Asset Management

asset_create_operation

This operation is used to create assets
1
struct asset_create_operation : public base_operation
2
{
3
struct fee_parameters_type {
4
uint64_t symbol3 = 500000 * ECHO_BLOCKCHAIN_PRECISION;
5
uint64_t symbol4 = 300000 * ECHO_BLOCKCHAIN_PRECISION;
6
uint64_t long_symbol = 5000 * ECHO_BLOCKCHAIN_PRECISION;
7
uint32_t price_per_kbyte = 10; /// only required for large memos.
8
};
9
10
asset fee;
11
/// This account must sign and pay the fee for this operation. Later, this account may update the asset
12
account_id_type issuer;
13
/// The ticker symbol of this asset
14
string symbol;
15
/// Number of digits to the right of decimal point, must be less than or equal to 12
16
uint8_t precision = 0;
17
18
/// Options common to all assets.
19
///
20
/// @note common_options.core_exchange_rate technically needs to store the asset ID of this new asset. Since this
21
/// ID is not known at the time this operation is created, create this price as though the new asset has instance
22
/// ID 1, and the chain will overwrite it with the new asset's ID.
23
asset_options common_options;
24
/// Options only available for BitAssets. MUST be non-null if and only if the asset is a bitasset
25
optional<bitasset_options> bitasset_opts;
26
27
extensions_type extensions;
28
29
account_id_type fee_payer()const { return issuer; }
30
share_type calculate_fee( const fee_parameters_type& k )const;
31
};
Copied!

JSON Example

1
[
2
7,
3
{
4
"fee": {
5
"amount": 0,
6
"asset_id": "1.3.0"
7
},
8
"issuer": "1.2.0",
9
"symbol": "",
10
"precision": 0,
11
"common_options": {
12
"max_supply": "1000000000000000",
13
"issuer_permissions": 15,
14
"flags": 0,
15
"core_exchange_rate": {
16
"base": {
17
"amount": 0,
18
"asset_id": "1.3.0"
19
},
20
"quote": {
21
"amount": 0,
22
"asset_id": "1.3.0"
23
}
24
},
25
"whitelist_authorities": [],
26
"blacklist_authorities": [],
27
"description": "",
28
"extensions": []
29
},
30
"extensions": []
31
}
32
]
Copied!

asset_update_operation

Update options common to all assets.
There are a number of options which all assets in the network use. These options are enumerated in the asset_options struct. This operation is used to update these options for an existing asset.
1
struct asset_update_operation : public base_operation
2
{
3
struct fee_parameters_type {
4
uint64_t fee = 500 * ECHO_BLOCKCHAIN_PRECISION;
5
uint32_t price_per_kbyte = 10;
6
};
7
8
asset_update_operation(){}
9
10
asset fee;
11
account_id_type issuer;
12
asset_id_type asset_to_update;
13
14
/// If the asset is to be given a new issuer, specify his ID here.
15
optional<account_id_type> new_issuer;
16
optional<asset_options> new_options;
17
18
extensions_type extensions;
19
20
account_id_type fee_payer()const { return issuer; }
21
share_type calculate_fee(const fee_parameters_type& k)const;
22
};
Copied!

JSON Example

1
[
2
8,
3
{
4
"fee": {
5
"amount": 0,
6
"asset_id": "1.3.0"
7
},
8
"issuer": "1.2.0",
9
"asset_to_update": "1.3.0",
10
"extensions": []
11
}
12
]
Copied!

asset_update_bitasset_operation

Update options specific to BitAssets.
BitAssets have some options which are not relevant to other asset types. This operation is used to update those options for existing BitAsset.
1
struct asset_update_bitasset_operation : public base_operation
2
{
3
struct fee_parameters_type { uint64_t fee = 500 * ECHO_BLOCKCHAIN_PRECISION; };
4
5
asset fee;
6
account_id_type issuer;
7
asset_id_type asset_to_update;
8
9
bitasset_options new_options;
10
11
extensions_type extensions;
12
13
account_id_type fee_payer()const { return issuer; }
14
};
Copied!

JSON Example

1
[
2
9,
3
{
4
"fee": {
5
"amount": 0,
6
"asset_id": "1.3.0"
7
},
8
"issuer": "1.2.0",
9
"asset_to_update": "1.3.0",
10
"new_options": {
11
"feed_lifetime_sec": 86400,
12
"minimum_feeds": 1,
13
"short_backing_asset": "1.3.0",
14
"extensions": []
15
},
16
"extensions": []
17
}
18
]
Copied!

asset_update_feed_producers_operation

Update the set of feed-producing accounts for a BitAsset.
BitAssets have price feeds selected by taking the median values of recommendations from a set of feed producers. This operation is used to specify which accounts may produce feeds for a given BitAsset.
1
struct asset_update_feed_producers_operation : public base_operation
2
{
3
struct fee_parameters_type { uint64_t fee = 500 * ECHO_BLOCKCHAIN_PRECISION; };
4
5
asset fee;
6
account_id_type issuer;
7
asset_id_type asset_to_update;
8
9
flat_set<account_id_type> new_feed_producers;
10
11
extensions_type extensions;
12
13
account_id_type fee_payer()const { return issuer; }
14
};
Copied!
asset

JSON Example

1
[
2
10,
3
{
4
"fee": {
5
"amount": 0,
6
"asset_id": "1.3.0"
7
},
8
"issuer": "1.2.0",
9
"asset_to_update": "1.3.0",
10
"new_feed_producers": [],
11
"extensions": []
12
}
13
]
Copied!

asset_issue_operation

Asset issue to account.
1
struct asset_issue_operation : public base_operation
2
{
3
struct fee_parameters_type {
4
uint64_t fee = 20 * ECHO_BLOCKCHAIN_PRECISION;
5
};
6
7
asset fee;
8
account_id_type issuer; ///< Must be asset_to_issue->asset_id->issuer
9
asset asset_to_issue;
10
account_id_type issue_to_account;
11
12
extensions_type extensions;
13
14
account_id_type fee_payer()const { return issuer; }
15
share_type calculate_fee(const fee_parameters_type& k)const;
16
};
Copied!
asset

JSON Example

1
[
2
11,
3
{
4
"fee": {
5
"amount": 0,
6
"asset_id": "1.3.0"
7
},
8
"issuer": "1.2.0",
9
"asset_to_issue": {
10
"amount": 0,
11
"asset_id": "1.3.0"
12
},
13
"issue_to_account": "1.2.0",
14
"extensions": []
15
}
16
]
Copied!

asset_reserve_operation

Used to take an asset out of circulation, returning to the issuer
1
struct asset_reserve_operation : public base_operation
2
{
3
struct fee_parameters_type { uint64_t fee = 20 * ECHO_BLOCKCHAIN_PRECISION; };
4
5
asset fee;
6
account_id_type payer;
7
asset amount_to_reserve;
8
9
extensions_type extensions;
10
11
account_id_type fee_payer()const { return payer; }
12
};
Copied!
asset

JSON Example

1
[
2
12,
3
{
4
"fee": {
5
"amount": 0,
6
"asset_id": "1.3.0"
7
},
8
"payer": "1.2.0",
9
"amount_to_reserve": {
10
"amount": 0,
11
"asset_id": "1.3.0"
12
},
13
"extensions": []
14
}
15
]
Copied!

asset_fund_fee_pool_operation

Used to transfer asset from account to asset fee pool. For more information see Asset Fee Pool.
1
struct asset_fund_fee_pool_operation : public base_operation
2
{
3
struct fee_parameters_type { uint64_t fee = ECHO_BLOCKCHAIN_PRECISION; };
4
5
asset fee; ///< core asset
6
account_id_type from_account;
7
asset_id_type asset_id;
8
share_type amount; ///< core asset
9
10
extensions_type extensions;
11
12
account_id_type fee_payer()const { return from_account; }
13
};
Copied!
asset

JSON Example

1
[
2
13,
3
{
4
"fee": {
5
"amount": 0,
6
"asset_id": "1.3.0"
7
},
8
"from_account": "1.2.0",
9
"asset_id": "1.3.0",
10
"amount": 0,
11
"extensions": []
12
}
13
]
Copied!

asset_publish_feed_operation

Publish price feeds for market-issued assets (BitAssets).
Price feed providers use this operation to publish their price feeds for market-issued assets. A price feed is used to tune the market for a particular market-issued asset. For each value in the feed, the median across all committee_member feeds for that asset is calculated and the market for the asset is configured with the median of that value.
The feed in the operation contains three prices: a call price limit, a short price limit, and a settlement price. The call limit price is structured as (collateral asset) / (debt asset) and the short limit price is structured as (asset for sale) / (collateral asset). Note that the asset IDs are opposite to eachother, so if we're publishing a feed for USD, the call limit price will be ECHO/USD and the short limit price will be USD/ECHO. The settlement price may be flipped either direction, as long as it is a ratio between the market-issued asset and its collateral.
1
struct asset_publish_feed_operation : public base_operation
2
{
3
struct fee_parameters_type { uint64_t fee = ECHO_BLOCKCHAIN_PRECISION; };
4
5
asset fee; ///< paid for by publisher
6
account_id_type publisher;
7
asset_id_type asset_id; ///< asset for which the feed is published
8
price core_exchange_rate;
9
10
extensions_type extensions;
11
12
account_id_type fee_payer()const { return publisher; }
13
};
Copied!
asset

JSON Example

1
[
2
14,
3
{
4
"fee": {
5
"amount": 0,
6
"asset_id": "1.3.0"
7
},
8
"publisher": "1.2.0",
9
"asset_id": "1.3.0",
10
"core_exchange_rate": {
11
"base": {
12
"amount": 0,
13
"asset_id": "1.3.0"
14
},
15
"quote": {
16
"amount": 0,
17
"asset_id": "1.3.0"
18
}
19
},
20
"extensions": []
21
}
22
]
Copied!

asset_claim_fees_operation

Used to transfer accumulated fees back to the issuer's balance
1
struct asset_claim_fees_operation : public base_operation
2
{
3
struct fee_parameters_type {
4
uint64_t fee = 20 * ECHO_BLOCKCHAIN_PRECISION;
5
};
6
7
asset fee;
8
account_id_type issuer;
9
asset amount_to_claim; /// amount_to_claim.asset_id->issuer must == issuer
10
11
extensions_type extensions;
12
13
account_id_type fee_payer()const { return issuer; }
14
};
Copied!
asset

JSON Example

1
[
2
15,
3
{
4
"fee": {
5
"amount": 0,
6
"asset_id": "1.3.0"
7
},
8
"issuer": "1.2.0",
9
"amount_to_claim": {
10
"amount": 0,
11
"asset_id": "1.3.0"
12
},
13
"extensions": []
14
}
15
]
Copied!
Last modified 1yr ago