/** * Vault Types * * Types for vault operations including deposits, withdrawals, and balance management. */ import type { BaseAPI } from "../api/index"; import type { Balance, TransactionResult } from "./responses"; /** * Vault API interface. * Provides methods for managing token deposits and withdrawals. * Handles token approvals and balance management. */ export interface VaultAPI extends BaseAPI { /** * Approves the vault to spend tokens. * @param assetId - Asset identifier (UUID) to approve * @param amount - Amount to approve * @param autoWait - Whether to automatically wait for transaction confirmation (defaults to true) * @returns Promise resolving to the transaction result */ approve(assetId: string, amount: bigint, autoWait?: boolean): Promise; /** * Deposits tokens into the vault. * @param assetId - Asset identifier (UUID) to deposit * @param amount - Amount to deposit * @param autoWait - Whether to automatically wait for transaction confirmation (defaults to true) * @returns Promise resolving to the transaction result */ deposit(assetId: string, amount: bigint, autoWait?: boolean): Promise; /** * Withdraws tokens from the vault. * @param assetId - Asset identifier (UUID) to withdraw * @param amount - Amount to withdraw * @param autoWait - Whether to automatically wait for transaction confirmation (defaults to true) * @returns Promise resolving to the transaction result */ withdraw(assetId: string, amount: bigint, autoWait?: boolean): Promise; /** * Gets the balance of a token in the vault. * @param assetId - Asset identifier (UUID) to check * @returns Promise resolving to the balance * @deprecated This method is no longer supported and will throw an APIError (410 Gone). Use `profileAPI.getUserBalances()` or `profileAPI.getUserBalanceByAssetId()` instead. */ getBalance(assetId: string): Promise; /** * Gets the allowance for a token. * @param assetId - Asset identifier (UUID) to check * @returns Promise resolving to the allowance */ getAllowance(assetId: string): Promise; /** * Checks if a token needs approval for an amount. * @param assetId - Asset identifier (UUID) to check * @param amount - Amount to check * @returns Promise resolving to whether approval is needed */ needsApproval(assetId: string, amount: bigint): Promise; /** * Gets the address of the vault. * @returns Promise resolving to the address of the vault */ getVaultAddress(): Promise; /** * Sets the wallet client for signing transactions. * Used when the wallet becomes available after SDK initialization. * @param walletClient - The wallet client to set */ setWalletClient(walletClient: unknown): void; } export type { Balance, TransactionResult } from "./responses";