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

Public Member Functions

 sellram_subcommand (CLI::App *actionRoot)
 

Public Attributes

string from_str
 
string receiver_str
 
uint64_t amount
 

Detailed Description

Definition at line 1715 of file main.cpp.

Constructor & Destructor Documentation

◆ sellram_subcommand()

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

Definition at line 1720 of file main.cpp.

1720 {
1721 auto sellram = actionRoot->add_subcommand("sellram", localized("Sell RAM"));
1722 sellram->add_option("account", receiver_str, localized("The account to receive tokens for sold RAM"))->required();
1723 sellram->add_option("bytes", amount, localized("The amount of RAM bytes to sell"))->required();
1724 add_standard_transaction_options(sellram, "account@active");
1725
1726 sellram->callback([this] {
1728 ("account", receiver_str)
1729 ("bytes", amount);
1730 auto accountPermissions = get_account_permissions(tx_permission, {name(receiver_str), config::active_name});
1731 send_actions({create_action(accountPermissions, config::system_account_name, "sellram"_n, act_payload)});
1732 });
1733 }
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 receiver_str
Definition main.cpp:1717
uint64_t amount
Definition main.cpp:1718
Here is the call graph for this function:

Member Data Documentation

◆ amount

uint64_t sellram_subcommand::amount

Definition at line 1718 of file main.cpp.

◆ from_str

string sellram_subcommand::from_str

Definition at line 1716 of file main.cpp.

◆ receiver_str

string sellram_subcommand::receiver_str

Definition at line 1717 of file main.cpp.


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