OperationsAPI
Access viaclient.operations.
supply
Plan a supply operation. Identify the wallet withwalletAddress or walletId.
Copy
async supply(request: SupplyRequest): Promise<OperationResponse>
Copy
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.Copy
async unwind(request: UnwindRequest): Promise<OperationResponse>
Copy
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.Copy
async get(id: number): Promise<OperationResponse>
cancel
Cancel a pending operation.Copy
async cancel(id: number): Promise<CancelOperationResponse>
Copy
interface CancelOperationResponse {
operationId: number;
status: string;
success: boolean;
}
OperationResponse Type
Copy
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;
}