mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-02 13:23:10 +00:00
doc: cli docs added
This commit is contained in:
parent
5840f9b779
commit
785ed5f169
@ -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,
|
||||
|
||||
@ -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,
|
||||
},
|
||||
|
||||
@ -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<String>,
|
||||
///to_npk - valid 32 byte base58 string
|
||||
///to_npk - valid 32 byte hex string
|
||||
#[arg(long)]
|
||||
to_npk: Option<String>,
|
||||
///to_ipk - valid 33 byte base58 string
|
||||
///to_ipk - valid 33 byte hex string
|
||||
#[arg(long)]
|
||||
to_ipk: Option<String>,
|
||||
///amount - amount of balance to move
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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<String>,
|
||||
///to_npk - valid 32 byte hex string
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user