BitShares-Core  6.0.1
BitShares blockchain implementation and command-line interface software
Public Member Functions | Public Attributes | List of all members
graphene::wallet::wallet_api Class Reference

#include <wallet.hpp>

Public Member Functions

 wallet_api (const wallet_data &initial_data, fc::api< login_api > rapi)
 
virtual ~wallet_api ()
 
bool copy_wallet_file (string destination_filename)
 
fc::ecc::private_key derive_private_key (const std::string &prefix_string, int sequence_number) const
 
variant info ()
 
variant_object about () const
 
optional< signed_block_with_infoget_block (uint32_t num)
 
uint64_t get_account_count () const
 
vector< account_objectlist_my_accounts ()
 
map< string, account_id_type > list_accounts (const string &lowerbound, uint32_t limit)
 
vector< assetlist_account_balances (const string &account_name_or_id)
 
vector< extended_asset_objectlist_assets (const string &lowerbound, uint32_t limit) const
 
uint64_t get_asset_count () const
 
vector< operation_detailget_account_history (const string &account_name_or_id, uint32_t limit) const
 
vector< operation_detailget_relative_account_history (const string &account_name_or_id, uint32_t stop, uint32_t limit, uint32_t start) const
 
full_account get_full_account (const string &name_or_id)
 Fetch all objects relevant to the specified account. More...
 
vector< bucket_objectget_market_history (string symbol, string symbol2, uint32_t bucket, fc::time_point_sec start, fc::time_point_sec end) const
 Get OHLCV data of a trading pair in a time range. More...
 
vector< limit_order_objectget_account_limit_orders (const string &name_or_id, const string &base, const string &quote, uint32_t limit=101, optional< limit_order_id_type > ostart_id=optional< limit_order_id_type >(), optional< price > ostart_price=optional< price >())
 Fetch all orders relevant to the specified account sorted descendingly by price. More...
 
vector< limit_order_objectget_limit_orders (string a, string b, uint32_t limit) const
 Get limit orders in a given market. More...
 
vector< call_order_objectget_call_orders (string asset_symbol_or_id, uint32_t limit) const
 Get call orders (aka margin positions) for a given asset. More...
 
vector< force_settlement_objectget_settle_orders (string a, uint32_t limit) const
 Get forced settlement orders in a given asset. More...
 
vector< collateral_bid_objectget_collateral_bids (string asset_symbol_or_id, uint32_t limit=100, uint32_t start=0) const
 
global_property_object get_global_properties () const
 
account_history_operation_detail get_account_history_by_operations (const string &account_name_or_id, const flat_set< uint16_t > &operation_types, uint32_t start, uint32_t limit)
 
dynamic_global_property_object get_dynamic_global_properties () const
 
account_object get_account (string account_name_or_id) const
 
extended_asset_object get_asset (string asset_symbol_or_id) const
 
asset_bitasset_data_object get_bitasset_data (string asset_symbol_or_id) const
 
fc::optional< fc::variantget_htlc (string htlc_id) const
 
account_id_type get_account_id (string account_name_or_id) const
 
string get_account_name (const string &account_name_or_id) const
 
asset_id_type get_asset_id (const string &asset_symbol_or_id) const
 
string get_asset_symbol (const string &asset_symbol_or_id) const
 
string get_asset_name (const string &asset_symbol_or_id) const
 
variant get_object (object_id_type id) const
 
string get_wallet_filename () const
 
string get_private_key (public_key_type pubkey) const
 
transaction_handle_type begin_builder_transaction ()
 
void add_operation_to_builder_transaction (transaction_handle_type transaction_handle, const operation &op)
 
void replace_operation_in_builder_transaction (transaction_handle_type handle, unsigned operation_index, const operation &new_op)
 
asset set_fees_on_builder_transaction (transaction_handle_type handle, string fee_asset=GRAPHENE_SYMBOL)
 
transaction preview_builder_transaction (transaction_handle_type handle)
 
signed_transaction sign_builder_transaction (transaction_handle_type transaction_handle, bool broadcast=true)
 
signed_transaction sign_builder_transaction2 (transaction_handle_type transaction_handle, const vector< public_key_type > &signing_keys=vector< public_key_type >(), bool broadcast=true)
 
pair< transaction_id_type, signed_transaction > broadcast_transaction (signed_transaction tx)
 
signed_transaction propose_builder_transaction (transaction_handle_type handle, time_point_sec expiration=time_point::now()+fc::minutes(1), uint32_t review_period_seconds=0, bool broadcast=true)
 
signed_transaction propose_builder_transaction2 (transaction_handle_type handle, string account_name_or_id, time_point_sec expiration=time_point::now()+fc::minutes(1), uint32_t review_period_seconds=0, bool broadcast=true)
 
void remove_builder_transaction (transaction_handle_type handle)
 
bool is_new () const
 
bool is_locked () const
 
void lock ()
 
void unlock (string password)
 
void set_password (string password)
 
map< public_key_type, string > dump_private_keys ()
 
string help () const
 
string gethelp (const string &method) const
 
bool load_wallet_file (string wallet_filename="")
 
void quit ()
 
void save_wallet_file (string wallet_filename="")
 
void set_wallet_filename (string wallet_filename)
 
brain_key_info suggest_brain_key () const
 
vector< brain_key_infoderive_owner_keys_from_brain_key (string brain_key, int number_of_desired_keys=1) const
 
bool is_public_key_registered (string public_key) const
 
string serialize_transaction (signed_transaction tx) const
 
bool import_key (string account_name_or_id, string wif_key)
 
map< string, bool > import_accounts (string filename, string password)
 
bool import_account_keys (string filename, string password, string src_account_name, string dest_account_name)
 
vector< signed_transaction > import_balance (string account_name_or_id, const vector< string > &wif_keys, bool broadcast)
 
string normalize_brain_key (string s) const
 
signed_transaction register_account (string name, public_key_type owner, public_key_type active, string registrar_account, string referrer_account, uint32_t referrer_percent, bool broadcast=false)
 
signed_transaction upgrade_account (string account_name_or_id, bool broadcast)
 
signed_transaction create_account_with_brain_key (string brain_key, string account_name, string registrar_account, string referrer_account, bool broadcast=false)
 
signed_transaction transfer (string from, string to, string amount, string asset_symbol_or_id, string memo, bool broadcast=false)
 
pair< transaction_id_type, signed_transaction > transfer2 (const string &from, const string &to, const string &amount, const string &asset_symbol_or_id, const string &memo)
 
transaction_id_type get_transaction_id (const signed_transaction &trx) const
 
memo_data sign_memo (string from, string to, string memo)
 
string read_memo (const memo_data &memo)
 
signed_message sign_message (string signer, string message)
 
bool verify_message (string message, string account, int block, const string &time, compact_signature sig)
 
bool verify_signed_message (signed_message message)
 
bool verify_encapsulated_message (string message)
 
vector< blind_receiptblind_history (string key_or_account)
 
blind_receipt receive_blind_transfer (string confirmation_receipt, string opt_from, string opt_memo)
 
blind_confirmation transfer_to_blind (string from_account_name_or_id, string asset_symbol_or_id, vector< pair< string, string >> to_amounts, bool broadcast=false)
 
blind_confirmation transfer_from_blind (string from_blind_account_key_or_label, string to_account_name_or_id, string amount, string asset_symbol_or_id, bool broadcast=false)
 
blind_confirmation blind_transfer (string from_key_or_label, string to_key_or_label, string amount, string symbol_or_id, bool broadcast=false)
 
signed_transaction sell_asset (string seller_account, string amount_to_sell, string symbol_or_id_to_sell, string min_to_receive, string symbol_or_id_to_receive, uint32_t timeout_sec=0, bool fill_or_kill=false, bool broadcast=false)
 
signed_transaction borrow_asset (string borrower, string amount_to_borrow, string asset_symbol_or_id, string amount_of_collateral, bool broadcast=false)
 
signed_transaction borrow_asset_ext (string borrower, string amount_to_borrow, string asset_symbol_or_id, string amount_of_collateral, call_order_update_operation::extensions_type extensions, bool broadcast=false)
 
signed_transaction cancel_order (object_id_type order_id, bool broadcast=false)
 
signed_transaction create_asset (string issuer, string symbol, uint8_t precision, asset_options common, fc::optional< bitasset_options > bitasset_opts, bool broadcast=false)
 
signed_transaction issue_asset (string to_account, string amount, string symbol_or_id, string memo, bool broadcast=false)
 
signed_transaction update_asset (string symbol_or_id, optional< string > new_issuer, asset_options new_options, bool broadcast=false)
 
signed_transaction update_asset_issuer (string symbol_or_id, string new_issuer, bool broadcast=false)
 
signed_transaction update_bitasset (string symbol_or_id, bitasset_options new_options, bool broadcast=false)
 
signed_transaction update_asset_feed_producers (string symbol_or_id, flat_set< string > new_feed_producers, bool broadcast=false)
 
signed_transaction publish_asset_feed (string publishing_account, string symbol_or_id, price_feed feed, bool broadcast=false)
 
signed_transaction fund_asset_fee_pool (string from, string symbol_or_id, string amount, bool broadcast=false)
 
signed_transaction claim_asset_fee_pool (string symbol_or_id, string amount, bool broadcast=false)
 
signed_transaction reserve_asset (string from, string amount, string symbol_or_id, bool broadcast=false)
 
signed_transaction global_settle_asset (string symbol_or_id, price settle_price, bool broadcast=false)
 
signed_transaction settle_asset (string account_to_settle, string amount_to_settle, string symbol_or_id, bool broadcast=false)
 
signed_transaction bid_collateral (string bidder, string debt_amount, string debt_symbol_or_id, string additional_collateral, bool broadcast=false)
 
signed_transaction whitelist_account (string authorizing_account, string account_to_list, account_whitelist_operation::account_listing new_listing_status, bool broadcast=false)
 
signed_transaction create_committee_member (string owner_account, string url, bool broadcast=false)
 
map< string, witness_id_type > list_witnesses (const string &lowerbound, uint32_t limit)
 
map< string, committee_member_id_type > list_committee_members (const string &lowerbound, uint32_t limit)
 
witness_object get_witness (string owner_account)
 
committee_member_object get_committee_member (string owner_account)
 
signed_transaction create_witness (string owner_account, string url, bool broadcast=false)
 
signed_transaction update_witness (string witness_name, string url, string block_signing_key, bool broadcast=false)
 
signed_transaction create_worker (string owner_account, time_point_sec work_begin_date, time_point_sec work_end_date, share_type daily_pay, string name, string url, variant worker_settings, bool broadcast=false)
 
signed_transaction update_worker_votes (string account, worker_vote_delta delta, bool broadcast=false)
 
signed_transaction htlc_create (string source, string destination, string amount, string asset_symbol_or_id, string hash_algorithm, const std::string &preimage_hash, uint32_t preimage_size, const uint32_t claim_period_seconds, const std::string &memo, bool broadcast=false)
 
signed_transaction htlc_redeem (string htlc_id, string issuer, const std::string &preimage, bool broadcast=false)
 
signed_transaction htlc_extend (string htlc_id, string issuer, const uint32_t seconds_to_add, bool broadcast=false)
 
vector< vesting_balance_object_with_infoget_vesting_balances (string account_name)
 
signed_transaction withdraw_vesting (string witness_name, string amount, string asset_symbol_or_id, bool broadcast=false)
 
signed_transaction vote_for_committee_member (string voting_account, string committee_member, bool approve, bool broadcast=false)
 
signed_transaction vote_for_witness (string voting_account, string witness, bool approve, bool broadcast=false)
 
signed_transaction set_voting_proxy (string account_to_modify, optional< string > voting_account, bool broadcast=false)
 
signed_transaction set_desired_witness_and_committee_member_count (string account_to_modify, uint16_t desired_number_of_witnesses, uint16_t desired_number_of_committee_members, bool broadcast=false)
 
signed_transaction sign_transaction (signed_transaction tx, bool broadcast=false)
 
signed_transaction sign_transaction2 (signed_transaction tx, const vector< public_key_type > &signing_keys=vector< public_key_type >(), bool broadcast=true)
 
flat_set< public_key_type > get_transaction_signers (const signed_transaction &tx) const
 
vector< flat_set< account_id_type > > get_key_references (const vector< public_key_type > &keys) const
 
operation get_prototype_operation (string operation_type)
 
signed_transaction propose_parameter_change (const string &proposing_account, fc::time_point_sec expiration_time, const variant_object &changed_values, bool broadcast=false)
 
signed_transaction propose_fee_change (const string &proposing_account, fc::time_point_sec expiration_time, const variant_object &changed_values, bool broadcast=false)
 
signed_transaction approve_proposal (const string &fee_paying_account, const string &proposal_id, const approval_delta &delta, bool broadcast)
 
order_book get_order_book (const string &base, const string &quote, unsigned limit=50)
 
signed_transaction add_transaction_signature (signed_transaction tx, bool broadcast=false)
 
void dbg_make_uia (string creator, string symbol)
 
void dbg_make_mia (string creator, string symbol)
 
void dbg_push_blocks (std::string src_filename, uint32_t count)
 
void dbg_generate_blocks (std::string debug_wif_key, uint32_t count)
 
void dbg_stream_json_objects (const std::string &filename)
 
void dbg_update_object (fc::variant_object update)
 
void flood_network (string prefix, uint32_t number_of_transactions)
 
void network_add_nodes (const vector< string > &nodes)
 
vector< variantnetwork_get_connected_peers ()
 
blind_confirmation blind_transfer_help (string from_key_or_label, string to_key_or_label, string amount, string symbol, bool broadcast=false, bool to_temp=false)
 
std::map< string, std::function< string(fc::variant, const fc::variants &)> > get_result_formatters () const
 
void encrypt_keys ()
 
signed_transaction account_store_map (string account, string catalog, bool remove, flat_map< string, optional< string >> key_values, bool broadcast)
 
vector< account_storage_objectget_account_storage (string account, string catalog)
 
bool set_key_label (public_key_type key, string label)
 
string get_key_label (public_key_type key) const
 
public_key_type create_blind_account (string label, string brain_key)
 
vector< assetget_blind_balances (string key_or_label)
 
map< string, public_key_type > get_blind_accounts () const
 
map< string, public_key_type > get_my_blind_accounts () const
 
public_key_type get_public_key (string label) const
 

Public Attributes

fc::signal< void(bool)> lock_changed
 
std::shared_ptr< detail::wallet_api_implmy
 

Detailed Description

This wallet assumes it is connected to the database server with a high-bandwidth, low-latency connection and performs minimal caching. This API could be provided locally to be used by a web interface.

Definition at line 50 of file wallet.hpp.

Constructor & Destructor Documentation

◆ wallet_api()

graphene::wallet::wallet_api::wallet_api ( const wallet_data initial_data,
fc::api< login_api rapi 
)

Definition at line 153 of file wallet.cpp.

◆ ~wallet_api()

graphene::wallet::wallet_api::~wallet_api ( )
virtual

Definition at line 158 of file wallet.cpp.

Member Function Documentation

◆ about()

variant_object graphene::wallet::wallet_api::about ( ) const

Returns info such as client version, git version of graphene/fc, version of boost, openssl.

Returns
compile time info and client and dependencies versions

Definition at line 756 of file wallet.cpp.

◆ account_store_map()

signed_transaction graphene::wallet::wallet_api::account_store_map ( string  account,
string  catalog,
bool  remove,
flat_map< string, optional< string >>  key_values,
bool  broadcast 
)

Manage account storage map(key->value) by using the custom operations plugin.

Each account can optionally add random information in the form of a key-value map to be retrieved by any interested party.

Parameters
accountThe account name or ID that we are adding additional information to.
catalogThe name of the catalog the operation will insert data to.
removetrue if you want to remove stuff from a catalog.
key_valuesThe map to be inserted/removed to/from the catalog
broadcasttrue if you wish to broadcast the transaction
Returns
The signed transaction

Definition at line 1924 of file wallet.cpp.

◆ add_operation_to_builder_transaction()

void graphene::wallet::wallet_api::add_operation_to_builder_transaction ( transaction_handle_type  transaction_handle,
const operation &  op 
)

Append a new operation to a transaction builder.

Parameters
transaction_handlehandle of the transaction builder
opthe operation in JSON format

Definition at line 509 of file wallet.cpp.

◆ add_transaction_signature()

signed_transaction graphene::wallet::wallet_api::add_transaction_signature ( signed_transaction  tx,
bool  broadcast = false 
)

Signs a transaction.

Given a fully-formed transaction with or without signatures, signs the transaction with the owned keys and optionally broadcasts the transaction.

Parameters
txthe unsigned transaction
broadcasttrue if you wish to broadcast the transaction
Returns
the signed transaction

Definition at line 1128 of file wallet.cpp.

◆ approve_proposal()

signed_transaction graphene::wallet::wallet_api::approve_proposal ( const string &  fee_paying_account,
const string &  proposal_id,
const approval_delta delta,
bool  broadcast 
)

Approve or disapprove a proposal.

Parameters
fee_paying_accountThe account paying the fee for the op.
proposal_idThe proposal to modify.
deltaMembers contain approvals to create or remove. In JSON you can leave empty members undefined.
broadcasttrue if you wish to broadcast the transaction
Returns
the signed version of the transaction

Definition at line 1108 of file wallet.cpp.

◆ begin_builder_transaction()

transaction_handle_type graphene::wallet::wallet_api::begin_builder_transaction ( )

Create a new transaction builder.

Returns
handle of the new transaction builder

Definition at line 504 of file wallet.cpp.

◆ bid_collateral()

signed_transaction graphene::wallet::wallet_api::bid_collateral ( string  bidder,
string  debt_amount,
string  debt_symbol_or_id,
string  additional_collateral,
bool  broadcast = false 
)

Creates or updates a bid on an MPA after global settlement.

In order to revive a market-pegged asset after global settlement (aka black swan), investors can bid collateral in order to take over part of the debt and the settlement fund, see BSIP-0018. Updating an existing bid to cover 0 debt will delete the bid.

Parameters
bidderthe name or id of the account making the bid
debt_amountthe amount of debt of the named asset to bid for
debt_symbol_or_idthe symbol or id of the MPA to bid for
additional_collateralthe amount of additional collateral to bid for taking over debt_amount. The asset type of this amount is determined automatically from debt_symbol_or_id.
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction creating/updating the bid

Definition at line 883 of file wallet.cpp.

◆ blind_history()

vector< blind_receipt > graphene::wallet::wallet_api::blind_history ( string  key_or_account)

Get all blind receipts to/form a particular account

Parameters
key_or_accounta public key in Base58 format or an account
Returns
all blind receipts to/form the account

Definition at line 1900 of file wallet.cpp.

◆ blind_transfer()

blind_confirmation graphene::wallet::wallet_api::blind_transfer ( string  from_key_or_label,
string  to_key_or_label,
string  amount,
string  symbol_or_id,
bool  broadcast = false 
)

Transfer from one set of blinded balances to another.

Parameters
from_key_or_labela public key in Base58 format or a label to transfer from
to_key_or_labela public key in Base58 format or a label to transfer to
amountthe amount to be transferred
symbol_or_idsymbol or ID of the asset to be transferred
broadcasttrue to broadcast the transaction on the network
Returns
a blind confirmation

Definition at line 1550 of file wallet.cpp.

◆ blind_transfer_help()

blind_confirmation graphene::wallet::wallet_api::blind_transfer_help ( string  from_key_or_label,
string  to_key_or_label,
string  amount,
string  symbol,
bool  broadcast = false,
bool  to_temp = false 
)

Used to transfer from one set of blinded balances to another

commitments must be in sorted order

Definition at line 1558 of file wallet.cpp.

◆ borrow_asset()

signed_transaction graphene::wallet::wallet_api::borrow_asset ( string  borrower,
string  amount_to_borrow,
string  asset_symbol_or_id,
string  amount_of_collateral,
bool  broadcast = false 
)

Borrow an asset or update the debt/collateral ratio for the loan.

This is the first step in shorting an asset. Call sell_asset() to complete the short.

Parameters
borrowerthe name or id of the account associated with the transaction.
amount_to_borrowthe amount of the asset being borrowed. Make this value negative to pay back debt.
asset_symbol_or_idthe symbol or id of the asset being borrowed.
amount_of_collateralthe amount of the backing asset to add to your collateral position. Make this negative to claim back some of your collateral. The backing asset is defined in the bitasset_options for the asset being borrowed.
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction borrowing the asset

Definition at line 1313 of file wallet.cpp.

◆ borrow_asset_ext()

signed_transaction graphene::wallet::wallet_api::borrow_asset_ext ( string  borrower,
string  amount_to_borrow,
string  asset_symbol_or_id,
string  amount_of_collateral,
call_order_update_operation::extensions_type  extensions,
bool  broadcast = false 
)

Borrow an asset or update the debt/collateral ratio for the loan, with additional options.

This is the first step in shorting an asset. Call sell_asset() to complete the short.

Parameters
borrowerthe name or id of the account associated with the transaction.
amount_to_borrowthe amount of the asset being borrowed. Make this value negative to pay back debt.
asset_symbol_or_idthe symbol or id of the asset being borrowed.
amount_of_collateralthe amount of the backing asset to add to your collateral position. Make this negative to claim back some of your collateral. The backing asset is defined in the bitasset_options for the asset being borrowed.
extensionsadditional options
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction borrowing the asset

Definition at line 1320 of file wallet.cpp.

◆ broadcast_transaction()

pair< transaction_id_type, signed_transaction > graphene::wallet::wallet_api::broadcast_transaction ( signed_transaction  tx)

Broadcast signed transaction

Parameters
txsigned transaction
Returns
the transaction ID along with the signed transaction.

Definition at line 546 of file wallet.cpp.

◆ cancel_order()

signed_transaction graphene::wallet::wallet_api::cancel_order ( object_id_type  order_id,
bool  broadcast = false 
)

Cancel an existing order

Parameters
order_idthe id of order to be cancelled
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction canceling the order

Definition at line 1330 of file wallet.cpp.

◆ claim_asset_fee_pool()

signed_transaction graphene::wallet::wallet_api::claim_asset_fee_pool ( string  symbol_or_id,
string  amount,
bool  broadcast = false 
)

Claim funds from the fee pool for the given asset.

User-issued assets can optionally have a pool of the core asset which is automatically used to pay transaction fees for any transaction using that asset (using the asset's core exchange rate).

This command allows the issuer to withdraw those funds from the fee pool.

Parameters
symbol_or_idthe symbol or id of the asset whose fee pool you wish to claim
amountthe amount of the core asset to withdraw
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction claiming from the fee pool

Definition at line 853 of file wallet.cpp.

◆ copy_wallet_file()

bool graphene::wallet::wallet_api::copy_wallet_file ( string  destination_filename)

Definition at line 162 of file wallet.cpp.

◆ create_account_with_brain_key()

signed_transaction graphene::wallet::wallet_api::create_account_with_brain_key ( string  brain_key,
string  account_name,
string  registrar_account,
string  referrer_account,
bool  broadcast = false 
)

Creates a new account and registers it on the blockchain.

Todo:
why no referrer_percent here?
See also
suggest_brain_key()
register_account()
Parameters
brain_keythe brain key used for generating the account's private keys
account_namethe name of the account, must be unique on the blockchain. Names with only latin letters and at least one vowel are premium names and expensive to register. Names with only consonants, or at least with a digit, a dot or a minus sign are cheap.
registrar_accountthe account which will pay the fee to register the user
referrer_accountthe account who is acting as a referrer, and may receive a portion of the user's transaction fees. This can be the same as the registrar_account if there is no referrer.
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction registering the account

Definition at line 777 of file wallet.cpp.

◆ create_asset()

signed_transaction graphene::wallet::wallet_api::create_asset ( string  issuer,
string  symbol,
uint8_t  precision,
asset_options  common,
fc::optional< bitasset_options >  bitasset_opts,
bool  broadcast = false 
)

Creates a new user-issued or market-issued asset.

Many options can be changed later using update_asset()

Right now this function is difficult to use because you must provide raw JSON data structures for the options objects, and those include prices and asset ids.

Parameters
issuerthe name or id of the account who will pay the fee and become the issuer of the new asset. This can be updated later
symbolthe ticker symbol of the new asset
precisionthe number of digits of precision to the right of the decimal point, must be less than or equal to 12
commonasset options required for all new assets. Note that core_exchange_rate technically needs to store the asset ID of this new asset. Since this ID is not known at the time this operation is created, create this price as though the new asset has instance ID 1, and the chain will overwrite it with the new asset's ID.
bitasset_optsoptions specific to BitAssets. This may be null unless the market_issued flag is set in common.flags
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction creating a new asset

Definition at line 797 of file wallet.cpp.

◆ create_blind_account()

public_key_type graphene::wallet::wallet_api::create_blind_account ( string  label,
string  brain_key 
)

Generates a new blind account for the given brain key and assigns it the given label.

Parameters
labela label
brain_keythe brain key to be used to generate a new blind account
Returns
the public key of the new account

Definition at line 1436 of file wallet.cpp.

◆ create_committee_member()

signed_transaction graphene::wallet::wallet_api::create_committee_member ( string  owner_account,
string  url,
bool  broadcast = false 
)

Creates a committee_member object owned by the given account.

An account can have at most one committee_member object.

Parameters
owner_accountthe name or id of the account which is creating the committee_member
urla URL to include in the committee_member record in the blockchain. Clients may display this when showing a list of committee_members. May be blank.
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction registering a committee_member

Definition at line 899 of file wallet.cpp.

◆ create_witness()

signed_transaction graphene::wallet::wallet_api::create_witness ( string  owner_account,
string  url,
bool  broadcast = false 
)

Creates a witness object owned by the given account.

An account can have at most one witness object.

Parameters
owner_accountthe name or id of the account which is creating the witness
urla URL to include in the witness record in the blockchain. Clients may display this when showing a list of witnesses. May be blank.
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction registering a witness

Definition at line 925 of file wallet.cpp.

◆ create_worker()

signed_transaction graphene::wallet::wallet_api::create_worker ( string  owner_account,
time_point_sec  work_begin_date,
time_point_sec  work_end_date,
share_type  daily_pay,
string  name,
string  url,
variant  worker_settings,
bool  broadcast = false 
)

Create a worker object.

Parameters
owner_accountThe account which owns the worker and will be paid
work_begin_dateWhen the work begins
work_end_dateWhen the work ends
daily_payAmount of pay per day (NOT per maint interval)
nameAny text
urlAny text
worker_settings{"type" : "burn"|"refund"|"vesting", "pay_vesting_period_days" : x}
broadcasttrue if you wish to broadcast the transaction.
Returns
the signed transaction

Definition at line 932 of file wallet.cpp.

◆ dbg_generate_blocks()

void graphene::wallet::wallet_api::dbg_generate_blocks ( std::string  debug_wif_key,
uint32_t  count 
)

Definition at line 1057 of file wallet.cpp.

◆ dbg_make_mia()

void graphene::wallet::wallet_api::dbg_make_mia ( string  creator,
string  symbol 
)

Definition at line 1046 of file wallet.cpp.

◆ dbg_make_uia()

void graphene::wallet::wallet_api::dbg_make_uia ( string  creator,
string  symbol 
)

Definition at line 1040 of file wallet.cpp.

◆ dbg_push_blocks()

void graphene::wallet::wallet_api::dbg_push_blocks ( std::string  src_filename,
uint32_t  count 
)

Definition at line 1052 of file wallet.cpp.

◆ dbg_stream_json_objects()

void graphene::wallet::wallet_api::dbg_stream_json_objects ( const std::string &  filename)

Definition at line 1062 of file wallet.cpp.

◆ dbg_update_object()

void graphene::wallet::wallet_api::dbg_update_object ( fc::variant_object  update)

Definition at line 1067 of file wallet.cpp.

◆ derive_owner_keys_from_brain_key()

vector< brain_key_info > graphene::wallet::wallet_api::derive_owner_keys_from_brain_key ( string  brain_key,
int  number_of_desired_keys = 1 
) const

Derive any number of possible owner keys from a given brain key.

NOTE: These keys may or may not match with the owner keys of any account. This function is merely intended to assist with account or key recovery.

See also
suggest_brain_key()
Parameters
brain_keyBrain key
number_of_desired_keysNumber of desired keys
Returns
A list of keys that are deterministically derived from the brainkey

Definition at line 475 of file wallet.cpp.

◆ derive_private_key()

fc::ecc::private_key graphene::wallet::wallet_api::derive_private_key ( const std::string &  prefix_string,
int  sequence_number 
) const

Definition at line 761 of file wallet.cpp.

◆ dump_private_keys()

map< public_key_type, string > graphene::wallet::wallet_api::dump_private_keys ( )

Dumps all private keys owned by the wallet.

The keys are printed in WIF format. You can import these keys into another wallet using import_key()

Returns
a map containing the private keys, indexed by their public key

Definition at line 1289 of file wallet.cpp.

◆ encrypt_keys()

void graphene::wallet::wallet_api::encrypt_keys ( )

Definition at line 1245 of file wallet.cpp.

◆ flood_network()

void graphene::wallet::wallet_api::flood_network ( string  prefix,
uint32_t  number_of_transactions 
)

Definition at line 1082 of file wallet.cpp.

◆ fund_asset_fee_pool()

signed_transaction graphene::wallet::wallet_api::fund_asset_fee_pool ( string  from,
string  symbol_or_id,
string  amount,
bool  broadcast = false 
)

Pay into the fee pool for the given asset.

User-issued assets can optionally have a pool of the core asset which is automatically used to pay transaction fees for any transaction using that asset (using the asset's core exchange rate).

This command allows anyone to deposit the core asset into this fee pool.

Parameters
fromthe name or id of the account sending the core asset
symbol_or_idthe symbol or id of the asset whose fee pool you wish to fund
amountthe amount of the core asset to deposit
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction funding the fee pool

Definition at line 845 of file wallet.cpp.

◆ get_account()

account_object graphene::wallet::wallet_api::get_account ( string  account_name_or_id) const

Returns information about the given account.

Parameters
account_name_or_idthe name or ID of the account to provide information about
Returns
the public account data stored in the blockchain

Definition at line 575 of file wallet.cpp.

◆ get_account_count()

uint64_t graphene::wallet::wallet_api::get_account_count ( ) const

Returns the number of accounts registered on the blockchain

Returns
the number of registered accounts

Definition at line 172 of file wallet.cpp.

◆ get_account_history()

vector< operation_detail > graphene::wallet::wallet_api::get_account_history ( const string &  account_name_or_id,
uint32_t  limit 
) const

Returns the most recent operations on the named account.

This returns a list of operation history objects, which describe activity on the account.

Parameters
account_name_or_idthe name or id of the account
limitthe number of entries to return (starting from the most recent)
Returns
a list of operation_history_objects

Definition at line 279 of file wallet.cpp.

◆ get_account_history_by_operations()

account_history_operation_detail graphene::wallet::wallet_api::get_account_history_by_operations ( const string &  account_name_or_id,
const flat_set< uint16_t > &  operation_types,
uint32_t  start,
uint32_t  limit 
)

Get operations relevant to the specified account filtering by operation type, with transaction id

Parameters
account_name_or_idthe name or id of the account, whose history shoulde be queried
operation_typesThe IDs of the operation we want to get operations in the account ( 0 = transfer , 1 = limit order create, ...)
startthe sequence number where to start looping back throw the history
limitthe max number of entries to return (from start number)
Returns
account_history_operation_detail

Definition at line 377 of file wallet.cpp.

◆ get_account_id()

account_id_type graphene::wallet::wallet_api::get_account_id ( string  account_name_or_id) const

Lookup the id of a named account.

Parameters
account_name_or_idthe name or ID of the account to look up
Returns
the id of the named account

Definition at line 594 of file wallet.cpp.

◆ get_account_limit_orders()

vector< limit_order_object > graphene::wallet::wallet_api::get_account_limit_orders ( const string &  name_or_id,
const string &  base,
const string &  quote,
uint32_t  limit = 101,
optional< limit_order_id_type >  ostart_id = optional<limit_order_id_type>(),
optional< price >  ostart_price = optional<price>() 
)

Fetch all orders relevant to the specified account sorted descendingly by price.

Parameters
name_or_idThe name or ID of an account to retrieve
baseBase asset
quoteQuote asset
limitThe limitation of items each query can fetch (max: 101)
ostart_idStart order id, fetch orders which price are lower than or equal to this order
ostart_priceFetch orders with price lower than or equal to this price
Returns
List of orders from name_or_id to the corresponding account
Note
  1. if name_or_id cannot be tied to an account, empty result will be returned
  2. ostart_id and ostart_price can be null, if so the api will return the "first page" of orders; if ostart_id is specified and valid, its price will be used to do page query preferentially, otherwise the ostart_price will be used

Definition at line 439 of file wallet.cpp.

◆ get_account_name()

string graphene::wallet::wallet_api::get_account_name ( const string &  account_name_or_id) const
inline

Lookup the name of an account.

Parameters
account_name_or_idthe name or ID of the account to look up
Returns
the name of the account

Definition at line 294 of file wallet.hpp.

◆ get_account_storage()

vector< account_storage_object > graphene::wallet::wallet_api::get_account_storage ( string  account,
string  catalog 
)

Get account_storage_object of an account by using the custom operations plugin.

Storage data added to the map with account_store_map will be returned.

Parameters
accountAccount name or ID to get stored data from.
catalogThe catalog to retrieve.
Returns
An account_storage_object or empty.

Definition at line 1930 of file wallet.cpp.

◆ get_asset()

extended_asset_object graphene::wallet::wallet_api::get_asset ( string  asset_symbol_or_id) const

Returns information about the given asset.

Parameters
asset_symbol_or_idthe symbol or id of the asset in question
Returns
the information about the asset stored in the block chain

Definition at line 580 of file wallet.cpp.

◆ get_asset_count()

uint64_t graphene::wallet::wallet_api::get_asset_count ( ) const

Returns assets count registered on the blockchain.

Returns
assets count

Definition at line 197 of file wallet.cpp.

◆ get_asset_id()

asset_id_type graphene::wallet::wallet_api::get_asset_id ( const string &  asset_symbol_or_id) const

Lookup the id of an asset.

Parameters
asset_symbol_or_idthe symbol or ID of an asset to look up
Returns
the id of the given asset

Definition at line 599 of file wallet.cpp.

◆ get_asset_name()

string graphene::wallet::wallet_api::get_asset_name ( const string &  asset_symbol_or_id) const
inline

Lookup the symbol of an asset. Synonym of get_asset_symbol.

Parameters
asset_symbol_or_idthe symbol or ID of an asset to look up
Returns
the symbol of the given asset

Definition at line 317 of file wallet.hpp.

◆ get_asset_symbol()

string graphene::wallet::wallet_api::get_asset_symbol ( const string &  asset_symbol_or_id) const
inline

Lookup the symbol of an asset.

Parameters
asset_symbol_or_idthe symbol or ID of an asset to look up
Returns
the symbol of the given asset

Definition at line 309 of file wallet.hpp.

◆ get_bitasset_data()

asset_bitasset_data_object graphene::wallet::wallet_api::get_bitasset_data ( string  asset_symbol_or_id) const

Returns the BitAsset-specific data for a given asset. Market-issued assets's behavior are determined both by their "BitAsset Data" and their basic asset data, as returned by get_asset().

Parameters
asset_symbol_or_idthe symbol or id of the BitAsset in question
Returns
the BitAsset-specific data for this asset

Definition at line 587 of file wallet.cpp.

◆ get_blind_accounts()

map< string, public_key_type > graphene::wallet::wallet_api::get_blind_accounts ( ) const

Get all blind accounts.

Returns
all blind accounts

Definition at line 1417 of file wallet.cpp.

◆ get_blind_balances()

vector< asset > graphene::wallet::wallet_api::get_blind_balances ( string  key_or_label)

Return the total balances of all blinded commitments that can be claimed by the given account key or label.

Parameters
key_or_labela public key in Base58 format or a label
Returns
the total balances of all blinded commitments that can be claimed by the given account key or label

Definition at line 1456 of file wallet.cpp.

◆ get_block()

optional< signed_block_with_info > graphene::wallet::wallet_api::get_block ( uint32_t  num)

Returns info about a specified block.

Parameters
numheight of the block to retrieve
Returns
info about the block, or null if not found

Definition at line 167 of file wallet.cpp.

◆ get_call_orders()

vector< call_order_object > graphene::wallet::wallet_api::get_call_orders ( string  asset_symbol_or_id,
uint32_t  limit 
) const

Get call orders (aka margin positions) for a given asset.

Parameters
asset_symbol_or_idsymbol or ID of the debt asset
limitMaximum number of orders to retrieve
Returns
The call orders, ordered from earliest to be called to latest

Definition at line 455 of file wallet.cpp.

◆ get_collateral_bids()

vector< collateral_bid_object > graphene::wallet::wallet_api::get_collateral_bids ( string  asset_symbol_or_id,
uint32_t  limit = 100,
uint32_t  start = 0 
) const

Returns the collateral_bid object for the given MPA

Parameters
asset_symbol_or_idthe symbol or id of the asset
limitthe number of entries to return
startthe sequence number where to start looping back throw the history
Returns
a list of collateral_bid_objects

Definition at line 465 of file wallet.cpp.

◆ get_committee_member()

committee_member_object graphene::wallet::wallet_api::get_committee_member ( string  owner_account)

Returns information about the given committee_member.

Parameters
owner_accountthe name or id of the committee_member account owner, or the id of the committee_member
Returns
the information about the committee_member stored in the block chain

Definition at line 920 of file wallet.cpp.

◆ get_dynamic_global_properties()

dynamic_global_property_object graphene::wallet::wallet_api::get_dynamic_global_properties ( ) const

Returns the block chain's rapidly-changing properties. The returned object contains information that changes every block interval such as the head block number, the next witness, etc.

See also
get_global_properties() for less-frequently changing properties
Returns
the dynamic global properties

Definition at line 1123 of file wallet.cpp.

◆ get_full_account()

full_account graphene::wallet::wallet_api::get_full_account ( const string &  name_or_id)

Fetch all objects relevant to the specified account.

Parameters
name_or_idMust be the name or ID of an account to retrieve
Returns
All info about the specified account

This function fetches all relevant objects for the given account. If the string of name_or_id cannot be tied to an account, that input will be ignored.

Definition at line 424 of file wallet.cpp.

◆ get_global_properties()

global_property_object graphene::wallet::wallet_api::get_global_properties ( ) const

Returns the block chain's slowly-changing settings. This object contains all of the properties of the blockchain that are fixed or that change only once per maintenance interval (daily) such as the current list of witnesses, committee_members, block interval, etc.

See also
get_dynamic_global_properties() for frequently changing properties
Returns
the global properties

Definition at line 1118 of file wallet.cpp.

◆ get_htlc()

fc::optional< fc::variant > graphene::wallet::wallet_api::get_htlc ( string  htlc_id) const

Returns information about the given HTLC object.

Parameters
htlc_idthe id of the HTLC object.
Returns
the information about the HTLC object

Definition at line 210 of file wallet.cpp.

◆ get_key_label()

string graphene::wallet::wallet_api::get_key_label ( public_key_type  key) const

Get label of a public key.

Parameters
keya public key
Returns
the label if already set by set_key_label(), or an empty string if not set

Definition at line 1380 of file wallet.cpp.

◆ get_key_references()

vector< flat_set< account_id_type > > graphene::wallet::wallet_api::get_key_references ( const vector< public_key_type > &  keys) const

Get key references.

Returns accounts related to given public keys.

Parameters
keyspublic keys to search for related accounts
Returns
the set of related accounts

Definition at line 1030 of file wallet.cpp.

◆ get_limit_orders()

vector< limit_order_object > graphene::wallet::wallet_api::get_limit_orders ( string  a,
string  b,
uint32_t  limit 
) const

Get limit orders in a given market.

Parameters
asymbol or ID of asset being sold
bsymbol or ID of asset being purchased
limitMaximum number of orders to retrieve
Returns
The limit orders, ordered from least price to greatest

Definition at line 450 of file wallet.cpp.

◆ get_market_history()

vector< bucket_object > graphene::wallet::wallet_api::get_market_history ( string  symbol,
string  symbol2,
uint32_t  bucket,
fc::time_point_sec  start,
fc::time_point_sec  end 
) const

Get OHLCV data of a trading pair in a time range.

Parameters
symbolsymbol or ID of the base asset
symbol2symbol or ID of the quote asset
bucketlength of each time bucket in seconds.
startthe start of a time range, E.G. "2018-01-01T00:00:00"
endthe end of the time range
Returns
A list of OHLCV data, in "least recent first" order.

Definition at line 429 of file wallet.cpp.

◆ get_my_blind_accounts()

map< string, public_key_type > graphene::wallet::wallet_api::get_my_blind_accounts ( ) const

Get all blind accounts for which this wallet has the private key.

Returns
all blind accounts for which this wallet has the private key

Definition at line 1424 of file wallet.cpp.

◆ get_object()

variant graphene::wallet::wallet_api::get_object ( object_id_type  id) const

Returns the blockchain object corresponding to the given id.

This generic function can be used to retrieve any object from the blockchain that is assigned an ID. Certain types of objects have specialized convenience functions to return their objects – e.g., assets have get_asset(), accounts have get_account(), but this function will work for any object.

Parameters
idthe id of the object to return
Returns
the requested object

Definition at line 494 of file wallet.cpp.

◆ get_order_book()

order_book graphene::wallet::wallet_api::get_order_book ( const string &  base,
const string &  quote,
unsigned  limit = 50 
)

Returns the order book for the market base:quote.

Parameters
basesymbol or ID of the base asset
quotesymbol or ID of the quote asset
limitdepth of the order book to retrieve, for bids and asks each, capped at 50
Returns
Order book of the market

Definition at line 1918 of file wallet.cpp.

◆ get_private_key()

string graphene::wallet::wallet_api::get_private_key ( public_key_type  pubkey) const

Get the WIF private key corresponding to a public key. The private key must already be in the wallet.

Parameters
pubkeya public key in Base58 format
Returns
the WIF private key

Definition at line 1388 of file wallet.cpp.

◆ get_prototype_operation()

operation graphene::wallet::wallet_api::get_prototype_operation ( string  operation_type)

Returns an uninitialized object representing a given blockchain operation.

This returns a default-initialized object of the given type; it can be used during early development of the wallet when we don't yet have custom commands for creating all of the operations the blockchain supports.

Any operation the blockchain supports can be created using the transaction builder's add_operation_to_builder_transaction() , but to do that from the CLI you need to know what the JSON form of the operation looks like. This will give you a template you can fill in. It's better than nothing.

Parameters
operation_typethe type of operation to return, must be one of the operations defined in graphene/protocol/operations.hpp (e.g., "global_parameters_update_operation")
Returns
a default-constructed operation of the given type

Definition at line 1035 of file wallet.cpp.

◆ get_public_key()

public_key_type graphene::wallet::wallet_api::get_public_key ( string  label) const

Get the public key associated with a given label.

Parameters
labela label
Returns
the public key associated with the given label

Definition at line 1393 of file wallet.cpp.

◆ get_relative_account_history()

vector< operation_detail > graphene::wallet::wallet_api::get_relative_account_history ( const string &  account_name_or_id,
uint32_t  stop,
uint32_t  limit,
uint32_t  start 
) const

Returns the relative operations on the named account from start number.

Parameters
account_name_or_idthe name or id of the account
stopSequence number of earliest operation.
limitthe number of entries to return
startthe sequence number where to start looping back throw the history
Returns
a list of operation_history_objects

Definition at line 337 of file wallet.cpp.

◆ get_result_formatters()

std::map< string, std::function< string(fc::variant, const fc::variants &)> > graphene::wallet::wallet_api::get_result_formatters ( ) const

Definition at line 1231 of file wallet.cpp.

◆ get_settle_orders()

vector< force_settlement_object > graphene::wallet::wallet_api::get_settle_orders ( string  a,
uint32_t  limit 
) const

Get forced settlement orders in a given asset.

Parameters
aSymbol or ID of asset being settled
limitMaximum number of orders to retrieve
Returns
The settle orders, ordered from earliest settlement date to latest

Definition at line 460 of file wallet.cpp.

◆ get_transaction_id()

transaction_id_type graphene::wallet::wallet_api::get_transaction_id ( const signed_transaction &  trx) const
inline

This method is used to convert a JSON transaction to its transactin ID.

Parameters
trxa JSON transaction
Returns
the ID (hash) of the transaction

Definition at line 800 of file wallet.hpp.

◆ get_transaction_signers()

flat_set< public_key_type > graphene::wallet::wallet_api::get_transaction_signers ( const signed_transaction &  tx) const

Get transaction signers.

Returns information about who signed the transaction, specifically, the corresponding public keys of the private keys used to sign the transaction.

Parameters
txthe signed transaction
Returns
the set of public_keys

Definition at line 1025 of file wallet.cpp.

◆ get_vesting_balances()

vector< vesting_balance_object_with_info > graphene::wallet::wallet_api::get_vesting_balances ( string  account_name)

Get information about a vesting balance object or vesting balance objects owned by an account.

Parameters
account_nameAn account name, account ID, or vesting balance object ID.
Returns
a list of vesting balance objects with additional info

Definition at line 963 of file wallet.cpp.

◆ get_wallet_filename()

string graphene::wallet::wallet_api::get_wallet_filename ( ) const

Returns the current wallet filename.

This is the filename that will be used when automatically saving the wallet.

See also
set_wallet_filename()
Returns
the wallet filename

Definition at line 499 of file wallet.cpp.

◆ get_witness()

witness_object graphene::wallet::wallet_api::get_witness ( string  owner_account)

Returns information about the given witness.

Parameters
owner_accountthe name or id of the witness account owner, or the id of the witness
Returns
the information about the witness stored in the block chain

Definition at line 915 of file wallet.cpp.

◆ gethelp()

string graphene::wallet::wallet_api::gethelp ( const string &  method) const

Returns detailed help on a single API command.

Parameters
methodthe name of the API command you want help with
Returns
a multi-line string suitable for displaying on a terminal

Definition at line 1152 of file wallet.cpp.

◆ global_settle_asset()

signed_transaction graphene::wallet::wallet_api::global_settle_asset ( string  symbol_or_id,
price  settle_price,
bool  broadcast = false 
)

Forces a global settling of the given asset (black swan or prediction markets).

In order to use this operation, asset_to_settle must have the global_settle permission set

When this operation is executed all open margin positions are called at the settle price. A pool will be formed containing the collateral got from the margin positions. Users owning an amount of the asset may use settle_asset() to claim collateral instantly at the settle price from the pool. If this asset is used as backing for other bitassets, those bitassets will not be affected.

Note
this operation is used only by the asset issuer.
Parameters
symbol_or_idthe symbol or id of the asset to globally settle
settle_pricethe price at which to settle
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction settling the named asset

Definition at line 868 of file wallet.cpp.

◆ help()

string graphene::wallet::wallet_api::help ( ) const

Returns a list of all commands supported by the wallet API.

This lists each command, along with its arguments and return types. For more detailed help on a single command, use gethelp()

Returns
a multi-line string suitable for displaying on a terminal

Definition at line 1134 of file wallet.cpp.

◆ htlc_create()

signed_transaction graphene::wallet::wallet_api::htlc_create ( string  source,
string  destination,
string  amount,
string  asset_symbol_or_id,
string  hash_algorithm,
const std::string &  preimage_hash,
uint32_t  preimage_size,
const uint32_t  claim_period_seconds,
const std::string &  memo,
bool  broadcast = false 
)

Create a hashed time lock contract

Parameters
sourceThe account that will reserve the funds (and pay the fee)
destinationThe account that will receive the funds if the preimage is presented
amountthe amount of the asset that is to be traded
asset_symbol_or_idThe asset that is to be traded
hash_algorithmthe algorithm used to generate the hash from the preimage. Can be RIPEMD160, SHA1 or SHA256.
preimage_hashthe hash of the preimage
preimage_sizethe size of the preimage in bytes
claim_period_secondshow long after creation until the lock expires
memothe memo
broadcasttrue if you wish to broadcast the transaction
Returns
the signed transaction

Definition at line 202 of file wallet.cpp.

◆ htlc_extend()

signed_transaction graphene::wallet::wallet_api::htlc_extend ( string  htlc_id,
string  issuer,
const uint32_t  seconds_to_add,
bool  broadcast = false 
)

Definition at line 273 of file wallet.cpp.

◆ htlc_redeem()

signed_transaction graphene::wallet::wallet_api::htlc_redeem ( string  htlc_id,
string  issuer,
const std::string &  preimage,
bool  broadcast = false 
)

Definition at line 266 of file wallet.cpp.

◆ import_account_keys()

bool graphene::wallet::wallet_api::import_account_keys ( string  filename,
string  password,
string  src_account_name,
string  dest_account_name 
)

Imports from a BitShares 0.x wallet file, find keys that were bound to a given account name on the BitShares 0.x chain, rebind them to an account name on the 2.0 chain. Current wallet file must be unlocked to perform the import.

Parameters
filenamethe BitShares 0.x wallet file to import
passwordthe password to encrypt the BitShares 0.x wallet file
src_account_namename of the account on BitShares 0.x chain
dest_account_namename of the account on BitShares 2.0 chain, can be same or different to src_account_name
Returns
whether the import has succeeded

Definition at line 695 of file wallet.cpp.

◆ import_accounts()

map< string, bool > graphene::wallet::wallet_api::import_accounts ( string  filename,
string  password 
)

Imports accounts from a BitShares 0.x wallet file. Current wallet file must be unlocked to perform the import.

Parameters
filenamethe BitShares 0.x wallet file to import
passwordthe password to encrypt the BitShares 0.x wallet file
Returns
a map containing the accounts found and whether imported

Definition at line 623 of file wallet.cpp.

◆ import_balance()

vector< signed_transaction > graphene::wallet::wallet_api::import_balance ( string  account_name_or_id,
const vector< string > &  wif_keys,
bool  broadcast 
)

This call will construct transaction(s) that will claim all balances controled by wif_keys and deposit them into the given account.

Parameters
account_name_or_idname or ID of an account that to claim balances to
wif_keysprivate WIF keys of balance objects to claim balances from
broadcasttrue to broadcast the transaction on the network

Definition at line 1281 of file wallet.cpp.

◆ import_key()

bool graphene::wallet::wallet_api::import_key ( string  account_name_or_id,
string  wif_key 
)

Imports the private key for an existing account.

The private key must match either an owner key or an active key for the named account.

See also
dump_private_keys()
Parameters
account_name_or_idthe account owning the key
wif_keythe private key in WIF format
Returns
true if the key was imported

Definition at line 604 of file wallet.cpp.

◆ info()

variant graphene::wallet::wallet_api::info ( )

Returns info about head block, chain_id, maintenance, participation, current active witnesses and committee members.

Returns
runtime info about the blockchain

Definition at line 751 of file wallet.cpp.

◆ is_locked()

bool graphene::wallet::wallet_api::is_locked ( ) const

Checks whether the wallet is locked (is unable to use its private keys).

This state can be changed by calling lock() or unlock().

Returns
true if the wallet is locked

Definition at line 1236 of file wallet.cpp.

◆ is_new()

bool graphene::wallet::wallet_api::is_new ( ) const

Checks whether the wallet has just been created and has not yet had a password set.

Calling set_password will transition the wallet to the locked state.

Returns
true if the wallet is new

Definition at line 1240 of file wallet.cpp.

◆ is_public_key_registered()

bool graphene::wallet::wallet_api::is_public_key_registered ( string  public_key) const

Determine whether a textual representation of a public key (in Base-58 format) is currently linked to any registered (i.e. non-stealth) account on the blockchain

Parameters
public_keyPublic key
Returns
Whether a public key is known

Definition at line 482 of file wallet.cpp.

◆ issue_asset()

signed_transaction graphene::wallet::wallet_api::issue_asset ( string  to_account,
string  amount,
string  symbol_or_id,
string  memo,
bool  broadcast = false 
)

Create the specified amount of the specified asset and credit into the specified account.

Parameters
to_accountthe name or id of the account to receive the new supply
amountthe amount to issue, in nominal units
symbol_or_idthe ticker symbol or id of the asset to issue
memoa memo to include in the transaction, readable by the recipient
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction issuing the new supply

Definition at line 786 of file wallet.cpp.

◆ list_account_balances()

vector< asset > graphene::wallet::wallet_api::list_account_balances ( const string &  account_name_or_id)

List the balances of an account. Each account can have multiple balances, one for each type of asset owned by that account. The returned list will only contain assets for which the account has a nonzero balance

Parameters
account_name_or_idthe name or id of the account whose balances you want
Returns
a list of the given account's balances

Definition at line 187 of file wallet.cpp.

◆ list_accounts()

map< string, account_id_type > graphene::wallet::wallet_api::list_accounts ( const string &  lowerbound,
uint32_t  limit 
)

Lists all accounts registered in the blockchain. This returns a list of all account names and their account ids, sorted by account name.

Use the lowerbound and limit parameters to page through the list. To retrieve all accounts, start by setting lowerbound to the empty string "", and then each iteration, pass the last account name returned as the lowerbound for the next list_accounts() call.

Parameters
lowerboundthe name of the first account to return. If the named account does not exist, the list will start at the account that comes after lowerbound
limitthe maximum number of accounts to return (max: 1000)
Returns
a list of accounts mapping account names to account ids

Definition at line 182 of file wallet.cpp.

◆ list_assets()

vector< extended_asset_object > graphene::wallet::wallet_api::list_assets ( const string &  lowerbound,
uint32_t  limit 
) const

Lists all assets registered on the blockchain.

To list all assets, pass the empty string "" for the lowerbound to start at the beginning of the list, and iterate as necessary.

Parameters
lowerboundthe symbol of the first asset to include in the list.
limitthe maximum number of assets to return (max: 100)
Returns
the list of asset objects, ordered by symbol

Definition at line 192 of file wallet.cpp.

◆ list_committee_members()

map< string, committee_member_id_type > graphene::wallet::wallet_api::list_committee_members ( const string &  lowerbound,
uint32_t  limit 
)

Lists all committee_members registered in the blockchain. This returns a list of all account names that own committee_members, and the associated committee_member id, sorted by name. This lists committee_members whether they are currently voted in or not.

Use the lowerbound and limit parameters to page through the list. To retrieve all committee_members, start by setting lowerbound to the empty string "", and then each iteration, pass the last committee_member name returned as the lowerbound for the next list_committee_members() call.

Parameters
lowerboundthe name of the first committee_member to return. If the named committee_member does not exist, the list will start at the committee_member that comes after lowerbound
limitthe maximum number of committee_members to return (max: 1000)
Returns
a list of committee_members mapping committee_member names to committee_member ids

Definition at line 910 of file wallet.cpp.

◆ list_my_accounts()

vector< account_object > graphene::wallet::wallet_api::list_my_accounts ( )

Lists all accounts controlled by this wallet. This returns a list of the full account objects for all accounts whose private keys we possess.

Returns
a list of account objects

Definition at line 177 of file wallet.cpp.

◆ list_witnesses()

map< string, witness_id_type > graphene::wallet::wallet_api::list_witnesses ( const string &  lowerbound,
uint32_t  limit 
)

Lists all witnesses registered in the blockchain. This returns a list of all account names that own witnesses, and the associated witness id, sorted by name. This lists witnesses whether they are currently voted in or not.

Use the lowerbound and limit parameters to page through the list. To retrieve all witnesss, start by setting lowerbound to the empty string "", and then each iteration, pass the last witness name returned as the lowerbound for the next list_witnesss() call.

Parameters
lowerboundthe name of the first witness to return. If the named witness does not exist, the list will start at the witness that comes after lowerbound
limitthe maximum number of witnesss to return (max: 1000)
Returns
a list of witnesss mapping witness names to witness ids

Definition at line 905 of file wallet.cpp.

◆ load_wallet_file()

bool graphene::wallet::wallet_api::load_wallet_file ( string  wallet_filename = "")

Loads a specified BitShares wallet.

The current wallet is closed before the new wallet is loaded.

Warning
This does not change the filename that will be used for future wallet writes, so this may cause you to overwrite your original wallet unless you also call set_wallet_filename()
Parameters
wallet_filenamethe filename of the wallet JSON file to load. If wallet_filename is empty, it reloads the existing wallet file
Returns
true if the specified wallet is loaded

Definition at line 1215 of file wallet.cpp.

◆ lock()

void graphene::wallet::wallet_api::lock ( )

Locks the wallet immediately.

Definition at line 1250 of file wallet.cpp.

◆ network_add_nodes()

void graphene::wallet::wallet_api::network_add_nodes ( const vector< string > &  nodes)

Definition at line 1072 of file wallet.cpp.

◆ network_get_connected_peers()

vector< variant > graphene::wallet::wallet_api::network_get_connected_peers ( )

Definition at line 1077 of file wallet.cpp.

◆ normalize_brain_key()

string graphene::wallet::wallet_api::normalize_brain_key ( string  s) const

Transforms a brain key to reduce the chance of errors when re-entering the key from memory.

This takes a user-supplied brain key and normalizes it into the form used for generating private keys. In particular, this upper-cases all ASCII characters and collapses multiple spaces into one.

Parameters
sthe brain key as supplied by the user
Returns
the brain key in its normalized form

Definition at line 746 of file wallet.cpp.

◆ preview_builder_transaction()

transaction graphene::wallet::wallet_api::preview_builder_transaction ( transaction_handle_type  handle)

Show content of a transaction builder.

Parameters
handlehandle of the transaction builder
Returns
a transaction

Definition at line 529 of file wallet.cpp.

◆ propose_builder_transaction()

signed_transaction graphene::wallet::wallet_api::propose_builder_transaction ( transaction_handle_type  handle,
time_point_sec  expiration = time_point::now() + fc::minutes(1),
uint32_t  review_period_seconds = 0,
bool  broadcast = true 
)

Create a proposal containing the operations in a transaction builder (create a new proposal_create operation, then replace the transaction builder with the new operation), then sign the transaction and optionally broadcast to the network.

Note: this command is buggy because unable to specify proposer. It will be deprecated in a future release. Please use propose_builder_transaction2() instead.

Parameters
handlehandle of the transaction builder
expirationwhen the proposal will expire
review_period_secondsreview period of the proposal in seconds
broadcastwhether to broadcast the signed transaction to the network
Returns
a signed transaction

Definition at line 551 of file wallet.cpp.

◆ propose_builder_transaction2()

signed_transaction graphene::wallet::wallet_api::propose_builder_transaction2 ( transaction_handle_type  handle,
string  account_name_or_id,
time_point_sec  expiration = time_point::now() + fc::minutes(1),
uint32_t  review_period_seconds = 0,
bool  broadcast = true 
)

Create a proposal containing the operations in a transaction builder (create a new proposal_create operation, then replace the transaction builder with the new operation), then sign the transaction and optionally broadcast to the network.

Parameters
handlehandle of the transaction builder
account_name_or_idname or ID of the account who would pay fees for creating the proposal
expirationwhen the proposal will expire
review_period_secondsreview period of the proposal in seconds
broadcastwhether to broadcast the signed transaction to the network
Returns
a signed transaction

Definition at line 560 of file wallet.cpp.

◆ propose_fee_change()

signed_transaction graphene::wallet::wallet_api::propose_fee_change ( const string &  proposing_account,
fc::time_point_sec  expiration_time,
const variant_object &  changed_values,
bool  broadcast = false 
)

Propose a fee change.

Parameters
proposing_accountThe account paying the fee to propose the tx
expiration_timeTimestamp specifying when the proposal will either take effect or expire.
changed_valuesMap of operation type to new fee. Operations may be specified by name or ID. The "scale" key changes the scale. All other operations will maintain current values.
broadcasttrue if you wish to broadcast the transaction
Returns
the signed version of the transaction

Definition at line 1098 of file wallet.cpp.

◆ propose_parameter_change()

signed_transaction graphene::wallet::wallet_api::propose_parameter_change ( const string &  proposing_account,
fc::time_point_sec  expiration_time,
const variant_object &  changed_values,
bool  broadcast = false 
)

Creates a transaction to propose a parameter change.

Multiple parameters can be specified if an atomic change is desired.

Parameters
proposing_accountThe account paying the fee to propose the tx
expiration_timeTimestamp specifying when the proposal will either take effect or expire.
changed_valuesThe values to change; all other chain parameters are filled in with default values
broadcasttrue if you wish to broadcast the transaction
Returns
the signed version of the transaction

Definition at line 1088 of file wallet.cpp.

◆ publish_asset_feed()

signed_transaction graphene::wallet::wallet_api::publish_asset_feed ( string  publishing_account,
string  symbol_or_id,
price_feed  feed,
bool  broadcast = false 
)

Publishes a price feed for the named asset.

Price feed providers use this command to publish their price feeds for market-issued assets. A price feed is used to tune the market for a particular market-issued asset. For each value in the feed, the median across all committee_member feeds for that asset is calculated and the market for the asset is configured with the median of that value.

The feed object in this command contains three prices: a call price limit, a short price limit, and a settlement price. The call limit price is structured as (collateral asset) / (debt asset) and the short limit price is structured as (asset for sale) / (collateral asset). Note that the asset IDs are opposite to eachother, so if we're publishing a feed for USD, the call limit price will be CORE/USD and the short limit price will be USD/CORE. The settlement price may be flipped either direction, as long as it is a ratio between the market-issued asset and its collateral.

Parameters
publishing_accountthe account publishing the price feed
symbol_or_idthe symbol or id of the asset whose feed we're publishing
feedthe price_feed object containing the three prices making up the feed
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction updating the price feed for the given asset

Definition at line 837 of file wallet.cpp.

◆ quit()

void graphene::wallet::wallet_api::quit ( )

Quit from the wallet.

The current wallet will be closed and saved.

Definition at line 1220 of file wallet.cpp.

◆ read_memo()

string graphene::wallet::wallet_api::read_memo ( const memo_data &  memo)

Read a memo.

Parameters
memoJSON-encoded memo.
Returns
string with decrypted message.

Definition at line 1342 of file wallet.cpp.

◆ receive_blind_transfer()

blind_receipt graphene::wallet::wallet_api::receive_blind_transfer ( string  confirmation_receipt,
string  opt_from,
string  opt_memo 
)

Given a confirmation receipt, this method will parse it for a blinded balance and confirm that it exists in the blockchain. If it exists then it will report the amount received and who sent it.

Parameters
confirmation_receipta base58 encoded stealth confirmation
opt_fromif not empty and the sender is a unknown public key, then the unknown public key will be given the label opt_from
opt_memoa self-defined label for this transfer to be saved in local wallet file
Returns
a blind receipt

Definition at line 1823 of file wallet.cpp.

◆ register_account()

signed_transaction graphene::wallet::wallet_api::register_account ( string  name,
public_key_type  owner,
public_key_type  active,
string  registrar_account,
string  referrer_account,
uint32_t  referrer_percent,
bool  broadcast = false 
)

Registers a third party's account on the blockckain.

This function is used to register an account for which you do not own the private keys. When acting as a registrar, an end user will generate their own private keys and send you the public keys. The registrar will use this function to register the account on behalf of the end user.

See also
create_account_with_brain_key()
Parameters
namethe name of the account, must be unique on the blockchain. Shorter names are more expensive to register; the rules are still in flux, but in general names of more than 8 characters with at least one digit will be cheap.
ownerthe owner key for the new account
activethe active key for the new account
registrar_accountthe account which will pay the fee to register the user
referrer_accountthe account who is acting as a referrer, and may receive a portion of the user's transaction fees. This can be the same as the registrar_account if there is no referrer.
referrer_percentthe percentage (0 - 100) of the new user's transaction fees not claimed by the blockchain that will be distributed to the referrer; the rest will be sent to the registrar. Will be multiplied by GRAPHENE_1_PERCENT when constructing the transaction.
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction registering the account

Definition at line 766 of file wallet.cpp.

◆ remove_builder_transaction()

void graphene::wallet::wallet_api::remove_builder_transaction ( transaction_handle_type  handle)

Destroy a transaction builder.

Parameters
handlehandle of the transaction builder

Definition at line 570 of file wallet.cpp.

◆ replace_operation_in_builder_transaction()

void graphene::wallet::wallet_api::replace_operation_in_builder_transaction ( transaction_handle_type  handle,
unsigned  operation_index,
const operation &  new_op 
)

Replace an operation in a transaction builder with a new operation.

Parameters
handlehandle of the transaction builder
operation_indexthe index of the old operation in the builder to be replaced
new_opthe new operation in JSON format

Definition at line 516 of file wallet.cpp.

◆ reserve_asset()

signed_transaction graphene::wallet::wallet_api::reserve_asset ( string  from,
string  amount,
string  symbol_or_id,
bool  broadcast = false 
)

Burns an amount of given asset to its reserve pool.

This command burns an amount of given asset to reduce the amount in circulation.

Note
you cannot burn market-issued assets.
Parameters
fromthe account containing the asset you wish to burn
amountthe amount to burn, in nominal units
symbol_or_idthe symbol or id of the asset to burn
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction burning the asset

Definition at line 860 of file wallet.cpp.

◆ save_wallet_file()

void graphene::wallet::wallet_api::save_wallet_file ( string  wallet_filename = "")

Saves the current wallet to the given filename.

Warning
This does not change the wallet filename that will be used for future writes, so think of this function as 'Save a Copy As...' instead of 'Save As...'. Use set_wallet_filename() to make the filename persist.
Parameters
wallet_filenamethe filename of the new wallet JSON file to create or overwrite. If wallet_filename is empty, save to the current filename.

Definition at line 1225 of file wallet.cpp.

◆ sell_asset()

signed_transaction graphene::wallet::wallet_api::sell_asset ( string  seller_account,
string  amount_to_sell,
string  symbol_or_id_to_sell,
string  min_to_receive,
string  symbol_or_id_to_receive,
uint32_t  timeout_sec = 0,
bool  fill_or_kill = false,
bool  broadcast = false 
)

Place a limit order attempting to sell one asset for another.

Buying and selling are the same operation on BitShares; if you want to buy BTS with USD, you should sell USD for BTS.

The blockchain will attempt to sell the symbol_or_id_to_sell for as much symbol_or_id_to_receive as possible, as long as the price is at least min_to_receive / amount_to_sell.

In addition to the transaction fees, market fees will apply as specified by the issuer of both the selling asset and the receiving asset as a percentage of the amount exchanged.

If either the selling asset or the receiving asset is whitelist restricted, the order will only be created if the seller is on the whitelist of the restricted asset type.

Market orders are matched in the order they are included in the block chain.

Todo:
Document default/max expiration time
Parameters
seller_accountthe account providing the asset being sold, and which will receive the proceeds of the sale.
amount_to_sellthe amount of the asset being sold to sell (in nominal units)
symbol_or_id_to_sellthe symbol or id of the asset to sell
min_to_receivethe minimum amount you are willing to receive in return for selling the entire amount_to_sell
symbol_or_id_to_receivethe symbol or id of the asset you wish to receive
timeout_secif the order does not fill immediately, this is the length of time the order will remain on the order books before it is cancelled and the un-spent funds are returned to the seller's account
fill_or_killif true, the order will only be included in the blockchain if it is filled immediately; if false, an open order will be left on the books to fill any amount that cannot be filled immediately.
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction selling the funds

Definition at line 1300 of file wallet.cpp.

◆ serialize_transaction()

string graphene::wallet::wallet_api::serialize_transaction ( signed_transaction  tx) const

Converts a signed_transaction in JSON form to its binary representation.

Parameters
txthe transaction to serialize
Returns
the binary form of the transaction. It will not be hex encoded, this returns a raw string that may have null characters embedded in it

Definition at line 489 of file wallet.cpp.

◆ set_desired_witness_and_committee_member_count()

signed_transaction graphene::wallet::wallet_api::set_desired_witness_and_committee_member_count ( string  account_to_modify,
uint16_t  desired_number_of_witnesses,
uint16_t  desired_number_of_committee_members,
bool  broadcast = false 
)

Set your vote for the number of witnesses and committee_members in the system.

Each account can voice their opinion on how many committee_members and how many witnesses there should be in the active committee_member/active witness list. These are independent of each other. You must vote your approval of at least as many committee_members or witnesses as you claim there should be (you can't say that there should be 20 committee_members but only vote for 10).

There are maximum values for each set in the blockchain parameters (currently defaulting to 1001).

This setting can be changed at any time. If your account has a voting proxy set, your preferences will be ignored.

Parameters
account_to_modifythe name or id of the account to update
desired_number_of_witnessesdesired number of active witnesses
desired_number_of_committee_membersdesired number of active committee members
broadcasttrue if you wish to broadcast the transaction
Returns
the signed transaction changing your vote proxy settings

Definition at line 1000 of file wallet.cpp.

◆ set_fees_on_builder_transaction()

asset graphene::wallet::wallet_api::set_fees_on_builder_transaction ( transaction_handle_type  handle,
string  fee_asset = GRAPHENE_SYMBOL 
)

Calculate and update fees for the operations in a transaction builder.

Parameters
handlehandle of the transaction builder
fee_assetsymbol or ID of an asset that to be used to pay fees
Returns
total fees

Definition at line 524 of file wallet.cpp.

◆ set_key_label()

bool graphene::wallet::wallet_api::set_key_label ( public_key_type  key,
string  label 
)

These methods are used for stealth transfers This method can be used to set a label for a public key

Note
No two keys can have the same label.
Parameters
keya public key
labela user-defined string as label
Returns
true if the label was set, otherwise false

Definition at line 1403 of file wallet.cpp.

◆ set_password()

void graphene::wallet::wallet_api::set_password ( string  password)

Sets a new password on the wallet.

The wallet must be either 'new' or 'unlocked' to execute this command.

When used in command line, if typed "set_password" without a password followed, the user will be prompted to input a password without echo.

Parameters
passworda new password

Definition at line 1273 of file wallet.cpp.

◆ set_voting_proxy()

signed_transaction graphene::wallet::wallet_api::set_voting_proxy ( string  account_to_modify,
optional< string >  voting_account,
bool  broadcast = false 
)

Set the voting proxy for an account.

If a user does not wish to take an active part in voting, they can choose to allow another account to vote their stake.

Setting a vote proxy does not remove your previous votes from the blockchain, they remain there but are ignored. If you later null out your vote proxy, your previous votes will take effect again.

This setting can be changed at any time.

Parameters
account_to_modifythe name or id of the account to update
voting_accountthe name or id of an account authorized to vote account_to_modify's stake, or null to vote your own stake
broadcasttrue if you wish to broadcast the transaction
Returns
the signed transaction changing your vote proxy settings

Definition at line 993 of file wallet.cpp.

◆ set_wallet_filename()

void graphene::wallet::wallet_api::set_wallet_filename ( string  wallet_filename)

Sets the wallet filename used for future writes.

This does not trigger a save, it only changes the default filename that will be used the next time a save is triggered.

Parameters
wallet_filenamethe new filename to use for future saves

Definition at line 1009 of file wallet.cpp.

◆ settle_asset()

signed_transaction graphene::wallet::wallet_api::settle_asset ( string  account_to_settle,
string  amount_to_settle,
string  symbol_or_id,
bool  broadcast = false 
)

Schedules a market-issued asset for automatic settlement.

Holders of market-issued assests may request a forced settlement for some amount of their asset. This means that the specified sum will be locked by the chain and held for the settlement period, after which time the chain will choose a margin posision holder and buy the settled asset using the margin's collateral. The price of this sale will be based on the feed price for the market-issued asset being settled. The exact settlement price will be the feed price at the time of settlement with an offset in favor of the margin position, where the offset is a blockchain parameter set in the asset's bitasset options.

Parameters
account_to_settlethe name or id of the account owning the asset
amount_to_settlethe amount of the asset to schedule for settlement
symbol_or_idthe symbol or id of the asset to settle
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction settling the named asset

Definition at line 875 of file wallet.cpp.

◆ sign_builder_transaction()

signed_transaction graphene::wallet::wallet_api::sign_builder_transaction ( transaction_handle_type  transaction_handle,
bool  broadcast = true 
)

Sign the transaction in a transaction builder and optionally broadcast to the network.

Parameters
transaction_handlehandle of the transaction builder
broadcastwhether to broadcast the signed transaction to the network
Returns
a signed transaction

Definition at line 534 of file wallet.cpp.

◆ sign_builder_transaction2()

signed_transaction graphene::wallet::wallet_api::sign_builder_transaction2 ( transaction_handle_type  transaction_handle,
const vector< public_key_type > &  signing_keys = vector<public_key_type>(),
bool  broadcast = true 
)

Sign the transaction in a transaction builder and optionally broadcast to the network.

Parameters
transaction_handlehandle of the transaction builder
signing_keysKeys that must be used when signing the transaction
broadcastwhether to broadcast the signed transaction to the network
Returns
a signed transaction

Definition at line 539 of file wallet.cpp.

◆ sign_memo()

memo_data graphene::wallet::wallet_api::sign_memo ( string  from,
string  to,
string  memo 
)

Sign a memo message.

Parameters
fromthe name or id of signing account, or a public key, or a label of a public key
tothe name or id of receiving account, or a public key, or a label of a public key
memotext to sign
Returns
the signed memo data

Definition at line 1336 of file wallet.cpp.

◆ sign_message()

signed_message graphene::wallet::wallet_api::sign_message ( string  signer,
string  message 
)

Sign a message using an account's memo key. The signature is generated as in in https://github.com/xeroc/python-graphenelib/blob/d9634d74273ebacc92555499eca7c444217ecba0/graphenecommon/message.py#L64 .

Parameters
signerthe name or id of signing account
messagetext to sign
Returns
the signed message in an abstract format

Definition at line 1348 of file wallet.cpp.

◆ sign_transaction()

signed_transaction graphene::wallet::wallet_api::sign_transaction ( signed_transaction  tx,
bool  broadcast = false 
)

Signs a transaction.

Given a fully-formed transaction that is only lacking signatures, this signs the transaction with the necessary keys and optionally broadcasts the transaction

Parameters
txthe unsigned transaction
broadcasttrue if you wish to broadcast the transaction
Returns
the signed version of the transaction

Definition at line 1014 of file wallet.cpp.

◆ sign_transaction2()

signed_transaction graphene::wallet::wallet_api::sign_transaction2 ( signed_transaction  tx,
const vector< public_key_type > &  signing_keys = vector<public_key_type>(),
bool  broadcast = true 
)

Signs a transaction.

Given a fully-formed transaction that is only lacking signatures, this signs the transaction with the inferred necessary keys and the explicitly provided keys, and optionally broadcasts the transaction

Parameters
txthe unsigned transaction
signing_keysKeys that must be used when signing the transaction
broadcasttrue if you wish to broadcast the transaction
Returns
the signed version of the transaction

Definition at line 1019 of file wallet.cpp.

◆ suggest_brain_key()

brain_key_info graphene::wallet::wallet_api::suggest_brain_key ( ) const

Suggests a safe brain key to use for creating your account. create_account_with_brain_key() requires you to specify a 'brain key', a long passphrase that provides enough entropy to generate cyrptographic keys. This function will suggest a suitably random string that should be easy to write down (and, with effort, memorize).

Returns
a suggested brain_key

Definition at line 470 of file wallet.cpp.

◆ transfer()

signed_transaction graphene::wallet::wallet_api::transfer ( string  from,
string  to,
string  amount,
string  asset_symbol_or_id,
string  memo,
bool  broadcast = false 
)

Transfer an amount from one account to another.

Parameters
fromthe name or id of the account sending the funds
tothe name or id of the account receiving the funds
amountthe amount to send (in nominal units – to send half of a BTS, specify 0.5)
asset_symbol_or_idthe symbol or id of the asset to send
memoa memo to attach to the transaction. The memo will be encrypted in the transaction and readable for the receiver. There is no length limit other than the limit imposed by maximum transaction size, but transaction increase with transaction size
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction transferring funds

Definition at line 792 of file wallet.cpp.

◆ transfer2()

pair<transaction_id_type,signed_transaction> graphene::wallet::wallet_api::transfer2 ( const string &  from,
const string &  to,
const string &  amount,
const string &  asset_symbol_or_id,
const string &  memo 
)
inline

This method works just like transfer, except it always broadcasts and returns the transaction ID (hash) along with the signed transaction.

Parameters
fromthe name or id of the account sending the funds
tothe name or id of the account receiving the funds
amountthe amount to send (in nominal units – to send half of a BTS, specify 0.5)
asset_symbol_or_idthe symbol or id of the asset to send
memoa memo to attach to the transaction. The memo will be encrypted in the transaction and readable for the receiver. There is no length limit other than the limit imposed by maximum transaction size, but transaction increase with transaction size
Returns
the transaction ID (hash) along with the signed transaction transferring funds

Definition at line 785 of file wallet.hpp.

◆ transfer_from_blind()

blind_confirmation graphene::wallet::wallet_api::transfer_from_blind ( string  from_blind_account_key_or_label,
string  to_account_name_or_id,
string  amount,
string  asset_symbol_or_id,
bool  broadcast = false 
)

Transfers funds from a set of blinded balances to a public account balance.

Parameters
from_blind_account_key_or_labela public key in Base58 format or a label to transfer from
to_account_name_or_idname or ID of an account to transfer to
amountthe amount to be transferred
asset_symbol_or_idsymbol or ID of the asset to be transferred
broadcasttrue to broadcast the transaction on the network
Returns
a blind confirmation

Definition at line 1489 of file wallet.cpp.

◆ transfer_to_blind()

blind_confirmation graphene::wallet::wallet_api::transfer_to_blind ( string  from_account_name_or_id,
string  asset_symbol_or_id,
vector< pair< string, string >>  to_amounts,
bool  broadcast = false 
)

Transfers a public balance from from_account_name_or_id to one or more blinded balances using a stealth transfer.

Parameters
from_account_name_or_idname or ID of an account to transfer from
asset_symbol_or_idsymbol or ID of the asset to be transferred
to_amountsmap from key or label to amount
broadcasttrue to broadcast the transaction on the network
Returns
a blind confirmation

commitments must be in sorted order

Definition at line 1736 of file wallet.cpp.

◆ unlock()

void graphene::wallet::wallet_api::unlock ( string  password)

Unlocks the wallet.

The wallet remain unlocked until the lock is called or the program exits.

When used in command line, if typed "unlock" without a password followed, the user will be prompted to input a password without echo.

Parameters
passwordthe password previously set with set_password()

Definition at line 1261 of file wallet.cpp.

◆ update_asset()

signed_transaction graphene::wallet::wallet_api::update_asset ( string  symbol_or_id,
optional< string >  new_issuer,
asset_options  new_options,
bool  broadcast = false 
)

Update the core options on an asset. There are a number of options which all assets in the network use. These options are enumerated in the asset_object::asset_options struct. This command is used to update these options for an existing asset.

Note
This operation cannot be used to update BitAsset-specific options. For these options, update_bitasset() instead.
Parameters
symbol_or_idthe symbol or id of the asset to update
new_issuerif changing the asset's issuer, the name or id of the new issuer. null if you wish to remain the issuer of the asset
new_optionsthe new asset_options object, which will entirely replace the existing options.
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction updating the asset

Definition at line 808 of file wallet.cpp.

◆ update_asset_feed_producers()

signed_transaction graphene::wallet::wallet_api::update_asset_feed_producers ( string  symbol_or_id,
flat_set< string >  new_feed_producers,
bool  broadcast = false 
)

Update the set of feed-producing accounts for a BitAsset.

BitAssets have price feeds selected by taking the median values of recommendations from a set of feed producers. This command is used to specify which accounts may produce feeds for a given BitAsset.

Parameters
symbol_or_idthe symbol or id of the asset to update
new_feed_producersa list of account names or ids which are authorized to produce feeds for the asset. this list will completely replace the existing list
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction updating the bitasset's feed producers

Definition at line 830 of file wallet.cpp.

◆ update_asset_issuer()

signed_transaction graphene::wallet::wallet_api::update_asset_issuer ( string  symbol_or_id,
string  new_issuer,
bool  broadcast = false 
)

Update the issuer of an asset Since this call requires the owner authority of the current issuer to sign the transaction, a separated operation is used to change the issuer. This call simplifies the use of this action.

Note
This operation requires the owner key to be available in the wallet.
Parameters
symbol_or_idthe symbol or id of the asset to update
new_issuerif changing the asset's issuer, the name or id of the new issuer.
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction updating the asset

Definition at line 816 of file wallet.cpp.

◆ update_bitasset()

signed_transaction graphene::wallet::wallet_api::update_bitasset ( string  symbol_or_id,
bitasset_options  new_options,
bool  broadcast = false 
)

Update the options specific to a BitAsset.

BitAssets have some options which are not relevant to other asset types. This operation is used to update those options an an existing BitAsset.

See also
update_asset()
Parameters
symbol_or_idthe symbol or id of the asset to update, which must be a market-issued asset
new_optionsthe new bitasset_options object, which will entirely replace the existing options.
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction updating the bitasset

Definition at line 823 of file wallet.cpp.

◆ update_witness()

signed_transaction graphene::wallet::wallet_api::update_witness ( string  witness_name,
string  url,
string  block_signing_key,
bool  broadcast = false 
)

Update a witness object owned by the given account.

Parameters
witness_nameThe name of the witness's owner account. Also accepts the ID of the owner account or the ID of the witness.
urlSame as for create_witness. The empty string makes it remain the same.
block_signing_keyThe new block signing public key. The empty string makes it remain the same.
broadcasttrue if you wish to broadcast the transaction.
Returns
the signed transaction

Definition at line 954 of file wallet.cpp.

◆ update_worker_votes()

signed_transaction graphene::wallet::wallet_api::update_worker_votes ( string  account,
worker_vote_delta  delta,
bool  broadcast = false 
)

Update your votes for workers

Parameters
accountThe account which will pay the fee and update votes.
delta{"vote_for" : [...], "vote_against" : [...], "vote_abstain" : [...]}
broadcasttrue if you wish to broadcast the transaction.
Returns
the signed transaction

Definition at line 946 of file wallet.cpp.

◆ upgrade_account()

signed_transaction graphene::wallet::wallet_api::upgrade_account ( string  account_name_or_id,
bool  broadcast 
)

Upgrades an account to prime status. This makes the account holder a 'lifetime member'.

Parameters
account_name_or_idthe name or id of the account to upgrade
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction upgrading the account

Definition at line 1295 of file wallet.cpp.

◆ verify_encapsulated_message()

bool graphene::wallet::wallet_api::verify_encapsulated_message ( string  message)

Verify a message signed with sign_message, in its encapsulated form.

Parameters
messagethe complete encapsulated message string including separators and line feeds
Returns
true if signature matches

Definition at line 1374 of file wallet.cpp.

◆ verify_message()

bool graphene::wallet::wallet_api::verify_message ( string  message,
string  account,
int  block,
const string &  time,
compact_signature  sig 
)

Verify a message signed with sign_message using the given account's memo key.

Parameters
messagethe message text
accountthe account name of the message
blockthe block number of the message
timethe timestamp of the message
sigthe message signature
Returns
true if signature matches

Definition at line 1354 of file wallet.cpp.

◆ verify_signed_message()

bool graphene::wallet::wallet_api::verify_signed_message ( signed_message  message)

Verify a message signed with sign_message

Parameters
messagethe signed_message structure containing message, meta data and signature
Returns
true if signature matches

Definition at line 1364 of file wallet.cpp.

◆ vote_for_committee_member()

signed_transaction graphene::wallet::wallet_api::vote_for_committee_member ( string  voting_account,
string  committee_member,
bool  approve,
bool  broadcast = false 
)

Vote for a given committee_member.

An account can publish a list of all committee_members they approve of. This command allows you to add or remove committee_members from this list. Each account's vote is weighted according to the number of voting stake owned by that account at the time the votes are tallied.

Note
you cannot vote against a committee_member, you can only vote for the committee_member or not vote for the committee_member.
Parameters
voting_accountthe name or id of the account who is voting with their stake
committee_memberthe name or id of the committee_member's owner account
approvetrue if you wish to vote in favor of that committee_member, false to remove your vote in favor of that committee_member
broadcasttrue if you wish to broadcast the transaction
Returns
the signed transaction changing your vote for the given committee_member

Definition at line 977 of file wallet.cpp.

◆ vote_for_witness()

signed_transaction graphene::wallet::wallet_api::vote_for_witness ( string  voting_account,
string  witness,
bool  approve,
bool  broadcast = false 
)

Vote for a given witness.

An account can publish a list of all witnesses they approve of. This command allows you to add or remove witnesses from this list. Each account's vote is weighted according to the number of voting stake owned by that account at the time the votes are tallied.

Note
you cannot vote against a witness, you can only vote for the witness or not vote for the witness.
Parameters
voting_accountthe name or id of the account who is voting with their stake
witnessthe name or id of the witness' owner account
approvetrue if you wish to vote in favor of that witness, false to remove your vote in favor of that witness
broadcasttrue if you wish to broadcast the transaction
Returns
the signed transaction changing your vote for the given witness

Definition at line 985 of file wallet.cpp.

◆ whitelist_account()

signed_transaction graphene::wallet::wallet_api::whitelist_account ( string  authorizing_account,
string  account_to_list,
account_whitelist_operation::account_listing  new_listing_status,
bool  broadcast = false 
)

Whitelist and blacklist accounts, primarily for transacting in whitelisted assets.

Accounts can freely specify opinions about other accounts, in the form of either whitelisting or blacklisting them. This information is used in chain validation only to determine whether an account is authorized to transact in an asset type which enforces a whitelist, but third parties can use this information for other uses as well, as long as it does not conflict with the use of whitelisted assets.

An asset which enforces a whitelist specifies a list of accounts to maintain its whitelist, and a list of accounts to maintain its blacklist. In order for a given account A to hold and transact in a whitelisted asset S, A must be whitelisted by at least one of S's whitelist_authorities and blacklisted by none of S's blacklist_authorities. If A receives a balance of S, and is later removed from the whitelist(s) which allowed it to hold S, or added to any blacklist S specifies as authoritative, A's balance of S will be frozen until A's authorization is reinstated.

Parameters
authorizing_accountthe account who is doing the whitelisting
account_to_listthe account being whitelisted
new_listing_statusthe new whitelisting status
broadcasttrue to broadcast the transaction on the network
Returns
the signed transaction changing the whitelisting status

Definition at line 891 of file wallet.cpp.

◆ withdraw_vesting()

signed_transaction graphene::wallet::wallet_api::withdraw_vesting ( string  witness_name,
string  amount,
string  asset_symbol_or_id,
bool  broadcast = false 
)

Withdraw a vesting balance.

Parameters
witness_nameThe account name of the witness, also accepts account ID or vesting balance ID type.
amountThe amount to withdraw.
asset_symbol_or_idThe symbol or id of the asset to withdraw.
broadcasttrue if you wish to broadcast the transaction
Returns
the signed transaction

Definition at line 968 of file wallet.cpp.

Member Data Documentation

◆ lock_changed

fc::signal<void(bool)> graphene::wallet::wallet_api::lock_changed

Definition at line 1776 of file wallet.hpp.

◆ my

std::shared_ptr<detail::wallet_api_impl> graphene::wallet::wallet_api::my

Definition at line 1777 of file wallet.hpp.


The documentation for this class was generated from the following files: