Links

eth_callBundle

Get the simulated bundle for a given block number.
Through eth_callBundle, you can fetch the simulated bundle, txsHex is necessary. Using this api, you can send simulated bundles to miners without dealing with flashbots, reducing technical costs.
Supported on Ethereum.

Parameters

Object - An object with the following fields (required):
  • txsHex(array of string, required) - array or string that contains raw transactions hash.
  • blockNumber(integer number, optional, default latest) - the blockNumber that the bundle should be included.

Returns

Object - An object with the following fields:
  • id(integer number) - json-rpc id.
  • jsonrpc(string) - json-rpc version.
  • result(object) - an object with the following fields:
    • bundleHash(hex string) - the hash value of the bundle.
    • txsResult(array of object, defined below) - simulating transactions result of the bundle.
  • Object schema:
    • fromAddress(hex string) - the origin address of the transaction.
    • gasPrice(integer number) - price of gas of the transaction.
    • txHash(hex string) - hash value of the transaction.
    • gasUsed(integer number) - used gas of the transaction.
    • metadata(object, defined below) - meta info of the transaction.
  • Metadata object schema:
    • coinbaseDiff(integer number) - the amount of ETH that miner would receiver.
    • ethSentToCoinbase(integer number) - the amount of ETH that pay for the miner directly.
    • gasFees(integer number) - the amount of gas used in this transaction.

Example

Request

curl
TypeScript
curl --location --request POST 'https://apis.blockvision.org/v1/<api key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_callBundle",
"params": {
"txsHex": [
"0xf868820154820428825208944592d8f8d7b001e72cb26a73e4fa1806a51ac79d85e8d4a51000802da03412f32337c2b1218fd76f6d953efb487a184d2c80ce0e3d7ceb5a130f25fc91a036031b6e93392eda68b5154b01b67ba68ababe32b8c93cdcf47c66d1bb2edff1",
"0xf868820155820428825208944592d8f8d7b001e72cb26a73e4fa1806a51ac79d85e8d4a51000802da0b0f88f3b49b63aef6148a316dbf6acb534731245b16c25110ec54f954fcef481a026fc384eaa960bed026e39e9f65ae1712ba5afb7250f7513299d896aeb384af1"
],
"blockNumber": 7626710
},
"id": 1
}'
import { BlockVisionProvider, BvNetwork } from 'blockvision.js'
// Optional parameters, but default to eth-mainnet and default api-key.
const bv = new BlockVisionProvider(BvNetwork.ETH_GOERLI)
// Access the BlockVision Mempool API
bv.getCallBundle({
txsHex: [
'0x02f874058085012a05f2008504a817c80082520894ba849911c809f6c922bc4767328a01db30c331e588058d15e17628000080c001a04cf959d89535bc942c3ac3ced842989d8f8452757bba5bba2815ac4afa67c073a005dd3ee1ffd916ec5f3003a94f2c58961f5e1ef04dcfc074be1a18069fe923df'
]
}).then(console.log)

Result

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"bundleHash": "0x161a90b226ba43b0e283d9fda02e801a3685fd4f550f55226016e5c4a8ab3428",
"txsResut": [
{
"metadata": {
"coinbaseDiff": "21861000",
"ethSentToCoinbase": "0",
"gasFees": "21861000"
},
"fromAddress": "0x137be392780558568fc0aB86c73495243Bc6062e",
"gasPrice": "1041",
"txHash": "0x978f0214e0e0ff944d1798fa17b6fe55fda061465f60ee5cc4b707be6f0816fb",
"gasUsed": 21000
},
{
"metadata": {
"coinbaseDiff": "21861000",
"ethSentToCoinbase": "0",
"gasFees": "21861000"
},
"fromAddress": "0x137be392780558568fc0aB86c73495243Bc6062e",
"gasPrice": "1041",
"txHash": "0xc9ed41d6c50d575fcf2f83f370b094f834ecae2d08ffdfa48732c49fa81b03c0",
"gasUsed": 21000
}
]
}
}