Asset Transfer

transfer_operation

Transfers an amount of one asset from one account to another.
1
struct transfer_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 to transfer asset from
9
account_id_type from;
10
/// Account to transfer asset to
11
account_id_type to;
12
/// The amount of asset to transfer from @ref from to @ref to
13
asset amount;
14
15
extensions_type extensions;
16
17
account_id_type fee_payer()const { return from; }
18
share_type calculate_fee(const fee_parameters_type& k)const;
19
};
Copied!
asset

JSON Examples

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

transfer_to_address_operation

Transfers an amount of one asset from one account to account address.
1
struct transfer_to_address_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 to transfer asset from
9
account_id_type from;
10
/// Account address to transfer asset to
11
fc::ripemd160 to;
12
/// The amount of asset to transfer from @ref from to @ref to
13
asset amount;
14
15
extensions_type extensions;
16
17
account_id_type fee_payer()const { return from; }
18
};
Copied!
asset

JSON Example

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

override_transfer_operation

Allows the issuer of an asset to transfer an asset from any account to any account if they have override_authority. See asset_issuer_permission_flags.
1
struct override_transfer_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
/// Account to transfer asset from
10
account_id_type from;
11
/// Account to transfer asset to
12
account_id_type to;
13
/// The amount of asset to transfer from @ref from to @ref to
14
asset amount;
15
16
extensions_type extensions;
17
18
account_id_type fee_payer()const { return issuer; }
19
share_type calculate_fee(const fee_parameters_type& k)const;
20
};
Copied!

JSON Example

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