algosdk 3.2.0 → 3.3.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.
@@ -978,6 +978,10 @@ export class ApplicationParams {
978
978
  key: 'local-state-schema',
979
979
  valueSchema: new OptionalSchema(ApplicationStateSchema.encodingSchema),
980
980
  omitEmpty: true,
981
+ }, {
982
+ key: 'version',
983
+ valueSchema: new OptionalSchema(new Uint64Schema()),
984
+ omitEmpty: true,
981
985
  });
982
986
  }
983
987
  return this.encodingSchemaValue;
@@ -992,8 +996,9 @@ export class ApplicationParams {
992
996
  * @param globalState - global state
993
997
  * @param globalStateSchema - global schema
994
998
  * @param localStateSchema - local schema
999
+ * @param version - the number of updates to the application programs
995
1000
  */
996
- constructor({ approvalProgram, clearStateProgram, creator, extraProgramPages, globalState, globalStateSchema, localStateSchema, }) {
1001
+ constructor({ approvalProgram, clearStateProgram, creator, extraProgramPages, globalState, globalStateSchema, localStateSchema, version, }) {
997
1002
  this.approvalProgram =
998
1003
  typeof approvalProgram === 'string'
999
1004
  ? base64ToBytes(approvalProgram)
@@ -1011,6 +1016,8 @@ export class ApplicationParams {
1011
1016
  this.globalState = globalState;
1012
1017
  this.globalStateSchema = globalStateSchema;
1013
1018
  this.localStateSchema = localStateSchema;
1019
+ this.version =
1020
+ typeof version === 'undefined' ? undefined : ensureSafeInteger(version);
1014
1021
  }
1015
1022
  // eslint-disable-next-line class-methods-use-this
1016
1023
  getEncodingSchema() {
@@ -1045,6 +1052,7 @@ export class ApplicationParams {
1045
1052
  ? this.localStateSchema.toEncodingData()
1046
1053
  : undefined,
1047
1054
  ],
1055
+ ['version', this.version],
1048
1056
  ]);
1049
1057
  }
1050
1058
  static fromEncodingData(data) {
@@ -1067,6 +1075,7 @@ export class ApplicationParams {
1067
1075
  localStateSchema: typeof data.get('local-state-schema') !== 'undefined'
1068
1076
  ? ApplicationStateSchema.fromEncodingData(data.get('local-state-schema'))
1069
1077
  : undefined,
1078
+ version: data.get('version'),
1070
1079
  });
1071
1080
  }
1072
1081
  }