A command-line tool and SDK that creates snapshots of any ERC20, ERC721, and ERC1155 tokens, synchronizes the data to SQLite, and allows exporting to JSON or CSV formats.
- Works without a local Ethereum node.
- Automatically resumes the next time upon failure.
- Tested to work with Alchemy.
npm install assets-snapshot -g
None. Prompts for user input and produces a configuration file on the first run.
Navigate to a directory where you'd like to save the token snapshot to.
cd path/to/a/directory
Run the program:
assets-snapshot
To avoid getting prompted for each configuration parameters, each time assets-snapshot
is ran, have a ./config.json
file at the same location as assets-snapshot
is executed.
Unique name, recommended as the name of the asset.
It is best to use the Alchemy cloud services.
Address of your ERC20, ERC721, and ERC1155 contract.
The block height to scan from. To save time, enter the block number of the transaction your token was created on.
The block height to end the scan at.
Can be any of the following: "ERC20", "ERC721", "ERC1155".
The number of blocks to query per batch.
If you are using remote service like Alchemy, keep this number relative low (2000-5000) to avoid rate limits. If you are using a dedicated Ethereum node, you can increase this number to suit your needs.
The delay (in ms) between each request in the loop. Tweak this if you are experiencing rate limit from your provider.
npm run start -- -c ./snapshot.json