Complete documentation for TypeScript SDK, REST API, GraphQL API, and Smart Contract interfaces across 8+ blockchains.
npm install @vault-protocol/sdk
import { VaultProtocol } from '@vault-protocol/sdk';
const sdk = new VaultProtocol({
chain: 'bsc', // or 'ethereum', 'polygon', etc.
mode: 'mainnet', // or 'testnet'
apiKey: 'your_api_key_here', // optional
rpcUrl: 'https://bsc-dataseed1.binance.org' // optional
});Create a new vault
const vault = await sdk.vaults.create({
beneficiaries: ['0xAlice', '0xBob'],
shares: [70, 30],
checkInIntervalDays: 90,
gracePeriodDays: 30
});Retrieve vault details
const vault = await sdk.vaults.get(vaultId); console.log(vault.status); // 'active'
Perform owner check-in
await sdk.vaults.checkIn(vaultId);
Update beneficiary configuration
Release vault assets to beneficiaries
Submit death attestation
const attestation = await sdk.attestation.submit( vaultId, 'government_record', '0xproof...' );
Check attestation consensus status
const status = await sdk.attestation.getStatus(vaultId);
// { pending: 5, verified: 8, consensusReached: true }Get total attestation node count
Deploy vault to another chain
await sdk.crossChain.deployToChain(vaultId, 137); // Polygon
Synchronize vault state across chains
await sdk.crossChain.sync(vaultId);
Get vault deployments across chains
List all supported chain IDs
Listen for vault creation events
sdk.events.onVaultCreated((vault) => {
console.log('New vault:', vault.id);
});Listen for attestation events
sdk.events.onAttestation(vaultId, (att) => {
console.log('Attestation:', att);
});Listen for consensus events
Listen for asset release events
https://api.vaultprotocol.ai/v1
/vaults/vaults/:id/vaults/vaults/:id/checkin/vaults/:id/beneficiaries/vaults/:id/release/attestations/attestations/:vaultId/statshttps://api.vaultprotocol.ai/graphql
query GetVault($id: ID!) {
vault(id: $id) {
id
owner
status
beneficiaries {
address
share
}
assets {
token
amount
}
attestations {
source
timestamp
verified
}
}
}subscription OnAttestation($vaultId: ID!) {
attestationSubmitted(vaultId: $vaultId) {
source
timestamp
verified
}
}0x...0x...0x...0x...0x...0x...0x...0x...0x...0x...0x...0x...0x...0x...0x...0x...0x...0x...0x...0x...0x...0x...0x...0x...Note: Contract addresses will be updated after mainnet deployment. Currently showing placeholder addresses.
Integrate Vault Protocol into your application today across 8+ blockchains.
View Quick Start Guide