koinos / koinos-cli

A command line utility used for key management and to interact with the Koinos blockchain.
Other
9 stars 7 forks source link

Implementation of `register_token` #148

Closed sgerbino closed 2 years ago

sgerbino commented 2 years ago

Resolves #143. Resolves #144. Resolves #145.

Brief description

Adds register_token command which allows the user to add tokens considering their symbol and precision. Removes the hardcoded transfer and balance commands.

Checklist

Demonstration

❯ ./koinos-cli
Connected to endpoint https://api.koinos.io/

Token 'koin' at address 15DJN4a8SgrbGhhGksSBASiSYjGnMU8dGL registered

Token 'vhp' at address 1AdzuXSpC6K9qtXdCBgD5NUpDNwHjMgrc9 registered

Contract 'pob' at address 159myq5YUhhoVWu3wsHKHiJYKPKGUrGiyv registered

Contract 'name_service' at address 19WxDJ9Kcvx4VqQFkpwVmwVEy1hMuwXtQE registered

Koinos CLI v1.0.0
Type "list" for a list of commands, "help <command>" for help on a specific command.
🔐 > vhp.total_supply
7759501.02489313 VHP

🔐 > koin.total_supply
9557584.57649814 KOIN

🔐 > koin.balance_of 1NsQbH5AhQXgtSNg1ejpFqTi2hmCWz1eQS
6977.43290515 KOIN

🔐 > vhp.balance_of 1NsQbH5AhQXgtSNg1ejpFqTi2hmCWz1eQS
2197976.10563429 VHP

...

🔓 > tkoin.transfer 1Kv5E6ZSJbJxNtDCy2dLTNqJoT1fLvpukP 0.1
Transferring 0.1 tKOIN to 1Kv5E6ZSJbJxNtDCy2dLTNqJoT1fLvpukP
Transaction with ID 0x1220dd0e8f7d3989a4a007e8bbc340a409822cd47bcafd5828ee684098be6af66a7a containing 1 operations submitted.
Mana cost: 0.10904102 (Disk: 112, Network: 313, Compute: 561569)

🔓 > tkoin.balance_of
9999.9 tKOIN

🔓 > tkoin.balance_of 1Kv5E6ZSJbJxNtDCy2dLTNqJoT1fLvpukP
0.1 tKOIN

🔓 > tkoin.total_supply
19658634.79195013 tKOIN