Public
Auto-generated reference for sdk.public.* HTTP methods (routes, auth, snippets).
← SDK API reference · Prefer Cookbook for common flows.
44 methods across 10 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!,
});sdk.public.analytics
Namespace sdk.public.analytics, 1 method(s). Example:
await sdk.public.analytics.getPlatformReport(/* args */);| Method | HTTP | Path | Auth |
|---|---|---|---|
getPlatformReport | GET | /bento/analytics/platform | Public |
sdk.public.auth
Namespace sdk.public.auth, 8 method(s). Example:
await sdk.public.auth.auth0Login({ /* body */ });| Method | HTTP | Path | Auth |
|---|---|---|---|
auth0Login | POST | /bento/user/auth/auth0/login | Public* |
auth0Register | POST | /bento/user/auth/auth0/register | Public* |
checkUsername | GET | /bento/user/auth/check-username | Public |
eoaChallenge | POST | /bento/user/auth/eoa/challenge | Public* |
eoaLogin | POST | /bento/user/auth/eoa/login | Public* |
eoaRegister | POST | /bento/user/auth/eoa/register | Public* |
loginOrRegister | POST | /bento/user/auth/eoa/challenge | Public* |
uploadProfileImage | POST | /bento/user/auth/profile-image | Public* |
Mutation snippets
First-party only — third-party builders must use EOA.
sdk.public.auth.auth0Login, POST /bento/user/auth/auth0/login
await sdk.public.auth.auth0Login({ /* body */ });First-party only — third-party builders must use EOA.
sdk.public.auth.auth0Register, POST /bento/user/auth/auth0/register
await sdk.public.auth.auth0Register({ /* body */ });Server-built SIWE message bound to this builder key + domain.
sdk.public.auth.eoaChallenge, POST /bento/user/auth/eoa/challenge
await sdk.public.auth.eoaChallenge({ /* body */ });sdk.public.auth.eoaLogin, POST /bento/user/auth/eoa/login
await sdk.public.auth.eoaLogin({ /* body */ });sdk.public.auth.eoaRegister, POST /bento/user/auth/eoa/register
await sdk.public.auth.eoaRegister({ /* body */ });One call: sign once, then log the wallet in or register it (with the same signature) if the backend has never seen it. Returns the JWT — pass it to sdk.withAuth(token). Provide username to allow registering a new wallet. Prefer eoaChallenge + explicit login/register when you need the first-party warning baked into the signed message.
sdk.public.auth.loginOrRegister, POST /bento/user/auth/eoa/challenge
await sdk.public.auth.loginOrRegister({ /* body */ });Multipart profile image upload (image field). Requires wallet auth.
sdk.public.auth.uploadProfileImage, POST /bento/user/auth/profile-image
await sdk.public.auth.uploadProfileImage({ /* body */ });sdk.public.duels
Namespace sdk.public.duels, 3 method(s). Example:
await sdk.public.duels.getById(/* args */);| Method | HTTP | Path | Auth |
|---|---|---|---|
getById | GET | /bento/public/duels/get-duel-by-id/:duelId | Public |
getContests | GET | /bento/user/duels/contest/:duelId | Public |
list | GET | /bento/public/duels/all | Public |
sdk.public.faucet
Namespace sdk.public.faucet, 1 method(s). Example:
await sdk.public.faucet.mint({ /* body */ });| Method | HTTP | Path | Auth |
|---|---|---|---|
mint | POST | /bento/auto-mint/mint | Public* |
Mutation snippets
Mint faucet funds to a wallet (testnet: 1000 USDC + 1000 Credits; mainnet: 1000 Credits, where enabled). Resolves with the mint result — including any usdc/credits txHashes — or throws if the backend reports the mint failed. Rate-limited to 5/min by the backend; a mainnet mint is 403 unless the host enables it, and an unconfigured faucet is 503 — both surface as thrown SDK errors from the HTTP layer.
sdk.public.faucet.mint, POST /bento/auto-mint/mint
await sdk.public.faucet.mint({ /* body */ });sdk.public.leaderboard
Namespace sdk.public.leaderboard, 8 method(s). Example:
await sdk.public.leaderboard.getCreatorsCount(/* args */);| Method | HTTP | Path | Auth |
|---|---|---|---|
getCreatorsCount | GET | /bento/leaderboard/creators/count | Public |
getCreatorsPnl | GET | /bento/leaderboard/creators/pnl | Public |
getGlobalAggregate | GET | /bento/leaderboard/global-aggregate | Public |
getParticipantsChart | GET | /bento/leaderboard/chart/participants | Public |
getTradersPnl | GET | /bento/leaderboard/traders/pnl | Public |
getVolumeChart | GET | /bento/leaderboard/chart/volume | Public |
listCreators | GET | /bento/leaderboard/creators | Public |
listTraders | GET | /bento/leaderboard/traders | Public |
sdk.public.packs
Namespace sdk.public.packs, 8 method(s). Example:
await sdk.public.packs.getById(/* args */);| Method | HTTP | Path | Auth |
|---|---|---|---|
getById | GET | /bento/packs/:param | Public |
getLeaderboard | GET | /bento/packs/:param/leaderboard | Public |
getPayoutProof | GET | /bento/packs/:param/payout-proof | Public |
getPayoutSummary | GET | /bento/packs/:param/payout-summary | Public |
getPriceHistory | GET | /bento/packs/:param/price-history-snapshots | Public |
getRefundProof | GET | /bento/packs/:param/refund-proof | Public |
getRefundSummary | GET | /bento/packs/:param/refund-summary | Public |
list | GET | /bento/packs | Public |
sdk.public.parentMarkets
Namespace sdk.public.parentMarkets, 4 method(s). Example:
await sdk.public.parentMarkets.getById(/* args */);| Method | HTTP | Path | Auth |
|---|---|---|---|
getById | GET | /bento/user/parent-markets/:param | Public |
listAccessible | GET | /bento/user/parent-markets/accessible | Public |
listMembers | GET | /bento/user/parent-markets/:param/members | Public |
validateInvite | POST | /bento/user/parent-markets/validate-invite | Public* |
Mutation snippets
sdk.public.parentMarkets.validateInvite, POST /bento/user/parent-markets/validate-invite
await sdk.public.parentMarkets.validateInvite({ /* body */ });sdk.public.protocolStats
Namespace sdk.public.protocolStats, 3 method(s). Example:
await sdk.public.protocolStats.getStats(/* args */);| Method | HTTP | Path | Auth |
|---|---|---|---|
getStats | GET | /bento/protocol-stats | Public |
getSummary | GET | /bento/protocol-stats/summary | Public |
refresh | POST | /bento/protocol-stats/refresh | Public* |
Mutation snippets
sdk.public.protocolStats.refresh, POST /bento/protocol-stats/refresh
await sdk.public.protocolStats.refresh({ /* body */ });sdk.public.publicBets
Namespace sdk.public.publicBets, 4 method(s). Example:
await sdk.public.publicBets.estimatedWin({ /* body */ });| Method | HTTP | Path | Auth |
|---|---|---|---|
estimatedWin | POST | /bento/public/bets/estimated-win | Public* |
estimateSell | POST | /bento/public/bets/estimate-sell | Public* |
getSellUnlockLiquidity | GET | /bento/public/bets/sell-unlock-liquidity/:param | Public |
getYesPercentageSnapshots | GET | /bento/public/bets/yes-percentage-snapshots/:param | Public |
Mutation snippets
sdk.public.publicBets.estimatedWin, POST /bento/public/bets/estimated-win
await sdk.public.publicBets.estimatedWin({ /* body */ });sdk.public.publicBets.estimateSell, POST /bento/public/bets/estimate-sell
await sdk.public.publicBets.estimateSell({ /* body */ });sdk.public.withdrawalRequests
Namespace sdk.public.withdrawalRequests, 4 method(s). Example:
await sdk.public.withdrawalRequests.create({ /* body */ });| Method | HTTP | Path | Auth |
|---|---|---|---|
create | POST | /bento/user/withdrawal-requests | Public* |
getDailyLimit | GET | /bento/user/withdrawal-requests/daily-limit | Public |
list | GET | /bento/user/withdrawal-requests | Public |
preValidate | POST | /bento/user/withdrawal-requests/pre-validate | Public* |
Mutation snippets
sdk.public.withdrawalRequests.create, POST /bento/user/withdrawal-requests
await sdk.public.withdrawalRequests.create({ /* body */ });sdk.public.withdrawalRequests.preValidate, POST /bento/user/withdrawal-requests/pre-validate
await sdk.public.withdrawalRequests.preValidate({ /* body */ });