Orderly SDKs / Modules / @orderly.network/core / EtherAdapter

Class: EtherAdapter

@orderly.network/core.EtherAdapter

Implements

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new EtherAdapter(options)

Parameters

NameType
optionsWalletAdapterOptions

Defined in

packages/core/src/wallet/etherAdapter.ts:22

Properties

_address

Private _address: string

Defined in

packages/core/src/wallet/etherAdapter.ts:21


_chainId

Private _chainId: number

Defined in

packages/core/src/wallet/etherAdapter.ts:20


provider

Private Optional provider: BrowserProvider

Defined in

packages/core/src/wallet/etherAdapter.ts:19

Accessors

addresses

get addresses(): string

Returns

string

Implementation of

IWalletAdapter.addresses

Defined in

packages/core/src/wallet/etherAdapter.ts:101


chainId

get chainId(): number

Returns

number

Implementation of

IWalletAdapter.chainId

Defined in

packages/core/src/wallet/etherAdapter.ts:93

set chainId(chainId): void

Set the chain id

Parameters

NameType
chainIdnumber

Returns

void

Implementation of

IWalletAdapter.chainId

Defined in

packages/core/src/wallet/etherAdapter.ts:97

Methods

call

call(address, method, params, options): Promise<any>

Parameters

NameType
addressstring
methodstring
paramsany[]
optionsObject
options.abiany

Returns

Promise<any>

Implementation of

WalletAdapter.call

Defined in

packages/core/src/wallet/etherAdapter.ts:51


callOnChain

callOnChain(chain, address, method, params, options): Promise<any>

Parameters

NameType
chainNetworkInfos
addressstring
methodstring
paramsany[]
optionsObject
options.abiany

Returns

Promise<any>

Implementation of

WalletAdapter.callOnChain

Defined in

packages/core/src/wallet/etherAdapter.ts:70


deposit

deposit(from, to, amount): Promise<any>

Parameters

NameType
fromstring
tostring
amountstring

Returns

Promise<any>

Defined in

packages/core/src/wallet/etherAdapter.ts:47


estimateGas

Private estimateGas(tx): Promise<number>

Parameters

NameType
txTransactionRequest

Returns

Promise<number>

Defined in

packages/core/src/wallet/etherAdapter.ts:194


formatUnits

formatUnits(amount): string

Parameters

NameType
amountstring

Returns

string

Implementation of

WalletAdapter.formatUnits

Defined in

packages/core/src/wallet/etherAdapter.ts:34


getBalance

getBalance(userAddress): Promise<any>

Parameters

NameType
userAddressstring

Returns

Promise<any>

Implementation of

WalletAdapter.getBalance

Defined in

packages/core/src/wallet/etherAdapter.ts:37


getContract

getContract(address, abi): Contract

Parameters

NameType
addressstring
abiany

Returns

Contract

Defined in

packages/core/src/wallet/etherAdapter.ts:221


getTransactionRecipect

getTransactionRecipect(txHash): Promise<void>

Parameters

NameType
txHashstring

Returns

Promise<void>

Implementation of

WalletAdapter.getTransactionRecipect

Defined in

packages/core/src/wallet/etherAdapter.ts:164


off

off(eventName, listener): void

Parameters

NameType
eventNameany
listenerany

Returns

void

Implementation of

WalletAdapter.off

Defined in

packages/core/src/wallet/etherAdapter.ts:217


on

on(eventName, listener): void

Parameters

NameType
eventNameany
listenerany

Returns

void

Implementation of

WalletAdapter.on

Defined in

packages/core/src/wallet/etherAdapter.ts:213


parseUnits

parseUnits(amount): string

Parameters

NameType
amountstring

Returns

string

Implementation of

WalletAdapter.parseUnits

Defined in

packages/core/src/wallet/etherAdapter.ts:31


pollTransactionReceiptWithBackoff

pollTransactionReceiptWithBackoff(txHash, baseInterval?, maxInterval?, maxRetries?): Promise<TransactionReceipt>

Parameters

NameTypeDefault value
txHashstringundefined
baseIntervalnumber1000
maxIntervalnumber6000
maxRetriesnumber30

Returns

Promise<TransactionReceipt>

Implementation of

WalletAdapter.pollTransactionReceiptWithBackoff

Defined in

packages/core/src/wallet/etherAdapter.ts:170


send

send(method, params): Promise<any>

Parameters

NameType
methodstring
paramsany[] | Record<string, any>

Returns

Promise<any>

Implementation of

WalletAdapter.send

Defined in

packages/core/src/wallet/etherAdapter.ts:105


sendTransaction

sendTransaction(contractAddress, method, payload, options): Promise<TransactionResponse>

Parameters

NameType
contractAddressstring
methodstring
payloadObject
payload.dataany[]
payload.fromstring
payload.to?string
payload.value?bigint
optionsObject
options.abiany

Returns

Promise<TransactionResponse>

Implementation of

WalletAdapter.sendTransaction

Defined in

packages/core/src/wallet/etherAdapter.ts:112


signTypedData

signTypedData(address, data): Promise<any>

Parameters

NameType
addressstring
dataany

Returns

Promise<any>

Implementation of

WalletAdapter.signTypedData

Defined in

packages/core/src/wallet/etherAdapter.ts:200


verify

verify(data, signature): Promise<void>

Parameters

NameType
dataObject
data.domainany
data.messageany
data.typesany
signaturestring

Returns

Promise<void>

Defined in

packages/core/src/wallet/etherAdapter.ts:204