Forkast Developer Docs
...
Account
Redeem Positions By Markets
2 min
redeems winning positions across one or more markets using a single multisend transaction import { forkastsdk, network, marketstatus } from "@forkastgg/client"; const sdk = new forkastsdk(network testnet, "your api key"); const accountservice = sdk getaccountservice(); const { accesstoken } = await accountservice loginwithprivatekey("your private key"); const positions = await accountservice getpositions( accesstoken, 1, 10, marketstatus resolved ); const redeemdata = (positions results || \[]) slice(0, 10) map((p any) => ({ marketid p marketid, resolvedaddress p resolvedaddress, questionid p questionid, outcometype p outcometype, // 1 = yes, 0 = no })); if (redeemdata length === 0) { console log("no redeemable positions"); } else { const redeemresponse = await accountservice redeemallpositions( accesstoken, redeemdata, "your proxy wallet address", "your private key" ); } parameters field type required description accesstoken string yes token from login response redeemdata iredeemdata\[] yes array of iredeemdata type proxywallet string yes proxy wallet address privatekey marketstatus yes owner private key redeemdata length must be between 1 and 10