Static ReadonlyVALID_Valid bar resolutions accepted by the API.
Create a new trading account.
The owner identity for the new account.
Create a new trading session.
The owner's b256 address.
The session creation request.
Fetch account information by owner address, contract, or trade account ID.
Lookup parameters (provide one of owner, ownerContract, or tradeAccountId).
Fetch all aggregated assets (CoinGecko-compatible).
Fetch aggregated order book (CoinGecko-compatible).
The market pair (e.g., "fFUEL_fUSDC").
Number of levels (default: 500).
Aggregation level (default: 2).
Fetch aggregated pair summaries (CoinGecko-compatible).
Fetch aggregated pair tickers (CoinGecko-compatible).
Fetch aggregated trades for a pair (CoinGecko-compatible).
The market pair (e.g., "fFUEL_fUSDC").
Fetch balance for a specific asset and account.
The asset ID.
Account lookup parameters.
Fetch OHLCV candlestick bars.
The market identifier.
Start time in milliseconds (not seconds).
End time in milliseconds (not seconds).
Bar resolution. Valid values:
1s, 1m, 2m, 3m, 5m, 15m, 30m,
1h, 2h, 4h, 6h, 8h, 12h,
1d, 3d, 1w, 1M, 3M.
Fetch the order book depth snapshot.
The market identifier.
Price aggregation precision (default: 10).
Optionallimit: numberMaximum number of price levels per side. undefined returns the full book.
Fetch all markets and global registry configuration.
Fetch 24-hour market summary statistics.
The market identifier.
Fetch real-time ticker data for a market.
The market identifier.
Fetch orders for an account on a specific market.
The market identifier.
The trade account contract ID.
Sort direction (default: "desc").
Number of orders to return (default: 20).
OptionalisOpen: booleanFilter by open/closed status.
OptionalstartTimestamp: numberOptionalstartOrderId: OrderIdFetch referral code information.
The referral code.
Fetch recent trades for a market.
The market identifier.
Sort direction (default: "desc").
Number of trades to return (default: 50).
OptionalstartTimestamp: numberOptional starting timestamp for pagination.
OptionalstartTradeId: stringOptional starting trade ID for pagination.
Optionalcontract: stringFetch trades for a specific account.
The market identifier.
The trade account contract ID.
Sort direction (default: "desc").
Number of trades to return (default: 50).
OptionalstartTimestamp: numberOptionalstartTradeId: stringMint test tokens to an address (testnet/devnet only).
The destination address.
O2Error if faucet is not available on this network.
Mint test tokens to a contract (testnet/devnet only).
The destination contract ID.
O2Error if faucet is not available on this network.
Submit session actions (create/cancel orders, settle balances).
The owner's b256 address.
The signed session actions request.
Preflight validation errors (e.g., invalid nonce, insufficient balance)
are returned as a SessionActionsResponse with
isPreflightError === true rather than thrown.
Whitelist a trading account.
The trade account contract ID.
Withdraw funds from a trading account.
The owner's b256 address.
The signed withdrawal request.
Low-level REST API client for the O2 Exchange.
Provides typed methods for every REST endpoint. Automatically retries on rate limit errors with exponential backoff and jitter.
Example