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

# Orderly network core.EtherAdapter

[Orderly SDKs](/sdks/tech-doc/README) / [Modules](/sdks/tech-doc/modules) / [@orderly.network/core](/sdks/tech-doc/modules/orderly_network_core) / EtherAdapter

# Class: EtherAdapter

[@orderly.network/core](/sdks/tech-doc/modules/orderly_network_core).EtherAdapter

## Implements

* [`WalletAdapter`](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter)

## Table of contents

### Constructors

* [constructor](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#constructor)

### Properties

* [\_address](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#_address)
* [\_chainId](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#_chainid)
* [provider](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#provider)

### Accessors

* [addresses](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#addresses)
* [chainId](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#chainid)

### Methods

* [call](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#call)
* [callOnChain](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#callonchain)
* [deposit](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#deposit)
* [estimateGas](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#estimategas)
* [formatUnits](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#formatunits)
* [getBalance](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#getbalance)
* [getContract](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#getcontract)
* [getTransactionRecipect](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#gettransactionrecipect)
* [off](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#off)
* [on](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#on)
* [parseUnits](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#parseunits)
* [pollTransactionReceiptWithBackoff](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#polltransactionreceiptwithbackoff)
* [send](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#send)
* [sendTransaction](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#sendtransaction)
* [signTypedData](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#signtypeddata)
* [verify](/sdks/tech-doc/classes/orderly_network_core.EtherAdapter#verify)

## Constructors

### constructor

• **new EtherAdapter**(`options`)

#### Parameters

| Name      | Type                                                                                       |
| :-------- | :----------------------------------------------------------------------------------------- |
| `options` | [`WalletAdapterOptions`](/sdks/tech-doc/modules/orderly_network_core#walletadapteroptions) |

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:22](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L22)

## Properties

### \_address

• `Private` **\_address**: `string`

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:21](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L21)

***

### \_chainId

• `Private` **\_chainId**: `number`

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:20](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L20)

***

### provider

• `Private` `Optional` **provider**: `BrowserProvider`

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:19](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L19)

## Accessors

### addresses

• `get` **addresses**(): `string`

#### Returns

`string`

#### Implementation of

IWalletAdapter.addresses

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:101](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L101)

***

### chainId

• `get` **chainId**(): `number`

#### Returns

`number`

#### Implementation of

IWalletAdapter.chainId

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:93](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L93)

• `set` **chainId**(`chainId`): `void`

Set the chain id

#### Parameters

| Name      | Type     |
| :-------- | :------- |
| `chainId` | `number` |

#### Returns

`void`

#### Implementation of

IWalletAdapter.chainId

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:97](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L97)

## Methods

### call

▸ **call**(`address`, `method`, `params`, `options`): `Promise`\<`any`>

#### Parameters

| Name          | Type     |
| :------------ | :------- |
| `address`     | `string` |
| `method`      | `string` |
| `params`      | `any`\[] |
| `options`     | `Object` |
| `options.abi` | `any`    |

#### Returns

`Promise`\<`any`>

#### Implementation of

[WalletAdapter](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter).[call](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter#call)

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:51](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L51)

***

### callOnChain

▸ **callOnChain**(`chain`, `address`, `method`, `params`, `options`): `Promise`\<`any`>

#### Parameters

| Name          | Type                                                                               |
| :------------ | :--------------------------------------------------------------------------------- |
| `chain`       | [`NetworkInfos`](/sdks/tech-doc/interfaces/orderly_network_types.API.NetworkInfos) |
| `address`     | `string`                                                                           |
| `method`      | `string`                                                                           |
| `params`      | `any`\[]                                                                           |
| `options`     | `Object`                                                                           |
| `options.abi` | `any`                                                                              |

#### Returns

`Promise`\<`any`>

#### Implementation of

[WalletAdapter](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter).[callOnChain](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter#callonchain)

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:70](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L70)

***

### deposit

▸ **deposit**(`from`, `to`, `amount`): `Promise`\<`any`>

#### Parameters

| Name     | Type     |
| :------- | :------- |
| `from`   | `string` |
| `to`     | `string` |
| `amount` | `string` |

#### Returns

`Promise`\<`any`>

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:47](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L47)

***

### estimateGas

▸ `Private` **estimateGas**(`tx`): `Promise`\<`number`>

#### Parameters

| Name | Type                 |
| :--- | :------------------- |
| `tx` | `TransactionRequest` |

#### Returns

`Promise`\<`number`>

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:194](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L194)

***

### formatUnits

▸ **formatUnits**(`amount`): `string`

#### Parameters

| Name     | Type     |
| :------- | :------- |
| `amount` | `string` |

#### Returns

`string`

#### Implementation of

[WalletAdapter](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter).[formatUnits](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter#formatunits)

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:34](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L34)

***

### getBalance

▸ **getBalance**(`userAddress`): `Promise`\<`any`>

#### Parameters

| Name          | Type     |
| :------------ | :------- |
| `userAddress` | `string` |

#### Returns

`Promise`\<`any`>

#### Implementation of

[WalletAdapter](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter).[getBalance](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter#getbalance)

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:37](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L37)

***

### getContract

▸ **getContract**(`address`, `abi`): `Contract`

#### Parameters

| Name      | Type     |
| :-------- | :------- |
| `address` | `string` |
| `abi`     | `any`    |

#### Returns

`Contract`

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:221](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L221)

***

### getTransactionRecipect

▸ **getTransactionRecipect**(`txHash`): `Promise`\<`void`>

#### Parameters

| Name     | Type     |
| :------- | :------- |
| `txHash` | `string` |

#### Returns

`Promise`\<`void`>

#### Implementation of

[WalletAdapter](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter).[getTransactionRecipect](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter#gettransactionrecipect)

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:164](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L164)

***

### off

▸ **off**(`eventName`, `listener`): `void`

#### Parameters

| Name        | Type  |
| :---------- | :---- |
| `eventName` | `any` |
| `listener`  | `any` |

#### Returns

`void`

#### Implementation of

[WalletAdapter](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter).[off](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter#off)

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:217](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L217)

***

### on

▸ **on**(`eventName`, `listener`): `void`

#### Parameters

| Name        | Type  |
| :---------- | :---- |
| `eventName` | `any` |
| `listener`  | `any` |

#### Returns

`void`

#### Implementation of

[WalletAdapter](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter).[on](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter#on)

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:213](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L213)

***

### parseUnits

▸ **parseUnits**(`amount`): `string`

#### Parameters

| Name     | Type     |
| :------- | :------- |
| `amount` | `string` |

#### Returns

`string`

#### Implementation of

[WalletAdapter](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter).[parseUnits](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter#parseunits)

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:31](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L31)

***

### pollTransactionReceiptWithBackoff

▸ **pollTransactionReceiptWithBackoff**(`txHash`, `baseInterval?`, `maxInterval?`, `maxRetries?`): `Promise`\<`TransactionReceipt`>

#### Parameters

| Name           | Type     | Default value |
| :------------- | :------- | :------------ |
| `txHash`       | `string` | `undefined`   |
| `baseInterval` | `number` | `1000`        |
| `maxInterval`  | `number` | `6000`        |
| `maxRetries`   | `number` | `30`          |

#### Returns

`Promise`\<`TransactionReceipt`>

#### Implementation of

[WalletAdapter](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter).[pollTransactionReceiptWithBackoff](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter#polltransactionreceiptwithbackoff)

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:170](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L170)

***

### send

▸ **send**(`method`, `params`): `Promise`\<`any`>

#### Parameters

| Name     | Type                                   |
| :------- | :------------------------------------- |
| `method` | `string`                               |
| `params` | `any`\[] \| `Record`\<`string`, `any`> |

#### Returns

`Promise`\<`any`>

#### Implementation of

[WalletAdapter](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter).[send](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter#send)

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:105](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L105)

***

### sendTransaction

▸ **sendTransaction**(`contractAddress`, `method`, `payload`, `options`): `Promise`\<`TransactionResponse`>

#### Parameters

| Name              | Type     |
| :---------------- | :------- |
| `contractAddress` | `string` |
| `method`          | `string` |
| `payload`         | `Object` |
| `payload.data`    | `any`\[] |
| `payload.from`    | `string` |
| `payload.to?`     | `string` |
| `payload.value?`  | `bigint` |
| `options`         | `Object` |
| `options.abi`     | `any`    |

#### Returns

`Promise`\<`TransactionResponse`>

#### Implementation of

[WalletAdapter](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter).[sendTransaction](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter#sendtransaction)

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:112](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L112)

***

### signTypedData

▸ **signTypedData**(`address`, `data`): `Promise`\<`any`>

#### Parameters

| Name      | Type     |
| :-------- | :------- |
| `address` | `string` |
| `data`    | `any`    |

#### Returns

`Promise`\<`any`>

#### Implementation of

[WalletAdapter](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter).[signTypedData](/sdks/tech-doc/interfaces/orderly_network_core.WalletAdapter#signtypeddata)

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:200](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L200)

***

### verify

▸ **verify**(`data`, `signature`): `Promise`\<`void`>

#### Parameters

| Name           | Type     |
| :------------- | :------- |
| `data`         | `Object` |
| `data.domain`  | `any`    |
| `data.message` | `any`    |
| `data.types`   | `any`    |
| `signature`    | `string` |

#### Returns

`Promise`\<`void`>

#### Defined in

[packages/core/src/wallet/etherAdapter.ts:204](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/core/src/wallet/etherAdapter.ts#L204)
