Orderly network core.EtherAdapter
Orderly SDKs / Modules / @orderly.network/core / EtherAdapter
Class: EtherAdapter
@orderly.network/core.EtherAdapter
Implements
Table of contents
Constructors
Properties
Accessors
Methods
- call
- callOnChain
- deposit
- estimateGas
- formatUnits
- getBalance
- getContract
- getTransactionRecipect
- off
- on
- parseUnits
- pollTransactionReceiptWithBackoff
- send
- sendTransaction
- signTypedData
- verify
Constructors
constructor
• new EtherAdapter(options
)
Parameters
Name | Type |
---|---|
options | WalletAdapterOptions |
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
Name | Type |
---|---|
chainId | number |
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
Name | Type |
---|---|
address | string |
method | string |
params | any [] |
options | Object |
options.abi | any |
Returns
Promise
<any
>
Implementation of
Defined in
packages/core/src/wallet/etherAdapter.ts:51
callOnChain
▸ callOnChain(chain
, address
, method
, params
, options
): Promise
<any
>
Parameters
Name | Type |
---|---|
chain | NetworkInfos |
address | string |
method | string |
params | any [] |
options | Object |
options.abi | any |
Returns
Promise
<any
>
Implementation of
Defined in
packages/core/src/wallet/etherAdapter.ts:70
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
estimateGas
▸ Private
estimateGas(tx
): Promise
<number
>
Parameters
Name | Type |
---|---|
tx | TransactionRequest |
Returns
Promise
<number
>
Defined in
packages/core/src/wallet/etherAdapter.ts:194
formatUnits
▸ formatUnits(amount
): string
Parameters
Name | Type |
---|---|
amount | string |
Returns
string
Implementation of
Defined in
packages/core/src/wallet/etherAdapter.ts:34
getBalance
▸ getBalance(userAddress
): Promise
<any
>
Parameters
Name | Type |
---|---|
userAddress | string |
Returns
Promise
<any
>
Implementation of
Defined in
packages/core/src/wallet/etherAdapter.ts:37
getContract
▸ getContract(address
, abi
): Contract
Parameters
Name | Type |
---|---|
address | string |
abi | any |
Returns
Contract
Defined in
packages/core/src/wallet/etherAdapter.ts:221
getTransactionRecipect
▸ getTransactionRecipect(txHash
): Promise
<void
>
Parameters
Name | Type |
---|---|
txHash | string |
Returns
Promise
<void
>
Implementation of
WalletAdapter.getTransactionRecipect
Defined in
packages/core/src/wallet/etherAdapter.ts:164
off
▸ off(eventName
, listener
): void
Parameters
Name | Type |
---|---|
eventName | any |
listener | any |
Returns
void
Implementation of
Defined in
packages/core/src/wallet/etherAdapter.ts:217
on
▸ on(eventName
, listener
): void
Parameters
Name | Type |
---|---|
eventName | any |
listener | any |
Returns
void
Implementation of
Defined in
packages/core/src/wallet/etherAdapter.ts:213
parseUnits
▸ parseUnits(amount
): string
Parameters
Name | Type |
---|---|
amount | string |
Returns
string
Implementation of
Defined in
packages/core/src/wallet/etherAdapter.ts:31
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.pollTransactionReceiptWithBackoff
Defined in
packages/core/src/wallet/etherAdapter.ts:170
send
▸ send(method
, params
): Promise
<any
>
Parameters
Name | Type |
---|---|
method | string |
params | any [] | Record <string , any > |
Returns
Promise
<any
>
Implementation of
Defined in
packages/core/src/wallet/etherAdapter.ts:105
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
Defined in
packages/core/src/wallet/etherAdapter.ts:112
signTypedData
▸ signTypedData(address
, data
): Promise
<any
>
Parameters
Name | Type |
---|---|
address | string |
data | any |
Returns
Promise
<any
>
Implementation of
Defined in
packages/core/src/wallet/etherAdapter.ts:200
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
>