Forkast Developer Docs
...
Account
Approve Trading Credits
2 min
signs a gnosis safe multisend transaction that approves the trading credits (tc) token and conditional tokens for trading it returns a tokenapprovalresponse containing the signature and transaction payload to submit, or undefined if approval is already sufficient import { forkastsdk, network } from "@forkastgg/client"; import { wallet } from "ethers"; const sdk = new forkastsdk(network mainnet, "your api key"); const accountservice = sdk getaccountservice(); const signer = new wallet("your private key"); const approval = await accountservice approvemaxplatformcreditsforproxywallet( signer, "your proxy wallet address", 10 000 000 // optional buyamount ); if (!approval) { console log("already approved"); } else { console log("signature ", approval signature); console log("payload ", approval datasign); } parameters field type required description signer string yes public address of the wallet walletproxyaddress string yes trading wallet address created buyamount number no amount of tokens to approve the signer must be the owner wallet of the proxy, and should have a provider attached (the sdk will attach one if missing) use the returned tokenapprovalresponse payload in your transaction submission flow buyamount is optional if omitted, the sdk uses max buy amount = 10 000 000 and approves the maximum amount