1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* Indexer
*
* Algorand ledger analytics API.
*
* The version of the OpenAPI document: 2.0
*
* Generated by: https://openapi-generator.tech
*/
/// TransactionAssetTransfer : Fields for an asset transfer transaction. Definition: data/transactions/asset.go : AssetTransferTxnFields
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct TransactionAssetTransfer {
/// \\[aamt\\] Amount of asset to transfer. A zero amount transferred to self allocates that asset in the account's Assets map.
#[serde(rename = "amount")]
pub amount: u64,
/// \\[xaid\\] ID of the asset being transferred.
#[serde(rename = "asset-id")]
pub asset_id: u64,
/// Number of assets transfered to the close-to account as part of the transaction.
#[serde(rename = "close-amount", skip_serializing_if = "Option::is_none")]
pub close_amount: Option<u64>,
/// \\[aclose\\] Indicates that the asset should be removed from the account's Assets map, and specifies where the remaining asset holdings should be transferred. It's always valid to transfer remaining asset holdings to the creator account.
#[serde(rename = "close-to", skip_serializing_if = "Option::is_none")]
pub close_to: Option<String>,
/// \\[arcv\\] Recipient address of the transfer.
#[serde(rename = "receiver")]
pub receiver: String,
/// \\[asnd\\] The effective sender during a clawback transactions. If this is not a zero value, the real transaction sender must be the Clawback address from the AssetParams.
#[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
pub sender: Option<String>,
}
impl TransactionAssetTransfer {
/// Fields for an asset transfer transaction. Definition: data/transactions/asset.go : AssetTransferTxnFields
pub fn new(amount: u64, asset_id: u64, receiver: String) -> TransactionAssetTransfer {
TransactionAssetTransfer {
amount,
asset_id,
close_amount: None,
close_to: None,
receiver,
sender: None,
}
}
}