diff --git a/wallet/src/cli/account.rs b/wallet/src/cli/account.rs index 06218fe..54e383a 100644 --- a/wallet/src/cli/account.rs +++ b/wallet/src/cli/account.rs @@ -69,14 +69,16 @@ impl TokenHolding { ///Represents generic chain CLI subcommand #[derive(Subcommand, Debug, Clone)] pub enum AccountSubcommand { - ///Get + ///Get account data Get { - #[arg(long)] + ///Flag to get raw account data + #[arg(short, long)] raw: bool, + ///Valid 32 byte base58 string with privacy prefix #[arg(short, long)] addr: String, }, - ///New + ///Produce new public or private account #[command(subcommand)] New(NewSubcommand), ///Sync private accounts @@ -260,7 +262,7 @@ impl WalletSubcommand for AccountSubcommand { .is_empty() { parse_block_range( - last_synced_block, + last_synced_block + 1, curr_last_block, wallet_core.sequencer_client.clone(), wallet_core, diff --git a/wallet/src/cli/chain.rs b/wallet/src/cli/chain.rs index aec2c9a..a6e7999 100644 --- a/wallet/src/cli/chain.rs +++ b/wallet/src/cli/chain.rs @@ -6,12 +6,16 @@ use crate::{SubcommandReturnValue, WalletCore, cli::WalletSubcommand}; ///Represents generic chain CLI subcommand #[derive(Subcommand, Debug, Clone)] pub enum ChainSubcommand { + ///Get current block id from sequencer CurrentBlockId {}, + ///Get block at id from sequencer Block { #[arg(short, long)] id: u64, }, + ///Get transaction at hash from sequencer Transaction { + ///hash - valid 32 byte hex string #[arg(short, long)] hash: String, }, diff --git a/wallet/src/cli/native_token_transfer_program.rs b/wallet/src/cli/native_token_transfer_program.rs index 19e8368..73243d2 100644 --- a/wallet/src/cli/native_token_transfer_program.rs +++ b/wallet/src/cli/native_token_transfer_program.rs @@ -12,22 +12,28 @@ use crate::{ ///Represents generic CLI subcommand for a wallet working with native token transfer program #[derive(Subcommand, Debug, Clone)] pub enum AuthTransferSubcommand { + ///Initialize account under authenticated transfer program Init { - ///addr - valid 32 byte base58 string + ///addr - valid 32 byte base58 string with privacy prefix #[arg(long)] addr: String, }, + ///Send native tokens from one account to another with variable privacy + /// + ///If receiver is private, then `to` and (`to_npk` , `to_ipk`) is a mutually exclusive patterns. + /// + ///First is used for owned accounts, second otherwise. Send { - ///from - valid 32 byte base58 string + ///from - valid 32 byte base58 string with privacy prefix #[arg(long)] from: String, - ///to - valid 32 byte base58 string + ///to - valid 32 byte base58 string with privacy prefix #[arg(long)] to: Option, - ///to_npk - valid 32 byte base58 string + ///to_npk - valid 32 byte hex string #[arg(long)] to_npk: Option, - ///to_ipk - valid 33 byte base58 string + ///to_ipk - valid 33 byte hex string #[arg(long)] to_ipk: Option, ///amount - amount of balance to move diff --git a/wallet/src/cli/pinata_program.rs b/wallet/src/cli/pinata_program.rs index 6e79362..fafd5f1 100644 --- a/wallet/src/cli/pinata_program.rs +++ b/wallet/src/cli/pinata_program.rs @@ -12,9 +12,9 @@ use crate::{ ///Represents generic CLI subcommand for a wallet working with pinata program #[derive(Subcommand, Debug, Clone)] pub enum PinataProgramAgnosticSubcommand { - ///Claim + ///Claim pinata Claim { - ///to_addr - valid 32 byte base58 string + ///to_addr - valid 32 byte base58 string with privacy prefix #[arg(long)] to_addr: String, ///solution - solution to pinata challenge diff --git a/wallet/src/cli/token_program.rs b/wallet/src/cli/token_program.rs index 99ebecd..e077efb 100644 --- a/wallet/src/cli/token_program.rs +++ b/wallet/src/cli/token_program.rs @@ -12,11 +12,14 @@ use crate::{ ///Represents generic CLI subcommand for a wallet working with token program #[derive(Subcommand, Debug, Clone)] pub enum TokenProgramAgnosticSubcommand { + ///Produce new ERC-20 token + /// + ///Currently the only supported privacy options is for public definition New { - ///addr - valid 32 byte base58 string + ///definition_addr - valid 32 byte base58 string with privacy prefix #[arg(long)] definition_addr: String, - ///addr - valid 32 byte base58 string + ///supply_addr - valid 32 byte base58 string with privacy prefix #[arg(long)] supply_addr: String, #[arg(short, long)] @@ -24,11 +27,16 @@ pub enum TokenProgramAgnosticSubcommand { #[arg(short, long)] total_supply: u128, }, + ///Send tokens from one account to another with variable privacy + /// + ///If receiver is private, then `to` and (`to_npk` , `to_ipk`) is a mutually exclusive patterns. + /// + ///First is used for owned accounts, second otherwise. Send { - ///from - valid 32 byte base58 string + ///from - valid 32 byte base58 string with privacy prefix #[arg(long)] from: String, - ///to - valid 32 byte base58 string + ///to - valid 32 byte base58 string with privacy prefix #[arg(long)] to: Option, ///to_npk - valid 32 byte hex string diff --git a/wallet/src/lib.rs b/wallet/src/lib.rs index 8b9ec78..dc17292 100644 --- a/wallet/src/lib.rs +++ b/wallet/src/lib.rs @@ -198,27 +198,32 @@ impl WalletCore { #[derive(Subcommand, Debug, Clone)] #[clap(about)] pub enum Command { - ///Transfer command + ///Authenticated transfer subcommand #[command(subcommand)] AuthTransfer(AuthTransferSubcommand), - ///Chain command + ///Generic chain info subcommand #[command(subcommand)] ChainInfo(ChainSubcommand), - ///Chain command + ///Account view and sync subcommand #[command(subcommand)] Account(AccountSubcommand), - ///Pinata command + ///Pinata program interaction subcommand #[command(subcommand)] Pinata(PinataProgramAgnosticSubcommand), - ///Token command + ///Token program interaction subcommand #[command(subcommand)] Token(TokenProgramAgnosticSubcommand), - // Check the wallet can connect to the node and builtin local programs - // match the remote versions + /// Check the wallet can connect to the node and builtin local programs + /// match the remote versions CheckHealth {}, } ///To execute commands, env var NSSA_WALLET_HOME_DIR must be set into directory with config +/// +/// All account adresses must be valid 32 byte base58 strings. +/// +/// All account addresses must be provided as {privacy_prefix}/{addr}, +/// where valid options for `privacy_prefix` is `Public` and `Private` #[derive(Parser, Debug)] #[clap(version, about)] pub struct Args {