Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • JsonRpcProvider
    • OpenMevBundleProvider

Index

Constructors

constructor

  • new OpenMevBundleProvider(genericProvider: BaseProvider, authSigner: Signer, connectionInfoOrUrl: ConnectionInfo, network: Networkish): OpenMevBundleProvider
  • Parameters

    • genericProvider: BaseProvider
    • authSigner: Signer
    • connectionInfoOrUrl: ConnectionInfo
    • network: Networkish

    Returns OpenMevBundleProvider

Properties

_bootstrapPoll

_bootstrapPoll: Timer

_emitted

_emitted: {}

Type declaration

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

_eventLoopCache

_eventLoopCache: Record<string, Promise<any>>

_events

_events: Event[]

_fastBlockNumber

_fastBlockNumber: number

_fastBlockNumberPromise

_fastBlockNumberPromise: Promise<number>

_fastQueryDate

_fastQueryDate: number

_internalBlockNumber

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

Readonly _isProvider

_isProvider: boolean

_lastBlockNumber

_lastBlockNumber: number

_maxInternalBlockNumber

_maxInternalBlockNumber: number

_network

_network: Network

_networkPromise

_networkPromise: Promise<Network>

_nextId

_nextId: number

_pendingFilter

_pendingFilter: Promise<number>

_poller

_poller: Timer

_pollingInterval

_pollingInterval: number

Readonly anyNetwork

anyNetwork: boolean

Private authSigner

authSigner: Signer

Readonly connection

connection: ConnectionInfo

Private connectionInfo

connectionInfo: ConnectionInfo

formatter

formatter: Formatter

Private genericProvider

genericProvider: BaseProvider

Accessors

_cache

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

blockNumber

  • get blockNumber(): number
  • Returns number

network

  • get network(): Network
  • Returns Network

polling

  • get polling(): boolean
  • set polling(value: boolean): void
  • Returns boolean

  • Parameters

    • value: boolean

    Returns void

pollingInterval

  • get pollingInterval(): number
  • set pollingInterval(value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

ready

  • get ready(): Promise<Network>
  • Returns Promise<Network>

Methods

_addEventListener

  • Parameters

    • eventName: EventType
    • listener: Listener
    • once: boolean

    Returns OpenMevBundleProvider

_getAddress

  • _getAddress(addressOrName: string | Promise<string>): Promise<string>
  • Parameters

    • addressOrName: string | Promise<string>

    Returns Promise<string>

_getBlock

  • _getBlock(blockHashOrBlockTag: BlockTag | Promise<BlockTag>, includeTransactions?: boolean): Promise<Block | BlockWithTransactions>
  • Parameters

    • blockHashOrBlockTag: BlockTag | Promise<BlockTag>
    • Optional includeTransactions: boolean

    Returns Promise<Block | BlockWithTransactions>

_getBlockTag

  • _getBlockTag(blockTag: BlockTag | Promise<BlockTag>): Promise<BlockTag>
  • Parameters

    • blockTag: BlockTag | Promise<BlockTag>

    Returns Promise<BlockTag>

_getFastBlockNumber

  • _getFastBlockNumber(): Promise<number>
  • Returns Promise<number>

_getFilter

  • _getFilter(filter: Filter | FilterByBlockHash | Promise<Filter | FilterByBlockHash>): Promise<Filter | FilterByBlockHash>
  • Parameters

    • filter: Filter | FilterByBlockHash | Promise<Filter | FilterByBlockHash>

    Returns Promise<Filter | FilterByBlockHash>

_getInternalBlockNumber

  • _getInternalBlockNumber(maxAge: number): Promise<number>
  • Parameters

    • maxAge: number

    Returns Promise<number>

_getResolver

  • _getResolver(name: string): Promise<string>
  • Parameters

    • name: string

    Returns Promise<string>

_getTransactionRequest

  • _getTransactionRequest(transaction: Deferrable<TransactionRequest>): Promise<Transaction>
  • Parameters

    • transaction: Deferrable<TransactionRequest>

    Returns Promise<Transaction>

_ready

  • _ready(): Promise<Network>
  • Returns Promise<Network>

_setFastBlockNumber

  • _setFastBlockNumber(blockNumber: number): void
  • Parameters

    • blockNumber: number

    Returns void

_startEvent

  • _startEvent(event: Event): void
  • Parameters

    • event: Event

    Returns void

_startPending

  • _startPending(): void
  • Returns void

_stopEvent

  • _stopEvent(event: Event): void
  • Parameters

    • event: Event

    Returns void

_uncachedDetectNetwork

  • _uncachedDetectNetwork(): Promise<Network>
  • Returns Promise<Network>

_waitForTransaction

  • _waitForTransaction(transactionHash: string, confirmations: number, timeout: number, replaceable: { data: string; from: string; nonce: number; startBlock: number; to: string; value: BigNumber }): Promise<TransactionReceipt>
  • Parameters

    • transactionHash: string
    • confirmations: number
    • timeout: number
    • replaceable: { data: string; from: string; nonce: number; startBlock: number; to: string; value: BigNumber }
      • data: string
      • from: string
      • nonce: number
      • startBlock: number
      • to: string
      • value: BigNumber

    Returns Promise<TransactionReceipt>

_wrapTransaction

  • _wrapTransaction(tx: Transaction, hash?: string, startBlock?: number): TransactionResponse
  • Parameters

    • tx: Transaction
    • Optional hash: string
    • Optional startBlock: number

    Returns TransactionResponse

addListener

  • addListener(eventName: EventType, listener: Listener): Provider
  • Parameters

    • eventName: EventType
    • listener: Listener

    Returns Provider

call

  • call(transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>
  • Parameters

    • transaction: Deferrable<TransactionRequest>
    • Optional blockTag: BlockTag | Promise<BlockTag>

    Returns Promise<string>

detectNetwork

  • detectNetwork(): Promise<Network>
  • Returns Promise<Network>

emit

  • emit(eventName: EventType, ...args: any[]): boolean
  • Parameters

    • eventName: EventType
    • Rest ...args: any[]

    Returns boolean

estimateGas

  • estimateGas(transaction: Deferrable<TransactionRequest>): Promise<BigNumber>
  • Parameters

    • transaction: Deferrable<TransactionRequest>

    Returns Promise<BigNumber>

Private fetchReceipts

Private formatNumber

  • formatNumber(num: number): string

getAvatar

  • getAvatar(nameOrAddress: string): Promise<null | string>
  • Parameters

    • nameOrAddress: string

    Returns Promise<null | string>

getBalance

  • getBalance(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<BigNumber>
  • Parameters

    • addressOrName: string | Promise<string>
    • Optional blockTag: BlockTag | Promise<BlockTag>

    Returns Promise<BigNumber>

getBlock

  • getBlock(blockHashOrBlockTag: BlockTag | Promise<BlockTag>): Promise<Block>
  • Parameters

    • blockHashOrBlockTag: BlockTag | Promise<BlockTag>

    Returns Promise<Block>

getBlockNumber

  • getBlockNumber(): Promise<number>
  • Returns Promise<number>

getBlockWithTransactions

  • getBlockWithTransactions(blockHashOrBlockTag: BlockTag | Promise<BlockTag>): Promise<BlockWithTransactions>
  • Parameters

    • blockHashOrBlockTag: BlockTag | Promise<BlockTag>

    Returns Promise<BlockWithTransactions>

getBundleStats

getCode

  • getCode(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>
  • Parameters

    • addressOrName: string | Promise<string>
    • Optional blockTag: BlockTag | Promise<BlockTag>

    Returns Promise<string>

getEtherPrice

  • getEtherPrice(): Promise<number>
  • Returns Promise<number>

getFeeData

  • getFeeData(): Promise<FeeData>
  • Returns Promise<FeeData>

getGasPrice

  • getGasPrice(): Promise<BigNumber>
  • Returns Promise<BigNumber>

getLogs

  • getLogs(filter: Filter | FilterByBlockHash | Promise<Filter | FilterByBlockHash>): Promise<Log[]>
  • Parameters

    • filter: Filter | FilterByBlockHash | Promise<Filter | FilterByBlockHash>

    Returns Promise<Log[]>

getNetwork

  • getNetwork(): Promise<Network>
  • Returns Promise<Network>

getResolver

  • getResolver(name: string): Promise<null | Resolver>
  • Parameters

    • name: string

    Returns Promise<null | Resolver>

getSigner

  • getSigner(addressOrIndex?: string | number): JsonRpcSigner
  • Parameters

    • Optional addressOrIndex: string | number

    Returns JsonRpcSigner

getStorageAt

  • getStorageAt(addressOrName: string | Promise<string>, position: BigNumberish | Promise<BigNumberish>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>
  • Parameters

    • addressOrName: string | Promise<string>
    • position: BigNumberish | Promise<BigNumberish>
    • Optional blockTag: BlockTag | Promise<BlockTag>

    Returns Promise<string>

getTransaction

  • getTransaction(transactionHash: string | Promise<string>): Promise<TransactionResponse>
  • Parameters

    • transactionHash: string | Promise<string>

    Returns Promise<TransactionResponse>

getTransactionCount

  • getTransactionCount(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<number>
  • Parameters

    • addressOrName: string | Promise<string>
    • Optional blockTag: BlockTag | Promise<BlockTag>

    Returns Promise<number>

getTransactionReceipt

  • getTransactionReceipt(transactionHash: string | Promise<string>): Promise<TransactionReceipt>
  • Parameters

    • transactionHash: string | Promise<string>

    Returns Promise<TransactionReceipt>

getUncheckedSigner

  • getUncheckedSigner(addressOrIndex?: string | number): UncheckedJsonRpcSigner
  • Parameters

    • Optional addressOrIndex: string | number

    Returns UncheckedJsonRpcSigner

getUserStats

listAccounts

  • listAccounts(): Promise<string[]>
  • Returns Promise<string[]>

listenerCount

  • listenerCount(eventName?: EventType): number
  • Parameters

    • Optional eventName: EventType

    Returns number

listeners

  • listeners(eventName?: EventType): Listener[]
  • Parameters

    • Optional eventName: EventType

    Returns Listener[]

lookupAddress

  • lookupAddress(address: string | Promise<string>): Promise<null | string>
  • Parameters

    • address: string | Promise<string>

    Returns Promise<null | string>

off

  • Parameters

    • eventName: EventType
    • Optional listener: Listener

    Returns OpenMevBundleProvider

on

  • Parameters

    • eventName: EventType
    • listener: Listener

    Returns OpenMevBundleProvider

once

  • Parameters

    • eventName: EventType
    • listener: Listener

    Returns OpenMevBundleProvider

perform

  • perform(method: string, params: any): Promise<any>
  • Parameters

    • method: string
    • params: any

    Returns Promise<any>

poll

  • poll(): Promise<void>
  • Returns Promise<void>

Private populateCarrierTransaction

  • populateCarrierTransaction(carrier: TransactionRequest, signer: Signer): Promise<void>
  • A private method to populate {@param carrier}'s missing fields with default values

    since

    v0.6.0

    Parameters

    • carrier: TransactionRequest

      an instance of TransactionRequest which will be the tx containing the full payload in its data field

    • signer: Signer

      the signer Object which will send the carrier tx

    Returns Promise<void>

Private prepareBundleRequest

  • prepareBundleRequest(method: "eth_callBundle" | "eth_sendBundle" | "eth_sendMegaBundle" | "openmev_getUserStats" | "openmev_getBundleStats", params: RpcParams): { id: number; jsonrpc: string; method: "eth_callBundle" | "eth_sendBundle" | "eth_sendMegaBundle" | "openmev_getUserStats" | "openmev_getBundleStats"; params: RpcParams }
  • since

    v0.5.0

    • eth_sendMegaBundle, v0.6.0

    Parameters

    • method: "eth_callBundle" | "eth_sendBundle" | "eth_sendMegaBundle" | "openmev_getUserStats" | "openmev_getBundleStats"
    • params: RpcParams

    Returns { id: number; jsonrpc: string; method: "eth_callBundle" | "eth_sendBundle" | "eth_sendMegaBundle" | "openmev_getUserStats" | "openmev_getBundleStats"; params: RpcParams }

    • id: number
    • jsonrpc: string
    • method: "eth_callBundle" | "eth_sendBundle" | "eth_sendMegaBundle" | "openmev_getUserStats" | "openmev_getBundleStats"
    • params: RpcParams

prepareRequest

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

    • method: string
    • params: any

    Returns [string, any[]]

removeAllListeners

  • Parameters

    • Optional eventName: EventType

    Returns OpenMevBundleProvider

removeListener

  • removeListener(eventName: EventType, listener: Listener): Provider
  • Parameters

    • eventName: EventType
    • listener: Listener

    Returns Provider

Private request

  • request(request: string): Promise<any>
  • summary

    OpenMEV currently does not utilize proprietary header information, so we just leave the flashbots implementation as is

    Parameters

    • request: string

    Returns Promise<any>

resetEventsBlock

  • resetEventsBlock(blockNumber: number): void
  • Parameters

    • blockNumber: number

    Returns void

resolveName

  • resolveName(name: string | Promise<string>): Promise<null | string>
  • Parameters

    • name: string | Promise<string>

    Returns Promise<null | string>

Private rlpSerializeBundle

  • method

    rlpSerializeBundle

    summary

    A private method to encode a OpenMevBundle following the RLP serialization standard.

    since

    v0.6.0

    Parameters

    Returns string

    string; the RLP encoded bundle.

send

  • send(method: string, params: any[]): Promise<any>
  • Parameters

    • method: string
    • params: any[]

    Returns Promise<any>

sendBundle

sendCarrierTransaction

  • sendCarrierTransaction(bundle: OpenMevBundle, validatorPublicKey: string, signer: Signer, carrierTx: TransactionRequest): Promise<TransactionResponse>
  • method

    sendCarrierTransaction

    summary

    Method to send a carrier tx into the public mempool

    since

    v0.6.0

    Parameters

    • bundle: OpenMevBundle

      OpenMevBundle with AT LEAST signed bundled transactions in signedBundledTransactions field obtainedf rom signBundle method, and blockTarget.

    • validatorPublicKey: string
    • signer: Signer

      Signer who will sign the carrier transaction.

    • carrierTx: TransactionRequest

      TransactionRequest whose data field will carry the encrypted bundle : MAY be an incomplete object which will be populated with default values.

    Returns Promise<TransactionResponse>

    Promise containing the response for the carrier tx

sendRawBundle

sendTransaction

  • sendTransaction(signedTransaction: string | Promise<string>): Promise<TransactionResponse>
  • Parameters

    • signedTransaction: string | Promise<string>

    Returns Promise<TransactionResponse>

signBundle

simulate

  • simulate(signedBundledTransactions: string[], blockTag: BlockTag, stateBlockTag?: BlockTag, blockTimestamp?: number): Promise<SimulationResponse>
  • Parameters

    • signedBundledTransactions: string[]
    • blockTag: BlockTag
    • Optional stateBlockTag: BlockTag
    • Optional blockTimestamp: number

    Returns Promise<SimulationResponse>

Private wait

waitForTransaction

  • waitForTransaction(transactionHash: string, confirmations?: number, timeout?: number): Promise<TransactionReceipt>
  • Parameters

    • transactionHash: string
    • Optional confirmations: number
    • Optional timeout: number

    Returns Promise<TransactionReceipt>

Static create

  • create(genericProvider: BaseProvider, authSigner: Signer, connectionInfoOrUrl?: string | ConnectionInfo, network?: Networkish): Promise<OpenMevBundleProvider>
  • Parameters

    • genericProvider: BaseProvider
    • authSigner: Signer
    • Optional connectionInfoOrUrl: string | ConnectionInfo
    • Optional network: Networkish

    Returns Promise<OpenMevBundleProvider>

Static defaultUrl

  • defaultUrl(): string
  • Returns string

Static getFormatter

  • getFormatter(): Formatter
  • Returns Formatter

Static getMaxBaseFeeInFutureBlock

  • getMaxBaseFeeInFutureBlock(baseFee: BigNumber, blocksInFuture: number): BigNumber
  • Parameters

    • baseFee: BigNumber
    • blocksInFuture: number

    Returns BigNumber

Static getNetwork

  • getNetwork(network: Networkish): Network
  • Parameters

    • network: Networkish

    Returns Network

Static hexlifyTransaction

  • hexlifyTransaction(transaction: TransactionRequest, allowExtra?: {}): {}
  • Parameters

    • transaction: TransactionRequest
    • Optional allowExtra: {}
      • [key: string]: boolean

    Returns {}

    • [key: string]: string | AccessList

Static isProvider

  • isProvider(value: any): value is Provider
  • Parameters

    • value: any

    Returns value is Provider

Static throttleCallback

  • throttleCallback(): Promise<boolean>

Generated using TypeDoc