Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
unstaketorex_subcommand Struct Reference
Collaboration diagram for unstaketorex_subcommand:

Public Member Functions

 unstaketorex_subcommand (CLI::App *actionRoot)
 

Public Attributes

string owner_str
 
string receiver_str
 
string from_net_str
 
string from_cpu_str
 
const name act_name { "unstaketorex"_n }
 

Detailed Description

Definition at line 1897 of file main.cpp.

Constructor & Destructor Documentation

◆ unstaketorex_subcommand()

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

Definition at line 1904 of file main.cpp.

1904 {
1905 auto unstaketorex = actionRoot->add_subcommand("unstaketorex", localized("Buy REX using staked tokens"));
1906 unstaketorex->add_option("owner", owner_str, localized("Account buying REX tokens"))->required();
1907 unstaketorex->add_option("receiver", receiver_str, localized("Account that tokens have been staked to"))->required();
1908 unstaketorex->add_option("from_net", from_net_str, localized("Amount to be unstaked from Net resources and used in REX purchase"))->required();
1909 unstaketorex->add_option("from_cpu", from_cpu_str, localized("Amount to be unstaked from CPU resources and used in REX purchase"))->required();
1910 add_standard_transaction_options(unstaketorex, "owner@active");
1911 unstaketorex->callback([this] {
1913 ("owner", owner_str)
1914 ("receiver", receiver_str)
1915 ("from_net", from_net_str)
1916 ("from_cpu", from_cpu_str);
1917 auto accountPermissions = get_account_permissions(tx_permission, {name(owner_str), config::active_name});
1918 send_actions({create_action(accountPermissions, config::system_account_name, act_name, act_payload)});
1919 });
1920 }
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
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

◆ act_name

const name unstaketorex_subcommand::act_name { "unstaketorex"_n }

Definition at line 1902 of file main.cpp.

1902{ "unstaketorex"_n };

◆ from_cpu_str

string unstaketorex_subcommand::from_cpu_str

Definition at line 1901 of file main.cpp.

◆ from_net_str

string unstaketorex_subcommand::from_net_str

Definition at line 1900 of file main.cpp.

◆ owner_str

string unstaketorex_subcommand::owner_str

Definition at line 1898 of file main.cpp.

◆ receiver_str

string unstaketorex_subcommand::receiver_str

Definition at line 1899 of file main.cpp.


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