User (wallet)
Auto-generated reference for sdk.user.* HTTP methods (routes, auth, snippets).
← SDK API reference · Prefer Cookbook for common flows.
92 methods across 9 namespaces.
Setup
import { createBentoSdk, walletAuthProvider, jwtAuthProvider } from '@bento.fun/sdk';
const sdk = createBentoSdk({
baseUrl: process.env.BENTO_URL!,
apiKey: process.env.BENTO_BUILDER_API_KEY!,
auth: walletAuthProvider(() => ({ Authorization: `Bearer ${token}` })),
});sdk.user.bets
Namespace sdk.user.bets, 10 method(s). Example:
await sdk.user.bets.estimateBuy({ /* body */ });| Method | HTTP | Path | Auth |
|---|---|---|---|
estimateBuy | POST | /bento/user/bets/estimate-buy | Wallet |
estimatedWin | POST | /bento/user/bets/estimated-win | Wallet |
estimateSell | POST | /bento/user/bets/estimate-sell | Wallet |
getParentYesPercentageSnapshots | GET | /bento/user/bets/yes-percentage-snapshots/parent/:parentMarketId | Wallet |
getSellUnlockLiquidity | GET | /bento/user/bets/sell-unlock-liquidity/:duelId | Wallet |
getUserBetLimit | GET | /bento/user/bets/user-bet-limit/:address | Wallet |
getUserShares | GET | /bento/user/bets/user-shares/:duelId/:address | Wallet |
getYesPercentageSnapshots | GET | /bento/user/bets/yes-percentage-snapshots/:duelId | Wallet |
placeBet | POST | /bento/user/bets/create | Wallet |
sellBet | POST | /bento/user/bets/sell | Wallet |
Mutation snippets
POST /bento/user/bets/estimate-buy Immediate pricing-engine buy quote (wallet auth required).
sdk.user.bets.estimateBuy, POST /bento/user/bets/estimate-buy
await sdk.user.bets.estimateBuy({ /* body */ });sdk.user.bets.estimatedWin, POST /bento/user/bets/estimated-win
await sdk.user.bets.estimatedWin({ /* body */ });POST /bento/user/bets/estimate-sell
sdk.user.bets.estimateSell, POST /bento/user/bets/estimate-sell
await sdk.user.bets.estimateSell({ /* body */ });Client-side guards that mirror the frontend/chatbot betting path, so the two failure modes that return an opaque backend 500 are caught before the request: - an empty bet option label, and - a below-minimum amount (the platform floor is 5 units per option; estimateBuy does NOT enforce it, only placement does — which is why a sub-5 bet prices fine then 500s at placement). The amount check only runs when tokenDecimals is known (needed to convert base units to whole units) so it can never false-positive.
sdk.user.bets.placeBet, POST /bento/user/bets/create
await sdk.user.bets.placeBet({ /* body */ });POST /bento/user/bets/sell — accepted / eventual only.
sdk.user.bets.sellBet, POST /bento/user/bets/sell
await sdk.user.bets.sellBet({ /* body */ });sdk.user.duelInvitations
Namespace sdk.user.duelInvitations, 12 method(s). Example:
await sdk.user.duelInvitations.addMember({ /* body */ });| Method | HTTP | Path | Auth |
|---|---|---|---|
addMember | POST | /bento/user/duel-invitations/add-member | Wallet |
checkMembership | GET | /bento/user/duel-invitations/membership/:param/:param | Wallet |
create | POST | /bento/user/duel-invitations/create | Wallet |
getByInviteCode | GET | /bento/user/duel-invitations/:param | Wallet |
join | POST | /bento/user/duel-invitations/join | Wallet |
listForDuel | GET | /bento/user/duel-invitations/duel/:param | Wallet |
listMemberships | GET | /bento/user/duel-invitations/memberships/:param | Wallet |
removeMember | POST | /bento/user/duel-invitations/remove-member | Wallet |
revoke | POST | /bento/user/duel-invitations/revoke | Wallet |
syncJoinSuccess | POST | /bento/user/duel-invitations/sync-join-success | Wallet |
userJoin | POST | /bento/user/duel-invitations/user-join | Wallet |
validateInvite | POST | /bento/user/duel-invitations/validate-invite | Wallet |
Mutation snippets
sdk.user.duelInvitations.addMember, POST /bento/user/duel-invitations/add-member
await sdk.user.duelInvitations.addMember({ /* body */ });sdk.user.duelInvitations.create, POST /bento/user/duel-invitations/create
await sdk.user.duelInvitations.create({ /* body */ });sdk.user.duelInvitations.join, POST /bento/user/duel-invitations/join
await sdk.user.duelInvitations.join({ /* body */ });sdk.user.duelInvitations.removeMember, POST /bento/user/duel-invitations/remove-member
await sdk.user.duelInvitations.removeMember({ /* body */ });sdk.user.duelInvitations.revoke, POST /bento/user/duel-invitations/revoke
await sdk.user.duelInvitations.revoke({ /* body */ });sdk.user.duelInvitations.syncJoinSuccess, POST /bento/user/duel-invitations/sync-join-success
await sdk.user.duelInvitations.syncJoinSuccess({ /* body */ });sdk.user.duelInvitations.userJoin, POST /bento/user/duel-invitations/user-join
await sdk.user.duelInvitations.userJoin({ /* body */ });sdk.user.duelInvitations.validateInvite, POST /bento/user/duel-invitations/validate-invite
await sdk.user.duelInvitations.validateInvite({ /* body */ });sdk.user.duels
Namespace sdk.user.duels, 8 method(s). Example:
await sdk.user.duels.createDuel({ /* body */ });| Method | HTTP | Path | Auth |
|---|---|---|---|
createDuel | POST | /bento/user/duels/create | Wallet |
finalizeContest | POST | /bento/user/duels/finalize-contest | Wallet |
getContests | GET | /bento/user/duels/contest/:param | Wallet |
getCreatorContests | GET | /bento/user/duels/:param/contests | Wallet |
getMyContest | GET | /bento/user/duels/contest/:param/my-contest | Wallet |
getParticipants | GET | /bento/user/duels/participants/:param | Wallet |
resolve | POST | /bento/user/duels/resolve | Wallet |
submitContest | POST | /bento/user/duels/contest | Wallet |
Mutation snippets
POST /bento/user/duels/create Submits on-chain market creation. HTTP 201 returns duelId + txHash but full catalog visibility is still eventual — poll PublicClient.getDuelById.
sdk.user.duels.createDuel, POST /bento/user/duels/create
await sdk.user.duels.createDuel({ /* body */ });sdk.user.duels.finalizeContest, POST /bento/user/duels/finalize-contest
await sdk.user.duels.finalizeContest({ /* body */ });sdk.user.duels.resolve, POST /bento/user/duels/resolve
await sdk.user.duels.resolve({ /* body */ });sdk.user.duels.submitContest, POST /bento/user/duels/contest
await sdk.user.duels.submitContest({ /* body */ });sdk.user.packs
Namespace sdk.user.packs, 11 method(s). Example:
await sdk.user.packs.addMarket({ /* body */ });| Method | HTTP | Path | Auth |
|---|---|---|---|
addMarket | POST | /bento/packs/creator/packs/:param/markets | Wallet |
createPack | POST | /bento/packs/creator/packs | Wallet |
enter | POST | /bento/packs/:param/enter | Wallet |
estimatePick | POST | /bento/packs/:param/picks/estimate | Wallet |
getMyEntry | GET | /bento/packs/:param/me | Wallet |
getPayoutProof | GET | /bento/packs/:param/payout-proof | Wallet |
getPayoutSummary | GET | /bento/packs/:param/payout-summary | Wallet |
getRefundProof | GET | /bento/packs/:param/refund-proof | Wallet |
getRefundSummary | GET | /bento/packs/:param/refund-summary | Wallet |
placePick | POST | /bento/packs/:param/picks | Wallet |
publish | POST | /bento/packs/creator/packs/:param/publish | Wallet |
Mutation snippets
sdk.user.packs.addMarket, POST /bento/packs/creator/packs/:param/markets
await sdk.user.packs.addMarket({ /* body */ });sdk.user.packs.createPack, POST /bento/packs/creator/packs
await sdk.user.packs.createPack({ /* body */ });sdk.user.packs.enter, POST /bento/packs/:param/enter
await sdk.user.packs.enter({ /* body */ });sdk.user.packs.estimatePick, POST /bento/packs/:param/picks/estimate
await sdk.user.packs.estimatePick({ /* body */ });sdk.user.packs.placePick, POST /bento/packs/:param/picks
await sdk.user.packs.placePick({ /* body */ });sdk.user.packs.publish, POST /bento/packs/creator/packs/:param/publish
await sdk.user.packs.publish({ /* body */ });sdk.user.parentMarkets
Namespace sdk.user.parentMarkets, 9 method(s). Example:
await sdk.user.parentMarkets.addChildDuel({ /* body */ });| Method | HTTP | Path | Auth |
|---|---|---|---|
addChildDuel | POST | /bento/user/parent-markets/:param/add-duel | Wallet |
createInvitation | POST | /bento/user/parent-markets/create-invitation | Wallet |
createParentMarket | POST | /bento/user/parent-markets/create | Wallet |
getById | GET | /bento/user/parent-markets/:param | Wallet |
join | POST | /bento/user/parent-markets/join | Wallet |
listAccessible | GET | /bento/user/parent-markets/accessible | Wallet |
listInvitations | GET | /bento/user/parent-markets/:param/invitations | Wallet |
listMembers | GET | /bento/user/parent-markets/:param/members | Wallet |
validateInvite | POST | /bento/user/parent-markets/validate-invite | Wallet |
Mutation snippets
sdk.user.parentMarkets.addChildDuel, POST /bento/user/parent-markets/:param/add-duel
await sdk.user.parentMarkets.addChildDuel({ /* body */ });sdk.user.parentMarkets.createInvitation, POST /bento/user/parent-markets/create-invitation
await sdk.user.parentMarkets.createInvitation({ /* body */ });sdk.user.parentMarkets.createParentMarket, POST /bento/user/parent-markets/create
await sdk.user.parentMarkets.createParentMarket({ /* body */ });sdk.user.parentMarkets.join, POST /bento/user/parent-markets/join
await sdk.user.parentMarkets.join({ /* body */ });sdk.user.parentMarkets.validateInvite, POST /bento/user/parent-markets/validate-invite
await sdk.user.parentMarkets.validateInvite({ /* body */ });sdk.user.polymarket
Namespace sdk.user.polymarket, 31 method(s). Example:
await sdk.user.polymarket.approveTrading({ /* body */ });| Method | HTTP | Path | Auth |
|---|---|---|---|
approveTrading | POST | /bento/user/polymarket/approve-trading | Wallet |
cancelAll | DELETE | /bento/user/polymarket/cancel-all | Wallet |
cancelOrder | DELETE | /bento/user/polymarket/cancel-order/:param | Wallet |
deploySafe | POST | /bento/user/polymarket/deploy-safe | Wallet |
deployWallet | POST | /bento/user/polymarket/deploy-wallet | Wallet |
deposit | POST | /bento/user/polymarket/deposit | Wallet |
deriveCredentials | POST | /bento/user/polymarket/derive-credentials | Wallet |
getApprovalStatus | GET | /bento/user/polymarket/approval-status | Wallet |
getAuthStatus | GET | /bento/user/polymarket/auth-status | Wallet |
getBalance | GET | /bento/user/polymarket/balance | Wallet |
getCardPrices | POST | /bento/user/polymarket/discovery/card-prices | Wallet |
getDepositStatus | GET | /bento/user/polymarket/deposit-status/:param | Wallet |
getEventsByTags | GET | /bento/user/polymarket/discovery/events-by-tags | Wallet |
getLiveScores | GET | /bento/user/polymarket/discovery/live-scores | Wallet |
getOrders | GET | /bento/user/polymarket/orders | Wallet |
getPolygonBalances | GET | /bento/user/polymarket/polygon-balances | Wallet |
getPositions | GET | /bento/user/polymarket/positions | Wallet |
getRelayerTx | GET | /bento/user/polymarket/relayer-tx/:param | Wallet |
getSafeStatus | GET | /bento/user/polymarket/safe-status | Wallet |
getSportsMap | GET | /bento/user/polymarket/discovery/sports-map | Wallet |
getTickSize | GET | /bento/user/polymarket/tick-size | Wallet |
getTrades | GET | /bento/user/polymarket/trades | Wallet |
getWalletStatus | GET | /bento/user/polymarket/wallet-status | Wallet |
placeOrder | POST | /bento/user/polymarket/place-order | Wallet |
publicSearch | GET | /bento/user/polymarket/discovery/public-search | Wallet |
recoverFunds | POST | /bento/user/polymarket/recover-funds | Wallet |
redeem | POST | /bento/user/polymarket/redeem | Wallet |
refreshCredentials | POST | /bento/user/polymarket/refresh-credentials | Wallet |
withdraw | POST | /bento/user/polymarket/withdraw | Wallet |
withdrawClob | POST | /bento/user/polymarket/withdraw-clob | Wallet |
wrapLegacyCollateral | POST | /bento/user/polymarket/wrap-legacy-collateral | Wallet |
Mutation snippets
sdk.user.polymarket.approveTrading, POST /bento/user/polymarket/approve-trading
await sdk.user.polymarket.approveTrading({ /* body */ });sdk.user.polymarket.cancelAll, DELETE /bento/user/polymarket/cancel-all
await sdk.user.polymarket.cancelAll({ /* body */ });sdk.user.polymarket.cancelOrder, DELETE /bento/user/polymarket/cancel-order/:param
await sdk.user.polymarket.cancelOrder({ /* body */ });sdk.user.polymarket.deploySafe, POST /bento/user/polymarket/deploy-safe
await sdk.user.polymarket.deploySafe({ /* body */ });sdk.user.polymarket.deployWallet, POST /bento/user/polymarket/deploy-wallet
await sdk.user.polymarket.deployWallet({ /* body */ });sdk.user.polymarket.deposit, POST /bento/user/polymarket/deposit
await sdk.user.polymarket.deposit({ /* body */ });sdk.user.polymarket.deriveCredentials, POST /bento/user/polymarket/derive-credentials
await sdk.user.polymarket.deriveCredentials({ /* body */ });sdk.user.polymarket.getCardPrices, POST /bento/user/polymarket/discovery/card-prices
await sdk.user.polymarket.getCardPrices({ /* body */ });sdk.user.polymarket.placeOrder, POST /bento/user/polymarket/place-order
await sdk.user.polymarket.placeOrder({ /* body */ });sdk.user.polymarket.recoverFunds, POST /bento/user/polymarket/recover-funds
await sdk.user.polymarket.recoverFunds({ /* body */ });sdk.user.polymarket.redeem, POST /bento/user/polymarket/redeem
await sdk.user.polymarket.redeem({ /* body */ });sdk.user.polymarket.refreshCredentials, POST /bento/user/polymarket/refresh-credentials
await sdk.user.polymarket.refreshCredentials({ /* body */ });+ 3 more mutations in table above.
sdk.user.portfolio
Namespace sdk.user.portfolio, 6 method(s). Example:
await sdk.user.portfolio.getAccountDetails({ /* body */ });| Method | HTTP | Path | Auth |
|---|---|---|---|
getAccountDetails | POST | /bento/user/portfolio/accountDetails | Wallet |
getDuels | POST | /bento/user/portfolio/duels | Wallet |
getDuelsTable | POST | /bento/user/portfolio/table/duels | Wallet |
getHistoryTable | POST | /bento/user/portfolio/table/history | Wallet |
getPnlChart | POST | /bento/user/portfolio/pnl-chart | Wallet |
getPositions | GET | /bento/user/portfolio/positions/:param | Wallet |
Mutation snippets
sdk.user.portfolio.getAccountDetails, POST /bento/user/portfolio/accountDetails
await sdk.user.portfolio.getAccountDetails({ /* body */ });sdk.user.portfolio.getDuels, POST /bento/user/portfolio/duels
await sdk.user.portfolio.getDuels({ /* body */ });sdk.user.portfolio.getDuelsTable, POST /bento/user/portfolio/table/duels
await sdk.user.portfolio.getDuelsTable({ /* body */ });sdk.user.portfolio.getHistoryTable, POST /bento/user/portfolio/table/history
await sdk.user.portfolio.getHistoryTable({ /* body */ });sdk.user.portfolio.getPnlChart, POST /bento/user/portfolio/pnl-chart
await sdk.user.portfolio.getPnlChart({ /* body */ });sdk.user.referralAnalytics
Namespace sdk.user.referralAnalytics, 1 method(s). Example:
await sdk.user.referralAnalytics.getMine(/* args */);| Method | HTTP | Path | Auth |
|---|---|---|---|
getMine | GET | /bento/user/referral-analytics | Wallet |
sdk.user.withdraw
Namespace sdk.user.withdraw, 4 method(s). Example:
await sdk.user.withdraw.claimFees({ /* body */ });| Method | HTTP | Path | Auth |
|---|---|---|---|
claimFees | POST | /bento/user/withdraw/claim-fees | Wallet |
claimWinnings | POST | /bento/user/withdraw/claim-winnings | Wallet |
getCreatorFees | GET | /bento/user/withdraw/creator-fees | Wallet |
withdraw | POST | /bento/user/withdraw | Wallet |
Mutation snippets
sdk.user.withdraw.claimFees, POST /bento/user/withdraw/claim-fees
await sdk.user.withdraw.claimFees({ /* body */ });sdk.user.withdraw.claimWinnings, POST /bento/user/withdraw/claim-winnings
await sdk.user.withdraw.claimWinnings({ /* body */ });sdk.user.withdraw.withdraw, POST /bento/user/withdraw
await sdk.user.withdraw.withdraw({ /* body */ });