_start()
method once connectedType parameter | Value |
---|---|
C | FetchRequest |
Parameter | Type | Description |
---|---|---|
network ? | Networkish | The network to connect to. |
options ? | JsonRpcApiProviderOptions | The options for the provider. |
JsonRpcApiProvider
<C
>
AbstractProvider
.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
AbstractProvider
._clearTimeout
void
AbstractProvider
.destroy
Promise
<Shard
[]>
A promise that resolves to the active shards.
AbstractProvider
.getActiveRegions
Promise
<Zone
[]>
A promise that resolves to the active zones.
AbstractProvider
.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.
AbstractProvider
.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.
AbstractProvider
.getLatestQuaiToQiRate
Promise
<number
>
A promise that resolves to the protocol expansion number.
AbstractProvider
.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.
AbstractProvider
.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.
AbstractProvider
.getQuaiToQiRateAtBlock
Parameter | Type | Description |
---|---|---|
address ? | string | number | The address or index of the account. |
Promise
<JsonRpcSigner
>
A promise that resolves to the JsonRpcSigner.
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.
AbstractProvider
.initialize
Promise
<JsonRpcSigner
[]>
A promise that resolves to an array of JsonRpcSigners.
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
AbstractProvider
.pause
void
AbstractProvider
.resume
method
with params
via the JSON-RPC protocol over the underlying channel. This can be used to
call methods on the backend that do not have a high-level API within the Provider API.
This method queues requests according to the batch constraints in the options, assigns the request a unique ID.
Do NOT override this method in sub-classes; instead override JsonRpcApiProvider._send | _send or
force the options values in the call to the constructor to modify this method’s behavior.
Parameter | Type | Description |
---|---|---|
method | string | The method to call. |
params | any [] | Record <string , any > | The parameters to pass to the method. |
shard ? | Shard | The shard to send the request to. |
now ? | boolean | If true, the request will be sent immediately. |
Promise
<any
>
A promise that resolves to the result of the method call.
Parameter | Type | Description |
---|---|---|
hash | string | The hash to get the shard from. |
Shard
The shard.
AbstractProvider
.shardFromHash
Parameter | Type | Description |
---|---|---|
_address | AddressLike | The address to get the zone from. |
Promise
<Zone
>
A promise that resolves to the zone.
AbstractProvider
.zoneFromAddress
Parameter | Type | Description |
---|---|---|
hash | string | The hash to get the zone from. |
Zone
The zone.
AbstractProvider
.zoneFromHash