Skip to content

nicov-iov/wallet-snapshots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wallet Snapshots

Generate complete wallet snapshots on the Rootstock blockchain, including ERC20 token balances and liquidity NFT metadata.

🚀 Features

  • ERC20 Balances: Retrieves balances and metadata of standard tokens
  • Liquidity NFTs: Extracts detailed information from liquidity pools (WoodSwap)
  • Block-based Snapshots: Query data at a specific block or the latest
  • JSON Export: Option to save snapshots to files

📋 Prerequisites

  • Node.js: v22.13.0 or higher
  • npm: For installing dependencies

🛠️ Installation

# Clone the repository
git clone <repository-url>
cd wallet-snapshots

# Install dependencies
npm install

⚙️ Configuration

Environment Variables (Required)

The project requires a .env file with all necessary configuration. Copy .env.example to .env and customize:

# 1) Copy the example file
cp .env.example .env

# 2) Edit the .env file with your values

Required variables:

  • TARGET_ADDRESS: Wallet address to generate snapshot for (must be a valid address)
  • BLOCK_NUMBER: Block number to query (or 'latest')
  • NETWORK: Network to use (mainnet or testnet)
  • MAINNET_RPC_URL: RPC provider for mainnet
  • TESTNET_RPC_URL: RPC provider for testnet

Optional variables:

  • SAVE_BY_DEFAULT: Whether to save snapshots by default (true/false)
  • OUTPUT_DIR: Directory for snapshot files

🚀 Usage

Basic

# Generate snapshot (console only)
node src/index.js

With options

# Save snapshot to file
node src/index.js --save

# Show help
node src/index.js --help

📁 Project Structure

wallet-snapshots/
├── src/
│   ├── index.js          # Main entry point
│   └── lib/
│       ├── config.js     # Centralized configuration
│       ├── utils.js      # Utility functions
│       └── abis/         # Contract ABIs
├── snapshots/            # Snapshot files (created automatically)
└── package.json

🔧 Main Dependencies

  • @rsksmart/nod3: RPC client for RSK
  • @rsksmart/rsk-contract-parser: RSK contract parser
  • ethers: Library for Ethereum/RSK interaction

📊 Output Format

The snapshot includes:

  • Basic wallet information
  • ERC20 token balances
  • Liquidity NFT metadata
  • Pool information (tokens, fees, positions)

🌐 Supported Networks

  • Mainnet: Rootstock Mainnet
  • Testnet: Rootstock Testnet

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published