注意: このページはまだ日本語に翻訳されていません。以下は英語の原文です。An AbstractProvider provides a base class for other sub-classes to implement the Provider API by normalizing input arguments and formatting output results as well as tracking events for consistent behaviour on an eventually-consistent network.
Type parameter | Value |
---|---|
C | FetchRequest |
network
, or use the various network detection capabilities to
discover the Network if necessary.
Parameter | Type | Description |
---|---|---|
_network ? | Networkish | The network to connect to, or "any" to |
options ? | AbstractProviderOptions | The options to configure the provider. |
AbstractProvider
<C
>
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.
Parameter | Type | Description |
---|---|---|
timerId | number | The ID of the timer to clear. |
void
super.destroy()
.
void
Provider
.destroy
Promise
<Shard
[]>
A promise that resolves to the active shards.
Promise
<Zone
[]>
A promise that resolves to the active zones.
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.
Provider
.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.
Provider
.getLatestQuaiToQiRate
Promise
<number
>
A promise that resolves to the protocol expansion number.
Provider
.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.
Provider
.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.
Provider
.getQuaiToQiRateAtBlock
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.
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
void
Parameter | Type | Description |
---|---|---|
hash | string | The hash to get the shard from. |
Shard
The shard.
Parameter | Type | Description |
---|---|---|
_address | AddressLike | The address to get the zone from. |
Promise
<Zone
>
A promise that resolves to the zone.
Parameter | Type | Description |
---|---|---|
hash | string | The hash to get the zone from. |
Zone
The zone.