eth_getBlockTransactionCountByHash RPC Method
To use the eth_getBlockTransactionCountByHash method on the Avalanche C-Chain, ensure that the end of your URL includes ext/bc/C/rpc.
Parameters
hash
string
REQUIRED
Loading...
Returns
result
string
Loading...
Request
1curl https://docs-demo.avalanche-mainnet.quiknode.pro \2-X POST \3-H "Content-Type: application/json" \4--data '{5"method": "eth_getBlockTransactionCountByHash",6"params": [7"0x3e56c97d34f03b1369c351fa6c9f57c8bfa987c7da40964fab981303e0ef5849"8],9"id": 1,10"jsonrpc": "2.0"11}'
1curl https://docs-demo.avalanche-mainnet.quiknode.pro \2-X POST \3-H "Content-Type: application/json" \4--data '{5"method": "eth_getBlockTransactionCountByHash",6"params": [7"0x3e56c97d34f03b1369c351fa6c9f57c8bfa987c7da40964fab981303e0ef5849"8],9"id": 1,10"jsonrpc": "2.0"11}'
1import { Core } from '@quicknode/sdk'23const core = new Core({4endpointUrl: "https://docs-demo.avalanche-mainnet.quiknode.pro",5})67core.client8.getBlockTransactionCount({9blockHash: '0x89644bbd5c8d682a2e9611170e6c1f02573d866d286f006cbf517eec7254ec2d'10})11.then(res => console.log(res))1213
1import { Core } from '@quicknode/sdk'23const core = new Core({4endpointUrl: "https://docs-demo.avalanche-mainnet.quiknode.pro",5})67core.client8.getBlockTransactionCount({9blockHash: '0x89644bbd5c8d682a2e9611170e6c1f02573d866d286f006cbf517eec7254ec2d'10})11.then(res => console.log(res))1213
1import { ethers } from "ethers";2(async () => {3const provider = new ethers.JsonRpcProvider(4"https://docs-demo.avalanche-mainnet.quiknode.pro"5);6const txCount = await provider.send("eth_getBlockTransactionCountByHash", [7"0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b",8]);9console.log(txCount);10})();11
1import { ethers } from "ethers";2(async () => {3const provider = new ethers.JsonRpcProvider(4"https://docs-demo.avalanche-mainnet.quiknode.pro"5);6const txCount = await provider.send("eth_getBlockTransactionCountByHash", [7"0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b",8]);9console.log(txCount);10})();11
1from web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.avalanche-mainnet.quiknode.pro'))3print (w3.eth.get_block_transaction_count('0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b'))
1from web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.avalanche-mainnet.quiknode.pro'))3print (w3.eth.get_block_transaction_count('0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b'))
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free