Skip to main content

Transaction History CLI

About

Transaction History CLI allows you to easily get transaction history of any address on any supported network!


License

Licensed under the PolyForm Noncommercial License 1.0.0. Commercial use requires a separate written commercial license agreement from the licensor — contact alex@vir-tec.net.


Key features

  • Supported Networks: Ethereum, Optimism, Bsc, Polygon, Sonic, Base, Arbitrum, Avalanche, Tron, Ethereum-Classic, Ton, Bitcoin, Litecoin, Solana, Sui, Aptos, Dogecoin, Ripple, Cardano, Bch, Polkadot
  • Pro Mode: You can use EXTRA WALLET API key if you do not want to search for all the other APIs. We will handle everything for you

How to run

This is the recommended way for most users.

Requirements

  • Node.js (v22)

Run

npx @extra-wallet/transaction-history

This will:

  • download the CLI on demand,
  • start the interactive terminal UI

Option 2: Run locally from the repository (development)

Use this if you want to:

  • inspect the code,
  • modify the CLI,
  • contribute or debug.

Requirements

  • Node.js (v22)
  • pnpm

1. Install dependencies

From the repository root:

pnpm install

2. Build shared code

cd shared/sdk
pnpm build

3. Return to the root of the repository

cd ../..

4. Build the CLI

cd packages/transaction-history-cli
pnpm build

5. Run locally

npx transaction-history

How to use

The CLI can be run in two modes: interactive and non-interactive

To run the program in interactive mode you just have to follow the instructions of the previous step. In this mode you will be asked for needed inputs step by step.

To run the program in non-interactive mode you have to also specify arguments using flags like this:

npx transaction-history --network="arbitrum" --extrawallet-key="..." --address="0x..."

To get information about every argument, you can use help command:

npx transaction-history help

Arguments

FlagRequiredDescriptionAliases
addresstrueAddress transaction history of which you want to get
networktrueOne of the supported networks you want to get history from
extrawallet-keyfalseYour EXTRA WALLET API keye
api-keyfalseAPI key for the service that will be used to fetch data in case you did not specify extrawallet-key. The service depends on the network you want to check.
outputfalseThe file to which the result will be written. If no file is specified, the result will be printed to stdout.o
formattedfalseWhether output should be formatted or rawf
About API key for Bitcoin Cash and Sui

API key is not needed at all on Bitcoin Cash(BCH).

For Sui it is optional even if you do not specify extrawallet-key

Network and service it uses

NetworkService used in free mode
ethereumAnkr
optimismAnkr
bscAnkr
polygonAnkr
sonicEtherscan
baseAnkr
arbitrumAnkr
avalancheAnkr
tronTronscan
ethereum-classicBlockscout Ethereum Classic
tonTonapi
bitcoinTatum
litecoinTatum
solanaAnkr
suiAnkr
aptosAnkr
dogecoinTatum
rippleTatum
cardanoCardanoscan
bchFullstack Bitcoin Cash
polkadotSubscan

Output

if output is specified, the result will be written to file. If not, the result will be printed to stdout.

In both cases, formatting or its absence depends on formatted flag.

Result format

The result will be a JSON array of transaction entries. Every entry will have the following fields:

FieldTypeExplanation
fromSenderOrReceiver[]Array of structs which tell which addresses sent the cryptocurrencies, which cryptocurrencies and how many of them
toSenderOrReceiver[] / nullArray of structs which tell which addresses received the cryptocurrencies, which cryptocurrencies and how many of them. Can be null in case transaction does not have any receivers(e.g. contract Deploy on EVM)
feestring / nullFee for the transaction in base units of the chain(satoshi for Bitcoin, Wei for Ethereum etc.
typeTxType / stringType of the transaction. Either one that can easily be classified or something provided by the network itself
hashstringHash of the transaction
explorerstringUrl that leads to transaction on network's explorer
timestampnumberUNIX time of the transaction
statusTxStatusStatus of the transaction

SenderOrReceiver has three fields:

  • address: string, address of the person that sends or receives the cryptocurrency
  • amount: number, raw not formatted amount of cryptocurrency that is sent or received
  • currency: optional string or object, if absent, the native currency was sent or received. If it is a string, it's either Unknown or currency address.

But if you use EXTRA WALLET API key, currency can be absent if currency is native, string if only the address of the currency is known or a struct with the following fields:

FieldTypeExplanation
decimalsnumberDecimals of the cryptocurrency
coinIdstringCoin id that corresponds to this cryptocurrency on CoinGecko
addressstringAddress of the currency
pricenumberPrice of the cryptocurrency in dollars
symbolstringSymbol of the cryptocurrency
imgstringUrl of the logo of the cryptocurrency

TxType can be one of the following values:

  • Contract Call
  • Contract Deploy
  • Block Reward
  • Send
  • Receive
  • Cancel

TxStatus can be one of the following values: Failed, Success, Pending, Unknown.