GithubHelp home page GithubHelp logo

subwallet's Introduction

subwallet

A simple Command Line Interface Wallet for Polkadot/Substrate.

Installation

Install Binary

You can go to the latest release and download the binary.

Install via Cargo

If you are a Rust developer, you can install via cargo:

cargo install subwallet

Build from source code

git clone https://github.com/yxf/subwallet.git
cargo +nightly build --release

Usage

$ ./subwallet -h
subwallet 0.1.0
yxf <[email protected]>
A simple Command Line Interface wallet for Polkadot/Substrate.

USAGE:
    subwallet [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    backup           Backup specified address to local json file
    getnewaddress    Generate a new address associated with label, deafult cryptography is sr25519
    help             Prints this message or the help of the given subcommand(s)
    listaddresses    Prints the list of addresses
    restore          Restore address from json file

Subcommands

./subwallet help [SUBCOMMAND] to prints help information of subcommand.

getnewaddress

Generate a new random address

Example:

$ ./subwallet getnewaddress demo
1c1AVSCrrhtakya7LSm2hXHJUmBFdXV2KmCgEgDDaTWUQK3

listaddresses

List all generated addresses

Example:

$ ./subwallet listaddresses
ec              1EE8Q6nt4x3x3Cm9eevvtCBesEUfwTJ4bw4ocQUkNrd42Z1j        ecdsa
demo            15FarxkDPL7LPvBPd1RDMGugGFs8be2ijuHEuLJd9z67PdNm        sr25519
ed              16Q55taKB1ggt3VgQ8EFTRkmYTgtNKb9xka8hqMqXMPLCNxU        ed25519

restore

Restore address from json file. It is compatible with keystore file generated on https://polkadot.js.org/apps.

Example:

./subwallet restore ~/1EE8Q6nt4x3x3Cm9eevvtCBesEUfwTJ4bw4ocQUkNrd42Z1j.json
Password: #Type password to decode seed
1EE8Q6nt4x3x3Cm9eevvtCBesEUfwTJ4bw4ocQUkNrd42Z1j is restored

backup

Backup address to local json file. The backed file can be restored on https://polkadot.js.org/apps.

Example:

./subwallet backup demo ~/demo.json
Type password to encrypt seed: # password
Address `15FarxkDPL7LPvBPd1RDMGugGFs8be2ijuHEuLJd9z67PdNm` is backed up to file `~/demo.json`

setrpcurl

Save RPC url to local file

Example:

./subwallet setrpcurl wss://rpc.polkadot.io

transfer

Submit a transfer extrinsic.

Because transfer is not open on Polkadot network now, the transfer will fail.

Example1: Use label

# Here `demo` is `15FarxkDPL7LPvBPd1RDMGugGFs8be2ijuHEuLJd9z67PdNm`, `ed` is `16Q55taKB1ggt3VgQ8EFTRkmYTgtNKb9xka8hqMqXMPLCNxU`
./subwallet transfer demo ed 0.001

Example2: Use address

./subwallet transfer 15FarxkDPL7LPvBPd1RDMGugGFs8be2ijuHEuLJd9z67PdNm 16Q55taKB1ggt3VgQ8EFTRkmYTgtNKb9xka8hqMqXMPLCNxU 0.001

getbalances

Show the balances of addresses

Example:

./subwallet getbalances
145CPZPTqovQNkYMwEJ1himG3GYEVW2jJrzWDR9mButvjca                              0 DOT
14cstG1jBDJuPGcAf41cmX6QWuF2AxN3sMWaxtPac9D5cToJ             52717.460021565876 DOT
1Qobp4G1snJPNWPz3onWpDVJGXtipBeF2EdLEdXT9aRRENe               531.509335187554 DOT
15UZUsnbRcUdYLfNjwCy5BzSLFi9Dc14FudUGuZ6AkbtEYv5                              0 DOT

syncextrinsics or syncxts

Download and save address related extrinsics from remote node to local file through RPC.

This command will scan all related data of addresses by quering storage of account's System::Events.

Example:

./subwallet syncextrinsics
⠁ [00:00:00] [==>-------------------------------------]     500/782531

listextrinsics or listxts

Lists all downloaded extrinsics of address

Example:

./subwallet listextrinsics 15YRTixjLrknN97vqRoVQmmaagfWk2TsmFWqTj6RDfTS2SUE
677100-3   15YRTixjLrknN97vqRoVQmmaagfWk2TsmFWqTj6RDfTS2SUE        Utility::batch                 ✅
656219-3   15YRTixjLrknN97vqRoVQmmaagfWk2TsmFWqTj6RDfTS2SUE        Staking::payout_stakers        ❌
631650-3   15YRTixjLrknN97vqRoVQmmaagfWk2TsmFWqTj6RDfTS2SUE        Utility::batch                 ✅
631648-3   15YRTixjLrknN97vqRoVQmmaagfWk2TsmFWqTj6RDfTS2SUE        Utility::batch                 ✅
...

watchaddress

Add watchonly address to local storage.

./subwallet watchaddress 13EAmr66rhEEXD8mq5wiqvJ2aHibBYebF1ys9JRi1qyVjQyk
`13EAmr66rhEEXD8mq5wiqvJ2aHibBYebF1ys9JRi1qyVjQyk` is added

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/yxf/subwallet

License

MIT

subwallet's People

Contributors

yxf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

subwallet's Issues

Error setrpcurl

setting to selendra node not support and can't get specific error!

./subwallet setrpcurl wss://rpc-testnet.selendra.org

and it's show the following error:

thread 'main' panicked at 'no entry found for key', src/main.rs:250:30
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I have take a look at the code nothing should be change to support please advised.
Thank you!

Transaction has a bad signature

./subwallet transfer 12g7CMKtepkZuE7xDvstNLz2Xf2ZYR7KrZ6VCrVoFqiAT1Vi 15ayVvcXf8YK82U85EPJiFpkb2wmLMUjZK131H2p3C9yDean 4.84

Error: Rpc(Request(Error { code: MethodError(1010), message: "Invalid Transaction", data: Some(String("Transaction has a bad signature")) }))

./subwallet --version
subwallet 0.1.3

Fail to compile

The following error occurs when run cargo +nightly install subwallet
error[E0599]: no function or associated item named from_path found for struct Database<Wallet, FileBackend, rustbreak::deser::Bincode> in the current scope
--> /home/shapeare/.cargo/registry/src/github.com-1ecc6299db9ec823/subwallet-0.1.0/src/wallet.rs:360:45
|
360 | let db = FileDatabase::<Wallet, Bincode>::from_path(file, backend).expect("Failed to initialize file database.");
| ^^^^^^^^^
| |
| function or associated item not found in Database<Wallet, FileBackend, rustbreak::deser::Bincode>
| help: there is an associated function with a similar name: from_parts

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.