@ethersproject/providers
- Version 5.7.2
- Published
- 1.2 MB
- 20 dependencies
- MIT license
Install
npm i @ethersproject/providers
yarn add @ethersproject/providers
pnpm add @ethersproject/providers
Overview
Ethereum Providers for ethers.
Index
Functions
Classes
BaseProvider
- anyNetwork
- blockNumber
- call()
- ccipReadFetch()
- detectNetwork()
- disableCcipRead
- emit()
- estimateGas()
- formatter
- getAvatar()
- getBalance()
- getBlock()
- getBlockNumber()
- getBlockWithTransactions()
- getCode()
- getEtherPrice()
- getFormatter()
- getGasPrice()
- getLogs()
- getNetwork()
- getResolver()
- getStorageAt()
- getTransaction()
- getTransactionCount()
- getTransactionReceipt()
- listenerCount()
- listeners()
- lookupAddress()
- network
- off()
- on()
- once()
- perform()
- poll()
- polling
- pollingInterval
- ready
- removeAllListeners()
- resetEventsBlock()
- resolveName()
- sendTransaction()
- waitForTransaction()
Formatter
- accessList()
- address()
- allowFalsish()
- allowNull()
- arrayOf()
- bigNumber()
- block()
- blockTag()
- blockWithTransactions()
- boolean()
- callAddress()
- check()
- contractAddress()
- data()
- difficulty()
- filter()
- filterLog()
- formats
- getDefaultFormats()
- hash()
- hex()
- number()
- receipt()
- receiptLog()
- topics()
- transaction()
- transactionRequest()
- transactionResponse()
- type()
- uint256()
Interfaces
Type Aliases
Namespaces
Functions
function getDefaultProvider
getDefaultProvider: (network?: Networkish, options?: any) => BaseProvider;
function isCommunityResourcable
isCommunityResourcable: (value: any) => value is CommunityResourcable;
function isCommunityResource
isCommunityResource: (value: any) => boolean;
function showThrottleMessage
showThrottleMessage: () => void;
Classes
class AlchemyProvider
class AlchemyProvider extends UrlJsonRpcProvider {}
method getApiKey
static getApiKey: (apiKey: any) => any;
method getUrl
static getUrl: (network: Network, apiKey: string) => ConnectionInfo;
method getWebSocketProvider
static getWebSocketProvider: ( network?: Networkish, apiKey?: any) => AlchemyWebSocketProvider;
method isCommunityResource
isCommunityResource: () => boolean;
class AlchemyWebSocketProvider
class AlchemyWebSocketProvider extends WebSocketProvider implements CommunityResourcable {}
constructor
constructor(network?: Networkish, apiKey?: any);
property apiKey
readonly apiKey: string;
method isCommunityResource
isCommunityResource: () => boolean;
class AnkrProvider
class AnkrProvider extends UrlJsonRpcProvider {}
property apiKey
readonly apiKey: string;
method getApiKey
static getApiKey: (apiKey: any) => any;
method getUrl
static getUrl: (network: Network, apiKey: any) => ConnectionInfo;
method isCommunityResource
isCommunityResource: () => boolean;
class BaseProvider
class BaseProvider extends Provider implements EnsProvider {}
constructor
constructor(network: any);
ready
A Promise that resolves only once the provider is ready.
Sub-classes that call the super with a network without a chainId MUST set this. Standard named networks have a known chainId.
property anyNetwork
readonly anyNetwork: boolean;
property blockNumber
readonly blockNumber: number;
property disableCcipRead
disableCcipRead: boolean;
property formatter
formatter: Formatter;
property network
readonly network: Network;
property polling
polling: boolean;
property pollingInterval
pollingInterval: number;
property ready
readonly ready: Promise<Network>;
method call
call: ( transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag | Promise<BlockTag>) => Promise<string>;
method ccipReadFetch
ccipReadFetch: ( tx: Transaction, calldata: string, urls: Array<string>) => Promise<null | string>;
method detectNetwork
detectNetwork: () => Promise<Network>;
method emit
emit: (eventName: EventType, ...args: Array<any>) => boolean;
method estimateGas
estimateGas: (transaction: Deferrable<TransactionRequest>) => Promise<BigNumber>;
method getAvatar
getAvatar: (nameOrAddress: string) => Promise<null | string>;
method getBalance
getBalance: ( addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>) => Promise<BigNumber>;
method getBlock
getBlock: ( blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>) => Promise<Block>;
method getBlockNumber
getBlockNumber: () => Promise<number>;
method getBlockWithTransactions
getBlockWithTransactions: ( blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>) => Promise<BlockWithTransactions>;
method getCode
getCode: ( addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>) => Promise<string>;
method getEtherPrice
getEtherPrice: () => Promise<number>;
method getFormatter
static getFormatter: () => Formatter;
method getGasPrice
getGasPrice: () => Promise<BigNumber>;
method getLogs
getLogs: ( filter: Filter | FilterByBlockHash | Promise<Filter | FilterByBlockHash>) => Promise<Array<Log>>;
method getNetwork
static getNetwork: (network: Networkish) => Network;
method getResolver
getResolver: (name: string) => Promise<null | Resolver>;
method getStorageAt
getStorageAt: ( addressOrName: string | Promise<string>, position: BigNumberish | Promise<BigNumberish>, blockTag?: BlockTag | Promise<BlockTag>) => Promise<string>;
method getTransaction
getTransaction: ( transactionHash: string | Promise<string>) => Promise<TransactionResponse>;
method getTransactionCount
getTransactionCount: ( addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>) => Promise<number>;
method getTransactionReceipt
getTransactionReceipt: ( transactionHash: string | Promise<string>) => Promise<TransactionReceipt>;
method listenerCount
listenerCount: (eventName?: EventType) => number;
method listeners
listeners: (eventName?: EventType) => Array<Listener>;
method lookupAddress
lookupAddress: (address: string | Promise<string>) => Promise<null | string>;
method off
off: (eventName: EventType, listener?: Listener) => this;
method on
on: (eventName: EventType, listener: Listener) => this;
method once
once: (eventName: EventType, listener: Listener) => this;
method perform
perform: (method: string, params: any) => Promise<any>;
method poll
poll: () => Promise<void>;
method removeAllListeners
removeAllListeners: (eventName?: EventType) => this;
method resetEventsBlock
resetEventsBlock: (blockNumber: number) => void;
method resolveName
resolveName: (name: string | Promise<string>) => Promise<null | string>;
method sendTransaction
sendTransaction: ( signedTransaction: string | Promise<string>) => Promise<TransactionResponse>;
method waitForTransaction
waitForTransaction: ( transactionHash: string, confirmations?: number, timeout?: number) => Promise<TransactionReceipt>;
class CloudflareProvider
class CloudflareProvider extends UrlJsonRpcProvider {}
class EtherscanProvider
class EtherscanProvider extends BaseProvider {}
constructor
constructor(network?: Networkish, apiKey?: string);
property apiKey
readonly apiKey: string;
property baseUrl
readonly baseUrl: string;
method detectNetwork
detectNetwork: () => Promise<Network>;
method fetch
fetch: ( module: string, params: Record<string, any>, post?: boolean) => Promise<any>;
method getBaseUrl
getBaseUrl: () => string;
method getHistory
getHistory: ( addressOrName: string | Promise<string>, startBlock?: BlockTag, endBlock?: BlockTag) => Promise<Array<TransactionResponse>>;
method getPostData
getPostData: ( module: string, params: Record<string, any>) => Record<string, any>;
method getPostUrl
getPostUrl: () => string;
method getUrl
getUrl: (module: string, params: Record<string, string>) => string;
method isCommunityResource
isCommunityResource: () => boolean;
method perform
perform: (method: string, params: any) => Promise<any>;
class FallbackProvider
class FallbackProvider extends BaseProvider {}
constructor
constructor(providers: any[], quorum?: number);
property providerConfigs
readonly providerConfigs: readonly FallbackProviderConfig[];
property quorum
readonly quorum: number;
method detectNetwork
detectNetwork: () => Promise<Network>;
method perform
perform: (method: string, params: { [name: string]: any }) => Promise<any>;
class Formatter
class Formatter {}
constructor
constructor();
property formats
readonly formats: Formats;
method accessList
accessList: (accessList: Array<any>) => AccessList;
method address
address: (value: any) => string;
method allowFalsish
static allowFalsish: (format: FormatFunc, replaceValue: any) => FormatFunc;
method allowNull
static allowNull: (format: FormatFunc, nullValue?: any) => FormatFunc;
method arrayOf
static arrayOf: (format: FormatFunc) => FormatFunc;
method bigNumber
bigNumber: (value: any) => BigNumber;
method block
block: (value: any) => Block;
method blockTag
blockTag: (blockTag: any) => string;
method blockWithTransactions
blockWithTransactions: (value: any) => Block;
method boolean
boolean: (value: any) => boolean;
method callAddress
callAddress: (value: any) => string;
method check
static check: (format: { [name: string]: FormatFunc }, object: any) => any;
method contractAddress
contractAddress: (value: any) => string;
method data
data: (value: any, strict?: boolean) => string;
method difficulty
difficulty: (value: any) => number;
method filter
filter: (value: any) => any;
method filterLog
filterLog: (value: any) => any;
method getDefaultFormats
getDefaultFormats: () => Formats;
method hash
hash: (value: any, strict?: boolean) => string;
method hex
hex: (value: any, strict?: boolean) => string;
method number
number: (number: any) => number;
method receipt
receipt: (value: any) => TransactionReceipt;
method receiptLog
receiptLog: (value: any) => any;
method topics
topics: (value: any) => any;
method transaction
transaction: (value: any) => any;
method transactionRequest
transactionRequest: (value: any) => any;
method transactionResponse
transactionResponse: (transaction: any) => TransactionResponse;
method type
type: (number: any) => number;
method uint256
uint256: (value: any) => string;
class InfuraProvider
class InfuraProvider extends UrlJsonRpcProvider {}
property projectId
readonly projectId: string;
property projectSecret
readonly projectSecret: string;
method getApiKey
static getApiKey: (apiKey: any) => any;
method getUrl
static getUrl: (network: Network, apiKey: any) => ConnectionInfo;
method getWebSocketProvider
static getWebSocketProvider: ( network?: Networkish, apiKey?: any) => InfuraWebSocketProvider;
method isCommunityResource
isCommunityResource: () => boolean;
class InfuraWebSocketProvider
class InfuraWebSocketProvider extends WebSocketProvider implements CommunityResourcable {}
constructor
constructor(network?: Networkish, apiKey?: any);
property apiKey
readonly apiKey: string;
property projectId
readonly projectId: string;
property projectSecret
readonly projectSecret: string;
method isCommunityResource
isCommunityResource: () => boolean;
class IpcProvider
class IpcProvider extends JsonRpcProvider {}
constructor
constructor(path: string, network?: Networkish);
property path
readonly path: string;
method send
send: (method: string, params: Array<any>) => Promise<any>;
class JsonRpcBatchProvider
class JsonRpcBatchProvider extends JsonRpcProvider {}
method send
send: (method: string, params: Array<any>) => Promise<any>;
class JsonRpcProvider
class JsonRpcProvider extends BaseProvider {}
constructor
constructor(url?: any, network?: Networkish);
property connection
readonly connection: ConnectionInfo;
method defaultUrl
static defaultUrl: () => string;
method detectNetwork
detectNetwork: () => Promise<Network>;
method getSigner
getSigner: (addressOrIndex?: string | number) => JsonRpcSigner;
method getUncheckedSigner
getUncheckedSigner: (addressOrIndex?: string | number) => UncheckedJsonRpcSigner;
method hexlifyTransaction
static hexlifyTransaction: ( transaction: TransactionRequest, allowExtra?: { [key: string]: boolean }) => { [key: string]: any };
method listAccounts
listAccounts: () => Promise<Array<string>>;
method perform
perform: (method: string, params: any) => Promise<any>;
method prepareRequest
prepareRequest: (method: string, params: any) => [string, Array<any>];
method send
send: (method: string, params: Array<any>) => Promise<any>;
class JsonRpcSigner
class JsonRpcSigner extends Signer implements TypedDataSigner {}
constructor
constructor( constructorGuard: any, provider: JsonRpcProvider, addressOrIndex?: string | number);
property provider
readonly provider: JsonRpcProvider;
method connect
connect: (provider: Provider) => JsonRpcSigner;
method connectUnchecked
connectUnchecked: () => JsonRpcSigner;
method getAddress
getAddress: () => Promise<string>;
method sendTransaction
sendTransaction: ( transaction: Deferrable<TransactionRequest>) => Promise<TransactionResponse>;
method sendUncheckedTransaction
sendUncheckedTransaction: ( transaction: Deferrable<TransactionRequest>) => Promise<string>;
method signMessage
signMessage: (message: Bytes | string) => Promise<string>;
method signTransaction
signTransaction: ( transaction: Deferrable<TransactionRequest>) => Promise<string>;
method unlock
unlock: (password: string) => Promise<boolean>;
class NodesmithProvider
class NodesmithProvider extends UrlJsonRpcProvider {}
class PocketProvider
class PocketProvider extends UrlJsonRpcProvider {}
property applicationId
readonly applicationId: string;
property applicationSecretKey
readonly applicationSecretKey: string;
property loadBalancer
readonly loadBalancer: boolean;
method getApiKey
static getApiKey: (apiKey: any) => any;
method getUrl
static getUrl: (network: Network, apiKey: any) => ConnectionInfo;
method isCommunityResource
isCommunityResource: () => boolean;
class Resolver
class Resolver implements EnsResolver {}
constructor
constructor( provider: BaseProvider, address: string, name: string, resolvedAddress?: string);
property address
readonly address: string;
property name
readonly name: string;
property provider
readonly provider: BaseProvider;
method getAddress
getAddress: (coinType?: number) => Promise<string>;
method getAvatar
getAvatar: () => Promise<null | Avatar>;
method getContentHash
getContentHash: () => Promise<string>;
method getText
getText: (key: string) => Promise<string>;
method supportsWildcard
supportsWildcard: () => Promise<boolean>;
class StaticJsonRpcProvider
class StaticJsonRpcProvider extends JsonRpcProvider {}
method detectNetwork
detectNetwork: () => Promise<Network>;
class UrlJsonRpcProvider
abstract class UrlJsonRpcProvider extends StaticJsonRpcProvider implements CommunityResourcable {}
constructor
constructor(network?: Networkish, apiKey?: any);
property apiKey
readonly apiKey: any;
method getApiKey
static getApiKey: (apiKey: any) => any;
method getSigner
getSigner: (address?: string) => JsonRpcSigner;
method getUrl
static getUrl: (network: Network, apiKey: any) => string | ConnectionInfo;
method isCommunityResource
isCommunityResource: () => boolean;
method listAccounts
listAccounts: () => Promise<Array<string>>;
class Web3Provider
class Web3Provider extends JsonRpcProvider {}
constructor
constructor(provider: ExternalProvider | JsonRpcFetchFunc, network?: Networkish);
property jsonRpcFetchFunc
readonly jsonRpcFetchFunc: JsonRpcFetchFunc;
property provider
readonly provider: ExternalProvider;
method send
send: (method: string, params: Array<any>) => Promise<any>;
class WebSocketProvider
class WebSocketProvider extends JsonRpcProvider {}
constructor
constructor(url: string | WebSocketLike, network?: Networkish);
property pollingInterval
pollingInterval: number;
property websocket
readonly websocket: WebSocketLike;
method defaultUrl
static defaultUrl: () => string;
method destroy
destroy: () => Promise<void>;
method detectNetwork
detectNetwork: () => Promise<Network>;
method poll
poll: () => Promise<void>;
method resetEventsBlock
resetEventsBlock: (blockNumber: number) => void;
method send
send: (method: string, params?: Array<any>) => Promise<any>;
Interfaces
interface CommunityResourcable
interface CommunityResourcable {}
method isCommunityResource
isCommunityResource: () => boolean;
interface EnsProvider
interface EnsProvider {}
method getResolver
getResolver: (name: string) => Promise<null | EnsResolver>;
method lookupAddress
lookupAddress: (address: string) => Promise<null | string>;
method resolveName
resolveName: (name: string) => Promise<null | string>;
interface EnsResolver
interface EnsResolver {}
property address
readonly address: string;
property name
readonly name: string;
method getAddress
getAddress: (coinType?: 60) => Promise<null | string>;
method getContentHash
getContentHash: () => Promise<null | string>;
method getText
getText: (key: string) => Promise<null | string>;
interface FallbackProviderConfig
interface FallbackProviderConfig {}
property priority
priority?: number;
property provider
provider: Provider;
property stallTimeout
stallTimeout?: number;
property weight
weight?: number;
Type Aliases
type ExternalProvider
type ExternalProvider = { isMetaMask?: boolean; isStatus?: boolean; host?: string; path?: string; sendAsync?: ( request: { method: string; params?: Array<any>; }, callback: (error: any, response: any) => void ) => void; send?: ( request: { method: string; params?: Array<any>; }, callback: (error: any, response: any) => void ) => void; request?: (request: { method: string; params?: Array<any> }) => Promise<any>;};
type JsonRpcFetchFunc
type JsonRpcFetchFunc = (method: string, params?: Array<any>) => Promise<any>;
Namespaces
namespace ws
module 'ws' {}
variable WebSocket
var WebSocket: { new (url: string | URL, protocols?: string | string[]): WebSocket; prototype: WebSocket; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; readonly OPEN: number;};
interface WebSocker
interface WebSocker {}
interface WebSocket
interface WebSocket extends EventTarget {}
property binaryType
binaryType: BinaryType;
property bufferedAmount
readonly bufferedAmount: number;
property CLOSED
readonly CLOSED: number;
property CLOSING
readonly CLOSING: number;
property CONNECTING
readonly CONNECTING: number;
property extensions
readonly extensions: string;
property onclose
onclose: ((this: WebSocket, ev: CloseEvent) => any) | null;
property onerror
onerror: ((this: WebSocket, ev: Event) => any) | null;
property onmessage
onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null;
property onopen
onopen: ((this: WebSocket, ev: Event) => any) | null;
property OPEN
readonly OPEN: number;
property protocol
readonly protocol: string;
property readyState
readonly readyState: number;
property url
readonly url: string;
method addEventListener
addEventListener: { <K extends keyof WebSocketEventMap>( type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions ): void; ( type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions ): void;};
method close
close: (code?: number, reason?: string) => void;
method removeEventListener
removeEventListener: { <K extends keyof WebSocketEventMap>( type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions ): void; ( type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions ): void;};
method send
send: (data: string | ArrayBufferLike | Blob | ArrayBufferView) => void;
Package Files (19)
- lib/alchemy-provider.d.ts
- lib/ankr-provider.d.ts
- lib/base-provider.d.ts
- lib/cloudflare-provider.d.ts
- lib/etherscan-provider.d.ts
- lib/fallback-provider.d.ts
- lib/formatter.d.ts
- lib/index.d.ts
- lib/infura-provider.d.ts
- lib/ipc-provider.d.ts
- lib/json-rpc-batch-provider.d.ts
- lib/json-rpc-provider.d.ts
- lib/nodesmith-provider.d.ts
- lib/pocket-provider.d.ts
- lib/url-json-rpc-provider.d.ts
- lib/web3-provider.d.ts
- lib/websocket-provider.d.ts
- node_modules/typescript/lib/lib.dom.d.ts
- thirdparty.d.ts
Dependencies (20)
- @ethersproject/abstract-provider
- @ethersproject/abstract-signer
- @ethersproject/address
- @ethersproject/base64
- @ethersproject/basex
- @ethersproject/bignumber
- @ethersproject/bytes
- @ethersproject/constants
- @ethersproject/hash
- @ethersproject/logger
- @ethersproject/networks
- @ethersproject/properties
- @ethersproject/random
- @ethersproject/rlp
- @ethersproject/sha2
- @ethersproject/strings
- @ethersproject/transactions
- @ethersproject/web
- bech32
- ws
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@ethersproject/providers
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@ethersproject/providers)
- HTML<a href="https://www.jsdocs.io/package/@ethersproject/providers"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 6287 ms. - Missing or incorrect documentation? Open an issue for this package.