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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* Indexer
*
* Algorand ledger analytics API.
*
* The version of the OpenAPI document: 2.0
*
* Generated by: https://openapi-generator.tech
*/
use algonaut_encoding::Bytes;
/// TransactionApplication : Fields for application transactions. Definition: data/transactions/application.go : ApplicationCallTxnFields
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct TransactionApplication {
/// \\[al\\] Access unifies `accounts`, `foreign-apps`, `foreign-assets`, and `box-references` under a single list. If access is non-empty, these lists must be empty. If access is empty, those lists may be non-empty.
#[serde(rename = "access", skip_serializing_if = "Option::is_none")]
pub access: Option<Vec<crate::models::ResourceRef>>,
/// \\[apat\\] List of accounts in addition to the sender that may be accessed from the application's approval-program and clear-state-program.
#[serde(rename = "accounts", skip_serializing_if = "Option::is_none")]
pub accounts: Option<Vec<String>>,
/// \\[apaa\\] transaction specific arguments accessed from the application's approval-program and clear-state-program.
#[serde(rename = "application-args", skip_serializing_if = "Option::is_none")]
pub application_args: Option<Vec<String>>,
/// \\[apid\\] ID of the application being configured or empty if creating.
#[serde(rename = "application-id")]
pub application_id: u64,
/// \\[apap\\] Logic executed for every application transaction, except when on-completion is set to \"clear\". It can read and write global state for the application, as well as account-specific local state. Approval programs may reject the transaction.
#[serde(rename = "approval-program", skip_serializing_if = "Option::is_none")]
pub approval_program: Option<Bytes>,
/// \\[apbx\\] the boxes that can be accessed by this transaction (and others in the same group).
#[serde(rename = "box-references", skip_serializing_if = "Option::is_none")]
pub box_references: Option<Vec<crate::models::BoxReference>>,
/// \\[apsu\\] Logic executed for application transactions with on-completion set to \"clear\". It can read and write global state for the application, as well as account-specific local state. Clear state programs cannot reject the transaction.
#[serde(
rename = "clear-state-program",
skip_serializing_if = "Option::is_none"
)]
pub clear_state_program: Option<Bytes>,
/// \\[epp\\] specifies the additional app program len requested in pages.
#[serde(
rename = "extra-program-pages",
skip_serializing_if = "Option::is_none"
)]
pub extra_program_pages: Option<u64>,
/// \\[apfa\\] Lists the applications in addition to the application-id whose global states may be accessed by this application's approval-program and clear-state-program. The access is read-only.
#[serde(rename = "foreign-apps", skip_serializing_if = "Option::is_none")]
pub foreign_apps: Option<Vec<u64>>,
/// \\[apas\\] lists the assets whose parameters may be accessed by this application's ApprovalProgram and ClearStateProgram. The access is read-only.
#[serde(rename = "foreign-assets", skip_serializing_if = "Option::is_none")]
pub foreign_assets: Option<Vec<u64>>,
#[serde(
rename = "global-state-schema",
skip_serializing_if = "Option::is_none"
)]
pub global_state_schema: Option<Box<crate::models::StateSchema>>,
#[serde(rename = "local-state-schema", skip_serializing_if = "Option::is_none")]
pub local_state_schema: Option<Box<crate::models::StateSchema>>,
#[serde(rename = "on-completion")]
pub on_completion: crate::models::OnCompletion,
/// \\[aprv\\] the lowest application version for which this transaction should immediately fail. 0 indicates that no version check should be performed.
#[serde(rename = "reject-version", skip_serializing_if = "Option::is_none")]
pub reject_version: Option<u64>,
}
impl TransactionApplication {
/// Fields for application transactions. Definition: data/transactions/application.go : ApplicationCallTxnFields
pub fn new(
application_id: u64,
on_completion: crate::models::OnCompletion,
) -> TransactionApplication {
TransactionApplication {
access: None,
accounts: None,
application_args: None,
application_id,
approval_program: None,
box_references: None,
clear_state_program: None,
extra_program_pages: None,
foreign_apps: None,
foreign_assets: None,
global_state_schema: None,
local_state_schema: None,
on_completion,
reject_version: None,
}
}
}