Ethereum Custom Methods

This guide outlines Blockdaemon's Ethereum JSON-RPC APIs for retrieving transaction and transfer data. One of the key capabilities is retrieving transaction hashes associated with a specific address.

Ethereum custom methods support the following networks:

  • mainnet
  • holesky
  • sepolia
  • hoodi
📘

See the Ethereum RPC API connection guide.


Account API

bd_getTransactionHashesByAddress

Returns transaction hashes by address. Use this method to track transactions associated with a specific address.


Compute Unit Value: 50 CU

Request Example

{
    "jsonrpc": "2.0",
    "method": "bd_getTransactionHashesByAddress",
    "id": 1,
    "params": [
        "0x388C818CA8B9251b393131C08a736A67ccB19297"
    ]
}
{
    "jsonrpc": "2.0",
    "method": "bd_getTransactionHashesByAddress",
    "id": 1,
    "params": [
      "0x388C818CA8B9251b393131C08a736A67ccB19297",
      {
        "blockStart": "0x10D4F",                 
        "blockEnd": "0x10FFFF",                  
        "order": "asc",                          
        "pageSize": 50,                           
    	}
   ]
}

Request Parameters

TypeDescription
params: Hex-encoded EVM address(required) The main account address.
params: Filter Object(optional) An object with filters. See the table below.

Filter Object

ArgumentTypeDescription
blockStartUnsigned integer or hex-encoded number(optional) Only return hashes higher than or equal to this block number.
blockEndUnsigned integer or hex-encoded number(optional) Only return hashes lower than this block number.
orderEnum (desc|asc)(optional) Return hashes by block number in ascending or descending order. The default is descending.
pageTokenString(optional) Token for pagination.
pageSizeUnsigned integer or hex-encoded number(optional) Max results per page (1-100). Default is 100.
contractComma-separated string of hex-encoded EVM addresses(optional) Only return hashes where the specified contract address was invoked. Multiple addresses are treated as an OR filter.
❗️

Info:

The pageToken should be used in combination with prior filter arguments to work properly.

Response Example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "transactions": [
            "0xf717bf9b76338c275373bf25b48692d4aad2f88b72b8677a5cae00a6c9e60157",
            "0x82d97cb65e4bd8c2f76e45d90f8f09550317b52a95d8c5d6b92a662fe72cac60",
            "0xdebb7de86c2f09f94e23c12c4a09f9abab4391b274febfeef1505b096cd1ad84",
            ...
        ]
    }
}

Response Object

FieldTypeDescription
transactionsList of hashes(required) List of matching transaction hashes.
pageTokenString(optional) Token for fetching the next page of results. Add the token in the request payload.

Blocks API

bd_getBlockHeaderByDate

Returns a block header for the given date (Unix timestamp). If no exact match is found, returns the nearest block.


Compute Unit Value: 50 CU

Request Example

{
    "jsonrpc": "2.0",
    "method": "bd_getBlockHeaderByDate",
    "id": 1,
    "params": [1728476495]
}

Request Parameter

FieldTypeDescription
params: Timestamptimestamp(required) The timestamp in Unix seconds can be provided as either a number or a hex-encoded number.

Response Example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "time": "0x6706754f",
        "height": "0x13f55fe",
        "hash": "0xead6af5739422ca8e99fba58943e138c718e5a093c437513973d9945ef89472b"
    }
}

Response Object

FieldTypeDescription
timeHex-encoded number(required) The block time in Unix timestamp.
heightHex-encoded number(required) The block number.
hashString(required) The block hash.

Tokens API

bd_getTokenBalance

Returns the token balance of a given address for a specific ERC-20 token contract.

🚧

Info

Historical queries only supported on Ethereum mainnet.


Compute Unit Value: 5 CU

Request Example

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "bd_getTokenBalance",
  "params": [
    {
      "contractAddress": "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE",
      "ownerAddress": "0xb8aFF7b6ddbecaF1e094C5a628845fC13e93d7f2",
      "blockNumber": "0x14EC0C9"
    }
  ]
}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "bd_getTokenBalance",
  "params": [
    {
      "contractAddress": "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE",
      "ownerAddress": "0xb8aFF7b6ddbecaF1e094C5a628845fC13e93d7f2",
      "date": "0x67c07b8f"
    }
  ]
}

Request Parameters

FieldTypeDescription
contractAddressString(required) The token contract address for which the balance is being queried
ownerAddressString(required) The account address whose token balance you want to retrieve
dateString/Int (hex/int)(optional) Timestamp to fetch historical balance
blockNumberString/Int (hex/int)(optional) Block number to fetch historical balance

Response Example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": 0x659abc0a1818f23843ff59b3
}

bd_getTokenMetadata

Returns token metadata, such as symbol, name, decimals, and total supply.


Compute Unit Value: 5 CU

Request Example

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "bd_getTokenMetadata",
    "params": [
        "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE"
    ]
}

Request Parameter

FieldTypeDescription
params: Token AddressString(required) Token contract address.

Response Example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "decimals": "0x12",
        "totalSupply": "0x314d8d3733f32fa376f039a13d46",
        "name": "SHIBA INU",
        "symbol": "SHIB"
    }
}

Response Object

FieldTypeDescription
decimalsHex encoded number(required) The decimal places the token uses.
totalSupplyHex encoded number(required) The number of a specific token that can currently exist.
nameString(required) The token name.
symbolString(required) The token symbol.

bd_getContractAbiByAddress

🚧

Info

This method is available only for the mainnet.

This method returns the ABI (Application Binary Interface) for a given contract address. It is not limited to token addresses but applies to any contract address. The ABI is required to interact with the contract.


Compute Unit Value: 10 CU

Request Example

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "bd_getContractAbiByAddress",
  "params": [
    "0x0e5dDA855EB1De2a212cD1F62b2a3EE49D20c444"
  ]
}

Request Parameter

FiledTypeDescription
params: Contract AddressString(required) The contract address for which you want to retrieve the ABI.

Response Example

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "beacon",
          "type": "address"
        },
        {
          "internalType": "bytes",
          "name": "data",
          "type": "bytes"
        }
      ],
      "stateMutability": "payable",
      "type": "constructor"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "address",
          "name": "previousAdmin",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "address",
          "name": "newAdmin",
          "type": "address"
        }
      ],
      "name": "AdminChanged",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "beacon",
          "type": "address"
        }
      ],
      "name": "BeaconUpgraded",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "implementation",
          "type": "address"
        }
      ],
      "name": "Upgraded",
      "type": "event"
    },
    {
      "stateMutability": "payable",
      "type": "fallback"
    },
    {
      "stateMutability": "payable",
      "type": "receive"
    }
  ]
}

Response Object

FieldTypeDescription
inputsArrayAn array of input parameters. Each item includes name, type, and internalType.
indexedBooleanIndicates whether the event parameter is indexed. Only present for event ABI items.
internalTypeStringThe type used internally, e.g., address.
nameStringName of the function or event.
typeStringType of the ABI item. Can be constructor, function, event, fallback, or receive.
anonymousBooleanIndicates if the event is anonymous. Only present for event types.
stateMutabilityStringThe state mutability of the function, e.g., payable.

Fees API

bd_estimateFee

Estimates the required fee to confirm your transaction on the network.


Compute Unit Value: 50 CU

Request Example

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "bd_estimateFee"
}

Response Example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "estimatedFees": {
            "fast": {
                "maxPriorityFee": "0x1e21cfcbe",
                "maxTotalFee": "0x4435d69a7"
            },
            "medium": {
                "maxPriorityFee": "0x47868c00",
                "maxTotalFee": "0x23a8b4df1"
            },
            "slow": {
                "maxPriorityFee": "0x3b9aca00",
                "maxTotalFee": "0x21d2c9e30"
            }
        },
        "mostRecentBlock": "0x13f1c5b"
    }
}

Response Object

FieldTypeDescription
estimatedFeesObjectContains fee estimates grouped by speed category.
estimatedFees: fastObjectFee values for the fastest confirmation.
estimatedFees: mediumObjectFee values for average confirmation time.
estimatedFees: slowObjectFee values for lowest-cost confirmation.
maxPriorityFeeStringMax priority fee per gas in hexadecimal (in wei).
maxTotalFeeStringMax total fee (base fee + priority fee) per gas in hexadecimal (in wei).
mostRecentBlockStringLatest block number (in hexadecimal) used to generate the fee estimates.

Transaction API

bd_createTokenTransferTransaction

Creates a token transfer transaction. Abstract away contract calls required to create a token transfer transaction.


Compute Unit Value: 10 CU

Request Example

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "bd_createTokenTransferTransaction",
    "params": [
        {
            "contractAddress": "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE",
            "from": "0xb8aFF7b6ddbecaF1e094C5a628845fC13e93d7f2",
            "to": "0xa96cce846638dc72885dfb93ac28961a09ae4b0a",
            "value": 1000,
            "gas": 250,
            "maxFeePerGas": 300,
            "maxPriorityFeePerGas": 100,
            "nonce": 203
        }
    ]
}

Request Parameters

FieldTypeDescription
contractAddressString(required) The token contract address you want to interact with. Must be a valid hex-encoded EVM address.
fromString(required) The sender's address. Must be a valid hex-encoded EVM address.
toString(required) The recipient's address. Must be a valid hex-encoded EVM address.
valueInteger(required) Amount of tokens to transfer, in token’s smallest unit.
gasInteger(optional) The gas limit for the transaction. If omitted, a default or estimated value will be used.
maxFeePerGasInteger(optional) Maximum total fee (base fee + priority fee) per gas unit in wei.
maxPriorityFeePerGasInteger(optional) Maximum priority fee per gas unit (tip for miners) in wei.
nonceInteger(optional) The nonce for the from address. If not provided, the next available nonce will be used.

Response Example

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "id": "0x9db934eed7f5008a9188da2ba501fc7bc54c0e6f3ba7635ec1cb28ab4f3f72b3",
    "unsignedTx": "02f871820fa20884018e35688478c3c9688286f794076488d244a73da4fa843f5a8cd91f655ca81a1e80b844a9059cbb000000000000000000000000a96cce846638dc72885dfb93ac28961a09ae4b0a00000000000000000000000000000000000000000000000000000000000003e8c0808080"
  }
}

Response Object

FieldTypeDescription
idStringA unique transaction ID.
unsignedTxStringUnsigned raw transaction in hexadecimal format, ready to be signed and sent to the blockchain.

bd_compileTransaction

Compiles the signature and public key with an unsigned transaction to create a signed transaction ready for broadcasting over the network.


Compute Unit Value: 5 CU

Request Example

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "bd_compileTransaction",
    "params": [
      {
        "unsignedTx": "02ed82426880840c1a97ac847e881fdc82520894057cbbc4d1568530991088108ee48fd8b949167f843b9aca0080c0",
        "signature": "3045022100abf81d41de58ed9bc92f5244fe0b2b5af0f83a71d1e1a7a317bde66146ed0b0f022043375062398819c5ff3cd859b4f861d96835cfda24cde435d681792a706b4d78",
        "publicKey": "037dbdaabd7fecb262b75874b16d0b2cf66a5a452bcc7f361cdf6955c0c581c727"
      }
    ]
}

Request Parameters

FieldTypeDescription
unsignedTxStringrequired The unsigned transaction to be compiled
signatureStringrequired The signature used to sign the unsigned transaction
publicKeyStringrequired The public key associated with the signer of the transaction

Response Example

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "02f86e820fa20784017f87988478b51b9882520894a96cce846638dc72885dfb93ac28961a09ae4b0a8203e880c001a08a62fd0d7d2bdea0a7e2c276df8a92112aabb9a66f3ce309455bd70b18604e18a05f5c7af8e9d062eeb5b25f2b88c5e61f454edd2e1701dfce1c5314b8d8ce20ad"
}

👋 Need Help?

Contact us through email or our support page for any issues, bugs, or assistance you may need.