Setup
The SDK works the same way on every chain. You install it, pick the chain config, and create a client. Everything after that (wallets, sessions, execution) is the same code.
Install
npm install @altananetwork/sdk viemChoose a chain
import { createClient, BNB, signerFromPrivateKey } from "@altananetwork/sdk";
const client = createClient({ chains: [BNB] }); // or ETHEREUM, CELO, BNB_TESTNET, CELO_SEPOLIA, BASE_SEPOLIA
const signer = signerFromPrivateKey(process.env.PRIVATE_KEY as `0x${string}`);
const wallet = await client.createWallet({ signer });
console.log(wallet.address);| Config | Chain | Chain id | Fund wallet.address with |
|---|---|---|---|
BNB | BNB Smart Chain (default) | 56 | BNB |
ETHEREUM | Ethereum | 1 | ETH |
CELO | Celo | 42220 | CELO |
BNB_TESTNET | BNB Smart Chain Testnet | 97 | test BNB: faucet |
CELO_SEPOLIA | Celo Sepolia | 11142220 | test CELO: faucet |
BASE_SEPOLIA | Base Sepolia | 84532 | Base Sepolia ETH. Keystore writes on Sepolia are paid from this balance; ETH on Sepolia is not used |
BNB Smart Chain, Ethereum and Celo are standalone: the Keystore is
on the chain itself. Base Sepolia is an L2: the Keystore is on Sepolia and a KeyStoreCache
on the L2 mirrors it. The SDK handles the L1 write and the
proof into the cache inside grantSession and
revokeSession. The L1 write is paid from the wallet's balance on
the L2: the relay takes the registration fee and its own fee there and funds the write on
the L1. BASE is also exported, for the L2
Keystore cache used by ensureKeyCached.
Multiple chains
createClient accepts several chains. A wallet has the same address on all
of them. Calls pick one with chainId and use the default chain without it.
A session is granted on one chain, or on several with chainIds, and revoked
wherever it lives:
import { createClient, NETWORKS } from "@altananetwork/sdk";
const client = createClient({ chains: [...NETWORKS.mainnet], defaultChainId: 56 });
await client.execute({ /* ... */, chainId: 42220 }); // one chain: Celo
await client.grantSession({ /* ... */ }); // the default chain: BNB
await client.grantSession({ /* ... */, chainId: 42220 }); // one chain: Celo
await client.grantSession({ /* ... */, chainIds: [56, 42220] }); // several in one call
await client.revokeSession({ wallet, signer, session }); // wherever the key livesA wallet that is new on BNB Chain or Celo is registered as an agent (ERC-8004)
after its first action, in a transaction of its own. agentIdentity sets the
name and image it is listed with, and agentIdentity: false turns it off. See
ERC-8004: agent identity.
NETWORKS.mainnet is BNB, Ethereum and Celo; NETWORKS.testnet is BNB
testnet, Celo Sepolia and Base Sepolia. networkByChainId(id) returns the
config for any chain the SDK knows, Sepolia included.
What's next
- Create a smart agentic wallet. The full walkthrough.
- Grant a session. Scoped, time-bounded keys for AI agents.
- Networks & Addresses and Testnet. RPCs, explorers, faucets, contract addresses.