Random Number Generator (RNG)
Other Documentation
Asset Calls

Asset Calls

list_assets

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.
1
vector<extended_asset_object> graphene::wallet::wallet_api::list_assets(
2
const string &lowerbound,
3
uint32_t limit)const
Copied!
Parameters
Return
  • lowerbound: the symbol of the first asset to include in the list.
  • limit: the maximum number of assets to return (max: 100)
The list of asset objects, ordered by symbol.

create_asset

Creates a new user-issued or market-issued asset.
Many options can be changed later using update_asset()
Note: 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.
1
signed_transaction graphene::wallet::wallet_api::create_asset(
2
string issuer,
3
string symbol,
4
uint8_t precision,
5
asset_options common,
6
fc::optional<bitasset_options> bitasset_opts,
7
bool broadcast = false)
Copied!
Parameters
Return
  • 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 later
  • symbol: the ticker symbol of the new asset
  • precision: the number of digits of precision to the right of the decimal point, must be less than or equal to 12
  • common: 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 the market_issued flag is set in common.flags
  • broadcast: true to broadcast the transaction on the network
The signed transaction creating a new asset.

update_asset

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.
1
signed_transaction graphene::wallet::wallet_api::update_asset(
2
string symbol,
3
optional<string> new_issuer,
4
asset_options new_options,
5
bool broadcast = false)
Copied!
Parameters
Return
  • symbol: the name or id of the asset to update
  • new_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 asset
  • new_options: the new asset_options object, which will entirely replace the existing options.
  • broadcast: true to broadcast the transaction on the network
The signed transaction updating the asset

update_bitasset

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.
1
signed_transaction graphene::wallet::wallet_api::update_bitasset(
2
string symbol,
3
bitasset_options new_options,
4
bool broadcast = false)
Copied!
Parameters
Return
  • symbol: the name or id of the asset to update, which must be a market-issued asset
  • new_options: the new bitasset_options object, which will entirely replace the existing options.
  • broadcast: true to broadcast the transaction on the network
The signed transaction updating the Bitasset

update_asset_feed_producers

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.
1
signed_transaction graphene::wallet::wallet_api::update_asset_feed_producers(
2
string symbol,
3
flat_set<string> new_feed_producers,
4
bool broadcast = false)
Copied!
Parameters
Return
  • symbol: the name or id of the asset to update
  • new_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 list
  • broadcast: true to broadcast the transaction on the network
The signed transaction updating the BitAsset’s feed producers

publish_asset_feed

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,
  • 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: The asset IDs are opposite to each other, 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.
1
signed_transaction graphene::wallet::wallet_api::publish_asset_feed(
2
string publishing_account,
3
string symbol,
4
price_feed feed,
5
bool broadcast = false)
Copied!
Parameters
Return
  • publishing_account: the account publishing the price feed
  • symbol: the name or id of the asset whose feed we’re publishing
  • feed: the price_feed object containing the three prices making up the feed
  • broadcast: true to broadcast the transaction on the network
The signed transaction updating the price feed for the given asset.

issue_asset

Issue new shares of an asset.
1
signed_transaction graphene::wallet::wallet_api::issue_asset(
2
string to_account,
3
string amount,
4
string symbol,
5
string memo,
6
bool broadcast = false)
Copied!
Parameters
Return
  • to_account: the name or id of the account to receive the new shares
  • amount: the amount to issue, in nominal units
  • symbol: the ticker symbol of the asset to issue
  • memo: a memo to include in the transaction, readable by the recipient
  • broadcast: true to broadcast the transaction on the network
The signed transaction issuing the new shares

get_asset

Returns information about the given asset.
1
extended_asset_object graphene::wallet::wallet_api::get_asset(
2
string asset_name_or_id)const
Copied!
Parameters
Return
  • asset_name_or_id: the symbol or id of the asset in question
The information about the asset stored in the block chain.

get_bitasset_data

Returns the BitAsset-specific data for a given asset. Market-issued assets’s behaviour are determined both by their “BitAsset Data” and their basic asset data, as returned by get_asset()
1
asset_bitasset_data_object graphene::wallet::wallet_api::get_bitasset_data(
2
string asset_name_or_id)const
Copied!
Parameters
Return
  • asset_name_or_id: the symbol or id of the BitAsset in question
The BitAsset-specific data for this asset

fund_asset_fee_pool

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.
1
signed_transaction graphene::wallet::wallet_api::fund_asset_fee_pool(
2
string from,
3
string symbol,
4
string amount,
5
bool broadcast = false)
Copied!
Parameters
Return
  • from: the name or id of the account sending the core asset
  • symbol: the name or id of the asset whose fee pool you wish to fund
  • amount: the amount of the core asset to deposit
  • broadcast: true to broadcast the transaction on the network
The signed transaction funding the fee pool.

reserve_asset

Burns an amount of given asset.
This command burns an amount of given asset to reduce the amount in circulation.
Note: You can't burn market-issued assets.
1
signed_transaction graphene::
2
wallet
3
::
4
wallet_api
5
::reserve_asset(string from, string amount, string symbol, bool broadcast = false)
Copied!
Parameters
Return
  • from: the account containing the asset you wish to burn
  • amount: the amount to burn, in nominal units
  • symbol: the name or id of the asset to burn
  • broadcast: true to broadcast the transaction on the network
The signed transaction burning the asset

global_settle_asset

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 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.
1
signed_transaction graphene::
2
wallet
3
::
4
wallet_api
5
::global_settle_asset(string symbol, price settle_price, bool broadcast = false)
6
Copied!
Parameters
Return
  • symbol: the name or id of the asset to globally settle
  • settle_price: the price at which to settle
  • broadcast: true to broadcast the transaction on the network
The signed transaction settling the named asset