import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
chainId: "43114",
});
async function run() {
const result = await avalanche.data.evm.transactions.listLatest({
pageSize: 10,
});
for await (const page of result) {
console.log(page);
}
}
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 latest transactions. Filterable by status.
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
chainId: "43114",
});
async function run() {
const result = await avalanche.data.evm.transactions.listLatest({
pageSize: 10,
});
for await (const page of result) {
console.log(page);
}
}
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 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 1. The maximum pageSize is 100.
1 <= x <= 100A status filter for listed transactions.
failed, success Was this page helpful?