Skip to main content

CLI for ICRC-1 tokens (ckBTC, ckETH, ICP) on the Internet Computer

Project description

ICW - ICP Wallet CLI

Simple CLI for managing ICRC-1 tokens (ckBTC, ckETH, ICP) on the Internet Computer.

⚠️ WARNING: This is experimental software. Do not use with significant amounts of funds. Use at your own risk.

Install

pip install internet-computer-wallet

Usage

# Check balance (auto-converts to USD)
icw balance                       # ckBTC (default)
icw -t cketh balance              # ckETH
icw -t icp balance                # ICP
icw balance -p <principal> -s 1   # specific principal + subaccount

# Transfer tokens
icw transfer <recipient> 0.001
icw transfer <recipient> 0.001 -s 1 -f 2  # to subaccount 1, from subaccount 2

# Token info + current price
icw info                          # ckBTC (default)
icw -t icp info                   # ICP

# Identity management
icw id              # current identity + principal
icw id list         # list all identities
icw id use <name>   # switch identity
icw id new <name>   # create new identity

# Version
icw --version

Output

All commands output JSON for easy parsing:

{
  "token": "ckBTC",
  "balance": 0.001,
  "raw": 100000,
  "usd": 97.0,
  "price": 97000.0,
  "principal": "abc-xyz"
}

Options

  • -t, --token: Token (ckbtc, cketh, icp). Default: ckbtc
  • -n, --network: Network (ic, local). Default: ic
  • --ledger: Override ledger canister ID (for local testing)
  • --fee: Override transfer fee (for local testing)

Local Development

To use icw with a local dfx replica:

cd tests

# Download ledger wasm artifacts
./download_artifacts.sh

# Start local replica
dfx start --clean --background

# Deploy test ledger with initial balance
dfx deploy ckbtc_ledger --no-wallet --yes --argument='(variant { Init = record { 
  minting_account = record { owner = principal "'$(dfx identity get-principal)'"; subaccount = null }; 
  transfer_fee = 0; token_symbol = "ckBTC"; token_name = "ckBTC Test"; decimals = opt 8; 
  metadata = vec {}; feature_flags = opt record { icrc2 = true };
  initial_balances = vec { record { record { owner = principal "'$(dfx identity get-principal)'"; subaccount = null }; 100_000_000_000 } }; 
  archive_options = record { num_blocks_to_archive = 1000; trigger_threshold = 2000; controller_id = principal "'$(dfx identity get-principal)'" } 
} })'

# Get ledger ID and use icw
LEDGER=$(dfx canister id ckbtc_ledger)
icw -n local balance --ledger $LEDGER
icw -n local transfer <recipient> 0.01 --ledger $LEDGER --fee 0

Requirements

  • Python 3.9+
  • dfx (auto-installs if missing)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

internet_computer_wallet-0.1.3.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

internet_computer_wallet-0.1.3-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file internet_computer_wallet-0.1.3.tar.gz.

File metadata

  • Download URL: internet_computer_wallet-0.1.3.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for internet_computer_wallet-0.1.3.tar.gz
Algorithm Hash digest
SHA256 100913ee86d31d2a88e3c811e59ac50bb56a27358d4490c6cf6a6e5a1382e28a
MD5 9183cf52ed95440e94f5e799dc69e129
BLAKE2b-256 a457cbef0b0cabb5e8dbc6b588057839d95218e6a98a246934deed4ce147912b

See more details on using hashes here.

File details

Details for the file internet_computer_wallet-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for internet_computer_wallet-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 be5952833b4be3b822ebd7aea53b5dc4eea0baac2d2a75759694cb8dab724a52
MD5 a071a7a2db72738ef2e74d0b877ee57f
BLAKE2b-256 c797ce9a7d28af7c5e15370e6a32221a54f6f2bfceb57a1ad7de8d4571bf12b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page