Skip to main content

Examples

Get all transactions

const transactions = [];
const accountId = '603522490d2b02001233a5d6';

// Provide the date the wallet or exchange account was created. If unsure,
// pass in a very old date.
const from = '2005-01-01';

// Start off with an empty ?last, to query the very first page of transactions
let last = '';

// Fetch `100` transactions per page
const limit = 100;

while (true) {
const page = await user.transactions.getList({ accountId, from, last, limit });

if (!page.length) break;

transactions.push(...page);
// Use this page's last transaction id to query the next page and so on
last = page[page.length - 1].id;
}