weichweich / kilt-rewards-importers-exporters

A small set of utility scripts to fetch all the staking rewards for a given KILT account using the Subscan HTTP APIs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KILT staking rewards importer & exporter

This repo contains a bunch of utility scripts to retrieve and optionally export KILT staking rewards information.

Imports

For now, the only supported import methods use either the Subscan.io HTTP APIs for KILT Spiritnet or the RPC endpoint exposed by KILT Spiritnet nodes.

For more details about that, see the imports module.

Exports

For now, the only supported export method generates a CSV file that follows the model expected by Koinly.io to import transactions for wallets/coins not yet supported.

For more details about that, see the exports module.

Install and run

The repo contains an example main() function which fetches some historical data from Subscan and exports it to a CSV file. The main can be changed according to each one's needs.

Depending on the import/export features, some environment variables must be specified. Again, to check what those variable are, please refere to the imports and exports modules.

Once the needed variables have been set, install the dependencies with

yarn

and run the main() with

yarn start

Example Environment

REWARDED_ACCOUNT=4p...r
RPC_ENDPOINT=wss://spiritnet.kilt.io
FROM_BLOCK=0
OUT_PATH=october2021.csv

About

A small set of utility scripts to fetch all the staking rewards for a given KILT account using the Subscan HTTP APIs.

License:MIT License


Languages

Language:TypeScript 99.3%Language:JavaScript 0.7%