algosdk 3.6.0 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/README.md +4 -4
  2. package/dist/browser/algosdk.min.js +1 -1
  3. package/dist/browser/algosdk.min.js.map +1 -1
  4. package/dist/cjs/appAccess.js +4 -0
  5. package/dist/cjs/appAccess.js.map +1 -1
  6. package/dist/cjs/client/v2/algod/algod.js +0 -18
  7. package/dist/cjs/client/v2/algod/algod.js.map +1 -1
  8. package/dist/cjs/client/v2/algod/models/types.js +153 -437
  9. package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
  10. package/dist/cjs/client/v2/indexer/models/types.js +163 -12
  11. package/dist/cjs/client/v2/indexer/models/types.js.map +1 -1
  12. package/dist/cjs/composer.js +4 -6
  13. package/dist/cjs/composer.js.map +1 -1
  14. package/dist/cjs/ed25519-signer.js +76 -0
  15. package/dist/cjs/ed25519-signer.js.map +1 -0
  16. package/dist/cjs/encoding/address.js +61 -1
  17. package/dist/cjs/encoding/address.js.map +1 -1
  18. package/dist/cjs/falcon-signer.js +17 -0
  19. package/dist/cjs/falcon-signer.js.map +1 -0
  20. package/dist/cjs/heartbeat.js +7 -0
  21. package/dist/cjs/heartbeat.js.map +1 -1
  22. package/dist/cjs/logicsig.js +201 -16
  23. package/dist/cjs/logicsig.js.map +1 -1
  24. package/dist/cjs/main.js +32 -63
  25. package/dist/cjs/main.js.map +1 -1
  26. package/dist/cjs/makeTxn.js +11 -2
  27. package/dist/cjs/makeTxn.js.map +1 -1
  28. package/dist/cjs/mnemonic/mnemonic.js +26 -1
  29. package/dist/cjs/mnemonic/mnemonic.js.map +1 -1
  30. package/dist/cjs/multisigSigning.js +78 -1
  31. package/dist/cjs/multisigSigning.js.map +1 -1
  32. package/dist/cjs/pq-signer.js +80 -0
  33. package/dist/cjs/pq-signer.js.map +1 -0
  34. package/dist/cjs/signedTransaction.js +15 -1
  35. package/dist/cjs/signedTransaction.js.map +1 -1
  36. package/dist/cjs/signer.js.map +1 -1
  37. package/dist/cjs/signing.js +94 -7
  38. package/dist/cjs/signing.js.map +1 -1
  39. package/dist/cjs/transaction.js +17 -1
  40. package/dist/cjs/transaction.js.map +1 -1
  41. package/dist/cjs/types/statedelta.js +17 -0
  42. package/dist/cjs/types/statedelta.js.map +1 -1
  43. package/dist/cjs/types/transactions/encoded.js +51 -1
  44. package/dist/cjs/types/transactions/encoded.js.map +1 -1
  45. package/dist/cjs/utils/ed25519-check.js +69 -0
  46. package/dist/cjs/utils/ed25519-check.js.map +1 -0
  47. package/dist/cjs/utils/utils.js +14 -1
  48. package/dist/cjs/utils/utils.js.map +1 -1
  49. package/dist/esm/appAccess.js +4 -0
  50. package/dist/esm/appAccess.js.map +1 -1
  51. package/dist/esm/client/v2/algod/algod.js +0 -18
  52. package/dist/esm/client/v2/algod/algod.js.map +1 -1
  53. package/dist/esm/client/v2/algod/models/types.js +149 -430
  54. package/dist/esm/client/v2/algod/models/types.js.map +1 -1
  55. package/dist/esm/client/v2/indexer/models/types.js +161 -11
  56. package/dist/esm/client/v2/indexer/models/types.js.map +1 -1
  57. package/dist/esm/composer.js +4 -6
  58. package/dist/esm/composer.js.map +1 -1
  59. package/dist/esm/ed25519-signer.js +72 -0
  60. package/dist/esm/ed25519-signer.js.map +1 -0
  61. package/dist/esm/encoding/address.js +58 -0
  62. package/dist/esm/encoding/address.js.map +1 -1
  63. package/dist/esm/falcon-signer.js +13 -0
  64. package/dist/esm/falcon-signer.js.map +1 -0
  65. package/dist/esm/heartbeat.js +8 -1
  66. package/dist/esm/heartbeat.js.map +1 -1
  67. package/dist/esm/logicsig.js +200 -15
  68. package/dist/esm/logicsig.js.map +1 -1
  69. package/dist/esm/main.js +8 -56
  70. package/dist/esm/main.js.map +1 -1
  71. package/dist/esm/makeTxn.js +11 -2
  72. package/dist/esm/makeTxn.js.map +1 -1
  73. package/dist/esm/mnemonic/mnemonic.js +25 -1
  74. package/dist/esm/mnemonic/mnemonic.js.map +1 -1
  75. package/dist/esm/multisigSigning.js +75 -0
  76. package/dist/esm/multisigSigning.js.map +1 -1
  77. package/dist/esm/pq-signer.js +76 -0
  78. package/dist/esm/pq-signer.js.map +1 -0
  79. package/dist/esm/signedTransaction.js +16 -2
  80. package/dist/esm/signedTransaction.js.map +1 -1
  81. package/dist/esm/signer.js.map +1 -1
  82. package/dist/esm/signing.js +91 -8
  83. package/dist/esm/signing.js.map +1 -1
  84. package/dist/esm/transaction.js +17 -1
  85. package/dist/esm/transaction.js.map +1 -1
  86. package/dist/esm/types/statedelta.js +17 -0
  87. package/dist/esm/types/statedelta.js.map +1 -1
  88. package/dist/esm/types/transactions/encoded.js +49 -1
  89. package/dist/esm/types/transactions/encoded.js.map +1 -1
  90. package/dist/esm/utils/ed25519-check.js +65 -0
  91. package/dist/esm/utils/ed25519-check.js.map +1 -0
  92. package/dist/esm/utils/utils.js +12 -0
  93. package/dist/esm/utils/utils.js.map +1 -1
  94. package/dist/types/client/v2/algod/algod.d.ts +0 -16
  95. package/dist/types/client/v2/algod/models/types.d.ts +90 -220
  96. package/dist/types/client/v2/indexer/models/types.d.ts +114 -7
  97. package/dist/types/composer.d.ts +3 -3
  98. package/dist/types/ed25519-signer.d.ts +7 -0
  99. package/dist/types/encoding/address.d.ts +37 -0
  100. package/dist/types/falcon-signer.d.ts +11 -0
  101. package/dist/types/heartbeat.d.ts +2 -0
  102. package/dist/types/logicsig.d.ts +72 -1
  103. package/dist/types/main.d.ts +8 -44
  104. package/dist/types/makeTxn.d.ts +8 -2
  105. package/dist/types/mnemonic/mnemonic.d.ts +13 -0
  106. package/dist/types/multisigSigning.d.ts +49 -0
  107. package/dist/types/pq-signer.d.ts +8 -0
  108. package/dist/types/signedTransaction.d.ts +7 -2
  109. package/dist/types/signer.d.ts +46 -0
  110. package/dist/types/signing.d.ts +45 -0
  111. package/dist/types/transaction.d.ts +10 -0
  112. package/dist/types/types/statedelta.d.ts +18 -0
  113. package/dist/types/types/transactions/base.d.ts +10 -0
  114. package/dist/types/types/transactions/encoded.d.ts +27 -0
  115. package/dist/types/utils/ed25519-check.d.ts +10 -0
  116. package/dist/types/utils/utils.d.ts +1 -0
  117. package/package.json +2 -1
  118. package/src/appAccess.ts +5 -0
  119. package/src/client/v2/algod/algod.ts +0 -19
  120. package/src/client/v2/algod/models/types.ts +324 -790
  121. package/src/client/v2/indexer/models/types.ts +280 -8
  122. package/src/composer.ts +7 -11
  123. package/src/ed25519-signer.ts +125 -0
  124. package/src/encoding/address.ts +80 -0
  125. package/src/falcon-signer.ts +33 -0
  126. package/src/heartbeat.ts +11 -0
  127. package/src/logicsig.ts +258 -16
  128. package/src/main.ts +30 -60
  129. package/src/makeTxn.ts +13 -4
  130. package/src/mnemonic/mnemonic.ts +34 -1
  131. package/src/multisigSigning.ts +111 -0
  132. package/src/pq-signer.ts +123 -0
  133. package/src/signedTransaction.ts +24 -0
  134. package/src/signer.ts +62 -0
  135. package/src/signing.ts +109 -8
  136. package/src/transaction.ts +19 -1
  137. package/src/types/statedelta.ts +34 -0
  138. package/src/types/transactions/base.ts +11 -0
  139. package/src/types/transactions/encoded.ts +88 -0
  140. package/src/utils/ed25519-check.ts +67 -0
  141. package/src/utils/utils.ts +13 -0
  142. package/dist/cjs/client/v2/algod/dryrun.js +0 -34
  143. package/dist/cjs/client/v2/algod/dryrun.js.map +0 -1
  144. package/dist/cjs/dryrun.js +0 -214
  145. package/dist/cjs/dryrun.js.map +0 -1
  146. package/dist/esm/client/v2/algod/dryrun.js +0 -28
  147. package/dist/esm/client/v2/algod/dryrun.js.map +0 -1
  148. package/dist/esm/dryrun.js +0 -208
  149. package/dist/esm/dryrun.js.map +0 -1
  150. package/dist/types/client/v2/algod/dryrun.d.ts +0 -11
  151. package/dist/types/dryrun.d.ts +0 -28
  152. package/src/client/v2/algod/dryrun.ts +0 -38
  153. package/src/dryrun.ts +0 -292
@@ -346,6 +346,7 @@ export class Account implements Encodable {
346
346
  * * sig
347
347
  * * msig
348
348
  * * lsig
349
+ * * pqsig
349
350
  * * or null if unknown
350
351
  */
351
352
  public sigType?: string;
@@ -406,6 +407,7 @@ export class Account implements Encodable {
406
407
  * * sig
407
408
  * * msig
408
409
  * * lsig
410
+ * * pqsig
409
411
  * * or null if unknown
410
412
  */
411
413
  constructor({
@@ -3026,11 +3028,21 @@ export class Block implements Encodable {
3026
3028
  valueSchema: new OptionalSchema(new Uint64Schema()),
3027
3029
  omitEmpty: true,
3028
3030
  },
3031
+ {
3032
+ key: 'congestion-tax',
3033
+ valueSchema: new OptionalSchema(new Uint64Schema()),
3034
+ omitEmpty: true,
3035
+ },
3029
3036
  {
3030
3037
  key: 'fees-collected',
3031
3038
  valueSchema: new OptionalSchema(new Uint64Schema()),
3032
3039
  omitEmpty: true,
3033
3040
  },
3041
+ {
3042
+ key: 'load',
3043
+ valueSchema: new OptionalSchema(new Uint64Schema()),
3044
+ omitEmpty: true,
3045
+ },
3034
3046
  {
3035
3047
  key: 'participation-updates',
3036
3048
  valueSchema: new OptionalSchema(ParticipationUpdates.encodingSchema),
@@ -3148,11 +3160,24 @@ export class Block implements Encodable {
3148
3160
  */
3149
3161
  public bonus?: number;
3150
3162
 
3163
+ /**
3164
+ * the fee required, beyond the minimum fee, for "normal" transactions in this
3165
+ * block.
3166
+ */
3167
+ public congestionTax?: number;
3168
+
3151
3169
  /**
3152
3170
  * the sum of all fees paid by transactions in this block.
3153
3171
  */
3154
3172
  public feesCollected?: number;
3155
3173
 
3174
+ /**
3175
+ * the degree to which this block is full, based on the number of bytes in the
3176
+ * final block compared to the maximum allowed. Expressed as a fixed-point integer
3177
+ * with 6 digits of precision, so 1,000,000 is a completely full block.
3178
+ */
3179
+ public load?: number;
3180
+
3156
3181
  /**
3157
3182
  * Participation account data that needs to be checked/acted on by the network.
3158
3183
  */
@@ -3233,7 +3258,12 @@ export class Block implements Encodable {
3233
3258
  * the default SHA512_256. This commitment can be used on environments where only
3234
3259
  * the SHA256 function exists.
3235
3260
  * @param bonus - the potential bonus payout for this block.
3261
+ * @param congestionTax - the fee required, beyond the minimum fee, for "normal" transactions in this
3262
+ * block.
3236
3263
  * @param feesCollected - the sum of all fees paid by transactions in this block.
3264
+ * @param load - the degree to which this block is full, based on the number of bytes in the
3265
+ * final block compared to the maximum allowed. Expressed as a fixed-point integer
3266
+ * with 6 digits of precision, so 1,000,000 is a completely full block.
3237
3267
  * @param participationUpdates - Participation account data that needs to be checked/acted on by the network.
3238
3268
  * @param previousBlockHash512 - (prev512) Previous block hash, using SHA-512.
3239
3269
  * @param proposer - the proposer of this block.
@@ -3262,7 +3292,9 @@ export class Block implements Encodable {
3262
3292
  transactionsRoot,
3263
3293
  transactionsRootSha256,
3264
3294
  bonus,
3295
+ congestionTax,
3265
3296
  feesCollected,
3297
+ load,
3266
3298
  participationUpdates,
3267
3299
  previousBlockHash512,
3268
3300
  proposer,
@@ -3284,7 +3316,9 @@ export class Block implements Encodable {
3284
3316
  transactionsRoot: string | Uint8Array;
3285
3317
  transactionsRootSha256: string | Uint8Array;
3286
3318
  bonus?: number | bigint;
3319
+ congestionTax?: number | bigint;
3287
3320
  feesCollected?: number | bigint;
3321
+ load?: number | bigint;
3288
3322
  participationUpdates?: ParticipationUpdates;
3289
3323
  previousBlockHash512?: string | Uint8Array;
3290
3324
  proposer?: Address | string;
@@ -3319,10 +3353,16 @@ export class Block implements Encodable {
3319
3353
  : transactionsRootSha256;
3320
3354
  this.bonus =
3321
3355
  typeof bonus === 'undefined' ? undefined : ensureSafeInteger(bonus);
3356
+ this.congestionTax =
3357
+ typeof congestionTax === 'undefined'
3358
+ ? undefined
3359
+ : ensureSafeInteger(congestionTax);
3322
3360
  this.feesCollected =
3323
3361
  typeof feesCollected === 'undefined'
3324
3362
  ? undefined
3325
3363
  : ensureSafeInteger(feesCollected);
3364
+ this.load =
3365
+ typeof load === 'undefined' ? undefined : ensureSafeInteger(load);
3326
3366
  this.participationUpdates = participationUpdates;
3327
3367
  this.previousBlockHash512 =
3328
3368
  typeof previousBlockHash512 === 'string'
@@ -3365,7 +3405,9 @@ export class Block implements Encodable {
3365
3405
  ['transactions-root', this.transactionsRoot],
3366
3406
  ['transactions-root-sha256', this.transactionsRootSha256],
3367
3407
  ['bonus', this.bonus],
3408
+ ['congestion-tax', this.congestionTax],
3368
3409
  ['fees-collected', this.feesCollected],
3410
+ ['load', this.load],
3369
3411
  [
3370
3412
  'participation-updates',
3371
3413
  typeof this.participationUpdates !== 'undefined'
@@ -3429,7 +3471,9 @@ export class Block implements Encodable {
3429
3471
  transactionsRoot: data.get('transactions-root'),
3430
3472
  transactionsRootSha256: data.get('transactions-root-sha256'),
3431
3473
  bonus: data.get('bonus'),
3474
+ congestionTax: data.get('congestion-tax'),
3432
3475
  feesCollected: data.get('fees-collected'),
3476
+ load: data.get('load'),
3433
3477
  participationUpdates:
3434
3478
  typeof data.get('participation-updates') !== 'undefined'
3435
3479
  ? ParticipationUpdates.fromEncodingData(
@@ -4009,7 +4053,7 @@ export class Box implements Encodable {
4009
4053
  }
4010
4054
 
4011
4055
  /**
4012
- * Box descriptor describes an app box without a value.
4056
+ * Box descriptor describes an app box.
4013
4057
  */
4014
4058
  export class BoxDescriptor implements Encodable {
4015
4059
  private static encodingSchemaValue: Schema | undefined;
@@ -4017,11 +4061,14 @@ export class BoxDescriptor implements Encodable {
4017
4061
  static get encodingSchema(): Schema {
4018
4062
  if (!this.encodingSchemaValue) {
4019
4063
  this.encodingSchemaValue = new NamedMapSchema([]);
4020
- (this.encodingSchemaValue as NamedMapSchema).pushEntries({
4021
- key: 'name',
4022
- valueSchema: new ByteArraySchema(),
4023
- omitEmpty: true,
4024
- });
4064
+ (this.encodingSchemaValue as NamedMapSchema).pushEntries(
4065
+ { key: 'name', valueSchema: new ByteArraySchema(), omitEmpty: true },
4066
+ {
4067
+ key: 'value',
4068
+ valueSchema: new OptionalSchema(new ByteArraySchema()),
4069
+ omitEmpty: true,
4070
+ }
4071
+ );
4025
4072
  }
4026
4073
  return this.encodingSchemaValue;
4027
4074
  }
@@ -4031,12 +4078,27 @@ export class BoxDescriptor implements Encodable {
4031
4078
  */
4032
4079
  public name: Uint8Array;
4033
4080
 
4081
+ /**
4082
+ * Base64 encoded box value. Present only when the `values` query parameter is set
4083
+ * to true.
4084
+ */
4085
+ public value?: Uint8Array;
4086
+
4034
4087
  /**
4035
4088
  * Creates a new `BoxDescriptor` object.
4036
4089
  * @param name - Base64 encoded box name
4090
+ * @param value - Base64 encoded box value. Present only when the `values` query parameter is set
4091
+ * to true.
4037
4092
  */
4038
- constructor({ name }: { name: string | Uint8Array }) {
4093
+ constructor({
4094
+ name,
4095
+ value,
4096
+ }: {
4097
+ name: string | Uint8Array;
4098
+ value?: string | Uint8Array;
4099
+ }) {
4039
4100
  this.name = typeof name === 'string' ? base64ToBytes(name) : name;
4101
+ this.value = typeof value === 'string' ? base64ToBytes(value) : value;
4040
4102
  }
4041
4103
 
4042
4104
  // eslint-disable-next-line class-methods-use-this
@@ -4045,7 +4107,10 @@ export class BoxDescriptor implements Encodable {
4045
4107
  }
4046
4108
 
4047
4109
  toEncodingData(): Map<string, unknown> {
4048
- return new Map<string, unknown>([['name', this.name]]);
4110
+ return new Map<string, unknown>([
4111
+ ['name', this.name],
4112
+ ['value', this.value],
4113
+ ]);
4049
4114
  }
4050
4115
 
4051
4116
  static fromEncodingData(data: unknown): BoxDescriptor {
@@ -4054,6 +4119,7 @@ export class BoxDescriptor implements Encodable {
4054
4119
  }
4055
4120
  return new BoxDescriptor({
4056
4121
  name: data.get('name'),
4122
+ value: data.get('value'),
4057
4123
  });
4058
4124
  }
4059
4125
  }
@@ -4150,6 +4216,11 @@ export class BoxesResponse implements Encodable {
4150
4216
  key: 'next-token',
4151
4217
  valueSchema: new OptionalSchema(new StringSchema()),
4152
4218
  omitEmpty: true,
4219
+ },
4220
+ {
4221
+ key: 'round',
4222
+ valueSchema: new OptionalSchema(new Uint64Schema()),
4223
+ omitEmpty: true,
4153
4224
  }
4154
4225
  );
4155
4226
  }
@@ -4169,25 +4240,35 @@ export class BoxesResponse implements Encodable {
4169
4240
  */
4170
4241
  public nextToken?: string;
4171
4242
 
4243
+ /**
4244
+ * The round for which this information is relevant.
4245
+ */
4246
+ public round?: number;
4247
+
4172
4248
  /**
4173
4249
  * Creates a new `BoxesResponse` object.
4174
4250
  * @param applicationId - (appidx) application index.
4175
4251
  * @param boxes -
4176
4252
  * @param nextToken - Used for pagination, when making another request provide this token with the
4177
4253
  * next parameter.
4254
+ * @param round - The round for which this information is relevant.
4178
4255
  */
4179
4256
  constructor({
4180
4257
  applicationId,
4181
4258
  boxes,
4182
4259
  nextToken,
4260
+ round,
4183
4261
  }: {
4184
4262
  applicationId: number | bigint;
4185
4263
  boxes: BoxDescriptor[];
4186
4264
  nextToken?: string;
4265
+ round?: number | bigint;
4187
4266
  }) {
4188
4267
  this.applicationId = ensureBigInt(applicationId);
4189
4268
  this.boxes = boxes;
4190
4269
  this.nextToken = nextToken;
4270
+ this.round =
4271
+ typeof round === 'undefined' ? undefined : ensureSafeInteger(round);
4191
4272
  }
4192
4273
 
4193
4274
  // eslint-disable-next-line class-methods-use-this
@@ -4200,6 +4281,7 @@ export class BoxesResponse implements Encodable {
4200
4281
  ['application-id', this.applicationId],
4201
4282
  ['boxes', this.boxes.map((v) => v.toEncodingData())],
4202
4283
  ['next-token', this.nextToken],
4284
+ ['round', this.round],
4203
4285
  ]);
4204
4286
  }
4205
4287
 
@@ -4213,6 +4295,7 @@ export class BoxesResponse implements Encodable {
4213
4295
  BoxDescriptor.fromEncodingData(v)
4214
4296
  ),
4215
4297
  nextToken: data.get('next-token'),
4298
+ round: data.get('round'),
4216
4299
  });
4217
4300
  }
4218
4301
  }
@@ -8039,6 +8122,11 @@ export class TransactionHeartbeat implements Encodable {
8039
8122
  key: 'hb-vote-id',
8040
8123
  valueSchema: new ByteArraySchema(),
8041
8124
  omitEmpty: true,
8125
+ },
8126
+ {
8127
+ key: 'hb-challenge-discount',
8128
+ valueSchema: new OptionalSchema(new BooleanSchema()),
8129
+ omitEmpty: true,
8042
8130
  }
8043
8131
  );
8044
8132
  }
@@ -8072,6 +8160,13 @@ export class TransactionHeartbeat implements Encodable {
8072
8160
  */
8073
8161
  public hbVoteId: Uint8Array;
8074
8162
 
8163
+ /**
8164
+ * (hbc) HbChallengeDiscount requests the challenge fee discount, reducing the
8165
+ * required fee by one min fee. It is a request, not an assertion: it is granted
8166
+ * only if HbAddress is actually under challenge.
8167
+ */
8168
+ public hbChallengeDiscount?: boolean;
8169
+
8075
8170
  /**
8076
8171
  * Creates a new `TransactionHeartbeat` object.
8077
8172
  * @param hbAddress - (hbad) HbAddress is the account this txn is proving onlineness for.
@@ -8081,6 +8176,9 @@ export class TransactionHeartbeat implements Encodable {
8081
8176
  * @param hbSeed - (hbsd) HbSeed must be the block seed for the this transaction's firstValid
8082
8177
  * block.
8083
8178
  * @param hbVoteId - (hbvid) HbVoteID must match the HbAddress account's current VoteID.
8179
+ * @param hbChallengeDiscount - (hbc) HbChallengeDiscount requests the challenge fee discount, reducing the
8180
+ * required fee by one min fee. It is a request, not an assertion: it is granted
8181
+ * only if HbAddress is actually under challenge.
8084
8182
  */
8085
8183
  constructor({
8086
8184
  hbAddress,
@@ -8088,12 +8186,14 @@ export class TransactionHeartbeat implements Encodable {
8088
8186
  hbProof,
8089
8187
  hbSeed,
8090
8188
  hbVoteId,
8189
+ hbChallengeDiscount,
8091
8190
  }: {
8092
8191
  hbAddress: string;
8093
8192
  hbKeyDilution: number | bigint;
8094
8193
  hbProof: HbProofFields;
8095
8194
  hbSeed: string | Uint8Array;
8096
8195
  hbVoteId: string | Uint8Array;
8196
+ hbChallengeDiscount?: boolean;
8097
8197
  }) {
8098
8198
  this.hbAddress = hbAddress;
8099
8199
  this.hbKeyDilution = ensureBigInt(hbKeyDilution);
@@ -8101,6 +8201,7 @@ export class TransactionHeartbeat implements Encodable {
8101
8201
  this.hbSeed = typeof hbSeed === 'string' ? base64ToBytes(hbSeed) : hbSeed;
8102
8202
  this.hbVoteId =
8103
8203
  typeof hbVoteId === 'string' ? base64ToBytes(hbVoteId) : hbVoteId;
8204
+ this.hbChallengeDiscount = hbChallengeDiscount;
8104
8205
  }
8105
8206
 
8106
8207
  // eslint-disable-next-line class-methods-use-this
@@ -8115,6 +8216,7 @@ export class TransactionHeartbeat implements Encodable {
8115
8216
  ['hb-proof', this.hbProof.toEncodingData()],
8116
8217
  ['hb-seed', this.hbSeed],
8117
8218
  ['hb-vote-id', this.hbVoteId],
8219
+ ['hb-challenge-discount', this.hbChallengeDiscount],
8118
8220
  ]);
8119
8221
  }
8120
8222
 
@@ -8130,6 +8232,7 @@ export class TransactionHeartbeat implements Encodable {
8130
8232
  ),
8131
8233
  hbSeed: data.get('hb-seed'),
8132
8234
  hbVoteId: data.get('hb-vote-id'),
8235
+ hbChallengeDiscount: data.get('hb-challenge-discount'),
8133
8236
  });
8134
8237
  }
8135
8238
  }
@@ -8526,6 +8629,13 @@ export class TransactionSignature implements Encodable {
8526
8629
  ),
8527
8630
  omitEmpty: true,
8528
8631
  },
8632
+ {
8633
+ key: 'pqsig',
8634
+ valueSchema: new OptionalSchema(
8635
+ TransactionSignaturePQsig.encodingSchema
8636
+ ),
8637
+ omitEmpty: true,
8638
+ },
8529
8639
  {
8530
8640
  key: 'sig',
8531
8641
  valueSchema: new OptionalSchema(new ByteArraySchema()),
@@ -8550,6 +8660,13 @@ export class TransactionSignature implements Encodable {
8550
8660
  */
8551
8661
  public multisig?: TransactionSignatureMultisig;
8552
8662
 
8663
+ /**
8664
+ * structure holding a post-quantum signature.
8665
+ * Definition:
8666
+ * data/transactions/pqsig.go : PQSig
8667
+ */
8668
+ public pqsig?: TransactionSignaturePQsig;
8669
+
8553
8670
  /**
8554
8671
  * (sig) Standard ed25519 signature.
8555
8672
  */
@@ -8563,19 +8680,25 @@ export class TransactionSignature implements Encodable {
8563
8680
  * @param multisig - structure holding multiple subsignatures.
8564
8681
  * Definition:
8565
8682
  * crypto/multisig.go : MultisigSig
8683
+ * @param pqsig - structure holding a post-quantum signature.
8684
+ * Definition:
8685
+ * data/transactions/pqsig.go : PQSig
8566
8686
  * @param sig - (sig) Standard ed25519 signature.
8567
8687
  */
8568
8688
  constructor({
8569
8689
  logicsig,
8570
8690
  multisig,
8691
+ pqsig,
8571
8692
  sig,
8572
8693
  }: {
8573
8694
  logicsig?: TransactionSignatureLogicsig;
8574
8695
  multisig?: TransactionSignatureMultisig;
8696
+ pqsig?: TransactionSignaturePQsig;
8575
8697
  sig?: string | Uint8Array;
8576
8698
  }) {
8577
8699
  this.logicsig = logicsig;
8578
8700
  this.multisig = multisig;
8701
+ this.pqsig = pqsig;
8579
8702
  this.sig = typeof sig === 'string' ? base64ToBytes(sig) : sig;
8580
8703
  }
8581
8704
 
@@ -8598,6 +8721,12 @@ export class TransactionSignature implements Encodable {
8598
8721
  ? this.multisig.toEncodingData()
8599
8722
  : undefined,
8600
8723
  ],
8724
+ [
8725
+ 'pqsig',
8726
+ typeof this.pqsig !== 'undefined'
8727
+ ? this.pqsig.toEncodingData()
8728
+ : undefined,
8729
+ ],
8601
8730
  ['sig', this.sig],
8602
8731
  ]);
8603
8732
  }
@@ -8615,6 +8744,10 @@ export class TransactionSignature implements Encodable {
8615
8744
  typeof data.get('multisig') !== 'undefined'
8616
8745
  ? TransactionSignatureMultisig.fromEncodingData(data.get('multisig'))
8617
8746
  : undefined,
8747
+ pqsig:
8748
+ typeof data.get('pqsig') !== 'undefined'
8749
+ ? TransactionSignaturePQsig.fromEncodingData(data.get('pqsig'))
8750
+ : undefined,
8618
8751
  sig: data.get('sig'),
8619
8752
  });
8620
8753
  }
@@ -8654,6 +8787,13 @@ export class TransactionSignatureLogicsig implements Encodable {
8654
8787
  ),
8655
8788
  omitEmpty: true,
8656
8789
  },
8790
+ {
8791
+ key: 'pqsig',
8792
+ valueSchema: new OptionalSchema(
8793
+ TransactionSignaturePQsig.encodingSchema
8794
+ ),
8795
+ omitEmpty: true,
8796
+ },
8657
8797
  {
8658
8798
  key: 'signature',
8659
8799
  valueSchema: new OptionalSchema(new ByteArraySchema()),
@@ -8689,6 +8829,13 @@ export class TransactionSignatureLogicsig implements Encodable {
8689
8829
  */
8690
8830
  public multisigSignature?: TransactionSignatureMultisig;
8691
8831
 
8832
+ /**
8833
+ * structure holding a post-quantum signature.
8834
+ * Definition:
8835
+ * data/transactions/pqsig.go : PQSig
8836
+ */
8837
+ public pqsig?: TransactionSignaturePQsig;
8838
+
8692
8839
  /**
8693
8840
  * (sig) ed25519 signature.
8694
8841
  */
@@ -8705,6 +8852,9 @@ export class TransactionSignatureLogicsig implements Encodable {
8705
8852
  * @param multisigSignature - structure holding multiple subsignatures.
8706
8853
  * Definition:
8707
8854
  * crypto/multisig.go : MultisigSig
8855
+ * @param pqsig - structure holding a post-quantum signature.
8856
+ * Definition:
8857
+ * data/transactions/pqsig.go : PQSig
8708
8858
  * @param signature - (sig) ed25519 signature.
8709
8859
  */
8710
8860
  constructor({
@@ -8712,18 +8862,21 @@ export class TransactionSignatureLogicsig implements Encodable {
8712
8862
  args,
8713
8863
  logicMultisigSignature,
8714
8864
  multisigSignature,
8865
+ pqsig,
8715
8866
  signature,
8716
8867
  }: {
8717
8868
  logic: string | Uint8Array;
8718
8869
  args?: Uint8Array[];
8719
8870
  logicMultisigSignature?: TransactionSignatureMultisig;
8720
8871
  multisigSignature?: TransactionSignatureMultisig;
8872
+ pqsig?: TransactionSignaturePQsig;
8721
8873
  signature?: string | Uint8Array;
8722
8874
  }) {
8723
8875
  this.logic = typeof logic === 'string' ? base64ToBytes(logic) : logic;
8724
8876
  this.args = args;
8725
8877
  this.logicMultisigSignature = logicMultisigSignature;
8726
8878
  this.multisigSignature = multisigSignature;
8879
+ this.pqsig = pqsig;
8727
8880
  this.signature =
8728
8881
  typeof signature === 'string' ? base64ToBytes(signature) : signature;
8729
8882
  }
@@ -8749,6 +8902,12 @@ export class TransactionSignatureLogicsig implements Encodable {
8749
8902
  ? this.multisigSignature.toEncodingData()
8750
8903
  : undefined,
8751
8904
  ],
8905
+ [
8906
+ 'pqsig',
8907
+ typeof this.pqsig !== 'undefined'
8908
+ ? this.pqsig.toEncodingData()
8909
+ : undefined,
8910
+ ],
8752
8911
  ['signature', this.signature],
8753
8912
  ]);
8754
8913
  }
@@ -8772,6 +8931,10 @@ export class TransactionSignatureLogicsig implements Encodable {
8772
8931
  data.get('multisig-signature')
8773
8932
  )
8774
8933
  : undefined,
8934
+ pqsig:
8935
+ typeof data.get('pqsig') !== 'undefined'
8936
+ ? TransactionSignaturePQsig.fromEncodingData(data.get('pqsig'))
8937
+ : undefined,
8775
8938
  signature: data.get('signature'),
8776
8939
  });
8777
8940
  }
@@ -8966,6 +9129,115 @@ export class TransactionSignatureMultisigSubsignature implements Encodable {
8966
9129
  }
8967
9130
  }
8968
9131
 
9132
+ /**
9133
+ * structure holding a post-quantum signature.
9134
+ * Definition:
9135
+ * data/transactions/pqsig.go : PQSig
9136
+ */
9137
+ export class TransactionSignaturePQsig implements Encodable {
9138
+ private static encodingSchemaValue: Schema | undefined;
9139
+
9140
+ static get encodingSchema(): Schema {
9141
+ if (!this.encodingSchemaValue) {
9142
+ this.encodingSchemaValue = new NamedMapSchema([]);
9143
+ (this.encodingSchemaValue as NamedMapSchema).pushEntries(
9144
+ {
9145
+ key: 'public-key',
9146
+ valueSchema: new ByteArraySchema(),
9147
+ omitEmpty: true,
9148
+ },
9149
+ { key: 'scheme', valueSchema: new StringSchema(), omitEmpty: true },
9150
+ {
9151
+ key: 'signature',
9152
+ valueSchema: new ByteArraySchema(),
9153
+ omitEmpty: true,
9154
+ },
9155
+ {
9156
+ key: 'salt',
9157
+ valueSchema: new OptionalSchema(new Uint64Schema()),
9158
+ omitEmpty: true,
9159
+ }
9160
+ );
9161
+ }
9162
+ return this.encodingSchemaValue;
9163
+ }
9164
+
9165
+ /**
9166
+ * (pk)
9167
+ */
9168
+ public publicKey: Uint8Array;
9169
+
9170
+ /**
9171
+ * (sch) identifies the internal signature scheme.
9172
+ */
9173
+ public scheme: string;
9174
+
9175
+ /**
9176
+ * (sig)
9177
+ */
9178
+ public signature: Uint8Array;
9179
+
9180
+ /**
9181
+ * (slt) a single byte, added to ensure the hashed address is not an Ed25519 curve
9182
+ * point
9183
+ */
9184
+ public salt?: number;
9185
+
9186
+ /**
9187
+ * Creates a new `TransactionSignaturePQsig` object.
9188
+ * @param publicKey - (pk)
9189
+ * @param scheme - (sch) identifies the internal signature scheme.
9190
+ * @param signature - (sig)
9191
+ * @param salt - (slt) a single byte, added to ensure the hashed address is not an Ed25519 curve
9192
+ * point
9193
+ */
9194
+ constructor({
9195
+ publicKey,
9196
+ scheme,
9197
+ signature,
9198
+ salt,
9199
+ }: {
9200
+ publicKey: string | Uint8Array;
9201
+ scheme: string;
9202
+ signature: string | Uint8Array;
9203
+ salt?: number | bigint;
9204
+ }) {
9205
+ this.publicKey =
9206
+ typeof publicKey === 'string' ? base64ToBytes(publicKey) : publicKey;
9207
+ this.scheme = scheme;
9208
+ this.signature =
9209
+ typeof signature === 'string' ? base64ToBytes(signature) : signature;
9210
+ this.salt =
9211
+ typeof salt === 'undefined' ? undefined : ensureSafeInteger(salt);
9212
+ }
9213
+
9214
+ // eslint-disable-next-line class-methods-use-this
9215
+ getEncodingSchema(): Schema {
9216
+ return TransactionSignaturePQsig.encodingSchema;
9217
+ }
9218
+
9219
+ toEncodingData(): Map<string, unknown> {
9220
+ return new Map<string, unknown>([
9221
+ ['public-key', this.publicKey],
9222
+ ['scheme', this.scheme],
9223
+ ['signature', this.signature],
9224
+ ['salt', this.salt],
9225
+ ]);
9226
+ }
9227
+
9228
+ static fromEncodingData(data: unknown): TransactionSignaturePQsig {
9229
+ if (!(data instanceof Map)) {
9230
+ throw new Error(`Invalid decoded TransactionSignaturePQsig: ${data}`);
9231
+ }
9232
+ return new TransactionSignaturePQsig({
9233
+ publicKey: data.get('public-key'),
9234
+ scheme: data.get('scheme'),
9235
+ signature: data.get('signature'),
9236
+ salt: data.get('salt'),
9237
+ });
9238
+ }
9239
+ }
9240
+
8969
9241
  /**
8970
9242
  * Fields for a state proof transaction.
8971
9243
  * Definition:
package/src/composer.ts CHANGED
@@ -241,15 +241,15 @@ export class AtomicTransactionComposer {
241
241
  approvalProgram?: Uint8Array;
242
242
  /** The clear program for this application call. Only set this if this is an application creation call, or if onComplete is OnApplicationComplete.UpdateApplicationOC */
243
243
  clearProgram?: Uint8Array;
244
- /** The global integer schema size. Only set this if this is an application creation call. */
244
+ /** The global integer schema size. Only set this if this is an application creation call or an OnApplicationComplete.UpdateApplicationOC call. */
245
245
  numGlobalInts?: number;
246
- /** The global byte slice schema size. Only set this if this is an application creation call. */
246
+ /** The global byte slice schema size. Only set this if this is an application creation call or an OnApplicationComplete.UpdateApplicationOC call. */
247
247
  numGlobalByteSlices?: number;
248
248
  /** The local integer schema size. Only set this if this is an application creation call. */
249
249
  numLocalInts?: number;
250
250
  /** The local byte slice schema size. Only set this if this is an application creation call. */
251
251
  numLocalByteSlices?: number;
252
- /** The number of extra pages to allocate for the application's programs. Only set this if this is an application creation call. If omitted, defaults to 0. */
252
+ /** The number of extra pages to allocate for the application's programs. Only set this if this is an application creation call or an OnApplicationComplete.UpdateApplicationOC call. If omitted, defaults to 0. */
253
253
  extraPages?: number;
254
254
  /** Array of Address strings that represent external accounts supplied to this application. If accounts are provided here, the accounts specified in the method args will appear after these. */
255
255
  appAccounts?: Array<string | Address>;
@@ -306,15 +306,11 @@ export class AtomicTransactionComposer {
306
306
  'One of the following required parameters for OnApplicationComplete.UpdateApplicationOC is missing: approvalProgram, clearProgram'
307
307
  );
308
308
  }
309
- if (
310
- numGlobalInts != null ||
311
- numGlobalByteSlices != null ||
312
- numLocalInts != null ||
313
- numLocalByteSlices != null ||
314
- extraPages != null
315
- ) {
309
+ // The local state schema cannot be changed after application creation. The global state
310
+ // schema (numGlobalInts, numGlobalByteSlices) and extraPages may be changed during an update.
311
+ if (numLocalInts != null || numLocalByteSlices != null) {
316
312
  throw new Error(
317
- 'One of the following application creation parameters were set on a non-creation call: numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages'
313
+ 'The local state schema cannot be changed on an update call: numLocalInts, numLocalByteSlices'
318
314
  );
319
315
  }
320
316
  } else if (