Skip to content

Commands

Command tree overview: internal/interface-adapters/cli/README.md

This document describes all available CLI commands for the three wallet types: Watch Wallet, Keygen Wallet, and Sign Wallet.


Watch Wallet Commands

Watch Wallet operates online and manages public keys only. It creates unsigned transactions, sends signed transactions, and monitors transaction status.

Import Commands

watch import address

Imports addresses generated by Keygen Wallet.

Options:

  • --file <path> - Path to the CSV file containing addresses to import
  • --rescan - Run blockchain rescan when importing addresses (default: false)

Example:

bash
watch import address --file data/address/btc/address.csv --rescan

Create Commands

watch create deposit

Creates an unsigned deposit transaction file for client accounts. This transaction aggregates coins sent to client addresses into cold wallet addresses managed offline.

Options:

  • --fee <float> - Adjustment fee (default: 0)

Example:

bash
watch create deposit --fee 0.0001

watch create payment

Creates an unsigned payment transaction file for payment accounts. This transaction sends coins to user-specified addresses based on withdrawal requests.

Options:

  • --fee <float> - Adjustment fee (default: 0)

Example:

bash
watch create payment --fee 0.0001

watch create transfer

Creates an unsigned transaction for transferring coins between internal accounts.

Options:

  • --account1 <string> - Sender account name
  • --account2 <string> - Receiver account name
  • --amount <float> - Amount to send. If 0, all coins are sent
  • --fee <float> - Adjustment fee (default: 0)

Example:

bash
watch create transfer --account1 deposit --account2 payment --amount 0.001 --fee 0.0001

watch create db

Creates payment_request table with dummy data for development use.

Note: This command is deprecated. Use SQL queries with shell scripts instead.

Send Commands

watch send

Sends a signed transaction to the blockchain network.

Options:

  • --file <path> - Path to the signed transaction file

Example:

bash
watch send --file data/tx/btc/tx_signed_1234567890.json

Monitor Commands

watch monitor senttx

Monitors sent transactions for a specific account.

Options:

  • --account <string> - Account name to monitor

Example:

bash
watch monitor senttx --account deposit

watch monitor balance

Monitors balance for addresses.

Options:

  • --num <uint64> - Confirmation number (default: 6)

Example:

bash
watch monitor balance --num 6

API Commands

API commands are coin-specific and dynamically configured based on the --coin flag.

Bitcoin/Bitcoin Cash API (watch api with --coin btc or --coin bch)

  • watch api balance - Get balance for an account
    • --account <string> - Account name
  • watch api estimatefee - Estimate transaction fee
  • watch api getnetworkinfo - Get network information
  • watch api getaddressinfo - Get address information
    • --address <string> - Address to query
  • watch api listunspent - List unspent transaction outputs
    • --account <string> - Account name
    • --num <int64> - Confirmation number (-1 for all)
  • watch api logging - Get logging information
  • watch api unlocktx - Unlock locked transactions for unspent outputs
  • watch api validateaddress - Validate a Bitcoin address
    • --address <string> - Address to validate

Ethereum API (watch api with --coin eth)

  • watch api clientversion - Get client version
  • watch api nodeinfo - Get node information
  • watch api syncing - Get synchronization status
  • watch api netversion - Get network version

Ripple API (watch api with --coin xrp)

  • watch api sendcoin - Send coins from faucet (for testing)
    • --address <string> - Receiver address
    • --amount <float> - Amount to send

Keygen Wallet Commands

Keygen Wallet operates offline as a cold wallet. It generates keys, creates multisig addresses, and provides the first signature for multisig transactions.

Create Commands

keygen create seed

Creates a seed for the wallet. If --seed is provided, it will be stored instead of generating a new one.

Options:

  • --seed <string> - Seed value to store (development use only)

Example:

bash
keygen create seed

keygen create key

Creates a single key for debugging purposes.

Example:

bash
keygen create key

keygen create hdkey

Creates HD (Hierarchical Deterministic) keys based on BIP32/BIP44 standards.

Options:

  • --keynum <uint64> - Number of HD keys to generate (default: 0)
  • --account <string> - Target account name
  • --keypair - Generate keypair for XRP (default: false)

Example:

bash
keygen create hdkey --keynum 10 --account deposit

keygen create multisig

Creates a multisig address based on account settings.

Options:

  • --account <string> - Target account name

Example:

bash
keygen create multisig --account deposit

Export Commands

keygen export address

Exports generated public key addresses as a CSV file for import into Watch Wallet.

Options:

  • --account <string> - Target account name

Example:

bash
keygen export address --account deposit

Import Commands

keygen import privkey

Imports generated private keys from the database into the Keygen Wallet.

Options:

  • --account <string> - Target account name

Example:

bash
keygen import privkey --account deposit

keygen import fullpubkey

Imports full public keys generated by Sign Wallet. These are used to create multisig addresses.

Options:

  • --file <path> - Path to the full-pubkey CSV file

Example:

bash
keygen import fullpubkey --file data/fullpubkey/btc/fullpubkey_sign1.csv

Sign Commands

keygen sign signature

Signs an unsigned transaction. This provides the first signature for multisig addresses.

Options:

  • --file <path> - Path to the unsigned transaction file

Example:

bash
keygen sign signature --file data/tx/btc/tx_unsigned_1234567890.json

API Commands

API commands are coin-specific and dynamically configured based on the --coin flag.

Bitcoin/Bitcoin Cash API (keygen api with --coin btc or --coin bch)

  • keygen api encryptwallet - Encrypts the wallet with a passphrase
    • --passphrase <string> - Passphrase for encryption
  • keygen api walletpassphrase - Stores the wallet decryption key in memory
    • --passphrase <string> - Passphrase to unlock the wallet
  • keygen api walletpassphrasechange - Changes the wallet passphrase
    • --old <string> - Old passphrase
    • --new <string> - New passphrase
  • keygen api walletlock - Locks the wallet by removing the encryption key from memory
  • keygen api dumpwallet - Dumps all wallet keys in a human-readable format
    • --file <string> - Output file name
  • keygen api importwallet - Imports keys from a wallet dump file
    • --file <string> - Wallet dump file path

Ethereum API (keygen api with --coin eth)

  • keygen api importrawkey - Imports a raw private key
    • --key <string> - Private key to import
    • --pass <string> - Passphrase for the key

Sign Wallet Commands

Sign Wallet operates offline as a cold wallet. It provides subsequent signatures (2nd, 3rd, etc.) for multisig transactions. Each authorization operator uses their own Sign Wallet instance.

Create Commands

sign create seed

Creates a seed for the authorization account wallet. If --seed is provided, it will be stored instead of generating a new one.

Options:

  • --seed <string> - Seed value to store (development use only)

Example:

bash
sign create seed

sign create hdkey

Creates HD keys for the authorization account.

Example:

bash
sign create hdkey

Export Commands

sign export fullpubkey

Exports full public key addresses as a CSV file for import into Keygen Wallet. These are used to create multisig addresses.

Example:

bash
sign export fullpubkey

Import Commands

sign import privkey

Imports generated private keys for the authorization account into the database.

Example:

bash
sign import privkey

Sign Commands

sign sign signature

Signs a transaction that has already been signed by Keygen Wallet (or other Sign Wallets). This provides subsequent signatures for multisig addresses.

Options:

  • --file <path> - Path to the signed transaction file

Example:

bash
sign sign signature --file data/tx/btc/tx_signed1_1234567890.json

API Commands

API commands are coin-specific and dynamically configured based on the --coin flag.

Bitcoin/Bitcoin Cash API (sign api with --coin btc or --coin bch)

  • sign api encryptwallet - Encrypts the wallet with a passphrase
    • --passphrase <string> - Passphrase for encryption
  • sign api walletpassphrase - Stores the wallet decryption key in memory
    • --passphrase <string> - Passphrase to unlock the wallet
  • sign api walletpassphrasechange - Changes the wallet passphrase
    • --old <string> - Old passphrase
    • --new <string> - New passphrase
  • sign api walletlock - Locks the wallet by removing the encryption key from memory

Ethereum API (sign api with --coin eth)

  • sign api clientversion - Get client version
  • sign api nodeinfo - Get node information
  • sign api syncing - Get synchronization status
  • sign api netversion - Get network version

Global Flags

See Global Flags in the CLI README.