SDK Reference
The Altana SDK is a TypeScript library for creating noncustodial agentic wallets, granting scoped sessions, and executing transactions onchain. It runs anywhere JavaScript runs, including servers, browsers, and agent runtimes, with no API key and no hosted backend.
npm install @altananetwork/sdk viemNew to the SDK? Start with Setup: BNB Smart Chain, Altana's default network, then follow Create an agentic wallet for the full walkthrough.
Wallets
| Function | What it does |
|---|---|
createWallet | Create a wallet from a private key signer and register it in the Keystore. |
createPasskeyWallet | Create a wallet whose admin key is a passkey (Face ID, Touch ID, Windows Hello). |
recoverFromPasskey | Reconnect to an existing passkey wallet from a new device or session. |
Sessions & Execution
| Function | What it does |
|---|---|
grantSession | Authorize an agent key with scoped permissions: spend caps, allowed contracts, expiry. |
execute | Send calls from the wallet, signed by the admin key or a session key. |
revokeSession | Revoke a session key. One transaction; immediate and global. |
Reads & Chains
| Function | What it does |
|---|---|
balances | Read native and token balances for a wallet. |
ensureKeyCached | Prove a key from the L1 Keystore into an L2 cache to authorize across chains. |
Payments & Signing
| Function | What it does |
|---|---|
fetchWithX402 | Pay for an HTTP resource from a session key (x402), via Permit2 or EIP-3009. |
signOrder | Sign an off-chain authorization with a session key (ERC-1271 wrapped signature). |
approveSignatureChecker | Authorize which contract may verify a session's signatures on-chain. |
approveTokenForPermit2 | One-time ERC-20 approval of Permit2 for the permit2 payment rail. |
Chain setup
| Page | What it covers |
|---|---|
| Setup: BNB Smart Chain | Install, createClient, and configuration for multiple chains. Deployed contract addresses live in Networks & Addresses. |