Account Calls

Account Calls

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.
1
vector<account_object> graphene::wallet::wallet_api::list_my_accounts()
Copied!
Return
A list of account objects

list_accounts

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.
1
map<string, account_id_type> graphene::wallet::wallet_api::list_accounts(
2
const string &lowerbound,
3
uint32_t limit)
Copied!
Parameters
Return
  • 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 after lowerbound
  • limit: the maximum number of accounts to return (max: 1000)
A list of accounts mapping account names to account ids.

list_account_balances

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 non-zero balance.
1
vector<asset> graphene::wallet::wallet_api::list_account_balances(
2
const string &id)
Copied!
Parameters
Return
  • id: the name or id of the account whose balances you want
A list of the given account’s balances

register_account

Registers a third party’s account on the blockchain.
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.
1
signed_transaction graphene::wallet::wallet_api::register_account(
2
string name,
3
public_key_type owner,
4
public_key_type active,
5
string registrar_account,
6
string referrer_account,
7
uint32_t referrer_percent,
8
bool broadcast = false)
Copied!
Parameters
Return
  • 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 account
  • active: the active key for the new account
  • registrar_account: the account which will pay the fee to register the user
  • referrer_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
The signed transaction registering the account

upgrade_account

Upgrades an account to prime status. This makes the account holder a ‘lifetime member’.
1
signed_transaction graphene::wallet::wallet_api::upgrade_account(
2
string name,
3
bool broadcast)
Copied!
Parameters
Return
  • name: the name or id of the account to upgrade
  • broadcast: true to broadcast the transaction on the network
The signed transaction upgrading the account

create_account_with_brain_key

Creates a new account and registers it on the blockchain.
1
signed_transaction graphene::wallet::wallet_api::create_account_with_brain_key(
2
string brain_key,
3
string account_name,
4
string registrar_account,
5
string referrer_account,
6
bool broadcast = false)
Copied!
Parameters
Return
  • brain_key: the brain key used for generating the account’s private keys
  • account_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 user
  • referrer_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
The signed transaction registering the account

transfer

Transfer an amount from one account to another.
1
signed_transaction graphene::wallet::wallet_api::transfer(
2
string from,
3
string to,
4
string amount,
5
string asset_symbol,
6
string memo,
7
bool broadcast = false)
Copied!
Parameters
Return
  • from: the name or id of the account sending the funds
  • to: the name or id of the account receiving the funds
  • amount: the amount to send (in nominal units, for example to send half of a PPY specify 0.5)
  • asset_symbol: the symbol or id of the asset to send
  • memo: 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 size
  • broadcast: true to broadcast the transaction on the network
The signed transaction transferring funds

transfer2

This method works just like transfer, except it always broadcasts and returns the transaction ID (hash) along with the signed transaction.
1
pair<transaction_id_type, signed_transaction> graphene::wallet::wallet_api::transfer2(
2
string from,
3
string to,
4
string amount,
5
string asset_symbol,
6
string memo)
Copied!
Parameters
Return
  • from: the name or id of the account sending the funds
  • to: the name or id of the account receiving the funds
  • amount: the amount to send (in nominal units, for example to send half of a PPY specify 0.5)
  • asset_symbol: the symbol or id of the asset to send
  • memo: 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 size
The transaction ID (hash) along with the signed transaction transferring funds

whitelist_account

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.
1
signed_transaction graphene::wallet::wallet_api::whitelist_account(
2
string authorizing_account,
3
string account_to_list,
4
account_whitelist_operation::account_listing new_listing_status,
5
bool broadcast = false)
Copied!
Parameters
Return
  • authorizing_account: the account who is doing the whitelisting
  • account_to_list: the account being whitelisted
  • new_listing_status: the new whitelisting status
  • broadcast: true to broadcast the transaction on the network
The signed transaction changing the whitelisting status

get_vesting_balances

Get information about a vesting balance object or vesting balance objects owned by an account.
1
vector<vesting_balance_object_with_info> graphene::wallet::wallet_api::get_vesting_balances(
2
string account_name)
Copied!
Parameters
Return
  • account_name: An account name, account ID, or vesting balance object ID.
A list of vesting balance objects with additional info

withdraw_vesting

Withdraw a vesting balance.
1
signed_transaction graphene::wallet::wallet_api::withdraw_vesting(
2
string witness_name,
3
string amount,
4
string asset_symbol,
5
bool broadcast = false)
Copied!
Parameters
Return
  • 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
The signed transaction

get_account

Returns information about the given account.
1
account_object graphene::wallet::wallet_api::get_account(
2
string account_name_or_id)const
Copied!
Parameters
Return
  • account_name_or_id: the name or ID of the account to provide information about
The public account data stored in the blockchain

get_account_id

Lookup the id of a named account.
1
account_id_type graphene::wallet::wallet_api::get_account_id(
2
string account_name_or_id)const
Copied!
Parameters
Return
  • account_name_or_id: the name or ID of the account to look up
The id of the named account

get_account_history

Returns the most recent operations on the named account.
This returns a list of operation history objects, which describe activity on the account.
1
vector<operation_detail> graphene::wallet::wallet_api::get_account_history(
2
string name,
3
int limit)const
Copied!
Parameters
Return
  • name: the name or id of the account
  • limit: the number of entries to return (starting from the most recent)
A list of operation_history_objects

approve_proposal

Approve or disapprove a proposal.
1
signed_transaction graphene::wallet::wallet_api::approve_proposal(
2
const string &fee_paying_account,
3
const string &proposal_id,
4
const approval_delta &delta,
5
bool broadcast)
Copied!
Parameters
Return
  • 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
The signed version of the transaction