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
|
@@ -621,6 +621,152 @@ export class Account implements Encodable {
|
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
623
|
|
|
624
|
+
/**
|
|
625
|
+
* AccountApplicationResource describes the account's application resource (local
|
|
626
|
+
* state and params if the account is the creator) for a specific application ID.
|
|
627
|
+
*/
|
|
628
|
+
export class AccountApplicationResource implements Encodable {
|
|
629
|
+
private static encodingSchemaValue: Schema | undefined;
|
|
630
|
+
|
|
631
|
+
static get encodingSchema(): Schema {
|
|
632
|
+
if (!this.encodingSchemaValue) {
|
|
633
|
+
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
634
|
+
(this.encodingSchemaValue as NamedMapSchema).pushEntries(
|
|
635
|
+
{ key: 'id', valueSchema: new Uint64Schema(), omitEmpty: true },
|
|
636
|
+
{
|
|
637
|
+
key: 'app-local-state',
|
|
638
|
+
valueSchema: new OptionalSchema(ApplicationLocalState.encodingSchema),
|
|
639
|
+
omitEmpty: true,
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
key: 'created-at-round',
|
|
643
|
+
valueSchema: new OptionalSchema(new Uint64Schema()),
|
|
644
|
+
omitEmpty: true,
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
key: 'deleted',
|
|
648
|
+
valueSchema: new OptionalSchema(new BooleanSchema()),
|
|
649
|
+
omitEmpty: true,
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
key: 'params',
|
|
653
|
+
valueSchema: new OptionalSchema(ApplicationParams.encodingSchema),
|
|
654
|
+
omitEmpty: true,
|
|
655
|
+
}
|
|
656
|
+
);
|
|
657
|
+
}
|
|
658
|
+
return this.encodingSchemaValue;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* The application ID.
|
|
663
|
+
*/
|
|
664
|
+
public id: number;
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* (appl) the application local data stored in this account.
|
|
668
|
+
* The raw account uses `AppLocalState` for this type.
|
|
669
|
+
*/
|
|
670
|
+
public appLocalState?: ApplicationLocalState;
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* Round when the account opted into or created the application.
|
|
674
|
+
*/
|
|
675
|
+
public createdAtRound?: number;
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* Whether the application has been deleted.
|
|
679
|
+
*/
|
|
680
|
+
public deleted?: boolean;
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* (appp) parameters of the application created by this account including app
|
|
684
|
+
* global data.
|
|
685
|
+
* The raw account uses `AppParams` for this type.
|
|
686
|
+
* Only present if the account is the creator and `include=params` is specified.
|
|
687
|
+
*/
|
|
688
|
+
public params?: ApplicationParams;
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* Creates a new `AccountApplicationResource` object.
|
|
692
|
+
* @param id - The application ID.
|
|
693
|
+
* @param appLocalState - (appl) the application local data stored in this account.
|
|
694
|
+
* The raw account uses `AppLocalState` for this type.
|
|
695
|
+
* @param createdAtRound - Round when the account opted into or created the application.
|
|
696
|
+
* @param deleted - Whether the application has been deleted.
|
|
697
|
+
* @param params - (appp) parameters of the application created by this account including app
|
|
698
|
+
* global data.
|
|
699
|
+
* The raw account uses `AppParams` for this type.
|
|
700
|
+
* Only present if the account is the creator and `include=params` is specified.
|
|
701
|
+
*/
|
|
702
|
+
constructor({
|
|
703
|
+
id,
|
|
704
|
+
appLocalState,
|
|
705
|
+
createdAtRound,
|
|
706
|
+
deleted,
|
|
707
|
+
params,
|
|
708
|
+
}: {
|
|
709
|
+
id: number | bigint;
|
|
710
|
+
appLocalState?: ApplicationLocalState;
|
|
711
|
+
createdAtRound?: number | bigint;
|
|
712
|
+
deleted?: boolean;
|
|
713
|
+
params?: ApplicationParams;
|
|
714
|
+
}) {
|
|
715
|
+
this.id = ensureSafeInteger(id);
|
|
716
|
+
this.appLocalState = appLocalState;
|
|
717
|
+
this.createdAtRound =
|
|
718
|
+
typeof createdAtRound === 'undefined'
|
|
719
|
+
? undefined
|
|
720
|
+
: ensureSafeInteger(createdAtRound);
|
|
721
|
+
this.deleted = deleted;
|
|
722
|
+
this.params = params;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
// eslint-disable-next-line class-methods-use-this
|
|
726
|
+
getEncodingSchema(): Schema {
|
|
727
|
+
return AccountApplicationResource.encodingSchema;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
toEncodingData(): Map<string, unknown> {
|
|
731
|
+
return new Map<string, unknown>([
|
|
732
|
+
['id', this.id],
|
|
733
|
+
[
|
|
734
|
+
'app-local-state',
|
|
735
|
+
typeof this.appLocalState !== 'undefined'
|
|
736
|
+
? this.appLocalState.toEncodingData()
|
|
737
|
+
: undefined,
|
|
738
|
+
],
|
|
739
|
+
['created-at-round', this.createdAtRound],
|
|
740
|
+
['deleted', this.deleted],
|
|
741
|
+
[
|
|
742
|
+
'params',
|
|
743
|
+
typeof this.params !== 'undefined'
|
|
744
|
+
? this.params.toEncodingData()
|
|
745
|
+
: undefined,
|
|
746
|
+
],
|
|
747
|
+
]);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
static fromEncodingData(data: unknown): AccountApplicationResource {
|
|
751
|
+
if (!(data instanceof Map)) {
|
|
752
|
+
throw new Error(`Invalid decoded AccountApplicationResource: ${data}`);
|
|
753
|
+
}
|
|
754
|
+
return new AccountApplicationResource({
|
|
755
|
+
id: data.get('id'),
|
|
756
|
+
appLocalState:
|
|
757
|
+
typeof data.get('app-local-state') !== 'undefined'
|
|
758
|
+
? ApplicationLocalState.fromEncodingData(data.get('app-local-state'))
|
|
759
|
+
: undefined,
|
|
760
|
+
createdAtRound: data.get('created-at-round'),
|
|
761
|
+
deleted: data.get('deleted'),
|
|
762
|
+
params:
|
|
763
|
+
typeof data.get('params') !== 'undefined'
|
|
764
|
+
? ApplicationParams.fromEncodingData(data.get('params'))
|
|
765
|
+
: undefined,
|
|
766
|
+
});
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
|
|
624
770
|
/**
|
|
625
771
|
* AccountApplicationResponse describes the account's application local state and
|
|
626
772
|
* global state (AppLocalState and AppParams, if either exists) for a specific
|
|
@@ -732,6 +878,112 @@ export class AccountApplicationResponse implements Encodable {
|
|
|
732
878
|
}
|
|
733
879
|
}
|
|
734
880
|
|
|
881
|
+
/**
|
|
882
|
+
* AccountApplicationsInformationResponse contains a list of application resources
|
|
883
|
+
* for an account.
|
|
884
|
+
*/
|
|
885
|
+
export class AccountApplicationsInformationResponse implements Encodable {
|
|
886
|
+
private static encodingSchemaValue: Schema | undefined;
|
|
887
|
+
|
|
888
|
+
static get encodingSchema(): Schema {
|
|
889
|
+
if (!this.encodingSchemaValue) {
|
|
890
|
+
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
891
|
+
(this.encodingSchemaValue as NamedMapSchema).pushEntries(
|
|
892
|
+
{ key: 'round', valueSchema: new Uint64Schema(), omitEmpty: true },
|
|
893
|
+
{
|
|
894
|
+
key: 'application-resources',
|
|
895
|
+
valueSchema: new OptionalSchema(
|
|
896
|
+
new ArraySchema(AccountApplicationResource.encodingSchema)
|
|
897
|
+
),
|
|
898
|
+
omitEmpty: true,
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
key: 'next-token',
|
|
902
|
+
valueSchema: new OptionalSchema(new StringSchema()),
|
|
903
|
+
omitEmpty: true,
|
|
904
|
+
}
|
|
905
|
+
);
|
|
906
|
+
}
|
|
907
|
+
return this.encodingSchemaValue;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* The round for which this information is relevant.
|
|
912
|
+
*/
|
|
913
|
+
public round: number;
|
|
914
|
+
|
|
915
|
+
public applicationResources?: AccountApplicationResource[];
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* Used for pagination, when making another request provide this token with the
|
|
919
|
+
* next parameter. The next token is the next application ID to use as the
|
|
920
|
+
* pagination cursor.
|
|
921
|
+
*/
|
|
922
|
+
public nextToken?: string;
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* Creates a new `AccountApplicationsInformationResponse` object.
|
|
926
|
+
* @param round - The round for which this information is relevant.
|
|
927
|
+
* @param applicationResources -
|
|
928
|
+
* @param nextToken - Used for pagination, when making another request provide this token with the
|
|
929
|
+
* next parameter. The next token is the next application ID to use as the
|
|
930
|
+
* pagination cursor.
|
|
931
|
+
*/
|
|
932
|
+
constructor({
|
|
933
|
+
round,
|
|
934
|
+
applicationResources,
|
|
935
|
+
nextToken,
|
|
936
|
+
}: {
|
|
937
|
+
round: number | bigint;
|
|
938
|
+
applicationResources?: AccountApplicationResource[];
|
|
939
|
+
nextToken?: string;
|
|
940
|
+
}) {
|
|
941
|
+
this.round = ensureSafeInteger(round);
|
|
942
|
+
this.applicationResources = applicationResources;
|
|
943
|
+
this.nextToken = nextToken;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
// eslint-disable-next-line class-methods-use-this
|
|
947
|
+
getEncodingSchema(): Schema {
|
|
948
|
+
return AccountApplicationsInformationResponse.encodingSchema;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
toEncodingData(): Map<string, unknown> {
|
|
952
|
+
return new Map<string, unknown>([
|
|
953
|
+
['round', this.round],
|
|
954
|
+
[
|
|
955
|
+
'application-resources',
|
|
956
|
+
typeof this.applicationResources !== 'undefined'
|
|
957
|
+
? this.applicationResources.map((v) => v.toEncodingData())
|
|
958
|
+
: undefined,
|
|
959
|
+
],
|
|
960
|
+
['next-token', this.nextToken],
|
|
961
|
+
]);
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
static fromEncodingData(
|
|
965
|
+
data: unknown
|
|
966
|
+
): AccountApplicationsInformationResponse {
|
|
967
|
+
if (!(data instanceof Map)) {
|
|
968
|
+
throw new Error(
|
|
969
|
+
`Invalid decoded AccountApplicationsInformationResponse: ${data}`
|
|
970
|
+
);
|
|
971
|
+
}
|
|
972
|
+
return new AccountApplicationsInformationResponse({
|
|
973
|
+
round: data.get('round'),
|
|
974
|
+
applicationResources:
|
|
975
|
+
typeof data.get('application-resources') !== 'undefined'
|
|
976
|
+
? data
|
|
977
|
+
.get('application-resources')
|
|
978
|
+
.map((v: unknown) =>
|
|
979
|
+
AccountApplicationResource.fromEncodingData(v)
|
|
980
|
+
)
|
|
981
|
+
: undefined,
|
|
982
|
+
nextToken: data.get('next-token'),
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
|
|
735
987
|
/**
|
|
736
988
|
* AccountAssetHolding describes the account's asset holding and asset parameters
|
|
737
989
|
* (if either exist) for a specific asset ID.
|
|
@@ -1347,7 +1599,7 @@ export class Application implements Encodable {
|
|
|
1347
1599
|
{ key: 'id', valueSchema: new Uint64Schema(), omitEmpty: true },
|
|
1348
1600
|
{
|
|
1349
1601
|
key: 'params',
|
|
1350
|
-
valueSchema: ApplicationParams.encodingSchema,
|
|
1602
|
+
valueSchema: new OptionalSchema(ApplicationParams.encodingSchema),
|
|
1351
1603
|
omitEmpty: true,
|
|
1352
1604
|
}
|
|
1353
1605
|
);
|
|
@@ -1363,7 +1615,7 @@ export class Application implements Encodable {
|
|
|
1363
1615
|
/**
|
|
1364
1616
|
* (appparams) application parameters.
|
|
1365
1617
|
*/
|
|
1366
|
-
public params
|
|
1618
|
+
public params?: ApplicationParams;
|
|
1367
1619
|
|
|
1368
1620
|
/**
|
|
1369
1621
|
* Creates a new `Application` object.
|
|
@@ -1375,7 +1627,7 @@ export class Application implements Encodable {
|
|
|
1375
1627
|
params,
|
|
1376
1628
|
}: {
|
|
1377
1629
|
id: number | bigint;
|
|
1378
|
-
params
|
|
1630
|
+
params?: ApplicationParams;
|
|
1379
1631
|
}) {
|
|
1380
1632
|
this.id = ensureBigInt(id);
|
|
1381
1633
|
this.params = params;
|
|
@@ -1389,7 +1641,12 @@ export class Application implements Encodable {
|
|
|
1389
1641
|
toEncodingData(): Map<string, unknown> {
|
|
1390
1642
|
return new Map<string, unknown>([
|
|
1391
1643
|
['id', this.id],
|
|
1392
|
-
[
|
|
1644
|
+
[
|
|
1645
|
+
'params',
|
|
1646
|
+
typeof this.params !== 'undefined'
|
|
1647
|
+
? this.params.toEncodingData()
|
|
1648
|
+
: undefined,
|
|
1649
|
+
],
|
|
1393
1650
|
]);
|
|
1394
1651
|
}
|
|
1395
1652
|
|
|
@@ -1399,9 +1656,10 @@ export class Application implements Encodable {
|
|
|
1399
1656
|
}
|
|
1400
1657
|
return new Application({
|
|
1401
1658
|
id: data.get('id'),
|
|
1402
|
-
params:
|
|
1403
|
-
data.get('params')
|
|
1404
|
-
|
|
1659
|
+
params:
|
|
1660
|
+
typeof data.get('params') !== 'undefined'
|
|
1661
|
+
? ApplicationParams.fromEncodingData(data.get('params'))
|
|
1662
|
+
: undefined,
|
|
1405
1663
|
});
|
|
1406
1664
|
}
|
|
1407
1665
|
}
|
|
@@ -1833,6 +2091,11 @@ export class ApplicationParams implements Encodable {
|
|
|
1833
2091
|
),
|
|
1834
2092
|
omitEmpty: true,
|
|
1835
2093
|
},
|
|
2094
|
+
{
|
|
2095
|
+
key: 'size-sponsor',
|
|
2096
|
+
valueSchema: new OptionalSchema(new StringSchema()),
|
|
2097
|
+
omitEmpty: true,
|
|
2098
|
+
},
|
|
1836
2099
|
{
|
|
1837
2100
|
key: 'version',
|
|
1838
2101
|
valueSchema: new OptionalSchema(new Uint64Schema()),
|
|
@@ -1879,6 +2142,11 @@ export class ApplicationParams implements Encodable {
|
|
|
1879
2142
|
*/
|
|
1880
2143
|
public localStateSchema?: ApplicationStateSchema;
|
|
1881
2144
|
|
|
2145
|
+
/**
|
|
2146
|
+
* (ss) the account responsible for extra pages and global state MBR
|
|
2147
|
+
*/
|
|
2148
|
+
public sizeSponsor?: Address;
|
|
2149
|
+
|
|
1882
2150
|
/**
|
|
1883
2151
|
* (v) the number of updates to the application programs
|
|
1884
2152
|
*/
|
|
@@ -1894,6 +2162,7 @@ export class ApplicationParams implements Encodable {
|
|
|
1894
2162
|
* @param globalState - (gs) global state
|
|
1895
2163
|
* @param globalStateSchema - (gsch) global schema
|
|
1896
2164
|
* @param localStateSchema - (lsch) local schema
|
|
2165
|
+
* @param sizeSponsor - (ss) the account responsible for extra pages and global state MBR
|
|
1897
2166
|
* @param version - (v) the number of updates to the application programs
|
|
1898
2167
|
*/
|
|
1899
2168
|
constructor({
|
|
@@ -1904,6 +2173,7 @@ export class ApplicationParams implements Encodable {
|
|
|
1904
2173
|
globalState,
|
|
1905
2174
|
globalStateSchema,
|
|
1906
2175
|
localStateSchema,
|
|
2176
|
+
sizeSponsor,
|
|
1907
2177
|
version,
|
|
1908
2178
|
}: {
|
|
1909
2179
|
approvalProgram: string | Uint8Array;
|
|
@@ -1913,6 +2183,7 @@ export class ApplicationParams implements Encodable {
|
|
|
1913
2183
|
globalState?: TealKeyValue[];
|
|
1914
2184
|
globalStateSchema?: ApplicationStateSchema;
|
|
1915
2185
|
localStateSchema?: ApplicationStateSchema;
|
|
2186
|
+
sizeSponsor?: Address | string;
|
|
1916
2187
|
version?: number | bigint;
|
|
1917
2188
|
}) {
|
|
1918
2189
|
this.approvalProgram =
|
|
@@ -1932,6 +2203,10 @@ export class ApplicationParams implements Encodable {
|
|
|
1932
2203
|
this.globalState = globalState;
|
|
1933
2204
|
this.globalStateSchema = globalStateSchema;
|
|
1934
2205
|
this.localStateSchema = localStateSchema;
|
|
2206
|
+
this.sizeSponsor =
|
|
2207
|
+
typeof sizeSponsor === 'string'
|
|
2208
|
+
? Address.fromString(sizeSponsor)
|
|
2209
|
+
: sizeSponsor;
|
|
1935
2210
|
this.version =
|
|
1936
2211
|
typeof version === 'undefined' ? undefined : ensureSafeInteger(version);
|
|
1937
2212
|
}
|
|
@@ -1965,6 +2240,12 @@ export class ApplicationParams implements Encodable {
|
|
|
1965
2240
|
? this.localStateSchema.toEncodingData()
|
|
1966
2241
|
: undefined,
|
|
1967
2242
|
],
|
|
2243
|
+
[
|
|
2244
|
+
'size-sponsor',
|
|
2245
|
+
typeof this.sizeSponsor !== 'undefined'
|
|
2246
|
+
? this.sizeSponsor.toString()
|
|
2247
|
+
: undefined,
|
|
2248
|
+
],
|
|
1968
2249
|
['version', this.version],
|
|
1969
2250
|
]);
|
|
1970
2251
|
}
|
|
@@ -1996,6 +2277,7 @@ export class ApplicationParams implements Encodable {
|
|
|
1996
2277
|
data.get('local-state-schema')
|
|
1997
2278
|
)
|
|
1998
2279
|
: undefined,
|
|
2280
|
+
sizeSponsor: data.get('size-sponsor'),
|
|
1999
2281
|
version: data.get('version'),
|
|
2000
2282
|
});
|
|
2001
2283
|
}
|
|
@@ -2216,7 +2498,7 @@ export class Asset implements Encodable {
|
|
|
2216
2498
|
{ key: 'index', valueSchema: new Uint64Schema(), omitEmpty: true },
|
|
2217
2499
|
{
|
|
2218
2500
|
key: 'params',
|
|
2219
|
-
valueSchema: AssetParams.encodingSchema,
|
|
2501
|
+
valueSchema: new OptionalSchema(AssetParams.encodingSchema),
|
|
2220
2502
|
omitEmpty: true,
|
|
2221
2503
|
}
|
|
2222
2504
|
);
|
|
@@ -2235,7 +2517,7 @@ export class Asset implements Encodable {
|
|
|
2235
2517
|
* Definition:
|
|
2236
2518
|
* data/transactions/asset.go : AssetParams
|
|
2237
2519
|
*/
|
|
2238
|
-
public params
|
|
2520
|
+
public params?: AssetParams;
|
|
2239
2521
|
|
|
2240
2522
|
/**
|
|
2241
2523
|
* Creates a new `Asset` object.
|
|
@@ -2250,7 +2532,7 @@ export class Asset implements Encodable {
|
|
|
2250
2532
|
params,
|
|
2251
2533
|
}: {
|
|
2252
2534
|
index: number | bigint;
|
|
2253
|
-
params
|
|
2535
|
+
params?: AssetParams;
|
|
2254
2536
|
}) {
|
|
2255
2537
|
this.index = ensureBigInt(index);
|
|
2256
2538
|
this.params = params;
|
|
@@ -2264,7 +2546,12 @@ export class Asset implements Encodable {
|
|
|
2264
2546
|
toEncodingData(): Map<string, unknown> {
|
|
2265
2547
|
return new Map<string, unknown>([
|
|
2266
2548
|
['index', this.index],
|
|
2267
|
-
[
|
|
2549
|
+
[
|
|
2550
|
+
'params',
|
|
2551
|
+
typeof this.params !== 'undefined'
|
|
2552
|
+
? this.params.toEncodingData()
|
|
2553
|
+
: undefined,
|
|
2554
|
+
],
|
|
2268
2555
|
]);
|
|
2269
2556
|
}
|
|
2270
2557
|
|
|
@@ -2274,7 +2561,10 @@ export class Asset implements Encodable {
|
|
|
2274
2561
|
}
|
|
2275
2562
|
return new Asset({
|
|
2276
2563
|
index: data.get('index'),
|
|
2277
|
-
params:
|
|
2564
|
+
params:
|
|
2565
|
+
typeof data.get('params') !== 'undefined'
|
|
2566
|
+
? AssetParams.fromEncodingData(data.get('params'))
|
|
2567
|
+
: undefined,
|
|
2278
2568
|
});
|
|
2279
2569
|
}
|
|
2280
2570
|
}
|
|
@@ -3189,11 +3479,14 @@ export class BoxDescriptor implements Encodable {
|
|
|
3189
3479
|
static get encodingSchema(): Schema {
|
|
3190
3480
|
if (!this.encodingSchemaValue) {
|
|
3191
3481
|
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
3192
|
-
(this.encodingSchemaValue as NamedMapSchema).pushEntries(
|
|
3193
|
-
key: 'name',
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3482
|
+
(this.encodingSchemaValue as NamedMapSchema).pushEntries(
|
|
3483
|
+
{ key: 'name', valueSchema: new ByteArraySchema(), omitEmpty: true },
|
|
3484
|
+
{
|
|
3485
|
+
key: 'value',
|
|
3486
|
+
valueSchema: new OptionalSchema(new ByteArraySchema()),
|
|
3487
|
+
omitEmpty: true,
|
|
3488
|
+
}
|
|
3489
|
+
);
|
|
3197
3490
|
}
|
|
3198
3491
|
return this.encodingSchemaValue;
|
|
3199
3492
|
}
|
|
@@ -3203,12 +3496,27 @@ export class BoxDescriptor implements Encodable {
|
|
|
3203
3496
|
*/
|
|
3204
3497
|
public name: Uint8Array;
|
|
3205
3498
|
|
|
3499
|
+
/**
|
|
3500
|
+
* Base64 encoded box value. Present only when the `values` query parameter is set
|
|
3501
|
+
* to true.
|
|
3502
|
+
*/
|
|
3503
|
+
public value?: Uint8Array;
|
|
3504
|
+
|
|
3206
3505
|
/**
|
|
3207
3506
|
* Creates a new `BoxDescriptor` object.
|
|
3208
3507
|
* @param name - Base64 encoded box name
|
|
3508
|
+
* @param value - Base64 encoded box value. Present only when the `values` query parameter is set
|
|
3509
|
+
* to true.
|
|
3209
3510
|
*/
|
|
3210
|
-
constructor({
|
|
3511
|
+
constructor({
|
|
3512
|
+
name,
|
|
3513
|
+
value,
|
|
3514
|
+
}: {
|
|
3515
|
+
name: string | Uint8Array;
|
|
3516
|
+
value?: string | Uint8Array;
|
|
3517
|
+
}) {
|
|
3211
3518
|
this.name = typeof name === 'string' ? base64ToBytes(name) : name;
|
|
3519
|
+
this.value = typeof value === 'string' ? base64ToBytes(value) : value;
|
|
3212
3520
|
}
|
|
3213
3521
|
|
|
3214
3522
|
// eslint-disable-next-line class-methods-use-this
|
|
@@ -3217,7 +3525,10 @@ export class BoxDescriptor implements Encodable {
|
|
|
3217
3525
|
}
|
|
3218
3526
|
|
|
3219
3527
|
toEncodingData(): Map<string, unknown> {
|
|
3220
|
-
return new Map<string, unknown>([
|
|
3528
|
+
return new Map<string, unknown>([
|
|
3529
|
+
['name', this.name],
|
|
3530
|
+
['value', this.value],
|
|
3531
|
+
]);
|
|
3221
3532
|
}
|
|
3222
3533
|
|
|
3223
3534
|
static fromEncodingData(data: unknown): BoxDescriptor {
|
|
@@ -3226,6 +3537,7 @@ export class BoxDescriptor implements Encodable {
|
|
|
3226
3537
|
}
|
|
3227
3538
|
return new BoxDescriptor({
|
|
3228
3539
|
name: data.get('name'),
|
|
3540
|
+
value: data.get('value'),
|
|
3229
3541
|
});
|
|
3230
3542
|
}
|
|
3231
3543
|
}
|
|
@@ -3297,7 +3609,7 @@ export class BoxReference implements Encodable {
|
|
|
3297
3609
|
}
|
|
3298
3610
|
|
|
3299
3611
|
/**
|
|
3300
|
-
*
|
|
3612
|
+
* Boxes of an application
|
|
3301
3613
|
*/
|
|
3302
3614
|
export class BoxesResponse implements Encodable {
|
|
3303
3615
|
private static encodingSchemaValue: Schema | undefined;
|
|
@@ -3305,11 +3617,23 @@ export class BoxesResponse implements Encodable {
|
|
|
3305
3617
|
static get encodingSchema(): Schema {
|
|
3306
3618
|
if (!this.encodingSchemaValue) {
|
|
3307
3619
|
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
3308
|
-
(this.encodingSchemaValue as NamedMapSchema).pushEntries(
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3620
|
+
(this.encodingSchemaValue as NamedMapSchema).pushEntries(
|
|
3621
|
+
{
|
|
3622
|
+
key: 'boxes',
|
|
3623
|
+
valueSchema: new ArraySchema(BoxDescriptor.encodingSchema),
|
|
3624
|
+
omitEmpty: true,
|
|
3625
|
+
},
|
|
3626
|
+
{
|
|
3627
|
+
key: 'next-token',
|
|
3628
|
+
valueSchema: new OptionalSchema(new StringSchema()),
|
|
3629
|
+
omitEmpty: true,
|
|
3630
|
+
},
|
|
3631
|
+
{
|
|
3632
|
+
key: 'round',
|
|
3633
|
+
valueSchema: new OptionalSchema(new Uint64Schema()),
|
|
3634
|
+
omitEmpty: true,
|
|
3635
|
+
}
|
|
3636
|
+
);
|
|
3313
3637
|
}
|
|
3314
3638
|
return this.encodingSchemaValue;
|
|
3315
3639
|
}
|
|
@@ -3317,21 +3641,50 @@ export class BoxesResponse implements Encodable {
|
|
|
3317
3641
|
public boxes: BoxDescriptor[];
|
|
3318
3642
|
|
|
3319
3643
|
/**
|
|
3320
|
-
*
|
|
3321
|
-
*
|
|
3644
|
+
* Used for pagination, when making another request provide this token with the
|
|
3645
|
+
* next parameter. The next token is the box name to use as the pagination cursor,
|
|
3646
|
+
* encoded in the goal app call arg form.
|
|
3322
3647
|
*/
|
|
3323
|
-
|
|
3324
|
-
this.boxes = boxes;
|
|
3325
|
-
}
|
|
3648
|
+
public nextToken?: string;
|
|
3326
3649
|
|
|
3327
|
-
|
|
3328
|
-
|
|
3650
|
+
/**
|
|
3651
|
+
* The round for which this information is relevant.
|
|
3652
|
+
*/
|
|
3653
|
+
public round?: number;
|
|
3654
|
+
|
|
3655
|
+
/**
|
|
3656
|
+
* Creates a new `BoxesResponse` object.
|
|
3657
|
+
* @param boxes -
|
|
3658
|
+
* @param nextToken - Used for pagination, when making another request provide this token with the
|
|
3659
|
+
* next parameter. The next token is the box name to use as the pagination cursor,
|
|
3660
|
+
* encoded in the goal app call arg form.
|
|
3661
|
+
* @param round - The round for which this information is relevant.
|
|
3662
|
+
*/
|
|
3663
|
+
constructor({
|
|
3664
|
+
boxes,
|
|
3665
|
+
nextToken,
|
|
3666
|
+
round,
|
|
3667
|
+
}: {
|
|
3668
|
+
boxes: BoxDescriptor[];
|
|
3669
|
+
nextToken?: string;
|
|
3670
|
+
round?: number | bigint;
|
|
3671
|
+
}) {
|
|
3672
|
+
this.boxes = boxes;
|
|
3673
|
+
this.nextToken = nextToken;
|
|
3674
|
+
this.round =
|
|
3675
|
+
typeof round === 'undefined' ? undefined : ensureSafeInteger(round);
|
|
3676
|
+
}
|
|
3677
|
+
|
|
3678
|
+
// eslint-disable-next-line class-methods-use-this
|
|
3679
|
+
getEncodingSchema(): Schema {
|
|
3329
3680
|
return BoxesResponse.encodingSchema;
|
|
3330
3681
|
}
|
|
3331
3682
|
|
|
3332
3683
|
toEncodingData(): Map<string, unknown> {
|
|
3333
3684
|
return new Map<string, unknown>([
|
|
3334
3685
|
['boxes', this.boxes.map((v) => v.toEncodingData())],
|
|
3686
|
+
['next-token', this.nextToken],
|
|
3687
|
+
['round', this.round],
|
|
3335
3688
|
]);
|
|
3336
3689
|
}
|
|
3337
3690
|
|
|
@@ -3343,6 +3696,8 @@ export class BoxesResponse implements Encodable {
|
|
|
3343
3696
|
boxes: (data.get('boxes') ?? []).map((v: unknown) =>
|
|
3344
3697
|
BoxDescriptor.fromEncodingData(v)
|
|
3345
3698
|
),
|
|
3699
|
+
nextToken: data.get('next-token'),
|
|
3700
|
+
round: data.get('round'),
|
|
3346
3701
|
});
|
|
3347
3702
|
}
|
|
3348
3703
|
}
|
|
@@ -3367,575 +3722,102 @@ export class BuildVersion implements Encodable {
|
|
|
3367
3722
|
omitEmpty: true,
|
|
3368
3723
|
},
|
|
3369
3724
|
{ key: 'major', valueSchema: new Uint64Schema(), omitEmpty: true },
|
|
3370
|
-
{ key: 'minor', valueSchema: new Uint64Schema(), omitEmpty: true }
|
|
3371
|
-
);
|
|
3372
|
-
}
|
|
3373
|
-
return this.encodingSchemaValue;
|
|
3374
|
-
}
|
|
3375
|
-
|
|
3376
|
-
public branch: string;
|
|
3377
|
-
|
|
3378
|
-
public buildNumber: number;
|
|
3379
|
-
|
|
3380
|
-
public channel: string;
|
|
3381
|
-
|
|
3382
|
-
public commitHash: string;
|
|
3383
|
-
|
|
3384
|
-
public major: number;
|
|
3385
|
-
|
|
3386
|
-
public minor: number;
|
|
3387
|
-
|
|
3388
|
-
/**
|
|
3389
|
-
* Creates a new `BuildVersion` object.
|
|
3390
|
-
* @param branch -
|
|
3391
|
-
* @param buildNumber -
|
|
3392
|
-
* @param channel -
|
|
3393
|
-
* @param commitHash -
|
|
3394
|
-
* @param major -
|
|
3395
|
-
* @param minor -
|
|
3396
|
-
*/
|
|
3397
|
-
constructor({
|
|
3398
|
-
branch,
|
|
3399
|
-
buildNumber,
|
|
3400
|
-
channel,
|
|
3401
|
-
commitHash,
|
|
3402
|
-
major,
|
|
3403
|
-
minor,
|
|
3404
|
-
}: {
|
|
3405
|
-
branch: string;
|
|
3406
|
-
buildNumber: number | bigint;
|
|
3407
|
-
channel: string;
|
|
3408
|
-
commitHash: string;
|
|
3409
|
-
major: number | bigint;
|
|
3410
|
-
minor: number | bigint;
|
|
3411
|
-
}) {
|
|
3412
|
-
this.branch = branch;
|
|
3413
|
-
this.buildNumber = ensureSafeInteger(buildNumber);
|
|
3414
|
-
this.channel = channel;
|
|
3415
|
-
this.commitHash = commitHash;
|
|
3416
|
-
this.major = ensureSafeInteger(major);
|
|
3417
|
-
this.minor = ensureSafeInteger(minor);
|
|
3418
|
-
}
|
|
3419
|
-
|
|
3420
|
-
// eslint-disable-next-line class-methods-use-this
|
|
3421
|
-
getEncodingSchema(): Schema {
|
|
3422
|
-
return BuildVersion.encodingSchema;
|
|
3423
|
-
}
|
|
3424
|
-
|
|
3425
|
-
toEncodingData(): Map<string, unknown> {
|
|
3426
|
-
return new Map<string, unknown>([
|
|
3427
|
-
['branch', this.branch],
|
|
3428
|
-
['build_number', this.buildNumber],
|
|
3429
|
-
['channel', this.channel],
|
|
3430
|
-
['commit_hash', this.commitHash],
|
|
3431
|
-
['major', this.major],
|
|
3432
|
-
['minor', this.minor],
|
|
3433
|
-
]);
|
|
3434
|
-
}
|
|
3435
|
-
|
|
3436
|
-
static fromEncodingData(data: unknown): BuildVersion {
|
|
3437
|
-
if (!(data instanceof Map)) {
|
|
3438
|
-
throw new Error(`Invalid decoded BuildVersion: ${data}`);
|
|
3439
|
-
}
|
|
3440
|
-
return new BuildVersion({
|
|
3441
|
-
branch: data.get('branch'),
|
|
3442
|
-
buildNumber: data.get('build_number'),
|
|
3443
|
-
channel: data.get('channel'),
|
|
3444
|
-
commitHash: data.get('commit_hash'),
|
|
3445
|
-
major: data.get('major'),
|
|
3446
|
-
minor: data.get('minor'),
|
|
3447
|
-
});
|
|
3448
|
-
}
|
|
3449
|
-
}
|
|
3450
|
-
|
|
3451
|
-
/**
|
|
3452
|
-
* Teal compile Result
|
|
3453
|
-
*/
|
|
3454
|
-
export class CompileResponse implements Encodable {
|
|
3455
|
-
private static encodingSchemaValue: Schema | undefined;
|
|
3456
|
-
|
|
3457
|
-
static get encodingSchema(): Schema {
|
|
3458
|
-
if (!this.encodingSchemaValue) {
|
|
3459
|
-
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
3460
|
-
(this.encodingSchemaValue as NamedMapSchema).pushEntries(
|
|
3461
|
-
{ key: 'hash', valueSchema: new StringSchema(), omitEmpty: true },
|
|
3462
|
-
{ key: 'result', valueSchema: new StringSchema(), omitEmpty: true },
|
|
3463
|
-
{
|
|
3464
|
-
key: 'sourcemap',
|
|
3465
|
-
valueSchema: new OptionalSchema(UntypedValue.encodingSchema),
|
|
3466
|
-
omitEmpty: true,
|
|
3467
|
-
}
|
|
3468
|
-
);
|
|
3469
|
-
}
|
|
3470
|
-
return this.encodingSchemaValue;
|
|
3471
|
-
}
|
|
3472
|
-
|
|
3473
|
-
/**
|
|
3474
|
-
* base32 SHA512_256 of program bytes (Address style)
|
|
3475
|
-
*/
|
|
3476
|
-
public hash: string;
|
|
3477
|
-
|
|
3478
|
-
/**
|
|
3479
|
-
* base64 encoded program bytes
|
|
3480
|
-
*/
|
|
3481
|
-
public result: string;
|
|
3482
|
-
|
|
3483
|
-
/**
|
|
3484
|
-
* JSON of the source map
|
|
3485
|
-
*/
|
|
3486
|
-
public sourcemap?: UntypedValue;
|
|
3487
|
-
|
|
3488
|
-
/**
|
|
3489
|
-
* Creates a new `CompileResponse` object.
|
|
3490
|
-
* @param hash - base32 SHA512_256 of program bytes (Address style)
|
|
3491
|
-
* @param result - base64 encoded program bytes
|
|
3492
|
-
* @param sourcemap - JSON of the source map
|
|
3493
|
-
*/
|
|
3494
|
-
constructor({
|
|
3495
|
-
hash,
|
|
3496
|
-
result,
|
|
3497
|
-
sourcemap,
|
|
3498
|
-
}: {
|
|
3499
|
-
hash: string;
|
|
3500
|
-
result: string;
|
|
3501
|
-
sourcemap?: UntypedValue;
|
|
3502
|
-
}) {
|
|
3503
|
-
this.hash = hash;
|
|
3504
|
-
this.result = result;
|
|
3505
|
-
this.sourcemap = sourcemap;
|
|
3506
|
-
}
|
|
3507
|
-
|
|
3508
|
-
// eslint-disable-next-line class-methods-use-this
|
|
3509
|
-
getEncodingSchema(): Schema {
|
|
3510
|
-
return CompileResponse.encodingSchema;
|
|
3511
|
-
}
|
|
3512
|
-
|
|
3513
|
-
toEncodingData(): Map<string, unknown> {
|
|
3514
|
-
return new Map<string, unknown>([
|
|
3515
|
-
['hash', this.hash],
|
|
3516
|
-
['result', this.result],
|
|
3517
|
-
[
|
|
3518
|
-
'sourcemap',
|
|
3519
|
-
typeof this.sourcemap !== 'undefined'
|
|
3520
|
-
? this.sourcemap.toEncodingData()
|
|
3521
|
-
: undefined,
|
|
3522
|
-
],
|
|
3523
|
-
]);
|
|
3524
|
-
}
|
|
3525
|
-
|
|
3526
|
-
static fromEncodingData(data: unknown): CompileResponse {
|
|
3527
|
-
if (!(data instanceof Map)) {
|
|
3528
|
-
throw new Error(`Invalid decoded CompileResponse: ${data}`);
|
|
3529
|
-
}
|
|
3530
|
-
return new CompileResponse({
|
|
3531
|
-
hash: data.get('hash'),
|
|
3532
|
-
result: data.get('result'),
|
|
3533
|
-
sourcemap:
|
|
3534
|
-
typeof data.get('sourcemap') !== 'undefined'
|
|
3535
|
-
? UntypedValue.fromEncodingData(data.get('sourcemap'))
|
|
3536
|
-
: undefined,
|
|
3537
|
-
});
|
|
3538
|
-
}
|
|
3539
|
-
}
|
|
3540
|
-
|
|
3541
|
-
/**
|
|
3542
|
-
* Teal disassembly Result
|
|
3543
|
-
*/
|
|
3544
|
-
export class DisassembleResponse implements Encodable {
|
|
3545
|
-
private static encodingSchemaValue: Schema | undefined;
|
|
3546
|
-
|
|
3547
|
-
static get encodingSchema(): Schema {
|
|
3548
|
-
if (!this.encodingSchemaValue) {
|
|
3549
|
-
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
3550
|
-
(this.encodingSchemaValue as NamedMapSchema).pushEntries({
|
|
3551
|
-
key: 'result',
|
|
3552
|
-
valueSchema: new StringSchema(),
|
|
3553
|
-
omitEmpty: true,
|
|
3554
|
-
});
|
|
3555
|
-
}
|
|
3556
|
-
return this.encodingSchemaValue;
|
|
3557
|
-
}
|
|
3558
|
-
|
|
3559
|
-
/**
|
|
3560
|
-
* disassembled Teal code
|
|
3561
|
-
*/
|
|
3562
|
-
public result: string;
|
|
3563
|
-
|
|
3564
|
-
/**
|
|
3565
|
-
* Creates a new `DisassembleResponse` object.
|
|
3566
|
-
* @param result - disassembled Teal code
|
|
3567
|
-
*/
|
|
3568
|
-
constructor({ result }: { result: string }) {
|
|
3569
|
-
this.result = result;
|
|
3570
|
-
}
|
|
3571
|
-
|
|
3572
|
-
// eslint-disable-next-line class-methods-use-this
|
|
3573
|
-
getEncodingSchema(): Schema {
|
|
3574
|
-
return DisassembleResponse.encodingSchema;
|
|
3575
|
-
}
|
|
3576
|
-
|
|
3577
|
-
toEncodingData(): Map<string, unknown> {
|
|
3578
|
-
return new Map<string, unknown>([['result', this.result]]);
|
|
3579
|
-
}
|
|
3580
|
-
|
|
3581
|
-
static fromEncodingData(data: unknown): DisassembleResponse {
|
|
3582
|
-
if (!(data instanceof Map)) {
|
|
3583
|
-
throw new Error(`Invalid decoded DisassembleResponse: ${data}`);
|
|
3584
|
-
}
|
|
3585
|
-
return new DisassembleResponse({
|
|
3586
|
-
result: data.get('result'),
|
|
3587
|
-
});
|
|
3588
|
-
}
|
|
3589
|
-
}
|
|
3590
|
-
|
|
3591
|
-
/**
|
|
3592
|
-
* Request data type for dryrun endpoint. Given the Transactions and simulated
|
|
3593
|
-
* ledger state upload, run TEAL scripts and return debugging information.
|
|
3594
|
-
*/
|
|
3595
|
-
export class DryrunRequest implements Encodable {
|
|
3596
|
-
private static encodingSchemaValue: Schema | undefined;
|
|
3597
|
-
|
|
3598
|
-
static get encodingSchema(): Schema {
|
|
3599
|
-
if (!this.encodingSchemaValue) {
|
|
3600
|
-
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
3601
|
-
(this.encodingSchemaValue as NamedMapSchema).pushEntries(
|
|
3602
|
-
{
|
|
3603
|
-
key: 'accounts',
|
|
3604
|
-
valueSchema: new ArraySchema(Account.encodingSchema),
|
|
3605
|
-
omitEmpty: true,
|
|
3606
|
-
},
|
|
3607
|
-
{
|
|
3608
|
-
key: 'apps',
|
|
3609
|
-
valueSchema: new ArraySchema(Application.encodingSchema),
|
|
3610
|
-
omitEmpty: true,
|
|
3611
|
-
},
|
|
3612
|
-
{
|
|
3613
|
-
key: 'latest-timestamp',
|
|
3614
|
-
valueSchema: new Uint64Schema(),
|
|
3615
|
-
omitEmpty: true,
|
|
3616
|
-
},
|
|
3617
|
-
{
|
|
3618
|
-
key: 'protocol-version',
|
|
3619
|
-
valueSchema: new StringSchema(),
|
|
3620
|
-
omitEmpty: true,
|
|
3621
|
-
},
|
|
3622
|
-
{ key: 'round', valueSchema: new Uint64Schema(), omitEmpty: true },
|
|
3623
|
-
{
|
|
3624
|
-
key: 'sources',
|
|
3625
|
-
valueSchema: new ArraySchema(DryrunSource.encodingSchema),
|
|
3626
|
-
omitEmpty: true,
|
|
3627
|
-
},
|
|
3628
|
-
{
|
|
3629
|
-
key: 'txns',
|
|
3630
|
-
valueSchema: new ArraySchema(SignedTransaction.encodingSchema),
|
|
3631
|
-
omitEmpty: true,
|
|
3632
|
-
}
|
|
3633
|
-
);
|
|
3634
|
-
}
|
|
3635
|
-
return this.encodingSchemaValue;
|
|
3636
|
-
}
|
|
3637
|
-
|
|
3638
|
-
public accounts: Account[];
|
|
3639
|
-
|
|
3640
|
-
public apps: Application[];
|
|
3641
|
-
|
|
3642
|
-
/**
|
|
3643
|
-
* LatestTimestamp is available to some TEAL scripts. Defaults to the latest
|
|
3644
|
-
* confirmed timestamp this algod is attached to.
|
|
3645
|
-
*/
|
|
3646
|
-
public latestTimestamp: number;
|
|
3647
|
-
|
|
3648
|
-
/**
|
|
3649
|
-
* ProtocolVersion specifies a specific version string to operate under, otherwise
|
|
3650
|
-
* whatever the current protocol of the network this algod is running in.
|
|
3651
|
-
*/
|
|
3652
|
-
public protocolVersion: string;
|
|
3653
|
-
|
|
3654
|
-
/**
|
|
3655
|
-
* Round is available to some TEAL scripts. Defaults to the current round on the
|
|
3656
|
-
* network this algod is attached to.
|
|
3657
|
-
*/
|
|
3658
|
-
public round: bigint;
|
|
3659
|
-
|
|
3660
|
-
public sources: DryrunSource[];
|
|
3661
|
-
|
|
3662
|
-
public txns: SignedTransaction[];
|
|
3663
|
-
|
|
3664
|
-
/**
|
|
3665
|
-
* Creates a new `DryrunRequest` object.
|
|
3666
|
-
* @param accounts -
|
|
3667
|
-
* @param apps -
|
|
3668
|
-
* @param latestTimestamp - LatestTimestamp is available to some TEAL scripts. Defaults to the latest
|
|
3669
|
-
* confirmed timestamp this algod is attached to.
|
|
3670
|
-
* @param protocolVersion - ProtocolVersion specifies a specific version string to operate under, otherwise
|
|
3671
|
-
* whatever the current protocol of the network this algod is running in.
|
|
3672
|
-
* @param round - Round is available to some TEAL scripts. Defaults to the current round on the
|
|
3673
|
-
* network this algod is attached to.
|
|
3674
|
-
* @param sources -
|
|
3675
|
-
* @param txns -
|
|
3676
|
-
*/
|
|
3677
|
-
constructor({
|
|
3678
|
-
accounts,
|
|
3679
|
-
apps,
|
|
3680
|
-
latestTimestamp,
|
|
3681
|
-
protocolVersion,
|
|
3682
|
-
round,
|
|
3683
|
-
sources,
|
|
3684
|
-
txns,
|
|
3685
|
-
}: {
|
|
3686
|
-
accounts: Account[];
|
|
3687
|
-
apps: Application[];
|
|
3688
|
-
latestTimestamp: number | bigint;
|
|
3689
|
-
protocolVersion: string;
|
|
3690
|
-
round: number | bigint;
|
|
3691
|
-
sources: DryrunSource[];
|
|
3692
|
-
txns: SignedTransaction[];
|
|
3693
|
-
}) {
|
|
3694
|
-
this.accounts = accounts;
|
|
3695
|
-
this.apps = apps;
|
|
3696
|
-
this.latestTimestamp = ensureSafeInteger(latestTimestamp);
|
|
3697
|
-
this.protocolVersion = protocolVersion;
|
|
3698
|
-
this.round = ensureBigInt(round);
|
|
3699
|
-
this.sources = sources;
|
|
3700
|
-
this.txns = txns;
|
|
3701
|
-
}
|
|
3702
|
-
|
|
3703
|
-
// eslint-disable-next-line class-methods-use-this
|
|
3704
|
-
getEncodingSchema(): Schema {
|
|
3705
|
-
return DryrunRequest.encodingSchema;
|
|
3706
|
-
}
|
|
3707
|
-
|
|
3708
|
-
toEncodingData(): Map<string, unknown> {
|
|
3709
|
-
return new Map<string, unknown>([
|
|
3710
|
-
['accounts', this.accounts.map((v) => v.toEncodingData())],
|
|
3711
|
-
['apps', this.apps.map((v) => v.toEncodingData())],
|
|
3712
|
-
['latest-timestamp', this.latestTimestamp],
|
|
3713
|
-
['protocol-version', this.protocolVersion],
|
|
3714
|
-
['round', this.round],
|
|
3715
|
-
['sources', this.sources.map((v) => v.toEncodingData())],
|
|
3716
|
-
['txns', this.txns.map((v) => v.toEncodingData())],
|
|
3717
|
-
]);
|
|
3718
|
-
}
|
|
3719
|
-
|
|
3720
|
-
static fromEncodingData(data: unknown): DryrunRequest {
|
|
3721
|
-
if (!(data instanceof Map)) {
|
|
3722
|
-
throw new Error(`Invalid decoded DryrunRequest: ${data}`);
|
|
3723
|
-
}
|
|
3724
|
-
return new DryrunRequest({
|
|
3725
|
-
accounts: (data.get('accounts') ?? []).map((v: unknown) =>
|
|
3726
|
-
Account.fromEncodingData(v)
|
|
3727
|
-
),
|
|
3728
|
-
apps: (data.get('apps') ?? []).map((v: unknown) =>
|
|
3729
|
-
Application.fromEncodingData(v)
|
|
3730
|
-
),
|
|
3731
|
-
latestTimestamp: data.get('latest-timestamp'),
|
|
3732
|
-
protocolVersion: data.get('protocol-version'),
|
|
3733
|
-
round: data.get('round'),
|
|
3734
|
-
sources: (data.get('sources') ?? []).map((v: unknown) =>
|
|
3735
|
-
DryrunSource.fromEncodingData(v)
|
|
3736
|
-
),
|
|
3737
|
-
txns: (data.get('txns') ?? []).map((v: unknown) =>
|
|
3738
|
-
SignedTransaction.fromEncodingData(v)
|
|
3739
|
-
),
|
|
3740
|
-
});
|
|
3741
|
-
}
|
|
3742
|
-
}
|
|
3743
|
-
|
|
3744
|
-
/**
|
|
3745
|
-
* DryrunResponse contains per-txn debug information from a dryrun.
|
|
3746
|
-
*/
|
|
3747
|
-
export class DryrunResponse implements Encodable {
|
|
3748
|
-
private static encodingSchemaValue: Schema | undefined;
|
|
3749
|
-
|
|
3750
|
-
static get encodingSchema(): Schema {
|
|
3751
|
-
if (!this.encodingSchemaValue) {
|
|
3752
|
-
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
3753
|
-
(this.encodingSchemaValue as NamedMapSchema).pushEntries(
|
|
3754
|
-
{ key: 'error', valueSchema: new StringSchema(), omitEmpty: true },
|
|
3755
|
-
{
|
|
3756
|
-
key: 'protocol-version',
|
|
3757
|
-
valueSchema: new StringSchema(),
|
|
3758
|
-
omitEmpty: true,
|
|
3759
|
-
},
|
|
3760
|
-
{
|
|
3761
|
-
key: 'txns',
|
|
3762
|
-
valueSchema: new ArraySchema(DryrunTxnResult.encodingSchema),
|
|
3763
|
-
omitEmpty: true,
|
|
3764
|
-
}
|
|
3765
|
-
);
|
|
3766
|
-
}
|
|
3767
|
-
return this.encodingSchemaValue;
|
|
3768
|
-
}
|
|
3769
|
-
|
|
3770
|
-
public error: string;
|
|
3771
|
-
|
|
3772
|
-
/**
|
|
3773
|
-
* Protocol version is the protocol version Dryrun was operated under.
|
|
3774
|
-
*/
|
|
3775
|
-
public protocolVersion: string;
|
|
3776
|
-
|
|
3777
|
-
public txns: DryrunTxnResult[];
|
|
3778
|
-
|
|
3779
|
-
/**
|
|
3780
|
-
* Creates a new `DryrunResponse` object.
|
|
3781
|
-
* @param error -
|
|
3782
|
-
* @param protocolVersion - Protocol version is the protocol version Dryrun was operated under.
|
|
3783
|
-
* @param txns -
|
|
3784
|
-
*/
|
|
3785
|
-
constructor({
|
|
3786
|
-
error,
|
|
3787
|
-
protocolVersion,
|
|
3788
|
-
txns,
|
|
3789
|
-
}: {
|
|
3790
|
-
error: string;
|
|
3791
|
-
protocolVersion: string;
|
|
3792
|
-
txns: DryrunTxnResult[];
|
|
3793
|
-
}) {
|
|
3794
|
-
this.error = error;
|
|
3795
|
-
this.protocolVersion = protocolVersion;
|
|
3796
|
-
this.txns = txns;
|
|
3797
|
-
}
|
|
3798
|
-
|
|
3799
|
-
// eslint-disable-next-line class-methods-use-this
|
|
3800
|
-
getEncodingSchema(): Schema {
|
|
3801
|
-
return DryrunResponse.encodingSchema;
|
|
3802
|
-
}
|
|
3803
|
-
|
|
3804
|
-
toEncodingData(): Map<string, unknown> {
|
|
3805
|
-
return new Map<string, unknown>([
|
|
3806
|
-
['error', this.error],
|
|
3807
|
-
['protocol-version', this.protocolVersion],
|
|
3808
|
-
['txns', this.txns.map((v) => v.toEncodingData())],
|
|
3809
|
-
]);
|
|
3810
|
-
}
|
|
3811
|
-
|
|
3812
|
-
static fromEncodingData(data: unknown): DryrunResponse {
|
|
3813
|
-
if (!(data instanceof Map)) {
|
|
3814
|
-
throw new Error(`Invalid decoded DryrunResponse: ${data}`);
|
|
3815
|
-
}
|
|
3816
|
-
return new DryrunResponse({
|
|
3817
|
-
error: data.get('error'),
|
|
3818
|
-
protocolVersion: data.get('protocol-version'),
|
|
3819
|
-
txns: (data.get('txns') ?? []).map((v: unknown) =>
|
|
3820
|
-
DryrunTxnResult.fromEncodingData(v)
|
|
3821
|
-
),
|
|
3822
|
-
});
|
|
3823
|
-
}
|
|
3824
|
-
}
|
|
3825
|
-
|
|
3826
|
-
/**
|
|
3827
|
-
* DryrunSource is TEAL source text that gets uploaded, compiled, and inserted into
|
|
3828
|
-
* transactions or application state.
|
|
3829
|
-
*/
|
|
3830
|
-
export class DryrunSource implements Encodable {
|
|
3831
|
-
private static encodingSchemaValue: Schema | undefined;
|
|
3832
|
-
|
|
3833
|
-
static get encodingSchema(): Schema {
|
|
3834
|
-
if (!this.encodingSchemaValue) {
|
|
3835
|
-
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
3836
|
-
(this.encodingSchemaValue as NamedMapSchema).pushEntries(
|
|
3837
|
-
{ key: 'app-index', valueSchema: new Uint64Schema(), omitEmpty: true },
|
|
3838
|
-
{ key: 'field-name', valueSchema: new StringSchema(), omitEmpty: true },
|
|
3839
|
-
{ key: 'source', valueSchema: new StringSchema(), omitEmpty: true },
|
|
3840
|
-
{ key: 'txn-index', valueSchema: new Uint64Schema(), omitEmpty: true }
|
|
3725
|
+
{ key: 'minor', valueSchema: new Uint64Schema(), omitEmpty: true }
|
|
3841
3726
|
);
|
|
3842
3727
|
}
|
|
3843
3728
|
return this.encodingSchemaValue;
|
|
3844
3729
|
}
|
|
3845
3730
|
|
|
3846
|
-
public
|
|
3731
|
+
public branch: string;
|
|
3847
3732
|
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
public fieldName: string;
|
|
3733
|
+
public buildNumber: number;
|
|
3734
|
+
|
|
3735
|
+
public channel: string;
|
|
3736
|
+
|
|
3737
|
+
public commitHash: string;
|
|
3854
3738
|
|
|
3855
|
-
public
|
|
3739
|
+
public major: number;
|
|
3856
3740
|
|
|
3857
|
-
public
|
|
3741
|
+
public minor: number;
|
|
3858
3742
|
|
|
3859
3743
|
/**
|
|
3860
|
-
* Creates a new `
|
|
3861
|
-
* @param
|
|
3862
|
-
* @param
|
|
3863
|
-
*
|
|
3864
|
-
*
|
|
3865
|
-
* @param
|
|
3866
|
-
* @param
|
|
3744
|
+
* Creates a new `BuildVersion` object.
|
|
3745
|
+
* @param branch -
|
|
3746
|
+
* @param buildNumber -
|
|
3747
|
+
* @param channel -
|
|
3748
|
+
* @param commitHash -
|
|
3749
|
+
* @param major -
|
|
3750
|
+
* @param minor -
|
|
3867
3751
|
*/
|
|
3868
3752
|
constructor({
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3753
|
+
branch,
|
|
3754
|
+
buildNumber,
|
|
3755
|
+
channel,
|
|
3756
|
+
commitHash,
|
|
3757
|
+
major,
|
|
3758
|
+
minor,
|
|
3873
3759
|
}: {
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3760
|
+
branch: string;
|
|
3761
|
+
buildNumber: number | bigint;
|
|
3762
|
+
channel: string;
|
|
3763
|
+
commitHash: string;
|
|
3764
|
+
major: number | bigint;
|
|
3765
|
+
minor: number | bigint;
|
|
3878
3766
|
}) {
|
|
3879
|
-
this.
|
|
3880
|
-
this.
|
|
3881
|
-
this.
|
|
3882
|
-
this.
|
|
3767
|
+
this.branch = branch;
|
|
3768
|
+
this.buildNumber = ensureSafeInteger(buildNumber);
|
|
3769
|
+
this.channel = channel;
|
|
3770
|
+
this.commitHash = commitHash;
|
|
3771
|
+
this.major = ensureSafeInteger(major);
|
|
3772
|
+
this.minor = ensureSafeInteger(minor);
|
|
3883
3773
|
}
|
|
3884
3774
|
|
|
3885
3775
|
// eslint-disable-next-line class-methods-use-this
|
|
3886
3776
|
getEncodingSchema(): Schema {
|
|
3887
|
-
return
|
|
3777
|
+
return BuildVersion.encodingSchema;
|
|
3888
3778
|
}
|
|
3889
3779
|
|
|
3890
3780
|
toEncodingData(): Map<string, unknown> {
|
|
3891
3781
|
return new Map<string, unknown>([
|
|
3892
|
-
['
|
|
3893
|
-
['
|
|
3894
|
-
['
|
|
3895
|
-
['
|
|
3782
|
+
['branch', this.branch],
|
|
3783
|
+
['build_number', this.buildNumber],
|
|
3784
|
+
['channel', this.channel],
|
|
3785
|
+
['commit_hash', this.commitHash],
|
|
3786
|
+
['major', this.major],
|
|
3787
|
+
['minor', this.minor],
|
|
3896
3788
|
]);
|
|
3897
3789
|
}
|
|
3898
3790
|
|
|
3899
|
-
static fromEncodingData(data: unknown):
|
|
3791
|
+
static fromEncodingData(data: unknown): BuildVersion {
|
|
3900
3792
|
if (!(data instanceof Map)) {
|
|
3901
|
-
throw new Error(`Invalid decoded
|
|
3793
|
+
throw new Error(`Invalid decoded BuildVersion: ${data}`);
|
|
3902
3794
|
}
|
|
3903
|
-
return new
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3795
|
+
return new BuildVersion({
|
|
3796
|
+
branch: data.get('branch'),
|
|
3797
|
+
buildNumber: data.get('build_number'),
|
|
3798
|
+
channel: data.get('channel'),
|
|
3799
|
+
commitHash: data.get('commit_hash'),
|
|
3800
|
+
major: data.get('major'),
|
|
3801
|
+
minor: data.get('minor'),
|
|
3908
3802
|
});
|
|
3909
3803
|
}
|
|
3910
3804
|
}
|
|
3911
3805
|
|
|
3912
3806
|
/**
|
|
3913
|
-
*
|
|
3807
|
+
* Teal compile Result
|
|
3914
3808
|
*/
|
|
3915
|
-
export class
|
|
3809
|
+
export class CompileResponse implements Encodable {
|
|
3916
3810
|
private static encodingSchemaValue: Schema | undefined;
|
|
3917
3811
|
|
|
3918
3812
|
static get encodingSchema(): Schema {
|
|
3919
3813
|
if (!this.encodingSchemaValue) {
|
|
3920
3814
|
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
3921
3815
|
(this.encodingSchemaValue as NamedMapSchema).pushEntries(
|
|
3922
|
-
{ key: '
|
|
3923
|
-
{ key: '
|
|
3924
|
-
{
|
|
3925
|
-
key: 'stack',
|
|
3926
|
-
valueSchema: new ArraySchema(TealValue.encodingSchema),
|
|
3927
|
-
omitEmpty: true,
|
|
3928
|
-
},
|
|
3929
|
-
{
|
|
3930
|
-
key: 'error',
|
|
3931
|
-
valueSchema: new OptionalSchema(new StringSchema()),
|
|
3932
|
-
omitEmpty: true,
|
|
3933
|
-
},
|
|
3816
|
+
{ key: 'hash', valueSchema: new StringSchema(), omitEmpty: true },
|
|
3817
|
+
{ key: 'result', valueSchema: new StringSchema(), omitEmpty: true },
|
|
3934
3818
|
{
|
|
3935
|
-
key: '
|
|
3936
|
-
valueSchema: new OptionalSchema(
|
|
3937
|
-
new ArraySchema(TealValue.encodingSchema)
|
|
3938
|
-
),
|
|
3819
|
+
key: 'sourcemap',
|
|
3820
|
+
valueSchema: new OptionalSchema(UntypedValue.encodingSchema),
|
|
3939
3821
|
omitEmpty: true,
|
|
3940
3822
|
}
|
|
3941
3823
|
);
|
|
@@ -3944,346 +3826,119 @@ export class DryrunState implements Encodable {
|
|
|
3944
3826
|
}
|
|
3945
3827
|
|
|
3946
3828
|
/**
|
|
3947
|
-
*
|
|
3829
|
+
* base32 SHA512_256 of program bytes (Address style)
|
|
3948
3830
|
*/
|
|
3949
|
-
public
|
|
3831
|
+
public hash: string;
|
|
3950
3832
|
|
|
3951
3833
|
/**
|
|
3952
|
-
*
|
|
3834
|
+
* base64 encoded program bytes
|
|
3953
3835
|
*/
|
|
3954
|
-
public
|
|
3955
|
-
|
|
3956
|
-
public stack: TealValue[];
|
|
3836
|
+
public result: string;
|
|
3957
3837
|
|
|
3958
3838
|
/**
|
|
3959
|
-
*
|
|
3839
|
+
* JSON of the source map
|
|
3960
3840
|
*/
|
|
3961
|
-
public
|
|
3962
|
-
|
|
3963
|
-
public scratch?: TealValue[];
|
|
3841
|
+
public sourcemap?: UntypedValue;
|
|
3964
3842
|
|
|
3965
3843
|
/**
|
|
3966
|
-
* Creates a new `
|
|
3967
|
-
* @param
|
|
3968
|
-
* @param
|
|
3969
|
-
* @param
|
|
3970
|
-
* @param error - Evaluation error if any
|
|
3971
|
-
* @param scratch -
|
|
3844
|
+
* Creates a new `CompileResponse` object.
|
|
3845
|
+
* @param hash - base32 SHA512_256 of program bytes (Address style)
|
|
3846
|
+
* @param result - base64 encoded program bytes
|
|
3847
|
+
* @param sourcemap - JSON of the source map
|
|
3972
3848
|
*/
|
|
3973
3849
|
constructor({
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
error,
|
|
3978
|
-
scratch,
|
|
3850
|
+
hash,
|
|
3851
|
+
result,
|
|
3852
|
+
sourcemap,
|
|
3979
3853
|
}: {
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
error?: string;
|
|
3984
|
-
scratch?: TealValue[];
|
|
3854
|
+
hash: string;
|
|
3855
|
+
result: string;
|
|
3856
|
+
sourcemap?: UntypedValue;
|
|
3985
3857
|
}) {
|
|
3986
|
-
this.
|
|
3987
|
-
this.
|
|
3988
|
-
this.
|
|
3989
|
-
this.error = error;
|
|
3990
|
-
this.scratch = scratch;
|
|
3858
|
+
this.hash = hash;
|
|
3859
|
+
this.result = result;
|
|
3860
|
+
this.sourcemap = sourcemap;
|
|
3991
3861
|
}
|
|
3992
3862
|
|
|
3993
3863
|
// eslint-disable-next-line class-methods-use-this
|
|
3994
3864
|
getEncodingSchema(): Schema {
|
|
3995
|
-
return
|
|
3865
|
+
return CompileResponse.encodingSchema;
|
|
3996
3866
|
}
|
|
3997
3867
|
|
|
3998
3868
|
toEncodingData(): Map<string, unknown> {
|
|
3999
3869
|
return new Map<string, unknown>([
|
|
4000
|
-
['
|
|
4001
|
-
['
|
|
4002
|
-
['stack', this.stack.map((v) => v.toEncodingData())],
|
|
4003
|
-
['error', this.error],
|
|
3870
|
+
['hash', this.hash],
|
|
3871
|
+
['result', this.result],
|
|
4004
3872
|
[
|
|
4005
|
-
'
|
|
4006
|
-
typeof this.
|
|
4007
|
-
? this.
|
|
3873
|
+
'sourcemap',
|
|
3874
|
+
typeof this.sourcemap !== 'undefined'
|
|
3875
|
+
? this.sourcemap.toEncodingData()
|
|
4008
3876
|
: undefined,
|
|
4009
3877
|
],
|
|
4010
3878
|
]);
|
|
4011
3879
|
}
|
|
4012
3880
|
|
|
4013
|
-
static fromEncodingData(data: unknown):
|
|
3881
|
+
static fromEncodingData(data: unknown): CompileResponse {
|
|
4014
3882
|
if (!(data instanceof Map)) {
|
|
4015
|
-
throw new Error(`Invalid decoded
|
|
3883
|
+
throw new Error(`Invalid decoded CompileResponse: ${data}`);
|
|
4016
3884
|
}
|
|
4017
|
-
return new
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
error: data.get('error'),
|
|
4024
|
-
scratch:
|
|
4025
|
-
typeof data.get('scratch') !== 'undefined'
|
|
4026
|
-
? data
|
|
4027
|
-
.get('scratch')
|
|
4028
|
-
.map((v: unknown) => TealValue.fromEncodingData(v))
|
|
3885
|
+
return new CompileResponse({
|
|
3886
|
+
hash: data.get('hash'),
|
|
3887
|
+
result: data.get('result'),
|
|
3888
|
+
sourcemap:
|
|
3889
|
+
typeof data.get('sourcemap') !== 'undefined'
|
|
3890
|
+
? UntypedValue.fromEncodingData(data.get('sourcemap'))
|
|
4029
3891
|
: undefined,
|
|
4030
3892
|
});
|
|
4031
3893
|
}
|
|
4032
3894
|
}
|
|
4033
3895
|
|
|
4034
3896
|
/**
|
|
4035
|
-
*
|
|
4036
|
-
* information and state updates from a dryrun.
|
|
3897
|
+
* Teal disassembly Result
|
|
4037
3898
|
*/
|
|
4038
|
-
export class
|
|
3899
|
+
export class DisassembleResponse implements Encodable {
|
|
4039
3900
|
private static encodingSchemaValue: Schema | undefined;
|
|
4040
3901
|
|
|
4041
3902
|
static get encodingSchema(): Schema {
|
|
4042
3903
|
if (!this.encodingSchemaValue) {
|
|
4043
3904
|
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
4044
|
-
(this.encodingSchemaValue as NamedMapSchema).pushEntries(
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
},
|
|
4050
|
-
{
|
|
4051
|
-
key: 'app-call-messages',
|
|
4052
|
-
valueSchema: new OptionalSchema(new ArraySchema(new StringSchema())),
|
|
4053
|
-
omitEmpty: true,
|
|
4054
|
-
},
|
|
4055
|
-
{
|
|
4056
|
-
key: 'app-call-trace',
|
|
4057
|
-
valueSchema: new OptionalSchema(
|
|
4058
|
-
new ArraySchema(DryrunState.encodingSchema)
|
|
4059
|
-
),
|
|
4060
|
-
omitEmpty: true,
|
|
4061
|
-
},
|
|
4062
|
-
{
|
|
4063
|
-
key: 'budget-added',
|
|
4064
|
-
valueSchema: new OptionalSchema(new Uint64Schema()),
|
|
4065
|
-
omitEmpty: true,
|
|
4066
|
-
},
|
|
4067
|
-
{
|
|
4068
|
-
key: 'budget-consumed',
|
|
4069
|
-
valueSchema: new OptionalSchema(new Uint64Schema()),
|
|
4070
|
-
omitEmpty: true,
|
|
4071
|
-
},
|
|
4072
|
-
{
|
|
4073
|
-
key: 'global-delta',
|
|
4074
|
-
valueSchema: new OptionalSchema(
|
|
4075
|
-
new ArraySchema(EvalDeltaKeyValue.encodingSchema)
|
|
4076
|
-
),
|
|
4077
|
-
omitEmpty: true,
|
|
4078
|
-
},
|
|
4079
|
-
{
|
|
4080
|
-
key: 'local-deltas',
|
|
4081
|
-
valueSchema: new OptionalSchema(
|
|
4082
|
-
new ArraySchema(AccountStateDelta.encodingSchema)
|
|
4083
|
-
),
|
|
4084
|
-
omitEmpty: true,
|
|
4085
|
-
},
|
|
4086
|
-
{
|
|
4087
|
-
key: 'logic-sig-disassembly',
|
|
4088
|
-
valueSchema: new OptionalSchema(new ArraySchema(new StringSchema())),
|
|
4089
|
-
omitEmpty: true,
|
|
4090
|
-
},
|
|
4091
|
-
{
|
|
4092
|
-
key: 'logic-sig-messages',
|
|
4093
|
-
valueSchema: new OptionalSchema(new ArraySchema(new StringSchema())),
|
|
4094
|
-
omitEmpty: true,
|
|
4095
|
-
},
|
|
4096
|
-
{
|
|
4097
|
-
key: 'logic-sig-trace',
|
|
4098
|
-
valueSchema: new OptionalSchema(
|
|
4099
|
-
new ArraySchema(DryrunState.encodingSchema)
|
|
4100
|
-
),
|
|
4101
|
-
omitEmpty: true,
|
|
4102
|
-
},
|
|
4103
|
-
{
|
|
4104
|
-
key: 'logs',
|
|
4105
|
-
valueSchema: new OptionalSchema(
|
|
4106
|
-
new ArraySchema(new ByteArraySchema())
|
|
4107
|
-
),
|
|
4108
|
-
omitEmpty: true,
|
|
4109
|
-
}
|
|
4110
|
-
);
|
|
3905
|
+
(this.encodingSchemaValue as NamedMapSchema).pushEntries({
|
|
3906
|
+
key: 'result',
|
|
3907
|
+
valueSchema: new StringSchema(),
|
|
3908
|
+
omitEmpty: true,
|
|
3909
|
+
});
|
|
4111
3910
|
}
|
|
4112
3911
|
return this.encodingSchemaValue;
|
|
4113
3912
|
}
|
|
4114
3913
|
|
|
4115
3914
|
/**
|
|
4116
|
-
*
|
|
4117
|
-
*/
|
|
4118
|
-
public disassembly: string[];
|
|
4119
|
-
|
|
4120
|
-
public appCallMessages?: string[];
|
|
4121
|
-
|
|
4122
|
-
public appCallTrace?: DryrunState[];
|
|
4123
|
-
|
|
4124
|
-
/**
|
|
4125
|
-
* Budget added during execution of app call transaction.
|
|
4126
|
-
*/
|
|
4127
|
-
public budgetAdded?: number;
|
|
4128
|
-
|
|
4129
|
-
/**
|
|
4130
|
-
* Budget consumed during execution of app call transaction.
|
|
4131
|
-
*/
|
|
4132
|
-
public budgetConsumed?: number;
|
|
4133
|
-
|
|
4134
|
-
/**
|
|
4135
|
-
* Application state delta.
|
|
4136
|
-
*/
|
|
4137
|
-
public globalDelta?: EvalDeltaKeyValue[];
|
|
4138
|
-
|
|
4139
|
-
public localDeltas?: AccountStateDelta[];
|
|
4140
|
-
|
|
4141
|
-
/**
|
|
4142
|
-
* Disassembled lsig program line by line.
|
|
3915
|
+
* disassembled Teal code
|
|
4143
3916
|
*/
|
|
4144
|
-
public
|
|
4145
|
-
|
|
4146
|
-
public logicSigMessages?: string[];
|
|
4147
|
-
|
|
4148
|
-
public logicSigTrace?: DryrunState[];
|
|
4149
|
-
|
|
4150
|
-
public logs?: Uint8Array[];
|
|
3917
|
+
public result: string;
|
|
4151
3918
|
|
|
4152
3919
|
/**
|
|
4153
|
-
* Creates a new `
|
|
4154
|
-
* @param
|
|
4155
|
-
* @param appCallMessages -
|
|
4156
|
-
* @param appCallTrace -
|
|
4157
|
-
* @param budgetAdded - Budget added during execution of app call transaction.
|
|
4158
|
-
* @param budgetConsumed - Budget consumed during execution of app call transaction.
|
|
4159
|
-
* @param globalDelta - Application state delta.
|
|
4160
|
-
* @param localDeltas -
|
|
4161
|
-
* @param logicSigDisassembly - Disassembled lsig program line by line.
|
|
4162
|
-
* @param logicSigMessages -
|
|
4163
|
-
* @param logicSigTrace -
|
|
4164
|
-
* @param logs -
|
|
3920
|
+
* Creates a new `DisassembleResponse` object.
|
|
3921
|
+
* @param result - disassembled Teal code
|
|
4165
3922
|
*/
|
|
4166
|
-
constructor({
|
|
4167
|
-
|
|
4168
|
-
appCallMessages,
|
|
4169
|
-
appCallTrace,
|
|
4170
|
-
budgetAdded,
|
|
4171
|
-
budgetConsumed,
|
|
4172
|
-
globalDelta,
|
|
4173
|
-
localDeltas,
|
|
4174
|
-
logicSigDisassembly,
|
|
4175
|
-
logicSigMessages,
|
|
4176
|
-
logicSigTrace,
|
|
4177
|
-
logs,
|
|
4178
|
-
}: {
|
|
4179
|
-
disassembly: string[];
|
|
4180
|
-
appCallMessages?: string[];
|
|
4181
|
-
appCallTrace?: DryrunState[];
|
|
4182
|
-
budgetAdded?: number | bigint;
|
|
4183
|
-
budgetConsumed?: number | bigint;
|
|
4184
|
-
globalDelta?: EvalDeltaKeyValue[];
|
|
4185
|
-
localDeltas?: AccountStateDelta[];
|
|
4186
|
-
logicSigDisassembly?: string[];
|
|
4187
|
-
logicSigMessages?: string[];
|
|
4188
|
-
logicSigTrace?: DryrunState[];
|
|
4189
|
-
logs?: Uint8Array[];
|
|
4190
|
-
}) {
|
|
4191
|
-
this.disassembly = disassembly;
|
|
4192
|
-
this.appCallMessages = appCallMessages;
|
|
4193
|
-
this.appCallTrace = appCallTrace;
|
|
4194
|
-
this.budgetAdded =
|
|
4195
|
-
typeof budgetAdded === 'undefined'
|
|
4196
|
-
? undefined
|
|
4197
|
-
: ensureSafeInteger(budgetAdded);
|
|
4198
|
-
this.budgetConsumed =
|
|
4199
|
-
typeof budgetConsumed === 'undefined'
|
|
4200
|
-
? undefined
|
|
4201
|
-
: ensureSafeInteger(budgetConsumed);
|
|
4202
|
-
this.globalDelta = globalDelta;
|
|
4203
|
-
this.localDeltas = localDeltas;
|
|
4204
|
-
this.logicSigDisassembly = logicSigDisassembly;
|
|
4205
|
-
this.logicSigMessages = logicSigMessages;
|
|
4206
|
-
this.logicSigTrace = logicSigTrace;
|
|
4207
|
-
this.logs = logs;
|
|
3923
|
+
constructor({ result }: { result: string }) {
|
|
3924
|
+
this.result = result;
|
|
4208
3925
|
}
|
|
4209
3926
|
|
|
4210
3927
|
// eslint-disable-next-line class-methods-use-this
|
|
4211
3928
|
getEncodingSchema(): Schema {
|
|
4212
|
-
return
|
|
3929
|
+
return DisassembleResponse.encodingSchema;
|
|
4213
3930
|
}
|
|
4214
3931
|
|
|
4215
3932
|
toEncodingData(): Map<string, unknown> {
|
|
4216
|
-
return new Map<string, unknown>([
|
|
4217
|
-
['disassembly', this.disassembly],
|
|
4218
|
-
['app-call-messages', this.appCallMessages],
|
|
4219
|
-
[
|
|
4220
|
-
'app-call-trace',
|
|
4221
|
-
typeof this.appCallTrace !== 'undefined'
|
|
4222
|
-
? this.appCallTrace.map((v) => v.toEncodingData())
|
|
4223
|
-
: undefined,
|
|
4224
|
-
],
|
|
4225
|
-
['budget-added', this.budgetAdded],
|
|
4226
|
-
['budget-consumed', this.budgetConsumed],
|
|
4227
|
-
[
|
|
4228
|
-
'global-delta',
|
|
4229
|
-
typeof this.globalDelta !== 'undefined'
|
|
4230
|
-
? this.globalDelta.map((v) => v.toEncodingData())
|
|
4231
|
-
: undefined,
|
|
4232
|
-
],
|
|
4233
|
-
[
|
|
4234
|
-
'local-deltas',
|
|
4235
|
-
typeof this.localDeltas !== 'undefined'
|
|
4236
|
-
? this.localDeltas.map((v) => v.toEncodingData())
|
|
4237
|
-
: undefined,
|
|
4238
|
-
],
|
|
4239
|
-
['logic-sig-disassembly', this.logicSigDisassembly],
|
|
4240
|
-
['logic-sig-messages', this.logicSigMessages],
|
|
4241
|
-
[
|
|
4242
|
-
'logic-sig-trace',
|
|
4243
|
-
typeof this.logicSigTrace !== 'undefined'
|
|
4244
|
-
? this.logicSigTrace.map((v) => v.toEncodingData())
|
|
4245
|
-
: undefined,
|
|
4246
|
-
],
|
|
4247
|
-
['logs', this.logs],
|
|
4248
|
-
]);
|
|
3933
|
+
return new Map<string, unknown>([['result', this.result]]);
|
|
4249
3934
|
}
|
|
4250
3935
|
|
|
4251
|
-
static fromEncodingData(data: unknown):
|
|
3936
|
+
static fromEncodingData(data: unknown): DisassembleResponse {
|
|
4252
3937
|
if (!(data instanceof Map)) {
|
|
4253
|
-
throw new Error(`Invalid decoded
|
|
3938
|
+
throw new Error(`Invalid decoded DisassembleResponse: ${data}`);
|
|
4254
3939
|
}
|
|
4255
|
-
return new
|
|
4256
|
-
|
|
4257
|
-
appCallMessages: data.get('app-call-messages'),
|
|
4258
|
-
appCallTrace:
|
|
4259
|
-
typeof data.get('app-call-trace') !== 'undefined'
|
|
4260
|
-
? data
|
|
4261
|
-
.get('app-call-trace')
|
|
4262
|
-
.map((v: unknown) => DryrunState.fromEncodingData(v))
|
|
4263
|
-
: undefined,
|
|
4264
|
-
budgetAdded: data.get('budget-added'),
|
|
4265
|
-
budgetConsumed: data.get('budget-consumed'),
|
|
4266
|
-
globalDelta:
|
|
4267
|
-
typeof data.get('global-delta') !== 'undefined'
|
|
4268
|
-
? data
|
|
4269
|
-
.get('global-delta')
|
|
4270
|
-
.map((v: unknown) => EvalDeltaKeyValue.fromEncodingData(v))
|
|
4271
|
-
: undefined,
|
|
4272
|
-
localDeltas:
|
|
4273
|
-
typeof data.get('local-deltas') !== 'undefined'
|
|
4274
|
-
? data
|
|
4275
|
-
.get('local-deltas')
|
|
4276
|
-
.map((v: unknown) => AccountStateDelta.fromEncodingData(v))
|
|
4277
|
-
: undefined,
|
|
4278
|
-
logicSigDisassembly: data.get('logic-sig-disassembly'),
|
|
4279
|
-
logicSigMessages: data.get('logic-sig-messages'),
|
|
4280
|
-
logicSigTrace:
|
|
4281
|
-
typeof data.get('logic-sig-trace') !== 'undefined'
|
|
4282
|
-
? data
|
|
4283
|
-
.get('logic-sig-trace')
|
|
4284
|
-
.map((v: unknown) => DryrunState.fromEncodingData(v))
|
|
4285
|
-
: undefined,
|
|
4286
|
-
logs: data.get('logs'),
|
|
3940
|
+
return new DisassembleResponse({
|
|
3941
|
+
result: data.get('result'),
|
|
4287
3942
|
});
|
|
4288
3943
|
}
|
|
4289
3944
|
}
|
|
@@ -8039,6 +7694,11 @@ export class SupplyResponse implements Encodable {
|
|
|
8039
7694
|
valueSchema: new Uint64Schema(),
|
|
8040
7695
|
omitEmpty: true,
|
|
8041
7696
|
},
|
|
7697
|
+
{
|
|
7698
|
+
key: 'online-stake',
|
|
7699
|
+
valueSchema: new Uint64Schema(),
|
|
7700
|
+
omitEmpty: true,
|
|
7701
|
+
},
|
|
8042
7702
|
{ key: 'total-money', valueSchema: new Uint64Schema(), omitEmpty: true }
|
|
8043
7703
|
);
|
|
8044
7704
|
}
|
|
@@ -8051,10 +7711,18 @@ export class SupplyResponse implements Encodable {
|
|
|
8051
7711
|
public currentRound: bigint;
|
|
8052
7712
|
|
|
8053
7713
|
/**
|
|
8054
|
-
*
|
|
7714
|
+
* Total stake held by accounts with status Online at current_round, including
|
|
7715
|
+
* those whose participation keys have expired but have not yet been marked
|
|
7716
|
+
* offline.
|
|
8055
7717
|
*/
|
|
8056
7718
|
public onlineMoney: bigint;
|
|
8057
7719
|
|
|
7720
|
+
/**
|
|
7721
|
+
* Online stake used by agreement to vote for current_round, excluding accounts
|
|
7722
|
+
* whose participation keys have expired.
|
|
7723
|
+
*/
|
|
7724
|
+
public onlineStake: bigint;
|
|
7725
|
+
|
|
8058
7726
|
/**
|
|
8059
7727
|
* TotalMoney
|
|
8060
7728
|
*/
|
|
@@ -8063,20 +7731,27 @@ export class SupplyResponse implements Encodable {
|
|
|
8063
7731
|
/**
|
|
8064
7732
|
* Creates a new `SupplyResponse` object.
|
|
8065
7733
|
* @param currentRound - Round
|
|
8066
|
-
* @param onlineMoney -
|
|
7734
|
+
* @param onlineMoney - Total stake held by accounts with status Online at current_round, including
|
|
7735
|
+
* those whose participation keys have expired but have not yet been marked
|
|
7736
|
+
* offline.
|
|
7737
|
+
* @param onlineStake - Online stake used by agreement to vote for current_round, excluding accounts
|
|
7738
|
+
* whose participation keys have expired.
|
|
8067
7739
|
* @param totalMoney - TotalMoney
|
|
8068
7740
|
*/
|
|
8069
7741
|
constructor({
|
|
8070
7742
|
currentRound,
|
|
8071
7743
|
onlineMoney,
|
|
7744
|
+
onlineStake,
|
|
8072
7745
|
totalMoney,
|
|
8073
7746
|
}: {
|
|
8074
7747
|
currentRound: number | bigint;
|
|
8075
7748
|
onlineMoney: number | bigint;
|
|
7749
|
+
onlineStake: number | bigint;
|
|
8076
7750
|
totalMoney: number | bigint;
|
|
8077
7751
|
}) {
|
|
8078
7752
|
this.currentRound = ensureBigInt(currentRound);
|
|
8079
7753
|
this.onlineMoney = ensureBigInt(onlineMoney);
|
|
7754
|
+
this.onlineStake = ensureBigInt(onlineStake);
|
|
8080
7755
|
this.totalMoney = ensureBigInt(totalMoney);
|
|
8081
7756
|
}
|
|
8082
7757
|
|
|
@@ -8089,6 +7764,7 @@ export class SupplyResponse implements Encodable {
|
|
|
8089
7764
|
return new Map<string, unknown>([
|
|
8090
7765
|
['current_round', this.currentRound],
|
|
8091
7766
|
['online-money', this.onlineMoney],
|
|
7767
|
+
['online-stake', this.onlineStake],
|
|
8092
7768
|
['total-money', this.totalMoney],
|
|
8093
7769
|
]);
|
|
8094
7770
|
}
|
|
@@ -8100,6 +7776,7 @@ export class SupplyResponse implements Encodable {
|
|
|
8100
7776
|
return new SupplyResponse({
|
|
8101
7777
|
currentRound: data.get('current_round'),
|
|
8102
7778
|
onlineMoney: data.get('online-money'),
|
|
7779
|
+
onlineStake: data.get('online-stake'),
|
|
8103
7780
|
totalMoney: data.get('total-money'),
|
|
8104
7781
|
});
|
|
8105
7782
|
}
|
|
@@ -8360,8 +8037,8 @@ export class TransactionParametersResponse implements Encodable {
|
|
|
8360
8037
|
public lastRound: bigint;
|
|
8361
8038
|
|
|
8362
8039
|
/**
|
|
8363
|
-
* The minimum transaction fee (not per byte) required for the
|
|
8364
|
-
*
|
|
8040
|
+
* The minimum transaction fee (not per byte) required for the txn to validate for
|
|
8041
|
+
* the current network protocol.
|
|
8365
8042
|
*/
|
|
8366
8043
|
public minFee: bigint;
|
|
8367
8044
|
|
|
@@ -8376,8 +8053,8 @@ export class TransactionParametersResponse implements Encodable {
|
|
|
8376
8053
|
* @param genesisHash - GenesisHash is the hash of the genesis block.
|
|
8377
8054
|
* @param genesisId - GenesisID is an ID listed in the genesis block.
|
|
8378
8055
|
* @param lastRound - LastRound indicates the last round seen
|
|
8379
|
-
* @param minFee - The minimum transaction fee (not per byte) required for the
|
|
8380
|
-
*
|
|
8056
|
+
* @param minFee - The minimum transaction fee (not per byte) required for the txn to validate for
|
|
8057
|
+
* the current network protocol.
|
|
8381
8058
|
*/
|
|
8382
8059
|
constructor({
|
|
8383
8060
|
consensusVersion,
|