This guide provides information on Blockdaemon-specific JSON-RPC APIs for Ethereum to access transactions and transfer data. A key feature of these APIs is the ability to retrieve transaction hashes by address.
Account API
bd_getTransactionHashesByAddress
bd_getTransactionHashesByAddress
This method returns transaction hashes by address. This functionality is used to track transactions for a specific account.
Request Example
{
"jsonrpc": "2.0",
"method": "bd_getTransactionHashesByAddress",
"id": 1,
"params": [
"0x388C818CA8B9251b393131C08a736A67ccB19297"
]
}
Request Parameters
Position | Type | Description |
---|---|---|
1 | Hex-encoded EVM address | (required) The main account address |
2 | Filter Object | (optional) An object with filter arguments. Please see the list in the table below. |
Filter Object
Info:
The
pageToken
should be used in combination with prior filter arguments to work properly.
Argument | Type | Description |
---|---|---|
blockStart | Unsigned integer or hex-encoded number | (optional) Only return hashes higher than or equal to this block number |
blockEnd | Unsigned integer or hex-encoded number | (optional) Only return hashes lower than this block number |
order | Enum (desc|asc) | (optional) Return hashes by block number in ascending or descending order. The default is descending when omitted. |
pageToken | String | (optional) Token to continue to the next page |
pageSize | Unsigned integer or hex-encoded number | (optional) Maximum number of transactions returned. It must be between 1 and 100. The default is 100. |
contract | Comma-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. |
Response Example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"transactions": [
"0xf717bf9b76338c275373bf25b48692d4aad2f88b72b8677a5cae00a6c9e60157",
"0x82d97cb65e4bd8c2f76e45d90f8f09550317b52a95d8c5d6b92a662fe72cac60",
"0xdebb7de86c2f09f94e23c12c4a09f9abab4391b274febfeef1505b096cd1ad84",
...
]
}
}
Response Object
Field | Type | Description |
---|---|---|
transactions | List of hashes | (required) A list of hashes that reference the provided contract and match the provided filter |
pageToken | String | (optional) Token to continue to the next page (if applicable) |
Blocks API
bd_getBlockHeaderByDate
bd_getBlockHeaderByDate
This method returns a block header for the specified date. If there is no block for that exact date, the nearest block will be returned instead.
Request Example
{
"jsonrpc": "2.0",
"method": "bd_getBlockHeaderByDate",
"id": 1,
"params": [1728476495]
}
Request Parameter
Field | Type | Description |
---|---|---|
params | timestamp | 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
Field | Type | Description |
---|---|---|
time | Hex-encoded number | (required) The block time in Unix timestamp |
height | Hex-encoded number | (required) The block number |
hash | String | (required) The block hash |
Tokens API
bd_getTokenBalance
bd_getTokenBalance
This method returns the token balance for a given address.
Request Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "bd_getTokenBalance",
"params": [
{
"contractAddress": "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE",
"ownerAddress": "0xb8aFF7b6ddbecaF1e094C5a628845fC13e93d7f2"
}
]
}
Request Parameters
Field | Type | Description |
---|---|---|
contractAddress | String | (required) The token contract address for which the balance is being queried |
ownerAddress | String | (required) The account address whose token balance you want to retrieve |
Response Example
{
"jsonrpc": "2.0",
"id": 1,
"result": 0x659abc0a1818f23843ff59b3
}
Response Object
Field | Type | Description |
---|---|---|
result | String | (required) The token balance in hexadecimal format. |
bd_getTokenMetadata
bd_getTokenMetadata
This method returns token metadata by token address, including the symbol and decimals.
Request Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "bd_getTokenMetadata",
"params": [
"0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE"
]
}
Request Parameter
Field | Type | Description |
---|---|---|
tokenAddress | String | (required) The Ethereum chain address of the token |
Response Example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"decimals": "0x12",
"totalSupply": "0x314d8d3733f32fa376f039a13d46",
"name": "SHIBA INU",
"symbol": "SHIB"
}
}
Response Object
Field | Type | Description |
---|---|---|
decimals | Hex encoded number | (required) The decimal places the token uses |
totalSupply | Hex encoded number | (required) The number of a specific token that can currently exist |
name | String | (required) The token name |
symbol | String | (required) The token symbol |
bd_getContractAbiByAddress
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.
Request Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "bd_getContractAbiByAddress",
"params": [
"0x0e5dDA855EB1De2a212cD1F62b2a3EE49D20c444"
]
}
Request Parameter
Filed | Type | Description |
---|---|---|
contractAddress | String | (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
Field | Type | Description |
---|---|---|
result | String | The ABI of the specified contract in JSON format. |
Fees API
bd_estimateFee
bd_estimateFee
This method estimates the required fee to confirm your transaction on the network.
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
Field | Type | Description |
---|---|---|
result | Object | Contains the estimated fees and the most recent block. |
estimatedFees | Object | Holds the fee estimates for different categories: fast, medium, and slow |
Transaction API
bd_createTokenTransferTransaction
bd_createTokenTransferTransaction
This method creates a token transfer transaction. Abstract away contract calls required to create a token transfer transaction.
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
An object containing the transfer information, including the token contract address, source and target addresses, token amount, and gas fees.
Response Example
The response includes the transaction ID and the unsigned transaction for signing and sending to the blockchain.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"id": "0x9db934eed7f5008a9188da2ba501fc7bc54c0e6f3ba7635ec1cb28ab4f3f72b3",
"unsignedTx": "02f871820fa20884018e35688478c3c9688286f794076488d244a73da4fa843f5a8cd91f655ca81a1e80b844a9059cbb000000000000000000000000a96cce846638dc72885dfb93ac28961a09ae4b0a00000000000000000000000000000000000000000000000000000000000003e8c0808080"
}
}
bd_compileTransaction
bd_compileTransaction
This method compiles the transaction signature with an unsigned transaction to create a signed transaction ready for broadcasting over the network.
Request Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "bd_compileTransaction",
"params": [
{
"unsignedTx": "02ed82426880840c1a97ac847e881fdc82520894057cbbc4d1568530991088108ee48fd8b949167f843b9aca0080c0",
"signature": "3045022100abf81d41de58ed9bc92f5244fe0b2b5af0f83a71d1e1a7a317bde66146ed0b0f022043375062398819c5ff3cd859b4f861d96835cfda24cde435d681792a706b4d78",
"publicKey": "037dbdaabd7fecb262b75874b16d0b2cf66a5a452bcc7f361cdf6955c0c581c727"
}
]
}
Request Parameters
Field | Type | Description |
---|---|---|
unsignedTx | String | required The unsigned transaction to be compiled |
signature | String | required The signature used to sign the unsigned transaction |
publicKey | String | required The public key associated with the signer of the transaction |
Response Example
{
"jsonrpc": "2.0",
"id": 1,
"result": "02f86e820fa20784017f87988478b51b9882520894a96cce846638dc72885dfb93ac28961a09ae4b0a8203e880c001a08a62fd0d7d2bdea0a7e2c276df8a92112aabb9a66f3ce309455bd70b18604e18a05f5c7af8e9d062eeb5b25f2b88c5e61f454edd2e1701dfce1c5314b8d8ce20ad"
}