@hiero-ledger/sdk 2.76.0 → 2.78.0-beta.1
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 +6 -6
- package/dist/umd.js +1017 -673
- package/dist/umd.min.js +14 -14
- package/lib/Cache.cjs +6 -6
- package/lib/Cache.d.ts +12 -12
- package/lib/Cache.js.map +1 -1
- package/lib/Duration.cjs +1 -1
- package/lib/Duration.d.ts +2 -2
- package/lib/Duration.js.map +1 -1
- package/lib/EntityIdHelper.cjs +1 -1
- package/lib/EntityIdHelper.js +1 -1
- package/lib/EntityIdHelper.js.map +1 -1
- package/lib/EthereumFlow.cjs +7 -7
- package/lib/EthereumFlow.d.ts +14 -14
- package/lib/EthereumFlow.js.map +1 -1
- package/lib/EthereumTransaction.cjs +7 -7
- package/lib/EthereumTransaction.d.ts +14 -14
- package/lib/EthereumTransaction.js.map +1 -1
- package/lib/EvmAddress.cjs +1 -1
- package/lib/EvmAddress.d.ts +2 -2
- package/lib/EvmAddress.js.map +1 -1
- package/lib/ExchangeRate.cjs +2 -2
- package/lib/ExchangeRate.d.ts +4 -4
- package/lib/ExchangeRate.js.map +1 -1
- package/lib/ExchangeRates.cjs +1 -1
- package/lib/ExchangeRates.d.ts +1 -1
- package/lib/ExchangeRates.js +1 -1
- package/lib/ExchangeRates.js.map +1 -1
- package/lib/Executable.cjs +13 -3
- package/lib/Executable.js +1 -1
- package/lib/Executable.js.map +1 -1
- package/lib/FeeComponents.cjs +1 -1
- package/lib/FeeComponents.d.ts +1 -1
- package/lib/FeeComponents.js +1 -1
- package/lib/FeeComponents.js.map +1 -1
- package/lib/FeeData.cjs +1 -1
- package/lib/FeeData.d.ts +1 -1
- package/lib/FeeData.js +1 -1
- package/lib/FeeData.js.map +1 -1
- package/lib/FeeDataType.cjs +1 -1
- package/lib/FeeDataType.d.ts +2 -2
- package/lib/FeeDataType.js.map +1 -1
- package/lib/FeeSchedule.cjs +1 -1
- package/lib/FeeSchedule.d.ts +1 -1
- package/lib/FeeSchedule.js +1 -1
- package/lib/FeeSchedule.js.map +1 -1
- package/lib/FeeSchedules.cjs +1 -1
- package/lib/FeeSchedules.d.ts +1 -1
- package/lib/FeeSchedules.js +1 -1
- package/lib/FeeSchedules.js.map +1 -1
- package/lib/FreezeType.cjs +1 -1
- package/lib/FreezeType.d.ts +2 -2
- package/lib/FreezeType.js.map +1 -1
- package/lib/Key.cjs +1 -1
- package/lib/Key.d.ts +2 -2
- package/lib/Key.js.map +1 -1
- package/lib/KeyList.cjs +3 -3
- package/lib/KeyList.d.ts +6 -6
- package/lib/KeyList.js.map +1 -1
- package/lib/Mnemonic.cjs +1 -1
- package/lib/Mnemonic.d.ts +1 -1
- package/lib/Mnemonic.js +1 -1
- package/lib/Mnemonic.js.map +1 -1
- package/lib/PrivateKey.cjs +7 -7
- package/lib/PrivateKey.d.ts +11 -11
- package/lib/PrivateKey.js +1 -1
- package/lib/PrivateKey.js.map +1 -1
- package/lib/PrngTransaction.cjs +9 -9
- package/lib/PrngTransaction.d.ts +18 -18
- package/lib/PrngTransaction.js.map +1 -1
- package/lib/PublicKey.cjs +5 -5
- package/lib/PublicKey.d.ts +9 -9
- package/lib/PublicKey.js +1 -1
- package/lib/PublicKey.js.map +1 -1
- package/lib/RequestType.cjs +1 -1
- package/lib/RequestType.d.ts +2 -2
- package/lib/RequestType.js.map +1 -1
- package/lib/StakingInfo.cjs +1 -1
- package/lib/StakingInfo.d.ts +1 -1
- package/lib/StakingInfo.js +1 -1
- package/lib/StakingInfo.js.map +1 -1
- package/lib/Status.cjs +1 -1
- package/lib/Status.d.ts +2 -2
- package/lib/Status.js.map +1 -1
- package/lib/Timestamp.cjs +1 -1
- package/lib/Timestamp.d.ts +1 -1
- package/lib/Timestamp.js.map +1 -1
- package/lib/TransactionFeeSchedule.cjs +1 -1
- package/lib/TransactionFeeSchedule.d.ts +1 -1
- package/lib/TransactionFeeSchedule.js +1 -1
- package/lib/TransactionFeeSchedule.js.map +1 -1
- package/lib/Transfer.cjs +2 -2
- package/lib/Transfer.d.ts +4 -4
- package/lib/Transfer.js.map +1 -1
- package/lib/account/AccountAllowanceAdjustTransaction.cjs +7 -7
- package/lib/account/AccountAllowanceAdjustTransaction.d.ts +14 -14
- package/lib/account/AccountAllowanceAdjustTransaction.js.map +1 -1
- package/lib/account/AccountAllowanceApproveTransaction.cjs +8 -8
- package/lib/account/AccountAllowanceApproveTransaction.d.ts +16 -16
- package/lib/account/AccountAllowanceApproveTransaction.js.map +1 -1
- package/lib/account/AccountAllowanceDeleteTransaction.cjs +7 -7
- package/lib/account/AccountAllowanceDeleteTransaction.d.ts +14 -14
- package/lib/account/AccountAllowanceDeleteTransaction.js.map +1 -1
- package/lib/account/AccountBalance.cjs +1 -1
- package/lib/account/AccountBalance.d.ts +1 -1
- package/lib/account/AccountBalance.js +1 -1
- package/lib/account/AccountBalance.js.map +1 -1
- package/lib/account/AccountBalanceQuery.cjs +6 -6
- package/lib/account/AccountBalanceQuery.d.ts +12 -12
- package/lib/account/AccountBalanceQuery.js.map +1 -1
- package/lib/account/AccountCreateTransaction.cjs +1 -1
- package/lib/account/AccountCreateTransaction.d.ts +1 -1
- package/lib/account/AccountCreateTransaction.js +1 -1
- package/lib/account/AccountCreateTransaction.js.map +1 -1
- package/lib/account/AccountDeleteTransaction.cjs +7 -7
- package/lib/account/AccountDeleteTransaction.d.ts +14 -14
- package/lib/account/AccountDeleteTransaction.js.map +1 -1
- package/lib/account/AccountId.cjs +1 -1
- package/lib/account/AccountId.d.ts +1 -1
- package/lib/account/AccountId.js +1 -1
- package/lib/account/AccountId.js.map +1 -1
- package/lib/account/AccountInfo.cjs +1 -1
- package/lib/account/AccountInfo.d.ts +1 -1
- package/lib/account/AccountInfo.js +1 -1
- package/lib/account/AccountInfo.js.map +1 -1
- package/lib/account/AccountInfoQuery.cjs +7 -7
- package/lib/account/AccountInfoQuery.d.ts +14 -14
- package/lib/account/AccountInfoQuery.js.map +1 -1
- package/lib/account/AccountRecordsQuery.cjs +7 -7
- package/lib/account/AccountRecordsQuery.d.ts +14 -14
- package/lib/account/AccountRecordsQuery.js.map +1 -1
- package/lib/account/AccountUpdateTransaction.cjs +7 -7
- package/lib/account/AccountUpdateTransaction.d.ts +14 -14
- package/lib/account/AccountUpdateTransaction.js.map +1 -1
- package/lib/account/HbarAllowance.cjs +3 -3
- package/lib/account/HbarAllowance.d.ts +6 -6
- package/lib/account/HbarAllowance.js.map +1 -1
- package/lib/account/HbarTransferMap.cjs +2 -2
- package/lib/account/HbarTransferMap.d.ts +4 -4
- package/lib/account/HbarTransferMap.js.map +1 -1
- package/lib/account/LiveHash.cjs +3 -3
- package/lib/account/LiveHash.d.ts +6 -6
- package/lib/account/LiveHash.js.map +1 -1
- package/lib/account/LiveHashAddTransaction.cjs +7 -7
- package/lib/account/LiveHashAddTransaction.d.ts +14 -14
- package/lib/account/LiveHashAddTransaction.js.map +1 -1
- package/lib/account/LiveHashDeleteTransaction.cjs +6 -6
- package/lib/account/LiveHashDeleteTransaction.d.ts +12 -12
- package/lib/account/LiveHashDeleteTransaction.js.map +1 -1
- package/lib/account/LiveHashQuery.cjs +7 -7
- package/lib/account/LiveHashQuery.d.ts +14 -14
- package/lib/account/LiveHashQuery.js.map +1 -1
- package/lib/account/NullableTokenDecimalMap.cjs +2 -2
- package/lib/account/NullableTokenDecimalMap.d.ts +4 -4
- package/lib/account/NullableTokenDecimalMap.js.map +1 -1
- package/lib/account/ProxyStaker.cjs +2 -2
- package/lib/account/ProxyStaker.d.ts +4 -4
- package/lib/account/ProxyStaker.js.map +1 -1
- package/lib/account/TokenAllowance.cjs +4 -4
- package/lib/account/TokenAllowance.d.ts +8 -8
- package/lib/account/TokenAllowance.js.map +1 -1
- package/lib/account/TokenBalanceMap.cjs +2 -2
- package/lib/account/TokenBalanceMap.d.ts +4 -4
- package/lib/account/TokenBalanceMap.js.map +1 -1
- package/lib/account/TokenDecimalMap.cjs +2 -2
- package/lib/account/TokenDecimalMap.d.ts +4 -4
- package/lib/account/TokenDecimalMap.js.map +1 -1
- package/lib/account/TokenNftAllowance.cjs +5 -5
- package/lib/account/TokenNftAllowance.d.ts +10 -10
- package/lib/account/TokenNftAllowance.js.map +1 -1
- package/lib/account/TokenNftTransferMap.cjs +5 -5
- package/lib/account/TokenNftTransferMap.d.ts +10 -10
- package/lib/account/TokenNftTransferMap.js.map +1 -1
- package/lib/account/TokenRelationship.cjs +4 -4
- package/lib/account/TokenRelationship.d.ts +8 -8
- package/lib/account/TokenRelationship.js.map +1 -1
- package/lib/account/TokenRelationshipMap.cjs +2 -2
- package/lib/account/TokenRelationshipMap.d.ts +4 -4
- package/lib/account/TokenRelationshipMap.js.map +1 -1
- package/lib/account/TokenTransferMap.cjs +4 -4
- package/lib/account/TokenTransferMap.d.ts +8 -8
- package/lib/account/TokenTransferMap.js.map +1 -1
- package/lib/account/TransferTransaction.cjs +6 -6
- package/lib/account/TransferTransaction.d.ts +12 -12
- package/lib/account/TransferTransaction.js.map +1 -1
- package/lib/address_book/AddressBooks.cjs +1 -1
- package/lib/address_book/AddressBooks.js +1 -1
- package/lib/address_book/AddressBooks.js.map +1 -1
- package/lib/address_book/Endpoint.cjs +1 -1
- package/lib/address_book/Endpoint.d.ts +2 -2
- package/lib/address_book/Endpoint.js.map +1 -1
- package/lib/address_book/NodeAddress.cjs +1 -1
- package/lib/address_book/NodeAddress.d.ts +2 -2
- package/lib/address_book/NodeAddress.js.map +1 -1
- package/lib/address_book/NodeAddressBook.cjs +1 -1
- package/lib/address_book/NodeAddressBook.d.ts +1 -1
- package/lib/address_book/NodeAddressBook.js +1 -1
- package/lib/address_book/NodeAddressBook.js.map +1 -1
- package/lib/browser.js +1 -1
- package/lib/channel/Channel.cjs +26 -2
- package/lib/channel/Channel.d.ts +21 -1
- package/lib/channel/Channel.js +1 -1
- package/lib/channel/Channel.js.map +1 -1
- package/lib/channel/NativeChannel.cjs +96 -2
- package/lib/channel/NativeChannel.d.ts +21 -1
- package/lib/channel/NativeChannel.js +1 -1
- package/lib/channel/NativeChannel.js.map +1 -1
- package/lib/channel/NodeChannel.cjs +4 -5
- package/lib/channel/NodeChannel.d.ts +2 -3
- package/lib/channel/NodeChannel.js +1 -1
- package/lib/channel/NodeChannel.js.map +1 -1
- package/lib/channel/WebChannel.cjs +163 -13
- package/lib/channel/WebChannel.d.ts +51 -1
- package/lib/channel/WebChannel.js +1 -1
- package/lib/channel/WebChannel.js.map +1 -1
- package/lib/client/Client.cjs +62 -5
- package/lib/client/Client.d.ts +26 -3
- package/lib/client/Client.js +1 -1
- package/lib/client/Client.js.map +1 -1
- package/lib/client/NativeClient.cjs +1 -1
- package/lib/client/NativeClient.js +1 -1
- package/lib/client/NativeClient.js.map +1 -1
- package/lib/client/NodeClient.cjs +7 -6
- package/lib/client/NodeClient.d.ts +3 -3
- package/lib/client/NodeClient.js +1 -1
- package/lib/client/NodeClient.js.map +1 -1
- package/lib/client/WebClient.cjs +55 -27
- package/lib/client/WebClient.d.ts +6 -0
- package/lib/client/WebClient.js +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.cjs +17 -1
- package/lib/constants/ClientConstants.d.ts +14 -0
- package/lib/constants/ClientConstants.js +1 -1
- package/lib/constants/ClientConstants.js.map +1 -1
- package/lib/contract/ContractByteCodeQuery.cjs +6 -6
- package/lib/contract/ContractByteCodeQuery.d.ts +12 -12
- package/lib/contract/ContractByteCodeQuery.js.map +1 -1
- package/lib/contract/ContractCallQuery.cjs +1 -1
- package/lib/contract/ContractCallQuery.d.ts +1 -1
- package/lib/contract/ContractCallQuery.js +1 -1
- package/lib/contract/ContractCallQuery.js.map +1 -1
- package/lib/contract/ContractCreateTransaction.cjs +8 -8
- package/lib/contract/ContractCreateTransaction.d.ts +16 -16
- package/lib/contract/ContractCreateTransaction.js.map +1 -1
- package/lib/contract/ContractDeleteTransaction.cjs +8 -8
- package/lib/contract/ContractDeleteTransaction.d.ts +16 -16
- package/lib/contract/ContractDeleteTransaction.js.map +1 -1
- package/lib/contract/ContractExecuteTransaction.cjs +9 -9
- package/lib/contract/ContractExecuteTransaction.d.ts +18 -18
- package/lib/contract/ContractExecuteTransaction.js.map +1 -1
- package/lib/contract/ContractFunctionResult.cjs +2 -2
- package/lib/contract/ContractFunctionResult.d.ts +4 -4
- package/lib/contract/ContractFunctionResult.js.map +1 -1
- package/lib/contract/ContractId.cjs +1 -1
- package/lib/contract/ContractId.d.ts +1 -1
- package/lib/contract/ContractId.js +1 -1
- package/lib/contract/ContractId.js.map +1 -1
- package/lib/contract/ContractInfo.cjs +1 -1
- package/lib/contract/ContractInfo.d.ts +1 -1
- package/lib/contract/ContractInfo.js +1 -1
- package/lib/contract/ContractInfo.js.map +1 -1
- package/lib/contract/ContractInfoQuery.cjs +7 -7
- package/lib/contract/ContractInfoQuery.d.ts +14 -14
- package/lib/contract/ContractInfoQuery.js.map +1 -1
- package/lib/contract/ContractLogInfo.cjs +2 -2
- package/lib/contract/ContractLogInfo.d.ts +4 -4
- package/lib/contract/ContractLogInfo.js.map +1 -1
- package/lib/contract/ContractNonceInfo.cjs +3 -3
- package/lib/contract/ContractNonceInfo.d.ts +4 -4
- package/lib/contract/ContractNonceInfo.js +1 -1
- package/lib/contract/ContractNonceInfo.js.map +1 -1
- package/lib/contract/ContractStateChange.cjs +1 -1
- package/lib/contract/ContractStateChange.d.ts +1 -1
- package/lib/contract/ContractUpdateTransaction.cjs +10 -10
- package/lib/contract/ContractUpdateTransaction.d.ts +18 -18
- package/lib/contract/ContractUpdateTransaction.js +1 -1
- package/lib/contract/ContractUpdateTransaction.js.map +1 -1
- package/lib/contract/DelegateContractId.cjs +2 -2
- package/lib/contract/DelegateContractId.d.ts +4 -4
- package/lib/contract/DelegateContractId.js.map +1 -1
- package/lib/contract/StorageChange.cjs +1 -1
- package/lib/contract/StorageChange.d.ts +1 -1
- package/lib/exports.cjs +1 -1
- package/lib/exports.d.ts +1 -1
- package/lib/exports.js +1 -1
- package/lib/exports.js.map +1 -1
- package/lib/file/FileAppendTransaction.cjs +7 -7
- package/lib/file/FileAppendTransaction.d.ts +14 -14
- package/lib/file/FileAppendTransaction.js.map +1 -1
- package/lib/file/FileContentsQuery.cjs +7 -7
- package/lib/file/FileContentsQuery.d.ts +14 -14
- package/lib/file/FileContentsQuery.js.map +1 -1
- package/lib/file/FileCreateTransaction.cjs +6 -6
- package/lib/file/FileCreateTransaction.d.ts +12 -12
- package/lib/file/FileCreateTransaction.js.map +1 -1
- package/lib/file/FileDeleteTransaction.cjs +7 -7
- package/lib/file/FileDeleteTransaction.d.ts +14 -14
- package/lib/file/FileDeleteTransaction.js.map +1 -1
- package/lib/file/FileId.cjs +1 -1
- package/lib/file/FileId.d.ts +1 -1
- package/lib/file/FileId.js +1 -1
- package/lib/file/FileId.js.map +1 -1
- package/lib/file/FileInfo.cjs +1 -1
- package/lib/file/FileInfo.d.ts +1 -1
- package/lib/file/FileInfo.js +1 -1
- package/lib/file/FileInfo.js.map +1 -1
- package/lib/file/FileInfoQuery.cjs +7 -7
- package/lib/file/FileInfoQuery.d.ts +14 -14
- package/lib/file/FileInfoQuery.js.map +1 -1
- package/lib/file/FileUpdateTransaction.cjs +6 -6
- package/lib/file/FileUpdateTransaction.d.ts +12 -12
- package/lib/file/FileUpdateTransaction.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/native.js +1 -1
- package/lib/network/AddressBookQuery.cjs +1 -5
- package/lib/network/AddressBookQuery.js +1 -1
- package/lib/network/AddressBookQuery.js.map +1 -1
- package/lib/network/AddressBookQueryWeb.cjs +1 -5
- package/lib/network/AddressBookQueryWeb.js +1 -1
- package/lib/network/AddressBookQueryWeb.js.map +1 -1
- package/lib/network/NetworkVersionInfo.cjs +1 -1
- package/lib/network/NetworkVersionInfo.d.ts +1 -1
- package/lib/network/NetworkVersionInfo.js +1 -1
- package/lib/network/NetworkVersionInfo.js.map +1 -1
- package/lib/network/NetworkVersionInfoQuery.cjs +6 -6
- package/lib/network/NetworkVersionInfoQuery.d.ts +12 -12
- package/lib/network/NetworkVersionInfoQuery.js.map +1 -1
- package/lib/network/SemanticVersion.cjs +1 -1
- package/lib/network/SemanticVersion.d.ts +1 -1
- package/lib/network/SemanticVersion.js +1 -1
- package/lib/network/SemanticVersion.js.map +1 -1
- package/lib/node/NodeCreateTransaction.cjs +6 -6
- package/lib/node/NodeCreateTransaction.d.ts +12 -12
- package/lib/node/NodeCreateTransaction.js.map +1 -1
- package/lib/node/NodeDeleteTransaction.cjs +6 -6
- package/lib/node/NodeDeleteTransaction.d.ts +12 -12
- package/lib/node/NodeDeleteTransaction.js.map +1 -1
- package/lib/node/NodeUpdateTransaction.cjs +6 -6
- package/lib/node/NodeUpdateTransaction.d.ts +12 -12
- package/lib/node/NodeUpdateTransaction.js.map +1 -1
- package/lib/node/ServiceEndpoint.cjs +1 -1
- package/lib/node/ServiceEndpoint.d.ts +2 -2
- package/lib/node/ServiceEndpoint.js.map +1 -1
- package/lib/query/CostQuery.cjs +1 -1
- package/lib/query/CostQuery.d.ts +1 -1
- package/lib/query/CostQuery.js +1 -1
- package/lib/query/CostQuery.js.map +1 -1
- package/lib/query/Query.cjs +1 -1
- package/lib/query/Query.d.ts +1 -1
- package/lib/query/Query.js +1 -1
- package/lib/query/Query.js.map +1 -1
- package/lib/query/QueryBase.cjs +1 -1
- package/lib/query/QueryBase.d.ts +1 -1
- package/lib/query/QueryBase.js +1 -1
- package/lib/query/QueryBase.js.map +1 -1
- package/lib/schedule/ScheduleCreateTransaction.cjs +1 -1
- package/lib/schedule/ScheduleCreateTransaction.d.ts +1 -1
- package/lib/schedule/ScheduleCreateTransaction.js +1 -1
- package/lib/schedule/ScheduleCreateTransaction.js.map +1 -1
- package/lib/schedule/ScheduleDeleteTransaction.cjs +8 -8
- package/lib/schedule/ScheduleDeleteTransaction.d.ts +16 -16
- package/lib/schedule/ScheduleDeleteTransaction.js.map +1 -1
- package/lib/schedule/ScheduleId.cjs +1 -1
- package/lib/schedule/ScheduleId.d.ts +1 -1
- package/lib/schedule/ScheduleId.js +1 -1
- package/lib/schedule/ScheduleId.js.map +1 -1
- package/lib/schedule/ScheduleInfo.cjs +1 -1
- package/lib/schedule/ScheduleInfo.d.ts +1 -1
- package/lib/schedule/ScheduleInfo.js +1 -1
- package/lib/schedule/ScheduleInfo.js.map +1 -1
- package/lib/schedule/ScheduleInfoQuery.cjs +7 -7
- package/lib/schedule/ScheduleInfoQuery.d.ts +14 -14
- package/lib/schedule/ScheduleInfoQuery.js.map +1 -1
- package/lib/schedule/ScheduleSignTransaction.cjs +10 -10
- package/lib/schedule/ScheduleSignTransaction.d.ts +20 -20
- package/lib/schedule/ScheduleSignTransaction.js.map +1 -1
- package/lib/system/FreezeTransaction.cjs +6 -6
- package/lib/system/FreezeTransaction.d.ts +12 -12
- package/lib/system/FreezeTransaction.js.map +1 -1
- package/lib/system/SystemDeleteTransaction.cjs +8 -8
- package/lib/system/SystemDeleteTransaction.d.ts +16 -16
- package/lib/system/SystemDeleteTransaction.js.map +1 -1
- package/lib/system/SystemUndeleteTransaction.cjs +8 -8
- package/lib/system/SystemUndeleteTransaction.d.ts +16 -16
- package/lib/system/SystemUndeleteTransaction.js.map +1 -1
- package/lib/token/AbstractTokenTransferTransaction.cjs +1 -1
- package/lib/token/AbstractTokenTransferTransaction.d.ts +2 -2
- package/lib/token/AbstractTokenTransferTransaction.js.map +1 -1
- package/lib/token/AssessedCustomFee.cjs +1 -1
- package/lib/token/AssessedCustomFee.d.ts +2 -2
- package/lib/token/AssessedCustomFee.js.map +1 -1
- package/lib/token/CustomFee.cjs +1 -1
- package/lib/token/CustomFee.d.ts +2 -2
- package/lib/token/CustomFee.js.map +1 -1
- package/lib/token/CustomFixedFee.cjs +3 -3
- package/lib/token/CustomFixedFee.d.ts +6 -6
- package/lib/token/CustomFixedFee.js.map +1 -1
- package/lib/token/CustomFractionalFee.cjs +3 -3
- package/lib/token/CustomFractionalFee.d.ts +6 -6
- package/lib/token/CustomFractionalFee.js.map +1 -1
- package/lib/token/CustomRoyaltyFee.cjs +4 -4
- package/lib/token/CustomRoyaltyFee.d.ts +8 -8
- package/lib/token/CustomRoyaltyFee.js.map +1 -1
- package/lib/token/NftId.cjs +1 -1
- package/lib/token/NftId.d.ts +1 -1
- package/lib/token/NftId.js +1 -1
- package/lib/token/NftId.js.map +1 -1
- package/lib/token/PendingAirdropId.cjs +1 -1
- package/lib/token/PendingAirdropId.d.ts +1 -1
- package/lib/token/PendingAirdropId.js.map +1 -1
- package/lib/token/PendingAirdropRecord.cjs +1 -1
- package/lib/token/PendingAirdropRecord.d.ts +1 -1
- package/lib/token/PendingAirdropRecord.js.map +1 -1
- package/lib/token/TokenAirdropTransaction.cjs +8 -8
- package/lib/token/TokenAirdropTransaction.d.ts +16 -16
- package/lib/token/TokenAirdropTransaction.js.map +1 -1
- package/lib/token/TokenAssociateTransaction.cjs +7 -7
- package/lib/token/TokenAssociateTransaction.d.ts +14 -14
- package/lib/token/TokenAssociateTransaction.js.map +1 -1
- package/lib/token/TokenAssociation.cjs +1 -1
- package/lib/token/TokenAssociation.d.ts +2 -2
- package/lib/token/TokenAssociation.js.map +1 -1
- package/lib/token/TokenBurnTransaction.cjs +7 -7
- package/lib/token/TokenBurnTransaction.d.ts +14 -14
- package/lib/token/TokenBurnTransaction.js.map +1 -1
- package/lib/token/TokenCancelAirdropTransaction.cjs +6 -6
- package/lib/token/TokenCancelAirdropTransaction.d.ts +12 -12
- package/lib/token/TokenCancelAirdropTransaction.js.map +1 -1
- package/lib/token/TokenClaimAirdropTransaction.cjs +6 -6
- package/lib/token/TokenClaimAirdropTransaction.d.ts +12 -12
- package/lib/token/TokenClaimAirdropTransaction.js.map +1 -1
- package/lib/token/TokenCreateTransaction.cjs +7 -7
- package/lib/token/TokenCreateTransaction.d.ts +14 -14
- package/lib/token/TokenCreateTransaction.js.map +1 -1
- package/lib/token/TokenDeleteTransaction.cjs +7 -7
- package/lib/token/TokenDeleteTransaction.d.ts +14 -14
- package/lib/token/TokenDeleteTransaction.js.map +1 -1
- package/lib/token/TokenDissociateTransaction.cjs +7 -7
- package/lib/token/TokenDissociateTransaction.d.ts +14 -14
- package/lib/token/TokenDissociateTransaction.js.map +1 -1
- package/lib/token/TokenFeeScheduleUpdateTransaction.cjs +7 -7
- package/lib/token/TokenFeeScheduleUpdateTransaction.d.ts +14 -14
- package/lib/token/TokenFeeScheduleUpdateTransaction.js.map +1 -1
- package/lib/token/TokenFreezeTransaction.cjs +7 -7
- package/lib/token/TokenFreezeTransaction.d.ts +14 -14
- package/lib/token/TokenFreezeTransaction.js.map +1 -1
- package/lib/token/TokenGrantKycTransaction.cjs +7 -7
- package/lib/token/TokenGrantKycTransaction.d.ts +14 -14
- package/lib/token/TokenGrantKycTransaction.js.map +1 -1
- package/lib/token/TokenId.cjs +1 -1
- package/lib/token/TokenId.d.ts +1 -1
- package/lib/token/TokenId.js +1 -1
- package/lib/token/TokenId.js.map +1 -1
- package/lib/token/TokenInfo.cjs +1 -1
- package/lib/token/TokenInfo.d.ts +1 -1
- package/lib/token/TokenInfo.js +1 -1
- package/lib/token/TokenInfo.js.map +1 -1
- package/lib/token/TokenInfoQuery.cjs +7 -7
- package/lib/token/TokenInfoQuery.d.ts +14 -14
- package/lib/token/TokenInfoQuery.js.map +1 -1
- package/lib/token/TokenKeyValidation.cjs +1 -1
- package/lib/token/TokenKeyValidation.d.ts +2 -2
- package/lib/token/TokenKeyValidation.js.map +1 -1
- package/lib/token/TokenMintTransaction.cjs +7 -7
- package/lib/token/TokenMintTransaction.d.ts +14 -14
- package/lib/token/TokenMintTransaction.js.map +1 -1
- package/lib/token/TokenNftInfo.cjs +10 -10
- package/lib/token/TokenNftInfo.d.ts +20 -20
- package/lib/token/TokenNftInfo.js.map +1 -1
- package/lib/token/TokenNftInfoQuery.cjs +11 -11
- package/lib/token/TokenNftInfoQuery.d.ts +22 -22
- package/lib/token/TokenNftInfoQuery.js.map +1 -1
- package/lib/token/TokenNftTransfer.cjs +5 -5
- package/lib/token/TokenNftTransfer.d.ts +10 -10
- package/lib/token/TokenNftTransfer.js.map +1 -1
- package/lib/token/TokenNftsUpdateTransaction.cjs +7 -7
- package/lib/token/TokenNftsUpdateTransaction.d.ts +14 -14
- package/lib/token/TokenPauseTransaction.cjs +7 -7
- package/lib/token/TokenPauseTransaction.d.ts +14 -14
- package/lib/token/TokenPauseTransaction.js.map +1 -1
- package/lib/token/TokenReference.cjs +1 -1
- package/lib/token/TokenReference.d.ts +2 -2
- package/lib/token/TokenReference.js.map +1 -1
- package/lib/token/TokenRejectTransaction.cjs +7 -7
- package/lib/token/TokenRejectTransaction.d.ts +14 -14
- package/lib/token/TokenRejectTransaction.js.map +1 -1
- package/lib/token/TokenRevokeKycTransaction.cjs +7 -7
- package/lib/token/TokenRevokeKycTransaction.d.ts +14 -14
- package/lib/token/TokenRevokeKycTransaction.js.map +1 -1
- package/lib/token/TokenSupplyType.cjs +1 -1
- package/lib/token/TokenSupplyType.d.ts +2 -2
- package/lib/token/TokenSupplyType.js.map +1 -1
- package/lib/token/TokenTransfer.cjs +4 -4
- package/lib/token/TokenTransfer.d.ts +8 -8
- package/lib/token/TokenTransfer.js.map +1 -1
- package/lib/token/TokenType.cjs +1 -1
- package/lib/token/TokenType.d.ts +2 -2
- package/lib/token/TokenType.js.map +1 -1
- package/lib/token/TokenUnfreezeTransaction.cjs +7 -7
- package/lib/token/TokenUnfreezeTransaction.d.ts +14 -14
- package/lib/token/TokenUnfreezeTransaction.js.map +1 -1
- package/lib/token/TokenUnpauseTransaction.cjs +7 -7
- package/lib/token/TokenUnpauseTransaction.d.ts +14 -14
- package/lib/token/TokenUnpauseTransaction.js.map +1 -1
- package/lib/token/TokenUpdateNftsTransaction.cjs +7 -7
- package/lib/token/TokenUpdateNftsTransaction.d.ts +14 -14
- package/lib/token/TokenUpdateNftsTransaction.js.map +1 -1
- package/lib/token/TokenUpdateTransaction.cjs +7 -7
- package/lib/token/TokenUpdateTransaction.d.ts +14 -14
- package/lib/token/TokenUpdateTransaction.js.map +1 -1
- package/lib/token/TokenWipeTransaction.cjs +7 -7
- package/lib/token/TokenWipeTransaction.d.ts +14 -14
- package/lib/token/TokenWipeTransaction.js.map +1 -1
- package/lib/topic/TopicCreateTransaction.cjs +6 -6
- package/lib/topic/TopicCreateTransaction.d.ts +12 -12
- package/lib/topic/TopicCreateTransaction.js.map +1 -1
- package/lib/topic/TopicDeleteTransaction.cjs +6 -6
- package/lib/topic/TopicDeleteTransaction.d.ts +12 -12
- package/lib/topic/TopicDeleteTransaction.js.map +1 -1
- package/lib/topic/TopicId.cjs +1 -1
- package/lib/topic/TopicId.d.ts +1 -1
- package/lib/topic/TopicId.js +1 -1
- package/lib/topic/TopicId.js.map +1 -1
- package/lib/topic/TopicInfo.cjs +1 -1
- package/lib/topic/TopicInfo.d.ts +1 -1
- package/lib/topic/TopicInfo.js +1 -1
- package/lib/topic/TopicInfo.js.map +1 -1
- package/lib/topic/TopicInfoQuery.cjs +7 -7
- package/lib/topic/TopicInfoQuery.d.ts +14 -14
- package/lib/topic/TopicInfoQuery.js.map +1 -1
- package/lib/topic/TopicMessage.cjs +2 -2
- package/lib/topic/TopicMessage.d.ts +4 -4
- package/lib/topic/TopicMessage.js.map +1 -1
- package/lib/topic/TopicMessageChunk.cjs +2 -2
- package/lib/topic/TopicMessageChunk.d.ts +4 -4
- package/lib/topic/TopicMessageChunk.js.map +1 -1
- package/lib/topic/TopicMessageQuery.cjs +1 -1
- package/lib/topic/TopicMessageQuery.js +1 -1
- package/lib/topic/TopicMessageQuery.js.map +1 -1
- package/lib/topic/TopicMessageSubmitTransaction.cjs +9 -9
- package/lib/topic/TopicMessageSubmitTransaction.d.ts +18 -18
- package/lib/topic/TopicMessageSubmitTransaction.js.map +1 -1
- package/lib/topic/TopicUpdateTransaction.cjs +6 -6
- package/lib/topic/TopicUpdateTransaction.d.ts +12 -12
- package/lib/topic/TopicUpdateTransaction.js.map +1 -1
- package/lib/transaction/BatchTransaction.cjs +5 -5
- package/lib/transaction/BatchTransaction.d.ts +9 -9
- package/lib/transaction/BatchTransaction.js +1 -1
- package/lib/transaction/BatchTransaction.js.map +1 -1
- package/lib/transaction/CustomFeeLimit.cjs +2 -2
- package/lib/transaction/CustomFeeLimit.d.ts +4 -4
- package/lib/transaction/CustomFeeLimit.js.map +1 -1
- package/lib/transaction/NodeAccountIdSignatureMap.cjs +2 -2
- package/lib/transaction/NodeAccountIdSignatureMap.d.ts +2 -2
- package/lib/transaction/NodeAccountIdSignatureMap.js +1 -1
- package/lib/transaction/NodeAccountIdSignatureMap.js.map +1 -1
- package/lib/transaction/NodeAccountIdSignatureMapLegacy.cjs +1 -1
- package/lib/transaction/NodeAccountIdSignatureMapLegacy.d.ts +2 -2
- package/lib/transaction/NodeAccountIdSignatureMapLegacy.js.map +1 -1
- package/lib/transaction/SignatureMap.cjs +1 -1
- package/lib/transaction/SignatureMap.js.map +1 -1
- package/lib/transaction/SignaturePairMap.cjs +1 -1
- package/lib/transaction/SignaturePairMap.d.ts +2 -2
- package/lib/transaction/SignaturePairMap.js.map +1 -1
- package/lib/transaction/Transaction.cjs +1 -1
- package/lib/transaction/Transaction.d.ts +1 -1
- package/lib/transaction/Transaction.js +1 -1
- package/lib/transaction/Transaction.js.map +1 -1
- package/lib/transaction/TransactionHashMap.cjs +1 -1
- package/lib/transaction/TransactionHashMap.d.ts +2 -2
- package/lib/transaction/TransactionHashMap.js.map +1 -1
- package/lib/transaction/TransactionId.cjs +1 -1
- package/lib/transaction/TransactionId.d.ts +1 -1
- package/lib/transaction/TransactionId.js +1 -1
- package/lib/transaction/TransactionId.js.map +1 -1
- package/lib/transaction/TransactionReceipt.cjs +1 -1
- package/lib/transaction/TransactionReceipt.d.ts +1 -1
- package/lib/transaction/TransactionReceipt.js +1 -1
- package/lib/transaction/TransactionReceipt.js.map +1 -1
- package/lib/transaction/TransactionReceiptQuery.cjs +1 -1
- package/lib/transaction/TransactionReceiptQuery.d.ts +1 -1
- package/lib/transaction/TransactionReceiptQuery.js +1 -1
- package/lib/transaction/TransactionReceiptQuery.js.map +1 -1
- package/lib/transaction/TransactionRecord.cjs +1 -1
- package/lib/transaction/TransactionRecord.d.ts +1 -1
- package/lib/transaction/TransactionRecord.js +1 -1
- package/lib/transaction/TransactionRecord.js.map +1 -1
- package/lib/transaction/TransactionRecordQuery.cjs +1 -1
- package/lib/transaction/TransactionRecordQuery.d.ts +1 -1
- package/lib/transaction/TransactionRecordQuery.js +1 -1
- package/lib/transaction/TransactionRecordQuery.js.map +1 -1
- package/lib/util/ASN1-Decoder.cjs +1 -1
- package/lib/util/ASN1-Decoder.js +1 -1
- package/lib/util/ASN1-Decoder.js.map +1 -1
- package/lib/version.js +1 -1
- package/package.json +6 -8
- package/src/Cache.js +6 -6
- package/src/Duration.js +1 -1
- package/src/EntityIdHelper.js +1 -1
- package/src/EthereumFlow.js +7 -7
- package/src/EthereumTransaction.js +7 -7
- package/src/EvmAddress.js +1 -1
- package/src/ExchangeRate.js +2 -2
- package/src/ExchangeRates.js +1 -1
- package/src/Executable.js +18 -2
- package/src/FeeComponents.js +1 -1
- package/src/FeeData.js +1 -1
- package/src/FeeDataType.js +1 -1
- package/src/FeeSchedule.js +1 -1
- package/src/FeeSchedules.js +1 -1
- package/src/FreezeType.js +1 -1
- package/src/Key.js +1 -1
- package/src/KeyList.js +3 -3
- package/src/Mnemonic.js +1 -1
- package/src/PrivateKey.js +7 -7
- package/src/PrngTransaction.js +9 -9
- package/src/PublicKey.js +5 -5
- package/src/RequestType.js +1 -1
- package/src/StakingInfo.js +1 -1
- package/src/Status.js +1 -1
- package/src/Timestamp.js +1 -1
- package/src/TransactionFeeSchedule.js +1 -1
- package/src/Transfer.js +2 -2
- package/src/account/AccountAllowanceAdjustTransaction.js +7 -7
- package/src/account/AccountAllowanceApproveTransaction.js +8 -8
- package/src/account/AccountAllowanceDeleteTransaction.js +7 -7
- package/src/account/AccountBalance.js +1 -1
- package/src/account/AccountBalanceQuery.js +6 -6
- package/src/account/AccountCreateTransaction.js +1 -1
- package/src/account/AccountDeleteTransaction.js +7 -7
- package/src/account/AccountId.js +1 -1
- package/src/account/AccountInfo.js +1 -1
- package/src/account/AccountInfoQuery.js +7 -7
- package/src/account/AccountRecordsQuery.js +7 -7
- package/src/account/AccountUpdateTransaction.js +7 -7
- package/src/account/HbarAllowance.js +3 -3
- package/src/account/HbarTransferMap.js +2 -2
- package/src/account/LiveHash.js +3 -3
- package/src/account/LiveHashAddTransaction.js +7 -7
- package/src/account/LiveHashDeleteTransaction.js +6 -6
- package/src/account/LiveHashQuery.js +7 -7
- package/src/account/NullableTokenDecimalMap.js +2 -2
- package/src/account/ProxyStaker.js +2 -2
- package/src/account/TokenAllowance.js +4 -4
- package/src/account/TokenBalanceMap.js +2 -2
- package/src/account/TokenDecimalMap.js +2 -2
- package/src/account/TokenNftAllowance.js +5 -5
- package/src/account/TokenNftTransferMap.js +5 -5
- package/src/account/TokenRelationship.js +4 -4
- package/src/account/TokenRelationshipMap.js +2 -2
- package/src/account/TokenTransferMap.js +4 -4
- package/src/account/TransferTransaction.js +6 -6
- package/src/address_book/AddressBooks.js +1 -1
- package/src/address_book/Endpoint.js +1 -1
- package/src/address_book/NodeAddress.js +1 -1
- package/src/address_book/NodeAddressBook.js +1 -1
- package/src/channel/Channel.js +26 -2
- package/src/channel/NativeChannel.js +111 -2
- package/src/channel/NodeChannel.js +4 -7
- package/src/channel/WebChannel.js +189 -21
- package/src/client/Client.js +79 -5
- package/src/client/NativeClient.js +1 -1
- package/src/client/NodeClient.js +7 -6
- package/src/client/WebClient.js +64 -31
- 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 +16 -0
- package/src/contract/ContractByteCodeQuery.js +6 -6
- package/src/contract/ContractCallQuery.js +1 -1
- package/src/contract/ContractCreateTransaction.js +8 -8
- package/src/contract/ContractDeleteTransaction.js +8 -8
- package/src/contract/ContractExecuteTransaction.js +9 -9
- package/src/contract/ContractFunctionResult.js +2 -2
- package/src/contract/ContractId.js +1 -1
- package/src/contract/ContractInfo.js +1 -1
- package/src/contract/ContractInfoQuery.js +7 -7
- package/src/contract/ContractLogInfo.js +2 -2
- package/src/contract/ContractNonceInfo.js +3 -3
- package/src/contract/ContractStateChange.js +1 -1
- package/src/contract/ContractUpdateTransaction.js +10 -10
- package/src/contract/DelegateContractId.js +2 -2
- package/src/contract/StorageChange.js +1 -1
- package/src/exports.js +1 -1
- package/src/file/FileAppendTransaction.js +7 -7
- package/src/file/FileContentsQuery.js +7 -7
- package/src/file/FileCreateTransaction.js +6 -6
- package/src/file/FileDeleteTransaction.js +7 -7
- package/src/file/FileId.js +1 -1
- package/src/file/FileInfo.js +1 -1
- package/src/file/FileInfoQuery.js +7 -7
- package/src/file/FileUpdateTransaction.js +6 -6
- package/src/network/AddressBookQuery.js +1 -8
- package/src/network/AddressBookQueryWeb.js +1 -8
- package/src/network/NetworkVersionInfo.js +1 -1
- package/src/network/NetworkVersionInfoQuery.js +6 -6
- package/src/network/SemanticVersion.js +1 -1
- package/src/node/NodeCreateTransaction.js +6 -6
- package/src/node/NodeDeleteTransaction.js +6 -6
- package/src/node/NodeUpdateTransaction.js +6 -6
- package/src/node/ServiceEndpoint.js +1 -1
- package/src/query/CostQuery.js +1 -1
- package/src/query/Query.js +1 -1
- package/src/query/QueryBase.js +1 -1
- package/src/schedule/ScheduleCreateTransaction.js +1 -1
- package/src/schedule/ScheduleDeleteTransaction.js +8 -8
- package/src/schedule/ScheduleId.js +1 -1
- package/src/schedule/ScheduleInfo.js +1 -1
- package/src/schedule/ScheduleInfoQuery.js +7 -7
- package/src/schedule/ScheduleSignTransaction.js +10 -10
- package/src/system/FreezeTransaction.js +6 -6
- package/src/system/SystemDeleteTransaction.js +8 -8
- package/src/system/SystemUndeleteTransaction.js +8 -8
- package/src/token/AbstractTokenTransferTransaction.js +1 -1
- package/src/token/AssessedCustomFee.js +1 -1
- package/src/token/CustomFee.js +1 -1
- package/src/token/CustomFixedFee.js +3 -3
- package/src/token/CustomFractionalFee.js +3 -3
- package/src/token/CustomRoyaltyFee.js +4 -4
- package/src/token/NftId.js +1 -1
- package/src/token/PendingAirdropId.js +1 -1
- package/src/token/PendingAirdropRecord.js +1 -1
- package/src/token/TokenAirdropTransaction.js +8 -8
- package/src/token/TokenAssociateTransaction.js +7 -7
- package/src/token/TokenAssociation.js +1 -1
- package/src/token/TokenBurnTransaction.js +7 -7
- package/src/token/TokenCancelAirdropTransaction.js +6 -6
- package/src/token/TokenClaimAirdropTransaction.js +6 -6
- package/src/token/TokenCreateTransaction.js +7 -7
- package/src/token/TokenDeleteTransaction.js +7 -7
- package/src/token/TokenDissociateTransaction.js +7 -7
- package/src/token/TokenFeeScheduleUpdateTransaction.js +7 -7
- package/src/token/TokenFreezeTransaction.js +7 -7
- package/src/token/TokenGrantKycTransaction.js +7 -7
- package/src/token/TokenId.js +1 -1
- package/src/token/TokenInfo.js +1 -1
- package/src/token/TokenInfoQuery.js +7 -7
- package/src/token/TokenKeyValidation.js +1 -1
- package/src/token/TokenMintTransaction.js +7 -7
- package/src/token/TokenNftInfo.js +10 -10
- package/src/token/TokenNftInfoQuery.js +11 -11
- package/src/token/TokenNftTransfer.js +5 -5
- package/src/token/TokenNftsUpdateTransaction.js +7 -7
- package/src/token/TokenPauseTransaction.js +7 -7
- package/src/token/TokenReference.js +1 -1
- package/src/token/TokenRejectTransaction.js +7 -7
- package/src/token/TokenRevokeKycTransaction.js +7 -7
- package/src/token/TokenSupplyType.js +1 -1
- package/src/token/TokenTransfer.js +4 -4
- package/src/token/TokenType.js +1 -1
- package/src/token/TokenUnfreezeTransaction.js +7 -7
- package/src/token/TokenUnpauseTransaction.js +7 -7
- package/src/token/TokenUpdateNftsTransaction.js +7 -7
- package/src/token/TokenUpdateTransaction.js +7 -7
- package/src/token/TokenWipeTransaction.js +7 -7
- package/src/topic/TopicCreateTransaction.js +6 -6
- package/src/topic/TopicDeleteTransaction.js +6 -6
- package/src/topic/TopicId.js +1 -1
- package/src/topic/TopicInfo.js +1 -1
- package/src/topic/TopicInfoQuery.js +7 -7
- package/src/topic/TopicMessage.js +2 -2
- package/src/topic/TopicMessageChunk.js +2 -2
- package/src/topic/TopicMessageQuery.js +1 -1
- package/src/topic/TopicMessageSubmitTransaction.js +9 -9
- package/src/topic/TopicUpdateTransaction.js +6 -6
- package/src/transaction/BatchTransaction.js +5 -5
- package/src/transaction/CustomFeeLimit.js +2 -2
- package/src/transaction/NodeAccountIdSignatureMap.js +2 -2
- package/src/transaction/NodeAccountIdSignatureMapLegacy.js +1 -1
- package/src/transaction/SignatureMap.js +1 -1
- package/src/transaction/SignaturePairMap.js +1 -1
- package/src/transaction/Transaction.js +1 -1
- package/src/transaction/TransactionHashMap.js +1 -1
- package/src/transaction/TransactionId.js +1 -1
- package/src/transaction/TransactionReceipt.js +1 -1
- package/src/transaction/TransactionReceiptQuery.js +1 -1
- package/src/transaction/TransactionRecord.js +1 -1
- package/src/transaction/TransactionRecordQuery.js +1 -1
- package/src/util/ASN1-Decoder.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumTransaction.js","sources":["../src/EthereumTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Hbar from \"./Hbar.js\";\nimport FileId from \"./file/FileId.js\";\nimport Transaction, {\n TRANSACTION_REGISTRY,\n} from \"./transaction/Transaction.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hashgraph/proto\").proto.ITransaction} HieroProto.proto.ITransaction\n * @typedef {import(\"@hashgraph/proto\").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction\n * @typedef {import(\"@hashgraph/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n * @typedef {import(\"@hashgraph/proto\").proto.IEthereumTransactionBody} HieroProto.proto.IEthereumTransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.IAccountID} HieroProto.proto.IAccountID\n */\n\n/**\n * @typedef {import(\"bignumber.js\").default} BigNumber\n * @typedef {import(\"./account/AccountId.js\").default} AccountId\n * @typedef {import(\"./channel/Channel.js\").default} Channel\n * @typedef {import(\"./client/Client.js\").default<*, *>} Client\n * @typedef {import(\"./Timestamp.js\").default} Timestamp\n * @typedef {import(\"./transaction/TransactionId.js\").default} TransactionId\n * @typedef {import(\"long\")} Long\n */\n\n/**\n * Create a new Hedera™ transaction wrapped ethereum transaction.\n */\nexport default class EthereumTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {Uint8Array} [props.ethereumData]\n * @param {FileId} [props.callData]\n * @param {FileId} [props.callDataFileId]\n * @param {number | string | Long | BigNumber | Hbar} [props.maxGasAllowance]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._ethereumData = null;\n\n /**\n * @private\n * @type {?FileId}\n */\n this._callDataFileId = null;\n\n /**\n * @private\n * @type {?Hbar}\n */\n this._maxGasAllowance = null;\n\n if (props.ethereumData != null) {\n this.setEthereumData(props.ethereumData);\n }\n\n if (props.callData != null) {\n this.setCallDataFileId(props.callData);\n }\n\n if (props.callDataFileId != null) {\n this.setCallDataFileId(props.callDataFileId);\n }\n\n if (props.maxGasAllowance != null) {\n this.setMaxGasAllowanceHbar(props.maxGasAllowance);\n }\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITransaction[]} transactions\n * @param {HieroProto.proto.ISignedTransaction[]} signedTransactions\n * @param {TransactionId[]} transactionIds\n * @param {AccountId[]} nodeIds\n * @param {HieroProto.proto.ITransactionBody[]} bodies\n * @returns {EthereumTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const transaction =\n /** @type {HieroProto.proto.IEthereumTransactionBody} */ (\n body.ethereumTransaction\n );\n\n return Transaction._fromProtobufTransactions(\n new EthereumTransaction({\n ethereumData:\n transaction.ethereumData != null\n ? transaction.ethereumData\n : undefined,\n callData:\n transaction.callData != null\n ? FileId._fromProtobuf(transaction.callData)\n : undefined,\n maxGasAllowance:\n transaction.maxGasAllowance != null\n ? Hbar.fromTinybars(transaction.maxGasAllowance)\n : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?(Uint8Array | FileId)}\n */\n get ethereumData() {\n return this._ethereumData;\n }\n\n /**\n * The raw Ethereum transaction (RLP encoded type 0, 1, and 2). Complete\n * unless the callData field is set.\n *\n * @param {Uint8Array} ethereumData\n * @returns {this}\n */\n setEthereumData(ethereumData) {\n this._requireNotFrozen();\n this._ethereumData = ethereumData;\n return this;\n }\n\n /**\n * @deprecated - Use `callDataFileId` instead\n * @returns {?FileId}\n */\n get callData() {\n return this.callDataFileId;\n }\n\n /**\n * @deprecated - Use `setCallDataFileId()` instead\n *\n * For large transactions (for example contract create) this is the callData\n * of the callData. The data in the callData will be re-written with\n * the callData element as a zero length string with the original contents in\n * the referenced file at time of execution. The callData will need to be\n * \"rehydrated\" with the callData for signature validation to pass.\n * @param {FileId} callDataFileId\n * @returns {this}\n */\n setCallData(callDataFileId) {\n return this.setCallDataFileId(callDataFileId);\n }\n\n /**\n * @returns {?FileId}\n */\n get callDataFileId() {\n return this._callDataFileId;\n }\n\n /**\n * For large transactions (for example contract create) this is the callData\n * of the callData. The data in the callData will be re-written with\n * the callData element as a zero length string with the original contents in\n * the referenced file at time of execution. The callData will need to be\n * \"rehydrated\" with the callData for signature validation to pass.\n *\n * @param {FileId} callDataFileId\n * @returns {this}\n */\n setCallDataFileId(callDataFileId) {\n this._requireNotFrozen();\n this._callDataFileId = callDataFileId;\n return this;\n }\n\n /**\n * @returns {?Hbar}\n */\n get maxGasAllowance() {\n return this._maxGasAllowance;\n }\n\n /**\n * @deprecated -- use setMaxGasAllowanceHbar instead\n * @param {number | string | Long | BigNumber | Hbar} maxGasAllowance\n * @returns {this}\n */\n setMaxGasAllowance(maxGasAllowance) {\n return this.setMaxGasAllowanceHbar(maxGasAllowance);\n }\n\n /**\n * The maximum amount, in hbars, that the payer of the hedera transaction\n * is willing to pay to complete the transaction.\n *\n * Ordinarily the account with the ECDSA alias corresponding to the public\n * key that is extracted from the ethereum_data signature is responsible for\n * fees that result from the execution of the transaction. If that amount of\n * authorized fees is not sufficient then the payer of the transaction can be\n * charged, up to but not exceeding this amount. If the ethereum_data\n * transaction authorized an amount that was insufficient then the payer will\n * only be charged the amount needed to make up the difference. If the gas\n * price in the transaction was set to zero then the payer will be assessed\n * the entire fee.\n *\n * @param {number | string | Long | BigNumber | Hbar} maxGasAllowance\n * @returns {this}\n */\n setMaxGasAllowanceHbar(maxGasAllowance) {\n this._requireNotFrozen();\n this._maxGasAllowance =\n maxGasAllowance instanceof Hbar\n ? maxGasAllowance\n : new Hbar(maxGasAllowance);\n return this;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (\n this._ethereumData != null &&\n this._ethereumData instanceof FileId\n ) {\n this._ethereumData.validateChecksum(client);\n }\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.smartContract.callEthereum(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"ethereumTransaction\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.IEthereumTransactionBody}\n */\n _makeTransactionData() {\n return {\n ethereumData: this._ethereumData,\n callData:\n this._callDataFileId != null\n ? this._callDataFileId._toProtobuf()\n : null,\n maxGasAllowance:\n this._maxGasAllowance != null\n ? this._maxGasAllowance.toTinybars()\n : null,\n };\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp = /** @type {import(\"./Timestamp.js\").default} */ (\n this._transactionIds.current.validStart\n );\n return `EthereumTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"ethereumTransaction\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n EthereumTransaction._fromProtobuf,\n);\n"],"names":["EthereumTransaction","Transaction","constructor","props","super","this","_ethereumData","_callDataFileId","_maxGasAllowance","ethereumData","setEthereumData","callData","setCallDataFileId","callDataFileId","maxGasAllowance","setMaxGasAllowanceHbar","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","transaction","_fromProtobufTransactions","undefined","FileId","Hbar","fromTinybars","_requireNotFrozen","setCallData","setMaxGasAllowance","_validateChecksums","client","validateChecksum","_execute","channel","request","smartContract","callEthereum","_getTransactionDataCase","_makeTransactionData","_toProtobuf","toTinybars","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"gIAgCe,MAAMA,UAA4BC,EAQ7C,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,cAAgB,KAMrBD,KAAKE,gBAAkB,KAMvBF,KAAKG,iBAAmB,KAEE,MAAtBL,EAAMM,cACNJ,KAAKK,gBAAgBP,EAAMM,cAGT,MAAlBN,EAAMQ,UACNN,KAAKO,kBAAkBT,EAAMQ,UAGL,MAAx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ACI,MAAO,CACH/B,aAAcJ,KAAKC,cACnBK,SAC4B,MAAxBN,KAAKE,gBACCF,KAAKE,gBAAgBkC,cACrB,KACV3B,gBAC6B,MAAzBT,KAAKG,iBACCH,KAAKG,iBAAiBkC,aACtB,KAEtB,CAKI,SAAAC,GAII,MAAO,uBAFHtC,KAAKuC,gBAAgBC,QACxB,WACuCC,YAChD,EAGAC,EAAqBC,IACjB,sBAEAhD,EAAoBgB"}
|
|
1
|
+
{"version":3,"file":"EthereumTransaction.js","sources":["../src/EthereumTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Hbar from \"./Hbar.js\";\nimport FileId from \"./file/FileId.js\";\nimport Transaction, {\n TRANSACTION_REGISTRY,\n} from \"./transaction/Transaction.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransaction} HieroProto.proto.ITransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n * @typedef {import(\"@hiero-ledger/proto\").proto.IEthereumTransactionBody} HieroProto.proto.IEthereumTransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.IAccountID} HieroProto.proto.IAccountID\n */\n\n/**\n * @typedef {import(\"bignumber.js\").default} BigNumber\n * @typedef {import(\"./account/AccountId.js\").default} AccountId\n * @typedef {import(\"./channel/Channel.js\").default} Channel\n * @typedef {import(\"./client/Client.js\").default<*, *>} Client\n * @typedef {import(\"./Timestamp.js\").default} Timestamp\n * @typedef {import(\"./transaction/TransactionId.js\").default} TransactionId\n * @typedef {import(\"long\")} Long\n */\n\n/**\n * Create a new Hedera™ transaction wrapped ethereum transaction.\n */\nexport default class EthereumTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {Uint8Array} [props.ethereumData]\n * @param {FileId} [props.callData]\n * @param {FileId} [props.callDataFileId]\n * @param {number | string | Long | BigNumber | Hbar} [props.maxGasAllowance]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._ethereumData = null;\n\n /**\n * @private\n * @type {?FileId}\n */\n this._callDataFileId = null;\n\n /**\n * @private\n * @type {?Hbar}\n */\n this._maxGasAllowance = null;\n\n if (props.ethereumData != null) {\n this.setEthereumData(props.ethereumData);\n }\n\n if (props.callData != null) {\n this.setCallDataFileId(props.callData);\n }\n\n if (props.callDataFileId != null) {\n this.setCallDataFileId(props.callDataFileId);\n }\n\n if (props.maxGasAllowance != null) {\n this.setMaxGasAllowanceHbar(props.maxGasAllowance);\n }\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITransaction[]} transactions\n * @param {HieroProto.proto.ISignedTransaction[]} signedTransactions\n * @param {TransactionId[]} transactionIds\n * @param {AccountId[]} nodeIds\n * @param {HieroProto.proto.ITransactionBody[]} bodies\n * @returns {EthereumTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const transaction =\n /** @type {HieroProto.proto.IEthereumTransactionBody} */ (\n body.ethereumTransaction\n );\n\n return Transaction._fromProtobufTransactions(\n new EthereumTransaction({\n ethereumData:\n transaction.ethereumData != null\n ? transaction.ethereumData\n : undefined,\n callData:\n transaction.callData != null\n ? FileId._fromProtobuf(transaction.callData)\n : undefined,\n maxGasAllowance:\n transaction.maxGasAllowance != null\n ? Hbar.fromTinybars(transaction.maxGasAllowance)\n : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?(Uint8Array | FileId)}\n */\n get ethereumData() {\n return this._ethereumData;\n }\n\n /**\n * The raw Ethereum transaction (RLP encoded type 0, 1, and 2). Complete\n * unless the callData field is set.\n *\n * @param {Uint8Array} ethereumData\n * @returns {this}\n */\n setEthereumData(ethereumData) {\n this._requireNotFrozen();\n this._ethereumData = ethereumData;\n return this;\n }\n\n /**\n * @deprecated - Use `callDataFileId` instead\n * @returns {?FileId}\n */\n get callData() {\n return this.callDataFileId;\n }\n\n /**\n * @deprecated - Use `setCallDataFileId()` instead\n *\n * For large transactions (for example contract create) this is the callData\n * of the callData. The data in the callData will be re-written with\n * the callData element as a zero length string with the original contents in\n * the referenced file at time of execution. The callData will need to be\n * \"rehydrated\" with the callData for signature validation to pass.\n * @param {FileId} callDataFileId\n * @returns {this}\n */\n setCallData(callDataFileId) {\n return this.setCallDataFileId(callDataFileId);\n }\n\n /**\n * @returns {?FileId}\n */\n get callDataFileId() {\n return this._callDataFileId;\n }\n\n /**\n * For large transactions (for example contract create) this is the callData\n * of the callData. The data in the callData will be re-written with\n * the callData element as a zero length string with the original contents in\n * the referenced file at time of execution. The callData will need to be\n * \"rehydrated\" with the callData for signature validation to pass.\n *\n * @param {FileId} callDataFileId\n * @returns {this}\n */\n setCallDataFileId(callDataFileId) {\n this._requireNotFrozen();\n this._callDataFileId = callDataFileId;\n return this;\n }\n\n /**\n * @returns {?Hbar}\n */\n get maxGasAllowance() {\n return this._maxGasAllowance;\n }\n\n /**\n * @deprecated -- use setMaxGasAllowanceHbar instead\n * @param {number | string | Long | BigNumber | Hbar} maxGasAllowance\n * @returns {this}\n */\n setMaxGasAllowance(maxGasAllowance) {\n return this.setMaxGasAllowanceHbar(maxGasAllowance);\n }\n\n /**\n * The maximum amount, in hbars, that the payer of the hedera transaction\n * is willing to pay to complete the transaction.\n *\n * Ordinarily the account with the ECDSA alias corresponding to the public\n * key that is extracted from the ethereum_data signature is responsible for\n * fees that result from the execution of the transaction. If that amount of\n * authorized fees is not sufficient then the payer of the transaction can be\n * charged, up to but not exceeding this amount. If the ethereum_data\n * transaction authorized an amount that was insufficient then the payer will\n * only be charged the amount needed to make up the difference. If the gas\n * price in the transaction was set to zero then the payer will be assessed\n * the entire fee.\n *\n * @param {number | string | Long | BigNumber | Hbar} maxGasAllowance\n * @returns {this}\n */\n setMaxGasAllowanceHbar(maxGasAllowance) {\n this._requireNotFrozen();\n this._maxGasAllowance =\n maxGasAllowance instanceof Hbar\n ? maxGasAllowance\n : new Hbar(maxGasAllowance);\n return this;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (\n this._ethereumData != null &&\n this._ethereumData instanceof FileId\n ) {\n this._ethereumData.validateChecksum(client);\n }\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.smartContract.callEthereum(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"ethereumTransaction\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.IEthereumTransactionBody}\n */\n _makeTransactionData() {\n return {\n ethereumData: this._ethereumData,\n callData:\n this._callDataFileId != null\n ? this._callDataFileId._toProtobuf()\n : null,\n maxGasAllowance:\n this._maxGasAllowance != null\n ? this._maxGasAllowance.toTinybars()\n : null,\n };\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp = /** @type {import(\"./Timestamp.js\").default} */ (\n this._transactionIds.current.validStart\n );\n return `EthereumTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"ethereumTransaction\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n EthereumTransaction._fromProtobuf,\n);\n"],"names":["EthereumTransaction","Transaction","constructor","props","super","this","_ethereumData","_callDataFileId","_maxGasAllowance","ethereumData","setEthereumData","callData","setCallDataFileId","callDataFileId","maxGasAllowance","setMaxGasAllowanceHbar","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","transaction","_fromProtobufTransactions","undefined","FileId","Hbar","fromTinybars","_requireNotFrozen","setCallData","setMaxGasAllowance","_validateChecksums","client","validateChecksum","_execute","channel","request","smartContract","callEthereum","_getTransactionDataCase","_makeTransactionData","_toProtobuf","toTinybars","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"gIAgCe,MAAMA,UAA4BC,EAQ7C,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,cAAgB,KAMrBD,KAAKE,gBAAkB,KAMvBF,KAAKG,iBAAmB,KAEE,MAAtBL,EAAMM,cACNJ,KAAKK,gBAAgBP,EAAMM,cAGT,MAAlBN,EAAMQ,UACNN,KAAKO,kBAAkBT,EAAMQ,UAGL,MAAxBR,EAAMU,gBACNR,KAAKO,kBAAkBT,EAAMU,gBAGJ,MAAzBV,EAAMW,iBACNT,KAAKU,uBAAuBZ,EAAMW,gBAE9C,CAWI,oBAAOE,CACHC,EACAC,EACAC,EACAC,EACAC,GAEA,MACMC,EADOD,EAAO,GAIf,oBAEL,OAAOpB,EAAYsB,0BACf,IAAIvB,EAAoB,CACpBS,aACgC,MAA5Ba,EAAYb,aACNa,EAAYb,kBACZe,EACVb,SAC4B,MAAxBW,EAAYX,SACNc,EAAOT,cAAcM,EAAYX,eACjCa,EACVV,gBACmC,MAA/BQ,EAAYR,gBACNY,EAAKC,aAAaL,EAAYR,sBAC9BU,IAEdP,EACAC,EACAC,EACAC,EACAC,EAEZ,CAKI,gBAAIZ,GACA,OAAOJ,KAAKC,aACpB,CASI,eAAAI,CAAgBD,GAGZ,OAFAJ,KAAKuB,oBACLvB,KAAKC,cAAgBG,EACdJ,IACf,CAMI,YAAIM,GACA,OAAON,KAAKQ,cACpB,CAaI,WAAAgB,CAAYhB,GACR,OAAOR,KAAKO,kBAAkBC,EACtC,CAKI,kBAAIA,GACA,OAAOR,KAAKE,eACpB,CAYI,iBAAAK,CAAkBC,GAGd,OAFAR,KAAKuB,oBACLvB,KAAKE,gBAAkBM,EAChBR,IACf,CAKI,mBAAIS,GACA,OAAOT,KAAKG,gBACpB,CAOI,kBAAAsB,CAAmBhB,GACf,OAAOT,KAAKU,uBAAuBD,EAC3C,CAmBI,sBAAAC,CAAuBD,GAMnB,OALAT,KAAKuB,oBACLvB,KAAKG,iBACDM,aAA2BY,EACrBZ,EACA,IAAIY,EAAKZ,GACZT,IACf,CAKI,kBAAA0B,CAAmBC,GAEW,MAAtB3B,KAAKC,eACLD,KAAKC,yBAAyBmB,GAE9BpB,KAAKC,cAAc2B,iBAAiBD,EAEhD,CASI,QAAAE,CAASC,EAASC,GACd,OAAOD,EAAQE,cAAcC,aAAaF,EAClD,CAOI,uBAAAG,GACI,MAAO,qBACf,CAOI,oBAAAC,GACI,MAAO,CACH/B,aAAcJ,KAAKC,cACnBK,SAC4B,MAAxBN,KAAKE,gBACCF,KAAKE,gBAAgBkC,cACrB,KACV3B,gBAC6B,MAAzBT,KAAKG,iBACCH,KAAKG,iBAAiBkC,aACtB,KAEtB,CAKI,SAAAC,GAII,MAAO,uBAFHtC,KAAKuC,gBAAgBC,QACxB,WACuCC,YAChD,EAGAC,EAAqBC,IACjB,sBAEAhD,EAAoBgB"}
|
package/lib/EvmAddress.cjs
CHANGED
|
@@ -13,7 +13,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @namespace proto
|
|
16
|
-
* @typedef {import("@
|
|
16
|
+
* @typedef {import("@hiero-ledger/proto").proto.IKey} HieroProto.proto.IKey
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
/**
|
package/lib/EvmAddress.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @namespace proto
|
|
3
|
-
* @typedef {import("@
|
|
3
|
+
* @typedef {import("@hiero-ledger/proto").proto.IKey} HieroProto.proto.IKey
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @typedef {import("./client/Client.js").default<*, *>} Client
|
|
@@ -40,7 +40,7 @@ export default class EvmAddress extends Key {
|
|
|
40
40
|
}
|
|
41
41
|
export namespace HieroProto {
|
|
42
42
|
namespace proto {
|
|
43
|
-
type IKey = import("@
|
|
43
|
+
type IKey = import("@hiero-ledger/proto").proto.IKey;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
export type Client = import("./client/Client.js").default<any, any>;
|
package/lib/EvmAddress.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvmAddress.js","sources":["../src/EvmAddress.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Key from \"./Key.js\";\nimport * as hex from \"./encoding/hex.js\";\nimport { arrayEqual } from \"./util.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@
|
|
1
|
+
{"version":3,"file":"EvmAddress.js","sources":["../src/EvmAddress.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Key from \"./Key.js\";\nimport * as hex from \"./encoding/hex.js\";\nimport { arrayEqual } from \"./util.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.IKey} HieroProto.proto.IKey\n */\n\n/**\n * @typedef {import(\"./client/Client.js\").default<*, *>} Client\n */\n\n/**\n * Represents an Ethereum Virtual Machine (EVM) address.\n * This class extends the Key class and provides functionality for handling EVM addresses.\n */\nexport default class EvmAddress extends Key {\n /**\n * @internal\n * @param {Uint8Array} bytes\n */\n constructor(bytes) {\n super();\n this._bytes = bytes;\n }\n\n /**\n * Creates an EvmAddress from a hex string representation.\n * @param {string} evmAddress - The hex string representing the EVM address\n * @returns {EvmAddress}\n * @throws {Error} If the input string is not the correct size\n */\n static fromString(evmAddress) {\n evmAddress = evmAddress.startsWith(\"0x\")\n ? evmAddress.slice(2)\n : evmAddress;\n\n // Standard EVM address is 20 bytes which is 40 hex characters\n if (evmAddress.length !== 40) {\n throw new Error(\"Input EVM address string is not the correct size\");\n }\n\n return new EvmAddress(hex.decode(evmAddress));\n }\n\n /**\n * @param {Uint8Array} bytes\n * @returns {EvmAddress}\n */\n static fromBytes(bytes) {\n return new EvmAddress(bytes);\n }\n\n /**\n * @returns {Uint8Array}\n */\n toBytes() {\n return this._bytes;\n }\n\n /**\n * @returns {string}\n */\n toString() {\n return hex.encode(this._bytes);\n }\n\n /**\n * @param {EvmAddress} other\n * @returns {boolean}\n */\n equals(other) {\n return arrayEqual(this._bytes, other._bytes);\n }\n}\n"],"names":["EvmAddress","Key","constructor","bytes","super","this","_bytes","fromString","evmAddress","startsWith","slice","length","Error","hex.decode","fromBytes","toBytes","toString","hex.encode","equals","other","arrayEqual"],"mappings":"sHAmBe,MAAMA,UAAmBC,EAKpC,WAAAC,CAAYC,GACRC,QACAC,KAAKC,OAASH,CACtB,CAQI,iBAAOI,CAAWC,GAMd,GAA0B,MAL1BA,EAAaA,EAAWC,WAAW,MAC7BD,EAAWE,MAAM,GACjBF,GAGSG,OACX,MAAM,IAAIC,MAAM,oDAGpB,OAAO,IAAIZ,EAAWa,EAAWL,GACzC,CAMI,gBAAOM,CAAUX,GACb,OAAO,IAAIH,EAAWG,EAC9B,CAKI,OAAAY,GACI,OAAOV,KAAKC,MACpB,CAKI,QAAAU,GACI,OAAOC,EAAWZ,KAAKC,OAC/B,CAMI,MAAAY,CAAOC,GACH,OAAOC,EAAWf,KAAKC,OAAQa,EAAMb,OAC7C"}
|
package/lib/ExchangeRate.cjs
CHANGED
|
@@ -66,7 +66,7 @@ class ExchangeRate {
|
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* @internal
|
|
69
|
-
* @param {import("@
|
|
69
|
+
* @param {import("@hiero-ledger/proto").proto.IExchangeRate} rate
|
|
70
70
|
* @returns {ExchangeRate}
|
|
71
71
|
*/
|
|
72
72
|
static _fromProtobuf(rate) {
|
|
@@ -79,7 +79,7 @@ class ExchangeRate {
|
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
81
|
* @internal
|
|
82
|
-
* @returns {import("@
|
|
82
|
+
* @returns {import("@hiero-ledger/proto").proto.IExchangeRate}
|
|
83
83
|
*/
|
|
84
84
|
_toProtobuf() {
|
|
85
85
|
return {
|
package/lib/ExchangeRate.d.ts
CHANGED
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
export default class ExchangeRate {
|
|
14
14
|
/**
|
|
15
15
|
* @internal
|
|
16
|
-
* @param {import("@
|
|
16
|
+
* @param {import("@hiero-ledger/proto").proto.IExchangeRate} rate
|
|
17
17
|
* @returns {ExchangeRate}
|
|
18
18
|
*/
|
|
19
|
-
static _fromProtobuf(rate: import("@
|
|
19
|
+
static _fromProtobuf(rate: import("@hiero-ledger/proto").proto.IExchangeRate): ExchangeRate;
|
|
20
20
|
/**
|
|
21
21
|
* @private
|
|
22
22
|
* @param {object} props
|
|
@@ -55,9 +55,9 @@ export default class ExchangeRate {
|
|
|
55
55
|
readonly exchangeRateInCents: number;
|
|
56
56
|
/**
|
|
57
57
|
* @internal
|
|
58
|
-
* @returns {import("@
|
|
58
|
+
* @returns {import("@hiero-ledger/proto").proto.IExchangeRate}
|
|
59
59
|
*/
|
|
60
|
-
_toProtobuf(): import("@
|
|
60
|
+
_toProtobuf(): import("@hiero-ledger/proto").proto.IExchangeRate;
|
|
61
61
|
/**
|
|
62
62
|
* @returns {ExchangeRateJSON}
|
|
63
63
|
*/
|
package/lib/ExchangeRate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExchangeRate.js","sources":["../src/ExchangeRate.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Long from \"long\";\n\n/**\n * @typedef {object} ExchangeRateJSON\n * @property {number} hbars\n * @property {number} cents\n * @property {Date} expirationTime\n * @property {number} exchangeRateInCents\n */\n\n/**\n * Represents an exchange rate between hbars and cents (USD).\n * This class provides functionality for handling and converting exchange rates\n * between Hedera's native HBAR currency and US cents.\n */\nexport default class ExchangeRate {\n /**\n * @private\n * @param {object} props\n * @param {number} props.hbars\n * @param {number} props.cents\n * @param {Date} props.expirationTime\n */\n constructor(props) {\n /**\n * Denotes Hbar equivalent to cents (USD)\n *\n * @readonly\n * @type {number}\n */\n this.hbars = props.hbars;\n\n /**\n * Denotes cents (USD) equivalent to Hbar\n *\n * @readonly\n * @type {number}\n */\n this.cents = props.cents;\n\n /**\n * Expiration time of this exchange rate\n *\n * @readonly\n * @type {Date}\n */\n this.expirationTime = props.expirationTime;\n\n /**\n * Calculated exchange rate\n *\n * @readonly\n * @type {number}\n */\n this.exchangeRateInCents = props.cents / props.hbars;\n\n Object.freeze(this);\n }\n\n /**\n * @internal\n * @param {import(\"@
|
|
1
|
+
{"version":3,"file":"ExchangeRate.js","sources":["../src/ExchangeRate.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Long from \"long\";\n\n/**\n * @typedef {object} ExchangeRateJSON\n * @property {number} hbars\n * @property {number} cents\n * @property {Date} expirationTime\n * @property {number} exchangeRateInCents\n */\n\n/**\n * Represents an exchange rate between hbars and cents (USD).\n * This class provides functionality for handling and converting exchange rates\n * between Hedera's native HBAR currency and US cents.\n */\nexport default class ExchangeRate {\n /**\n * @private\n * @param {object} props\n * @param {number} props.hbars\n * @param {number} props.cents\n * @param {Date} props.expirationTime\n */\n constructor(props) {\n /**\n * Denotes Hbar equivalent to cents (USD)\n *\n * @readonly\n * @type {number}\n */\n this.hbars = props.hbars;\n\n /**\n * Denotes cents (USD) equivalent to Hbar\n *\n * @readonly\n * @type {number}\n */\n this.cents = props.cents;\n\n /**\n * Expiration time of this exchange rate\n *\n * @readonly\n * @type {Date}\n */\n this.expirationTime = props.expirationTime;\n\n /**\n * Calculated exchange rate\n *\n * @readonly\n * @type {number}\n */\n this.exchangeRateInCents = props.cents / props.hbars;\n\n Object.freeze(this);\n }\n\n /**\n * @internal\n * @param {import(\"@hiero-ledger/proto\").proto.IExchangeRate} rate\n * @returns {ExchangeRate}\n */\n static _fromProtobuf(rate) {\n return new ExchangeRate({\n hbars: /** @type {number} */ (rate.hbarEquiv),\n cents: /** @type {number} */ (rate.centEquiv),\n expirationTime: new Date(\n rate.expirationTime != null\n ? rate.expirationTime.seconds != null\n ? Long.isLong(rate.expirationTime.seconds)\n ? rate.expirationTime.seconds.toInt() * 1000\n : rate.expirationTime.seconds\n : 0\n : 0,\n ),\n });\n }\n\n /**\n * @internal\n * @returns {import(\"@hiero-ledger/proto\").proto.IExchangeRate}\n */\n _toProtobuf() {\n return {\n hbarEquiv: this.hbars,\n centEquiv: this.cents,\n expirationTime: {\n seconds: Long.fromNumber(\n Math.trunc(this.expirationTime.getTime() / 1000),\n ),\n },\n };\n }\n\n /**\n * @returns {ExchangeRateJSON}\n */\n toJSON() {\n return {\n hbars: this.hbars,\n cents: this.cents,\n expirationTime: this.expirationTime,\n exchangeRateInCents: this.exchangeRateInCents,\n };\n }\n\n /**\n * @returns {string}\n */\n toString() {\n return JSON.stringify(this.toJSON());\n }\n}\n"],"names":["ExchangeRate","constructor","props","this","hbars","cents","expirationTime","exchangeRateInCents","Object","freeze","_fromProtobuf","rate","Date","seconds","Long","isLong","toInt","_toProtobuf","hbarEquiv","centEquiv","fromNumber","Math","trunc","getTime","toJSON","toString","JSON","stringify"],"mappings":"oBAiBe,MAAMA,EAQjB,WAAAC,CAAYC,GAORC,KAAKC,MAAQF,EAAME,MAQnBD,KAAKE,MAAQH,EAAMG,MAQnBF,KAAKG,eAAiBJ,EAAMI,eAQ5BH,KAAKI,oBAAsBL,EAAMG,MAAQH,EAAME,MAE/CI,OAAOC,OAAON,KACtB,CAOI,oBAAOO,CAAcC,GACjB,OAAO,IAAIX,EAAa,CACpBI,MAA8BO,EAAc,UAC5CN,MAA8BM,EAAc,UAC5CL,eAAgB,IAAIM,KACO,MAAvBD,EAAKL,gBACgC,MAA/BK,EAAKL,eAAeO,QAChBC,EAAKC,OAAOJ,EAAKL,eAAeO,SACU,IAAtCF,EAAKL,eAAeO,QAAQG,QAC5BL,EAAKL,eAAeO,QAE5B,IAGtB,CAMI,WAAAI,GACI,MAAO,CACHC,UAAWf,KAAKC,MAChBe,UAAWhB,KAAKE,MAChBC,eAAgB,CACZO,QAASC,EAAKM,WACVC,KAAKC,MAAMnB,KAAKG,eAAeiB,UAAY,OAI/D,CAKI,MAAAC,GACI,MAAO,CACHpB,MAAOD,KAAKC,MACZC,MAAOF,KAAKE,MACZC,eAAgBH,KAAKG,eACrBC,oBAAqBJ,KAAKI,oBAEtC,CAKI,QAAAkB,GACI,OAAOC,KAAKC,UAAUxB,KAAKqB,SACnC"}
|
package/lib/ExchangeRates.cjs
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _ExchangeRate = _interopRequireDefault(require("./ExchangeRate.cjs"));
|
|
8
|
-
var HieroProto = _interopRequireWildcard(require("@
|
|
8
|
+
var HieroProto = _interopRequireWildcard(require("@hiero-ledger/proto"));
|
|
9
9
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
// SPDX-License-Identifier: Apache-2.0
|
package/lib/ExchangeRates.d.ts
CHANGED
package/lib/ExchangeRates.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"./ExchangeRate.js";import*as e from"@
|
|
1
|
+
import t from"./ExchangeRate.js";import*as e from"@hiero-ledger/proto";const{proto:r}=e;class o{constructor(t){this.currentRate=t.currentRate,this.nextRate=t.nextRate,Object.freeze(this)}static _fromProtobuf(e){return new o({currentRate:t._fromProtobuf(e.currentRate),nextRate:t._fromProtobuf(e.nextRate)})}_toProtobuf(){return{currentRate:this.currentRate._toProtobuf(),nextRate:this.nextRate._toProtobuf()}}static fromBytes(t){return o._fromProtobuf(r.ExchangeRateSet.decode(t))}}export{o as default};
|
|
2
2
|
//# sourceMappingURL=ExchangeRates.js.map
|
package/lib/ExchangeRates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExchangeRates.js","sources":["../src/ExchangeRates.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport ExchangeRate from \"./ExchangeRate.js\";\nimport * as HieroProto from \"@
|
|
1
|
+
{"version":3,"file":"ExchangeRates.js","sources":["../src/ExchangeRates.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport ExchangeRate from \"./ExchangeRate.js\";\nimport * as HieroProto from \"@hiero-ledger/proto\";\n\nconst { proto } = HieroProto;\n\n/**\n * Represents a pair of exchange rates for HBAR to USD cents conversion.\n * Contains both the current exchange rate and the next exchange rate that will take effect.\n */\nexport default class ExchangeRates {\n /**\n * @private\n * @param {object} props\n * @param {ExchangeRate} props.currentRate\n * @param {ExchangeRate} props.nextRate\n */\n constructor(props) {\n /**\n * @readonly\n */\n this.currentRate = props.currentRate;\n\n /**\n * @readonly\n */\n this.nextRate = props.nextRate;\n\n Object.freeze(this);\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.IExchangeRateSet} rateSet\n * @returns {ExchangeRates}\n */\n static _fromProtobuf(rateSet) {\n return new ExchangeRates({\n currentRate: ExchangeRate._fromProtobuf(\n /** @type {HieroProto.proto.IExchangeRate} */ (\n rateSet.currentRate\n ),\n ),\n nextRate: ExchangeRate._fromProtobuf(\n /** @type {HieroProto.proto.IExchangeRate} */ (\n rateSet.nextRate\n ),\n ),\n });\n }\n\n /**\n * @internal\n * @returns {HieroProto.proto.IExchangeRateSet}\n */\n _toProtobuf() {\n return {\n currentRate: this.currentRate._toProtobuf(),\n nextRate: this.nextRate._toProtobuf(),\n };\n }\n\n /**\n * @param {Uint8Array} bytes\n * @returns {ExchangeRates}\n */\n static fromBytes(bytes) {\n return ExchangeRates._fromProtobuf(proto.ExchangeRateSet.decode(bytes));\n }\n}\n"],"names":["proto","HieroProto","ExchangeRates","constructor","props","this","currentRate","nextRate","Object","freeze","_fromProtobuf","rateSet","ExchangeRate","_toProtobuf","fromBytes","bytes","ExchangeRateSet","decode"],"mappings":"uEAKA,MAAMA,MAAEA,GAAUC,EAMH,MAAMC,EAOjB,WAAAC,CAAYC,GAIRC,KAAKC,YAAcF,EAAME,YAKzBD,KAAKE,SAAWH,EAAMG,SAEtBC,OAAOC,OAAOJ,KACtB,CAOI,oBAAOK,CAAcC,GACjB,OAAO,IAAIT,EAAc,CACrBI,YAAaM,EAAaF,cAElBC,EACpB,aAEYJ,SAAUK,EAAaF,cAEfC,EACpB,WAGA,CAMI,WAAAE,GACI,MAAO,CACHP,YAAaD,KAAKC,YAAYO,cAC9BN,SAAUF,KAAKE,SAASM,cAEpC,CAMI,gBAAOC,CAAUC,GACb,OAAOb,EAAcQ,cAAcV,EAAMgB,gBAAgBC,OAAOF,GACxE"}
|
package/lib/Executable.cjs
CHANGED
|
@@ -439,7 +439,7 @@ class Executable {
|
|
|
439
439
|
*/
|
|
440
440
|
_shouldRetryExceptionally(error) {
|
|
441
441
|
if (error instanceof _GrpcServiceError.default) {
|
|
442
|
-
return error.status._code === _GrpcStatus.default.Timeout._code || error.status._code === _GrpcStatus.default.Unavailable._code || error.status._code === _GrpcStatus.default.ResourceExhausted._code || error.status._code === _GrpcStatus.default.GrpcWeb._code || error.status._code === _GrpcStatus.default.Internal._code && RST_STREAM.test(error.message);
|
|
442
|
+
return error.status._code === _GrpcStatus.default.Timeout._code || error.status._code === _GrpcStatus.default.DeadlineExceeded._code || error.status._code === _GrpcStatus.default.Unavailable._code || error.status._code === _GrpcStatus.default.ResourceExhausted._code || error.status._code === _GrpcStatus.default.GrpcWeb._code || error.status._code === _GrpcStatus.default.Internal._code && RST_STREAM.test(error.message);
|
|
443
443
|
} else {
|
|
444
444
|
// if we get to the 'else' statement, the 'error' is instanceof 'HttpError'
|
|
445
445
|
// and in this case, we have to retry always
|
|
@@ -515,6 +515,11 @@ class Executable {
|
|
|
515
515
|
this._requestTimeout = requestTimeout != null ? requestTimeout : client.requestTimeout;
|
|
516
516
|
}
|
|
517
517
|
|
|
518
|
+
// If the grpc deadline is not set on the request, use the default value from client
|
|
519
|
+
if (this._grpcDeadline == null) {
|
|
520
|
+
this._grpcDeadline = client.grpcDeadline;
|
|
521
|
+
}
|
|
522
|
+
|
|
518
523
|
// Some request need to perform additional requests before the executing
|
|
519
524
|
// such as paid queries need to fetch the cost of the query before
|
|
520
525
|
// finally executing the actual query.
|
|
@@ -590,6 +595,11 @@ class Executable {
|
|
|
590
595
|
this._logger.debug(`[${logId}] Node AccountID: ${node.accountId.toString()}, IP: ${node.address.toString()}`);
|
|
591
596
|
}
|
|
592
597
|
const channel = node.getChannel();
|
|
598
|
+
|
|
599
|
+
// Set the gRPC deadline on the channel if this query has a custom deadline
|
|
600
|
+
if (this._grpcDeadline != null) {
|
|
601
|
+
channel.setGrpcDeadline(this._grpcDeadline);
|
|
602
|
+
}
|
|
593
603
|
const request = await this._makeRequestAsync();
|
|
594
604
|
let response;
|
|
595
605
|
if (!node.isHealthy()) {
|
|
@@ -617,14 +627,14 @@ class Executable {
|
|
|
617
627
|
// from blocking this request
|
|
618
628
|
const promises = [];
|
|
619
629
|
|
|
620
|
-
// If a grpc deadline is
|
|
630
|
+
// If a grpc deadline is set, we should race it, otherwise the only thing in the
|
|
621
631
|
// list of promises will be the execution promise.
|
|
622
632
|
if (this._grpcDeadline != null) {
|
|
623
633
|
promises.push(
|
|
624
634
|
// eslint-disable-next-line ie11/no-loop-func
|
|
625
635
|
new Promise((_, reject) => setTimeout(
|
|
626
636
|
// eslint-disable-next-line ie11/no-loop-func
|
|
627
|
-
() => reject(new
|
|
637
|
+
() => reject(new _GrpcServiceError.default(_GrpcStatus.default.DeadlineExceeded)), /** @type {number=} */this._grpcDeadline)));
|
|
628
638
|
}
|
|
629
639
|
if (this._logger) {
|
|
630
640
|
this._logger.trace(`[${this._getLogId()}] sending protobuf ${hex.encode(this._requestToBytes(request))}`);
|
package/lib/Executable.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"./grpc/GrpcServiceError.js";import e from"./grpc/GrpcStatus.js";import
|
|
1
|
+
import t from"./grpc/GrpcServiceError.js";import e from"./grpc/GrpcStatus.js";import n from"./transaction/List.js";import{encode as o}from"./encoding/hex.js";import r from"./http/HttpError.js";import s from"./Status.js";import i from"./MaxAttemptsOrTimeoutError.js";const c={Finished:"Finished",Retry:"Retry",Error:"Error"},a=/\brst[^0-9a-zA-Z]stream\b/i,h=10;class d{constructor(){this._maxAttempts=10,this._nodeAccountIds=new n,this.transactionNodeIds=[],this._signOnDemand=!1,this._minBackoff=null,this._maxBackoff=8e3,this._operator=null,this._requestTimeout=null,this._grpcDeadline=null,this._logger=null}get nodeAccountIds(){return this._nodeAccountIds.isEmpty?null:(this._nodeAccountIds.setLocked(),this._nodeAccountIds.list)}setNodeAccountIds(t){return this._nodeAccountIds.setList(t).setLocked(),this}get maxRetries(){return console.warn("Deprecated: use maxAttempts instead"),this.maxAttempts}setMaxRetries(t){return console.warn("Deprecated: use setMaxAttempts() instead"),this.setMaxAttempts(t)}get maxAttempts(){return this._maxAttempts}setMaxAttempts(t){return this._maxAttempts=t,this}get grpcDeadline(){return this._grpcDeadline}setGrpcDeadline(t){return this._grpcDeadline=t,this}setMinBackoff(t){if(null==t)throw new Error("minBackoff cannot be null.");if(null!=this._maxBackoff&&t>this._maxBackoff)throw new Error("minBackoff cannot be larger than maxBackoff.");return this._minBackoff=t,this}get minBackoff(){return this._minBackoff}setMaxBackoff(t){if(null==t)throw new Error("maxBackoff cannot be null.");if(null!=this._minBackoff&&t<this._minBackoff)throw new Error("maxBackoff cannot be smaller than minBackoff.");return this._maxBackoff=t,this}get maxBackoff(){return this._maxBackoff}_beforeExecute(t){throw new Error("not implemented")}_makeRequestAsync(){throw new Error("not implemented")}_mapStatusError(t,e,n){throw new Error("not implemented")}_mapResponse(t,e,n){throw new Error("not implemented")}_execute(t,e){throw new Error("not implemented")}_getTransactionId(){throw new Error("not implemented")}_getLogId(){throw new Error("not implemented")}_requestToBytes(t){throw new Error("not implemented")}_responseToBytes(t){throw new Error("not implemented")}_shouldRetry(t,e){throw new Error("not implemented")}_shouldRetryExceptionally(n){return!(n instanceof t)||(n.status._code===e.Timeout._code||n.status._code===e.DeadlineExceeded._code||n.status._code===e.Unavailable._code||n.status._code===e.ResourceExhausted._code||n.status._code===e.GrpcWeb._code||n.status._code===e.Internal._code&&a.test(n.message))}_setOperatorWith(t,e,n){return this._operator={transactionSigner:n,accountId:t,publicKey:e},this}async executeWithSigner(t){return t.call(this)}isBatchedAndNotBatchTransaction(){return!1}async execute(n,a){const h=null!=n.network["127.0.0.1:50211"];if(this.isBatchedAndNotBatchTransaction())throw new Error("Cannot execute batchified transaction outside of BatchTransaction");this._logger=null==this._logger?null!=n._logger?n._logger:null:this._logger,null==this._requestTimeout&&(this._requestTimeout=null!=a?a:n.requestTimeout),null==this._grpcDeadline&&(this._grpcDeadline=n.grpcDeadline),await this._beforeExecute(n),null==this._maxBackoff&&(this._maxBackoff=n.maxBackoff),null==this._minBackoff&&(this._minBackoff=n.minBackoff);const d=Date.now();let g=null;const m=h?1e3:n._maxAttempts??this._maxAttempts;if(this.transactionNodeIds.length){const t=this._nodeAccountIds.list.map(t=>t.toString());if(!this.transactionNodeIds.some(e=>t.includes(e))){const e=t.length>2?`${t.slice(0,2).join(", ")} ...`:t.join(", "),n=1===t.length;throw new Error(`Attempting to execute a transaction against node${n?"":"s"} ${e}, which ${n?"is":"are"} not included in the Client's node list. Please review your Client configuration.`)}}for(let a=1;a<=m;a+=1){if(null!=this._requestTimeout&&d+this._requestTimeout<=Date.now())throw new i("timeout exceeded",this._nodeAccountIds.isEmpty?"No node account ID set":this._nodeAccountIds.current.toString());let _,f;if(this._nodeAccountIds.isEmpty?(f=n._network.getNode(),_=f.accountId,this._nodeAccountIds.setList([_])):(_=this._nodeAccountIds.current,f=n._network.getNode(_)),null==f)throw new Error(`NodeAccountId not recognized: ${_.toString()}`);if(this.transactionNodeIds.length){if(!this.transactionNodeIds.includes(_.toString())){console.error(`Attempting to execute a transaction against node ${_.toString()}, which is not included in the Client's node list. Please review your Client configuration.`),this._nodeAccountIds.advance();continue}}const p=this._getLogId();this._logger&&this._logger.debug(`[${p}] Node AccountID: ${f.accountId.toString()}, IP: ${f.address.toString()}`);const w=f.getChannel();null!=this._grpcDeadline&&w.setGrpcDeadline(this._grpcDeadline);const x=await this._makeRequestAsync();let k;if(!f.isHealthy()){const t=this._nodeAccountIds.index===this._nodeAccountIds.list.length-1;if(u(x)||h){await l(h,a,this._minBackoff,this._maxBackoff);continue}if(t||this._nodeAccountIds.length<=1)throw new Error(`Network connectivity issue: All nodes are unhealthy. Original node list: ${this._nodeAccountIds.list.join(", ")}`);this._logger&&this._logger.debug(`[${p}] Node is not healthy, trying the next node.`),this._nodeAccountIds.advance();continue}this._nodeAccountIds.advance();try{const n=[];null!=this._grpcDeadline&&n.push(new Promise((n,o)=>setTimeout(()=>o(new t(e.DeadlineExceeded)),this._grpcDeadline))),this._logger&&this._logger.trace(`[${this._getLogId()}] sending protobuf ${o(this._requestToBytes(x))}`),n.push(this._execute(w,x)),k=await Promise.race(n)}catch(e){const o=t._fromResponse(e);if(g=o,this._logger&&this._logger.debug(`[${p}] received error ${JSON.stringify(o)}`),(o instanceof t||o instanceof r)&&this._shouldRetryExceptionally(o)&&a<=m){this._logger&&this._logger.debug(`[${this._getLogId()}] node with accountId: ${f.accountId.toString()} and proxy IP: ${f.address.toString()} is unhealthy`),n._network.increaseBackoff(f);continue}throw e}this._logger&&this._logger.trace(`[${this._getLogId()}] sending protobuf ${o(this._responseToBytes(k))}`),n._network.decreaseBackoff(f);const[A,B]=this._shouldRetry(x,k);switch(A.toString()!==s.Ok.toString()&&A.toString()!==s.Success.toString()&&(g=A),B){case c.Retry:await l(h,a,this._minBackoff,this._maxBackoff);continue;case c.Finished:return this._mapResponse(k,_,x);case c.Error:throw this._mapStatusError(x,k,_);default:throw new Error("(BUG) non-exhaustive switch statement for `ExecutionState`")}}throw new i(`max attempts of ${m.toString()} was reached for request with last error being: ${null!=g?g.toString():""}`,this._nodeAccountIds.current.toString())}toBytes(){throw new Error("not implemented")}setLogger(t){return this._logger=t,this}get logger(){return this._logger}}function u(t){return"object"==typeof t&&null!==t&&("transactionGetReceipt"in t||"transactionGetRecord"in t)}function l(t,e,n,o){if(t)return new Promise(t=>setTimeout(t,n));const r=Math.min(Math.floor(n*Math.pow(2,e)),o);return new Promise(t=>setTimeout(t,r))}export{h as DEFAULT_MAX_ATTEMPTS,c as ExecutionState,a as RST_STREAM,d as default};
|
|
2
2
|
//# sourceMappingURL=Executable.js.map
|
package/lib/Executable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Executable.js","sources":["../src/Executable.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport GrpcServiceError from \"./grpc/GrpcServiceError.js\";\nimport GrpcStatus from \"./grpc/GrpcStatus.js\";\nimport List from \"./transaction/List.js\";\nimport * as hex from \"./encoding/hex.js\";\nimport HttpError from \"./http/HttpError.js\";\nimport Status from \"./Status.js\";\nimport MaxAttemptsOrTimeoutError from \"./MaxAttemptsOrTimeoutError.js\";\n\n/**\n * @typedef {import(\"./account/AccountId.js\").default} AccountId\n * @typedef {import(\"./channel/Channel.js\").default} Channel\n * @typedef {import(\"./channel/MirrorChannel.js\").default} MirrorChannel\n * @typedef {import(\"./transaction/TransactionId.js\").default} TransactionId\n * @typedef {import(\"./client/Client.js\").ClientOperator} ClientOperator\n * @typedef {import(\"./Signer.js\").Signer} Signer\n * @typedef {import(\"./PublicKey.js\").default} PublicKey\n * @typedef {import(\"./logger/Logger.js\").default} Logger\n */\n\n/**\n * @enum {string}\n */\nexport const ExecutionState = {\n Finished: \"Finished\",\n Retry: \"Retry\",\n Error: \"Error\",\n};\n\nexport const RST_STREAM = /\\brst[^0-9a-zA-Z]stream\\b/i;\nexport const DEFAULT_MAX_ATTEMPTS = 10;\n\n/**\n * @abstract\n * @internal\n * @template RequestT\n * @template ResponseT\n * @template OutputT\n */\nexport default class Executable {\n constructor() {\n /**\n * The number of times we can retry the grpc call\n *\n * @internal\n * @type {number}\n */\n this._maxAttempts = DEFAULT_MAX_ATTEMPTS;\n\n /**\n * List of node account IDs for each transaction that has been\n * built.\n *\n * @internal\n * @type {List<AccountId>}\n */\n this._nodeAccountIds = new List();\n\n /**\n * List of the transaction node account IDs to check if\n * the node account ID of the request is in the list\n *\n * @protected\n * @type {Array<string>}\n */\n this.transactionNodeIds = [];\n\n /**\n * @internal\n */\n this._signOnDemand = false;\n\n /**\n * This is the request's min backoff\n *\n * @internal\n * @type {number | null}\n */\n this._minBackoff = null;\n\n /**\n * This is the request's max backoff\n *\n * @internal\n * @type {number}\n */\n this._maxBackoff = 8000;\n\n /**\n * The operator that was used to execute this request.\n * The reason we save the operator in the request is because of the signing on\n * demand feature. This feature requires us to sign new request on each attempt\n * meaning if a client with an operator was used we'd need to sign with the operator\n * on each attempt.\n *\n * @internal\n * @type {ClientOperator | null}\n */\n this._operator = null;\n\n /**\n * The complete timeout for running the `execute()` method\n *\n * @internal\n * @type {number | null}\n */\n this._requestTimeout = null;\n\n /**\n * The grpc request timeout aka deadline.\n *\n * The reason we have this is because there were times that consensus nodes held the grpc\n * connection, but didn't return anything; not error nor regular response. This resulted\n * in some weird behavior in the SDKs. To fix this we've added a grpc deadline to prevent\n * nodes from stalling the executing of a request.\n *\n * @internal\n * @type {number | null}\n */\n this._grpcDeadline = null;\n\n /**\n * Logger\n *\n * @protected\n * @type {Logger | null}\n */\n this._logger = null;\n }\n\n /**\n * Get the list of node account IDs on the request. If no nodes are set, then null is returned.\n * The reasoning for this is simply \"legacy behavior\".\n *\n * @returns {?AccountId[]}\n */\n get nodeAccountIds() {\n if (this._nodeAccountIds.isEmpty) {\n return null;\n } else {\n this._nodeAccountIds.setLocked();\n return this._nodeAccountIds.list;\n }\n }\n\n /**\n * Set the node account IDs on the request\n *\n * @param {AccountId[]} nodeIds\n * @returns {this}\n */\n setNodeAccountIds(nodeIds) {\n // Set the node account IDs, and lock the list. This will require `execute`\n // to use these nodes instead of random nodes from the network.\n this._nodeAccountIds.setList(nodeIds).setLocked();\n return this;\n }\n\n /**\n * @deprecated\n * @returns {number}\n */\n get maxRetries() {\n console.warn(\"Deprecated: use maxAttempts instead\");\n return this.maxAttempts;\n }\n\n /**\n * @param {number} maxRetries\n * @returns {this}\n */\n setMaxRetries(maxRetries) {\n console.warn(\"Deprecated: use setMaxAttempts() instead\");\n return this.setMaxAttempts(maxRetries);\n }\n\n /**\n * Get the max attempts on the request\n *\n * @returns {number}\n */\n get maxAttempts() {\n return this._maxAttempts;\n }\n\n /**\n * Set the max attempts on the request\n *\n * @param {number} maxAttempts\n * @returns {this}\n */\n setMaxAttempts(maxAttempts) {\n this._maxAttempts = maxAttempts;\n\n return this;\n }\n\n /**\n * Get the grpc deadline\n *\n * @returns {?number}\n */\n get grpcDeadline() {\n return this._grpcDeadline;\n }\n\n /**\n * Set the grpc deadline\n *\n * @param {number} grpcDeadline\n * @returns {this}\n */\n setGrpcDeadline(grpcDeadline) {\n this._grpcDeadline = grpcDeadline;\n\n return this;\n }\n\n /**\n * Set the min backoff for the request\n *\n * @param {number} minBackoff\n * @returns {this}\n */\n setMinBackoff(minBackoff) {\n // Honestly we shouldn't be checking for null since that should be TypeScript's job.\n // Also verify that min backoff is not greater than max backoff.\n if (minBackoff == null) {\n throw new Error(\"minBackoff cannot be null.\");\n } else if (this._maxBackoff != null && minBackoff > this._maxBackoff) {\n throw new Error(\"minBackoff cannot be larger than maxBackoff.\");\n }\n this._minBackoff = minBackoff;\n return this;\n }\n\n /**\n * Get the min backoff\n *\n * @returns {number | null}\n */\n get minBackoff() {\n return this._minBackoff;\n }\n\n /**\n * Set the max backoff for the request\n *\n * @param {?number} maxBackoff\n * @returns {this}\n */\n setMaxBackoff(maxBackoff) {\n // Honestly we shouldn't be checking for null since that should be TypeScript's job.\n // Also verify that max backoff is not less than min backoff.\n if (maxBackoff == null) {\n throw new Error(\"maxBackoff cannot be null.\");\n } else if (this._minBackoff != null && maxBackoff < this._minBackoff) {\n throw new Error(\"maxBackoff cannot be smaller than minBackoff.\");\n }\n this._maxBackoff = maxBackoff;\n return this;\n }\n\n /**\n * Get the max backoff\n *\n * @returns {number}\n */\n get maxBackoff() {\n return this._maxBackoff;\n }\n\n /**\n * This method is responsible for doing any work before the executing process begins.\n * For paid queries this will result in executing a cost query, for transactions this\n * will make sure we save the operator and sign any requests that need to be signed\n * in case signing on demand is disabled.\n *\n * @abstract\n * @protected\n * @param {import(\"./client/Client.js\").default<Channel, *>} client\n * @returns {Promise<void>}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _beforeExecute(client) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Create a protobuf request which will be passed into the `_execute()` method\n *\n * @abstract\n * @protected\n * @returns {Promise<RequestT>}\n */\n _makeRequestAsync() {\n throw new Error(\"not implemented\");\n }\n\n /**\n * This name is a bit wrong now, but the purpose of this method is to map the\n * request and response into an error. This method will only be called when\n * `_shouldRetry` returned `ExecutionState.Error`\n *\n * @abstract\n * @internal\n * @param {RequestT} request\n * @param {ResponseT} response\n * @param {AccountId} nodeId\n * @returns {Error}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _mapStatusError(request, response, nodeId) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Map the request, response, and the node account ID used for this attempt into a response.\n * This method will only be called when `_shouldRetry` returned `ExecutionState.Finished`\n *\n * @abstract\n * @protected\n * @param {ResponseT} response\n * @param {AccountId} nodeAccountId\n * @param {RequestT} request\n * @returns {Promise<OutputT>}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _mapResponse(response, nodeAccountId, request) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Perform a single grpc call with the given request. Each request has it's own\n * required service so we just pass in channel, and it'$ the request's responsiblity\n * to use the right service and call the right grpc method.\n *\n * @abstract\n * @internal\n * @param {Channel} channel\n * @param {RequestT} request\n * @returns {Promise<ResponseT>}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _execute(channel, request) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Return the current transaction ID for the request. All requests which are\n * use the same transaction ID for each node, but the catch is that `Transaction`\n * implicitly supports chunked transactions. Meaning there could be multiple\n * transaction IDs stored in the request, and a different transaction ID will be used\n * on subsequent calls to `execute()`\n *\n * FIXME: This method can most likely be removed, although some further inspection\n * is required.\n *\n * @abstract\n * @protected\n * @returns {TransactionId}\n */\n _getTransactionId() {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Return the log ID for this particular request\n *\n * Log IDs are simply a string constructed to make it easy to track each request's\n * execution even when mulitple requests are executing in parallel. Typically, this\n * method returns the format of `[<request type>.<timestamp of the transaction ID>]`\n *\n * Maybe we should deduplicate this using ${this.consturtor.name}\n *\n * @abstract\n * @internal\n * @returns {string}\n */\n _getLogId() {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Serialize the request into bytes\n *\n * @abstract\n * @param {RequestT} request\n * @returns {Uint8Array}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _requestToBytes(request) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Serialize the response into bytes\n *\n * @abstract\n * @param {ResponseT} response\n * @returns {Uint8Array}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _responseToBytes(response) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Determine if we should continue the execution process, error, or finish.\n *\n * FIXME: This method should really be called something else. Initially it returned\n * a boolean so `shouldRetry` made sense, but now it returns an enum, so the name\n * no longer makes sense.\n *\n * @abstract\n * @protected\n * @param {RequestT} request\n * @param {ResponseT} response\n * @returns {[Status, ExecutionState]}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _shouldRetry(request, response) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Determine if we should error based on the gRPC status\n *\n * Unlike `shouldRetry` this method does in fact still return a boolean\n *\n * @protected\n * @param {Error} error\n * @returns {boolean}\n */\n _shouldRetryExceptionally(error) {\n if (error instanceof GrpcServiceError) {\n return (\n error.status._code === GrpcStatus.Timeout._code ||\n error.status._code === GrpcStatus.Unavailable._code ||\n error.status._code === GrpcStatus.ResourceExhausted._code ||\n error.status._code === GrpcStatus.GrpcWeb._code ||\n (error.status._code === GrpcStatus.Internal._code &&\n RST_STREAM.test(error.message))\n );\n } else {\n // if we get to the 'else' statement, the 'error' is instanceof 'HttpError'\n // and in this case, we have to retry always\n return true;\n }\n }\n\n /**\n * A helper method for setting the operator on the request\n *\n * @internal\n * @param {AccountId} accountId\n * @param {PublicKey} publicKey\n * @param {(message: Uint8Array) => Promise<Uint8Array>} transactionSigner\n * @returns {this}\n */\n _setOperatorWith(accountId, publicKey, transactionSigner) {\n this._operator = {\n transactionSigner,\n accountId,\n publicKey,\n };\n return this;\n }\n\n /**\n * Execute this request using the signer\n *\n * This method is part of the signature providers feature\n * https://hips.hedera.com/hip/hip-338\n *\n * @param {Signer} signer\n * @returns {Promise<OutputT>}\n */\n async executeWithSigner(signer) {\n return signer.call(this);\n }\n\n /**\n * @returns {boolean}\n * @abstract\n * @protected\n */\n isBatchedAndNotBatchTransaction() {\n return false;\n }\n\n /**\n * Execute the request using a client and an optional request timeout\n *\n * @template {Channel} ChannelT\n * @template {MirrorChannel} MirrorChannelT\n * @param {import(\"./client/Client.js\").default<ChannelT, MirrorChannelT>} client\n * @param {number=} requestTimeout\n * @returns {Promise<OutputT>}\n */\n async execute(client, requestTimeout) {\n // we check if its local node then backoff mechanism should be disabled\n // and we increase the retry attempts\n const isLocalNode = client.network[\"127.0.0.1:50211\"] != null;\n\n if (this.isBatchedAndNotBatchTransaction()) {\n throw new Error(\n \"Cannot execute batchified transaction outside of BatchTransaction\",\n );\n }\n\n // If the logger on the request is not set, use the logger in client\n // (if set, otherwise do not use logger)\n this._logger =\n this._logger == null\n ? client._logger != null\n ? client._logger\n : null\n : this._logger;\n\n // If the request timeout is set on the request we'll prioritize that instead\n // of the parameter provided, and if the parameter isn't provided we'll\n // use the default request timeout on client\n if (this._requestTimeout == null) {\n this._requestTimeout =\n requestTimeout != null ? requestTimeout : client.requestTimeout;\n }\n\n // Some request need to perform additional requests before the executing\n // such as paid queries need to fetch the cost of the query before\n // finally executing the actual query.\n await this._beforeExecute(client);\n\n // If the max backoff on the request is not set, use the default value in client\n if (this._maxBackoff == null) {\n this._maxBackoff = client.maxBackoff;\n }\n\n // If the min backoff on the request is not set, use the default value in client\n if (this._minBackoff == null) {\n this._minBackoff = client.minBackoff;\n }\n\n // Save the start time to be used later with request timeout\n const startTime = Date.now();\n\n // Saves each error we get so when we err due to max attempts exceeded we'll have\n // the last error that was returned by the consensus node\n let persistentError = null;\n\n // If the max attempts on the request is not set, use the default value in client\n // If the default value in client is not set, use a default of 10.\n //\n // FIXME: current implementation is wrong, update to follow comment above.\n // ... existing code ...\n const LOCAL_NODE_ATTEMPTS = 1000;\n const maxAttempts = isLocalNode\n ? LOCAL_NODE_ATTEMPTS\n : client._maxAttempts ?? this._maxAttempts;\n\n // Checks if has a valid nodes to which the TX can be sent\n if (this.transactionNodeIds.length) {\n const nodeAccountIds = this._nodeAccountIds.list.map((nodeId) =>\n nodeId.toString(),\n );\n\n const hasValidNodes = this.transactionNodeIds.some((nodeId) =>\n nodeAccountIds.includes(nodeId),\n );\n\n if (!hasValidNodes) {\n const displayNodeAccountIds =\n nodeAccountIds.length > 2\n ? `${nodeAccountIds.slice(0, 2).join(\", \")} ...`\n : nodeAccountIds.join(\", \");\n const isSingleNode = nodeAccountIds.length === 1;\n\n throw new Error(\n `Attempting to execute a transaction against node${\n isSingleNode ? \"\" : \"s\"\n } ${displayNodeAccountIds}, ` +\n `which ${\n isSingleNode ? \"is\" : \"are\"\n } not included in the Client's node list. Please review your Client configuration.`,\n );\n }\n }\n\n // The retry loop\n for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {\n // Determine if we've exceeded request timeout\n if (\n this._requestTimeout != null &&\n startTime + this._requestTimeout <= Date.now()\n ) {\n throw new MaxAttemptsOrTimeoutError(\n `timeout exceeded`,\n this._nodeAccountIds.isEmpty\n ? \"No node account ID set\"\n : this._nodeAccountIds.current.toString(),\n );\n }\n\n let nodeAccountId;\n let node;\n\n if (this._nodeAccountIds.isEmpty) {\n node = client._network.getNode();\n nodeAccountId = node.accountId;\n this._nodeAccountIds.setList([nodeAccountId]);\n } else {\n nodeAccountId = this._nodeAccountIds.current;\n node = client._network.getNode(nodeAccountId);\n }\n\n if (node == null) {\n throw new Error(\n `NodeAccountId not recognized: ${nodeAccountId.toString()}`,\n );\n }\n\n if (this.transactionNodeIds.length) {\n const isNodeAccountIdValid = this.transactionNodeIds.includes(\n nodeAccountId.toString(),\n );\n\n if (!isNodeAccountIdValid) {\n console.error(\n `Attempting to execute a transaction against node ${nodeAccountId.toString()}, which is not included in the Client's node list. Please review your Client configuration.`,\n );\n\n this._nodeAccountIds.advance();\n continue;\n }\n }\n\n // Get the log ID for the request.\n const logId = this._getLogId();\n if (this._logger) {\n this._logger.debug(\n `[${logId}] Node AccountID: ${node.accountId.toString()}, IP: ${node.address.toString()}`,\n );\n }\n\n const channel = node.getChannel();\n const request = await this._makeRequestAsync();\n\n let response;\n\n if (!node.isHealthy()) {\n const isLastNode =\n this._nodeAccountIds.index ===\n this._nodeAccountIds.list.length - 1;\n\n // Check if the request is a transaction receipt or record\n // request to retry 10 times, because getReceiptQuery/getRecordQuery\n // are single node requests\n if (\n isTransactionReceiptOrRecordRequest(request) ||\n isLocalNode\n ) {\n await delayForAttempt(\n isLocalNode,\n attempt,\n this._minBackoff,\n this._maxBackoff,\n );\n continue;\n }\n\n if (isLastNode || this._nodeAccountIds.length <= 1) {\n throw new Error(\n `Network connectivity issue: All nodes are unhealthy. Original node list: ${this._nodeAccountIds.list.join(\n \", \",\n )}`,\n );\n }\n\n if (this._logger) {\n this._logger.debug(\n `[${logId}] Node is not healthy, trying the next node.`,\n );\n }\n\n this._nodeAccountIds.advance();\n continue;\n }\n\n this._nodeAccountIds.advance();\n\n try {\n // Race the execution promise against the grpc timeout to prevent grpc connections\n // from blocking this request\n const promises = [];\n\n // If a grpc deadline is est, we should race it, otherwise the only thing in the\n // list of promises will be the execution promise.\n if (this._grpcDeadline != null) {\n promises.push(\n // eslint-disable-next-line ie11/no-loop-func\n new Promise((_, reject) =>\n setTimeout(\n // eslint-disable-next-line ie11/no-loop-func\n () =>\n reject(new Error(\"grpc deadline exceeded\")),\n /** @type {number=} */ (this._grpcDeadline),\n ),\n ),\n );\n }\n if (this._logger) {\n this._logger.trace(\n `[${this._getLogId()}] sending protobuf ${hex.encode(\n this._requestToBytes(request),\n )}`,\n );\n }\n\n promises.push(this._execute(channel, request));\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n response = /** @type {ResponseT} */ (\n await Promise.race(promises)\n );\n } catch (err) {\n // If we received a grpc status error we need to determine if\n // we should retry on this error, or err from the request entirely.\n const error = GrpcServiceError._fromResponse(\n /** @type {Error} */ (err),\n );\n\n // Save the error in case we retry\n persistentError = error;\n if (this._logger) {\n this._logger.debug(\n `[${logId}] received error ${JSON.stringify(error)}`,\n );\n }\n\n if (\n (error instanceof GrpcServiceError ||\n error instanceof HttpError) &&\n this._shouldRetryExceptionally(error) &&\n attempt <= maxAttempts\n ) {\n // Increase the backoff for the particular node and remove it from\n // the healthy node list\n if (this._logger) {\n this._logger.debug(\n `[${this._getLogId()}] node with accountId: ${node.accountId.toString()} and proxy IP: ${node.address.toString()} is unhealthy`,\n );\n }\n\n client._network.increaseBackoff(node);\n continue;\n }\n\n throw err;\n }\n if (this._logger) {\n this._logger.trace(\n `[${this._getLogId()}] sending protobuf ${hex.encode(\n this._responseToBytes(response),\n )}`,\n );\n }\n\n // If we didn't receive an error we should decrease the current nodes backoff\n // in case it is a recovering node\n client._network.decreaseBackoff(node);\n\n // Determine what execution state we're in by the response\n // For transactions this would be as simple as checking the response status is `OK`\n // while for _most_ queries it would check if the response status is `SUCCESS`\n // The only odd balls are `TransactionReceiptQuery` and `TransactionRecordQuery`\n const [status, shouldRetry] = this._shouldRetry(request, response);\n if (\n status.toString() !== Status.Ok.toString() &&\n status.toString() !== Status.Success.toString()\n ) {\n persistentError = status;\n }\n\n // Determine by the executing state what we should do\n switch (shouldRetry) {\n case ExecutionState.Retry:\n await delayForAttempt(\n isLocalNode,\n attempt,\n this._minBackoff,\n this._maxBackoff,\n );\n continue;\n case ExecutionState.Finished:\n return this._mapResponse(response, nodeAccountId, request);\n case ExecutionState.Error:\n throw this._mapStatusError(\n request,\n response,\n nodeAccountId,\n );\n default:\n throw new Error(\n \"(BUG) non-exhaustive switch statement for `ExecutionState`\",\n );\n }\n }\n\n // We'll only get here if we've run out of attempts, so we return an error wrapping the\n // persistent error we saved before.\n\n throw new MaxAttemptsOrTimeoutError(\n `max attempts of ${maxAttempts.toString()} was reached for request with last error being: ${\n persistentError != null ? persistentError.toString() : \"\"\n }`,\n this._nodeAccountIds.current.toString(),\n );\n }\n\n /**\n * The current purpose of this method is to easily support signature providers since\n * signature providers need to serialize _any_ request into bytes. `Query` and `Transaction`\n * already implement `toBytes()` so it only made sense to make it available here too.\n *\n * @abstract\n * @returns {Uint8Array}\n */\n toBytes() {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Set logger\n *\n * @param {Logger} logger\n * @returns {this}\n */\n setLogger(logger) {\n this._logger = logger;\n return this;\n }\n\n /**\n * Get logger if set\n *\n * @returns {?Logger}\n */\n get logger() {\n return this._logger;\n }\n}\n\n/**\n * Checks if the request is a transaction receipt or record request\n *\n * @template T\n * @param {T} request - The request to check\n * @returns {boolean} - True if the request is a transaction receipt or record\n */\nfunction isTransactionReceiptOrRecordRequest(request) {\n if (typeof request !== \"object\" || request === null) {\n return false;\n }\n\n return (\n \"transactionGetReceipt\" in request || \"transactionGetRecord\" in request\n );\n}\n\n/**\n * A simple function that returns a promise timeout for a specific period of time\n *\n * @param {boolean} isLocalNode\n * @param {number} attempt\n * @param {number} minBackoff\n * @param {number} maxBackoff\n * @returns {Promise<void>}\n */\nfunction delayForAttempt(isLocalNode, attempt, minBackoff, maxBackoff) {\n if (isLocalNode) {\n return new Promise((resolve) => setTimeout(resolve, minBackoff));\n }\n\n // 0.1s, 0.2s, 0.4s, 0.8s, ...\n const ms = Math.min(\n Math.floor(minBackoff * Math.pow(2, attempt)),\n maxBackoff,\n );\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"],"names":["ExecutionState","Finished","Retry","Error","RST_STREAM","DEFAULT_MAX_ATTEMPTS","Executable","constructor","this","_maxAttempts","_nodeAccountIds","List","transactionNodeIds","_signOnDemand","_minBackoff","_maxBackoff","_operator","_requestTimeout","_grpcDeadline","_logger","nodeAccountIds","isEmpty","setLocked","list","setNodeAccountIds","nodeIds","setList","maxRetries","console","warn","maxAttempts","setMaxRetries","setMaxAttempts","grpcDeadline","setGrpcDeadline","setMinBackoff","minBackoff","setMaxBackoff","maxBackoff","_beforeExecute","client","_makeRequestAsync","_mapStatusError","request","response","nodeId","_mapResponse","nodeAccountId","_execute","channel","_getTransactionId","_getLogId","_requestToBytes","_responseToBytes","_shouldRetry","_shouldRetryExceptionally","error","GrpcServiceError","status","_code","GrpcStatus","Timeout","Unavailable","ResourceExhausted","GrpcWeb","Internal","test","message","_setOperatorWith","accountId","publicKey","transactionSigner","executeWithSigner","signer","call","isBatchedAndNotBatchTransaction","execute","requestTimeout","isLocalNode","network","startTime","Date","now","persistentError","length","map","toString","some","includes","displayNodeAccountIds","slice","join","isSingleNode","attempt","MaxAttemptsOrTimeoutError","current","node","_network","getNode","advance","logId","debug","address","getChannel","isHealthy","isLastNode","index","isTransactionReceiptOrRecordRequest","delayForAttempt","promises","push","Promise","_","reject","setTimeout","trace","hex.encode","race","err","_fromResponse","JSON","stringify","HttpError","increaseBackoff","decreaseBackoff","shouldRetry","Status","Ok","Success","toBytes","setLogger","logger","resolve","ms","Math","min","floor","pow"],"mappings":"0QAwBY,MAACA,EAAiB,CAC1BC,SAAU,WACVC,MAAO,QACPC,MAAO,SAGEC,EAAa,6BACbC,EAAuB,GASrB,MAAMC,EACjB,WAAAC,GAOIC,KAAKC,aAjBuB,GA0B5BD,KAAKE,gBAAkB,IAAIC,EAS3BH,KAAKI,mBAAqB,GAK1BJ,KAAKK,eAAgB,EAQrBL,KAAKM,YAAc,KAQnBN,KAAKO,YAAc,IAYnBP,KAAKQ,UAAY,KAQjBR,KAAKS,gBAAkB,KAavBT,KAAKU,cAAgB,KAQrBV,KAAKW,QAAU,IACvB,CAQI,kBAAIC,GACA,OAAIZ,KAAKE,gBAAgBW,QACd,MAEPb,KAAKE,gBAAgBY,YACdd,KAAKE,gBAAgBa,KAExC,CAQI,iBAAAC,CAAkBC,GAId,OADAjB,KAAKE,gBAAgBgB,QAAQD,GAASH,YAC/Bd,IACf,CAMI,cAAImB,GAEA,OADAC,QAAQC,KAAK,uCACNrB,KAAKsB,WACpB,CAMI,aAAAC,CAAcJ,GAEV,OADAC,QAAQC,KAAK,4CACNrB,KAAKwB,eAAeL,EACnC,CAOI,eAAIG,GACA,OAAOtB,KAAKC,YACpB,CAQI,cAAAuB,CAAeF,GAGX,OAFAtB,KAAKC,aAAeqB,EAEbtB,IACf,CAOI,gBAAIyB,GACA,OAAOzB,KAAKU,aACpB,CAQI,eAAAgB,CAAgBD,GAGZ,OAFAzB,KAAKU,cAAgBe,EAEdzB,IACf,CAQI,aAAA2B,CAAcC,GAGV,GAAkB,MAAdA,EACA,MAAM,IAAIjC,MAAM,8B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G,MAChB,MAAMK,KAAKkC,gBACPC,EACAC,EACAG,GAER,QACI,MAAM,IAAI5C,MACN,8DAGxB,CAKQ,MAAM,IAAI2F,EACN,mBAAmBhE,EAAYwD,6DACR,MAAnBH,EAA0BA,EAAgBG,WAAa,KAE3D9E,KAAKE,gBAAgBqF,QAAQT,WAEzC,CAUI,OAAA2C,GACI,MAAM,IAAI9H,MAAM,kBACxB,CAQI,SAAA+H,CAAUC,GAEN,OADA3H,KAAKW,QAAUgH,EACR3H,IACf,CAOI,UAAI2H,GACA,OAAO3H,KAAKW,OACpB,EAUA,SAASwF,EAAoChE,GACzC,MAAuB,iBAAZA,GAAoC,OAAZA,IAK/B,0BAA2BA,GAAW,yBAA0BA,EAExE,CAWA,SAASiE,EAAgB9B,EAAae,EAASzD,EAAYE,GACvD,GAAIwC,EACA,OAAO,IAAIiC,QAASqB,GAAYlB,WAAWkB,EAAShG,IAIxD,MAAMiG,EAAKC,KAAKC,IACZD,KAAKE,MAAMpG,EAAakG,KAAKG,IAAI,EAAG5C,IACpCvD,GAEJ,OAAO,IAAIyE,QAASqB,GAAYlB,WAAWkB,EAASC,GACxD"}
|
|
1
|
+
{"version":3,"file":"Executable.js","sources":["../src/Executable.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport GrpcServiceError from \"./grpc/GrpcServiceError.js\";\nimport GrpcStatus from \"./grpc/GrpcStatus.js\";\nimport List from \"./transaction/List.js\";\nimport * as hex from \"./encoding/hex.js\";\nimport HttpError from \"./http/HttpError.js\";\nimport Status from \"./Status.js\";\nimport MaxAttemptsOrTimeoutError from \"./MaxAttemptsOrTimeoutError.js\";\n\n/**\n * @typedef {import(\"./account/AccountId.js\").default} AccountId\n * @typedef {import(\"./channel/Channel.js\").default} Channel\n * @typedef {import(\"./channel/MirrorChannel.js\").default} MirrorChannel\n * @typedef {import(\"./transaction/TransactionId.js\").default} TransactionId\n * @typedef {import(\"./client/Client.js\").ClientOperator} ClientOperator\n * @typedef {import(\"./Signer.js\").Signer} Signer\n * @typedef {import(\"./PublicKey.js\").default} PublicKey\n * @typedef {import(\"./logger/Logger.js\").default} Logger\n */\n\n/**\n * @enum {string}\n */\nexport const ExecutionState = {\n Finished: \"Finished\",\n Retry: \"Retry\",\n Error: \"Error\",\n};\n\nexport const RST_STREAM = /\\brst[^0-9a-zA-Z]stream\\b/i;\nexport const DEFAULT_MAX_ATTEMPTS = 10;\n\n/**\n * @abstract\n * @internal\n * @template RequestT\n * @template ResponseT\n * @template OutputT\n */\nexport default class Executable {\n constructor() {\n /**\n * The number of times we can retry the grpc call\n *\n * @internal\n * @type {number}\n */\n this._maxAttempts = DEFAULT_MAX_ATTEMPTS;\n\n /**\n * List of node account IDs for each transaction that has been\n * built.\n *\n * @internal\n * @type {List<AccountId>}\n */\n this._nodeAccountIds = new List();\n\n /**\n * List of the transaction node account IDs to check if\n * the node account ID of the request is in the list\n *\n * @protected\n * @type {Array<string>}\n */\n this.transactionNodeIds = [];\n\n /**\n * @internal\n */\n this._signOnDemand = false;\n\n /**\n * This is the request's min backoff\n *\n * @internal\n * @type {number | null}\n */\n this._minBackoff = null;\n\n /**\n * This is the request's max backoff\n *\n * @internal\n * @type {number}\n */\n this._maxBackoff = 8000;\n\n /**\n * The operator that was used to execute this request.\n * The reason we save the operator in the request is because of the signing on\n * demand feature. This feature requires us to sign new request on each attempt\n * meaning if a client with an operator was used we'd need to sign with the operator\n * on each attempt.\n *\n * @internal\n * @type {ClientOperator | null}\n */\n this._operator = null;\n\n /**\n * The complete timeout for running the `execute()` method\n *\n * @internal\n * @type {number | null}\n */\n this._requestTimeout = null;\n\n /**\n * The grpc request timeout aka deadline.\n *\n * The reason we have this is because there were times that consensus nodes held the grpc\n * connection, but didn't return anything; not error nor regular response. This resulted\n * in some weird behavior in the SDKs. To fix this we've added a grpc deadline to prevent\n * nodes from stalling the executing of a request.\n *\n * @internal\n * @type {number | null}\n */\n this._grpcDeadline = null;\n\n /**\n * Logger\n *\n * @protected\n * @type {Logger | null}\n */\n this._logger = null;\n }\n\n /**\n * Get the list of node account IDs on the request. If no nodes are set, then null is returned.\n * The reasoning for this is simply \"legacy behavior\".\n *\n * @returns {?AccountId[]}\n */\n get nodeAccountIds() {\n if (this._nodeAccountIds.isEmpty) {\n return null;\n } else {\n this._nodeAccountIds.setLocked();\n return this._nodeAccountIds.list;\n }\n }\n\n /**\n * Set the node account IDs on the request\n *\n * @param {AccountId[]} nodeIds\n * @returns {this}\n */\n setNodeAccountIds(nodeIds) {\n // Set the node account IDs, and lock the list. This will require `execute`\n // to use these nodes instead of random nodes from the network.\n this._nodeAccountIds.setList(nodeIds).setLocked();\n return this;\n }\n\n /**\n * @deprecated\n * @returns {number}\n */\n get maxRetries() {\n console.warn(\"Deprecated: use maxAttempts instead\");\n return this.maxAttempts;\n }\n\n /**\n * @param {number} maxRetries\n * @returns {this}\n */\n setMaxRetries(maxRetries) {\n console.warn(\"Deprecated: use setMaxAttempts() instead\");\n return this.setMaxAttempts(maxRetries);\n }\n\n /**\n * Get the max attempts on the request\n *\n * @returns {number}\n */\n get maxAttempts() {\n return this._maxAttempts;\n }\n\n /**\n * Set the max attempts on the request\n *\n * @param {number} maxAttempts\n * @returns {this}\n */\n setMaxAttempts(maxAttempts) {\n this._maxAttempts = maxAttempts;\n\n return this;\n }\n\n /**\n * Get the grpc deadline\n *\n * @returns {?number}\n */\n get grpcDeadline() {\n return this._grpcDeadline;\n }\n\n /**\n * Set the grpc deadline\n *\n * @param {number} grpcDeadline\n * @returns {this}\n */\n setGrpcDeadline(grpcDeadline) {\n this._grpcDeadline = grpcDeadline;\n\n return this;\n }\n\n /**\n * Set the min backoff for the request\n *\n * @param {number} minBackoff\n * @returns {this}\n */\n setMinBackoff(minBackoff) {\n // Honestly we shouldn't be checking for null since that should be TypeScript's job.\n // Also verify that min backoff is not greater than max backoff.\n if (minBackoff == null) {\n throw new Error(\"minBackoff cannot be null.\");\n } else if (this._maxBackoff != null && minBackoff > this._maxBackoff) {\n throw new Error(\"minBackoff cannot be larger than maxBackoff.\");\n }\n this._minBackoff = minBackoff;\n return this;\n }\n\n /**\n * Get the min backoff\n *\n * @returns {number | null}\n */\n get minBackoff() {\n return this._minBackoff;\n }\n\n /**\n * Set the max backoff for the request\n *\n * @param {?number} maxBackoff\n * @returns {this}\n */\n setMaxBackoff(maxBackoff) {\n // Honestly we shouldn't be checking for null since that should be TypeScript's job.\n // Also verify that max backoff is not less than min backoff.\n if (maxBackoff == null) {\n throw new Error(\"maxBackoff cannot be null.\");\n } else if (this._minBackoff != null && maxBackoff < this._minBackoff) {\n throw new Error(\"maxBackoff cannot be smaller than minBackoff.\");\n }\n this._maxBackoff = maxBackoff;\n return this;\n }\n\n /**\n * Get the max backoff\n *\n * @returns {number}\n */\n get maxBackoff() {\n return this._maxBackoff;\n }\n\n /**\n * This method is responsible for doing any work before the executing process begins.\n * For paid queries this will result in executing a cost query, for transactions this\n * will make sure we save the operator and sign any requests that need to be signed\n * in case signing on demand is disabled.\n *\n * @abstract\n * @protected\n * @param {import(\"./client/Client.js\").default<Channel, *>} client\n * @returns {Promise<void>}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _beforeExecute(client) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Create a protobuf request which will be passed into the `_execute()` method\n *\n * @abstract\n * @protected\n * @returns {Promise<RequestT>}\n */\n _makeRequestAsync() {\n throw new Error(\"not implemented\");\n }\n\n /**\n * This name is a bit wrong now, but the purpose of this method is to map the\n * request and response into an error. This method will only be called when\n * `_shouldRetry` returned `ExecutionState.Error`\n *\n * @abstract\n * @internal\n * @param {RequestT} request\n * @param {ResponseT} response\n * @param {AccountId} nodeId\n * @returns {Error}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _mapStatusError(request, response, nodeId) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Map the request, response, and the node account ID used for this attempt into a response.\n * This method will only be called when `_shouldRetry` returned `ExecutionState.Finished`\n *\n * @abstract\n * @protected\n * @param {ResponseT} response\n * @param {AccountId} nodeAccountId\n * @param {RequestT} request\n * @returns {Promise<OutputT>}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _mapResponse(response, nodeAccountId, request) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Perform a single grpc call with the given request. Each request has it's own\n * required service so we just pass in channel, and it'$ the request's responsiblity\n * to use the right service and call the right grpc method.\n *\n * @abstract\n * @internal\n * @param {Channel} channel\n * @param {RequestT} request\n * @returns {Promise<ResponseT>}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _execute(channel, request) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Return the current transaction ID for the request. All requests which are\n * use the same transaction ID for each node, but the catch is that `Transaction`\n * implicitly supports chunked transactions. Meaning there could be multiple\n * transaction IDs stored in the request, and a different transaction ID will be used\n * on subsequent calls to `execute()`\n *\n * FIXME: This method can most likely be removed, although some further inspection\n * is required.\n *\n * @abstract\n * @protected\n * @returns {TransactionId}\n */\n _getTransactionId() {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Return the log ID for this particular request\n *\n * Log IDs are simply a string constructed to make it easy to track each request's\n * execution even when mulitple requests are executing in parallel. Typically, this\n * method returns the format of `[<request type>.<timestamp of the transaction ID>]`\n *\n * Maybe we should deduplicate this using ${this.consturtor.name}\n *\n * @abstract\n * @internal\n * @returns {string}\n */\n _getLogId() {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Serialize the request into bytes\n *\n * @abstract\n * @param {RequestT} request\n * @returns {Uint8Array}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _requestToBytes(request) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Serialize the response into bytes\n *\n * @abstract\n * @param {ResponseT} response\n * @returns {Uint8Array}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _responseToBytes(response) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Determine if we should continue the execution process, error, or finish.\n *\n * FIXME: This method should really be called something else. Initially it returned\n * a boolean so `shouldRetry` made sense, but now it returns an enum, so the name\n * no longer makes sense.\n *\n * @abstract\n * @protected\n * @param {RequestT} request\n * @param {ResponseT} response\n * @returns {[Status, ExecutionState]}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _shouldRetry(request, response) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Determine if we should error based on the gRPC status\n *\n * Unlike `shouldRetry` this method does in fact still return a boolean\n *\n * @protected\n * @param {Error} error\n * @returns {boolean}\n */\n _shouldRetryExceptionally(error) {\n if (error instanceof GrpcServiceError) {\n return (\n error.status._code === GrpcStatus.Timeout._code ||\n error.status._code === GrpcStatus.DeadlineExceeded._code ||\n error.status._code === GrpcStatus.Unavailable._code ||\n error.status._code === GrpcStatus.ResourceExhausted._code ||\n error.status._code === GrpcStatus.GrpcWeb._code ||\n (error.status._code === GrpcStatus.Internal._code &&\n RST_STREAM.test(error.message))\n );\n } else {\n // if we get to the 'else' statement, the 'error' is instanceof 'HttpError'\n // and in this case, we have to retry always\n return true;\n }\n }\n\n /**\n * A helper method for setting the operator on the request\n *\n * @internal\n * @param {AccountId} accountId\n * @param {PublicKey} publicKey\n * @param {(message: Uint8Array) => Promise<Uint8Array>} transactionSigner\n * @returns {this}\n */\n _setOperatorWith(accountId, publicKey, transactionSigner) {\n this._operator = {\n transactionSigner,\n accountId,\n publicKey,\n };\n return this;\n }\n\n /**\n * Execute this request using the signer\n *\n * This method is part of the signature providers feature\n * https://hips.hedera.com/hip/hip-338\n *\n * @param {Signer} signer\n * @returns {Promise<OutputT>}\n */\n async executeWithSigner(signer) {\n return signer.call(this);\n }\n\n /**\n * @returns {boolean}\n * @abstract\n * @protected\n */\n isBatchedAndNotBatchTransaction() {\n return false;\n }\n\n /**\n * Execute the request using a client and an optional request timeout\n *\n * @template {Channel} ChannelT\n * @template {MirrorChannel} MirrorChannelT\n * @param {import(\"./client/Client.js\").default<ChannelT, MirrorChannelT>} client\n * @param {number=} requestTimeout\n * @returns {Promise<OutputT>}\n */\n async execute(client, requestTimeout) {\n // we check if its local node then backoff mechanism should be disabled\n // and we increase the retry attempts\n const isLocalNode = client.network[\"127.0.0.1:50211\"] != null;\n\n if (this.isBatchedAndNotBatchTransaction()) {\n throw new Error(\n \"Cannot execute batchified transaction outside of BatchTransaction\",\n );\n }\n\n // If the logger on the request is not set, use the logger in client\n // (if set, otherwise do not use logger)\n this._logger =\n this._logger == null\n ? client._logger != null\n ? client._logger\n : null\n : this._logger;\n\n // If the request timeout is set on the request we'll prioritize that instead\n // of the parameter provided, and if the parameter isn't provided we'll\n // use the default request timeout on client\n if (this._requestTimeout == null) {\n this._requestTimeout =\n requestTimeout != null ? requestTimeout : client.requestTimeout;\n }\n\n // If the grpc deadline is not set on the request, use the default value from client\n if (this._grpcDeadline == null) {\n this._grpcDeadline = client.grpcDeadline;\n }\n\n // Some request need to perform additional requests before the executing\n // such as paid queries need to fetch the cost of the query before\n // finally executing the actual query.\n await this._beforeExecute(client);\n\n // If the max backoff on the request is not set, use the default value in client\n if (this._maxBackoff == null) {\n this._maxBackoff = client.maxBackoff;\n }\n\n // If the min backoff on the request is not set, use the default value in client\n if (this._minBackoff == null) {\n this._minBackoff = client.minBackoff;\n }\n\n // Save the start time to be used later with request timeout\n const startTime = Date.now();\n\n // Saves each error we get so when we err due to max attempts exceeded we'll have\n // the last error that was returned by the consensus node\n let persistentError = null;\n\n // If the max attempts on the request is not set, use the default value in client\n // If the default value in client is not set, use a default of 10.\n //\n // FIXME: current implementation is wrong, update to follow comment above.\n // ... existing code ...\n const LOCAL_NODE_ATTEMPTS = 1000;\n const maxAttempts = isLocalNode\n ? LOCAL_NODE_ATTEMPTS\n : client._maxAttempts ?? this._maxAttempts;\n\n // Checks if has a valid nodes to which the TX can be sent\n if (this.transactionNodeIds.length) {\n const nodeAccountIds = this._nodeAccountIds.list.map((nodeId) =>\n nodeId.toString(),\n );\n\n const hasValidNodes = this.transactionNodeIds.some((nodeId) =>\n nodeAccountIds.includes(nodeId),\n );\n\n if (!hasValidNodes) {\n const displayNodeAccountIds =\n nodeAccountIds.length > 2\n ? `${nodeAccountIds.slice(0, 2).join(\", \")} ...`\n : nodeAccountIds.join(\", \");\n const isSingleNode = nodeAccountIds.length === 1;\n\n throw new Error(\n `Attempting to execute a transaction against node${\n isSingleNode ? \"\" : \"s\"\n } ${displayNodeAccountIds}, ` +\n `which ${\n isSingleNode ? \"is\" : \"are\"\n } not included in the Client's node list. Please review your Client configuration.`,\n );\n }\n }\n\n // The retry loop\n for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {\n // Determine if we've exceeded request timeout\n if (\n this._requestTimeout != null &&\n startTime + this._requestTimeout <= Date.now()\n ) {\n throw new MaxAttemptsOrTimeoutError(\n `timeout exceeded`,\n this._nodeAccountIds.isEmpty\n ? \"No node account ID set\"\n : this._nodeAccountIds.current.toString(),\n );\n }\n\n let nodeAccountId;\n let node;\n\n if (this._nodeAccountIds.isEmpty) {\n node = client._network.getNode();\n nodeAccountId = node.accountId;\n this._nodeAccountIds.setList([nodeAccountId]);\n } else {\n nodeAccountId = this._nodeAccountIds.current;\n node = client._network.getNode(nodeAccountId);\n }\n\n if (node == null) {\n throw new Error(\n `NodeAccountId not recognized: ${nodeAccountId.toString()}`,\n );\n }\n\n if (this.transactionNodeIds.length) {\n const isNodeAccountIdValid = this.transactionNodeIds.includes(\n nodeAccountId.toString(),\n );\n\n if (!isNodeAccountIdValid) {\n console.error(\n `Attempting to execute a transaction against node ${nodeAccountId.toString()}, which is not included in the Client's node list. Please review your Client configuration.`,\n );\n\n this._nodeAccountIds.advance();\n continue;\n }\n }\n\n // Get the log ID for the request.\n const logId = this._getLogId();\n if (this._logger) {\n this._logger.debug(\n `[${logId}] Node AccountID: ${node.accountId.toString()}, IP: ${node.address.toString()}`,\n );\n }\n\n const channel = node.getChannel();\n\n // Set the gRPC deadline on the channel if this query has a custom deadline\n if (this._grpcDeadline != null) {\n channel.setGrpcDeadline(this._grpcDeadline);\n }\n\n const request = await this._makeRequestAsync();\n\n let response;\n\n if (!node.isHealthy()) {\n const isLastNode =\n this._nodeAccountIds.index ===\n this._nodeAccountIds.list.length - 1;\n\n // Check if the request is a transaction receipt or record\n // request to retry 10 times, because getReceiptQuery/getRecordQuery\n // are single node requests\n if (\n isTransactionReceiptOrRecordRequest(request) ||\n isLocalNode\n ) {\n await delayForAttempt(\n isLocalNode,\n attempt,\n this._minBackoff,\n this._maxBackoff,\n );\n continue;\n }\n\n if (isLastNode || this._nodeAccountIds.length <= 1) {\n throw new Error(\n `Network connectivity issue: All nodes are unhealthy. Original node list: ${this._nodeAccountIds.list.join(\n \", \",\n )}`,\n );\n }\n\n if (this._logger) {\n this._logger.debug(\n `[${logId}] Node is not healthy, trying the next node.`,\n );\n }\n\n this._nodeAccountIds.advance();\n continue;\n }\n\n this._nodeAccountIds.advance();\n\n try {\n // Race the execution promise against the grpc timeout to prevent grpc connections\n // from blocking this request\n const promises = [];\n\n // If a grpc deadline is set, we should race it, otherwise the only thing in the\n // list of promises will be the execution promise.\n if (this._grpcDeadline != null) {\n promises.push(\n // eslint-disable-next-line ie11/no-loop-func\n new Promise((_, reject) =>\n setTimeout(\n // eslint-disable-next-line ie11/no-loop-func\n () =>\n reject(\n new GrpcServiceError(\n GrpcStatus.DeadlineExceeded,\n ),\n ),\n /** @type {number=} */ (this._grpcDeadline),\n ),\n ),\n );\n }\n if (this._logger) {\n this._logger.trace(\n `[${this._getLogId()}] sending protobuf ${hex.encode(\n this._requestToBytes(request),\n )}`,\n );\n }\n\n promises.push(this._execute(channel, request));\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n response = /** @type {ResponseT} */ (\n await Promise.race(promises)\n );\n } catch (err) {\n // If we received a grpc status error we need to determine if\n // we should retry on this error, or err from the request entirely.\n const error = GrpcServiceError._fromResponse(\n /** @type {Error} */ (err),\n );\n\n // Save the error in case we retry\n persistentError = error;\n if (this._logger) {\n this._logger.debug(\n `[${logId}] received error ${JSON.stringify(error)}`,\n );\n }\n\n if (\n (error instanceof GrpcServiceError ||\n error instanceof HttpError) &&\n this._shouldRetryExceptionally(error) &&\n attempt <= maxAttempts\n ) {\n // Increase the backoff for the particular node and remove it from\n // the healthy node list\n if (this._logger) {\n this._logger.debug(\n `[${this._getLogId()}] node with accountId: ${node.accountId.toString()} and proxy IP: ${node.address.toString()} is unhealthy`,\n );\n }\n\n client._network.increaseBackoff(node);\n continue;\n }\n\n throw err;\n }\n if (this._logger) {\n this._logger.trace(\n `[${this._getLogId()}] sending protobuf ${hex.encode(\n this._responseToBytes(response),\n )}`,\n );\n }\n\n // If we didn't receive an error we should decrease the current nodes backoff\n // in case it is a recovering node\n client._network.decreaseBackoff(node);\n\n // Determine what execution state we're in by the response\n // For transactions this would be as simple as checking the response status is `OK`\n // while for _most_ queries it would check if the response status is `SUCCESS`\n // The only odd balls are `TransactionReceiptQuery` and `TransactionRecordQuery`\n const [status, shouldRetry] = this._shouldRetry(request, response);\n if (\n status.toString() !== Status.Ok.toString() &&\n status.toString() !== Status.Success.toString()\n ) {\n persistentError = status;\n }\n\n // Determine by the executing state what we should do\n switch (shouldRetry) {\n case ExecutionState.Retry:\n await delayForAttempt(\n isLocalNode,\n attempt,\n this._minBackoff,\n this._maxBackoff,\n );\n continue;\n case ExecutionState.Finished:\n return this._mapResponse(response, nodeAccountId, request);\n case ExecutionState.Error:\n throw this._mapStatusError(\n request,\n response,\n nodeAccountId,\n );\n default:\n throw new Error(\n \"(BUG) non-exhaustive switch statement for `ExecutionState`\",\n );\n }\n }\n\n // We'll only get here if we've run out of attempts, so we return an error wrapping the\n // persistent error we saved before.\n\n throw new MaxAttemptsOrTimeoutError(\n `max attempts of ${maxAttempts.toString()} was reached for request with last error being: ${\n persistentError != null ? persistentError.toString() : \"\"\n }`,\n this._nodeAccountIds.current.toString(),\n );\n }\n\n /**\n * The current purpose of this method is to easily support signature providers since\n * signature providers need to serialize _any_ request into bytes. `Query` and `Transaction`\n * already implement `toBytes()` so it only made sense to make it available here too.\n *\n * @abstract\n * @returns {Uint8Array}\n */\n toBytes() {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Set logger\n *\n * @param {Logger} logger\n * @returns {this}\n */\n setLogger(logger) {\n this._logger = logger;\n return this;\n }\n\n /**\n * Get logger if set\n *\n * @returns {?Logger}\n */\n get logger() {\n return this._logger;\n }\n}\n\n/**\n * Checks if the request is a transaction receipt or record request\n *\n * @template T\n * @param {T} request - The request to check\n * @returns {boolean} - True if the request is a transaction receipt or record\n */\nfunction isTransactionReceiptOrRecordRequest(request) {\n if (typeof request !== \"object\" || request === null) {\n return false;\n }\n\n return (\n \"transactionGetReceipt\" in request || \"transactionGetRecord\" in request\n );\n}\n\n/**\n * A simple function that returns a promise timeout for a specific period of time\n *\n * @param {boolean} isLocalNode\n * @param {number} attempt\n * @param {number} minBackoff\n * @param {number} maxBackoff\n * @returns {Promise<void>}\n */\nfunction delayForAttempt(isLocalNode, attempt, minBackoff, maxBackoff) {\n if (isLocalNode) {\n return new Promise((resolve) => setTimeout(resolve, minBackoff));\n }\n\n // 0.1s, 0.2s, 0.4s, 0.8s, ...\n const ms = Math.min(\n Math.floor(minBackoff * Math.pow(2, attempt)),\n maxBackoff,\n );\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"],"names":["ExecutionState","Finished","Retry","Error","RST_STREAM","DEFAULT_MAX_ATTEMPTS","Executable","constructor","this","_maxAttempts","_nodeAccountIds","List","transactionNodeIds","_signOnDemand","_minBackoff","_maxBackoff","_operator","_requestTimeout","_grpcDeadline","_logger","nodeAccountIds","isEmpty","setLocked","list","setNodeAccountIds","nodeIds","setList","maxRetries","console","warn","maxAttempts","setMaxRetries","setMaxAttempts","grpcDeadline","setGrpcDeadline","setMinBackoff","minBackoff","setMaxBackoff","maxBackoff","_beforeExecute","client","_makeRequestAsync","_mapStatusError","request","response","nodeId","_mapResponse","nodeAccountId","_execute","channel","_getTransactionId","_getLogId","_requestToBytes","_responseToBytes","_shouldRetry","_shouldRetryExceptionally","error","GrpcServiceError","status","_code","GrpcStatus","Timeout","DeadlineExceeded","Unavailable","ResourceExhausted","GrpcWeb","Internal","test","message","_setOperatorWith","accountId","publicKey","transactionSigner","executeWithSigner","signer","call","isBatchedAndNotBatchTransaction","execute","requestTimeout","isLocalNode","network","startTime","Date","now","persistentError","length","map","toString","some","includes","displayNodeAccountIds","slice","join","isSingleNode","attempt","MaxAttemptsOrTimeoutError","current","node","_network","getNode","advance","logId","debug","address","getChannel","isHealthy","isLastNode","index","isTransactionReceiptOrRecordRequest","delayForAttempt","promises","push","Promise","_","reject","setTimeout","trace","hex.encode","race","err","_fromResponse","JSON","stringify","HttpError","increaseBackoff","decreaseBackoff","shouldRetry","Status","Ok","Success","toBytes","setLogger","logger","resolve","ms","Math","min","floor","pow"],"mappings":"0QAwBY,MAACA,EAAiB,CAC1BC,SAAU,WACVC,MAAO,QACPC,MAAO,SAGEC,EAAa,6BACbC,EAAuB,GASrB,MAAMC,EACjB,WAAAC,GAOIC,KAAKC,aAjBuB,GA0B5BD,KAAKE,gBAAkB,IAAIC,EAS3BH,KAAKI,mBAAqB,GAK1BJ,KAAKK,eAAgB,EAQrBL,KAAKM,YAAc,KAQnBN,KAAKO,YAAc,IAYnBP,KAAKQ,UAAY,KAQjBR,KAAKS,gBAAkB,KAavBT,KAAKU,cAAgB,KAQrBV,KAAKW,QAAU,IACvB,CAQI,kBAAIC,GACA,OAAIZ,KAAKE,gBAAgBW,QACd,MAEPb,KAAKE,gBAAgBY,YACdd,KAAKE,gBAAgBa,KAExC,CAQI,iBAAAC,CAAkBC,GAId,OADAjB,KAAKE,gBAAgBgB,QAAQD,GAASH,YAC/Bd,IACf,CAMI,cAAImB,GAEA,OADAC,QAAQC,KAAK,uCACNrB,KAAKsB,WACpB,CAMI,aAAAC,CAAcJ,GAEV,OADAC,QAAQC,KAAK,4CACNrB,KAAKwB,eAAeL,EACnC,CAOI,eAAIG,GACA,OAAOtB,KAAKC,YACpB,CAQI,cAAAuB,CAAeF,GAGX,OAFAt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,EACtC7G,KAAK6C,iBAAiBT,OAOlCJ,EAAO0D,SAAS2B,gBAAgB5B,GAMhC,MAAOvC,EAAQoE,GAAetH,KAAK8C,aAAaX,EAASC,GASzD,OAPIc,EAAO6B,aAAewC,EAAOC,GAAGzC,YAChC7B,EAAO6B,aAAewC,EAAOE,QAAQ1C,aAErCH,EAAkB1B,GAIdoE,GACJ,KAAK9H,EAAeE,YACV2G,EACF9B,EACAe,EACAtF,KAAKM,YACLN,KAAKO,aAET,SACJ,KAAKf,EAAeC,SAChB,OAAOO,KAAKsC,aAAaF,EAAUG,EAAeJ,GACtD,KAAK3C,EAAeG,MAChB,MAAMK,KAAKkC,gBACPC,EACAC,EACAG,GAER,QACI,MAAM,IAAI5C,MACN,8DAGxB,CAKQ,MAAM,IAAI4F,EACN,mBAAmBjE,EAAYyD,6DACR,MAAnBH,EAA0BA,EAAgBG,WAAa,KAE3D/E,KAAKE,gBAAgBsF,QAAQT,WAEzC,CAUI,OAAA2C,GACI,MAAM,IAAI/H,MAAM,kBACxB,CAQI,SAAAgI,CAAUC,GAEN,OADA5H,KAAKW,QAAUiH,EACR5H,IACf,CAOI,UAAI4H,GACA,OAAO5H,KAAKW,OACpB,EAUA,SAASyF,EAAoCjE,GACzC,MAAuB,iBAAZA,GAAoC,OAAZA,IAK/B,0BAA2BA,GAAW,yBAA0BA,EAExE,CAWA,SAASkE,EAAgB9B,EAAae,EAAS1D,EAAYE,GACvD,GAAIyC,EACA,OAAO,IAAIiC,QAASqB,GAAYlB,WAAWkB,EAASjG,IAIxD,MAAMkG,EAAKC,KAAKC,IACZD,KAAKE,MAAMrG,EAAamG,KAAKG,IAAI,EAAG5C,IACpCxD,GAEJ,OAAO,IAAI0E,QAASqB,GAAYlB,WAAWkB,EAASC,GACxD"}
|
package/lib/FeeComponents.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var HieroProto = _interopRequireWildcard(require("@
|
|
7
|
+
var HieroProto = _interopRequireWildcard(require("@hiero-ledger/proto"));
|
|
8
8
|
var _long = _interopRequireDefault(require("long"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
package/lib/FeeComponents.d.ts
CHANGED
package/lib/FeeComponents.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as t from"@
|
|
1
|
+
import*as t from"@hiero-ledger/proto";import"long";class n{constructor(t={}){this.min=t.min,this.max=t.max,this.constant=t.constant,this.transactionBandwidthByte=t.transactionBandwidthByte,this.transactionVerification=t.transactionVerification,this.transactionRamByteHour=t.transactionRamByteHour,this.transactionStorageByteHour=t.transactionStorageByteHour,this.contractTransactionGas=t.contractTransactionGas,this.transferVolumeHbar=t.transferVolumeHbar,this.responseMemoryByte=t.responseMemoryByte,this.responseDiskByte=t.responseDiskByte}static fromBytes(o){return n._fromProtobuf(t.proto.FeeComponents.decode(o))}static _fromProtobuf(t){return new n({min:null!=t.min?t.min:void 0,max:null!=t.max?t.max:void 0,constant:null!=t.constant?t.constant:void 0,transactionBandwidthByte:null!=t.bpt?t.bpt:void 0,transactionVerification:null!=t.vpt?t.vpt:void 0,transactionRamByteHour:null!=t.rbh?t.rbh:void 0,transactionStorageByteHour:null!=t.sbh?t.sbh:void 0,contractTransactionGas:null!=t.gas?t.gas:void 0,transferVolumeHbar:null!=t.tv?t.tv:void 0,responseMemoryByte:null!=t.bpr?t.bpr:void 0,responseDiskByte:null!=t.sbpr?t.sbpr:void 0})}_toProtobuf(){return{min:null!=this.min?this.min:void 0,max:null!=this.max?this.max:void 0,constant:null!=this.constant?this.constant:void 0,bpt:null!=this.transactionBandwidthByte?this.transactionBandwidthByte:void 0,vpt:null!=this.transactionVerification?this.transactionVerification:void 0,rbh:null!=this.transactionRamByteHour?this.transactionRamByteHour:void 0,sbh:null!=this.transactionStorageByteHour?this.transactionStorageByteHour:void 0,gas:null!=this.contractTransactionGas?this.contractTransactionGas:void 0,tv:null!=this.transferVolumeHbar?this.transferVolumeHbar:void 0,bpr:null!=this.responseMemoryByte?this.responseMemoryByte:void 0,sbpr:null!=this.responseDiskByte?this.responseDiskByte:void 0}}toBytes(){return t.proto.FeeComponents.encode(this._toProtobuf()).finish()}}export{n as default};
|
|
2
2
|
//# sourceMappingURL=FeeComponents.js.map
|
package/lib/FeeComponents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeeComponents.js","sources":["../src/FeeComponents.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport * as HieroProto from \"@
|
|
1
|
+
{"version":3,"file":"FeeComponents.js","sources":["../src/FeeComponents.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport * as HieroProto from \"@hiero-ledger/proto\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport Long from \"long\";\n\n/**\n * A set of values the nodes use in determining transaction and query fees, and\n * constants involved in fee calculations.\n */\nexport default class FeeComponents {\n /**\n * @param {object} [props]\n * @param {Long} [props.min]\n * @param {Long} [props.max]\n * @param {Long} [props.constant]\n * @param {Long} [props.transactionBandwidthByte]\n * @param {Long} [props.transactionVerification]\n * @param {Long} [props.transactionRamByteHour]\n * @param {Long} [props.transactionStorageByteHour]\n * @param {Long} [props.contractTransactionGas]\n * @param {Long} [props.transferVolumeHbar]\n * @param {Long} [props.responseMemoryByte]\n * @param {Long} [props.responseDiskByte]\n */\n constructor(props = {}) {\n /*\n * A minimum, the calculated fee must be greater than this value\n *\n * @type {Long}\n */\n this.min = props.min;\n\n /*\n * A maximum, the calculated fee must be less than this value\n *\n * @type {Long}\n */\n this.max = props.max;\n\n /*\n * A constant contribution to the fee\n *\n * @type {Long}\n */\n this.constant = props.constant;\n\n /*\n * The price of bandwidth consumed by a transaction, measured in bytes\n *\n * @type {Long}\n */\n this.transactionBandwidthByte = props.transactionBandwidthByte;\n\n /*\n * The price per signature verification for a transaction\n *\n * @type {Long}\n */\n this.transactionVerification = props.transactionVerification;\n\n /*\n * The price of RAM consumed by a transaction, measured in byte-hours\n *\n * @type {Long}\n */\n this.transactionRamByteHour = props.transactionRamByteHour;\n\n /*\n * The price of storage consumed by a transaction, measured in byte-hours\n *\n * @type {Long}\n */\n this.transactionStorageByteHour = props.transactionStorageByteHour;\n\n /*\n * The price of computation for a smart contract transaction, measured in gas\n *\n * @type {Long}\n */\n this.contractTransactionGas = props.contractTransactionGas;\n\n /*\n * The price per hbar transferred for a transfer\n *\n * @type {Long}\n */\n this.transferVolumeHbar = props.transferVolumeHbar;\n\n /*\n * The price of bandwidth for data retrieved from memory for a response, measured in bytes\n *\n * @type {Long}\n */\n this.responseMemoryByte = props.responseMemoryByte;\n\n /*\n * The price of bandwidth for data retrieved from disk for a response, measured in bytes\n *\n * @type {Long}\n */\n this.responseDiskByte = props.responseDiskByte;\n }\n\n /**\n * @param {Uint8Array} bytes\n * @returns {FeeComponents}\n */\n static fromBytes(bytes) {\n return FeeComponents._fromProtobuf(\n HieroProto.proto.FeeComponents.decode(bytes),\n );\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.IFeeComponents} feeComponents\n * @returns {FeeComponents}\n */\n static _fromProtobuf(feeComponents) {\n return new FeeComponents({\n min: feeComponents.min != null ? feeComponents.min : undefined,\n max: feeComponents.max != null ? feeComponents.max : undefined,\n constant:\n feeComponents.constant != null\n ? feeComponents.constant\n : undefined,\n transactionBandwidthByte:\n feeComponents.bpt != null ? feeComponents.bpt : undefined,\n transactionVerification:\n feeComponents.vpt != null ? feeComponents.vpt : undefined,\n transactionRamByteHour:\n feeComponents.rbh != null ? feeComponents.rbh : undefined,\n transactionStorageByteHour:\n feeComponents.sbh != null ? feeComponents.sbh : undefined,\n contractTransactionGas:\n feeComponents.gas != null ? feeComponents.gas : undefined,\n transferVolumeHbar:\n feeComponents.tv != null ? feeComponents.tv : undefined,\n responseMemoryByte:\n feeComponents.bpr != null ? feeComponents.bpr : undefined,\n responseDiskByte:\n feeComponents.sbpr != null ? feeComponents.sbpr : undefined,\n });\n }\n\n /**\n * @internal\n * @returns {HieroProto.proto.IFeeComponents}\n */\n _toProtobuf() {\n return {\n min: this.min != null ? this.min : undefined,\n max: this.max != null ? this.max : undefined,\n constant: this.constant != null ? this.constant : undefined,\n bpt:\n this.transactionBandwidthByte != null\n ? this.transactionBandwidthByte\n : undefined,\n vpt:\n this.transactionVerification != null\n ? this.transactionVerification\n : undefined,\n rbh:\n this.transactionRamByteHour != null\n ? this.transactionRamByteHour\n : undefined,\n sbh:\n this.transactionStorageByteHour != null\n ? this.transactionStorageByteHour\n : undefined,\n gas:\n this.contractTransactionGas != null\n ? this.contractTransactionGas\n : undefined,\n tv:\n this.transferVolumeHbar != null\n ? this.transferVolumeHbar\n : undefined,\n bpr:\n this.responseMemoryByte != null\n ? this.responseMemoryByte\n : undefined,\n sbpr:\n this.responseDiskByte != null\n ? this.responseDiskByte\n : undefined,\n };\n }\n\n /**\n * @returns {Uint8Array}\n */\n toBytes() {\n return HieroProto.proto.FeeComponents.encode(\n this._toProtobuf(),\n ).finish();\n }\n}\n"],"names":["FeeComponents","constructor","props","this","min","max","constant","transactionBandwidthByte","transactionVerification","transactionRamByteHour","transactionStorageByteHour","contractTransactionGas","transferVolumeHbar","responseMemoryByte","responseDiskByte","fromBytes","bytes","_fromProtobuf","HieroProto","proto","decode","feeComponents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