> For the complete documentation index, see [llms.txt](https://docs.augustdigital.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.augustdigital.io/developers/typescript-sdk/api/evmadapter.md).

# EVMAdapter

[SDK Reference](/developers/typescript-sdk/api.md) / EVMAdapter

## EVMAdapter

EVM Adapter for August SDK

### Classes

#### default

EVM Adapter for August SDK Supports both ethers Signer/Wallet and wagmi/viem WalletClient

**Example**

To access the EVM adapter instance

```
const sdk = new AugustSDK()
sdk.evm.vaultRedeem()
```

**Constructors**

**Constructor**

> **new default**(`signer?`): [`default`](#default)

**Parameters**

| Parameter | Type  |
| --------- | ----- |
| `signer?` | `any` |

**Returns**

[`default`](#default)

**Methods**

**allowance()**

> **allowance**(`options`): `Promise`<`bigint`>

Read the ERC-20 allowance an owner has granted the vault. Defaults to the vault's underlying asset; pass `asset` to override.

**Parameters**

| Parameter | Type                |
| --------- | ------------------- |
| `options` | `IAllowanceOptions` |

**Returns**

`Promise`<`bigint`>

Allowance as a raw `bigint`.

**Example**

```ts
const raw = await augustSdk.evm.allowance({ vault, owner });
```

**approve()**

> **approve**(`options`): `Promise`<`ApproveResult`>

Approve a vault to spend a deposit token, returning a discriminated ApproveResult so callers can tell `sent` from `sufficient` (existing allowance covers) and `native` (no allowance applies). Prefer this over [vaultApprove](#vaultapprove) for new integrations.

**Parameters**

| Parameter | Type                    |
| --------- | ----------------------- |
| `options` | `IContractWriteOptions` |

**Returns**

`Promise`<`ApproveResult`>

**Example**

```ts
const r = await augustSdk.evm.approve({
  target: vaultAddress,
  wallet: walletAddress,
  amount: '100',
  wait: true,
});
if (r.kind === 'sent') console.log('approve tx', r.hash);
```

**balanceOf()**

> **balanceOf**(`options`): `Promise`<`bigint`>

Read an ERC-20 token balance.

**Parameters**

| Parameter | Type                |
| --------- | ------------------- |
| `options` | `IBalanceOfOptions` |

**Returns**

`Promise`<`bigint`>

Balance as a raw `bigint`.

**Example**

```ts
const raw = await augustSdk.evm.balanceOf({ asset: usdcAddress, owner });
```

**depositNative()**

> **depositNative**(`options`): `Promise`<`string`>

Deposit the chain's native asset (ETH / AVAX / etc.) into a vault by routing through the `MultiAssetNativeDepositWrapper`. The wrapper handles native-to-wrapped conversion and the subsequent vault deposit in a single transaction.

**Parameters**

| Parameter | Type                    | Description                                                                                                                                                           |
| --------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options` | `INativeDepositOptions` | INativeDepositOptions: `wrapperAddress`, `amount` (native, scaled by the chain's native decimals), optional `receiver` (defaults to the signer), and optional `wait`. |

**Returns**

`Promise`<`string`>

The deposit `TransactionResponse`.

**Throws**

AugustValidationError on invalid inputs.

**Throws**

AugustSDKError on RPC / contract revert.

**Example**

```ts
const tx = await augustSdk.evm.depositNative({
  wrapperAddress: nativeWrapperAddress,
  amount: parseEther('1'),
  wait: true,
});
```

**depositNativeViaSwapRouter()**

> **depositNativeViaSwapRouter**(`options`): `Promise`<`string`>

Deposit native ETH (or chain-native equivalent) into a vault via the SwapRouter. Only valid when the vault's reference asset is the chain's wrapped-native token — the SwapRouter wraps `amount` and deposits.

**Parameters**

| Parameter | Type                              | Description                      |
| --------- | --------------------------------- | -------------------------------- |
| `options` | `ISwapRouterNativeDepositOptions` | ISwapRouterNativeDepositOptions. |

**Returns**

`Promise`<`string`>

The transaction hash of the `depositNativeToken` call.

**depositViaSwapRouter()**

> **depositViaSwapRouter**(`options`): `Promise`<`string`>

Deposit a vault's reference asset through the SwapRouter — no swap. Use this when the caller already holds the reference asset but wants the origin/referral fee accounting that the SwapRouter path provides.

**Parameters**

| Parameter | Type                              | Description                      |
| --------- | --------------------------------- | -------------------------------- |
| `options` | `ISwapRouterDirectDepositOptions` | ISwapRouterDirectDepositOptions. |

**Returns**

`Promise`<`string`>

The transaction hash of the `deposit` call.

**getDeposited()**

> **getDeposited**(`options`): `Promise`<`INormalizedNumber`>

**Parameters**

| Parameter           | Type                                                                                               |
| ------------------- | -------------------------------------------------------------------------------------------------- |
| `options`           | { `vault`: `` `0x${string}` ``; `wallet`: `` `0x${string}` ``; `whitelist`: `` `0x${string}` ``; } |
| `options.vault`     | `` `0x${string}` ``                                                                                |
| `options.wallet`    | `` `0x${string}` ``                                                                                |
| `options.whitelist` | `` `0x${string}` ``                                                                                |

**Returns**

`Promise`<`INormalizedNumber`>

**getRemainingAllocations()**

> **getRemainingAllocations**(`options`): `Promise`<`INormalizedNumber`>

**Parameters**

| Parameter                   | Type                                                                                                                              |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `options`                   | { `depositCapAmount?`: `bigint`; `vault`: `` `0x${string}` ``; `wallet`: `` `0x${string}` ``; `whitelist`: `` `0x${string}` ``; } |
| `options.depositCapAmount?` | `bigint`                                                                                                                          |
| `options.vault`             | `` `0x${string}` ``                                                                                                               |
| `options.wallet`            | `` `0x${string}` ``                                                                                                               |
| `options.whitelist`         | `` `0x${string}` ``                                                                                                               |

**Returns**

`Promise`<`INormalizedNumber`>

**isWhitelisted()**

> **isWhitelisted**(`options`): `Promise`<`boolean`>

**Parameters**

| Parameter           | Type                                                                 |
| ------------------- | -------------------------------------------------------------------- |
| `options`           | { `wallet`: `` `0x${string}` ``; `whitelist`: `` `0x${string}` ``; } |
| `options.wallet`    | `` `0x${string}` ``                                                  |
| `options.whitelist` | `` `0x${string}` ``                                                  |

**Returns**

`Promise`<`boolean`>

**maxDeposit()**

> **maxDeposit**(`options`): `Promise`<`bigint`>

Read the maximum deposit accepted by the vault for the supplied receiver. Useful for "vault is full" gates.

**Parameters**

| Parameter | Type                 |
| --------- | -------------------- |
| `options` | `IMaxDepositOptions` |

**Returns**

`Promise`<`bigint`>

Max deposit as a raw `bigint`.

**Example**

```ts
const cap = await augustSdk.evm.maxDeposit({ vault });
```

**previewDeposit()**

> **previewDeposit**(`options`): `Promise`<`bigint`>

Preview the share output of a deposit without broadcasting a transaction. See readPreviewDeposit for the routing details (EVM-1 vs EVM-2 multi-asset vaults).

**Parameters**

| Parameter | Type                     |
| --------- | ------------------------ |
| `options` | `IPreviewDepositOptions` |

**Returns**

`Promise`<`bigint`>

Shares minted in raw on-chain units (share-token decimals).

**Example**

```ts
const shares = await augustSdk.evm.previewDeposit({
  vault: '0x...',
  amount: 1_000_000n,
});
```

**previewRedeem()**

> **previewRedeem**(`options`): `Promise`<`bigint`>

Preview the assets returned by redeeming a number of shares, without broadcasting a transaction.

**Parameters**

| Parameter | Type                    |
| --------- | ----------------------- |
| `options` | `IPreviewRedeemOptions` |

**Returns**

`Promise`<`bigint`>

Assets returned in raw on-chain units (asset decimals).

**Example**

```ts
const assets = await augustSdk.evm.previewRedeem({
  vault: '0x...',
  shares: 1_000_000_000_000_000_000n,
});
```

**sendersWhitelistAddress()**

> **sendersWhitelistAddress**(`options`): `Promise`<`` `0x${string}` ``>

**Parameters**

| Parameter       | Type                              |
| --------------- | --------------------------------- |
| `options`       | { `vault`: `` `0x${string}` ``; } |
| `options.vault` | `` `0x${string}` ``               |

**Returns**

`Promise`<`` `0x${string}` ``>

**setSigner()**

> **setSigner**(`signer`): `void`

Set a new signer (supports both ethers and viem/wagmi)

**Parameters**

| Parameter | Type  | Description                                         |
| --------- | ----- | --------------------------------------------------- |
| `signer`  | `any` | Either an ethers Signer/Wallet or viem WalletClient |

**Returns**

`void`

**swapAndDeposit()**

> **swapAndDeposit**(`options`): `Promise`<`string`>

Swap one or more whitelisted ERC-20s into a vault's reference asset via the on-chain `SwapRouter` and deposit the proceeds. The router handles fee accrual, slippage protection, and the v1/v3 vs v2 deposit-interface branching. Approval is sent automatically for each `swaps[i].tokenIn` when the caller's allowance against the SwapRouter is below `amountIn`.

**Parameters**

| Parameter | Type                     | Description             |
| --------- | ------------------------ | ----------------------- |
| `options` | `ISwapAndDepositOptions` | ISwapAndDepositOptions. |

**Returns**

`Promise`<`string`>

The transaction hash of the `swapAndDeposit` call.

**Throws**

AugustValidationError on invalid inputs (bad chain, empty swaps).

**Throws**

AugustSDKError on RPC / contract revert.

**Example**

```ts
const quote = await fetchSwapQuote({
  chainId: 1, srcToken: WBTC, srcDecimals: 8,
  destToken: USDC, destDecimals: 6, amount: 100_000_000n,
  receiver: SWAP_ROUTER_ADDRESSES[1]!,
});
const hash = await augustSdk.evm.swapAndDeposit({
  chainId: 1, vault, receiver: wallet,
  swaps: [{ tokenIn: WBTC, tokenOut: USDC, amountIn: 100_000_000n,
    minAmountOut: quote.minAmountOut, router: quote.router, payload: quote.payload }],
});
```

**vaultAllowance()**

> **vaultAllowance**(`options`): `Promise`<`INormalizedNumber`>

Read the ERC-20 allowance the wallet has granted the vault to spend its underlying asset, returned as a normalized number. For the newer typed read that returns a raw `bigint` and accepts an explicit `asset` override, use [EVMAdapter.allowance](#allowance).

Only `target` (vault address) and `wallet` are read from `options`; the remaining IContractWriteOptions fields are ignored.

**Parameters**

| Parameter | Type                    | Description                                  |
| --------- | ----------------------- | -------------------------------------------- |
| `options` | `IContractWriteOptions` | `{ target, wallet }` (other fields ignored). |

**Returns**

`Promise`<`INormalizedNumber`>

Normalized allowance (`{ raw, normalized }`), or `undefined` when `target` / `wallet` fail address validation.

**Example**

```ts
const a = await augustSdk.evm.vaultAllowance({
  target: vaultAddress,
  wallet: walletAddress,
});
console.log(a?.normalized);
```

**vaultApprove()**

> **vaultApprove**(`options`): `Promise`<`string`>

**Parameters**

| Parameter | Type                    |
| --------- | ----------------------- |
| `options` | `IContractWriteOptions` |

**Returns**

`Promise`<`string`>

**vaultDeposit()**

> **vaultDeposit**(`options`): `Promise`<`string`>

Deposit into an August vault. Routes automatically: V1 single-asset vaults deposit the underlying directly; V2 multi-asset vaults route through the adapter for non-underlying `depositAsset`. If allowance is insufficient the method submits an approve transaction first (the approve step always waits for confirmation to close a race window, regardless of `wait`).

**Parameters**

| Parameter | Type                    | Description                                                                                                                                                                                        |
| --------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options` | `IContractWriteOptions` | IContractWriteOptions. `target` and `wallet` are required; pass `amount`, `depositAsset` (defaults to the vault's underlying), `chainId`, `poolName`, `wait`, and `isDepositWithPermit` as needed. |

**Returns**

`Promise`<`string`>

The deposit `TransactionResponse`, or `undefined` if an approval-only path was taken and no deposit transaction was sent.

**Throws**

AugustValidationError on invalid inputs (bad address, bad amount).

**Throws**

AugustSDKError on RPC / contract revert during the deposit.

**Example**

```ts
const tx = await augustSdk.evm.vaultDeposit({
  target: vaultAddress,
  wallet: walletAddress,
  amount: '100',
  wait: true,
});
```

**vaultRedeem()**

> **vaultRedeem**(`options`): `Promise`<`string`>

Claim assets from a matured redemption request on a dated-redemption (RWA-style) vault. The `year`, `month`, `day`, and `receiverIndex` tuple identifies which batch of the user's matured requests to redeem from — these are emitted at request-time and indexed by the subgraph.

For non-dated vaults that complete their redemption via `instantRedeem`, see [EVMAdapter.vaultRequestRedeem](#vaultrequestredeem) with `isInstantRedeem: true`.

**Parameters**

| Parameter | Type                               | Description                                                                                                   |
| --------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `options` | `IContractWriteOptions` & `object` | IContractWriteOptions plus `year` / `month` / `day` / `receiverIndex` identifying the matured batch to claim. |

**Returns**

`Promise`<`string`>

The redeem `TransactionResponse`.

**Throws**

AugustValidationError on invalid inputs.

**Throws**

AugustSDKError on RPC / contract revert.

**Example**

```ts
const tx = await augustSdk.evm.vaultRedeem({
  target: vaultAddress,
  wallet: walletAddress,
  amount: shareAmount,
  year: '2026',
  month: '06',
  day: '02',
  receiverIndex: '0',
  wait: true,
});
```

**vaultRequestRedeem()**

> **vaultRequestRedeem**(`options`): `Promise`<`string`>

Submit a redemption request against a vault. Shares are escrowed and the underlying assets are released asynchronously by the protocol; callers collect the matured assets via [EVMAdapter.vaultRedeem](#vaultredeem), or use the instant-redeem variant by setting `isInstantRedeem: true`.

**Parameters**

| Parameter | Type                    | Description                                                                                                                                                               |
| --------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options` | `IContractWriteOptions` | IContractWriteOptions. `target`, `wallet`, and `amount` (in shares) are required. Set `isInstantRedeem: true` to take the instant-redeem path when the vault supports it. |

**Returns**

`Promise`<`string`>

The request `TransactionResponse`, or `undefined` if the request could not be built (validation failure).

**Throws**

AugustValidationError on invalid inputs.

**Throws**

AugustSDKError on RPC / contract revert.

**Example**

```ts
const tx = await augustSdk.evm.vaultRequestRedeem({
  target: vaultAddress,
  wallet: walletAddress,
  amount: shareAmount,
  wait: true,
});
```

### Functions

#### getEvmVaultV1()

> **getEvmVaultV1**(`tokenizedVault`, `options`): `Promise`<`IVault`>

Fetch EVM vault data for v1 vault contracts (legacy format). Queries on-chain state and combines with backend metadata.

**Parameters**

| Parameter        | Type                                                                                    | Description                         |
| ---------------- | --------------------------------------------------------------------------------------- | ----------------------------------- |
| `tokenizedVault` | `ITokenizedVault`                                                                       | Vault metadata from backend         |
| `options`        | [`IVaultBaseOptions`](/developers/typescript-sdk/api/augustvaults.md#ivaultbaseoptions) | RPC configuration and chain details |

**Returns**

`Promise`<`IVault`>

Formatted vault object or null if closed/invisible

***

#### getEvmVaultV2()

> **getEvmVaultV2**(`tokenizedVault`, `options`): `Promise`<`IVault`>

Fetch EVM vault data for v2 vault contracts (current format). V2 vaults use separate contracts for vault, receipt token, and whitelist. Queries all three contracts and combines results.

**Parameters**

| Parameter        | Type                                                                                    | Description                         |
| ---------------- | --------------------------------------------------------------------------------------- | ----------------------------------- |
| `tokenizedVault` | `ITokenizedVault`                                                                       | Vault metadata from backend         |
| `options`        | [`IVaultBaseOptions`](/developers/typescript-sdk/api/augustvaults.md#ivaultbaseoptions) | RPC configuration and chain details |

**Returns**

`Promise`<`IVault`>

Formatted vault object or null if closed/invisible


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.augustdigital.io/developers/typescript-sdk/api/evmadapter.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
