ethereum
provider, optionally forcing the network
.
Parameter | Type | Description |
---|---|---|
ethereum | Eip1193Provider | The EIP-1193 provider. |
network ? | Networkish | The network to connect to. |
BrowserProvider
JsonRpcApiProvider
.constructor
FetchRequest
[]
The list of connected FetchRequests.
boolean
paused = true
is identical to calling .pause(false)
, which will buffer any events that occur while
paused until the provider is unpaused.
boolean
Whether the provider is paused.
number
The polling interval.
this
, to allow an AbstractProvider to implement the Contract Runner
interface.
this
The provider instance.
boolean
True if the provider is ready.
Parameter | Type | Description |
---|---|---|
timerId | number | The ID of the timer to clear. |
void
JsonRpcApiProvider
._clearTimeout
void
JsonRpcApiProvider
.destroy
Promise
<Shard
[]>
A promise that resolves to the active shards.
JsonRpcApiProvider
.getActiveRegions
Promise
<Zone
[]>
A promise that resolves to the active zones.
JsonRpcApiProvider
.getActiveZones
Parameter | Type | Description |
---|---|---|
zone | Zone | The zone to get the rate for. |
amt ? | bigint | The amount to get the rate for. Default is 1 |
Promise
<bigint
>
A promise that resolves to the latest Qi rate.
JsonRpcApiProvider
.getLatestQiToQuaiRate
Parameter | Type | Description |
---|---|---|
zone | Zone | The zone to get the rate for. |
amt ? | bigint | The amount in quais to get the rate for. Default is 1 |
Promise
<bigint
>
A promise that resolves to the latest Quai -> Qi rate for the given amount.
JsonRpcApiProvider
.getLatestQuaiToQiRate
Promise
<number
>
A promise that resolves to the protocol expansion number.
JsonRpcApiProvider
.getProtocolExpansionNumber
Parameter | Type | Description |
---|---|---|
zone | Zone | The zone to get the rate for. |
blockTag | BlockTag | The block tag to get the rate at. |
amt ? | bigint | The amount to get the rate for. Default is 1 |
Promise
<bigint
>
A promise that resolves to the Qi rate at the specified block.
JsonRpcApiProvider
.getQiToQuaiRateAtBlock
Parameter | Type | Description |
---|---|---|
zone | Zone | The zone to get the rate for. |
blockTag | BlockTag | The block tag to get the rate at. |
amt ? | bigint | The amount to get the rate for. Default is 1 |
Promise
<bigint
>
A promise that resolves to the Quai rate at the specified block.
JsonRpcApiProvider
.getQuaiToQiRateAtBlock
Parameter | Type | Description |
---|---|---|
payload | JsonRpcPayload | The JSON-RPC payload. |
error | JsonRpcError | The JSON-RPC error. |
Error
The RPC error.
JsonRpcApiProvider.getRpcError
Parameter | Type | Description |
---|---|---|
address ? | string | number | The address to get the signer for. |
Promise
<JsonRpcSigner
>
The signer for the address.
JsonRpcApiProvider
.getSigner
true
if the provider manages the address
.
Parameter | Type | Description |
---|---|---|
address | string | number | The address to check. |
Promise
<boolean
>
Resolves to true
if the provider manages the address
.
Type parameter | Value |
---|---|
U | string [] | FetchRequest |
Parameter | Type | Description |
---|---|---|
urls | U | The URLs to initialize the map with. |
Promise
<void
>
A promise that resolves when the map is initialized.
JsonRpcApiProvider
.initialize
Promise
<JsonRpcSigner
[]>
A promise that resolves to an array of JsonRpcSigners.
JsonRpcApiProvider
.listAccounts
dropWhilePaused
, any events that occur while paused are dropped, otherwise all events
will be emitted once the provider is unpaused.
Parameter | Type | Description |
---|---|---|
dropWhilePaused ? | boolean | Whether to drop events while paused. |
void
JsonRpcApiProvider
.pause
void
JsonRpcApiProvider
.resume
Parameter | Type | Description |
---|---|---|
method | string | The method name. |
params | any [] | Record <string , any > | The parameters for the method. |
shard ? | Shard | - |
Promise
<any
>
The result of the request.
JsonRpcApiProvider
.send
Parameter | Type | Description |
---|---|---|
hash | string | The hash to get the shard from. |
Shard
The shard.
JsonRpcApiProvider
.shardFromHash
Parameter | Type | Description |
---|---|---|
_address | AddressLike | The address to get the zone from. |
Promise
<Zone
>
A promise that resolves to the zone.
JsonRpcApiProvider
.zoneFromAddress
Parameter | Type | Description |
---|---|---|
hash | string | The hash to get the zone from. |
Zone
The zone.
JsonRpcApiProvider
.zoneFromHash