Zerc20SdkOptions accepts the following optional fields:
Field
Type
Description
wasm
WasmRuntime
Custom WASM runtime (auto-detected if omitted)
teleportProofs
TeleportProofClient
Custom teleport-proof client
decider
HttpDeciderClient
Decider prover endpoint
stealth
StealthClientFactory
Custom stealth client factory
The returned Zerc20Sdk exposes the same fields for direct access:
Connect to ICP
Create a StealthCanisterClient to interact with the ICP storage and key-manager canisters:
The agent, storageCanisterId, and keyManagerCanisterId fields are required. If any are missing (and no factory defaults have been set), createStealthClient() will throw an error.
Load Tokens
The SDK provides two ways to load token configuration:
Option A: From compressed data with loadTokens
loadTokens(compressed) accepts a Base64-encoded gzip string containing token configuration JSON. This is the format used by the production frontend.
Option B: From raw JSON with normalizeTokens
If you have a tokens.json file (e.g., from your own deployment), use normalizeTokens() instead:
Finding tokens and creating providers
Type signatures
First Private Send
Below is a compact end-to-end example. Each helper is covered in detail on the Private Send page.
// Pick the token entry for Arbitrum (chain ID 42161)
const entry = findTokenByChain(tokens, 42161n);
// Create a viem PublicClient pre-configured for that chain
const publicClient = createProviderForToken(entry);
function loadTokens(compressed: string, options?: LoadTokensOptions): Promise<NormalizedTokens>;
function normalizeTokens(file: TokensFile): NormalizedTokens;
interface NormalizedTokens {
hub?: HubEntry;
tokens: TokenEntry[];
raw: TokensFile;
}
function findTokenByChain(
tokens: readonly TokenEntry[],
chainId: bigint,
): TokenEntry;
function createProviderForToken(entry: TokenEntry): PublicClient;