💰Vault Operations
Overview
Initialize SDK
import { SomniaAgentKit, SOMNIA_NETWORKS } from 'somnia-agent-kit';
import { ethers } from 'ethers';
const kit = new SomniaAgentKit({
network: SOMNIA_NETWORKS.testnet,
contracts: {
agentRegistry: '0xC9f3452090EEB519467DEa4a390976D38C008347',
agentManager: '0x77F6dC5924652e32DBa0B4329De0a44a2C95691E',
agentExecutor: '0x157C56dEdbAB6caD541109daabA4663Fc016026e',
agentVault: '0x7cEe3142A9c6d15529C322035041af697B2B5129',
},
privateKey: process.env.PRIVATE_KEY,
});
await kit.initialize();Get Agent Address
Create Vault
Deposit Native Tokens
Deposit ERC20 Tokens
Withdraw Native Tokens
Withdraw ERC20 Tokens
Check Balances
Native Token Balance
ERC20 Token Balance
Daily Limit Management
Get Daily Limit Info
Update Daily Limit
Token Management
Get Allowed Tokens
Allow Token
Disallow Token
Vault Status
Check if Vault is Active
Activate Vault
Deactivate Vault
Listen to Events
Native Deposit Event
Native Withdraw Event
Token Deposit Event
Token Withdraw Event
Transfer Event
See Also
Last updated

