Skip to main content

OperationsAPI

Access via client.operations.

supply

Plan a supply operation. Identify the wallet with walletAddress or walletId.
async supply(request: SupplyRequest): Promise<OperationResponse>
interface SupplyRequest {
  /** Wallet address */
  walletAddress?: string;
  /** Wallet ID from registration */
  walletId?: number;
  /** Target strategy ID */
  strategyId: number;
  /** Amount in base units */
  amount: string;
  /** Token contract address */
  tokenAddress: string;
}

unwind

Plan an unwind operation.
async unwind(request: UnwindRequest): Promise<OperationResponse>
interface UnwindRequest {
  walletAddress?: string;
  walletId?: number;
  strategyId: number;
  amount: string;
}

get

Get operation status.
async get(id: number): Promise<OperationResponse>

cancel

Cancel a pending operation.
async cancel(id: number): Promise<CancelOperationResponse>
interface CancelOperationResponse {
  operationId: number;
  status: string;
  success: boolean;
}

OperationResponse Type

interface OperationResponse {
  operationId: number;
  type: 'supply' | 'unwind';
  status: 'pending' | 'awaiting_signature' | 'submitted' | 'confirmed' | 'failed';
  transactions: Transaction[];
  expiresAt: string;
  /** IDs of auto-cancelled operations (only present when operations were cancelled) */
  cancelledOperations?: number[];
}

interface Transaction {
  id: number;
  blockchain: 'solana' | 'polygon' | 'ethereum';
  status: 'unsigned' | 'pending' | 'confirmed' | 'failed';
  unsignedTransaction?: string;
  description?: string;
  txHash?: string;
  confirmations?: number;
  blockNumber?: number;
  error?: string;
  failureCode?: TransactionFailureCode;
  revertReason?: string;
}