@dfk-tools/transaction-history-report-generator
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Transaction History Report Generator

JavaScript library used to collect and generate reports on historical transactions across multiple EVM chains for Defi Kingdoms.

About the Project

This library serves as a package that can be used to collect transaction histories of users and contracts, and generate a report in various formats. The bounty for this project provides more detailed information about its uses.

Getting started

Install the package into your project

npm install --save @dfk-tools/transaction-history-report-generator

Usage

Generating reports

import { Generator } from '@dfk-tools/transaction-history-report-generator';

// Create a new instance of the report generator with default settings
const generator = new Generator();

// Generate a report for a player for all time, including all DFK interactions
const playerReport = await generator.report('[PLAYER ADDRESS]');

// Generate a report for a player, including transactions starting after a certain date
const startDate = new Date('2021-12-13');
const contractSince2021Dec13Report = await generator.report('[PLAYER ADDRESS]', {
    start: startDate
});

// Generate a report for a player for all time, including only hero purchase transactions
const playerHeroPurchasesReport = await generator.report('[PLAYER ADDRESS]', {
    contract: contracts.Hero
});

Exporting

import { resolve } from 'path';

// ...

// Save a report to a path with default options
const savePath = resolve(__dirname, './reports');
await report.exportAsCsv(savePath);

Accessing report data

// ...

const transactions = report.transactions;
console.log(transactions);

Package Sidebar

Install

npm i @dfk-tools/transaction-history-report-generator

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

34.3 kB

Total Files

58

Last publish

Collaborators

  • matthewdowns