Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

BNB Smart Chain

BNB Smart Chain (chain id 56) is Altana's default network.

The keystore and the account contracts are deployed there (see Networks & Addresses), and the SDK ships a ready-made BNB config.

Install

npm install @altananetwork/sdk viem

Create a wallet on BNB

import { createClient, BNB, signerFromPrivateKey } from "@altananetwork/sdk";
 
const client = createClient({ chains: [BNB] });
const signer = signerFromPrivateKey(process.env.PRIVATE_KEY as `0x${string}`);
 
const wallet = await client.createWallet({ signer });
 
console.log(wallet.address);

Fund wallet.address with BNB before step 2. Send BNB from any exchange or wallet to the printed address.

Multi-chain

createClient accepts multiple wallet execution chains. Add Ethereum alongside BNB and pass chainId per call:

import { createClient, BNB, ETHEREUM } from "@altananetwork/sdk";
 
const client = createClient({ chains: [BNB, ETHEREUM], defaultChainId: 56 });
await client.grantSession({ /* ... */, chainId: 1 }); // operate on Ethereum

The SDK also exports BASE for the L2 Keystore cache used by cross-chain verification.

What's next