Skip to main content
Most utilities live under the leokit-sdk/utils and leokit-sdk/cdn subpath imports. They’re tree-shakeable — only what you import gets bundled.

Amount Math

All amount helpers accept and return strings to avoid number precision loss. Internally they use bignumber.js.

Chain Helpers

CHAIN_CONFIGS (from the main entry point) holds the full per-chain config used by the SDK — RPC URLs, explorer URLs, native asset, decimals.

Asset Parsing

LeoKit asset IDs follow CHAIN.SYMBOL[-ADDRESS] (e.g. ETH.USDC-0xA0b...). Helpers:
The full asset-format spec is at Asset Format.

Errors

The full ErrorCode catalog is at Error Codes. LeoKitError mirrors the backend’s error class so you get matching codes on both sides.

Events

The LeoKitClient is itself an EventEmitter. For your own internal pub/sub, the SDK exposes the same primitive:
Built-in LeoKitEvents shape: error, transaction, walletChange, connectionChange. Type-safe on/off/emit.

CDN Icons

The CDN is also exposed as LEOKIT_CDN_BASE_URL if you want to compose URLs yourself. Custom CDN bases can be set via cdnUrl in LeoKitConfig.

EVM-Specific

Useful when comparing eth_chainId values across providers that disagree on padding.