Newer
Older
use sp_core::{sr25519::Pair, Pair as _};
use subxt::blocks::ExtrinsicEvents;
use subxt::tx::{BaseExtrinsicParamsBuilder, PairSigner, TxStatus};
#[clap(subcommand)]
pub subcommand: Subcommand,
#[clap(short, long)]
indexer: Option<String>,
/// Do not use indexer
#[clap(long)]
no_indexer: bool,
/// Secret key or BIP39 mnemonic
/// (eventually followed by derivation path)
#[clap(short, long)]
secret: Option<String>,
/// Secret key format (seed, substrate)
#[clap(short = 'S', long, default_value = SecretFormat::Substrate)]
secret_format: SecretFormat,
/// Address
#[clap(short, long)]
address: Option<String>,
/// Overwrite duniter websocket RPC endpoint
#[clap(short, long)]
url: Option<String>,
/// Target network (local, gdev, gtest...)
#[clap(short, long)]
network: Option<String>,
#[clap(hide = true)]
DoNothing,
/// Account (balance, transfer...)
#[clap(subcommand)]
Account(commands::account::Subcommand),
/// Identity (get, create, confirm, revoke...)
#[clap(subcommand)]
Identity(commands::identity::Subcommand),
/// Smith (certify, go-online, go-offline...)
/// Tech (list members, proposals, vote...)
#[clap(subcommand)]
Tech(commands::collective::Subcommand),
/// Universal Dividend (claim...)
#[clap(subcommand)]
Ud(commands::ud::Subcommand),
/// Oneshot account (balance, create, consume...)
#[clap(subcommand)]
Oneshot(commands::oneshot::Subcommand),
/// Blockchain (current block, runtime info...)
#[clap(subcommand)]
Blockchain(commands::blockchain::Subcommand),
/// Indexer (check, latest block)
Indexer(indexer::Subcommand),
let data = Data::new(Args::parse());
match data.args.subcommand.clone() {
Subcommand::DoNothing => {}
Subcommand::Account(subcommand) => {
commands::account::handle_command(data, subcommand).await?
}
Subcommand::Identity(subcommand) => {
commands::identity::handle_command(data, subcommand).await?
}
Subcommand::Smith(subcommand) => commands::smith::handle_command(data, subcommand).await?,
Subcommand::Tech(subcommand) => {
commands::collective::handle_command(data, subcommand).await?
}
Subcommand::Ud(subcommand) => commands::ud::handle_command(data, subcommand).await?,
Subcommand::Oneshot(subcommand) => {
commands::oneshot::handle_command(data, subcommand).await?
}
Subcommand::Blockchain(subcommand) => {
commands::blockchain::handle_command(data, subcommand).await?
}
Subcommand::Indexer(subcommand) => indexer::handle_command(data, subcommand).await?,
Subcommand::Config(subcommand) => conf::handle_command(data, subcommand)?,