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

# Borrow Documentation

> API reference for Actions SDK borrow operations, functions, and parameters.

## WalletBorrowNamespace

Wallet-bound borrow namespace exposed on `wallet.borrow`.

### Methods

| Function | Description |
| - | - |
| **[supportedChainIds()](#supportedchainids)** | Union of chain IDs supported by any configured provider. |
| **[getMarkets()](#getmarkets)** | List borrow markets across configured providers. |
| **[getMarket()](#getmarket)** | Read a single borrow market. |
| **[getPosition()](#getposition)** | |
| **[getQuote()](#getquote)** | Build a borrow quote without dispatching it. |
| **[openPosition()](#openposition)** | Open or increase a borrow position from this wallet. |
| **[closePosition()](#closeposition)** | Close or reduce a borrow position from this wallet. |
| **[depositCollateral()](#depositcollateral)** | Deposit collateral from this wallet. |
| **[withdrawCollateral()](#withdrawcollateral)** | Withdraw collateral to this wallet. |
| **[repay()](#repay)** | Repay borrowed assets from this wallet. |

#### `supportedChainIds()`

Union of chain IDs supported by any configured provider.

<sub>[ Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.8.1/packages/sdk/src/actions/shared/BaseNamespace.ts#L29)</sub>

***

#### `getMarkets()`

List borrow markets across configured providers.

| Parameter | Type | Description |
| - | - | - |
| `params` | `GetBorrowMarketsParams` | Optional chain and asset filters. |

**Returns:** Borrow markets from all providers that fulfilled the read.

<sub>[ Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.8.1/packages/sdk/src/actions/borrow/namespaces/BaseBorrowNamespace.ts#L40)</sub>

***

#### `getMarket()`

Read a single borrow market.

| Parameter | Type | Description |
| - | - | - |
| `marketId` | `BorrowMarketId` | Market identifier to read. |

**Returns:** Borrow market data for the selected market.

<sub>[ Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.8.1/packages/sdk/src/actions/borrow/namespaces/BaseBorrowNamespace.ts#L59)</sub>

***

#### `getPosition()`

| Parameter | Type | Description |
| - | - | - |
| `params` | `Omit<GetBorrowPositionParams, 'walletAddress'>` | Market identity (`{ marketId }`) plus optional reader hints. |

**Returns:** The wallet's position on the given market.

<sub>[ Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.8.1/packages/sdk/src/actions/borrow/namespaces/WalletBorrowNamespace.ts#L56)</sub>

***

#### `getQuote()`

Build a borrow quote without dispatching it.

| Parameter | Type | Description |
| - | - | - |
| `params` | `BorrowQuoteParams` | Discriminated borrow quote parameters. |

**Returns:** Borrow quote with projected position changes and execution data.

<sub>[ Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.8.1/packages/sdk/src/actions/borrow/namespaces/BaseBorrowNamespace.ts#L87)</sub>

***

#### `openPosition()`

Open or increase a borrow position from this wallet.

| Parameter | Type | Description | |
| - | - | - | - |
| `params` | \`BorrowOpenPositionParams | BorrowQuote\` | Raw open-position params or a pre-built borrow quote. |

**Returns:** Receipt envelope with position data and wallet receipt hash.

<sub>[ Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.8.1/packages/sdk/src/actions/borrow/namespaces/WalletBorrowNamespace.ts#L75)</sub>

***

#### `closePosition()`

Close or reduce a borrow position from this wallet.

| Parameter | Type | Description | |
| - | - | - | - |
| `params` | \`BorrowClosePositionParams | BorrowQuote\` | Raw close-position params or a pre-built borrow quote. |

**Returns:** Receipt envelope with position data and wallet receipt hash.

<sub>[ Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.8.1/packages/sdk/src/actions/borrow/namespaces/WalletBorrowNamespace.ts#L97)</sub>

***

#### `depositCollateral()`

Deposit collateral from this wallet.

| Parameter | Type | Description | |
| - | - | - | - |
| `params` | \`BorrowDepositCollateralParams | BorrowQuote\` | Raw deposit-collateral params or a pre-built borrow quote. |

**Returns:** Receipt envelope with position data and wallet receipt hash.

<sub>[ Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.8.1/packages/sdk/src/actions/borrow/namespaces/WalletBorrowNamespace.ts#L119)</sub>

***

#### `withdrawCollateral()`

Withdraw collateral to this wallet.

| Parameter | Type | Description | |
| - | - | - | - |
| `params` | \`BorrowWithdrawCollateralParams | BorrowQuote\` | Raw withdraw-collateral params or a pre-built borrow quote. |

**Returns:** Receipt envelope with position data and wallet receipt hash.

<sub>[ Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.8.1/packages/sdk/src/actions/borrow/namespaces/WalletBorrowNamespace.ts#L141)</sub>

***

#### `repay()`

Repay borrowed assets from this wallet.

| Parameter | Type | Description | |
| - | - | - | - |
| `params` | \`BorrowRepayParams | BorrowQuote\` | Raw repay params or a pre-built borrow quote. |

**Returns:** Receipt envelope with position data and wallet receipt hash.

<sub>[ Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.8.1/packages/sdk/src/actions/borrow/namespaces/WalletBorrowNamespace.ts#L163)</sub>

***
