How to get account transactions?
getTransactionsByAccount
This function is used to retrieve an array of transaction receipts for a specified account.
import { L1XProvider, GetTransactionsByAccountArg } from "@l1x/l1x-wallet-sdk";
let l1xProvider = new L1XProvider({
clusterType: "mainnet",
endpoint: "https://v2-mainnet-rpc.l1x.foundation",
});
const query: GetTransactionsByAccountArg = {
address: "6e371a05d5766c692172744f4907940ef324fcb9",
number_of_transactions: 10,
starting_from: 0,
};
l1xProvider.core
.getTransactionsByAccount(query)
.then((response) => console.log(response)) // log response
.catch((err) => console.error(err)); // log error
Parameters:
The account address and query parameters.
Returns:
A promise that resolves with an array of transaction receipts.
Last updated