npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

scan-wallet-evm

v1.0.6

Published

Wallet scanner for native token and ERC20 transfers on EVM networks.

Readme

Scan Wallet EVM

Wallet scanner for native token and ERC20 transfers on EVM networks.

npm version license typescript ethers

Scan Wallet EVM is a small EVM wallet activity scanner.

It is built for two common jobs:

  • Scan native coin transfers for a wallet on EVM chains such as ETH, BNB, MATIC, AVAX, and similar networks
  • Scan ERC20 Transfer(address,address,uint256) events for a wallet, with an optional token contract filter

The package is useful when you want to inspect wallet inflow and outflow without writing your own log filters, block walkers, proxy handling, or ethers provider setup.

What This Package Scans

Native token scan

Use scanNativeTransfers() to find successful top-level transactions where the wallet sends or receives the chain's native token.

  • Supports in, out, or both
  • Supports custom block ranges
  • Returns raw amount as bigint
  • Works with custom RPC, proxy, or injected provider

Important: native scanning covers top-level native transfers only. It does not decode internal transactions from traces.

ERC20 scan

Use scanErc20Transfers() to scan ERC20 Transfer logs involving a wallet.

  • Supports in, out, or both
  • Can scan all ERC20 contracts or a single tokenAddress
  • Supports custom block ranges
  • Returns raw amount as bigint
  • Works with custom RPC, proxy, or injected provider

Feature Summary

| Capability | ERC20 | Native | | --- | --- | --- | | Incoming / outgoing / both | Yes | Yes | | Custom block range | Yes | Yes | | Custom RPC URL | Yes | Yes | | Proxy support | Yes | Yes | | Injected provider | Yes | Yes | | Single token contract filter | Yes | No | | Raw amount as bigint | Yes | Yes |

Installation

yarn add scan-wallet-evm

Requirements

  • Node.js with ESM support
  • An EVM-compatible JSON-RPC endpoint

Quick Start

1. Scan native token transfers

import { scanNativeTransfers } from "scan-wallet-evm";

const nativeTransfers = await scanNativeTransfers({
  rpcUrl: "https://your-evm-rpc.example.com",
  wallet: "0xYourWalletAddress",
  direction: "both",
  fromBlock: 74229500,
  toBlock: 74229520,
});

console.log(nativeTransfers[0]);

Example record:

{
  from: "0x...",
  to: "0x...",
  amount: 24259569238705576n,
  tx: "0x...",
  block: 74229500,
  blockTimestamp: 1767674408,
  transactionIndex: 99,
  direction: "in"
}

2. Scan ERC20 transfers

import { scanErc20Transfers } from "scan-wallet-evm";

const erc20Transfers = await scanErc20Transfers({
  rpcUrl: "https://your-evm-rpc.example.com",
  wallet: "0xYourWalletAddress",
  tokenAddress: "0xYourTokenContractAddress",
  direction: "both",
  fromBlock: 100,
  toBlock: 200,
});

console.log(erc20Transfers[0]);

Example record:

{
  token: "0x...",
  from: "0x...",
  to: "0x...",
  amount: 29688142670000000000n,
  tx: "0x...",
  block: 85570465,
  blockTimestamp: 1773052865,
  logIndex: 216,
  transactionIndex: 71,
  data: "0x..."
}

Default Block Range Behavior

For both scan functions:

  • If fromBlock and toBlock are both omitted, the package scans from latestBlock - 100 to latestBlock
  • If only fromBlock is omitted, it uses toBlock as a single-block scan
  • If only toBlock is omitted, it scans from fromBlock to the latest block

Proxy Support

Pass a proxy as a full URL:

const transfers = await scanNativeTransfers({
  rpcUrl: "https://your-evm-rpc.example.com",
  wallet: "0xYourWalletAddress",
  proxy: "http://user:[email protected]:8080",
});

Or pass a structured config:

const transfers = await scanErc20Transfers({
  rpcUrl: "https://your-evm-rpc.example.com",
  wallet: "0xYourWalletAddress",
  direction: "out",
  proxy: {
    url: "http://proxy.example.com:8080",
    username: "my-user",
    password: "my-pass",
  },
});

proxy and proxyUrl are interchangeable aliases.

Reuse a Provider

Use one shared provider across multiple scans:

import {
  createRpcProvider,
  scanErc20Transfers,
  scanNativeTransfers,
} from "scan-wallet-evm";

const provider = createRpcProvider({
  rpcUrl: "https://your-evm-rpc.example.com",
  timeoutMs: 10_000,
});

const nativeTransfers = await scanNativeTransfers({
  provider,
  wallet: "0xYourWalletAddress",
  direction: "both",
  fromBlock: 74229500,
  toBlock: 74229520,
});

const erc20Transfers = await scanErc20Transfers({
  provider,
  wallet: "0xYourWalletAddress",
  tokenAddress: "0xYourTokenContractAddress",
  direction: "both",
  fromBlock: 100,
  toBlock: 200,
});

console.log(nativeTransfers.length, erc20Transfers.length);

TypeScript

import {
  scanErc20Transfers,
  scanNativeTransfers,
  type Erc20Transfer,
  type NativeTransfer,
} from "scan-wallet-evm";

const nativeTransfers: NativeTransfer[] = await scanNativeTransfers({
  rpcUrl: "https://your-evm-rpc.example.com",
  wallet: "0xYourWalletAddress",
  direction: "both",
});

const erc20Transfers: Erc20Transfer[] = await scanErc20Transfers({
  rpcUrl: "https://your-evm-rpc.example.com",
  wallet: "0xYourWalletAddress",
  direction: "in",
});

API Overview

scanNativeTransfers(options)

Scans successful top-level native token transfers for a wallet.

| Option | Type | Notes | | --- | --- | --- | | wallet | string | Required wallet address | | rpcUrl | string | Optional when provider is supplied | | direction | "in" \| "out" \| "both" | Defaults to "both" | | fromBlock | number \| bigint | Optional start block | | toBlock | number \| bigint | Optional end block | | proxy | string \| ProxyConfig \| null | Optional proxy config | | proxyUrl | string \| ProxyConfig \| null | Alias of proxy | | timeoutMs | number | Optional HTTP timeout | | provider | NativeScanProvider | Optional custom provider |

Returns Promise<NativeTransfer[]>.

scanErc20Transfers(options)

Scans ERC20 Transfer logs where the wallet is sender, receiver, or both.

| Option | Type | Notes | | --- | --- | --- | | wallet | string | Required wallet address | | rpcUrl | string | Optional when provider is supplied | | tokenAddress | string \| null | Optional ERC20 contract filter | | direction | "in" \| "out" \| "both" | Defaults to "both" | | fromBlock | number \| bigint | Optional start block | | toBlock | number \| bigint | Optional end block | | proxy | string \| ProxyConfig \| null | Optional proxy config | | proxyUrl | string \| ProxyConfig \| null | Alias of proxy | | timeoutMs | number | Optional HTTP timeout | | provider | ScanProvider | Optional custom provider |

Returns Promise<Erc20Transfer[]>.

createRpcProvider(options)

Creates an ethers JsonRpcProvider with optional timeout and proxy support.

createRpcProvider({
  rpcUrl: string,
  proxy?: string | ProxyConfig | null,
  proxyUrl?: string | ProxyConfig | null,
  timeoutMs?: number,
})

ProxyConfig

type ProxyConfig = {
  url: string;
  username?: string;
  password?: string;
};

Development

yarn test
yarn typecheck

License

MIT