import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
chainId: "43114",
});
async function run() {
const result = await avalanche.data.evm.blocks.listTransactions({
pageSize: 10,
blockId: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c",
});
console.log(result);
}
run();{
"transactions": [
{
"blockNumber": "<string>",
"blockTimestamp": 123,
"blockHash": "<string>",
"chainId": "<string>",
"blockIndex": 123,
"txHash": "<string>",
"txStatus": "<string>",
"txType": 123,
"gasLimit": "<string>",
"gasUsed": "<string>",
"gasPrice": "<string>",
"nonce": "<string>",
"from": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"to": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"value": "<string>",
"method": {
"callType": "NATIVE_TRANSFER",
"methodHash": "<string>",
"methodName": "<string>"
}
}
],
"nextPageToken": "<string>"
}Lists the transactions that occured in a given block.
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
chainId: "43114",
});
async function run() {
const result = await avalanche.data.evm.blocks.listTransactions({
pageSize: 10,
blockId: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c",
});
console.log(result);
}
run();{
"transactions": [
{
"blockNumber": "<string>",
"blockTimestamp": 123,
"blockHash": "<string>",
"chainId": "<string>",
"blockIndex": 123,
"txHash": "<string>",
"txStatus": "<string>",
"txType": 123,
"gasLimit": "<string>",
"gasUsed": "<string>",
"gasPrice": "<string>",
"nonce": "<string>",
"from": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"to": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"value": "<string>",
"method": {
"callType": "NATIVE_TRANSFER",
"methodHash": "<string>",
"methodName": "<string>"
}
}
],
"nextPageToken": "<string>"
}Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://avacloud.io/.
A supported evm chain id or blockchain id. Use the /chains endpoint to get a list of supported chain ids.
A block identifier which is either a block number or the block hash.
A page token, received from a previous list call. Provide this to retrieve the subsequent page.
The maximum number of items to return. The minimum page size is 0. The maximum pageSize is 100.
0 <= x <= 100Was this page helpful?