Skip to main content

Vault Operations

Manage your ZeroQuant smart vaults.

Creating Vaults​

// Create with specific salt (deterministic address)
const vault = await client.createVault(42);

// Predict address before creation
const futureAddress = await client.getAccountAddress(ownerAddress, 42);

Connecting to Vaults​

// Connect to existing vault
await client.connectVault('0x...');

// Get connected vault address
const address = await client.getVaultAddress();

Executing Operations​

Single Operation​

const tx = await client.execute({
target: tokenAddress,
value: 0n,
data: transferCalldata,
});
await tx.wait();

Batch Operations​

Execute multiple operations atomically:

const tx = await client.executeBatch({
targets: [token1, token2],
values: [0n, 0n],
calldatas: [approve1, approve2],
});
await tx.wait();

Querying State​

// ETH balance
const balance = await client.getBalance();

// Owner address
const owner = await client.getOwner();