dApp Interaction CLI
About
dApp Interaction CLI allows you to connect to dApps from the terminal and sign incoming transactions, messages and typed data.
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, Ethereum-Classic
- Offline Signing: Sign transactions, messages and typed data without any Internet connection
- Terminal dApp Interaction: Interact with dApps directly from your terminal
How to run
Option 1: Run via npm (recommended)
This is the recommended way for most users.
Requirements
- Node.js (v22)
Run
# Listen to incomming transactions, messages and typed data
npx @extra-wallet/dapp-interaction listen
# Sign the data to send
npx @extra-wallet/dapp-interaction sign
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/dapp-interaction-cli
pnpm build
5. Run locally
# Listen to incomming transactions, messages and typed data
npx @extra-wallet/dapp-interaction listen
# Sign the data to send
npx @extra-wallet/dapp-interaction sign
How to use
The CLI has two commands: sign and listen
To get more information about the commands, use help command:
npx wallet-tracker help
Sign
sign can be run in two ways: interactive and non-interactive
In interactive mode you will be prompted to provide private key for signing, path to the file that was generated when listening to incomming data from dApp, and optional output file to put the signed data to. If output file is not specified, the signed data will be printed to stdout.
In non-interactive mode you will have to specify the required arguments with flags.
Arguments
| Flag | Required | Description | Aliases |
|---|---|---|---|
| private-key | true | Private key to use to sign the data. | key, pk |
| filepath | true | Path to the file generated when listening to incomming data from dApp. | file |
| output | false | Output file to put the signed data to. If not specified, the signed data will be printed to stdout. | o |
Example
npx @extra-wallet/dapp-interaction sign --private-key="0x..." --filepath="transaction-qr.png" --output="output.txt"
Listen
listen can be run only in the interactive mode.
After starting the CLI you will be prompted to provide the list of addresses and networks you want to use and also
wallet connect URI. After that the program will start listening to the incomming events. Once it receives transaction/message/typed data,
it creates two new files with the data to sign - one in JSON format, the other as a QR code. After that you have to use
sign command and specify either of those files in filepath. Then paste the result string to the program instance
listening to the dApp events. After that the dApp request will be approved. If you want to reject the request, instead
of pasting the signed data, write reject.