Class: EtherAdapter
@orderly.network/core.EtherAdapterImplements
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:22Properties
_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:20provider
•Private
Optional
provider: BrowserProvider
Defined in
packages/core/src/wallet/etherAdapter.ts:19Accessors
addresses
•get
addresses(): string
Returns
string
Implementation of
IWalletAdapter.addressesDefined in
packages/core/src/wallet/etherAdapter.ts:101chainId
•get
chainId(): number
Returns
number
Implementation of
IWalletAdapter.chainIdDefined 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.chainIdDefined in
packages/core/src/wallet/etherAdapter.ts:97Methods
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.callDefined in
packages/core/src/wallet/etherAdapter.ts:51callOnChain
▸ 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
WalletAdapter.callOnChainDefined in
packages/core/src/wallet/etherAdapter.ts:70deposit
▸ 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:47estimateGas
▸Private
estimateGas(tx
): Promise
<number
>
Parameters
Name | Type |
---|---|
tx | TransactionRequest |
Returns
Promise
<number
>
Defined in
packages/core/src/wallet/etherAdapter.ts:194formatUnits
▸ formatUnits(amount
): string
Parameters
Name | Type |
---|---|
amount | string |
Returns
string
Implementation of
WalletAdapter.formatUnitsDefined in
packages/core/src/wallet/etherAdapter.ts:34getBalance
▸ getBalance(userAddress
): Promise
<any
>
Parameters
Name | Type |
---|---|
userAddress | string |
Returns
Promise
<any
>
Implementation of
WalletAdapter.getBalanceDefined in
packages/core/src/wallet/etherAdapter.ts:37getContract
▸ getContract(address
, abi
): Contract
Parameters
Name | Type |
---|---|
address | string |
abi | any |
Returns
Contract
Defined in
packages/core/src/wallet/etherAdapter.ts:221getTransactionRecipect
▸ getTransactionRecipect(txHash
): Promise
<void
>
Parameters
Name | Type |
---|---|
txHash | string |
Returns
Promise
<void
>
Implementation of
WalletAdapter.getTransactionRecipectDefined in
packages/core/src/wallet/etherAdapter.ts:164off
▸ off(eventName
, listener
): void
Parameters
Name | Type |
---|---|
eventName | any |
listener | any |
Returns
void
Implementation of
WalletAdapter.offDefined in
packages/core/src/wallet/etherAdapter.ts:217on
▸ on(eventName
, listener
): void
Parameters
Name | Type |
---|---|
eventName | any |
listener | any |
Returns
void
Implementation of
WalletAdapter.onDefined in
packages/core/src/wallet/etherAdapter.ts:213parseUnits
▸ parseUnits(amount
): string
Parameters
Name | Type |
---|---|
amount | string |
Returns
string
Implementation of
WalletAdapter.parseUnitsDefined in
packages/core/src/wallet/etherAdapter.ts:31pollTransactionReceiptWithBackoff
▸ 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.pollTransactionReceiptWithBackoffDefined in
packages/core/src/wallet/etherAdapter.ts:170send
▸ send(method
, params
): Promise
<any
>
Parameters
Name | Type |
---|---|
method | string |
params | any [] | Record <string , any > |
Returns
Promise
<any
>
Implementation of
WalletAdapter.sendDefined in
packages/core/src/wallet/etherAdapter.ts:105sendTransaction
▸ 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.sendTransactionDefined in
packages/core/src/wallet/etherAdapter.ts:112signTypedData
▸ signTypedData(address
, data
): Promise
<any
>
Parameters
Name | Type |
---|---|
address | string |
data | any |
Returns
Promise
<any
>
Implementation of
WalletAdapter.signTypedDataDefined in
packages/core/src/wallet/etherAdapter.ts:200verify
▸ verify(data
, signature
): Promise
<void
>
Parameters
Name | Type |
---|---|
data | Object |
data.domain | any |
data.message | any |
data.types | any |
signature | string |
Returns
Promise
<void
>