@hiero-ledger/sdk 2.73.2 → 2.74.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.
- package/dist/umd.js +250 -115
- package/dist/umd.min.js +3 -3
- package/lib/MirrorNode.cjs +46 -0
- package/lib/MirrorNode.d.ts +16 -0
- package/lib/MirrorNode.js +1 -1
- package/lib/MirrorNode.js.map +1 -1
- package/lib/account/AccountAllowanceApproveTransaction.cjs +11 -5
- package/lib/account/AccountAllowanceApproveTransaction.d.ts +4 -5
- package/lib/account/AccountAllowanceApproveTransaction.js +1 -1
- package/lib/account/AccountAllowanceApproveTransaction.js.map +1 -1
- package/lib/account/TokenAllowance.cjs +4 -2
- package/lib/account/TokenAllowance.d.ts +4 -2
- package/lib/account/TokenAllowance.js +1 -1
- package/lib/account/TokenAllowance.js.map +1 -1
- package/lib/account/TokenTransferMap.cjs +7 -2
- package/lib/account/TokenTransferMap.d.ts +6 -2
- package/lib/account/TokenTransferMap.js +1 -1
- package/lib/account/TokenTransferMap.js.map +1 -1
- package/lib/client/Client.cjs +13 -44
- package/lib/client/Client.d.ts +12 -12
- package/lib/client/Client.js +1 -1
- package/lib/client/Client.js.map +1 -1
- package/lib/client/MirrorNetwork.cjs +16 -0
- package/lib/client/MirrorNetwork.d.ts +7 -0
- package/lib/client/MirrorNetwork.js +1 -1
- package/lib/client/MirrorNetwork.js.map +1 -1
- package/lib/client/addressbooks/mainnet.cjs +1 -1
- package/lib/client/addressbooks/mainnet.d.ts +1 -1
- package/lib/client/addressbooks/mainnet.js +1 -1
- package/lib/client/addressbooks/mainnet.js.map +1 -1
- package/lib/client/addressbooks/previewnet.cjs +1 -1
- package/lib/client/addressbooks/previewnet.d.ts +1 -1
- package/lib/client/addressbooks/previewnet.js +1 -1
- package/lib/client/addressbooks/previewnet.js.map +1 -1
- package/lib/client/addressbooks/testnet.cjs +1 -1
- package/lib/client/addressbooks/testnet.d.ts +1 -1
- package/lib/client/addressbooks/testnet.js +1 -1
- package/lib/client/addressbooks/testnet.js.map +1 -1
- package/lib/constants/ClientConstants.cjs +4 -1
- package/lib/constants/ClientConstants.d.ts +2 -0
- package/lib/constants/ClientConstants.js +1 -1
- package/lib/constants/ClientConstants.js.map +1 -1
- package/lib/contract/ContractId.cjs +2 -5
- package/lib/contract/ContractId.js +1 -1
- package/lib/contract/ContractId.js.map +1 -1
- package/lib/query/MirrorNodeContractQuery.cjs +2 -1
- package/lib/query/MirrorNodeContractQuery.js.map +1 -1
- package/lib/token/AbstractTokenTransferTransaction.cjs +12 -8
- package/lib/token/AbstractTokenTransferTransaction.d.ts +14 -11
- package/lib/token/AbstractTokenTransferTransaction.js +1 -1
- package/lib/token/AbstractTokenTransferTransaction.js.map +1 -1
- package/lib/token/AssessedCustomFee.cjs +8 -4
- package/lib/token/AssessedCustomFee.d.ts +8 -5
- package/lib/token/AssessedCustomFee.js +1 -1
- package/lib/token/AssessedCustomFee.js.map +1 -1
- package/lib/token/CustomFixedFee.cjs +8 -4
- package/lib/token/CustomFixedFee.d.ts +8 -5
- package/lib/token/CustomFixedFee.js +1 -1
- package/lib/token/CustomFixedFee.js.map +1 -1
- package/lib/token/PendingAirdropRecord.cjs +7 -2
- package/lib/token/PendingAirdropRecord.d.ts +6 -2
- package/lib/token/PendingAirdropRecord.js +1 -1
- package/lib/token/PendingAirdropRecord.js.map +1 -1
- package/lib/token/TokenAirdropTransaction.cjs +2 -1
- package/lib/token/TokenAirdropTransaction.d.ts +4 -2
- package/lib/token/TokenAirdropTransaction.js.map +1 -1
- package/lib/token/TokenBurnTransaction.cjs +5 -3
- package/lib/token/TokenBurnTransaction.d.ts +6 -4
- package/lib/token/TokenBurnTransaction.js +1 -1
- package/lib/token/TokenBurnTransaction.js.map +1 -1
- package/lib/token/TokenCreateTransaction.cjs +7 -6
- package/lib/token/TokenCreateTransaction.d.ts +8 -8
- package/lib/token/TokenCreateTransaction.js +1 -1
- package/lib/token/TokenCreateTransaction.js.map +1 -1
- package/lib/token/TokenMintTransaction.cjs +5 -4
- package/lib/token/TokenMintTransaction.d.ts +6 -5
- package/lib/token/TokenMintTransaction.js +1 -1
- package/lib/token/TokenMintTransaction.js.map +1 -1
- package/lib/token/TokenTransfer.cjs +3 -2
- package/lib/token/TokenTransfer.d.ts +2 -2
- package/lib/token/TokenTransfer.js +1 -1
- package/lib/token/TokenTransfer.js.map +1 -1
- package/lib/token/TokenWipeTransaction.cjs +5 -3
- package/lib/token/TokenWipeTransaction.d.ts +6 -4
- package/lib/token/TokenWipeTransaction.js +1 -1
- package/lib/token/TokenWipeTransaction.js.map +1 -1
- package/lib/transaction/Transaction.cjs +54 -0
- package/lib/transaction/Transaction.d.ts +10 -0
- package/lib/transaction/Transaction.js +1 -1
- package/lib/transaction/Transaction.js.map +1 -1
- package/lib/util.cjs +25 -0
- package/lib/util.d.ts +8 -0
- package/lib/util.js +1 -1
- package/lib/util.js.map +1 -1
- package/lib/version.js +1 -1
- package/package.json +12 -8
- package/src/MirrorNode.js +49 -0
- package/src/account/AccountAllowanceApproveTransaction.js +11 -11
- package/src/account/TokenAllowance.js +5 -2
- package/src/account/TokenTransferMap.js +7 -2
- package/src/client/Client.js +13 -51
- package/src/client/MirrorNetwork.js +18 -0
- package/src/client/addressbooks/mainnet.js +1 -1
- package/src/client/addressbooks/previewnet.js +1 -1
- package/src/client/addressbooks/testnet.js +1 -1
- package/src/constants/ClientConstants.js +3 -0
- package/src/contract/ContractId.js +2 -10
- package/src/query/MirrorNodeContractQuery.js +2 -1
- package/src/token/AbstractTokenTransferTransaction.js +12 -8
- package/src/token/AssessedCustomFee.js +8 -5
- package/src/token/CustomFixedFee.js +8 -5
- package/src/token/PendingAirdropRecord.js +7 -2
- package/src/token/TokenAirdropTransaction.js +2 -1
- package/src/token/TokenBurnTransaction.js +5 -3
- package/src/token/TokenCreateTransaction.js +7 -9
- package/src/token/TokenMintTransaction.js +5 -4
- package/src/token/TokenTransfer.js +3 -2
- package/src/token/TokenWipeTransaction.js +5 -3
- package/src/transaction/Transaction.js +63 -0
- 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
|
-
|
|
45010
|
-
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 = {
|
|
@@ -97465,26 +97638,7 @@
|
|
|
97465
97638
|
* @throws {Error} When no mirror network is configured or available
|
|
97466
97639
|
*/
|
|
97467
97640
|
get mirrorRestApiBaseUrl() {
|
|
97468
|
-
|
|
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
|
-
}
|
|
97641
|
+
return this._mirrorNetwork.mirrorRestApiBaseUrl;
|
|
97488
97642
|
}
|
|
97489
97643
|
|
|
97490
97644
|
/**
|
|
@@ -97755,15 +97909,24 @@
|
|
|
97755
97909
|
}
|
|
97756
97910
|
|
|
97757
97911
|
/**
|
|
97758
|
-
*
|
|
97912
|
+
* Gets the maximum number of nodes that a transaction or query will attempt to execute against.
|
|
97913
|
+
*
|
|
97914
|
+
* @returns {number} The current maximum nodes per transaction setting.
|
|
97915
|
+
* Returns -1 if no limit is set (uses network defaults).
|
|
97759
97916
|
*/
|
|
97760
97917
|
get maxNodesPerTransaction() {
|
|
97761
97918
|
return this._network.maxNodesPerTransaction;
|
|
97762
97919
|
}
|
|
97763
97920
|
|
|
97764
97921
|
/**
|
|
97765
|
-
*
|
|
97766
|
-
*
|
|
97922
|
+
* Sets the maximum number of nodes that a transaction or query will execute against.
|
|
97923
|
+
*
|
|
97924
|
+
* - **Before freezing**: Limits automatic node selection when no explicit nodes are set
|
|
97925
|
+
* - **After freezing**: Trims frozen transactions to the first N nodes while preserving signatures
|
|
97926
|
+
* - **Special values**: 0 disables limiting, values > available nodes cause no trimming
|
|
97927
|
+
*
|
|
97928
|
+
* @param {number} maxNodesPerTransaction - Maximum nodes per transaction. Set to 0 to disable.
|
|
97929
|
+
* @returns {this} The client instance for method chaining
|
|
97767
97930
|
*/
|
|
97768
97931
|
setMaxNodesPerTransaction(maxNodesPerTransaction) {
|
|
97769
97932
|
this._network.setMaxNodesPerTransaction(maxNodesPerTransaction);
|
|
@@ -98025,34 +98188,6 @@
|
|
|
98025
98188
|
}, this._networkUpdatePeriod);
|
|
98026
98189
|
}
|
|
98027
98190
|
|
|
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
98191
|
/**
|
|
98057
98192
|
* @returns {boolean}
|
|
98058
98193
|
*/
|
|
@@ -98122,7 +98257,7 @@
|
|
|
98122
98257
|
|
|
98123
98258
|
const SDK_NAME = "hiero-sdk-js";
|
|
98124
98259
|
const SDK_VERSION =
|
|
98125
|
-
"2.
|
|
98260
|
+
"2.74.0" ;
|
|
98126
98261
|
|
|
98127
98262
|
// SPDX-License-Identifier: Apache-2.0
|
|
98128
98263
|
|