.transactions

📘

Check out these recipes to learn more about transactions and the SDK

Get transactions - takes filters for start and end date and type/asset

const filters= {
  startDate: '2024-01-01',
  endDate: '2024-02-01',
  type: 'stake',
  asset: 'ETH',
  page: 1,
  limit: 100
};

const { body: transactionsResponse } = await api.transactions.getTransactions(filters);

console.log(` 
	Total Transactions: ${transactionsResponse.total}
  Number of Pages: ${transactionsResponse.pages}
  Current Page: ${transactionsResponse.currentPage}
  Transactions: ${JSON.stringify(transactionsResponse.transactions)}
`)

for (const transaction of transactionsResponse.transactions) {
  console.log(`
    Transaction ID: ${transaction.eventId}
    Transaction Type: ${transaction.eventType}
    Transaction Asset: ${transaction.asset}
    Transaction Amount: ${transaction.assetAmount}
    Transaction Date: ${transaction.eventTime}
  `);
  }