참고: 이 페이지는 아직 한국어로 번역되지 않았습니다. 아래는 영어 원문입니다.A BrowserProvider is intended to wrap an injected provider which adheres to the EIP-1193 standard, which most (if not all) currently do.
Extends
Constructors
new BrowserProvider()
ethereum provider, optionally forcing the network.
Parameters
| Parameter | Type | Description |
|---|---|---|
ethereum | Eip1193Provider | The EIP-1193 provider. |
network? | Networkish | The network to connect to. |
Returns
BrowserProvider
Overrides
JsonRpcApiProvider.constructor
Source
providers/provider-browser.ts:72Accessors
connect
Returns
FetchRequest[]
The list of connected FetchRequests.
Source
providers/abstract-provider.ts:1026destroyed
Returns
boolean
Source
providers/abstract-provider.ts:2545paused
paused = true is identical to calling .pause(false), which will buffer any events that occur while
paused until the provider is unpaused.
Returns
boolean
Whether the provider is paused.
Source
providers/abstract-provider.ts:2577pollingInterval
Returns
number
The polling interval.
Source
providers/abstract-provider.ts:1183provider
this, to allow an AbstractProvider to implement the Contract Runner
interface.
Returns
this
The provider instance.
Source
providers/abstract-provider.ts:1193ready
Returns
boolean
True if the provider is ready.
Source
providers/provider-jsonrpc.ts:1117Methods
_clearTimeout()
Parameters
| Parameter | Type | Description |
|---|---|---|
timerId | number | The ID of the timer to clear. |
Returns
void
Inherited from
JsonRpcApiProvider._clearTimeout
Source
providers/abstract-provider.ts:2221destroy()
Returns
void
Inherited from
JsonRpcApiProvider.destroy
Source
providers/provider-jsonrpc.ts:1587getActiveRegions()
Returns
Promise<Shard[]>
A promise that resolves to the active shards.
Inherited from
JsonRpcApiProvider.getActiveRegions
Source
providers/abstract-provider.ts:1110getActiveZones()
Returns
Promise<Zone[]>
A promise that resolves to the active zones.
Inherited from
JsonRpcApiProvider.getActiveZones
Source
providers/abstract-provider.ts:1127getLatestQiToQuaiRate()
Parameters
| Parameter | Type | Description |
|---|---|---|
zone | Zone | The zone to get the rate for. |
amt? | bigint | The amount to get the rate for. Default is 1 |
Returns
Promise<bigint>
A promise that resolves to the latest Qi rate.
Inherited from
JsonRpcApiProvider.getLatestQiToQuaiRate
Source
providers/abstract-provider.ts:1149getLatestQuaiToQiRate()
Parameters
| 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 |
Returns
Promise<bigint>
A promise that resolves to the latest Quai -> Qi rate for the given amount.
Inherited from
JsonRpcApiProvider.getLatestQuaiToQiRate
Source
providers/abstract-provider.ts:1068getProtocolExpansionNumber()
Returns
Promise<number>
A promise that resolves to the protocol expansion number.
Inherited from
JsonRpcApiProvider.getProtocolExpansionNumber
Source
providers/abstract-provider.ts:1101getQiToQuaiRateAtBlock()
Parameters
| 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 |
Returns
Promise<bigint>
A promise that resolves to the Qi rate at the specified block.
Inherited from
JsonRpcApiProvider.getQiToQuaiRateAtBlock
Source
providers/abstract-provider.ts:1162getQuaiToQiRateAtBlock()
Parameters
| 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 |
Returns
Promise<bigint>
A promise that resolves to the Quai rate at the specified block.
Inherited from
JsonRpcApiProvider.getQuaiToQiRateAtBlock
Source
providers/abstract-provider.ts:1081getRpcError()
Parameters
| Parameter | Type | Description |
|---|---|---|
payload | JsonRpcPayload | The JSON-RPC payload. |
error | JsonRpcError | The JSON-RPC error. |
Returns
Error
The RPC error.
Overrides
JsonRpcApiProvider.getRpcError
Source
providers/provider-browser.ts:162getSigner()
Parameters
| Parameter | Type | Description |
|---|---|---|
address? | string | number | The address to get the signer for. |
Returns
Promise<JsonRpcSigner>
The signer for the address.
Overrides
JsonRpcApiProvider.getSigner
Source
providers/provider-browser.ts:185hasSigner()
true if the provider manages the address.
Parameters
| Parameter | Type | Description |
|---|---|---|
address | string | number | The address to check. |
Returns
Promise<boolean>
Resolves to true if the provider manages the address.
Source
providers/provider-browser.ts:101initialize()
Type parameters
| Type parameter | Value |
|---|---|
U | string[] | FetchRequest |
Parameters
| Parameter | Type | Description |
|---|---|---|
urls | U | The URLs to initialize the map with. |
Returns
Promise<void>
A promise that resolves when the map is initialized.
Inherited from
JsonRpcApiProvider.initialize
Source
providers/abstract-provider.ts:874listAccounts()
Returns
Promise<JsonRpcSigner[]>
A promise that resolves to an array of JsonRpcSigners.
Inherited from
JsonRpcApiProvider.listAccounts
Source
providers/provider-jsonrpc.ts:1579pause()
dropWhilePaused, any events that occur while paused are dropped, otherwise all events
will be emitted once the provider is unpaused.
Parameters
| Parameter | Type | Description |
|---|---|---|
dropWhilePaused? | boolean | Whether to drop events while paused. |
Returns
void
Inherited from
JsonRpcApiProvider.pause
Source
providers/abstract-provider.ts:2598resume()
Returns
void
Inherited from
JsonRpcApiProvider.resume
Source
providers/abstract-provider.ts:2627send()
Parameters
| Parameter | Type | Description |
|---|---|---|
method | string | The method name. |
params | any[] | Record<string, any> | The parameters for the method. |
shard? | Shard | - |
Returns
Promise<any>
The result of the request.
Overrides
JsonRpcApiProvider.send
Source
providers/provider-browser.ts:122shardFromHash()
Parameters
| Parameter | Type | Description |
|---|---|---|
hash | string | The hash to get the shard from. |
Returns
Shard
The shard.
Inherited from
JsonRpcApiProvider.shardFromHash
Source
providers/abstract-provider.ts:1047zoneFromAddress()
Parameters
| Parameter | Type | Description |
|---|---|---|
_address | AddressLike | The address to get the zone from. |
Returns
Promise<Zone>
A promise that resolves to the zone.
Inherited from
JsonRpcApiProvider.zoneFromAddress
Source
providers/abstract-provider.ts:1036zoneFromHash()
Parameters
| Parameter | Type | Description |
|---|---|---|
hash | string | The hash to get the zone from. |
Returns
Zone
The zone.
Inherited from
JsonRpcApiProvider.zoneFromHash
