Actions API

Build ready-to-sign transaction bundles for any Baseline action over plain HTTP.

Base URL: https://api.baseline.markets

The actions API turns any Baseline protocol action — launch a token, buy, sell, stake (deposit / withdraw / claim), borrow, repay — into a wallet_sendCalls-compatible (ERC-5792) transaction bundle over plain HTTP. It is the fastest way to integrate Baseline into a frontend: no SDK dependency, no contract knowledge, no quote or approval logic on your side.

The API prepares and validates; your user's wallet signs and pays. It never holds keys, signs, or submits transactions.

Discovery

GET /v1/actions (no auth) returns an OpenAPI 3.1 spec describing every endpoint, with request schemas generated from the same validators that guard the routes, and the live per-chain approved-reserve registry under x-baseline-chains. Also served at /v1/actions/openapi.json.

Integrating a frontend

Three steps, all stateless:

1. Authenticate (SIWE)

GET  /v1/auth/nonce                     → { nonce }
POST /v1/auth/verify                    → { token, address, expiresAt }
     { message, signature }

Build an EIP-4361 message with the nonce, have the wallet sign it (personal_sign), and exchange it for a JWT. Send the JWT as Authorization: Bearer <jwt> afterwards.

2. Build the calls

POST /v1/actions/build
{
  "type": "buy",
  "chainId": 8453,
  "bToken": "0x…",
  "exactSide": "in",
  "amount": "0.5",
  "slippagePct": "1"
}

The config is a discriminated union on type: launch, buy, sell, deposit, withdraw, claim, borrow, repay. Amounts are human-unit decimal strings — BToken amounts in whole tokens (18 decimals), reserve amounts in whole reserve units.

The response is an executable artifact:

{
  "artifact": {
    "type": "buy",
    "chainId": 8453,
    "account": "0x…",
    "calls": [
      { "to": "0x…", "data": "0x…" },
      { "to": "0x…", "data": "0x…" }
    ],
    "summary": {
      "exactSide": "in",
      "exactAmount": "500000000000000000",
      "quotedAmount": "1000000000000000000000",
      "limitAmount": "990000000000000000000"
    },
    "quotedAt": "2026-07-08T00:00:00.000Z"
  }
}
  • Trades are quoted on-chain at build time; the swap's limit is derived from slippagePct.
  • Required ERC-20 approvals are prepended to calls, so the bundle executes as-is — no separate approval step in your UI.
  • Launch artifacts include the precomputed bToken address, known before anything is signed.
  • summary carries the raw parsed amounts for your review screen.
  • Quotes go stale: rebuild the artifact if meaningful time passes between build and signing (quotedAt tells you when state was read).

3. Execute

Send artifact.calls in order from the authenticated wallet — wallet_sendCalls (EIP-5792) as one bundle, or sequential eth_sendTransaction. Every call must succeed. Simulate client-side before signing for pre-flight protection.

Nothing is persisted server-side; there is no record to manage.

Reads

The actions API constructs transactions only. For token lists, prices, balances, and pool state, use the GraphQL API at /graphql and the REST read endpoints.