Vultisig SDK
TypeScript SDK for Vultisig MPC wallet operations. See the router skill for an overview of MPC benefits and to choose between CLI and SDK.
Installation
npm install @vultisig/sdk
# or
yarn add @vultisig/sdk
Requirements:
- Node.js 20+
- TypeScript (recommended)
- Platforms: Node.js, Browser (with WASM), React Native, Electron
Quick Start
import { Vultisig, Chain } from '@vultisig/sdk'
// Initialize SDK
const sdk = new Vultisig({
onPasswordRequired: async (vaultId, vaultName) => {
return process.env.VAULT_PASSWORD || ''
},
passwordCache: { defaultTTL: 300000 } // 5 minutes
})
await sdk.initialize()
// Create a FastVault
const vaultId = await sdk.createFastVault({
name: 'agent-wallet',
email: 'agent@example.com',
password: 'SecurePassword123!'
})
// Verify with email code
const vault = await sdk.verifyVault(vaultId, 'verification-code')
// Get address
const address = await vault.address(Chain.Ethereum)
console.log('ETH address:', address)
// Check balance
const balance = await vault.balance(Chain.Ethereum)
console.log(`Balance: ${balance.amount} ${balance.symbol}`)
// Clean up
sdk.dispose()
Vault Types
| Type |
Threshold |
Signing |
Best For |
| FastVault |
2-of-2 (device + server) |
Instant |
AI agents, automation |
| SecureVault |
N-of-M (configurable) |
Multi-device coordination |
Teams, high security |
For AI agents, FastVault is recommended - instant signing without coordination.
Core Classes
Vultisig (Main Entry Point)
const sdk = new Vultisig({
storage?: Storage, // Default: FileStorage (Node) / BrowserStorage
defaultChains?: Chain[], // Chains for new vaults
defaultCurrency?: string, // Fiat currency (default: 'USD')
onPasswordRequired?: (id, name) => Promise<string>,
passwordCache?: { defaultTTL: number }
})
// Lifecycle
await sdk.initialize()
sdk.dispose()
// Vault creation
const vaultId = await sdk.createFastVault({ name, email, password })
const vault = await sdk.verifyVault(vaultId, code)
const { vault } = await sdk.createSecureVault({ name, devices, threshold })
// Vault management
const vaults = await sdk.listVaults()
const vault = await sdk.getActiveVault()
await sdk.setActiveVault(vault)
await sdk.deleteVault(vault)
// Import/Export
const vault = await sdk.importVault(vultContent, password)
const isEncrypted = sdk.isVaultEncrypted(vultContent)
// Seedphrase
await sdk.validateSeedphrase(mnemonic)
await sdk.discoverChainsFromSeedphrase(mnemonic, chains?, onProgress?)
await sdk.createFastVaultFromSeedphrase({ mnemonic, name, email, password })
// Push Notifications
await sdk.notifications.registerDevice({ vaultId, partyName, token, deviceType })
await sdk.notifications.notifyVaultMembers({ vaultId, vaultName, localPartyId, qrCodeData })
const unsub = sdk.notifications.onSigningRequest((notification) => { /* handle */ })
sdk.notifications.handleIncomingPush(rawPushData)
VaultBase (Shared Vault Methods)
// Properties
vault.id: string
vault.name: string
vault.type: 'fast' | 'secure'
vault.isEncrypted: boolean
// Addresses
const address = await vault.address(Chain.Bitcoin)
const addresses = await vault.addresses([Chain.Bitcoin, Chain.Ethereum])
// Balances
const balance = await vault.balance(Chain.Ethereum)
const balances = await vault.balances() // All chains
await vault.updateBalance(Chain.Ethereum) // Force refresh
// Transactions
const payload = await vault.prepareSendTx({ coin, receiver, amount })
const signature = await vault.sign(payload)
const txHash = await vault.broadcastTx({ chain, keysignPayload: payload, signature })
// Swaps
const quote = await vault.getSwapQuote({ fromCoin, toCoin, amount })
const { keysignPayload } = await vault.prepareSwapTx({ fromCoin, toCoin, amount, swapQuote })
// Management
await vault.addChain(Chain.Solana)
await vault.removeChain(Chain.Litecoin)
await vault.rename('New Name')
const { filename, data } = await vault.export(password)
Chain Enum
import { Chain } from '@vultisig/sdk'
// EVM
Chain.Ethereum, Chain.Polygon, Chain.BSC, Chain.Arbitrum, Chain.Optimism,
Chain.Base, Chain.Avalanche, Chain.Blast, Chain.CronosChain, Chain.ZkSync,
Chain.Hyperliquid, Chain.Mantle, Chain.Sei
// UTXO
Chain.Bitcoin, Chain.Litecoin, Chain.Dogecoin, Chain.BitcoinCash,
Chain.Dash, Chain.Zcash
// Cosmos
Chain.Cosmos, Chain.THORChain, Chain.MayaChain, Chain.Osmosis, Chain.Dydx,
Chain.Kujira, Chain.Terra, Chain.TerraClassic, Chain.Noble, Chain.Akash
// Other
Chain.Solana, Chain.Sui, Chain.Polkadot, Chain.Ton, Chain.Ripple,
Chain.Tron, Chain.Cardano
All Capabilities
For full details and code examples, see the SDK Users Guide.
| Capability |
Description |
Guide Section |
| Vault Creation |
FastVault (2-of-2) and SecureVault (N-of-M) |
Vault Management |
| Seedphrase Import |
Validate mnemonics, discover chains, create vaults from seedphrase |
Seedphrase |
| Send Transactions |
Prepare, sign, broadcast for all 36+ chains |
Essential Operations |
| Token Swaps |
Cross-chain (THORChain), same-chain (1inch, LiFi), ERC-20 approval handling |
Token Swaps |
| Sign Arbitrary Bytes |
Custom tx construction with signBytes and broadcastRawTx |
Signing |
| Cosmos Signing |
SignAmino and SignDirect for Cosmos dApps |
Cosmos Signing |
| Gas Estimation |
Get gas info per chain via vault.gas(chain) |
Gas Estimation |
| Token Discovery |
Look up known tokens, discover at address, resolve metadata |
Token Registry |
| Price Feeds |
CoinGecko token prices via vault.getPrice() |
Price Feeds |
| Security Scanning |
Site scanning, transaction validation, transaction simulation |
Security |
| Fiat On-Ramp |
Buy crypto via Banxa integration |
Fiat On-Ramp |
| Push Notifications |
Register devices, notify vault members for signing, handle incoming push |
Push Notifications |
| Portfolio Value |
Fiat valuations across all chains |
Portfolio |
| Password Management |
Callbacks, caching, manual lock/unlock |
Password Management |
| Event System |
Reactive updates for balances, signing, chains, tokens |
Events |
| Caching |
Address, balance, password, portfolio caching with configurable TTLs |
Caching |
| Error Handling |
Typed VaultError with error codes (PasswordRequired, InsufficientBalance, etc.) |
Quick Reference |
| Stateless Mode |
MemoryStorage for serverless, testing, one-off operations |
Stateless Usage |
| Multi-Platform |
Node.js, Browser (WASM), React Native, Electron |
Platform Notes |
| Storage Options |
FileStorage, BrowserStorage, MemoryStorage, or custom |
Configuration |
Supported Chains
36+ blockchains:
- EVM (13): Ethereum, Polygon, BSC, Arbitrum, Optimism, Base, Avalanche, Blast, Cronos, ZkSync, Hyperliquid, Mantle, Sei
- UTXO (6): Bitcoin, Litecoin, Dogecoin, Bitcoin Cash, Dash, Zcash
- Cosmos (10): Cosmos, THORChain, MayaChain, Osmosis, Dydx, Kujira, Terra, Terra Classic, Noble, Akash
- Other (7): Solana, Sui, Polkadot, TON, Ripple, Tron, Cardano
Resources
1---2name: vultisig-sdk3description: TypeScript SDK for MPC wallet integration across 36+ blockchains. Create wallets, import from seedphrase, sign transactions, execute swaps, scan for security threats, and more. Supports Bitcoin, Ethereum, Solana, and 33+ other chains with threshold signing security.4---56# Vultisig SDK78TypeScript SDK for Vultisig MPC wallet operations. See the [router skill](../SKILL.md) for an overview of MPC benefits and to choose between CLI and SDK.910## Installation1112```bash13npm install @vultisig/sdk14# or15yarn add @vultisig/sdk16```1718**Requirements:**19- Node.js 20+20- TypeScript (recommended)21- Platforms: Node.js, Browser (with WASM), React Native, Electron2223## Quick Start2425```typescript26import { Vultisig, Chain } from '@vultisig/sdk'2728// Initialize SDK29const sdk = new Vultisig({30 onPasswordRequired: async (vaultId, vaultName) => {31 return process.env.VAULT_PASSWORD || ''32 },33 passwordCache: { defaultTTL: 300000 } // 5 minutes34})35await sdk.initialize()3637// Create a FastVault38const vaultId = await sdk.createFastVault({39 name: 'agent-wallet',40 email: 'agent@example.com',41 password: 'SecurePassword123!'42})4344// Verify with email code45const vault = await sdk.verifyVault(vaultId, 'verification-code')4647// Get address48const address = await vault.address(Chain.Ethereum)49console.log('ETH address:', address)5051// Check balance52const balance = await vault.balance(Chain.Ethereum)53console.log(`Balance: ${balance.amount} ${balance.symbol}`)5455// Clean up56sdk.dispose()57```5859## Vault Types6061| Type | Threshold | Signing | Best For |62|------|-----------|---------|----------|63| **FastVault** | 2-of-2 (device + server) | Instant | AI agents, automation |64| **SecureVault** | N-of-M (configurable) | Multi-device coordination | Teams, high security |6566**For AI agents, FastVault is recommended** - instant signing without coordination.6768## Core Classes6970### Vultisig (Main Entry Point)7172```typescript73const sdk = new Vultisig({74 storage?: Storage, // Default: FileStorage (Node) / BrowserStorage75 defaultChains?: Chain[], // Chains for new vaults76 defaultCurrency?: string, // Fiat currency (default: 'USD')77 onPasswordRequired?: (id, name) => Promise<string>,78 passwordCache?: { defaultTTL: number }79})8081// Lifecycle82await sdk.initialize()83sdk.dispose()8485// Vault creation86const vaultId = await sdk.createFastVault({ name, email, password })87const vault = await sdk.verifyVault(vaultId, code)88const { vault } = await sdk.createSecureVault({ name, devices, threshold })8990// Vault management91const vaults = await sdk.listVaults()92const vault = await sdk.getActiveVault()93await sdk.setActiveVault(vault)94await sdk.deleteVault(vault)9596// Import/Export97const vault = await sdk.importVault(vultContent, password)98const isEncrypted = sdk.isVaultEncrypted(vultContent)99100// Seedphrase101await sdk.validateSeedphrase(mnemonic)102await sdk.discoverChainsFromSeedphrase(mnemonic, chains?, onProgress?)103await sdk.createFastVaultFromSeedphrase({ mnemonic, name, email, password })104105// Push Notifications106await sdk.notifications.registerDevice({ vaultId, partyName, token, deviceType })107await sdk.notifications.notifyVaultMembers({ vaultId, vaultName, localPartyId, qrCodeData })108const unsub = sdk.notifications.onSigningRequest((notification) => { /* handle */ })109sdk.notifications.handleIncomingPush(rawPushData)110```111112### VaultBase (Shared Vault Methods)113114```typescript115// Properties116vault.id: string117vault.name: string118vault.type: 'fast' | 'secure'119vault.isEncrypted: boolean120121// Addresses122const address = await vault.address(Chain.Bitcoin)123const addresses = await vault.addresses([Chain.Bitcoin, Chain.Ethereum])124125// Balances126const balance = await vault.balance(Chain.Ethereum)127const balances = await vault.balances() // All chains128await vault.updateBalance(Chain.Ethereum) // Force refresh129130// Transactions131const payload = await vault.prepareSendTx({ coin, receiver, amount })132const signature = await vault.sign(payload)133const txHash = await vault.broadcastTx({ chain, keysignPayload: payload, signature })134135// Swaps136const quote = await vault.getSwapQuote({ fromCoin, toCoin, amount })137const { keysignPayload } = await vault.prepareSwapTx({ fromCoin, toCoin, amount, swapQuote })138139// Management140await vault.addChain(Chain.Solana)141await vault.removeChain(Chain.Litecoin)142await vault.rename('New Name')143const { filename, data } = await vault.export(password)144```145146### Chain Enum147148```typescript149import { Chain } from '@vultisig/sdk'150151// EVM152Chain.Ethereum, Chain.Polygon, Chain.BSC, Chain.Arbitrum, Chain.Optimism,153Chain.Base, Chain.Avalanche, Chain.Blast, Chain.CronosChain, Chain.ZkSync,154Chain.Hyperliquid, Chain.Mantle, Chain.Sei155156// UTXO157Chain.Bitcoin, Chain.Litecoin, Chain.Dogecoin, Chain.BitcoinCash,158Chain.Dash, Chain.Zcash159160// Cosmos161Chain.Cosmos, Chain.THORChain, Chain.MayaChain, Chain.Osmosis, Chain.Dydx,162Chain.Kujira, Chain.Terra, Chain.TerraClassic, Chain.Noble, Chain.Akash163164// Other165Chain.Solana, Chain.Sui, Chain.Polkadot, Chain.Ton, Chain.Ripple,166Chain.Tron, Chain.Cardano167```168169## All Capabilities170171For full details and code examples, see the [SDK Users Guide](../../docs/SDK-USERS-GUIDE.md).172173| Capability | Description | Guide Section |174|-----------|-------------|---------------|175| Vault Creation | FastVault (2-of-2) and SecureVault (N-of-M) | [Vault Management](../../docs/SDK-USERS-GUIDE.md#vault-management) |176| Seedphrase Import | Validate mnemonics, discover chains, create vaults from seedphrase | [Seedphrase](../../docs/SDK-USERS-GUIDE.md#creating-vaults-from-seedphrase) |177| Send Transactions | Prepare, sign, broadcast for all 36+ chains | [Essential Operations](../../docs/SDK-USERS-GUIDE.md#essential-operations) |178| Token Swaps | Cross-chain (THORChain), same-chain (1inch, LiFi), ERC-20 approval handling | [Token Swaps](../../docs/SDK-USERS-GUIDE.md#token-swaps) |179| Sign Arbitrary Bytes | Custom tx construction with signBytes and broadcastRawTx | [Signing](../../docs/SDK-USERS-GUIDE.md#signing-arbitrary-bytes) |180| Cosmos Signing | SignAmino and SignDirect for Cosmos dApps | [Cosmos Signing](../../docs/SDK-USERS-GUIDE.md#cosmos-signing-signamino--signdirect) |181| Gas Estimation | Get gas info per chain via `vault.gas(chain)` | [Gas Estimation](../../docs/SDK-USERS-GUIDE.md#gas-estimation) |182| Token Discovery | Look up known tokens, discover at address, resolve metadata | [Token Registry](../../docs/SDK-USERS-GUIDE.md#token-registry--discovery) |183| Price Feeds | CoinGecko token prices via `vault.getPrice()` | [Price Feeds](../../docs/SDK-USERS-GUIDE.md#price-feeds) |184| Security Scanning | Site scanning, transaction validation, transaction simulation | [Security](../../docs/SDK-USERS-GUIDE.md#security-scanning) |185| Fiat On-Ramp | Buy crypto via Banxa integration | [Fiat On-Ramp](../../docs/SDK-USERS-GUIDE.md#fiat-on-ramp-banxa) |186| Push Notifications | Register devices, notify vault members for signing, handle incoming push | [Push Notifications](../../docs/SDK-USERS-GUIDE.md#push-notifications) |187| Portfolio Value | Fiat valuations across all chains | [Portfolio](../../docs/SDK-USERS-GUIDE.md#portfolio-value) |188| Password Management | Callbacks, caching, manual lock/unlock | [Password Management](../../docs/SDK-USERS-GUIDE.md#password-management) |189| Event System | Reactive updates for balances, signing, chains, tokens | [Events](../../docs/SDK-USERS-GUIDE.md#event-system) |190| Caching | Address, balance, password, portfolio caching with configurable TTLs | [Caching](../../docs/SDK-USERS-GUIDE.md#caching-system) |191| Error Handling | Typed VaultError with error codes (PasswordRequired, InsufficientBalance, etc.) | [Quick Reference](../../docs/SDK-USERS-GUIDE.md#quick-reference) |192| Stateless Mode | MemoryStorage for serverless, testing, one-off operations | [Stateless Usage](../../docs/SDK-USERS-GUIDE.md#stateless-usage) |193| Multi-Platform | Node.js, Browser (WASM), React Native, Electron | [Platform Notes](../../docs/SDK-USERS-GUIDE.md#platform-notes) |194| Storage Options | FileStorage, BrowserStorage, MemoryStorage, or custom | [Configuration](../../docs/SDK-USERS-GUIDE.md#configuration) |195196## Supported Chains19719836+ blockchains:199- **EVM (13)**: Ethereum, Polygon, BSC, Arbitrum, Optimism, Base, Avalanche, Blast, Cronos, ZkSync, Hyperliquid, Mantle, Sei200- **UTXO (6)**: Bitcoin, Litecoin, Dogecoin, Bitcoin Cash, Dash, Zcash201- **Cosmos (10)**: Cosmos, THORChain, MayaChain, Osmosis, Dydx, Kujira, Terra, Terra Classic, Noble, Akash202- **Other (7)**: Solana, Sui, Polkadot, TON, Ripple, Tron, Cardano203204## Resources205206- [SDK Users Guide](../../docs/SDK-USERS-GUIDE.md) - Complete documentation with examples207- [GitHub Repository](https://github.com/vultisig/vultisig-sdk)