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

Public Member Functions

 rentcpu_subcommand (CLI::App *actionRoot)
 

Public Attributes

string from_str
 
string receiver_str
 
string loan_payment_str
 
string loan_fund_str
 
const name act_name { "rentcpu"_n }
 

Detailed Description

Definition at line 1959 of file main.cpp.

Constructor & Destructor Documentation

◆ rentcpu_subcommand()

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

Definition at line 1966 of file main.cpp.

1966 {
1967 auto rentcpu = actionRoot->add_subcommand("rentcpu", localized("Rent CPU bandwidth for 30 days"));
1968 rentcpu->add_option("from", from_str, localized("Account paying rent fees"))->required();
1969 rentcpu->add_option("receiver", receiver_str, localized("Account to whom rented CPU bandwidth is staked"))->required();
1970 rentcpu->add_option("loan_payment", loan_payment_str, localized("Loan fee to be paid, used to calculate amount of rented bandwidth"))->required();
1971 rentcpu->add_option("loan_fund", loan_fund_str, localized("Loan fund to be used in automatic renewal, can be 0 tokens"))->required();
1972 add_standard_transaction_options(rentcpu, "from@active");
1973 rentcpu->callback([this] {
1975 ("from", from_str)
1976 ("receiver", receiver_str)
1977 ("loan_payment", loan_payment_str)
1978 ("loan_fund", loan_fund_str);
1979 auto accountPermissions = get_account_permissions(tx_permission, {name(from_str), config::active_name});
1980 send_actions({create_action(accountPermissions, config::system_account_name, act_name, act_payload)});
1981 });
1982 }
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
string loan_fund_str
Definition main.cpp:1963
string receiver_str
Definition main.cpp:1961
const name act_name
Definition main.cpp:1964
string loan_payment_str
Definition main.cpp:1962
Here is the call graph for this function:

Member Data Documentation

◆ act_name

const name rentcpu_subcommand::act_name { "rentcpu"_n }

Definition at line 1964 of file main.cpp.

1964{ "rentcpu"_n };

◆ from_str

string rentcpu_subcommand::from_str

Definition at line 1960 of file main.cpp.

◆ loan_fund_str

string rentcpu_subcommand::loan_fund_str

Definition at line 1963 of file main.cpp.

◆ loan_payment_str

string rentcpu_subcommand::loan_payment_str

Definition at line 1962 of file main.cpp.

◆ receiver_str

string rentcpu_subcommand::receiver_str

Definition at line 1961 of file main.cpp.


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