@paraswap/sdk / Exports / <internal> / BaseProvider
-
↳
BaseProvider
- _bootstrapPoll
- _emitted
- _events
- _fastBlockNumber
- _fastBlockNumberPromise
- _fastQueryDate
- _internalBlockNumber
- _isProvider
- _lastBlockNumber
- _maxFilterBlockRange
- _maxInternalBlockNumber
- _network
- _networkPromise
- _poller
- _pollingInterval
- anyNetwork
- disableCcipRead
- formatter
- _addEventListener
- _call
- _getAddress
- _getBlock
- _getBlockTag
- _getFastBlockNumber
- _getFilter
- _getInternalBlockNumber
- _getResolver
- _getTransactionRequest
- _ready
- _setFastBlockNumber
- _startEvent
- _stopEvent
- _waitForTransaction
- _wrapTransaction
- addListener
- call
- ccipReadFetch
- detectNetwork
- emit
- estimateGas
- getAvatar
- getBalance
- getBlock
- getBlockNumber
- getBlockWithTransactions
- getCode
- getEtherPrice
- getFeeData
- getGasPrice
- getLogs
- getNetwork
- getResolver
- getStorageAt
- getTransaction
- getTransactionCount
- getTransactionReceipt
- listenerCount
- listeners
- lookupAddress
- off
- on
- once
- perform
- poll
- removeAllListeners
- removeListener
- resetEventsBlock
- resolveName
- sendTransaction
- waitForTransaction
- getFormatter
- getNetwork
- isProvider
• 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.
Name | Type |
---|---|
network |
Networkish | Promise <Network > |
• _bootstrapPoll: Timer
node_modules/@ethersproject/providers/lib/base-provider.d.ts:66
• _emitted: Object
▪ [eventName: string
]: number
| "pending"
node_modules/@ethersproject/providers/lib/base-provider.d.ts:61
• _events: Event
[]
node_modules/@ethersproject/providers/lib/base-provider.d.ts:59
• _fastBlockNumber: number
node_modules/@ethersproject/providers/lib/base-provider.d.ts:69
• _fastBlockNumberPromise: Promise
<number
>
node_modules/@ethersproject/providers/lib/base-provider.d.ts:70
• _fastQueryDate: number
node_modules/@ethersproject/providers/lib/base-provider.d.ts:71
• _internalBlockNumber: Promise
<{ blockNumber
: number
; reqTime
: number
; respTime
: number
}>
node_modules/@ethersproject/providers/lib/base-provider.d.ts:73
• Readonly
_isProvider: boolean
node_modules/@ethersproject/abstract-provider/lib/index.d.ts:151
• _lastBlockNumber: number
node_modules/@ethersproject/providers/lib/base-provider.d.ts:67
• _maxFilterBlockRange: number
node_modules/@ethersproject/providers/lib/base-provider.d.ts:68
• _maxInternalBlockNumber: number
node_modules/@ethersproject/providers/lib/base-provider.d.ts:72
• _network: Network
node_modules/@ethersproject/providers/lib/base-provider.d.ts:58
• _networkPromise: Promise
<Network
>
node_modules/@ethersproject/providers/lib/base-provider.d.ts:57
• _poller: Timer
node_modules/@ethersproject/providers/lib/base-provider.d.ts:65
• _pollingInterval: number
node_modules/@ethersproject/providers/lib/base-provider.d.ts:64
• Readonly
anyNetwork: boolean
node_modules/@ethersproject/providers/lib/base-provider.d.ts:78
• disableCcipRead: boolean
node_modules/@ethersproject/providers/lib/base-provider.d.ts:79
• formatter: Formatter
node_modules/@ethersproject/providers/lib/base-provider.d.ts:60
• get
blockNumber(): number
number
• get
network(): Network
• get
polling(): boolean
boolean
• set
polling(value
): void
Name | Type |
---|---|
value |
boolean |
void
• get
pollingInterval(): number
number
• set
pollingInterval(value
): void
Name | Type |
---|---|
value |
number |
void
• get
ready(): Promise
<Network
>
Promise
<Network
>
▸ _addEventListener(eventName
, listener
, once
): BaseProvider
Name | Type |
---|---|
eventName |
EventType |
listener |
Listener |
once |
boolean |
▸ _call(transaction
, blockTag
, attempt
): Promise
<string
>
Name | Type |
---|---|
transaction |
TransactionRequest |
blockTag |
BlockTag |
attempt |
number |
Promise
<string
>
▸ _getAddress(addressOrName
): Promise
<string
>
Name | Type |
---|---|
addressOrName |
string | Promise <string > |
Promise
<string
>
▸ _getBlock(blockHashOrBlockTag
, includeTransactions?
): Promise
<Block
| BlockWithTransactions
>
Name | Type |
---|---|
blockHashOrBlockTag |
BlockTag | Promise <BlockTag > |
includeTransactions? |
boolean |
Promise
<Block
| BlockWithTransactions
>
▸ _getBlockTag(blockTag
): Promise
<BlockTag
>
Name | Type |
---|---|
blockTag |
BlockTag | Promise <BlockTag > |
Promise
<BlockTag
>
▸ _getFastBlockNumber(): Promise
<number
>
Promise
<number
>
▸ _getFilter(filter
): Promise
<Filter
| FilterByBlockHash
>
Name | Type |
---|---|
filter |
Filter | FilterByBlockHash | Promise <Filter | FilterByBlockHash > |
Promise
<Filter
| FilterByBlockHash
>
▸ _getInternalBlockNumber(maxAge
): Promise
<number
>
Name | Type |
---|---|
maxAge |
number |
Promise
<number
>
▸ _getResolver(name
, operation?
): Promise
<string
>
Name | Type |
---|---|
name |
string |
operation? |
string |
Promise
<string
>
▸ _getTransactionRequest(transaction
): Promise
<Transaction
>
Name | Type |
---|---|
transaction |
Deferrable <TransactionRequest > |
Promise
<Transaction
>
▸ _ready(): Promise
<Network
>
Promise
<Network
>
▸ _setFastBlockNumber(blockNumber
): void
Name | Type |
---|---|
blockNumber |
number |
void
▸ _startEvent(event
): void
Name | Type |
---|---|
event |
Event |
void
▸ _stopEvent(event
): void
Name | Type |
---|---|
event |
Event |
void
▸ _waitForTransaction(transactionHash
, confirmations
, timeout
, replaceable
): Promise
<TransactionReceipt
>
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 |
Promise
<TransactionReceipt
>
▸ _wrapTransaction(tx
, hash?
, startBlock?
): TransactionResponse
Name | Type |
---|---|
tx |
Transaction |
hash? |
string |
startBlock? |
number |
▸ addListener(eventName
, listener
): Provider
Name | Type |
---|---|
eventName |
EventType |
listener |
Listener |
▸ call(transaction
, blockTag?
): Promise
<string
>
Name | Type |
---|---|
transaction |
Deferrable <TransactionRequest > |
blockTag? |
BlockTag | Promise <BlockTag > |
Promise
<string
>
▸ ccipReadFetch(tx
, calldata
, urls
): Promise
<null
| string
>
Name | Type |
---|---|
tx |
Transaction |
calldata |
string |
urls |
string [] |
Promise
<null
| string
>
▸ detectNetwork(): Promise
<Network
>
Promise
<Network
>
▸ emit(eventName
, ...args
): boolean
Name | Type |
---|---|
eventName |
EventType |
...args |
any [] |
boolean
▸ estimateGas(transaction
): Promise
<BigNumber
>
Name | Type |
---|---|
transaction |
Deferrable <TransactionRequest > |
Promise
<BigNumber
>
▸ getAvatar(nameOrAddress
): Promise
<null
| string
>
Name | Type |
---|---|
nameOrAddress |
string |
Promise
<null
| string
>
▸ getBalance(addressOrName
, blockTag?
): Promise
<BigNumber
>
Name | Type |
---|---|
addressOrName |
string | Promise <string > |
blockTag? |
BlockTag | Promise <BlockTag > |
Promise
<BigNumber
>
▸ getBlock(blockHashOrBlockTag
): Promise
<Block
>
Name | Type |
---|---|
blockHashOrBlockTag |
BlockTag | Promise <BlockTag > |
Promise
<Block
>
▸ getBlockNumber(): Promise
<number
>
Promise
<number
>
▸ getBlockWithTransactions(blockHashOrBlockTag
): Promise
<BlockWithTransactions
>
Name | Type |
---|---|
blockHashOrBlockTag |
BlockTag | Promise <BlockTag > |
Promise
<BlockWithTransactions
>
Provider.getBlockWithTransactions
▸ getCode(addressOrName
, blockTag?
): Promise
<string
>
Name | Type |
---|---|
addressOrName |
string | Promise <string > |
blockTag? |
BlockTag | Promise <BlockTag > |
Promise
<string
>
▸ getEtherPrice(): Promise
<number
>
Promise
<number
>
▸ getFeeData(): Promise
<FeeData
>
Promise
<FeeData
>
▸ getGasPrice(): Promise
<BigNumber
>
Promise
<BigNumber
>
▸ getLogs(filter
): Promise
<Log
[]>
Name | Type |
---|---|
filter |
Filter | FilterByBlockHash | Promise <Filter | FilterByBlockHash > |
Promise
<Log
[]>
▸ getNetwork(): Promise
<Network
>
Promise
<Network
>
▸ getResolver(name
): Promise
<null
| Resolver
>
Name | Type |
---|---|
name |
string |
Promise
<null
| Resolver
>
▸ getStorageAt(addressOrName
, position
, blockTag?
): Promise
<string
>
Name | Type |
---|---|
addressOrName |
string | Promise <string > |
position |
BigNumberish | Promise <BigNumberish > |
blockTag? |
BlockTag | Promise <BlockTag > |
Promise
<string
>
▸ getTransaction(transactionHash
): Promise
<TransactionResponse
>
Name | Type |
---|---|
transactionHash |
string | Promise <string > |
Promise
<TransactionResponse
>
▸ getTransactionCount(addressOrName
, blockTag?
): Promise
<number
>
Name | Type |
---|---|
addressOrName |
string | Promise <string > |
blockTag? |
BlockTag | Promise <BlockTag > |
Promise
<number
>
▸ getTransactionReceipt(transactionHash
): Promise
<TransactionReceipt
>
Name | Type |
---|---|
transactionHash |
string | Promise <string > |
Promise
<TransactionReceipt
>
Provider.getTransactionReceipt
▸ listenerCount(eventName?
): number
Name | Type |
---|---|
eventName? |
EventType |
number
▸ listeners(eventName?
): Listener
[]
Name | Type |
---|---|
eventName? |
EventType |
Listener
[]
▸ lookupAddress(address
): Promise
<null
| string
>
Name | Type |
---|---|
address |
string | Promise <string > |
Promise
<null
| string
>
▸ off(eventName
, listener?
): BaseProvider
Name | Type |
---|---|
eventName |
EventType |
listener? |
Listener |
▸ on(eventName
, listener
): BaseProvider
Name | Type |
---|---|
eventName |
EventType |
listener |
Listener |
▸ once(eventName
, listener
): BaseProvider
Name | Type |
---|---|
eventName |
EventType |
listener |
Listener |
▸ perform(method
, params
): Promise
<any
>
Name | Type |
---|---|
method |
string |
params |
any |
Promise
<any
>
▸ poll(): Promise
<void
>
Promise
<void
>
▸ removeAllListeners(eventName?
): BaseProvider
Name | Type |
---|---|
eventName? |
EventType |
▸ removeListener(eventName
, listener
): Provider
Name | Type |
---|---|
eventName |
EventType |
listener |
Listener |
▸ resetEventsBlock(blockNumber
): void
Name | Type |
---|---|
blockNumber |
number |
void
▸ resolveName(name
): Promise
<null
| string
>
Name | Type |
---|---|
name |
string | Promise <string > |
Promise
<null
| string
>
▸ sendTransaction(signedTransaction
): Promise
<TransactionResponse
>
Name | Type |
---|---|
signedTransaction |
string | Promise <string > |
Promise
<TransactionResponse
>
▸ waitForTransaction(transactionHash
, confirmations?
, timeout?
): Promise
<TransactionReceipt
>
Name | Type |
---|---|
transactionHash |
string |
confirmations? |
number |
timeout? |
number |
Promise
<TransactionReceipt
>
▸ Static
getFormatter(): Formatter
▸ Static
getNetwork(network
): Network
Name | Type |
---|---|
network |
Networkish |
▸ Static
isProvider(value
): value is Provider
Name | Type |
---|---|
value |
any |
value is Provider