Docs / For agents / The SDK reference
The SDK reference.
Four calls: launch, trade, status, claim. Same rails as a human, through a scoped key.
The surface below is proposed and may change before release. There is no live endpoint. Every id and hash shown is a placeholder.
Scope Proposed developer surface.
Setup
import { Untoll } from "@untoll/sdk"
const untoll = new Untoll({ key: process.env.UNTOLL_SCOPED_KEY, chain: "testnet" })
const untoll = new Untoll({ key: process.env.UNTOLL_SCOPED_KEY, chain: "testnet" })
The key is a scoped, revocable session key, not a wallet private key. See Scoped keys for the allowlist model.
launch
launch(input: LaunchInput): Promise<Launched>
Opens a live pool with the hook attached at creation. Sole-minter curve, zero LP required.
| Param | Type | Notes |
|---|---|---|
| name | string | Display name. |
| ticker | string | Symbol. |
| curve | string | Proposed SDK field. The contract takes a graduation target and a curve supply. |
| metadata | object? | Optional off-chain image and links. |
| crew | address? | Blank means the creator. |
const t = await untoll.launch({ name: "Your Token", ticker: "TICKER", curve: "default" })
// Launched { id: "utl_…", poolId: "0x…", hook: "0x…", txHash: "0x…" }
// Launched { id: "utl_…", poolId: "0x…", hook: "0x…", txHash: "0x…" }
trade
trade(id: string, input: TradeInput): Promise<TradeResult>
Buys or sells against the pool. The toll (2.00% on the curve, 1.00% after) splits four ways on-chain as the trade settles.
| Param | Type | Notes |
|---|---|---|
| in | string? | Quote amount to spend. Provide in or out, not both. |
| out | string? | Token amount to receive. Open pool only. Exact output reverts while bonding. |
| slippageBps | number? | Max slippage in basis points. Defaults to a conservative value. |
| recipient | string? | Optional. Defaults to the key's bound account. |
const r = await untoll.trade(t.id, { in: "…", slippageBps: 100 })
// TradeResult { txHash: "0x…", filled: "…", price: "…", receipt: { creator, crew, buyback, protocol } }
// TradeResult { txHash: "0x…", filled: "…", price: "…", receipt: { creator, crew, buyback, protocol } }
status
status(id: string): Promise<Status>
Reads pool state. No key required for a read.
| Field | Type | Notes |
|---|---|---|
| phase | "bonding" | "graduated" | Which pricing mode the pool is in. |
| progress | number | Progress toward the open pool, 0 to 1, during bonding. |
| pool | object | The kept pool depth. Shown separate from the fee split. |
const s = await untoll.status(t.id)
// Status { phase: "bonding", progress: …, pool: { depth: "…" } }
// Status { phase: "bonding", progress: …, pool: { depth: "…" } }
claim
claim(input: ClaimInput): Promise<ClaimResult>
Settles accrued balances on-chain. The creator's cut accrues to the launcher on their token's volume. A settlement pays realized fees.
| Param | Type | Notes |
|---|---|---|
| bucket | "creator" | "crew" | Which accrued balance to settle. |
| token | string? | The token id. |
const c = await untoll.claim({ bucket: "creator", token: t.id })
// ClaimResult { txHash: "0x…", amount: "…", bucket: "creator" }
// ClaimResult { txHash: "0x…", amount: "…", bucket: "creator" }
Every id, hash, and figure above is a placeholder.