Skip to content

Latest commit

 

History

History
1375 lines (791 loc) · 29.1 KB

internal_.BaseProvider.md

File metadata and controls

1375 lines (791 loc) · 29.1 KB

@paraswap/sdk / Exports / <internal> / BaseProvider

Class: BaseProvider

.BaseProvider

Hierarchy

Implements

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new BaseProvider(network)

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.

Parameters

Name Type
network Networkish | Promise<Network>

Overrides

Provider.constructor

Properties

_bootstrapPoll

_bootstrapPoll: Timer

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:66


_emitted

_emitted: Object

Index signature

▪ [eventName: string]: number | "pending"

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:61


_events

_events: Event[]

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:59


_fastBlockNumber

_fastBlockNumber: number

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:69


_fastBlockNumberPromise

_fastBlockNumberPromise: Promise<number>

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:70


_fastQueryDate

_fastQueryDate: number

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:71


_internalBlockNumber

_internalBlockNumber: Promise<{ blockNumber: number ; reqTime: number ; respTime: number }>

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:73


_isProvider

Readonly _isProvider: boolean

Inherited from

Provider._isProvider

Defined in

node_modules/@ethersproject/abstract-provider/lib/index.d.ts:151


_lastBlockNumber

_lastBlockNumber: number

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:67


_maxFilterBlockRange

_maxFilterBlockRange: number

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:68


_maxInternalBlockNumber

_maxInternalBlockNumber: number

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:72


_network

_network: Network

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:58


_networkPromise

_networkPromise: Promise<Network>

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:57


_poller

_poller: Timer

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:65


_pollingInterval

_pollingInterval: number

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:64


anyNetwork

Readonly anyNetwork: boolean

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:78


disableCcipRead

disableCcipRead: boolean

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:79


formatter

formatter: Formatter

Defined in

node_modules/@ethersproject/providers/lib/base-provider.d.ts:60

Accessors

blockNumber

get blockNumber(): number

Returns

number


network

get network(): Network

Returns

Network


polling

get polling(): boolean

Returns

boolean

set polling(value): void

Parameters

Name Type
value boolean

Returns

void


pollingInterval

get pollingInterval(): number

Returns

number

set pollingInterval(value): void

Parameters

Name Type
value number

Returns

void


ready

get ready(): Promise<Network>

Returns

Promise<Network>

Methods

_addEventListener

_addEventListener(eventName, listener, once): BaseProvider

Parameters

Name Type
eventName EventType
listener Listener
once boolean

Returns

BaseProvider


_call

_call(transaction, blockTag, attempt): Promise<string>

Parameters

Name Type
transaction TransactionRequest
blockTag BlockTag
attempt number

Returns

Promise<string>


_getAddress

_getAddress(addressOrName): Promise<string>

Parameters

Name Type
addressOrName string | Promise<string>

Returns

Promise<string>


_getBlock

_getBlock(blockHashOrBlockTag, includeTransactions?): Promise<Block | BlockWithTransactions>

Parameters

Name Type
blockHashOrBlockTag BlockTag | Promise<BlockTag>
includeTransactions? boolean

Returns

Promise<Block | BlockWithTransactions>


_getBlockTag

_getBlockTag(blockTag): Promise<BlockTag>

Parameters

Name Type
blockTag BlockTag | Promise<BlockTag>

Returns

Promise<BlockTag>


_getFastBlockNumber

_getFastBlockNumber(): Promise<number>

Returns

Promise<number>


_getFilter

_getFilter(filter): Promise<Filter | FilterByBlockHash>

Parameters

Name Type
filter Filter | FilterByBlockHash | Promise<Filter | FilterByBlockHash>

Returns

Promise<Filter | FilterByBlockHash>


_getInternalBlockNumber

_getInternalBlockNumber(maxAge): Promise<number>

Parameters

Name Type
maxAge number

Returns

Promise<number>


_getResolver

_getResolver(name, operation?): Promise<string>

Parameters

Name Type
name string
operation? string

Returns

Promise<string>


_getTransactionRequest

_getTransactionRequest(transaction): Promise<Transaction>

Parameters

Name Type
transaction Deferrable<TransactionRequest>

Returns

Promise<Transaction>


_ready

_ready(): Promise<Network>

Returns

Promise<Network>


_setFastBlockNumber

_setFastBlockNumber(blockNumber): void

Parameters

Name Type
blockNumber number

Returns

void


_startEvent

_startEvent(event): void

Parameters

Name Type
event Event

Returns

void


_stopEvent

_stopEvent(event): void

Parameters

Name Type
event Event

Returns

void


_waitForTransaction

_waitForTransaction(transactionHash, confirmations, timeout, replaceable): Promise<TransactionReceipt>

Parameters

Name Type
transactionHash string
confirmations number
timeout number
replaceable Object
replaceable.data string
replaceable.from string
replaceable.nonce number
replaceable.startBlock number
replaceable.to string
replaceable.value BigNumber

Returns

Promise<TransactionReceipt>


_wrapTransaction

_wrapTransaction(tx, hash?, startBlock?): TransactionResponse

Parameters

Name Type
tx Transaction
hash? string
startBlock? number

Returns

TransactionResponse


addListener

addListener(eventName, listener): Provider

Parameters

Name Type
eventName EventType
listener Listener

Returns

Provider

Inherited from

Provider.addListener


call

call(transaction, blockTag?): Promise<string>

Parameters

Name Type
transaction Deferrable<TransactionRequest>
blockTag? BlockTag | Promise<BlockTag>

Returns

Promise<string>

Overrides

Provider.call


ccipReadFetch

ccipReadFetch(tx, calldata, urls): Promise<null | string>

Parameters

Name Type
tx Transaction
calldata string
urls string[]

Returns

Promise<null | string>


detectNetwork

detectNetwork(): Promise<Network>

Returns

Promise<Network>


emit

emit(eventName, ...args): boolean

Parameters

Name Type
eventName EventType
...args any[]

Returns

boolean

Overrides

Provider.emit


estimateGas

estimateGas(transaction): Promise<BigNumber>

Parameters

Name Type
transaction Deferrable<TransactionRequest>

Returns

Promise<BigNumber>

Overrides

Provider.estimateGas


getAvatar

getAvatar(nameOrAddress): Promise<null | string>

Parameters

Name Type
nameOrAddress string

Returns

Promise<null | string>


getBalance

getBalance(addressOrName, blockTag?): Promise<BigNumber>

Parameters

Name Type
addressOrName string | Promise<string>
blockTag? BlockTag | Promise<BlockTag>

Returns

Promise<BigNumber>

Overrides

Provider.getBalance


getBlock

getBlock(blockHashOrBlockTag): Promise<Block>

Parameters

Name Type
blockHashOrBlockTag BlockTag | Promise<BlockTag>

Returns

Promise<Block>

Overrides

Provider.getBlock


getBlockNumber

getBlockNumber(): Promise<number>

Returns

Promise<number>

Overrides

Provider.getBlockNumber


getBlockWithTransactions

getBlockWithTransactions(blockHashOrBlockTag): Promise<BlockWithTransactions>

Parameters

Name Type
blockHashOrBlockTag BlockTag | Promise<BlockTag>

Returns

Promise<BlockWithTransactions>

Overrides

Provider.getBlockWithTransactions


getCode

getCode(addressOrName, blockTag?): Promise<string>

Parameters

Name Type
addressOrName string | Promise<string>
blockTag? BlockTag | Promise<BlockTag>

Returns

Promise<string>

Overrides

Provider.getCode


getEtherPrice

getEtherPrice(): Promise<number>

Returns

Promise<number>


getFeeData

getFeeData(): Promise<FeeData>

Returns

Promise<FeeData>

Inherited from

Provider.getFeeData


getGasPrice

getGasPrice(): Promise<BigNumber>

Returns

Promise<BigNumber>

Overrides

Provider.getGasPrice


getLogs

getLogs(filter): Promise<Log[]>

Parameters

Name Type
filter Filter | FilterByBlockHash | Promise<Filter | FilterByBlockHash>

Returns

Promise<Log[]>

Overrides

Provider.getLogs


getNetwork

getNetwork(): Promise<Network>

Returns

Promise<Network>

Overrides

Provider.getNetwork


getResolver

getResolver(name): Promise<null | Resolver>

Parameters

Name Type
name string

Returns

Promise<null | Resolver>

Implementation of

EnsProvider.getResolver


getStorageAt

getStorageAt(addressOrName, position, blockTag?): Promise<string>

Parameters

Name Type
addressOrName string | Promise<string>
position BigNumberish | Promise<BigNumberish>
blockTag? BlockTag | Promise<BlockTag>

Returns

Promise<string>

Overrides

Provider.getStorageAt


getTransaction

getTransaction(transactionHash): Promise<TransactionResponse>

Parameters

Name Type
transactionHash string | Promise<string>

Returns

Promise<TransactionResponse>

Overrides

Provider.getTransaction


getTransactionCount

getTransactionCount(addressOrName, blockTag?): Promise<number>

Parameters

Name Type
addressOrName string | Promise<string>
blockTag? BlockTag | Promise<BlockTag>

Returns

Promise<number>

Overrides

Provider.getTransactionCount


getTransactionReceipt

getTransactionReceipt(transactionHash): Promise<TransactionReceipt>

Parameters

Name Type
transactionHash string | Promise<string>

Returns

Promise<TransactionReceipt>

Overrides

Provider.getTransactionReceipt


listenerCount

listenerCount(eventName?): number

Parameters

Name Type
eventName? EventType

Returns

number

Overrides

Provider.listenerCount


listeners

listeners(eventName?): Listener[]

Parameters

Name Type
eventName? EventType

Returns

Listener[]

Overrides

Provider.listeners


lookupAddress

lookupAddress(address): Promise<null | string>

Parameters

Name Type
address string | Promise<string>

Returns

Promise<null | string>

Implementation of

EnsProvider.lookupAddress

Overrides

Provider.lookupAddress


off

off(eventName, listener?): BaseProvider

Parameters

Name Type
eventName EventType
listener? Listener

Returns

BaseProvider

Overrides

Provider.off


on

on(eventName, listener): BaseProvider

Parameters

Name Type
eventName EventType
listener Listener

Returns

BaseProvider

Overrides

Provider.on


once

once(eventName, listener): BaseProvider

Parameters

Name Type
eventName EventType
listener Listener

Returns

BaseProvider

Overrides

Provider.once


perform

perform(method, params): Promise<any>

Parameters

Name Type
method string
params any

Returns

Promise<any>


poll

poll(): Promise<void>

Returns

Promise<void>


removeAllListeners

removeAllListeners(eventName?): BaseProvider

Parameters

Name Type
eventName? EventType

Returns

BaseProvider

Overrides

Provider.removeAllListeners


removeListener

removeListener(eventName, listener): Provider

Parameters

Name Type
eventName EventType
listener Listener

Returns

Provider

Inherited from

Provider.removeListener


resetEventsBlock

resetEventsBlock(blockNumber): void

Parameters

Name Type
blockNumber number

Returns

void


resolveName

resolveName(name): Promise<null | string>

Parameters

Name Type
name string | Promise<string>

Returns

Promise<null | string>

Implementation of

EnsProvider.resolveName

Overrides

Provider.resolveName


sendTransaction

sendTransaction(signedTransaction): Promise<TransactionResponse>

Parameters

Name Type
signedTransaction string | Promise<string>

Returns

Promise<TransactionResponse>

Overrides

Provider.sendTransaction


waitForTransaction

waitForTransaction(transactionHash, confirmations?, timeout?): Promise<TransactionReceipt>

Parameters

Name Type
transactionHash string
confirmations? number
timeout? number

Returns

Promise<TransactionReceipt>

Overrides

Provider.waitForTransaction


getFormatter

Static getFormatter(): Formatter

Returns

Formatter


getNetwork

Static getNetwork(network): Network

Parameters

Name Type
network Networkish

Returns

Network


isProvider

Static isProvider(value): value is Provider

Parameters

Name Type
value any

Returns

value is Provider

Inherited from

Provider.isProvider