@hiero-ledger/sdk 2.80.0 → 2.81.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/README.md +107 -64
- package/dist/umd.js +444 -217
- package/dist/umd.js.map +1 -0
- package/dist/umd.min.js +8 -7
- package/dist/umd.min.js.map +1 -0
- package/lib/BadEntityIdError.js.map +1 -1
- package/lib/Cache.js.map +1 -1
- package/lib/Duration.js.map +1 -1
- package/lib/EntityIdHelper.js.map +1 -1
- package/lib/EthereumFlow.js.map +1 -1
- package/lib/EthereumTransaction.d.ts +4 -0
- package/lib/EthereumTransaction.js.map +1 -1
- package/lib/EthereumTransactionData.js.map +1 -1
- package/lib/EthereumTransactionDataEip1559.js.map +1 -1
- package/lib/EthereumTransactionDataEip2930.js.map +1 -1
- package/lib/EthereumTransactionDataEip7702.js.map +1 -1
- package/lib/EthereumTransactionDataLegacy.js.map +1 -1
- package/lib/EvmAddress.js.map +1 -1
- package/lib/ExchangeRate.js.map +1 -1
- package/lib/ExchangeRates.js.map +1 -1
- package/lib/Executable.cjs +8 -5
- package/lib/Executable.js +1 -1
- package/lib/Executable.js.map +1 -1
- package/lib/FeeComponents.js.map +1 -1
- package/lib/FeeData.js.map +1 -1
- package/lib/FeeDataType.js.map +1 -1
- package/lib/FeeSchedule.js.map +1 -1
- package/lib/FeeSchedules.js.map +1 -1
- package/lib/FreezeType.js.map +1 -1
- package/lib/Hbar.js.map +1 -1
- package/lib/HbarUnit.js.map +1 -1
- package/lib/Key.js.map +1 -1
- package/lib/KeyList.js.map +1 -1
- package/lib/LedgerId.js.map +1 -1
- package/lib/LocalProvider.js.map +1 -1
- package/lib/LocalProviderWeb.js.map +1 -1
- package/lib/ManagedNode.js.map +1 -1
- package/lib/ManagedNodeAddress.js.map +1 -1
- package/lib/MaxAttemptsOrTimeoutError.js.map +1 -1
- package/lib/MaxQueryPaymentExceeded.js.map +1 -1
- package/lib/MirrorNode.js.map +1 -1
- package/lib/Mnemonic.js.map +1 -1
- package/lib/Node.js.map +1 -1
- package/lib/ObjectMap.js.map +1 -1
- package/lib/PrecheckStatusError.js.map +1 -1
- package/lib/PrivateKey.js.map +1 -1
- package/lib/PrngTransaction.d.ts +4 -0
- package/lib/PrngTransaction.js.map +1 -1
- package/lib/Provider.js.map +1 -1
- package/lib/PublicKey.js.map +1 -1
- package/lib/ReceiptStatusError.js.map +1 -1
- package/lib/RecordStatusError.js.map +1 -1
- package/lib/RequestType.js.map +1 -1
- package/lib/Signer.js.map +1 -1
- package/lib/SignerSignature.js.map +1 -1
- package/lib/StakingInfo.js.map +1 -1
- package/lib/Status.js.map +1 -1
- package/lib/StatusError.js.map +1 -1
- package/lib/Timestamp.js.map +1 -1
- package/lib/TransactionFeeSchedule.js.map +1 -1
- package/lib/Transfer.js.map +1 -1
- package/lib/Wallet.js.map +1 -1
- package/lib/account/AccountAllowanceAdjustTransaction.cjs +2 -1
- package/lib/account/AccountAllowanceAdjustTransaction.d.ts +4 -2
- package/lib/account/AccountAllowanceAdjustTransaction.js.map +1 -1
- package/lib/account/AccountAllowanceApproveTransaction.cjs +2 -1
- package/lib/account/AccountAllowanceApproveTransaction.d.ts +4 -2
- package/lib/account/AccountAllowanceApproveTransaction.js.map +1 -1
- package/lib/account/AccountAllowanceDeleteTransaction.cjs +2 -1
- package/lib/account/AccountAllowanceDeleteTransaction.d.ts +4 -2
- package/lib/account/AccountAllowanceDeleteTransaction.js.map +1 -1
- package/lib/account/AccountBalance.cjs +6 -15
- package/lib/account/AccountBalance.d.ts +2 -2
- package/lib/account/AccountBalance.js +1 -1
- package/lib/account/AccountBalance.js.map +1 -1
- package/lib/account/AccountBalanceQuery.cjs +5 -10
- package/lib/account/AccountBalanceQuery.d.ts +15 -2
- package/lib/account/AccountBalanceQuery.js +1 -1
- package/lib/account/AccountBalanceQuery.js.map +1 -1
- package/lib/account/AccountCreateTransaction.cjs +2 -1
- package/lib/account/AccountCreateTransaction.d.ts +4 -2
- package/lib/account/AccountCreateTransaction.js.map +1 -1
- package/lib/account/AccountDeleteTransaction.cjs +2 -1
- package/lib/account/AccountDeleteTransaction.d.ts +4 -2
- package/lib/account/AccountDeleteTransaction.js.map +1 -1
- package/lib/account/AccountId.js.map +1 -1
- package/lib/account/AccountInfo.js.map +1 -1
- package/lib/account/AccountInfoFlow.js.map +1 -1
- package/lib/account/AccountInfoQuery.cjs +2 -1
- package/lib/account/AccountInfoQuery.d.ts +8 -2
- package/lib/account/AccountInfoQuery.js.map +1 -1
- package/lib/account/AccountRecordsQuery.cjs +2 -1
- package/lib/account/AccountRecordsQuery.d.ts +8 -2
- package/lib/account/AccountRecordsQuery.js.map +1 -1
- package/lib/account/AccountUpdateTransaction.cjs +2 -1
- package/lib/account/AccountUpdateTransaction.d.ts +4 -2
- package/lib/account/AccountUpdateTransaction.js.map +1 -1
- package/lib/account/HbarAllowance.cjs +3 -1
- package/lib/account/HbarAllowance.d.ts +6 -2
- package/lib/account/HbarAllowance.js.map +1 -1
- package/lib/account/HbarTransferMap.js.map +1 -1
- package/lib/account/LiveHash.js.map +1 -1
- package/lib/account/LiveHashAddTransaction.cjs +2 -1
- package/lib/account/LiveHashAddTransaction.d.ts +4 -2
- package/lib/account/LiveHashAddTransaction.js.map +1 -1
- package/lib/account/LiveHashDeleteTransaction.cjs +2 -1
- package/lib/account/LiveHashDeleteTransaction.d.ts +4 -2
- package/lib/account/LiveHashDeleteTransaction.js.map +1 -1
- package/lib/account/LiveHashQuery.cjs +2 -1
- package/lib/account/LiveHashQuery.d.ts +8 -2
- package/lib/account/LiveHashQuery.js.map +1 -1
- package/lib/account/NullableTokenDecimalMap.js.map +1 -1
- package/lib/account/ProxyStaker.js.map +1 -1
- package/lib/account/TokenAllowance.cjs +3 -1
- package/lib/account/TokenAllowance.d.ts +6 -2
- package/lib/account/TokenAllowance.js.map +1 -1
- package/lib/account/TokenBalanceMap.js.map +1 -1
- package/lib/account/TokenDecimalMap.js.map +1 -1
- package/lib/account/TokenNftAllowance.cjs +3 -1
- package/lib/account/TokenNftAllowance.d.ts +6 -2
- package/lib/account/TokenNftAllowance.js.map +1 -1
- package/lib/account/TokenNftTransferMap.js.map +1 -1
- package/lib/account/TokenRelationship.js.map +1 -1
- package/lib/account/TokenRelationshipMap.js.map +1 -1
- package/lib/account/TokenTransferAccountMap.js.map +1 -1
- package/lib/account/TokenTransferMap.js.map +1 -1
- package/lib/account/TransferTransaction.cjs +6 -5
- package/lib/account/TransferTransaction.d.ts +6 -2
- package/lib/account/TransferTransaction.js +1 -1
- package/lib/account/TransferTransaction.js.map +1 -1
- package/lib/address_book/Endpoint.js.map +1 -1
- package/lib/address_book/IPv4Address.js.map +1 -1
- package/lib/address_book/IPv4AddressPart.js.map +1 -1
- package/lib/address_book/NodeAddress.js.map +1 -1
- package/lib/address_book/NodeAddressBook.js.map +1 -1
- package/lib/base32.js.map +1 -1
- package/lib/browser.js +1 -1
- package/lib/channel/Channel.js.map +1 -1
- package/lib/channel/MirrorChannel.js.map +1 -1
- package/lib/channel/NativeChannel.js.map +1 -1
- package/lib/channel/NodeChannel.js.map +1 -1
- package/lib/channel/NodeMirrorChannel.js.map +1 -1
- package/lib/channel/WebChannel.js.map +1 -1
- package/lib/client/Client.cjs +38 -0
- package/lib/client/Client.d.ts +30 -0
- package/lib/client/Client.js +1 -1
- package/lib/client/Client.js.map +1 -1
- package/lib/client/ManagedNetwork.js.map +1 -1
- package/lib/client/MirrorNetwork.js.map +1 -1
- package/lib/client/NativeClient.js.map +1 -1
- package/lib/client/Network.js.map +1 -1
- package/lib/client/NodeClient.js.map +1 -1
- package/lib/client/WebClient.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.js.map +1 -1
- package/lib/contract/ContractByteCodeQuery.js.map +1 -1
- package/lib/contract/ContractCallQuery.js.map +1 -1
- package/lib/contract/ContractCreateFlow.js.map +1 -1
- package/lib/contract/ContractCreateTransaction.cjs +2 -1
- package/lib/contract/ContractCreateTransaction.d.ts +4 -2
- package/lib/contract/ContractCreateTransaction.js.map +1 -1
- package/lib/contract/ContractDeleteTransaction.cjs +2 -1
- package/lib/contract/ContractDeleteTransaction.d.ts +4 -2
- package/lib/contract/ContractDeleteTransaction.js.map +1 -1
- package/lib/contract/ContractExecuteTransaction.d.ts +4 -0
- package/lib/contract/ContractExecuteTransaction.js.map +1 -1
- package/lib/contract/ContractFunctionParameters.js.map +1 -1
- package/lib/contract/ContractFunctionResult.js.map +1 -1
- package/lib/contract/ContractFunctionSelector.js.map +1 -1
- package/lib/contract/ContractId.js.map +1 -1
- package/lib/contract/ContractInfo.js.map +1 -1
- package/lib/contract/ContractInfoQuery.js.map +1 -1
- package/lib/contract/ContractLogInfo.js.map +1 -1
- package/lib/contract/ContractNonceInfo.js.map +1 -1
- package/lib/contract/ContractUpdateTransaction.cjs +2 -1
- package/lib/contract/ContractUpdateTransaction.d.ts +4 -2
- package/lib/contract/ContractUpdateTransaction.js.map +1 -1
- package/lib/contract/DelegateContractId.js.map +1 -1
- package/lib/cryptography/keccak.js.map +1 -1
- package/lib/encoding/hex.js.map +1 -1
- package/lib/file/FileAppendTransaction.cjs +5 -4
- package/lib/file/FileAppendTransaction.d.ts +10 -12
- package/lib/file/FileAppendTransaction.js.map +1 -1
- package/lib/file/FileContentsQuery.js.map +1 -1
- package/lib/file/FileCreateTransaction.js.map +1 -1
- package/lib/file/FileDeleteTransaction.d.ts +4 -0
- package/lib/file/FileDeleteTransaction.js.map +1 -1
- package/lib/file/FileId.js.map +1 -1
- package/lib/file/FileInfo.js.map +1 -1
- package/lib/file/FileInfoQuery.js.map +1 -1
- package/lib/file/FileUpdateTransaction.d.ts +4 -0
- package/lib/file/FileUpdateTransaction.js.map +1 -1
- package/lib/grpc/GrpcServiceError.js.map +1 -1
- package/lib/grpc/GrpcStatus.js.map +1 -1
- package/lib/http/HttpError.js.map +1 -1
- package/lib/http/HttpStatus.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/logger/LogLevel.js.map +1 -1
- package/lib/logger/Logger.js.map +1 -1
- package/lib/native.js +1 -1
- package/lib/network/AddressBookQuery.js.map +1 -1
- package/lib/network/AddressBookQueryWeb.js.map +1 -1
- package/lib/network/NetworkVersionInfo.js.map +1 -1
- package/lib/network/NetworkVersionInfoQuery.js.map +1 -1
- package/lib/network/SemanticVersion.js.map +1 -1
- package/lib/node/NodeCreateTransaction.js.map +1 -1
- package/lib/node/NodeDeleteTransaction.js.map +1 -1
- package/lib/node/NodeUpdateTransaction.js.map +1 -1
- package/lib/node/ServiceEndpoint.js.map +1 -1
- package/lib/query/CostQuery.js.map +1 -1
- package/lib/query/MirrorNodeContractCallQuery.js.map +1 -1
- package/lib/query/MirrorNodeContractEstimateQuery.js.map +1 -1
- package/lib/query/MirrorNodeContractQuery.js.map +1 -1
- package/lib/query/Query.js.map +1 -1
- package/lib/query/QueryBase.js.map +1 -1
- package/lib/schedule/ScheduleCreateTransaction.cjs +2 -1
- package/lib/schedule/ScheduleCreateTransaction.d.ts +4 -2
- package/lib/schedule/ScheduleCreateTransaction.js.map +1 -1
- package/lib/schedule/ScheduleDeleteTransaction.d.ts +4 -0
- package/lib/schedule/ScheduleDeleteTransaction.js.map +1 -1
- package/lib/schedule/ScheduleId.js.map +1 -1
- package/lib/schedule/ScheduleInfo.js.map +1 -1
- package/lib/schedule/ScheduleInfoQuery.js.map +1 -1
- package/lib/schedule/ScheduleSignTransaction.d.ts +4 -0
- package/lib/schedule/ScheduleSignTransaction.js.map +1 -1
- package/lib/system/FreezeTransaction.js.map +1 -1
- package/lib/system/SystemDeleteTransaction.js.map +1 -1
- package/lib/system/SystemUndeleteTransaction.js.map +1 -1
- package/lib/token/AbstractTokenTransferTransaction.js.map +1 -1
- package/lib/token/AirdropPendingTransaction.js.map +1 -1
- package/lib/token/AssessedCustomFee.js.map +1 -1
- package/lib/token/CustomFee.js.map +1 -1
- package/lib/token/CustomFixedFee.js.map +1 -1
- package/lib/token/CustomFractionalFee.js.map +1 -1
- package/lib/token/CustomRoyaltyFee.js.map +1 -1
- package/lib/token/FeeAssessmentMethod.js.map +1 -1
- package/lib/token/NftId.js.map +1 -1
- package/lib/token/PendingAirdropId.js.map +1 -1
- package/lib/token/PendingAirdropRecord.js.map +1 -1
- package/lib/token/TokenAirdropTransaction.js.map +1 -1
- package/lib/token/TokenAssociateTransaction.cjs +2 -1
- package/lib/token/TokenAssociateTransaction.d.ts +4 -2
- package/lib/token/TokenAssociateTransaction.js.map +1 -1
- package/lib/token/TokenAssociation.js.map +1 -1
- package/lib/token/TokenBurnTransaction.d.ts +4 -0
- package/lib/token/TokenBurnTransaction.js.map +1 -1
- package/lib/token/TokenCancelAirdropTransaction.js.map +1 -1
- package/lib/token/TokenClaimAirdropTransaction.js.map +1 -1
- package/lib/token/TokenCreateTransaction.cjs +2 -1
- package/lib/token/TokenCreateTransaction.d.ts +4 -2
- package/lib/token/TokenCreateTransaction.js.map +1 -1
- package/lib/token/TokenDeleteTransaction.d.ts +4 -0
- package/lib/token/TokenDeleteTransaction.js.map +1 -1
- package/lib/token/TokenDissociateTransaction.cjs +2 -1
- package/lib/token/TokenDissociateTransaction.d.ts +4 -2
- package/lib/token/TokenDissociateTransaction.js.map +1 -1
- package/lib/token/TokenFeeScheduleUpdateTransaction.js.map +1 -1
- package/lib/token/TokenFreezeTransaction.cjs +2 -1
- package/lib/token/TokenFreezeTransaction.d.ts +4 -2
- package/lib/token/TokenFreezeTransaction.js.map +1 -1
- package/lib/token/TokenGrantKycTransaction.cjs +2 -1
- package/lib/token/TokenGrantKycTransaction.d.ts +4 -2
- package/lib/token/TokenGrantKycTransaction.js.map +1 -1
- package/lib/token/TokenId.js.map +1 -1
- package/lib/token/TokenInfo.js.map +1 -1
- package/lib/token/TokenInfoQuery.js.map +1 -1
- package/lib/token/TokenKeyValidation.js.map +1 -1
- package/lib/token/TokenMintTransaction.d.ts +4 -0
- package/lib/token/TokenMintTransaction.js.map +1 -1
- package/lib/token/TokenNftInfo.js.map +1 -1
- package/lib/token/TokenNftInfoQuery.js.map +1 -1
- package/lib/token/TokenNftTransfer.js.map +1 -1
- package/lib/token/TokenNftsUpdateTransaction.d.ts +4 -0
- package/lib/token/TokenPauseTransaction.d.ts +4 -0
- package/lib/token/TokenPauseTransaction.js.map +1 -1
- package/lib/token/TokenReference.js.map +1 -1
- package/lib/token/TokenRejectFlow.cjs +3 -1
- package/lib/token/TokenRejectFlow.d.ts +6 -2
- package/lib/token/TokenRejectFlow.js.map +1 -1
- package/lib/token/TokenRejectTransaction.js.map +1 -1
- package/lib/token/TokenRevokeKycTransaction.cjs +2 -1
- package/lib/token/TokenRevokeKycTransaction.d.ts +4 -2
- package/lib/token/TokenRevokeKycTransaction.js.map +1 -1
- package/lib/token/TokenSupplyType.js.map +1 -1
- package/lib/token/TokenTransfer.js.map +1 -1
- package/lib/token/TokenType.js.map +1 -1
- package/lib/token/TokenUnfreezeTransaction.cjs +2 -1
- package/lib/token/TokenUnfreezeTransaction.d.ts +4 -2
- package/lib/token/TokenUnfreezeTransaction.js.map +1 -1
- package/lib/token/TokenUnpauseTransaction.d.ts +4 -0
- package/lib/token/TokenUnpauseTransaction.js.map +1 -1
- package/lib/token/TokenUpdateNftsTransaction.d.ts +4 -0
- package/lib/token/TokenUpdateNftsTransaction.js.map +1 -1
- package/lib/token/TokenUpdateTransaction.cjs +2 -1
- package/lib/token/TokenUpdateTransaction.d.ts +4 -2
- package/lib/token/TokenUpdateTransaction.js.map +1 -1
- package/lib/token/TokenWipeTransaction.cjs +2 -1
- package/lib/token/TokenWipeTransaction.d.ts +4 -2
- package/lib/token/TokenWipeTransaction.js.map +1 -1
- package/lib/topic/SubscriptionHandle.js.map +1 -1
- package/lib/topic/TopicCreateTransaction.cjs +2 -1
- package/lib/topic/TopicCreateTransaction.d.ts +4 -2
- package/lib/topic/TopicCreateTransaction.js.map +1 -1
- package/lib/topic/TopicDeleteTransaction.d.ts +4 -0
- package/lib/topic/TopicDeleteTransaction.js.map +1 -1
- package/lib/topic/TopicId.js.map +1 -1
- package/lib/topic/TopicInfo.js.map +1 -1
- package/lib/topic/TopicInfoQuery.js.map +1 -1
- package/lib/topic/TopicMessage.js.map +1 -1
- package/lib/topic/TopicMessageChunk.js.map +1 -1
- package/lib/topic/TopicMessageQuery.js.map +1 -1
- package/lib/topic/TopicMessageSubmitTransaction.js.map +1 -1
- package/lib/topic/TopicUpdateTransaction.cjs +2 -1
- package/lib/topic/TopicUpdateTransaction.d.ts +4 -2
- package/lib/topic/TopicUpdateTransaction.js.map +1 -1
- package/lib/transaction/BatchTransaction.js.map +1 -1
- package/lib/transaction/CustomFeeLimit.js.map +1 -1
- package/lib/transaction/List.js.map +1 -1
- package/lib/transaction/NodeAccountIdSignatureMap.js.map +1 -1
- package/lib/transaction/NodeAccountIdSignatureMapLegacy.js.map +1 -1
- package/lib/transaction/SignableNodeTransactionBodyBytes.js.map +1 -1
- package/lib/transaction/SignatureMap.js.map +1 -1
- package/lib/transaction/SignatureMapLegacy.js.map +1 -1
- package/lib/transaction/SignaturePairMap.js.map +1 -1
- package/lib/transaction/Transaction.cjs +83 -15
- package/lib/transaction/Transaction.d.ts +33 -4
- package/lib/transaction/Transaction.js +1 -1
- package/lib/transaction/Transaction.js.map +1 -1
- package/lib/transaction/TransactionHashMap.js.map +1 -1
- package/lib/transaction/TransactionId.js.map +1 -1
- package/lib/transaction/TransactionReceipt.js.map +1 -1
- package/lib/transaction/TransactionReceiptQuery.cjs +2 -1
- package/lib/transaction/TransactionReceiptQuery.d.ts +8 -2
- package/lib/transaction/TransactionReceiptQuery.js.map +1 -1
- package/lib/transaction/TransactionRecord.js.map +1 -1
- package/lib/transaction/TransactionRecordQuery.cjs +2 -1
- package/lib/transaction/TransactionRecordQuery.d.ts +8 -2
- package/lib/transaction/TransactionRecordQuery.js.map +1 -1
- package/lib/transaction/TransactionResponse.cjs +85 -10
- package/lib/transaction/TransactionResponse.d.ts +39 -4
- package/lib/transaction/TransactionResponse.js +1 -1
- package/lib/transaction/TransactionResponse.js.map +1 -1
- package/lib/util/ASN1-Decoder.js.map +1 -1
- package/lib/util.js.map +1 -1
- package/lib/version.js +1 -1
- package/package.json +21 -19
- package/src/Executable.js +13 -8
- package/src/account/AccountAllowanceAdjustTransaction.js +2 -1
- package/src/account/AccountAllowanceApproveTransaction.js +2 -1
- package/src/account/AccountAllowanceDeleteTransaction.js +2 -1
- package/src/account/AccountBalance.js +7 -15
- package/src/account/AccountBalanceQuery.js +5 -9
- package/src/account/AccountCreateTransaction.js +2 -1
- package/src/account/AccountDeleteTransaction.js +2 -1
- package/src/account/AccountInfoQuery.js +2 -1
- package/src/account/AccountRecordsQuery.js +2 -1
- package/src/account/AccountUpdateTransaction.js +2 -1
- package/src/account/HbarAllowance.js +3 -1
- package/src/account/LiveHashAddTransaction.js +2 -1
- package/src/account/LiveHashDeleteTransaction.js +2 -1
- package/src/account/LiveHashQuery.js +2 -1
- package/src/account/TokenAllowance.js +3 -1
- package/src/account/TokenNftAllowance.js +3 -1
- package/src/account/TransferTransaction.js +6 -4
- package/src/client/Client.js +38 -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/contract/ContractCreateTransaction.js +2 -1
- package/src/contract/ContractDeleteTransaction.js +2 -1
- package/src/contract/ContractUpdateTransaction.js +2 -1
- package/src/file/FileAppendTransaction.js +5 -4
- package/src/schedule/ScheduleCreateTransaction.js +2 -1
- package/src/token/TokenAssociateTransaction.js +2 -1
- package/src/token/TokenCreateTransaction.js +2 -1
- package/src/token/TokenDissociateTransaction.js +2 -1
- package/src/token/TokenFreezeTransaction.js +2 -1
- package/src/token/TokenGrantKycTransaction.js +2 -1
- package/src/token/TokenRejectFlow.js +3 -1
- package/src/token/TokenRevokeKycTransaction.js +2 -1
- package/src/token/TokenUnfreezeTransaction.js +2 -1
- package/src/token/TokenUpdateTransaction.js +2 -1
- package/src/token/TokenWipeTransaction.js +2 -1
- package/src/topic/TopicCreateTransaction.js +2 -1
- package/src/topic/TopicUpdateTransaction.js +2 -1
- package/src/transaction/Transaction.js +139 -19
- package/src/transaction/TransactionReceiptQuery.js +2 -1
- package/src/transaction/TransactionRecordQuery.js +2 -1
- package/src/transaction/TransactionResponse.js +101 -14
|
@@ -4,7 +4,9 @@ import TokenDissociateTransaction from "../token/TokenDissociateTransaction.js";
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @typedef {import("../PrivateKey.js").default} PrivateKey
|
|
7
|
-
* @typedef {import("../
|
|
7
|
+
* @typedef {import("../channel/Channel.js").default} Channel
|
|
8
|
+
* @typedef {import("../channel/MirrorChannel.js").default} MirrorChannel
|
|
9
|
+
* @typedef {import("../client/Client.js").default<Channel, MirrorChannel>} Client
|
|
8
10
|
* @typedef {import("../Signer.js").default} Signer
|
|
9
11
|
* @typedef {import("../transaction/TransactionId.js").default} TransactionId
|
|
10
12
|
* @typedef {import("../transaction/Transaction.js").default} Transaction
|
|
@@ -19,7 +19,8 @@ import Transaction, {
|
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* @typedef {import("../channel/Channel.js").default} Channel
|
|
22
|
-
* @typedef {import("../
|
|
22
|
+
* @typedef {import("../channel/MirrorChannel.js").default} MirrorChannel
|
|
23
|
+
* @typedef {import("../client/Client.js").default<Channel, MirrorChannel>} Client
|
|
23
24
|
* @typedef {import("../transaction/TransactionId.js").default} TransactionId
|
|
24
25
|
*/
|
|
25
26
|
|
|
@@ -19,7 +19,8 @@ import Transaction, {
|
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* @typedef {import("../channel/Channel.js").default} Channel
|
|
22
|
-
* @typedef {import("../
|
|
22
|
+
* @typedef {import("../channel/MirrorChannel.js").default} MirrorChannel
|
|
23
|
+
* @typedef {import("../client/Client.js").default<Channel, MirrorChannel>} Client
|
|
23
24
|
* @typedef {import("../transaction/TransactionId.js").default} TransactionId
|
|
24
25
|
*/
|
|
25
26
|
|
|
@@ -24,7 +24,8 @@ import TokenKeyValidation from "./TokenKeyValidation.js";
|
|
|
24
24
|
/**
|
|
25
25
|
* @typedef {import("bignumber.js").default} BigNumber
|
|
26
26
|
* @typedef {import("../channel/Channel.js").default} Channel
|
|
27
|
-
* @typedef {import("../
|
|
27
|
+
* @typedef {import("../channel/MirrorChannel.js").default} MirrorChannel
|
|
28
|
+
* @typedef {import("../client/Client.js").default<Channel, MirrorChannel>} Client
|
|
28
29
|
* @typedef {import("../transaction/TransactionId.js").default} TransactionId
|
|
29
30
|
*/
|
|
30
31
|
|
|
@@ -21,7 +21,8 @@ import { convertAmountToLong } from "../util.js";
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* @typedef {import("../channel/Channel.js").default} Channel
|
|
24
|
-
* @typedef {import("../
|
|
24
|
+
* @typedef {import("../channel/MirrorChannel.js").default} MirrorChannel
|
|
25
|
+
* @typedef {import("../client/Client.js").default<Channel, MirrorChannel>} Client
|
|
25
26
|
* @typedef {import("../transaction/TransactionId.js").default} TransactionId
|
|
26
27
|
* @typedef {import("bignumber.js").default} BigNumber
|
|
27
28
|
*/
|
|
@@ -22,7 +22,8 @@ import Hbar from "../Hbar.js";
|
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* @typedef {import("../channel/Channel.js").default} Channel
|
|
25
|
-
* @typedef {import("../
|
|
25
|
+
* @typedef {import("../channel/MirrorChannel.js").default} MirrorChannel
|
|
26
|
+
* @typedef {import("../client/Client.js").default<Channel, MirrorChannel>} Client
|
|
26
27
|
* @typedef {import("../transaction/TransactionId.js").default} TransactionId
|
|
27
28
|
*/
|
|
28
29
|
|
|
@@ -22,7 +22,8 @@ import CustomFixedFee from "../token/CustomFixedFee.js";
|
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* @typedef {import("../channel/Channel.js").default} Channel
|
|
25
|
-
* @typedef {import("../
|
|
25
|
+
* @typedef {import("../channel/MirrorChannel.js").default} MirrorChannel
|
|
26
|
+
* @typedef {import("../client/Client.js").default<Channel, MirrorChannel>} Client
|
|
26
27
|
* @typedef {import("../transaction/TransactionId.js").default} TransactionId
|
|
27
28
|
*/
|
|
28
29
|
|
|
@@ -30,7 +30,8 @@ import SignableNodeTransactionBodyBytes from "./SignableNodeTransactionBodyBytes
|
|
|
30
30
|
* @typedef {import("../schedule/ScheduleCreateTransaction.js").default} ScheduleCreateTransaction
|
|
31
31
|
* @typedef {import("../PrivateKey.js").default} PrivateKey
|
|
32
32
|
* @typedef {import("../channel/Channel.js").default} Channel
|
|
33
|
-
* @typedef {import("../
|
|
33
|
+
* @typedef {import("../channel/MirrorChannel.js").default} MirrorChannel
|
|
34
|
+
* @typedef {import("../client/Client.js").default<Channel, MirrorChannel>} Client
|
|
34
35
|
* @typedef {import("../Signer.js").Signer} Signer
|
|
35
36
|
*/
|
|
36
37
|
|
|
@@ -56,6 +57,17 @@ const DEFAULT_TRANSACTION_VALID_DURATION = 120;
|
|
|
56
57
|
// This value can be overriden using `setChunkSize` when preparing to submit a messsage via `TopicMessageSubmitTransaction`.
|
|
57
58
|
export const CHUNK_SIZE = 1024;
|
|
58
59
|
|
|
60
|
+
/**
|
|
61
|
+
* @param {NonNullable<HieroProto.proto.TransactionBody["data"]>} transactionDataCase
|
|
62
|
+
* @returns {boolean}
|
|
63
|
+
*/
|
|
64
|
+
function isMultiTransactionIdType(transactionDataCase) {
|
|
65
|
+
return (
|
|
66
|
+
transactionDataCase === "fileAppend" ||
|
|
67
|
+
transactionDataCase === "consensusSubmitMessage"
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
59
71
|
/**
|
|
60
72
|
* @type {Map<NonNullable<HieroProto.proto.TransactionBody["data"]>, (transactions: HieroProto.proto.ITransaction[], signedTransactions: HieroProto.proto.ISignedTransaction[], transactionIds: TransactionId[], nodeIds: AccountId[], bodies: HieroProto.proto.TransactionBody[]) => Transaction>}
|
|
61
73
|
*/
|
|
@@ -438,7 +450,7 @@ export default class Transaction extends Executable {
|
|
|
438
450
|
* @description Batchify method is used to mark a transaction as part of a batch transaction or make it so-called inner transaction.
|
|
439
451
|
* The Transaction will be frozen and signed by the operator of the client.
|
|
440
452
|
*
|
|
441
|
-
* @param {
|
|
453
|
+
* @param {Client} client
|
|
442
454
|
* @param {Key} batchKey
|
|
443
455
|
* @returns {Promise<this>}
|
|
444
456
|
*/
|
|
@@ -448,6 +460,82 @@ export default class Transaction extends Executable {
|
|
|
448
460
|
return await this.signWithOperator(client);
|
|
449
461
|
}
|
|
450
462
|
|
|
463
|
+
/**
|
|
464
|
+
* Validate transaction list shape and consistency.
|
|
465
|
+
*
|
|
466
|
+
* @private
|
|
467
|
+
* @param {NonNullable<HieroProto.proto.TransactionBody["data"]>} transactionDataCase
|
|
468
|
+
* @param {TransactionId[]} transactionIds
|
|
469
|
+
* @param {AccountId[]} nodeIds
|
|
470
|
+
* @param {HieroProto.proto.ITransactionBody[]} bodies
|
|
471
|
+
* @returns {void}
|
|
472
|
+
*/
|
|
473
|
+
static _validateTransactionBodies(
|
|
474
|
+
transactionDataCase,
|
|
475
|
+
transactionIds,
|
|
476
|
+
nodeIds,
|
|
477
|
+
bodies,
|
|
478
|
+
) {
|
|
479
|
+
const hasNoTransactionIds = transactionIds.length === 0;
|
|
480
|
+
const hasNoBodies = bodies.length === 0;
|
|
481
|
+
|
|
482
|
+
if (hasNoTransactionIds || hasNoBodies) {
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
const transactionCount = transactionIds.length;
|
|
487
|
+
const nodeCount = nodeIds.length;
|
|
488
|
+
const isChunkedTransactionType =
|
|
489
|
+
isMultiTransactionIdType(transactionDataCase);
|
|
490
|
+
const hasInvalidLogicalTransactionCount =
|
|
491
|
+
!isChunkedTransactionType && transactionCount !== 1;
|
|
492
|
+
|
|
493
|
+
if (nodeCount === 0) {
|
|
494
|
+
const hasUnexpectedBodyCountWithoutNodes =
|
|
495
|
+
bodies.length !== transactionCount;
|
|
496
|
+
|
|
497
|
+
if (
|
|
498
|
+
hasUnexpectedBodyCountWithoutNodes ||
|
|
499
|
+
hasInvalidLogicalTransactionCount
|
|
500
|
+
) {
|
|
501
|
+
throw new Error("failed to validate transaction bodies");
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
const expectedBodyCount = transactionCount * nodeCount;
|
|
508
|
+
const hasUnexpectedBodyCount = bodies.length !== expectedBodyCount;
|
|
509
|
+
|
|
510
|
+
if (hasUnexpectedBodyCount || hasInvalidLogicalTransactionCount) {
|
|
511
|
+
throw new Error("failed to validate transaction bodies");
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
const ignoredFields = new Set();
|
|
515
|
+
ignoredFields.add("nodeAccountID");
|
|
516
|
+
|
|
517
|
+
for (
|
|
518
|
+
let transactionIndex = 0;
|
|
519
|
+
transactionIndex < transactionCount;
|
|
520
|
+
transactionIndex++
|
|
521
|
+
) {
|
|
522
|
+
const rowStart = transactionIndex * nodeCount;
|
|
523
|
+
const referenceBody = bodies[rowStart];
|
|
524
|
+
|
|
525
|
+
for (let nodeIndex = 1; nodeIndex < nodeCount; nodeIndex++) {
|
|
526
|
+
if (
|
|
527
|
+
!util.compare(
|
|
528
|
+
referenceBody,
|
|
529
|
+
bodies[rowStart + nodeIndex],
|
|
530
|
+
ignoredFields,
|
|
531
|
+
)
|
|
532
|
+
) {
|
|
533
|
+
throw new Error("failed to validate transaction bodies");
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
451
539
|
/**
|
|
452
540
|
* This method is called by each `*Transaction._fromProtobuf()` method. It does
|
|
453
541
|
* all the finalization before the user gets hold of a complete `Transaction`
|
|
@@ -470,22 +558,12 @@ export default class Transaction extends Executable {
|
|
|
470
558
|
bodies,
|
|
471
559
|
) {
|
|
472
560
|
const body = bodies[0];
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
bodies[i * nodeIds.length + j],
|
|
480
|
-
bodies[i * nodeIds.length + j + 1],
|
|
481
|
-
// eslint-disable-next-line ie11/no-collection-args
|
|
482
|
-
new Set(["nodeAccountID"]),
|
|
483
|
-
)
|
|
484
|
-
) {
|
|
485
|
-
throw new Error("failed to validate transaction bodies");
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
}
|
|
561
|
+
Transaction._validateTransactionBodies(
|
|
562
|
+
transaction._getTransactionDataCase(),
|
|
563
|
+
transactionIds,
|
|
564
|
+
nodeIds,
|
|
565
|
+
bodies,
|
|
566
|
+
);
|
|
489
567
|
|
|
490
568
|
// Remove node account IDs of 0
|
|
491
569
|
// _IIRC_ this was initial due to some funny behavior with `ScheduleCreateTransaction`
|
|
@@ -790,6 +868,43 @@ export default class Transaction extends Executable {
|
|
|
790
868
|
);
|
|
791
869
|
}
|
|
792
870
|
|
|
871
|
+
/**
|
|
872
|
+
* Defense-in-depth validation before adding signatures.
|
|
873
|
+
*
|
|
874
|
+
* @private
|
|
875
|
+
* @returns {void}
|
|
876
|
+
*/
|
|
877
|
+
_validateSignedTransactionBodies() {
|
|
878
|
+
if (
|
|
879
|
+
this._transactionIds.length === 0 ||
|
|
880
|
+
this._signedTransactions.length === 0
|
|
881
|
+
) {
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
/** @type {HieroProto.proto.ITransactionBody[]} */
|
|
886
|
+
const bodies = [];
|
|
887
|
+
|
|
888
|
+
for (const signedTransaction of this._signedTransactions.list) {
|
|
889
|
+
if (signedTransaction.bodyBytes == null) {
|
|
890
|
+
throw new Error("failed to validate transaction bodies");
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
bodies.push(
|
|
894
|
+
HieroProto.proto.TransactionBody.decode(
|
|
895
|
+
/** @type {Uint8Array} */ (signedTransaction.bodyBytes),
|
|
896
|
+
),
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
Transaction._validateTransactionBodies(
|
|
901
|
+
this._getTransactionDataCase(),
|
|
902
|
+
this._transactionIds.list,
|
|
903
|
+
this._nodeAccountIds.list,
|
|
904
|
+
bodies,
|
|
905
|
+
);
|
|
906
|
+
}
|
|
907
|
+
|
|
793
908
|
/**
|
|
794
909
|
* Sign the transaction with the public key and signer function
|
|
795
910
|
*
|
|
@@ -821,6 +936,8 @@ export default class Transaction extends Executable {
|
|
|
821
936
|
return this;
|
|
822
937
|
}
|
|
823
938
|
|
|
939
|
+
this._validateSignedTransactionBodies();
|
|
940
|
+
|
|
824
941
|
// If we add a new signer, then we need to re-create all transactions
|
|
825
942
|
this._transactions.clear();
|
|
826
943
|
|
|
@@ -1706,7 +1823,7 @@ export default class Transaction extends Executable {
|
|
|
1706
1823
|
*
|
|
1707
1824
|
* @override
|
|
1708
1825
|
* @protected
|
|
1709
|
-
* @param {
|
|
1826
|
+
* @param {Client} client
|
|
1710
1827
|
* @returns {Promise<void>}
|
|
1711
1828
|
*/
|
|
1712
1829
|
async _beforeExecute(client) {
|
|
@@ -2056,6 +2173,9 @@ export default class Transaction extends Executable {
|
|
|
2056
2173
|
transactionId,
|
|
2057
2174
|
transaction: this,
|
|
2058
2175
|
logger: this._logger,
|
|
2176
|
+
transactionNodeAccountIds: !this._nodeAccountIds.isEmpty
|
|
2177
|
+
? this._nodeAccountIds.list
|
|
2178
|
+
: undefined,
|
|
2059
2179
|
});
|
|
2060
2180
|
}
|
|
2061
2181
|
|
|
@@ -14,7 +14,8 @@ const { proto } = HieroProto;
|
|
|
14
14
|
/**
|
|
15
15
|
* @typedef {import("../account/AccountId.js").default} AccountId
|
|
16
16
|
* @typedef {import("../channel/Channel.js").default} Channel
|
|
17
|
-
* @typedef {import("../
|
|
17
|
+
* @typedef {import("../channel/MirrorChannel.js").default} MirrorChannel
|
|
18
|
+
* @typedef {import("../client/Client.js").default<Channel, MirrorChannel>} Client
|
|
18
19
|
*/
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -15,7 +15,8 @@ const { proto } = HieroProto;
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @typedef {import("../channel/Channel.js").default} Channel
|
|
18
|
-
* @typedef {import("../
|
|
18
|
+
* @typedef {import("../channel/MirrorChannel.js").default} MirrorChannel
|
|
19
|
+
* @typedef {import("../client/Client.js").default<Channel, MirrorChannel>} Client
|
|
19
20
|
* @typedef {import("../account/AccountId.js").default} AccountId
|
|
20
21
|
*/
|
|
21
22
|
|
|
@@ -10,7 +10,9 @@ import * as hex from "../encoding/hex.js";
|
|
|
10
10
|
import { wait } from "../util.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* @typedef {import("../
|
|
13
|
+
* @typedef {import("../channel/Channel.js").default} Channel
|
|
14
|
+
* @typedef {import("../channel/MirrorChannel.js").default} MirrorChannel
|
|
15
|
+
* @typedef {import("../client/Client.js").default<Channel, MirrorChannel>} Client
|
|
14
16
|
* @typedef {import("./Transaction.js").default} Transaction
|
|
15
17
|
* @typedef {import("./TransactionReceipt.js").default} TransactionReceipt
|
|
16
18
|
* @typedef {import("./TransactionRecord.js").default} TransactionRecord
|
|
@@ -43,6 +45,7 @@ export default class TransactionResponse {
|
|
|
43
45
|
* @param {TransactionId} props.transactionId
|
|
44
46
|
* @param {Transaction} [props.transaction]
|
|
45
47
|
* @param {Logger | null} [props.logger]
|
|
48
|
+
* @param {AccountId[]} [props.transactionNodeAccountIds]
|
|
46
49
|
*/
|
|
47
50
|
constructor(props) {
|
|
48
51
|
/** @readonly */
|
|
@@ -56,6 +59,14 @@ export default class TransactionResponse {
|
|
|
56
59
|
this.transaction = props.transaction;
|
|
57
60
|
|
|
58
61
|
this.logger = props.logger;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The node account IDs that were configured on the transaction.
|
|
65
|
+
* Used for receipt query failover when allowReceiptNodeFailover is enabled.
|
|
66
|
+
* @internal
|
|
67
|
+
* @type {AccountId[] | undefined}
|
|
68
|
+
*/
|
|
69
|
+
this.transactionNodeAccountIds = props.transactionNodeAccountIds;
|
|
59
70
|
}
|
|
60
71
|
|
|
61
72
|
/**
|
|
@@ -77,7 +88,7 @@ export default class TransactionResponse {
|
|
|
77
88
|
async getReceipt(client) {
|
|
78
89
|
let receipt;
|
|
79
90
|
try {
|
|
80
|
-
receipt = await this.getReceiptQuery().execute(client);
|
|
91
|
+
receipt = await this.getReceiptQuery(client).execute(client);
|
|
81
92
|
} catch (err) {
|
|
82
93
|
if (
|
|
83
94
|
err instanceof ReceiptStatusError &&
|
|
@@ -113,7 +124,7 @@ export default class TransactionResponse {
|
|
|
113
124
|
async getRecord(client) {
|
|
114
125
|
await this.getReceipt(client);
|
|
115
126
|
|
|
116
|
-
return this.getRecordQuery().execute(client);
|
|
127
|
+
return this.getRecordQuery(client).execute(client);
|
|
117
128
|
}
|
|
118
129
|
|
|
119
130
|
/**
|
|
@@ -125,10 +136,10 @@ export default class TransactionResponse {
|
|
|
125
136
|
async getVerboseRecord(client) {
|
|
126
137
|
try {
|
|
127
138
|
// The receipt needs to be called in order to wait for transaction to be included in the consensus. Otherwise we are going to get "DUPLICATE_TRANSACTION".
|
|
128
|
-
await this.getReceiptQuery().execute(client);
|
|
129
|
-
return this.getRecordQuery().execute(client);
|
|
139
|
+
await this.getReceiptQuery(client).execute(client);
|
|
140
|
+
return this.getRecordQuery(client).execute(client);
|
|
130
141
|
} catch (e) {
|
|
131
|
-
return this.getRecordQuery().execute(client);
|
|
142
|
+
return this.getRecordQuery(client).execute(client);
|
|
132
143
|
}
|
|
133
144
|
}
|
|
134
145
|
|
|
@@ -161,21 +172,97 @@ export default class TransactionResponse {
|
|
|
161
172
|
}
|
|
162
173
|
|
|
163
174
|
/**
|
|
175
|
+
* Create a receipt query for this transaction.
|
|
176
|
+
*
|
|
177
|
+
* By default, the query is pinned to the submitting node only. If the client has
|
|
178
|
+
* `allowReceiptNodeFailover` enabled, the query can fail over to other nodes while
|
|
179
|
+
* still starting with the submitting node first.
|
|
180
|
+
*
|
|
181
|
+
* When failover is enabled, the node list is determined by:
|
|
182
|
+
* 1. Transaction's configured nodes (if transaction had specific nodes set), or
|
|
183
|
+
* 2. Client's network nodes (as fallback)
|
|
184
|
+
*
|
|
185
|
+
* @param {Client} [client] - Optional client to enable failover behavior
|
|
164
186
|
* @returns {TransactionReceiptQuery}
|
|
165
187
|
*/
|
|
166
|
-
getReceiptQuery() {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
188
|
+
getReceiptQuery(client) {
|
|
189
|
+
const query = new TransactionReceiptQuery().setTransactionId(
|
|
190
|
+
this.transactionId,
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
// If client is provided and failover is enabled, construct a node list
|
|
194
|
+
// that starts with the submitting node followed by other nodes
|
|
195
|
+
if (client != null && client.allowReceiptNodeFailover) {
|
|
196
|
+
// Use transaction's configured nodes if available, otherwise use client network
|
|
197
|
+
const availableNodes =
|
|
198
|
+
this.transactionNodeAccountIds != null &&
|
|
199
|
+
this.transactionNodeAccountIds.length > 0
|
|
200
|
+
? this.transactionNodeAccountIds
|
|
201
|
+
: client._network.getNodeAccountIdsForExecute();
|
|
202
|
+
|
|
203
|
+
// Build node list: [submittedNode, ...otherNodes] without duplicates
|
|
204
|
+
const nodeList = [this.nodeId];
|
|
205
|
+
for (const node of availableNodes) {
|
|
206
|
+
// Only add if it's not the submitting node (avoid duplicates)
|
|
207
|
+
if (!node.equals(this.nodeId)) {
|
|
208
|
+
nodeList.push(node);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
query.setNodeAccountIds(nodeList);
|
|
213
|
+
} else {
|
|
214
|
+
// Default behavior: pin to submitting node only
|
|
215
|
+
query.setNodeAccountIds([this.nodeId]);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return query;
|
|
170
219
|
}
|
|
171
220
|
|
|
172
221
|
/**
|
|
222
|
+
* Create a record query for this transaction.
|
|
223
|
+
*
|
|
224
|
+
* By default, the query is pinned to the submitting node only. If the client has
|
|
225
|
+
* `allowReceiptNodeFailover` enabled, the query can fail over to other nodes while
|
|
226
|
+
* still starting with the submitting node first.
|
|
227
|
+
*
|
|
228
|
+
* When failover is enabled, the node list is determined by:
|
|
229
|
+
* 1. Transaction's configured nodes (if transaction had specific nodes set), or
|
|
230
|
+
* 2. Client's network nodes (as fallback)
|
|
231
|
+
*
|
|
232
|
+
* @param {Client} [client] - Optional client to enable failover behavior
|
|
173
233
|
* @returns {TransactionRecordQuery}
|
|
174
234
|
*/
|
|
175
|
-
getRecordQuery() {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
235
|
+
getRecordQuery(client) {
|
|
236
|
+
const query = new TransactionRecordQuery().setTransactionId(
|
|
237
|
+
this.transactionId,
|
|
238
|
+
);
|
|
239
|
+
|
|
240
|
+
// If client is provided and failover is enabled, construct a node list
|
|
241
|
+
// that starts with the submitting node followed by other nodes
|
|
242
|
+
if (client != null && client.allowReceiptNodeFailover) {
|
|
243
|
+
// Use transaction's configured nodes if available, otherwise use client network
|
|
244
|
+
const availableNodes =
|
|
245
|
+
this.transactionNodeAccountIds != null &&
|
|
246
|
+
this.transactionNodeAccountIds.length > 0
|
|
247
|
+
? this.transactionNodeAccountIds
|
|
248
|
+
: client._network.getNodeAccountIdsForExecute();
|
|
249
|
+
|
|
250
|
+
// Build node list: [submittedNode, ...otherNodes] without duplicates
|
|
251
|
+
const nodeList = [this.nodeId];
|
|
252
|
+
for (const node of availableNodes) {
|
|
253
|
+
// Only add if it's not the submitting node (avoid duplicates)
|
|
254
|
+
if (!node.equals(this.nodeId)) {
|
|
255
|
+
nodeList.push(node);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
query.setNodeAccountIds(nodeList);
|
|
260
|
+
} else {
|
|
261
|
+
// Default behavior: pin to submitting node only
|
|
262
|
+
query.setNodeAccountIds([this.nodeId]);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return query;
|
|
179
266
|
}
|
|
180
267
|
|
|
181
268
|
/**
|