group WalletCLI

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.

Summary

Members Descriptions
public vector< class transaction_detail_object >search_account_history(account_id_type const & account,string const & order,object_id_type const & id,int limit) const Returns the operations on the named account.
public multimap< time_point_sec, price_feed >get_feeds_by_miner(const account_id_type account_id,const uint32_t count) const Get a list of published price feeds by a miner.
public boolcopy_wallet_file(string destination_filename) Copy wallet file to a new file.
public fc::ecc::private_keyderive_private_key(const std::string & prefix_string,int sequence_number) const Derive private key from given prefix and sequence.
public variantinfo() Lists all available commands.
public variant_objectabout() const Returns info such as client version, git version of graphene/fc, version of boost, openssl.
public optional< signed_block_with_info >get_block(uint32_t num) Retrieve a full, signed block with info.
public uint64_tget_account_count() const Returns the number of accounts registered on the blockchain.
public vector<account_object>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.
public map< string,account_id_type>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.
public vector<account_object>search_accounts(const string & term,const string & order,const string & id,uint32_t limit) Get names and IDs for registered accounts that match search term.
public vector<asset>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.
public vector<asset_object>list_assets(const string & lowerbound,uint32_t limit) const Lists all assets registered on the blockchain.
public vector< classtransaction_detail_object>search_account_history(string const & account_name,string const & order,string const & id,int limit) const Returns the operations on the named account.
publicglobal_property_objectget_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 miners, block interval, etc.
publicdynamic_global_property_objectget_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 miner, etc.
publicaccount_objectget_account(string account_name_or_id) const Returns information about the given account.
publicasset_objectget_asset(string asset_name_or_id) const Returns information about the given asset.
publicmonitored_asset_optionsget_monitored_asset_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()](#group___wallet_c_l_i_1ga12dcc7308bd4277d83f62ebcdbe51596).
publicaccount_id_typeget_account_id(string account_name_or_id) const Lookup the id of a named account.
publicasset_id_typeget_asset_id(string asset_name_or_id) const Lookup the id of a named asset.
public variantget_object(object_id_type id) const Returns the blockchain object corresponding to the given id.
public stringget_wallet_filename() const Returns the current wallet filename.
public stringget_private_key(public_key_typepubkey) const Get the WIF private key corresponding to a public key. The private key must already be in the wallet.
public transaction_handle_typebegin_builder_transaction()
public voidadd_operation_to_builder_transaction(transaction_handle_type transaction_handle,constoperation& op) #### Parameters
public voidreplace_operation_in_builder_transaction(transaction_handle_type handle,unsigned operation_index,constoperation& new_op) #### Parameters
publicassetset_fees_on_builder_transaction(transaction_handle_type handle,string fee_asset) #### Parameters
publictransactionpreview_builder_transaction(transaction_handle_type handle) #### Parameters
publicsigned_transactionsign_builder_transaction(transaction_handle_type transaction_handle,bool broadcast) #### Parameters
publicsigned_transactionpropose_builder_transaction(transaction_handle_type handle,time_point_sec expiration,uint32_t review_period_seconds,bool broadcast) #### Parameters
publicsigned_transactionpropose_builder_transaction2(transaction_handle_type handle,string account_name_or_id,time_point_sec expiration,uint32_t review_period_seconds,bool broadcast) #### Parameters
public voidremove_builder_transaction(transaction_handle_type handle) #### Parameters
public boolis_new() const Checks whether the wallet has just been created and has not yet had a password set.
public boolis_locked() const Checks whether the wallet is locked (is unable to use its private keys).
public voidlock() Locks the wallet immediately.
public voidunlock(string password) Unlocks the wallet.
public voidset_password(string password) Sets a new password on the wallet.
public map<public_key_type, string >dump_private_keys() Dumps all private keys owned by the wallet.
public stringhelp() const Returns a list of all commands supported by the wallet API.
public stringgethelp(const string & method) const Returns detailed help on a single API command.
public boolload_wallet_file(string wallet_filename) Loads a specified Graphene wallet.
public voidsave_wallet_file(string wallet_filename) Saves the current wallet to the given filename.
public voidset_wallet_filename(string wallet_filename) Sets the wallet filename used for future writes.
public brain_key_infosuggest_brain_key() const Suggests a safe brain key to use for creating your account. [create_account_with_brain_key()](#group___wallet_c_l_i_1gae0f64d97393cae7db848eeffc75c491d) 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).
public pair< brain_key_info, el_gamal_key_pair >generate_brain_key_el_gamal_key() const Suggests a safe brain key to use for creating your account also generates the el_gamal_key_pair corresponding to the brain key [create_account_with_brain_key()](#group___wallet_c_l_i_1gae0f64d97393cae7db848eeffc75c491d) 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).
public brain_key_infoget_brain_key_info(string const & brain_key) const Calculates the private key and public key corresponding to any brain key.
public stringserialize_transaction(signed_transactiontx) const Converts a signed_transaction in JSON form to its binary representation.
public boolimport_key(string account_name_or_id,string wif_key) Imports the private key for an existing account.
public map< string, bool >import_accounts(string filename,string password) Imports accounts from the other wallet file.
public boolimport_account_keys(string filename,string password,string src_account_name,string dest_account_name) Imports account keys from particular account from another wallet file to desired account located in wallet file currently used.
public stringnormalize_brain_key(string s) const Transforms a brain key to reduce the chance of errors when re-entering the key from memory.
publicsigned_transactionregister_account(string name,public_key_typeowner,public_key_typeactive,string registrar_account,bool broadcast) Registers a third party's account on the blockckain.
publicsigned_transactioncreate_account_with_brain_key(string brain_key,string account_name,string registrar_account,bool broadcast) Creates a new account and registers it on the blockchain.
publicsigned_transactioncreate_account_with_brain_key_noimport(string brain_key,string account_name,string registrar_account,bool broadcast) Creates a new account and registers it on the blockchain, but does not import the key to wallet.
publicsigned_transactiontransfer(string from,string to,string amount,string asset_symbol,string memo,bool broadcast) Transfer an amount from one account to another.
public inline pair<transaction_id_type](#namespacegraphene_1_1chain_1adc38ef0a36d8b8dfcef2cbbcacb6d1e8), [signed_transaction>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.
public voidpropose_transfer(string proposer,string from,string to,string amount,string asset_symbol,string memo,time_point_sec expiration) Encapsulates begin_builder_transaction(), add_operation_to_builder_transaction(), propose_builder_transaction2(), set_fees_on_builder_transaction() functions for transfer operation.
public inlinetransaction_id_typeget_transaction_id(constsigned_transaction& trx) const This method is used to convert a JSON transaction to its transaction ID.
publicsigned_transactioncreate_monitored_asset(string issuer,string symbol,uint8_t precision,string description,uint32_t feed_lifetime_sec,uint8_t minimum_feeds,bool broadcast) Creates a new monitored asset.
publicsigned_transactionupdate_monitored_asset(string symbol,string description,uint32_t feed_lifetime_sec,uint8_t minimum_feeds,bool broadcast) Update the options specific to a monitored asset.
publicsigned_transactioncreate_user_issued_asset(string issuer,string symbol,uint8_t precision,string description,uint64_t max_supply,pricecore_exchange_rate,bool is_exchangeable,bool broadcast) Creates a new user-issued asset.
publicsigned_transactionupdate_user_issued_asset(string symbol,string new_issuer,string description,uint64_t max_supply,pricecore_exchange_rate,bool is_exchangeable,bool broadcast) Update the options specific to a user issued asset.
publicsigned_transactionpublish_asset_feed(string publishing_account,string symbol,price_feedfeed,bool broadcast) Publishes a price feed for the named asset.
public multimap< time_point_sec,price_feed>get_feeds_by_miner(const string & account_name_or_id,const uint32_t count) Get a list of published price feeds by a miner.
public map< string,miner_id_type>list_miners(const string & lowerbound,uint32_t limit) Lists all miners registered in the blockchain. This returns a list of all account names that own miners, and the associated miner id, sorted by name. This lists miners whether they are currently voted in or not.
publicminer_objectget_miner(string owner_account) Returns information about the given miner.
publicsigned_transactioncreate_miner(string owner_account,string url,bool broadcast) Creates a miner object owned by the given account.
publicsigned_transactionupdate_miner(string miner_name,string url,string block_signing_key,bool broadcast) Update a miner object owned by the given account.
public vector< vesting_balance_object_with_info >get_vesting_balances(string account_name) Get information about a vesting balance object.
publicsigned_transactionwithdraw_vesting(string miner_name,string amount,string asset_symbol,bool broadcast) Withdraw a vesting balance.
publicsigned_transactionvote_for_miner(string voting_account,string miner,bool approve,bool broadcast) Vote for a given miner.
publicsigned_transactionset_voting_proxy(string account_to_modify,optional< string > voting_account,bool broadcast) Set the voting proxy for an account.
publicsigned_transactionset_desired_miner_count(string account_to_modify,uint16_t desired_number_of_miners,bool broadcast) Set your vote for the number of miners in the system.
publicsigned_transactionsign_transaction(signed_transactiontx,bool broadcast) Signs a transaction.
publicoperationget_prototype_operation(string operation_type) Returns an uninitialized object representing a given blockchain operation.
publicsigned_transactionpropose_parameter_change(const string & proposing_account,fc::time_point_sec expiration_time,const variant_object & changed_values,bool broadcast) Creates a transaction to propose a parameter change.
publicsigned_transactionpropose_fee_change(const string & proposing_account,fc::time_point_sec expiration_time,const variant_object & changed_values,bool broadcast) Propose a fee change.
publicsigned_transactionapprove_proposal(const string & fee_paying_account,const string & proposal_id,const approval_delta & delta,bool broadcast) Approve or disapprove a proposal.
public voiddbg_make_mia(string creator,string symbol) #### Parameters
public voiddbg_push_blocks(std::string src_filename,uint32_t count) #### Parameters
public voiddbg_generate_blocks(std::string debug_wif_key,uint32_t count) #### Parameters
public voiddbg_stream_json_objects(const std::string & filename) #### Parameters
public voiddbg_update_object(fc::variant_object update) #### Parameters
public voidflood_network(string prefix,uint32_t number_of_transactions) #### Parameters
public voidnetwork_add_nodes(const vector< string > & nodes) #### Parameters
public vector< variant >network_get_connected_peers()
publicreal_supplyget_real_supply() const Get current supply of the core asset
publicsigned_transactionset_publishing_manager(const string from,const vector< string > to,bool is_allowed,bool broadcast) This method is used to promote account to publishing manager. Such an account can grant or remove right to publish a content. Only DECENT account has permission to use this method.
publicsigned_transactionset_publishing_right(const string from,const vector< string > to,bool is_allowed,bool broadcast) Allows account to publish a content. Only account with publishing manager status has permission to use this method.
public vector<account_id_type>list_publishing_managers(const string & lower_bound_name,uint32_t limit) Get a list of accounts holding publishing manager status.
publicsigned_transactionsubmit_content(string const & author,vector< pair< string, uint32_t >> co_authors,string const & URI,vector< regional_price_info > const & price_amounts,uint64_t size,fc::ripemd160 const & hash,vector<account_id_type> const & seeders,uint32_t quorum,fc::time_point_sec const & expiration,string const & publishing_fee_asset,string const & publishing_fee_amount,string const & synopsis,DInteger const & secret,decent::encrypt::CustodyData const & cd,bool broadcast) Submits or resubmits content to the blockchain. In a case of resubmit, co-authors, price and synopsis fields can be modified.
public voidsubmit_content_async(string const & author,vector< pair< string, uint32_t >> co_authors,string const & content_dir,string const & samples_dir,string const & protocol,vector< regional_price_info > const & price_amounts,vector<account_id_type> const & seeders,fc::time_point_sec const & expiration,string const & synopsis) This function is used to create package, upload package and submit content in one step.
publicsigned_transactioncontent_cancellation(string author,string URI,bool broadcast) This function can be used to cancel submitted content. This content is immediately not available to purchase. Seeders keep seeding this content in next 24 hours.
public voiddownload_content(string const & consumer,string const & URI,string const & region_code_from,bool broadcast) Downloads encrypted content specified by provided URI.
public optional< content_download_status >get_download_status(string consumer,string URI) const Get status about particular download process specified by provided URI.
publicsigned_transactionrequest_to_buy(string consumer,string URI,string price_asset_name,string price_amount,string str_region_code_from,bool broadcast) This function is used to send a request to buy a content. This request is caught by seeders.
public voidseeding_startup(string account_id_type_or_name,DInteger content_private_key,string seeder_private_key,uint64_t free_space,uint32_t seeding_price,string packages_path,string region_code) This method allows user to start seeding plugin from running application.
public voidleave_rating_and_comment(string consumer,string URI,uint64_t rating,string comment,bool broadcast) Rates and comments a content.
publicsigned_transactionsubscribe_to_author(string from,string to,string price_amount,string price_asset_symbol,bool broadcast) Creates a subscription to author. This function is used by consumers.
publicsigned_transactionsubscribe_by_author(string from,string to,bool broadcast) Creates a subscription to author. This function is used by author.
publicsigned_transactionset_subscription(string account,bool allow_subscription,uint32_t subscription_period,string price_amount,string price_asset_symbol,bool broadcast) This function can be used to allow/disallow subscription.
publicsigned_transactionset_automatic_renewal_of_subscription(string account_id_or_name,subscription_id_typesubscription_id,bool automatic_renewal,bool broadcast) This function can be used to allow/disallow automatic renewal of expired subscription.
public vector<subscription_object>list_active_subscriptions_by_consumer(const string & account_id_or_name,const uint32_t count) const Get a list of consumer's active (not expired) subscriptions.
public vector<subscription_object>list_subscriptions_by_consumer(const string & account_id_or_name,const uint32_t count) const Get a list of consumer's subscriptions.
public vector<subscription_object>list_active_subscriptions_by_author(const string & account_id_or_name,const uint32_t count) const Get a list of active (not expired) subscriptions to author.
public vector<subscription_object>list_subscriptions_by_author(const string & account_id_or_name,const uint32_t count) const Get a list of subscriptions to author.
public DIntegerrestore_encryption_key(std::string account,buying_id_typebuying) Restores AES key( used to encrypt and decrypt a content) from key particles stored in a buying object.
public el_gamal_key_pairgenerate_el_gamal_keys() const Generates private ElGamal key and corresponding public key.
public el_gamal_key_pair_strget_el_gammal_key(string const & consumer) const Gets unique ElGamal key pair for consumer.
public DIntegergenerate_encryption_key() const Generates AES encryption key.
public vector<buying_object>get_open_buyings() const Get a list of open buyings.
public vector<buying_object>get_open_buyings_by_URI(const string & URI) const Get a list of open buyings by URI.
public vector<buying_object>get_open_buyings_by_consumer(const string & account_id_or_name) const Get a list of open buyings by consumer.
public vector<buying_object>get_buying_history_objects_by_consumer(const string & account_id_or_name) const Get history buyings by consumer.
public vector< buying_object_ex >search_my_purchases(const string & account_id_or_name,const string & term,const string & order,const string & id,uint32_t count) const Get history buying objects by consumer that match search term.
public optional<buying_object>get_buying_by_consumer_URI(const string & account_id_or_name,const string & URI) const Get buying (open or history) by consumer and URI.
public vector< rating_object_ex >search_feedback(const string & user,const string & URI,const string & id,uint32_t count) const Search for term in contents (author, title and description)
public optional<content_object>get_content(const string & URI) const Get a content by URI.
public vector<content_summary>search_content(const string & term,const string & order,const string & user,const string & region_code,const string & id,const string & type,uint32_t count) const Get a list of contents ordered alphabetically by search term.
public vector<content_summary>search_user_content(const string & user,const string & term,const string & order,const string & region_code,const string & id,const string & type,uint32_t count) const Get a list of contents ordered alphabetically by search term.
public vector<seeder_object>list_seeders_by_price(uint32_t count) const Get a list of seeders by price, in increasing order.
public optional< vector<seeder_object> >list_seeders_by_upload(const uint32_t count) const Get a list of seeders ordered by total upload, in decreasing order.
public vector<seeder_object>list_seeders_by_region(const string region_code) const Get a list of seeders by region code.
public vector<seeder_object>list_seeders_by_rating(const uint32_t count) const Get a list of seeders ordered by rating, in decreasing order.
public std::pair< string, decent::encrypt::CustodyData >create_package(const std::string & content_dir,const std::string & samples_dir,const DInteger & aes_key) const Create package from selected files.
public voidextract_package(const std::string & package_hash,const std::string & output_dir,const DInteger & aes_key) const Extract selected package.
public voiddownload_package(const std::string & url) const Download package.
public std::stringupload_package(const std::string & package_hash,const std::string & protocol) const Start uploading package.
public voidremove_package(const std::string & package_hash) const Remove package.
public voidset_transfer_logs(bool enable) const Print statuses of all active transfers.
public std::stringsign_buffer(std::string const & str_buffer,std::string const & str_brainkey) const Sign a buffer.
public boolverify_signature(std::string const & str_buffer,std::string const & str_publickey,std::string const & str_signature) const Verify if the signature is valid.

Members

public vector< class transaction_detail_object >search_account_history(account_id_type const & account,string const & order,object_id_type const & id,int limit) const

Returns the operations on the named account.

This returns a list of transaction detail object, which describe activity on the account.

Parameters

  • account the account to search

  • order Sort data by field

  • id object_id to start searching from

  • limit the number of entries to return (starting from the most recent) (max 100)

Returns

a list of transaction_detail_object

public multimap< time_point_sec, price_feed >get_feeds_by_miner(const account_id_type account_id,const uint32_t count) const

Get a list of published price feeds by a miner.

Parameters

  • account_id id of the account

  • count Maximum number of price feeds to fetch (must not exceed 100)

Returns

list of price feeds published by the miner

public boolcopy_wallet_file(string destination_filename)

Copy wallet file to a new file.

Parameters

  • destination_filename

Returns

true if the wallet is copied, false otherwise

public fc::ecc::private_keyderive_private_key(const std::string & prefix_string,int sequence_number) const

Derive private key from given prefix and sequence.

Parameters

  • prefix_string

  • sequence_number

Returns

private_key Derived private key

public variantinfo()

Lists all available commands.

Returns

List of all available commands

public variant_objectabout() 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

public optional< signed_block_with_info >get_block(uint32_t num)

Retrieve a full, signed block with info.

Parameters

  • num ID of the block

Returns

the referenced block with info, or null if no matching block was found

public uint64_tget_account_count() const

Returns the number of accounts registered on the blockchain.

Returns

the number of registered accounts

public vector<account_object>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

public map< string,account_id_type>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()](#group___wallet_c_l_i_1gade01cfbd19d3aa965d96ce4931880e40) call.

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 after lowerbound

  • limit the maximum number of accounts to return (max: 1000)

Returns

a list of accounts mapping account names to account ids

public vector<account_object>search_accounts(const string & term,const string & order,const string & id,uint32_t limit)

Get names and IDs for registered accounts that match search term.

Parameters

  • term will try to partially match account name or id

  • limit Maximum number of results to return must not exceed 1000

  • order Sort data by field

  • id object_id to start searching from

Returns

Map of account names to corresponding IDs

public vector<asset>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.

Parameters

  • id the name or id of the account whose balances you want

Returns

a list of the given account's balances

public vector<asset_object>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

  • lowerbound the symbol of the first asset to include in the list.

  • limit the maximum number of assets to return (max: 100)

Returns

the list of asset objects, ordered by symbol

public vector< classtransaction_detail_object>search_account_history(string const & account_name,string const & order,string const & id,int limit) const

Returns the operations on the named account.

This returns a list of transaction detail object, which describe activity on the account.

Parameters

  • account_name the name or id of the account

  • order Sort data by field

  • id object_id to start searching from

  • limit the number of entries to return (starting from the most recent) (max 100)

Returns

a list of transaction_detail_object

publicglobal_property_objectget_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 miners, block interval, etc.

See also: [get_dynamic_global_properties()](#group___wallet_c_l_i_1gaaa8f1ab2e2e5fe7a414ada5375e14566) for frequently changing properties

Returns

the global properties

publicdynamic_global_property_objectget_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 miner, etc.

See also: [get_global_properties()](#group___wallet_c_l_i_1ga9f44d453c99ffc99bbd99caa9e065a95) for less-frequently changing properties

Returns

the dynamic global properties

publicaccount_objectget_account(string account_name_or_id) const

Returns information about the given account.

Parameters

  • account_name_or_id the name or id of the account to provide information about

Returns

the public account data stored in the blockchain

publicasset_objectget_asset(string asset_name_or_id) const

Returns information about the given asset.

Parameters

  • asset_name_or_id the symbol or id of the asset in question

Returns

the information about the asset stored in the block chain

publicmonitored_asset_optionsget_monitored_asset_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()](#group___wallet_c_l_i_1ga12dcc7308bd4277d83f62ebcdbe51596).

Parameters

  • asset_name_or_id the symbol or id of the BitAsset in question

Returns

the BitAsset-specific data for this asset

publicaccount_id_typeget_account_id(string account_name_or_id) const

Lookup the id of a named account.

Parameters

  • account_name_or_id the name of the account to look up

Returns

the id of the named account

publicasset_id_typeget_asset_id(string asset_name_or_id) const

Lookup the id of a named asset.

Parameters

  • asset_name_or_id the symbol of an asset to look up

Returns

the id of the given asset

public variantget_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()](#group___wallet_c_l_i_1ga12dcc7308bd4277d83f62ebcdbe51596), accounts have [get_account()](#group___wallet_c_l_i_1gae4133a2fe8f63695385c20d327a88ff9), but this function will work for any object.

Parameters

  • id the id of the object to return

Returns

the requested object

public stringget_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

public stringget_private_key(public_key_typepubkey) const

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

Parameters

  • pubkey Public key

Returns

WIF private key corresponding to a public key

public transaction_handle_typebegin_builder_transaction()

public voidadd_operation_to_builder_transaction(transaction_handle_type transaction_handle,constoperation& op)

Parameters

  • transaction_handle

  • op

public voidreplace_operation_in_builder_transaction(transaction_handle_type handle,unsigned operation_index,constoperation& new_op)

Parameters

  • handle

  • operation_index

  • new_op

publicassetset_fees_on_builder_transaction(transaction_handle_type handle,string fee_asset)

Parameters

  • handle

  • fee_asset

Returns

publictransactionpreview_builder_transaction(transaction_handle_type handle)

Parameters

  • handle

publicsigned_transactionsign_builder_transaction(transaction_handle_type transaction_handle,bool broadcast)

Parameters

  • transaction_handle

  • broadcast true to broadcast the transaction on the network

Returns

publicsigned_transactionpropose_builder_transaction(transaction_handle_type handle,time_point_sec expiration,uint32_t review_period_seconds,bool broadcast)

Parameters

  • handle

  • expiration

  • review_period_seconds

  • broadcast true to broadcast the transaction on the network

Returns

publicsigned_transactionpropose_builder_transaction2(transaction_handle_type handle,string account_name_or_id,time_point_sec expiration,uint32_t review_period_seconds,bool broadcast)

Parameters

  • handle

  • account_name_or_id

  • expiration

  • review_period_seconds

  • broadcast true to broadcast the transaction on the network

Returns

public voidremove_builder_transaction(transaction_handle_type handle)

Parameters

  • handle

public boolis_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

public boolis_locked() const

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

This state can be changed by calling [lock()](#group___wallet_c_l_i_1ga5e7950c9039f0c59e1266d6732d94e09) or [unlock()](#group___wallet_c_l_i_1gae16994a63cfdef1616b6b968117fd29d).

Returns

true if the wallet is locked

public voidlock()

Locks the wallet immediately.

public voidunlock(string password)

Unlocks the wallet.

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

Parameters

  • password the password previously set with [set_password()](#group___wallet_c_l_i_1ga2a5d174ec4fde8633b8e962fabc00804)

public voidset_password(string password)

Sets a new password on the wallet.

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

Parameters

  • password

public map<public_key_type, string >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()](#group___wallet_c_l_i_1ga45e93f4a83143cb8ec6a09b67f91f4bb)

Returns

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

public stringhelp() 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()

Returns

a multi-line string suitable for displaying on a terminal

public stringgethelp(const string & method) const

Returns detailed help on a single API command.

Parameters

  • method the name of the API command you want help with

Returns

a multi-line string suitable for displaying on a terminal

public boolload_wallet_file(string wallet_filename)

Loads a specified Graphene wallet.

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

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()](#group___wallet_c_l_i_1gaa5804e1ee29ff8f2c3bcc668ad2bfbcd)

Parameters

  • wallet_filename the 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

public voidsave_wallet_file(string wallet_filename)

Saves the current wallet to the given filename.

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()](#group___wallet_c_l_i_1gaa5804e1ee29ff8f2c3bcc668ad2bfbcd) to make the filename persist.

Parameters

  • wallet_filename the filename of the new wallet JSON file to create or overwrite. If wallet_filename is empty, save to the current filename.

public voidset_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_filename the new filename to use for future saves

public brain_key_infosuggest_brain_key() const

Suggests a safe brain key to use for creating your account. [create_account_with_brain_key()](#group___wallet_c_l_i_1gae0f64d97393cae7db848eeffc75c491d) 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

public pair< brain_key_info, el_gamal_key_pair >generate_brain_key_el_gamal_key() const

Suggests a safe brain key to use for creating your account also generates the el_gamal_key_pair corresponding to the brain key [create_account_with_brain_key()](#group___wallet_c_l_i_1gae0f64d97393cae7db848eeffc75c491d) 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

public brain_key_infoget_brain_key_info(string const & brain_key) const

Calculates the private key and public key corresponding to any brain key.

Parameters

  • brain_key the brain key to be used for calculation

Returns

the corresponding brain_key_info

public stringserialize_transaction(signed_transactiontx) const

Converts a signed_transaction in JSON form to its binary representation.

TODO: I don't see a broadcast_transaction() function, do we need one?

Parameters

  • tx the 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

public boolimport_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_id the account owning the key

  • wif_key the private key in WIF format

Returns

true if the key was imported

public map< string, bool >import_accounts(string filename,string password)

Imports accounts from the other wallet file.

Parameters

  • filename The filename of the wallet JSON file

  • password User's password to the wallet

Returns

mapped account names to boolean values indicating whether the account was successfully imported

public boolimport_account_keys(string filename,string password,string src_account_name,string dest_account_name)

Imports account keys from particular account from another wallet file to desired account located in wallet file currently used.

Parameters

  • filename The filename of the wallet JSON file

  • password User's password to the wallet

  • src_account_name Name of the source account

  • dest_account_name Name of the destination account

Returns

true if the keys were imported

public stringnormalize_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

  • s the brain key as supplied by the user

Returns

the brain key in its normalized form

publicsigned_transactionregister_account(string name,public_key_typeowner,public_key_typeactive,string registrar_account,bool broadcast)

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

  • 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

  • broadcast true to broadcast the transaction on the network

Returns

the signed transaction registering the account

publicsigned_transactioncreate_account_with_brain_key(string brain_key,string account_name,string registrar_account,bool broadcast)

Creates a new account and registers it on the blockchain.

Todo: why no referrer_percent here?

See also: suggest_brain_key()

See also: register_account()

Parameters

  • 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

  • broadcast true to broadcast the transaction on the network

Returns

the signed transaction registering the account

publicsigned_transactioncreate_account_with_brain_key_noimport(string brain_key,string account_name,string registrar_account,bool broadcast)

Creates a new account and registers it on the blockchain, but does not import the key to wallet.

See also: suggest_brain_key()

See also: register_account()

Parameters

  • 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

  • broadcast true to broadcast the transaction on the network

Returns

the signed transaction registering the account

publicsigned_transactiontransfer(string from,string to,string amount,string asset_symbol,string memo,bool broadcast)

Transfer an amount from one account to another.

Parameters

  • 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 to send half of a BTS, 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

Returns

the signed transaction transferring funds

public inline pair<transaction_id_type](#namespacegraphene_1_1chain_1adc38ef0a36d8b8dfcef2cbbcacb6d1e8), [signed_transaction>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.

Parameters

  • 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 to send half of a BTS, 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

public voidpropose_transfer(string proposer,string from,string to,string amount,string asset_symbol,string memo,time_point_sec expiration)

Encapsulates begin_builder_transaction(), add_operation_to_builder_transaction(), propose_builder_transaction2(), set_fees_on_builder_transaction() functions for transfer operation.

Parameters

  • proposer Proposer

  • 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 to send half of a BTS, 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

  • expiration expiration time

public inlinetransaction_id_typeget_transaction_id(constsigned_transaction& trx) const

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

Parameters

  • trx Signed transaction

Returns

publicsigned_transactioncreate_monitored_asset(string issuer,string symbol,uint8_t precision,string description,uint32_t feed_lifetime_sec,uint8_t minimum_feeds,bool broadcast)

Creates a new monitored asset.

Options can be changed later using [update_monitored_asset()](#group___wallet_c_l_i_1gad8429474b4a796d11e42516a6ddeb017)

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 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

  • description asset description. Maximal length is 1000 chars.

  • feed_lifetime_sec time before a price feed expires

  • minimum_feeds minimum number of unexpired feeds required to extract a median feed from

  • broadcast true to broadcast the transaction on the network

Returns

the signed transaction creating a new asset

publicsigned_transactionupdate_monitored_asset(string symbol,string description,uint32_t feed_lifetime_sec,uint8_t minimum_feeds,bool broadcast)

Update the options specific to a monitored asset.

Monitored assets have some options which are not relevant to other asset types. This operation is used to update those options and an existing monitored asset.

Parameters

  • symbol the name or id of the asset to update, which must be a market-issued asset

  • description asset description

  • feed_lifetime_sec time before a price feed expires

  • minimum_feeds minimum number of unexpired feeds required to extract a median feed from

  • broadcast true to broadcast the transaction on the network

Returns

the signed transaction updating the bitasset

publicsigned_transactioncreate_user_issued_asset(string issuer,string symbol,uint8_t precision,string description,uint64_t max_supply,pricecore_exchange_rate,bool is_exchangeable,bool broadcast)

Creates a new user-issued asset.

Options can be changed later using update_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 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

  • description asset description. Maximal length is 1000 chars

  • max_supply the maximum supply of this asset which may exist at any given time

  • core_exchange_rate 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

  • is_exchangeable True to allow implicit conversion of this asset to/from core asset

  • broadcast true to broadcast the transaction on the network

Returns

the signed transaction creating a new asset

publicsigned_transactionupdate_user_issued_asset(string symbol,string new_issuer,string description,uint64_t max_supply,pricecore_exchange_rate,bool is_exchangeable,bool broadcast)

Update the options specific to a user issued asset.

User issued assets have some options which are not relevant to other asset types. This operation is used to update those options an an existing user issues asset.

Parameters

  • symbol the name or id of the asset to update, which must be a market-issued asset

  • new_issuer if the asset is to be given a new issuer, specify his ID here

  • description asset description

  • max_supply The maximum supply of this asset which may exist at any given time

  • core_exchange_rate Price used to convert non-core asset to core asset

  • is_exchangeable True to allow implicit conversion of this asset to/from core asset

  • broadcast true to broadcast the transaction on the network

Returns

the signed transaction updating the bitasset

publicsigned_transactionpublish_asset_feed(string publishing_account,string symbol,price_feedfeed,bool broadcast)

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 miner feeds for that asset is calculated and the market for the asset is configured with the median of that value.

Parameters

  • 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 for particular market-issued asset

  • broadcast true to broadcast the transaction on the network

Returns

the signed transaction updating the price feed for the given asset

public multimap< time_point_sec,price_feed>get_feeds_by_miner(const string & account_name_or_id,const uint32_t count)

Get a list of published price feeds by a miner.

Parameters

  • account_name_or_id the name or id of the account

  • count Maximum number of price feeds to fetch (must not exceed 100)

Returns

list of price feeds published by the miner

public map< string,miner_id_type>list_miners(const string & lowerbound,uint32_t limit)

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

Use the lowerbound and limit parameters to page through the list. To retrieve all miners, start by setting lowerbound to the empty string "", and then each iteration, pass the last miner name returned as the lowerbound for the next [list_miners()](#group___wallet_c_l_i_1gacbb4b46e0fbf9fe9347bf3a99c425734) call.

Parameters

  • lowerbound the name of the first miner to return. If the named miner does not exist, the list will start at the miner that comes after lowerbound

  • limit the maximum number of miners to return (max: 1000)

Returns

a list of miners mapping miner names to miner ids

publicminer_objectget_miner(string owner_account)

Returns information about the given miner.

s

Parameters

  • owner_account the name or id of the miner account owner, or the id of the miner

Returns

the information about the miner stored in the block chain

publicsigned_transactioncreate_miner(string owner_account,string url,bool broadcast)

Creates a miner object owned by the given account.

An account can have at most one miner object.

Parameters

  • owner_account the name or id of the account which is creating the miner

  • url a URL to include in the miner record in the blockchain. Clients may display this when showing a list of miners. May be blank.

  • broadcast true to broadcast the transaction on the network

Returns

the signed transaction registering a miner

publicsigned_transactionupdate_miner(string miner_name,string url,string block_signing_key,bool broadcast)

Update a miner object owned by the given account.

Parameters

  • miner_name The name of the miner's owner account. Also accepts the ID of the owner account or the ID of the miner.

  • url Same as for create_miner. 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.

public vector< vesting_balance_object_with_info >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.

publicsigned_transactionwithdraw_vesting(string miner_name,string amount,string asset_symbol,bool broadcast)

Withdraw a vesting balance.

Parameters

  • miner_name The account name of the miner, 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

publicsigned_transactionvote_for_miner(string voting_account,string miner,bool approve,bool broadcast)

Vote for a given miner.

An account can publish a list of all miners they approve of. This command allows you to add or remove miners 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.

you cannot vote against a miner, you can only vote for the miner or not vote for the miner.

Parameters

  • voting_account the name or id of the account who is voting with their shares

  • miner the name or id of the miner' owner account

  • approve true if you wish to vote in favor of that miner, false to remove your vote in favor of that miner

  • broadcast true if you wish to broadcast the transaction

Returns

the signed transaction changing your vote for the given miner

publicsigned_transactionset_voting_proxy(string account_to_modify,optional< string > voting_account,bool broadcast)

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_modify the name or id of the account to update

  • voting_account the name or id of an account authorized to vote account_to_modify's shares, or null to vote your own shares

  • broadcast true if you wish to broadcast the transaction

Returns

the signed transaction changing your vote proxy settings

publicsigned_transactionset_desired_miner_count(string account_to_modify,uint16_t desired_number_of_miners,bool broadcast)

Set your vote for the number of miners in the system.

Each account can voice their opinion on how many miners there should be in the active miner list. These are independent of each other. You must vote your approval of at least as many miners as you claim there should be (you can't say that there should be 20 miners 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_modify the name or id of the account to update

  • desired_number_of_miners

  • broadcast true if you wish to broadcast the transaction

Returns

the signed transaction changing your vote proxy settings

publicsigned_transactionsign_transaction(signed_transactiontx,bool broadcast)

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

  • tx the unsigned transaction

  • broadcast true if you wish to broadcast the transaction

Returns

the signed version of the transaction

publicoperationget_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()](#group___wallet_c_l_i_1gab5cd568be3fd1c283e0ed2c1fd3c5469) , 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_type the type of operation to return, must be one of the operations defined in graphene/chain/operations.hpp (e.g., "global_parameters_update_operation")

Returns

a default-constructed operation of the given type

publicsigned_transactionpropose_parameter_change(const string & proposing_account,fc::time_point_sec expiration_time,const variant_object & changed_values,bool broadcast)

Creates a transaction to propose a parameter change.

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

Parameters

  • proposing_account The account paying the fee to propose the tx

  • expiration_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 values

  • broadcast true if you wish to broadcast the transaction

Returns

the signed version of the transaction

publicsigned_transactionpropose_fee_change(const string & proposing_account,fc::time_point_sec expiration_time,const variant_object & changed_values,bool broadcast)

Propose a fee change.

Parameters

  • proposing_account The account paying the fee to propose the tx

  • expiration_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

Returns

the signed version of the transaction

publicsigned_transactionapprove_proposal(const string & fee_paying_account,const string & proposal_id,const approval_delta & delta,bool broadcast)

Approve or disapprove a proposal.

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

Returns

the signed version of the transaction

public voiddbg_make_mia(string creator,string symbol)

Parameters

  • creator

  • symbol

public voiddbg_push_blocks(std::string src_filename,uint32_t count)

Parameters

  • src_filename

  • count

public voiddbg_generate_blocks(std::string debug_wif_key,uint32_t count)

Parameters

  • debug_wif_key

  • count

public voiddbg_stream_json_objects(const std::string & filename)

Parameters

  • filename

public voiddbg_update_object(fc::variant_object update)

Parameters

  • update

public voidflood_network(string prefix,uint32_t number_of_transactions)

Parameters

  • prefix

  • number_of_transactions

public voidnetwork_add_nodes(const vector< string > & nodes)

Parameters

  • nodes

public vector< variant >network_get_connected_peers()

publicreal_supplyget_real_supply() const

Get current supply of the core asset

publicsigned_transactionset_publishing_manager(const string from,const vector< string > to,bool is_allowed,bool broadcast)

This method is used to promote account to publishing manager. Such an account can grant or remove right to publish a content. Only DECENT account has permission to use this method.

See also: set_publishing_right()

Parameters

  • from Account ( DECENT account ) giving/removing status of the publishing manager.

  • to List of accounts getting status of the publishing manager.

  • is_allowed True to give the status, false to remove it

  • broadcast True to broadcast the transaction on the network

Returns

The signed transaction updating account status

publicsigned_transactionset_publishing_right(const string from,const vector< string > to,bool is_allowed,bool broadcast)

Allows account to publish a content. Only account with publishing manager status has permission to use this method.

See also: set_publishing_manager()

Parameters

  • from Account giving/removing right to publish a content.

  • to List of accounts getting right to publish a content.

  • is_allowed True to give the right, false to remove it

  • broadcast True to broadcast the transaction on the network

Returns

The signed transaction updating account status

public vector<account_id_type>list_publishing_managers(const string & lower_bound_name,uint32_t limit)

Get a list of accounts holding publishing manager status.

Parameters

  • lower_bound_name 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: 100)

Returns

List of accounts

publicsigned_transactionsubmit_content(string const & author,vector< pair< string, uint32_t >> co_authors,string const & URI,vector< regional_price_info > const & price_amounts,uint64_t size,fc::ripemd160 const & hash,vector<account_id_type> const & seeders,uint32_t quorum,fc::time_point_sec const & expiration,string const & publishing_fee_asset,string const & publishing_fee_amount,string const & synopsis,DInteger const & secret,decent::encrypt::CustodyData const & cd,bool broadcast)

Submits or resubmits content to the blockchain. In a case of resubmit, co-authors, price and synopsis fields can be modified.

See also: submit_content_new()

Parameters

  • author The author of the content

  • co_authors The co-authors' account name or ID mapped to corresponding payment split based on basis points

  • URI The URI of the content

  • price_amounts The price of the content per regions

  • size The size of the content

  • hash The Hash of the package

  • seeders List of the seeders, which will publish the content

  • quorum Defines number of seeders needed to restore the encryption key

  • expiration The expiration time of the content. The content is available to buy till it's expiration time

  • publishing_fee_asset Ticker symbol of the asset which will be used to publish content

  • publishing_fee_amount Publishing price

  • synopsis The description of the content

  • secret The AES key used to encrypt and decrypt the content

  • cd Custody data

  • broadcast true to broadcast the transaction on the network

Returns

The signed transaction submitting the content

public voidsubmit_content_async(string const & author,vector< pair< string, uint32_t >> co_authors,string const & content_dir,string const & samples_dir,string const & protocol,vector< regional_price_info > const & price_amounts,vector<account_id_type> const & seeders,fc::time_point_sec const & expiration,string const & synopsis)

This function is used to create package, upload package and submit content in one step.

See also: create_package()

See also: upload_package()

See also: submit_content()

Parameters

  • author The author of the content

  • co_authors The co-authors' account name or ID mapped to corresponding payment split based on basis points

  • content_dir Path to the directory containing all content that should be packed

  • samples_dir Path to the directory containing samples of content

  • protocol Protocol for uploading package( ipfs )

  • price_amounts The prices of the content per regions

  • seeders List of the seeders, which will publish the content

  • expiration The expiration time of the content. The content is available to buy till it's expiration time

  • synopsis The description of the content

Returns

The signed transaction submitting the content

publicsigned_transactioncontent_cancellation(string author,string URI,bool broadcast)

This function can be used to cancel submitted content. This content is immediately not available to purchase. Seeders keep seeding this content in next 24 hours.

Parameters

  • author The author of the content

  • URI The URI of the content

  • broadcast True to broadcast the transaction on the network

Returns

signed transaction

public voiddownload_content(string const & consumer,string const & URI,string const & region_code_from,bool broadcast)

Downloads encrypted content specified by provided URI.

Parameters

  • consumer Consumer of the content

  • URI The URI of the content

  • region_code_from Two letter region code

  • broadcast true to broadcast the transaction on the network

public optional< content_download_status >get_download_status(string consumer,string URI) const

Get status about particular download process specified by provided URI.

Parameters

  • consumer Consumer of the content

  • URI The URI of the content

Returns

Download status, or null if no matching download process was found

publicsigned_transactionrequest_to_buy(string consumer,string URI,string price_asset_name,string price_amount,string str_region_code_from,bool broadcast)

This function is used to send a request to buy a content. This request is caught by seeders.

Parameters

  • consumer Consumer of the content

  • URI The URI of the content

  • price_asset_name Ticker symbol of the asset which will be used to buy content

  • price_amount The price of the content

  • str_region_code_from Two letter region code

  • broadcast true to broadcast the transaction on the network

Returns

The signed transaction requesting buying of the content

public voidseeding_startup(string account_id_type_or_name,DInteger content_private_key,string seeder_private_key,uint64_t free_space,uint32_t seeding_price,string packages_path,string region_code)

This method allows user to start seeding plugin from running application.

Parameters

  • account_id_type_or_name Name or ID of account controlling this seeder

  • content_private_key El Gamal content private key

  • seeder_private_key Private key of the account controlling this seeder

  • free_space Allocated disk space, in MegaBytes

  • seeding_price price per MegaByte

  • packages_path Packages storage path

  • region_code Optional ISO 3166-1 alpha-2 two-letter region code

public voidleave_rating_and_comment(string consumer,string URI,uint64_t rating,string comment,bool broadcast)

Rates and comments a content.

Parameters

  • consumer Consumer giving the rating

  • URI The URI of the content

  • rating Rating

  • comment Comment

  • broadcast true to broadcast the transaction on the network

publicsigned_transactionsubscribe_to_author(string from,string to,string price_amount,string price_asset_symbol,bool broadcast)

Creates a subscription to author. This function is used by consumers.

Parameters

  • from Account who wants subscription to author

  • to The author you wish to subscribe to

  • price_amount Price for the subscription

  • price_asset_symbol Ticker symbol of the asset which will be used to buy subscription ( must be DCT token )

  • broadcast True if you wish to broadcast the transaction

Returns

The signed transaction subscribing the consumer to the author

publicsigned_transactionsubscribe_by_author(string from,string to,bool broadcast)

Creates a subscription to author. This function is used by author.

Parameters

  • from The account obtaining subscription from the author

  • to The name or id of the author

  • broadcast True if you wish to broadcast the transaction

Returns

The signed transaction subscribing the consumer to the author

publicsigned_transactionset_subscription(string account,bool allow_subscription,uint32_t subscription_period,string price_amount,string price_asset_symbol,bool broadcast)

This function can be used to allow/disallow subscription.

Parameters

  • account The name or id of the account to update

  • allow_subscription True if account (author) wants to allow subscription, false otherwise

  • subscription_period Duration of subscription in days

  • price_amount Price for subscription per one subscription period

  • price_asset_symbol Ticker symbol of the asset which will be used to buy subscription

  • broadcast True if you wish to broadcast the transaction

Returns

The signed transaction updating the account

publicsigned_transactionset_automatic_renewal_of_subscription(string account_id_or_name,subscription_id_typesubscription_id,bool automatic_renewal,bool broadcast)

This function can be used to allow/disallow automatic renewal of expired subscription.

Parameters

  • account_id_or_name The name or id of the account to update

  • subscription_id The ID of the subscription.

  • automatic_renewal True if account (consumer) wants to allow automatic renewal of subscription, false otherwise

  • broadcast True if you wish to broadcast the transaction

Returns

The signed transaction allowing/disallowing renewal of the subscription

public vector<subscription_object>list_active_subscriptions_by_consumer(const string & account_id_or_name,const uint32_t count) const

Get a list of consumer's active (not expired) subscriptions.

Parameters

  • account_id_or_name The name or id of the consumer

  • count Maximum number of subscriptions to fetch (must not exceed 100)

Returns

List of active subscription objects corresponding to the provided consumer

public vector<subscription_object>list_subscriptions_by_consumer(const string & account_id_or_name,const uint32_t count) const

Get a list of consumer's subscriptions.

Parameters

  • account_id_or_name The name or id of the consumer

  • count Maximum number of subscriptions to fetch (must not exceed 100)

Returns

List of subscription objects corresponding to the provided consumer

public vector<subscription_object>list_active_subscriptions_by_author(const string & account_id_or_name,const uint32_t count) const

Get a list of active (not expired) subscriptions to author.

Parameters

  • account_id_or_name The name or id of the author

  • count Maximum number of subscriptions to fetch (must not exceed 100)

Returns

List of active subscription objects corresponding to the provided author

public vector<subscription_object>list_subscriptions_by_author(const string & account_id_or_name,const uint32_t count) const

Get a list of subscriptions to author.

Parameters

  • account_id_or_name The name or id of the author

  • count Maximum number of subscriptions to fetch (must not exceed 100)

Returns

List of subscription objects corresponding to the provided author

public DIntegerrestore_encryption_key(std::string account,buying_id_typebuying)

Restores AES key( used to encrypt and decrypt a content) from key particles stored in a buying object.

Parameters

  • account Consumers account id or name

  • buying The buying object containing key particles

Returns

restored AES key from particles

public el_gamal_key_pairgenerate_el_gamal_keys() const

Generates private ElGamal key and corresponding public key.

Returns

Pair of ElGamal keys

public el_gamal_key_pair_strget_el_gammal_key(string const & consumer) const

Gets unique ElGamal key pair for consumer.

Returns

Pair of ElGamal keys

public DIntegergenerate_encryption_key() const

Generates AES encryption key.

Returns

Random encryption key

public vector<buying_object>get_open_buyings() const

Get a list of open buyings.

Returns

Open buying objects

public vector<buying_object>get_open_buyings_by_URI(const string & URI) const

Get a list of open buyings by URI.

Parameters

  • URI URI of the buyings to retrieve

Returns

Open buyings corresponding to the provided URI

public vector<buying_object>get_open_buyings_by_consumer(const string & account_id_or_name) const

Get a list of open buyings by consumer.

Parameters

  • account_id_or_name Consumer of the buyings to retrieve

Returns

Open buyings corresponding to the provided consumer

public vector<buying_object>get_buying_history_objects_by_consumer(const string & account_id_or_name) const

Get history buyings by consumer.

Parameters

  • account_id_or_name Consumer of the buyings to retrieve

Returns

History buying objects corresponding to the provided consumer

public vector< buying_object_ex >search_my_purchases(const string & account_id_or_name,const string & term,const string & order,const string & id,uint32_t count) const

Get history buying objects by consumer that match search term.

Parameters

  • account_id_or_name Consumer of the buyings to retrieve

  • term Search term to look up in Title and Description

  • order Sort data by field

  • id Object_id to start searching from

  • count Maximum number of contents to fetch (must not exceed 100)

Returns

History buying objects corresponding to the provided consumer and matching search term

public optional<buying_object>get_buying_by_consumer_URI(const string & account_id_or_name,const string & URI) const

Get buying (open or history) by consumer and URI.

Parameters

  • account_id_or_name Consumer of the buying to retrieve

  • URI URI of the buying to retrieve

Returns

Buying_objects corresponding to the provided consumer, or null if no matching buying was found

public vector< rating_object_ex >search_feedback(const string & user,const string & URI,const string & id,uint32_t count) const

Search for term in contents (author, title and description)

Parameters

  • user Feedback author

  • URI The content object URI

  • id The id of feedback object to start searching from

  • count Maximum number of feedbacks to fetch

Returns

The feedback found

public optional<content_object>get_content(const string & URI) const

Get a content by URI.

Parameters

  • URI URI of the content to retrieve

Returns

The content corresponding to the provided URI, or null if no matching content was found

public vector<content_summary>search_content(const string & term,const string & order,const string & user,const string & region_code,const string & id,const string & type,uint32_t count) const

Get a list of contents ordered alphabetically by search term.

Parameters

  • term Search term

  • order Order field

  • user Content owner

  • region_code Two letter region code

  • id The id of content object to start searching from

  • type The application and content type to be filtered

  • count Maximum number of contents to fetch (must not exceed 100)

Returns

The contents found

public vector<content_summary>search_user_content(const string & user,const string & term,const string & order,const string & region_code,const string & id,const string & type,uint32_t count) const

Get a list of contents ordered alphabetically by search term.

Parameters

  • user Content owner

  • term Search term

  • order Order field

  • region_code Two letter region code

  • id The id of content object to start searching from

  • type The application and content type to be filtered

  • count Maximum number of contents to fetch (must not exceed 100)

Returns

The contents found

public vector<seeder_object>list_seeders_by_price(uint32_t count) const

Get a list of seeders by price, in increasing order.

Parameters

  • count Maximum number of seeders to retrieve

Returns

The seeders found

public optional< vector<seeder_object> >list_seeders_by_upload(const uint32_t count) const

Get a list of seeders ordered by total upload, in decreasing order.

Parameters

  • count Maximum number of seeders to retrieve

Returns

The seeders found

public vector<seeder_object>list_seeders_by_region(const string region_code) const

Get a list of seeders by region code.

Parameters

  • region_code Region code of seeders to retrieve

Returns

The seeders found

public vector<seeder_object>list_seeders_by_rating(const uint32_t count) const

Get a list of seeders ordered by rating, in decreasing order.

Parameters

  • count Maximum number of seeders to retrieve

Returns

The seeders found

public std::pair< string, decent::encrypt::CustodyData >create_package(const std::string & content_dir,const std::string & samples_dir,const DInteger & aes_key) const

Create package from selected files.

Parameters

  • content_dir Directory containing all content that should be packed

  • samples_dir Directory containing samples of content

  • aes_key AES key for encryption

Returns

package hash (ripemd160 hash of package content) and content custody data

public voidextract_package(const std::string & package_hash,const std::string & output_dir,const DInteger & aes_key) const

Extract selected package.

Parameters

  • package_hash Hash of package that needs to be extracted

  • output_dir Directory where extracted files will be created

  • aes_key AES key for decryption

public voiddownload_package(const std::string & url) const

Download package.

Parameters

  • url Magnet or IPFS URL of package

public std::stringupload_package(const std::string & package_hash,const std::string & protocol) const

Start uploading package.

Parameters

  • package_hash Hash of package that needs to be extracted

  • protocol protocol for uploading package ( ipfs )

public voidremove_package(const std::string & package_hash) const

Remove package.

Parameters

  • package_hash Hash of package that needs to be removed

public voidset_transfer_logs(bool enable) const

Print statuses of all active transfers.

public std::stringsign_buffer(std::string const & str_buffer,std::string const & str_brainkey) const

Sign a buffer.

Parameters

  • str_buffer The buffer to be signed

  • str_brainkey Derives the private key used for signature

Returns

The signed buffer

public boolverify_signature(std::string const & str_buffer,std::string const & str_publickey,std::string const & str_signature) const

Verify if the signature is valid.

Parameters

  • str_buffer The original buffer

  • str_publickey The public key used for verification

  • str_signature The signed buffer

Returns

true if valid, otherwise false