@keetanetwork/keetanet-client 0.14.10 → 0.14.11

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 (105) hide show
  1. package/client/index-browser.js +40 -12
  2. package/client/index.js +37 -9
  3. package/docs/assets/hierarchy.js +1 -1
  4. package/docs/assets/navigation.js +1 -1
  5. package/docs/assets/search.js +1 -1
  6. package/docs/classes/KeetaNetSDK.Referenced.BaseSet.html +1 -1
  7. package/docs/classes/KeetaNetSDK.Referenced.BaseVoteBuilder.html +1 -1
  8. package/docs/classes/KeetaNetSDK.Referenced.BlockOperation.html +1 -1
  9. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationCREATE_IDENTIFIER.html +1 -1
  10. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMANAGE_CERTIFICATE.html +1 -1
  11. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMODIFY_PERMISSIONS.html +1 -1
  12. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationRECEIVE.html +1 -1
  13. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSEND.html +1 -1
  14. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_INFO.html +1 -1
  15. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_REP.html +1 -1
  16. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_MODIFY_BALANCE.html +1 -1
  17. package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_SUPPLY.html +1 -1
  18. package/docs/classes/KeetaNetSDK.Referenced.ECDSAKeyPair.html +1 -1
  19. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1KeyPair.html +1 -1
  20. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1PrivateKey.html +1 -1
  21. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1PublicKey.html +1 -1
  22. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1Signature.html +1 -1
  23. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1KeyPair.html +1 -1
  24. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1PrivateKey.html +1 -1
  25. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1PublicKey.html +1 -1
  26. package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1Signature.html +1 -1
  27. package/docs/classes/KeetaNetSDK.Referenced.ED25519KeyPair.html +1 -1
  28. package/docs/classes/KeetaNetSDK.Referenced.ED25519PrivateKey.html +1 -1
  29. package/docs/classes/KeetaNetSDK.Referenced.ED25519PublicKey.html +1 -1
  30. package/docs/classes/KeetaNetSDK.Referenced.ED25519Signature.html +1 -1
  31. package/docs/classes/KeetaNetSDK.Referenced.ExternalKeyPair.html +1 -1
  32. package/docs/classes/KeetaNetSDK.Referenced.ExternalSet.html +1 -1
  33. package/docs/classes/KeetaNetSDK.Referenced.IdempotentKey.html +1 -1
  34. package/docs/classes/KeetaNetSDK.Referenced.IdentifierKey.html +1 -1
  35. package/docs/classes/KeetaNetSDK.Referenced.IdentifierKeyPair.html +1 -1
  36. package/docs/classes/KeetaNetSDK.Referenced.KeetaNetError.html +1 -1
  37. package/docs/classes/KeetaNetSDK.Referenced.KeetaNetErrorBase.html +1 -1
  38. package/docs/classes/KeetaNetSDK.Referenced.KeetaNetLedgerError.html +2 -2
  39. package/docs/classes/KeetaNetSDK.Referenced.KeetaNetLedgerIdempotentKeyError.html +1 -1
  40. package/docs/classes/KeetaNetSDK.Referenced.KeetaNetLedgerVoteError.html +1 -1
  41. package/docs/classes/KeetaNetSDK.Referenced.KeyInterface.html +1 -1
  42. package/docs/classes/KeetaNetSDK.Referenced.KeyStorage.html +1 -1
  43. package/docs/classes/KeetaNetSDK.Referenced.PermissionSetHolder.html +1 -1
  44. package/docs/classes/KeetaNetSDK.Referenced.PossiblyExpiredVote.html +1 -1
  45. package/docs/classes/KeetaNetSDK.Referenced.SignatureStorage.html +1 -1
  46. package/docs/classes/KeetaNetSDK.Referenced.StatsPending.html +1 -1
  47. package/docs/classes/KeetaNetSDK.Referenced.VoteBlockBundle.html +1 -1
  48. package/docs/classes/KeetaNetSDK.Referenced.VoteBuilder.html +1 -1
  49. package/docs/classes/KeetaNetSDK.Referenced.VoteHash.html +1 -1
  50. package/docs/classes/KeetaNetSDK.Referenced.VoteLikeBase.html +1 -1
  51. package/docs/classes/KeetaNetSDK.Referenced.VoteQuoteBuilder.html +1 -1
  52. package/docs/classes/KeetaNetSDK.Referenced.VoteStapleHash.html +1 -1
  53. package/docs/hierarchy.html +1 -1
  54. package/docs/interfaces/KeetaNetSDK.Referenced.ACLEntry.html +1 -1
  55. package/docs/interfaces/KeetaNetSDK.Referenced.ACLUpdate.html +1 -1
  56. package/docs/interfaces/KeetaNetSDK.Referenced.ASN1ExplicitContextTag.html +1 -1
  57. package/docs/interfaces/KeetaNetSDK.Referenced.ASN1ImplicitContextTag.html +1 -1
  58. package/docs/interfaces/KeetaNetSDK.Referenced.ASN1Object.html +1 -1
  59. package/docs/interfaces/KeetaNetSDK.Referenced.BaseExternalKeyPairFunctions.html +1 -1
  60. package/docs/interfaces/KeetaNetSDK.Referenced.BaseGenerationConfig.html +1 -1
  61. package/docs/interfaces/KeetaNetSDK.Referenced.BaseIdentifierCreateArguments.html +1 -1
  62. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperation.html +1 -1
  63. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationCREATE_IDENTIFIER.html +1 -1
  64. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMANAGE_CERTIFICATE.html +1 -1
  65. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMANAGE_CERTIFICATESerializable.html +1 -1
  66. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMODIFY_PERMISSIONS.html +1 -1
  67. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationRECEIVE.html +1 -1
  68. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSEND.html +1 -1
  69. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSET_INFO.html +1 -1
  70. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSET_REP.html +1 -1
  71. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationTOKEN_ADMIN_MODIFY_BALANCE.html +1 -1
  72. package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationTOKEN_ADMIN_SUPPLY.html +1 -1
  73. package/docs/interfaces/KeetaNetSDK.Referenced.BlockV1Canonical.html +1 -1
  74. package/docs/interfaces/KeetaNetSDK.Referenced.BlockV2Canonical.html +1 -1
  75. package/docs/interfaces/KeetaNetSDK.Referenced.Constructor.html +1 -1
  76. package/docs/interfaces/KeetaNetSDK.Referenced.DisposableTimingHandle.html +1 -1
  77. package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsNoEncryption.html +1 -1
  78. package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsSupportsEncryption.html +1 -1
  79. package/docs/interfaces/KeetaNetSDK.Referenced.InitialConfigSupply.html +1 -1
  80. package/docs/interfaces/KeetaNetSDK.Referenced.InstanceSet.html +1 -1
  81. package/docs/interfaces/KeetaNetSDK.Referenced.KVGenericOptionsType.html +1 -1
  82. package/docs/interfaces/KeetaNetSDK.Referenced.KVSetOptionsType.html +1 -1
  83. package/docs/interfaces/KeetaNetSDK.Referenced.ModifyTokenBalanceEntry.html +1 -1
  84. package/docs/interfaces/KeetaNetSDK.Referenced.MultiSigIdentifierCreateArguments.html +1 -1
  85. package/docs/interfaces/KeetaNetSDK.Referenced.MultisigConfig.html +1 -1
  86. package/docs/interfaces/KeetaNetSDK.Referenced.NumericValueEntry.html +1 -1
  87. package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerBase.html +1 -1
  88. package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerListener.html +1 -1
  89. package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerRepBase.html +1 -1
  90. package/docs/interfaces/KeetaNetSDK.Referenced.PublicKeyStorage.html +1 -1
  91. package/docs/interfaces/KeetaNetSDK.Referenced.RequestTokenReceiveEntry.html +1 -1
  92. package/docs/interfaces/KeetaNetSDK.Referenced.TokenNumericEntry.html +1 -1
  93. package/docs/interfaces/KeetaNetSDK.Referenced.WithIsInstance.html +1 -1
  94. package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_helper.html +1 -1
  95. package/docs/variables/KeetaNetSDK.Referenced.FullLedgerBaseErrorCode.html +1 -1
  96. package/docs/variables/KeetaNetSDK.Referenced.allFullErrorCodes.html +1 -1
  97. package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_helper.crypto.html +1 -1
  98. package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_helper.util.html +1 -0
  99. package/lib/error/index.d.ts +1 -1
  100. package/lib/error/ledger.d.ts +3 -3
  101. package/lib/log/index.d.ts +2 -2
  102. package/lib/utils/helper.d.ts +7 -0
  103. package/npm-shrinkwrap.json +2 -2
  104. package/package.json +1 -1
  105. package/version.d.ts +1 -1
@@ -101243,6 +101243,7 @@ __webpack_require__.d(client_helper_namespaceObject, {
101243
101243
  randomInt: () => (client_randomInt),
101244
101244
  randomString: () => (client_randomString),
101245
101245
  setGenerator: () => (client_setGenerator),
101246
+ util: () => (client_helper_util),
101246
101247
  validateBase64ToBuffer: () => (client_validateBase64ToBuffer),
101247
101248
  waitTicks: () => (client_waitTicks)
101248
101249
  });
@@ -105947,7 +105948,13 @@ const client_helper_crypto = {
105947
105948
  randomUUID: client_helper_randomUUID,
105948
105949
  randomBytes: client_helper_randomBytes,
105949
105950
  createCipheriv: client_crypto_default().createCipheriv.bind((client_crypto_default())),
105950
- createDecipheriv: client_crypto_default().createDecipheriv.bind((client_crypto_default()))
105951
+ createDecipheriv: client_crypto_default().createDecipheriv.bind((client_crypto_default())),
105952
+ createHash: client_crypto_default().createHash.bind((client_crypto_default())),
105953
+ createHmac: client_crypto_default().createHmac.bind((client_crypto_default()))
105954
+ };
105955
+ const client_helper_util = {
105956
+ inspect: client_util.inspect,
105957
+ types: client_util.types
105951
105958
  };
105952
105959
  ;// ./node_modules/rfc4648/lib/rfc4648.js
105953
105960
  /* eslint-disable @typescript-eslint/strict-boolean-expressions */
@@ -116914,7 +116921,7 @@ function client_ledger_toPrimitive(t, r) { if ("object" != typeof t || !t) retur
116914
116921
  const client_LedgerErrorType = 'LEDGER';
116915
116922
  const client_LedgerBaseErrorCodes = ['BLOCK_ALREADY_EXISTS', 'BLOCK_EXPIRED', 'TRANSACTION_ABORTED', 'INVALID_CHAIN', 'INVALID_NETWORK', 'INVALID_SUBNET', 'INVALID_PERMISSIONS', 'INVALID_OWNER_COUNT', 'INVALID_BALANCE', 'INVALID_SET_REP', 'OPERATION_NOT_SUPPORTED', 'NOT_EMPTY', 'PREVIOUS_ALREADY_USED', 'PREVIOUS_NOT_SEEN', 'SUCCESSOR_VOTE_EXISTS', 'INSUFFICIENT_VOTING_WEIGHT', 'INVALID_ACCOUNT_INFO_KEY', 'RECEIVE_NOT_MET', 'DUPLICATE_VOTE_FOUND', 'CANNOT_EXCHANGE_PERM_VOTE', 'TEMP_VOTE_INCLUDES_SELF', 'BLOCKS_DIFFER_FROM_VOTED_ON', 'NO_PERM_WITHOUT_SELF_TEMP', 'DUPLICATE_VOTE_ISSUER_FOUND', 'OTHER', 'MISSING_BLOCKS',
116916
116923
  // Fee Errors
116917
- 'FEE_AMOUNT_MISMATCH', 'FEE_TOKEN_MISMATCH', 'FEE_MISSING', 'MISSING_REQUIRED_FEE_BLOCK', 'VOTE_WITH_QUOTE', 'QUOTE_MISMATCH', 'REQUIRED_FEE_MISMATCH'];
116924
+ 'FEE_AMOUNT_MISMATCH', 'FEE_TOKEN_MISMATCH', 'FEE_MISSING', 'MISSING_REQUIRED_FEE_BLOCK', 'MULTIPLE_FEE_BLOCK', 'VOTE_WITH_QUOTE', 'QUOTE_MISMATCH', 'REQUIRED_FEE_MISMATCH'];
116918
116925
 
116919
116926
  // Errors that can trigger rep sync
116920
116927
  const client_LedgerVoteErrorCodes = ['NOT_SUCCESSOR', 'NOT_OPENING'];
@@ -126564,6 +126571,9 @@ class client_LedgerAtomicInterface {
126564
126571
  if (blocks.length === 0) {
126565
126572
  throw new client_ledger_KeetaNetLedgerError('LEDGER_MISSING_BLOCKS', 'At least one block is required to issue a vote');
126566
126573
  }
126574
+ if (blocks[0].purpose === src_client_Block.Purpose.FEE) {
126575
+ throw new client_ledger_KeetaNetLedgerError('LEDGER_MISSING_BLOCKS', 'First block cannot be a fee block');
126576
+ }
126567
126577
  if (!client_ledger_classPrivateFieldGet(client_ledger_privateKey, this)) {
126568
126578
  throw new Error('Cannot vote on block, no private key loaded');
126569
126579
  }
@@ -126622,7 +126632,16 @@ class client_LedgerAtomicInterface {
126622
126632
  const possibleFeeBlock = blocks.at(-1);
126623
126633
  if ((possibleFeeBlock === null || possibleFeeBlock === void 0 ? void 0 : possibleFeeBlock.purpose) === client_BlockPurpose.FEE) {
126624
126634
  hasFeeBlock = true;
126625
- blockCount--;
126635
+ /**
126636
+ * If permanent votes were provided then all votes should include the fee block
126637
+ * So only decrement block count if otherVotes are all temporary votes
126638
+ */
126639
+ const otherVotesAllTemporary = !otherVotes.some(function (checkVote) {
126640
+ return checkVote.$permanent;
126641
+ });
126642
+ if (otherVotesAllTemporary) {
126643
+ blockCount--;
126644
+ }
126626
126645
  }
126627
126646
  const requiredFees = new Map();
126628
126647
  for (const checkVote of otherVotes) {
@@ -126649,13 +126668,9 @@ class client_LedgerAtomicInterface {
126649
126668
  throw new client_ledger_KeetaNetLedgerError('LEDGER_CANNOT_EXCHANGE_PERM_VOTE', 'Asked to exchange a permanent vote from us for a permanent vote from us');
126650
126669
  }
126651
126670
  }
126652
-
126653
- /* XXX:TODO: Need to account for fee blocks if the input is a permanent vote */
126654
126671
  let blocksDifferFromVoteBlocks = checkVote.blocks.length !== blockCount;
126655
-
126656
126672
  /* If they do not differ from length alone, compare block hashes */
126657
126673
  if (!blocksDifferFromVoteBlocks) {
126658
- /* XXX:TODO: Need to account for fee blocks if the input is a permanent vote */
126659
126674
  for (let blockIndex = 0; blockIndex < blockCount; blockIndex++) {
126660
126675
  if (!blocks[blockIndex].hash.compareHexString(checkVote.blocks[blockIndex])) {
126661
126676
  blocksDifferFromVoteBlocks = true;
@@ -127584,7 +127599,15 @@ async function client_validateBlocksForVote(blocks) {
127584
127599
  const allLedgerHeads = new Map();
127585
127600
  const allLedgerIdempotentKeys = new Map();
127586
127601
  const allLedgerIdempotentKeysReverse = new Map();
127602
+ let foundFeeBlock = false;
127587
127603
  for (const block of blocks) {
127604
+ if (block.purpose === src_client_Block.Purpose.FEE) {
127605
+ if (foundFeeBlock) {
127606
+ throw new client_ledger_KeetaNetLedgerError('LEDGER_MULTIPLE_FEE_BLOCK', 'Should only contain 1 fee block');
127607
+ } else {
127608
+ foundFeeBlock = true;
127609
+ }
127610
+ }
127588
127611
  const prevBlockHash = block.previous;
127589
127612
  seenBlockHashes.add(block.hash);
127590
127613
  if (block.network !== client_ledger_classPrivateFieldGet(client_network, this)) {
@@ -127641,7 +127664,7 @@ async function client_validateBlocksForVote(blocks) {
127641
127664
  };
127642
127665
  }
127643
127666
  async function client_voteOrQuoteWithFees(blocks, type, quote, options) {
127644
- var _options$requireBlock, _quote$fee;
127667
+ var _options$requireBlock;
127645
127668
  if (client_ledger_classPrivateFieldGet(client_ledger, this).ledgerWriteMode !== 'read-write') {
127646
127669
  throw new Error(`May not issue votes in read-only mode, in ${client_ledger_classPrivateFieldGet(client_ledger, this).ledgerWriteMode} mode`);
127647
127670
  }
@@ -127691,10 +127714,15 @@ async function client_voteOrQuoteWithFees(blocks, type, quote, options) {
127691
127714
 
127692
127715
  /**
127693
127716
  * If a quote was provided use it as the fee, otherwise generate new fee
127717
+ * If we are creating a vote with permanent `otherVotes` then do not include the fee.
127718
+ * TODO - considering changing how fees are handled when recovering
127694
127719
  */
127695
- const fee = (_quote$fee = quote === null || quote === void 0 ? void 0 : quote.fee) !== null && _quote$fee !== void 0 ? _quote$fee : await this.getFee(blocks, effects);
127696
- if (fee !== null) {
127697
- builder.addFee(fee);
127720
+ if (requireBlockTimestampCheck) {
127721
+ var _quote$fee;
127722
+ const fee = (_quote$fee = quote === null || quote === void 0 ? void 0 : quote.fee) !== null && _quote$fee !== void 0 ? _quote$fee : await this.getFee(blocks, effects);
127723
+ if (fee !== null) {
127724
+ builder.addFee(fee);
127725
+ }
127698
127726
  }
127699
127727
  const voteOrQuote = await builder.seal(serial, pendingVoteExpiry);
127700
127728
  return voteOrQuote;
@@ -128122,7 +128150,7 @@ client_lib_ledger_defineProperty(src_client_Ledger, "isInstance", client_checkab
128122
128150
  // EXTERNAL MODULE: ws (ignored)
128123
128151
  var client_ws_ignored_ = __webpack_require__(4708);
128124
128152
  ;// ./src/version.ts
128125
- const client_version = '0.14.10+g915d941de2a9b7990a6a140496a0e142eafaa9b7';
128153
+ const client_version = '0.14.11+gfb27e304d06f586fd5f3532fae4f1504a46d359b';
128126
128154
  /* harmony default export */ const client_src_version = ((/* unused pure expression or super */ null && (client_version)));
128127
128155
  ;// ./src/lib/p2p.ts
128128
128156
  /* provided dependency */ var client_p2p_Buffer = __webpack_require__(8287)["Buffer"];
package/client/index.js CHANGED
@@ -65849,6 +65849,7 @@ exports.LedgerBaseErrorCodes = [
65849
65849
  'FEE_TOKEN_MISMATCH',
65850
65850
  'FEE_MISSING',
65851
65851
  'MISSING_REQUIRED_FEE_BLOCK',
65852
+ 'MULTIPLE_FEE_BLOCK',
65852
65853
  'VOTE_WITH_QUOTE',
65853
65854
  'QUOTE_MISMATCH',
65854
65855
  'REQUIRED_FEE_MISMATCH'
@@ -68115,6 +68116,9 @@ class LedgerAtomicInterface {
68115
68116
  if (blocks.length === 0) {
68116
68117
  throw (new ledger_1.KeetaNetLedgerError('LEDGER_MISSING_BLOCKS', 'At least one block is required to issue a vote'));
68117
68118
  }
68119
+ if (blocks[0].purpose === block_1.Block.Purpose.FEE) {
68120
+ throw (new ledger_1.KeetaNetLedgerError('LEDGER_MISSING_BLOCKS', 'First block cannot be a fee block'));
68121
+ }
68118
68122
  if (!__classPrivateFieldGet(this, _LedgerAtomicInterface_privateKey, "f")) {
68119
68123
  throw (new Error('Cannot vote on block, no private key loaded'));
68120
68124
  }
@@ -68171,7 +68175,14 @@ class LedgerAtomicInterface {
68171
68175
  const possibleFeeBlock = blocks.at(-1);
68172
68176
  if (possibleFeeBlock?.purpose === block_1.BlockPurpose.FEE) {
68173
68177
  hasFeeBlock = true;
68174
- blockCount--;
68178
+ /**
68179
+ * If permanent votes were provided then all votes should include the fee block
68180
+ * So only decrement block count if otherVotes are all temporary votes
68181
+ */
68182
+ const otherVotesAllTemporary = !otherVotes.some(function (checkVote) { return (checkVote.$permanent); });
68183
+ if (otherVotesAllTemporary) {
68184
+ blockCount--;
68185
+ }
68175
68186
  }
68176
68187
  const requiredFees = new Map();
68177
68188
  for (const checkVote of otherVotes) {
@@ -68197,11 +68208,9 @@ class LedgerAtomicInterface {
68197
68208
  throw (new ledger_1.KeetaNetLedgerError('LEDGER_CANNOT_EXCHANGE_PERM_VOTE', 'Asked to exchange a permanent vote from us for a permanent vote from us'));
68198
68209
  }
68199
68210
  }
68200
- /* XXX:TODO: Need to account for fee blocks if the input is a permanent vote */
68201
68211
  let blocksDifferFromVoteBlocks = checkVote.blocks.length !== blockCount;
68202
68212
  /* If they do not differ from length alone, compare block hashes */
68203
68213
  if (!blocksDifferFromVoteBlocks) {
68204
- /* XXX:TODO: Need to account for fee blocks if the input is a permanent vote */
68205
68214
  for (let blockIndex = 0; blockIndex < blockCount; blockIndex++) {
68206
68215
  if (!blocks[blockIndex].hash.compareHexString(checkVote.blocks[blockIndex])) {
68207
68216
  blocksDifferFromVoteBlocks = true;
@@ -69032,7 +69041,16 @@ async function _LedgerAtomicInterface_validateLedgerOutcome(blocks) {
69032
69041
  const allLedgerHeads = new Map();
69033
69042
  const allLedgerIdempotentKeys = new Map();
69034
69043
  const allLedgerIdempotentKeysReverse = new Map();
69044
+ let foundFeeBlock = false;
69035
69045
  for (const block of blocks) {
69046
+ if (block.purpose === block_1.Block.Purpose.FEE) {
69047
+ if (foundFeeBlock) {
69048
+ throw (new ledger_1.KeetaNetLedgerError('LEDGER_MULTIPLE_FEE_BLOCK', 'Should only contain 1 fee block'));
69049
+ }
69050
+ else {
69051
+ foundFeeBlock = true;
69052
+ }
69053
+ }
69036
69054
  const prevBlockHash = block.previous;
69037
69055
  seenBlockHashes.add(block.hash);
69038
69056
  if (block.network !== __classPrivateFieldGet(this, _LedgerAtomicInterface_network, "f")) {
@@ -69129,10 +69147,14 @@ async function _LedgerAtomicInterface_validateLedgerOutcome(blocks) {
69129
69147
  }
69130
69148
  /**
69131
69149
  * If a quote was provided use it as the fee, otherwise generate new fee
69150
+ * If we are creating a vote with permanent `otherVotes` then do not include the fee.
69151
+ * TODO - considering changing how fees are handled when recovering
69132
69152
  */
69133
- const fee = quote?.fee ?? await this.getFee(blocks, effects);
69134
- if (fee !== null) {
69135
- builder.addFee(fee);
69153
+ if (requireBlockTimestampCheck) {
69154
+ const fee = quote?.fee ?? await this.getFee(blocks, effects);
69155
+ if (fee !== null) {
69156
+ builder.addFee(fee);
69157
+ }
69136
69158
  }
69137
69159
  const voteOrQuote = await builder.seal(serial, pendingVoteExpiry);
69138
69160
  return (voteOrQuote);
@@ -76825,7 +76847,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
76825
76847
  };
76826
76848
  var _AsyncDisposableStackPolyfill_instances, _AsyncDisposableStackPolyfill_toDispose, _AsyncDisposableStackPolyfill_validateNotDisposed, _a;
76827
76849
  Object.defineProperty(exports, "__esModule", ({ value: true }));
76828
- exports.crypto = exports.AsyncDisposableStack = void 0;
76850
+ exports.util = exports.crypto = exports.AsyncDisposableStack = void 0;
76829
76851
  exports.validateBase64ToBuffer = validateBase64ToBuffer;
76830
76852
  exports.bufferToArrayBuffer = bufferToArrayBuffer;
76831
76853
  exports.bufferToBigInt = bufferToBigInt;
@@ -77318,7 +77340,13 @@ exports.crypto = {
77318
77340
  randomUUID: randomUUID,
77319
77341
  randomBytes: randomBytes,
77320
77342
  createCipheriv: crypto_1.default.createCipheriv.bind(crypto_1.default),
77321
- createDecipheriv: crypto_1.default.createDecipheriv.bind(crypto_1.default)
77343
+ createDecipheriv: crypto_1.default.createDecipheriv.bind(crypto_1.default),
77344
+ createHash: crypto_1.default.createHash.bind(crypto_1.default),
77345
+ createHmac: crypto_1.default.createHmac.bind(crypto_1.default)
77346
+ };
77347
+ exports.util = {
77348
+ inspect: util_1.inspect,
77349
+ types: util_1.types
77322
77350
  };
77323
77351
 
77324
77352
 
@@ -79106,7 +79134,7 @@ exports.Testing = { findRDN, blockHashesFromVote, feeFromVote };
79106
79134
 
79107
79135
  Object.defineProperty(exports, "__esModule", ({ value: true }));
79108
79136
  exports.version = void 0;
79109
- exports.version = '0.14.10+g915d941de2a9b7990a6a140496a0e142eafaa9b7';
79137
+ exports.version = '0.14.11+gfb27e304d06f586fd5f3532fae4f1504a46d359b';
79110
79138
  exports["default"] = exports.version;
79111
79139
 
79112
79140
 
@@ -1 +1 @@
1
- window.hierarchyData = "eJy1m9FyozgWht/F15oskoUEuXMcesabtOM1nmxNTXWliK04bBPwgjzVqal+960DjiOBsYVgb+iu7tJ/PulIQvoP/nuUZ5ksRtd/cowd5OExQ5wQgjyHUsQJd+FvBHHqOGjsj13EMXUQIw5D3MUe8hyMEfe5g5iHMWKeT6EFRx5mBHmYeIhTHyPuMIYIdzmihHBEOWHf0CgXL4lYyzhLi9H13yM8Zgz+TKM3MboePWZShDLaJWKERt/jdDO6Br3RPk9G16N1EhWFKP5xJ4SM5kKGt3dXS/EicpGuxebqs/HVq3xLRqhqMLoeyWLzC6j9Uv3DTzTCHPNa3H/tM2kbtmxrENVjtBbVMuDlWIRQrMS6SbL199+i4tUi4LGtSVRPzedi/5zExevDrkr4R2ji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