Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jspada committed Dec 18, 2020
1 parent 577fd2d commit 358a988
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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).

0 comments on commit 358a988

Please sign in to comment.