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
  • 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.