Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): added (multi)-wallet integration #2352

Conversation

mickvandijke
Copy link
Contributor

@mickvandijke mickvandijke commented Oct 29, 2024

Building on @ermineJose 's PR: #2253

Adds (multi)-wallet support to the CLI. Including wallet encryption.

Adds the following commands to the CLI:

  1. wallet create: Creates a new wallet in the wallets folder. The user will be prompted if they want to optionally encrypt the wallet with a password.
  2. wallet create --no-password: Same as above, but skips the optional encryption step.
  3. wallet create --private-key <PRIVATE_KEY>: Imports a wallet into the wallets folder. The user will be prompted if they want to optionally encrypt the wallet with a password.
  4. wallet balance: Prints the wallet token and gas balances in atto's.

If a user owns multiple wallets, they will be presented with a list of wallets to select from for performing a certain action:

Wallets:
+-------+--------------------------------------------+-----------+
| Index | Address                                    | Encrypted |
+-------+--------------------------------------------+-----------+
| 1     | 0x8088440383508eDdaD6132dAfaEEA1d7A476Cb8A | false     |
+-------+--------------------------------------------+-----------+
| 2     | 0x51d1e7B9ABC31f858fDe576A37e6C3a8FB70a693 | false     |
+-------+--------------------------------------------+-----------+
| 3     | 0x5A631e17FfB0F07b00D88E0e42246495Bf21d698 | true      |
+-------+--------------------------------------------+-----------+
Select by index:
1

If the user selects an encrypted wallet, they will have to provide a password to decrypt it:

Wallets:
+-------+--------------------------------------------+-----------+
| Index | Address                                    | Encrypted |
+-------+--------------------------------------------+-----------+
| 1     | 0x8088440383508eDdaD6132dAfaEEA1d7A476Cb8A | false     |
+-------+--------------------------------------------+-----------+
| 2     | 0x51d1e7B9ABC31f858fDe576A37e6C3a8FB70a693 | false     |
+-------+--------------------------------------------+-----------+
| 3     | 0x5A631e17FfB0F07b00D88E0e42246495Bf21d698 | true      |
+-------+--------------------------------------------+-----------+
Select by index:
3
Enter password to decrypt wallet:
Wallet balances: 0x5A631e17FfB0F07b00D88E0e42246495Bf21d698
+---------------+---+
| Token Balance | 0 |
+---------------+---+
| Gas Balance   | 0 |
+---------------+---+

@mickvandijke mickvandijke force-pushed the feat-autonomi-cli-wallet-integration-rc branch from 6b9f91f to 543446f Compare October 29, 2024 12:00
@mickvandijke mickvandijke force-pushed the feat-autonomi-cli-wallet-integration-rc branch from 543446f to 561cf4e Compare October 29, 2024 12:16
@mickvandijke mickvandijke force-pushed the feat-autonomi-cli-wallet-integration-rc branch from 561cf4e to e145bb1 Compare October 29, 2024 12:49
@b-zee b-zee merged commit 8d3652f into maidsafe:rc-2024.10.4 Oct 29, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants