cliwallet code
下面这两个不用管,命令行复制时顺带的。
unlocked >>>
locked >>>
1.
signed_transaction withdraw_vesting(string witness_name, string amount, string asset_symbol, bool broadcast)
unlocked >>> gethelp withdraw_vesting
gethelp withdraw_vesting
Withdraw a vesting balance.
Parameters:
witness_name: The account name of the witness, also accepts account ID
or vesting balance ID type. (type: string)
amount: The amount to withdraw. (type: string)
asset_symbol: The symbol of the asset to withdraw. (type: string)
broadcast: true if you wish to broadcast the transaction (type: bool)
2.
signed_transaction whitelist_account(string authorizing_account, string account_to_list, account_whitelist_operation::account_listing new_listing_status, bool broadcast)
unlocked >>> gethelp withdraw_vesting
gethelp withdraw_vesting
Withdraw a vesting balance.
Parameters:
witness_name: The account name of the witness, also accepts account ID
or vesting balance ID type. (type: string)
amount: The amount to withdraw. (type: string)
asset_symbol: The symbol of the asset to withdraw. (type: string)
broadcast: true if you wish to broadcast the transaction (type: bool)
unlocked >>> gethelp whitelist_account
gethelp 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.
Parameters:
authorizing_account: the account who is doing the whitelisting (type:
string)
account_to_list: the account being whitelisted (type: string)
new_listing_status: the new whitelisting status (type:
account_whitelist_operation::account_listing)
broadcast: true to broadcast the transaction on the network (type:
bool)
Returns
the signed transaction changing the whitelisting status
3.
signed_transaction approve_proposal(const string & fee_paying_account, const string & proposal_id, const approval_delta & delta, bool broadcast)
unlocked >>> gethelp approve_proposal
gethelp approve_proposal
Approve or disapprove a proposal.
Parameters:
fee_paying_account: The account paying the fee for the op. (type: const
string &)
proposal_id: The proposal to modify. (type: const string &)
delta: Members contain approvals to create or remove. In JSON you can
leave empty members undefined. (type: const approval_delta &)
broadcast: true if you wish to broadcast the transaction (type: bool)
Returns
the signed version of the transaction
4.
signed_transaction bid_collateral(string bidder_name, string debt_amount, string debt_symbol, string additional_collateral, bool broadcast)
unlocked >>> gethelp bid_collateral
gethelp bid_collateral
Creates or updates a bid on an MPA after global settlement.
In order to revive a market-pegged asset after global settlement (aka black
swan), investors can bid collateral in order to take over part of the debt
and the settlement fund, see BSIP-0018. Updating an existing bid to cover 0
debt will delete the bid.
Parameters:
bidder_name: the name or id of the account making the bid (type:
string)
debt_amount: the amount of debt of the named asset to bid for (type:
string)
debt_symbol: the name or id of the MPA to bid for (type: string)
additional_collateral: the amount of additional collateral to bid for
taking over debt_amount. The asset type of this amount is
determined automatically from debt_symbol. (type: string)
broadcast: true to broadcast the transaction on the network (type:
bool)
Returns
the signed transaction creating/updating the bid
5.
vector<blind_receipt> blind_history(string key_or_account)
gethelp bid_collateral
Creates or updates a bid on an MPA after global settlement.
In order to revive a market-pegged asset after global settlement (aka black
swan), investors can bid collateral in order to take over part of the debt
and the settlement fund, see BSIP-0018. Updating an existing bid to cover 0
debt will delete the bid.
Parameters:
bidder_name: the name or id of the account making the bid (type:
string)
debt_amount: the amount of debt of the named asset to bid for (type:
string)
debt_symbol: the name or id of the MPA to bid for (type: string)
additional_collateral: the amount of additional collateral to bid for
taking over debt_amount. The asset type of this amount is
determined automatically from debt_symbol. (type: string)
broadcast: true to broadcast the transaction on the network (type:
bool)
Returns
the signed transaction creating/updating the bid
unlocked >>> gethelp blind_history
gethelp blind_history
Returns
all blind receipts to/form a particular account
6.
blind_confirmation blind_transfer(string from_key_or_label, string to_key_or_label, string amount, string symbol, bool broadcast)
unlocked >>> gethelp blind_history
gethelp blind_history
Returns
all blind receipts to/form a particular account
unlocked >>> gethelp blind_transfer
gethelp blind_transfer
Used to transfer from one set of blinded balances to another
7.
signed_transaction borrow_asset(string borrower_name, string amount_to_borrow, string asset_symbol, string amount_of_collateral, bool broadcast)
unlocked >>> gethelp borrow_asset
gethelp borrow_asset
Borrow an asset or update the debt/collateral ratio for the loan.
This is the first step in shorting an asset. Call 'sell_asset()' to
complete the short.
Parameters:
borrower_name: the name or id of the account associated with the
transaction. (type: string)
amount_to_borrow: the amount of the asset being borrowed. Make this
value negative to pay back debt. (type: string)
asset_symbol: the symbol or id of the asset being borrowed. (type:
string)
amount_of_collateral: the amount of the backing asset to add to your
collateral position. Make this negative to claim back some of your
collateral. The backing asset is defined in the 'bitasset_options'
for the asset being borrowed. (type: string)
broadcast: true to broadcast the transaction on the network (type:
bool)
Returns
the signed transaction borrowing the asset
8.signed_transaction borrow_asset_ext(string borrower_name, string amount_to_borrow, string asset_symbol, string amount_of_collateral, call_order_update_operation::extensions_type extensions, bool broadcast)
pair<transaction_id_type, signed_transaction> broadcast_transaction(signed_transaction tx)
unlocked >>> gethelp borrow_asset_ext
gethelp borrow_asset_ext
Borrow an asset or update the debt/collateral ratio for the loan, with
additional options.
This is the first step in shorting an asset. Call 'sell_asset()' to
complete the short.
Parameters:
borrower_name: the name or id of the account associated with the
transaction. (type: string)
amount_to_borrow: the amount of the asset being borrowed. Make this
value negative to pay back debt. (type: string)
asset_symbol: the symbol or id of the asset being borrowed. (type:
string)
amount_of_collateral: the amount of the backing asset to add to your
collateral position. Make this negative to claim back some of your
collateral. The backing asset is defined in the 'bitasset_options'
for the asset being borrowed. (type: string)
extensions: additional options (type:
call_order_update_operation::extensions_type)
broadcast: true to broadcast the transaction on the network (type:
bool)
Returns
the signed transaction borrowing the asset
9.signed_transaction cancel_order(object_id_type order_id, bool broadcast)
unlocked >>> gethelp cancel_order
gethelp cancel_order
Cancel an existing order
Parameters:
order_id: the id of order to be cancelled (type: object_id_type)
broadcast: true to broadcast the transaction on the network (type:
bool)
Returns
the signed transaction canceling the order
10.
signed_transaction claim_asset_fee_pool(string symbol, string amount, bool broadcast)
unlocked >>> gethelp claim_asset_fee_pool
gethelp claim_asset_fee_pool
Claim funds from the fee pool for the given asset.
User-issued assets can optionally have a pool of the core asset which is
automatically used to pay transaction fees for any transaction using that
asset (using the asset's core exchange rate).
This command allows the issuer to withdraw those funds from the fee pool.
Parameters:
symbol: the name or id of the asset whose fee pool you wish to claim
(type: string)
amount: the amount of the core asset to withdraw (type: string)
broadcast: true to broadcast the transaction on the network (type:
bool)
Returns
the signed transaction claiming from the fee pool
11.
signed_transaction create_account_with_brain_key(string brain_key, string account_name, string registrar_account, string referrer_account, bool broadcast)
unlocked >>> gethelp create_account_with_brain_key
gethelp create_account_with_brain_key
usage: create_account_with_brain_key BRAIN_KEY ACCOUNT_NAME REGISTRAR REFERRER BROADCAST
example: create_account_with_brain_key "my really long brain key" "newaccount" "1.3.11" "1.3.11" true
example: create_account_with_brain_key "my really long brain key" "newaccount" "someaccount" "otheraccount" true
This method should be used if you would like the wallet to generate new keys derived from the brain key.
The BRAIN_KEY will be used as the owner key, and the active key will be derived from the BRAIN_KEY. Use
register_account if you already know the keys you know the public keys that you would like to register.
12.
signed_transaction create_asset(string issuer, string symbol, uint8_t precision, asset_options common, fc::optional<bitasset_options> bitasset_opts, bool broadcast)
unlocked >>> gethelp create_asset
gethelp create_asset
usage: ISSUER SYMBOL PRECISION_DIGITS OPTIONS BITASSET_OPTIONS BROADCAST
PRECISION_DIGITS: the number of digits after the decimal point
Example value of OPTIONS:
{
"max_supply": "1000000000000000",
"market_fee_percent": 0,
"max_market_fee": "1000000000000000",
"issuer_permissions": 79,
"flags": 0,
"core_exchange_rate": {
"base": {
"amount": 0,
"asset_id": "1.3.0"
},
"quote": {
"amount": 0,
"asset_id": "1.3.1"
}
},
"whitelist_authorities": [],
"blacklist_authorities": [],
"whitelist_markets": [],
"blacklist_markets": [],
"description": "",
"extensions": []
}
Example value of BITASSET_OPTIONS:
{
"feed_lifetime_sec": 86400,
"minimum_feeds": 1,
"force_settlement_delay_sec": 86400,
"force_settlement_offset_percent": 0,
"maximum_force_settlement_volume": 2000,
"short_backing_asset": "1.3.0",
"extensions": []
}
BITASSET_OPTIONS may be null
13.
signed_transaction create_committee_member(string owner_account, string url, bool broadcast)
unlocked >>> gethelp create_committee_member
gethelp create_committee_member
Creates a committee_member object owned by the given account.
An account can have at most one committee_member object.
Parameters:
owner_account: the name or id of the account which is creating the
committee_member (type: string)
url: a URL to include in the committee_member record in the blockchain.
Clients may display this when showing a list of committee_members.
May be blank. (type: string)
broadcast: true to broadcast the transaction on the network (type:
bool)
Returns
the signed transaction registering a committee_member
14.
signed_transaction create_witness(string owner_account, string url, bool broadcast)
unlocked >>> gethelp create_witness
gethelp create_witness
Creates a witness object owned by the given account.
An account can have at most one witness object.
Parameters:
owner_account: the name or id of the account which is creating the
witness (type: string)
url: a URL to include in the witness record in the blockchain. Clients
may display this when showing a list of witnesses. May be blank.
(type: string)
broadcast: true to broadcast the transaction on the network (type:
bool)
Returns
the signed transaction registering a witness
15.
signed_transaction create_worker(string owner_account, time_point_sec work_begin_date, time_point_sec work_end_date, share_type daily_pay, string name, string url, variant worker_settings, bool broadcast)
unlocked >>> gethelp create_worker
gethelp create_worker
Create a worker object.
Parameters:
owner_account: The account which owns the worker and will be paid
(type: string)
work_begin_date: When the work begins (type: time_point_sec)
work_end_date: When the work ends (type: time_point_sec)
daily_pay: Amount of pay per day (NOT per maint interval) (type:
share_type)
name: Any text (type: string)
url: Any text (type: string)
worker_settings: {"type" : "burn"|"refund"|"vesting",
"pay_vesting_period_days" : x} (type: variant)
broadcast: true if you wish to broadcast the transaction. (type: bool)
16
void dbg_generate_blocks(std::string debug_wif_key, uint32_t count)
void dbg_make_mia(string creator, string symbol)
void dbg_make_uia(string creator, string symbol)
void dbg_push_blocks(std::string src_filename, uint32_t count)
void dbg_stream_json_objects(const std::string & filename)
void dbg_update_object(fc::variant_object update)
17
vector<brain_key_info> derive_owner_keys_from_brain_key(string brain_key, int number_of_desired_keys)
map<public_key_type, string> dump_private_keys()
unlocked >>> gethelp derive_owner_keys_from_brain_key
gethelp derive_owner_keys_from_brain_key
Derive any number of possible owner keys from a given brain key.
NOTE: These keys may or may not match with the owner keys of any account.
This function is merely intended to assist with account or key recovery.
Parameters:
brain_key: Brain key (type: string)
number_of_desired_keys: Number of desired keys (type: int)
Returns
A list of keys that are deterministically derived from the brainkey
18
vector<brain_key_info> derive_owner_keys_from_brain_key(string brain_key, int number_of_desired_keys)
map<public_key_type, string> dump_private_keys()
unlocked >>> gethelp derive_owner_keys_from_brain_key
gethelp derive_owner_keys_from_brain_key
Derive any number of possible owner keys from a given brain key.
NOTE: These keys may or may not match with the owner keys of any account.
This function is merely intended to assist with account or key recovery.
Parameters:
brain_key: Brain key (type: string)
number_of_desired_keys: Number of desired keys (type: int)
Returns
A list of keys that are deterministically derived from the brainkey
19
void flood_network(string prefix, uint32_t number_of_transactions)
20
signed_transaction fund_asset_fee_pool(string from, string symbol, string amount, bool broadcast)
unlocked >>> gethelp fund_asset_fee_pool
gethelp 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.
Parameters:
from: the name or id of the account sending the core asset (type:
string)
symbol: the name or id of the asset whose fee pool you wish to fund
(type: string)
amount: the amount of the core asset to deposit (type: string)
broadcast: true to broadcast the transaction on the network (type:
bool)
Returns
the signed transaction funding the fee pool
21.
account_object get_account(string account_name_or_id)
unlocked >>> gethelp get_account
gethelp get_account
Returns information about the given account.
Parameters:
account_name_or_id: the name or id of the account to provide
information about (type: string)
Returns
the public account data stored in the blockchain
22.
uint64_t get_account_count()
unlocked >>> gethelp get_account_count
gethelp get_account_count
Returns the number of accounts registered on the blockchain
Returns
the number of registered accounts
23.
vector<operation_detail> get_account_history(string name, int limit)
unlocked >>> gethelp get_account_history
gethelp 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.
Parameters:
name: the name or id of the account (type: string)
limit: the number of entries to return (starting from the most recent)
(type: int)
Returns
a list of 'operation_history_objects'
24
account_history_operation_detail get_account_history_by_operations(string name, vector<uint16_t> operation_types, uint32_t start, int limit)
unlocked >>> gethelp get_account_history_by_operations
gethelp get_account_history_by_operations
Get operations relevant to the specified account filtering by operation
type, with transaction id
Parameters:
name: the name or id of the account, whose history shoulde be queried
(type: string)
operation_types: The IDs of the operation we want to get operations in
the account( 0 = transfer , 1 = limit order create, ...) (type:
vector<uint16_t>)
start: the sequence number where to start looping back throw the
history (type: uint32_t)
limit: the max number of entries to return (from start number) (type:
int)
Returns
account_history_operation_detail
25.
account_id_type get_account_id(string account_name_or_id)
unlocked >>> gethelp get_account_id
gethelp get_account_id
Lookup the id of a named account.
Parameters:
account_name_or_id: the name of the account to look up (type: string)
Returns
the id of the named account
26
vector<limit_order_object> get_account_limit_orders(const string & name_or_id, const string & base, const string & quote, uint32_t limit, optional<limit_order_id_type> ostart_id, optional<price> ostart_price)
unlocked >>> gethelp get_account_limit_orders
gethelp get_account_limit_orders
Parameters:
name_or_id: The name or ID of an account to retrieve (type: const
string &)
base: Base asset (type: const string &)
quote: Quote asset (type: const string &)
limit: The limitation of items each query can fetch (max: 101) (type:
uint32_t)
ostart_id: Start order id, fetch orders which price are lower than or
equal to this order (type: optional<limit_order_id_type>)
ostart_price: Fetch orders with price lower than or equal to this price
(type: optional<price>)
Returns
List of orders from 'name_or_id' to the corresponding account
27
asset_object get_asset(string asset_name_or_id)
unlocked >>> gethelp get_asset
gethelp get_asset
Returns information about the given asset.
Parameters:
asset_name_or_id: the symbol or id of the asset in question (type:
string)
Returns
the information about the asset stored in the block chain
28
uint64_t get_asset_count()
unlocked >>> gethelp get_asset_count
gethelp get_asset_count
Returns assets count registered on the blockchain.
Returns
assets count
29
asset_bitasset_data_object get_bitasset_data(string asset_name_or_id)
unlocked >>> gethelp get_bitasset_data
gethelp get_bitasset_data
Returns the BitAsset-specific data for a given asset. Market-issued
assets's behavior are determined both by their "BitAsset Data" and their
basic asset data, as returned by 'get_asset()'.
Parameters:
asset_name_or_id: the symbol or id of the BitAsset in question (type:
string)
Returns
the BitAsset-specific data for this asset
30
optional<signed_block_with_info> get_block(uint32_t num)
31
vector<call_order_object> get_call_orders(string a, uint32_t limit)
32
vector<collateral_bid_object> get_collateral_bids(string asset, uint32_t limit, uint32_t start)
unlocked >>> gethelp get_collateral_bids
gethelp get_collateral_bids
Returns the collateral_bid object for the given MPA
Parameters:
asset: the name or id of the asset (type: string)
limit: the number of entries to return (type: uint32_t)
start: the sequence number where to start looping back throw the
history (type: uint32_t)
Returns
a list of 'collateral_bid_objects'
31
committee_member_object get_committee_member(string owner_account)
unlocked >>> gethelp get_committee_member
gethelp get_committee_member
Returns information about the given committee_member.
Parameters:
owner_account: the name or id of the committee_member account owner, or
the id of the committee_member (type: string)
Returns
the information about the committee_member stored in the block chain
32
dynamic_global_property_object get_dynamic_global_properties()
unlocked >>> gethelp get_dynamic_global_properties
gethelp get_dynamic_global_properties
Returns the block chain's rapidly-changing properties. The returned object
contains information that changes every block interval such as the head
block number, the next witness, etc.
Returns
the dynamic global properties
33.
full_account get_full_account(const string & name_or_id)
locked >>> gethelp get_full_account
gethelp get_full_account
This function fetches all relevant objects for the given account. If the
string of 'name_or_id' cannot be tied to an account, that input will be
ignored.
Parameters:
name_or_id: Must be the name or ID of an account to retrieve (type:
const string &)
Returns
All info about the specified account
34
global_property_object get_global_properties()
locked >>> gethelp get_global_properties
gethelp get_global_properties
Returns the block chain's slowly-changing settings. This object contains
all of the properties of the blockchain that are fixed or that change only
once per maintenance interval (daily) such as the current list of
witnesses, committee_members, block interval, etc.
Returns
the global properties
35
vector<limit_order_object> get_limit_orders(string a, string b, uint32_t limit)
vector<bucket_object> get_market_history(string symbol, string symbol2, uint32_t bucket, fc::time_point_sec start, fc::time_point_sec end)
36
variant get_object(object_id_type id)
locked >>> gethelp get_object
gethelp get_object
Returns the blockchain object corresponding to the given id.
This generic function can be used to retrieve any object from the
blockchain that is assigned an ID. Certain types of objects have
specialized convenience functions to return their objects - e.g., assets
have 'get_asset()', accounts have 'get_account()', but this function will
work for any object.
Parameters:
id: the id of the object to return (type: object_id_type)
Returns
the requested object
37
order_book get_order_book(const string & base, const string & quote, unsigned limit)
用法 get_order_book CNY CTS 20
base 是基价 用来标价的
quote 是目标资产 20是查询有效条目数。
出来的是 价位 目标资产数量 折合基价资产数量 计加以上总价
38
string get_private_key(public_key_type pubkey)
locked >>> gethelp get_order_book
gethelp get_order_book
No help defined for method get_order_book
locked >>> gethelp get_private_key
gethelp get_private_key
Get the WIF private key corresponding to a public key. The private key must
already be in the wallet.
39
operation get_prototype_operation(string operation_type)
locked >>> gethelp get_prototype_operation
gethelp get_prototype_operation
Returns an uninitialized object representing a given blockchain operation.
This returns a default-initialized object of the given type; it can be used
during early development of the wallet when we don't yet have custom
commands for creating all of the operations the blockchain supports.
Any operation the blockchain supports can be created using the transaction
builder's 'add_operation_to_builder_transaction()' , but to do that from
the CLI you need to know what the JSON form of the operation looks like.
This will give you a template you can fill in. It's better than nothing.
Parameters:
operation_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") (type: string)
Returns
a default-constructed operation of the given type
40
vector<operation_detail> get_relative_account_history(string name, uint32_t stop, int limit, uint32_t start)
locked >>> gethelp get_relative_account_history
gethelp get_relative_account_history
Returns the relative operations on the named account from start number.
Parameters:
name: the name or id of the account (type: string)
stop: Sequence number of earliest operation. (type: uint32_t)
limit: the number of entries to return (type: int)
start: the sequence number where to start looping back throw the
history (type: uint32_t)
Returns
a list of 'operation_history_objects'
41
vector<force_settlement_object> get_settle_orders(string a, uint32_t limit)
42
transaction_id_type get_transaction_id(const signed_transaction & trx)
locked >>> gethelp get_settle_orders
gethelp get_settle_orders
No help defined for method get_settle_orders
locked >>> gethelp get_transaction_id
gethelp get_transaction_id
This method is used to convert a JSON transaction to its transactin ID.
43
vector<vesting_balance_object_with_info> get_vesting_balances(string account_name)
locked >>> gethelp get_vesting_balances
gethelp get_vesting_balances
Get information about a vesting balance object.
Parameters:
account_name: An account name, account ID, or vesting balance object
ID. (type: string)
44
witness_object get_witness(string owner_account)
locked >>> gethelp get_witness
gethelp get_witness
Returns information about the given witness.
Parameters:
owner_account: the name or id of the witness account owner, or the id
of the witness (type: string)
Returns
the information about the witness stored in the block chain
45
string gethelp(const string & method)
46
signed_transaction global_settle_asset(string symbol, price settle_price, bool broadcast)
locked >>> gethelp global_settle_asset
gethelp 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 balances are converted into the backing
asset at the settle_price and all open margin positions are called at the
settle price. If this asset is used as backing for other bitassets, those
bitassets will be force settled at their current feed price.
Parameters:
symbol: the name or id of the asset to force settlement on (type:
string)
settle_price: the price at which to settle (type: price)
broadcast: true to broadcast the transaction on the network (type:
bool)
Returns
the signed transaction settling the named asset
47
bool import_account_keys(string filename, string password, string src_account_name, string dest_account_name)
48
bool import_account_keys(string filename, string password, string src_account_name, string dest_account_name)
map<string, bool> import_accounts(string filename, string password)
49
vector<signed_transaction> import_balance(string account_name_or_id, const vector<string> & wif_keys, bool broadcast)
locked >>> gethelp import_accounts
gethelp import_accounts
No help defined for method import_accounts
locked >>> gethelp import_balance
gethelp import_balance
This call will construct transaction(s) that will claim all balances
controled by wif_keys and deposit them into the given account.
50
locked >>> gethelp import_key
gethelp import_key
usage: import_key ACCOUNT_NAME_OR_ID WIF_PRIVATE_KEY
example: import_key "1.3.11" 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
example: import_key "usera" 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3