> For the complete documentation index, see [llms.txt](https://sdk.unlockd.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sdk.unlockd.finance/getting-started/sdk-modules/action-module.md).

# Action Module

## Flow

<figure><img src="/files/zc8bR8u1fMNdSbSTZWh7" alt=""><figcaption><p>Action Flow</p></figcaption></figure>

## Types

### Assets

```typescript
export type Nft = {
  collection: string
  tokenId: string
}
```

### Signature

```typescript
export type Signature = {
  data: object
  signature: { v: number; r: string; s: string; deadline: number }
}

/* data object
interface SignAction {
  loan: SignLoanConfig;
  assets: string[];
  underlyingAsset: string;
  nonce: BigInt;
  deadline: BigInt;
}

interface SignLoanConfig {
  loanId: string;
  aggLoanPrice: BigInt;
  aggLtv: BigInt;
  aggLiquidationThreshold: BigInt;
  totalAssets: BigInt;
  nonce: BigInt;
  deadline: BigInt;
}
*/
```

### ClientOptions

```typescript
export type ClientOptions = {
  network?: Chain
}

export type Chain = 'mainnet' | 'sepolia' | 'localhost'
```

***

## Functions

### Borrowing Assets

To borrow assets using the SDK, use the `borrow` function from the `action` module:

<pre class="language-typescript"><code class="lang-typescript"><strong>export const borrow = async (
</strong><strong>        amount: BigInt, 
</strong><strong>        assets: Array&#x3C;Nft>, 
</strong><strong>        signature: Signature, 
</strong><strong>        options?: ClientOptions
</strong><strong>    )
</strong></code></pre>

```typescript
const result = await borrow(amount, assets[], signature, options?);
```

### Repaying Loans

To repay a borrowed loan, use the `repay` function from the `action` module:

```typescript
export const repay = async (
        amount: BigInt, 
        signature: Signature, 
        options?: ClientOptions
    )
```

```typescript
const result = await repay(amount, signature, options?);
```

***

Refer to the Action Module documentation for more details on the `borrow` and `repay` functions.

{% content-ref url="/pages/hnXwWgQd5bRcF7bJjAlG" %}
[Broken mention](broken://pages/hnXwWgQd5bRcF7bJjAlG)
{% endcontent-ref %}
