From 358a988144df44859d8ffe7cfbd09411fcc5cb1a Mon Sep 17 00:00:00 2001 From: Joseph Spadavecchia Date: Fri, 18 Dec 2020 00:20:56 +0000 Subject: [PATCH] Updated readme --- README.md | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 02d2ae9..384440a 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ install prerequisite and switch to a Nano X dev-env: sudo apt install python3-venv python3-dev libudev-dev libusb-1.0-0-dev # (x or s, depending on your device) -source prepare-devenv.sh x +source prepare-devenv.sh s ``` Compile and load the app onto the device: @@ -75,33 +75,57 @@ with your Ledger device and Mina blockchain to allow you to generate addresses, sign transaction and submit them to the Mina network. ```bash -$ ./utils/mina-ledger-wallet.py -h -usage: mina-ledger-wallet.py [-h] {get-address,send-payment} ... +$ ./utils/mina_ledger_wallet.py -h +usage: mina_ledger_wallet.py [-h] [--verbose] + {get-address,get-balance,send-payment,delegate} + ... positional arguments: - {get-address,send-payment} + {get-address,get-balance,send-payment,delegate} optional arguments: -h, --help show this help message and exit + --verbose Verbose mode ``` **Get address** ```bash -$ ./utils/mina-ledger-wallet.py get-address 1 -Getting address... -Received: B62qpaDc8nfu4a7xghkEni8u2rBjx7EH95MFeZAhTgGofopaxFjdS7P +$ ./utils/mina_ledger_wallet.py get-address 1 +Get address for account 1 (path 44'/12586'/1/0/0) +Continue? (y/N) y +Generating address (please confirm on Ledger device)... done +Received address: B62qpaDc8nfu4a7xghkEni8u2rBjx7EH95MFeZAhTgGofopaxFjdS7P ``` +This generates the keypair corresponding to hardware wallet account 1 (BIP44 account 44'/12586'/1/0/0) and returns the corresponding Mina address. -This generates the keypair corresponding to hardware wallet account 1 (BIP44 address /44'/12586'/1/0/0) and returns the corresponding Mina address. +**Get balance** + +```bash +$ ./utils/mina_ledger_wallet.py get-balance B62qrGaXh9wekfwaA2yzUbhbvFYynkmBkhYLV36dvy5AkRvgeQnY6vx +Getting network identifier... debug +Getting account balance... done + +Address: B62qrGaXh9wekfwaA2yzUbhbvFYynkmBkhYLV36dvy5AkRvgeQnY6vx +Balance: 9792.0 +``` +This queries the Mina blockchain for the balance of address B62qrGaXh9wekfwaA2yzUbhbvFYynkmBkhYLV36dvy5AkRvgeQnY6vx. **Send payment** ```bash -$ ./utils/mina-ledger-wallet.py send-payment --fee 0.00271828 1 B62qpaDc8nfu4a7xghkEni8u2rBjx7EH95MFeZAhTgGofopaxFjdS7P B62qrPN5Y5yq8kGE3FbVKbGTdTAJNdtNtB5sNVpxyRwWGcDEhpMzc8g 100.5 +$ ./utils/mina_ledger_wallet.py send-payment 1 B62qpaDc8nfu4a7xghkEni8u2rBjx7EH95MFeZAhTgGofopaxFjdS7P B62qrPN5Y5yq8kGE3FbVKbGTdTAJNdtNtB5sNVpxyRwWGcDEhpMzc8g 2.71821 +``` + +This sends a payment of 2.71821 Mina from hardware wallet account 1 (B62qpaDc8nfu4a7xghkEni8u2rBjx7EH95MFeZAhTgGofopaxFjdS7P) to recipient B62qrPN5Y5yq8kGE3FbVKbGTdTAJNdtNtB5sNVpxyRwWGcDEhpMzc8g. + +**Delegate** + +```bash +$ ./utils/mina_ledger_wallet.py delegate 1 B62qpaDc8nfu4a7xghkEni8u2rBjx7EH95MFeZAhTgGofopaxFjdS7P B62qrPN5Y5yq8kGE3FbVKbGTdTAJNdtNtB5sNVpxyRwWGcDEhpMzc8g --memo "Delegation is fun!" ``` -This sends a payment of 100.5 Mina from hardware wallet account 1 (B62qpaDc8nfu4a7xghkEni8u2rBjx7EH95MFeZAhTgGofopaxFjdS7P) to recipient B62qrPN5Y5yq8kGE3FbVKbGTdTAJNdtNtB5sNVpxyRwWGcDEhpMzc8g. +This delegates the entire balance of hardware wallet account 1 (B62qpaDc8nfu4a7xghkEni8u2rBjx7EH95MFeZAhTgGofopaxFjdS7P) to delegate B62qrPN5Y5yq8kGE3FbVKbGTdTAJNdtNtB5sNVpxyRwWGcDEhpMzc8g. ## Documentation This follows the specification available in the [`api.asc`](https://github.com/LedgerHQ/ledger-app-boilerplate/blob/master/doc/api.asc).