BentoSDK

Introduction

Build prediction markets, tournaments, and more on Bento with the TypeScript SDK.

Bento is an on-chain prediction-markets platform. People bet on real-world outcomes, join tournaments, open packs, and create their own markets, all settled on-chain.

@bento.fun/sdk is the TypeScript SDK for apps, bots, agents, and servers.

Start here

  1. Quickstart — zero → first bet on testnet (one script)
  2. Cookbook — the ~15 methods most apps need
  3. Common patternsduelId, wei, errors, auth pitfalls

What you can build

  • Trade & bet — browse markets, quote, place bets
  • Create markets — public or private (invite-gated)
  • Tournaments — enter brackets and stake match chips
  • Sports data — Sportmonks fixtures/scores via the rate-limited tournaments proxy

The model in 60 seconds

  1. Reads are open; actions need login. Catalog needs no user JWT. Betting / creating needs a Builder API key + a user JWT from a signed login.
  2. You sign with your wallet, trade through a managed account. Funds live on a different address than your signing key.
  3. Amounts are wei. Stakes are base units (18 decimals on BSC / credits).

Install

npm install @bento.fun/sdk

Node.js 18+. Then Quickstart.

Building with an AI agent?

Copy-paste this into the agent, then point it at the live docs:

You are integrating @bento.fun/sdk on Bento testnet.

1. Fetch https://docs.bento.fun/llms.txt and follow only these pages in order:
   - /quickstart (golden path — do not invent a different login/bet flow)
   - /reference/cookbook
   - /reference/common-patterns
2. Rules you must not violate:
   - createBentoSdk always needs apiKey (Builder key) + auth provider
   - Markets user calls need Authorization: Bearer <JWT> from eoaLogin/eoaRegister
   - Use duelId (never list row id) for getDuelById / bets
   - Amounts are wei (18 decimals on BSC/credits); min bet is 5 units
   - Prefer placeBetFromEstimate over hand-built placeBet
   - Fund the managed account address from login (not the EOA) via `sdk.public.faucet.mint` on testnet
3. Prefer /quickstart.md or /llms-full.txt for plain markdown if HTML is noisy.

Full dump: /llms-full.txt. Per-page markdown: append .md to any docs URL (e.g. /quickstart.md).

On this page