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

Public Member Functions

 lendrex_subcommand (CLI::App *actionRoot)
 

Public Attributes

string from_str
 
string amount_str
 
const name act_name1 { "deposit"_n }
 
const name act_name2 { "buyrex"_n }
 

Detailed Description

Definition at line 1872 of file main.cpp.

Constructor & Destructor Documentation

◆ lendrex_subcommand()

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

Definition at line 1878 of file main.cpp.

1878 {
1879 auto lendrex = actionRoot->add_subcommand("lendrex", localized("Deposit tokens to REX fund and use the tokens to buy REX"));
1880 lendrex->add_option("from", from_str, localized("Account buying REX tokens"))->required();
1881 lendrex->add_option("amount", amount_str, localized("Amount of liquid tokens to be used in buying REX"))->required();
1882 add_standard_transaction_options(lendrex, "from@active");
1883 lendrex->callback([this] {
1885 ("owner", from_str)
1886 ("amount", amount_str);
1888 ("from", from_str)
1889 ("amount", amount_str);
1890 auto accountPermissions = get_account_permissions(tx_permission, {name(from_str), config::active_name});
1891 send_actions({create_action(accountPermissions, config::system_account_name, act_name1, act_payload1),
1892 create_action(accountPermissions, config::system_account_name, act_name2, act_payload2)});
1893 });
1894 }
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
const name act_name1
Definition main.cpp:1875
const name act_name2
Definition main.cpp:1876
Here is the call graph for this function:

Member Data Documentation

◆ act_name1

const name lendrex_subcommand::act_name1 { "deposit"_n }

Definition at line 1875 of file main.cpp.

1875{ "deposit"_n };

◆ act_name2

const name lendrex_subcommand::act_name2 { "buyrex"_n }

Definition at line 1876 of file main.cpp.

1876{ "buyrex"_n };

◆ amount_str

string lendrex_subcommand::amount_str

Definition at line 1874 of file main.cpp.

◆ from_str

string lendrex_subcommand::from_str

Definition at line 1873 of file main.cpp.


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