Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Deposit outcome tokens and manage Polymarket vault withdrawals
setApprovalForAll
const conditionId = "0x..."; // Market condition ID const tokenId = 123456789n; // Outcome token ID const amount = 100; // Amount to deposit const isNegRisk = false; // Whether the market is negative risk const tx = await sdk.depositPolymarketToken(conditionId, tokenId, amount, isNegRisk); console.log("Deposit transaction:", tx);
const amountToWithdraw = 50; const txRequest = await sdk.requestPolymarketWithdrawal(tokenId, amountToWithdraw); console.log("Withdrawal requested:", txRequest);
// 1. Find approved withdrawal requests const transactions = await sdk.getTransactions({ type: "withdraw", status: "approved" }); // 2. Claim them for (const tx of transactions.data) { if (tx.platform === "polymarket") { console.log(`Claiming withdrawal for ${tx.amount} (Request ID: ${tx.requestId})...`); const txClaim = await sdk.claimPolymarketWithdrawal(BigInt(tx.requestId!)); console.log("Withdrawal claimed:", txClaim); } }