Map the SDK surface
The SDK mirrors the public contract with grouped helpers. This page focuses on the methods that exist today, the exact parameter shapes they expect, and where they map into the public API.
Initialize one signed client per integration
The main export is OttoWalletSDK, also re-exported asOttoSDK. Both share the same HMAC request-signing logic.
new OttoSDK(config)| Name | Type | Required | Description |
|---|---|---|---|
| apiKey | string | Yes | Workspace-issued public API key. |
| secretKey | string | Yes | Private signing secret. Keep it server-side only. |
| basePath | BasePath | string | No | Defaults to BasePath.prod. Available presets: prod, sandbox, local. |
otto.vaults.list({ page?: number, pageSize?: number })vaults
Use this group to create vault roots and list vault inventory available to the active integration.
otto.vaults| Name | Input | HTTP mapping | Description |
|---|---|---|---|
| create | { name: string } | POST /vault/create | Create a vault boundary. |
| list | { page?: number, pageSize?: number } | GET /dash/vaults/list | Fetch paginated vault inventory. |
wallets
The wallet group concentrates the most common app-facing calls: generate address, list wallets, fetch balances, preview transfers, and send transactions.
otto.wallets| Name | Input | HTTP mapping | Description |
|---|---|---|---|
| create | { network, vault_id, name? } | POST /wallet/generate-address-hd | Generate a managed address under a vault. |
| list | { page?, pageSize?, filters? } | GET /dash/wallets/list | List wallets with vault, chain, and address filters. |
| getBalance | { network, address } | POST /wallet/get-balance | Fetch on-chain or indexed balance data. |
| generateAddressHD | { network, vault_id, name? } | POST /wallet/generate-address-hd | Alias for explicit HD generation. |
| previewTransfer | { from, to, amount, tokenAddress? } | POST /wallet/transfer-preview | Preview fee and readiness before sending. |
| sendTransaction | { network, from, to, amount, tokenAddress? } | POST /wallet/send-transaction | Submit a signed transaction request. |
Wallet list filters
{
page?: number,
pageSize?: number,
filters?: {
vault?: string,
networks?: string[],
address?: string
}
}otto.wallets.getBalance({ network, address })otto.wallets.previewTransfer({ from, to, amount, tokenAddress? })otto.wallets.sendTransaction({ network, from, to, amount, tokenAddress? })transactions
Transaction helpers are retrieval-oriented and are designed to complement execution flows with reporting and activity history.
otto.transactions| Name | Input | HTTP mapping | Description |
|---|---|---|---|
| list | { page?: number, limit?: number } | GET /transaction/list | Paginated transaction feed. |
| getMetrics | { from?: string } | GET /transaction/metrics | Aggregate transaction metrics from an optional date. |
| getVolumeHistory | { from?: string } | GET /transaction/volume-history | Monthly or periodic volume history. |
otto.transactions.getMetrics({ from?: string })otto.transactions.getVolumeHistory({ from?: string })gasStation
This group exposes the public operational helpers for refill, inventory, targeting, and processing of gas station workflows.
otto.gasStation| Name | Input | HTTP mapping | Description |
|---|---|---|---|
| create | Record<string, unknown> | POST /gas-station/create | Create a gas station configuration. |
| list | none | GET /gas-station/list | List configured gas stations. |
| get | id: string | GET /gas-station/:id | Fetch one gas station. |
| getAvailableNetworks | none | GET /gas-station/available-networks | List supported sponsor networks. |
| getLowBalance | { threshold?: number } | GET /gas-station/low-balance | Return wallets below threshold. |
| refill | { walletAddress, amount?, purpose? } | POST /gas-station/refill | Queue a refill request. |
| process | none | POST /gas-station/process | Trigger processing of refill work. |
Targeting helpers
addVault/removeVaultexpectid: string, vaultId: string.includeWallet/excludeWalletexpectid: string, walletId: string.addTarget/removeTargetalso useid: string, walletId: string.
mpc
The MPC group stays focused on wallet and session operations instead of dashboard administration. That keeps the public package narrow while still enabling signer coordination flows.
otto.mpcWallet methods
| Name | Input | HTTP mapping | Description |
|---|---|---|---|
| listWallets | none | GET /mpc-security/wallets | List MPC wallets. |
| getWalletById | walletId: string | GET /mpc-security/wallets/:walletId | Fetch one MPC wallet. |
| createWallet | { networkId, name?, threshold, participants } | POST /mpc-security/wallets | Create a threshold wallet. |
Session methods
| Name | Input | HTTP mapping | Description |
|---|---|---|---|
| listSessions | none | GET /mpc-security/sessions | List signing sessions. |
| createSession | { walletId, networkId, to, amount, assetSymbol, assetAddress? } | POST /mpc-security/sessions | Create a signing session for one transfer. |
| startSession | sessionId: string | POST /mpc-security/sessions/:sessionId/start | Start the orchestrated signing flow. |
| signSession | sessionId: string, { participantId } | POST /mpc-security/sessions/:sessionId/sign | Submit one signer approval. |
| listParticipants | none | GET /mpc-security/participants | List signer candidates. |
Participant types
'USER' | 'DEVICE' | 'SERVER' | 'BACKUP' | 'EXTERNAL'
participantId. That is workable today, but it is also a good candidate for future hardening.Errors
SDK errors still reflect the underlying HTTP contract. In practice, treat network, authentication, permission, business validation, and transient failures as separate categories.
401: wrong API key or bad signature source data.403: policy or assignment denied the action.400/422: invalid payload or business rule violation.404: resource id does not exist in the current scope.5xx: retry only from safe backend workers.
waas alias
The SDK still ships a compatibility alias for older vault and wallet integrations so teams can migrate incrementally instead of rewriting all call sites at once.
otto.waas.vaults.create(...) otto.waas.wallets.create(...) otto.waas.wallets.list(...) otto.waas.wallets.previewTransfer(...) otto.waas.wallets.createTransaction(...)