algosdk 1.22.0 → 1.23.2

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 (106) 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 +38 -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/models/types.js +815 -42
  17. package/dist/cjs/src/client/v2/algod/models/types.js.map +1 -1
  18. package/dist/cjs/src/client/v2/{algod/models/base.js → basemodel.js} +1 -1
  19. package/dist/cjs/src/client/v2/basemodel.js.map +1 -0
  20. package/dist/cjs/src/client/v2/indexer/indexer.js +50 -0
  21. package/dist/cjs/src/client/v2/indexer/indexer.js.map +1 -1
  22. package/dist/cjs/src/client/v2/indexer/lookupApplicationBoxByIDandName.js +45 -0
  23. package/dist/cjs/src/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -0
  24. package/dist/cjs/src/client/v2/indexer/models/types.js +3077 -0
  25. package/dist/cjs/src/client/v2/indexer/models/types.js.map +1 -0
  26. package/dist/cjs/src/client/v2/indexer/searchForApplicationBoxes.js +99 -0
  27. package/dist/cjs/src/client/v2/indexer/searchForApplicationBoxes.js.map +1 -0
  28. package/dist/cjs/src/client/v2/jsonrequest.js +11 -1
  29. package/dist/cjs/src/client/v2/jsonrequest.js.map +1 -1
  30. package/dist/cjs/src/composer.js +4 -1
  31. package/dist/cjs/src/composer.js.map +1 -1
  32. package/dist/cjs/src/dryrun.js +1 -1
  33. package/dist/cjs/src/dryrun.js.map +1 -1
  34. package/dist/cjs/src/main.js +3 -2
  35. package/dist/cjs/src/main.js.map +1 -1
  36. package/dist/cjs/src/makeTxn.js +29 -14
  37. package/dist/cjs/src/makeTxn.js.map +1 -1
  38. package/dist/cjs/src/multisig.js +15 -25
  39. package/dist/cjs/src/multisig.js.map +1 -1
  40. package/dist/cjs/src/transaction.js +30 -0
  41. package/dist/cjs/src/transaction.js.map +1 -1
  42. package/dist/cjs/src/types/transactions/index.js.map +1 -1
  43. package/dist/esm/src/boxStorage.js +29 -0
  44. package/dist/esm/src/boxStorage.js.map +1 -0
  45. package/dist/esm/src/client/client.js +11 -9
  46. package/dist/esm/src/client/client.js.map +1 -1
  47. package/dist/esm/src/client/urlTokenBaseHTTPClient.js +93 -73
  48. package/dist/esm/src/client/urlTokenBaseHTTPClient.js.map +1 -1
  49. package/dist/esm/src/client/v2/algod/algod.js +38 -1
  50. package/dist/esm/src/client/v2/algod/algod.js.map +1 -1
  51. package/dist/esm/src/client/v2/algod/getApplicationBoxByName.js +38 -0
  52. package/dist/esm/src/client/v2/algod/getApplicationBoxByName.js.map +1 -0
  53. package/dist/esm/src/client/v2/algod/getApplicationBoxes.js +54 -0
  54. package/dist/esm/src/client/v2/algod/getApplicationBoxes.js.map +1 -0
  55. package/dist/esm/src/client/v2/algod/models/types.js +771 -2
  56. package/dist/esm/src/client/v2/algod/models/types.js.map +1 -1
  57. package/dist/esm/src/client/v2/{algod/models/base.js → basemodel.js} +1 -1
  58. package/dist/esm/src/client/v2/basemodel.js.map +1 -0
  59. package/dist/esm/src/client/v2/indexer/indexer.js +50 -0
  60. package/dist/esm/src/client/v2/indexer/indexer.js.map +1 -1
  61. package/dist/esm/src/client/v2/indexer/lookupApplicationBoxByIDandName.js +39 -0
  62. package/dist/esm/src/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -0
  63. package/dist/esm/src/client/v2/indexer/models/types.js +3009 -0
  64. package/dist/esm/src/client/v2/indexer/models/types.js.map +1 -0
  65. package/dist/esm/src/client/v2/indexer/searchForApplicationBoxes.js +93 -0
  66. package/dist/esm/src/client/v2/indexer/searchForApplicationBoxes.js.map +1 -0
  67. package/dist/esm/src/client/v2/jsonrequest.js +11 -1
  68. package/dist/esm/src/client/v2/jsonrequest.js.map +1 -1
  69. package/dist/esm/src/composer.js +4 -1
  70. package/dist/esm/src/composer.js.map +1 -1
  71. package/dist/esm/src/dryrun.js +1 -1
  72. package/dist/esm/src/dryrun.js.map +1 -1
  73. package/dist/esm/src/main.js +2 -0
  74. package/dist/esm/src/main.js.map +1 -1
  75. package/dist/esm/src/makeTxn.js +29 -14
  76. package/dist/esm/src/makeTxn.js.map +1 -1
  77. package/dist/esm/src/multisig.js +15 -25
  78. package/dist/esm/src/multisig.js.map +1 -1
  79. package/dist/esm/src/transaction.js +30 -0
  80. package/dist/esm/src/transaction.js.map +1 -1
  81. package/dist/esm/src/types/transactions/index.js +1 -1
  82. package/dist/esm/src/types/transactions/index.js.map +1 -1
  83. package/dist/types/src/boxStorage.d.ts +7 -0
  84. package/dist/types/src/client/client.d.ts +5 -3
  85. package/dist/types/src/client/urlTokenBaseHTTPClient.d.ts +8 -12
  86. package/dist/types/src/client/v2/algod/algod.d.ts +34 -1
  87. package/dist/types/src/client/v2/algod/getApplicationBoxByName.d.ts +28 -0
  88. package/dist/types/src/client/v2/algod/getApplicationBoxes.d.ts +43 -0
  89. package/dist/types/src/client/v2/algod/models/types.d.ts +117 -2
  90. package/dist/types/src/client/v2/{algod/models/base.d.ts → basemodel.d.ts} +0 -0
  91. package/dist/types/src/client/v2/indexer/indexer.d.ts +46 -0
  92. package/dist/types/src/client/v2/indexer/lookupApplicationBoxByIDandName.d.ts +29 -0
  93. package/dist/types/src/client/v2/indexer/models/types.d.ts +2689 -0
  94. package/dist/types/src/client/v2/indexer/searchForApplicationBoxes.d.ts +80 -0
  95. package/dist/types/src/client/v2/jsonrequest.d.ts +8 -1
  96. package/dist/types/src/composer.d.ts +4 -2
  97. package/dist/types/src/main.d.ts +1 -0
  98. package/dist/types/src/makeTxn.d.ts +22 -15
  99. package/dist/types/src/transaction.d.ts +3 -1
  100. package/dist/types/src/types/transactions/application.d.ts +3 -3
  101. package/dist/types/src/types/transactions/base.d.ts +15 -1
  102. package/dist/types/src/types/transactions/encoded.d.ts +12 -1
  103. package/dist/types/src/types/transactions/index.d.ts +1 -1
  104. package/package.json +6 -7
  105. package/dist/cjs/src/client/v2/algod/models/base.js.map +0 -1
  106. package/dist/esm/src/client/v2/algod/models/base.js.map +0 -1
@@ -6,15 +6,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6
6
  return (mod && mod.__esModule) ? mod : { "default": mod };
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.Version = exports.TransactionProofResponse = exports.TransactionParametersResponse = exports.TealValue = exports.TealKeyValue = exports.SupplyResponse = exports.StateProofMessage = exports.StateProof = exports.PostTransactionsResponse = exports.PendingTransactionsResponse = exports.PendingTransactionResponse = exports.NodeStatusResponse = exports.LightBlockHeaderProof = exports.EvalDeltaKeyValue = exports.EvalDelta = exports.ErrorResponse = exports.DryrunTxnResult = exports.DryrunState = exports.DryrunSource = exports.DryrunResponse = exports.DryrunRequest = exports.DisassembleResponse = exports.CompileResponse = exports.CatchpointStartResponse = exports.CatchpointAbortResponse = exports.BuildVersion = exports.BlockResponse = exports.AssetParams = exports.AssetHolding = exports.Asset = exports.ApplicationStateSchema = exports.ApplicationParams = exports.ApplicationLocalState = exports.Application = exports.AccountStateDelta = exports.AccountParticipation = exports.AccountAssetResponse = exports.AccountApplicationResponse = exports.Account = void 0;
9
+ exports.Version = exports.TransactionProofResponse = exports.TransactionParametersResponse = exports.TealValue = exports.TealKeyValue = exports.SupplyResponse = exports.StateProofMessage = exports.StateProof = exports.PostTransactionsResponse = exports.PendingTransactionsResponse = exports.PendingTransactionResponse = exports.NodeStatusResponse = exports.LightBlockHeaderProof = exports.EvalDeltaKeyValue = exports.EvalDelta = exports.ErrorResponse = exports.DryrunTxnResult = exports.DryrunState = exports.DryrunSource = exports.DryrunResponse = exports.DryrunRequest = exports.DisassembleResponse = exports.CompileResponse = exports.CatchpointStartResponse = exports.CatchpointAbortResponse = exports.BuildVersion = exports.BoxesResponse = exports.BoxDescriptor = exports.Box = exports.BlockResponse = exports.BlockHashResponse = exports.AssetParams = exports.AssetHolding = exports.Asset = exports.ApplicationStateSchema = exports.ApplicationParams = exports.ApplicationLocalState = exports.Application = exports.AccountStateDelta = exports.AccountParticipation = exports.AccountAssetResponse = exports.AccountApplicationResponse = exports.Account = void 0;
10
10
  /* eslint-disable no-use-before-define */
11
- const base_1 = __importDefault(require("./base"));
11
+ const basemodel_1 = __importDefault(require("../../basemodel"));
12
12
  /**
13
13
  * Account information at a given round.
14
14
  * Definition:
15
15
  * data/basics/userBalance.go : AccountData
16
16
  */
17
- class Account extends base_1.default {
17
+ class Account extends basemodel_1.default {
18
18
  /**
19
19
  * Creates a new `Account` object.
20
20
  * @param address - the account public key
@@ -62,8 +62,11 @@ class Account extends base_1.default {
62
62
  * * sig
63
63
  * * msig
64
64
  * * lsig
65
+ * @param totalBoxBytes - (tbxb) The total number of bytes used by this account's app's box keys and
66
+ * values.
67
+ * @param totalBoxes - (tbx) The number of existing boxes created by this account's app.
65
68
  */
66
- constructor({ address, amount, amountWithoutPendingRewards, minBalance, pendingRewards, rewards, round, status, totalAppsOptedIn, totalAssetsOptedIn, totalCreatedApps, totalCreatedAssets, appsLocalState, appsTotalExtraPages, appsTotalSchema, assets, authAddr, createdApps, createdAssets, participation, rewardBase, sigType, }) {
69
+ constructor({ address, amount, amountWithoutPendingRewards, minBalance, pendingRewards, rewards, round, status, totalAppsOptedIn, totalAssetsOptedIn, totalCreatedApps, totalCreatedAssets, appsLocalState, appsTotalExtraPages, appsTotalSchema, assets, authAddr, createdApps, createdAssets, participation, rewardBase, sigType, totalBoxBytes, totalBoxes, }) {
67
70
  super();
68
71
  this.address = address;
69
72
  this.amount = amount;
@@ -87,6 +90,8 @@ class Account extends base_1.default {
87
90
  this.participation = participation;
88
91
  this.rewardBase = rewardBase;
89
92
  this.sigType = sigType;
93
+ this.totalBoxBytes = totalBoxBytes;
94
+ this.totalBoxes = totalBoxes;
90
95
  this.attribute_map = {
91
96
  address: 'address',
92
97
  amount: 'amount',
@@ -110,8 +115,77 @@ class Account extends base_1.default {
110
115
  participation: 'participation',
111
116
  rewardBase: 'reward-base',
112
117
  sigType: 'sig-type',
118
+ totalBoxBytes: 'total-box-bytes',
119
+ totalBoxes: 'total-boxes',
113
120
  };
114
121
  }
122
+ // eslint-disable-next-line camelcase
123
+ static from_obj_for_encoding(data) {
124
+ /* eslint-disable dot-notation */
125
+ if (typeof data['address'] === 'undefined')
126
+ throw new Error(`Response is missing required field 'address': ${data}`);
127
+ if (typeof data['amount'] === 'undefined')
128
+ throw new Error(`Response is missing required field 'amount': ${data}`);
129
+ if (typeof data['amount-without-pending-rewards'] === 'undefined')
130
+ throw new Error(`Response is missing required field 'amount-without-pending-rewards': ${data}`);
131
+ if (typeof data['min-balance'] === 'undefined')
132
+ throw new Error(`Response is missing required field 'min-balance': ${data}`);
133
+ if (typeof data['pending-rewards'] === 'undefined')
134
+ throw new Error(`Response is missing required field 'pending-rewards': ${data}`);
135
+ if (typeof data['rewards'] === 'undefined')
136
+ throw new Error(`Response is missing required field 'rewards': ${data}`);
137
+ if (typeof data['round'] === 'undefined')
138
+ throw new Error(`Response is missing required field 'round': ${data}`);
139
+ if (typeof data['status'] === 'undefined')
140
+ throw new Error(`Response is missing required field 'status': ${data}`);
141
+ if (typeof data['total-apps-opted-in'] === 'undefined')
142
+ throw new Error(`Response is missing required field 'total-apps-opted-in': ${data}`);
143
+ if (typeof data['total-assets-opted-in'] === 'undefined')
144
+ throw new Error(`Response is missing required field 'total-assets-opted-in': ${data}`);
145
+ if (typeof data['total-created-apps'] === 'undefined')
146
+ throw new Error(`Response is missing required field 'total-created-apps': ${data}`);
147
+ if (typeof data['total-created-assets'] === 'undefined')
148
+ throw new Error(`Response is missing required field 'total-created-assets': ${data}`);
149
+ return new Account({
150
+ address: data['address'],
151
+ amount: data['amount'],
152
+ amountWithoutPendingRewards: data['amount-without-pending-rewards'],
153
+ minBalance: data['min-balance'],
154
+ pendingRewards: data['pending-rewards'],
155
+ rewards: data['rewards'],
156
+ round: data['round'],
157
+ status: data['status'],
158
+ totalAppsOptedIn: data['total-apps-opted-in'],
159
+ totalAssetsOptedIn: data['total-assets-opted-in'],
160
+ totalCreatedApps: data['total-created-apps'],
161
+ totalCreatedAssets: data['total-created-assets'],
162
+ appsLocalState: typeof data['apps-local-state'] !== 'undefined'
163
+ ? data['apps-local-state'].map(ApplicationLocalState.from_obj_for_encoding)
164
+ : undefined,
165
+ appsTotalExtraPages: data['apps-total-extra-pages'],
166
+ appsTotalSchema: typeof data['apps-total-schema'] !== 'undefined'
167
+ ? ApplicationStateSchema.from_obj_for_encoding(data['apps-total-schema'])
168
+ : undefined,
169
+ assets: typeof data['assets'] !== 'undefined'
170
+ ? data['assets'].map(AssetHolding.from_obj_for_encoding)
171
+ : undefined,
172
+ authAddr: data['auth-addr'],
173
+ createdApps: typeof data['created-apps'] !== 'undefined'
174
+ ? data['created-apps'].map(Application.from_obj_for_encoding)
175
+ : undefined,
176
+ createdAssets: typeof data['created-assets'] !== 'undefined'
177
+ ? data['created-assets'].map(Asset.from_obj_for_encoding)
178
+ : undefined,
179
+ participation: typeof data['participation'] !== 'undefined'
180
+ ? AccountParticipation.from_obj_for_encoding(data['participation'])
181
+ : undefined,
182
+ rewardBase: data['reward-base'],
183
+ sigType: data['sig-type'],
184
+ totalBoxBytes: data['total-box-bytes'],
185
+ totalBoxes: data['total-boxes'],
186
+ });
187
+ /* eslint-enable dot-notation */
188
+ }
115
189
  }
116
190
  exports.Account = Account;
117
191
  /**
@@ -120,7 +194,7 @@ exports.Account = Account;
120
194
  * application ID. Global state will only be returned if the provided address is
121
195
  * the application's creator.
122
196
  */
123
- class AccountApplicationResponse extends base_1.default {
197
+ class AccountApplicationResponse extends basemodel_1.default {
124
198
  /**
125
199
  * Creates a new `AccountApplicationResponse` object.
126
200
  * @param round - The round for which this information is relevant.
@@ -141,6 +215,18 @@ class AccountApplicationResponse extends base_1.default {
141
215
  createdApp: 'created-app',
142
216
  };
143
217
  }
218
+ // eslint-disable-next-line camelcase
219
+ static from_obj_for_encoding(data) {
220
+ /* eslint-disable dot-notation */
221
+ if (typeof data['round'] === 'undefined')
222
+ throw new Error(`Response is missing required field 'round': ${data}`);
223
+ return new AccountApplicationResponse(data['round'], typeof data['app-local-state'] !== 'undefined'
224
+ ? ApplicationLocalState.from_obj_for_encoding(data['app-local-state'])
225
+ : undefined, typeof data['created-app'] !== 'undefined'
226
+ ? ApplicationParams.from_obj_for_encoding(data['created-app'])
227
+ : undefined);
228
+ /* eslint-enable dot-notation */
229
+ }
144
230
  }
145
231
  exports.AccountApplicationResponse = AccountApplicationResponse;
146
232
  /**
@@ -148,7 +234,7 @@ exports.AccountApplicationResponse = AccountApplicationResponse;
148
234
  * (if either exist) for a specific asset ID. Asset parameters will only be
149
235
  * returned if the provided address is the asset's creator.
150
236
  */
151
- class AccountAssetResponse extends base_1.default {
237
+ class AccountAssetResponse extends basemodel_1.default {
152
238
  /**
153
239
  * Creates a new `AccountAssetResponse` object.
154
240
  * @param round - The round for which this information is relevant.
@@ -168,13 +254,25 @@ class AccountAssetResponse extends base_1.default {
168
254
  createdAsset: 'created-asset',
169
255
  };
170
256
  }
257
+ // eslint-disable-next-line camelcase
258
+ static from_obj_for_encoding(data) {
259
+ /* eslint-disable dot-notation */
260
+ if (typeof data['round'] === 'undefined')
261
+ throw new Error(`Response is missing required field 'round': ${data}`);
262
+ return new AccountAssetResponse(data['round'], typeof data['asset-holding'] !== 'undefined'
263
+ ? AssetHolding.from_obj_for_encoding(data['asset-holding'])
264
+ : undefined, typeof data['created-asset'] !== 'undefined'
265
+ ? AssetParams.from_obj_for_encoding(data['created-asset'])
266
+ : undefined);
267
+ /* eslint-enable dot-notation */
268
+ }
171
269
  }
172
270
  exports.AccountAssetResponse = AccountAssetResponse;
173
271
  /**
174
272
  * AccountParticipation describes the parameters used by this account in consensus
175
273
  * protocol.
176
274
  */
177
- class AccountParticipation extends base_1.default {
275
+ class AccountParticipation extends basemodel_1.default {
178
276
  /**
179
277
  * Creates a new `AccountParticipation` object.
180
278
  * @param selectionParticipationKey - (sel) Selection public key (if any) currently registered for this round.
@@ -211,12 +309,35 @@ class AccountParticipation extends base_1.default {
211
309
  stateProofKey: 'state-proof-key',
212
310
  };
213
311
  }
312
+ // eslint-disable-next-line camelcase
313
+ static from_obj_for_encoding(data) {
314
+ /* eslint-disable dot-notation */
315
+ if (typeof data['selection-participation-key'] === 'undefined')
316
+ throw new Error(`Response is missing required field 'selection-participation-key': ${data}`);
317
+ if (typeof data['vote-first-valid'] === 'undefined')
318
+ throw new Error(`Response is missing required field 'vote-first-valid': ${data}`);
319
+ if (typeof data['vote-key-dilution'] === 'undefined')
320
+ throw new Error(`Response is missing required field 'vote-key-dilution': ${data}`);
321
+ if (typeof data['vote-last-valid'] === 'undefined')
322
+ throw new Error(`Response is missing required field 'vote-last-valid': ${data}`);
323
+ if (typeof data['vote-participation-key'] === 'undefined')
324
+ throw new Error(`Response is missing required field 'vote-participation-key': ${data}`);
325
+ return new AccountParticipation({
326
+ selectionParticipationKey: data['selection-participation-key'],
327
+ voteFirstValid: data['vote-first-valid'],
328
+ voteKeyDilution: data['vote-key-dilution'],
329
+ voteLastValid: data['vote-last-valid'],
330
+ voteParticipationKey: data['vote-participation-key'],
331
+ stateProofKey: data['state-proof-key'],
332
+ });
333
+ /* eslint-enable dot-notation */
334
+ }
214
335
  }
215
336
  exports.AccountParticipation = AccountParticipation;
216
337
  /**
217
338
  * Application state delta.
218
339
  */
219
- class AccountStateDelta extends base_1.default {
340
+ class AccountStateDelta extends basemodel_1.default {
220
341
  /**
221
342
  * Creates a new `AccountStateDelta` object.
222
343
  * @param address -
@@ -231,12 +352,22 @@ class AccountStateDelta extends base_1.default {
231
352
  delta: 'delta',
232
353
  };
233
354
  }
355
+ // eslint-disable-next-line camelcase
356
+ static from_obj_for_encoding(data) {
357
+ /* eslint-disable dot-notation */
358
+ if (typeof data['address'] === 'undefined')
359
+ throw new Error(`Response is missing required field 'address': ${data}`);
360
+ if (!Array.isArray(data['delta']))
361
+ throw new Error(`Response is missing required array field 'delta': ${data}`);
362
+ return new AccountStateDelta(data['address'], data['delta'].map(EvalDeltaKeyValue.from_obj_for_encoding));
363
+ /* eslint-enable dot-notation */
364
+ }
234
365
  }
235
366
  exports.AccountStateDelta = AccountStateDelta;
236
367
  /**
237
368
  * Application index and its parameters
238
369
  */
239
- class Application extends base_1.default {
370
+ class Application extends basemodel_1.default {
240
371
  /**
241
372
  * Creates a new `Application` object.
242
373
  * @param id - (appidx) application index.
@@ -251,12 +382,22 @@ class Application extends base_1.default {
251
382
  params: 'params',
252
383
  };
253
384
  }
385
+ // eslint-disable-next-line camelcase
386
+ static from_obj_for_encoding(data) {
387
+ /* eslint-disable dot-notation */
388
+ if (typeof data['id'] === 'undefined')
389
+ throw new Error(`Response is missing required field 'id': ${data}`);
390
+ if (typeof data['params'] === 'undefined')
391
+ throw new Error(`Response is missing required field 'params': ${data}`);
392
+ return new Application(data['id'], ApplicationParams.from_obj_for_encoding(data['params']));
393
+ /* eslint-enable dot-notation */
394
+ }
254
395
  }
255
396
  exports.Application = Application;
256
397
  /**
257
398
  * Stores local state associated with an application.
258
399
  */
259
- class ApplicationLocalState extends base_1.default {
400
+ class ApplicationLocalState extends basemodel_1.default {
260
401
  /**
261
402
  * Creates a new `ApplicationLocalState` object.
262
403
  * @param id - The application which this local state is for.
@@ -274,12 +415,24 @@ class ApplicationLocalState extends base_1.default {
274
415
  keyValue: 'key-value',
275
416
  };
276
417
  }
418
+ // eslint-disable-next-line camelcase
419
+ static from_obj_for_encoding(data) {
420
+ /* eslint-disable dot-notation */
421
+ if (typeof data['id'] === 'undefined')
422
+ throw new Error(`Response is missing required field 'id': ${data}`);
423
+ if (typeof data['schema'] === 'undefined')
424
+ throw new Error(`Response is missing required field 'schema': ${data}`);
425
+ return new ApplicationLocalState(data['id'], ApplicationStateSchema.from_obj_for_encoding(data['schema']), typeof data['key-value'] !== 'undefined'
426
+ ? data['key-value'].map(TealKeyValue.from_obj_for_encoding)
427
+ : undefined);
428
+ /* eslint-enable dot-notation */
429
+ }
277
430
  }
278
431
  exports.ApplicationLocalState = ApplicationLocalState;
279
432
  /**
280
433
  * Stores the global information associated with an application.
281
434
  */
282
- class ApplicationParams extends base_1.default {
435
+ class ApplicationParams extends basemodel_1.default {
283
436
  /**
284
437
  * Creates a new `ApplicationParams` object.
285
438
  * @param approvalProgram - (approv) approval program.
@@ -316,12 +469,38 @@ class ApplicationParams extends base_1.default {
316
469
  localStateSchema: 'local-state-schema',
317
470
  };
318
471
  }
472
+ // eslint-disable-next-line camelcase
473
+ static from_obj_for_encoding(data) {
474
+ /* eslint-disable dot-notation */
475
+ if (typeof data['approval-program'] === 'undefined')
476
+ throw new Error(`Response is missing required field 'approval-program': ${data}`);
477
+ if (typeof data['clear-state-program'] === 'undefined')
478
+ throw new Error(`Response is missing required field 'clear-state-program': ${data}`);
479
+ if (typeof data['creator'] === 'undefined')
480
+ throw new Error(`Response is missing required field 'creator': ${data}`);
481
+ return new ApplicationParams({
482
+ approvalProgram: data['approval-program'],
483
+ clearStateProgram: data['clear-state-program'],
484
+ creator: data['creator'],
485
+ extraProgramPages: data['extra-program-pages'],
486
+ globalState: typeof data['global-state'] !== 'undefined'
487
+ ? data['global-state'].map(TealKeyValue.from_obj_for_encoding)
488
+ : undefined,
489
+ globalStateSchema: typeof data['global-state-schema'] !== 'undefined'
490
+ ? ApplicationStateSchema.from_obj_for_encoding(data['global-state-schema'])
491
+ : undefined,
492
+ localStateSchema: typeof data['local-state-schema'] !== 'undefined'
493
+ ? ApplicationStateSchema.from_obj_for_encoding(data['local-state-schema'])
494
+ : undefined,
495
+ });
496
+ /* eslint-enable dot-notation */
497
+ }
319
498
  }
320
499
  exports.ApplicationParams = ApplicationParams;
321
500
  /**
322
501
  * Specifies maximums on the number of each type that may be stored.
323
502
  */
324
- class ApplicationStateSchema extends base_1.default {
503
+ class ApplicationStateSchema extends basemodel_1.default {
325
504
  /**
326
505
  * Creates a new `ApplicationStateSchema` object.
327
506
  * @param numUint - (nui) num of uints.
@@ -336,12 +515,22 @@ class ApplicationStateSchema extends base_1.default {
336
515
  numByteSlice: 'num-byte-slice',
337
516
  };
338
517
  }
518
+ // eslint-disable-next-line camelcase
519
+ static from_obj_for_encoding(data) {
520
+ /* eslint-disable dot-notation */
521
+ if (typeof data['num-uint'] === 'undefined')
522
+ throw new Error(`Response is missing required field 'num-uint': ${data}`);
523
+ if (typeof data['num-byte-slice'] === 'undefined')
524
+ throw new Error(`Response is missing required field 'num-byte-slice': ${data}`);
525
+ return new ApplicationStateSchema(data['num-uint'], data['num-byte-slice']);
526
+ /* eslint-enable dot-notation */
527
+ }
339
528
  }
340
529
  exports.ApplicationStateSchema = ApplicationStateSchema;
341
530
  /**
342
531
  * Specifies both the unique identifier and the parameters for an asset
343
532
  */
344
- class Asset extends base_1.default {
533
+ class Asset extends basemodel_1.default {
345
534
  /**
346
535
  * Creates a new `Asset` object.
347
536
  * @param index - unique asset identifier
@@ -359,6 +548,16 @@ class Asset extends base_1.default {
359
548
  params: 'params',
360
549
  };
361
550
  }
551
+ // eslint-disable-next-line camelcase
552
+ static from_obj_for_encoding(data) {
553
+ /* eslint-disable dot-notation */
554
+ if (typeof data['index'] === 'undefined')
555
+ throw new Error(`Response is missing required field 'index': ${data}`);
556
+ if (typeof data['params'] === 'undefined')
557
+ throw new Error(`Response is missing required field 'params': ${data}`);
558
+ return new Asset(data['index'], AssetParams.from_obj_for_encoding(data['params']));
559
+ /* eslint-enable dot-notation */
560
+ }
362
561
  }
363
562
  exports.Asset = Asset;
364
563
  /**
@@ -366,7 +565,7 @@ exports.Asset = Asset;
366
565
  * Definition:
367
566
  * data/basics/userBalance.go : AssetHolding
368
567
  */
369
- class AssetHolding extends base_1.default {
568
+ class AssetHolding extends basemodel_1.default {
370
569
  /**
371
570
  * Creates a new `AssetHolding` object.
372
571
  * @param amount - (a) number of units held.
@@ -384,6 +583,18 @@ class AssetHolding extends base_1.default {
384
583
  isFrozen: 'is-frozen',
385
584
  };
386
585
  }
586
+ // eslint-disable-next-line camelcase
587
+ static from_obj_for_encoding(data) {
588
+ /* eslint-disable dot-notation */
589
+ if (typeof data['amount'] === 'undefined')
590
+ throw new Error(`Response is missing required field 'amount': ${data}`);
591
+ if (typeof data['asset-id'] === 'undefined')
592
+ throw new Error(`Response is missing required field 'asset-id': ${data}`);
593
+ if (typeof data['is-frozen'] === 'undefined')
594
+ throw new Error(`Response is missing required field 'is-frozen': ${data}`);
595
+ return new AssetHolding(data['amount'], data['asset-id'], data['is-frozen']);
596
+ /* eslint-enable dot-notation */
597
+ }
387
598
  }
388
599
  exports.AssetHolding = AssetHolding;
389
600
  /**
@@ -392,7 +603,7 @@ exports.AssetHolding = AssetHolding;
392
603
  * Definition:
393
604
  * data/transactions/asset.go : AssetParams
394
605
  */
395
- class AssetParams extends base_1.default {
606
+ class AssetParams extends basemodel_1.default {
396
607
  /**
397
608
  * Creates a new `AssetParams` object.
398
609
  * @param creator - The address that created this asset. This is the address where the parameters
@@ -469,12 +680,65 @@ class AssetParams extends base_1.default {
469
680
  urlB64: 'url-b64',
470
681
  };
471
682
  }
683
+ // eslint-disable-next-line camelcase
684
+ static from_obj_for_encoding(data) {
685
+ /* eslint-disable dot-notation */
686
+ if (typeof data['creator'] === 'undefined')
687
+ throw new Error(`Response is missing required field 'creator': ${data}`);
688
+ if (typeof data['decimals'] === 'undefined')
689
+ throw new Error(`Response is missing required field 'decimals': ${data}`);
690
+ if (typeof data['total'] === 'undefined')
691
+ throw new Error(`Response is missing required field 'total': ${data}`);
692
+ return new AssetParams({
693
+ creator: data['creator'],
694
+ decimals: data['decimals'],
695
+ total: data['total'],
696
+ clawback: data['clawback'],
697
+ defaultFrozen: data['default-frozen'],
698
+ freeze: data['freeze'],
699
+ manager: data['manager'],
700
+ metadataHash: data['metadata-hash'],
701
+ name: data['name'],
702
+ nameB64: data['name-b64'],
703
+ reserve: data['reserve'],
704
+ unitName: data['unit-name'],
705
+ unitNameB64: data['unit-name-b64'],
706
+ url: data['url'],
707
+ urlB64: data['url-b64'],
708
+ });
709
+ /* eslint-enable dot-notation */
710
+ }
472
711
  }
473
712
  exports.AssetParams = AssetParams;
713
+ /**
714
+ * Hash of a block header.
715
+ */
716
+ class BlockHashResponse extends basemodel_1.default {
717
+ /**
718
+ * Creates a new `BlockHashResponse` object.
719
+ * @param blockhash - Block header hash.
720
+ */
721
+ constructor(blockhash) {
722
+ super();
723
+ this.blockhash = blockhash;
724
+ this.attribute_map = {
725
+ blockhash: 'blockHash',
726
+ };
727
+ }
728
+ // eslint-disable-next-line camelcase
729
+ static from_obj_for_encoding(data) {
730
+ /* eslint-disable dot-notation */
731
+ if (typeof data['blockHash'] === 'undefined')
732
+ throw new Error(`Response is missing required field 'blockHash': ${data}`);
733
+ return new BlockHashResponse(data['blockHash']);
734
+ /* eslint-enable dot-notation */
735
+ }
736
+ }
737
+ exports.BlockHashResponse = BlockHashResponse;
474
738
  /**
475
739
  * Encoded block object.
476
740
  */
477
- class BlockResponse extends base_1.default {
741
+ class BlockResponse extends basemodel_1.default {
478
742
  /**
479
743
  * Creates a new `BlockResponse` object.
480
744
  * @param block - Block header data.
@@ -490,9 +754,106 @@ class BlockResponse extends base_1.default {
490
754
  cert: 'cert',
491
755
  };
492
756
  }
757
+ // eslint-disable-next-line camelcase
758
+ static from_obj_for_encoding(data) {
759
+ /* eslint-disable dot-notation */
760
+ if (typeof data['block'] === 'undefined')
761
+ throw new Error(`Response is missing required field 'block': ${data}`);
762
+ return new BlockResponse(data['block'], data['cert']);
763
+ /* eslint-enable dot-notation */
764
+ }
493
765
  }
494
766
  exports.BlockResponse = BlockResponse;
495
- class BuildVersion extends base_1.default {
767
+ /**
768
+ * Box name and its content.
769
+ */
770
+ class Box extends basemodel_1.default {
771
+ /**
772
+ * Creates a new `Box` object.
773
+ * @param name - (name) box name, base64 encoded
774
+ * @param value - (value) box value, base64 encoded.
775
+ */
776
+ constructor(name, value) {
777
+ super();
778
+ this.name =
779
+ typeof name === 'string'
780
+ ? new Uint8Array(Buffer.from(name, 'base64'))
781
+ : name;
782
+ this.value =
783
+ typeof value === 'string'
784
+ ? new Uint8Array(Buffer.from(value, 'base64'))
785
+ : value;
786
+ this.attribute_map = {
787
+ name: 'name',
788
+ value: 'value',
789
+ };
790
+ }
791
+ // eslint-disable-next-line camelcase
792
+ static from_obj_for_encoding(data) {
793
+ /* eslint-disable dot-notation */
794
+ if (typeof data['name'] === 'undefined')
795
+ throw new Error(`Response is missing required field 'name': ${data}`);
796
+ if (typeof data['value'] === 'undefined')
797
+ throw new Error(`Response is missing required field 'value': ${data}`);
798
+ return new Box(data['name'], data['value']);
799
+ /* eslint-enable dot-notation */
800
+ }
801
+ }
802
+ exports.Box = Box;
803
+ /**
804
+ * Box descriptor describes a Box.
805
+ */
806
+ class BoxDescriptor extends basemodel_1.default {
807
+ /**
808
+ * Creates a new `BoxDescriptor` object.
809
+ * @param name - Base64 encoded box name
810
+ */
811
+ constructor(name) {
812
+ super();
813
+ this.name =
814
+ typeof name === 'string'
815
+ ? new Uint8Array(Buffer.from(name, 'base64'))
816
+ : name;
817
+ this.attribute_map = {
818
+ name: 'name',
819
+ };
820
+ }
821
+ // eslint-disable-next-line camelcase
822
+ static from_obj_for_encoding(data) {
823
+ /* eslint-disable dot-notation */
824
+ if (typeof data['name'] === 'undefined')
825
+ throw new Error(`Response is missing required field 'name': ${data}`);
826
+ return new BoxDescriptor(data['name']);
827
+ /* eslint-enable dot-notation */
828
+ }
829
+ }
830
+ exports.BoxDescriptor = BoxDescriptor;
831
+ /**
832
+ * Box names of an application
833
+ */
834
+ class BoxesResponse extends basemodel_1.default {
835
+ /**
836
+ * Creates a new `BoxesResponse` object.
837
+ * @param boxes -
838
+ */
839
+ constructor(boxes) {
840
+ super();
841
+ this.boxes = boxes;
842
+ this.attribute_map = {
843
+ boxes: 'boxes',
844
+ };
845
+ }
846
+ // eslint-disable-next-line camelcase
847
+ static from_obj_for_encoding(data) {
848
+ /* eslint-disable dot-notation */
849
+ if (!Array.isArray(data['boxes']))
850
+ throw new Error(`Response is missing required array field 'boxes': ${data}`);
851
+ return new BoxesResponse(data['boxes'].map(BoxDescriptor.from_obj_for_encoding));
852
+ /* eslint-enable dot-notation */
853
+ }
854
+ }
855
+ exports.BoxesResponse = BoxesResponse;
856
+ class BuildVersion extends basemodel_1.default {
496
857
  /**
497
858
  * Creates a new `BuildVersion` object.
498
859
  * @param branch -
@@ -519,12 +880,37 @@ class BuildVersion extends base_1.default {
519
880
  minor: 'minor',
520
881
  };
521
882
  }
883
+ // eslint-disable-next-line camelcase
884
+ static from_obj_for_encoding(data) {
885
+ /* eslint-disable dot-notation */
886
+ if (typeof data['branch'] === 'undefined')
887
+ throw new Error(`Response is missing required field 'branch': ${data}`);
888
+ if (typeof data['build_number'] === 'undefined')
889
+ throw new Error(`Response is missing required field 'build_number': ${data}`);
890
+ if (typeof data['channel'] === 'undefined')
891
+ throw new Error(`Response is missing required field 'channel': ${data}`);
892
+ if (typeof data['commit_hash'] === 'undefined')
893
+ throw new Error(`Response is missing required field 'commit_hash': ${data}`);
894
+ if (typeof data['major'] === 'undefined')
895
+ throw new Error(`Response is missing required field 'major': ${data}`);
896
+ if (typeof data['minor'] === 'undefined')
897
+ throw new Error(`Response is missing required field 'minor': ${data}`);
898
+ return new BuildVersion({
899
+ branch: data['branch'],
900
+ buildNumber: data['build_number'],
901
+ channel: data['channel'],
902
+ commitHash: data['commit_hash'],
903
+ major: data['major'],
904
+ minor: data['minor'],
905
+ });
906
+ /* eslint-enable dot-notation */
907
+ }
522
908
  }
523
909
  exports.BuildVersion = BuildVersion;
524
910
  /**
525
911
  *
526
912
  */
527
- class CatchpointAbortResponse extends base_1.default {
913
+ class CatchpointAbortResponse extends basemodel_1.default {
528
914
  /**
529
915
  * Creates a new `CatchpointAbortResponse` object.
530
916
  * @param catchupMessage - Catchup abort response string
@@ -536,12 +922,20 @@ class CatchpointAbortResponse extends base_1.default {
536
922
  catchupMessage: 'catchup-message',
537
923
  };
538
924
  }
925
+ // eslint-disable-next-line camelcase
926
+ static from_obj_for_encoding(data) {
927
+ /* eslint-disable dot-notation */
928
+ if (typeof data['catchup-message'] === 'undefined')
929
+ throw new Error(`Response is missing required field 'catchup-message': ${data}`);
930
+ return new CatchpointAbortResponse(data['catchup-message']);
931
+ /* eslint-enable dot-notation */
932
+ }
539
933
  }
540
934
  exports.CatchpointAbortResponse = CatchpointAbortResponse;
541
935
  /**
542
936
  *
543
937
  */
544
- class CatchpointStartResponse extends base_1.default {
938
+ class CatchpointStartResponse extends basemodel_1.default {
545
939
  /**
546
940
  * Creates a new `CatchpointStartResponse` object.
547
941
  * @param catchupMessage - Catchup start response string
@@ -553,12 +947,20 @@ class CatchpointStartResponse extends base_1.default {
553
947
  catchupMessage: 'catchup-message',
554
948
  };
555
949
  }
950
+ // eslint-disable-next-line camelcase
951
+ static from_obj_for_encoding(data) {
952
+ /* eslint-disable dot-notation */
953
+ if (typeof data['catchup-message'] === 'undefined')
954
+ throw new Error(`Response is missing required field 'catchup-message': ${data}`);
955
+ return new CatchpointStartResponse(data['catchup-message']);
956
+ /* eslint-enable dot-notation */
957
+ }
556
958
  }
557
959
  exports.CatchpointStartResponse = CatchpointStartResponse;
558
960
  /**
559
961
  * Teal compile Result
560
962
  */
561
- class CompileResponse extends base_1.default {
963
+ class CompileResponse extends basemodel_1.default {
562
964
  /**
563
965
  * Creates a new `CompileResponse` object.
564
966
  * @param hash - base32 SHA512_256 of program bytes (Address style)
@@ -576,12 +978,22 @@ class CompileResponse extends base_1.default {
576
978
  sourcemap: 'sourcemap',
577
979
  };
578
980
  }
981
+ // eslint-disable-next-line camelcase
982
+ static from_obj_for_encoding(data) {
983
+ /* eslint-disable dot-notation */
984
+ if (typeof data['hash'] === 'undefined')
985
+ throw new Error(`Response is missing required field 'hash': ${data}`);
986
+ if (typeof data['result'] === 'undefined')
987
+ throw new Error(`Response is missing required field 'result': ${data}`);
988
+ return new CompileResponse(data['hash'], data['result'], data['sourcemap']);
989
+ /* eslint-enable dot-notation */
990
+ }
579
991
  }
580
992
  exports.CompileResponse = CompileResponse;
581
993
  /**
582
994
  * Teal disassembly Result
583
995
  */
584
- class DisassembleResponse extends base_1.default {
996
+ class DisassembleResponse extends basemodel_1.default {
585
997
  /**
586
998
  * Creates a new `DisassembleResponse` object.
587
999
  * @param result - disassembled Teal code
@@ -593,13 +1005,21 @@ class DisassembleResponse extends base_1.default {
593
1005
  result: 'result',
594
1006
  };
595
1007
  }
1008
+ // eslint-disable-next-line camelcase
1009
+ static from_obj_for_encoding(data) {
1010
+ /* eslint-disable dot-notation */
1011
+ if (typeof data['result'] === 'undefined')
1012
+ throw new Error(`Response is missing required field 'result': ${data}`);
1013
+ return new DisassembleResponse(data['result']);
1014
+ /* eslint-enable dot-notation */
1015
+ }
596
1016
  }
597
1017
  exports.DisassembleResponse = DisassembleResponse;
598
1018
  /**
599
1019
  * Request data type for dryrun endpoint. Given the Transactions and simulated
600
1020
  * ledger state upload, run TEAL scripts and return debugging information.
601
1021
  */
602
- class DryrunRequest extends base_1.default {
1022
+ class DryrunRequest extends basemodel_1.default {
603
1023
  /**
604
1024
  * Creates a new `DryrunRequest` object.
605
1025
  * @param accounts -
@@ -632,12 +1052,40 @@ class DryrunRequest extends base_1.default {
632
1052
  txns: 'txns',
633
1053
  };
634
1054
  }
1055
+ // eslint-disable-next-line camelcase
1056
+ static from_obj_for_encoding(data) {
1057
+ /* eslint-disable dot-notation */
1058
+ if (!Array.isArray(data['accounts']))
1059
+ throw new Error(`Response is missing required array field 'accounts': ${data}`);
1060
+ if (!Array.isArray(data['apps']))
1061
+ throw new Error(`Response is missing required array field 'apps': ${data}`);
1062
+ if (typeof data['latest-timestamp'] === 'undefined')
1063
+ throw new Error(`Response is missing required field 'latest-timestamp': ${data}`);
1064
+ if (typeof data['protocol-version'] === 'undefined')
1065
+ throw new Error(`Response is missing required field 'protocol-version': ${data}`);
1066
+ if (typeof data['round'] === 'undefined')
1067
+ throw new Error(`Response is missing required field 'round': ${data}`);
1068
+ if (!Array.isArray(data['sources']))
1069
+ throw new Error(`Response is missing required array field 'sources': ${data}`);
1070
+ if (!Array.isArray(data['txns']))
1071
+ throw new Error(`Response is missing required array field 'txns': ${data}`);
1072
+ return new DryrunRequest({
1073
+ accounts: data['accounts'].map(Account.from_obj_for_encoding),
1074
+ apps: data['apps'].map(Application.from_obj_for_encoding),
1075
+ latestTimestamp: data['latest-timestamp'],
1076
+ protocolVersion: data['protocol-version'],
1077
+ round: data['round'],
1078
+ sources: data['sources'].map(DryrunSource.from_obj_for_encoding),
1079
+ txns: data['txns'],
1080
+ });
1081
+ /* eslint-enable dot-notation */
1082
+ }
635
1083
  }
636
1084
  exports.DryrunRequest = DryrunRequest;
637
1085
  /**
638
1086
  * DryrunResponse contains per-txn debug information from a dryrun.
639
1087
  */
640
- class DryrunResponse extends base_1.default {
1088
+ class DryrunResponse extends basemodel_1.default {
641
1089
  /**
642
1090
  * Creates a new `DryrunResponse` object.
643
1091
  * @param error -
@@ -655,13 +1103,25 @@ class DryrunResponse extends base_1.default {
655
1103
  txns: 'txns',
656
1104
  };
657
1105
  }
1106
+ // eslint-disable-next-line camelcase
1107
+ static from_obj_for_encoding(data) {
1108
+ /* eslint-disable dot-notation */
1109
+ if (typeof data['error'] === 'undefined')
1110
+ throw new Error(`Response is missing required field 'error': ${data}`);
1111
+ if (typeof data['protocol-version'] === 'undefined')
1112
+ throw new Error(`Response is missing required field 'protocol-version': ${data}`);
1113
+ if (!Array.isArray(data['txns']))
1114
+ throw new Error(`Response is missing required array field 'txns': ${data}`);
1115
+ return new DryrunResponse(data['error'], data['protocol-version'], data['txns'].map(DryrunTxnResult.from_obj_for_encoding));
1116
+ /* eslint-enable dot-notation */
1117
+ }
658
1118
  }
659
1119
  exports.DryrunResponse = DryrunResponse;
660
1120
  /**
661
1121
  * DryrunSource is TEAL source text that gets uploaded, compiled, and inserted into
662
1122
  * transactions or application state.
663
1123
  */
664
- class DryrunSource extends base_1.default {
1124
+ class DryrunSource extends basemodel_1.default {
665
1125
  /**
666
1126
  * Creates a new `DryrunSource` object.
667
1127
  * @param fieldName - FieldName is what kind of sources this is. If lsig then it goes into the
@@ -684,12 +1144,26 @@ class DryrunSource extends base_1.default {
684
1144
  appIndex: 'app-index',
685
1145
  };
686
1146
  }
1147
+ // eslint-disable-next-line camelcase
1148
+ static from_obj_for_encoding(data) {
1149
+ /* eslint-disable dot-notation */
1150
+ if (typeof data['field-name'] === 'undefined')
1151
+ throw new Error(`Response is missing required field 'field-name': ${data}`);
1152
+ if (typeof data['source'] === 'undefined')
1153
+ throw new Error(`Response is missing required field 'source': ${data}`);
1154
+ if (typeof data['txn-index'] === 'undefined')
1155
+ throw new Error(`Response is missing required field 'txn-index': ${data}`);
1156
+ if (typeof data['app-index'] === 'undefined')
1157
+ throw new Error(`Response is missing required field 'app-index': ${data}`);
1158
+ return new DryrunSource(data['field-name'], data['source'], data['txn-index'], data['app-index']);
1159
+ /* eslint-enable dot-notation */
1160
+ }
687
1161
  }
688
1162
  exports.DryrunSource = DryrunSource;
689
1163
  /**
690
1164
  * Stores the TEAL eval step data
691
1165
  */
692
- class DryrunState extends base_1.default {
1166
+ class DryrunState extends basemodel_1.default {
693
1167
  /**
694
1168
  * Creates a new `DryrunState` object.
695
1169
  * @param line - Line number
@@ -713,13 +1187,33 @@ class DryrunState extends base_1.default {
713
1187
  scratch: 'scratch',
714
1188
  };
715
1189
  }
1190
+ // eslint-disable-next-line camelcase
1191
+ static from_obj_for_encoding(data) {
1192
+ /* eslint-disable dot-notation */
1193
+ if (typeof data['line'] === 'undefined')
1194
+ throw new Error(`Response is missing required field 'line': ${data}`);
1195
+ if (typeof data['pc'] === 'undefined')
1196
+ throw new Error(`Response is missing required field 'pc': ${data}`);
1197
+ if (!Array.isArray(data['stack']))
1198
+ throw new Error(`Response is missing required array field 'stack': ${data}`);
1199
+ return new DryrunState({
1200
+ line: data['line'],
1201
+ pc: data['pc'],
1202
+ stack: data['stack'].map(TealValue.from_obj_for_encoding),
1203
+ error: data['error'],
1204
+ scratch: typeof data['scratch'] !== 'undefined'
1205
+ ? data['scratch'].map(TealValue.from_obj_for_encoding)
1206
+ : undefined,
1207
+ });
1208
+ /* eslint-enable dot-notation */
1209
+ }
716
1210
  }
717
1211
  exports.DryrunState = DryrunState;
718
1212
  /**
719
1213
  * DryrunTxnResult contains any LogicSig or ApplicationCall program debug
720
1214
  * information and state updates from a dryrun.
721
1215
  */
722
- class DryrunTxnResult extends base_1.default {
1216
+ class DryrunTxnResult extends basemodel_1.default {
723
1217
  /**
724
1218
  * Creates a new `DryrunTxnResult` object.
725
1219
  * @param disassembly - Disassembled program line by line.
@@ -765,12 +1259,41 @@ class DryrunTxnResult extends base_1.default {
765
1259
  logs: 'logs',
766
1260
  };
767
1261
  }
1262
+ // eslint-disable-next-line camelcase
1263
+ static from_obj_for_encoding(data) {
1264
+ /* eslint-disable dot-notation */
1265
+ if (!Array.isArray(data['disassembly']))
1266
+ throw new Error(`Response is missing required array field 'disassembly': ${data}`);
1267
+ return new DryrunTxnResult({
1268
+ disassembly: data['disassembly'],
1269
+ appCallMessages: data['app-call-messages'],
1270
+ appCallTrace: typeof data['app-call-trace'] !== 'undefined'
1271
+ ? data['app-call-trace'].map(DryrunState.from_obj_for_encoding)
1272
+ : undefined,
1273
+ budgetAdded: data['budget-added'],
1274
+ budgetConsumed: data['budget-consumed'],
1275
+ cost: data['cost'],
1276
+ globalDelta: typeof data['global-delta'] !== 'undefined'
1277
+ ? data['global-delta'].map(EvalDeltaKeyValue.from_obj_for_encoding)
1278
+ : undefined,
1279
+ localDeltas: typeof data['local-deltas'] !== 'undefined'
1280
+ ? data['local-deltas'].map(AccountStateDelta.from_obj_for_encoding)
1281
+ : undefined,
1282
+ logicSigDisassembly: data['logic-sig-disassembly'],
1283
+ logicSigMessages: data['logic-sig-messages'],
1284
+ logicSigTrace: typeof data['logic-sig-trace'] !== 'undefined'
1285
+ ? data['logic-sig-trace'].map(DryrunState.from_obj_for_encoding)
1286
+ : undefined,
1287
+ logs: data['logs'],
1288
+ });
1289
+ /* eslint-enable dot-notation */
1290
+ }
768
1291
  }
769
1292
  exports.DryrunTxnResult = DryrunTxnResult;
770
1293
  /**
771
1294
  * An error response with optional data field.
772
1295
  */
773
- class ErrorResponse extends base_1.default {
1296
+ class ErrorResponse extends basemodel_1.default {
774
1297
  /**
775
1298
  * Creates a new `ErrorResponse` object.
776
1299
  * @param message -
@@ -785,12 +1308,20 @@ class ErrorResponse extends base_1.default {
785
1308
  data: 'data',
786
1309
  };
787
1310
  }
1311
+ // eslint-disable-next-line camelcase
1312
+ static from_obj_for_encoding(data) {
1313
+ /* eslint-disable dot-notation */
1314
+ if (typeof data['message'] === 'undefined')
1315
+ throw new Error(`Response is missing required field 'message': ${data}`);
1316
+ return new ErrorResponse(data['message'], data['data']);
1317
+ /* eslint-enable dot-notation */
1318
+ }
788
1319
  }
789
1320
  exports.ErrorResponse = ErrorResponse;
790
1321
  /**
791
1322
  * Represents a TEAL value delta.
792
1323
  */
793
- class EvalDelta extends base_1.default {
1324
+ class EvalDelta extends basemodel_1.default {
794
1325
  /**
795
1326
  * Creates a new `EvalDelta` object.
796
1327
  * @param action - (at) delta action.
@@ -808,12 +1339,20 @@ class EvalDelta extends base_1.default {
808
1339
  uint: 'uint',
809
1340
  };
810
1341
  }
1342
+ // eslint-disable-next-line camelcase
1343
+ static from_obj_for_encoding(data) {
1344
+ /* eslint-disable dot-notation */
1345
+ if (typeof data['action'] === 'undefined')
1346
+ throw new Error(`Response is missing required field 'action': ${data}`);
1347
+ return new EvalDelta(data['action'], data['bytes'], data['uint']);
1348
+ /* eslint-enable dot-notation */
1349
+ }
811
1350
  }
812
1351
  exports.EvalDelta = EvalDelta;
813
1352
  /**
814
1353
  * Key-value pairs for StateDelta.
815
1354
  */
816
- class EvalDeltaKeyValue extends base_1.default {
1355
+ class EvalDeltaKeyValue extends basemodel_1.default {
817
1356
  /**
818
1357
  * Creates a new `EvalDeltaKeyValue` object.
819
1358
  * @param key -
@@ -828,12 +1367,22 @@ class EvalDeltaKeyValue extends base_1.default {
828
1367
  value: 'value',
829
1368
  };
830
1369
  }
1370
+ // eslint-disable-next-line camelcase
1371
+ static from_obj_for_encoding(data) {
1372
+ /* eslint-disable dot-notation */
1373
+ if (typeof data['key'] === 'undefined')
1374
+ throw new Error(`Response is missing required field 'key': ${data}`);
1375
+ if (typeof data['value'] === 'undefined')
1376
+ throw new Error(`Response is missing required field 'value': ${data}`);
1377
+ return new EvalDeltaKeyValue(data['key'], EvalDelta.from_obj_for_encoding(data['value']));
1378
+ /* eslint-enable dot-notation */
1379
+ }
831
1380
  }
832
1381
  exports.EvalDeltaKeyValue = EvalDeltaKeyValue;
833
1382
  /**
834
1383
  * Proof of membership and position of a light block header.
835
1384
  */
836
- class LightBlockHeaderProof extends base_1.default {
1385
+ class LightBlockHeaderProof extends basemodel_1.default {
837
1386
  /**
838
1387
  * Creates a new `LightBlockHeaderProof` object.
839
1388
  * @param index - The index of the light block header in the vector commitment tree
@@ -855,12 +1404,24 @@ class LightBlockHeaderProof extends base_1.default {
855
1404
  treedepth: 'treedepth',
856
1405
  };
857
1406
  }
1407
+ // eslint-disable-next-line camelcase
1408
+ static from_obj_for_encoding(data) {
1409
+ /* eslint-disable dot-notation */
1410
+ if (typeof data['index'] === 'undefined')
1411
+ throw new Error(`Response is missing required field 'index': ${data}`);
1412
+ if (typeof data['proof'] === 'undefined')
1413
+ throw new Error(`Response is missing required field 'proof': ${data}`);
1414
+ if (typeof data['treedepth'] === 'undefined')
1415
+ throw new Error(`Response is missing required field 'treedepth': ${data}`);
1416
+ return new LightBlockHeaderProof(data['index'], data['proof'], data['treedepth']);
1417
+ /* eslint-enable dot-notation */
1418
+ }
858
1419
  }
859
1420
  exports.LightBlockHeaderProof = LightBlockHeaderProof;
860
1421
  /**
861
1422
  *
862
1423
  */
863
- class NodeStatusResponse extends base_1.default {
1424
+ class NodeStatusResponse extends basemodel_1.default {
864
1425
  /**
865
1426
  * Creates a new `NodeStatusResponse` object.
866
1427
  * @param catchupTime - CatchupTime in nanoseconds
@@ -920,13 +1481,51 @@ class NodeStatusResponse extends base_1.default {
920
1481
  lastCatchpoint: 'last-catchpoint',
921
1482
  };
922
1483
  }
1484
+ // eslint-disable-next-line camelcase
1485
+ static from_obj_for_encoding(data) {
1486
+ /* eslint-disable dot-notation */
1487
+ if (typeof data['catchup-time'] === 'undefined')
1488
+ throw new Error(`Response is missing required field 'catchup-time': ${data}`);
1489
+ if (typeof data['last-round'] === 'undefined')
1490
+ throw new Error(`Response is missing required field 'last-round': ${data}`);
1491
+ if (typeof data['last-version'] === 'undefined')
1492
+ throw new Error(`Response is missing required field 'last-version': ${data}`);
1493
+ if (typeof data['next-version'] === 'undefined')
1494
+ throw new Error(`Response is missing required field 'next-version': ${data}`);
1495
+ if (typeof data['next-version-round'] === 'undefined')
1496
+ throw new Error(`Response is missing required field 'next-version-round': ${data}`);
1497
+ if (typeof data['next-version-supported'] === 'undefined')
1498
+ throw new Error(`Response is missing required field 'next-version-supported': ${data}`);
1499
+ if (typeof data['stopped-at-unsupported-round'] === 'undefined')
1500
+ throw new Error(`Response is missing required field 'stopped-at-unsupported-round': ${data}`);
1501
+ if (typeof data['time-since-last-round'] === 'undefined')
1502
+ throw new Error(`Response is missing required field 'time-since-last-round': ${data}`);
1503
+ return new NodeStatusResponse({
1504
+ catchupTime: data['catchup-time'],
1505
+ lastRound: data['last-round'],
1506
+ lastVersion: data['last-version'],
1507
+ nextVersion: data['next-version'],
1508
+ nextVersionRound: data['next-version-round'],
1509
+ nextVersionSupported: data['next-version-supported'],
1510
+ stoppedAtUnsupportedRound: data['stopped-at-unsupported-round'],
1511
+ timeSinceLastRound: data['time-since-last-round'],
1512
+ catchpoint: data['catchpoint'],
1513
+ catchpointAcquiredBlocks: data['catchpoint-acquired-blocks'],
1514
+ catchpointProcessedAccounts: data['catchpoint-processed-accounts'],
1515
+ catchpointTotalAccounts: data['catchpoint-total-accounts'],
1516
+ catchpointTotalBlocks: data['catchpoint-total-blocks'],
1517
+ catchpointVerifiedAccounts: data['catchpoint-verified-accounts'],
1518
+ lastCatchpoint: data['last-catchpoint'],
1519
+ });
1520
+ /* eslint-enable dot-notation */
1521
+ }
923
1522
  }
924
1523
  exports.NodeStatusResponse = NodeStatusResponse;
925
1524
  /**
926
1525
  * Details about a pending transaction. If the transaction was recently confirmed,
927
1526
  * includes confirmation details like the round and reward details.
928
1527
  */
929
- class PendingTransactionResponse extends base_1.default {
1528
+ class PendingTransactionResponse extends basemodel_1.default {
930
1529
  /**
931
1530
  * Creates a new `PendingTransactionResponse` object.
932
1531
  * @param poolError - Indicates that the transaction was kicked out of this node's transaction pool
@@ -982,6 +1581,37 @@ class PendingTransactionResponse extends base_1.default {
982
1581
  senderRewards: 'sender-rewards',
983
1582
  };
984
1583
  }
1584
+ // eslint-disable-next-line camelcase
1585
+ static from_obj_for_encoding(data) {
1586
+ /* eslint-disable dot-notation */
1587
+ if (typeof data['pool-error'] === 'undefined')
1588
+ throw new Error(`Response is missing required field 'pool-error': ${data}`);
1589
+ if (typeof data['txn'] === 'undefined')
1590
+ throw new Error(`Response is missing required field 'txn': ${data}`);
1591
+ return new PendingTransactionResponse({
1592
+ poolError: data['pool-error'],
1593
+ txn: data['txn'],
1594
+ applicationIndex: data['application-index'],
1595
+ assetClosingAmount: data['asset-closing-amount'],
1596
+ assetIndex: data['asset-index'],
1597
+ closeRewards: data['close-rewards'],
1598
+ closingAmount: data['closing-amount'],
1599
+ confirmedRound: data['confirmed-round'],
1600
+ globalStateDelta: typeof data['global-state-delta'] !== 'undefined'
1601
+ ? data['global-state-delta'].map(EvalDeltaKeyValue.from_obj_for_encoding)
1602
+ : undefined,
1603
+ innerTxns: typeof data['inner-txns'] !== 'undefined'
1604
+ ? data['inner-txns'].map(PendingTransactionResponse.from_obj_for_encoding)
1605
+ : undefined,
1606
+ localStateDelta: typeof data['local-state-delta'] !== 'undefined'
1607
+ ? data['local-state-delta'].map(AccountStateDelta.from_obj_for_encoding)
1608
+ : undefined,
1609
+ logs: data['logs'],
1610
+ receiverRewards: data['receiver-rewards'],
1611
+ senderRewards: data['sender-rewards'],
1612
+ });
1613
+ /* eslint-enable dot-notation */
1614
+ }
985
1615
  }
986
1616
  exports.PendingTransactionResponse = PendingTransactionResponse;
987
1617
  /**
@@ -989,7 +1619,7 @@ exports.PendingTransactionResponse = PendingTransactionResponse;
989
1619
  * pool. You can compute whether or not the list is truncated if the number of
990
1620
  * elements in the **top-transactions** array is fewer than **total-transactions**.
991
1621
  */
992
- class PendingTransactionsResponse extends base_1.default {
1622
+ class PendingTransactionsResponse extends basemodel_1.default {
993
1623
  /**
994
1624
  * Creates a new `PendingTransactionsResponse` object.
995
1625
  * @param topTransactions - An array of signed transaction objects.
@@ -1004,12 +1634,22 @@ class PendingTransactionsResponse extends base_1.default {
1004
1634
  totalTransactions: 'total-transactions',
1005
1635
  };
1006
1636
  }
1637
+ // eslint-disable-next-line camelcase
1638
+ static from_obj_for_encoding(data) {
1639
+ /* eslint-disable dot-notation */
1640
+ if (!Array.isArray(data['top-transactions']))
1641
+ throw new Error(`Response is missing required array field 'top-transactions': ${data}`);
1642
+ if (typeof data['total-transactions'] === 'undefined')
1643
+ throw new Error(`Response is missing required field 'total-transactions': ${data}`);
1644
+ return new PendingTransactionsResponse(data['top-transactions'], data['total-transactions']);
1645
+ /* eslint-enable dot-notation */
1646
+ }
1007
1647
  }
1008
1648
  exports.PendingTransactionsResponse = PendingTransactionsResponse;
1009
1649
  /**
1010
1650
  * Transaction ID of the submission.
1011
1651
  */
1012
- class PostTransactionsResponse extends base_1.default {
1652
+ class PostTransactionsResponse extends basemodel_1.default {
1013
1653
  /**
1014
1654
  * Creates a new `PostTransactionsResponse` object.
1015
1655
  * @param txid - encoding of the transaction hash.
@@ -1021,12 +1661,20 @@ class PostTransactionsResponse extends base_1.default {
1021
1661
  txid: 'txId',
1022
1662
  };
1023
1663
  }
1664
+ // eslint-disable-next-line camelcase
1665
+ static from_obj_for_encoding(data) {
1666
+ /* eslint-disable dot-notation */
1667
+ if (typeof data['txId'] === 'undefined')
1668
+ throw new Error(`Response is missing required field 'txId': ${data}`);
1669
+ return new PostTransactionsResponse(data['txId']);
1670
+ /* eslint-enable dot-notation */
1671
+ }
1024
1672
  }
1025
1673
  exports.PostTransactionsResponse = PostTransactionsResponse;
1026
1674
  /**
1027
1675
  * Represents a state proof and its corresponding message
1028
1676
  */
1029
- class StateProof extends base_1.default {
1677
+ class StateProof extends basemodel_1.default {
1030
1678
  /**
1031
1679
  * Creates a new `StateProof` object.
1032
1680
  * @param message - Represents the message that the state proofs are attesting to.
@@ -1044,12 +1692,22 @@ class StateProof extends base_1.default {
1044
1692
  stateproof: 'StateProof',
1045
1693
  };
1046
1694
  }
1695
+ // eslint-disable-next-line camelcase
1696
+ static from_obj_for_encoding(data) {
1697
+ /* eslint-disable dot-notation */
1698
+ if (typeof data['Message'] === 'undefined')
1699
+ throw new Error(`Response is missing required field 'Message': ${data}`);
1700
+ if (typeof data['StateProof'] === 'undefined')
1701
+ throw new Error(`Response is missing required field 'StateProof': ${data}`);
1702
+ return new StateProof(StateProofMessage.from_obj_for_encoding(data['Message']), data['StateProof']);
1703
+ /* eslint-enable dot-notation */
1704
+ }
1047
1705
  }
1048
1706
  exports.StateProof = StateProof;
1049
1707
  /**
1050
1708
  * Represents the message that the state proofs are attesting to.
1051
1709
  */
1052
- class StateProofMessage extends base_1.default {
1710
+ class StateProofMessage extends basemodel_1.default {
1053
1711
  /**
1054
1712
  * Creates a new `StateProofMessage` object.
1055
1713
  * @param blockheaderscommitment - The vector commitment root on all light block headers within a state proof
@@ -1081,12 +1739,34 @@ class StateProofMessage extends base_1.default {
1081
1739
  voterscommitment: 'VotersCommitment',
1082
1740
  };
1083
1741
  }
1742
+ // eslint-disable-next-line camelcase
1743
+ static from_obj_for_encoding(data) {
1744
+ /* eslint-disable dot-notation */
1745
+ if (typeof data['BlockHeadersCommitment'] === 'undefined')
1746
+ throw new Error(`Response is missing required field 'BlockHeadersCommitment': ${data}`);
1747
+ if (typeof data['FirstAttestedRound'] === 'undefined')
1748
+ throw new Error(`Response is missing required field 'FirstAttestedRound': ${data}`);
1749
+ if (typeof data['LastAttestedRound'] === 'undefined')
1750
+ throw new Error(`Response is missing required field 'LastAttestedRound': ${data}`);
1751
+ if (typeof data['LnProvenWeight'] === 'undefined')
1752
+ throw new Error(`Response is missing required field 'LnProvenWeight': ${data}`);
1753
+ if (typeof data['VotersCommitment'] === 'undefined')
1754
+ throw new Error(`Response is missing required field 'VotersCommitment': ${data}`);
1755
+ return new StateProofMessage({
1756
+ blockheaderscommitment: data['BlockHeadersCommitment'],
1757
+ firstattestedround: data['FirstAttestedRound'],
1758
+ lastattestedround: data['LastAttestedRound'],
1759
+ lnprovenweight: data['LnProvenWeight'],
1760
+ voterscommitment: data['VotersCommitment'],
1761
+ });
1762
+ /* eslint-enable dot-notation */
1763
+ }
1084
1764
  }
1085
1765
  exports.StateProofMessage = StateProofMessage;
1086
1766
  /**
1087
1767
  * Supply represents the current supply of MicroAlgos in the system.
1088
1768
  */
1089
- class SupplyResponse extends base_1.default {
1769
+ class SupplyResponse extends basemodel_1.default {
1090
1770
  /**
1091
1771
  * Creates a new `SupplyResponse` object.
1092
1772
  * @param currentRound - Round
@@ -1104,12 +1784,24 @@ class SupplyResponse extends base_1.default {
1104
1784
  totalMoney: 'total-money',
1105
1785
  };
1106
1786
  }
1787
+ // eslint-disable-next-line camelcase
1788
+ static from_obj_for_encoding(data) {
1789
+ /* eslint-disable dot-notation */
1790
+ if (typeof data['current_round'] === 'undefined')
1791
+ throw new Error(`Response is missing required field 'current_round': ${data}`);
1792
+ if (typeof data['online-money'] === 'undefined')
1793
+ throw new Error(`Response is missing required field 'online-money': ${data}`);
1794
+ if (typeof data['total-money'] === 'undefined')
1795
+ throw new Error(`Response is missing required field 'total-money': ${data}`);
1796
+ return new SupplyResponse(data['current_round'], data['online-money'], data['total-money']);
1797
+ /* eslint-enable dot-notation */
1798
+ }
1107
1799
  }
1108
1800
  exports.SupplyResponse = SupplyResponse;
1109
1801
  /**
1110
1802
  * Represents a key-value pair in an application store.
1111
1803
  */
1112
- class TealKeyValue extends base_1.default {
1804
+ class TealKeyValue extends basemodel_1.default {
1113
1805
  /**
1114
1806
  * Creates a new `TealKeyValue` object.
1115
1807
  * @param key -
@@ -1124,12 +1816,22 @@ class TealKeyValue extends base_1.default {
1124
1816
  value: 'value',
1125
1817
  };
1126
1818
  }
1819
+ // eslint-disable-next-line camelcase
1820
+ static from_obj_for_encoding(data) {
1821
+ /* eslint-disable dot-notation */
1822
+ if (typeof data['key'] === 'undefined')
1823
+ throw new Error(`Response is missing required field 'key': ${data}`);
1824
+ if (typeof data['value'] === 'undefined')
1825
+ throw new Error(`Response is missing required field 'value': ${data}`);
1826
+ return new TealKeyValue(data['key'], TealValue.from_obj_for_encoding(data['value']));
1827
+ /* eslint-enable dot-notation */
1828
+ }
1127
1829
  }
1128
1830
  exports.TealKeyValue = TealKeyValue;
1129
1831
  /**
1130
1832
  * Represents a TEAL value.
1131
1833
  */
1132
- class TealValue extends base_1.default {
1834
+ class TealValue extends basemodel_1.default {
1133
1835
  /**
1134
1836
  * Creates a new `TealValue` object.
1135
1837
  * @param type - (tt) value type. Value `1` refers to **bytes**, value `2` refers to **uint**
@@ -1147,13 +1849,25 @@ class TealValue extends base_1.default {
1147
1849
  uint: 'uint',
1148
1850
  };
1149
1851
  }
1852
+ // eslint-disable-next-line camelcase
1853
+ static from_obj_for_encoding(data) {
1854
+ /* eslint-disable dot-notation */
1855
+ if (typeof data['type'] === 'undefined')
1856
+ throw new Error(`Response is missing required field 'type': ${data}`);
1857
+ if (typeof data['bytes'] === 'undefined')
1858
+ throw new Error(`Response is missing required field 'bytes': ${data}`);
1859
+ if (typeof data['uint'] === 'undefined')
1860
+ throw new Error(`Response is missing required field 'uint': ${data}`);
1861
+ return new TealValue(data['type'], data['bytes'], data['uint']);
1862
+ /* eslint-enable dot-notation */
1863
+ }
1150
1864
  }
1151
1865
  exports.TealValue = TealValue;
1152
1866
  /**
1153
1867
  * TransactionParams contains the parameters that help a client construct a new
1154
1868
  * transaction.
1155
1869
  */
1156
- class TransactionParametersResponse extends base_1.default {
1870
+ class TransactionParametersResponse extends basemodel_1.default {
1157
1871
  /**
1158
1872
  * Creates a new `TransactionParametersResponse` object.
1159
1873
  * @param consensusVersion - ConsensusVersion indicates the consensus protocol version
@@ -1188,12 +1902,37 @@ class TransactionParametersResponse extends base_1.default {
1188
1902
  minFee: 'min-fee',
1189
1903
  };
1190
1904
  }
1905
+ // eslint-disable-next-line camelcase
1906
+ static from_obj_for_encoding(data) {
1907
+ /* eslint-disable dot-notation */
1908
+ if (typeof data['consensus-version'] === 'undefined')
1909
+ throw new Error(`Response is missing required field 'consensus-version': ${data}`);
1910
+ if (typeof data['fee'] === 'undefined')
1911
+ throw new Error(`Response is missing required field 'fee': ${data}`);
1912
+ if (typeof data['genesis-hash'] === 'undefined')
1913
+ throw new Error(`Response is missing required field 'genesis-hash': ${data}`);
1914
+ if (typeof data['genesis-id'] === 'undefined')
1915
+ throw new Error(`Response is missing required field 'genesis-id': ${data}`);
1916
+ if (typeof data['last-round'] === 'undefined')
1917
+ throw new Error(`Response is missing required field 'last-round': ${data}`);
1918
+ if (typeof data['min-fee'] === 'undefined')
1919
+ throw new Error(`Response is missing required field 'min-fee': ${data}`);
1920
+ return new TransactionParametersResponse({
1921
+ consensusVersion: data['consensus-version'],
1922
+ fee: data['fee'],
1923
+ genesisHash: data['genesis-hash'],
1924
+ genesisId: data['genesis-id'],
1925
+ lastRound: data['last-round'],
1926
+ minFee: data['min-fee'],
1927
+ });
1928
+ /* eslint-enable dot-notation */
1929
+ }
1191
1930
  }
1192
1931
  exports.TransactionParametersResponse = TransactionParametersResponse;
1193
1932
  /**
1194
1933
  * Proof of transaction in a block.
1195
1934
  */
1196
- class TransactionProofResponse extends base_1.default {
1935
+ class TransactionProofResponse extends basemodel_1.default {
1197
1936
  /**
1198
1937
  * Creates a new `TransactionProofResponse` object.
1199
1938
  * @param idx - Index of the transaction in the block's payset.
@@ -1226,12 +1965,32 @@ class TransactionProofResponse extends base_1.default {
1226
1965
  hashtype: 'hashtype',
1227
1966
  };
1228
1967
  }
1968
+ // eslint-disable-next-line camelcase
1969
+ static from_obj_for_encoding(data) {
1970
+ /* eslint-disable dot-notation */
1971
+ if (typeof data['idx'] === 'undefined')
1972
+ throw new Error(`Response is missing required field 'idx': ${data}`);
1973
+ if (typeof data['proof'] === 'undefined')
1974
+ throw new Error(`Response is missing required field 'proof': ${data}`);
1975
+ if (typeof data['stibhash'] === 'undefined')
1976
+ throw new Error(`Response is missing required field 'stibhash': ${data}`);
1977
+ if (typeof data['treedepth'] === 'undefined')
1978
+ throw new Error(`Response is missing required field 'treedepth': ${data}`);
1979
+ return new TransactionProofResponse({
1980
+ idx: data['idx'],
1981
+ proof: data['proof'],
1982
+ stibhash: data['stibhash'],
1983
+ treedepth: data['treedepth'],
1984
+ hashtype: data['hashtype'],
1985
+ });
1986
+ /* eslint-enable dot-notation */
1987
+ }
1229
1988
  }
1230
1989
  exports.TransactionProofResponse = TransactionProofResponse;
1231
1990
  /**
1232
1991
  * algod version information.
1233
1992
  */
1234
- class Version extends base_1.default {
1993
+ class Version extends basemodel_1.default {
1235
1994
  /**
1236
1995
  * Creates a new `Version` object.
1237
1996
  * @param build -
@@ -1255,6 +2014,20 @@ class Version extends base_1.default {
1255
2014
  versions: 'versions',
1256
2015
  };
1257
2016
  }
2017
+ // eslint-disable-next-line camelcase
2018
+ static from_obj_for_encoding(data) {
2019
+ /* eslint-disable dot-notation */
2020
+ if (typeof data['build'] === 'undefined')
2021
+ throw new Error(`Response is missing required field 'build': ${data}`);
2022
+ if (typeof data['genesis_hash_b64'] === 'undefined')
2023
+ throw new Error(`Response is missing required field 'genesis_hash_b64': ${data}`);
2024
+ if (typeof data['genesis_id'] === 'undefined')
2025
+ throw new Error(`Response is missing required field 'genesis_id': ${data}`);
2026
+ if (!Array.isArray(data['versions']))
2027
+ throw new Error(`Response is missing required array field 'versions': ${data}`);
2028
+ return new Version(BuildVersion.from_obj_for_encoding(data['build']), data['genesis_hash_b64'], data['genesis_id'], data['versions']);
2029
+ /* eslint-enable dot-notation */
2030
+ }
1258
2031
  }
1259
2032
  exports.Version = Version;
1260
2033
  //# sourceMappingURL=types.js.map