algosdk 3.5.2 → 3.7.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/appAccess.js +8 -5
- package/dist/cjs/appAccess.js.map +1 -1
- package/dist/cjs/client/v2/algod/accountApplicationsInformation.js +38 -0
- package/dist/cjs/client/v2/algod/accountApplicationsInformation.js.map +1 -0
- package/dist/cjs/client/v2/algod/accountAssetsInformation.js +31 -0
- package/dist/cjs/client/v2/algod/accountAssetsInformation.js.map +1 -0
- package/dist/cjs/client/v2/algod/algod.js +23 -19
- package/dist/cjs/client/v2/algod/algod.js.map +1 -1
- package/dist/cjs/client/v2/algod/getApplicationBoxes.js +116 -5
- package/dist/cjs/client/v2/algod/getApplicationBoxes.js.map +1 -1
- package/dist/cjs/client/v2/algod/models/types.js +243 -452
- package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
- package/dist/cjs/ed25519-signer.js +76 -0
- package/dist/cjs/ed25519-signer.js.map +1 -0
- package/dist/cjs/encoding/address.js +61 -1
- package/dist/cjs/encoding/address.js.map +1 -1
- package/dist/cjs/falcon-signer.js +17 -0
- package/dist/cjs/falcon-signer.js.map +1 -0
- package/dist/cjs/logicsig.js +201 -16
- package/dist/cjs/logicsig.js.map +1 -1
- package/dist/cjs/main.js +32 -63
- package/dist/cjs/main.js.map +1 -1
- package/dist/cjs/mnemonic/mnemonic.js +26 -1
- package/dist/cjs/mnemonic/mnemonic.js.map +1 -1
- package/dist/cjs/multisigSigning.js +78 -1
- package/dist/cjs/multisigSigning.js.map +1 -1
- package/dist/cjs/pq-signer.js +54 -0
- package/dist/cjs/pq-signer.js.map +1 -0
- package/dist/cjs/signedTransaction.js +15 -1
- package/dist/cjs/signedTransaction.js.map +1 -1
- package/dist/cjs/signer.js.map +1 -1
- package/dist/cjs/signing.js +94 -7
- package/dist/cjs/signing.js.map +1 -1
- package/dist/cjs/transaction.js +9 -1
- package/dist/cjs/transaction.js.map +1 -1
- package/dist/cjs/types/transactions/encoded.js +51 -1
- package/dist/cjs/types/transactions/encoded.js.map +1 -1
- package/dist/cjs/utils/ed25519-check.js +69 -0
- package/dist/cjs/utils/ed25519-check.js.map +1 -0
- package/dist/esm/appAccess.js +8 -5
- package/dist/esm/appAccess.js.map +1 -1
- package/dist/esm/client/v2/algod/accountApplicationsInformation.js +32 -0
- package/dist/esm/client/v2/algod/accountApplicationsInformation.js.map +1 -0
- package/dist/esm/client/v2/algod/accountAssetsInformation.js +25 -0
- package/dist/esm/client/v2/algod/accountAssetsInformation.js.map +1 -0
- package/dist/esm/client/v2/algod/algod.js +23 -19
- package/dist/esm/client/v2/algod/algod.js.map +1 -1
- package/dist/esm/client/v2/algod/getApplicationBoxes.js +116 -5
- package/dist/esm/client/v2/algod/getApplicationBoxes.js.map +1 -1
- package/dist/esm/client/v2/algod/models/types.js +239 -445
- package/dist/esm/client/v2/algod/models/types.js.map +1 -1
- package/dist/esm/ed25519-signer.js +72 -0
- package/dist/esm/ed25519-signer.js.map +1 -0
- package/dist/esm/encoding/address.js +58 -0
- package/dist/esm/encoding/address.js.map +1 -1
- package/dist/esm/falcon-signer.js +13 -0
- package/dist/esm/falcon-signer.js.map +1 -0
- package/dist/esm/logicsig.js +200 -15
- package/dist/esm/logicsig.js.map +1 -1
- package/dist/esm/main.js +8 -56
- package/dist/esm/main.js.map +1 -1
- package/dist/esm/mnemonic/mnemonic.js +25 -1
- package/dist/esm/mnemonic/mnemonic.js.map +1 -1
- package/dist/esm/multisigSigning.js +75 -0
- package/dist/esm/multisigSigning.js.map +1 -1
- package/dist/esm/pq-signer.js +50 -0
- package/dist/esm/pq-signer.js.map +1 -0
- package/dist/esm/signedTransaction.js +16 -2
- package/dist/esm/signedTransaction.js.map +1 -1
- package/dist/esm/signer.js.map +1 -1
- package/dist/esm/signing.js +91 -8
- package/dist/esm/signing.js.map +1 -1
- package/dist/esm/transaction.js +9 -1
- package/dist/esm/transaction.js.map +1 -1
- package/dist/esm/types/transactions/encoded.js +49 -1
- package/dist/esm/types/transactions/encoded.js.map +1 -1
- package/dist/esm/utils/ed25519-check.js +65 -0
- package/dist/esm/utils/ed25519-check.js.map +1 -0
- package/dist/types/client/v2/algod/accountApplicationsInformation.d.ts +16 -0
- package/dist/types/client/v2/algod/accountAssetsInformation.d.ts +12 -0
- package/dist/types/client/v2/algod/algod.d.ts +19 -17
- package/dist/types/client/v2/algod/getApplicationBoxes.d.ts +100 -5
- package/dist/types/client/v2/algod/models/types.d.ts +146 -232
- package/dist/types/ed25519-signer.d.ts +7 -0
- package/dist/types/encoding/address.d.ts +37 -0
- package/dist/types/falcon-signer.d.ts +11 -0
- package/dist/types/logicsig.d.ts +72 -1
- package/dist/types/main.d.ts +8 -44
- package/dist/types/mnemonic/mnemonic.d.ts +13 -0
- package/dist/types/multisigSigning.d.ts +49 -0
- package/dist/types/pq-signer.d.ts +8 -0
- package/dist/types/signedTransaction.d.ts +7 -2
- package/dist/types/signer.d.ts +38 -0
- package/dist/types/signing.d.ts +45 -0
- package/dist/types/transaction.d.ts +9 -0
- package/dist/types/types/transactions/encoded.d.ts +27 -0
- package/dist/types/utils/ed25519-check.d.ts +10 -0
- package/package.json +2 -1
- package/src/appAccess.ts +10 -5
- package/src/client/v2/algod/accountApplicationsInformation.ts +46 -0
- package/src/client/v2/algod/accountAssetsInformation.ts +33 -0
- package/src/client/v2/algod/algod.ts +25 -20
- package/src/client/v2/algod/getApplicationBoxes.ts +123 -5
- package/src/client/v2/algod/models/types.ts +523 -846
- package/src/ed25519-signer.ts +125 -0
- package/src/encoding/address.ts +80 -0
- package/src/falcon-signer.ts +30 -0
- package/src/logicsig.ts +258 -16
- package/src/main.ts +30 -60
- package/src/mnemonic/mnemonic.ts +34 -1
- package/src/multisigSigning.ts +111 -0
- package/src/pq-signer.ts +90 -0
- package/src/signedTransaction.ts +24 -0
- package/src/signer.ts +53 -0
- package/src/signing.ts +109 -8
- package/src/transaction.ts +9 -1
- package/src/types/transactions/encoded.ts +88 -0
- package/src/utils/ed25519-check.ts +67 -0
- package/dist/cjs/client/v2/algod/dryrun.js +0 -34
- package/dist/cjs/client/v2/algod/dryrun.js.map +0 -1
- package/dist/cjs/dryrun.js +0 -214
- package/dist/cjs/dryrun.js.map +0 -1
- package/dist/esm/client/v2/algod/dryrun.js +0 -28
- package/dist/esm/client/v2/algod/dryrun.js.map +0 -1
- package/dist/esm/dryrun.js +0 -208
- package/dist/esm/dryrun.js.map +0 -1
- package/dist/types/client/v2/algod/dryrun.d.ts +0 -11
- package/dist/types/dryrun.d.ts +0 -28
- package/src/client/v2/algod/dryrun.ts +0 -38
- package/src/dryrun.ts +0 -292
|
@@ -338,6 +338,96 @@ export class Account {
|
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* AccountApplicationResource describes the account's application resource (local
|
|
343
|
+
* state and params if the account is the creator) for a specific application ID.
|
|
344
|
+
*/
|
|
345
|
+
export class AccountApplicationResource {
|
|
346
|
+
static get encodingSchema() {
|
|
347
|
+
if (!this.encodingSchemaValue) {
|
|
348
|
+
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
349
|
+
this.encodingSchemaValue.pushEntries({ key: 'id', valueSchema: new Uint64Schema(), omitEmpty: true }, {
|
|
350
|
+
key: 'app-local-state',
|
|
351
|
+
valueSchema: new OptionalSchema(ApplicationLocalState.encodingSchema),
|
|
352
|
+
omitEmpty: true,
|
|
353
|
+
}, {
|
|
354
|
+
key: 'created-at-round',
|
|
355
|
+
valueSchema: new OptionalSchema(new Uint64Schema()),
|
|
356
|
+
omitEmpty: true,
|
|
357
|
+
}, {
|
|
358
|
+
key: 'deleted',
|
|
359
|
+
valueSchema: new OptionalSchema(new BooleanSchema()),
|
|
360
|
+
omitEmpty: true,
|
|
361
|
+
}, {
|
|
362
|
+
key: 'params',
|
|
363
|
+
valueSchema: new OptionalSchema(ApplicationParams.encodingSchema),
|
|
364
|
+
omitEmpty: true,
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
return this.encodingSchemaValue;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Creates a new `AccountApplicationResource` object.
|
|
371
|
+
* @param id - The application ID.
|
|
372
|
+
* @param appLocalState - (appl) the application local data stored in this account.
|
|
373
|
+
* The raw account uses `AppLocalState` for this type.
|
|
374
|
+
* @param createdAtRound - Round when the account opted into or created the application.
|
|
375
|
+
* @param deleted - Whether the application has been deleted.
|
|
376
|
+
* @param params - (appp) parameters of the application created by this account including app
|
|
377
|
+
* global data.
|
|
378
|
+
* The raw account uses `AppParams` for this type.
|
|
379
|
+
* Only present if the account is the creator and `include=params` is specified.
|
|
380
|
+
*/
|
|
381
|
+
constructor({ id, appLocalState, createdAtRound, deleted, params, }) {
|
|
382
|
+
this.id = ensureSafeInteger(id);
|
|
383
|
+
this.appLocalState = appLocalState;
|
|
384
|
+
this.createdAtRound =
|
|
385
|
+
typeof createdAtRound === 'undefined'
|
|
386
|
+
? undefined
|
|
387
|
+
: ensureSafeInteger(createdAtRound);
|
|
388
|
+
this.deleted = deleted;
|
|
389
|
+
this.params = params;
|
|
390
|
+
}
|
|
391
|
+
// eslint-disable-next-line class-methods-use-this
|
|
392
|
+
getEncodingSchema() {
|
|
393
|
+
return AccountApplicationResource.encodingSchema;
|
|
394
|
+
}
|
|
395
|
+
toEncodingData() {
|
|
396
|
+
return new Map([
|
|
397
|
+
['id', this.id],
|
|
398
|
+
[
|
|
399
|
+
'app-local-state',
|
|
400
|
+
typeof this.appLocalState !== 'undefined'
|
|
401
|
+
? this.appLocalState.toEncodingData()
|
|
402
|
+
: undefined,
|
|
403
|
+
],
|
|
404
|
+
['created-at-round', this.createdAtRound],
|
|
405
|
+
['deleted', this.deleted],
|
|
406
|
+
[
|
|
407
|
+
'params',
|
|
408
|
+
typeof this.params !== 'undefined'
|
|
409
|
+
? this.params.toEncodingData()
|
|
410
|
+
: undefined,
|
|
411
|
+
],
|
|
412
|
+
]);
|
|
413
|
+
}
|
|
414
|
+
static fromEncodingData(data) {
|
|
415
|
+
if (!(data instanceof Map)) {
|
|
416
|
+
throw new Error(`Invalid decoded AccountApplicationResource: ${data}`);
|
|
417
|
+
}
|
|
418
|
+
return new AccountApplicationResource({
|
|
419
|
+
id: data.get('id'),
|
|
420
|
+
appLocalState: typeof data.get('app-local-state') !== 'undefined'
|
|
421
|
+
? ApplicationLocalState.fromEncodingData(data.get('app-local-state'))
|
|
422
|
+
: undefined,
|
|
423
|
+
createdAtRound: data.get('created-at-round'),
|
|
424
|
+
deleted: data.get('deleted'),
|
|
425
|
+
params: typeof data.get('params') !== 'undefined'
|
|
426
|
+
? ApplicationParams.fromEncodingData(data.get('params'))
|
|
427
|
+
: undefined,
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
}
|
|
341
431
|
/**
|
|
342
432
|
* AccountApplicationResponse describes the account's application local state and
|
|
343
433
|
* global state (AppLocalState and AppParams, if either exists) for a specific
|
|
@@ -410,6 +500,70 @@ export class AccountApplicationResponse {
|
|
|
410
500
|
});
|
|
411
501
|
}
|
|
412
502
|
}
|
|
503
|
+
/**
|
|
504
|
+
* AccountApplicationsInformationResponse contains a list of application resources
|
|
505
|
+
* for an account.
|
|
506
|
+
*/
|
|
507
|
+
export class AccountApplicationsInformationResponse {
|
|
508
|
+
static get encodingSchema() {
|
|
509
|
+
if (!this.encodingSchemaValue) {
|
|
510
|
+
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
511
|
+
this.encodingSchemaValue.pushEntries({ key: 'round', valueSchema: new Uint64Schema(), omitEmpty: true }, {
|
|
512
|
+
key: 'application-resources',
|
|
513
|
+
valueSchema: new OptionalSchema(new ArraySchema(AccountApplicationResource.encodingSchema)),
|
|
514
|
+
omitEmpty: true,
|
|
515
|
+
}, {
|
|
516
|
+
key: 'next-token',
|
|
517
|
+
valueSchema: new OptionalSchema(new StringSchema()),
|
|
518
|
+
omitEmpty: true,
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
return this.encodingSchemaValue;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Creates a new `AccountApplicationsInformationResponse` object.
|
|
525
|
+
* @param round - The round for which this information is relevant.
|
|
526
|
+
* @param applicationResources -
|
|
527
|
+
* @param nextToken - Used for pagination, when making another request provide this token with the
|
|
528
|
+
* next parameter. The next token is the next application ID to use as the
|
|
529
|
+
* pagination cursor.
|
|
530
|
+
*/
|
|
531
|
+
constructor({ round, applicationResources, nextToken, }) {
|
|
532
|
+
this.round = ensureSafeInteger(round);
|
|
533
|
+
this.applicationResources = applicationResources;
|
|
534
|
+
this.nextToken = nextToken;
|
|
535
|
+
}
|
|
536
|
+
// eslint-disable-next-line class-methods-use-this
|
|
537
|
+
getEncodingSchema() {
|
|
538
|
+
return AccountApplicationsInformationResponse.encodingSchema;
|
|
539
|
+
}
|
|
540
|
+
toEncodingData() {
|
|
541
|
+
return new Map([
|
|
542
|
+
['round', this.round],
|
|
543
|
+
[
|
|
544
|
+
'application-resources',
|
|
545
|
+
typeof this.applicationResources !== 'undefined'
|
|
546
|
+
? this.applicationResources.map((v) => v.toEncodingData())
|
|
547
|
+
: undefined,
|
|
548
|
+
],
|
|
549
|
+
['next-token', this.nextToken],
|
|
550
|
+
]);
|
|
551
|
+
}
|
|
552
|
+
static fromEncodingData(data) {
|
|
553
|
+
if (!(data instanceof Map)) {
|
|
554
|
+
throw new Error(`Invalid decoded AccountApplicationsInformationResponse: ${data}`);
|
|
555
|
+
}
|
|
556
|
+
return new AccountApplicationsInformationResponse({
|
|
557
|
+
round: data.get('round'),
|
|
558
|
+
applicationResources: typeof data.get('application-resources') !== 'undefined'
|
|
559
|
+
? data
|
|
560
|
+
.get('application-resources')
|
|
561
|
+
.map((v) => AccountApplicationResource.fromEncodingData(v))
|
|
562
|
+
: undefined,
|
|
563
|
+
nextToken: data.get('next-token'),
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
}
|
|
413
567
|
/**
|
|
414
568
|
* AccountAssetHolding describes the account's asset holding and asset parameters
|
|
415
569
|
* (if either exist) for a specific asset ID.
|
|
@@ -797,7 +951,7 @@ export class Application {
|
|
|
797
951
|
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
798
952
|
this.encodingSchemaValue.pushEntries({ key: 'id', valueSchema: new Uint64Schema(), omitEmpty: true }, {
|
|
799
953
|
key: 'params',
|
|
800
|
-
valueSchema: ApplicationParams.encodingSchema,
|
|
954
|
+
valueSchema: new OptionalSchema(ApplicationParams.encodingSchema),
|
|
801
955
|
omitEmpty: true,
|
|
802
956
|
});
|
|
803
957
|
}
|
|
@@ -819,7 +973,12 @@ export class Application {
|
|
|
819
973
|
toEncodingData() {
|
|
820
974
|
return new Map([
|
|
821
975
|
['id', this.id],
|
|
822
|
-
[
|
|
976
|
+
[
|
|
977
|
+
'params',
|
|
978
|
+
typeof this.params !== 'undefined'
|
|
979
|
+
? this.params.toEncodingData()
|
|
980
|
+
: undefined,
|
|
981
|
+
],
|
|
823
982
|
]);
|
|
824
983
|
}
|
|
825
984
|
static fromEncodingData(data) {
|
|
@@ -828,7 +987,9 @@ export class Application {
|
|
|
828
987
|
}
|
|
829
988
|
return new Application({
|
|
830
989
|
id: data.get('id'),
|
|
831
|
-
params:
|
|
990
|
+
params: typeof data.get('params') !== 'undefined'
|
|
991
|
+
? ApplicationParams.fromEncodingData(data.get('params'))
|
|
992
|
+
: undefined,
|
|
832
993
|
});
|
|
833
994
|
}
|
|
834
995
|
}
|
|
@@ -1103,6 +1264,10 @@ export class ApplicationParams {
|
|
|
1103
1264
|
key: 'local-state-schema',
|
|
1104
1265
|
valueSchema: new OptionalSchema(ApplicationStateSchema.encodingSchema),
|
|
1105
1266
|
omitEmpty: true,
|
|
1267
|
+
}, {
|
|
1268
|
+
key: 'size-sponsor',
|
|
1269
|
+
valueSchema: new OptionalSchema(new StringSchema()),
|
|
1270
|
+
omitEmpty: true,
|
|
1106
1271
|
}, {
|
|
1107
1272
|
key: 'version',
|
|
1108
1273
|
valueSchema: new OptionalSchema(new Uint64Schema()),
|
|
@@ -1121,9 +1286,10 @@ export class ApplicationParams {
|
|
|
1121
1286
|
* @param globalState - (gs) global state
|
|
1122
1287
|
* @param globalStateSchema - (gsch) global schema
|
|
1123
1288
|
* @param localStateSchema - (lsch) local schema
|
|
1289
|
+
* @param sizeSponsor - (ss) the account responsible for extra pages and global state MBR
|
|
1124
1290
|
* @param version - (v) the number of updates to the application programs
|
|
1125
1291
|
*/
|
|
1126
|
-
constructor({ approvalProgram, clearStateProgram, creator, extraProgramPages, globalState, globalStateSchema, localStateSchema, version, }) {
|
|
1292
|
+
constructor({ approvalProgram, clearStateProgram, creator, extraProgramPages, globalState, globalStateSchema, localStateSchema, sizeSponsor, version, }) {
|
|
1127
1293
|
this.approvalProgram =
|
|
1128
1294
|
typeof approvalProgram === 'string'
|
|
1129
1295
|
? base64ToBytes(approvalProgram)
|
|
@@ -1141,6 +1307,10 @@ export class ApplicationParams {
|
|
|
1141
1307
|
this.globalState = globalState;
|
|
1142
1308
|
this.globalStateSchema = globalStateSchema;
|
|
1143
1309
|
this.localStateSchema = localStateSchema;
|
|
1310
|
+
this.sizeSponsor =
|
|
1311
|
+
typeof sizeSponsor === 'string'
|
|
1312
|
+
? Address.fromString(sizeSponsor)
|
|
1313
|
+
: sizeSponsor;
|
|
1144
1314
|
this.version =
|
|
1145
1315
|
typeof version === 'undefined' ? undefined : ensureSafeInteger(version);
|
|
1146
1316
|
}
|
|
@@ -1172,6 +1342,12 @@ export class ApplicationParams {
|
|
|
1172
1342
|
? this.localStateSchema.toEncodingData()
|
|
1173
1343
|
: undefined,
|
|
1174
1344
|
],
|
|
1345
|
+
[
|
|
1346
|
+
'size-sponsor',
|
|
1347
|
+
typeof this.sizeSponsor !== 'undefined'
|
|
1348
|
+
? this.sizeSponsor.toString()
|
|
1349
|
+
: undefined,
|
|
1350
|
+
],
|
|
1175
1351
|
['version', this.version],
|
|
1176
1352
|
]);
|
|
1177
1353
|
}
|
|
@@ -1195,6 +1371,7 @@ export class ApplicationParams {
|
|
|
1195
1371
|
localStateSchema: typeof data.get('local-state-schema') !== 'undefined'
|
|
1196
1372
|
? ApplicationStateSchema.fromEncodingData(data.get('local-state-schema'))
|
|
1197
1373
|
: undefined,
|
|
1374
|
+
sizeSponsor: data.get('size-sponsor'),
|
|
1198
1375
|
version: data.get('version'),
|
|
1199
1376
|
});
|
|
1200
1377
|
}
|
|
@@ -1331,7 +1508,7 @@ export class Asset {
|
|
|
1331
1508
|
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
1332
1509
|
this.encodingSchemaValue.pushEntries({ key: 'index', valueSchema: new Uint64Schema(), omitEmpty: true }, {
|
|
1333
1510
|
key: 'params',
|
|
1334
|
-
valueSchema: AssetParams.encodingSchema,
|
|
1511
|
+
valueSchema: new OptionalSchema(AssetParams.encodingSchema),
|
|
1335
1512
|
omitEmpty: true,
|
|
1336
1513
|
});
|
|
1337
1514
|
}
|
|
@@ -1356,7 +1533,12 @@ export class Asset {
|
|
|
1356
1533
|
toEncodingData() {
|
|
1357
1534
|
return new Map([
|
|
1358
1535
|
['index', this.index],
|
|
1359
|
-
[
|
|
1536
|
+
[
|
|
1537
|
+
'params',
|
|
1538
|
+
typeof this.params !== 'undefined'
|
|
1539
|
+
? this.params.toEncodingData()
|
|
1540
|
+
: undefined,
|
|
1541
|
+
],
|
|
1360
1542
|
]);
|
|
1361
1543
|
}
|
|
1362
1544
|
static fromEncodingData(data) {
|
|
@@ -1365,7 +1547,9 @@ export class Asset {
|
|
|
1365
1547
|
}
|
|
1366
1548
|
return new Asset({
|
|
1367
1549
|
index: data.get('index'),
|
|
1368
|
-
params:
|
|
1550
|
+
params: typeof data.get('params') !== 'undefined'
|
|
1551
|
+
? AssetParams.fromEncodingData(data.get('params'))
|
|
1552
|
+
: undefined,
|
|
1369
1553
|
});
|
|
1370
1554
|
}
|
|
1371
1555
|
}
|
|
@@ -1934,9 +2118,9 @@ export class BoxDescriptor {
|
|
|
1934
2118
|
static get encodingSchema() {
|
|
1935
2119
|
if (!this.encodingSchemaValue) {
|
|
1936
2120
|
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
1937
|
-
this.encodingSchemaValue.pushEntries({
|
|
1938
|
-
key: '
|
|
1939
|
-
valueSchema: new ByteArraySchema(),
|
|
2121
|
+
this.encodingSchemaValue.pushEntries({ key: 'name', valueSchema: new ByteArraySchema(), omitEmpty: true }, {
|
|
2122
|
+
key: 'value',
|
|
2123
|
+
valueSchema: new OptionalSchema(new ByteArraySchema()),
|
|
1940
2124
|
omitEmpty: true,
|
|
1941
2125
|
});
|
|
1942
2126
|
}
|
|
@@ -1945,16 +2129,22 @@ export class BoxDescriptor {
|
|
|
1945
2129
|
/**
|
|
1946
2130
|
* Creates a new `BoxDescriptor` object.
|
|
1947
2131
|
* @param name - Base64 encoded box name
|
|
2132
|
+
* @param value - Base64 encoded box value. Present only when the `values` query parameter is set
|
|
2133
|
+
* to true.
|
|
1948
2134
|
*/
|
|
1949
|
-
constructor({ name }) {
|
|
2135
|
+
constructor({ name, value, }) {
|
|
1950
2136
|
this.name = typeof name === 'string' ? base64ToBytes(name) : name;
|
|
2137
|
+
this.value = typeof value === 'string' ? base64ToBytes(value) : value;
|
|
1951
2138
|
}
|
|
1952
2139
|
// eslint-disable-next-line class-methods-use-this
|
|
1953
2140
|
getEncodingSchema() {
|
|
1954
2141
|
return BoxDescriptor.encodingSchema;
|
|
1955
2142
|
}
|
|
1956
2143
|
toEncodingData() {
|
|
1957
|
-
return new Map([
|
|
2144
|
+
return new Map([
|
|
2145
|
+
['name', this.name],
|
|
2146
|
+
['value', this.value],
|
|
2147
|
+
]);
|
|
1958
2148
|
}
|
|
1959
2149
|
static fromEncodingData(data) {
|
|
1960
2150
|
if (!(data instanceof Map)) {
|
|
@@ -1962,6 +2152,7 @@ export class BoxDescriptor {
|
|
|
1962
2152
|
}
|
|
1963
2153
|
return new BoxDescriptor({
|
|
1964
2154
|
name: data.get('name'),
|
|
2155
|
+
value: data.get('value'),
|
|
1965
2156
|
});
|
|
1966
2157
|
}
|
|
1967
2158
|
}
|
|
@@ -2006,7 +2197,7 @@ export class BoxReference {
|
|
|
2006
2197
|
}
|
|
2007
2198
|
}
|
|
2008
2199
|
/**
|
|
2009
|
-
*
|
|
2200
|
+
* Boxes of an application
|
|
2010
2201
|
*/
|
|
2011
2202
|
export class BoxesResponse {
|
|
2012
2203
|
static get encodingSchema() {
|
|
@@ -2016,6 +2207,14 @@ export class BoxesResponse {
|
|
|
2016
2207
|
key: 'boxes',
|
|
2017
2208
|
valueSchema: new ArraySchema(BoxDescriptor.encodingSchema),
|
|
2018
2209
|
omitEmpty: true,
|
|
2210
|
+
}, {
|
|
2211
|
+
key: 'next-token',
|
|
2212
|
+
valueSchema: new OptionalSchema(new StringSchema()),
|
|
2213
|
+
omitEmpty: true,
|
|
2214
|
+
}, {
|
|
2215
|
+
key: 'round',
|
|
2216
|
+
valueSchema: new OptionalSchema(new Uint64Schema()),
|
|
2217
|
+
omitEmpty: true,
|
|
2019
2218
|
});
|
|
2020
2219
|
}
|
|
2021
2220
|
return this.encodingSchemaValue;
|
|
@@ -2023,9 +2222,16 @@ export class BoxesResponse {
|
|
|
2023
2222
|
/**
|
|
2024
2223
|
* Creates a new `BoxesResponse` object.
|
|
2025
2224
|
* @param boxes -
|
|
2225
|
+
* @param nextToken - Used for pagination, when making another request provide this token with the
|
|
2226
|
+
* next parameter. The next token is the box name to use as the pagination cursor,
|
|
2227
|
+
* encoded in the goal app call arg form.
|
|
2228
|
+
* @param round - The round for which this information is relevant.
|
|
2026
2229
|
*/
|
|
2027
|
-
constructor({ boxes }) {
|
|
2230
|
+
constructor({ boxes, nextToken, round, }) {
|
|
2028
2231
|
this.boxes = boxes;
|
|
2232
|
+
this.nextToken = nextToken;
|
|
2233
|
+
this.round =
|
|
2234
|
+
typeof round === 'undefined' ? undefined : ensureSafeInteger(round);
|
|
2029
2235
|
}
|
|
2030
2236
|
// eslint-disable-next-line class-methods-use-this
|
|
2031
2237
|
getEncodingSchema() {
|
|
@@ -2034,6 +2240,8 @@ export class BoxesResponse {
|
|
|
2034
2240
|
toEncodingData() {
|
|
2035
2241
|
return new Map([
|
|
2036
2242
|
['boxes', this.boxes.map((v) => v.toEncodingData())],
|
|
2243
|
+
['next-token', this.nextToken],
|
|
2244
|
+
['round', this.round],
|
|
2037
2245
|
]);
|
|
2038
2246
|
}
|
|
2039
2247
|
static fromEncodingData(data) {
|
|
@@ -2042,6 +2250,8 @@ export class BoxesResponse {
|
|
|
2042
2250
|
}
|
|
2043
2251
|
return new BoxesResponse({
|
|
2044
2252
|
boxes: (data.get('boxes') ?? []).map((v) => BoxDescriptor.fromEncodingData(v)),
|
|
2253
|
+
nextToken: data.get('next-token'),
|
|
2254
|
+
round: data.get('round'),
|
|
2045
2255
|
});
|
|
2046
2256
|
}
|
|
2047
2257
|
}
|
|
@@ -2199,433 +2409,6 @@ export class DisassembleResponse {
|
|
|
2199
2409
|
});
|
|
2200
2410
|
}
|
|
2201
2411
|
}
|
|
2202
|
-
/**
|
|
2203
|
-
* Request data type for dryrun endpoint. Given the Transactions and simulated
|
|
2204
|
-
* ledger state upload, run TEAL scripts and return debugging information.
|
|
2205
|
-
*/
|
|
2206
|
-
export class DryrunRequest {
|
|
2207
|
-
static get encodingSchema() {
|
|
2208
|
-
if (!this.encodingSchemaValue) {
|
|
2209
|
-
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
2210
|
-
this.encodingSchemaValue.pushEntries({
|
|
2211
|
-
key: 'accounts',
|
|
2212
|
-
valueSchema: new ArraySchema(Account.encodingSchema),
|
|
2213
|
-
omitEmpty: true,
|
|
2214
|
-
}, {
|
|
2215
|
-
key: 'apps',
|
|
2216
|
-
valueSchema: new ArraySchema(Application.encodingSchema),
|
|
2217
|
-
omitEmpty: true,
|
|
2218
|
-
}, {
|
|
2219
|
-
key: 'latest-timestamp',
|
|
2220
|
-
valueSchema: new Uint64Schema(),
|
|
2221
|
-
omitEmpty: true,
|
|
2222
|
-
}, {
|
|
2223
|
-
key: 'protocol-version',
|
|
2224
|
-
valueSchema: new StringSchema(),
|
|
2225
|
-
omitEmpty: true,
|
|
2226
|
-
}, { key: 'round', valueSchema: new Uint64Schema(), omitEmpty: true }, {
|
|
2227
|
-
key: 'sources',
|
|
2228
|
-
valueSchema: new ArraySchema(DryrunSource.encodingSchema),
|
|
2229
|
-
omitEmpty: true,
|
|
2230
|
-
}, {
|
|
2231
|
-
key: 'txns',
|
|
2232
|
-
valueSchema: new ArraySchema(SignedTransaction.encodingSchema),
|
|
2233
|
-
omitEmpty: true,
|
|
2234
|
-
});
|
|
2235
|
-
}
|
|
2236
|
-
return this.encodingSchemaValue;
|
|
2237
|
-
}
|
|
2238
|
-
/**
|
|
2239
|
-
* Creates a new `DryrunRequest` object.
|
|
2240
|
-
* @param accounts -
|
|
2241
|
-
* @param apps -
|
|
2242
|
-
* @param latestTimestamp - LatestTimestamp is available to some TEAL scripts. Defaults to the latest
|
|
2243
|
-
* confirmed timestamp this algod is attached to.
|
|
2244
|
-
* @param protocolVersion - ProtocolVersion specifies a specific version string to operate under, otherwise
|
|
2245
|
-
* whatever the current protocol of the network this algod is running in.
|
|
2246
|
-
* @param round - Round is available to some TEAL scripts. Defaults to the current round on the
|
|
2247
|
-
* network this algod is attached to.
|
|
2248
|
-
* @param sources -
|
|
2249
|
-
* @param txns -
|
|
2250
|
-
*/
|
|
2251
|
-
constructor({ accounts, apps, latestTimestamp, protocolVersion, round, sources, txns, }) {
|
|
2252
|
-
this.accounts = accounts;
|
|
2253
|
-
this.apps = apps;
|
|
2254
|
-
this.latestTimestamp = ensureSafeInteger(latestTimestamp);
|
|
2255
|
-
this.protocolVersion = protocolVersion;
|
|
2256
|
-
this.round = ensureBigInt(round);
|
|
2257
|
-
this.sources = sources;
|
|
2258
|
-
this.txns = txns;
|
|
2259
|
-
}
|
|
2260
|
-
// eslint-disable-next-line class-methods-use-this
|
|
2261
|
-
getEncodingSchema() {
|
|
2262
|
-
return DryrunRequest.encodingSchema;
|
|
2263
|
-
}
|
|
2264
|
-
toEncodingData() {
|
|
2265
|
-
return new Map([
|
|
2266
|
-
['accounts', this.accounts.map((v) => v.toEncodingData())],
|
|
2267
|
-
['apps', this.apps.map((v) => v.toEncodingData())],
|
|
2268
|
-
['latest-timestamp', this.latestTimestamp],
|
|
2269
|
-
['protocol-version', this.protocolVersion],
|
|
2270
|
-
['round', this.round],
|
|
2271
|
-
['sources', this.sources.map((v) => v.toEncodingData())],
|
|
2272
|
-
['txns', this.txns.map((v) => v.toEncodingData())],
|
|
2273
|
-
]);
|
|
2274
|
-
}
|
|
2275
|
-
static fromEncodingData(data) {
|
|
2276
|
-
if (!(data instanceof Map)) {
|
|
2277
|
-
throw new Error(`Invalid decoded DryrunRequest: ${data}`);
|
|
2278
|
-
}
|
|
2279
|
-
return new DryrunRequest({
|
|
2280
|
-
accounts: (data.get('accounts') ?? []).map((v) => Account.fromEncodingData(v)),
|
|
2281
|
-
apps: (data.get('apps') ?? []).map((v) => Application.fromEncodingData(v)),
|
|
2282
|
-
latestTimestamp: data.get('latest-timestamp'),
|
|
2283
|
-
protocolVersion: data.get('protocol-version'),
|
|
2284
|
-
round: data.get('round'),
|
|
2285
|
-
sources: (data.get('sources') ?? []).map((v) => DryrunSource.fromEncodingData(v)),
|
|
2286
|
-
txns: (data.get('txns') ?? []).map((v) => SignedTransaction.fromEncodingData(v)),
|
|
2287
|
-
});
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
/**
|
|
2291
|
-
* DryrunResponse contains per-txn debug information from a dryrun.
|
|
2292
|
-
*/
|
|
2293
|
-
export class DryrunResponse {
|
|
2294
|
-
static get encodingSchema() {
|
|
2295
|
-
if (!this.encodingSchemaValue) {
|
|
2296
|
-
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
2297
|
-
this.encodingSchemaValue.pushEntries({ key: 'error', valueSchema: new StringSchema(), omitEmpty: true }, {
|
|
2298
|
-
key: 'protocol-version',
|
|
2299
|
-
valueSchema: new StringSchema(),
|
|
2300
|
-
omitEmpty: true,
|
|
2301
|
-
}, {
|
|
2302
|
-
key: 'txns',
|
|
2303
|
-
valueSchema: new ArraySchema(DryrunTxnResult.encodingSchema),
|
|
2304
|
-
omitEmpty: true,
|
|
2305
|
-
});
|
|
2306
|
-
}
|
|
2307
|
-
return this.encodingSchemaValue;
|
|
2308
|
-
}
|
|
2309
|
-
/**
|
|
2310
|
-
* Creates a new `DryrunResponse` object.
|
|
2311
|
-
* @param error -
|
|
2312
|
-
* @param protocolVersion - Protocol version is the protocol version Dryrun was operated under.
|
|
2313
|
-
* @param txns -
|
|
2314
|
-
*/
|
|
2315
|
-
constructor({ error, protocolVersion, txns, }) {
|
|
2316
|
-
this.error = error;
|
|
2317
|
-
this.protocolVersion = protocolVersion;
|
|
2318
|
-
this.txns = txns;
|
|
2319
|
-
}
|
|
2320
|
-
// eslint-disable-next-line class-methods-use-this
|
|
2321
|
-
getEncodingSchema() {
|
|
2322
|
-
return DryrunResponse.encodingSchema;
|
|
2323
|
-
}
|
|
2324
|
-
toEncodingData() {
|
|
2325
|
-
return new Map([
|
|
2326
|
-
['error', this.error],
|
|
2327
|
-
['protocol-version', this.protocolVersion],
|
|
2328
|
-
['txns', this.txns.map((v) => v.toEncodingData())],
|
|
2329
|
-
]);
|
|
2330
|
-
}
|
|
2331
|
-
static fromEncodingData(data) {
|
|
2332
|
-
if (!(data instanceof Map)) {
|
|
2333
|
-
throw new Error(`Invalid decoded DryrunResponse: ${data}`);
|
|
2334
|
-
}
|
|
2335
|
-
return new DryrunResponse({
|
|
2336
|
-
error: data.get('error'),
|
|
2337
|
-
protocolVersion: data.get('protocol-version'),
|
|
2338
|
-
txns: (data.get('txns') ?? []).map((v) => DryrunTxnResult.fromEncodingData(v)),
|
|
2339
|
-
});
|
|
2340
|
-
}
|
|
2341
|
-
}
|
|
2342
|
-
/**
|
|
2343
|
-
* DryrunSource is TEAL source text that gets uploaded, compiled, and inserted into
|
|
2344
|
-
* transactions or application state.
|
|
2345
|
-
*/
|
|
2346
|
-
export class DryrunSource {
|
|
2347
|
-
static get encodingSchema() {
|
|
2348
|
-
if (!this.encodingSchemaValue) {
|
|
2349
|
-
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
2350
|
-
this.encodingSchemaValue.pushEntries({ key: 'app-index', valueSchema: new Uint64Schema(), omitEmpty: true }, { key: 'field-name', valueSchema: new StringSchema(), omitEmpty: true }, { key: 'source', valueSchema: new StringSchema(), omitEmpty: true }, { key: 'txn-index', valueSchema: new Uint64Schema(), omitEmpty: true });
|
|
2351
|
-
}
|
|
2352
|
-
return this.encodingSchemaValue;
|
|
2353
|
-
}
|
|
2354
|
-
/**
|
|
2355
|
-
* Creates a new `DryrunSource` object.
|
|
2356
|
-
* @param appIndex -
|
|
2357
|
-
* @param fieldName - FieldName is what kind of sources this is. If lsig then it goes into the
|
|
2358
|
-
* transactions[this.TxnIndex].LogicSig. If approv or clearp it goes into the
|
|
2359
|
-
* Approval Program or Clear State Program of application[this.AppIndex].
|
|
2360
|
-
* @param source -
|
|
2361
|
-
* @param txnIndex -
|
|
2362
|
-
*/
|
|
2363
|
-
constructor({ appIndex, fieldName, source, txnIndex, }) {
|
|
2364
|
-
this.appIndex = ensureBigInt(appIndex);
|
|
2365
|
-
this.fieldName = fieldName;
|
|
2366
|
-
this.source = source;
|
|
2367
|
-
this.txnIndex = ensureSafeInteger(txnIndex);
|
|
2368
|
-
}
|
|
2369
|
-
// eslint-disable-next-line class-methods-use-this
|
|
2370
|
-
getEncodingSchema() {
|
|
2371
|
-
return DryrunSource.encodingSchema;
|
|
2372
|
-
}
|
|
2373
|
-
toEncodingData() {
|
|
2374
|
-
return new Map([
|
|
2375
|
-
['app-index', this.appIndex],
|
|
2376
|
-
['field-name', this.fieldName],
|
|
2377
|
-
['source', this.source],
|
|
2378
|
-
['txn-index', this.txnIndex],
|
|
2379
|
-
]);
|
|
2380
|
-
}
|
|
2381
|
-
static fromEncodingData(data) {
|
|
2382
|
-
if (!(data instanceof Map)) {
|
|
2383
|
-
throw new Error(`Invalid decoded DryrunSource: ${data}`);
|
|
2384
|
-
}
|
|
2385
|
-
return new DryrunSource({
|
|
2386
|
-
appIndex: data.get('app-index'),
|
|
2387
|
-
fieldName: data.get('field-name'),
|
|
2388
|
-
source: data.get('source'),
|
|
2389
|
-
txnIndex: data.get('txn-index'),
|
|
2390
|
-
});
|
|
2391
|
-
}
|
|
2392
|
-
}
|
|
2393
|
-
/**
|
|
2394
|
-
* Stores the TEAL eval step data
|
|
2395
|
-
*/
|
|
2396
|
-
export class DryrunState {
|
|
2397
|
-
static get encodingSchema() {
|
|
2398
|
-
if (!this.encodingSchemaValue) {
|
|
2399
|
-
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
2400
|
-
this.encodingSchemaValue.pushEntries({ key: 'line', valueSchema: new Uint64Schema(), omitEmpty: true }, { key: 'pc', valueSchema: new Uint64Schema(), omitEmpty: true }, {
|
|
2401
|
-
key: 'stack',
|
|
2402
|
-
valueSchema: new ArraySchema(TealValue.encodingSchema),
|
|
2403
|
-
omitEmpty: true,
|
|
2404
|
-
}, {
|
|
2405
|
-
key: 'error',
|
|
2406
|
-
valueSchema: new OptionalSchema(new StringSchema()),
|
|
2407
|
-
omitEmpty: true,
|
|
2408
|
-
}, {
|
|
2409
|
-
key: 'scratch',
|
|
2410
|
-
valueSchema: new OptionalSchema(new ArraySchema(TealValue.encodingSchema)),
|
|
2411
|
-
omitEmpty: true,
|
|
2412
|
-
});
|
|
2413
|
-
}
|
|
2414
|
-
return this.encodingSchemaValue;
|
|
2415
|
-
}
|
|
2416
|
-
/**
|
|
2417
|
-
* Creates a new `DryrunState` object.
|
|
2418
|
-
* @param line - Line number
|
|
2419
|
-
* @param pc - Program counter
|
|
2420
|
-
* @param stack -
|
|
2421
|
-
* @param error - Evaluation error if any
|
|
2422
|
-
* @param scratch -
|
|
2423
|
-
*/
|
|
2424
|
-
constructor({ line, pc, stack, error, scratch, }) {
|
|
2425
|
-
this.line = ensureSafeInteger(line);
|
|
2426
|
-
this.pc = ensureSafeInteger(pc);
|
|
2427
|
-
this.stack = stack;
|
|
2428
|
-
this.error = error;
|
|
2429
|
-
this.scratch = scratch;
|
|
2430
|
-
}
|
|
2431
|
-
// eslint-disable-next-line class-methods-use-this
|
|
2432
|
-
getEncodingSchema() {
|
|
2433
|
-
return DryrunState.encodingSchema;
|
|
2434
|
-
}
|
|
2435
|
-
toEncodingData() {
|
|
2436
|
-
return new Map([
|
|
2437
|
-
['line', this.line],
|
|
2438
|
-
['pc', this.pc],
|
|
2439
|
-
['stack', this.stack.map((v) => v.toEncodingData())],
|
|
2440
|
-
['error', this.error],
|
|
2441
|
-
[
|
|
2442
|
-
'scratch',
|
|
2443
|
-
typeof this.scratch !== 'undefined'
|
|
2444
|
-
? this.scratch.map((v) => v.toEncodingData())
|
|
2445
|
-
: undefined,
|
|
2446
|
-
],
|
|
2447
|
-
]);
|
|
2448
|
-
}
|
|
2449
|
-
static fromEncodingData(data) {
|
|
2450
|
-
if (!(data instanceof Map)) {
|
|
2451
|
-
throw new Error(`Invalid decoded DryrunState: ${data}`);
|
|
2452
|
-
}
|
|
2453
|
-
return new DryrunState({
|
|
2454
|
-
line: data.get('line'),
|
|
2455
|
-
pc: data.get('pc'),
|
|
2456
|
-
stack: (data.get('stack') ?? []).map((v) => TealValue.fromEncodingData(v)),
|
|
2457
|
-
error: data.get('error'),
|
|
2458
|
-
scratch: typeof data.get('scratch') !== 'undefined'
|
|
2459
|
-
? data
|
|
2460
|
-
.get('scratch')
|
|
2461
|
-
.map((v) => TealValue.fromEncodingData(v))
|
|
2462
|
-
: undefined,
|
|
2463
|
-
});
|
|
2464
|
-
}
|
|
2465
|
-
}
|
|
2466
|
-
/**
|
|
2467
|
-
* DryrunTxnResult contains any LogicSig or ApplicationCall program debug
|
|
2468
|
-
* information and state updates from a dryrun.
|
|
2469
|
-
*/
|
|
2470
|
-
export class DryrunTxnResult {
|
|
2471
|
-
static get encodingSchema() {
|
|
2472
|
-
if (!this.encodingSchemaValue) {
|
|
2473
|
-
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
2474
|
-
this.encodingSchemaValue.pushEntries({
|
|
2475
|
-
key: 'disassembly',
|
|
2476
|
-
valueSchema: new ArraySchema(new StringSchema()),
|
|
2477
|
-
omitEmpty: true,
|
|
2478
|
-
}, {
|
|
2479
|
-
key: 'app-call-messages',
|
|
2480
|
-
valueSchema: new OptionalSchema(new ArraySchema(new StringSchema())),
|
|
2481
|
-
omitEmpty: true,
|
|
2482
|
-
}, {
|
|
2483
|
-
key: 'app-call-trace',
|
|
2484
|
-
valueSchema: new OptionalSchema(new ArraySchema(DryrunState.encodingSchema)),
|
|
2485
|
-
omitEmpty: true,
|
|
2486
|
-
}, {
|
|
2487
|
-
key: 'budget-added',
|
|
2488
|
-
valueSchema: new OptionalSchema(new Uint64Schema()),
|
|
2489
|
-
omitEmpty: true,
|
|
2490
|
-
}, {
|
|
2491
|
-
key: 'budget-consumed',
|
|
2492
|
-
valueSchema: new OptionalSchema(new Uint64Schema()),
|
|
2493
|
-
omitEmpty: true,
|
|
2494
|
-
}, {
|
|
2495
|
-
key: 'global-delta',
|
|
2496
|
-
valueSchema: new OptionalSchema(new ArraySchema(EvalDeltaKeyValue.encodingSchema)),
|
|
2497
|
-
omitEmpty: true,
|
|
2498
|
-
}, {
|
|
2499
|
-
key: 'local-deltas',
|
|
2500
|
-
valueSchema: new OptionalSchema(new ArraySchema(AccountStateDelta.encodingSchema)),
|
|
2501
|
-
omitEmpty: true,
|
|
2502
|
-
}, {
|
|
2503
|
-
key: 'logic-sig-disassembly',
|
|
2504
|
-
valueSchema: new OptionalSchema(new ArraySchema(new StringSchema())),
|
|
2505
|
-
omitEmpty: true,
|
|
2506
|
-
}, {
|
|
2507
|
-
key: 'logic-sig-messages',
|
|
2508
|
-
valueSchema: new OptionalSchema(new ArraySchema(new StringSchema())),
|
|
2509
|
-
omitEmpty: true,
|
|
2510
|
-
}, {
|
|
2511
|
-
key: 'logic-sig-trace',
|
|
2512
|
-
valueSchema: new OptionalSchema(new ArraySchema(DryrunState.encodingSchema)),
|
|
2513
|
-
omitEmpty: true,
|
|
2514
|
-
}, {
|
|
2515
|
-
key: 'logs',
|
|
2516
|
-
valueSchema: new OptionalSchema(new ArraySchema(new ByteArraySchema())),
|
|
2517
|
-
omitEmpty: true,
|
|
2518
|
-
});
|
|
2519
|
-
}
|
|
2520
|
-
return this.encodingSchemaValue;
|
|
2521
|
-
}
|
|
2522
|
-
/**
|
|
2523
|
-
* Creates a new `DryrunTxnResult` object.
|
|
2524
|
-
* @param disassembly - Disassembled program line by line.
|
|
2525
|
-
* @param appCallMessages -
|
|
2526
|
-
* @param appCallTrace -
|
|
2527
|
-
* @param budgetAdded - Budget added during execution of app call transaction.
|
|
2528
|
-
* @param budgetConsumed - Budget consumed during execution of app call transaction.
|
|
2529
|
-
* @param globalDelta - Application state delta.
|
|
2530
|
-
* @param localDeltas -
|
|
2531
|
-
* @param logicSigDisassembly - Disassembled lsig program line by line.
|
|
2532
|
-
* @param logicSigMessages -
|
|
2533
|
-
* @param logicSigTrace -
|
|
2534
|
-
* @param logs -
|
|
2535
|
-
*/
|
|
2536
|
-
constructor({ disassembly, appCallMessages, appCallTrace, budgetAdded, budgetConsumed, globalDelta, localDeltas, logicSigDisassembly, logicSigMessages, logicSigTrace, logs, }) {
|
|
2537
|
-
this.disassembly = disassembly;
|
|
2538
|
-
this.appCallMessages = appCallMessages;
|
|
2539
|
-
this.appCallTrace = appCallTrace;
|
|
2540
|
-
this.budgetAdded =
|
|
2541
|
-
typeof budgetAdded === 'undefined'
|
|
2542
|
-
? undefined
|
|
2543
|
-
: ensureSafeInteger(budgetAdded);
|
|
2544
|
-
this.budgetConsumed =
|
|
2545
|
-
typeof budgetConsumed === 'undefined'
|
|
2546
|
-
? undefined
|
|
2547
|
-
: ensureSafeInteger(budgetConsumed);
|
|
2548
|
-
this.globalDelta = globalDelta;
|
|
2549
|
-
this.localDeltas = localDeltas;
|
|
2550
|
-
this.logicSigDisassembly = logicSigDisassembly;
|
|
2551
|
-
this.logicSigMessages = logicSigMessages;
|
|
2552
|
-
this.logicSigTrace = logicSigTrace;
|
|
2553
|
-
this.logs = logs;
|
|
2554
|
-
}
|
|
2555
|
-
// eslint-disable-next-line class-methods-use-this
|
|
2556
|
-
getEncodingSchema() {
|
|
2557
|
-
return DryrunTxnResult.encodingSchema;
|
|
2558
|
-
}
|
|
2559
|
-
toEncodingData() {
|
|
2560
|
-
return new Map([
|
|
2561
|
-
['disassembly', this.disassembly],
|
|
2562
|
-
['app-call-messages', this.appCallMessages],
|
|
2563
|
-
[
|
|
2564
|
-
'app-call-trace',
|
|
2565
|
-
typeof this.appCallTrace !== 'undefined'
|
|
2566
|
-
? this.appCallTrace.map((v) => v.toEncodingData())
|
|
2567
|
-
: undefined,
|
|
2568
|
-
],
|
|
2569
|
-
['budget-added', this.budgetAdded],
|
|
2570
|
-
['budget-consumed', this.budgetConsumed],
|
|
2571
|
-
[
|
|
2572
|
-
'global-delta',
|
|
2573
|
-
typeof this.globalDelta !== 'undefined'
|
|
2574
|
-
? this.globalDelta.map((v) => v.toEncodingData())
|
|
2575
|
-
: undefined,
|
|
2576
|
-
],
|
|
2577
|
-
[
|
|
2578
|
-
'local-deltas',
|
|
2579
|
-
typeof this.localDeltas !== 'undefined'
|
|
2580
|
-
? this.localDeltas.map((v) => v.toEncodingData())
|
|
2581
|
-
: undefined,
|
|
2582
|
-
],
|
|
2583
|
-
['logic-sig-disassembly', this.logicSigDisassembly],
|
|
2584
|
-
['logic-sig-messages', this.logicSigMessages],
|
|
2585
|
-
[
|
|
2586
|
-
'logic-sig-trace',
|
|
2587
|
-
typeof this.logicSigTrace !== 'undefined'
|
|
2588
|
-
? this.logicSigTrace.map((v) => v.toEncodingData())
|
|
2589
|
-
: undefined,
|
|
2590
|
-
],
|
|
2591
|
-
['logs', this.logs],
|
|
2592
|
-
]);
|
|
2593
|
-
}
|
|
2594
|
-
static fromEncodingData(data) {
|
|
2595
|
-
if (!(data instanceof Map)) {
|
|
2596
|
-
throw new Error(`Invalid decoded DryrunTxnResult: ${data}`);
|
|
2597
|
-
}
|
|
2598
|
-
return new DryrunTxnResult({
|
|
2599
|
-
disassembly: data.get('disassembly'),
|
|
2600
|
-
appCallMessages: data.get('app-call-messages'),
|
|
2601
|
-
appCallTrace: typeof data.get('app-call-trace') !== 'undefined'
|
|
2602
|
-
? data
|
|
2603
|
-
.get('app-call-trace')
|
|
2604
|
-
.map((v) => DryrunState.fromEncodingData(v))
|
|
2605
|
-
: undefined,
|
|
2606
|
-
budgetAdded: data.get('budget-added'),
|
|
2607
|
-
budgetConsumed: data.get('budget-consumed'),
|
|
2608
|
-
globalDelta: typeof data.get('global-delta') !== 'undefined'
|
|
2609
|
-
? data
|
|
2610
|
-
.get('global-delta')
|
|
2611
|
-
.map((v) => EvalDeltaKeyValue.fromEncodingData(v))
|
|
2612
|
-
: undefined,
|
|
2613
|
-
localDeltas: typeof data.get('local-deltas') !== 'undefined'
|
|
2614
|
-
? data
|
|
2615
|
-
.get('local-deltas')
|
|
2616
|
-
.map((v) => AccountStateDelta.fromEncodingData(v))
|
|
2617
|
-
: undefined,
|
|
2618
|
-
logicSigDisassembly: data.get('logic-sig-disassembly'),
|
|
2619
|
-
logicSigMessages: data.get('logic-sig-messages'),
|
|
2620
|
-
logicSigTrace: typeof data.get('logic-sig-trace') !== 'undefined'
|
|
2621
|
-
? data
|
|
2622
|
-
.get('logic-sig-trace')
|
|
2623
|
-
.map((v) => DryrunState.fromEncodingData(v))
|
|
2624
|
-
: undefined,
|
|
2625
|
-
logs: data.get('logs'),
|
|
2626
|
-
});
|
|
2627
|
-
}
|
|
2628
|
-
}
|
|
2629
2412
|
/**
|
|
2630
2413
|
* An error response with optional data field.
|
|
2631
2414
|
*/
|
|
@@ -4909,6 +4692,10 @@ export class SupplyResponse {
|
|
|
4909
4692
|
key: 'online-money',
|
|
4910
4693
|
valueSchema: new Uint64Schema(),
|
|
4911
4694
|
omitEmpty: true,
|
|
4695
|
+
}, {
|
|
4696
|
+
key: 'online-stake',
|
|
4697
|
+
valueSchema: new Uint64Schema(),
|
|
4698
|
+
omitEmpty: true,
|
|
4912
4699
|
}, { key: 'total-money', valueSchema: new Uint64Schema(), omitEmpty: true });
|
|
4913
4700
|
}
|
|
4914
4701
|
return this.encodingSchemaValue;
|
|
@@ -4916,12 +4703,17 @@ export class SupplyResponse {
|
|
|
4916
4703
|
/**
|
|
4917
4704
|
* Creates a new `SupplyResponse` object.
|
|
4918
4705
|
* @param currentRound - Round
|
|
4919
|
-
* @param onlineMoney -
|
|
4706
|
+
* @param onlineMoney - Total stake held by accounts with status Online at current_round, including
|
|
4707
|
+
* those whose participation keys have expired but have not yet been marked
|
|
4708
|
+
* offline.
|
|
4709
|
+
* @param onlineStake - Online stake used by agreement to vote for current_round, excluding accounts
|
|
4710
|
+
* whose participation keys have expired.
|
|
4920
4711
|
* @param totalMoney - TotalMoney
|
|
4921
4712
|
*/
|
|
4922
|
-
constructor({ currentRound, onlineMoney, totalMoney, }) {
|
|
4713
|
+
constructor({ currentRound, onlineMoney, onlineStake, totalMoney, }) {
|
|
4923
4714
|
this.currentRound = ensureBigInt(currentRound);
|
|
4924
4715
|
this.onlineMoney = ensureBigInt(onlineMoney);
|
|
4716
|
+
this.onlineStake = ensureBigInt(onlineStake);
|
|
4925
4717
|
this.totalMoney = ensureBigInt(totalMoney);
|
|
4926
4718
|
}
|
|
4927
4719
|
// eslint-disable-next-line class-methods-use-this
|
|
@@ -4932,6 +4724,7 @@ export class SupplyResponse {
|
|
|
4932
4724
|
return new Map([
|
|
4933
4725
|
['current_round', this.currentRound],
|
|
4934
4726
|
['online-money', this.onlineMoney],
|
|
4727
|
+
['online-stake', this.onlineStake],
|
|
4935
4728
|
['total-money', this.totalMoney],
|
|
4936
4729
|
]);
|
|
4937
4730
|
}
|
|
@@ -4942,6 +4735,7 @@ export class SupplyResponse {
|
|
|
4942
4735
|
return new SupplyResponse({
|
|
4943
4736
|
currentRound: data.get('current_round'),
|
|
4944
4737
|
onlineMoney: data.get('online-money'),
|
|
4738
|
+
onlineStake: data.get('online-stake'),
|
|
4945
4739
|
totalMoney: data.get('total-money'),
|
|
4946
4740
|
});
|
|
4947
4741
|
}
|
|
@@ -5102,8 +4896,8 @@ export class TransactionParametersResponse {
|
|
|
5102
4896
|
* @param genesisHash - GenesisHash is the hash of the genesis block.
|
|
5103
4897
|
* @param genesisId - GenesisID is an ID listed in the genesis block.
|
|
5104
4898
|
* @param lastRound - LastRound indicates the last round seen
|
|
5105
|
-
* @param minFee - The minimum transaction fee (not per byte) required for the
|
|
5106
|
-
*
|
|
4899
|
+
* @param minFee - The minimum transaction fee (not per byte) required for the txn to validate for
|
|
4900
|
+
* the current network protocol.
|
|
5107
4901
|
*/
|
|
5108
4902
|
constructor({ consensusVersion, fee, genesisHash, genesisId, lastRound, minFee, }) {
|
|
5109
4903
|
this.consensusVersion = consensusVersion;
|