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 to unwind in base units (e.g., '1000000' for 1 USDC).
   * Required unless `fullWithdrawal` is true.
   */
  amount?: string;
  /**
   * If true, withdraws the full position using the protocol's native
   * max-withdrawal mechanism. Cannot be combined with `amount`.
   */
  fullWithdrawal?: boolean;
}

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' | 'base';
  status: 'UNSIGNED' | 'PENDING' | 'CONFIRMED' | 'FAILED';
  unsignedTransaction?: string;
  description?: string;
  txHash?: string;
  confirmations?: number;
  blockNumber?: number;
  error?: string;
  failureCode?: TransactionFailureCode;
  revertReason?: string;
}