@hiero-ledger/sdk 2.73.2 → 2.75.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 (125) hide show
  1. package/dist/umd.js +368 -202
  2. package/dist/umd.min.js +3 -3
  3. package/lib/MirrorNode.cjs +46 -0
  4. package/lib/MirrorNode.d.ts +16 -0
  5. package/lib/MirrorNode.js +1 -1
  6. package/lib/MirrorNode.js.map +1 -1
  7. package/lib/account/AccountAllowanceApproveTransaction.cjs +11 -5
  8. package/lib/account/AccountAllowanceApproveTransaction.d.ts +4 -5
  9. package/lib/account/AccountAllowanceApproveTransaction.js +1 -1
  10. package/lib/account/AccountAllowanceApproveTransaction.js.map +1 -1
  11. package/lib/account/TokenAllowance.cjs +4 -2
  12. package/lib/account/TokenAllowance.d.ts +4 -2
  13. package/lib/account/TokenAllowance.js +1 -1
  14. package/lib/account/TokenAllowance.js.map +1 -1
  15. package/lib/account/TokenTransferMap.cjs +7 -2
  16. package/lib/account/TokenTransferMap.d.ts +6 -2
  17. package/lib/account/TokenTransferMap.js +1 -1
  18. package/lib/account/TokenTransferMap.js.map +1 -1
  19. package/lib/client/Client.cjs +13 -44
  20. package/lib/client/Client.d.ts +12 -12
  21. package/lib/client/Client.js +1 -1
  22. package/lib/client/Client.js.map +1 -1
  23. package/lib/client/MirrorNetwork.cjs +16 -0
  24. package/lib/client/MirrorNetwork.d.ts +7 -0
  25. package/lib/client/MirrorNetwork.js +1 -1
  26. package/lib/client/MirrorNetwork.js.map +1 -1
  27. package/lib/client/addressbooks/mainnet.cjs +1 -1
  28. package/lib/client/addressbooks/mainnet.d.ts +1 -1
  29. package/lib/client/addressbooks/mainnet.js +1 -1
  30. package/lib/client/addressbooks/mainnet.js.map +1 -1
  31. package/lib/client/addressbooks/previewnet.cjs +1 -1
  32. package/lib/client/addressbooks/previewnet.d.ts +1 -1
  33. package/lib/client/addressbooks/previewnet.js +1 -1
  34. package/lib/client/addressbooks/previewnet.js.map +1 -1
  35. package/lib/client/addressbooks/testnet.cjs +1 -1
  36. package/lib/client/addressbooks/testnet.d.ts +1 -1
  37. package/lib/client/addressbooks/testnet.js +1 -1
  38. package/lib/client/addressbooks/testnet.js.map +1 -1
  39. package/lib/constants/ClientConstants.cjs +4 -1
  40. package/lib/constants/ClientConstants.d.ts +2 -0
  41. package/lib/constants/ClientConstants.js +1 -1
  42. package/lib/constants/ClientConstants.js.map +1 -1
  43. package/lib/contract/ContractId.cjs +2 -5
  44. package/lib/contract/ContractId.js +1 -1
  45. package/lib/contract/ContractId.js.map +1 -1
  46. package/lib/network/AddressBookQueryWeb.cjs +88 -60
  47. package/lib/network/AddressBookQueryWeb.d.ts +7 -37
  48. package/lib/network/AddressBookQueryWeb.js +1 -1
  49. package/lib/network/AddressBookQueryWeb.js.map +1 -1
  50. package/lib/query/MirrorNodeContractQuery.cjs +2 -1
  51. package/lib/query/MirrorNodeContractQuery.js.map +1 -1
  52. package/lib/token/AbstractTokenTransferTransaction.cjs +12 -8
  53. package/lib/token/AbstractTokenTransferTransaction.d.ts +14 -11
  54. package/lib/token/AbstractTokenTransferTransaction.js +1 -1
  55. package/lib/token/AbstractTokenTransferTransaction.js.map +1 -1
  56. package/lib/token/AssessedCustomFee.cjs +8 -4
  57. package/lib/token/AssessedCustomFee.d.ts +8 -5
  58. package/lib/token/AssessedCustomFee.js +1 -1
  59. package/lib/token/AssessedCustomFee.js.map +1 -1
  60. package/lib/token/CustomFixedFee.cjs +8 -4
  61. package/lib/token/CustomFixedFee.d.ts +8 -5
  62. package/lib/token/CustomFixedFee.js +1 -1
  63. package/lib/token/CustomFixedFee.js.map +1 -1
  64. package/lib/token/PendingAirdropRecord.cjs +7 -2
  65. package/lib/token/PendingAirdropRecord.d.ts +6 -2
  66. package/lib/token/PendingAirdropRecord.js +1 -1
  67. package/lib/token/PendingAirdropRecord.js.map +1 -1
  68. package/lib/token/TokenAirdropTransaction.cjs +2 -1
  69. package/lib/token/TokenAirdropTransaction.d.ts +4 -2
  70. package/lib/token/TokenAirdropTransaction.js.map +1 -1
  71. package/lib/token/TokenBurnTransaction.cjs +5 -3
  72. package/lib/token/TokenBurnTransaction.d.ts +6 -4
  73. package/lib/token/TokenBurnTransaction.js +1 -1
  74. package/lib/token/TokenBurnTransaction.js.map +1 -1
  75. package/lib/token/TokenCreateTransaction.cjs +7 -6
  76. package/lib/token/TokenCreateTransaction.d.ts +8 -8
  77. package/lib/token/TokenCreateTransaction.js +1 -1
  78. package/lib/token/TokenCreateTransaction.js.map +1 -1
  79. package/lib/token/TokenMintTransaction.cjs +5 -4
  80. package/lib/token/TokenMintTransaction.d.ts +6 -5
  81. package/lib/token/TokenMintTransaction.js +1 -1
  82. package/lib/token/TokenMintTransaction.js.map +1 -1
  83. package/lib/token/TokenTransfer.cjs +3 -2
  84. package/lib/token/TokenTransfer.d.ts +2 -2
  85. package/lib/token/TokenTransfer.js +1 -1
  86. package/lib/token/TokenTransfer.js.map +1 -1
  87. package/lib/token/TokenWipeTransaction.cjs +5 -3
  88. package/lib/token/TokenWipeTransaction.d.ts +6 -4
  89. package/lib/token/TokenWipeTransaction.js +1 -1
  90. package/lib/token/TokenWipeTransaction.js.map +1 -1
  91. package/lib/transaction/Transaction.cjs +54 -0
  92. package/lib/transaction/Transaction.d.ts +10 -0
  93. package/lib/transaction/Transaction.js +1 -1
  94. package/lib/transaction/Transaction.js.map +1 -1
  95. package/lib/util.cjs +25 -0
  96. package/lib/util.d.ts +8 -0
  97. package/lib/util.js +1 -1
  98. package/lib/util.js.map +1 -1
  99. package/lib/version.js +1 -1
  100. package/package.json +16 -12
  101. package/src/MirrorNode.js +49 -0
  102. package/src/account/AccountAllowanceApproveTransaction.js +11 -11
  103. package/src/account/TokenAllowance.js +5 -2
  104. package/src/account/TokenTransferMap.js +7 -2
  105. package/src/client/Client.js +13 -51
  106. package/src/client/MirrorNetwork.js +18 -0
  107. package/src/client/addressbooks/mainnet.js +1 -1
  108. package/src/client/addressbooks/previewnet.js +1 -1
  109. package/src/client/addressbooks/testnet.js +1 -1
  110. package/src/constants/ClientConstants.js +3 -0
  111. package/src/contract/ContractId.js +2 -10
  112. package/src/network/AddressBookQueryWeb.js +122 -91
  113. package/src/query/MirrorNodeContractQuery.js +2 -1
  114. package/src/token/AbstractTokenTransferTransaction.js +12 -8
  115. package/src/token/AssessedCustomFee.js +8 -5
  116. package/src/token/CustomFixedFee.js +8 -5
  117. package/src/token/PendingAirdropRecord.js +7 -2
  118. package/src/token/TokenAirdropTransaction.js +2 -1
  119. package/src/token/TokenBurnTransaction.js +5 -3
  120. package/src/token/TokenCreateTransaction.js +7 -9
  121. package/src/token/TokenMintTransaction.js +5 -4
  122. package/src/token/TokenTransfer.js +3 -2
  123. package/src/token/TokenWipeTransaction.js +5 -3
  124. package/src/transaction/Transaction.js +63 -0
  125. package/src/util.js +26 -0
package/dist/umd.js CHANGED
@@ -4758,6 +4758,32 @@
4758
4758
  throw new Error(FUNCTION_CONVERT_TO_BIGNUMBER_ERROR);
4759
4759
  }
4760
4760
 
4761
+ /**
4762
+ * Converts amount (number, Long, BigNumber, or bigint) to Long.
4763
+ * This utility ensures consistent amount handling across the SDK.
4764
+ *
4765
+ * @param {number | Long | BigNumber | bigint} amount
4766
+ * @returns {Long}
4767
+ */
4768
+ function convertAmountToLong(amount) {
4769
+ requireNonNull(amount);
4770
+
4771
+ // Preserve exact original behavior for existing types
4772
+ if (Long.isLong(amount)) {
4773
+ return amount;
4774
+ } else if (typeof amount === "number") {
4775
+ return Long.fromNumber(amount);
4776
+ } else if (BigNumber$1.isBigNumber(amount)) {
4777
+ return Long.fromValue(
4778
+ amount.integerValue(BigNumber$1.ROUND_DOWN).toString(),
4779
+ );
4780
+ } else if (typeof amount === "bigint") {
4781
+ return Long.fromValue(amount.toString());
4782
+ } else {
4783
+ // Handle other types that can be converted to string
4784
+ return Long.fromValue(String(amount));
4785
+ }
4786
+ }
4761
4787
  /**
4762
4788
  * Converts Array of Numbers or Strings to Array of BigNumbers.
4763
4789
  *
@@ -45006,18 +45032,10 @@
45006
45032
  * @returns {Promise<ContractId>}
45007
45033
  */
45008
45034
  async populateAccountNum(client) {
45009
- if (this.evmAddress === null) {
45010
- throw new Error("field `evmAddress` should not be null");
45011
- }
45012
- const mirrorUrl = client.mirrorNetwork[0].slice(
45013
- 0,
45014
- client.mirrorNetwork[0].indexOf(":"),
45015
- );
45035
+ const mirrorRestApiBaseUrl = client.mirrorRestApiBaseUrl;
45036
+ const url = `${mirrorRestApiBaseUrl}/contracts/${this.toEvmAddress()}`;
45016
45037
 
45017
45038
  /* eslint-disable */
45018
- const url = `https://${mirrorUrl}/api/v1/contracts/${encode$5(
45019
- this.evmAddress,
45020
- )}`;
45021
45039
  const response = await fetch(url);
45022
45040
  const data = await response.json();
45023
45041
  const mirrorAccountId = data.contract_id;
@@ -54097,6 +54115,10 @@
54097
54115
  * @typedef {import("@hashgraph/proto").proto.IAccountID} HieroProto.proto.IAccountID
54098
54116
  */
54099
54117
 
54118
+ /**
54119
+ * @typedef {import("bignumber.js").default} BigNumber
54120
+ */
54121
+
54100
54122
  /**
54101
54123
  * @augments {ObjectMap<TokenId, TokenTransferAccountMap>}
54102
54124
  */
@@ -54109,7 +54131,7 @@
54109
54131
  * @internal
54110
54132
  * @param {TokenId} tokenId
54111
54133
  * @param {AccountId} accountId
54112
- * @param {Long} amount
54134
+ * @param {Long | number | BigNumber | bigint} amount
54113
54135
  */
54114
54136
  __set(tokenId, accountId, amount) {
54115
54137
  const token = tokenId.toString();
@@ -54121,7 +54143,7 @@
54121
54143
  this.__map.set(tokenId, _map);
54122
54144
  }
54123
54145
 
54124
- _map._set(accountId, amount);
54146
+ _map._set(accountId, convertAmountToLong(amount));
54125
54147
  }
54126
54148
 
54127
54149
  /**
@@ -54316,6 +54338,10 @@
54316
54338
  // SPDX-License-Identifier: Apache-2.0
54317
54339
 
54318
54340
 
54341
+ /**
54342
+ * @typedef {import("bignumber.js").default} BigNumber
54343
+ */
54344
+
54319
54345
  /**
54320
54346
  * @namespace proto
54321
54347
  * @typedef {import("@hashgraph/proto").proto.IAssessedCustomFee} HieroProto.proto.IAssessedCustomFee
@@ -54339,7 +54365,7 @@
54339
54365
  * @param {object} props
54340
54366
  * @param {AccountId | string} [props.feeCollectorAccountId]
54341
54367
  * @param {TokenId | string} [props.tokenId]
54342
- * @param {Long | number} [props.amount]
54368
+ * @param {Long | number | BigNumber | bigint} [props.amount]
54343
54369
  * @param {AccountId[]} [props.payerAccountIds]
54344
54370
  */
54345
54371
  constructor(props = {}) {
@@ -54424,12 +54450,11 @@
54424
54450
  }
54425
54451
 
54426
54452
  /**
54427
- * @param {Long | number} amount
54453
+ * @param {Long | number | BigNumber | bigint} amount
54428
54454
  * @returns {AssessedCustomFee}
54429
54455
  */
54430
54456
  setAmount(amount) {
54431
- this._amount =
54432
- typeof amount === "number" ? Long.fromNumber(amount) : amount;
54457
+ this._amount = convertAmountToLong(amount);
54433
54458
  return this;
54434
54459
  }
54435
54460
 
@@ -54668,7 +54693,7 @@
54668
54693
  * @param {TokenId | string} props.tokenId
54669
54694
  * @param {AccountId | string} props.accountId
54670
54695
  * @param {number | null} props.expectedDecimals
54671
- * @param {Long | number} props.amount
54696
+ * @param {Long | number | BigNumber | bigint} props.amount
54672
54697
  * @param {boolean} props.isApproved
54673
54698
  */
54674
54699
  constructor(props) {
@@ -54693,7 +54718,7 @@
54693
54718
  : AccountId.fromString(props.accountId);
54694
54719
 
54695
54720
  this.expectedDecimals = props.expectedDecimals;
54696
- this.amount = Long.fromValue(props.amount);
54721
+ this.amount = convertAmountToLong(props.amount);
54697
54722
  this.isApproved = props.isApproved;
54698
54723
  }
54699
54724
 
@@ -55029,15 +55054,19 @@
55029
55054
  */
55030
55055
 
55031
55056
 
55057
+ /**
55058
+ * @typedef {import("bignumber.js").default} BigNumber
55059
+ */
55060
+
55032
55061
  class PendingAirdropRecord {
55033
55062
  /**
55034
55063
  * @param {object} props
55035
55064
  * @param {PendingAirdropId} props.airdropId
55036
- * @param {Long} props.amount
55065
+ * @param {Long | number | BigNumber | bigint} props.amount
55037
55066
  */
55038
55067
  constructor(props) {
55039
55068
  this.airdropId = props.airdropId;
55040
- this.amount = props.amount;
55069
+ this.amount = convertAmountToLong(props.amount);
55041
55070
  }
55042
55071
 
55043
55072
  /**
@@ -56648,6 +56677,10 @@
56648
56677
  // SPDX-License-Identifier: Apache-2.0
56649
56678
 
56650
56679
 
56680
+ /**
56681
+ * @typedef {import("bignumber.js").default} BigNumber
56682
+ */
56683
+
56651
56684
  /**
56652
56685
  * @namespace proto
56653
56686
  * @typedef {import("@hashgraph/proto").proto.ICustomFee} HieroProto.proto.ICustomFee
@@ -56661,7 +56694,7 @@
56661
56694
  * @param {AccountId | string} [props.feeCollectorAccountId]
56662
56695
  * @param {boolean} [props.allCollectorsAreExempt]
56663
56696
  * @param {TokenId | string} [props.denominatingTokenId]
56664
- * @param {Long | number} [props.amount]
56697
+ * @param {Long | number | BigNumber | bigint} [props.amount]
56665
56698
  */
56666
56699
  constructor(props = {}) {
56667
56700
  super(props);
@@ -56739,12 +56772,11 @@
56739
56772
  }
56740
56773
 
56741
56774
  /**
56742
- * @param {Long | number} amount
56775
+ * @param {Long | number | BigNumber | bigint} amount
56743
56776
  * @returns {CustomFixedFee}
56744
56777
  */
56745
56778
  setAmount(amount) {
56746
- this._amount =
56747
- typeof amount === "number" ? Long.fromNumber(amount) : amount;
56779
+ this._amount = convertAmountToLong(amount);
56748
56780
  return this;
56749
56781
  }
56750
56782
 
@@ -58251,6 +58283,65 @@
58251
58283
  );
58252
58284
  }
58253
58285
 
58286
+ /**
58287
+ * Apply maxNodesPerTransaction limit to an already frozen transaction.
58288
+ * This trims the node list to the first N nodes while preserving existing signatures.
58289
+ *
58290
+ * Note: This method assumes the caller has already verified that trimming is needed.
58291
+ *
58292
+ * @private
58293
+ * @param {import("../client/Client.js").default<Channel, *>} client
58294
+ */
58295
+ _applyMaxNodesPerTransactionLimit(client) {
58296
+ const maxNodes = client.maxNodesPerTransaction;
58297
+
58298
+ if (maxNodes <= 0 || this._nodeAccountIds.length <= maxNodes) {
58299
+ return;
58300
+ }
58301
+
58302
+ if (this._logger) {
58303
+ this._logger.debug(
58304
+ `Trimming frozen transaction from ${this._nodeAccountIds.length} nodes to ${maxNodes} nodes based on maxNodesPerTransaction setting`,
58305
+ );
58306
+ }
58307
+
58308
+ // Trim the node account IDs to the first N nodes
58309
+ const trimmedNodeIds = this._nodeAccountIds.list.slice(0, maxNodes);
58310
+
58311
+ // Trim the signed transactions to match the trimmed node list
58312
+ // Each chunk has transactions for all nodes, so we need to trim each chunk
58313
+ const nodeCount = this._nodeAccountIds.length;
58314
+ const chunkCount = this._transactionIds.length;
58315
+ const trimmedSignedTransactions = [];
58316
+
58317
+ for (let chunkIndex = 0; chunkIndex < chunkCount; chunkIndex++) {
58318
+ const chunkStart = chunkIndex * nodeCount;
58319
+
58320
+ // Add the first maxNodes transactions from this chunk
58321
+ for (let nodeIndex = 0; nodeIndex < maxNodes; nodeIndex++) {
58322
+ const transactionIndex = chunkStart + nodeIndex;
58323
+ if (transactionIndex < this._signedTransactions.length) {
58324
+ trimmedSignedTransactions.push(
58325
+ this._signedTransactions.get(transactionIndex),
58326
+ );
58327
+ }
58328
+ }
58329
+ }
58330
+
58331
+ // Clear and rebuild the transactions list since it's derived from signed transactions
58332
+ this._transactions.clear();
58333
+
58334
+ // Update the node account IDs (we need to unlock, update, and relock)
58335
+ this._nodeAccountIds.locked = false;
58336
+
58337
+ this._nodeAccountIds.setList(trimmedNodeIds);
58338
+
58339
+ this._nodeAccountIds.locked = true;
58340
+
58341
+ // Update the signed transactions
58342
+ this._signedTransactions.setList(trimmedSignedTransactions);
58343
+ }
58344
+
58254
58345
  /**
58255
58346
  * @description Set the key that will sign the batch of which this Transaction is a part of.
58256
58347
  * @param {Key} batchKey
@@ -58627,6 +58718,10 @@
58627
58718
  this.freezeWith(client);
58628
58719
  }
58629
58720
 
58721
+ // Apply maxNodesPerTransaction limit to already frozen transaction
58722
+ // This allows changing the node count even after freezing while preserving signatures
58723
+ this._applyMaxNodesPerTransactionLimit(client);
58724
+
58630
58725
  // Valid checksums if the option is enabled
58631
58726
  if (client.isAutoValidateChecksumsEnabled()) {
58632
58727
  this._validateChecksums(client);
@@ -59393,6 +59488,10 @@
59393
59488
 
59394
59489
  // SPDX-License-Identifier: Apache-2.0
59395
59490
 
59491
+ /**
59492
+ * @typedef {import("bignumber.js").default} BigNumber
59493
+ */
59494
+
59396
59495
  /**
59397
59496
  * @namespace proto
59398
59497
  * @typedef {import("@hashgraph/proto").proto.ITokenAirdropTransactionBody} HieroProto.proto.ITokenAirdropTransactionBody
@@ -59402,7 +59501,7 @@
59402
59501
  * @typedef {object} TransferTokensInput
59403
59502
  * @property {TokenId | string} tokenId
59404
59503
  * @property {AccountId | string} accountId
59405
- * @property {Long | number} amount
59504
+ * @property {Long | number | BigNumber | bigint} amount
59406
59505
  */
59407
59506
 
59408
59507
  /**
@@ -59481,7 +59580,7 @@
59481
59580
  /**
59482
59581
  * @param {TokenId | string} tokenId
59483
59582
  * @param {AccountId | string} accountId
59484
- * @param {number | Long} amount
59583
+ * @param {number | Long | BigNumber | bigint} amount
59485
59584
  * @param {boolean} isApproved
59486
59585
  * @param {number | null} expectedDecimals
59487
59586
  * @returns {this}
@@ -59501,7 +59600,7 @@
59501
59600
  accountId instanceof AccountId
59502
59601
  ? accountId
59503
59602
  : AccountId.fromString(accountId);
59504
- const value = amount instanceof Long ? amount : Long.fromNumber(amount);
59603
+ const value = convertAmountToLong(amount);
59505
59604
 
59506
59605
  for (const tokenTransfer of this._tokenTransfers) {
59507
59606
  if (
@@ -59530,7 +59629,7 @@
59530
59629
  /**
59531
59630
  * @param {TokenId | string} tokenId
59532
59631
  * @param {AccountId | string} accountId
59533
- * @param {number | Long} amount
59632
+ * @param {number | Long | BigNumber | bigint} amount
59534
59633
  * @returns {this}
59535
59634
  */
59536
59635
  addTokenTransfer(tokenId, accountId, amount) {
@@ -59672,7 +59771,7 @@
59672
59771
  /**
59673
59772
  * @param {TokenId | string} tokenId
59674
59773
  * @param {AccountId | string} accountId
59675
- * @param {number | Long} amount
59774
+ * @param {number | Long | BigNumber | bigint} amount
59676
59775
  * @returns {this}
59677
59776
  */
59678
59777
  addApprovedTokenTransfer(tokenId, accountId, amount) {
@@ -59682,7 +59781,7 @@
59682
59781
  /**
59683
59782
  * @param {TokenId | string} tokenId
59684
59783
  * @param {AccountId | string} accountId
59685
- * @param {number | Long} amount
59784
+ * @param {number | Long | BigNumber | bigint} amount
59686
59785
  * @param {number} decimals
59687
59786
  * @returns {this}
59688
59787
  */
@@ -59695,7 +59794,7 @@
59695
59794
  accountId instanceof AccountId
59696
59795
  ? accountId
59697
59796
  : AccountId.fromString(accountId);
59698
- const value = amount instanceof Long ? amount : Long.fromNumber(amount);
59797
+ const value = convertAmountToLong(amount);
59699
59798
 
59700
59799
  let found = false;
59701
59800
 
@@ -59990,6 +60089,7 @@
59990
60089
  * @typedef {import("../account/AccountId.js").default} AccountId
59991
60090
  * @typedef {import("./NftId.js").default} NftId
59992
60091
  * @typedef {import("./TokenId.js").default} TokenId
60092
+ * @typedef {import("bignumber.js").default} BigNumber
59993
60093
  */
59994
60094
 
59995
60095
  /**
@@ -60085,7 +60185,7 @@
60085
60185
  *
60086
60186
  * @param {TokenId} tokenId
60087
60187
  * @param {AccountId} accountId
60088
- * @param {Long} amount
60188
+ * @param {Long | number | BigNumber | bigint} amount
60089
60189
  * @param {number} expectedDecimals
60090
60190
  * @returns {this}
60091
60191
  */
@@ -60636,6 +60736,7 @@
60636
60736
 
60637
60737
  /**
60638
60738
  * @typedef {import("../client/Client.js").default<*, *>} Client
60739
+ * @typedef {import("bignumber.js").default} BigNumber
60639
60740
  */
60640
60741
 
60641
60742
  /**
@@ -60652,7 +60753,7 @@
60652
60753
  * @param {TokenId} props.tokenId
60653
60754
  * @param {AccountId | null} props.spenderAccountId
60654
60755
  * @param {AccountId | null} props.ownerAccountId
60655
- * @param {Long | null} props.amount
60756
+ * @param {Long | number | BigNumber | bigint | null} props.amount
60656
60757
  */
60657
60758
  constructor(props) {
60658
60759
  /**
@@ -60683,7 +60784,8 @@
60683
60784
  *
60684
60785
  * @readonly
60685
60786
  */
60686
- this.amount = props.amount;
60787
+ this.amount =
60788
+ props.amount != null ? convertAmountToLong(props.amount) : null;
60687
60789
 
60688
60790
  Object.freeze(this);
60689
60791
  }
@@ -61700,12 +61802,15 @@
61700
61802
  * @param {TokenId | string} tokenId
61701
61803
  * @param {AccountId | string} ownerAccountId
61702
61804
  * @param {AccountId | ContractId | string} spenderAccountId
61703
- * @param {Long | number} amount
61805
+ * @param {Long | number | BigNumber | bigint} amount
61704
61806
  * @returns {AccountAllowanceApproveTransaction}
61705
61807
  */
61706
61808
  approveTokenAllowance(tokenId, ownerAccountId, spenderAccountId, amount) {
61707
61809
  this._requireNotFrozen();
61708
61810
 
61811
+ // Convert amount to Long
61812
+ const amountLong = convertAmountToLong(amount);
61813
+
61709
61814
  this._tokenApprovals.push(
61710
61815
  new TokenAllowance({
61711
61816
  tokenId:
@@ -61732,10 +61837,7 @@
61732
61837
  ownerAccountId.toEvmAddress(),
61733
61838
  )
61734
61839
  : ownerAccountId,
61735
- amount:
61736
- typeof amount === "number"
61737
- ? Long.fromNumber(amount)
61738
- : amount,
61840
+ amount: amountLong,
61739
61841
  }),
61740
61842
  );
61741
61843
 
@@ -61746,12 +61848,15 @@
61746
61848
  * @deprecated - Use `approveTokenAllowance()` instead
61747
61849
  * @param {TokenId | string} tokenId
61748
61850
  * @param {AccountId | string} spenderAccountId
61749
- * @param {Long | number} amount
61851
+ * @param {Long | number | BigNumber | bigint} amount
61750
61852
  * @returns {AccountAllowanceApproveTransaction}
61751
61853
  */
61752
61854
  addTokenAllowance(tokenId, spenderAccountId, amount) {
61753
61855
  this._requireNotFrozen();
61754
61856
 
61857
+ // Convert amount to Long
61858
+ const amountLong = convertAmountToLong(amount);
61859
+
61755
61860
  this._tokenApprovals.push(
61756
61861
  new TokenAllowance({
61757
61862
  tokenId:
@@ -61762,10 +61867,7 @@
61762
61867
  typeof spenderAccountId === "string"
61763
61868
  ? AccountId.fromString(spenderAccountId)
61764
61869
  : spenderAccountId,
61765
- amount:
61766
- typeof amount === "number"
61767
- ? Long.fromNumber(amount)
61768
- : amount,
61870
+ amount: amountLong,
61769
61871
  ownerAccountId: null,
61770
61872
  }),
61771
61873
  );
@@ -79573,7 +79675,8 @@
79573
79675
  const isLocalEnvironment = host === "localhost" || host === "127.0.0.1";
79574
79676
 
79575
79677
  if (isLocalEnvironment) {
79576
- // For local environments, use HTTP scheme and port 8545
79678
+ // For local environments, use HTTP scheme and port 8545 for contract calls
79679
+ // (different from general mirror node REST API port 5551)
79577
79680
  const url = new URL(mirrorRestApiBaseUrl);
79578
79681
  url.protocol = "http:";
79579
79682
  url.port = "8545";
@@ -82924,6 +83027,7 @@
82924
83027
  * @typedef {import("../client/Client.js").default<*, *>} Client
82925
83028
  * @typedef {import("../account/AccountId.js").default} AccountId
82926
83029
  * @typedef {import("../transaction/TransactionId.js").default} TransactionId
83030
+ * @typedef {import("bignumber.js").default} BigNumber
82927
83031
  */
82928
83032
 
82929
83033
  /**
@@ -82933,7 +83037,7 @@
82933
83037
  /**
82934
83038
  * @param {object} [props]
82935
83039
  * @param {TokenId | string} [props.tokenId]
82936
- * @param {Long | number} [props.amount]
83040
+ * @param {Long | number | BigNumber | bigint} [props.amount]
82937
83041
  * @param {(Long | number)[]} [props.serials]
82938
83042
  */
82939
83043
  constructor(props = {}) {
@@ -83041,12 +83145,12 @@
83041
83145
  }
83042
83146
 
83043
83147
  /**
83044
- * @param {Long | number} amount
83148
+ * @param {Long | number | BigNumber | bigint} amount
83045
83149
  * @returns {this}
83046
83150
  */
83047
83151
  setAmount(amount) {
83048
83152
  this._requireNotFrozen();
83049
- this._amount = amount instanceof Long ? amount : Long.fromValue(amount);
83153
+ this._amount = convertAmountToLong(amount);
83050
83154
 
83051
83155
  return this;
83052
83156
  }
@@ -84077,7 +84181,7 @@
84077
84181
  * @param {string} [props.tokenName]
84078
84182
  * @param {string} [props.tokenSymbol]
84079
84183
  * @param {Long | number} [props.decimals]
84080
- * @param {Long | number} [props.initialSupply]
84184
+ * @param {Long | number | BigNumber | bigint} [props.initialSupply]
84081
84185
  * @param {AccountId | string} [props.treasuryAccountId]
84082
84186
  * @param {Key} [props.adminKey]
84083
84187
  * @param {Key} [props.kycKey]
@@ -84094,7 +84198,7 @@
84094
84198
  * @param {CustomFee[]} [props.customFees]
84095
84199
  * @param {TokenType} [props.tokenType]
84096
84200
  * @param {TokenSupplyType} [props.supplyType]
84097
- * @param {Long | number} [props.maxSupply]
84201
+ * @param {Long | number | BigNumber | bigint} [props.maxSupply]
84098
84202
  * @param {Key} [props.metadataKey]
84099
84203
  * @param {Uint8Array} [props.metadata]
84100
84204
  */
@@ -84519,12 +84623,12 @@
84519
84623
  }
84520
84624
 
84521
84625
  /**
84522
- * @param {Long | number} initialSupply
84626
+ * @param {Long | number | BigNumber | bigint} initialSupply
84523
84627
  * @returns {this}
84524
84628
  */
84525
84629
  setInitialSupply(initialSupply) {
84526
84630
  this._requireNotFrozen();
84527
- this._initialSupply = Long.fromValue(initialSupply);
84631
+ this._initialSupply = convertAmountToLong(initialSupply);
84528
84632
 
84529
84633
  return this;
84530
84634
  }
@@ -84852,14 +84956,11 @@
84852
84956
  }
84853
84957
 
84854
84958
  /**
84855
- * @param {Long | number} maxSupply
84959
+ * @param {Long | number | BigNumber | bigint} maxSupply
84856
84960
  * @returns {this}
84857
84961
  */
84858
84962
  setMaxSupply(maxSupply) {
84859
- this._maxSupply =
84860
- typeof maxSupply === "number"
84861
- ? Long.fromNumber(maxSupply)
84862
- : maxSupply;
84963
+ this._maxSupply = convertAmountToLong(maxSupply);
84863
84964
  return this;
84864
84965
  }
84865
84966
 
@@ -86400,6 +86501,7 @@
86400
86501
  * @typedef {import("../client/Client.js").default<*, *>} Client
86401
86502
  * @typedef {import("../account/AccountId.js").default} AccountId
86402
86503
  * @typedef {import("../transaction/TransactionId.js").default} TransactionId
86504
+ * @typedef {import("bignumber.js").default} BigNumber
86403
86505
  */
86404
86506
 
86405
86507
  /**
@@ -86409,7 +86511,7 @@
86409
86511
  /**
86410
86512
  * @param {object} [props]
86411
86513
  * @param {TokenId | string} [props.tokenId]
86412
- * @param {Long | number} [props.amount]
86514
+ * @param {Long | number | BigNumber | bigint} [props.amount]
86413
86515
  * @param {Uint8Array[]} [props.metadata]
86414
86516
  */
86415
86517
  constructor(props = {}) {
@@ -86515,12 +86617,12 @@
86515
86617
  }
86516
86618
 
86517
86619
  /**
86518
- * @param {Long | number} amount
86620
+ * @param {Long | number | BigNumber | bigint} amount
86519
86621
  * @returns {this}
86520
86622
  */
86521
86623
  setAmount(amount) {
86522
86624
  this._requireNotFrozen();
86523
- this._amount = amount instanceof Long ? amount : Long.fromValue(amount);
86625
+ this._amount = convertAmountToLong(amount);
86524
86626
 
86525
86627
  return this;
86526
86628
  }
@@ -88749,6 +88851,7 @@
88749
88851
  * @typedef {import("../channel/Channel.js").default} Channel
88750
88852
  * @typedef {import("../client/Client.js").default<*, *>} Client
88751
88853
  * @typedef {import("../transaction/TransactionId.js").default} TransactionId
88854
+ * @typedef {import("bignumber.js").default} BigNumber
88752
88855
  */
88753
88856
 
88754
88857
  /**
@@ -88759,7 +88862,7 @@
88759
88862
  * @param {object} [props]
88760
88863
  * @param {TokenId | string} [props.tokenId]
88761
88864
  * @param {AccountId | string} [props.accountId]
88762
- * @param {Long | number} [props.amount]
88865
+ * @param {Long | number | BigNumber | bigint} [props.amount]
88763
88866
  * @param {(Long | number)[]} [props.serials]
88764
88867
  */
88765
88868
  constructor(props = {}) {
@@ -88902,12 +89005,12 @@
88902
89005
  }
88903
89006
 
88904
89007
  /**
88905
- * @param {Long | number} amount
89008
+ * @param {Long | number | BigNumber | bigint} amount
88906
89009
  * @returns {this}
88907
89010
  */
88908
89011
  setAmount(amount) {
88909
89012
  this._requireNotFrozen();
88910
- this._amount = amount instanceof Long ? amount : Long.fromValue(amount);
89013
+ this._amount = convertAmountToLong(amount);
88911
89014
 
88912
89015
  return this;
88913
89016
  }
@@ -96609,6 +96712,55 @@
96609
96712
  getKey() {
96610
96713
  return this._address.toString();
96611
96714
  }
96715
+
96716
+ /**
96717
+ * Gets the base URL for this mirror node's REST API.
96718
+ *
96719
+ * @returns {string} The base URL for the mirror node REST API
96720
+ * @throws {Error} When the mirror node has invalid address configuration
96721
+ */
96722
+ get mirrorRestApiBaseUrl() {
96723
+ const host = this.address.address;
96724
+ const port = this.address.port;
96725
+
96726
+ if (!host || !port) {
96727
+ throw new Error("Mirror node has invalid address configuration");
96728
+ }
96729
+
96730
+ // For localhost/127.0.0.1, mirror node gRPC and REST API use different ports
96731
+ // gRPC typically uses port 5600, but REST API uses port 5551
96732
+ // Note: Contract calls may use port 8545 (handled separately in MirrorNodeContractQuery)
96733
+ if (host === "localhost" || host === "127.0.0.1") {
96734
+ return `http://${host}:5551/api/v1`;
96735
+ }
96736
+
96737
+ const scheme = this._getSchemeFromHostAndPort(host, port);
96738
+
96739
+ return `${scheme}://${host}:${port}/api/v1`;
96740
+ }
96741
+
96742
+ /**
96743
+ * Determines the appropriate scheme (http/https) based on the host and port.
96744
+ *
96745
+ * @private
96746
+ * @param {string} host - The host address
96747
+ * @param {number} port - The port number
96748
+ * @returns {string} - The scheme ('http' or 'https')
96749
+ */
96750
+ _getSchemeFromHostAndPort(host, port) {
96751
+ // For localhost and 127.0.0.1, use HTTP scheme
96752
+ if (host === "localhost" || host === "127.0.0.1") {
96753
+ return "http";
96754
+ }
96755
+
96756
+ // Standard HTTP ports
96757
+ if (port === 80) {
96758
+ return "http";
96759
+ }
96760
+
96761
+ // For other ports, assume HTTPS for security
96762
+ return "https";
96763
+ }
96612
96764
  }
96613
96765
 
96614
96766
  // SPDX-License-Identifier: Apache-2.0
@@ -96695,6 +96847,24 @@
96695
96847
  getNextMirrorNode() {
96696
96848
  return this._getNumberOfMostHealthyNodes(1)[0];
96697
96849
  }
96850
+
96851
+ /**
96852
+ * Gets the base URL for the mirror node REST API.
96853
+ *
96854
+ * @returns {string} The base URL for the mirror node REST API
96855
+ * @throws {Error} When no mirror network is configured or available
96856
+ */
96857
+ get mirrorRestApiBaseUrl() {
96858
+ try {
96859
+ const mirrorNode = this.getNextMirrorNode();
96860
+ return mirrorNode.mirrorRestApiBaseUrl;
96861
+ } catch (error) {
96862
+ // Re-throw with a more descriptive error message
96863
+ throw new Error(
96864
+ "Client has no mirror network configured or no healthy mirror nodes are available",
96865
+ );
96866
+ }
96867
+ }
96698
96868
  };
96699
96869
 
96700
96870
  /* NOSONAR */
@@ -96729,6 +96899,9 @@
96729
96899
  "node29.swirldslabs.com:443": new AccountId(32),
96730
96900
  "node30.swirldslabs.com:443": new AccountId(33),
96731
96901
  "node31.swirldslabs.com:443": new AccountId(34),
96902
+ // "node32.swirldslabs.com:443": new AccountId(35), - temporarily disabled
96903
+ "node33.swirldslabs.com:443": new AccountId(36),
96904
+ "node34.swirldslabs.com:443": new AccountId(37),
96732
96905
  };
96733
96906
 
96734
96907
  const WEB_TESTNET = {
@@ -96859,8 +97032,15 @@
96859
97032
  * description: string,
96860
97033
  * stake: number
96861
97034
  * }>} nodes
97035
+ * @property {?{next: ?string}} links - Links object containing pagination information
96862
97036
  */
96863
97037
 
97038
+ /**
97039
+ * Default page size limit for optimal pagination performance
97040
+ * @constant {number}
97041
+ */
97042
+ const DEFAULT_PAGE_SIZE = 25;
97043
+
96864
97044
  /**
96865
97045
  * Web-compatible query to get a list of Hedera network node addresses from a mirror node.
96866
97046
  * Uses fetch API instead of gRPC for web environments.
@@ -96875,7 +97055,7 @@
96875
97055
  /**
96876
97056
  * @param {object} props
96877
97057
  * @param {FileId | string} [props.fileId]
96878
- * @param {number} [props.limit]
97058
+ * @param {number} [props.limit] - Page size limit (defaults to 25 for optimal performance)
96879
97059
  */
96880
97060
  constructor(props = {}) {
96881
97061
  super();
@@ -97042,111 +97222,135 @@
97042
97222
  baseUrl = `${baseUrl}:${port}`;
97043
97223
  }
97044
97224
 
97045
- const url = new URL(`${baseUrl}/api/v1/network/nodes`);
97225
+ // Initialize aggregated results
97226
+ this._addresses = [];
97227
+ let nextUrl = null;
97228
+ let isLastPage = false;
97046
97229
 
97230
+ // Build initial URL
97231
+ const initialUrl = new URL(`${baseUrl}/api/v1/network/nodes`);
97047
97232
  if (this._fileId != null) {
97048
- url.searchParams.append("file.id", this._fileId.toString());
97049
- }
97050
- if (this._limit != null) {
97051
- url.searchParams.append("limit", this._limit.toString());
97233
+ initialUrl.searchParams.append("file.id", this._fileId.toString());
97052
97234
  }
97053
97235
 
97054
- for (let attempt = 0; attempt <= this._maxAttempts; attempt++) {
97055
- try {
97056
- // eslint-disable-next-line n/no-unsupported-features/node-builtins
97057
- const response = await fetch(url.toString(), {
97058
- method: "GET",
97059
- headers: {
97060
- Accept: "application/json",
97061
- },
97062
- signal: requestTimeout
97063
- ? AbortSignal.timeout(requestTimeout)
97064
- : undefined,
97065
- });
97236
+ // Use the specified limit, or default to DEFAULT_PAGE_SIZE for optimal pagination performance
97237
+ const effectiveLimit =
97238
+ this._limit != null ? this._limit : DEFAULT_PAGE_SIZE;
97239
+ initialUrl.searchParams.append("limit", effectiveLimit.toString());
97066
97240
 
97067
- if (!response.ok) {
97068
- throw new Error(`HTTP error! status: ${response.status}`);
97069
- }
97241
+ // Fetch all pages
97242
+ while (!isLastPage) {
97243
+ const currentUrl = nextUrl ? new URL(nextUrl, baseUrl) : initialUrl;
97070
97244
 
97071
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
97072
- const data = /** @type {AddressBookQueryWebResponse} */ (
97073
- await response.json()
97074
- );
97245
+ for (let attempt = 0; attempt <= this._maxAttempts; attempt++) {
97246
+ try {
97247
+ // eslint-disable-next-line n/no-unsupported-features/node-builtins
97248
+ const response = await fetch(currentUrl.toString(), {
97249
+ method: "GET",
97250
+ headers: {
97251
+ Accept: "application/json",
97252
+ },
97253
+ signal: requestTimeout
97254
+ ? AbortSignal.timeout(requestTimeout)
97255
+ : undefined,
97256
+ });
97075
97257
 
97076
- const nodes = data.nodes || [];
97258
+ if (!response.ok) {
97259
+ throw new Error(
97260
+ `HTTP error! status: ${response.status}`,
97261
+ );
97262
+ }
97077
97263
 
97078
- // eslint-disable-next-line ie11/no-loop-func
97079
- this._addresses = nodes.map((node) =>
97080
- NodeAddress.fromJSON({
97081
- nodeId: node.node_id.toString(),
97082
- accountId: node.node_account_id,
97083
- addresses: this._handleAddressesFromGrpcProxyEndpoint(
97084
- node,
97085
- client,
97086
- ),
97087
- certHash: node.node_cert_hash,
97088
- publicKey: node.public_key,
97089
- description: node.description,
97090
- stake: node.stake.toString(),
97091
- }),
97092
- );
97264
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
97265
+ const data = /** @type {AddressBookQueryWebResponse} */ (
97266
+ await response.json()
97267
+ );
97093
97268
 
97094
- const addressBook = new NodeAddressBook({
97095
- nodeAddresses: this._addresses,
97096
- });
97269
+ const nodes = data.nodes || [];
97270
+
97271
+ // Aggregate nodes from this page
97272
+ const pageNodes = nodes.map((node) =>
97273
+ NodeAddress.fromJSON({
97274
+ nodeId: node.node_id.toString(),
97275
+ accountId: node.node_account_id,
97276
+ addresses:
97277
+ this._handleAddressesFromGrpcProxyEndpoint(
97278
+ node,
97279
+ client,
97280
+ ),
97281
+ certHash: node.node_cert_hash,
97282
+ publicKey: node.public_key,
97283
+ description: node.description,
97284
+ stake: node.stake.toString(),
97285
+ }),
97286
+ );
97097
97287
 
97098
- resolve(addressBook);
97099
- return;
97100
- } catch (error) {
97101
- console.error("Error in _makeFetchRequest:", error);
97102
- const message =
97103
- error instanceof Error ? error.message : String(error);
97288
+ this._addresses.push(...pageNodes);
97289
+ nextUrl = data.links?.next || null;
97104
97290
 
97105
- // Check if we should retry
97106
- if (
97107
- attempt < this._maxAttempts &&
97108
- !client.isClientShutDown &&
97109
- this._retryHandler(
97110
- /** @type {MirrorError | Error | null} */ (error),
97111
- )
97112
- ) {
97113
- const delay = Math.min(
97114
- 250 * 2 ** attempt,
97115
- this._maxBackoff,
97116
- );
97291
+ // If no more pages, set flag to exit loop
97292
+ if (!nextUrl) {
97293
+ isLastPage = true;
97294
+ }
97117
97295
 
97118
- if (this._logger) {
97119
- this._logger.debug(
97120
- `Error getting nodes from mirror for file ${
97121
- this._fileId != null
97122
- ? this._fileId.toString()
97123
- : "UNKNOWN"
97124
- } during attempt ${
97125
- attempt + 1
97126
- }. Waiting ${delay} ms before next attempt: ${message}`,
97296
+ // Move to next page
97297
+ break;
97298
+ } catch (error) {
97299
+ console.error("Error in _makeFetchRequest:", error);
97300
+ const message =
97301
+ error instanceof Error ? error.message : String(error);
97302
+
97303
+ // Check if we should retry
97304
+ if (
97305
+ attempt < this._maxAttempts &&
97306
+ !client.isClientShutDown &&
97307
+ this._retryHandler(
97308
+ /** @type {MirrorError | Error | null} */ (error),
97309
+ )
97310
+ ) {
97311
+ const delay = Math.min(
97312
+ 250 * 2 ** attempt,
97313
+ this._maxBackoff,
97127
97314
  );
97315
+
97316
+ if (this._logger) {
97317
+ this._logger.debug(
97318
+ `Error getting nodes from mirror for file ${
97319
+ this._fileId != null
97320
+ ? this._fileId.toString()
97321
+ : "UNKNOWN"
97322
+ } during attempt ${
97323
+ attempt + 1
97324
+ }. Waiting ${delay} ms before next attempt: ${message}`,
97325
+ );
97326
+ }
97327
+
97328
+ // Wait before next attempt
97329
+ // eslint-disable-next-line ie11/no-loop-func
97330
+ await new Promise((resolve) =>
97331
+ setTimeout(resolve, delay),
97332
+ );
97333
+ continue;
97128
97334
  }
97129
97335
 
97130
- // Wait before next attempt
97131
- // eslint-disable-next-line ie11/no-loop-func
97132
- await new Promise((resolve) => setTimeout(resolve, delay));
97133
- continue;
97336
+ // If we shouldn't retry or have exhausted attempts, reject
97337
+ const maxAttemptsReached = attempt >= this._maxAttempts;
97338
+ const errorMessage = maxAttemptsReached
97339
+ ? `Failed to query address book after ${
97340
+ this._maxAttempts + 1
97341
+ } attempts. Last error: ${message}`
97342
+ : `Failed to query address book: ${message}`;
97343
+ reject(new Error(errorMessage));
97344
+ return;
97134
97345
  }
97135
-
97136
- // If we shouldn't retry or have exhausted attempts, reject
97137
- const maxAttemptsReached = attempt >= this._maxAttempts;
97138
- const errorMessage = maxAttemptsReached
97139
- ? `Failed to query address book after ${
97140
- this._maxAttempts + 1
97141
- } attempts. Last error: ${message}`
97142
- : `Failed to query address book: ${message}`;
97143
- reject(new Error(errorMessage));
97144
- return;
97145
97346
  }
97146
97347
  }
97147
97348
 
97148
- // This should never be reached, but just in case
97149
- reject(new Error("failed to query address book"));
97349
+ // Return the aggregated results
97350
+ const addressBook = new NodeAddressBook({
97351
+ nodeAddresses: this._addresses,
97352
+ });
97353
+ resolve(addressBook);
97150
97354
  }
97151
97355
 
97152
97356
  /**
@@ -97465,26 +97669,7 @@
97465
97669
  * @throws {Error} When no mirror network is configured or available
97466
97670
  */
97467
97671
  get mirrorRestApiBaseUrl() {
97468
- try {
97469
- const mirrorNode = this._mirrorNetwork.getNextMirrorNode();
97470
- const host = mirrorNode.address.address;
97471
- const port = mirrorNode.address.port;
97472
-
97473
- if (!host || !port) {
97474
- throw new Error(
97475
- "Mirror node has invalid address configuration",
97476
- );
97477
- }
97478
-
97479
- const scheme = this._getSchemeFromHostAndPort(host, port);
97480
-
97481
- return `${scheme}://${host}:${port}/api/v1`;
97482
- } catch (error) {
97483
- // Re-throw with a more descriptive error message
97484
- throw new Error(
97485
- "Client has no mirror network configured or no healthy mirror nodes are available",
97486
- );
97487
- }
97672
+ return this._mirrorNetwork.mirrorRestApiBaseUrl;
97488
97673
  }
97489
97674
 
97490
97675
  /**
@@ -97755,15 +97940,24 @@
97755
97940
  }
97756
97941
 
97757
97942
  /**
97758
- * @returns {number}
97943
+ * Gets the maximum number of nodes that a transaction or query will attempt to execute against.
97944
+ *
97945
+ * @returns {number} The current maximum nodes per transaction setting.
97946
+ * Returns -1 if no limit is set (uses network defaults).
97759
97947
  */
97760
97948
  get maxNodesPerTransaction() {
97761
97949
  return this._network.maxNodesPerTransaction;
97762
97950
  }
97763
97951
 
97764
97952
  /**
97765
- * @param {number} maxNodesPerTransaction
97766
- * @returns {this}
97953
+ * Sets the maximum number of nodes that a transaction or query will execute against.
97954
+ *
97955
+ * - **Before freezing**: Limits automatic node selection when no explicit nodes are set
97956
+ * - **After freezing**: Trims frozen transactions to the first N nodes while preserving signatures
97957
+ * - **Special values**: 0 disables limiting, values > available nodes cause no trimming
97958
+ *
97959
+ * @param {number} maxNodesPerTransaction - Maximum nodes per transaction. Set to 0 to disable.
97960
+ * @returns {this} The client instance for method chaining
97767
97961
  */
97768
97962
  setMaxNodesPerTransaction(maxNodesPerTransaction) {
97769
97963
  this._network.setMaxNodesPerTransaction(maxNodesPerTransaction);
@@ -98025,34 +98219,6 @@
98025
98219
  }, this._networkUpdatePeriod);
98026
98220
  }
98027
98221
 
98028
- /**
98029
- * Determines the appropriate scheme (http/https) based on the host and port.
98030
- *
98031
- * @private
98032
- * @param {string} host - The host address
98033
- * @param {number} port - The port number
98034
- * @returns {string} - The scheme ('http' or 'https')
98035
- */
98036
- _getSchemeFromHostAndPort(host, port) {
98037
- // For localhost and 127.0.0.1, use HTTP scheme
98038
- if (host === "localhost" || host === "127.0.0.1") {
98039
- return "http";
98040
- }
98041
-
98042
- // Standard HTTPS ports
98043
- if (port === 443) {
98044
- return "https";
98045
- }
98046
-
98047
- // Standard HTTP ports
98048
- if (port === 80) {
98049
- return "http";
98050
- }
98051
-
98052
- // For other ports, assume HTTPS for security
98053
- return "https";
98054
- }
98055
-
98056
98222
  /**
98057
98223
  * @returns {boolean}
98058
98224
  */
@@ -98122,7 +98288,7 @@
98122
98288
 
98123
98289
  const SDK_NAME = "hiero-sdk-js";
98124
98290
  const SDK_VERSION =
98125
- "2.73.2" ;
98291
+ "2.75.0" ;
98126
98292
 
98127
98293
  // SPDX-License-Identifier: Apache-2.0
98128
98294