algosdk 1.21.0 → 1.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/README.md +4 -4
  2. package/dist/browser/algosdk.min.js +1 -1
  3. package/dist/browser/algosdk.min.js.map +1 -1
  4. package/dist/cjs/src/boxStorage.js +33 -0
  5. package/dist/cjs/src/boxStorage.js.map +1 -0
  6. package/dist/cjs/src/client/client.js +11 -9
  7. package/dist/cjs/src/client/client.js.map +1 -1
  8. package/dist/cjs/src/client/urlTokenBaseHTTPClient.js +93 -96
  9. package/dist/cjs/src/client/urlTokenBaseHTTPClient.js.map +1 -1
  10. package/dist/cjs/src/client/v2/algod/algod.js +55 -1
  11. package/dist/cjs/src/client/v2/algod/algod.js.map +1 -1
  12. package/dist/cjs/src/client/v2/algod/getApplicationBoxByName.js +44 -0
  13. package/dist/cjs/src/client/v2/algod/getApplicationBoxByName.js.map +1 -0
  14. package/dist/cjs/src/client/v2/algod/getApplicationBoxes.js +60 -0
  15. package/dist/cjs/src/client/v2/algod/getApplicationBoxes.js.map +1 -0
  16. package/dist/cjs/src/client/v2/algod/getBlockHash.js +19 -0
  17. package/dist/cjs/src/client/v2/algod/getBlockHash.js.map +1 -0
  18. package/dist/cjs/src/client/v2/algod/models/types.js +815 -42
  19. package/dist/cjs/src/client/v2/algod/models/types.js.map +1 -1
  20. package/dist/cjs/src/client/v2/{algod/models/base.js → basemodel.js} +1 -1
  21. package/dist/cjs/src/client/v2/basemodel.js.map +1 -0
  22. package/dist/cjs/src/client/v2/indexer/indexer.js +50 -0
  23. package/dist/cjs/src/client/v2/indexer/indexer.js.map +1 -1
  24. package/dist/cjs/src/client/v2/indexer/lookupApplicationBoxByIDandName.js +45 -0
  25. package/dist/cjs/src/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -0
  26. package/dist/cjs/src/client/v2/indexer/lookupBlock.js +8 -0
  27. package/dist/cjs/src/client/v2/indexer/lookupBlock.js.map +1 -1
  28. package/dist/cjs/src/client/v2/indexer/models/types.js +3077 -0
  29. package/dist/cjs/src/client/v2/indexer/models/types.js.map +1 -0
  30. package/dist/cjs/src/client/v2/indexer/searchAccounts.js +1 -1
  31. package/dist/cjs/src/client/v2/indexer/searchForApplicationBoxes.js +99 -0
  32. package/dist/cjs/src/client/v2/indexer/searchForApplicationBoxes.js.map +1 -0
  33. package/dist/cjs/src/client/v2/jsonrequest.js +11 -1
  34. package/dist/cjs/src/client/v2/jsonrequest.js.map +1 -1
  35. package/dist/cjs/src/composer.js +4 -1
  36. package/dist/cjs/src/composer.js.map +1 -1
  37. package/dist/cjs/src/main.js +3 -2
  38. package/dist/cjs/src/main.js.map +1 -1
  39. package/dist/cjs/src/makeTxn.js +29 -14
  40. package/dist/cjs/src/makeTxn.js.map +1 -1
  41. package/dist/cjs/src/multisig.js +15 -25
  42. package/dist/cjs/src/multisig.js.map +1 -1
  43. package/dist/cjs/src/transaction.js +29 -0
  44. package/dist/cjs/src/transaction.js.map +1 -1
  45. package/dist/cjs/src/types/transactions/index.js.map +1 -1
  46. package/dist/esm/src/boxStorage.js +29 -0
  47. package/dist/esm/src/boxStorage.js.map +1 -0
  48. package/dist/esm/src/client/client.js +11 -9
  49. package/dist/esm/src/client/client.js.map +1 -1
  50. package/dist/esm/src/client/urlTokenBaseHTTPClient.js +93 -73
  51. package/dist/esm/src/client/urlTokenBaseHTTPClient.js.map +1 -1
  52. package/dist/esm/src/client/v2/algod/algod.js +55 -1
  53. package/dist/esm/src/client/v2/algod/algod.js.map +1 -1
  54. package/dist/esm/src/client/v2/algod/getApplicationBoxByName.js +38 -0
  55. package/dist/esm/src/client/v2/algod/getApplicationBoxByName.js.map +1 -0
  56. package/dist/esm/src/client/v2/algod/getApplicationBoxes.js +54 -0
  57. package/dist/esm/src/client/v2/algod/getApplicationBoxes.js.map +1 -0
  58. package/dist/esm/src/client/v2/algod/getBlockHash.js +13 -0
  59. package/dist/esm/src/client/v2/algod/getBlockHash.js.map +1 -0
  60. package/dist/esm/src/client/v2/algod/models/types.js +771 -2
  61. package/dist/esm/src/client/v2/algod/models/types.js.map +1 -1
  62. package/dist/esm/src/client/v2/{algod/models/base.js → basemodel.js} +1 -1
  63. package/dist/esm/src/client/v2/basemodel.js.map +1 -0
  64. package/dist/esm/src/client/v2/indexer/indexer.js +50 -0
  65. package/dist/esm/src/client/v2/indexer/indexer.js.map +1 -1
  66. package/dist/esm/src/client/v2/indexer/lookupApplicationBoxByIDandName.js +39 -0
  67. package/dist/esm/src/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -0
  68. package/dist/esm/src/client/v2/indexer/lookupBlock.js +8 -0
  69. package/dist/esm/src/client/v2/indexer/lookupBlock.js.map +1 -1
  70. package/dist/esm/src/client/v2/indexer/models/types.js +3009 -0
  71. package/dist/esm/src/client/v2/indexer/models/types.js.map +1 -0
  72. package/dist/esm/src/client/v2/indexer/searchAccounts.js +1 -1
  73. package/dist/esm/src/client/v2/indexer/searchForApplicationBoxes.js +93 -0
  74. package/dist/esm/src/client/v2/indexer/searchForApplicationBoxes.js.map +1 -0
  75. package/dist/esm/src/client/v2/jsonrequest.js +11 -1
  76. package/dist/esm/src/client/v2/jsonrequest.js.map +1 -1
  77. package/dist/esm/src/composer.js +4 -1
  78. package/dist/esm/src/composer.js.map +1 -1
  79. package/dist/esm/src/main.js +2 -0
  80. package/dist/esm/src/main.js.map +1 -1
  81. package/dist/esm/src/makeTxn.js +29 -14
  82. package/dist/esm/src/makeTxn.js.map +1 -1
  83. package/dist/esm/src/multisig.js +15 -25
  84. package/dist/esm/src/multisig.js.map +1 -1
  85. package/dist/esm/src/transaction.js +29 -0
  86. package/dist/esm/src/transaction.js.map +1 -1
  87. package/dist/esm/src/types/transactions/index.js +1 -1
  88. package/dist/esm/src/types/transactions/index.js.map +1 -1
  89. package/dist/types/src/boxStorage.d.ts +7 -0
  90. package/dist/types/src/client/client.d.ts +5 -3
  91. package/dist/types/src/client/urlTokenBaseHTTPClient.d.ts +8 -12
  92. package/dist/types/src/client/v2/algod/algod.d.ts +49 -1
  93. package/dist/types/src/client/v2/algod/getApplicationBoxByName.d.ts +28 -0
  94. package/dist/types/src/client/v2/algod/getApplicationBoxes.d.ts +43 -0
  95. package/dist/types/src/client/v2/algod/getBlockHash.d.ts +8 -0
  96. package/dist/types/src/client/v2/algod/models/types.d.ts +117 -2
  97. package/dist/types/src/client/v2/{algod/models/base.d.ts → basemodel.d.ts} +0 -0
  98. package/dist/types/src/client/v2/indexer/indexer.d.ts +46 -0
  99. package/dist/types/src/client/v2/indexer/lookupApplicationBoxByIDandName.d.ts +29 -0
  100. package/dist/types/src/client/v2/indexer/lookupBlock.d.ts +5 -0
  101. package/dist/types/src/client/v2/indexer/models/types.d.ts +2689 -0
  102. package/dist/types/src/client/v2/indexer/searchAccounts.d.ts +1 -1
  103. package/dist/types/src/client/v2/indexer/searchForApplicationBoxes.d.ts +80 -0
  104. package/dist/types/src/client/v2/jsonrequest.d.ts +8 -1
  105. package/dist/types/src/composer.d.ts +4 -2
  106. package/dist/types/src/main.d.ts +1 -0
  107. package/dist/types/src/makeTxn.d.ts +22 -15
  108. package/dist/types/src/transaction.d.ts +3 -1
  109. package/dist/types/src/types/transactions/application.d.ts +3 -3
  110. package/dist/types/src/types/transactions/base.d.ts +15 -1
  111. package/dist/types/src/types/transactions/encoded.d.ts +12 -1
  112. package/dist/types/src/types/transactions/index.d.ts +1 -1
  113. package/package.json +6 -7
  114. package/dist/cjs/src/client/v2/algod/models/base.js.map +0 -1
  115. package/dist/esm/src/client/v2/algod/models/base.js.map +0 -1
@@ -0,0 +1,3077 @@
1
+ "use strict";
2
+ /**
3
+ * NOTICE: This file was generated. Editing this file manually is not recommended.
4
+ */
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.TransactionAssetConfig = exports.TransactionApplication = exports.Transaction = exports.TealValue = exports.TealKeyValue = exports.StateSchema = exports.StateProofVerifier = exports.StateProofTracking = exports.StateProofSignature = exports.StateProofSigSlot = exports.StateProofReveal = exports.StateProofParticipant = exports.StateProofFields = exports.ParticipationUpdates = exports.MiniAssetHolding = exports.MerkleArrayProof = exports.IndexerStateProofMessage = exports.HealthCheck = exports.HashFactory = exports.EvalDeltaKeyValue = exports.EvalDelta = exports.ErrorResponse = exports.BoxesResponse = exports.BoxDescriptor = exports.Box = exports.BlockUpgradeVote = exports.BlockUpgradeState = exports.BlockRewards = exports.Block = exports.AssetsResponse = exports.AssetResponse = exports.AssetParams = exports.AssetHoldingsResponse = exports.AssetHolding = exports.AssetBalancesResponse = exports.Asset = exports.ApplicationsResponse = exports.ApplicationStateSchema = exports.ApplicationResponse = exports.ApplicationParams = exports.ApplicationLogsResponse = exports.ApplicationLogData = exports.ApplicationLocalStatesResponse = exports.ApplicationLocalState = exports.Application = exports.AccountsResponse = exports.AccountStateDelta = exports.AccountResponse = exports.AccountParticipation = exports.Account = void 0;
10
+ exports.TransactionsResponse = exports.TransactionStateProof = exports.TransactionSignatureMultisigSubsignature = exports.TransactionSignatureMultisig = exports.TransactionSignatureLogicsig = exports.TransactionSignature = exports.TransactionResponse = exports.TransactionPayment = exports.TransactionKeyreg = exports.TransactionAssetTransfer = exports.TransactionAssetFreeze = void 0;
11
+ /* eslint-disable no-use-before-define */
12
+ const basemodel_1 = __importDefault(require("../../basemodel"));
13
+ /**
14
+ * Account information at a given round.
15
+ * Definition:
16
+ * data/basics/userBalance.go : AccountData
17
+ */
18
+ class Account extends basemodel_1.default {
19
+ /**
20
+ * Creates a new `Account` object.
21
+ * @param address - the account public key
22
+ * @param amount - (algo) total number of MicroAlgos in the account
23
+ * @param amountWithoutPendingRewards - specifies the amount of MicroAlgos in the account, without the pending rewards.
24
+ * @param pendingRewards - amount of MicroAlgos of pending rewards in this account.
25
+ * @param rewards - (ern) total rewards of MicroAlgos the account has received, including pending
26
+ * rewards.
27
+ * @param round - The round for which this information is relevant.
28
+ * @param status - (onl) delegation status of the account's MicroAlgos
29
+ * * Offline - indicates that the associated account is delegated.
30
+ * * Online - indicates that the associated account used as part of the delegation
31
+ * pool.
32
+ * * NotParticipating - indicates that the associated account is neither a
33
+ * delegator nor a delegate.
34
+ * @param totalAppsOptedIn - The count of all applications that have been opted in, equivalent to the count
35
+ * of application local data (AppLocalState objects) stored in this account.
36
+ * @param totalAssetsOptedIn - The count of all assets that have been opted in, equivalent to the count of
37
+ * AssetHolding objects held by this account.
38
+ * @param totalBoxBytes - For app-accounts only. The total number of bytes allocated for the keys and
39
+ * values of boxes which belong to the associated application.
40
+ * @param totalBoxes - For app-accounts only. The total number of boxes which belong to the associated
41
+ * application.
42
+ * @param totalCreatedApps - The count of all apps (AppParams objects) created by this account.
43
+ * @param totalCreatedAssets - The count of all assets (AssetParams objects) created by this account.
44
+ * @param appsLocalState - (appl) applications local data stored in this account.
45
+ * Note the raw object uses `map[int] -> AppLocalState` for this type.
46
+ * @param appsTotalExtraPages - (teap) the sum of all extra application program pages for this account.
47
+ * @param appsTotalSchema - (tsch) stores the sum of all of the local schemas and global schemas in this
48
+ * account.
49
+ * Note: the raw account uses `StateSchema` for this type.
50
+ * @param assets - (asset) assets held by this account.
51
+ * Note the raw object uses `map[int] -> AssetHolding` for this type.
52
+ * @param authAddr - (spend) the address against which signing should be checked. If empty, the
53
+ * address of the current account is used. This field can be updated in any
54
+ * transaction by setting the RekeyTo field.
55
+ * @param closedAtRound - Round during which this account was most recently closed.
56
+ * @param createdApps - (appp) parameters of applications created by this account including app global
57
+ * data.
58
+ * Note: the raw account uses `map[int] -> AppParams` for this type.
59
+ * @param createdAssets - (apar) parameters of assets created by this account.
60
+ * Note: the raw account uses `map[int] -> Asset` for this type.
61
+ * @param createdAtRound - Round during which this account first appeared in a transaction.
62
+ * @param deleted - Whether or not this account is currently closed.
63
+ * @param participation - AccountParticipation describes the parameters used by this account in consensus
64
+ * protocol.
65
+ * @param rewardBase - (ebase) used as part of the rewards computation. Only applicable to accounts
66
+ * which are participating.
67
+ * @param sigType - Indicates what type of signature is used by this account, must be one of:
68
+ * * sig
69
+ * * msig
70
+ * * lsig
71
+ * * or null if unknown
72
+ */
73
+ constructor({ address, amount, amountWithoutPendingRewards, pendingRewards, rewards, round, status, totalAppsOptedIn, totalAssetsOptedIn, totalBoxBytes, totalBoxes, totalCreatedApps, totalCreatedAssets, appsLocalState, appsTotalExtraPages, appsTotalSchema, assets, authAddr, closedAtRound, createdApps, createdAssets, createdAtRound, deleted, participation, rewardBase, sigType, }) {
74
+ super();
75
+ this.address = address;
76
+ this.amount = amount;
77
+ this.amountWithoutPendingRewards = amountWithoutPendingRewards;
78
+ this.pendingRewards = pendingRewards;
79
+ this.rewards = rewards;
80
+ this.round = round;
81
+ this.status = status;
82
+ this.totalAppsOptedIn = totalAppsOptedIn;
83
+ this.totalAssetsOptedIn = totalAssetsOptedIn;
84
+ this.totalBoxBytes = totalBoxBytes;
85
+ this.totalBoxes = totalBoxes;
86
+ this.totalCreatedApps = totalCreatedApps;
87
+ this.totalCreatedAssets = totalCreatedAssets;
88
+ this.appsLocalState = appsLocalState;
89
+ this.appsTotalExtraPages = appsTotalExtraPages;
90
+ this.appsTotalSchema = appsTotalSchema;
91
+ this.assets = assets;
92
+ this.authAddr = authAddr;
93
+ this.closedAtRound = closedAtRound;
94
+ this.createdApps = createdApps;
95
+ this.createdAssets = createdAssets;
96
+ this.createdAtRound = createdAtRound;
97
+ this.deleted = deleted;
98
+ this.participation = participation;
99
+ this.rewardBase = rewardBase;
100
+ this.sigType = sigType;
101
+ this.attribute_map = {
102
+ address: 'address',
103
+ amount: 'amount',
104
+ amountWithoutPendingRewards: 'amount-without-pending-rewards',
105
+ pendingRewards: 'pending-rewards',
106
+ rewards: 'rewards',
107
+ round: 'round',
108
+ status: 'status',
109
+ totalAppsOptedIn: 'total-apps-opted-in',
110
+ totalAssetsOptedIn: 'total-assets-opted-in',
111
+ totalBoxBytes: 'total-box-bytes',
112
+ totalBoxes: 'total-boxes',
113
+ totalCreatedApps: 'total-created-apps',
114
+ totalCreatedAssets: 'total-created-assets',
115
+ appsLocalState: 'apps-local-state',
116
+ appsTotalExtraPages: 'apps-total-extra-pages',
117
+ appsTotalSchema: 'apps-total-schema',
118
+ assets: 'assets',
119
+ authAddr: 'auth-addr',
120
+ closedAtRound: 'closed-at-round',
121
+ createdApps: 'created-apps',
122
+ createdAssets: 'created-assets',
123
+ createdAtRound: 'created-at-round',
124
+ deleted: 'deleted',
125
+ participation: 'participation',
126
+ rewardBase: 'reward-base',
127
+ sigType: 'sig-type',
128
+ };
129
+ }
130
+ // eslint-disable-next-line camelcase
131
+ static from_obj_for_encoding(data) {
132
+ /* eslint-disable dot-notation */
133
+ if (typeof data['address'] === 'undefined')
134
+ throw new Error(`Response is missing required field 'address': ${data}`);
135
+ if (typeof data['amount'] === 'undefined')
136
+ throw new Error(`Response is missing required field 'amount': ${data}`);
137
+ if (typeof data['amount-without-pending-rewards'] === 'undefined')
138
+ throw new Error(`Response is missing required field 'amount-without-pending-rewards': ${data}`);
139
+ if (typeof data['pending-rewards'] === 'undefined')
140
+ throw new Error(`Response is missing required field 'pending-rewards': ${data}`);
141
+ if (typeof data['rewards'] === 'undefined')
142
+ throw new Error(`Response is missing required field 'rewards': ${data}`);
143
+ if (typeof data['round'] === 'undefined')
144
+ throw new Error(`Response is missing required field 'round': ${data}`);
145
+ if (typeof data['status'] === 'undefined')
146
+ throw new Error(`Response is missing required field 'status': ${data}`);
147
+ if (typeof data['total-apps-opted-in'] === 'undefined')
148
+ throw new Error(`Response is missing required field 'total-apps-opted-in': ${data}`);
149
+ if (typeof data['total-assets-opted-in'] === 'undefined')
150
+ throw new Error(`Response is missing required field 'total-assets-opted-in': ${data}`);
151
+ if (typeof data['total-box-bytes'] === 'undefined')
152
+ throw new Error(`Response is missing required field 'total-box-bytes': ${data}`);
153
+ if (typeof data['total-boxes'] === 'undefined')
154
+ throw new Error(`Response is missing required field 'total-boxes': ${data}`);
155
+ if (typeof data['total-created-apps'] === 'undefined')
156
+ throw new Error(`Response is missing required field 'total-created-apps': ${data}`);
157
+ if (typeof data['total-created-assets'] === 'undefined')
158
+ throw new Error(`Response is missing required field 'total-created-assets': ${data}`);
159
+ return new Account({
160
+ address: data['address'],
161
+ amount: data['amount'],
162
+ amountWithoutPendingRewards: data['amount-without-pending-rewards'],
163
+ pendingRewards: data['pending-rewards'],
164
+ rewards: data['rewards'],
165
+ round: data['round'],
166
+ status: data['status'],
167
+ totalAppsOptedIn: data['total-apps-opted-in'],
168
+ totalAssetsOptedIn: data['total-assets-opted-in'],
169
+ totalBoxBytes: data['total-box-bytes'],
170
+ totalBoxes: data['total-boxes'],
171
+ totalCreatedApps: data['total-created-apps'],
172
+ totalCreatedAssets: data['total-created-assets'],
173
+ appsLocalState: typeof data['apps-local-state'] !== 'undefined'
174
+ ? data['apps-local-state'].map(ApplicationLocalState.from_obj_for_encoding)
175
+ : undefined,
176
+ appsTotalExtraPages: data['apps-total-extra-pages'],
177
+ appsTotalSchema: typeof data['apps-total-schema'] !== 'undefined'
178
+ ? ApplicationStateSchema.from_obj_for_encoding(data['apps-total-schema'])
179
+ : undefined,
180
+ assets: typeof data['assets'] !== 'undefined'
181
+ ? data['assets'].map(AssetHolding.from_obj_for_encoding)
182
+ : undefined,
183
+ authAddr: data['auth-addr'],
184
+ closedAtRound: data['closed-at-round'],
185
+ createdApps: typeof data['created-apps'] !== 'undefined'
186
+ ? data['created-apps'].map(Application.from_obj_for_encoding)
187
+ : undefined,
188
+ createdAssets: typeof data['created-assets'] !== 'undefined'
189
+ ? data['created-assets'].map(Asset.from_obj_for_encoding)
190
+ : undefined,
191
+ createdAtRound: data['created-at-round'],
192
+ deleted: data['deleted'],
193
+ participation: typeof data['participation'] !== 'undefined'
194
+ ? AccountParticipation.from_obj_for_encoding(data['participation'])
195
+ : undefined,
196
+ rewardBase: data['reward-base'],
197
+ sigType: data['sig-type'],
198
+ });
199
+ /* eslint-enable dot-notation */
200
+ }
201
+ }
202
+ exports.Account = Account;
203
+ /**
204
+ * AccountParticipation describes the parameters used by this account in consensus
205
+ * protocol.
206
+ */
207
+ class AccountParticipation extends basemodel_1.default {
208
+ /**
209
+ * Creates a new `AccountParticipation` object.
210
+ * @param selectionParticipationKey - (sel) Selection public key (if any) currently registered for this round.
211
+ * @param voteFirstValid - (voteFst) First round for which this participation is valid.
212
+ * @param voteKeyDilution - (voteKD) Number of subkeys in each batch of participation keys.
213
+ * @param voteLastValid - (voteLst) Last round for which this participation is valid.
214
+ * @param voteParticipationKey - (vote) root participation public key (if any) currently registered for this
215
+ * round.
216
+ * @param stateProofKey - (stprf) Root of the state proof key (if any)
217
+ */
218
+ constructor({ selectionParticipationKey, voteFirstValid, voteKeyDilution, voteLastValid, voteParticipationKey, stateProofKey, }) {
219
+ super();
220
+ this.selectionParticipationKey =
221
+ typeof selectionParticipationKey === 'string'
222
+ ? new Uint8Array(Buffer.from(selectionParticipationKey, 'base64'))
223
+ : selectionParticipationKey;
224
+ this.voteFirstValid = voteFirstValid;
225
+ this.voteKeyDilution = voteKeyDilution;
226
+ this.voteLastValid = voteLastValid;
227
+ this.voteParticipationKey =
228
+ typeof voteParticipationKey === 'string'
229
+ ? new Uint8Array(Buffer.from(voteParticipationKey, 'base64'))
230
+ : voteParticipationKey;
231
+ this.stateProofKey =
232
+ typeof stateProofKey === 'string'
233
+ ? new Uint8Array(Buffer.from(stateProofKey, 'base64'))
234
+ : stateProofKey;
235
+ this.attribute_map = {
236
+ selectionParticipationKey: 'selection-participation-key',
237
+ voteFirstValid: 'vote-first-valid',
238
+ voteKeyDilution: 'vote-key-dilution',
239
+ voteLastValid: 'vote-last-valid',
240
+ voteParticipationKey: 'vote-participation-key',
241
+ stateProofKey: 'state-proof-key',
242
+ };
243
+ }
244
+ // eslint-disable-next-line camelcase
245
+ static from_obj_for_encoding(data) {
246
+ /* eslint-disable dot-notation */
247
+ if (typeof data['selection-participation-key'] === 'undefined')
248
+ throw new Error(`Response is missing required field 'selection-participation-key': ${data}`);
249
+ if (typeof data['vote-first-valid'] === 'undefined')
250
+ throw new Error(`Response is missing required field 'vote-first-valid': ${data}`);
251
+ if (typeof data['vote-key-dilution'] === 'undefined')
252
+ throw new Error(`Response is missing required field 'vote-key-dilution': ${data}`);
253
+ if (typeof data['vote-last-valid'] === 'undefined')
254
+ throw new Error(`Response is missing required field 'vote-last-valid': ${data}`);
255
+ if (typeof data['vote-participation-key'] === 'undefined')
256
+ throw new Error(`Response is missing required field 'vote-participation-key': ${data}`);
257
+ return new AccountParticipation({
258
+ selectionParticipationKey: data['selection-participation-key'],
259
+ voteFirstValid: data['vote-first-valid'],
260
+ voteKeyDilution: data['vote-key-dilution'],
261
+ voteLastValid: data['vote-last-valid'],
262
+ voteParticipationKey: data['vote-participation-key'],
263
+ stateProofKey: data['state-proof-key'],
264
+ });
265
+ /* eslint-enable dot-notation */
266
+ }
267
+ }
268
+ exports.AccountParticipation = AccountParticipation;
269
+ /**
270
+ *
271
+ */
272
+ class AccountResponse extends basemodel_1.default {
273
+ /**
274
+ * Creates a new `AccountResponse` object.
275
+ * @param account - Account information at a given round.
276
+ * Definition:
277
+ * data/basics/userBalance.go : AccountData
278
+ * @param currentRound - Round at which the results were computed.
279
+ */
280
+ constructor({ account, currentRound, }) {
281
+ super();
282
+ this.account = account;
283
+ this.currentRound = currentRound;
284
+ this.attribute_map = {
285
+ account: 'account',
286
+ currentRound: 'current-round',
287
+ };
288
+ }
289
+ // eslint-disable-next-line camelcase
290
+ static from_obj_for_encoding(data) {
291
+ /* eslint-disable dot-notation */
292
+ if (typeof data['account'] === 'undefined')
293
+ throw new Error(`Response is missing required field 'account': ${data}`);
294
+ if (typeof data['current-round'] === 'undefined')
295
+ throw new Error(`Response is missing required field 'current-round': ${data}`);
296
+ return new AccountResponse({
297
+ account: Account.from_obj_for_encoding(data['account']),
298
+ currentRound: data['current-round'],
299
+ });
300
+ /* eslint-enable dot-notation */
301
+ }
302
+ }
303
+ exports.AccountResponse = AccountResponse;
304
+ /**
305
+ * Application state delta.
306
+ */
307
+ class AccountStateDelta extends basemodel_1.default {
308
+ /**
309
+ * Creates a new `AccountStateDelta` object.
310
+ * @param address -
311
+ * @param delta - Application state delta.
312
+ */
313
+ constructor({ address, delta, }) {
314
+ super();
315
+ this.address = address;
316
+ this.delta = delta;
317
+ this.attribute_map = {
318
+ address: 'address',
319
+ delta: 'delta',
320
+ };
321
+ }
322
+ // eslint-disable-next-line camelcase
323
+ static from_obj_for_encoding(data) {
324
+ /* eslint-disable dot-notation */
325
+ if (typeof data['address'] === 'undefined')
326
+ throw new Error(`Response is missing required field 'address': ${data}`);
327
+ if (!Array.isArray(data['delta']))
328
+ throw new Error(`Response is missing required array field 'delta': ${data}`);
329
+ return new AccountStateDelta({
330
+ address: data['address'],
331
+ delta: data['delta'].map(EvalDeltaKeyValue.from_obj_for_encoding),
332
+ });
333
+ /* eslint-enable dot-notation */
334
+ }
335
+ }
336
+ exports.AccountStateDelta = AccountStateDelta;
337
+ /**
338
+ *
339
+ */
340
+ class AccountsResponse extends basemodel_1.default {
341
+ /**
342
+ * Creates a new `AccountsResponse` object.
343
+ * @param accounts -
344
+ * @param currentRound - Round at which the results were computed.
345
+ * @param nextToken - Used for pagination, when making another request provide this token with the
346
+ * next parameter.
347
+ */
348
+ constructor({ accounts, currentRound, nextToken, }) {
349
+ super();
350
+ this.accounts = accounts;
351
+ this.currentRound = currentRound;
352
+ this.nextToken = nextToken;
353
+ this.attribute_map = {
354
+ accounts: 'accounts',
355
+ currentRound: 'current-round',
356
+ nextToken: 'next-token',
357
+ };
358
+ }
359
+ // eslint-disable-next-line camelcase
360
+ static from_obj_for_encoding(data) {
361
+ /* eslint-disable dot-notation */
362
+ if (!Array.isArray(data['accounts']))
363
+ throw new Error(`Response is missing required array field 'accounts': ${data}`);
364
+ if (typeof data['current-round'] === 'undefined')
365
+ throw new Error(`Response is missing required field 'current-round': ${data}`);
366
+ return new AccountsResponse({
367
+ accounts: data['accounts'].map(Account.from_obj_for_encoding),
368
+ currentRound: data['current-round'],
369
+ nextToken: data['next-token'],
370
+ });
371
+ /* eslint-enable dot-notation */
372
+ }
373
+ }
374
+ exports.AccountsResponse = AccountsResponse;
375
+ /**
376
+ * Application index and its parameters
377
+ */
378
+ class Application extends basemodel_1.default {
379
+ /**
380
+ * Creates a new `Application` object.
381
+ * @param id - (appidx) application index.
382
+ * @param params - (appparams) application parameters.
383
+ * @param createdAtRound - Round when this application was created.
384
+ * @param deleted - Whether or not this application is currently deleted.
385
+ * @param deletedAtRound - Round when this application was deleted.
386
+ */
387
+ constructor({ id, params, createdAtRound, deleted, deletedAtRound, }) {
388
+ super();
389
+ this.id = id;
390
+ this.params = params;
391
+ this.createdAtRound = createdAtRound;
392
+ this.deleted = deleted;
393
+ this.deletedAtRound = deletedAtRound;
394
+ this.attribute_map = {
395
+ id: 'id',
396
+ params: 'params',
397
+ createdAtRound: 'created-at-round',
398
+ deleted: 'deleted',
399
+ deletedAtRound: 'deleted-at-round',
400
+ };
401
+ }
402
+ // eslint-disable-next-line camelcase
403
+ static from_obj_for_encoding(data) {
404
+ /* eslint-disable dot-notation */
405
+ if (typeof data['id'] === 'undefined')
406
+ throw new Error(`Response is missing required field 'id': ${data}`);
407
+ if (typeof data['params'] === 'undefined')
408
+ throw new Error(`Response is missing required field 'params': ${data}`);
409
+ return new Application({
410
+ id: data['id'],
411
+ params: ApplicationParams.from_obj_for_encoding(data['params']),
412
+ createdAtRound: data['created-at-round'],
413
+ deleted: data['deleted'],
414
+ deletedAtRound: data['deleted-at-round'],
415
+ });
416
+ /* eslint-enable dot-notation */
417
+ }
418
+ }
419
+ exports.Application = Application;
420
+ /**
421
+ * Stores local state associated with an application.
422
+ */
423
+ class ApplicationLocalState extends basemodel_1.default {
424
+ /**
425
+ * Creates a new `ApplicationLocalState` object.
426
+ * @param id - The application which this local state is for.
427
+ * @param schema - (hsch) schema.
428
+ * @param closedOutAtRound - Round when account closed out of the application.
429
+ * @param deleted - Whether or not the application local state is currently deleted from its
430
+ * account.
431
+ * @param keyValue - (tkv) storage.
432
+ * @param optedInAtRound - Round when the account opted into the application.
433
+ */
434
+ constructor({ id, schema, closedOutAtRound, deleted, keyValue, optedInAtRound, }) {
435
+ super();
436
+ this.id = id;
437
+ this.schema = schema;
438
+ this.closedOutAtRound = closedOutAtRound;
439
+ this.deleted = deleted;
440
+ this.keyValue = keyValue;
441
+ this.optedInAtRound = optedInAtRound;
442
+ this.attribute_map = {
443
+ id: 'id',
444
+ schema: 'schema',
445
+ closedOutAtRound: 'closed-out-at-round',
446
+ deleted: 'deleted',
447
+ keyValue: 'key-value',
448
+ optedInAtRound: 'opted-in-at-round',
449
+ };
450
+ }
451
+ // eslint-disable-next-line camelcase
452
+ static from_obj_for_encoding(data) {
453
+ /* eslint-disable dot-notation */
454
+ if (typeof data['id'] === 'undefined')
455
+ throw new Error(`Response is missing required field 'id': ${data}`);
456
+ if (typeof data['schema'] === 'undefined')
457
+ throw new Error(`Response is missing required field 'schema': ${data}`);
458
+ return new ApplicationLocalState({
459
+ id: data['id'],
460
+ schema: ApplicationStateSchema.from_obj_for_encoding(data['schema']),
461
+ closedOutAtRound: data['closed-out-at-round'],
462
+ deleted: data['deleted'],
463
+ keyValue: typeof data['key-value'] !== 'undefined'
464
+ ? data['key-value'].map(TealKeyValue.from_obj_for_encoding)
465
+ : undefined,
466
+ optedInAtRound: data['opted-in-at-round'],
467
+ });
468
+ /* eslint-enable dot-notation */
469
+ }
470
+ }
471
+ exports.ApplicationLocalState = ApplicationLocalState;
472
+ /**
473
+ *
474
+ */
475
+ class ApplicationLocalStatesResponse extends basemodel_1.default {
476
+ /**
477
+ * Creates a new `ApplicationLocalStatesResponse` object.
478
+ * @param appsLocalStates -
479
+ * @param currentRound - Round at which the results were computed.
480
+ * @param nextToken - Used for pagination, when making another request provide this token with the
481
+ * next parameter.
482
+ */
483
+ constructor({ appsLocalStates, currentRound, nextToken, }) {
484
+ super();
485
+ this.appsLocalStates = appsLocalStates;
486
+ this.currentRound = currentRound;
487
+ this.nextToken = nextToken;
488
+ this.attribute_map = {
489
+ appsLocalStates: 'apps-local-states',
490
+ currentRound: 'current-round',
491
+ nextToken: 'next-token',
492
+ };
493
+ }
494
+ // eslint-disable-next-line camelcase
495
+ static from_obj_for_encoding(data) {
496
+ /* eslint-disable dot-notation */
497
+ if (!Array.isArray(data['apps-local-states']))
498
+ throw new Error(`Response is missing required array field 'apps-local-states': ${data}`);
499
+ if (typeof data['current-round'] === 'undefined')
500
+ throw new Error(`Response is missing required field 'current-round': ${data}`);
501
+ return new ApplicationLocalStatesResponse({
502
+ appsLocalStates: data['apps-local-states'].map(ApplicationLocalState.from_obj_for_encoding),
503
+ currentRound: data['current-round'],
504
+ nextToken: data['next-token'],
505
+ });
506
+ /* eslint-enable dot-notation */
507
+ }
508
+ }
509
+ exports.ApplicationLocalStatesResponse = ApplicationLocalStatesResponse;
510
+ /**
511
+ * Stores the global information associated with an application.
512
+ */
513
+ class ApplicationLogData extends basemodel_1.default {
514
+ /**
515
+ * Creates a new `ApplicationLogData` object.
516
+ * @param logs - (lg) Logs for the application being executed by the transaction.
517
+ * @param txid - Transaction ID
518
+ */
519
+ constructor({ logs, txid }) {
520
+ super();
521
+ this.logs = logs;
522
+ this.txid = txid;
523
+ this.attribute_map = {
524
+ logs: 'logs',
525
+ txid: 'txid',
526
+ };
527
+ }
528
+ // eslint-disable-next-line camelcase
529
+ static from_obj_for_encoding(data) {
530
+ /* eslint-disable dot-notation */
531
+ if (!Array.isArray(data['logs']))
532
+ throw new Error(`Response is missing required array field 'logs': ${data}`);
533
+ if (typeof data['txid'] === 'undefined')
534
+ throw new Error(`Response is missing required field 'txid': ${data}`);
535
+ return new ApplicationLogData({
536
+ logs: data['logs'],
537
+ txid: data['txid'],
538
+ });
539
+ /* eslint-enable dot-notation */
540
+ }
541
+ }
542
+ exports.ApplicationLogData = ApplicationLogData;
543
+ /**
544
+ *
545
+ */
546
+ class ApplicationLogsResponse extends basemodel_1.default {
547
+ /**
548
+ * Creates a new `ApplicationLogsResponse` object.
549
+ * @param applicationId - (appidx) application index.
550
+ * @param currentRound - Round at which the results were computed.
551
+ * @param logData -
552
+ * @param nextToken - Used for pagination, when making another request provide this token with the
553
+ * next parameter.
554
+ */
555
+ constructor({ applicationId, currentRound, logData, nextToken, }) {
556
+ super();
557
+ this.applicationId = applicationId;
558
+ this.currentRound = currentRound;
559
+ this.logData = logData;
560
+ this.nextToken = nextToken;
561
+ this.attribute_map = {
562
+ applicationId: 'application-id',
563
+ currentRound: 'current-round',
564
+ logData: 'log-data',
565
+ nextToken: 'next-token',
566
+ };
567
+ }
568
+ // eslint-disable-next-line camelcase
569
+ static from_obj_for_encoding(data) {
570
+ /* eslint-disable dot-notation */
571
+ if (typeof data['application-id'] === 'undefined')
572
+ throw new Error(`Response is missing required field 'application-id': ${data}`);
573
+ if (typeof data['current-round'] === 'undefined')
574
+ throw new Error(`Response is missing required field 'current-round': ${data}`);
575
+ return new ApplicationLogsResponse({
576
+ applicationId: data['application-id'],
577
+ currentRound: data['current-round'],
578
+ logData: typeof data['log-data'] !== 'undefined'
579
+ ? data['log-data'].map(ApplicationLogData.from_obj_for_encoding)
580
+ : undefined,
581
+ nextToken: data['next-token'],
582
+ });
583
+ /* eslint-enable dot-notation */
584
+ }
585
+ }
586
+ exports.ApplicationLogsResponse = ApplicationLogsResponse;
587
+ /**
588
+ * Stores the global information associated with an application.
589
+ */
590
+ class ApplicationParams extends basemodel_1.default {
591
+ /**
592
+ * Creates a new `ApplicationParams` object.
593
+ * @param approvalProgram - (approv) approval program.
594
+ * @param clearStateProgram - (clearp) approval program.
595
+ * @param creator - The address that created this application. This is the address where the
596
+ * parameters and global state for this application can be found.
597
+ * @param extraProgramPages - (epp) the amount of extra program pages available to this app.
598
+ * @param globalState - [\gs) global schema
599
+ * @param globalStateSchema - [\gsch) global schema
600
+ * @param localStateSchema - [\lsch) local schema
601
+ */
602
+ constructor({ approvalProgram, clearStateProgram, creator, extraProgramPages, globalState, globalStateSchema, localStateSchema, }) {
603
+ super();
604
+ this.approvalProgram =
605
+ typeof approvalProgram === 'string'
606
+ ? new Uint8Array(Buffer.from(approvalProgram, 'base64'))
607
+ : approvalProgram;
608
+ this.clearStateProgram =
609
+ typeof clearStateProgram === 'string'
610
+ ? new Uint8Array(Buffer.from(clearStateProgram, 'base64'))
611
+ : clearStateProgram;
612
+ this.creator = creator;
613
+ this.extraProgramPages = extraProgramPages;
614
+ this.globalState = globalState;
615
+ this.globalStateSchema = globalStateSchema;
616
+ this.localStateSchema = localStateSchema;
617
+ this.attribute_map = {
618
+ approvalProgram: 'approval-program',
619
+ clearStateProgram: 'clear-state-program',
620
+ creator: 'creator',
621
+ extraProgramPages: 'extra-program-pages',
622
+ globalState: 'global-state',
623
+ globalStateSchema: 'global-state-schema',
624
+ localStateSchema: 'local-state-schema',
625
+ };
626
+ }
627
+ // eslint-disable-next-line camelcase
628
+ static from_obj_for_encoding(data) {
629
+ /* eslint-disable dot-notation */
630
+ if (typeof data['approval-program'] === 'undefined')
631
+ throw new Error(`Response is missing required field 'approval-program': ${data}`);
632
+ if (typeof data['clear-state-program'] === 'undefined')
633
+ throw new Error(`Response is missing required field 'clear-state-program': ${data}`);
634
+ return new ApplicationParams({
635
+ approvalProgram: data['approval-program'],
636
+ clearStateProgram: data['clear-state-program'],
637
+ creator: data['creator'],
638
+ extraProgramPages: data['extra-program-pages'],
639
+ globalState: typeof data['global-state'] !== 'undefined'
640
+ ? data['global-state'].map(TealKeyValue.from_obj_for_encoding)
641
+ : undefined,
642
+ globalStateSchema: typeof data['global-state-schema'] !== 'undefined'
643
+ ? ApplicationStateSchema.from_obj_for_encoding(data['global-state-schema'])
644
+ : undefined,
645
+ localStateSchema: typeof data['local-state-schema'] !== 'undefined'
646
+ ? ApplicationStateSchema.from_obj_for_encoding(data['local-state-schema'])
647
+ : undefined,
648
+ });
649
+ /* eslint-enable dot-notation */
650
+ }
651
+ }
652
+ exports.ApplicationParams = ApplicationParams;
653
+ /**
654
+ *
655
+ */
656
+ class ApplicationResponse extends basemodel_1.default {
657
+ /**
658
+ * Creates a new `ApplicationResponse` object.
659
+ * @param currentRound - Round at which the results were computed.
660
+ * @param application - Application index and its parameters
661
+ */
662
+ constructor({ currentRound, application, }) {
663
+ super();
664
+ this.currentRound = currentRound;
665
+ this.application = application;
666
+ this.attribute_map = {
667
+ currentRound: 'current-round',
668
+ application: 'application',
669
+ };
670
+ }
671
+ // eslint-disable-next-line camelcase
672
+ static from_obj_for_encoding(data) {
673
+ /* eslint-disable dot-notation */
674
+ if (typeof data['current-round'] === 'undefined')
675
+ throw new Error(`Response is missing required field 'current-round': ${data}`);
676
+ return new ApplicationResponse({
677
+ currentRound: data['current-round'],
678
+ application: typeof data['application'] !== 'undefined'
679
+ ? Application.from_obj_for_encoding(data['application'])
680
+ : undefined,
681
+ });
682
+ /* eslint-enable dot-notation */
683
+ }
684
+ }
685
+ exports.ApplicationResponse = ApplicationResponse;
686
+ /**
687
+ * Specifies maximums on the number of each type that may be stored.
688
+ */
689
+ class ApplicationStateSchema extends basemodel_1.default {
690
+ /**
691
+ * Creates a new `ApplicationStateSchema` object.
692
+ * @param numByteSlice - (nbs) num of byte slices.
693
+ * @param numUint - (nui) num of uints.
694
+ */
695
+ constructor({ numByteSlice, numUint, }) {
696
+ super();
697
+ this.numByteSlice = numByteSlice;
698
+ this.numUint = numUint;
699
+ this.attribute_map = {
700
+ numByteSlice: 'num-byte-slice',
701
+ numUint: 'num-uint',
702
+ };
703
+ }
704
+ // eslint-disable-next-line camelcase
705
+ static from_obj_for_encoding(data) {
706
+ /* eslint-disable dot-notation */
707
+ if (typeof data['num-byte-slice'] === 'undefined')
708
+ throw new Error(`Response is missing required field 'num-byte-slice': ${data}`);
709
+ if (typeof data['num-uint'] === 'undefined')
710
+ throw new Error(`Response is missing required field 'num-uint': ${data}`);
711
+ return new ApplicationStateSchema({
712
+ numByteSlice: data['num-byte-slice'],
713
+ numUint: data['num-uint'],
714
+ });
715
+ /* eslint-enable dot-notation */
716
+ }
717
+ }
718
+ exports.ApplicationStateSchema = ApplicationStateSchema;
719
+ /**
720
+ *
721
+ */
722
+ class ApplicationsResponse extends basemodel_1.default {
723
+ /**
724
+ * Creates a new `ApplicationsResponse` object.
725
+ * @param applications -
726
+ * @param currentRound - Round at which the results were computed.
727
+ * @param nextToken - Used for pagination, when making another request provide this token with the
728
+ * next parameter.
729
+ */
730
+ constructor({ applications, currentRound, nextToken, }) {
731
+ super();
732
+ this.applications = applications;
733
+ this.currentRound = currentRound;
734
+ this.nextToken = nextToken;
735
+ this.attribute_map = {
736
+ applications: 'applications',
737
+ currentRound: 'current-round',
738
+ nextToken: 'next-token',
739
+ };
740
+ }
741
+ // eslint-disable-next-line camelcase
742
+ static from_obj_for_encoding(data) {
743
+ /* eslint-disable dot-notation */
744
+ if (!Array.isArray(data['applications']))
745
+ throw new Error(`Response is missing required array field 'applications': ${data}`);
746
+ if (typeof data['current-round'] === 'undefined')
747
+ throw new Error(`Response is missing required field 'current-round': ${data}`);
748
+ return new ApplicationsResponse({
749
+ applications: data['applications'].map(Application.from_obj_for_encoding),
750
+ currentRound: data['current-round'],
751
+ nextToken: data['next-token'],
752
+ });
753
+ /* eslint-enable dot-notation */
754
+ }
755
+ }
756
+ exports.ApplicationsResponse = ApplicationsResponse;
757
+ /**
758
+ * Specifies both the unique identifier and the parameters for an asset
759
+ */
760
+ class Asset extends basemodel_1.default {
761
+ /**
762
+ * Creates a new `Asset` object.
763
+ * @param index - unique asset identifier
764
+ * @param params - AssetParams specifies the parameters for an asset.
765
+ * (apar) when part of an AssetConfig transaction.
766
+ * Definition:
767
+ * data/transactions/asset.go : AssetParams
768
+ * @param createdAtRound - Round during which this asset was created.
769
+ * @param deleted - Whether or not this asset is currently deleted.
770
+ * @param destroyedAtRound - Round during which this asset was destroyed.
771
+ */
772
+ constructor({ index, params, createdAtRound, deleted, destroyedAtRound, }) {
773
+ super();
774
+ this.index = index;
775
+ this.params = params;
776
+ this.createdAtRound = createdAtRound;
777
+ this.deleted = deleted;
778
+ this.destroyedAtRound = destroyedAtRound;
779
+ this.attribute_map = {
780
+ index: 'index',
781
+ params: 'params',
782
+ createdAtRound: 'created-at-round',
783
+ deleted: 'deleted',
784
+ destroyedAtRound: 'destroyed-at-round',
785
+ };
786
+ }
787
+ // eslint-disable-next-line camelcase
788
+ static from_obj_for_encoding(data) {
789
+ /* eslint-disable dot-notation */
790
+ if (typeof data['index'] === 'undefined')
791
+ throw new Error(`Response is missing required field 'index': ${data}`);
792
+ if (typeof data['params'] === 'undefined')
793
+ throw new Error(`Response is missing required field 'params': ${data}`);
794
+ return new Asset({
795
+ index: data['index'],
796
+ params: AssetParams.from_obj_for_encoding(data['params']),
797
+ createdAtRound: data['created-at-round'],
798
+ deleted: data['deleted'],
799
+ destroyedAtRound: data['destroyed-at-round'],
800
+ });
801
+ /* eslint-enable dot-notation */
802
+ }
803
+ }
804
+ exports.Asset = Asset;
805
+ /**
806
+ *
807
+ */
808
+ class AssetBalancesResponse extends basemodel_1.default {
809
+ /**
810
+ * Creates a new `AssetBalancesResponse` object.
811
+ * @param balances -
812
+ * @param currentRound - Round at which the results were computed.
813
+ * @param nextToken - Used for pagination, when making another request provide this token with the
814
+ * next parameter.
815
+ */
816
+ constructor({ balances, currentRound, nextToken, }) {
817
+ super();
818
+ this.balances = balances;
819
+ this.currentRound = currentRound;
820
+ this.nextToken = nextToken;
821
+ this.attribute_map = {
822
+ balances: 'balances',
823
+ currentRound: 'current-round',
824
+ nextToken: 'next-token',
825
+ };
826
+ }
827
+ // eslint-disable-next-line camelcase
828
+ static from_obj_for_encoding(data) {
829
+ /* eslint-disable dot-notation */
830
+ if (!Array.isArray(data['balances']))
831
+ throw new Error(`Response is missing required array field 'balances': ${data}`);
832
+ if (typeof data['current-round'] === 'undefined')
833
+ throw new Error(`Response is missing required field 'current-round': ${data}`);
834
+ return new AssetBalancesResponse({
835
+ balances: data['balances'].map(MiniAssetHolding.from_obj_for_encoding),
836
+ currentRound: data['current-round'],
837
+ nextToken: data['next-token'],
838
+ });
839
+ /* eslint-enable dot-notation */
840
+ }
841
+ }
842
+ exports.AssetBalancesResponse = AssetBalancesResponse;
843
+ /**
844
+ * Describes an asset held by an account.
845
+ * Definition:
846
+ * data/basics/userBalance.go : AssetHolding
847
+ */
848
+ class AssetHolding extends basemodel_1.default {
849
+ /**
850
+ * Creates a new `AssetHolding` object.
851
+ * @param amount - (a) number of units held.
852
+ * @param assetId - Asset ID of the holding.
853
+ * @param isFrozen - (f) whether or not the holding is frozen.
854
+ * @param deleted - Whether or not the asset holding is currently deleted from its account.
855
+ * @param optedInAtRound - Round during which the account opted into this asset holding.
856
+ * @param optedOutAtRound - Round during which the account opted out of this asset holding.
857
+ */
858
+ constructor({ amount, assetId, isFrozen, deleted, optedInAtRound, optedOutAtRound, }) {
859
+ super();
860
+ this.amount = amount;
861
+ this.assetId = assetId;
862
+ this.isFrozen = isFrozen;
863
+ this.deleted = deleted;
864
+ this.optedInAtRound = optedInAtRound;
865
+ this.optedOutAtRound = optedOutAtRound;
866
+ this.attribute_map = {
867
+ amount: 'amount',
868
+ assetId: 'asset-id',
869
+ isFrozen: 'is-frozen',
870
+ deleted: 'deleted',
871
+ optedInAtRound: 'opted-in-at-round',
872
+ optedOutAtRound: 'opted-out-at-round',
873
+ };
874
+ }
875
+ // eslint-disable-next-line camelcase
876
+ static from_obj_for_encoding(data) {
877
+ /* eslint-disable dot-notation */
878
+ if (typeof data['amount'] === 'undefined')
879
+ throw new Error(`Response is missing required field 'amount': ${data}`);
880
+ if (typeof data['asset-id'] === 'undefined')
881
+ throw new Error(`Response is missing required field 'asset-id': ${data}`);
882
+ if (typeof data['is-frozen'] === 'undefined')
883
+ throw new Error(`Response is missing required field 'is-frozen': ${data}`);
884
+ return new AssetHolding({
885
+ amount: data['amount'],
886
+ assetId: data['asset-id'],
887
+ isFrozen: data['is-frozen'],
888
+ deleted: data['deleted'],
889
+ optedInAtRound: data['opted-in-at-round'],
890
+ optedOutAtRound: data['opted-out-at-round'],
891
+ });
892
+ /* eslint-enable dot-notation */
893
+ }
894
+ }
895
+ exports.AssetHolding = AssetHolding;
896
+ /**
897
+ *
898
+ */
899
+ class AssetHoldingsResponse extends basemodel_1.default {
900
+ /**
901
+ * Creates a new `AssetHoldingsResponse` object.
902
+ * @param assets -
903
+ * @param currentRound - Round at which the results were computed.
904
+ * @param nextToken - Used for pagination, when making another request provide this token with the
905
+ * next parameter.
906
+ */
907
+ constructor({ assets, currentRound, nextToken, }) {
908
+ super();
909
+ this.assets = assets;
910
+ this.currentRound = currentRound;
911
+ this.nextToken = nextToken;
912
+ this.attribute_map = {
913
+ assets: 'assets',
914
+ currentRound: 'current-round',
915
+ nextToken: 'next-token',
916
+ };
917
+ }
918
+ // eslint-disable-next-line camelcase
919
+ static from_obj_for_encoding(data) {
920
+ /* eslint-disable dot-notation */
921
+ if (!Array.isArray(data['assets']))
922
+ throw new Error(`Response is missing required array field 'assets': ${data}`);
923
+ if (typeof data['current-round'] === 'undefined')
924
+ throw new Error(`Response is missing required field 'current-round': ${data}`);
925
+ return new AssetHoldingsResponse({
926
+ assets: data['assets'].map(AssetHolding.from_obj_for_encoding),
927
+ currentRound: data['current-round'],
928
+ nextToken: data['next-token'],
929
+ });
930
+ /* eslint-enable dot-notation */
931
+ }
932
+ }
933
+ exports.AssetHoldingsResponse = AssetHoldingsResponse;
934
+ /**
935
+ * AssetParams specifies the parameters for an asset.
936
+ * (apar) when part of an AssetConfig transaction.
937
+ * Definition:
938
+ * data/transactions/asset.go : AssetParams
939
+ */
940
+ class AssetParams extends basemodel_1.default {
941
+ /**
942
+ * Creates a new `AssetParams` object.
943
+ * @param creator - The address that created this asset. This is the address where the parameters
944
+ * for this asset can be found, and also the address where unwanted asset units can
945
+ * be sent in the worst case.
946
+ * @param decimals - (dc) The number of digits to use after the decimal point when displaying this
947
+ * asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in
948
+ * tenths. If 2, the base unit of the asset is in hundredths, and so on. This value
949
+ * must be between 0 and 19 (inclusive).
950
+ * @param total - (t) The total number of units of this asset.
951
+ * @param clawback - (c) Address of account used to clawback holdings of this asset. If empty,
952
+ * clawback is not permitted.
953
+ * @param defaultFrozen - (df) Whether holdings of this asset are frozen by default.
954
+ * @param freeze - (f) Address of account used to freeze holdings of this asset. If empty, freezing
955
+ * is not permitted.
956
+ * @param manager - (m) Address of account used to manage the keys of this asset and to destroy it.
957
+ * @param metadataHash - (am) A commitment to some unspecified asset metadata. The format of this
958
+ * metadata is up to the application.
959
+ * @param name - (an) Name of this asset, as supplied by the creator. Included only when the
960
+ * asset name is composed of printable utf-8 characters.
961
+ * @param nameB64 - Base64 encoded name of this asset, as supplied by the creator.
962
+ * @param reserve - (r) Address of account holding reserve (non-minted) units of this asset.
963
+ * @param unitName - (un) Name of a unit of this asset, as supplied by the creator. Included only
964
+ * when the name of a unit of this asset is composed of printable utf-8 characters.
965
+ * @param unitNameB64 - Base64 encoded name of a unit of this asset, as supplied by the creator.
966
+ * @param url - (au) URL where more information about the asset can be retrieved. Included only
967
+ * when the URL is composed of printable utf-8 characters.
968
+ * @param urlB64 - Base64 encoded URL where more information about the asset can be retrieved.
969
+ */
970
+ constructor({ creator, decimals, total, clawback, defaultFrozen, freeze, manager, metadataHash, name, nameB64, reserve, unitName, unitNameB64, url, urlB64, }) {
971
+ super();
972
+ this.creator = creator;
973
+ this.decimals = decimals;
974
+ this.total = total;
975
+ this.clawback = clawback;
976
+ this.defaultFrozen = defaultFrozen;
977
+ this.freeze = freeze;
978
+ this.manager = manager;
979
+ this.metadataHash =
980
+ typeof metadataHash === 'string'
981
+ ? new Uint8Array(Buffer.from(metadataHash, 'base64'))
982
+ : metadataHash;
983
+ this.name = name;
984
+ this.nameB64 =
985
+ typeof nameB64 === 'string'
986
+ ? new Uint8Array(Buffer.from(nameB64, 'base64'))
987
+ : nameB64;
988
+ this.reserve = reserve;
989
+ this.unitName = unitName;
990
+ this.unitNameB64 =
991
+ typeof unitNameB64 === 'string'
992
+ ? new Uint8Array(Buffer.from(unitNameB64, 'base64'))
993
+ : unitNameB64;
994
+ this.url = url;
995
+ this.urlB64 =
996
+ typeof urlB64 === 'string'
997
+ ? new Uint8Array(Buffer.from(urlB64, 'base64'))
998
+ : urlB64;
999
+ this.attribute_map = {
1000
+ creator: 'creator',
1001
+ decimals: 'decimals',
1002
+ total: 'total',
1003
+ clawback: 'clawback',
1004
+ defaultFrozen: 'default-frozen',
1005
+ freeze: 'freeze',
1006
+ manager: 'manager',
1007
+ metadataHash: 'metadata-hash',
1008
+ name: 'name',
1009
+ nameB64: 'name-b64',
1010
+ reserve: 'reserve',
1011
+ unitName: 'unit-name',
1012
+ unitNameB64: 'unit-name-b64',
1013
+ url: 'url',
1014
+ urlB64: 'url-b64',
1015
+ };
1016
+ }
1017
+ // eslint-disable-next-line camelcase
1018
+ static from_obj_for_encoding(data) {
1019
+ /* eslint-disable dot-notation */
1020
+ if (typeof data['creator'] === 'undefined')
1021
+ throw new Error(`Response is missing required field 'creator': ${data}`);
1022
+ if (typeof data['decimals'] === 'undefined')
1023
+ throw new Error(`Response is missing required field 'decimals': ${data}`);
1024
+ if (typeof data['total'] === 'undefined')
1025
+ throw new Error(`Response is missing required field 'total': ${data}`);
1026
+ return new AssetParams({
1027
+ creator: data['creator'],
1028
+ decimals: data['decimals'],
1029
+ total: data['total'],
1030
+ clawback: data['clawback'],
1031
+ defaultFrozen: data['default-frozen'],
1032
+ freeze: data['freeze'],
1033
+ manager: data['manager'],
1034
+ metadataHash: data['metadata-hash'],
1035
+ name: data['name'],
1036
+ nameB64: data['name-b64'],
1037
+ reserve: data['reserve'],
1038
+ unitName: data['unit-name'],
1039
+ unitNameB64: data['unit-name-b64'],
1040
+ url: data['url'],
1041
+ urlB64: data['url-b64'],
1042
+ });
1043
+ /* eslint-enable dot-notation */
1044
+ }
1045
+ }
1046
+ exports.AssetParams = AssetParams;
1047
+ /**
1048
+ *
1049
+ */
1050
+ class AssetResponse extends basemodel_1.default {
1051
+ /**
1052
+ * Creates a new `AssetResponse` object.
1053
+ * @param asset - Specifies both the unique identifier and the parameters for an asset
1054
+ * @param currentRound - Round at which the results were computed.
1055
+ */
1056
+ constructor({ asset, currentRound, }) {
1057
+ super();
1058
+ this.asset = asset;
1059
+ this.currentRound = currentRound;
1060
+ this.attribute_map = {
1061
+ asset: 'asset',
1062
+ currentRound: 'current-round',
1063
+ };
1064
+ }
1065
+ // eslint-disable-next-line camelcase
1066
+ static from_obj_for_encoding(data) {
1067
+ /* eslint-disable dot-notation */
1068
+ if (typeof data['asset'] === 'undefined')
1069
+ throw new Error(`Response is missing required field 'asset': ${data}`);
1070
+ if (typeof data['current-round'] === 'undefined')
1071
+ throw new Error(`Response is missing required field 'current-round': ${data}`);
1072
+ return new AssetResponse({
1073
+ asset: Asset.from_obj_for_encoding(data['asset']),
1074
+ currentRound: data['current-round'],
1075
+ });
1076
+ /* eslint-enable dot-notation */
1077
+ }
1078
+ }
1079
+ exports.AssetResponse = AssetResponse;
1080
+ /**
1081
+ *
1082
+ */
1083
+ class AssetsResponse extends basemodel_1.default {
1084
+ /**
1085
+ * Creates a new `AssetsResponse` object.
1086
+ * @param assets -
1087
+ * @param currentRound - Round at which the results were computed.
1088
+ * @param nextToken - Used for pagination, when making another request provide this token with the
1089
+ * next parameter.
1090
+ */
1091
+ constructor({ assets, currentRound, nextToken, }) {
1092
+ super();
1093
+ this.assets = assets;
1094
+ this.currentRound = currentRound;
1095
+ this.nextToken = nextToken;
1096
+ this.attribute_map = {
1097
+ assets: 'assets',
1098
+ currentRound: 'current-round',
1099
+ nextToken: 'next-token',
1100
+ };
1101
+ }
1102
+ // eslint-disable-next-line camelcase
1103
+ static from_obj_for_encoding(data) {
1104
+ /* eslint-disable dot-notation */
1105
+ if (!Array.isArray(data['assets']))
1106
+ throw new Error(`Response is missing required array field 'assets': ${data}`);
1107
+ if (typeof data['current-round'] === 'undefined')
1108
+ throw new Error(`Response is missing required field 'current-round': ${data}`);
1109
+ return new AssetsResponse({
1110
+ assets: data['assets'].map(Asset.from_obj_for_encoding),
1111
+ currentRound: data['current-round'],
1112
+ nextToken: data['next-token'],
1113
+ });
1114
+ /* eslint-enable dot-notation */
1115
+ }
1116
+ }
1117
+ exports.AssetsResponse = AssetsResponse;
1118
+ /**
1119
+ * Block information.
1120
+ * Definition:
1121
+ * data/bookkeeping/block.go : Block
1122
+ */
1123
+ class Block extends basemodel_1.default {
1124
+ /**
1125
+ * Creates a new `Block` object.
1126
+ * @param genesisHash - (gh) hash to which this block belongs.
1127
+ * @param genesisId - (gen) ID to which this block belongs.
1128
+ * @param previousBlockHash - (prev) Previous block hash.
1129
+ * @param round - (rnd) Current round on which this block was appended to the chain.
1130
+ * @param seed - (seed) Sortition seed.
1131
+ * @param timestamp - (ts) Block creation timestamp in seconds since eposh
1132
+ * @param transactionsRoot - (txn) TransactionsRoot authenticates the set of transactions appearing in the
1133
+ * block. More specifically, it's the root of a merkle tree whose leaves are the
1134
+ * block's Txids, in lexicographic order. For the empty block, it's 0. Note that
1135
+ * the TxnRoot does not authenticate the signatures on the transactions, only the
1136
+ * transactions themselves. Two blocks with the same transactions but in a
1137
+ * different order and with different signatures will have the same TxnRoot.
1138
+ * @param transactionsRootSha256 - (txn256) TransactionsRootSHA256 is an auxiliary TransactionRoot, built using a
1139
+ * vector commitment instead of a merkle tree, and SHA256 hash function instead of
1140
+ * the default SHA512_256. This commitment can be used on environments where only
1141
+ * the SHA256 function exists.
1142
+ * @param participationUpdates - Participation account data that needs to be checked/acted on by the network.
1143
+ * @param rewards - Fields relating to rewards,
1144
+ * @param stateProofTracking - Tracks the status of state proofs.
1145
+ * @param transactions - (txns) list of transactions corresponding to a given round.
1146
+ * @param txnCounter - (tc) TxnCounter counts the number of transactions committed in the ledger, from
1147
+ * the time at which support for this feature was introduced.
1148
+ * Specifically, TxnCounter is the number of the next transaction that will be
1149
+ * committed after this block. It is 0 when no transactions have ever been
1150
+ * committed (since TxnCounter started being supported).
1151
+ * @param upgradeState - Fields relating to a protocol upgrade.
1152
+ * @param upgradeVote - Fields relating to voting for a protocol upgrade.
1153
+ */
1154
+ constructor({ genesisHash, genesisId, previousBlockHash, round, seed, timestamp, transactionsRoot, transactionsRootSha256, participationUpdates, rewards, stateProofTracking, transactions, txnCounter, upgradeState, upgradeVote, }) {
1155
+ super();
1156
+ this.genesisHash =
1157
+ typeof genesisHash === 'string'
1158
+ ? new Uint8Array(Buffer.from(genesisHash, 'base64'))
1159
+ : genesisHash;
1160
+ this.genesisId = genesisId;
1161
+ this.previousBlockHash =
1162
+ typeof previousBlockHash === 'string'
1163
+ ? new Uint8Array(Buffer.from(previousBlockHash, 'base64'))
1164
+ : previousBlockHash;
1165
+ this.round = round;
1166
+ this.seed =
1167
+ typeof seed === 'string'
1168
+ ? new Uint8Array(Buffer.from(seed, 'base64'))
1169
+ : seed;
1170
+ this.timestamp = timestamp;
1171
+ this.transactionsRoot =
1172
+ typeof transactionsRoot === 'string'
1173
+ ? new Uint8Array(Buffer.from(transactionsRoot, 'base64'))
1174
+ : transactionsRoot;
1175
+ this.transactionsRootSha256 =
1176
+ typeof transactionsRootSha256 === 'string'
1177
+ ? new Uint8Array(Buffer.from(transactionsRootSha256, 'base64'))
1178
+ : transactionsRootSha256;
1179
+ this.participationUpdates = participationUpdates;
1180
+ this.rewards = rewards;
1181
+ this.stateProofTracking = stateProofTracking;
1182
+ this.transactions = transactions;
1183
+ this.txnCounter = txnCounter;
1184
+ this.upgradeState = upgradeState;
1185
+ this.upgradeVote = upgradeVote;
1186
+ this.attribute_map = {
1187
+ genesisHash: 'genesis-hash',
1188
+ genesisId: 'genesis-id',
1189
+ previousBlockHash: 'previous-block-hash',
1190
+ round: 'round',
1191
+ seed: 'seed',
1192
+ timestamp: 'timestamp',
1193
+ transactionsRoot: 'transactions-root',
1194
+ transactionsRootSha256: 'transactions-root-sha256',
1195
+ participationUpdates: 'participation-updates',
1196
+ rewards: 'rewards',
1197
+ stateProofTracking: 'state-proof-tracking',
1198
+ transactions: 'transactions',
1199
+ txnCounter: 'txn-counter',
1200
+ upgradeState: 'upgrade-state',
1201
+ upgradeVote: 'upgrade-vote',
1202
+ };
1203
+ }
1204
+ // eslint-disable-next-line camelcase
1205
+ static from_obj_for_encoding(data) {
1206
+ /* eslint-disable dot-notation */
1207
+ if (typeof data['genesis-hash'] === 'undefined')
1208
+ throw new Error(`Response is missing required field 'genesis-hash': ${data}`);
1209
+ if (typeof data['genesis-id'] === 'undefined')
1210
+ throw new Error(`Response is missing required field 'genesis-id': ${data}`);
1211
+ if (typeof data['previous-block-hash'] === 'undefined')
1212
+ throw new Error(`Response is missing required field 'previous-block-hash': ${data}`);
1213
+ if (typeof data['round'] === 'undefined')
1214
+ throw new Error(`Response is missing required field 'round': ${data}`);
1215
+ if (typeof data['seed'] === 'undefined')
1216
+ throw new Error(`Response is missing required field 'seed': ${data}`);
1217
+ if (typeof data['timestamp'] === 'undefined')
1218
+ throw new Error(`Response is missing required field 'timestamp': ${data}`);
1219
+ if (typeof data['transactions-root'] === 'undefined')
1220
+ throw new Error(`Response is missing required field 'transactions-root': ${data}`);
1221
+ if (typeof data['transactions-root-sha256'] === 'undefined')
1222
+ throw new Error(`Response is missing required field 'transactions-root-sha256': ${data}`);
1223
+ return new Block({
1224
+ genesisHash: data['genesis-hash'],
1225
+ genesisId: data['genesis-id'],
1226
+ previousBlockHash: data['previous-block-hash'],
1227
+ round: data['round'],
1228
+ seed: data['seed'],
1229
+ timestamp: data['timestamp'],
1230
+ transactionsRoot: data['transactions-root'],
1231
+ transactionsRootSha256: data['transactions-root-sha256'],
1232
+ participationUpdates: typeof data['participation-updates'] !== 'undefined'
1233
+ ? ParticipationUpdates.from_obj_for_encoding(data['participation-updates'])
1234
+ : undefined,
1235
+ rewards: typeof data['rewards'] !== 'undefined'
1236
+ ? BlockRewards.from_obj_for_encoding(data['rewards'])
1237
+ : undefined,
1238
+ stateProofTracking: typeof data['state-proof-tracking'] !== 'undefined'
1239
+ ? data['state-proof-tracking'].map(StateProofTracking.from_obj_for_encoding)
1240
+ : undefined,
1241
+ transactions: typeof data['transactions'] !== 'undefined'
1242
+ ? data['transactions'].map(Transaction.from_obj_for_encoding)
1243
+ : undefined,
1244
+ txnCounter: data['txn-counter'],
1245
+ upgradeState: typeof data['upgrade-state'] !== 'undefined'
1246
+ ? BlockUpgradeState.from_obj_for_encoding(data['upgrade-state'])
1247
+ : undefined,
1248
+ upgradeVote: typeof data['upgrade-vote'] !== 'undefined'
1249
+ ? BlockUpgradeVote.from_obj_for_encoding(data['upgrade-vote'])
1250
+ : undefined,
1251
+ });
1252
+ /* eslint-enable dot-notation */
1253
+ }
1254
+ }
1255
+ exports.Block = Block;
1256
+ /**
1257
+ * Fields relating to rewards,
1258
+ */
1259
+ class BlockRewards extends basemodel_1.default {
1260
+ /**
1261
+ * Creates a new `BlockRewards` object.
1262
+ * @param feeSink - (fees) accepts transaction fees, it can only spend to the incentive pool.
1263
+ * @param rewardsCalculationRound - (rwcalr) number of leftover MicroAlgos after the distribution of rewards-rate
1264
+ * MicroAlgos for every reward unit in the next round.
1265
+ * @param rewardsLevel - (earn) How many rewards, in MicroAlgos, have been distributed to each RewardUnit
1266
+ * of MicroAlgos since genesis.
1267
+ * @param rewardsPool - (rwd) accepts periodic injections from the fee-sink and continually
1268
+ * redistributes them as rewards.
1269
+ * @param rewardsRate - (rate) Number of new MicroAlgos added to the participation stake from rewards at
1270
+ * the next round.
1271
+ * @param rewardsResidue - (frac) Number of leftover MicroAlgos after the distribution of
1272
+ * RewardsRate/rewardUnits MicroAlgos for every reward unit in the next round.
1273
+ */
1274
+ constructor({ feeSink, rewardsCalculationRound, rewardsLevel, rewardsPool, rewardsRate, rewardsResidue, }) {
1275
+ super();
1276
+ this.feeSink = feeSink;
1277
+ this.rewardsCalculationRound = rewardsCalculationRound;
1278
+ this.rewardsLevel = rewardsLevel;
1279
+ this.rewardsPool = rewardsPool;
1280
+ this.rewardsRate = rewardsRate;
1281
+ this.rewardsResidue = rewardsResidue;
1282
+ this.attribute_map = {
1283
+ feeSink: 'fee-sink',
1284
+ rewardsCalculationRound: 'rewards-calculation-round',
1285
+ rewardsLevel: 'rewards-level',
1286
+ rewardsPool: 'rewards-pool',
1287
+ rewardsRate: 'rewards-rate',
1288
+ rewardsResidue: 'rewards-residue',
1289
+ };
1290
+ }
1291
+ // eslint-disable-next-line camelcase
1292
+ static from_obj_for_encoding(data) {
1293
+ /* eslint-disable dot-notation */
1294
+ if (typeof data['fee-sink'] === 'undefined')
1295
+ throw new Error(`Response is missing required field 'fee-sink': ${data}`);
1296
+ if (typeof data['rewards-calculation-round'] === 'undefined')
1297
+ throw new Error(`Response is missing required field 'rewards-calculation-round': ${data}`);
1298
+ if (typeof data['rewards-level'] === 'undefined')
1299
+ throw new Error(`Response is missing required field 'rewards-level': ${data}`);
1300
+ if (typeof data['rewards-pool'] === 'undefined')
1301
+ throw new Error(`Response is missing required field 'rewards-pool': ${data}`);
1302
+ if (typeof data['rewards-rate'] === 'undefined')
1303
+ throw new Error(`Response is missing required field 'rewards-rate': ${data}`);
1304
+ if (typeof data['rewards-residue'] === 'undefined')
1305
+ throw new Error(`Response is missing required field 'rewards-residue': ${data}`);
1306
+ return new BlockRewards({
1307
+ feeSink: data['fee-sink'],
1308
+ rewardsCalculationRound: data['rewards-calculation-round'],
1309
+ rewardsLevel: data['rewards-level'],
1310
+ rewardsPool: data['rewards-pool'],
1311
+ rewardsRate: data['rewards-rate'],
1312
+ rewardsResidue: data['rewards-residue'],
1313
+ });
1314
+ /* eslint-enable dot-notation */
1315
+ }
1316
+ }
1317
+ exports.BlockRewards = BlockRewards;
1318
+ /**
1319
+ * Fields relating to a protocol upgrade.
1320
+ */
1321
+ class BlockUpgradeState extends basemodel_1.default {
1322
+ /**
1323
+ * Creates a new `BlockUpgradeState` object.
1324
+ * @param currentProtocol - (proto) The current protocol version.
1325
+ * @param nextProtocol - (nextproto) The next proposed protocol version.
1326
+ * @param nextProtocolApprovals - (nextyes) Number of blocks which approved the protocol upgrade.
1327
+ * @param nextProtocolSwitchOn - (nextswitch) Round on which the protocol upgrade will take effect.
1328
+ * @param nextProtocolVoteBefore - (nextbefore) Deadline round for this protocol upgrade (No votes will be consider
1329
+ * after this round).
1330
+ */
1331
+ constructor({ currentProtocol, nextProtocol, nextProtocolApprovals, nextProtocolSwitchOn, nextProtocolVoteBefore, }) {
1332
+ super();
1333
+ this.currentProtocol = currentProtocol;
1334
+ this.nextProtocol = nextProtocol;
1335
+ this.nextProtocolApprovals = nextProtocolApprovals;
1336
+ this.nextProtocolSwitchOn = nextProtocolSwitchOn;
1337
+ this.nextProtocolVoteBefore = nextProtocolVoteBefore;
1338
+ this.attribute_map = {
1339
+ currentProtocol: 'current-protocol',
1340
+ nextProtocol: 'next-protocol',
1341
+ nextProtocolApprovals: 'next-protocol-approvals',
1342
+ nextProtocolSwitchOn: 'next-protocol-switch-on',
1343
+ nextProtocolVoteBefore: 'next-protocol-vote-before',
1344
+ };
1345
+ }
1346
+ // eslint-disable-next-line camelcase
1347
+ static from_obj_for_encoding(data) {
1348
+ /* eslint-disable dot-notation */
1349
+ if (typeof data['current-protocol'] === 'undefined')
1350
+ throw new Error(`Response is missing required field 'current-protocol': ${data}`);
1351
+ return new BlockUpgradeState({
1352
+ currentProtocol: data['current-protocol'],
1353
+ nextProtocol: data['next-protocol'],
1354
+ nextProtocolApprovals: data['next-protocol-approvals'],
1355
+ nextProtocolSwitchOn: data['next-protocol-switch-on'],
1356
+ nextProtocolVoteBefore: data['next-protocol-vote-before'],
1357
+ });
1358
+ /* eslint-enable dot-notation */
1359
+ }
1360
+ }
1361
+ exports.BlockUpgradeState = BlockUpgradeState;
1362
+ /**
1363
+ * Fields relating to voting for a protocol upgrade.
1364
+ */
1365
+ class BlockUpgradeVote extends basemodel_1.default {
1366
+ /**
1367
+ * Creates a new `BlockUpgradeVote` object.
1368
+ * @param upgradeApprove - (upgradeyes) Indicates a yes vote for the current proposal.
1369
+ * @param upgradeDelay - (upgradedelay) Indicates the time between acceptance and execution.
1370
+ * @param upgradePropose - (upgradeprop) Indicates a proposed upgrade.
1371
+ */
1372
+ constructor({ upgradeApprove, upgradeDelay, upgradePropose, }) {
1373
+ super();
1374
+ this.upgradeApprove = upgradeApprove;
1375
+ this.upgradeDelay = upgradeDelay;
1376
+ this.upgradePropose = upgradePropose;
1377
+ this.attribute_map = {
1378
+ upgradeApprove: 'upgrade-approve',
1379
+ upgradeDelay: 'upgrade-delay',
1380
+ upgradePropose: 'upgrade-propose',
1381
+ };
1382
+ }
1383
+ // eslint-disable-next-line camelcase
1384
+ static from_obj_for_encoding(data) {
1385
+ /* eslint-disable dot-notation */
1386
+ return new BlockUpgradeVote({
1387
+ upgradeApprove: data['upgrade-approve'],
1388
+ upgradeDelay: data['upgrade-delay'],
1389
+ upgradePropose: data['upgrade-propose'],
1390
+ });
1391
+ /* eslint-enable dot-notation */
1392
+ }
1393
+ }
1394
+ exports.BlockUpgradeVote = BlockUpgradeVote;
1395
+ /**
1396
+ * Box name and its content.
1397
+ */
1398
+ class Box extends basemodel_1.default {
1399
+ /**
1400
+ * Creates a new `Box` object.
1401
+ * @param name - (name) box name, base64 encoded
1402
+ * @param value - (value) box value, base64 encoded.
1403
+ */
1404
+ constructor({ name, value, }) {
1405
+ super();
1406
+ this.name =
1407
+ typeof name === 'string'
1408
+ ? new Uint8Array(Buffer.from(name, 'base64'))
1409
+ : name;
1410
+ this.value =
1411
+ typeof value === 'string'
1412
+ ? new Uint8Array(Buffer.from(value, 'base64'))
1413
+ : value;
1414
+ this.attribute_map = {
1415
+ name: 'name',
1416
+ value: 'value',
1417
+ };
1418
+ }
1419
+ // eslint-disable-next-line camelcase
1420
+ static from_obj_for_encoding(data) {
1421
+ /* eslint-disable dot-notation */
1422
+ if (typeof data['name'] === 'undefined')
1423
+ throw new Error(`Response is missing required field 'name': ${data}`);
1424
+ if (typeof data['value'] === 'undefined')
1425
+ throw new Error(`Response is missing required field 'value': ${data}`);
1426
+ return new Box({
1427
+ name: data['name'],
1428
+ value: data['value'],
1429
+ });
1430
+ /* eslint-enable dot-notation */
1431
+ }
1432
+ }
1433
+ exports.Box = Box;
1434
+ /**
1435
+ * Box descriptor describes an app box without a value.
1436
+ */
1437
+ class BoxDescriptor extends basemodel_1.default {
1438
+ /**
1439
+ * Creates a new `BoxDescriptor` object.
1440
+ * @param name - Base64 encoded box name
1441
+ */
1442
+ constructor({ name }) {
1443
+ super();
1444
+ this.name =
1445
+ typeof name === 'string'
1446
+ ? new Uint8Array(Buffer.from(name, 'base64'))
1447
+ : name;
1448
+ this.attribute_map = {
1449
+ name: 'name',
1450
+ };
1451
+ }
1452
+ // eslint-disable-next-line camelcase
1453
+ static from_obj_for_encoding(data) {
1454
+ /* eslint-disable dot-notation */
1455
+ if (typeof data['name'] === 'undefined')
1456
+ throw new Error(`Response is missing required field 'name': ${data}`);
1457
+ return new BoxDescriptor({
1458
+ name: data['name'],
1459
+ });
1460
+ /* eslint-enable dot-notation */
1461
+ }
1462
+ }
1463
+ exports.BoxDescriptor = BoxDescriptor;
1464
+ /**
1465
+ * Box names of an application
1466
+ */
1467
+ class BoxesResponse extends basemodel_1.default {
1468
+ /**
1469
+ * Creates a new `BoxesResponse` object.
1470
+ * @param applicationId - (appidx) application index.
1471
+ * @param boxes -
1472
+ * @param nextToken - Used for pagination, when making another request provide this token with the
1473
+ * next parameter.
1474
+ */
1475
+ constructor({ applicationId, boxes, nextToken, }) {
1476
+ super();
1477
+ this.applicationId = applicationId;
1478
+ this.boxes = boxes;
1479
+ this.nextToken = nextToken;
1480
+ this.attribute_map = {
1481
+ applicationId: 'application-id',
1482
+ boxes: 'boxes',
1483
+ nextToken: 'next-token',
1484
+ };
1485
+ }
1486
+ // eslint-disable-next-line camelcase
1487
+ static from_obj_for_encoding(data) {
1488
+ /* eslint-disable dot-notation */
1489
+ if (typeof data['application-id'] === 'undefined')
1490
+ throw new Error(`Response is missing required field 'application-id': ${data}`);
1491
+ if (!Array.isArray(data['boxes']))
1492
+ throw new Error(`Response is missing required array field 'boxes': ${data}`);
1493
+ return new BoxesResponse({
1494
+ applicationId: data['application-id'],
1495
+ boxes: data['boxes'].map(BoxDescriptor.from_obj_for_encoding),
1496
+ nextToken: data['next-token'],
1497
+ });
1498
+ /* eslint-enable dot-notation */
1499
+ }
1500
+ }
1501
+ exports.BoxesResponse = BoxesResponse;
1502
+ /**
1503
+ * Response for errors
1504
+ */
1505
+ class ErrorResponse extends basemodel_1.default {
1506
+ /**
1507
+ * Creates a new `ErrorResponse` object.
1508
+ * @param message -
1509
+ * @param data -
1510
+ */
1511
+ constructor({ message, data, }) {
1512
+ super();
1513
+ this.message = message;
1514
+ this.data = data;
1515
+ this.attribute_map = {
1516
+ message: 'message',
1517
+ data: 'data',
1518
+ };
1519
+ }
1520
+ // eslint-disable-next-line camelcase
1521
+ static from_obj_for_encoding(data) {
1522
+ /* eslint-disable dot-notation */
1523
+ if (typeof data['message'] === 'undefined')
1524
+ throw new Error(`Response is missing required field 'message': ${data}`);
1525
+ return new ErrorResponse({
1526
+ message: data['message'],
1527
+ data: data['data'],
1528
+ });
1529
+ /* eslint-enable dot-notation */
1530
+ }
1531
+ }
1532
+ exports.ErrorResponse = ErrorResponse;
1533
+ /**
1534
+ * Represents a TEAL value delta.
1535
+ */
1536
+ class EvalDelta extends basemodel_1.default {
1537
+ /**
1538
+ * Creates a new `EvalDelta` object.
1539
+ * @param action - (at) delta action.
1540
+ * @param bytes - (bs) bytes value.
1541
+ * @param uint - (ui) uint value.
1542
+ */
1543
+ constructor({ action, bytes, uint, }) {
1544
+ super();
1545
+ this.action = action;
1546
+ this.bytes = bytes;
1547
+ this.uint = uint;
1548
+ this.attribute_map = {
1549
+ action: 'action',
1550
+ bytes: 'bytes',
1551
+ uint: 'uint',
1552
+ };
1553
+ }
1554
+ // eslint-disable-next-line camelcase
1555
+ static from_obj_for_encoding(data) {
1556
+ /* eslint-disable dot-notation */
1557
+ if (typeof data['action'] === 'undefined')
1558
+ throw new Error(`Response is missing required field 'action': ${data}`);
1559
+ return new EvalDelta({
1560
+ action: data['action'],
1561
+ bytes: data['bytes'],
1562
+ uint: data['uint'],
1563
+ });
1564
+ /* eslint-enable dot-notation */
1565
+ }
1566
+ }
1567
+ exports.EvalDelta = EvalDelta;
1568
+ /**
1569
+ * Key-value pairs for StateDelta.
1570
+ */
1571
+ class EvalDeltaKeyValue extends basemodel_1.default {
1572
+ /**
1573
+ * Creates a new `EvalDeltaKeyValue` object.
1574
+ * @param key -
1575
+ * @param value - Represents a TEAL value delta.
1576
+ */
1577
+ constructor({ key, value }) {
1578
+ super();
1579
+ this.key = key;
1580
+ this.value = value;
1581
+ this.attribute_map = {
1582
+ key: 'key',
1583
+ value: 'value',
1584
+ };
1585
+ }
1586
+ // eslint-disable-next-line camelcase
1587
+ static from_obj_for_encoding(data) {
1588
+ /* eslint-disable dot-notation */
1589
+ if (typeof data['key'] === 'undefined')
1590
+ throw new Error(`Response is missing required field 'key': ${data}`);
1591
+ if (typeof data['value'] === 'undefined')
1592
+ throw new Error(`Response is missing required field 'value': ${data}`);
1593
+ return new EvalDeltaKeyValue({
1594
+ key: data['key'],
1595
+ value: EvalDelta.from_obj_for_encoding(data['value']),
1596
+ });
1597
+ /* eslint-enable dot-notation */
1598
+ }
1599
+ }
1600
+ exports.EvalDeltaKeyValue = EvalDeltaKeyValue;
1601
+ class HashFactory extends basemodel_1.default {
1602
+ /**
1603
+ * Creates a new `HashFactory` object.
1604
+ * @param hashType - (t)
1605
+ */
1606
+ constructor({ hashType }) {
1607
+ super();
1608
+ this.hashType = hashType;
1609
+ this.attribute_map = {
1610
+ hashType: 'hash-type',
1611
+ };
1612
+ }
1613
+ // eslint-disable-next-line camelcase
1614
+ static from_obj_for_encoding(data) {
1615
+ /* eslint-disable dot-notation */
1616
+ return new HashFactory({
1617
+ hashType: data['hash-type'],
1618
+ });
1619
+ /* eslint-enable dot-notation */
1620
+ }
1621
+ }
1622
+ exports.HashFactory = HashFactory;
1623
+ /**
1624
+ * A health check response.
1625
+ */
1626
+ class HealthCheck extends basemodel_1.default {
1627
+ /**
1628
+ * Creates a new `HealthCheck` object.
1629
+ * @param dbAvailable -
1630
+ * @param isMigrating -
1631
+ * @param message -
1632
+ * @param round -
1633
+ * @param version - Current version.
1634
+ * @param data -
1635
+ * @param errors -
1636
+ */
1637
+ constructor({ dbAvailable, isMigrating, message, round, version, data, errors, }) {
1638
+ super();
1639
+ this.dbAvailable = dbAvailable;
1640
+ this.isMigrating = isMigrating;
1641
+ this.message = message;
1642
+ this.round = round;
1643
+ this.version = version;
1644
+ this.data = data;
1645
+ this.errors = errors;
1646
+ this.attribute_map = {
1647
+ dbAvailable: 'db-available',
1648
+ isMigrating: 'is-migrating',
1649
+ message: 'message',
1650
+ round: 'round',
1651
+ version: 'version',
1652
+ data: 'data',
1653
+ errors: 'errors',
1654
+ };
1655
+ }
1656
+ // eslint-disable-next-line camelcase
1657
+ static from_obj_for_encoding(data) {
1658
+ /* eslint-disable dot-notation */
1659
+ if (typeof data['db-available'] === 'undefined')
1660
+ throw new Error(`Response is missing required field 'db-available': ${data}`);
1661
+ if (typeof data['is-migrating'] === 'undefined')
1662
+ throw new Error(`Response is missing required field 'is-migrating': ${data}`);
1663
+ if (typeof data['message'] === 'undefined')
1664
+ throw new Error(`Response is missing required field 'message': ${data}`);
1665
+ if (typeof data['round'] === 'undefined')
1666
+ throw new Error(`Response is missing required field 'round': ${data}`);
1667
+ if (typeof data['version'] === 'undefined')
1668
+ throw new Error(`Response is missing required field 'version': ${data}`);
1669
+ return new HealthCheck({
1670
+ dbAvailable: data['db-available'],
1671
+ isMigrating: data['is-migrating'],
1672
+ message: data['message'],
1673
+ round: data['round'],
1674
+ version: data['version'],
1675
+ data: data['data'],
1676
+ errors: data['errors'],
1677
+ });
1678
+ /* eslint-enable dot-notation */
1679
+ }
1680
+ }
1681
+ exports.HealthCheck = HealthCheck;
1682
+ class IndexerStateProofMessage extends basemodel_1.default {
1683
+ /**
1684
+ * Creates a new `IndexerStateProofMessage` object.
1685
+ * @param blockHeadersCommitment - (b)
1686
+ * @param firstAttestedRound - (f)
1687
+ * @param latestAttestedRound - (l)
1688
+ * @param lnProvenWeight - (P)
1689
+ * @param votersCommitment - (v)
1690
+ */
1691
+ constructor({ blockHeadersCommitment, firstAttestedRound, latestAttestedRound, lnProvenWeight, votersCommitment, }) {
1692
+ super();
1693
+ this.blockHeadersCommitment =
1694
+ typeof blockHeadersCommitment === 'string'
1695
+ ? new Uint8Array(Buffer.from(blockHeadersCommitment, 'base64'))
1696
+ : blockHeadersCommitment;
1697
+ this.firstAttestedRound = firstAttestedRound;
1698
+ this.latestAttestedRound = latestAttestedRound;
1699
+ this.lnProvenWeight = lnProvenWeight;
1700
+ this.votersCommitment =
1701
+ typeof votersCommitment === 'string'
1702
+ ? new Uint8Array(Buffer.from(votersCommitment, 'base64'))
1703
+ : votersCommitment;
1704
+ this.attribute_map = {
1705
+ blockHeadersCommitment: 'block-headers-commitment',
1706
+ firstAttestedRound: 'first-attested-round',
1707
+ latestAttestedRound: 'latest-attested-round',
1708
+ lnProvenWeight: 'ln-proven-weight',
1709
+ votersCommitment: 'voters-commitment',
1710
+ };
1711
+ }
1712
+ // eslint-disable-next-line camelcase
1713
+ static from_obj_for_encoding(data) {
1714
+ /* eslint-disable dot-notation */
1715
+ return new IndexerStateProofMessage({
1716
+ blockHeadersCommitment: data['block-headers-commitment'],
1717
+ firstAttestedRound: data['first-attested-round'],
1718
+ latestAttestedRound: data['latest-attested-round'],
1719
+ lnProvenWeight: data['ln-proven-weight'],
1720
+ votersCommitment: data['voters-commitment'],
1721
+ });
1722
+ /* eslint-enable dot-notation */
1723
+ }
1724
+ }
1725
+ exports.IndexerStateProofMessage = IndexerStateProofMessage;
1726
+ class MerkleArrayProof extends basemodel_1.default {
1727
+ /**
1728
+ * Creates a new `MerkleArrayProof` object.
1729
+ * @param hashFactory -
1730
+ * @param path - (pth)
1731
+ * @param treeDepth - (td)
1732
+ */
1733
+ constructor({ hashFactory, path, treeDepth, }) {
1734
+ super();
1735
+ this.hashFactory = hashFactory;
1736
+ this.path = path;
1737
+ this.treeDepth = treeDepth;
1738
+ this.attribute_map = {
1739
+ hashFactory: 'hash-factory',
1740
+ path: 'path',
1741
+ treeDepth: 'tree-depth',
1742
+ };
1743
+ }
1744
+ // eslint-disable-next-line camelcase
1745
+ static from_obj_for_encoding(data) {
1746
+ /* eslint-disable dot-notation */
1747
+ return new MerkleArrayProof({
1748
+ hashFactory: typeof data['hash-factory'] !== 'undefined'
1749
+ ? HashFactory.from_obj_for_encoding(data['hash-factory'])
1750
+ : undefined,
1751
+ path: data['path'],
1752
+ treeDepth: data['tree-depth'],
1753
+ });
1754
+ /* eslint-enable dot-notation */
1755
+ }
1756
+ }
1757
+ exports.MerkleArrayProof = MerkleArrayProof;
1758
+ /**
1759
+ * A simplified version of AssetHolding
1760
+ */
1761
+ class MiniAssetHolding extends basemodel_1.default {
1762
+ /**
1763
+ * Creates a new `MiniAssetHolding` object.
1764
+ * @param address -
1765
+ * @param amount -
1766
+ * @param isFrozen -
1767
+ * @param deleted - Whether or not this asset holding is currently deleted from its account.
1768
+ * @param optedInAtRound - Round during which the account opted into the asset.
1769
+ * @param optedOutAtRound - Round during which the account opted out of the asset.
1770
+ */
1771
+ constructor({ address, amount, isFrozen, deleted, optedInAtRound, optedOutAtRound, }) {
1772
+ super();
1773
+ this.address = address;
1774
+ this.amount = amount;
1775
+ this.isFrozen = isFrozen;
1776
+ this.deleted = deleted;
1777
+ this.optedInAtRound = optedInAtRound;
1778
+ this.optedOutAtRound = optedOutAtRound;
1779
+ this.attribute_map = {
1780
+ address: 'address',
1781
+ amount: 'amount',
1782
+ isFrozen: 'is-frozen',
1783
+ deleted: 'deleted',
1784
+ optedInAtRound: 'opted-in-at-round',
1785
+ optedOutAtRound: 'opted-out-at-round',
1786
+ };
1787
+ }
1788
+ // eslint-disable-next-line camelcase
1789
+ static from_obj_for_encoding(data) {
1790
+ /* eslint-disable dot-notation */
1791
+ if (typeof data['address'] === 'undefined')
1792
+ throw new Error(`Response is missing required field 'address': ${data}`);
1793
+ if (typeof data['amount'] === 'undefined')
1794
+ throw new Error(`Response is missing required field 'amount': ${data}`);
1795
+ if (typeof data['is-frozen'] === 'undefined')
1796
+ throw new Error(`Response is missing required field 'is-frozen': ${data}`);
1797
+ return new MiniAssetHolding({
1798
+ address: data['address'],
1799
+ amount: data['amount'],
1800
+ isFrozen: data['is-frozen'],
1801
+ deleted: data['deleted'],
1802
+ optedInAtRound: data['opted-in-at-round'],
1803
+ optedOutAtRound: data['opted-out-at-round'],
1804
+ });
1805
+ /* eslint-enable dot-notation */
1806
+ }
1807
+ }
1808
+ exports.MiniAssetHolding = MiniAssetHolding;
1809
+ /**
1810
+ * Participation account data that needs to be checked/acted on by the network.
1811
+ */
1812
+ class ParticipationUpdates extends basemodel_1.default {
1813
+ /**
1814
+ * Creates a new `ParticipationUpdates` object.
1815
+ * @param expiredParticipationAccounts - (partupdrmv) a list of online accounts that needs to be converted to offline
1816
+ * since their participation key expired.
1817
+ */
1818
+ constructor({ expiredParticipationAccounts, }) {
1819
+ super();
1820
+ this.expiredParticipationAccounts = expiredParticipationAccounts;
1821
+ this.attribute_map = {
1822
+ expiredParticipationAccounts: 'expired-participation-accounts',
1823
+ };
1824
+ }
1825
+ // eslint-disable-next-line camelcase
1826
+ static from_obj_for_encoding(data) {
1827
+ /* eslint-disable dot-notation */
1828
+ return new ParticipationUpdates({
1829
+ expiredParticipationAccounts: data['expired-participation-accounts'],
1830
+ });
1831
+ /* eslint-enable dot-notation */
1832
+ }
1833
+ }
1834
+ exports.ParticipationUpdates = ParticipationUpdates;
1835
+ /**
1836
+ * (sp) represents a state proof.
1837
+ * Definition:
1838
+ * crypto/stateproof/structs.go : StateProof
1839
+ */
1840
+ class StateProofFields extends basemodel_1.default {
1841
+ /**
1842
+ * Creates a new `StateProofFields` object.
1843
+ * @param partProofs - (P)
1844
+ * @param positionsToReveal - (pr) Sequence of reveal positions.
1845
+ * @param reveals - (r) Note that this is actually stored as a map[uint64] - Reveal in the actual
1846
+ * msgp
1847
+ * @param saltVersion - (v) Salt version of the merkle signature.
1848
+ * @param sigCommit - (c)
1849
+ * @param sigProofs - (S)
1850
+ * @param signedWeight - (w)
1851
+ */
1852
+ constructor({ partProofs, positionsToReveal, reveals, saltVersion, sigCommit, sigProofs, signedWeight, }) {
1853
+ super();
1854
+ this.partProofs = partProofs;
1855
+ this.positionsToReveal = positionsToReveal;
1856
+ this.reveals = reveals;
1857
+ this.saltVersion = saltVersion;
1858
+ this.sigCommit =
1859
+ typeof sigCommit === 'string'
1860
+ ? new Uint8Array(Buffer.from(sigCommit, 'base64'))
1861
+ : sigCommit;
1862
+ this.sigProofs = sigProofs;
1863
+ this.signedWeight = signedWeight;
1864
+ this.attribute_map = {
1865
+ partProofs: 'part-proofs',
1866
+ positionsToReveal: 'positions-to-reveal',
1867
+ reveals: 'reveals',
1868
+ saltVersion: 'salt-version',
1869
+ sigCommit: 'sig-commit',
1870
+ sigProofs: 'sig-proofs',
1871
+ signedWeight: 'signed-weight',
1872
+ };
1873
+ }
1874
+ // eslint-disable-next-line camelcase
1875
+ static from_obj_for_encoding(data) {
1876
+ /* eslint-disable dot-notation */
1877
+ return new StateProofFields({
1878
+ partProofs: typeof data['part-proofs'] !== 'undefined'
1879
+ ? MerkleArrayProof.from_obj_for_encoding(data['part-proofs'])
1880
+ : undefined,
1881
+ positionsToReveal: data['positions-to-reveal'],
1882
+ reveals: typeof data['reveals'] !== 'undefined'
1883
+ ? data['reveals'].map(StateProofReveal.from_obj_for_encoding)
1884
+ : undefined,
1885
+ saltVersion: data['salt-version'],
1886
+ sigCommit: data['sig-commit'],
1887
+ sigProofs: typeof data['sig-proofs'] !== 'undefined'
1888
+ ? MerkleArrayProof.from_obj_for_encoding(data['sig-proofs'])
1889
+ : undefined,
1890
+ signedWeight: data['signed-weight'],
1891
+ });
1892
+ /* eslint-enable dot-notation */
1893
+ }
1894
+ }
1895
+ exports.StateProofFields = StateProofFields;
1896
+ class StateProofParticipant extends basemodel_1.default {
1897
+ /**
1898
+ * Creates a new `StateProofParticipant` object.
1899
+ * @param verifier - (p)
1900
+ * @param weight - (w)
1901
+ */
1902
+ constructor({ verifier, weight, }) {
1903
+ super();
1904
+ this.verifier = verifier;
1905
+ this.weight = weight;
1906
+ this.attribute_map = {
1907
+ verifier: 'verifier',
1908
+ weight: 'weight',
1909
+ };
1910
+ }
1911
+ // eslint-disable-next-line camelcase
1912
+ static from_obj_for_encoding(data) {
1913
+ /* eslint-disable dot-notation */
1914
+ return new StateProofParticipant({
1915
+ verifier: typeof data['verifier'] !== 'undefined'
1916
+ ? StateProofVerifier.from_obj_for_encoding(data['verifier'])
1917
+ : undefined,
1918
+ weight: data['weight'],
1919
+ });
1920
+ /* eslint-enable dot-notation */
1921
+ }
1922
+ }
1923
+ exports.StateProofParticipant = StateProofParticipant;
1924
+ class StateProofReveal extends basemodel_1.default {
1925
+ /**
1926
+ * Creates a new `StateProofReveal` object.
1927
+ * @param participant - (p)
1928
+ * @param position - The position in the signature and participants arrays corresponding to this
1929
+ * entry.
1930
+ * @param sigSlot - (s)
1931
+ */
1932
+ constructor({ participant, position, sigSlot, }) {
1933
+ super();
1934
+ this.participant = participant;
1935
+ this.position = position;
1936
+ this.sigSlot = sigSlot;
1937
+ this.attribute_map = {
1938
+ participant: 'participant',
1939
+ position: 'position',
1940
+ sigSlot: 'sig-slot',
1941
+ };
1942
+ }
1943
+ // eslint-disable-next-line camelcase
1944
+ static from_obj_for_encoding(data) {
1945
+ /* eslint-disable dot-notation */
1946
+ return new StateProofReveal({
1947
+ participant: typeof data['participant'] !== 'undefined'
1948
+ ? StateProofParticipant.from_obj_for_encoding(data['participant'])
1949
+ : undefined,
1950
+ position: data['position'],
1951
+ sigSlot: typeof data['sig-slot'] !== 'undefined'
1952
+ ? StateProofSigSlot.from_obj_for_encoding(data['sig-slot'])
1953
+ : undefined,
1954
+ });
1955
+ /* eslint-enable dot-notation */
1956
+ }
1957
+ }
1958
+ exports.StateProofReveal = StateProofReveal;
1959
+ class StateProofSigSlot extends basemodel_1.default {
1960
+ /**
1961
+ * Creates a new `StateProofSigSlot` object.
1962
+ * @param lowerSigWeight - (l) The total weight of signatures in the lower-numbered slots.
1963
+ * @param signature -
1964
+ */
1965
+ constructor({ lowerSigWeight, signature, }) {
1966
+ super();
1967
+ this.lowerSigWeight = lowerSigWeight;
1968
+ this.signature = signature;
1969
+ this.attribute_map = {
1970
+ lowerSigWeight: 'lower-sig-weight',
1971
+ signature: 'signature',
1972
+ };
1973
+ }
1974
+ // eslint-disable-next-line camelcase
1975
+ static from_obj_for_encoding(data) {
1976
+ /* eslint-disable dot-notation */
1977
+ return new StateProofSigSlot({
1978
+ lowerSigWeight: data['lower-sig-weight'],
1979
+ signature: typeof data['signature'] !== 'undefined'
1980
+ ? StateProofSignature.from_obj_for_encoding(data['signature'])
1981
+ : undefined,
1982
+ });
1983
+ /* eslint-enable dot-notation */
1984
+ }
1985
+ }
1986
+ exports.StateProofSigSlot = StateProofSigSlot;
1987
+ class StateProofSignature extends basemodel_1.default {
1988
+ /**
1989
+ * Creates a new `StateProofSignature` object.
1990
+ * @param falconSignature -
1991
+ * @param merkleArrayIndex -
1992
+ * @param proof -
1993
+ * @param verifyingKey - (vkey)
1994
+ */
1995
+ constructor({ falconSignature, merkleArrayIndex, proof, verifyingKey, }) {
1996
+ super();
1997
+ this.falconSignature =
1998
+ typeof falconSignature === 'string'
1999
+ ? new Uint8Array(Buffer.from(falconSignature, 'base64'))
2000
+ : falconSignature;
2001
+ this.merkleArrayIndex = merkleArrayIndex;
2002
+ this.proof = proof;
2003
+ this.verifyingKey =
2004
+ typeof verifyingKey === 'string'
2005
+ ? new Uint8Array(Buffer.from(verifyingKey, 'base64'))
2006
+ : verifyingKey;
2007
+ this.attribute_map = {
2008
+ falconSignature: 'falcon-signature',
2009
+ merkleArrayIndex: 'merkle-array-index',
2010
+ proof: 'proof',
2011
+ verifyingKey: 'verifying-key',
2012
+ };
2013
+ }
2014
+ // eslint-disable-next-line camelcase
2015
+ static from_obj_for_encoding(data) {
2016
+ /* eslint-disable dot-notation */
2017
+ return new StateProofSignature({
2018
+ falconSignature: data['falcon-signature'],
2019
+ merkleArrayIndex: data['merkle-array-index'],
2020
+ proof: typeof data['proof'] !== 'undefined'
2021
+ ? MerkleArrayProof.from_obj_for_encoding(data['proof'])
2022
+ : undefined,
2023
+ verifyingKey: data['verifying-key'],
2024
+ });
2025
+ /* eslint-enable dot-notation */
2026
+ }
2027
+ }
2028
+ exports.StateProofSignature = StateProofSignature;
2029
+ class StateProofTracking extends basemodel_1.default {
2030
+ /**
2031
+ * Creates a new `StateProofTracking` object.
2032
+ * @param nextRound - (n) Next round for which we will accept a state proof transaction.
2033
+ * @param onlineTotalWeight - (t) The total number of microalgos held by the online accounts during the
2034
+ * StateProof round.
2035
+ * @param type - State Proof Type. Note the raw object uses map with this as key.
2036
+ * @param votersCommitment - (v) Root of a vector commitment containing online accounts that will help sign
2037
+ * the proof.
2038
+ */
2039
+ constructor({ nextRound, onlineTotalWeight, type, votersCommitment, }) {
2040
+ super();
2041
+ this.nextRound = nextRound;
2042
+ this.onlineTotalWeight = onlineTotalWeight;
2043
+ this.type = type;
2044
+ this.votersCommitment =
2045
+ typeof votersCommitment === 'string'
2046
+ ? new Uint8Array(Buffer.from(votersCommitment, 'base64'))
2047
+ : votersCommitment;
2048
+ this.attribute_map = {
2049
+ nextRound: 'next-round',
2050
+ onlineTotalWeight: 'online-total-weight',
2051
+ type: 'type',
2052
+ votersCommitment: 'voters-commitment',
2053
+ };
2054
+ }
2055
+ // eslint-disable-next-line camelcase
2056
+ static from_obj_for_encoding(data) {
2057
+ /* eslint-disable dot-notation */
2058
+ return new StateProofTracking({
2059
+ nextRound: data['next-round'],
2060
+ onlineTotalWeight: data['online-total-weight'],
2061
+ type: data['type'],
2062
+ votersCommitment: data['voters-commitment'],
2063
+ });
2064
+ /* eslint-enable dot-notation */
2065
+ }
2066
+ }
2067
+ exports.StateProofTracking = StateProofTracking;
2068
+ class StateProofVerifier extends basemodel_1.default {
2069
+ /**
2070
+ * Creates a new `StateProofVerifier` object.
2071
+ * @param commitment - (cmt) Represents the root of the vector commitment tree.
2072
+ * @param keyLifetime - (lf) Key lifetime.
2073
+ */
2074
+ constructor({ commitment, keyLifetime, }) {
2075
+ super();
2076
+ this.commitment =
2077
+ typeof commitment === 'string'
2078
+ ? new Uint8Array(Buffer.from(commitment, 'base64'))
2079
+ : commitment;
2080
+ this.keyLifetime = keyLifetime;
2081
+ this.attribute_map = {
2082
+ commitment: 'commitment',
2083
+ keyLifetime: 'key-lifetime',
2084
+ };
2085
+ }
2086
+ // eslint-disable-next-line camelcase
2087
+ static from_obj_for_encoding(data) {
2088
+ /* eslint-disable dot-notation */
2089
+ return new StateProofVerifier({
2090
+ commitment: data['commitment'],
2091
+ keyLifetime: data['key-lifetime'],
2092
+ });
2093
+ /* eslint-enable dot-notation */
2094
+ }
2095
+ }
2096
+ exports.StateProofVerifier = StateProofVerifier;
2097
+ /**
2098
+ * Represents a (apls) local-state or (apgs) global-state schema. These schemas
2099
+ * determine how much storage may be used in a local-state or global-state for an
2100
+ * application. The more space used, the larger minimum balance must be maintained
2101
+ * in the account holding the data.
2102
+ */
2103
+ class StateSchema extends basemodel_1.default {
2104
+ /**
2105
+ * Creates a new `StateSchema` object.
2106
+ * @param numByteSlice - Maximum number of TEAL byte slices that may be stored in the key/value store.
2107
+ * @param numUint - Maximum number of TEAL uints that may be stored in the key/value store.
2108
+ */
2109
+ constructor({ numByteSlice, numUint, }) {
2110
+ super();
2111
+ this.numByteSlice = numByteSlice;
2112
+ this.numUint = numUint;
2113
+ this.attribute_map = {
2114
+ numByteSlice: 'num-byte-slice',
2115
+ numUint: 'num-uint',
2116
+ };
2117
+ }
2118
+ // eslint-disable-next-line camelcase
2119
+ static from_obj_for_encoding(data) {
2120
+ /* eslint-disable dot-notation */
2121
+ if (typeof data['num-byte-slice'] === 'undefined')
2122
+ throw new Error(`Response is missing required field 'num-byte-slice': ${data}`);
2123
+ if (typeof data['num-uint'] === 'undefined')
2124
+ throw new Error(`Response is missing required field 'num-uint': ${data}`);
2125
+ return new StateSchema({
2126
+ numByteSlice: data['num-byte-slice'],
2127
+ numUint: data['num-uint'],
2128
+ });
2129
+ /* eslint-enable dot-notation */
2130
+ }
2131
+ }
2132
+ exports.StateSchema = StateSchema;
2133
+ /**
2134
+ * Represents a key-value pair in an application store.
2135
+ */
2136
+ class TealKeyValue extends basemodel_1.default {
2137
+ /**
2138
+ * Creates a new `TealKeyValue` object.
2139
+ * @param key -
2140
+ * @param value - Represents a TEAL value.
2141
+ */
2142
+ constructor({ key, value }) {
2143
+ super();
2144
+ this.key = key;
2145
+ this.value = value;
2146
+ this.attribute_map = {
2147
+ key: 'key',
2148
+ value: 'value',
2149
+ };
2150
+ }
2151
+ // eslint-disable-next-line camelcase
2152
+ static from_obj_for_encoding(data) {
2153
+ /* eslint-disable dot-notation */
2154
+ if (typeof data['key'] === 'undefined')
2155
+ throw new Error(`Response is missing required field 'key': ${data}`);
2156
+ if (typeof data['value'] === 'undefined')
2157
+ throw new Error(`Response is missing required field 'value': ${data}`);
2158
+ return new TealKeyValue({
2159
+ key: data['key'],
2160
+ value: TealValue.from_obj_for_encoding(data['value']),
2161
+ });
2162
+ /* eslint-enable dot-notation */
2163
+ }
2164
+ }
2165
+ exports.TealKeyValue = TealKeyValue;
2166
+ /**
2167
+ * Represents a TEAL value.
2168
+ */
2169
+ class TealValue extends basemodel_1.default {
2170
+ /**
2171
+ * Creates a new `TealValue` object.
2172
+ * @param bytes - (tb) bytes value.
2173
+ * @param type - (tt) value type. Value `1` refers to **bytes**, value `2` refers to **uint**
2174
+ * @param uint - (ui) uint value.
2175
+ */
2176
+ constructor({ bytes, type, uint, }) {
2177
+ super();
2178
+ this.bytes = bytes;
2179
+ this.type = type;
2180
+ this.uint = uint;
2181
+ this.attribute_map = {
2182
+ bytes: 'bytes',
2183
+ type: 'type',
2184
+ uint: 'uint',
2185
+ };
2186
+ }
2187
+ // eslint-disable-next-line camelcase
2188
+ static from_obj_for_encoding(data) {
2189
+ /* eslint-disable dot-notation */
2190
+ if (typeof data['bytes'] === 'undefined')
2191
+ throw new Error(`Response is missing required field 'bytes': ${data}`);
2192
+ if (typeof data['type'] === 'undefined')
2193
+ throw new Error(`Response is missing required field 'type': ${data}`);
2194
+ if (typeof data['uint'] === 'undefined')
2195
+ throw new Error(`Response is missing required field 'uint': ${data}`);
2196
+ return new TealValue({
2197
+ bytes: data['bytes'],
2198
+ type: data['type'],
2199
+ uint: data['uint'],
2200
+ });
2201
+ /* eslint-enable dot-notation */
2202
+ }
2203
+ }
2204
+ exports.TealValue = TealValue;
2205
+ /**
2206
+ * Contains all fields common to all transactions and serves as an envelope to all
2207
+ * transactions type. Represents both regular and inner transactions.
2208
+ * Definition:
2209
+ * data/transactions/signedtxn.go : SignedTxn
2210
+ * data/transactions/transaction.go : Transaction
2211
+ */
2212
+ class Transaction extends basemodel_1.default {
2213
+ /**
2214
+ * Creates a new `Transaction` object.
2215
+ * @param fee - (fee) Transaction fee.
2216
+ * @param firstValid - (fv) First valid round for this transaction.
2217
+ * @param lastValid - (lv) Last valid round for this transaction.
2218
+ * @param sender - (snd) Sender's address.
2219
+ * @param applicationTransaction - Fields for application transactions.
2220
+ * Definition:
2221
+ * data/transactions/application.go : ApplicationCallTxnFields
2222
+ * @param assetConfigTransaction - Fields for asset allocation, re-configuration, and destruction.
2223
+ * A zero value for asset-id indicates asset creation.
2224
+ * A zero value for the params indicates asset destruction.
2225
+ * Definition:
2226
+ * data/transactions/asset.go : AssetConfigTxnFields
2227
+ * @param assetFreezeTransaction - Fields for an asset freeze transaction.
2228
+ * Definition:
2229
+ * data/transactions/asset.go : AssetFreezeTxnFields
2230
+ * @param assetTransferTransaction - Fields for an asset transfer transaction.
2231
+ * Definition:
2232
+ * data/transactions/asset.go : AssetTransferTxnFields
2233
+ * @param authAddr - (sgnr) this is included with signed transactions when the signing address does
2234
+ * not equal the sender. The backend can use this to ensure that auth addr is equal
2235
+ * to the accounts auth addr.
2236
+ * @param closeRewards - (rc) rewards applied to close-remainder-to account.
2237
+ * @param closingAmount - (ca) closing amount for transaction.
2238
+ * @param confirmedRound - Round when the transaction was confirmed.
2239
+ * @param createdApplicationIndex - Specifies an application index (ID) if an application was created with this
2240
+ * transaction.
2241
+ * @param createdAssetIndex - Specifies an asset index (ID) if an asset was created with this transaction.
2242
+ * @param genesisHash - (gh) Hash of genesis block.
2243
+ * @param genesisId - (gen) genesis block ID.
2244
+ * @param globalStateDelta - (gd) Global state key/value changes for the application being executed by this
2245
+ * transaction.
2246
+ * @param group - (grp) Base64 encoded byte array of a sha512/256 digest. When present indicates
2247
+ * that this transaction is part of a transaction group and the value is the
2248
+ * sha512/256 hash of the transactions in that group.
2249
+ * @param id - Transaction ID
2250
+ * @param innerTxns - Inner transactions produced by application execution.
2251
+ * @param intraRoundOffset - Offset into the round where this transaction was confirmed.
2252
+ * @param keyregTransaction - Fields for a keyreg transaction.
2253
+ * Definition:
2254
+ * data/transactions/keyreg.go : KeyregTxnFields
2255
+ * @param lease - (lx) Base64 encoded 32-byte array. Lease enforces mutual exclusion of
2256
+ * transactions. If this field is nonzero, then once the transaction is confirmed,
2257
+ * it acquires the lease identified by the (Sender, Lease) pair of the transaction
2258
+ * until the LastValid round passes. While this transaction possesses the lease, no
2259
+ * other transaction specifying this lease can be confirmed.
2260
+ * @param localStateDelta - (ld) Local state key/value changes for the application being executed by this
2261
+ * transaction.
2262
+ * @param logs - (lg) Logs for the application being executed by this transaction.
2263
+ * @param note - (note) Free form data.
2264
+ * @param paymentTransaction - Fields for a payment transaction.
2265
+ * Definition:
2266
+ * data/transactions/payment.go : PaymentTxnFields
2267
+ * @param receiverRewards - (rr) rewards applied to receiver account.
2268
+ * @param rekeyTo - (rekey) when included in a valid transaction, the accounts auth addr will be
2269
+ * updated with this value and future signatures must be signed with the key
2270
+ * represented by this address.
2271
+ * @param roundTime - Time when the block this transaction is in was confirmed.
2272
+ * @param senderRewards - (rs) rewards applied to sender account.
2273
+ * @param signature - Validation signature associated with some data. Only one of the signatures
2274
+ * should be provided.
2275
+ * @param stateProofTransaction - Fields for a state proof transaction.
2276
+ * Definition:
2277
+ * data/transactions/stateproof.go : StateProofTxnFields
2278
+ * @param txType - (type) Indicates what type of transaction this is. Different types have
2279
+ * different fields.
2280
+ * Valid types, and where their fields are stored:
2281
+ * * (pay) payment-transaction
2282
+ * * (keyreg) keyreg-transaction
2283
+ * * (acfg) asset-config-transaction
2284
+ * * (axfer) asset-transfer-transaction
2285
+ * * (afrz) asset-freeze-transaction
2286
+ * * (appl) application-transaction
2287
+ * * (stpf) state-proof-transaction
2288
+ */
2289
+ constructor({ fee, firstValid, lastValid, sender, applicationTransaction, assetConfigTransaction, assetFreezeTransaction, assetTransferTransaction, authAddr, closeRewards, closingAmount, confirmedRound, createdApplicationIndex, createdAssetIndex, genesisHash, genesisId, globalStateDelta, group, id, innerTxns, intraRoundOffset, keyregTransaction, lease, localStateDelta, logs, note, paymentTransaction, receiverRewards, rekeyTo, roundTime, senderRewards, signature, stateProofTransaction, txType, }) {
2290
+ super();
2291
+ this.fee = fee;
2292
+ this.firstValid = firstValid;
2293
+ this.lastValid = lastValid;
2294
+ this.sender = sender;
2295
+ this.applicationTransaction = applicationTransaction;
2296
+ this.assetConfigTransaction = assetConfigTransaction;
2297
+ this.assetFreezeTransaction = assetFreezeTransaction;
2298
+ this.assetTransferTransaction = assetTransferTransaction;
2299
+ this.authAddr = authAddr;
2300
+ this.closeRewards = closeRewards;
2301
+ this.closingAmount = closingAmount;
2302
+ this.confirmedRound = confirmedRound;
2303
+ this.createdApplicationIndex = createdApplicationIndex;
2304
+ this.createdAssetIndex = createdAssetIndex;
2305
+ this.genesisHash =
2306
+ typeof genesisHash === 'string'
2307
+ ? new Uint8Array(Buffer.from(genesisHash, 'base64'))
2308
+ : genesisHash;
2309
+ this.genesisId = genesisId;
2310
+ this.globalStateDelta = globalStateDelta;
2311
+ this.group =
2312
+ typeof group === 'string'
2313
+ ? new Uint8Array(Buffer.from(group, 'base64'))
2314
+ : group;
2315
+ this.id = id;
2316
+ this.innerTxns = innerTxns;
2317
+ this.intraRoundOffset = intraRoundOffset;
2318
+ this.keyregTransaction = keyregTransaction;
2319
+ this.lease =
2320
+ typeof lease === 'string'
2321
+ ? new Uint8Array(Buffer.from(lease, 'base64'))
2322
+ : lease;
2323
+ this.localStateDelta = localStateDelta;
2324
+ this.logs = logs;
2325
+ this.note =
2326
+ typeof note === 'string'
2327
+ ? new Uint8Array(Buffer.from(note, 'base64'))
2328
+ : note;
2329
+ this.paymentTransaction = paymentTransaction;
2330
+ this.receiverRewards = receiverRewards;
2331
+ this.rekeyTo = rekeyTo;
2332
+ this.roundTime = roundTime;
2333
+ this.senderRewards = senderRewards;
2334
+ this.signature = signature;
2335
+ this.stateProofTransaction = stateProofTransaction;
2336
+ this.txType = txType;
2337
+ this.attribute_map = {
2338
+ fee: 'fee',
2339
+ firstValid: 'first-valid',
2340
+ lastValid: 'last-valid',
2341
+ sender: 'sender',
2342
+ applicationTransaction: 'application-transaction',
2343
+ assetConfigTransaction: 'asset-config-transaction',
2344
+ assetFreezeTransaction: 'asset-freeze-transaction',
2345
+ assetTransferTransaction: 'asset-transfer-transaction',
2346
+ authAddr: 'auth-addr',
2347
+ closeRewards: 'close-rewards',
2348
+ closingAmount: 'closing-amount',
2349
+ confirmedRound: 'confirmed-round',
2350
+ createdApplicationIndex: 'created-application-index',
2351
+ createdAssetIndex: 'created-asset-index',
2352
+ genesisHash: 'genesis-hash',
2353
+ genesisId: 'genesis-id',
2354
+ globalStateDelta: 'global-state-delta',
2355
+ group: 'group',
2356
+ id: 'id',
2357
+ innerTxns: 'inner-txns',
2358
+ intraRoundOffset: 'intra-round-offset',
2359
+ keyregTransaction: 'keyreg-transaction',
2360
+ lease: 'lease',
2361
+ localStateDelta: 'local-state-delta',
2362
+ logs: 'logs',
2363
+ note: 'note',
2364
+ paymentTransaction: 'payment-transaction',
2365
+ receiverRewards: 'receiver-rewards',
2366
+ rekeyTo: 'rekey-to',
2367
+ roundTime: 'round-time',
2368
+ senderRewards: 'sender-rewards',
2369
+ signature: 'signature',
2370
+ stateProofTransaction: 'state-proof-transaction',
2371
+ txType: 'tx-type',
2372
+ };
2373
+ }
2374
+ // eslint-disable-next-line camelcase
2375
+ static from_obj_for_encoding(data) {
2376
+ /* eslint-disable dot-notation */
2377
+ if (typeof data['fee'] === 'undefined')
2378
+ throw new Error(`Response is missing required field 'fee': ${data}`);
2379
+ if (typeof data['first-valid'] === 'undefined')
2380
+ throw new Error(`Response is missing required field 'first-valid': ${data}`);
2381
+ if (typeof data['last-valid'] === 'undefined')
2382
+ throw new Error(`Response is missing required field 'last-valid': ${data}`);
2383
+ if (typeof data['sender'] === 'undefined')
2384
+ throw new Error(`Response is missing required field 'sender': ${data}`);
2385
+ return new Transaction({
2386
+ fee: data['fee'],
2387
+ firstValid: data['first-valid'],
2388
+ lastValid: data['last-valid'],
2389
+ sender: data['sender'],
2390
+ applicationTransaction: typeof data['application-transaction'] !== 'undefined'
2391
+ ? TransactionApplication.from_obj_for_encoding(data['application-transaction'])
2392
+ : undefined,
2393
+ assetConfigTransaction: typeof data['asset-config-transaction'] !== 'undefined'
2394
+ ? TransactionAssetConfig.from_obj_for_encoding(data['asset-config-transaction'])
2395
+ : undefined,
2396
+ assetFreezeTransaction: typeof data['asset-freeze-transaction'] !== 'undefined'
2397
+ ? TransactionAssetFreeze.from_obj_for_encoding(data['asset-freeze-transaction'])
2398
+ : undefined,
2399
+ assetTransferTransaction: typeof data['asset-transfer-transaction'] !== 'undefined'
2400
+ ? TransactionAssetTransfer.from_obj_for_encoding(data['asset-transfer-transaction'])
2401
+ : undefined,
2402
+ authAddr: data['auth-addr'],
2403
+ closeRewards: data['close-rewards'],
2404
+ closingAmount: data['closing-amount'],
2405
+ confirmedRound: data['confirmed-round'],
2406
+ createdApplicationIndex: data['created-application-index'],
2407
+ createdAssetIndex: data['created-asset-index'],
2408
+ genesisHash: data['genesis-hash'],
2409
+ genesisId: data['genesis-id'],
2410
+ globalStateDelta: typeof data['global-state-delta'] !== 'undefined'
2411
+ ? data['global-state-delta'].map(EvalDeltaKeyValue.from_obj_for_encoding)
2412
+ : undefined,
2413
+ group: data['group'],
2414
+ id: data['id'],
2415
+ innerTxns: typeof data['inner-txns'] !== 'undefined'
2416
+ ? data['inner-txns'].map(Transaction.from_obj_for_encoding)
2417
+ : undefined,
2418
+ intraRoundOffset: data['intra-round-offset'],
2419
+ keyregTransaction: typeof data['keyreg-transaction'] !== 'undefined'
2420
+ ? TransactionKeyreg.from_obj_for_encoding(data['keyreg-transaction'])
2421
+ : undefined,
2422
+ lease: data['lease'],
2423
+ localStateDelta: typeof data['local-state-delta'] !== 'undefined'
2424
+ ? data['local-state-delta'].map(AccountStateDelta.from_obj_for_encoding)
2425
+ : undefined,
2426
+ logs: data['logs'],
2427
+ note: data['note'],
2428
+ paymentTransaction: typeof data['payment-transaction'] !== 'undefined'
2429
+ ? TransactionPayment.from_obj_for_encoding(data['payment-transaction'])
2430
+ : undefined,
2431
+ receiverRewards: data['receiver-rewards'],
2432
+ rekeyTo: data['rekey-to'],
2433
+ roundTime: data['round-time'],
2434
+ senderRewards: data['sender-rewards'],
2435
+ signature: typeof data['signature'] !== 'undefined'
2436
+ ? TransactionSignature.from_obj_for_encoding(data['signature'])
2437
+ : undefined,
2438
+ stateProofTransaction: typeof data['state-proof-transaction'] !== 'undefined'
2439
+ ? TransactionStateProof.from_obj_for_encoding(data['state-proof-transaction'])
2440
+ : undefined,
2441
+ txType: data['tx-type'],
2442
+ });
2443
+ /* eslint-enable dot-notation */
2444
+ }
2445
+ }
2446
+ exports.Transaction = Transaction;
2447
+ /**
2448
+ * Fields for application transactions.
2449
+ * Definition:
2450
+ * data/transactions/application.go : ApplicationCallTxnFields
2451
+ */
2452
+ class TransactionApplication extends basemodel_1.default {
2453
+ /**
2454
+ * Creates a new `TransactionApplication` object.
2455
+ * @param applicationId - (apid) ID of the application being configured or empty if creating.
2456
+ * @param accounts - (apat) List of accounts in addition to the sender that may be accessed from the
2457
+ * application's approval-program and clear-state-program.
2458
+ * @param applicationArgs - (apaa) transaction specific arguments accessed from the application's
2459
+ * approval-program and clear-state-program.
2460
+ * @param approvalProgram - (apap) Logic executed for every application transaction, except when
2461
+ * on-completion is set to "clear". It can read and write global state for the
2462
+ * application, as well as account-specific local state. Approval programs may
2463
+ * reject the transaction.
2464
+ * @param clearStateProgram - (apsu) Logic executed for application transactions with on-completion set to
2465
+ * "clear". It can read and write global state for the application, as well as
2466
+ * account-specific local state. Clear state programs cannot reject the
2467
+ * transaction.
2468
+ * @param extraProgramPages - (epp) specifies the additional app program len requested in pages.
2469
+ * @param foreignApps - (apfa) Lists the applications in addition to the application-id whose global
2470
+ * states may be accessed by this application's approval-program and
2471
+ * clear-state-program. The access is read-only.
2472
+ * @param foreignAssets - (apas) lists the assets whose parameters may be accessed by this application's
2473
+ * ApprovalProgram and ClearStateProgram. The access is read-only.
2474
+ * @param globalStateSchema - Represents a (apls) local-state or (apgs) global-state schema. These schemas
2475
+ * determine how much storage may be used in a local-state or global-state for an
2476
+ * application. The more space used, the larger minimum balance must be maintained
2477
+ * in the account holding the data.
2478
+ * @param localStateSchema - Represents a (apls) local-state or (apgs) global-state schema. These schemas
2479
+ * determine how much storage may be used in a local-state or global-state for an
2480
+ * application. The more space used, the larger minimum balance must be maintained
2481
+ * in the account holding the data.
2482
+ * @param onCompletion - (apan) defines the what additional actions occur with the transaction.
2483
+ * Valid types:
2484
+ * * noop
2485
+ * * optin
2486
+ * * closeout
2487
+ * * clear
2488
+ * * update
2489
+ * * update
2490
+ * * delete
2491
+ */
2492
+ constructor({ applicationId, accounts, applicationArgs, approvalProgram, clearStateProgram, extraProgramPages, foreignApps, foreignAssets, globalStateSchema, localStateSchema, onCompletion, }) {
2493
+ super();
2494
+ this.applicationId = applicationId;
2495
+ this.accounts = accounts;
2496
+ this.applicationArgs = applicationArgs;
2497
+ this.approvalProgram =
2498
+ typeof approvalProgram === 'string'
2499
+ ? new Uint8Array(Buffer.from(approvalProgram, 'base64'))
2500
+ : approvalProgram;
2501
+ this.clearStateProgram =
2502
+ typeof clearStateProgram === 'string'
2503
+ ? new Uint8Array(Buffer.from(clearStateProgram, 'base64'))
2504
+ : clearStateProgram;
2505
+ this.extraProgramPages = extraProgramPages;
2506
+ this.foreignApps = foreignApps;
2507
+ this.foreignAssets = foreignAssets;
2508
+ this.globalStateSchema = globalStateSchema;
2509
+ this.localStateSchema = localStateSchema;
2510
+ this.onCompletion = onCompletion;
2511
+ this.attribute_map = {
2512
+ applicationId: 'application-id',
2513
+ accounts: 'accounts',
2514
+ applicationArgs: 'application-args',
2515
+ approvalProgram: 'approval-program',
2516
+ clearStateProgram: 'clear-state-program',
2517
+ extraProgramPages: 'extra-program-pages',
2518
+ foreignApps: 'foreign-apps',
2519
+ foreignAssets: 'foreign-assets',
2520
+ globalStateSchema: 'global-state-schema',
2521
+ localStateSchema: 'local-state-schema',
2522
+ onCompletion: 'on-completion',
2523
+ };
2524
+ }
2525
+ // eslint-disable-next-line camelcase
2526
+ static from_obj_for_encoding(data) {
2527
+ /* eslint-disable dot-notation */
2528
+ if (typeof data['application-id'] === 'undefined')
2529
+ throw new Error(`Response is missing required field 'application-id': ${data}`);
2530
+ return new TransactionApplication({
2531
+ applicationId: data['application-id'],
2532
+ accounts: data['accounts'],
2533
+ applicationArgs: data['application-args'],
2534
+ approvalProgram: data['approval-program'],
2535
+ clearStateProgram: data['clear-state-program'],
2536
+ extraProgramPages: data['extra-program-pages'],
2537
+ foreignApps: data['foreign-apps'],
2538
+ foreignAssets: data['foreign-assets'],
2539
+ globalStateSchema: typeof data['global-state-schema'] !== 'undefined'
2540
+ ? StateSchema.from_obj_for_encoding(data['global-state-schema'])
2541
+ : undefined,
2542
+ localStateSchema: typeof data['local-state-schema'] !== 'undefined'
2543
+ ? StateSchema.from_obj_for_encoding(data['local-state-schema'])
2544
+ : undefined,
2545
+ onCompletion: data['on-completion'],
2546
+ });
2547
+ /* eslint-enable dot-notation */
2548
+ }
2549
+ }
2550
+ exports.TransactionApplication = TransactionApplication;
2551
+ /**
2552
+ * Fields for asset allocation, re-configuration, and destruction.
2553
+ * A zero value for asset-id indicates asset creation.
2554
+ * A zero value for the params indicates asset destruction.
2555
+ * Definition:
2556
+ * data/transactions/asset.go : AssetConfigTxnFields
2557
+ */
2558
+ class TransactionAssetConfig extends basemodel_1.default {
2559
+ /**
2560
+ * Creates a new `TransactionAssetConfig` object.
2561
+ * @param assetId - (xaid) ID of the asset being configured or empty if creating.
2562
+ * @param params - AssetParams specifies the parameters for an asset.
2563
+ * (apar) when part of an AssetConfig transaction.
2564
+ * Definition:
2565
+ * data/transactions/asset.go : AssetParams
2566
+ */
2567
+ constructor({ assetId, params, }) {
2568
+ super();
2569
+ this.assetId = assetId;
2570
+ this.params = params;
2571
+ this.attribute_map = {
2572
+ assetId: 'asset-id',
2573
+ params: 'params',
2574
+ };
2575
+ }
2576
+ // eslint-disable-next-line camelcase
2577
+ static from_obj_for_encoding(data) {
2578
+ /* eslint-disable dot-notation */
2579
+ return new TransactionAssetConfig({
2580
+ assetId: data['asset-id'],
2581
+ params: typeof data['params'] !== 'undefined'
2582
+ ? AssetParams.from_obj_for_encoding(data['params'])
2583
+ : undefined,
2584
+ });
2585
+ /* eslint-enable dot-notation */
2586
+ }
2587
+ }
2588
+ exports.TransactionAssetConfig = TransactionAssetConfig;
2589
+ /**
2590
+ * Fields for an asset freeze transaction.
2591
+ * Definition:
2592
+ * data/transactions/asset.go : AssetFreezeTxnFields
2593
+ */
2594
+ class TransactionAssetFreeze extends basemodel_1.default {
2595
+ /**
2596
+ * Creates a new `TransactionAssetFreeze` object.
2597
+ * @param address - (fadd) Address of the account whose asset is being frozen or thawed.
2598
+ * @param assetId - (faid) ID of the asset being frozen or thawed.
2599
+ * @param newFreezeStatus - (afrz) The new freeze status.
2600
+ */
2601
+ constructor({ address, assetId, newFreezeStatus, }) {
2602
+ super();
2603
+ this.address = address;
2604
+ this.assetId = assetId;
2605
+ this.newFreezeStatus = newFreezeStatus;
2606
+ this.attribute_map = {
2607
+ address: 'address',
2608
+ assetId: 'asset-id',
2609
+ newFreezeStatus: 'new-freeze-status',
2610
+ };
2611
+ }
2612
+ // eslint-disable-next-line camelcase
2613
+ static from_obj_for_encoding(data) {
2614
+ /* eslint-disable dot-notation */
2615
+ if (typeof data['address'] === 'undefined')
2616
+ throw new Error(`Response is missing required field 'address': ${data}`);
2617
+ if (typeof data['asset-id'] === 'undefined')
2618
+ throw new Error(`Response is missing required field 'asset-id': ${data}`);
2619
+ if (typeof data['new-freeze-status'] === 'undefined')
2620
+ throw new Error(`Response is missing required field 'new-freeze-status': ${data}`);
2621
+ return new TransactionAssetFreeze({
2622
+ address: data['address'],
2623
+ assetId: data['asset-id'],
2624
+ newFreezeStatus: data['new-freeze-status'],
2625
+ });
2626
+ /* eslint-enable dot-notation */
2627
+ }
2628
+ }
2629
+ exports.TransactionAssetFreeze = TransactionAssetFreeze;
2630
+ /**
2631
+ * Fields for an asset transfer transaction.
2632
+ * Definition:
2633
+ * data/transactions/asset.go : AssetTransferTxnFields
2634
+ */
2635
+ class TransactionAssetTransfer extends basemodel_1.default {
2636
+ /**
2637
+ * Creates a new `TransactionAssetTransfer` object.
2638
+ * @param amount - (aamt) Amount of asset to transfer. A zero amount transferred to self allocates
2639
+ * that asset in the account's Assets map.
2640
+ * @param assetId - (xaid) ID of the asset being transferred.
2641
+ * @param receiver - (arcv) Recipient address of the transfer.
2642
+ * @param closeAmount - Number of assets transfered to the close-to account as part of the transaction.
2643
+ * @param closeTo - (aclose) Indicates that the asset should be removed from the account's Assets
2644
+ * map, and specifies where the remaining asset holdings should be transferred.
2645
+ * It's always valid to transfer remaining asset holdings to the creator account.
2646
+ * @param sender - (asnd) The effective sender during a clawback transactions. If this is not a
2647
+ * zero value, the real transaction sender must be the Clawback address from the
2648
+ * AssetParams.
2649
+ */
2650
+ constructor({ amount, assetId, receiver, closeAmount, closeTo, sender, }) {
2651
+ super();
2652
+ this.amount = amount;
2653
+ this.assetId = assetId;
2654
+ this.receiver = receiver;
2655
+ this.closeAmount = closeAmount;
2656
+ this.closeTo = closeTo;
2657
+ this.sender = sender;
2658
+ this.attribute_map = {
2659
+ amount: 'amount',
2660
+ assetId: 'asset-id',
2661
+ receiver: 'receiver',
2662
+ closeAmount: 'close-amount',
2663
+ closeTo: 'close-to',
2664
+ sender: 'sender',
2665
+ };
2666
+ }
2667
+ // eslint-disable-next-line camelcase
2668
+ static from_obj_for_encoding(data) {
2669
+ /* eslint-disable dot-notation */
2670
+ if (typeof data['amount'] === 'undefined')
2671
+ throw new Error(`Response is missing required field 'amount': ${data}`);
2672
+ if (typeof data['asset-id'] === 'undefined')
2673
+ throw new Error(`Response is missing required field 'asset-id': ${data}`);
2674
+ if (typeof data['receiver'] === 'undefined')
2675
+ throw new Error(`Response is missing required field 'receiver': ${data}`);
2676
+ return new TransactionAssetTransfer({
2677
+ amount: data['amount'],
2678
+ assetId: data['asset-id'],
2679
+ receiver: data['receiver'],
2680
+ closeAmount: data['close-amount'],
2681
+ closeTo: data['close-to'],
2682
+ sender: data['sender'],
2683
+ });
2684
+ /* eslint-enable dot-notation */
2685
+ }
2686
+ }
2687
+ exports.TransactionAssetTransfer = TransactionAssetTransfer;
2688
+ /**
2689
+ * Fields for a keyreg transaction.
2690
+ * Definition:
2691
+ * data/transactions/keyreg.go : KeyregTxnFields
2692
+ */
2693
+ class TransactionKeyreg extends basemodel_1.default {
2694
+ /**
2695
+ * Creates a new `TransactionKeyreg` object.
2696
+ * @param nonParticipation - (nonpart) Mark the account as participating or non-participating.
2697
+ * @param selectionParticipationKey - (selkey) Public key used with the Verified Random Function (VRF) result during
2698
+ * committee selection.
2699
+ * @param stateProofKey - (sprfkey) State proof key used in key registration transactions.
2700
+ * @param voteFirstValid - (votefst) First round this participation key is valid.
2701
+ * @param voteKeyDilution - (votekd) Number of subkeys in each batch of participation keys.
2702
+ * @param voteLastValid - (votelst) Last round this participation key is valid.
2703
+ * @param voteParticipationKey - (votekey) Participation public key used in key registration transactions.
2704
+ */
2705
+ constructor({ nonParticipation, selectionParticipationKey, stateProofKey, voteFirstValid, voteKeyDilution, voteLastValid, voteParticipationKey, }) {
2706
+ super();
2707
+ this.nonParticipation = nonParticipation;
2708
+ this.selectionParticipationKey =
2709
+ typeof selectionParticipationKey === 'string'
2710
+ ? new Uint8Array(Buffer.from(selectionParticipationKey, 'base64'))
2711
+ : selectionParticipationKey;
2712
+ this.stateProofKey =
2713
+ typeof stateProofKey === 'string'
2714
+ ? new Uint8Array(Buffer.from(stateProofKey, 'base64'))
2715
+ : stateProofKey;
2716
+ this.voteFirstValid = voteFirstValid;
2717
+ this.voteKeyDilution = voteKeyDilution;
2718
+ this.voteLastValid = voteLastValid;
2719
+ this.voteParticipationKey =
2720
+ typeof voteParticipationKey === 'string'
2721
+ ? new Uint8Array(Buffer.from(voteParticipationKey, 'base64'))
2722
+ : voteParticipationKey;
2723
+ this.attribute_map = {
2724
+ nonParticipation: 'non-participation',
2725
+ selectionParticipationKey: 'selection-participation-key',
2726
+ stateProofKey: 'state-proof-key',
2727
+ voteFirstValid: 'vote-first-valid',
2728
+ voteKeyDilution: 'vote-key-dilution',
2729
+ voteLastValid: 'vote-last-valid',
2730
+ voteParticipationKey: 'vote-participation-key',
2731
+ };
2732
+ }
2733
+ // eslint-disable-next-line camelcase
2734
+ static from_obj_for_encoding(data) {
2735
+ /* eslint-disable dot-notation */
2736
+ return new TransactionKeyreg({
2737
+ nonParticipation: data['non-participation'],
2738
+ selectionParticipationKey: data['selection-participation-key'],
2739
+ stateProofKey: data['state-proof-key'],
2740
+ voteFirstValid: data['vote-first-valid'],
2741
+ voteKeyDilution: data['vote-key-dilution'],
2742
+ voteLastValid: data['vote-last-valid'],
2743
+ voteParticipationKey: data['vote-participation-key'],
2744
+ });
2745
+ /* eslint-enable dot-notation */
2746
+ }
2747
+ }
2748
+ exports.TransactionKeyreg = TransactionKeyreg;
2749
+ /**
2750
+ * Fields for a payment transaction.
2751
+ * Definition:
2752
+ * data/transactions/payment.go : PaymentTxnFields
2753
+ */
2754
+ class TransactionPayment extends basemodel_1.default {
2755
+ /**
2756
+ * Creates a new `TransactionPayment` object.
2757
+ * @param amount - (amt) number of MicroAlgos intended to be transferred.
2758
+ * @param receiver - (rcv) receiver's address.
2759
+ * @param closeAmount - Number of MicroAlgos that were sent to the close-remainder-to address when
2760
+ * closing the sender account.
2761
+ * @param closeRemainderTo - (close) when set, indicates that the sending account should be closed and all
2762
+ * remaining funds be transferred to this address.
2763
+ */
2764
+ constructor({ amount, receiver, closeAmount, closeRemainderTo, }) {
2765
+ super();
2766
+ this.amount = amount;
2767
+ this.receiver = receiver;
2768
+ this.closeAmount = closeAmount;
2769
+ this.closeRemainderTo = closeRemainderTo;
2770
+ this.attribute_map = {
2771
+ amount: 'amount',
2772
+ receiver: 'receiver',
2773
+ closeAmount: 'close-amount',
2774
+ closeRemainderTo: 'close-remainder-to',
2775
+ };
2776
+ }
2777
+ // eslint-disable-next-line camelcase
2778
+ static from_obj_for_encoding(data) {
2779
+ /* eslint-disable dot-notation */
2780
+ if (typeof data['amount'] === 'undefined')
2781
+ throw new Error(`Response is missing required field 'amount': ${data}`);
2782
+ if (typeof data['receiver'] === 'undefined')
2783
+ throw new Error(`Response is missing required field 'receiver': ${data}`);
2784
+ return new TransactionPayment({
2785
+ amount: data['amount'],
2786
+ receiver: data['receiver'],
2787
+ closeAmount: data['close-amount'],
2788
+ closeRemainderTo: data['close-remainder-to'],
2789
+ });
2790
+ /* eslint-enable dot-notation */
2791
+ }
2792
+ }
2793
+ exports.TransactionPayment = TransactionPayment;
2794
+ /**
2795
+ *
2796
+ */
2797
+ class TransactionResponse extends basemodel_1.default {
2798
+ /**
2799
+ * Creates a new `TransactionResponse` object.
2800
+ * @param currentRound - Round at which the results were computed.
2801
+ * @param transaction - Contains all fields common to all transactions and serves as an envelope to all
2802
+ * transactions type. Represents both regular and inner transactions.
2803
+ * Definition:
2804
+ * data/transactions/signedtxn.go : SignedTxn
2805
+ * data/transactions/transaction.go : Transaction
2806
+ */
2807
+ constructor({ currentRound, transaction, }) {
2808
+ super();
2809
+ this.currentRound = currentRound;
2810
+ this.transaction = transaction;
2811
+ this.attribute_map = {
2812
+ currentRound: 'current-round',
2813
+ transaction: 'transaction',
2814
+ };
2815
+ }
2816
+ // eslint-disable-next-line camelcase
2817
+ static from_obj_for_encoding(data) {
2818
+ /* eslint-disable dot-notation */
2819
+ if (typeof data['current-round'] === 'undefined')
2820
+ throw new Error(`Response is missing required field 'current-round': ${data}`);
2821
+ if (typeof data['transaction'] === 'undefined')
2822
+ throw new Error(`Response is missing required field 'transaction': ${data}`);
2823
+ return new TransactionResponse({
2824
+ currentRound: data['current-round'],
2825
+ transaction: Transaction.from_obj_for_encoding(data['transaction']),
2826
+ });
2827
+ /* eslint-enable dot-notation */
2828
+ }
2829
+ }
2830
+ exports.TransactionResponse = TransactionResponse;
2831
+ /**
2832
+ * Validation signature associated with some data. Only one of the signatures
2833
+ * should be provided.
2834
+ */
2835
+ class TransactionSignature extends basemodel_1.default {
2836
+ /**
2837
+ * Creates a new `TransactionSignature` object.
2838
+ * @param logicsig - (lsig) Programatic transaction signature.
2839
+ * Definition:
2840
+ * data/transactions/logicsig.go
2841
+ * @param multisig - (msig) structure holding multiple subsignatures.
2842
+ * Definition:
2843
+ * crypto/multisig.go : MultisigSig
2844
+ * @param sig - (sig) Standard ed25519 signature.
2845
+ */
2846
+ constructor({ logicsig, multisig, sig, }) {
2847
+ super();
2848
+ this.logicsig = logicsig;
2849
+ this.multisig = multisig;
2850
+ this.sig =
2851
+ typeof sig === 'string'
2852
+ ? new Uint8Array(Buffer.from(sig, 'base64'))
2853
+ : sig;
2854
+ this.attribute_map = {
2855
+ logicsig: 'logicsig',
2856
+ multisig: 'multisig',
2857
+ sig: 'sig',
2858
+ };
2859
+ }
2860
+ // eslint-disable-next-line camelcase
2861
+ static from_obj_for_encoding(data) {
2862
+ /* eslint-disable dot-notation */
2863
+ return new TransactionSignature({
2864
+ logicsig: typeof data['logicsig'] !== 'undefined'
2865
+ ? TransactionSignatureLogicsig.from_obj_for_encoding(data['logicsig'])
2866
+ : undefined,
2867
+ multisig: typeof data['multisig'] !== 'undefined'
2868
+ ? TransactionSignatureMultisig.from_obj_for_encoding(data['multisig'])
2869
+ : undefined,
2870
+ sig: data['sig'],
2871
+ });
2872
+ /* eslint-enable dot-notation */
2873
+ }
2874
+ }
2875
+ exports.TransactionSignature = TransactionSignature;
2876
+ /**
2877
+ * (lsig) Programatic transaction signature.
2878
+ * Definition:
2879
+ * data/transactions/logicsig.go
2880
+ */
2881
+ class TransactionSignatureLogicsig extends basemodel_1.default {
2882
+ /**
2883
+ * Creates a new `TransactionSignatureLogicsig` object.
2884
+ * @param logic - (l) Program signed by a signature or multi signature, or hashed to be the
2885
+ * address of ana ccount. Base64 encoded TEAL program.
2886
+ * @param args - (arg) Logic arguments, base64 encoded.
2887
+ * @param multisigSignature - (msig) structure holding multiple subsignatures.
2888
+ * Definition:
2889
+ * crypto/multisig.go : MultisigSig
2890
+ * @param signature - (sig) ed25519 signature.
2891
+ */
2892
+ constructor({ logic, args, multisigSignature, signature, }) {
2893
+ super();
2894
+ this.logic =
2895
+ typeof logic === 'string'
2896
+ ? new Uint8Array(Buffer.from(logic, 'base64'))
2897
+ : logic;
2898
+ this.args = args;
2899
+ this.multisigSignature = multisigSignature;
2900
+ this.signature =
2901
+ typeof signature === 'string'
2902
+ ? new Uint8Array(Buffer.from(signature, 'base64'))
2903
+ : signature;
2904
+ this.attribute_map = {
2905
+ logic: 'logic',
2906
+ args: 'args',
2907
+ multisigSignature: 'multisig-signature',
2908
+ signature: 'signature',
2909
+ };
2910
+ }
2911
+ // eslint-disable-next-line camelcase
2912
+ static from_obj_for_encoding(data) {
2913
+ /* eslint-disable dot-notation */
2914
+ if (typeof data['logic'] === 'undefined')
2915
+ throw new Error(`Response is missing required field 'logic': ${data}`);
2916
+ return new TransactionSignatureLogicsig({
2917
+ logic: data['logic'],
2918
+ args: data['args'],
2919
+ multisigSignature: typeof data['multisig-signature'] !== 'undefined'
2920
+ ? TransactionSignatureMultisig.from_obj_for_encoding(data['multisig-signature'])
2921
+ : undefined,
2922
+ signature: data['signature'],
2923
+ });
2924
+ /* eslint-enable dot-notation */
2925
+ }
2926
+ }
2927
+ exports.TransactionSignatureLogicsig = TransactionSignatureLogicsig;
2928
+ /**
2929
+ * (msig) structure holding multiple subsignatures.
2930
+ * Definition:
2931
+ * crypto/multisig.go : MultisigSig
2932
+ */
2933
+ class TransactionSignatureMultisig extends basemodel_1.default {
2934
+ /**
2935
+ * Creates a new `TransactionSignatureMultisig` object.
2936
+ * @param subsignature - (subsig) holds pairs of public key and signatures.
2937
+ * @param threshold - (thr)
2938
+ * @param version - (v)
2939
+ */
2940
+ constructor({ subsignature, threshold, version, }) {
2941
+ super();
2942
+ this.subsignature = subsignature;
2943
+ this.threshold = threshold;
2944
+ this.version = version;
2945
+ this.attribute_map = {
2946
+ subsignature: 'subsignature',
2947
+ threshold: 'threshold',
2948
+ version: 'version',
2949
+ };
2950
+ }
2951
+ // eslint-disable-next-line camelcase
2952
+ static from_obj_for_encoding(data) {
2953
+ /* eslint-disable dot-notation */
2954
+ return new TransactionSignatureMultisig({
2955
+ subsignature: typeof data['subsignature'] !== 'undefined'
2956
+ ? data['subsignature'].map(TransactionSignatureMultisigSubsignature.from_obj_for_encoding)
2957
+ : undefined,
2958
+ threshold: data['threshold'],
2959
+ version: data['version'],
2960
+ });
2961
+ /* eslint-enable dot-notation */
2962
+ }
2963
+ }
2964
+ exports.TransactionSignatureMultisig = TransactionSignatureMultisig;
2965
+ class TransactionSignatureMultisigSubsignature extends basemodel_1.default {
2966
+ /**
2967
+ * Creates a new `TransactionSignatureMultisigSubsignature` object.
2968
+ * @param publicKey - (pk)
2969
+ * @param signature - (s)
2970
+ */
2971
+ constructor({ publicKey, signature, }) {
2972
+ super();
2973
+ this.publicKey =
2974
+ typeof publicKey === 'string'
2975
+ ? new Uint8Array(Buffer.from(publicKey, 'base64'))
2976
+ : publicKey;
2977
+ this.signature =
2978
+ typeof signature === 'string'
2979
+ ? new Uint8Array(Buffer.from(signature, 'base64'))
2980
+ : signature;
2981
+ this.attribute_map = {
2982
+ publicKey: 'public-key',
2983
+ signature: 'signature',
2984
+ };
2985
+ }
2986
+ // eslint-disable-next-line camelcase
2987
+ static from_obj_for_encoding(data) {
2988
+ /* eslint-disable dot-notation */
2989
+ return new TransactionSignatureMultisigSubsignature({
2990
+ publicKey: data['public-key'],
2991
+ signature: data['signature'],
2992
+ });
2993
+ /* eslint-enable dot-notation */
2994
+ }
2995
+ }
2996
+ exports.TransactionSignatureMultisigSubsignature = TransactionSignatureMultisigSubsignature;
2997
+ /**
2998
+ * Fields for a state proof transaction.
2999
+ * Definition:
3000
+ * data/transactions/stateproof.go : StateProofTxnFields
3001
+ */
3002
+ class TransactionStateProof extends basemodel_1.default {
3003
+ /**
3004
+ * Creates a new `TransactionStateProof` object.
3005
+ * @param message - (spmsg)
3006
+ * @param stateProof - (sp) represents a state proof.
3007
+ * Definition:
3008
+ * crypto/stateproof/structs.go : StateProof
3009
+ * @param stateProofType - (sptype) Type of the state proof. Integer representing an entry defined in
3010
+ * protocol/stateproof.go
3011
+ */
3012
+ constructor({ message, stateProof, stateProofType, }) {
3013
+ super();
3014
+ this.message = message;
3015
+ this.stateProof = stateProof;
3016
+ this.stateProofType = stateProofType;
3017
+ this.attribute_map = {
3018
+ message: 'message',
3019
+ stateProof: 'state-proof',
3020
+ stateProofType: 'state-proof-type',
3021
+ };
3022
+ }
3023
+ // eslint-disable-next-line camelcase
3024
+ static from_obj_for_encoding(data) {
3025
+ /* eslint-disable dot-notation */
3026
+ return new TransactionStateProof({
3027
+ message: typeof data['message'] !== 'undefined'
3028
+ ? IndexerStateProofMessage.from_obj_for_encoding(data['message'])
3029
+ : undefined,
3030
+ stateProof: typeof data['state-proof'] !== 'undefined'
3031
+ ? StateProofFields.from_obj_for_encoding(data['state-proof'])
3032
+ : undefined,
3033
+ stateProofType: data['state-proof-type'],
3034
+ });
3035
+ /* eslint-enable dot-notation */
3036
+ }
3037
+ }
3038
+ exports.TransactionStateProof = TransactionStateProof;
3039
+ /**
3040
+ *
3041
+ */
3042
+ class TransactionsResponse extends basemodel_1.default {
3043
+ /**
3044
+ * Creates a new `TransactionsResponse` object.
3045
+ * @param currentRound - Round at which the results were computed.
3046
+ * @param transactions -
3047
+ * @param nextToken - Used for pagination, when making another request provide this token with the
3048
+ * next parameter.
3049
+ */
3050
+ constructor({ currentRound, transactions, nextToken, }) {
3051
+ super();
3052
+ this.currentRound = currentRound;
3053
+ this.transactions = transactions;
3054
+ this.nextToken = nextToken;
3055
+ this.attribute_map = {
3056
+ currentRound: 'current-round',
3057
+ transactions: 'transactions',
3058
+ nextToken: 'next-token',
3059
+ };
3060
+ }
3061
+ // eslint-disable-next-line camelcase
3062
+ static from_obj_for_encoding(data) {
3063
+ /* eslint-disable dot-notation */
3064
+ if (typeof data['current-round'] === 'undefined')
3065
+ throw new Error(`Response is missing required field 'current-round': ${data}`);
3066
+ if (!Array.isArray(data['transactions']))
3067
+ throw new Error(`Response is missing required array field 'transactions': ${data}`);
3068
+ return new TransactionsResponse({
3069
+ currentRound: data['current-round'],
3070
+ transactions: data['transactions'].map(Transaction.from_obj_for_encoding),
3071
+ nextToken: data['next-token'],
3072
+ });
3073
+ /* eslint-enable dot-notation */
3074
+ }
3075
+ }
3076
+ exports.TransactionsResponse = TransactionsResponse;
3077
+ //# sourceMappingURL=types.js.map