Skip to content

Instantly share code, notes, and snippets.

@evan-gray
evan-gray / balances.ts
Last active April 29, 2026 13:35
get EVM balances bun script
#!/usr/bin/env bun
const ADDRESS = process.argv[2];
if (!ADDRESS || !/^0x[0-9a-fA-F]{40}$/.test(ADDRESS)) {
console.error("Usage: bun balances.ts 0x<address>");
process.exit(1);
}
type Chain = { name: string; rpc: string; symbol: string; cgId?: string; decimals?: number };
const CHAINS: Chain[] = [
// https://github.com/XLabs/portal-bridge-ui/issues/1185
// The following transactions allegedly don't have valid VAAs and have yet to be redeemed.
// Source: Ethereum
// import {
// CONTRACTS,
// getIsTransferCompletedSolana,
// } from "@certusone/wormhole-sdk";
// import { Connection } from "@solana/web3.js";
import {
@evan-gray
evan-gray / historyCheck.ts
Created December 1, 2023 19:09
geth history check
// Dependencies
// $ npm i axios ora
// Ethereum mainnet localhost example - WETH totalSupply()
// $ RPC="http://localhost:8545" BLOCKS=1024 TO="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" DATA="0x18160ddd" npx tsx historyCheck.ts
// Optimism mainnet public node example - WETH totalSupply()
// $ RPC="https://optimism.publicnode.com" BLOCKS=1024 TO="0x4200000000000000000000000000000000000006" DATA="0x18160ddd" npx tsx historyCheck.ts
// Base mainnet public node example - WETH totalSupply()
// $ RPC="https://base.publicnode.com" BLOCKS=1024 TO="0x4200000000000000000000000000000000000006" DATA="0x18160ddd" npx tsx historyCheck.ts
import axios from "axios";