Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
undelegate_bandwidth_subcommand Struct Reference

Public Member Functions

 undelegate_bandwidth_subcommand (CLI::App *actionRoot)
 

Public Attributes

string from_str
 
string receiver_str
 
string unstake_net_amount
 
string unstake_cpu_amount
 
uint64_t unstake_storage_bytes
 

Detailed Description

Definition at line 1563 of file main.cpp.

Constructor & Destructor Documentation

◆ undelegate_bandwidth_subcommand()

undelegate_bandwidth_subcommand::undelegate_bandwidth_subcommand ( CLI::App * actionRoot)
inline

Definition at line 1570 of file main.cpp.

1570 {
1571 auto undelegate_bandwidth = actionRoot->add_subcommand("undelegatebw", localized("Undelegate bandwidth"));
1572 undelegate_bandwidth->add_option("from", from_str, localized("The account undelegating bandwidth"))->required();
1573 undelegate_bandwidth->add_option("receiver", receiver_str, localized("The account to undelegate bandwidth from"))->required();
1574 undelegate_bandwidth->add_option("unstake_net_quantity", unstake_net_amount, localized("The amount of tokens to undelegate for network bandwidth"))->required();
1575 undelegate_bandwidth->add_option("unstake_cpu_quantity", unstake_cpu_amount, localized("The amount of tokens to undelegate for CPU bandwidth"))->required();
1576 add_standard_transaction_options(undelegate_bandwidth, "from@active");
1577
1578 undelegate_bandwidth->callback([this] {
1580 ("from", from_str)
1581 ("receiver", receiver_str)
1582 ("unstake_net_quantity", to_asset(unstake_net_amount))
1583 ("unstake_cpu_quantity", to_asset(unstake_cpu_amount));
1584 auto accountPermissions = get_account_permissions(tx_permission, {name(from_str), config::active_name});
1585 send_actions({create_action(accountPermissions, config::system_account_name, "undelegatebw"_n, act_payload)});
1586 });
1587 }
std::string name
App * add_subcommand(std::string subcommand_name="", std::string subcommand_description="")
Add a subcommand. Inherits INHERITABLE and OptionDefaults, and help flag.
Definition CLI11.hpp:5538
Option * add_option(std::string option_name, callback_t option_callback, std::string option_description="", bool defaulted=false, std::function< std::string()> func={})
Definition CLI11.hpp:5099
CRTP * required(bool value=true)
Set the option as required.
Definition CLI11.hpp:3400
An order-preserving dictionary of variants.
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition variant.hpp:191
#define localized(str,...)
Definition localize.hpp:10
chain::action create_action(const vector< permission_level > &authorization, const account_name &code, const action_name &act, const fc::variant &args)
Definition main.cpp:683
asset to_asset(account_name code, const string &s)
Definition main.cpp:812
vector< chain::permission_level > get_account_permissions(const vector< string > &permissions)
Definition main.cpp:238
void add_standard_transaction_options(CLI::App *cmd, string default_permission="")
Definition main.cpp:202
void send_actions(std::vector< chain::action > &&actions, packed_transaction::compression_type compression=packed_transaction::compression_type::none)
Definition main.cpp:616
vector< string > tx_permission
Definition main.cpp:198
Here is the call graph for this function:

Member Data Documentation

◆ from_str

string undelegate_bandwidth_subcommand::from_str

Definition at line 1564 of file main.cpp.

◆ receiver_str

string undelegate_bandwidth_subcommand::receiver_str

Definition at line 1565 of file main.cpp.

◆ unstake_cpu_amount

string undelegate_bandwidth_subcommand::unstake_cpu_amount

Definition at line 1567 of file main.cpp.

◆ unstake_net_amount

string undelegate_bandwidth_subcommand::unstake_net_amount

Definition at line 1566 of file main.cpp.

◆ unstake_storage_bytes

uint64_t undelegate_bandwidth_subcommand::unstake_storage_bytes

Definition at line 1568 of file main.cpp.


The documentation for this struct was generated from the following file: