Manage funds
A seller's funds live on-chain in a treasury slot, keyed by sellerId. Earnings from completed exchanges land here automatically. Deposits and withdrawals are explicit calls.
For the conceptual model, see Funds, escrow & payouts.
SDK
// Read balance — getFunds takes a subgraph query-variables object.
const funds = await sdk.getFunds({ fundsFilter: { accountId: sellerId } })
// → [{ availableAmount, token: { address, decimals, symbol, name } }, …]
// Deposit (used for offers with sellerDeposit > 0, or to pre-fund a treasury)
await (await sdk.depositFunds(sellerId, tokenAddress, amount)).wait()
// Withdraw
await (await sdk.withdrawFunds(sellerId, [tokenAddress], [amount])).wait()Voiding an offer
Sellers can void an offer at any time before it expires. Voiding stops new commits but doesn't affect existing exchanges.
SDK
await (await sdk.voidOffer(offerId)).wait()For non-listed (private / EIP-712) offers, use void_non_listed_offer or void_non_listed_offer_batch — see Reference → MCP tools.
Common gotchas
- Withdrawals are not gas-free. Plan to withdraw less frequently than you complete exchanges to amortize gas.
- Per-token withdrawals. Each
withdrawFundscall takes a list of token addresses + amounts. Batch them. getFundsreturns available amounts only. Funds locked in active escrow (aCOMMITTEDexchange) are not included.