Transaction Simulation CLI
About
Transaction Simulation CLI allows you to easily simulate EVM transactions to see their result. CLI version of transaction simulation extension on EXTRA WALLET
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: Under the hood we are using Tenderly, so any network that is supported there can be used here.
- Pro Mode: You can use EXTRA WALLET API key if you do not want to create your own account on Tenderly and worry about their credentials
How to run
Option 1: Run via npm (recommended)
This is the recommended way for most users.
Requirements
- Node.js (v22)
Run
npx @extra-wallet/transaction-simulation
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-simulation-cli
pnpm build
5. Run locally
npx transaction-simulation
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-simulation --extrawallet-key="..." --input="{...}"
To get information about every argument, you can use help command:
npx transaction-simulation help
Arguments
| Flag | Required | Description | Aliases |
|---|---|---|---|
| input | true | JSON string of the input expected by Tenderly | i, d, data |
| extrawallet-key | false | Your EXTRA WALLET API key. Required when you want to use EXTRA WALLET API | e |
| account | false | Your Tenderly account. Required when you do not want to use EXTRA WALLET API | |
| project-key | false | Your Tenderly project. Required when you do not want to use EXTRA WALLET API | |
| access-key-key | false | Access key to your Tenderly project. Required when you do not want to use EXTRA WALLET API | |
| verbose | false | Whether the full result of simulation should be shown or the short one like in interactive mode(only status and url to the simulation result) | v |
| formatted | false | Whether output should be formatted or raw json | f |
Input Format
Input JSON string has to have the following fields:
| Field | Type | Required | Explanation |
|---|---|---|---|
| network_id | string | true | Numberic id as a string of one of the networks supported by Tenderly(1, 137 etc.) |
| from | string | true | Address of the sender of the transaction |
| to | string | true | Address of the receiver of the transaction |
| input | string | false | Calldata of the transaction. If no calldata specified, defaults to 0x |
| gas | number | false | Transaction gas |
| gas_price | number | false | Gas price |
| value | number | false | Value of the transaction |
| simulation_type | string | false | Simulation type. By default eqauls to full. Can also be quick and abi. More about them here |
Output
The result will be printed to stdout as a JSON object with two fields:
status: boolean value wheretruemeans the transaction was successull andfalsethat it failedsimulationUrl: URL to full information about simulation on tenderly
In case you are using non-interactive mode and set verbose to true, there will also be a field fullSimulationData with all the information about simulation that tenderly provides.
More about the format of that data can be read here
Depending on if formatted was set to true, the result will be printed as a raw or formatted JSON.
In interactive mode the result is always formatted.