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

# Subaccounts (integer, hex, or text)
icw balance -s 1                  # integer (0-255)
icw balance -s savings            # text (max 32 ASCII chars)
icw balance -s 0a1b2c...          # hex (64 chars = 32 bytes)

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

# 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.4.tar.gz (8.0 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.4-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: internet_computer_wallet-0.1.4.tar.gz
  • Upload date:
  • Size: 8.0 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.4.tar.gz
Algorithm Hash digest
SHA256 df53abb4aca9275d2b08dd3cabf0c4ab9184462925e19e61933d750703a36f91
MD5 f78d5b1166694716660e8151a848f2d3
BLAKE2b-256 020d666dfc63e4d20c22eefb3ee7ceb772a44984e8c0196f70a607c03392316e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for internet_computer_wallet-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e33da449264d98677c9c52eb7edcab11d1081469052388d69f2f7acfa30f6873
MD5 9743d044c5b06b519d46a76134abe8ad
BLAKE2b-256 e2789717394b5f43b12b77dde1dafce8691e91ab41d50ad66ce4a8c3d068f89d

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