forked from venbrinoDev/chain_cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created: inital commit from precious_the_app_guy
- Loading branch information
0 parents
commit 3c5680a
Showing
11 changed files
with
864 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# https://dart.dev/guides/libraries/private-files | ||
# Created by `dart pub` | ||
.dart_tool/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 1.0.0 | ||
|
||
- Initial version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Chain Manager CLI | ||
|
||
This is a command-line interface (CLI) tool written in Dart that helps you create, manage seed phrase, and interact with blockchain and cryptocurrency wallets. | ||
|
||
## Features | ||
|
||
- **Create Seed Phrase:** Generate a new mnemonic seed phrase. | ||
- **Manage Seed Phrase:** Store and manage your mnemonic seed phrases securely. | ||
- **Manage Wallet Addresses:** Add, remove, and label wallet addresses for easy reference. | ||
- **Send Crypto:** Send cryptocurrency from your wallet to another address. | ||
- **And More:** Explore additional features to manage your cryptocurrency assets efficiently. | ||
|
||
|
||
## Installation | ||
|
||
To use this tool, you need to have Dart installed. You can install Dart from the [Dart website](https://dart.dev/get-dart). | ||
|
||
Once Dart is installed, you can install the tool using the following command: | ||
|
||
```bash | ||
dart pub global activate --source path <path_to_tool_directory> | ||
``` | ||
|
||
# Commands | ||
|
||
### Generate Seed Phrase | ||
To generate a new mnemonic seed phrase, use the following command: | ||
|
||
```bash | ||
chain generate | ||
``` | ||
This command will output a new mnemonic seed phrase that can be used to generate a wallet. | ||
|
||
### Verify Seed Phrase | ||
To verify if a seed phrase is correct, use the following command: | ||
|
||
```bash | ||
chain verify --seed="<seed_phrase>" | ||
``` | ||
Replace <seed_phrase> with the seed phrase you want to verify. If the seed phrase is correct, it will output "Your seed phrase is correct"; otherwise, it will output "Incorrect seed phrase". | ||
|
||
## Send Crypto | ||
Coming soon | ||
```bash | ||
chain send --amount | ||
``` | ||
|
||
## Check Wallet Balance | ||
Coming soon | ||
```bash | ||
chain send --balance="<wallet_address>" | ||
``` | ||
|
||
## Help | ||
if you are stuck you can run this command any time to find your way | ||
|
||
```bash | ||
chain help | ||
``` | ||
|
||
## Contributing | ||
|
||
If you would like to contribute to this project, feel free to fork the repository and submit a pull request. Your contributions are welcome! | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This file configures the static analysis results for your project (errors, | ||
# warnings, and lints). | ||
# | ||
# This enables the 'recommended' set of lints from `package:lints`. | ||
# This set helps identify many issues that may lead to problems when running | ||
# or consuming Dart code, and enforces writing Dart using a single, idiomatic | ||
# style and format. | ||
# | ||
# If you want a smaller set of lints you can change this to specify | ||
# 'package:lints/core.yaml'. These are just the most critical lints | ||
# (the recommended set includes the core lints). | ||
# The core lints are also what is used by pub.dev for scoring packages. | ||
|
||
include: package:lints/recommended.yaml | ||
|
||
# Uncomment the following section to specify additional rules. | ||
|
||
# linter: | ||
# rules: | ||
# - camel_case_types | ||
|
||
# analyzer: | ||
# exclude: | ||
# - path/to/excluded/files/** | ||
|
||
# For more information about the core and recommended set of lints, see | ||
# https://dart.dev/go/core-lints | ||
|
||
# For additional information about configuring this file, see | ||
# https://dart.dev/guides/language/analysis-options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import 'package:chain/chain.dart' as chain; | ||
|
||
void main(List<String> args) => chain.start(args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
library generate; | ||
|
||
export 'src/chain_base.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import 'package:args/command_runner.dart'; | ||
import 'package:chain/src/commands/seed.dart'; | ||
import 'package:chain/src/commands/verify.dart'; | ||
|
||
///Start the cli tool | ||
void start(List<String> args) { | ||
final runner = CommandRunner('chain', 'Manage and generate seed pharse') | ||
..addCommand(GenerateSeedPharse()) | ||
..addCommand(VerifySeedPhrase()); | ||
runner.run(args); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:args/command_runner.dart'; | ||
import 'package:bip39/bip39.dart' as bip39; | ||
import 'package:dcli/dcli.dart'; | ||
|
||
///A simple seed pharse generator | ||
class GenerateSeedPharse extends Command { | ||
GenerateSeedPharse() { | ||
init(); | ||
} | ||
|
||
void init() {} | ||
|
||
@override | ||
void run() { | ||
final seed = bip39.generateMnemonic(); | ||
print(blue(seed)); | ||
} | ||
|
||
@override | ||
String get description => 'Helps create a new seedpharse '; | ||
|
||
@override | ||
String get name => "generate"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:args/command_runner.dart'; | ||
import 'package:bip39/bip39.dart' as bip39; | ||
import 'package:dcli/dcli.dart'; | ||
|
||
///A simple seed pharse generator | ||
class VerifySeedPhrase extends Command { | ||
VerifySeedPhrase() { | ||
init(); | ||
} | ||
|
||
void init() { | ||
argParser.addOption('seed', | ||
aliases: ['seeds'], | ||
help: | ||
'''Pass the seed pharse by doing chain verify --seed="seed pharse"'''); | ||
} | ||
|
||
@override | ||
void run() { | ||
if (argResults == null) { | ||
print(exists('Try running chain -h')); | ||
exit(1); | ||
} | ||
|
||
if (argResults!.wasParsed('seed')) { | ||
final isVerified = bip39.validateMnemonic(argResults!['seed']); | ||
if (isVerified) { | ||
print(green('Your seed pharse is correct')); | ||
exit(0); | ||
} else { | ||
print(red('Incorrect seed phrase')); | ||
exit(0); | ||
} | ||
} | ||
|
||
print(red('please pass in seed pharse ')); | ||
} | ||
|
||
@override | ||
String get description => 'Verify if a seed pharse is correct'; | ||
|
||
@override | ||
String get name => "verify"; | ||
} |
Oops, something went wrong.