5. Wallet API - Calls¶
The wallet (cli_wallet) requires a running full node to connect to because
it does not offer P2P or blockchain capabilities directly.
If you have not set up your wallet yet, you can find more information on the Wallet-CLI Tutorial and the CLI Wallet - FAQ pages.
Table of Contents
- General Calls
- Wallet Calls
- Account Calls
- Trading Calls
- Asset Calls
- Governance
- create_committee_member
- get_witness
- get_committee_member
- list_witnesses
- list_committee_members
- create_witness
- update_witness
- create_worker
- update_worker_votes
- vote_for_committee_member
- vote_for_witness
- set_voting_proxy
- set_desired_witness_and_committee_member_count
- propose_parameter_change
- propose_fee_change
- Privacy Mode
- Blockchain Inspection
- Transaction Builder
- begin_builder_transaction
- add_operation_to_builder_transaction
- replace_operation_in_builder_transaction
- set_fees_on_builder_transaction
- preview_builder_transaction
- sign_builder_transaction
- propose_builder_transaction
- propose_builder_transaction2
- remove_builder_transaction
- serialize_transaction
- sign_transaction
- get_prototype_operation
5.1. General Calls¶
5.1.1. 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
get_help()- Return
- a multi-line string suitable for displaying on a terminal
5.1.2. gethelp¶
-
string
graphene::wallet::wallet_api::gethelp(const string &method) const Returns detailed help on a single API command.
- Return
- a multi-line string suitable for displaying on a terminal
- Parameters
method: the name of the API command you want help with
5.1.3. info¶
-
variant
graphene::wallet::wallet_api::info()¶
5.1.4. about¶
-
variant_object
graphene::wallet::wallet_api::about() const Returns info such as client version, git version of graphene/fc, version of boost, openssl.
- Return
- compile time info and client and dependencies versions
5.1.5. network_add_nodes¶
-
void
graphene::wallet::wallet_api::network_add_nodes(const vector<string> &nodes)¶
5.1.6. network_get_connected_peers¶
-
vector<variant>
graphene::wallet::wallet_api::network_get_connected_peers()¶
5.2. Wallet Calls¶
5.2.1. 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_passwordwill transition the wallet to the locked state.- Return
- true if the wallet is new
5.2.2. 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()orunlock().- Return
- true if the wallet is locked
5.2.3. lock¶
-
void
graphene::wallet::wallet_api::lock() Locks the wallet immediately.
5.2.4. unlock¶
-
void
graphene::wallet::wallet_api::unlock(string password) Unlocks the wallet.
The wallet remain unlocked until the
lockis called or the program exits.- Parameters
password: the password previously set withset_password()
5.2.5. 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.
5.2.6. 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()- Return
- a map containing the private keys, indexed by their public key
5.2.7. 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
- dump_private_keys()
- Return
- true if the key was imported
- Parameters
account_name_or_id: the account owning the keywif_key: the private key in WIF format
5.2.8. import_accounts¶
-
map<string, bool>
graphene::wallet::wallet_api::import_accounts(string filename, string password)¶
5.2.9. import_account_keys¶
-
bool
graphene::wallet::wallet_api::import_account_keys(string filename, string password, string src_account_name, string dest_account_name)¶
5.2.10. 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.
5.2.11. 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).- Return
- a suggested brain_key
5.2.12. get_transaction_id¶
-
transaction_id_type
graphene::wallet::wallet_api::get_transaction_id(const signed_transaction &trx) const This method is used to convert a JSON transaction to its transactin ID.
5.2.13. 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.
5.2.14. load_wallet_file¶
-
bool
graphene::wallet::wallet_api::load_wallet_file(string wallet_filename = "") Loads a specified Graphene 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() - Return
- true if the specified wallet is loaded
- Parameters
wallet_filename: the filename of the wallet JSON file to load. Ifwallet_filenameis empty, it reloads the existing wallet file
5.2.15. 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.
- Return
- the brain key in its normalized form
- Parameters
s: the brain key as supplied by the user
5.2.16. 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_filename: the filename of the new wallet JSON file to create or overwrite. Ifwallet_filenameis empty, save to the current filename.
5.3. Account Calls¶
5.3.1. 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.
- Return
- a list of account objects
5.3.2. 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
lowerboundand limit parameters to page through the list. To retrieve all accounts, start by settinglowerboundto the empty string"", and then each iteration, pass the last account name returned as thelowerboundfor the nextlist_accounts()call.- Return
- a list of accounts mapping account names to account ids
- Parameters
lowerbound: the name of the first account to return. If the named account does not exist, the list will start at the account that comes afterlowerboundlimit: the maximum number of accounts to return (max: 1000)
5.3.3. list_account_balances¶
-
vector<asset>
graphene::wallet::wallet_api::list_account_balances(const string &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
- Return
- a list of the given account’s balances
- Parameters
id: the name or id of the account whose balances you want
5.3.4. 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
- create_account_with_brain_key()
- Return
- the signed transaction registering the account
- Parameters
name: the 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.owner: the owner key for the new accountactive: the active key for the new accountregistrar_account: the account which will pay the fee to register the userreferrer_account: the 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_percent: the 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.broadcast: true to broadcast the transaction on the network
5.3.5. upgrade_account¶
-
signed_transaction
graphene::wallet::wallet_api::upgrade_account(string name, bool broadcast) Upgrades an account to prime status. This makes the account holder a „lifetime member“.
- Return
- the signed transaction upgrading the account
- Parameters
name: the name or id of the account to upgradebroadcast: true to broadcast the transaction on the network
5.3.6. 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.
- See
- suggest_brain_key()
- See
- register_account()
- Return
- the signed transaction registering the account
- Parameters
brain_key: the brain key used for generating the account’s private keysaccount_name: the 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.registrar_account: the account which will pay the fee to register the userreferrer_account: the 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.broadcast: true to broadcast the transaction on the network
5.3.7. transfer¶
-
signed_transaction
graphene::wallet::wallet_api::transfer(string from, string to, string amount, string asset_symbol, string memo, bool broadcast = false) Transfer an amount from one account to another.
- Return
- the signed transaction transferring funds
- Parameters
from: the name or id of the account sending the fundsto: the name or id of the account receiving the fundsamount: the amount to send (in nominal units to send half of a BTS, specify 0.5)asset_symbol: the symbol or id of the asset to sendmemo: a 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 sizebroadcast: true to broadcast the transaction on the network
5.3.8. transfer2¶
-
pair<transaction_id_type, signed_transaction>
graphene::wallet::wallet_api::transfer2(string from, string to, string amount, string asset_symbol, string memo) This method works just like transfer, except it always broadcasts and returns the transaction ID along with the signed transaction.
5.3.9. 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.
- Return
- the signed transaction changing the whitelisting status
- Parameters
authorizing_account: the account who is doing the whitelistingaccount_to_list: the account being whitelistednew_listing_status: the new whitelisting statusbroadcast: true to broadcast the transaction on the network
5.3.10. 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.
- Parameters
account_name: An account name, account ID, or vesting balance object ID.
5.3.11. withdraw_vesting¶
-
signed_transaction
graphene::wallet::wallet_api::withdraw_vesting(string witness_name, string amount, string asset_symbol, bool broadcast = false) Withdraw a vesting balance.
- Parameters
witness_name: The account name of the witness, also accepts account ID or vesting balance ID type.amount: The amount to withdraw.asset_symbol: The symbol of the asset to withdraw.broadcast: true if you wish to broadcast the transaction
5.3.12. get_account¶
-
account_object
graphene::wallet::wallet_api::get_account(string account_name_or_id) const Returns information about the given account.
- Return
- the public account data stored in the blockchain
- Parameters
account_name_or_id: the name or id of the account to provide information about
5.3.13. 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.
- Return
- the id of the named account
- Parameters
account_name_or_id: the name of the account to look up
5.3.14. get_account_history¶
-
vector<operation_detail>
graphene::wallet::wallet_api::get_account_history(string name, int 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.
- Return
- a list of
operation_history_objects - Parameters
name: the name or id of the accountlimit: the number of entries to return (starting from the most recent)
5.3.15. 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.
- Return
- the signed version of the transaction
- Parameters
fee_paying_account: The account paying the fee for the op.proposal_id: The proposal to modify.delta: Members contain approvals to create or remove. In JSON you can leave empty members undefined.broadcast: true if you wish to broadcast the transaction
5.4. Trading Calls¶
5.4.1. sell_asset¶
-
signed_transaction
graphene::wallet::wallet_api::sell_asset(string seller_account, string amount_to_sell, string symbol_to_sell, string min_to_receive, string symbol_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 Graphene; if you want to buy BTS with USD, you should sell USD for BTS.
The blockchain will attempt to sell the
symbol_to_sellfor as muchsymbol_to_receiveas possible, as long as the price is at leastmin_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.
- Return
- the signed transaction selling the funds
- Parameters
seller_account: the account providing the asset being sold, and which will receive the proceeds of the sale.amount_to_sell: the amount of the asset being sold to sell (in nominal units)symbol_to_sell: the name or id of the asset to sellmin_to_receive: the minimum amount you are willing to receive in return for selling the entire amount_to_sellsymbol_to_receive: the name or id of the asset you wish to receivetimeout_sec: if 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 accountfill_or_kill: if 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.broadcast: true to broadcast the transaction on the network
5.4.2. borrow_asset¶
-
signed_transaction
graphene::wallet::wallet_api::borrow_asset(string borrower_name, string amount_to_borrow, string asset_symbol, 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.- Return
- the signed transaction borrowing the asset
- Parameters
borrower_name: the name or id of the account associated with the transaction.amount_to_borrow: the amount of the asset being borrowed. Make this value negative to pay back debt.asset_symbol: the symbol or id of the asset being borrowed.amount_of_collateral: the 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 thebitasset_optionsfor the asset being borrowed.broadcast: true to broadcast the transaction on the network
5.4.3. cancel_order¶
-
signed_transaction
graphene::wallet::wallet_api::cancel_order(object_id_type order_id, bool broadcast = false) Cancel an existing order
- Return
- the signed transaction canceling the order
- Parameters
order_id: the id of order to be cancelledbroadcast: true to broadcast the transaction on the network
5.4.4. settle_asset¶
-
signed_transaction
graphene::wallet::wallet_api::settle_asset(string account_to_settle, string amount_to_settle, string symbol, 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 global_property_object.
- Return
- the signed transaction settling the named asset
- Parameters
account_to_settle: the name or id of the account owning the assetamount_to_settle: the amount of the named asset to schedule for settlementsymbol: the name or id of the asset to settlement onbroadcast: true to broadcast the transaction on the network
5.4.5. 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¶
5.4.6. get_limit_orders¶
-
vector<limit_order_object>
graphene::wallet::wallet_api::get_limit_orders(string a, string b, uint32_t limit) const¶
5.4.7. get_call_orders¶
-
vector<call_order_object>
graphene::wallet::wallet_api::get_call_orders(string a, uint32_t limit) const¶
5.4.8. get_settle_orders¶
-
vector<force_settlement_object>
graphene::wallet::wallet_api::get_settle_orders(string a, uint32_t limit) const¶
5.5. Asset Calls¶
5.5.1. list_assets¶
-
vector<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.- Return
- the list of asset objects, ordered by symbol
- Parameters
lowerbound: the symbol of the first asset to include in the list.limit: the maximum number of assets to return (max: 100)
5.5.2. 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.
- Return
- the signed transaction creating a new asset
- Parameters
issuer: the name or id of the account who will pay the fee and become the issuer of the new asset. This can be updated latersymbol: the ticker symbol of the new assetprecision: the number of digits of precision to the right of the decimal point, must be less than or equal to 12common: asset 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_opts: options specific to BitAssets. This may be null unless themarket_issuedflag is set in common.flagsbroadcast: true to broadcast the transaction on the network
5.5.3. update_asset¶
-
signed_transaction
graphene::wallet::wallet_api::update_asset(string symbol, 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. - Return
- the signed transaction updating the asset
- Parameters
symbol: the name or id of the asset to updatenew_issuer: if changing the asset’s issuer, the name or id of the new issuer. null if you wish to remain the issuer of the assetnew_options: the new asset_options object, which will entirely replace the existing options.broadcast: true to broadcast the transaction on the network
5.5.4. update_bitasset¶
-
signed_transaction
graphene::wallet::wallet_api::update_bitasset(string symbol, 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
- update_asset()
- Return
- the signed transaction updating the bitasset
- Parameters
symbol: the name or id of the asset to update, which must be a market-issued assetnew_options: the new bitasset_options object, which will entirely replace the existing options.broadcast: true to broadcast the transaction on the network
5.5.5. update_asset_feed_producers¶
-
signed_transaction
graphene::wallet::wallet_api::update_asset_feed_producers(string symbol, 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.
- Return
- the signed transaction updating the bitasset’s feed producers
- Parameters
symbol: the name or id of the asset to updatenew_feed_producers: a list of account names or ids which are authorized to produce feeds for the asset. this list will completely replace the existing listbroadcast: true to broadcast the transaction on the network
5.5.6. publish_asset_feed¶
-
signed_transaction
graphene::wallet::wallet_api::publish_asset_feed(string publishing_account, string symbol, 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.
- Return
- the signed transaction updating the price feed for the given asset
- Parameters
publishing_account: the account publishing the price feedsymbol: the name or id of the asset whose feed we’re publishingfeed: the price_feed object containing the three prices making up the feedbroadcast: true to broadcast the transaction on the network
5.5.7. issue_asset¶
-
signed_transaction
graphene::wallet::wallet_api::issue_asset(string to_account, string amount, string symbol, string memo, bool broadcast = false) Issue new shares of an asset.
- Return
- the signed transaction issuing the new shares
- Parameters
to_account: the name or id of the account to receive the new sharesamount: the amount to issue, in nominal unitssymbol: the ticker symbol of the asset to issuememo: a memo to include in the transaction, readable by the recipientbroadcast: true to broadcast the transaction on the network
5.5.8. get_asset¶
-
asset_object
graphene::wallet::wallet_api::get_asset(string asset_name_or_id) const Returns information about the given asset.
- Return
- the information about the asset stored in the block chain
- Parameters
asset_name_or_id: the symbol or id of the asset in question
5.5.9. get_bitasset_data¶
-
asset_bitasset_data_object
graphene::wallet::wallet_api::get_bitasset_data(string asset_name_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().- Return
- the BitAsset-specific data for this asset
- Parameters
asset_name_or_id: the symbol or id of the BitAsset in question
5.5.10. fund_asset_fee_pool¶
-
signed_transaction
graphene::wallet::wallet_api::fund_asset_fee_pool(string from, string symbol, 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.
- Return
- the signed transaction funding the fee pool
- Parameters
from: the name or id of the account sending the core assetsymbol: the name or id of the asset whose fee pool you wish to fundamount: the amount of the core asset to depositbroadcast: true to broadcast the transaction on the network
5.5.11. reserve_asset¶
-
signed_transaction
graphene::wallet::wallet_api::reserve_asset(string from, string amount, string symbol, bool broadcast = false) Burns the given user-issued asset.
This command burns the user-issued asset to reduce the amount in circulation.
- Note
- you cannot burn market-issued assets.
- Return
- the signed transaction burning the asset
- Parameters
from: the account containing the asset you wish to burnamount: the amount to burn, in nominal unitssymbol: the name or id of the asset to burnbroadcast: true to broadcast the transaction on the network
5.5.12. global_settle_asset¶
-
signed_transaction
graphene::wallet::wallet_api::global_settle_asset(string symbol, 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 flag set
When this operation is executed all balances are converted into the backing asset at the settle_price and all open margin positions are called at the settle price. If this asset is used as backing for other bitassets, those bitassets will be force settled at their current feed price.
- Note
- this operation is used only by the asset issuer,
settle_asset()may be used by any user owning the asset - Return
- the signed transaction settling the named asset
- Parameters
symbol: the name or id of the asset to force settlement onsettle_price: the price at which to settlebroadcast: true to broadcast the transaction on the network
5.6. Governance¶
5.6.1. 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.
- Return
- the signed transaction registering a committee_member
- Parameters
owner_account: the name or id of the account which is creating the committee_memberurl: a 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.broadcast: true to broadcast the transaction on the network
5.6.2. get_witness¶
-
witness_object
graphene::wallet::wallet_api::get_witness(string owner_account) Returns information about the given witness.
- Return
- the information about the witness stored in the block chain
- Parameters
owner_account: the name or id of the witness account owner, or the id of the witness
5.6.3. get_committee_member¶
-
committee_member_object
graphene::wallet::wallet_api::get_committee_member(string owner_account) Returns information about the given committee_member.
- Return
- the information about the committee_member stored in the block chain
- Parameters
owner_account: the name or id of the committee_member account owner, or the id of the committee_member
5.6.4. 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
lowerboundand limit parameters to page through the list. To retrieve all witnesss, start by settinglowerboundto the empty string"", and then each iteration, pass the last witness name returned as thelowerboundfor the nextlist_witnesss()call.- Return
- a list of witnesss mapping witness names to witness ids
- Parameters
lowerbound: the name of the first witness to return. If the named witness does not exist, the list will start at the witness that comes afterlowerboundlimit: the maximum number of witnesss to return (max: 1000)
5.6.5. 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
lowerboundand limit parameters to page through the list. To retrieve all committee_members, start by settinglowerboundto the empty string"", and then each iteration, pass the last committee_member name returned as thelowerboundfor the nextlist_committee_members()call.- Return
- a list of committee_members mapping committee_member names to committee_member ids
- Parameters
lowerbound: the 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 afterlowerboundlimit: the maximum number of committee_members to return (max: 1000)
5.6.6. 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.
- Return
- the signed transaction registering a witness
- Parameters
owner_account: the name or id of the account which is creating the witnessurl: a URL to include in the witness record in the blockchain. Clients may display this when showing a list of witnesses. May be blank.broadcast: true to broadcast the transaction on the network
5.6.7. 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_name: The name of the witness’s owner account. Also accepts the ID of the owner account or the ID of the witness.url: Same as for create_witness. The empty string makes it remain the same.block_signing_key: The new block signing public key. The empty string makes it remain the same.broadcast: true if you wish to broadcast the transaction.
5.6.8. create_worker¶
Create a worker object.
- Parameters
owner_account: The account which owns the worker and will be paidwork_begin_date: When the work beginswork_end_date: When the work endsdaily_pay: Amount of pay per day (NOT per maint interval)name: Any texturl: Any textworker_settings: {«type» : «burn»|»refund»|»vesting», «pay_vesting_period_days» : x}broadcast: true if you wish to broadcast the transaction.
5.6.9. 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 a worker
- Parameters
account: The account which will pay the fee and update votes.delta: {«vote_for» : […], «vote_against» : […], «vote_abstain» : […]}broadcast: true if you wish to broadcast the transaction.
5.6.10. 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_memberes they approve of. This command allows you to add or remove committee_memberes from this list. Each account’s vote is weighted according to the number of shares of the core asset 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.
- Return
- the signed transaction changing your vote for the given committee_member
- Parameters
voting_account: the name or id of the account who is voting with their sharescommittee_member: the name or id of the committee_member“ owner accountapprove: true if you wish to vote in favor of that committee_member, false to remove your vote in favor of that committee_memberbroadcast: true if you wish to broadcast the transaction
5.6.11. 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 shares of the core asset 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.
- Return
- the signed transaction changing your vote for the given witness
- Parameters
voting_account: the name or id of the account who is voting with their shareswitness: the name or id of the witness“ owner accountapprove: true if you wish to vote in favor of that witness, false to remove your vote in favor of that witnessbroadcast: true if you wish to broadcast the transaction
5.6.12. 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.
- Return
- the signed transaction changing your vote proxy settings
- Parameters
account_to_modify: the name or id of the account to updatevoting_account: the name or id of an account authorized to vote account_to_modify’s shares, or null to vote your own sharesbroadcast: true if you wish to broadcast the transaction
5.6.13. 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.
- Return
- the signed transaction changing your vote proxy settings
- Parameters
account_to_modify: the name or id of the account to updatedesired_number_of_witnesses: desired number of active witnessesdesired_number_of_committee_members: desired number of active committee membersbroadcast: true if you wish to broadcast the transaction
5.6.14. 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.
- Return
- the signed version of the transaction
- Parameters
proposing_account: The account paying the fee to propose the txexpiration_time: Timestamp specifying when the proposal will either take effect or expire.changed_values: The values to change; all other chain parameters are filled in with default valuesbroadcast: true if you wish to broadcast the transaction
5.6.15. 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.
- Return
- the signed version of the transaction
- Parameters
proposing_account: The account paying the fee to propose the txexpiration_time: Timestamp specifying when the proposal will either take effect or expire.changed_values: Map 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.broadcast: true if you wish to broadcast the transaction
5.7. Privacy Mode¶
5.7.1. 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 the label for a public key
- Note
- No two keys can have the same label.
- Return
- true if the label was set, otherwise false
5.7.2. get_key_label¶
-
string
graphene::wallet::wallet_api::get_key_label(public_key_type key) const¶
5.7.3. get_public_key¶
-
public_key_type
graphene::wallet::wallet_api::get_public_key(string label) const - Return
- the public key associated with the given label
5.7.4. get_blind_accounts¶
-
map<string, public_key_type>
graphene::wallet::wallet_api::get_blind_accounts() const - Return
- all blind accounts
5.7.5. get_my_blind_accounts¶
-
map<string, public_key_type>
graphene::wallet::wallet_api::get_my_blind_accounts() const - Return
- all blind accounts for which this wallet has the private key
5.7.6. get_blind_balances¶
-
vector<asset>
graphene::wallet::wallet_api::get_blind_balances(string key_or_label) - Return
- the total balance of all blinded commitments that can be claimed by the given account key or label
5.7.7. 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.
5.7.8. transfer_to_blind¶
-
blind_confirmation
graphene::wallet::wallet_api::transfer_to_blind(string from_account_id_or_name, string asset_symbol, vector<pair<string, string>> to_amounts, bool broadcast = false) - Parameters
to_amounts: map from key or label to amount
Transfers a public balance from
from_account_id_or_nameto one or more blinded balances using a stealth transfer.Transfers a public balance from to one or more blinded balances using a stealth transfer.
5.7.9. transfer_from_blind¶
-
blind_confirmation
graphene::wallet::wallet_api::transfer_from_blind(string from_blind_account_key_or_label, string to_account_id_or_name, string amount, string asset_symbol, bool broadcast = false) Transfers funds from a set of blinded balances to a public account balance.
5.7.10. blind_transfer¶
-
blind_confirmation
graphene::wallet::wallet_api::blind_transfer(string from_key_or_label, string to_key_or_label, string amount, string symbol, bool broadcast = false) Used to transfer from one set of blinded balances to another
5.7.11. blind_history¶
-
vector<blind_receipt>
graphene::wallet::wallet_api::blind_history(string key_or_account) - Return
- all blind receipts to/form a particular account
5.7.12. 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
opt_from: if not empty and the sender is a unknown public key, then the unknown public key will be given the labelopt_fromconfirmation_receipt: a base58 encoded stealth confirmationopt_memo: a self-defined label for this transfer to be saved in local wallet file
5.8. Blockchain Inspection¶
5.8.1. get_block¶
-
optional<signed_block_with_info>
graphene::wallet::wallet_api::get_block(uint32_t num)¶
5.8.2. get_account_count¶
-
uint64_t
graphene::wallet::wallet_api::get_account_count() const Returns the number of accounts registered on the blockchain
- Return
- the number of registered accounts
5.8.3. 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
get_dynamic_global_properties()for frequently changing properties- Return
- the global properties
5.8.4. 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
get_global_properties()for less-frequently changing properties- Return
- the dynamic global properties
5.8.5. 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 haveget_account(), but this function will work for any object.- Return
- the requested object
- Parameters
id: the id of the object to return
5.9. Transaction Builder¶
5.9.1. begin_builder_transaction¶
-
transaction_handle_type
graphene::wallet::wallet_api::begin_builder_transaction()¶
5.9.2. add_operation_to_builder_transaction¶
-
void
graphene::wallet::wallet_api::add_operation_to_builder_transaction(transaction_handle_type transaction_handle, const operation &op)¶
5.9.3. 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)¶
5.9.4. set_fees_on_builder_transaction¶
-
asset
graphene::wallet::wallet_api::set_fees_on_builder_transaction(transaction_handle_type handle, string fee_asset = GRAPHENE_SYMBOL)¶
5.9.5. preview_builder_transaction¶
-
transaction
graphene::wallet::wallet_api::preview_builder_transaction(transaction_handle_type handle)¶
5.9.6. sign_builder_transaction¶
-
signed_transaction
graphene::wallet::wallet_api::sign_builder_transaction(transaction_handle_type transaction_handle, bool broadcast = true)¶
5.9.7. 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)¶
5.9.8. 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)¶
5.9.9. remove_builder_transaction¶
-
void
graphene::wallet::wallet_api::remove_builder_transaction(transaction_handle_type handle)¶
5.9.10. serialize_transaction¶
-
string
graphene::wallet::wallet_api::serialize_transaction(signed_transaction tx) const Converts a signed_transaction in JSON form to its binary representation.
- Return
- 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
- Parameters
tx: the transaction to serialize
5.9.11. 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
- Return
- the signed version of the transaction
- Parameters
tx: the unsigned transactionbroadcast: true if you wish to broadcast the transaction
5.9.12. 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.- Return
- a default-constructed operation of the given type
- Parameters
operation_type: the type of operation to return, must be one of the operations defined ingraphene/chain/operations.hpp(e.g., «global_parameters_update_operation»)