BentoSDK
SDK API reference

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 */);
MethodHTTPPathAuth
getPlatformReportGET/bento/analytics/platformPublic

sdk.public.auth

Namespace sdk.public.auth, 8 method(s). Example:

await sdk.public.auth.auth0Login({ /* body */ });
MethodHTTPPathAuth
auth0LoginPOST/bento/user/auth/auth0/loginPublic*
auth0RegisterPOST/bento/user/auth/auth0/registerPublic*
checkUsernameGET/bento/user/auth/check-usernamePublic
eoaChallengePOST/bento/user/auth/eoa/challengePublic*
eoaLoginPOST/bento/user/auth/eoa/loginPublic*
eoaRegisterPOST/bento/user/auth/eoa/registerPublic*
loginOrRegisterPOST/bento/user/auth/eoa/challengePublic*
uploadProfileImagePOST/bento/user/auth/profile-imagePublic*

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 */);
MethodHTTPPathAuth
getByIdGET/bento/public/duels/get-duel-by-id/:duelIdPublic
getContestsGET/bento/user/duels/contest/:duelIdPublic
listGET/bento/public/duels/allPublic

sdk.public.faucet

Namespace sdk.public.faucet, 1 method(s). Example:

await sdk.public.faucet.mint({ /* body */ });
MethodHTTPPathAuth
mintPOST/bento/auto-mint/mintPublic*

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 */);
MethodHTTPPathAuth
getCreatorsCountGET/bento/leaderboard/creators/countPublic
getCreatorsPnlGET/bento/leaderboard/creators/pnlPublic
getGlobalAggregateGET/bento/leaderboard/global-aggregatePublic
getParticipantsChartGET/bento/leaderboard/chart/participantsPublic
getTradersPnlGET/bento/leaderboard/traders/pnlPublic
getVolumeChartGET/bento/leaderboard/chart/volumePublic
listCreatorsGET/bento/leaderboard/creatorsPublic
listTradersGET/bento/leaderboard/tradersPublic

sdk.public.packs

Namespace sdk.public.packs, 8 method(s). Example:

await sdk.public.packs.getById(/* args */);
MethodHTTPPathAuth
getByIdGET/bento/packs/:paramPublic
getLeaderboardGET/bento/packs/:param/leaderboardPublic
getPayoutProofGET/bento/packs/:param/payout-proofPublic
getPayoutSummaryGET/bento/packs/:param/payout-summaryPublic
getPriceHistoryGET/bento/packs/:param/price-history-snapshotsPublic
getRefundProofGET/bento/packs/:param/refund-proofPublic
getRefundSummaryGET/bento/packs/:param/refund-summaryPublic
listGET/bento/packsPublic

sdk.public.parentMarkets

Namespace sdk.public.parentMarkets, 4 method(s). Example:

await sdk.public.parentMarkets.getById(/* args */);
MethodHTTPPathAuth
getByIdGET/bento/user/parent-markets/:paramPublic
listAccessibleGET/bento/user/parent-markets/accessiblePublic
listMembersGET/bento/user/parent-markets/:param/membersPublic
validateInvitePOST/bento/user/parent-markets/validate-invitePublic*

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 */);
MethodHTTPPathAuth
getStatsGET/bento/protocol-statsPublic
getSummaryGET/bento/protocol-stats/summaryPublic
refreshPOST/bento/protocol-stats/refreshPublic*

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 */ });
MethodHTTPPathAuth
estimatedWinPOST/bento/public/bets/estimated-winPublic*
estimateSellPOST/bento/public/bets/estimate-sellPublic*
getSellUnlockLiquidityGET/bento/public/bets/sell-unlock-liquidity/:paramPublic
getYesPercentageSnapshotsGET/bento/public/bets/yes-percentage-snapshots/:paramPublic

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 */ });
MethodHTTPPathAuth
createPOST/bento/user/withdrawal-requestsPublic*
getDailyLimitGET/bento/user/withdrawal-requests/daily-limitPublic
listGET/bento/user/withdrawal-requestsPublic
preValidatePOST/bento/user/withdrawal-requests/pre-validatePublic*

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 */ });

On this page