> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebelfi.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Operations

> OperationsAPI — Supply and unwind operations

## OperationsAPI

Access via `client.operations`.

### supply

Plan a supply operation. Identify the wallet with `walletAddress` or `walletId`.

```typescript theme={null}
async supply(request: SupplyRequest): Promise<OperationResponse>
```

```typescript theme={null}
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.

```typescript theme={null}
async unwind(request: UnwindRequest): Promise<OperationResponse>
```

```typescript theme={null}
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.

```typescript theme={null}
async get(id: number): Promise<OperationResponse>
```

### cancel

Cancel a pending operation.

```typescript theme={null}
async cancel(id: number): Promise<CancelOperationResponse>
```

```typescript theme={null}
interface CancelOperationResponse {
  operationId: number;
  status: string;
  success: boolean;
}
```

### OperationResponse Type

```typescript theme={null}
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;
}
```
