@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
package/lib/FeeData.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 _FeeComponents = _interopRequireDefault(require("./FeeComponents.cjs"));
|
|
9
9
|
var _FeeDataType = _interopRequireDefault(require("./FeeDataType.cjs"));
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/lib/FeeData.d.ts
CHANGED
package/lib/FeeData.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as t from"@
|
|
1
|
+
import*as t from"@hiero-ledger/proto";import e from"./FeeComponents.js";import o from"./FeeDataType.js";class a{constructor(t={}){this.nodedata=t.nodedata,this.networkdata=t.networkdata,this.servicedata=t.servicedata,this.feeDataType=t.feeDataType}static fromBytes(e){return a._fromProtobuf(t.proto.FeeData.decode(e))}static _fromProtobuf(t){return new a({nodedata:null!=t.nodedata?e._fromProtobuf(t.nodedata):void 0,networkdata:null!=t.networkdata?e._fromProtobuf(t.networkdata):void 0,servicedata:null!=t.servicedata?e._fromProtobuf(t.servicedata):void 0,feeDataType:null!=t.subType?o._fromCode(t.subType):void 0})}_toProtobuf(){return{nodedata:null!=this.nodedata?this.nodedata._toProtobuf():void 0,networkdata:null!=this.networkdata?this.networkdata._toProtobuf():void 0,servicedata:null!=this.servicedata?this.servicedata._toProtobuf():void 0,subType:null!=this.feeDataType?this.feeDataType.valueOf():void 0}}toBytes(){return t.proto.FeeData.encode(this._toProtobuf()).finish()}}export{a as default};
|
|
2
2
|
//# sourceMappingURL=FeeData.js.map
|
package/lib/FeeData.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeeData.js","sources":["../src/FeeData.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport * as HieroProto from \"@
|
|
1
|
+
{"version":3,"file":"FeeData.js","sources":["../src/FeeData.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport * as HieroProto from \"@hiero-ledger/proto\";\nimport FeeComponents from \"./FeeComponents.js\";\nimport FeeDataType from \"./FeeDataType.js\";\n\n/**\n * A total fee, in component amounts charged for a transaction.\n *\n * Total fees are composed of three sets of components.\n * - Node data, components that compensate the specific node that submitted\n * the transaction.\n * - Network data, components that compensate the Hedera network for gossiping\n * the transaction and determining the consensus timestamp.\n * - Service data, components that compensate the Hedera network for the ongoing\n * maintenance and operation of the network, as well as ongoing development\n * of network services.\n *\n * Fee components are recorded in thousandths of a tiny cent, and the network\n * exchange rate converts these to tinybar amounts, which are what the network\n * charges for transactions and what the network reports in the record stream.\n */\nexport default class FeeData {\n /**\n * @param {object} [props]\n * @param {FeeComponents} [props.nodedata]\n * @param {FeeComponents} [props.networkdata]\n * @param {FeeComponents} [props.servicedata]\n * @param {FeeDataType} [props.feeDataType]\n */\n constructor(props = {}) {\n /*\n * Fee paid to the submitting node\n *\n * @type {FeeComponents}\n */\n this.nodedata = props.nodedata;\n\n /*\n * Fee paid to the network for processing a transaction into consensus\n *\n * @type {FeeComponents}\n */\n this.networkdata = props.networkdata;\n\n /*\n * Fee paid to the network for providing the service associated with the transaction; for instance, storing a file\n *\n * @type {FeeComponents}\n */\n this.servicedata = props.servicedata;\n\n /*\n * SubType distinguishing between different types of FeeData, correlating to the same HederaFunctionality\n *\n * @type {SubType}\n */\n this.feeDataType = props.feeDataType;\n }\n\n /**\n * @param {Uint8Array} bytes\n * @returns {FeeData}\n */\n static fromBytes(bytes) {\n return FeeData._fromProtobuf(HieroProto.proto.FeeData.decode(bytes));\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.IFeeData} feeData\n * @returns {FeeData}\n */\n static _fromProtobuf(feeData) {\n return new FeeData({\n nodedata:\n feeData.nodedata != null\n ? FeeComponents._fromProtobuf(feeData.nodedata)\n : undefined,\n networkdata:\n feeData.networkdata != null\n ? FeeComponents._fromProtobuf(feeData.networkdata)\n : undefined,\n servicedata:\n feeData.servicedata != null\n ? FeeComponents._fromProtobuf(feeData.servicedata)\n : undefined,\n feeDataType:\n feeData.subType != null\n ? FeeDataType._fromCode(feeData.subType)\n : undefined,\n });\n }\n\n /**\n * @internal\n * @returns {HieroProto.proto.IFeeData}\n */\n _toProtobuf() {\n return {\n nodedata:\n this.nodedata != null ? this.nodedata._toProtobuf() : undefined,\n\n networkdata:\n this.networkdata != null\n ? this.networkdata._toProtobuf()\n : undefined,\n\n servicedata:\n this.servicedata != null\n ? this.servicedata._toProtobuf()\n : undefined,\n\n subType:\n this.feeDataType != null\n ? this.feeDataType.valueOf()\n : undefined,\n };\n }\n\n /**\n * @returns {Uint8Array}\n */\n toBytes() {\n return HieroProto.proto.FeeData.encode(this._toProtobuf()).finish();\n }\n}\n"],"names":["FeeData","constructor","props","this","nodedata","networkdata","servicedata","feeDataType","fromBytes","bytes","_fromProtobuf","HieroProto","proto","decode","feeData","FeeComponents","undefined","subType","FeeDataType","_fromCode","_toProtobuf","valueOf","toBytes","encode","finish"],"mappings":"wGAsBe,MAAMA,EAQjB,WAAAC,CAAYC,EAAQ,IAMhBC,KAAKC,SAAWF,EAAME,SAOtBD,KAAKE,YAAcH,EAAMG,YAOzBF,KAAKG,YAAcJ,EAAMI,YAOzBH,KAAKI,YAAcL,EAAMK,WACjC,CAMI,gBAAOC,CAAUC,GACb,OAAOT,EAAQU,cAAcC,EAAWC,MAAMZ,QAAQa,OAAOJ,GACrE,CAOI,oBAAOC,CAAcI,GACjB,OAAO,IAAId,EAAQ,CACfI,SACwB,MAApBU,EAAQV,SACFW,EAAcL,cAAcI,EAAQV,eACpCY,EACVX,YAC2B,MAAvBS,EAAQT,YACFU,EAAcL,cAAcI,EAAQT,kBACpCW,EACVV,YAC2B,MAAvBQ,EAAQR,YACFS,EAAcL,cAAcI,EAAQR,kBACpCU,EACVT,YACuB,MAAnBO,EAAQG,QACFC,EAAYC,UAAUL,EAAQG,cAC9BD,GAEtB,CAMI,WAAAI,GACI,MAAO,CACHhB,SACqB,MAAjBD,KAAKC,SAAmBD,KAAKC,SAASgB,mBAAgBJ,EAE1DX,YACwB,MAApBF,KAAKE,YACCF,KAAKE,YAAYe,mBACjBJ,EAEVV,YACwB,MAApBH,KAAKG,YACCH,KAAKG,YAAYc,mBACjBJ,EAEVC,QACwB,MAApBd,KAAKI,YACCJ,KAAKI,YAAYc,eACjBL,EAEtB,CAKI,OAAAM,GACI,OAAOX,EAAWC,MAAMZ,QAAQuB,OAAOpB,KAAKiB,eAAeI,QACnE"}
|
package/lib/FeeDataType.cjs
CHANGED
package/lib/FeeDataType.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @namespace proto
|
|
3
|
-
* @typedef {import("@
|
|
3
|
+
* @typedef {import("@hiero-ledger/proto").proto.SubType} HieroProto.proto.SubType
|
|
4
4
|
*/
|
|
5
5
|
declare class FeeDataType {
|
|
6
6
|
/**
|
|
@@ -39,6 +39,6 @@ declare namespace FeeDataType {
|
|
|
39
39
|
export default FeeDataType;
|
|
40
40
|
export namespace HieroProto {
|
|
41
41
|
namespace proto {
|
|
42
|
-
type SubType = import("@
|
|
42
|
+
type SubType = import("@hiero-ledger/proto").proto.SubType;
|
|
43
43
|
}
|
|
44
44
|
}
|
package/lib/FeeDataType.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeeDataType.js","sources":["../src/FeeDataType.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * @namespace proto\n * @typedef {import(\"@
|
|
1
|
+
{"version":3,"file":"FeeDataType.js","sources":["../src/FeeDataType.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.SubType} HieroProto.proto.SubType\n */\n\nexport default class FeeDataType {\n /**\n * @hideconstructor\n * @internal\n * @param {number} code\n */\n constructor(code) {\n /** @readonly */\n this._code = code;\n\n Object.freeze(this);\n }\n\n /**\n * @returns {string}\n */\n toString() {\n switch (this) {\n case FeeDataType.Default:\n return \"DEFAULT\";\n case FeeDataType.TokenFungibleCommon:\n return \"TOKEN_FUNGIBLE_COMMON\";\n case FeeDataType.TokenNonFungibleUnique:\n return \"TOKEN_NON_FUNGIBLE_UNIQUE\";\n case FeeDataType.TokenFungibleCommonWithCustomFees:\n return \"TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES\";\n case FeeDataType.TokenNonFungibleUniqueWithCustomFees:\n return \"TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES\";\n case FeeDataType.ScheduleCreateContractCall:\n return \"SCHEDULE_CREATE_CONTRACT_CALL\";\n case FeeDataType.TopicCreateWithCustomFees:\n return \"TOPIC_CREATE_WITH_CUSTOM_FEES\";\n case FeeDataType.SubmitMessageWithCustomFees:\n return \"SUBMIT_MESSAGE_WITH_CUSTOM_FEES\";\n default:\n return `UNKNOWN (${this._code})`;\n }\n }\n\n /**\n * @internal\n * @param {number} code\n * @returns {FeeDataType}\n */\n static _fromCode(code) {\n switch (code) {\n case 0:\n return FeeDataType.Default;\n case 1:\n return FeeDataType.TokenFungibleCommon;\n case 2:\n return FeeDataType.TokenNonFungibleUnique;\n case 3:\n return FeeDataType.TokenFungibleCommonWithCustomFees;\n case 4:\n return FeeDataType.TokenNonFungibleUniqueWithCustomFees;\n case 5:\n return FeeDataType.ScheduleCreateContractCall;\n case 6:\n return FeeDataType.TopicCreateWithCustomFees;\n case 7:\n return FeeDataType.SubmitMessageWithCustomFees;\n }\n\n throw new Error(\n `(BUG) SubType.fromCode() does not handle code: ${code}`,\n );\n }\n\n /**\n * @returns {HieroProto.proto.SubType}\n */\n valueOf() {\n return this._code;\n }\n}\n\n/**\n * The resource prices have no special scope\n */\nFeeDataType.Default = new FeeDataType(0);\n\n/**\n * The resource prices are scoped to an operation on a fungible common token\n */\nFeeDataType.TokenFungibleCommon = new FeeDataType(1);\n\n/**\n * The resource prices are scoped to an operation on a non-fungible unique token\n */\nFeeDataType.TokenNonFungibleUnique = new FeeDataType(2);\n\n/**\n * The resource prices are scoped to an operation on a fungible common token with a custom fee schedule\n */\nFeeDataType.TokenFungibleCommonWithCustomFees = new FeeDataType(3);\n\n/**\n * The resource prices are scoped to an operation on a non-fungible unique token with a custom fee schedule\n */\nFeeDataType.TokenNonFungibleUniqueWithCustomFees = new FeeDataType(4);\n\n/**\n * The resource prices are scoped to a ScheduleCreate containing a ContractCall.\n */\nFeeDataType.ScheduleCreateContractCall = new FeeDataType(5);\n\n/**\n * The resource cost for the transaction type includes a TopicCreate\n * with custom fees.\n */\nFeeDataType.TopicCreateWithCustomFees = new FeeDataType(6);\n\n/**\n * The resource cost for the transaction type includes a ConsensusSubmitMessage\n * for a topic with custom fees.\n */\nFeeDataType.SubmitMessageWithCustomFees = new FeeDataType(7);\n"],"names":["FeeDataType","constructor","code","this","_code","Object","freeze","toString","Default","TokenFungibleCommon","TokenNonFungibleUnique","TokenFungibleCommonWithCustomFees","TokenNonFungibleUniqueWithCustomFees","ScheduleCreateContractCall","TopicCreateWithCustomFees","SubmitMessageWithCustomFees","_fromCode","Error","valueOf"],"mappings":"AAOe,MAAMA,EAMjB,WAAAC,CAAYC,GAERC,KAAKC,MAAQF,EAEbG,OAAOC,OAAOH,KACtB,CAKI,QAAAI,GACI,OAAQJ,MACJ,KAAKH,EAAYQ,QACb,MAAO,UACX,KAAKR,EAAYS,oBACb,MAAO,wBACX,KAAKT,EAAYU,uBACb,MAAO,4BACX,KAAKV,EAAYW,kCACb,MAAO,yCACX,KAAKX,EAAYY,qCACb,MAAO,6CACX,KAAKZ,EAAYa,2BACb,MAAO,gCACX,KAAKb,EAAYc,0BACb,MAAO,gCACX,KAAKd,EAAYe,4BACb,MAAO,kCACX,QACI,MAAO,YAAYZ,KAAKC,SAExC,CAOI,gBAAOY,CAAUd,GACb,OAAQA,GACJ,KAAK,EACD,OAAOF,EAAYQ,QACvB,KAAK,EACD,OAAOR,EAAYS,oBACvB,KAAK,EACD,OAAOT,EAAYU,uBACvB,KAAK,EACD,OAAOV,EAAYW,kCACvB,KAAK,EACD,OAAOX,EAAYY,qCACvB,KAAK,EACD,OAAOZ,EAAYa,2BACvB,KAAK,EACD,OAAOb,EAAYc,0BACvB,KAAK,EACD,OAAOd,EAAYe,4BAG3B,MAAM,IAAIE,MACN,kDAAkDf,IAE9D,CAKI,OAAAgB,GACI,OAAOf,KAAKC,KACpB,EAMAJ,EAAYQ,QAAU,IAAIR,EAAY,GAKtCA,EAAYS,oBAAsB,IAAIT,EAAY,GAKlDA,EAAYU,uBAAyB,IAAIV,EAAY,GAKrDA,EAAYW,kCAAoC,IAAIX,EAAY,GAKhEA,EAAYY,qCAAuC,IAAIZ,EAAY,GAKnEA,EAAYa,2BAA6B,IAAIb,EAAY,GAMzDA,EAAYc,0BAA4B,IAAId,EAAY,GAMxDA,EAAYe,4BAA8B,IAAIf,EAAY"}
|
package/lib/FeeSchedule.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 _TransactionFeeSchedule = _interopRequireDefault(require("./TransactionFeeSchedule.cjs"));
|
|
9
9
|
var _Timestamp = _interopRequireDefault(require("./Timestamp.cjs"));
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/lib/FeeSchedule.d.ts
CHANGED
package/lib/FeeSchedule.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"@
|
|
1
|
+
import*as e from"@hiero-ledger/proto";import t from"./TransactionFeeSchedule.js";import o from"./Timestamp.js";class r{constructor(e={}){this.transactionFeeSchedule=e.transactionFeeSchedule,this.expirationTime=e.expirationTime}static fromBytes(t){return r._fromProtobuf(e.proto.FeeSchedule.decode(t))}static _fromProtobuf(e){return new r({transactionFeeSchedule:null!=e.transactionFeeSchedule?e.transactionFeeSchedule.map(e=>t._fromProtobuf(e)):void 0,expirationTime:null!=e.expiryTime?o._fromProtobuf(e.expiryTime):void 0})}_toProtobuf(){return{transactionFeeSchedule:null!=this.transactionFeeSchedule?this.transactionFeeSchedule.map(e=>e._toProtobuf()):void 0,expiryTime:null!=this.expirationTime?this.expirationTime._toProtobuf():void 0}}toBytes(){return e.proto.FeeSchedule.encode(this._toProtobuf()).finish()}}export{r as default};
|
|
2
2
|
//# sourceMappingURL=FeeSchedule.js.map
|
package/lib/FeeSchedule.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeeSchedule.js","sources":["../src/FeeSchedule.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport * as HieroProto from \"@
|
|
1
|
+
{"version":3,"file":"FeeSchedule.js","sources":["../src/FeeSchedule.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport * as HieroProto from \"@hiero-ledger/proto\";\nimport TransactionFeeSchedule from \"./TransactionFeeSchedule.js\";\nimport Timestamp from \"./Timestamp.js\";\n\n/**\n * A set of fee schedules covering all transaction types and query types, along\n * with a specific time at which this fee schedule will expire.\n */\nexport default class FeeSchedule {\n /**\n * @param {object} [props]\n * @param {TransactionFeeSchedule[]} [props.transactionFeeSchedule]\n * @param {Timestamp} [props.expirationTime]\n */\n constructor(props = {}) {\n /*\n * List of price coefficients for network resources\n *\n * @type {TransactionFeeSchedule}\n */\n this.transactionFeeSchedule = props.transactionFeeSchedule;\n\n /*\n * FeeSchedule expiry time\n *\n * @type {Timestamp}\n */\n this.expirationTime = props.expirationTime;\n }\n\n /**\n * @param {Uint8Array} bytes\n * @returns {FeeSchedule}\n */\n static fromBytes(bytes) {\n return FeeSchedule._fromProtobuf(\n HieroProto.proto.FeeSchedule.decode(bytes),\n );\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.IFeeSchedule} feeSchedule\n * @returns {FeeSchedule}\n */\n static _fromProtobuf(feeSchedule) {\n return new FeeSchedule({\n transactionFeeSchedule:\n feeSchedule.transactionFeeSchedule != null\n ? feeSchedule.transactionFeeSchedule.map((schedule) =>\n TransactionFeeSchedule._fromProtobuf(schedule),\n )\n : undefined,\n expirationTime:\n feeSchedule.expiryTime != null\n ? Timestamp._fromProtobuf(feeSchedule.expiryTime)\n : undefined,\n });\n }\n\n /**\n * @internal\n * @returns {HieroProto.proto.IFeeSchedule}\n */\n _toProtobuf() {\n return {\n transactionFeeSchedule:\n this.transactionFeeSchedule != null\n ? this.transactionFeeSchedule.map((transaction) =>\n transaction._toProtobuf(),\n )\n : undefined,\n expiryTime:\n this.expirationTime != null\n ? this.expirationTime._toProtobuf()\n : undefined,\n };\n }\n\n /**\n * @returns {Uint8Array}\n */\n toBytes() {\n return HieroProto.proto.FeeSchedule.encode(this._toProtobuf()).finish();\n }\n}\n"],"names":["FeeSchedule","constructor","props","this","transactionFeeSchedule","expirationTime","fromBytes","bytes","_fromProtobuf","HieroProto","proto","decode","feeSchedule","map","schedule","TransactionFeeSchedule","undefined","expiryTime","Timestamp","_toProtobuf","transaction","toBytes","encode","finish"],"mappings":"+GAUe,MAAMA,EAMjB,WAAAC,CAAYC,EAAQ,IAMhBC,KAAKC,uBAAyBF,EAAME,uBAOpCD,KAAKE,eAAiBH,EAAMG,cACpC,CAMI,gBAAOC,CAAUC,GACb,OAAOP,EAAYQ,cACfC,EAAWC,MAAMV,YAAYW,OAAOJ,GAEhD,CAOI,oBAAOC,CAAcI,GACjB,OAAO,IAAIZ,EAAY,CACnBI,uBAC0C,MAAtCQ,EAAYR,uBACNQ,EAAYR,uBAAuBS,IAAKC,GACpCC,EAAuBP,cAAcM,SAEzCE,EACVX,eAC8B,MAA1BO,EAAYK,WACNC,EAAUV,cAAcI,EAAYK,iBACpCD,GAEtB,CAMI,WAAAG,GACI,MAAO,CACHf,uBACmC,MAA/BD,KAAKC,uBACCD,KAAKC,uBAAuBS,IAAKO,GAC7BA,EAAYD,oBAEhBH,EACVC,WAC2B,MAAvBd,KAAKE,eACCF,KAAKE,eAAec,mBACpBH,EAEtB,CAKI,OAAAK,GACI,OAAOZ,EAAWC,MAAMV,YAAYsB,OAAOnB,KAAKgB,eAAeI,QACvE"}
|
package/lib/FeeSchedules.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 _FeeSchedule = _interopRequireDefault(require("./FeeSchedule.cjs"));
|
|
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/FeeSchedules.d.ts
CHANGED
package/lib/FeeSchedules.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"@
|
|
1
|
+
import*as e from"@hiero-ledger/proto";import t from"./FeeSchedule.js";class r{constructor(e={}){this.current=e.currentFeeSchedule,this.next=e.nextFeeSchedule}static fromBytes(t){return r._fromProtobuf(e.proto.CurrentAndNextFeeSchedule.decode(t))}static _fromProtobuf(e){return new r({currentFeeSchedule:null!=e.currentFeeSchedule?t._fromProtobuf(e.currentFeeSchedule):void 0,nextFeeSchedule:null!=e.nextFeeSchedule?t._fromProtobuf(e.nextFeeSchedule):void 0})}_toProtobuf(){return{currentFeeSchedule:null!=this.current?this.current._toProtobuf():void 0,nextFeeSchedule:null!=this.next?this.next._toProtobuf():void 0}}toBytes(){return e.proto.CurrentAndNextFeeSchedule.encode(this._toProtobuf()).finish()}}export{r as default};
|
|
2
2
|
//# sourceMappingURL=FeeSchedules.js.map
|
package/lib/FeeSchedules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeeSchedules.js","sources":["../src/FeeSchedules.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport * as HieroProto from \"@
|
|
1
|
+
{"version":3,"file":"FeeSchedules.js","sources":["../src/FeeSchedules.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport * as HieroProto from \"@hiero-ledger/proto\";\nimport FeeSchedule from \"./FeeSchedule.js\";\n\n/**\n * Represents a pair of fee schedules on the Hedera network - the currently active fee schedule\n * and the next upcoming fee schedule. This structure allows for transparent fee updates by making\n * future fee changes visible before they take effect.\n */\nexport default class FeeSchedules {\n /**\n * @param {object} [props]\n * @param {FeeSchedule} [props.currentFeeSchedule]\n * @param {FeeSchedule} [props.nextFeeSchedule]\n */\n constructor(props = {}) {\n /*\n * Contains current Fee Schedule\n *\n * @type {FeeSchedule}\n */\n this.current = props.currentFeeSchedule;\n\n /*\n * Contains next Fee Schedule\n *\n * @type {FeeSchedule}\n */\n this.next = props.nextFeeSchedule;\n }\n\n /**\n * @param {Uint8Array} bytes\n * @returns {FeeSchedules}\n */\n static fromBytes(bytes) {\n return FeeSchedules._fromProtobuf(\n HieroProto.proto.CurrentAndNextFeeSchedule.decode(bytes),\n );\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ICurrentAndNextFeeSchedule} feeSchedules\n * @returns {FeeSchedules}\n */\n static _fromProtobuf(feeSchedules) {\n return new FeeSchedules({\n currentFeeSchedule:\n feeSchedules.currentFeeSchedule != null\n ? FeeSchedule._fromProtobuf(feeSchedules.currentFeeSchedule)\n : undefined,\n nextFeeSchedule:\n feeSchedules.nextFeeSchedule != null\n ? FeeSchedule._fromProtobuf(feeSchedules.nextFeeSchedule)\n : undefined,\n });\n }\n\n /**\n * @internal\n * @returns {HieroProto.proto.ICurrentAndNextFeeSchedule}\n */\n _toProtobuf() {\n return {\n currentFeeSchedule:\n this.current != null ? this.current._toProtobuf() : undefined,\n nextFeeSchedule:\n this.next != null ? this.next._toProtobuf() : undefined,\n };\n }\n\n /**\n * @returns {Uint8Array}\n */\n toBytes() {\n return HieroProto.proto.CurrentAndNextFeeSchedule.encode(\n this._toProtobuf(),\n ).finish();\n }\n}\n"],"names":["FeeSchedules","constructor","props","this","current","currentFeeSchedule","next","nextFeeSchedule","fromBytes","bytes","_fromProtobuf","HieroProto","proto","CurrentAndNextFeeSchedule","decode","feeSchedules","FeeSchedule","undefined","_toProtobuf","toBytes","encode","finish"],"mappings":"sEAUe,MAAMA,EAMjB,WAAAC,CAAYC,EAAQ,IAMhBC,KAAKC,QAAUF,EAAMG,mBAOrBF,KAAKG,KAAOJ,EAAMK,eAC1B,CAMI,gBAAOC,CAAUC,GACb,OAAOT,EAAaU,cAChBC,EAAWC,MAAMC,0BAA0BC,OAAOL,GAE9D,CAOI,oBAAOC,CAAcK,GACjB,OAAO,IAAIf,EAAa,CACpBK,mBACuC,MAAnCU,EAAaV,mBACPW,EAAYN,cAAcK,EAAaV,yBACvCY,EACVV,gBACoC,MAAhCQ,EAAaR,gBACPS,EAAYN,cAAcK,EAAaR,sBACvCU,GAEtB,CAMI,WAAAC,GACI,MAAO,CACHb,mBACoB,MAAhBF,KAAKC,QAAkBD,KAAKC,QAAQc,mBAAgBD,EACxDV,gBACiB,MAAbJ,KAAKG,KAAeH,KAAKG,KAAKY,mBAAgBD,EAE9D,CAKI,OAAAE,GACI,OAAOR,EAAWC,MAAMC,0BAA0BO,OAC9CjB,KAAKe,eACPG,QACV"}
|
package/lib/FreezeType.cjs
CHANGED
|
@@ -8,7 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @namespace proto
|
|
11
|
-
* @typedef {import("@
|
|
11
|
+
* @typedef {import("@hiero-ledger/proto").proto.FreezeType} HieroProto.proto.FreezeType
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
class FreezeType {
|
package/lib/FreezeType.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @namespace proto
|
|
3
|
-
* @typedef {import("@
|
|
3
|
+
* @typedef {import("@hiero-ledger/proto").proto.FreezeType} HieroProto.proto.FreezeType
|
|
4
4
|
*/
|
|
5
5
|
declare class FreezeType {
|
|
6
6
|
/**
|
|
@@ -37,6 +37,6 @@ declare namespace FreezeType {
|
|
|
37
37
|
export default FreezeType;
|
|
38
38
|
export namespace HieroProto {
|
|
39
39
|
namespace proto {
|
|
40
|
-
type FreezeType = import("@
|
|
40
|
+
type FreezeType = import("@hiero-ledger/proto").proto.FreezeType;
|
|
41
41
|
}
|
|
42
42
|
}
|
package/lib/FreezeType.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FreezeType.js","sources":["../src/FreezeType.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * @namespace proto\n * @typedef {import(\"@
|
|
1
|
+
{"version":3,"file":"FreezeType.js","sources":["../src/FreezeType.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.FreezeType} HieroProto.proto.FreezeType\n */\n\nexport default class FreezeType {\n /**\n * @hideconstructor\n * @internal\n * @param {number} code\n */\n constructor(code) {\n /** @readonly */\n this._code = code;\n\n Object.freeze(this);\n }\n\n /**\n * @returns {string}\n */\n toString() {\n switch (this) {\n case FreezeType.UnknownFreezeType:\n return \"UNKNOWN_FREEZE_TYPE\";\n case FreezeType.FreezeOnly:\n return \"FREEZE_ONLY\";\n case FreezeType.PrepareUpgrade:\n return \"PREPARE_UPGRADE\";\n case FreezeType.FreezeUpgrade:\n return \"FREEZE_UPGRADE\";\n case FreezeType.FreezeAbort:\n return \"FREEZE_ABORT\";\n case FreezeType.TelemetryUpgrade:\n return \"TELEMETRY_UPGRADE\";\n default:\n return `UNKNOWN (${this._code})`;\n }\n }\n\n /**\n * @internal\n * @param {number} code\n * @returns {FreezeType}\n */\n static _fromCode(code) {\n switch (code) {\n case 0:\n return FreezeType.UnknownFreezeType;\n case 1:\n return FreezeType.FreezeOnly;\n case 2:\n return FreezeType.PrepareUpgrade;\n case 3:\n return FreezeType.FreezeUpgrade;\n case 4:\n return FreezeType.FreezeAbort;\n case 5:\n return FreezeType.TelemetryUpgrade;\n default:\n throw new Error(\n `(BUG) Status.fromCode() does not handle code: ${code}`,\n );\n }\n }\n\n /**\n * @returns {HieroProto.proto.FreezeType}\n */\n valueOf() {\n return this._code;\n }\n}\n\n/**\n * An (invalid) default value for this enum, to ensure the client explicitly sets\n * the intended type of freeze transaction.\n */\nFreezeType.UnknownFreezeType = new FreezeType(0);\n\n/**\n * Freezes the network at the specified time. The start_time field must be provided and\n * must reference a future time. Any values specified for the update_file and file_hash\n * fields will be ignored. This transaction does not perform any network changes or\n * upgrades and requires manual intervention to restart the network.\n */\nFreezeType.FreezeOnly = new FreezeType(1);\n\n/**\n * A non-freezing operation that initiates network wide preparation in advance of a\n * scheduled freeze upgrade. The update_file and file_hash fields must be provided and\n * valid. The start_time field may be omitted and any value present will be ignored.\n */\nFreezeType.PrepareUpgrade = new FreezeType(2);\n\n/**\n * Freezes the network at the specified time and performs the previously prepared\n * automatic upgrade across the entire network.\n */\nFreezeType.FreezeUpgrade = new FreezeType(3);\n\n/**\n * Aborts a pending network freeze operation.\n */\nFreezeType.FreezeAbort = new FreezeType(4);\n\n/**\n * Performs an immediate upgrade on auxilary services and containers providing\n * telemetry/metrics. Does not impact network operations.\n */\nFreezeType.TelemetryUpgrade = new FreezeType(5);\n"],"names":["FreezeType","constructor","code","this","_code","Object","freeze","toString","UnknownFreezeType","FreezeOnly","PrepareUpgrade","FreezeUpgrade","FreezeAbort","TelemetryUpgrade","_fromCode","Error","valueOf"],"mappings":"AAOe,MAAMA,EAMjB,WAAAC,CAAYC,GAERC,KAAKC,MAAQF,EAEbG,OAAOC,OAAOH,KACtB,CAKI,QAAAI,GACI,OAAQJ,MACJ,KAAKH,EAAWQ,kBACZ,MAAO,sBACX,KAAKR,EAAWS,WACZ,MAAO,cACX,KAAKT,EAAWU,eACZ,MAAO,kBACX,KAAKV,EAAWW,cACZ,MAAO,iBACX,KAAKX,EAAWY,YACZ,MAAO,eACX,KAAKZ,EAAWa,iBACZ,MAAO,oBACX,QACI,MAAO,YAAYV,KAAKC,SAExC,CAOI,gBAAOU,CAAUZ,GACb,OAAQA,GACJ,KAAK,EACD,OAAOF,EAAWQ,kBACtB,KAAK,EACD,OAAOR,EAAWS,WACtB,KAAK,EACD,OAAOT,EAAWU,eACtB,KAAK,EACD,OAAOV,EAAWW,cACtB,KAAK,EACD,OAAOX,EAAWY,YACtB,KAAK,EACD,OAAOZ,EAAWa,iBACtB,QACI,MAAM,IAAIE,MACN,iDAAiDb,KAGrE,CAKI,OAAAc,GACI,OAAOb,KAAKC,KACpB,EAOAJ,EAAWQ,kBAAoB,IAAIR,EAAW,GAQ9CA,EAAWS,WAAa,IAAIT,EAAW,GAOvCA,EAAWU,eAAiB,IAAIV,EAAW,GAM3CA,EAAWW,cAAgB,IAAIX,EAAW,GAK1CA,EAAWY,YAAc,IAAIZ,EAAW,GAMxCA,EAAWa,iBAAmB,IAAIb,EAAW"}
|
package/lib/Key.cjs
CHANGED
|
@@ -10,7 +10,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @namespace proto
|
|
13
|
-
* @typedef {import("@
|
|
13
|
+
* @typedef {import("@hiero-ledger/proto").proto.IKey} HieroProto.proto.IKey
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
class Key {
|
package/lib/Key.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
|
export default class Key {
|
|
6
6
|
/**
|
|
@@ -18,6 +18,6 @@ export default class Key {
|
|
|
18
18
|
}
|
|
19
19
|
export namespace HieroProto {
|
|
20
20
|
namespace proto {
|
|
21
|
-
type IKey = import("@
|
|
21
|
+
type IKey = import("@hiero-ledger/proto").proto.IKey;
|
|
22
22
|
}
|
|
23
23
|
}
|
package/lib/Key.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Key.js","sources":["../src/Key.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport CACHE from \"./Cache.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@
|
|
1
|
+
{"version":3,"file":"Key.js","sources":["../src/Key.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport CACHE from \"./Cache.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.IKey} HieroProto.proto.IKey\n */\n\nexport default class Key {\n /**\n * @internal\n * @abstract\n * @returns {HieroProto.proto.IKey}\n */\n // eslint-disable-next-line jsdoc/require-returns-check\n _toProtobufKey() {\n throw new Error(\"not implemented\");\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.IKey} key\n * @returns {Key}\n */\n static _fromProtobufKey(key) {\n if (key.contractID != null) {\n return CACHE.contractId(key.contractID);\n }\n\n if (key.delegatableContractId != null) {\n return CACHE.delegateContractId(key.delegatableContractId);\n }\n\n if (key.ed25519 != null && key.ed25519.byteLength > 0) {\n return CACHE.publicKeyED25519(key.ed25519);\n }\n\n if (key.ECDSASecp256k1 != null && key.ECDSASecp256k1.byteLength > 0) {\n return CACHE.publicKeyECDSA(key.ECDSASecp256k1);\n }\n\n if (key.thresholdKey != null && key.thresholdKey.threshold != null) {\n return CACHE.thresholdKey(key.thresholdKey);\n }\n\n if (key.keyList != null) {\n return CACHE.keyList(key.keyList);\n }\n\n // @ts-ignore\n return null;\n\n /* throw new Error(\n `(BUG) keyFromProtobuf: not implemented key case: ${JSON.stringify(\n key\n )}`\n ); */\n }\n}\n"],"names":["Key","_toProtobufKey","Error","_fromProtobufKey","key","contractID","CACHE","contractId","delegatableContractId","delegateContractId","ed25519","byteLength","publicKeyED25519","ECDSASecp256k1","publicKeyECDSA","thresholdKey","threshold","keyList"],"mappings":"0BASe,MAAMA,EAOjB,cAAAC,GACI,MAAM,IAAIC,MAAM,kBACxB,CAOI,uBAAOC,CAAiBC,GACpB,OAAsB,MAAlBA,EAAIC,WACGC,EAAMC,WAAWH,EAAIC,YAGC,MAA7BD,EAAII,sBACGF,EAAMG,mBAAmBL,EAAII,uBAGrB,MAAfJ,EAAIM,SAAmBN,EAAIM,QAAQC,WAAa,EACzCL,EAAMM,iBAAiBR,EAAIM,SAGZ,MAAtBN,EAAIS,gBAA0BT,EAAIS,eAAeF,WAAa,EACvDL,EAAMQ,eAAeV,EAAIS,gBAGZ,MAApBT,EAAIW,cAAsD,MAA9BX,EAAIW,aAAaC,UACtCV,EAAMS,aAAaX,EAAIW,cAGf,MAAfX,EAAIa,QACGX,EAAMW,QAAQb,EAAIa,SAItB,IAOf"}
|
package/lib/KeyList.cjs
CHANGED
|
@@ -11,9 +11,9 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @namespace proto
|
|
14
|
-
* @typedef {import("@
|
|
15
|
-
* @typedef {import("@
|
|
16
|
-
* @typedef {import("@
|
|
14
|
+
* @typedef {import("@hiero-ledger/proto").proto.IKey} HieroProto.proto.IKey
|
|
15
|
+
* @typedef {import("@hiero-ledger/proto").proto.IKeyList} HieroProto.proto.IKeyList
|
|
16
|
+
* @typedef {import("@hiero-ledger/proto").proto.IThresholdKey} HieroProto.proto.IThresholdKey
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
/**
|
package/lib/KeyList.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @namespace proto
|
|
3
|
-
* @typedef {import("@
|
|
4
|
-
* @typedef {import("@
|
|
5
|
-
* @typedef {import("@
|
|
3
|
+
* @typedef {import("@hiero-ledger/proto").proto.IKey} HieroProto.proto.IKey
|
|
4
|
+
* @typedef {import("@hiero-ledger/proto").proto.IKeyList} HieroProto.proto.IKeyList
|
|
5
|
+
* @typedef {import("@hiero-ledger/proto").proto.IThresholdKey} HieroProto.proto.IThresholdKey
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* A list of Keys (`Key`) with an optional threshold.
|
|
@@ -79,9 +79,9 @@ export default class KeyList extends Key {
|
|
|
79
79
|
}
|
|
80
80
|
export namespace HieroProto {
|
|
81
81
|
namespace proto {
|
|
82
|
-
type IKey = import("@
|
|
83
|
-
type IKeyList = import("@
|
|
84
|
-
type IThresholdKey = import("@
|
|
82
|
+
type IKey = import("@hiero-ledger/proto").proto.IKey;
|
|
83
|
+
type IKeyList = import("@hiero-ledger/proto").proto.IKeyList;
|
|
84
|
+
type IThresholdKey = import("@hiero-ledger/proto").proto.IThresholdKey;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
import Key from "./Key.js";
|
package/lib/KeyList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyList.js","sources":["../src/KeyList.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Key from \"./Key.js\";\nimport CACHE from \"./Cache.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@
|
|
1
|
+
{"version":3,"file":"KeyList.js","sources":["../src/KeyList.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Key from \"./Key.js\";\nimport CACHE from \"./Cache.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.IKey} HieroProto.proto.IKey\n * @typedef {import(\"@hiero-ledger/proto\").proto.IKeyList} HieroProto.proto.IKeyList\n * @typedef {import(\"@hiero-ledger/proto\").proto.IThresholdKey} HieroProto.proto.IThresholdKey\n */\n\n/**\n * A list of Keys (`Key`) with an optional threshold.\n */\nexport default class KeyList extends Key {\n /**\n * @param {?Key[]} [keys]\n * @param {?number} [threshold]\n */\n constructor(keys, threshold) {\n super();\n\n /**\n * @private\n * @type {Key[]}\n */\n // @ts-ignore\n if (keys == null) this._keys = [];\n //checks if the value for `keys` is passed as a single key\n //rather than a list that contains just one key\n else if (keys instanceof Key) this._keys = [keys];\n else this._keys = keys;\n\n /**\n * @type {?number}\n */\n this._threshold = threshold == null ? null : threshold;\n }\n\n /**\n * @param {Key[]} keys\n * @returns {KeyList}\n */\n static of(...keys) {\n return new KeyList(keys, null);\n }\n\n /**\n * @template T\n * @param {ArrayLike<Key>} arrayLike\n * @param {((key: Key) => Key)} [mapFn]\n * @param {T} [thisArg]\n * @returns {KeyList}\n */\n static from(arrayLike, mapFn, thisArg) {\n if (mapFn == null) {\n return new KeyList(Array.from(arrayLike));\n }\n\n return new KeyList(Array.from(arrayLike, mapFn, thisArg));\n }\n\n /**\n * @returns {?number}\n */\n get threshold() {\n return this._threshold;\n }\n\n /**\n * @param {number} threshold\n * @returns {this}\n */\n setThreshold(threshold) {\n this._threshold = threshold;\n return this;\n }\n\n /**\n * @param {Key[]} keys\n * @returns {number}\n */\n push(...keys) {\n return this._keys.push(...keys);\n }\n\n /**\n * @param {number} start\n * @param {number} deleteCount\n * @param {Key[]} items\n * @returns {KeyList}\n */\n splice(start, deleteCount, ...items) {\n return new KeyList(\n this._keys.splice(start, deleteCount, ...items),\n this.threshold,\n );\n }\n\n /**\n * @param {number=} start\n * @param {number=} end\n * @returns {KeyList}\n */\n slice(start, end) {\n return new KeyList(this._keys.slice(start, end), this.threshold);\n }\n\n /**\n * @returns {Iterator<Key>}\n */\n [Symbol.iterator]() {\n return this._keys[Symbol.iterator]();\n }\n\n /**\n * @returns {Key[]}\n */\n toArray() {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this._keys.slice();\n }\n\n /**\n * @returns {string}\n */\n toString() {\n return JSON.stringify({\n threshold: this._threshold,\n keys: this._keys.toString(),\n });\n }\n\n /**\n * @returns {HieroProto.proto.IKey}\n */\n _toProtobufKey() {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return\n const keys = this._keys.map((key) => key._toProtobufKey());\n\n if (this.threshold == null) {\n return { keyList: { keys } };\n } else {\n return {\n thresholdKey: {\n threshold: this.threshold,\n keys: { keys },\n },\n };\n }\n }\n\n /**\n * @param {HieroProto.proto.IKeyList} key\n * @returns {KeyList}\n */\n static __fromProtobufKeyList(key) {\n const keys = (key.keys != null ? key.keys : []).map((key) =>\n Key._fromProtobufKey(key),\n );\n return new KeyList(keys);\n }\n\n /**\n * @param {HieroProto.proto.IThresholdKey} key\n * @returns {KeyList}\n */\n static __fromProtobufThresoldKey(key) {\n const list = KeyList.__fromProtobufKeyList(\n key.keys != null ? key.keys : {},\n );\n list.setThreshold(key.threshold != null ? key.threshold : 0);\n return list;\n }\n}\n\nCACHE.setKeyList((key) => KeyList.__fromProtobufKeyList(key));\nCACHE.setThresholdKey((key) => KeyList.__fromProtobufThresoldKey(key));\n"],"names":["KeyList","Key","constructor","keys","threshold","super","this","_keys","_threshold","of","from","arrayLike","mapFn","thisArg","Array","setThreshold","push","splice","start","deleteCount","items","slice","end","Symbol","iterator","toArray","toString","JSON","stringify","_toProtobufKey","map","key","keyList","thresholdKey","__fromProtobufKeyList","_fromProtobufKey","__fromProtobufThresoldKey","list","CACHE","setKeyList","setThresholdKey"],"mappings":"kDAee,MAAMA,UAAgBC,EAKjC,WAAAC,CAAYC,EAAMC,GACdC,QAOkBC,KAAKC,MAAX,MAARJ,EAA2B,GAGtBA,aAAgBF,EAAkB,CAACE,GAC1BA,EAKlBG,KAAKE,WAA0B,MAAbJ,EAAoB,KAAOA,CACrD,CAMI,SAAOK,IAAMN,GACT,OAAO,IAAIH,EAAQG,EAAM,KACjC,CASI,WAAOO,CAAKC,EAAWC,EAAOC,GAC1B,OACW,IAAIb,EADF,MAATY,EACmBE,MAAMJ,KAAKC,GAGfG,MAAMJ,KAAKC,EAAWC,EAAOC,GACxD,CAKI,aAAIT,GACA,OAAOE,KAAKE,UACpB,CAMI,YAAAO,CAAaX,GAET,OADAE,KAAKE,WAAaJ,EACXE,IACf,CAMI,IAAAU,IAAQb,GACJ,OAAOG,KAAKC,MAAMS,QAAQb,EAClC,CAQI,MAAAc,CAAOC,EAAOC,KAAgBC,GAC1B,OAAO,IAAIpB,EACPM,KAAKC,MAAMU,OAAOC,EAAOC,KAAgBC,GACzCd,KAAKF,UAEjB,CAOI,KAAAiB,CAAMH,EAAOI,GACT,OAAO,IAAItB,EAAQM,KAAKC,MAAMc,MAAMH,EAAOI,GAAMhB,KAAKF,UAC9D,CAKI,CAACmB,OAAOC,YACJ,OAAOlB,KAAKC,MAAMgB,OAAOC,WACjC,CAKI,OAAAC,GAEI,OAAOnB,KAAKC,MAAMc,OAC1B,CAKI,QAAAK,GACI,OAAOC,KAAKC,UAAU,CAClBxB,UAAWE,KAAKE,WAChBL,KAAMG,KAAKC,MAAMmB,YAE7B,CAKI,cAAAG,GAEI,MAAM1B,EAAOG,KAAKC,MAAMuB,IAAKC,GAAQA,EAAIF,kBAEzC,OAAsB,MAAlBvB,KAAKF,UACE,CAAE4B,QAAS,CAAE7B,SAEb,CACH8B,aAAc,CACV7B,UAAWE,KAAKF,UAChBD,KAAM,CAAEA,SAI5B,CAMI,4BAAO+B,CAAsBH,GACzB,MAAM5B,GAAoB,MAAZ4B,EAAI5B,KAAe4B,EAAI5B,KAAO,IAAI2B,IAAKC,GACjD9B,EAAIkC,iBAAiBJ,IAEzB,OAAO,IAAI/B,EAAQG,EAC3B,CAMI,gCAAOiC,CAA0BL,GAC7B,MAAMM,EAAOrC,EAAQkC,sBACL,MAAZH,EAAI5B,KAAe4B,EAAI5B,KAAO,CAAE,GAGpC,OADAkC,EAAKtB,aAA8B,MAAjBgB,EAAI3B,UAAoB2B,EAAI3B,UAAY,GACnDiC,CACf,EAGAC,EAAMC,WAAYR,GAAQ/B,EAAQkC,sBAAsBH,IACxDO,EAAME,gBAAiBT,GAAQ/B,EAAQoC,0BAA0BL"}
|
package/lib/Mnemonic.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _cryptography = require("@
|
|
7
|
+
var _cryptography = require("@hiero-ledger/cryptography");
|
|
8
8
|
var _Cache = _interopRequireDefault(require("./Cache.cjs"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
// SPDX-License-Identifier: Apache-2.0
|
package/lib/Mnemonic.d.ts
CHANGED
|
@@ -142,4 +142,4 @@ export default class Mnemonic {
|
|
|
142
142
|
toString(): string;
|
|
143
143
|
}
|
|
144
144
|
export type PrivateKey = import("./PrivateKey.js").default;
|
|
145
|
-
import { Mnemonic as MnemonicCryptography } from "@
|
|
145
|
+
import { Mnemonic as MnemonicCryptography } from "@hiero-ledger/cryptography";
|
package/lib/Mnemonic.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Mnemonic as t}from"@
|
|
1
|
+
import{Mnemonic as t}from"@hiero-ledger/cryptography";import e from"./Cache.js";class a{constructor(t){this._mnemonic=t}static async generate(){return new a(await t._generate(24))}static async generate12(){return new a(await t._generate(12))}static async fromWords(e){return new a(await t.fromWords(e))}async toPrivateKey(t=""){return e.privateKeyConstructor(await this._mnemonic.toPrivateKey(t))}async toEd25519PrivateKey(t="",a){return e.privateKeyConstructor(await this._mnemonic.toEd25519PrivateKey(t,a))}async toStandardEd25519PrivateKey(t="",a){return e.privateKeyConstructor(await this._mnemonic.toStandardEd25519PrivateKey(t,a))}async toEcdsaPrivateKey(t="",a){return e.privateKeyConstructor(await this._mnemonic.toEcdsaPrivateKey(t,a))}calculateDerivationPathValues(t){const e=/m\/(\d+'?)\/(\d+'?)\/(\d+'?)\/(\d+'?)\/(\d+'?)/.exec(t),a=new Array(5);if(e)for(let t=1;t<=5;t++){let r=e[t];r.endsWith("'")?(r=r.substring(0,r.length-1),a[t-1]=2147483648|parseInt(r,10)):a[t-1]=parseInt(r,10)}return a}async toStandardECDSAsecp256k1PrivateKeyImpl(t,e){return await this.toEcdsaPrivateKey(t,e)}async toStandardECDSAsecp256k1PrivateKey(t="",a){return e.privateKeyConstructor(await this._mnemonic.toStandardECDSAsecp256k1PrivateKey(t,a))}async toStandardECDSAsecp256k1PrivateKeyCustomDerivationPath(t="",e){const a=this.calculateDerivationPathValues(e);return await this.toStandardECDSAsecp256k1PrivateKeyImpl(t,a)}static async fromString(e){return new a(await t.fromString(e))}async toLegacyPrivateKey(){return e.privateKeyConstructor(await this._mnemonic.toLegacyPrivateKey())}async toSeed(e){return await t.toSeed(this._mnemonic.words,e)}toString(){return this._mnemonic.toString()}}export{a as default};
|
|
2
2
|
//# sourceMappingURL=Mnemonic.js.map
|
package/lib/Mnemonic.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mnemonic.js","sources":["../src/Mnemonic.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport { Mnemonic as MnemonicCryptography } from \"@hashgraph/cryptography\";\nimport CACHE from \"./Cache.js\";\n\n/**\n * @typedef {import(\"./PrivateKey.js\").default} PrivateKey\n */\n\nconst HARDENED_BIT = 0x80000000;\n\n/**\n * Multi-word mnemonic phrase (BIP-39).\n *\n * Compatible with the official Hiero mobile\n * wallets (24-words or 22-words) and BRD (12-words).\n */\nexport default class Mnemonic {\n /**\n * @param {MnemonicCryptography} mnemonic\n * @hideconstructor\n * @private\n */\n constructor(mnemonic) {\n this._mnemonic = mnemonic;\n }\n\n /**\n * Returns a new random 24-word mnemonic from the BIP-39\n * standard English word list.\n *\n * @returns {Promise<Mnemonic>}\n */\n static async generate() {\n return new Mnemonic(await MnemonicCryptography._generate(24));\n }\n\n /**\n * Returns a new random 12-word mnemonic from the BIP-39\n * standard English word list.\n *\n * @returns {Promise<Mnemonic>}\n */\n static async generate12() {\n return new Mnemonic(await MnemonicCryptography._generate(12));\n }\n\n /**\n * Construct a mnemonic from a list of words. Handles 12, 22 (legacy), and 24 words.\n *\n * An exception of BadMnemonicError will be thrown if the mnemonic\n * contains unknown words or fails the checksum. An invalid mnemonic\n * can still be used to create private keys, the exception will\n * contain the failing mnemonic in case you wish to ignore the\n * validation error and continue.\n *\n * @param {string[]} words\n * @throws {cryptography.BadMnemonicError}\n * @returns {Promise<Mnemonic>}\n */\n static async fromWords(words) {\n return new Mnemonic(await MnemonicCryptography.fromWords(words));\n }\n\n /**\n * @deprecated - Use `toStandardEd25519PrivateKey()` or `toStandardECDSAsecp256k1PrivateKey()` instead\n * Recover a private key from this mnemonic phrase, with an\n * optional passphrase.\n * @param {string} [passphrase]\n * @returns {Promise<PrivateKey>}\n */\n async toPrivateKey(passphrase = \"\") {\n return CACHE.privateKeyConstructor(\n // eslint-disable-next-line deprecation/deprecation\n await this._mnemonic.toPrivateKey(passphrase),\n );\n }\n\n /**\n * @deprecated - Use `toStandardEd25519PrivateKey()` or `toStandardECDSAsecp256k1PrivateKey()` instead\n * Recover an Ed25519 private key from this mnemonic phrase, with an\n * optional passphrase.\n * @param {string} [passphrase]\n * @param {number[]} [path]\n * @returns {Promise<PrivateKey>}\n */\n async toEd25519PrivateKey(passphrase = \"\", path) {\n return CACHE.privateKeyConstructor(\n // eslint-disable-next-line deprecation/deprecation\n await this._mnemonic.toEd25519PrivateKey(passphrase, path),\n );\n }\n\n /**\n * Recover an Ed25519 private key from this mnemonic phrase, with an\n * optional passphrase.\n *\n * @param {string} [passphrase]\n * @param {number} [index]\n * @returns {Promise<PrivateKey>}\n */\n async toStandardEd25519PrivateKey(passphrase = \"\", index) {\n return CACHE.privateKeyConstructor(\n await this._mnemonic.toStandardEd25519PrivateKey(passphrase, index),\n );\n }\n\n /**\n * @deprecated - Use `toStandardEd25519PrivateKey()` or `toStandardECDSAsecp256k1PrivateKey()` instead\n * Recover an ECDSA private key from this mnemonic phrase, with an\n * optional passphrase.\n * @param {string} [passphrase]\n * @param {number[]} [path]\n * @returns {Promise<PrivateKey>}\n */\n async toEcdsaPrivateKey(passphrase = \"\", path) {\n return CACHE.privateKeyConstructor(\n // eslint-disable-next-line deprecation/deprecation\n await this._mnemonic.toEcdsaPrivateKey(passphrase, path),\n );\n }\n\n /**\n * Converts a derivation path from string to an array of integers.\n * Note that this expects precisely 5 components in the derivation path,\n * as per BIP-44:\n * `m / purpose' / coin_type' / account' / change / address_index`\n * Takes into account `'` for hardening as per BIP-32,\n * and does not prescribe which components should be hardened.\n *\n * @param {string} derivationPath the derivation path in BIP-44 format,\n * e.g. \"m/44'/60'/0'/0/0\"\n * @returns {Array<number>} to be used with PrivateKey#derive\n */\n calculateDerivationPathValues(derivationPath) {\n // Parse the derivation path from string into values\n const pattern = /m\\/(\\d+'?)\\/(\\d+'?)\\/(\\d+'?)\\/(\\d+'?)\\/(\\d+'?)/;\n const matches = pattern.exec(derivationPath);\n const values = new Array(5); // as Array<Number>;\n if (matches) {\n // Extract numbers and use apostrophe to select if is hardened\n for (let i = 1; i <= 5; i++) {\n let value = matches[i];\n if (value.endsWith(\"'\")) {\n value = value.substring(0, value.length - 1);\n values[i - 1] = parseInt(value, 10) | HARDENED_BIT;\n } else {\n values[i - 1] = parseInt(value, 10);\n }\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return values;\n }\n\n /**\n * Common implementation for both `toStandardECDSAsecp256k1PrivateKey`\n * functions.\n *\n * @param {string} passphrase the passphrase used to protect the\n * mnemonic, use \"\" for none\n * @param {Array<number>} derivationPathValues derivation path as an\n * integer array,\n * see: `calculateDerivationPathValues`\n * @returns {Promise<PrivateKey>} a private key\n */\n async toStandardECDSAsecp256k1PrivateKeyImpl(\n passphrase,\n derivationPathValues,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n return await this.toEcdsaPrivateKey(passphrase, derivationPathValues);\n }\n\n /**\n * Recover an ECDSA private key from this mnemonic phrase, with an\n * optional passphrase.\n *\n * @param {string} [passphrase]\n * @param {number} [index]\n * @returns {Promise<PrivateKey>}\n */\n async toStandardECDSAsecp256k1PrivateKey(passphrase = \"\", index) {\n return CACHE.privateKeyConstructor(\n await this._mnemonic.toStandardECDSAsecp256k1PrivateKey(\n passphrase,\n index,\n ),\n );\n }\n\n /**\n * Recover an ECDSAsecp256k1 private key from this mnemonic phrase and\n * derivation path, with an optional passphrase\n *\n * @param {string} passphrase the passphrase used to protect the mnemonic,\n * use \"\" for none\n * @param {string} derivationPath the derivation path in BIP-44 format,\n * e.g. \"m/44'/60'/0'/0/0\"\n * @returns {Promise<PrivateKey>} the private key\n */\n async toStandardECDSAsecp256k1PrivateKeyCustomDerivationPath(\n passphrase = \"\",\n derivationPath,\n ) {\n const derivationPathValues =\n this.calculateDerivationPathValues(derivationPath);\n return await this.toStandardECDSAsecp256k1PrivateKeyImpl(\n passphrase,\n derivationPathValues,\n );\n }\n\n /**\n * Recover a mnemonic phrase from a string, splitting on spaces. Handles 12, 22 (legacy), and 24 words.\n *\n * @param {string} mnemonic\n * @returns {Promise<Mnemonic>}\n */\n static async fromString(mnemonic) {\n return new Mnemonic(await MnemonicCryptography.fromString(mnemonic));\n }\n\n /**\n * @returns {Promise<PrivateKey>}\n */\n async toLegacyPrivateKey() {\n return CACHE.privateKeyConstructor(\n await this._mnemonic.toLegacyPrivateKey(),\n );\n }\n\n /**\n * @param {string} passphrase\n * @returns {Promise<Uint8Array>}\n */\n async toSeed(passphrase) {\n return await MnemonicCryptography.toSeed(\n this._mnemonic.words,\n passphrase,\n );\n }\n\n /**\n * @returns {string}\n */\n toString() {\n return this._mnemonic.toString();\n }\n}\n"],"names":["Mnemonic","constructor","mnemonic","this","_mnemonic","generate","MnemonicCryptography","_generate","generate12","fromWords","words","toPrivateKey","passphrase","CACHE","privateKeyConstructor","toEd25519PrivateKey","path","toStandardEd25519PrivateKey","index","toEcdsaPrivateKey","calculateDerivationPathValues","derivationPath","matches","exec","values","Array","i","value","endsWith","substring","length","parseInt","toStandardECDSAsecp256k1PrivateKeyImpl","derivationPathValues","toStandardECDSAsecp256k1PrivateKey","toStandardECDSAsecp256k1PrivateKeyCustomDerivationPath","fromString","toLegacyPrivateKey","toSeed","toString"],"mappings":"6EAiBe,MAAMA,EAMjB,WAAAC,CAAYC,GACRC,KAAKC,UAAYF,CACzB,CAQI,qBAAaG,GACT,OAAO,IAAIL,QAAeM,EAAqBC,UAAU,IACjE,CAQI,uBAAaC,GACT,OAAO,IAAIR,QAAeM,EAAqBC,UAAU,IACjE,CAeI,sBAAaE,CAAUC,GACnB,OAAO,IAAIV,QAAeM,EAAqBG,UAAUC,GACjE,CASI,kBAAMC,CAAaC,EAAa,IAC5B,OAAOC,EAAMC,4BAEHX,KAAKC,UAAUO,aAAaC,GAE9C,CAUI,yBAAMG,CAAoBH,EAAa,GAAII,GACvC,OAAOH,EAAMC,4BAEHX,KAAKC,UAAUW,oBAAoBH,EAAYI,GAEjE,CAUI,iCAAMC,CAA4BL,EAAa,GAAIM,GAC/C,OAAOL,EAAMC,4BACHX,KAAKC,UAAUa,4BAA4BL,EAAYM,GAEzE,CAUI,uBAAMC,CAAkBP,EAAa,GAAII,GACrC,OAAOH,EAAMC,4BAEHX,KAAKC,UAAUe,kBAAkBP,EAAYI,GAE/D,CAcI,6BAAAI,CAA8BC,GAE1B,MACMC,EADU,iDACQC,KAAKF,GACvBG,EAAS,IAAIC,MAAM,GACzB,GAAIH,EAEA,IAAK,IAAII,EAAI,EAAGA,GAAK,EAAGA,IAAK,CACzB,IAAIC,EAAQL,EAAQI,GAChBC,EAAMC,SAAS,MACfD,EAAQA,EAAME,UAAU,EAAGF,EAAMG,OAAS,GAC1CN,EAAOE,EAAI,GAxIV,WAwIeK,SAASJ,EAAO,KAEhCH,EAAOE,EAAI,GAAKK,SAASJ,EAAO,GAEpD,CAGQ,OAAOH,CACf,CAaI,4CAAMQ,CACFpB,EACAqB,GAGA,aAAa9B,KAAKgB,kBAAkBP,EAAYqB,EACxD,CAUI,wCAAMC,CAAmCtB,EAAa,GAAIM,GACtD,OAAOL,EAAMC,4BACHX,KAAKC,UAAU8B,mCACjBtB,EACAM,GAGhB,CAYI,4DAAMiB,CACFvB,EAAa,GACbS,GAEA,MAAMY,EACF9B,KAAKiB,8BAA8BC,GACvC,aAAalB,KAAK6B,uCACdpB,EACAqB,EAEZ,CAQI,uBAAaG,CAAWlC,GACpB,OAAO,IAAIF,QAAeM,EAAqB8B,WAAWlC,GAClE,CAKI,wBAAMmC,GACF,OAAOxB,EAAMC,4BACHX,KAAKC,UAAUiC,qBAEjC,CAMI,YAAMC,CAAO1B,GACT,aAAaN,EAAqBgC,OAC9BnC,KAAKC,UAAUM,MACfE,EAEZ,CAKI,QAAA2B,GACI,OAAOpC,KAAKC,UAAUmC,UAC9B"}
|
|
1
|
+
{"version":3,"file":"Mnemonic.js","sources":["../src/Mnemonic.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport { Mnemonic as MnemonicCryptography } from \"@hiero-ledger/cryptography\";\nimport CACHE from \"./Cache.js\";\n\n/**\n * @typedef {import(\"./PrivateKey.js\").default} PrivateKey\n */\n\nconst HARDENED_BIT = 0x80000000;\n\n/**\n * Multi-word mnemonic phrase (BIP-39).\n *\n * Compatible with the official Hiero mobile\n * wallets (24-words or 22-words) and BRD (12-words).\n */\nexport default class Mnemonic {\n /**\n * @param {MnemonicCryptography} mnemonic\n * @hideconstructor\n * @private\n */\n constructor(mnemonic) {\n this._mnemonic = mnemonic;\n }\n\n /**\n * Returns a new random 24-word mnemonic from the BIP-39\n * standard English word list.\n *\n * @returns {Promise<Mnemonic>}\n */\n static async generate() {\n return new Mnemonic(await MnemonicCryptography._generate(24));\n }\n\n /**\n * Returns a new random 12-word mnemonic from the BIP-39\n * standard English word list.\n *\n * @returns {Promise<Mnemonic>}\n */\n static async generate12() {\n return new Mnemonic(await MnemonicCryptography._generate(12));\n }\n\n /**\n * Construct a mnemonic from a list of words. Handles 12, 22 (legacy), and 24 words.\n *\n * An exception of BadMnemonicError will be thrown if the mnemonic\n * contains unknown words or fails the checksum. An invalid mnemonic\n * can still be used to create private keys, the exception will\n * contain the failing mnemonic in case you wish to ignore the\n * validation error and continue.\n *\n * @param {string[]} words\n * @throws {cryptography.BadMnemonicError}\n * @returns {Promise<Mnemonic>}\n */\n static async fromWords(words) {\n return new Mnemonic(await MnemonicCryptography.fromWords(words));\n }\n\n /**\n * @deprecated - Use `toStandardEd25519PrivateKey()` or `toStandardECDSAsecp256k1PrivateKey()` instead\n * Recover a private key from this mnemonic phrase, with an\n * optional passphrase.\n * @param {string} [passphrase]\n * @returns {Promise<PrivateKey>}\n */\n async toPrivateKey(passphrase = \"\") {\n return CACHE.privateKeyConstructor(\n // eslint-disable-next-line deprecation/deprecation\n await this._mnemonic.toPrivateKey(passphrase),\n );\n }\n\n /**\n * @deprecated - Use `toStandardEd25519PrivateKey()` or `toStandardECDSAsecp256k1PrivateKey()` instead\n * Recover an Ed25519 private key from this mnemonic phrase, with an\n * optional passphrase.\n * @param {string} [passphrase]\n * @param {number[]} [path]\n * @returns {Promise<PrivateKey>}\n */\n async toEd25519PrivateKey(passphrase = \"\", path) {\n return CACHE.privateKeyConstructor(\n // eslint-disable-next-line deprecation/deprecation\n await this._mnemonic.toEd25519PrivateKey(passphrase, path),\n );\n }\n\n /**\n * Recover an Ed25519 private key from this mnemonic phrase, with an\n * optional passphrase.\n *\n * @param {string} [passphrase]\n * @param {number} [index]\n * @returns {Promise<PrivateKey>}\n */\n async toStandardEd25519PrivateKey(passphrase = \"\", index) {\n return CACHE.privateKeyConstructor(\n await this._mnemonic.toStandardEd25519PrivateKey(passphrase, index),\n );\n }\n\n /**\n * @deprecated - Use `toStandardEd25519PrivateKey()` or `toStandardECDSAsecp256k1PrivateKey()` instead\n * Recover an ECDSA private key from this mnemonic phrase, with an\n * optional passphrase.\n * @param {string} [passphrase]\n * @param {number[]} [path]\n * @returns {Promise<PrivateKey>}\n */\n async toEcdsaPrivateKey(passphrase = \"\", path) {\n return CACHE.privateKeyConstructor(\n // eslint-disable-next-line deprecation/deprecation\n await this._mnemonic.toEcdsaPrivateKey(passphrase, path),\n );\n }\n\n /**\n * Converts a derivation path from string to an array of integers.\n * Note that this expects precisely 5 components in the derivation path,\n * as per BIP-44:\n * `m / purpose' / coin_type' / account' / change / address_index`\n * Takes into account `'` for hardening as per BIP-32,\n * and does not prescribe which components should be hardened.\n *\n * @param {string} derivationPath the derivation path in BIP-44 format,\n * e.g. \"m/44'/60'/0'/0/0\"\n * @returns {Array<number>} to be used with PrivateKey#derive\n */\n calculateDerivationPathValues(derivationPath) {\n // Parse the derivation path from string into values\n const pattern = /m\\/(\\d+'?)\\/(\\d+'?)\\/(\\d+'?)\\/(\\d+'?)\\/(\\d+'?)/;\n const matches = pattern.exec(derivationPath);\n const values = new Array(5); // as Array<Number>;\n if (matches) {\n // Extract numbers and use apostrophe to select if is hardened\n for (let i = 1; i <= 5; i++) {\n let value = matches[i];\n if (value.endsWith(\"'\")) {\n value = value.substring(0, value.length - 1);\n values[i - 1] = parseInt(value, 10) | HARDENED_BIT;\n } else {\n values[i - 1] = parseInt(value, 10);\n }\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return values;\n }\n\n /**\n * Common implementation for both `toStandardECDSAsecp256k1PrivateKey`\n * functions.\n *\n * @param {string} passphrase the passphrase used to protect the\n * mnemonic, use \"\" for none\n * @param {Array<number>} derivationPathValues derivation path as an\n * integer array,\n * see: `calculateDerivationPathValues`\n * @returns {Promise<PrivateKey>} a private key\n */\n async toStandardECDSAsecp256k1PrivateKeyImpl(\n passphrase,\n derivationPathValues,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n return await this.toEcdsaPrivateKey(passphrase, derivationPathValues);\n }\n\n /**\n * Recover an ECDSA private key from this mnemonic phrase, with an\n * optional passphrase.\n *\n * @param {string} [passphrase]\n * @param {number} [index]\n * @returns {Promise<PrivateKey>}\n */\n async toStandardECDSAsecp256k1PrivateKey(passphrase = \"\", index) {\n return CACHE.privateKeyConstructor(\n await this._mnemonic.toStandardECDSAsecp256k1PrivateKey(\n passphrase,\n index,\n ),\n );\n }\n\n /**\n * Recover an ECDSAsecp256k1 private key from this mnemonic phrase and\n * derivation path, with an optional passphrase\n *\n * @param {string} passphrase the passphrase used to protect the mnemonic,\n * use \"\" for none\n * @param {string} derivationPath the derivation path in BIP-44 format,\n * e.g. \"m/44'/60'/0'/0/0\"\n * @returns {Promise<PrivateKey>} the private key\n */\n async toStandardECDSAsecp256k1PrivateKeyCustomDerivationPath(\n passphrase = \"\",\n derivationPath,\n ) {\n const derivationPathValues =\n this.calculateDerivationPathValues(derivationPath);\n return await this.toStandardECDSAsecp256k1PrivateKeyImpl(\n passphrase,\n derivationPathValues,\n );\n }\n\n /**\n * Recover a mnemonic phrase from a string, splitting on spaces. Handles 12, 22 (legacy), and 24 words.\n *\n * @param {string} mnemonic\n * @returns {Promise<Mnemonic>}\n */\n static async fromString(mnemonic) {\n return new Mnemonic(await MnemonicCryptography.fromString(mnemonic));\n }\n\n /**\n * @returns {Promise<PrivateKey>}\n */\n async toLegacyPrivateKey() {\n return CACHE.privateKeyConstructor(\n await this._mnemonic.toLegacyPrivateKey(),\n );\n }\n\n /**\n * @param {string} passphrase\n * @returns {Promise<Uint8Array>}\n */\n async toSeed(passphrase) {\n return await MnemonicCryptography.toSeed(\n this._mnemonic.words,\n passphrase,\n );\n }\n\n /**\n * @returns {string}\n */\n toString() {\n return this._mnemonic.toString();\n }\n}\n"],"names":["Mnemonic","constructor","mnemonic","this","_mnemonic","generate","MnemonicCryptography","_generate","generate12","fromWords","words","toPrivateKey","passphrase","CACHE","privateKeyConstructor","toEd25519PrivateKey","path","toStandardEd25519PrivateKey","index","toEcdsaPrivateKey","calculateDerivationPathValues","derivationPath","matches","exec","values","Array","i","value","endsWith","substring","length","parseInt","toStandardECDSAsecp256k1PrivateKeyImpl","derivationPathValues","toStandardECDSAsecp256k1PrivateKey","toStandardECDSAsecp256k1PrivateKeyCustomDerivationPath","fromString","toLegacyPrivateKey","toSeed","toString"],"mappings":"gFAiBe,MAAMA,EAMjB,WAAAC,CAAYC,GACRC,KAAKC,UAAYF,CACzB,CAQI,qBAAaG,GACT,OAAO,IAAIL,QAAeM,EAAqBC,UAAU,IACjE,CAQI,uBAAaC,GACT,OAAO,IAAIR,QAAeM,EAAqBC,UAAU,IACjE,CAeI,sBAAaE,CAAUC,GACnB,OAAO,IAAIV,QAAeM,EAAqBG,UAAUC,GACjE,CASI,kBAAMC,CAAaC,EAAa,IAC5B,OAAOC,EAAMC,4BAEHX,KAAKC,UAAUO,aAAaC,GAE9C,CAUI,yBAAMG,CAAoBH,EAAa,GAAII,GACvC,OAAOH,EAAMC,4BAEHX,KAAKC,UAAUW,oBAAoBH,EAAYI,GAEjE,CAUI,iCAAMC,CAA4BL,EAAa,GAAIM,GAC/C,OAAOL,EAAMC,4BACHX,KAAKC,UAAUa,4BAA4BL,EAAYM,GAEzE,CAUI,uBAAMC,CAAkBP,EAAa,GAAII,GACrC,OAAOH,EAAMC,4BAEHX,KAAKC,UAAUe,kBAAkBP,EAAYI,GAE/D,CAcI,6BAAAI,CAA8BC,GAE1B,MACMC,EADU,iDACQC,KAAKF,GACvBG,EAAS,IAAIC,MAAM,GACzB,GAAIH,EAEA,IAAK,IAAII,EAAI,EAAGA,GAAK,EAAGA,IAAK,CACzB,IAAIC,EAAQL,EAAQI,GAChBC,EAAMC,SAAS,MACfD,EAAQA,EAAME,UAAU,EAAGF,EAAMG,OAAS,GAC1CN,EAAOE,EAAI,GAxIV,WAwIeK,SAASJ,EAAO,KAEhCH,EAAOE,EAAI,GAAKK,SAASJ,EAAO,GAEpD,CAGQ,OAAOH,CACf,CAaI,4CAAMQ,CACFpB,EACAqB,GAGA,aAAa9B,KAAKgB,kBAAkBP,EAAYqB,EACxD,CAUI,wCAAMC,CAAmCtB,EAAa,GAAIM,GACtD,OAAOL,EAAMC,4BACHX,KAAKC,UAAU8B,mCACjBtB,EACAM,GAGhB,CAYI,4DAAMiB,CACFvB,EAAa,GACbS,GAEA,MAAMY,EACF9B,KAAKiB,8BAA8BC,GACvC,aAAalB,KAAK6B,uCACdpB,EACAqB,EAEZ,CAQI,uBAAaG,CAAWlC,GACpB,OAAO,IAAIF,QAAeM,EAAqB8B,WAAWlC,GAClE,CAKI,wBAAMmC,GACF,OAAOxB,EAAMC,4BACHX,KAAKC,UAAUiC,qBAEjC,CAMI,YAAMC,CAAO1B,GACT,aAAaN,EAAqBgC,OAC9BnC,KAAKC,UAAUM,MACfE,EAEZ,CAKI,QAAA2B,GACI,OAAOpC,KAAKC,UAAUmC,UAC9B"}
|
package/lib/PrivateKey.cjs
CHANGED
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _bytes = require("@ethersproject/bytes");
|
|
8
|
-
var _cryptography = require("@
|
|
9
|
-
var _proto = require("@
|
|
8
|
+
var _cryptography = require("@hiero-ledger/cryptography");
|
|
9
|
+
var _proto = require("@hiero-ledger/proto");
|
|
10
10
|
var _Mnemonic = _interopRequireDefault(require("./Mnemonic.cjs"));
|
|
11
11
|
var _PublicKey = _interopRequireDefault(require("./PublicKey.cjs"));
|
|
12
12
|
var _Key = _interopRequireDefault(require("./Key.cjs"));
|
|
@@ -25,11 +25,11 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* @namespace proto
|
|
28
|
-
* @typedef {import("@
|
|
29
|
-
* @typedef {import("@
|
|
30
|
-
* @typedef {import("@
|
|
31
|
-
* @typedef {import("@
|
|
32
|
-
* @typedef {import("@
|
|
28
|
+
* @typedef {import("@hiero-ledger/proto").proto.IKey} HieroProto.proto.IKey
|
|
29
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransaction} HieroProto.proto.ITransaction
|
|
30
|
+
* @typedef {import("@hiero-ledger/proto").proto.ISignaturePair} HieroProto.proto.ISignaturePair
|
|
31
|
+
* @typedef {import("@hiero-ledger/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
|
|
32
|
+
* @typedef {import("@hiero-ledger/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
35
|
class PrivateKey extends _Key.default {
|
package/lib/PrivateKey.d.ts
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* @namespace proto
|
|
6
|
-
* @typedef {import("@
|
|
7
|
-
* @typedef {import("@
|
|
8
|
-
* @typedef {import("@
|
|
9
|
-
* @typedef {import("@
|
|
10
|
-
* @typedef {import("@
|
|
6
|
+
* @typedef {import("@hiero-ledger/proto").proto.IKey} HieroProto.proto.IKey
|
|
7
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransaction} HieroProto.proto.ITransaction
|
|
8
|
+
* @typedef {import("@hiero-ledger/proto").proto.ISignaturePair} HieroProto.proto.ISignaturePair
|
|
9
|
+
* @typedef {import("@hiero-ledger/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
|
|
10
|
+
* @typedef {import("@hiero-ledger/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
|
|
11
11
|
*/
|
|
12
12
|
export default class PrivateKey extends Key {
|
|
13
13
|
/**
|
|
@@ -297,15 +297,15 @@ export default class PrivateKey extends Key {
|
|
|
297
297
|
export type Transaction = import("./transaction/Transaction.js").default;
|
|
298
298
|
export namespace HieroProto {
|
|
299
299
|
namespace proto {
|
|
300
|
-
type IKey = import("@
|
|
301
|
-
type ITransaction = import("@
|
|
302
|
-
type ISignaturePair = import("@
|
|
303
|
-
type ISignedTransaction = import("@
|
|
304
|
-
type TransactionBody = import("@
|
|
300
|
+
type IKey = import("@hiero-ledger/proto").proto.IKey;
|
|
301
|
+
type ITransaction = import("@hiero-ledger/proto").proto.ITransaction;
|
|
302
|
+
type ISignaturePair = import("@hiero-ledger/proto").proto.ISignaturePair;
|
|
303
|
+
type ISignedTransaction = import("@hiero-ledger/proto").proto.ISignedTransaction;
|
|
304
|
+
type TransactionBody = import("@hiero-ledger/proto").proto.TransactionBody;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
import Key from "./Key.js";
|
|
308
|
-
import { PrivateKey as PrivateKeyCrypto } from "@
|
|
308
|
+
import { PrivateKey as PrivateKeyCrypto } from "@hiero-ledger/cryptography";
|
|
309
309
|
import PublicKey from "./PublicKey.js";
|
|
310
310
|
import SignatureMap from "./transaction/SignatureMap.js";
|
|
311
311
|
import AccountId from "./account/AccountId.js";
|
package/lib/PrivateKey.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{hexlify as t}from"@ethersproject/bytes";import{PrivateKey as e}from"@
|
|
1
|
+
import{hexlify as t}from"@ethersproject/bytes";import{PrivateKey as e}from"@hiero-ledger/cryptography";import{proto as r}from"@hiero-ledger/proto";import n from"./Mnemonic.js";import i from"./PublicKey.js";import o from"./Key.js";import s from"./Cache.js";import a from"./transaction/SignatureMap.js";import c from"./account/AccountId.js";import y from"./transaction/TransactionId.js";import{decode as u}from"./encoding/hex.js";import{ASN1Decoder as m}from"./util/ASN1-Decoder.js";class g extends o{constructor(t){super(),this._key=t}static generateED25519(){return new g(e.generateED25519())}static generateECDSA(){return new g(e.generateECDSA())}static generate(){return g.generateED25519()}static async generateAsync(){return new g(await e.generateAsync())}static async generateED25519Async(){return new g(await e.generateED25519Async())}static async generateECDSAAsync(){return new g(await e.generateECDSAAsync())}static fromBytes(r){const n=t(r);return g.isDerKey(n)?"ecdsa"===g.getAlgorithm(n)?new g(e.fromBytesECDSA(r)):new g(e.fromBytesED25519(r)):new g(e.fromBytes(r))}static fromBytesECDSA(t){return new g(e.fromBytesECDSA(t))}static fromBytesED25519(t){return new g(e.fromBytesED25519(t))}static fromString(t){return g.isDerKey(t)?this.fromStringDer(t):new g(e.fromString(t))}static fromStringDer(t){return g.isDerKey(t)?"ecdsa"===g.getAlgorithm(t)?this.fromStringECDSA(t):this.fromStringED25519(t):g.fromString(t)}static fromStringECDSA(t){return new g(e.fromStringECDSA(t))}static fromStringED25519(t){return new g(e.fromStringED25519(t))}static async fromSeedED25519(t){return new g(await e.fromSeedED25519(t))}static async fromSeedECDSAsecp256k1(t){return new g(await e.fromSeedECDSAsecp256k1(t))}static async fromMnemonic(t,r=""){return new g(t instanceof n?await e.fromMnemonic(t._mnemonic,r):await e.fromMnemonic(t,r))}static async fromKeystore(t,r=""){return new g(await e.fromKeystore(t,r))}static async fromPem(t,r=""){return new g(await e.fromPem(t,r))}async derive(t){return new g(await this._key.derive(t))}async legacyDerive(t){return new g(await this._key.legacyDerive(t))}get publicKey(){return new i(this._key.publicKey)}get chainCode(){return this._key._chainCode}sign(t){return this._key.sign(t)}signTransaction(t,e=!1){if(e)return this._signTransactionLegacy(t);const n=new a;for(const e of t._signedTransactions.list){const t=e.bodyBytes;if(!t)throw new Error("Body bytes are missing");const i=r.TransactionBody.decode(t);if(!i.transactionID||!i.nodeAccountID)throw new Error("Transaction ID or Node Account ID not found in the signed transaction");const o=c._fromProtobuf(i.nodeAccountID),s=y._fromProtobuf(i.transactionID),a=this._key.sign(t);n.addSignature(o,s,this.publicKey,a)}return t.addSignature(this.publicKey,n),n}_signTransactionLegacy(t){const e=t._signedTransactions.list.map(t=>{const e=t.bodyBytes;return e?this._key.sign(e):new Uint8Array});return t.addSignature(this.publicKey,e),1===e.length?e[0]:e}isDerivable(){return this._key.isDerivable()}toBytes(){return this._key.toBytes()}toBytesDer(){return this._key.toBytesDer()}toBytesRaw(){return this._key.toBytesRaw()}toString(){return this._key.toStringDer()}toStringDer(){return this._key.toStringDer()}toStringRaw(){return this._key.toStringRaw()}toKeystore(t=""){return this._key.toKeystore(t)}_toProtobufKey(){return this.publicKey._toProtobufKey()}toAccountId(t,e){return this.publicKey.toAccountId(t,e)}get type(){return this._key._type}getRecoveryId(t,e,r){return this._key.getRecoveryId(t,e,r)}static getAlgorithm(t){if(!g.isDerKey(t))throw new Error("Only der keys are supported");const e=new m(Uint8Array.from(u(t)));e.read();return e.getOidKeyTypes()[0]}static isDerKey(t){try{const e=Uint8Array.from(u(t));return new m(e).read(),!0}catch(t){return!1}}}s.setPrivateKeyConstructor(t=>new g(t));export{g as default};
|
|
2
2
|
//# sourceMappingURL=PrivateKey.js.map
|