Add inheritance, time-locks, and automated release mechanisms to your Web3 application with just 3 lines of code.
npm install @vault-protocol/sdk # or pnpm add @vault-protocol/sdk # or yarn add @vault-protocol/sdk
import { VaultProtocol } from '@vault-protocol/sdk';
const sdk = new VaultProtocol({
chain: 'bsc',
mode: 'mainnet',
apiKey: 'your_api_key_here' // optional
});const vault = await sdk.vaults.create({
beneficiaries: [
'0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
'0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199'
],
shares: [70, 30], // 70% / 30% split
checkInIntervalDays: 90,
gracePeriodDays: 30
});
console.log('Vault created:', vault.id);// Check vault status
const status = await sdk.vaults.get(vault.id);
console.log('Status:', status.status);
// Listen for attestation events
sdk.events.onAttestation(vault.id, (attestation) => {
console.log('New attestation:', attestation);
});
// Perform regular check-ins
await sdk.vaults.checkIn(vault.id);Fully typed SDK with IntelliSense support. Works with React, Vue, Angular, and vanilla JavaScript.
SDK ReferenceDeploy vaults directly from your contracts. Solidity interfaces included.
Contract DocsQuery vault data, monitor attestations, and subscribe to real-time events.
API ReferenceLearn how Vault Protocol works under the hood
Deploy vaults across 8+ supported chains
Understand the decentralized death verification process
Review our security architecture and audit reports
See how zkVault and others use Vault Protocol
Complete REST, GraphQL, and SDK documentation
Deploy vaults on any of these chains with the same unified API. Cross-chain synchronization via LayerZero V2.
// Add vault creation to your wallet
import { VaultProtocol } from '@vault-protocol/sdk';
async function createInheritanceVault(
wallet: WalletClient
) {
const sdk = new VaultProtocol({
chain: 'ethereum',
mode: 'mainnet'
});
const vault = await sdk.vaults.create({
beneficiaries: wallet.beneficiaries,
shares: wallet.beneficiaryShares,
checkInIntervalDays: 90
});
return vault;
}// Add time-locked rewards
import { VaultProtocol } from '@vault-protocol/sdk';
async function lockRewards(
user: Address,
amount: bigint
) {
const vault = await sdk.vaults.create({
beneficiaries: [user],
shares: [100],
checkInIntervalDays: 0, // Time-lock only
gracePeriodDays: 365 // 1-year lock
});
// Transfer tokens to vault
await sdk.assets.deposit(vault.id, {
token: rewardToken,
amount
});
}// Deploy vault to multiple chains
const vault = await sdk.vaults.create({
beneficiaries: ['0xAlice', '0xBob'],
shares: [50, 50]
});
// Deploy to other chains
await sdk.crossChain.deployToChain(
vault.id,
137 // Polygon
);
await sdk.crossChain.deployToChain(
vault.id,
42161 // Arbitrum
);
// Sync state across chains
await sdk.crossChain.sync(vault.id);// Subscribe to vault events
sdk.events.onVaultCreated((vault) => {
console.log('Vault created:', vault.id);
});
sdk.events.onAttestation(vaultId, (att) => {
console.log('Attestation received:', att);
});
sdk.events.onConsensusReached(vaultId, () => {
console.log('Consensus reached!');
});
sdk.events.onVaultReleased(vaultId, () => {
console.log('Assets released');
});Join our developer community and get help from the Vault Protocol team.