eth_getBlockTransactionCountByHash RPC 方法
To use the eth_getBlockTransactionCountByHash method on the Avalanche C-Chain, ensure that the end of your URL includes ext/bc/C/rpc.
参数
哈希
字符串
必填
正在加载...
退货
结果
字符串
正在加载...
请求
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 { 核心 } from '@quicknode/sdk'23const 核心 = new Core({4endpointUrl: "https://docs-demo.avalanche-mainnet.quiknode.pro",5})67核心.客户端8.getBlockTransactionCount({9blockHash: '0x89644bbd5c8d682a2e9611170e6c1f02573d866d286f006cbf517eec7254ec2d'10})11.then(res => console.log(res))1213
1import { 核心 } from '@quicknode/sdk'23const 核心 = new Core({4endpointUrl: "https://docs-demo.avalanche-mainnet.quiknode.pro",5})67核心.客户端8.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
1来源 web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.avalanche-mainnet.quiknode.pro'))3print (w3.eth.get_block_transaction_count('0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b'))
1来源 web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.avalanche-mainnet.quiknode.pro'))3print (w3.eth.get_block_transaction_count('0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b'))