Comment on page
🖥
For Developers
[ Base URL: https://wbtc-chain.com/api ]
This API is provided for developers transitioning their applications from Etherscan to BlockScout. It supports GET and POST requests.
Token
Eth Rpc
Rpc
[ Base URL: https://wbtc-chain.com/api/eth-rpc ]
This API is provided to support some rpc methods in the exact format specified for ethereum nodes, which can be found here. This is useful to allow sending requests to blockscout without having to change anything about the request. However, in general, the custom RPC is recommended. Anything not in this list is not supported. Click on the method to be taken to the documentation for that method, and check the notes section for any potential differences.
curl -X POST --data '{"id":0,"jsonrpc":"2.0","method": "eth_blockNumber", "params": []}'
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": []
}
The `earliest` parameter will not work as expected currently, because genesis block balances are not currently imported
curl -X POST --data '{"id":0,"jsonrpc":"2.0","method": "eth_getBalance", "params": []}'
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0x0000000000000000000000000000000000000007",
"latest"
]
}
Will never return more than 1000 log entries. For this reason, you can use pagination options to request the next page. Pagination options params: {"logIndex": "3D", "blockNumber": "6423AC", "transactionIndex": 53} which include parameters from the last log received from the previous request. These three parameters are required for pagination.
curl -X POST --data '{"id":0,"jsonrpc":"2.0","method": "eth_getLogs", "params": []}'
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getLogs",
"params": [
{
"address": "0xc78Be425090Dbd437532594D12267C5934Cc6c6f",
"paging_options": {
"logIndex": "3D",
"blockNumber": "6423AC",
"transactionIndex": 53
},
"fromBlock": "earliest",
"toBlock": "latest",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
]
}
]
}
?module=account&action=eth_get_balance&address={addressHash}
eth_get_balance
Name
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: eth_get_balance
address *required
string (query)
The address of the account.
block
string (query)
Either the block number as a string, or one of latest, earliest or pending latest will be the latest balance in a *consensus* block. earliest will be the first recorded balance for the address. pending will be the latest balance in consensus *or* nonconcensus blocks.
Code
Description
200
successful operation
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x0234c8a3397aab58"
}
Get balance for address. Also available through a GraphQL 'addresses' query. If the balance hasn't been updated in a long time, we will double check with the node to fetch the absolute latest balance. This will not be reflected in the current request, but once it is updated, subsequent requests will show the updated balance. If you want to know whether or not we are checking for another balance, use the `balancemulti` action. That contains a property called `stale` that will let you know to recheck that balance in the near future.
?module=account&action=balance&address={addressHash}
balance
Name
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: balance
address *required
string (query)
A 160-bit code used for identifying Accounts.
Code
Description
200
successful operation
{
"message": "OK",
"result": "663046792267785498951364",
"status": "1"
}
200
error
{
"message": "Invalid address hash",
"result": null,
"status": "0"
}
Get balance for multiple addresses. Also available through a GraphQL 'addresses' query. If the balance hasn't been updated in a long time, we will double check with the node to fetch the absolute latest balance. This will not be reflected in the current request, but once it is updated, subsequent requests will show the updated balance. You can know that this is taking place via the `stale` attribute, which is set to `true` if a new balance is being fetched.
?module=account&action=balancemulti&address={addressHash1,addressHash2,addressHash3}
balancemulti
Name
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: balancemulti
address *required
string (query)
A 160-bit code used for identifying Accounts. Separate addresses by comma. Maximum of 20 addresses.
Code
Description
200
successful operation
{
"message": "OK",
"result": [
{
"account": "0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a",
"balance": "40807168566070000000000",
"stale": true
},
{
"account": "0x63a9975ba31b0b9626b34300f7f627147df1f526",
"balance": "332567136222827062478",
"stale": false
},
{
"account": "0x198ef1ec325a96cc354c7266a038be8b5c558f67",
"balance": "185178830000000000",
"stale": false
}
],
"status": "1"
}
200
error
{
"message": "Invalid address hash",
"result": null,
"status": "0"
}
?module=account&action=pendingtxlist&address={addressHash}
pendingtxlist
Name
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: pendingtxlist
address *required
string (query)
A 160-bit code used for identifying Accounts.
page
integer (query)
A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction.
offset
integer (query)
A nonnegative integer that represents the maximum number of records to return when paginating. 'page' must be provided in conjunction.
Code
Description
200
successful operation
{
"message": "OK",
"result": [
{
"contractAddress": "",
"cumulativeGasUsed": "122207",
"from": "0x3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4",
"gas": "122261",
"gasPrice": "50000000000",
"gasUsed": "122207",
"hash": "0x98beb27135aa0a25650557005ad962919d6a278c4b3dde7f4f6a3a1e65aa746c",
"input": "0xf00d4b5d000000000000000000000000036c8cecce8d8bbf0831d840d7f29c9e3ddefa63000000000000000000000000c5a96db085dda36ffbe390f455315d30d6d3dc52",
"nonce": "0",
"to": "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae",
"value": "0"
}
],
"status": "1"
}
200
error
{
"message": "No transactions found",
"result": [],
"status": "0"
}Mimics Ethereum JSON RPC's eth_getBalance. Returns the balance as of the provided block (defaults to latest)
?module=account&action=eth_get_balance&address={addressHash}
eth_get_balance
ParametersTry it out
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: eth_get_balance
address *required
string (query)
The address of the account.
block
string (query)
Either the block number as a string, or one of latest, earliest or pending latest will be the latest balance in a *consensus* block. earliest will be the first recorded balance for the address. pending will be the latest balance in consensus *or* nonconcensus blocks.
Responses
Code
Description
200
successful operation
Example Value
Model
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x0234c8a3397aab58"
}
Get balance for address. Also available through a GraphQL 'addresses' query. If the balance hasn't been updated in a long time, we will double check with the node to fetch the absolute latest balance. This will not be reflected in the current request, but once it is updated, subsequent requests will show the updated balance. If you want to know whether or not we are checking for another balance, use the `balancemulti` action. That contains a property called `stale` that will let you know to recheck that balance in the near future.
?module=account&action=balance&address={addressHash}
balance
ParametersTry it out
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: balance
address *required
string (query)
A 160-bit code used for identifying Accounts.
Responses
Code
Description
200
successful operation
Example Value
Model
{
"message": "OK",
"result": "663046792267785498951364",
"status": "1"
}
200
error
Example Value
{
"message": "Invalid address hash",
"result": null,
"status": "0"
}
Get balance for multiple addresses. Also available through a GraphQL 'addresses' query. If the balance hasn't been updated in a long time, we will double check with the node to fetch the absolute latest balance. This will not be reflected in the current request, but once it is updated, subsequent requests will show the updated balance. You can know that this is taking place via the `stale` attribute, which is set to `true` if a new balance is being fetched.
?module=account&action=balancemulti&address={addressHash1,addressHash2,addressHash3}
balancemulti
ParametersTry it out
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: balancemulti
address *required
string (query)
A 160-bit code used for identifying Accounts. Separate addresses by comma. Maximum of 20 addresses.
Responses
Code
Description
200
successful operation
Example Value
Model
{
"message": "OK",
"result": [
{
"account": "0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a",
"balance": "40807168566070000000000",
"stale": true
},
{
"account": "0x63a9975ba31b0b9626b34300f7f627147df1f526",
"balance": "332567136222827062478",
"stale": false
},
{
"account": "0x198ef1ec325a96cc354c7266a038be8b5c558f67",
"balance": "185178830000000000",
"stale": false
}
],
"status": "1"
}
200
error
Example Value
{
"message": "Invalid address hash",
"result": null,
"status": "0"
}
Get pending transactions by address.
?module=account&action=pendingtxlist&address={addressHash}
pendingtxlist
ParametersTry it out
Name
Description
Module *required
string (query)
A string with the name of the module to be invoked.
Must be set to: account
Action *required
string (query)
A string with the name of the action to be invoked.
Must be set to: pendingtxlist
address *required
string (query)
A 160-bit code used for identifying Accounts.
page
integer (query)
A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction.
offset
integer (query)
A nonnegative integer that represents the maximum number of records to return when paginating. 'page' must be provided in conjunction.
Responses
Code
Description
200
successful operation
Example Value
Model
{
"message": "OK",
"result": [
{
"contractAddress": "",
"cumulativeGasUsed": "122207",
"from": "0x3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4",
"gas": "122261",
"gasPrice": "50000000000",
"gasUsed": "122207",
"hash": "0x98beb27135aa0a25650557005ad962919d6a278c4b3dde7f4f6a3a1e65aa746c",
"input": "0xf00d4b5d000000000000000000000000036c8cecce8d8bbf0831d840d7f29c9e3ddefa63000000000000000000000000c5a96db085dda36ffbe390f455315d30d6d3dc52",
"nonce": "0",
"to": "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae",
"value": "0"
}
],
"status": "1"
}
200
error
Example Value
{
"message": "No transactions found",
"result": [],
"status": "0"
}
Last modified 1yr ago