Skip to content

CLI Wallet

The cli_wallet executable provides an interactive command-line interface for managing accounts, signing and broadcasting transactions, and querying the blockchain.


Connection

bash
cli_wallet --server-rpc-endpoint="ws://127.0.0.1:8091"

On first run, set a password:

new >>> set_password "yourpassword"

Then unlock:

locked >>> unlock "yourpassword"

Wallet Management

CommandDescription
is_newReturns true if no password set yet
is_lockedReturns true if wallet is locked
lockLock the wallet
unlock "password"Unlock the wallet
set_password "password"Set or change the password
load_wallet_file "file.json"Load a wallet file ("" = reload current)
save_wallet_file "file.json"Save wallet to file
set_transaction_expiration 60Set transaction TTL in seconds
quitExit the wallet
helpList all commands
gethelp "command"Detailed help for one command

Key Management

CommandDescription
import_key "5K..."Import a WIF private key
suggest_brain_keyGenerate a suggested brain key with public/private pair
list_keysList all private keys (WIF) in the wallet
get_private_key "VIZpubkey..."Get WIF for a known public key
get_private_key_from_password "account" "role" "password"Derive key from credentials
normalize_brain_key "words..."Normalize a brain key string

Querying

CommandDescription
infoCurrent blockchain state
database_infoDatabase object statistics
get_block 1000000Block data
get_ops_in_block 1000000 falseOperations in block (true = virtual only)
get_active_validatorsActive validator set
get_account "alice"Account object
list_accounts "" 100Paginated account list
list_my_accountsAccounts with keys in wallet
get_account_history "alice" -1 100Last 100 operations for alice
get_transaction "txid..."Transaction by ID
get_master_history "alice"Master key change history
get_withdraw_routes "alice" "all"Withdrawal routes ("incoming", "outgoing", "all")
get_proposed_transactions "alice" 0 100Proposals requiring alice's approval

Account Operations

CommandDescription
create_account "creator" "1.000 VIZ" "10.000000 SHARES" "newaccount" "{}" trueCreate account with auto-generated keys
create_account_with_keys "creator" "1.000 VIZ" "10.000000 SHARES" "newaccount" "{}" "VIZmaster..." "VIZactive..." "VIZregular..." "VIZmemo..." trueCreate account with specified keys
update_account "account" "{}" "VIZm..." "VIZa..." "VIZr..." "VIZmemo..." trueUpdate all keys and metadata
update_account_auth_key "account" "active" "VIZnewkey..." 1 trueAdd key to authority (weight 0 = remove)
update_account_auth_account "account" "active" "guardian" 1 trueAdd account to authority
update_account_auth_threshold "account" "active" 2 trueSet authority weight threshold
update_account_meta "account" "{\"key\":\"value\"}" trueUpdate JSON metadata (regular auth)
update_account_memo_key "account" "VIZnewmemo..." trueUpdate memo key
delegate_vesting_shares "alice" "bob" "100.000000 SHARES" trueDelegate SHARES (0 = remove)

Transfer and Vesting

CommandDescription
transfer "alice" "bob" "10.000 VIZ" "memo" trueTransfer VIZ (prefix memo with # for encrypted)
transfer_to_vesting "alice" "alice" "100.000 VIZ" trueStake VIZ as SHARES
withdraw_vesting "alice" "100.000000 SHARES" trueStart power-down (0 = cancel)
set_withdraw_vesting_route "alice" "bob" 5000 false trueRoute 50% of withdrawals to bob as VIZ

Validator Operations

CommandDescription
list_validators "" 100List validators
get_validator "validatorname"Validator object
update_validator "myvalidator" "https://url" "VIZsigningkey..." trueRegister/update validator
update_chain_properties "myvalidator" {...} trueVote on chain properties (init format)
versioned_update_chain_properties "myvalidator" {...} trueVote on versioned chain properties (hf9 format)
vote_for_validator "alice" "myvalidator" true trueVote for validator (false = remove vote)
set_voting_proxy "alice" "proxy" trueSet validator vote proxy ("" = remove)

Escrow Operations

CommandDescription
escrow_transfer "alice" "bob" "agent" 1 "100.000 VIZ" "1.000 VIZ" "2024-06-01T00:00:00" "2024-07-01T00:00:00" "{}" trueCreate escrow
escrow_approve "alice" "bob" "agent" "bob" 1 true trueApprove escrow (who = "bob" or "agent")
escrow_dispute "alice" "bob" "agent" "alice" 1 trueRaise dispute (who = "alice" or "bob")
escrow_release "alice" "bob" "agent" "agent" "bob" 1 "100.000 VIZ" trueRelease funds

Recovery Operations

CommandDescription
request_account_recovery "recovery" "victim" {"weight_threshold":1,...} trueRequest recovery as recovery account
recover_account "victim" {"recent_master_auth"} {"new_master_auth"} trueConfirm recovery
change_recovery_account "account" "new_recovery" trueChange recovery account (30-day delay)

Committee Operations

CommandDescription
committee_worker_create_request "creator" "https://url" "worker" "100.000 VIZ" "500.000 VIZ" 604800 trueCreate funding request
committee_worker_cancel_request "creator" 123 trueCancel request
committee_vote_request "voter" 123 10000 trueVote (+10000 = full support, -10000 = full oppose, 0 = remove)

Invite Operations

CommandDescription
create_invite "creator" "10.000 VIZ" "VIZinvitekey..." trueCreate invite
claim_invite_balance "initiator" "receiver" "5Kinvitesecret..." trueClaim invite balance
invite_registration "initiator" "newaccount" "5Kinvitesecret..." "VIZnewaccountkey..." trueCreate account from invite
use_invite_balance "initiator" "receiver" "5Kinvitesecret..." trueUse invite (may vest to SHARES)

Award Operations

CommandDescription
award "alice" "bob" 1000 0 "Great work!" [] trueAward with energy-based reward
fixed_award "alice" "bob" "10.000000 SHARES" 5000 0 "Reward" [] trueAward fixed SHARES amount

Beneficiary format: [{"account":"charlie","weight":2000}]


Subscription Operations

CommandDescription
set_paid_subscription "account" "https://url" 3 "10.000 VIZ" 30 trueCreate subscription (3 levels, 10 VIZ/period, 30-day period)
paid_subscribe "subscriber" "account" 2 "20.000 VIZ" 1 true trueSubscribe to level 2

Account Market

CommandDescription
set_account_price "account" "account" "100.000 VIZ" true trueList for sale
set_subaccount_price "account" "account" "50.000 VIZ" true trueList subaccount creation for sale
buy_account "buyer" "account" "100.000 VIZ" "VIZnewkey..." "0.000 VIZ" trueBuy account
target_account_sale "account" "account" "targetbuyer" "100.000 VIZ" true trueTargeted sale

Custom Operation

bash
custom [] ["alice"] "my_app" "{\"action\":\"follow\",\"target\":\"bob\"}" true

Parameters: required_active_auths required_regular_auths id json broadcast


Transaction Builder

Build and sign custom multi-operation transactions:

bash
begin_builder_transaction           # Returns handle (e.g. 0)
add_operation_to_builder_transaction 0 [2,{"from":"alice","to":"bob","amount":"10.000 VIZ","memo":""}]
sign_builder_transaction 0 true     # Sign and broadcast
CommandDescription
begin_builder_transactionStart a new transaction (returns handle)
add_operation_to_builder_transaction handle [type_id, op]Add operation
replace_operation_in_builder_transaction handle idx [type_id, op]Replace operation
preview_builder_transaction handlePreview transaction JSON
sign_builder_transaction handle broadcastSign (and optionally broadcast)
propose_builder_transaction handle author title memo expiry review broadcastWrap in proposal
remove_builder_transaction handleDiscard
get_prototype_operation "transfer_operation"Get empty operation template
serialize_transaction {trx}Get hex serialization
sign_transaction {trx} broadcastSign arbitrary transaction

NS DNS Helpers

Store DNS records in account metadata:

bash
ns_set_records "myaccount" {"a_records":["188.120.231.153"],"ssl_hash":"4a4613...","ttl":28800} true
ns_get_summary "myaccount"
ns_extract_a_records "myaccount"
ns_remove_records "myaccount" true

Validation helpers: ns_validate_ipv4, ns_validate_sha256_hash, ns_validate_ttl, ns_validate_ssl_txt_record, ns_validate_metadata, ns_create_metadata.


Private Messaging

bash
get_encrypted_memo "alice" "bob" "#secret message"
decrypt_memo "#encrypteddata..."
get_inbox "myaccount" "2024-01-15T00:00:00" 100 0
get_outbox "myaccount" "2024-01-15T00:00:00" 100 0

See also: JSON-RPC API, Operations Overview, Data Types.