algosdk 1.24.1 → 2.0.0
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.
- package/README.md +4 -4
- package/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.LICENSE.txt +0 -18
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/client/v2/algod/algod.js +1 -1
- package/dist/cjs/client/v2/algod/algod.js.map +1 -1
- package/dist/cjs/client/v2/algod/models/types.js +161 -123
- package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js +0 -7
- package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
- package/dist/cjs/dryrun.js +16 -7
- package/dist/cjs/dryrun.js.map +1 -1
- package/dist/cjs/logicsig.js +3 -14
- package/dist/cjs/logicsig.js.map +1 -1
- package/dist/cjs/main.js +3 -6
- package/dist/cjs/main.js.map +1 -1
- package/dist/cjs/makeTxn.js +1 -193
- package/dist/cjs/makeTxn.js.map +1 -1
- package/dist/esm/client/v2/algod/algod.js +1 -1
- package/dist/esm/client/v2/algod/algod.js.map +1 -1
- package/dist/esm/client/v2/algod/models/types.js +160 -120
- package/dist/esm/client/v2/algod/models/types.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAssetTransactions.js +0 -7
- package/dist/esm/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
- package/dist/esm/dryrun.js +16 -7
- package/dist/esm/dryrun.js.map +1 -1
- package/dist/esm/logicsig.js +2 -12
- package/dist/esm/logicsig.js.map +1 -1
- package/dist/esm/main.js +1 -4
- package/dist/esm/main.js.map +1 -1
- package/dist/esm/makeTxn.js +0 -185
- package/dist/esm/makeTxn.js.map +1 -1
- package/dist/types/client/v2/algod/algod.d.ts +1 -1
- package/dist/types/client/v2/algod/models/types.d.ts +122 -67
- package/dist/types/client/v2/indexer/lookupAssetTransactions.d.ts +0 -4
- package/dist/types/logicsig.d.ts +2 -10
- package/dist/types/main.d.ts +1 -3
- package/dist/types/makeTxn.d.ts +1 -147
- package/dist/types/types/transactions/encoded.d.ts +0 -15
- package/package.json +1 -1
- package/src/client/v2/algod/algod.ts +2 -2
- package/src/client/v2/algod/models/types.ts +318 -249
- package/src/client/v2/indexer/lookupAssetTransactions.ts +0 -8
- package/src/dryrun.ts +13 -13
- package/src/logicsig.ts +2 -13
- package/src/main.ts +1 -5
- package/src/makeTxn.ts +0 -421
- package/src/types/transactions/encoded.ts +0 -17
- package/dist/cjs/client/algod.js +0 -295
- package/dist/cjs/client/algod.js.map +0 -1
- package/dist/cjs/logic/langspec.json +0 -2014
- package/dist/cjs/logic/logic.js +0 -262
- package/dist/cjs/logic/logic.js.map +0 -1
- package/dist/cjs/logicTemplates/dynamicfee.js +0 -192
- package/dist/cjs/logicTemplates/dynamicfee.js.map +0 -1
- package/dist/cjs/logicTemplates/htlc.js +0 -145
- package/dist/cjs/logicTemplates/htlc.js.map +0 -1
- package/dist/cjs/logicTemplates/index.js +0 -19
- package/dist/cjs/logicTemplates/index.js.map +0 -1
- package/dist/cjs/logicTemplates/limitorder.js +0 -167
- package/dist/cjs/logicTemplates/limitorder.js.map +0 -1
- package/dist/cjs/logicTemplates/periodicpayment.js +0 -163
- package/dist/cjs/logicTemplates/periodicpayment.js.map +0 -1
- package/dist/cjs/logicTemplates/split.js +0 -154
- package/dist/cjs/logicTemplates/split.js.map +0 -1
- package/dist/cjs/logicTemplates/templates.js +0 -67
- package/dist/cjs/logicTemplates/templates.js.map +0 -1
- package/dist/esm/client/algod.js +0 -295
- package/dist/esm/client/algod.js.map +0 -1
- package/dist/esm/logic/langspec.json +0 -2014
- package/dist/esm/logic/logic.js +0 -249
- package/dist/esm/logic/logic.js.map +0 -1
- package/dist/esm/logicTemplates/dynamicfee.js +0 -192
- package/dist/esm/logicTemplates/dynamicfee.js.map +0 -1
- package/dist/esm/logicTemplates/htlc.js +0 -145
- package/dist/esm/logicTemplates/htlc.js.map +0 -1
- package/dist/esm/logicTemplates/index.js +0 -19
- package/dist/esm/logicTemplates/index.js.map +0 -1
- package/dist/esm/logicTemplates/limitorder.js +0 -167
- package/dist/esm/logicTemplates/limitorder.js.map +0 -1
- package/dist/esm/logicTemplates/periodicpayment.js +0 -163
- package/dist/esm/logicTemplates/periodicpayment.js.map +0 -1
- package/dist/esm/logicTemplates/split.js +0 -154
- package/dist/esm/logicTemplates/split.js.map +0 -1
- package/dist/esm/logicTemplates/templates.js +0 -67
- package/dist/esm/logicTemplates/templates.js.map +0 -1
- package/dist/types/client/algod.d.ts +0 -162
- package/dist/types/logic/logic.d.ts +0 -45
- package/dist/types/logicTemplates/dynamicfee.d.ts +0 -59
- package/dist/types/logicTemplates/htlc.d.ts +0 -51
- package/dist/types/logicTemplates/index.d.ts +0 -16
- package/dist/types/logicTemplates/limitorder.d.ts +0 -70
- package/dist/types/logicTemplates/periodicpayment.d.ts +0 -58
- package/dist/types/logicTemplates/split.d.ts +0 -57
- package/dist/types/logicTemplates/templates.d.ts +0 -6
- package/src/client/algod.js +0 -365
- package/src/logic/langspec.json +0 -2014
- package/src/logic/logic.ts +0 -316
- package/src/logicTemplates/dynamicfee.js +0 -219
- package/src/logicTemplates/htlc.js +0 -165
- package/src/logicTemplates/index.js +0 -20
- package/src/logicTemplates/limitorder.js +0 -227
- package/src/logicTemplates/periodicpayment.js +0 -208
- package/src/logicTemplates/split.js +0 -208
- package/src/logicTemplates/templates.js +0 -78
|
@@ -197,7 +197,7 @@ export class AccountApplicationResponse extends BaseModel {
|
|
|
197
197
|
* global data.
|
|
198
198
|
* The raw account uses `AppParams` for this type.
|
|
199
199
|
*/
|
|
200
|
-
constructor(round, appLocalState, createdApp) {
|
|
200
|
+
constructor({ round, appLocalState, createdApp, }) {
|
|
201
201
|
super();
|
|
202
202
|
this.round = round;
|
|
203
203
|
this.appLocalState = appLocalState;
|
|
@@ -213,11 +213,15 @@ export class AccountApplicationResponse extends BaseModel {
|
|
|
213
213
|
/* eslint-disable dot-notation */
|
|
214
214
|
if (typeof data['round'] === 'undefined')
|
|
215
215
|
throw new Error(`Response is missing required field 'round': ${data}`);
|
|
216
|
-
return new AccountApplicationResponse(
|
|
217
|
-
|
|
218
|
-
:
|
|
219
|
-
|
|
220
|
-
|
|
216
|
+
return new AccountApplicationResponse({
|
|
217
|
+
round: data['round'],
|
|
218
|
+
appLocalState: typeof data['app-local-state'] !== 'undefined'
|
|
219
|
+
? ApplicationLocalState.from_obj_for_encoding(data['app-local-state'])
|
|
220
|
+
: undefined,
|
|
221
|
+
createdApp: typeof data['created-app'] !== 'undefined'
|
|
222
|
+
? ApplicationParams.from_obj_for_encoding(data['created-app'])
|
|
223
|
+
: undefined,
|
|
224
|
+
});
|
|
221
225
|
/* eslint-enable dot-notation */
|
|
222
226
|
}
|
|
223
227
|
}
|
|
@@ -235,7 +239,7 @@ export class AccountAssetResponse extends BaseModel {
|
|
|
235
239
|
* @param createdAsset - (apar) parameters of the asset created by this account.
|
|
236
240
|
* The raw account uses `AssetParams` for this type.
|
|
237
241
|
*/
|
|
238
|
-
constructor(round, assetHolding, createdAsset) {
|
|
242
|
+
constructor({ round, assetHolding, createdAsset, }) {
|
|
239
243
|
super();
|
|
240
244
|
this.round = round;
|
|
241
245
|
this.assetHolding = assetHolding;
|
|
@@ -251,11 +255,15 @@ export class AccountAssetResponse extends BaseModel {
|
|
|
251
255
|
/* eslint-disable dot-notation */
|
|
252
256
|
if (typeof data['round'] === 'undefined')
|
|
253
257
|
throw new Error(`Response is missing required field 'round': ${data}`);
|
|
254
|
-
return new AccountAssetResponse(
|
|
255
|
-
|
|
256
|
-
:
|
|
257
|
-
|
|
258
|
-
|
|
258
|
+
return new AccountAssetResponse({
|
|
259
|
+
round: data['round'],
|
|
260
|
+
assetHolding: typeof data['asset-holding'] !== 'undefined'
|
|
261
|
+
? AssetHolding.from_obj_for_encoding(data['asset-holding'])
|
|
262
|
+
: undefined,
|
|
263
|
+
createdAsset: typeof data['created-asset'] !== 'undefined'
|
|
264
|
+
? AssetParams.from_obj_for_encoding(data['created-asset'])
|
|
265
|
+
: undefined,
|
|
266
|
+
});
|
|
259
267
|
/* eslint-enable dot-notation */
|
|
260
268
|
}
|
|
261
269
|
}
|
|
@@ -333,7 +341,7 @@ export class AccountStateDelta extends BaseModel {
|
|
|
333
341
|
* @param address -
|
|
334
342
|
* @param delta - Application state delta.
|
|
335
343
|
*/
|
|
336
|
-
constructor(address, delta) {
|
|
344
|
+
constructor({ address, delta, }) {
|
|
337
345
|
super();
|
|
338
346
|
this.address = address;
|
|
339
347
|
this.delta = delta;
|
|
@@ -349,7 +357,10 @@ export class AccountStateDelta extends BaseModel {
|
|
|
349
357
|
throw new Error(`Response is missing required field 'address': ${data}`);
|
|
350
358
|
if (!Array.isArray(data['delta']))
|
|
351
359
|
throw new Error(`Response is missing required array field 'delta': ${data}`);
|
|
352
|
-
return new AccountStateDelta(
|
|
360
|
+
return new AccountStateDelta({
|
|
361
|
+
address: data['address'],
|
|
362
|
+
delta: data['delta'].map(EvalDeltaKeyValue.from_obj_for_encoding),
|
|
363
|
+
});
|
|
353
364
|
/* eslint-enable dot-notation */
|
|
354
365
|
}
|
|
355
366
|
}
|
|
@@ -362,7 +373,7 @@ export class Application extends BaseModel {
|
|
|
362
373
|
* @param id - (appidx) application index.
|
|
363
374
|
* @param params - (appparams) application parameters.
|
|
364
375
|
*/
|
|
365
|
-
constructor(id, params) {
|
|
376
|
+
constructor({ id, params, }) {
|
|
366
377
|
super();
|
|
367
378
|
this.id = id;
|
|
368
379
|
this.params = params;
|
|
@@ -378,7 +389,10 @@ export class Application extends BaseModel {
|
|
|
378
389
|
throw new Error(`Response is missing required field 'id': ${data}`);
|
|
379
390
|
if (typeof data['params'] === 'undefined')
|
|
380
391
|
throw new Error(`Response is missing required field 'params': ${data}`);
|
|
381
|
-
return new Application(
|
|
392
|
+
return new Application({
|
|
393
|
+
id: data['id'],
|
|
394
|
+
params: ApplicationParams.from_obj_for_encoding(data['params']),
|
|
395
|
+
});
|
|
382
396
|
/* eslint-enable dot-notation */
|
|
383
397
|
}
|
|
384
398
|
}
|
|
@@ -392,7 +406,7 @@ export class ApplicationLocalState extends BaseModel {
|
|
|
392
406
|
* @param schema - (hsch) schema.
|
|
393
407
|
* @param keyValue - (tkv) storage.
|
|
394
408
|
*/
|
|
395
|
-
constructor(id, schema, keyValue) {
|
|
409
|
+
constructor({ id, schema, keyValue, }) {
|
|
396
410
|
super();
|
|
397
411
|
this.id = id;
|
|
398
412
|
this.schema = schema;
|
|
@@ -410,9 +424,13 @@ export class ApplicationLocalState extends BaseModel {
|
|
|
410
424
|
throw new Error(`Response is missing required field 'id': ${data}`);
|
|
411
425
|
if (typeof data['schema'] === 'undefined')
|
|
412
426
|
throw new Error(`Response is missing required field 'schema': ${data}`);
|
|
413
|
-
return new ApplicationLocalState(
|
|
414
|
-
|
|
415
|
-
:
|
|
427
|
+
return new ApplicationLocalState({
|
|
428
|
+
id: data['id'],
|
|
429
|
+
schema: ApplicationStateSchema.from_obj_for_encoding(data['schema']),
|
|
430
|
+
keyValue: typeof data['key-value'] !== 'undefined'
|
|
431
|
+
? data['key-value'].map(TealKeyValue.from_obj_for_encoding)
|
|
432
|
+
: undefined,
|
|
433
|
+
});
|
|
416
434
|
/* eslint-enable dot-notation */
|
|
417
435
|
}
|
|
418
436
|
}
|
|
@@ -492,7 +510,7 @@ export class ApplicationStateSchema extends BaseModel {
|
|
|
492
510
|
* @param numUint - (nui) num of uints.
|
|
493
511
|
* @param numByteSlice - (nbs) num of byte slices.
|
|
494
512
|
*/
|
|
495
|
-
constructor(numUint, numByteSlice) {
|
|
513
|
+
constructor({ numUint, numByteSlice, }) {
|
|
496
514
|
super();
|
|
497
515
|
this.numUint = numUint;
|
|
498
516
|
this.numByteSlice = numByteSlice;
|
|
@@ -508,7 +526,10 @@ export class ApplicationStateSchema extends BaseModel {
|
|
|
508
526
|
throw new Error(`Response is missing required field 'num-uint': ${data}`);
|
|
509
527
|
if (typeof data['num-byte-slice'] === 'undefined')
|
|
510
528
|
throw new Error(`Response is missing required field 'num-byte-slice': ${data}`);
|
|
511
|
-
return new ApplicationStateSchema(
|
|
529
|
+
return new ApplicationStateSchema({
|
|
530
|
+
numUint: data['num-uint'],
|
|
531
|
+
numByteSlice: data['num-byte-slice'],
|
|
532
|
+
});
|
|
512
533
|
/* eslint-enable dot-notation */
|
|
513
534
|
}
|
|
514
535
|
}
|
|
@@ -524,7 +545,7 @@ export class Asset extends BaseModel {
|
|
|
524
545
|
* Definition:
|
|
525
546
|
* data/transactions/asset.go : AssetParams
|
|
526
547
|
*/
|
|
527
|
-
constructor(index, params) {
|
|
548
|
+
constructor({ index, params, }) {
|
|
528
549
|
super();
|
|
529
550
|
this.index = index;
|
|
530
551
|
this.params = params;
|
|
@@ -540,7 +561,10 @@ export class Asset extends BaseModel {
|
|
|
540
561
|
throw new Error(`Response is missing required field 'index': ${data}`);
|
|
541
562
|
if (typeof data['params'] === 'undefined')
|
|
542
563
|
throw new Error(`Response is missing required field 'params': ${data}`);
|
|
543
|
-
return new Asset(
|
|
564
|
+
return new Asset({
|
|
565
|
+
index: data['index'],
|
|
566
|
+
params: AssetParams.from_obj_for_encoding(data['params']),
|
|
567
|
+
});
|
|
544
568
|
/* eslint-enable dot-notation */
|
|
545
569
|
}
|
|
546
570
|
}
|
|
@@ -556,7 +580,7 @@ export class AssetHolding extends BaseModel {
|
|
|
556
580
|
* @param assetId - Asset ID of the holding.
|
|
557
581
|
* @param isFrozen - (f) whether or not the holding is frozen.
|
|
558
582
|
*/
|
|
559
|
-
constructor(amount, assetId, isFrozen) {
|
|
583
|
+
constructor({ amount, assetId, isFrozen, }) {
|
|
560
584
|
super();
|
|
561
585
|
this.amount = amount;
|
|
562
586
|
this.assetId = assetId;
|
|
@@ -576,7 +600,11 @@ export class AssetHolding extends BaseModel {
|
|
|
576
600
|
throw new Error(`Response is missing required field 'asset-id': ${data}`);
|
|
577
601
|
if (typeof data['is-frozen'] === 'undefined')
|
|
578
602
|
throw new Error(`Response is missing required field 'is-frozen': ${data}`);
|
|
579
|
-
return new AssetHolding(
|
|
603
|
+
return new AssetHolding({
|
|
604
|
+
amount: data['amount'],
|
|
605
|
+
assetId: data['asset-id'],
|
|
606
|
+
isFrozen: data['is-frozen'],
|
|
607
|
+
});
|
|
580
608
|
/* eslint-enable dot-notation */
|
|
581
609
|
}
|
|
582
610
|
}
|
|
@@ -700,7 +728,7 @@ export class BlockHashResponse extends BaseModel {
|
|
|
700
728
|
* Creates a new `BlockHashResponse` object.
|
|
701
729
|
* @param blockhash - Block header hash.
|
|
702
730
|
*/
|
|
703
|
-
constructor(blockhash) {
|
|
731
|
+
constructor({ blockhash }) {
|
|
704
732
|
super();
|
|
705
733
|
this.blockhash = blockhash;
|
|
706
734
|
this.attribute_map = {
|
|
@@ -712,7 +740,9 @@ export class BlockHashResponse extends BaseModel {
|
|
|
712
740
|
/* eslint-disable dot-notation */
|
|
713
741
|
if (typeof data['blockHash'] === 'undefined')
|
|
714
742
|
throw new Error(`Response is missing required field 'blockHash': ${data}`);
|
|
715
|
-
return new BlockHashResponse(
|
|
743
|
+
return new BlockHashResponse({
|
|
744
|
+
blockhash: data['blockHash'],
|
|
745
|
+
});
|
|
716
746
|
/* eslint-enable dot-notation */
|
|
717
747
|
}
|
|
718
748
|
}
|
|
@@ -726,7 +756,7 @@ export class BlockResponse extends BaseModel {
|
|
|
726
756
|
* @param cert - Optional certificate object. This is only included when the format is set to
|
|
727
757
|
* message pack.
|
|
728
758
|
*/
|
|
729
|
-
constructor(block, cert) {
|
|
759
|
+
constructor({ block, cert, }) {
|
|
730
760
|
super();
|
|
731
761
|
this.block = block;
|
|
732
762
|
this.cert = cert;
|
|
@@ -740,7 +770,10 @@ export class BlockResponse extends BaseModel {
|
|
|
740
770
|
/* eslint-disable dot-notation */
|
|
741
771
|
if (typeof data['block'] === 'undefined')
|
|
742
772
|
throw new Error(`Response is missing required field 'block': ${data}`);
|
|
743
|
-
return new BlockResponse(
|
|
773
|
+
return new BlockResponse({
|
|
774
|
+
block: data['block'],
|
|
775
|
+
cert: data['cert'],
|
|
776
|
+
});
|
|
744
777
|
/* eslint-enable dot-notation */
|
|
745
778
|
}
|
|
746
779
|
}
|
|
@@ -753,7 +786,7 @@ export class Box extends BaseModel {
|
|
|
753
786
|
* @param name - (name) box name, base64 encoded
|
|
754
787
|
* @param value - (value) box value, base64 encoded.
|
|
755
788
|
*/
|
|
756
|
-
constructor(name, value) {
|
|
789
|
+
constructor({ name, value, }) {
|
|
757
790
|
super();
|
|
758
791
|
this.name =
|
|
759
792
|
typeof name === 'string'
|
|
@@ -775,7 +808,10 @@ export class Box extends BaseModel {
|
|
|
775
808
|
throw new Error(`Response is missing required field 'name': ${data}`);
|
|
776
809
|
if (typeof data['value'] === 'undefined')
|
|
777
810
|
throw new Error(`Response is missing required field 'value': ${data}`);
|
|
778
|
-
return new Box(
|
|
811
|
+
return new Box({
|
|
812
|
+
name: data['name'],
|
|
813
|
+
value: data['value'],
|
|
814
|
+
});
|
|
779
815
|
/* eslint-enable dot-notation */
|
|
780
816
|
}
|
|
781
817
|
}
|
|
@@ -787,7 +823,7 @@ export class BoxDescriptor extends BaseModel {
|
|
|
787
823
|
* Creates a new `BoxDescriptor` object.
|
|
788
824
|
* @param name - Base64 encoded box name
|
|
789
825
|
*/
|
|
790
|
-
constructor(name) {
|
|
826
|
+
constructor({ name }) {
|
|
791
827
|
super();
|
|
792
828
|
this.name =
|
|
793
829
|
typeof name === 'string'
|
|
@@ -802,7 +838,9 @@ export class BoxDescriptor extends BaseModel {
|
|
|
802
838
|
/* eslint-disable dot-notation */
|
|
803
839
|
if (typeof data['name'] === 'undefined')
|
|
804
840
|
throw new Error(`Response is missing required field 'name': ${data}`);
|
|
805
|
-
return new BoxDescriptor(
|
|
841
|
+
return new BoxDescriptor({
|
|
842
|
+
name: data['name'],
|
|
843
|
+
});
|
|
806
844
|
/* eslint-enable dot-notation */
|
|
807
845
|
}
|
|
808
846
|
}
|
|
@@ -814,7 +852,7 @@ export class BoxesResponse extends BaseModel {
|
|
|
814
852
|
* Creates a new `BoxesResponse` object.
|
|
815
853
|
* @param boxes -
|
|
816
854
|
*/
|
|
817
|
-
constructor(boxes) {
|
|
855
|
+
constructor({ boxes }) {
|
|
818
856
|
super();
|
|
819
857
|
this.boxes = boxes;
|
|
820
858
|
this.attribute_map = {
|
|
@@ -826,7 +864,9 @@ export class BoxesResponse extends BaseModel {
|
|
|
826
864
|
/* eslint-disable dot-notation */
|
|
827
865
|
if (!Array.isArray(data['boxes']))
|
|
828
866
|
throw new Error(`Response is missing required array field 'boxes': ${data}`);
|
|
829
|
-
return new BoxesResponse(
|
|
867
|
+
return new BoxesResponse({
|
|
868
|
+
boxes: data['boxes'].map(BoxDescriptor.from_obj_for_encoding),
|
|
869
|
+
});
|
|
830
870
|
/* eslint-enable dot-notation */
|
|
831
871
|
}
|
|
832
872
|
}
|
|
@@ -883,54 +923,6 @@ export class BuildVersion extends BaseModel {
|
|
|
883
923
|
/* eslint-enable dot-notation */
|
|
884
924
|
}
|
|
885
925
|
}
|
|
886
|
-
/**
|
|
887
|
-
*
|
|
888
|
-
*/
|
|
889
|
-
export class CatchpointAbortResponse extends BaseModel {
|
|
890
|
-
/**
|
|
891
|
-
* Creates a new `CatchpointAbortResponse` object.
|
|
892
|
-
* @param catchupMessage - Catchup abort response string
|
|
893
|
-
*/
|
|
894
|
-
constructor(catchupMessage) {
|
|
895
|
-
super();
|
|
896
|
-
this.catchupMessage = catchupMessage;
|
|
897
|
-
this.attribute_map = {
|
|
898
|
-
catchupMessage: 'catchup-message',
|
|
899
|
-
};
|
|
900
|
-
}
|
|
901
|
-
// eslint-disable-next-line camelcase
|
|
902
|
-
static from_obj_for_encoding(data) {
|
|
903
|
-
/* eslint-disable dot-notation */
|
|
904
|
-
if (typeof data['catchup-message'] === 'undefined')
|
|
905
|
-
throw new Error(`Response is missing required field 'catchup-message': ${data}`);
|
|
906
|
-
return new CatchpointAbortResponse(data['catchup-message']);
|
|
907
|
-
/* eslint-enable dot-notation */
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
/**
|
|
911
|
-
*
|
|
912
|
-
*/
|
|
913
|
-
export class CatchpointStartResponse extends BaseModel {
|
|
914
|
-
/**
|
|
915
|
-
* Creates a new `CatchpointStartResponse` object.
|
|
916
|
-
* @param catchupMessage - Catchup start response string
|
|
917
|
-
*/
|
|
918
|
-
constructor(catchupMessage) {
|
|
919
|
-
super();
|
|
920
|
-
this.catchupMessage = catchupMessage;
|
|
921
|
-
this.attribute_map = {
|
|
922
|
-
catchupMessage: 'catchup-message',
|
|
923
|
-
};
|
|
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 CatchpointStartResponse(data['catchup-message']);
|
|
931
|
-
/* eslint-enable dot-notation */
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
926
|
/**
|
|
935
927
|
* Teal compile Result
|
|
936
928
|
*/
|
|
@@ -941,7 +933,7 @@ export class CompileResponse extends BaseModel {
|
|
|
941
933
|
* @param result - base64 encoded program bytes
|
|
942
934
|
* @param sourcemap - JSON of the source map
|
|
943
935
|
*/
|
|
944
|
-
constructor(hash, result, sourcemap) {
|
|
936
|
+
constructor({ hash, result, sourcemap, }) {
|
|
945
937
|
super();
|
|
946
938
|
this.hash = hash;
|
|
947
939
|
this.result = result;
|
|
@@ -959,7 +951,11 @@ export class CompileResponse extends BaseModel {
|
|
|
959
951
|
throw new Error(`Response is missing required field 'hash': ${data}`);
|
|
960
952
|
if (typeof data['result'] === 'undefined')
|
|
961
953
|
throw new Error(`Response is missing required field 'result': ${data}`);
|
|
962
|
-
return new CompileResponse(
|
|
954
|
+
return new CompileResponse({
|
|
955
|
+
hash: data['hash'],
|
|
956
|
+
result: data['result'],
|
|
957
|
+
sourcemap: data['sourcemap'],
|
|
958
|
+
});
|
|
963
959
|
/* eslint-enable dot-notation */
|
|
964
960
|
}
|
|
965
961
|
}
|
|
@@ -971,7 +967,7 @@ export class DisassembleResponse extends BaseModel {
|
|
|
971
967
|
* Creates a new `DisassembleResponse` object.
|
|
972
968
|
* @param result - disassembled Teal code
|
|
973
969
|
*/
|
|
974
|
-
constructor(result) {
|
|
970
|
+
constructor({ result }) {
|
|
975
971
|
super();
|
|
976
972
|
this.result = result;
|
|
977
973
|
this.attribute_map = {
|
|
@@ -983,7 +979,9 @@ export class DisassembleResponse extends BaseModel {
|
|
|
983
979
|
/* eslint-disable dot-notation */
|
|
984
980
|
if (typeof data['result'] === 'undefined')
|
|
985
981
|
throw new Error(`Response is missing required field 'result': ${data}`);
|
|
986
|
-
return new DisassembleResponse(
|
|
982
|
+
return new DisassembleResponse({
|
|
983
|
+
result: data['result'],
|
|
984
|
+
});
|
|
987
985
|
/* eslint-enable dot-notation */
|
|
988
986
|
}
|
|
989
987
|
}
|
|
@@ -1063,7 +1061,7 @@ export class DryrunResponse extends BaseModel {
|
|
|
1063
1061
|
* @param protocolVersion - Protocol version is the protocol version Dryrun was operated under.
|
|
1064
1062
|
* @param txns -
|
|
1065
1063
|
*/
|
|
1066
|
-
constructor(error, protocolVersion, txns) {
|
|
1064
|
+
constructor({ error, protocolVersion, txns, }) {
|
|
1067
1065
|
super();
|
|
1068
1066
|
this.error = error;
|
|
1069
1067
|
this.protocolVersion = protocolVersion;
|
|
@@ -1083,7 +1081,11 @@ export class DryrunResponse extends BaseModel {
|
|
|
1083
1081
|
throw new Error(`Response is missing required field 'protocol-version': ${data}`);
|
|
1084
1082
|
if (!Array.isArray(data['txns']))
|
|
1085
1083
|
throw new Error(`Response is missing required array field 'txns': ${data}`);
|
|
1086
|
-
return new DryrunResponse(
|
|
1084
|
+
return new DryrunResponse({
|
|
1085
|
+
error: data['error'],
|
|
1086
|
+
protocolVersion: data['protocol-version'],
|
|
1087
|
+
txns: data['txns'].map(DryrunTxnResult.from_obj_for_encoding),
|
|
1088
|
+
});
|
|
1087
1089
|
/* eslint-enable dot-notation */
|
|
1088
1090
|
}
|
|
1089
1091
|
}
|
|
@@ -1101,7 +1103,7 @@ export class DryrunSource extends BaseModel {
|
|
|
1101
1103
|
* @param txnIndex -
|
|
1102
1104
|
* @param appIndex -
|
|
1103
1105
|
*/
|
|
1104
|
-
constructor(fieldName, source, txnIndex, appIndex) {
|
|
1106
|
+
constructor({ fieldName, source, txnIndex, appIndex, }) {
|
|
1105
1107
|
super();
|
|
1106
1108
|
this.fieldName = fieldName;
|
|
1107
1109
|
this.source = source;
|
|
@@ -1125,7 +1127,12 @@ export class DryrunSource extends BaseModel {
|
|
|
1125
1127
|
throw new Error(`Response is missing required field 'txn-index': ${data}`);
|
|
1126
1128
|
if (typeof data['app-index'] === 'undefined')
|
|
1127
1129
|
throw new Error(`Response is missing required field 'app-index': ${data}`);
|
|
1128
|
-
return new DryrunSource(
|
|
1130
|
+
return new DryrunSource({
|
|
1131
|
+
fieldName: data['field-name'],
|
|
1132
|
+
source: data['source'],
|
|
1133
|
+
txnIndex: data['txn-index'],
|
|
1134
|
+
appIndex: data['app-index'],
|
|
1135
|
+
});
|
|
1129
1136
|
/* eslint-enable dot-notation */
|
|
1130
1137
|
}
|
|
1131
1138
|
}
|
|
@@ -1189,8 +1196,6 @@ export class DryrunTxnResult extends BaseModel {
|
|
|
1189
1196
|
* @param appCallTrace -
|
|
1190
1197
|
* @param budgetAdded - Budget added during execution of app call transaction.
|
|
1191
1198
|
* @param budgetConsumed - Budget consumed during execution of app call transaction.
|
|
1192
|
-
* @param cost - Net cost of app execution. Field is DEPRECATED and is subject for removal.
|
|
1193
|
-
* Instead, use `budget-added` and `budget-consumed.
|
|
1194
1199
|
* @param globalDelta - Application state delta.
|
|
1195
1200
|
* @param localDeltas -
|
|
1196
1201
|
* @param logicSigDisassembly - Disassembled lsig program line by line.
|
|
@@ -1198,14 +1203,13 @@ export class DryrunTxnResult extends BaseModel {
|
|
|
1198
1203
|
* @param logicSigTrace -
|
|
1199
1204
|
* @param logs -
|
|
1200
1205
|
*/
|
|
1201
|
-
constructor({ disassembly, appCallMessages, appCallTrace, budgetAdded, budgetConsumed,
|
|
1206
|
+
constructor({ disassembly, appCallMessages, appCallTrace, budgetAdded, budgetConsumed, globalDelta, localDeltas, logicSigDisassembly, logicSigMessages, logicSigTrace, logs, }) {
|
|
1202
1207
|
super();
|
|
1203
1208
|
this.disassembly = disassembly;
|
|
1204
1209
|
this.appCallMessages = appCallMessages;
|
|
1205
1210
|
this.appCallTrace = appCallTrace;
|
|
1206
1211
|
this.budgetAdded = budgetAdded;
|
|
1207
1212
|
this.budgetConsumed = budgetConsumed;
|
|
1208
|
-
this.cost = cost;
|
|
1209
1213
|
this.globalDelta = globalDelta;
|
|
1210
1214
|
this.localDeltas = localDeltas;
|
|
1211
1215
|
this.logicSigDisassembly = logicSigDisassembly;
|
|
@@ -1218,7 +1222,6 @@ export class DryrunTxnResult extends BaseModel {
|
|
|
1218
1222
|
appCallTrace: 'app-call-trace',
|
|
1219
1223
|
budgetAdded: 'budget-added',
|
|
1220
1224
|
budgetConsumed: 'budget-consumed',
|
|
1221
|
-
cost: 'cost',
|
|
1222
1225
|
globalDelta: 'global-delta',
|
|
1223
1226
|
localDeltas: 'local-deltas',
|
|
1224
1227
|
logicSigDisassembly: 'logic-sig-disassembly',
|
|
@@ -1240,7 +1243,6 @@ export class DryrunTxnResult extends BaseModel {
|
|
|
1240
1243
|
: undefined,
|
|
1241
1244
|
budgetAdded: data['budget-added'],
|
|
1242
1245
|
budgetConsumed: data['budget-consumed'],
|
|
1243
|
-
cost: data['cost'],
|
|
1244
1246
|
globalDelta: typeof data['global-delta'] !== 'undefined'
|
|
1245
1247
|
? data['global-delta'].map(EvalDeltaKeyValue.from_obj_for_encoding)
|
|
1246
1248
|
: undefined,
|
|
@@ -1266,7 +1268,7 @@ export class ErrorResponse extends BaseModel {
|
|
|
1266
1268
|
* @param message -
|
|
1267
1269
|
* @param data -
|
|
1268
1270
|
*/
|
|
1269
|
-
constructor(message, data) {
|
|
1271
|
+
constructor({ message, data, }) {
|
|
1270
1272
|
super();
|
|
1271
1273
|
this.message = message;
|
|
1272
1274
|
this.data = data;
|
|
@@ -1280,7 +1282,10 @@ export class ErrorResponse extends BaseModel {
|
|
|
1280
1282
|
/* eslint-disable dot-notation */
|
|
1281
1283
|
if (typeof data['message'] === 'undefined')
|
|
1282
1284
|
throw new Error(`Response is missing required field 'message': ${data}`);
|
|
1283
|
-
return new ErrorResponse(
|
|
1285
|
+
return new ErrorResponse({
|
|
1286
|
+
message: data['message'],
|
|
1287
|
+
data: data['data'],
|
|
1288
|
+
});
|
|
1284
1289
|
/* eslint-enable dot-notation */
|
|
1285
1290
|
}
|
|
1286
1291
|
}
|
|
@@ -1294,7 +1299,7 @@ export class EvalDelta extends BaseModel {
|
|
|
1294
1299
|
* @param bytes - (bs) bytes value.
|
|
1295
1300
|
* @param uint - (ui) uint value.
|
|
1296
1301
|
*/
|
|
1297
|
-
constructor(action, bytes, uint) {
|
|
1302
|
+
constructor({ action, bytes, uint, }) {
|
|
1298
1303
|
super();
|
|
1299
1304
|
this.action = action;
|
|
1300
1305
|
this.bytes = bytes;
|
|
@@ -1310,7 +1315,11 @@ export class EvalDelta extends BaseModel {
|
|
|
1310
1315
|
/* eslint-disable dot-notation */
|
|
1311
1316
|
if (typeof data['action'] === 'undefined')
|
|
1312
1317
|
throw new Error(`Response is missing required field 'action': ${data}`);
|
|
1313
|
-
return new EvalDelta(
|
|
1318
|
+
return new EvalDelta({
|
|
1319
|
+
action: data['action'],
|
|
1320
|
+
bytes: data['bytes'],
|
|
1321
|
+
uint: data['uint'],
|
|
1322
|
+
});
|
|
1314
1323
|
/* eslint-enable dot-notation */
|
|
1315
1324
|
}
|
|
1316
1325
|
}
|
|
@@ -1323,7 +1332,7 @@ export class EvalDeltaKeyValue extends BaseModel {
|
|
|
1323
1332
|
* @param key -
|
|
1324
1333
|
* @param value - Represents a TEAL value delta.
|
|
1325
1334
|
*/
|
|
1326
|
-
constructor(key, value) {
|
|
1335
|
+
constructor({ key, value }) {
|
|
1327
1336
|
super();
|
|
1328
1337
|
this.key = key;
|
|
1329
1338
|
this.value = value;
|
|
@@ -1339,7 +1348,10 @@ export class EvalDeltaKeyValue extends BaseModel {
|
|
|
1339
1348
|
throw new Error(`Response is missing required field 'key': ${data}`);
|
|
1340
1349
|
if (typeof data['value'] === 'undefined')
|
|
1341
1350
|
throw new Error(`Response is missing required field 'value': ${data}`);
|
|
1342
|
-
return new EvalDeltaKeyValue(
|
|
1351
|
+
return new EvalDeltaKeyValue({
|
|
1352
|
+
key: data['key'],
|
|
1353
|
+
value: EvalDelta.from_obj_for_encoding(data['value']),
|
|
1354
|
+
});
|
|
1343
1355
|
/* eslint-enable dot-notation */
|
|
1344
1356
|
}
|
|
1345
1357
|
}
|
|
@@ -1354,7 +1366,7 @@ export class LightBlockHeaderProof extends BaseModel {
|
|
|
1354
1366
|
* @param treedepth - Represents the depth of the tree that is being proven, i.e. the number of edges
|
|
1355
1367
|
* from a leaf to the root.
|
|
1356
1368
|
*/
|
|
1357
|
-
constructor(index, proof, treedepth) {
|
|
1369
|
+
constructor({ index, proof, treedepth, }) {
|
|
1358
1370
|
super();
|
|
1359
1371
|
this.index = index;
|
|
1360
1372
|
this.proof =
|
|
@@ -1377,7 +1389,11 @@ export class LightBlockHeaderProof extends BaseModel {
|
|
|
1377
1389
|
throw new Error(`Response is missing required field 'proof': ${data}`);
|
|
1378
1390
|
if (typeof data['treedepth'] === 'undefined')
|
|
1379
1391
|
throw new Error(`Response is missing required field 'treedepth': ${data}`);
|
|
1380
|
-
return new LightBlockHeaderProof(
|
|
1392
|
+
return new LightBlockHeaderProof({
|
|
1393
|
+
index: data['index'],
|
|
1394
|
+
proof: data['proof'],
|
|
1395
|
+
treedepth: data['treedepth'],
|
|
1396
|
+
});
|
|
1381
1397
|
/* eslint-enable dot-notation */
|
|
1382
1398
|
}
|
|
1383
1399
|
}
|
|
@@ -1600,7 +1616,7 @@ export class PendingTransactionsResponse extends BaseModel {
|
|
|
1600
1616
|
* @param topTransactions - An array of signed transaction objects.
|
|
1601
1617
|
* @param totalTransactions - Total number of transactions in the pool.
|
|
1602
1618
|
*/
|
|
1603
|
-
constructor(topTransactions, totalTransactions) {
|
|
1619
|
+
constructor({ topTransactions, totalTransactions, }) {
|
|
1604
1620
|
super();
|
|
1605
1621
|
this.topTransactions = topTransactions;
|
|
1606
1622
|
this.totalTransactions = totalTransactions;
|
|
@@ -1616,7 +1632,10 @@ export class PendingTransactionsResponse extends BaseModel {
|
|
|
1616
1632
|
throw new Error(`Response is missing required array field 'top-transactions': ${data}`);
|
|
1617
1633
|
if (typeof data['total-transactions'] === 'undefined')
|
|
1618
1634
|
throw new Error(`Response is missing required field 'total-transactions': ${data}`);
|
|
1619
|
-
return new PendingTransactionsResponse(
|
|
1635
|
+
return new PendingTransactionsResponse({
|
|
1636
|
+
topTransactions: data['top-transactions'],
|
|
1637
|
+
totalTransactions: data['total-transactions'],
|
|
1638
|
+
});
|
|
1620
1639
|
/* eslint-enable dot-notation */
|
|
1621
1640
|
}
|
|
1622
1641
|
}
|
|
@@ -1628,7 +1647,7 @@ export class PostTransactionsResponse extends BaseModel {
|
|
|
1628
1647
|
* Creates a new `PostTransactionsResponse` object.
|
|
1629
1648
|
* @param txid - encoding of the transaction hash.
|
|
1630
1649
|
*/
|
|
1631
|
-
constructor(txid) {
|
|
1650
|
+
constructor({ txid }) {
|
|
1632
1651
|
super();
|
|
1633
1652
|
this.txid = txid;
|
|
1634
1653
|
this.attribute_map = {
|
|
@@ -1640,7 +1659,9 @@ export class PostTransactionsResponse extends BaseModel {
|
|
|
1640
1659
|
/* eslint-disable dot-notation */
|
|
1641
1660
|
if (typeof data['txId'] === 'undefined')
|
|
1642
1661
|
throw new Error(`Response is missing required field 'txId': ${data}`);
|
|
1643
|
-
return new PostTransactionsResponse(
|
|
1662
|
+
return new PostTransactionsResponse({
|
|
1663
|
+
txid: data['txId'],
|
|
1664
|
+
});
|
|
1644
1665
|
/* eslint-enable dot-notation */
|
|
1645
1666
|
}
|
|
1646
1667
|
}
|
|
@@ -1653,7 +1674,7 @@ export class StateProof extends BaseModel {
|
|
|
1653
1674
|
* @param message - Represents the message that the state proofs are attesting to.
|
|
1654
1675
|
* @param stateproof - The encoded StateProof for the message.
|
|
1655
1676
|
*/
|
|
1656
|
-
constructor(message, stateproof) {
|
|
1677
|
+
constructor({ message, stateproof, }) {
|
|
1657
1678
|
super();
|
|
1658
1679
|
this.message = message;
|
|
1659
1680
|
this.stateproof =
|
|
@@ -1672,7 +1693,10 @@ export class StateProof extends BaseModel {
|
|
|
1672
1693
|
throw new Error(`Response is missing required field 'Message': ${data}`);
|
|
1673
1694
|
if (typeof data['StateProof'] === 'undefined')
|
|
1674
1695
|
throw new Error(`Response is missing required field 'StateProof': ${data}`);
|
|
1675
|
-
return new StateProof(
|
|
1696
|
+
return new StateProof({
|
|
1697
|
+
message: StateProofMessage.from_obj_for_encoding(data['Message']),
|
|
1698
|
+
stateproof: data['StateProof'],
|
|
1699
|
+
});
|
|
1676
1700
|
/* eslint-enable dot-notation */
|
|
1677
1701
|
}
|
|
1678
1702
|
}
|
|
@@ -1744,7 +1768,7 @@ export class SupplyResponse extends BaseModel {
|
|
|
1744
1768
|
* @param onlineMoney - OnlineMoney
|
|
1745
1769
|
* @param totalMoney - TotalMoney
|
|
1746
1770
|
*/
|
|
1747
|
-
constructor(currentRound, onlineMoney, totalMoney) {
|
|
1771
|
+
constructor({ currentRound, onlineMoney, totalMoney, }) {
|
|
1748
1772
|
super();
|
|
1749
1773
|
this.currentRound = currentRound;
|
|
1750
1774
|
this.onlineMoney = onlineMoney;
|
|
@@ -1764,7 +1788,11 @@ export class SupplyResponse extends BaseModel {
|
|
|
1764
1788
|
throw new Error(`Response is missing required field 'online-money': ${data}`);
|
|
1765
1789
|
if (typeof data['total-money'] === 'undefined')
|
|
1766
1790
|
throw new Error(`Response is missing required field 'total-money': ${data}`);
|
|
1767
|
-
return new SupplyResponse(
|
|
1791
|
+
return new SupplyResponse({
|
|
1792
|
+
currentRound: data['current_round'],
|
|
1793
|
+
onlineMoney: data['online-money'],
|
|
1794
|
+
totalMoney: data['total-money'],
|
|
1795
|
+
});
|
|
1768
1796
|
/* eslint-enable dot-notation */
|
|
1769
1797
|
}
|
|
1770
1798
|
}
|
|
@@ -1777,7 +1805,7 @@ export class TealKeyValue extends BaseModel {
|
|
|
1777
1805
|
* @param key -
|
|
1778
1806
|
* @param value - Represents a TEAL value.
|
|
1779
1807
|
*/
|
|
1780
|
-
constructor(key, value) {
|
|
1808
|
+
constructor({ key, value }) {
|
|
1781
1809
|
super();
|
|
1782
1810
|
this.key = key;
|
|
1783
1811
|
this.value = value;
|
|
@@ -1793,7 +1821,10 @@ export class TealKeyValue extends BaseModel {
|
|
|
1793
1821
|
throw new Error(`Response is missing required field 'key': ${data}`);
|
|
1794
1822
|
if (typeof data['value'] === 'undefined')
|
|
1795
1823
|
throw new Error(`Response is missing required field 'value': ${data}`);
|
|
1796
|
-
return new TealKeyValue(
|
|
1824
|
+
return new TealKeyValue({
|
|
1825
|
+
key: data['key'],
|
|
1826
|
+
value: TealValue.from_obj_for_encoding(data['value']),
|
|
1827
|
+
});
|
|
1797
1828
|
/* eslint-enable dot-notation */
|
|
1798
1829
|
}
|
|
1799
1830
|
}
|
|
@@ -1807,7 +1838,7 @@ export class TealValue extends BaseModel {
|
|
|
1807
1838
|
* @param bytes - (tb) bytes value.
|
|
1808
1839
|
* @param uint - (ui) uint value.
|
|
1809
1840
|
*/
|
|
1810
|
-
constructor(type, bytes, uint) {
|
|
1841
|
+
constructor({ type, bytes, uint, }) {
|
|
1811
1842
|
super();
|
|
1812
1843
|
this.type = type;
|
|
1813
1844
|
this.bytes = bytes;
|
|
@@ -1827,7 +1858,11 @@ export class TealValue extends BaseModel {
|
|
|
1827
1858
|
throw new Error(`Response is missing required field 'bytes': ${data}`);
|
|
1828
1859
|
if (typeof data['uint'] === 'undefined')
|
|
1829
1860
|
throw new Error(`Response is missing required field 'uint': ${data}`);
|
|
1830
|
-
return new TealValue(
|
|
1861
|
+
return new TealValue({
|
|
1862
|
+
type: data['type'],
|
|
1863
|
+
bytes: data['bytes'],
|
|
1864
|
+
uint: data['uint'],
|
|
1865
|
+
});
|
|
1831
1866
|
/* eslint-enable dot-notation */
|
|
1832
1867
|
}
|
|
1833
1868
|
}
|
|
@@ -1964,7 +1999,7 @@ export class Version extends BaseModel {
|
|
|
1964
1999
|
* @param genesisId -
|
|
1965
2000
|
* @param versions -
|
|
1966
2001
|
*/
|
|
1967
|
-
constructor(build, genesisHashB64, genesisId, versions) {
|
|
2002
|
+
constructor({ build, genesisHashB64, genesisId, versions, }) {
|
|
1968
2003
|
super();
|
|
1969
2004
|
this.build = build;
|
|
1970
2005
|
this.genesisHashB64 =
|
|
@@ -1991,7 +2026,12 @@ export class Version extends BaseModel {
|
|
|
1991
2026
|
throw new Error(`Response is missing required field 'genesis_id': ${data}`);
|
|
1992
2027
|
if (!Array.isArray(data['versions']))
|
|
1993
2028
|
throw new Error(`Response is missing required array field 'versions': ${data}`);
|
|
1994
|
-
return new Version(
|
|
2029
|
+
return new Version({
|
|
2030
|
+
build: BuildVersion.from_obj_for_encoding(data['build']),
|
|
2031
|
+
genesisHashB64: data['genesis_hash_b64'],
|
|
2032
|
+
genesisId: data['genesis_id'],
|
|
2033
|
+
versions: data['versions'],
|
|
2034
|
+
});
|
|
1995
2035
|
/* eslint-enable dot-notation */
|
|
1996
2036
|
}
|
|
1997
2037
|
}
|