Skip to main content

StaticJsonRpcProvider

[# Masa SDK

  • v3.34.1](/docs/developers/sdk/) / Exports / StaticJsonRpcProvider

Class: StaticJsonRpcProvider

Hierarchy

  • JsonRpcProvider

    StaticJsonRpcProvider

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new StaticJsonRpcProvider(url?, network?): StaticJsonRpcProvider

Parameters

NameType
url?string | ConnectionInfo
network?Networkish

Returns

StaticJsonRpcProvider

Inherited from

providers.JsonRpcProvider.constructor

Properties

_bootstrapPoll

_bootstrapPoll: Timer

Inherited from

providers.JsonRpcProvider._bootstrapPoll


_emitted

_emitted: Object

Index signature

[eventName: string]: number | "pending"

Inherited from

providers.JsonRpcProvider._emitted


_eventLoopCache

_eventLoopCache: Record\<string, Promise\<any>>

Inherited from

providers.JsonRpcProvider._eventLoopCache


_events

_events: Event[]

Inherited from

providers.JsonRpcProvider._events


_fastBlockNumber

_fastBlockNumber: number

Inherited from

providers.JsonRpcProvider._fastBlockNumber


_fastBlockNumberPromise

_fastBlockNumberPromise: Promise\<number>

Inherited from

providers.JsonRpcProvider._fastBlockNumberPromise


_fastQueryDate

_fastQueryDate: number

Inherited from

providers.JsonRpcProvider._fastQueryDate


_internalBlockNumber

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

Inherited from

providers.JsonRpcProvider._internalBlockNumber


_isProvider

Readonly _isProvider: boolean

Inherited from

providers.JsonRpcProvider._isProvider


_lastBlockNumber

_lastBlockNumber: number

Inherited from

providers.JsonRpcProvider._lastBlockNumber


_maxFilterBlockRange

_maxFilterBlockRange: number

Inherited from

providers.JsonRpcProvider._maxFilterBlockRange


_maxInternalBlockNumber

_maxInternalBlockNumber: number

Inherited from

providers.JsonRpcProvider._maxInternalBlockNumber


_network

_network: Network

Inherited from

providers.JsonRpcProvider._network


_networkPromise

_networkPromise: Promise\<Network>

Inherited from

providers.JsonRpcProvider._networkPromise


_nextId

_nextId: number

Inherited from

providers.JsonRpcProvider._nextId


_pendingFilter

_pendingFilter: Promise\<number>

Inherited from

providers.JsonRpcProvider._pendingFilter


_poller

_poller: Timer

Inherited from

providers.JsonRpcProvider._poller


_pollingInterval

_pollingInterval: number

Inherited from

providers.JsonRpcProvider._pollingInterval


anyNetwork

Readonly anyNetwork: boolean

Inherited from

providers.JsonRpcProvider.anyNetwork


connection

Readonly connection: ConnectionInfo

Inherited from

providers.JsonRpcProvider.connection


disableCcipRead

disableCcipRead: boolean

Inherited from

providers.JsonRpcProvider.disableCcipRead


formatter

formatter: Formatter

Inherited from

providers.JsonRpcProvider.formatter

Accessors

_cache

get _cache(): Record\<string, Promise\<any>>

Returns

Record\<string, Promise\<any>>

Inherited from

providers.JsonRpcProvider._cache


blockNumber

get blockNumber(): number

Returns

number

Inherited from

providers.JsonRpcProvider.blockNumber


network

get network(): Network

Returns

Network

Inherited from

providers.JsonRpcProvider.network


polling

get polling(): boolean

Returns

boolean

Inherited from

providers.JsonRpcProvider.polling

set polling(value): void

Parameters

NameType
valueboolean

Returns

void

Inherited from

providers.JsonRpcProvider.polling


pollingInterval

get pollingInterval(): number

Returns

number

Inherited from

providers.JsonRpcProvider.pollingInterval

set pollingInterval(value): void

Parameters

NameType
valuenumber

Returns

void

Inherited from

providers.JsonRpcProvider.pollingInterval


ready

get ready(): Promise\<Network>

Returns

Promise\<Network>

Inherited from

providers.JsonRpcProvider.ready

Methods

_addEventListener

_addEventListener(eventName, listener, once): this

Parameters

NameType
eventNameEventType
listenerListener
onceboolean

Returns

this

Inherited from

providers.JsonRpcProvider._addEventListener


_call

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

Parameters

NameType
transactionTransactionRequest
blockTagBlockTag
attemptnumber

Returns

Promise\<string>

Inherited from

providers.JsonRpcProvider._call


_getAddress

_getAddress(addressOrName): Promise\<string>

Parameters

NameType
addressOrNamestring | Promise\<string>

Returns

Promise\<string>

Inherited from

providers.JsonRpcProvider._getAddress


_getBlock

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

Parameters

NameType
blockHashOrBlockTagBlockTag | Promise\<BlockTag>
includeTransactions?boolean

Returns

Promise\<Block | BlockWithTransactions>

Inherited from

providers.JsonRpcProvider._getBlock


_getBlockTag

_getBlockTag(blockTag): Promise\<BlockTag>

Parameters

NameType
blockTagBlockTag | Promise\<BlockTag>

Returns

Promise\<BlockTag>

Inherited from

providers.JsonRpcProvider._getBlockTag


_getFastBlockNumber

_getFastBlockNumber(): Promise\<number>

Returns

Promise\<number>

Inherited from

providers.JsonRpcProvider._getFastBlockNumber


_getFilter

_getFilter(filter): Promise\<Filter | FilterByBlockHash>

Parameters

NameType
filterFilter | FilterByBlockHash | Promise\<Filter | FilterByBlockHash>

Returns

Promise\<Filter | FilterByBlockHash>

Inherited from

providers.JsonRpcProvider._getFilter


_getInternalBlockNumber

_getInternalBlockNumber(maxAge): Promise\<number>

Parameters

NameType
maxAgenumber

Returns

Promise\<number>

Inherited from

providers.JsonRpcProvider._getInternalBlockNumber


_getResolver

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

Parameters

NameType
namestring
operation?string

Returns

Promise\<string>

Inherited from

providers.JsonRpcProvider._getResolver


_getTransactionRequest

_getTransactionRequest(transaction): Promise\<Transaction>

Parameters

NameType
transactionDeferrable\<TransactionRequest>

Returns

Promise\<Transaction>

Inherited from

providers.JsonRpcProvider._getTransactionRequest


_ready

_ready(): Promise\<Network>

Returns

Promise\<Network>

Inherited from

providers.JsonRpcProvider._ready


_setFastBlockNumber

_setFastBlockNumber(blockNumber): void

Parameters

NameType
blockNumbernumber

Returns

void

Inherited from

providers.JsonRpcProvider._setFastBlockNumber


_startEvent

_startEvent(event): void

Parameters

NameType
eventEvent

Returns

void

Inherited from

providers.JsonRpcProvider._startEvent


_startPending

_startPending(): void

Returns

void

Inherited from

providers.JsonRpcProvider._startPending


_stopEvent

_stopEvent(event): void

Parameters

NameType
eventEvent

Returns

void

Inherited from

providers.JsonRpcProvider._stopEvent


_uncachedDetectNetwork

_uncachedDetectNetwork(): Promise\<Network>

Returns

Promise\<Network>

Inherited from

providers.JsonRpcProvider._uncachedDetectNetwork


_waitForTransaction

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

Parameters

NameType
transactionHashstring
confirmationsnumber
timeoutnumber
replaceableObject
replaceable.datastring
replaceable.fromstring
replaceable.noncenumber
replaceable.startBlocknumber
replaceable.tostring
replaceable.valueBigNumber

Returns

Promise\<TransactionReceipt>

Inherited from

providers.JsonRpcProvider._waitForTransaction


_wrapTransaction

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

Parameters

NameType
txTransaction
hash?string
startBlock?number

Returns

TransactionResponse

Inherited from

providers.JsonRpcProvider._wrapTransaction


addListener

addListener(eventName, listener): Provider

Parameters

NameType
eventNameEventType
listenerListener

Returns

Provider

Inherited from

providers.JsonRpcProvider.addListener


call

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

Parameters

NameType
transactionDeferrable\<TransactionRequest>
blockTag?BlockTag | Promise\<BlockTag>

Returns

Promise\<string>

Inherited from

providers.JsonRpcProvider.call


ccipReadFetch

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

Parameters

NameType
txTransaction
calldatastring
urlsstring[]

Returns

Promise\<null | string>

Inherited from

providers.JsonRpcProvider.ccipReadFetch


detectNetwork

detectNetwork(): Promise\<Network>

Returns

Promise\<Network>

Inherited from

providers.JsonRpcProvider.detectNetwork


emit

emit(eventName, ...args): boolean

Parameters

NameType
eventNameEventType
...argsany[]

Returns

boolean

Inherited from

providers.JsonRpcProvider.emit


estimateGas

estimateGas(transaction): Promise\<BigNumber>

Parameters

NameType
transactionDeferrable\<TransactionRequest>

Returns

Promise\<BigNumber>

Inherited from

providers.JsonRpcProvider.estimateGas


getAvatar

getAvatar(nameOrAddress): Promise\<null | string>

Parameters

NameType
nameOrAddressstring

Returns

Promise\<null | string>

Inherited from

providers.JsonRpcProvider.getAvatar


getBalance

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

Parameters

NameType
addressOrNamestring | Promise\<string>
blockTag?BlockTag | Promise\<BlockTag>

Returns

Promise\<BigNumber>

Inherited from

providers.JsonRpcProvider.getBalance


getBlock

getBlock(blockHashOrBlockTag): Promise\<Block>

Parameters

NameType
blockHashOrBlockTagBlockTag | Promise\<BlockTag>

Returns

Promise\<Block>

Inherited from

providers.JsonRpcProvider.getBlock


getBlockNumber

getBlockNumber(): Promise\<number>

Returns

Promise\<number>

Inherited from

providers.JsonRpcProvider.getBlockNumber


getBlockWithTransactions

getBlockWithTransactions(blockHashOrBlockTag): Promise\<BlockWithTransactions>

Parameters

NameType
blockHashOrBlockTagBlockTag | Promise\<BlockTag>

Returns

Promise\<BlockWithTransactions>

Inherited from

providers.JsonRpcProvider.getBlockWithTransactions


getCode

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

Parameters

NameType
addressOrNamestring | Promise\<string>
blockTag?BlockTag | Promise\<BlockTag>

Returns

Promise\<string>

Inherited from

providers.JsonRpcProvider.getCode


getEtherPrice

getEtherPrice(): Promise\<number>

Returns

Promise\<number>

Inherited from

providers.JsonRpcProvider.getEtherPrice


getFeeData

getFeeData(): Promise\<FeeData>

Returns

Promise\<FeeData>

Inherited from

providers.JsonRpcProvider.getFeeData


getGasPrice

getGasPrice(): Promise\<BigNumber>

Returns

Promise\<BigNumber>

Inherited from

providers.JsonRpcProvider.getGasPrice


getLogs

getLogs(filter): Promise\<Log[]>

Parameters

NameType
filterFilter | FilterByBlockHash | Promise\<Filter | FilterByBlockHash>

Returns

Promise\<Log[]>

Inherited from

providers.JsonRpcProvider.getLogs


getNetwork

getNetwork(): Promise\<Network>

Returns

Promise\<Network>

Overrides

providers.JsonRpcProvider.getNetwork


getResolver

getResolver(name): Promise\<null | Resolver>

Parameters

NameType
namestring

Returns

Promise\<null | Resolver>

Inherited from

providers.JsonRpcProvider.getResolver


getSigner

getSigner(addressOrIndex?): JsonRpcSigner

Parameters

NameType
addressOrIndex?string | number

Returns

JsonRpcSigner

Inherited from

providers.JsonRpcProvider.getSigner


getStorageAt

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

Parameters

NameType
addressOrNamestring | Promise\<string>
positionBigNumberish | Promise\<BigNumberish>
blockTag?BlockTag | Promise\<BlockTag>

Returns

Promise\<string>

Inherited from

providers.JsonRpcProvider.getStorageAt


getTransaction

getTransaction(transactionHash): Promise\<TransactionResponse>

Parameters

NameType
transactionHashstring | Promise\<string>

Returns

Promise\<TransactionResponse>

Inherited from

providers.JsonRpcProvider.getTransaction


getTransactionCount

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

Parameters

NameType
addressOrNamestring | Promise\<string>
blockTag?BlockTag | Promise\<BlockTag>

Returns

Promise\<number>

Inherited from

providers.JsonRpcProvider.getTransactionCount


getTransactionReceipt

getTransactionReceipt(transactionHash): Promise\<TransactionReceipt>

Parameters

NameType
transactionHashstring | Promise\<string>

Returns

Promise\<TransactionReceipt>

Inherited from

providers.JsonRpcProvider.getTransactionReceipt


getUncheckedSigner

getUncheckedSigner(addressOrIndex?): UncheckedJsonRpcSigner

Parameters

NameType
addressOrIndex?string | number

Returns

UncheckedJsonRpcSigner

Inherited from

providers.JsonRpcProvider.getUncheckedSigner


listAccounts

listAccounts(): Promise\<string[]>

Returns

Promise\<string[]>

Inherited from

providers.JsonRpcProvider.listAccounts


listenerCount

listenerCount(eventName?): number

Parameters

NameType
eventName?EventType

Returns

number

Inherited from

providers.JsonRpcProvider.listenerCount


listeners

listeners(eventName?): Listener[]

Parameters

NameType
eventName?EventType

Returns

Listener[]

Inherited from

providers.JsonRpcProvider.listeners


lookupAddress

lookupAddress(address): Promise\<null | string>

Parameters

NameType
addressstring | Promise\<string>

Returns

Promise\<null | string>

Inherited from

providers.JsonRpcProvider.lookupAddress


off

off(eventName, listener?): this

Parameters

NameType
eventNameEventType
listener?Listener

Returns

this

Inherited from

providers.JsonRpcProvider.off


on

on(eventName, listener): this

Parameters

NameType
eventNameEventType
listenerListener

Returns

this

Inherited from

providers.JsonRpcProvider.on


once

once(eventName, listener): this

Parameters

NameType
eventNameEventType
listenerListener

Returns

this

Inherited from

providers.JsonRpcProvider.once


perform

perform(method, params): Promise\<any>

Parameters

NameType
methodstring
paramsany

Returns

Promise\<any>

Inherited from

providers.JsonRpcProvider.perform


poll

poll(): Promise\<void>

Returns

Promise\<void>

Inherited from

providers.JsonRpcProvider.poll


prepareRequest

prepareRequest(method, params): [string, any[]]

Parameters

NameType
methodstring
paramsany

Returns

[string, any[]]

Inherited from

providers.JsonRpcProvider.prepareRequest


removeAllListeners

removeAllListeners(eventName?): this

Parameters

NameType
eventName?EventType

Returns

this

Inherited from

providers.JsonRpcProvider.removeAllListeners


removeListener

removeListener(eventName, listener): Provider

Parameters

NameType
eventNameEventType
listenerListener

Returns

Provider

Inherited from

providers.JsonRpcProvider.removeListener


resetEventsBlock

resetEventsBlock(blockNumber): void

Parameters

NameType
blockNumbernumber

Returns

void

Inherited from

providers.JsonRpcProvider.resetEventsBlock


resolveName

resolveName(name): Promise\<null | string>

Parameters

NameType
namestring | Promise\<string>

Returns

Promise\<null | string>

Inherited from

providers.JsonRpcProvider.resolveName


send

send(method, params): Promise\<any>

Parameters

NameType
methodstring
paramsany[]

Returns

Promise\<any>

Inherited from

providers.JsonRpcProvider.send


sendTransaction

sendTransaction(signedTransaction): Promise\<TransactionResponse>

Parameters

NameType
signedTransactionstring | Promise\<string>

Returns

Promise\<TransactionResponse>

Inherited from

providers.JsonRpcProvider.sendTransaction


waitForTransaction

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

Parameters

NameType
transactionHashstring
confirmations?number
timeout?number

Returns

Promise\<TransactionReceipt>

Inherited from

providers.JsonRpcProvider.waitForTransaction


defaultUrl

defaultUrl(): string

Returns

string

Inherited from

providers.JsonRpcProvider.defaultUrl


getFormatter

getFormatter(): Formatter

Returns

Formatter

Inherited from

providers.JsonRpcProvider.getFormatter


getNetwork

getNetwork(network): Network

Parameters

NameType
networkNetworkish

Returns

Network

Inherited from

providers.JsonRpcProvider.getNetwork


hexlifyTransaction

hexlifyTransaction(transaction, allowExtra?): Object

Parameters

NameType
transactionTransactionRequest
allowExtra?Object

Returns

Object

Inherited from

providers.JsonRpcProvider.hexlifyTransaction


isProvider

isProvider(value): value is Provider

Parameters

NameType
valueany

Returns

value is Provider

Inherited from

providers.JsonRpcProvider.isProvider