@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/exports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sources":["../src/exports.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport * as EntityIdHelper from \"./EntityIdHelper.js\";\n\nexport { default as Cache } from \"./Cache.js\";\nexport {\n BadKeyError,\n BadMnemonicError,\n BadMnemonicReason,\n HEDERA_PATH,\n SLIP44_ECDSA_ETH_PATH,\n SLIP44_ECDSA_HEDERA_PATH,\n} from \"@hashgraph/cryptography\";\nexport { default as PrivateKey } from \"./PrivateKey.js\";\nexport { default as PublicKey } from \"./PublicKey.js\";\nexport { default as KeyList } from \"./KeyList.js\";\nexport { default as Key } from \"./Key.js\";\nexport { default as Mnemonic } from \"./Mnemonic.js\";\nexport { default as TokenAirdropTransaction } from \"./token/TokenAirdropTransaction.js\";\nexport { default as TokenClaimAirdropTransaction } from \"./token/TokenClaimAirdropTransaction.js\";\nexport { default as TokenCancelAirdropTransaction } from \"./token/TokenCancelAirdropTransaction.js\";\n// eslint-disable-next-line deprecation/deprecation\nexport { default as AccountAllowanceAdjustTransaction } from \"./account/AccountAllowanceAdjustTransaction.js\";\nexport { default as AccountAllowanceApproveTransaction } from \"./account/AccountAllowanceApproveTransaction.js\";\nexport { default as AccountAllowanceDeleteTransaction } from \"./account/AccountAllowanceDeleteTransaction.js\";\nexport { default as AccountBalance } from \"./account/AccountBalance.js\";\nexport { default as AccountBalanceQuery } from \"./account/AccountBalanceQuery.js\";\nexport { default as AccountCreateTransaction } from \"./account/AccountCreateTransaction.js\";\nexport { default as AccountDeleteTransaction } from \"./account/AccountDeleteTransaction.js\";\nexport { default as AccountId } from \"./account/AccountId.js\";\nexport { default as AccountInfo } from \"./account/AccountInfo.js\";\nexport { default as AccountInfoFlow } from \"./account/AccountInfoFlow.js\";\nexport { default as AccountInfoQuery } from \"./account/AccountInfoQuery.js\";\nexport { default as AccountRecordsQuery } from \"./account/AccountRecordsQuery.js\";\nexport { default as AccountUpdateTransaction } from \"./account/AccountUpdateTransaction.js\";\nexport { default as AssessedCustomFee } from \"./token/AssessedCustomFee.js\";\nexport { default as BatchTransaction } from \"./transaction/BatchTransaction.js\";\nexport { default as ContractByteCodeQuery } from \"./contract/ContractByteCodeQuery.js\";\nexport { default as ContractCallQuery } from \"./contract/ContractCallQuery.js\";\nexport { default as ContractCreateFlow } from \"./contract/ContractCreateFlow.js\";\nexport { default as ContractCreateTransaction } from \"./contract/ContractCreateTransaction.js\";\nexport { default as ContractDeleteTransaction } from \"./contract/ContractDeleteTransaction.js\";\nexport { default as ContractExecuteTransaction } from \"./contract/ContractExecuteTransaction.js\";\nexport { default as ContractFunctionParameters } from \"./contract/ContractFunctionParameters.js\";\nexport { default as ContractFunctionResult } from \"./contract/ContractFunctionResult.js\";\nexport { default as ContractFunctionSelector } from \"./contract/ContractFunctionSelector.js\";\nexport { default as ContractId } from \"./contract/ContractId.js\";\nexport { default as ContractInfo } from \"./contract/ContractInfo.js\";\nexport { default as ContractInfoQuery } from \"./contract/ContractInfoQuery.js\";\nexport { default as ContractLogInfo } from \"./contract/ContractLogInfo.js\";\nexport { default as ContractNonceInfo } from \"./contract/ContractNonceInfo.js\";\nexport { default as ContractUpdateTransaction } from \"./contract/ContractUpdateTransaction.js\";\nexport { default as CustomFee } from \"./token/CustomFee.js\";\nexport { default as CustomFixedFee } from \"./token/CustomFixedFee.js\";\nexport { default as CustomFractionalFee } from \"./token/CustomFractionalFee.js\";\nexport { default as CustomRoyaltyFee } from \"./token/CustomRoyaltyFee.js\";\nexport { default as DelegateContractId } from \"./contract/DelegateContractId.js\";\nexport { default as EthereumTransaction } from \"./EthereumTransaction.js\";\nexport { default as EthereumTransactionDataLegacy } from \"./EthereumTransactionDataLegacy.js\";\nexport { default as EthereumTransactionDataEip1559 } from \"./EthereumTransactionDataEip1559.js\";\nexport { default as EthereumTransactionDataEip2930 } from \"./EthereumTransactionDataEip2930.js\";\nexport { default as EthereumTransactionData } from \"./EthereumTransactionData.js\";\n// eslint-disable-next-line deprecation/deprecation\nexport { default as EthereumFlow } from \"./EthereumFlow.js\";\nexport { default as EvmAddress } from \"./EvmAddress.js\";\nexport { default as ExchangeRate } from \"./ExchangeRate.js\";\nexport { default as ExchangeRates } from \"./ExchangeRates.js\";\nexport { default as Executable } from \"./Executable.js\";\nexport { default as FeeAssessmentMethod } from \"./token/FeeAssessmentMethod.js\";\nexport { default as FeeComponents } from \"./FeeComponents.js\";\nexport { default as FeeData } from \"./FeeData.js\";\nexport { default as FeeDataType } from \"./FeeDataType.js\";\nexport { default as FeeSchedule } from \"./FeeSchedule.js\";\nexport { default as FeeSchedules } from \"./FeeSchedules.js\";\nexport { default as FileAppendTransaction } from \"./file/FileAppendTransaction.js\";\nexport { default as FileContentsQuery } from \"./file/FileContentsQuery.js\";\nexport { default as FileCreateTransaction } from \"./file/FileCreateTransaction.js\";\nexport { default as FileDeleteTransaction } from \"./file/FileDeleteTransaction.js\";\nexport { default as FileId } from \"./file/FileId.js\";\nexport { default as FileInfo } from \"./file/FileInfo.js\";\nexport { default as FileInfoQuery } from \"./file/FileInfoQuery.js\";\nexport { default as FileUpdateTransaction } from \"./file/FileUpdateTransaction.js\";\nexport { default as FreezeTransaction } from \"./system/FreezeTransaction.js\";\nexport { default as Hbar } from \"./Hbar.js\";\nexport { default as HbarAllowance } from \"./account/HbarAllowance.js\";\nexport { default as HbarUnit } from \"./HbarUnit.js\";\nexport { default as LiveHash } from \"./account/LiveHash.js\";\n// eslint-disable-next-line deprecation/deprecation\nexport { default as LiveHashAddTransaction } from \"./account/LiveHashAddTransaction.js\";\n// eslint-disable-next-line deprecation/deprecation\nexport { default as LiveHashDeleteTransaction } from \"./account/LiveHashDeleteTransaction.js\";\n// eslint-disable-next-line deprecation/deprecation\nexport { default as LiveHashQuery } from \"./account/LiveHashQuery.js\";\nexport { default as MaxQueryPaymentExceeded } from \"./MaxQueryPaymentExceeded.js\";\nexport { default as MirrorNodeContractCallQuery } from \"./query/MirrorNodeContractCallQuery.js\";\nexport { default as MirrorNodeContractEstimateQuery } from \"./query/MirrorNodeContractEstimateQuery.js\";\nexport { default as NodeAddressBook } from \"./address_book/NodeAddressBook.js\";\nexport { default as NetworkVersionInfo } from \"./network/NetworkVersionInfo.js\";\nexport { default as NetworkVersionInfoQuery } from \"./network/NetworkVersionInfoQuery.js\";\nexport { default as NftId } from \"./token/NftId.js\";\nexport { default as PendingAirdropId } from \"./token/PendingAirdropId.js\";\nexport { default as Provider } from \"./Provider.js\";\nexport { default as PrngTransaction } from \"./PrngTransaction.js\";\nexport { default as ProxyStaker } from \"./account/ProxyStaker.js\";\nexport { default as Query } from \"./query/Query.js\";\nexport { default as RequestType } from \"./RequestType.js\";\nexport { default as ScheduleCreateTransaction } from \"./schedule/ScheduleCreateTransaction.js\";\nexport { default as ScheduleDeleteTransaction } from \"./schedule/ScheduleDeleteTransaction.js\";\nexport { default as ScheduleId } from \"./schedule/ScheduleId.js\";\nexport { default as ScheduleInfo } from \"./schedule/ScheduleInfo.js\";\nexport { default as ScheduleInfoQuery } from \"./schedule/ScheduleInfoQuery.js\";\nexport { default as ScheduleSignTransaction } from \"./schedule/ScheduleSignTransaction.js\";\nexport { default as SemanticVersion } from \"./network/SemanticVersion.js\";\nexport { default as SignatureMap } from \"./transaction/SignatureMap.js\";\nexport { default as Signer } from \"./Signer.js\";\nexport { default as SignerSignature } from \"./SignerSignature.js\";\nexport { default as Status } from \"./Status.js\";\nexport { default as SubscriptionHandle } from \"./topic/SubscriptionHandle.js\";\n// eslint-disable-next-line deprecation/deprecation\nexport { default as SystemDeleteTransaction } from \"./system/SystemDeleteTransaction.js\";\n// eslint-disable-next-line deprecation/deprecation\nexport { default as SystemUndeleteTransaction } from \"./system/SystemUndeleteTransaction.js\";\nexport { default as Timestamp } from \"./Timestamp.js\";\nexport { default as TokenAllowance } from \"./account/TokenAllowance.js\";\nexport { default as TokenAssociateTransaction } from \"./token/TokenAssociateTransaction.js\";\nexport { default as TokenBurnTransaction } from \"./token/TokenBurnTransaction.js\";\nexport { default as TokenRejectTransaction } from \"./token/TokenRejectTransaction.js\";\nexport { default as TokenRejectFlow } from \"./token/TokenRejectFlow.js\";\nexport { default as TokenCreateTransaction } from \"./token/TokenCreateTransaction.js\";\nexport { default as TokenDeleteTransaction } from \"./token/TokenDeleteTransaction.js\";\nexport { default as TokenDissociateTransaction } from \"./token/TokenDissociateTransaction.js\";\nexport { default as TokenFeeScheduleUpdateTransaction } from \"./token/TokenFeeScheduleUpdateTransaction.js\";\nexport { default as TokenFreezeTransaction } from \"./token/TokenFreezeTransaction.js\";\nexport { default as TokenGrantKycTransaction } from \"./token/TokenGrantKycTransaction.js\";\nexport { default as TokenId } from \"./token/TokenId.js\";\nexport { default as TokenInfo } from \"./token/TokenInfo.js\";\nexport { default as TokenInfoQuery } from \"./token/TokenInfoQuery.js\";\nexport { default as TokenMintTransaction } from \"./token/TokenMintTransaction.js\";\nexport { default as TokenNftAllowance } from \"./account/TokenNftAllowance.js\";\nexport { default as TokenNftInfo } from \"./token/TokenNftInfo.js\";\nexport { default as TokenNftInfoQuery } from \"./token/TokenNftInfoQuery.js\";\nexport { default as TokenPauseTransaction } from \"./token/TokenPauseTransaction.js\";\nexport { default as TokenRevokeKycTransaction } from \"./token/TokenRevokeKycTransaction.js\";\nexport { default as TokenSupplyType } from \"./token/TokenSupplyType.js\";\nexport { default as TokenType } from \"./token/TokenType.js\";\nexport { default as TokenUnfreezeTransaction } from \"./token/TokenUnfreezeTransaction.js\";\nexport { default as TokenUnpauseTransaction } from \"./token/TokenUnpauseTransaction.js\";\nexport { default as TokenUpdateTransaction } from \"./token/TokenUpdateTransaction.js\";\nexport { default as TokenWipeTransaction } from \"./token/TokenWipeTransaction.js\";\nexport { default as TopicCreateTransaction } from \"./topic/TopicCreateTransaction.js\";\nexport { default as TopicDeleteTransaction } from \"./topic/TopicDeleteTransaction.js\";\nexport { default as TopicId } from \"./topic/TopicId.js\";\nexport { default as TopicInfo } from \"./topic/TopicInfo.js\";\nexport { default as TopicInfoQuery } from \"./topic/TopicInfoQuery.js\";\nexport { default as TopicMessage } from \"./topic/TopicMessage.js\";\nexport { default as TopicMessageChunk } from \"./topic/TopicMessageChunk.js\";\nexport { default as TopicMessageQuery } from \"./topic/TopicMessageQuery.js\";\nexport { default as TopicMessageSubmitTransaction } from \"./topic/TopicMessageSubmitTransaction.js\";\nexport { default as TopicUpdateTransaction } from \"./topic/TopicUpdateTransaction.js\";\nexport { default as CustomFeeLimit } from \"./transaction/CustomFeeLimit.js\";\nexport { default as Transaction } from \"./transaction/Transaction.js\";\nexport { default as TransactionFeeSchedule } from \"./TransactionFeeSchedule.js\";\nexport { default as TransactionId } from \"./transaction/TransactionId.js\";\nexport { default as TransactionReceipt } from \"./transaction/TransactionReceipt.js\";\nexport { default as TransactionReceiptQuery } from \"./transaction/TransactionReceiptQuery.js\";\nexport { default as TransactionRecord } from \"./transaction/TransactionRecord.js\";\nexport { default as TransactionRecordQuery } from \"./transaction/TransactionRecordQuery.js\";\nexport { default as TransactionResponse } from \"./transaction/TransactionResponse.js\";\nexport { default as Transfer } from \"./Transfer.js\";\nexport { default as TransferTransaction } from \"./account/TransferTransaction.js\";\nexport { default as Wallet } from \"./Wallet.js\";\nexport { default as Logger } from \"./logger/Logger.js\";\nexport { default as LogLevel } from \"./logger/LogLevel.js\";\nexport { EntityIdHelper };\nexport { default as Long } from \"long\";\nexport { default as FreezeType } from \"./FreezeType.js\";\nexport { default as TokenKeyValidation } from \"./token/TokenKeyValidation.js\";\n\nexport { default as StatusError } from \"./StatusError.js\";\nexport { default as MaxAttemptsOrTimeoutError } from \"./MaxAttemptsOrTimeoutError.js\";\nexport { default as PrecheckStatusError } from \"./PrecheckStatusError.js\";\nexport { default as ReceiptStatusError } from \"./ReceiptStatusError.js\";\nexport { default as LedgerId } from \"./LedgerId.js\";\nexport { default as TokenUpdateNftsTransaction } from \"./token/TokenUpdateNftsTransaction.js\";\nexport { default as NodeCreateTransaction } from \"./node/NodeCreateTransaction.js\";\nexport { default as ServiceEndpoint } from \"./node/ServiceEndpoint.js\";\nexport { default as NodeDeleteTransaction } from \"./node/NodeDeleteTransaction.js\";\nexport { default as NodeUpdateTransaction } from \"./node/NodeUpdateTransaction.js\";\n\nexport { default as WebClient } from \"./client/WebClient.js\";\n\n/**\n * @typedef {import(\"./client/Client.js\").NetworkName} ClientNetworkName\n * @typedef {import(\"./Provider.js\").Provider} Provider\n * @typedef {import(\"./Signer.js\").Signer} Signer\n * @typedef {import(\"./account/AccountBalance.js\").AccountBalanceJson} AccountBalanceJson\n * @typedef {import(\"./account/AccountBalance.js\").TokenBalanceJson} TokenBalanceJson\n * @typedef {import(\"./transaction/TransactionResponse.js\").TransactionResponseJSON} TransactionResponseJSON\n */\n\n/**\n * @typedef {object} NetworkNameType\n * @property {ClientNetworkName} Mainnet\n * @property {ClientNetworkName} Testnet\n * @property {ClientNetworkName} Previewnet\n */\n/**\n * @type {NetworkNameType}\n */\nexport const NetworkName = {\n Mainnet: \"mainnet\",\n Testnet: \"testnet\",\n Previewnet: \"previewnet\",\n};\n"],"names":["NetworkName","Mainnet","Testnet","Previewnet"],"mappings":"ysOAgNY,MAACA,EAAc,CACvBC,QAAS,UACTC,QAAS,UACTC,WAAY"}
|
|
1
|
+
{"version":3,"file":"exports.js","sources":["../src/exports.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport * as EntityIdHelper from \"./EntityIdHelper.js\";\n\nexport { default as Cache } from \"./Cache.js\";\nexport {\n BadKeyError,\n BadMnemonicError,\n BadMnemonicReason,\n HEDERA_PATH,\n SLIP44_ECDSA_ETH_PATH,\n SLIP44_ECDSA_HEDERA_PATH,\n} from \"@hiero-ledger/cryptography\";\nexport { default as PrivateKey } from \"./PrivateKey.js\";\nexport { default as PublicKey } from \"./PublicKey.js\";\nexport { default as KeyList } from \"./KeyList.js\";\nexport { default as Key } from \"./Key.js\";\nexport { default as Mnemonic } from \"./Mnemonic.js\";\nexport { default as TokenAirdropTransaction } from \"./token/TokenAirdropTransaction.js\";\nexport { default as TokenClaimAirdropTransaction } from \"./token/TokenClaimAirdropTransaction.js\";\nexport { default as TokenCancelAirdropTransaction } from \"./token/TokenCancelAirdropTransaction.js\";\n// eslint-disable-next-line deprecation/deprecation\nexport { default as AccountAllowanceAdjustTransaction } from \"./account/AccountAllowanceAdjustTransaction.js\";\nexport { default as AccountAllowanceApproveTransaction } from \"./account/AccountAllowanceApproveTransaction.js\";\nexport { default as AccountAllowanceDeleteTransaction } from \"./account/AccountAllowanceDeleteTransaction.js\";\nexport { default as AccountBalance } from \"./account/AccountBalance.js\";\nexport { default as AccountBalanceQuery } from \"./account/AccountBalanceQuery.js\";\nexport { default as AccountCreateTransaction } from \"./account/AccountCreateTransaction.js\";\nexport { default as AccountDeleteTransaction } from \"./account/AccountDeleteTransaction.js\";\nexport { default as AccountId } from \"./account/AccountId.js\";\nexport { default as AccountInfo } from \"./account/AccountInfo.js\";\nexport { default as AccountInfoFlow } from \"./account/AccountInfoFlow.js\";\nexport { default as AccountInfoQuery } from \"./account/AccountInfoQuery.js\";\nexport { default as AccountRecordsQuery } from \"./account/AccountRecordsQuery.js\";\nexport { default as AccountUpdateTransaction } from \"./account/AccountUpdateTransaction.js\";\nexport { default as AssessedCustomFee } from \"./token/AssessedCustomFee.js\";\nexport { default as BatchTransaction } from \"./transaction/BatchTransaction.js\";\nexport { default as ContractByteCodeQuery } from \"./contract/ContractByteCodeQuery.js\";\nexport { default as ContractCallQuery } from \"./contract/ContractCallQuery.js\";\nexport { default as ContractCreateFlow } from \"./contract/ContractCreateFlow.js\";\nexport { default as ContractCreateTransaction } from \"./contract/ContractCreateTransaction.js\";\nexport { default as ContractDeleteTransaction } from \"./contract/ContractDeleteTransaction.js\";\nexport { default as ContractExecuteTransaction } from \"./contract/ContractExecuteTransaction.js\";\nexport { default as ContractFunctionParameters } from \"./contract/ContractFunctionParameters.js\";\nexport { default as ContractFunctionResult } from \"./contract/ContractFunctionResult.js\";\nexport { default as ContractFunctionSelector } from \"./contract/ContractFunctionSelector.js\";\nexport { default as ContractId } from \"./contract/ContractId.js\";\nexport { default as ContractInfo } from \"./contract/ContractInfo.js\";\nexport { default as ContractInfoQuery } from \"./contract/ContractInfoQuery.js\";\nexport { default as ContractLogInfo } from \"./contract/ContractLogInfo.js\";\nexport { default as ContractNonceInfo } from \"./contract/ContractNonceInfo.js\";\nexport { default as ContractUpdateTransaction } from \"./contract/ContractUpdateTransaction.js\";\nexport { default as CustomFee } from \"./token/CustomFee.js\";\nexport { default as CustomFixedFee } from \"./token/CustomFixedFee.js\";\nexport { default as CustomFractionalFee } from \"./token/CustomFractionalFee.js\";\nexport { default as CustomRoyaltyFee } from \"./token/CustomRoyaltyFee.js\";\nexport { default as DelegateContractId } from \"./contract/DelegateContractId.js\";\nexport { default as EthereumTransaction } from \"./EthereumTransaction.js\";\nexport { default as EthereumTransactionDataLegacy } from \"./EthereumTransactionDataLegacy.js\";\nexport { default as EthereumTransactionDataEip1559 } from \"./EthereumTransactionDataEip1559.js\";\nexport { default as EthereumTransactionDataEip2930 } from \"./EthereumTransactionDataEip2930.js\";\nexport { default as EthereumTransactionData } from \"./EthereumTransactionData.js\";\n// eslint-disable-next-line deprecation/deprecation\nexport { default as EthereumFlow } from \"./EthereumFlow.js\";\nexport { default as EvmAddress } from \"./EvmAddress.js\";\nexport { default as ExchangeRate } from \"./ExchangeRate.js\";\nexport { default as ExchangeRates } from \"./ExchangeRates.js\";\nexport { default as Executable } from \"./Executable.js\";\nexport { default as FeeAssessmentMethod } from \"./token/FeeAssessmentMethod.js\";\nexport { default as FeeComponents } from \"./FeeComponents.js\";\nexport { default as FeeData } from \"./FeeData.js\";\nexport { default as FeeDataType } from \"./FeeDataType.js\";\nexport { default as FeeSchedule } from \"./FeeSchedule.js\";\nexport { default as FeeSchedules } from \"./FeeSchedules.js\";\nexport { default as FileAppendTransaction } from \"./file/FileAppendTransaction.js\";\nexport { default as FileContentsQuery } from \"./file/FileContentsQuery.js\";\nexport { default as FileCreateTransaction } from \"./file/FileCreateTransaction.js\";\nexport { default as FileDeleteTransaction } from \"./file/FileDeleteTransaction.js\";\nexport { default as FileId } from \"./file/FileId.js\";\nexport { default as FileInfo } from \"./file/FileInfo.js\";\nexport { default as FileInfoQuery } from \"./file/FileInfoQuery.js\";\nexport { default as FileUpdateTransaction } from \"./file/FileUpdateTransaction.js\";\nexport { default as FreezeTransaction } from \"./system/FreezeTransaction.js\";\nexport { default as Hbar } from \"./Hbar.js\";\nexport { default as HbarAllowance } from \"./account/HbarAllowance.js\";\nexport { default as HbarUnit } from \"./HbarUnit.js\";\nexport { default as LiveHash } from \"./account/LiveHash.js\";\n// eslint-disable-next-line deprecation/deprecation\nexport { default as LiveHashAddTransaction } from \"./account/LiveHashAddTransaction.js\";\n// eslint-disable-next-line deprecation/deprecation\nexport { default as LiveHashDeleteTransaction } from \"./account/LiveHashDeleteTransaction.js\";\n// eslint-disable-next-line deprecation/deprecation\nexport { default as LiveHashQuery } from \"./account/LiveHashQuery.js\";\nexport { default as MaxQueryPaymentExceeded } from \"./MaxQueryPaymentExceeded.js\";\nexport { default as MirrorNodeContractCallQuery } from \"./query/MirrorNodeContractCallQuery.js\";\nexport { default as MirrorNodeContractEstimateQuery } from \"./query/MirrorNodeContractEstimateQuery.js\";\nexport { default as NodeAddressBook } from \"./address_book/NodeAddressBook.js\";\nexport { default as NetworkVersionInfo } from \"./network/NetworkVersionInfo.js\";\nexport { default as NetworkVersionInfoQuery } from \"./network/NetworkVersionInfoQuery.js\";\nexport { default as NftId } from \"./token/NftId.js\";\nexport { default as PendingAirdropId } from \"./token/PendingAirdropId.js\";\nexport { default as Provider } from \"./Provider.js\";\nexport { default as PrngTransaction } from \"./PrngTransaction.js\";\nexport { default as ProxyStaker } from \"./account/ProxyStaker.js\";\nexport { default as Query } from \"./query/Query.js\";\nexport { default as RequestType } from \"./RequestType.js\";\nexport { default as ScheduleCreateTransaction } from \"./schedule/ScheduleCreateTransaction.js\";\nexport { default as ScheduleDeleteTransaction } from \"./schedule/ScheduleDeleteTransaction.js\";\nexport { default as ScheduleId } from \"./schedule/ScheduleId.js\";\nexport { default as ScheduleInfo } from \"./schedule/ScheduleInfo.js\";\nexport { default as ScheduleInfoQuery } from \"./schedule/ScheduleInfoQuery.js\";\nexport { default as ScheduleSignTransaction } from \"./schedule/ScheduleSignTransaction.js\";\nexport { default as SemanticVersion } from \"./network/SemanticVersion.js\";\nexport { default as SignatureMap } from \"./transaction/SignatureMap.js\";\nexport { default as Signer } from \"./Signer.js\";\nexport { default as SignerSignature } from \"./SignerSignature.js\";\nexport { default as Status } from \"./Status.js\";\nexport { default as SubscriptionHandle } from \"./topic/SubscriptionHandle.js\";\n// eslint-disable-next-line deprecation/deprecation\nexport { default as SystemDeleteTransaction } from \"./system/SystemDeleteTransaction.js\";\n// eslint-disable-next-line deprecation/deprecation\nexport { default as SystemUndeleteTransaction } from \"./system/SystemUndeleteTransaction.js\";\nexport { default as Timestamp } from \"./Timestamp.js\";\nexport { default as TokenAllowance } from \"./account/TokenAllowance.js\";\nexport { default as TokenAssociateTransaction } from \"./token/TokenAssociateTransaction.js\";\nexport { default as TokenBurnTransaction } from \"./token/TokenBurnTransaction.js\";\nexport { default as TokenRejectTransaction } from \"./token/TokenRejectTransaction.js\";\nexport { default as TokenRejectFlow } from \"./token/TokenRejectFlow.js\";\nexport { default as TokenCreateTransaction } from \"./token/TokenCreateTransaction.js\";\nexport { default as TokenDeleteTransaction } from \"./token/TokenDeleteTransaction.js\";\nexport { default as TokenDissociateTransaction } from \"./token/TokenDissociateTransaction.js\";\nexport { default as TokenFeeScheduleUpdateTransaction } from \"./token/TokenFeeScheduleUpdateTransaction.js\";\nexport { default as TokenFreezeTransaction } from \"./token/TokenFreezeTransaction.js\";\nexport { default as TokenGrantKycTransaction } from \"./token/TokenGrantKycTransaction.js\";\nexport { default as TokenId } from \"./token/TokenId.js\";\nexport { default as TokenInfo } from \"./token/TokenInfo.js\";\nexport { default as TokenInfoQuery } from \"./token/TokenInfoQuery.js\";\nexport { default as TokenMintTransaction } from \"./token/TokenMintTransaction.js\";\nexport { default as TokenNftAllowance } from \"./account/TokenNftAllowance.js\";\nexport { default as TokenNftInfo } from \"./token/TokenNftInfo.js\";\nexport { default as TokenNftInfoQuery } from \"./token/TokenNftInfoQuery.js\";\nexport { default as TokenPauseTransaction } from \"./token/TokenPauseTransaction.js\";\nexport { default as TokenRevokeKycTransaction } from \"./token/TokenRevokeKycTransaction.js\";\nexport { default as TokenSupplyType } from \"./token/TokenSupplyType.js\";\nexport { default as TokenType } from \"./token/TokenType.js\";\nexport { default as TokenUnfreezeTransaction } from \"./token/TokenUnfreezeTransaction.js\";\nexport { default as TokenUnpauseTransaction } from \"./token/TokenUnpauseTransaction.js\";\nexport { default as TokenUpdateTransaction } from \"./token/TokenUpdateTransaction.js\";\nexport { default as TokenWipeTransaction } from \"./token/TokenWipeTransaction.js\";\nexport { default as TopicCreateTransaction } from \"./topic/TopicCreateTransaction.js\";\nexport { default as TopicDeleteTransaction } from \"./topic/TopicDeleteTransaction.js\";\nexport { default as TopicId } from \"./topic/TopicId.js\";\nexport { default as TopicInfo } from \"./topic/TopicInfo.js\";\nexport { default as TopicInfoQuery } from \"./topic/TopicInfoQuery.js\";\nexport { default as TopicMessage } from \"./topic/TopicMessage.js\";\nexport { default as TopicMessageChunk } from \"./topic/TopicMessageChunk.js\";\nexport { default as TopicMessageQuery } from \"./topic/TopicMessageQuery.js\";\nexport { default as TopicMessageSubmitTransaction } from \"./topic/TopicMessageSubmitTransaction.js\";\nexport { default as TopicUpdateTransaction } from \"./topic/TopicUpdateTransaction.js\";\nexport { default as CustomFeeLimit } from \"./transaction/CustomFeeLimit.js\";\nexport { default as Transaction } from \"./transaction/Transaction.js\";\nexport { default as TransactionFeeSchedule } from \"./TransactionFeeSchedule.js\";\nexport { default as TransactionId } from \"./transaction/TransactionId.js\";\nexport { default as TransactionReceipt } from \"./transaction/TransactionReceipt.js\";\nexport { default as TransactionReceiptQuery } from \"./transaction/TransactionReceiptQuery.js\";\nexport { default as TransactionRecord } from \"./transaction/TransactionRecord.js\";\nexport { default as TransactionRecordQuery } from \"./transaction/TransactionRecordQuery.js\";\nexport { default as TransactionResponse } from \"./transaction/TransactionResponse.js\";\nexport { default as Transfer } from \"./Transfer.js\";\nexport { default as TransferTransaction } from \"./account/TransferTransaction.js\";\nexport { default as Wallet } from \"./Wallet.js\";\nexport { default as Logger } from \"./logger/Logger.js\";\nexport { default as LogLevel } from \"./logger/LogLevel.js\";\nexport { EntityIdHelper };\nexport { default as Long } from \"long\";\nexport { default as FreezeType } from \"./FreezeType.js\";\nexport { default as TokenKeyValidation } from \"./token/TokenKeyValidation.js\";\n\nexport { default as StatusError } from \"./StatusError.js\";\nexport { default as MaxAttemptsOrTimeoutError } from \"./MaxAttemptsOrTimeoutError.js\";\nexport { default as PrecheckStatusError } from \"./PrecheckStatusError.js\";\nexport { default as ReceiptStatusError } from \"./ReceiptStatusError.js\";\nexport { default as LedgerId } from \"./LedgerId.js\";\nexport { default as TokenUpdateNftsTransaction } from \"./token/TokenUpdateNftsTransaction.js\";\nexport { default as NodeCreateTransaction } from \"./node/NodeCreateTransaction.js\";\nexport { default as ServiceEndpoint } from \"./node/ServiceEndpoint.js\";\nexport { default as NodeDeleteTransaction } from \"./node/NodeDeleteTransaction.js\";\nexport { default as NodeUpdateTransaction } from \"./node/NodeUpdateTransaction.js\";\n\nexport { default as WebClient } from \"./client/WebClient.js\";\n\n/**\n * @typedef {import(\"./client/Client.js\").NetworkName} ClientNetworkName\n * @typedef {import(\"./Provider.js\").Provider} Provider\n * @typedef {import(\"./Signer.js\").Signer} Signer\n * @typedef {import(\"./account/AccountBalance.js\").AccountBalanceJson} AccountBalanceJson\n * @typedef {import(\"./account/AccountBalance.js\").TokenBalanceJson} TokenBalanceJson\n * @typedef {import(\"./transaction/TransactionResponse.js\").TransactionResponseJSON} TransactionResponseJSON\n */\n\n/**\n * @typedef {object} NetworkNameType\n * @property {ClientNetworkName} Mainnet\n * @property {ClientNetworkName} Testnet\n * @property {ClientNetworkName} Previewnet\n */\n/**\n * @type {NetworkNameType}\n */\nexport const NetworkName = {\n Mainnet: \"mainnet\",\n Testnet: \"testnet\",\n Previewnet: \"previewnet\",\n};\n"],"names":["NetworkName","Mainnet","Testnet","Previewnet"],"mappings":"+sOAgNY,MAACA,EAAc,CACvBC,QAAS,UACTC,QAAS,UACTC,WAAY"}
|
|
@@ -18,13 +18,13 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @namespace proto
|
|
21
|
-
* @typedef {import("@
|
|
22
|
-
* @typedef {import("@
|
|
23
|
-
* @typedef {import("@
|
|
24
|
-
* @typedef {import("@
|
|
25
|
-
* @typedef {import("@
|
|
26
|
-
* @typedef {import("@
|
|
27
|
-
* @typedef {import("@
|
|
21
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransaction} HieroProto.proto.ITransaction
|
|
22
|
+
* @typedef {import("@hiero-ledger/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
|
|
23
|
+
* @typedef {import("@hiero-ledger/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
|
|
24
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
|
|
25
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
|
|
26
|
+
* @typedef {import("@hiero-ledger/proto").proto.IFileAppendTransactionBody} HieroProto.proto.IFileAppendTransactionBody
|
|
27
|
+
* @typedef {import("@hiero-ledger/proto").proto.IFileID} HieroProto.proto.IFileID
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @namespace proto
|
|
3
|
-
* @typedef {import("@
|
|
4
|
-
* @typedef {import("@
|
|
5
|
-
* @typedef {import("@
|
|
6
|
-
* @typedef {import("@
|
|
7
|
-
* @typedef {import("@
|
|
8
|
-
* @typedef {import("@
|
|
9
|
-
* @typedef {import("@
|
|
3
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransaction} HieroProto.proto.ITransaction
|
|
4
|
+
* @typedef {import("@hiero-ledger/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
|
|
5
|
+
* @typedef {import("@hiero-ledger/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
|
|
6
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
|
|
7
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
|
|
8
|
+
* @typedef {import("@hiero-ledger/proto").proto.IFileAppendTransactionBody} HieroProto.proto.IFileAppendTransactionBody
|
|
9
|
+
* @typedef {import("@hiero-ledger/proto").proto.IFileID} HieroProto.proto.IFileID
|
|
10
10
|
*/
|
|
11
11
|
/**
|
|
12
12
|
* @typedef {import("../PublicKey.js").default} PublicKey
|
|
@@ -176,13 +176,13 @@ export default class FileAppendTransaction extends Transaction {
|
|
|
176
176
|
}
|
|
177
177
|
export namespace HieroProto {
|
|
178
178
|
namespace proto {
|
|
179
|
-
type ITransaction = import("@
|
|
180
|
-
type ISignedTransaction = import("@
|
|
181
|
-
type TransactionBody = import("@
|
|
182
|
-
type ITransactionBody = import("@
|
|
183
|
-
type ITransactionResponse = import("@
|
|
184
|
-
type IFileAppendTransactionBody = import("@
|
|
185
|
-
type IFileID = import("@
|
|
179
|
+
type ITransaction = import("@hiero-ledger/proto").proto.ITransaction;
|
|
180
|
+
type ISignedTransaction = import("@hiero-ledger/proto").proto.ISignedTransaction;
|
|
181
|
+
type TransactionBody = import("@hiero-ledger/proto").proto.TransactionBody;
|
|
182
|
+
type ITransactionBody = import("@hiero-ledger/proto").proto.ITransactionBody;
|
|
183
|
+
type ITransactionResponse = import("@hiero-ledger/proto").proto.ITransactionResponse;
|
|
184
|
+
type IFileAppendTransactionBody = import("@hiero-ledger/proto").proto.IFileAppendTransactionBody;
|
|
185
|
+
type IFileID = import("@hiero-ledger/proto").proto.IFileID;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
export type PublicKey = import("../PublicKey.js").default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileAppendTransaction.js","sources":["../../src/file/FileAppendTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Hbar from \"../Hbar.js\";\nimport Transaction, {\n TRANSACTION_REGISTRY,\n} from \"../transaction/Transaction.js\";\nimport * as utf8 from \"../encoding/utf8.js\";\nimport FileId from \"./FileId.js\";\nimport TransactionId from \"../transaction/TransactionId.js\";\nimport Timestamp from \"../Timestamp.js\";\nimport List from \"../transaction/List.js\";\nimport AccountId from \"../account/AccountId.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hashgraph/proto\").proto.ITransaction} HieroProto.proto.ITransaction\n * @typedef {import(\"@hashgraph/proto\").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction\n * @typedef {import(\"@hashgraph/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n * @typedef {import(\"@hashgraph/proto\").proto.IFileAppendTransactionBody} HieroProto.proto.IFileAppendTransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.IFileID} HieroProto.proto.IFileID\n */\n\n/**\n * @typedef {import(\"../PublicKey.js\").default} PublicKey\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../client/Client.js\").default<Channel, *>} Client\n * @typedef {import(\"../transaction/TransactionResponse.js\").default} TransactionResponse\n * @typedef {import(\"../schedule/ScheduleCreateTransaction.js\").default} ScheduleCreateTransaction\n */\n\n/**\n * A transaction specifically to append data to a file on the network.\n *\n * If a file has multiple keys, all keys must sign to modify its contents.\n */\nexport default class FileAppendTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {FileId | string} [props.fileId]\n * @param {Uint8Array | string} [props.contents]\n * @param {number} [props.maxChunks]\n * @param {number} [props.chunkSize]\n * @param {number} [props.chunkInterval]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?FileId}\n */\n this._fileId = null;\n\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._contents = null;\n\n /**\n * @private\n * @type {number}\n */\n this._maxChunks = 20;\n\n /**\n * @private\n * @type {number}\n */\n this._chunkSize = 4096;\n\n /**\n * @private\n * @type {number}\n */\n this._chunkInterval = 10;\n\n this._defaultMaxTransactionFee = new Hbar(5);\n\n if (props.fileId != null) {\n this.setFileId(props.fileId);\n }\n\n if (props.contents != null) {\n this.setContents(props.contents);\n }\n\n if (props.maxChunks != null) {\n this.setMaxChunks(props.maxChunks);\n }\n\n if (props.chunkSize != null) {\n this.setChunkSize(props.chunkSize);\n }\n\n if (props.chunkInterval != null) {\n this.setChunkInterval(props.chunkInterval);\n }\n\n /** @type {List<TransactionId>} */\n this._transactionIds = new List();\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITransaction[]} transactions\n * @param {HieroProto.proto.ISignedTransaction[]} signedTransactions\n * @param {TransactionId[]} transactionIds\n * @param {AccountId[]} nodeIds\n * @param {HieroProto.proto.ITransactionBody[]} bodies\n * @returns {FileAppendTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const append =\n /** @type {HieroProto.proto.IFileAppendTransactionBody} */ (\n body.fileAppend\n );\n\n let contents;\n\n // The increment value depends on whether the node IDs list is empty or not.\n // The node IDs list is not empty if the transaction has been frozen\n // before serialization and deserialization, otherwise, it's empty.\n const incrementValue = nodeIds.length > 0 ? nodeIds.length : 1;\n\n for (let i = 0; i < bodies.length; i += incrementValue) {\n const fileAppend =\n /** @type {HieroProto.proto.IFileAppendTransactionBody} */ (\n bodies[i].fileAppend\n );\n if (fileAppend.contents == null) {\n break;\n }\n\n if (contents == null) {\n contents = new Uint8Array(\n /** @type {Uint8Array} */ (fileAppend.contents),\n );\n continue;\n }\n\n /** @type {Uint8Array} */\n const concat = new Uint8Array(\n contents.length +\n /** @type {Uint8Array} */ (fileAppend.contents).length,\n );\n concat.set(contents, 0);\n concat.set(\n /** @type {Uint8Array} */ (fileAppend.contents),\n contents.length,\n );\n contents = concat;\n }\n const chunkSize = append.contents?.length || undefined;\n const maxChunks = bodies.length\n ? bodies.length / incrementValue\n : undefined;\n let chunkInterval;\n if (transactionIds.length > 1) {\n const firstValidStart = transactionIds[0].validStart;\n const secondValidStart = transactionIds[1].validStart;\n if (firstValidStart && secondValidStart) {\n chunkInterval = secondValidStart.nanos\n .sub(firstValidStart.nanos)\n .toNumber();\n }\n }\n\n return Transaction._fromProtobufTransactions(\n new FileAppendTransaction({\n fileId:\n append.fileID != null\n ? FileId._fromProtobuf(\n /** @type {HieroProto.proto.IFileID} */ (\n append.fileID\n ),\n )\n : undefined,\n contents,\n chunkSize,\n maxChunks,\n chunkInterval,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?FileId}\n */\n get fileId() {\n return this._fileId;\n }\n\n /**\n * Set the keys which must sign any transactions modifying this file. Required.\n *\n * All keys must sign to modify the file's contents or keys. No key is required\n * to sign for extending the expiration time (except the one for the operator account\n * paying for the transaction). Only one key must sign to delete the file, however.\n *\n * To require more than one key to sign to delete a file, add them to a\n * KeyList and pass that here.\n *\n * The network currently requires a file to have at least one key (or key list or threshold key)\n * but this requirement may be lifted in the future.\n *\n * @param {FileId | string} fileId\n * @returns {this}\n */\n setFileId(fileId) {\n this._requireNotFrozen();\n this._fileId =\n typeof fileId === \"string\"\n ? FileId.fromString(fileId)\n : fileId.clone();\n\n return this;\n }\n\n /**\n * @override\n * @returns {number}\n */\n getRequiredChunks() {\n if (this._contents == null) {\n return 1;\n }\n\n const result = Math.ceil(this._contents.length / this._chunkSize);\n\n return result;\n }\n\n /**\n * @returns {?Uint8Array}\n */\n get contents() {\n return this._contents;\n }\n\n /**\n * Set the given byte array as the file's contents.\n *\n * This may be omitted to append an empty file.\n *\n * Note that total size for a given transaction is limited to 6KiB (as of March 2020) by the\n * network; if you exceed this you may receive a HederaPreCheckStatusException\n * with Status#TransactionOversize.\n *\n * In this case, you will need to break the data into chunks of less than ~6KiB and execute this\n * transaction with the first chunk and then use FileAppendTransaction with\n * FileAppendTransaction#setContents(Uint8Array) for the remaining chunks.\n *\n * @param {Uint8Array | string} contents\n * @returns {this}\n */\n setContents(contents) {\n this._requireNotFrozen();\n this._contents =\n contents instanceof Uint8Array ? contents : utf8.encode(contents);\n\n return this;\n }\n\n /**\n * @returns {?number}\n */\n get maxChunks() {\n return this._maxChunks;\n }\n\n /**\n * @param {number} maxChunks\n * @returns {this}\n */\n setMaxChunks(maxChunks) {\n if (maxChunks <= 0) {\n throw new Error(\"Max chunks must be greater than 0\");\n }\n this._requireNotFrozen();\n this._maxChunks = maxChunks;\n return this;\n }\n\n /**\n * @returns {?number}\n */\n get chunkSize() {\n return this._chunkSize;\n }\n\n /**\n * @param {number} chunkSize\n * @returns {this}\n */\n setChunkSize(chunkSize) {\n if (chunkSize <= 0) {\n throw new Error(\"Chunk size must be greater than 0\");\n }\n this._chunkSize = chunkSize;\n return this;\n }\n\n /**\n * @returns {number}\n */\n get chunkInterval() {\n return this._chunkInterval;\n }\n\n /**\n * @param {number} chunkInterval The valid start interval between chunks in nanoseconds\n * @returns {this}\n */\n setChunkInterval(chunkInterval) {\n this._chunkInterval = chunkInterval;\n return this;\n }\n\n /**\n * Freeze this transaction from further modification to prepare for\n * signing or serialization.\n *\n * Will use the `Client`, if available, to generate a default Transaction ID and select 1/3\n * nodes to prepare this transaction for.\n *\n * @param {?import(\"../client/Client.js\").default<Channel, *>} client\n * @returns {this}\n */\n freezeWith(client) {\n super.freezeWith(client);\n\n if (this._contents == null) {\n return this;\n }\n\n let nextTransactionId = this._getTransactionId();\n\n // Hack around the locked list. Should refactor a bit to remove such code\n this._transactionIds.locked = false;\n\n this._transactions.clear();\n this._transactionIds.clear();\n this._signedTransactions.clear();\n\n for (let chunk = 0; chunk < this.getRequiredChunks(); chunk++) {\n this._transactionIds.push(nextTransactionId);\n this._transactionIds.advance();\n\n for (const nodeAccountId of this._nodeAccountIds.list) {\n this._signedTransactions.push(\n this._makeSignedTransaction(nodeAccountId),\n );\n }\n\n nextTransactionId = new TransactionId(\n /** @type {AccountId} */ (nextTransactionId.accountId),\n new Timestamp(\n /** @type {Timestamp} */ (\n nextTransactionId.validStart\n ).seconds,\n /** @type {Timestamp} */ (\n nextTransactionId.validStart\n ).nanos.add(this._chunkInterval),\n ),\n );\n }\n\n this._transactionIds.advance();\n this._transactionIds.setLocked();\n\n return this;\n }\n\n /**\n * @returns {ScheduleCreateTransaction}\n */\n schedule() {\n this._requireNotFrozen();\n\n if (this._contents != null && this._contents.length > this._chunkSize) {\n throw new Error(\n `cannot schedule \\`FileAppendTransaction\\` with message over ${this._chunkSize} bytes`,\n );\n }\n\n return super.schedule();\n }\n\n /**\n * @param {import(\"../client/Client.js\").default<Channel, *>} client\n * @param {number=} requestTimeout\n * @returns {Promise<TransactionResponse>}\n */\n async execute(client, requestTimeout) {\n return (await this.executeAll(client, requestTimeout))[0];\n }\n\n /**\n * @param {import(\"../client/Client.js\").default<Channel, *>} client\n * @param {number=} requestTimeout\n * @returns {Promise<TransactionResponse[]>}\n */\n async executeAll(client, requestTimeout) {\n if (this.maxChunks && this.getRequiredChunks() > this.maxChunks) {\n throw new Error(\n `cannot execute \\`FileAppendTransaction\\` with more than ${this.maxChunks} chunks`,\n );\n }\n\n if (!super._isFrozen()) {\n this.freezeWith(client);\n }\n\n // on execute, sign each transaction with the operator, if present\n // and we are signing a transaction that used the default transaction ID\n\n const transactionId = this._getTransactionId();\n const operatorAccountId = client.operatorAccountId;\n\n if (\n operatorAccountId != null &&\n operatorAccountId.equals(\n /** @type {AccountId} */ (transactionId.accountId),\n )\n ) {\n await super.signWithOperator(client);\n }\n\n const responses = [];\n let remainingTimeout = requestTimeout;\n\n for (let i = 0; i < this._transactionIds.length; i++) {\n const startTimestamp = Date.now();\n const response = await super.execute(client, remainingTimeout);\n\n if (remainingTimeout != null) {\n remainingTimeout = Date.now() - startTimestamp;\n }\n\n await response.getReceipt(client);\n responses.push(response);\n }\n\n return responses;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (this._fileId != null) {\n this._fileId.validateChecksum(client);\n }\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.file.appendContent(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"fileAppend\";\n }\n\n /**\n * Build all the transactions\n * when transactions are not complete.\n * @override\n * @internal\n */\n _buildIncompleteTransactions() {\n const dummyAccountId = AccountId.fromString(\"0.0.0\");\n const accountId = this.transactionId?.accountId || dummyAccountId;\n const validStart =\n this.transactionId?.validStart || Timestamp.fromDate(new Date());\n\n if (this.maxChunks && this.getRequiredChunks() > this.maxChunks) {\n throw new Error(\n `cannot build \\`FileAppendTransaction\\` with more than ${this.maxChunks} chunks`,\n );\n }\n\n // Hack around the locked list. Should refactor a bit to remove such code\n this._transactionIds.locked = false;\n\n this._transactions.clear();\n this._transactionIds.clear();\n this._signedTransactions.clear();\n\n for (let chunk = 0; chunk < this.getRequiredChunks(); chunk++) {\n let nextTransactionId = TransactionId.withValidStart(\n accountId,\n validStart.plusNanos(this._chunkInterval * chunk),\n );\n this._transactionIds.push(nextTransactionId);\n this._transactionIds.advance();\n\n if (this._nodeAccountIds.list.length === 0) {\n this._transactions.push(this._makeSignedTransaction(null));\n } else {\n for (const nodeAccountId of this._nodeAccountIds.list) {\n this._transactions.push(\n this._makeSignedTransaction(nodeAccountId),\n );\n }\n }\n }\n\n this._transactionIds.advance();\n this._transactionIds.setLocked();\n }\n\n /**\n * Build all the signed transactions\n * @override\n * @internal\n */\n _buildAllTransactions() {\n if (this.maxChunks && this.getRequiredChunks() > this.maxChunks) {\n throw new Error(\n `cannot build \\`FileAppendTransaction\\` with more than ${this.maxChunks} chunks`,\n );\n }\n for (let i = 0; i < this._signedTransactions.length; i++) {\n this._buildTransaction(i);\n }\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp = /** @type {import(\"../Timestamp.js\").default} */ (\n this._transactionIds.current.validStart\n );\n return `FileAppendTransaction:${timestamp.toString()}`;\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.IFileAppendTransactionBody}\n */\n _makeTransactionData() {\n const length = this._contents != null ? this._contents.length : 0;\n const startIndex = this._transactionIds.index * this._chunkSize;\n const endIndex = Math.min(startIndex + this._chunkSize, length);\n\n return {\n fileID: this._fileId != null ? this._fileId._toProtobuf() : null,\n contents:\n this._contents != null\n ? this._contents.slice(startIndex, endIndex)\n : null,\n };\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nTRANSACTION_REGISTRY.set(\"fileAppend\", FileAppendTransaction._fromProtobuf);\n"],"names":["FileAppendTransaction","Transaction","constructor","props","super","this","_fileId","_contents","_maxChunks","_chunkSize","_chunkInterval","_defaultMaxTransactionFee","Hbar","fileId","setFileId","contents","setContents","maxChunks","setMaxChunks","chunkSize","setChunkSize","chunkInterval","setChunkInterval","_transactionIds","List","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","append","incrementValue","length","i","fileAppend","Uint8Array","concat","set","undefined","firstValidStart","validStart","secondValidStart","nanos","sub","toNumber","_fromProtobufTransactions","fileID","FileId","_requireNotFrozen","fromString","clone","getRequiredChunks","Math","ceil","utf8.encode","Error","freezeWith","client","nextTransactionId","_getTransactionId","locked","_transactions","clear","_signedTransactions","chunk","push","advance","nodeAccountId","_nodeAccountIds","list","_makeSignedTransaction","TransactionId","Timestamp","seconds","add","setLocked","schedule","execute","requestTimeout","executeAll","_isFrozen","transactionId","operatorAccountId","equals","signWithOperator","responses","remainingTimeout","startTimestamp","Date","now","response","getReceipt","_validateChecksums","validateChecksum","_execute","channel","request","file","appendContent","_getTransactionDataCase","_buildIncompleteTransactions","dummyAccountId","AccountId","accountId","fromDate","withValidStart","plusNanos","_buildAllTransactions","_buildTransaction","_getLogId","current","toString","_makeTransactionData","startIndex","index","endIndex","min","_toProtobuf","slice","TRANSACTION_REGISTRY"],"mappings":"qUAqCe,MAAMA,UAA8BC,EAS/C,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,QAAU,KAMfD,KAAKE,UAAY,KAMjBF,KAAKG,WAAa,GAMlBH,KAAKI,WAAa,KAMlBJ,KAAKK,eAAiB,GAEtBL,KAAKM,0BAA4B,IAAIC,EAAK,GAEtB,MAAhBT,EAAMU,QACNR,KAAKS,UAAUX,EAAMU,QAGH,MAAlBV,EAAMY,UACNV,KAAKW,YAAYb,EAAMY,UAGJ,MAAnBZ,EAAMc,WACNZ,KAAKa,aAAaf,EAAMc,WAGL,MAAnBd,EAAMgB,WACNd,KAAKe,aAAajB,EAAMgB,WAGD,MAAvBhB,EAAMkB,eACNhB,KAAKiB,iBAAiBnB,EAAMkB,eAIhChB,KAAKkB,gBAAkB,IAAIC,CACnC,CAWI,oBAAOC,CACHC,EACAC,EACAC,EACAC,EACAC,GAEA,MACMC,EADOD,EAAO,GAIf,WAEL,IAAIf,EAKJ,MAAMiB,EAAiBH,EAAQI,OAAS,EAAIJ,EAAQI,OAAS,EAE7D,IAAK,IAAIC,EAAI,EAAGA,EAAIJ,EAAOG,OAAQC,GAAKF,EAAgB,CACpD,MAAMG,EAEEL,EAAOI,GACV,WACL,GAA2B,MAAvBC,EAAWpB,SACX,MAGJ,GAAgB,MAAZA,EAAkB,CAClBA,EAAW,IAAIqB,WACgBD,EAAmB,UAElD,QAChB,CAGY,MAAME,EAAS,IAAID,WACfrB,EAASkB,OACsBE,EAAmB,SAAEF,QAExDI,EAAOC,IAAIvB,EAAU,GACrBsB,EAAOC,IACwBH,EAAmB,SAC9CpB,EA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OAC1B5B,KAAKyD,cAAcI,KAAK7D,KAAKkE,uBAAuB,YAEpD,IAAK,MAAMH,KAAiB/D,KAAKgE,gBAAgBC,KAC7CjE,KAAKyD,cAAcI,KACf7D,KAAKkE,uBAAuBH,GAIpD,CAEQ/D,KAAKkB,gBAAgB4C,UACrB9D,KAAKkB,gBAAgBqD,WAC7B,CAOI,qBAAAgC,GACI,GAAIvG,KAAKY,WAAaZ,KAAK+C,oBAAsB/C,KAAKY,UAClD,MAAM,IAAIuC,MACN,yDAAyDnD,KAAKY,oBAGtE,IAAK,IAAIiB,EAAI,EAAGA,EAAI7B,KAAK2D,oBAAoB/B,OAAQC,IACjD7B,KAAKwG,kBAAkB3E,EAEnC,CAKI,SAAA4E,GAII,MAAO,yBAFHzG,KAAKkB,gBAAgBwF,QACxB,WACyCC,YAClD,CAOI,oBAAAC,GACI,MAAMhF,EAA2B,MAAlB5B,KAAKE,UAAoBF,KAAKE,UAAU0B,OAAS,EAC1DiF,EAAa7G,KAAKkB,gBAAgB4F,MAAQ9G,KAAKI,WAC/C2G,EAAW/D,KAAKgE,IAAIH,EAAa7G,KAAKI,WAAYwB,GAExD,MAAO,CACHc,OAAwB,MAAhB1C,KAAKC,QAAkBD,KAAKC,QAAQgH,cAAgB,KAC5DvG,SACsB,MAAlBV,KAAKE,UACCF,KAAKE,UAAUgH,MAAML,EAAYE,GACjC,KAEtB,EAIAI,EAAqBlF,IAAI,aAActC,EAAsByB"}
|
|
1
|
+
{"version":3,"file":"FileAppendTransaction.js","sources":["../../src/file/FileAppendTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Hbar from \"../Hbar.js\";\nimport Transaction, {\n TRANSACTION_REGISTRY,\n} from \"../transaction/Transaction.js\";\nimport * as utf8 from \"../encoding/utf8.js\";\nimport FileId from \"./FileId.js\";\nimport TransactionId from \"../transaction/TransactionId.js\";\nimport Timestamp from \"../Timestamp.js\";\nimport List from \"../transaction/List.js\";\nimport AccountId from \"../account/AccountId.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransaction} HieroProto.proto.ITransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n * @typedef {import(\"@hiero-ledger/proto\").proto.IFileAppendTransactionBody} HieroProto.proto.IFileAppendTransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.IFileID} HieroProto.proto.IFileID\n */\n\n/**\n * @typedef {import(\"../PublicKey.js\").default} PublicKey\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../client/Client.js\").default<Channel, *>} Client\n * @typedef {import(\"../transaction/TransactionResponse.js\").default} TransactionResponse\n * @typedef {import(\"../schedule/ScheduleCreateTransaction.js\").default} ScheduleCreateTransaction\n */\n\n/**\n * A transaction specifically to append data to a file on the network.\n *\n * If a file has multiple keys, all keys must sign to modify its contents.\n */\nexport default class FileAppendTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {FileId | string} [props.fileId]\n * @param {Uint8Array | string} [props.contents]\n * @param {number} [props.maxChunks]\n * @param {number} [props.chunkSize]\n * @param {number} [props.chunkInterval]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?FileId}\n */\n this._fileId = null;\n\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._contents = null;\n\n /**\n * @private\n * @type {number}\n */\n this._maxChunks = 20;\n\n /**\n * @private\n * @type {number}\n */\n this._chunkSize = 4096;\n\n /**\n * @private\n * @type {number}\n */\n this._chunkInterval = 10;\n\n this._defaultMaxTransactionFee = new Hbar(5);\n\n if (props.fileId != null) {\n this.setFileId(props.fileId);\n }\n\n if (props.contents != null) {\n this.setContents(props.contents);\n }\n\n if (props.maxChunks != null) {\n this.setMaxChunks(props.maxChunks);\n }\n\n if (props.chunkSize != null) {\n this.setChunkSize(props.chunkSize);\n }\n\n if (props.chunkInterval != null) {\n this.setChunkInterval(props.chunkInterval);\n }\n\n /** @type {List<TransactionId>} */\n this._transactionIds = new List();\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITransaction[]} transactions\n * @param {HieroProto.proto.ISignedTransaction[]} signedTransactions\n * @param {TransactionId[]} transactionIds\n * @param {AccountId[]} nodeIds\n * @param {HieroProto.proto.ITransactionBody[]} bodies\n * @returns {FileAppendTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const append =\n /** @type {HieroProto.proto.IFileAppendTransactionBody} */ (\n body.fileAppend\n );\n\n let contents;\n\n // The increment value depends on whether the node IDs list is empty or not.\n // The node IDs list is not empty if the transaction has been frozen\n // before serialization and deserialization, otherwise, it's empty.\n const incrementValue = nodeIds.length > 0 ? nodeIds.length : 1;\n\n for (let i = 0; i < bodies.length; i += incrementValue) {\n const fileAppend =\n /** @type {HieroProto.proto.IFileAppendTransactionBody} */ (\n bodies[i].fileAppend\n );\n if (fileAppend.contents == null) {\n break;\n }\n\n if (contents == null) {\n contents = new Uint8Array(\n /** @type {Uint8Array} */ (fileAppend.contents),\n );\n continue;\n }\n\n /** @type {Uint8Array} */\n const concat = new Uint8Array(\n contents.length +\n /** @type {Uint8Array} */ (fileAppend.contents).length,\n );\n concat.set(contents, 0);\n concat.set(\n /** @type {Uint8Array} */ (fileAppend.contents),\n contents.length,\n );\n contents = concat;\n }\n const chunkSize = append.contents?.length || undefined;\n const maxChunks = bodies.length\n ? bodies.length / incrementValue\n : undefined;\n let chunkInterval;\n if (transactionIds.length > 1) {\n const firstValidStart = transactionIds[0].validStart;\n const secondValidStart = transactionIds[1].validStart;\n if (firstValidStart && secondValidStart) {\n chunkInterval = secondValidStart.nanos\n .sub(firstValidStart.nanos)\n .toNumber();\n }\n }\n\n return Transaction._fromProtobufTransactions(\n new FileAppendTransaction({\n fileId:\n append.fileID != null\n ? FileId._fromProtobuf(\n /** @type {HieroProto.proto.IFileID} */ (\n append.fileID\n ),\n )\n : undefined,\n contents,\n chunkSize,\n maxChunks,\n chunkInterval,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?FileId}\n */\n get fileId() {\n return this._fileId;\n }\n\n /**\n * Set the keys which must sign any transactions modifying this file. Required.\n *\n * All keys must sign to modify the file's contents or keys. No key is required\n * to sign for extending the expiration time (except the one for the operator account\n * paying for the transaction). Only one key must sign to delete the file, however.\n *\n * To require more than one key to sign to delete a file, add them to a\n * KeyList and pass that here.\n *\n * The network currently requires a file to have at least one key (or key list or threshold key)\n * but this requirement may be lifted in the future.\n *\n * @param {FileId | string} fileId\n * @returns {this}\n */\n setFileId(fileId) {\n this._requireNotFrozen();\n this._fileId =\n typeof fileId === \"string\"\n ? FileId.fromString(fileId)\n : fileId.clone();\n\n return this;\n }\n\n /**\n * @override\n * @returns {number}\n */\n getRequiredChunks() {\n if (this._contents == null) {\n return 1;\n }\n\n const result = Math.ceil(this._contents.length / this._chunkSize);\n\n return result;\n }\n\n /**\n * @returns {?Uint8Array}\n */\n get contents() {\n return this._contents;\n }\n\n /**\n * Set the given byte array as the file's contents.\n *\n * This may be omitted to append an empty file.\n *\n * Note that total size for a given transaction is limited to 6KiB (as of March 2020) by the\n * network; if you exceed this you may receive a HederaPreCheckStatusException\n * with Status#TransactionOversize.\n *\n * In this case, you will need to break the data into chunks of less than ~6KiB and execute this\n * transaction with the first chunk and then use FileAppendTransaction with\n * FileAppendTransaction#setContents(Uint8Array) for the remaining chunks.\n *\n * @param {Uint8Array | string} contents\n * @returns {this}\n */\n setContents(contents) {\n this._requireNotFrozen();\n this._contents =\n contents instanceof Uint8Array ? contents : utf8.encode(contents);\n\n return this;\n }\n\n /**\n * @returns {?number}\n */\n get maxChunks() {\n return this._maxChunks;\n }\n\n /**\n * @param {number} maxChunks\n * @returns {this}\n */\n setMaxChunks(maxChunks) {\n if (maxChunks <= 0) {\n throw new Error(\"Max chunks must be greater than 0\");\n }\n this._requireNotFrozen();\n this._maxChunks = maxChunks;\n return this;\n }\n\n /**\n * @returns {?number}\n */\n get chunkSize() {\n return this._chunkSize;\n }\n\n /**\n * @param {number} chunkSize\n * @returns {this}\n */\n setChunkSize(chunkSize) {\n if (chunkSize <= 0) {\n throw new Error(\"Chunk size must be greater than 0\");\n }\n this._chunkSize = chunkSize;\n return this;\n }\n\n /**\n * @returns {number}\n */\n get chunkInterval() {\n return this._chunkInterval;\n }\n\n /**\n * @param {number} chunkInterval The valid start interval between chunks in nanoseconds\n * @returns {this}\n */\n setChunkInterval(chunkInterval) {\n this._chunkInterval = chunkInterval;\n return this;\n }\n\n /**\n * Freeze this transaction from further modification to prepare for\n * signing or serialization.\n *\n * Will use the `Client`, if available, to generate a default Transaction ID and select 1/3\n * nodes to prepare this transaction for.\n *\n * @param {?import(\"../client/Client.js\").default<Channel, *>} client\n * @returns {this}\n */\n freezeWith(client) {\n super.freezeWith(client);\n\n if (this._contents == null) {\n return this;\n }\n\n let nextTransactionId = this._getTransactionId();\n\n // Hack around the locked list. Should refactor a bit to remove such code\n this._transactionIds.locked = false;\n\n this._transactions.clear();\n this._transactionIds.clear();\n this._signedTransactions.clear();\n\n for (let chunk = 0; chunk < this.getRequiredChunks(); chunk++) {\n this._transactionIds.push(nextTransactionId);\n this._transactionIds.advance();\n\n for (const nodeAccountId of this._nodeAccountIds.list) {\n this._signedTransactions.push(\n this._makeSignedTransaction(nodeAccountId),\n );\n }\n\n nextTransactionId = new TransactionId(\n /** @type {AccountId} */ (nextTransactionId.accountId),\n new Timestamp(\n /** @type {Timestamp} */ (\n nextTransactionId.validStart\n ).seconds,\n /** @type {Timestamp} */ (\n nextTransactionId.validStart\n ).nanos.add(this._chunkInterval),\n ),\n );\n }\n\n this._transactionIds.advance();\n this._transactionIds.setLocked();\n\n return this;\n }\n\n /**\n * @returns {ScheduleCreateTransaction}\n */\n schedule() {\n this._requireNotFrozen();\n\n if (this._contents != null && this._contents.length > this._chunkSize) {\n throw new Error(\n `cannot schedule \\`FileAppendTransaction\\` with message over ${this._chunkSize} bytes`,\n );\n }\n\n return super.schedule();\n }\n\n /**\n * @param {import(\"../client/Client.js\").default<Channel, *>} client\n * @param {number=} requestTimeout\n * @returns {Promise<TransactionResponse>}\n */\n async execute(client, requestTimeout) {\n return (await this.executeAll(client, requestTimeout))[0];\n }\n\n /**\n * @param {import(\"../client/Client.js\").default<Channel, *>} client\n * @param {number=} requestTimeout\n * @returns {Promise<TransactionResponse[]>}\n */\n async executeAll(client, requestTimeout) {\n if (this.maxChunks && this.getRequiredChunks() > this.maxChunks) {\n throw new Error(\n `cannot execute \\`FileAppendTransaction\\` with more than ${this.maxChunks} chunks`,\n );\n }\n\n if (!super._isFrozen()) {\n this.freezeWith(client);\n }\n\n // on execute, sign each transaction with the operator, if present\n // and we are signing a transaction that used the default transaction ID\n\n const transactionId = this._getTransactionId();\n const operatorAccountId = client.operatorAccountId;\n\n if (\n operatorAccountId != null &&\n operatorAccountId.equals(\n /** @type {AccountId} */ (transactionId.accountId),\n )\n ) {\n await super.signWithOperator(client);\n }\n\n const responses = [];\n let remainingTimeout = requestTimeout;\n\n for (let i = 0; i < this._transactionIds.length; i++) {\n const startTimestamp = Date.now();\n const response = await super.execute(client, remainingTimeout);\n\n if (remainingTimeout != null) {\n remainingTimeout = Date.now() - startTimestamp;\n }\n\n await response.getReceipt(client);\n responses.push(response);\n }\n\n return responses;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (this._fileId != null) {\n this._fileId.validateChecksum(client);\n }\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.file.appendContent(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"fileAppend\";\n }\n\n /**\n * Build all the transactions\n * when transactions are not complete.\n * @override\n * @internal\n */\n _buildIncompleteTransactions() {\n const dummyAccountId = AccountId.fromString(\"0.0.0\");\n const accountId = this.transactionId?.accountId || dummyAccountId;\n const validStart =\n this.transactionId?.validStart || Timestamp.fromDate(new Date());\n\n if (this.maxChunks && this.getRequiredChunks() > this.maxChunks) {\n throw new Error(\n `cannot build \\`FileAppendTransaction\\` with more than ${this.maxChunks} chunks`,\n );\n }\n\n // Hack around the locked list. Should refactor a bit to remove such code\n this._transactionIds.locked = false;\n\n this._transactions.clear();\n this._transactionIds.clear();\n this._signedTransactions.clear();\n\n for (let chunk = 0; chunk < this.getRequiredChunks(); chunk++) {\n let nextTransactionId = TransactionId.withValidStart(\n accountId,\n validStart.plusNanos(this._chunkInterval * chunk),\n );\n this._transactionIds.push(nextTransactionId);\n this._transactionIds.advance();\n\n if (this._nodeAccountIds.list.length === 0) {\n this._transactions.push(this._makeSignedTransaction(null));\n } else {\n for (const nodeAccountId of this._nodeAccountIds.list) {\n this._transactions.push(\n this._makeSignedTransaction(nodeAccountId),\n );\n }\n }\n }\n\n this._transactionIds.advance();\n this._transactionIds.setLocked();\n }\n\n /**\n * Build all the signed transactions\n * @override\n * @internal\n */\n _buildAllTransactions() {\n if (this.maxChunks && this.getRequiredChunks() > this.maxChunks) {\n throw new Error(\n `cannot build \\`FileAppendTransaction\\` with more than ${this.maxChunks} chunks`,\n );\n }\n for (let i = 0; i < this._signedTransactions.length; i++) {\n this._buildTransaction(i);\n }\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp = /** @type {import(\"../Timestamp.js\").default} */ (\n this._transactionIds.current.validStart\n );\n return `FileAppendTransaction:${timestamp.toString()}`;\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.IFileAppendTransactionBody}\n */\n _makeTransactionData() {\n const length = this._contents != null ? this._contents.length : 0;\n const startIndex = this._transactionIds.index * this._chunkSize;\n const endIndex = Math.min(startIndex + this._chunkSize, length);\n\n return {\n fileID: this._fileId != null ? this._fileId._toProtobuf() : null,\n contents:\n this._contents != null\n ? this._contents.slice(startIndex, endIndex)\n : null,\n };\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nTRANSACTION_REGISTRY.set(\"fileAppend\", FileAppendTransaction._fromProtobuf);\n"],"names":["FileAppendTransaction","Transaction","constructor","props","super","this","_fileId","_contents","_maxChunks","_chunkSize","_chunkInterval","_defaultMaxTransactionFee","Hbar","fileId","setFileId","contents","setContents","maxChunks","setMaxChunks","chunkSize","setChunkSize","chunkInterval","setChunkInterval","_transactionIds","List","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","append","incrementValue","length","i","fileAppend","Uint8Array","concat","set","undefined","firstValidStart","validStart","secondValidStart","nanos","sub","toNumber","_fromProtobufTransactions","fileID","FileId","_requireNotFrozen","fromString","clone","getRequiredChunks","Math","ceil","utf8.encode","Error","freezeWith","client","nextTransactionId","_getTransactionId","locked","_transactions","clear","_signedTransactions","chunk","push","advance","nodeAccountId","_nodeAccountIds","list","_makeSignedTransaction","TransactionId","Timestamp","seconds","add","setLocked","schedule","execute","requestTimeout","executeAll","_isFrozen","transactionId","operatorAccountId","equals","signWithOperator","responses","remainingTimeout","startTimestamp","Date","now","response","getReceipt","_validateChecksums","validateChecksum","_execute","channel","request","file","appendContent","_getTransactionDataCase","_buildIncompleteTransactions","dummyAccountId","AccountId","accountId","fromDate","withValidStart","plusNanos","_buildAllTransactions","_buildTransaction","_getLogId","current","toString","_makeTransactionData","startIndex","index","endIndex","min","_toProtobuf","slice","TRANSACTION_REGISTRY"],"mappings":"qUAqCe,MAAMA,UAA8BC,EAS/C,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,QAAU,KAMfD,KAAKE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,KAAKY,oBAGtE,IAAK,IAAIiB,EAAI,EAAGA,EAAI7B,KAAK2D,oBAAoB/B,OAAQC,IACjD7B,KAAKwG,kBAAkB3E,EAEnC,CAKI,SAAA4E,GAII,MAAO,yBAFHzG,KAAKkB,gBAAgBwF,QACxB,WACyCC,YAClD,CAOI,oBAAAC,GACI,MAAMhF,EAA2B,MAAlB5B,KAAKE,UAAoBF,KAAKE,UAAU0B,OAAS,EAC1DiF,EAAa7G,KAAKkB,gBAAgB4F,MAAQ9G,KAAKI,WAC/C2G,EAAW/D,KAAKgE,IAAIH,EAAa7G,KAAKI,WAAYwB,GAExD,MAAO,CACHc,OAAwB,MAAhB1C,KAAKC,QAAkBD,KAAKC,QAAQgH,cAAgB,KAC5DvG,SACsB,MAAlBV,KAAKE,UACCF,KAAKE,UAAUgH,MAAML,EAAYE,GACjC,KAEtB,EAIAI,EAAqBlF,IAAI,aAActC,EAAsByB"}
|
|
@@ -12,13 +12,13 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @namespace proto
|
|
15
|
-
* @typedef {import("@
|
|
16
|
-
* @typedef {import("@
|
|
17
|
-
* @typedef {import("@
|
|
18
|
-
* @typedef {import("@
|
|
19
|
-
* @typedef {import("@
|
|
20
|
-
* @typedef {import("@
|
|
21
|
-
* @typedef {import("@
|
|
15
|
+
* @typedef {import("@hiero-ledger/proto").proto.IQuery} HieroProto.proto.IQuery
|
|
16
|
+
* @typedef {import("@hiero-ledger/proto").proto.IQueryHeader} HieroProto.proto.IQueryHeader
|
|
17
|
+
* @typedef {import("@hiero-ledger/proto").proto.IResponse} HieroProto.proto.IResponse
|
|
18
|
+
* @typedef {import("@hiero-ledger/proto").proto.IResponseHeader} HieroProto.proto.IResponseHeader
|
|
19
|
+
* @typedef {import("@hiero-ledger/proto").proto.IFileGetContentsQuery} HieroProto.proto.IFileGetContentsQuery
|
|
20
|
+
* @typedef {import("@hiero-ledger/proto").proto.IFileGetContentsResponse} HieroProto.proto.IFileGetContentsResponse
|
|
21
|
+
* @typedef {import("@hiero-ledger/proto").proto.FileGetContentsResponse.IFileContents} HieroProto.proto.FileGetContentsResponse.IFileContents
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @namespace proto
|
|
3
|
-
* @typedef {import("@
|
|
4
|
-
* @typedef {import("@
|
|
5
|
-
* @typedef {import("@
|
|
6
|
-
* @typedef {import("@
|
|
7
|
-
* @typedef {import("@
|
|
8
|
-
* @typedef {import("@
|
|
9
|
-
* @typedef {import("@
|
|
3
|
+
* @typedef {import("@hiero-ledger/proto").proto.IQuery} HieroProto.proto.IQuery
|
|
4
|
+
* @typedef {import("@hiero-ledger/proto").proto.IQueryHeader} HieroProto.proto.IQueryHeader
|
|
5
|
+
* @typedef {import("@hiero-ledger/proto").proto.IResponse} HieroProto.proto.IResponse
|
|
6
|
+
* @typedef {import("@hiero-ledger/proto").proto.IResponseHeader} HieroProto.proto.IResponseHeader
|
|
7
|
+
* @typedef {import("@hiero-ledger/proto").proto.IFileGetContentsQuery} HieroProto.proto.IFileGetContentsQuery
|
|
8
|
+
* @typedef {import("@hiero-ledger/proto").proto.IFileGetContentsResponse} HieroProto.proto.IFileGetContentsResponse
|
|
9
|
+
* @typedef {import("@hiero-ledger/proto").proto.FileGetContentsResponse.IFileContents} HieroProto.proto.FileGetContentsResponse.IFileContents
|
|
10
10
|
*/
|
|
11
11
|
/**
|
|
12
12
|
* @typedef {import("../channel/Channel.js").default} Channel
|
|
@@ -59,14 +59,14 @@ export default class FileContentsQuery extends Query<Uint8Array<ArrayBufferLike>
|
|
|
59
59
|
}
|
|
60
60
|
export namespace HieroProto {
|
|
61
61
|
namespace proto {
|
|
62
|
-
type IQuery = import("@
|
|
63
|
-
type IQueryHeader = import("@
|
|
64
|
-
type IResponse = import("@
|
|
65
|
-
type IResponseHeader = import("@
|
|
66
|
-
type IFileGetContentsQuery = import("@
|
|
67
|
-
type IFileGetContentsResponse = import("@
|
|
62
|
+
type IQuery = import("@hiero-ledger/proto").proto.IQuery;
|
|
63
|
+
type IQueryHeader = import("@hiero-ledger/proto").proto.IQueryHeader;
|
|
64
|
+
type IResponse = import("@hiero-ledger/proto").proto.IResponse;
|
|
65
|
+
type IResponseHeader = import("@hiero-ledger/proto").proto.IResponseHeader;
|
|
66
|
+
type IFileGetContentsQuery = import("@hiero-ledger/proto").proto.IFileGetContentsQuery;
|
|
67
|
+
type IFileGetContentsResponse = import("@hiero-ledger/proto").proto.IFileGetContentsResponse;
|
|
68
68
|
namespace FileGetContentsResponse {
|
|
69
|
-
type IFileContents = import("@
|
|
69
|
+
type IFileContents = import("@hiero-ledger/proto").proto.FileGetContentsResponse.IFileContents;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileContentsQuery.js","sources":["../../src/file/FileContentsQuery.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Query, { QUERY_REGISTRY } from \"../query/Query.js\";\nimport FileId from \"./FileId.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@
|
|
1
|
+
{"version":3,"file":"FileContentsQuery.js","sources":["../../src/file/FileContentsQuery.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Query, { QUERY_REGISTRY } from \"../query/Query.js\";\nimport FileId from \"./FileId.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.IQuery} HieroProto.proto.IQuery\n * @typedef {import(\"@hiero-ledger/proto\").proto.IQueryHeader} HieroProto.proto.IQueryHeader\n * @typedef {import(\"@hiero-ledger/proto\").proto.IResponse} HieroProto.proto.IResponse\n * @typedef {import(\"@hiero-ledger/proto\").proto.IResponseHeader} HieroProto.proto.IResponseHeader\n * @typedef {import(\"@hiero-ledger/proto\").proto.IFileGetContentsQuery} HieroProto.proto.IFileGetContentsQuery\n * @typedef {import(\"@hiero-ledger/proto\").proto.IFileGetContentsResponse} HieroProto.proto.IFileGetContentsResponse\n * @typedef {import(\"@hiero-ledger/proto\").proto.FileGetContentsResponse.IFileContents} HieroProto.proto.FileGetContentsResponse.IFileContents\n */\n\n/**\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../client/Client.js\").default<*, *>} Client\n * @typedef {import(\"../account/AccountId.js\").default} AccountId\n */\n\n/**\n * @augments {Query<Uint8Array>}\n * Retrieve the content of a file in HFS.<br/>\n * Note that this query retrieves _only_ the file content, not any of\n * the metadata for the file.\n */\nexport default class FileContentsQuery extends Query {\n /**\n * @param {object} [props]\n * @param {FileId | string} [props.fileId]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @type {?FileId}\n * @private\n */\n this._fileId = null;\n if (props.fileId != null) {\n this.setFileId(props.fileId);\n }\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.IQuery} query\n * @returns {FileContentsQuery}\n */\n static _fromProtobuf(query) {\n const contents = /** @type {HieroProto.proto.IFileGetContentsQuery} */ (\n query.fileGetContents\n );\n\n return new FileContentsQuery({\n fileId:\n contents.fileID != null\n ? FileId._fromProtobuf(contents.fileID)\n : undefined,\n });\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (this._fileId != null) {\n this._fileId.validateChecksum(client);\n }\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.IQuery} request\n * @returns {Promise<HieroProto.proto.IResponse>}\n */\n _execute(channel, request) {\n return channel.file.getFileContent(request);\n }\n\n /**\n * @returns {?FileId}\n */\n get fileId() {\n return this._fileId;\n }\n\n /**\n * Set the file ID for which the info is being requested.\n *\n * @param {FileId | string} fileId\n * @returns {FileContentsQuery}\n */\n setFileId(fileId) {\n this._fileId =\n typeof fileId === \"string\"\n ? FileId.fromString(fileId)\n : fileId.clone();\n\n return this;\n }\n\n /**\n * @override\n * @internal\n * @param {HieroProto.proto.IResponse} response\n * @returns {HieroProto.proto.IResponseHeader}\n */\n _mapResponseHeader(response) {\n const fileGetContents =\n /** @type {HieroProto.proto.IFileGetContentsResponse} */ (\n response.fileGetContents\n );\n return /** @type {HieroProto.proto.IResponseHeader} */ (\n fileGetContents.header\n );\n }\n\n /**\n * @protected\n * @override\n * @param {HieroProto.proto.IResponse} response\n * @returns {Promise<Uint8Array>}\n */\n _mapResponse(response) {\n const fileContentsResponse =\n /** @type {HieroProto.proto.IFileGetContentsResponse} */ (\n response.fileGetContents\n );\n const fileConents =\n /** @type {HieroProto.proto.FileGetContentsResponse.IFileContents} */ (\n fileContentsResponse.fileContents\n );\n const contents = /** @type {Uint8Array} */ (fileConents.contents);\n\n return Promise.resolve(contents);\n }\n\n /**\n * @override\n * @internal\n * @param {HieroProto.proto.IQueryHeader} header\n * @returns {HieroProto.proto.IQuery}\n */\n _onMakeRequest(header) {\n return {\n fileGetContents: {\n header,\n fileID:\n this._fileId != null ? this._fileId._toProtobuf() : null,\n },\n };\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp =\n this._paymentTransactionId != null &&\n this._paymentTransactionId.validStart != null\n ? this._paymentTransactionId.validStart\n : this._timestamp;\n\n return `FileContentsQuery:${timestamp.toString()}`;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nQUERY_REGISTRY.set(\"fileGetContents\", FileContentsQuery._fromProtobuf);\n"],"names":["FileContentsQuery","Query","constructor","props","super","this","_fileId","fileId","setFileId","_fromProtobuf","query","contents","fileID","FileId","undefined","_validateChecksums","client","validateChecksum","_execute","channel","request","file","getFileContent","fromString","clone","_mapResponseHeader","response","_mapResponse","Promise","resolve","_onMakeRequest","header","fileGetContents","_toProtobuf","_getLogId","_paymentTransactionId","validStart","_timestamp","toString","QUERY_REGISTRY","set"],"mappings":"iFA4Be,MAAMA,UAA0BC,EAK3C,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,QAAU,KACK,MAAhBH,EAAMI,QACNF,KAAKG,UAAUL,EAAMI,OAEjC,CAOI,oBAAOE,CAAcC,GACjB,MAAMC,EACFD,EACH,gBAED,OAAO,IAAIV,EAAkB,CACzBO,OACuB,MAAnBI,EAASC,OACHC,EAAOJ,cAAcE,EAASC,aAC9BE,GAEtB,CAKI,kBAAAC,CAAmBC,GACK,MAAhBX,KAAKC,SACLD,KAAKC,QAAQW,iBAAiBD,EAE1C,CASI,QAAAE,CAASC,EAASC,GACd,OAAOD,EAAQE,KAAKC,eAAeF,EAC3C,CAKI,UAAIb,GACA,OAAOF,KAAKC,OACpB,CAQI,SAAAE,CAAUD,GAMN,OALAF,KAAKC,QACiB,iBAAXC,EACDM,EAAOU,WAAWhB,GAClBA,EAAOiB,QAEVnB,IACf,CAQI,kBAAAoB,CAAmBC,GAKf,OAFQA,EACH,gBAGb,MACA,CAQI,YAAAC,CAAaD,GACT,MAQMf,EANEe,EACH,gBAIA,aAC2D,SAEhE,OAAOE,QAAQC,QAAQlB,EAC/B,CAQI,cAAAmB,CAAeC,GACX,MAAO,CACHC,gBAAiB,CACbD,SACAnB,OACoB,MAAhBP,KAAKC,QAAkBD,KAAKC,QAAQ2B,cAAgB,MAGxE,CAKI,SAAAC,GAOI,MAAO,sBAL2B,MAA9B7B,KAAK8B,uBACoC,MAAzC9B,KAAK8B,sBAAsBC,WACrB/B,KAAK8B,sBAAsBC,WAC3B/B,KAAKgC,YAEuBC,YAC9C,EAIAC,EAAeC,IAAI,kBAAmBxC,EAAkBS"}
|
|
@@ -17,12 +17,12 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* @namespace proto
|
|
20
|
-
* @typedef {import("@
|
|
21
|
-
* @typedef {import("@
|
|
22
|
-
* @typedef {import("@
|
|
23
|
-
* @typedef {import("@
|
|
24
|
-
* @typedef {import("@
|
|
25
|
-
* @typedef {import("@
|
|
20
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransaction} HieroProto.proto.ITransaction
|
|
21
|
+
* @typedef {import("@hiero-ledger/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
|
|
22
|
+
* @typedef {import("@hiero-ledger/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
|
|
23
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
|
|
24
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
|
|
25
|
+
* @typedef {import("@hiero-ledger/proto").proto.IFileCreateTransactionBody} HieroProto.proto.IFileCreateTransactionBody
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @namespace proto
|
|
3
|
-
* @typedef {import("@
|
|
4
|
-
* @typedef {import("@
|
|
5
|
-
* @typedef {import("@
|
|
6
|
-
* @typedef {import("@
|
|
7
|
-
* @typedef {import("@
|
|
8
|
-
* @typedef {import("@
|
|
3
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransaction} HieroProto.proto.ITransaction
|
|
4
|
+
* @typedef {import("@hiero-ledger/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
|
|
5
|
+
* @typedef {import("@hiero-ledger/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
|
|
6
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
|
|
7
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
|
|
8
|
+
* @typedef {import("@hiero-ledger/proto").proto.IFileCreateTransactionBody} HieroProto.proto.IFileCreateTransactionBody
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
11
|
* @typedef {import("../channel/Channel.js").default} Channel
|
|
@@ -136,12 +136,12 @@ export default class FileCreateTransaction extends Transaction {
|
|
|
136
136
|
}
|
|
137
137
|
export namespace HieroProto {
|
|
138
138
|
namespace proto {
|
|
139
|
-
type ITransaction = import("@
|
|
140
|
-
type ISignedTransaction = import("@
|
|
141
|
-
type TransactionBody = import("@
|
|
142
|
-
type ITransactionBody = import("@
|
|
143
|
-
type ITransactionResponse = import("@
|
|
144
|
-
type IFileCreateTransactionBody = import("@
|
|
139
|
+
type ITransaction = import("@hiero-ledger/proto").proto.ITransaction;
|
|
140
|
+
type ISignedTransaction = import("@hiero-ledger/proto").proto.ISignedTransaction;
|
|
141
|
+
type TransactionBody = import("@hiero-ledger/proto").proto.TransactionBody;
|
|
142
|
+
type ITransactionBody = import("@hiero-ledger/proto").proto.ITransactionBody;
|
|
143
|
+
type ITransactionResponse = import("@hiero-ledger/proto").proto.ITransactionResponse;
|
|
144
|
+
type IFileCreateTransactionBody = import("@hiero-ledger/proto").proto.IFileCreateTransactionBody;
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
export type Channel = import("../channel/Channel.js").default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileCreateTransaction.js","sources":["../../src/file/FileCreateTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Hbar from \"../Hbar.js\";\nimport Transaction, {\n TRANSACTION_REGISTRY,\n DEFAULT_AUTO_RENEW_PERIOD,\n} from \"../transaction/Transaction.js\";\nimport * as utf8 from \"../encoding/utf8.js\";\nimport Timestamp from \"../Timestamp.js\";\nimport Key from \"../Key.js\";\nimport KeyList from \"../KeyList.js\";\nimport Long from \"long\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hashgraph/proto\").proto.ITransaction} HieroProto.proto.ITransaction\n * @typedef {import(\"@hashgraph/proto\").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction\n * @typedef {import(\"@hashgraph/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n * @typedef {import(\"@hashgraph/proto\").proto.IFileCreateTransactionBody} HieroProto.proto.IFileCreateTransactionBody\n */\n\n/**\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../account/AccountId.js\").default} AccountId\n * @typedef {import(\"../transaction/TransactionId.js\").default} TransactionId\n */\n\n/**\n * Create a new Hedera™ crypto-currency file.\n */\nexport default class FileCreateTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {Key[] | KeyList} [props.keys]\n * @param {Timestamp | Date} [props.expirationTime]\n * @param {Uint8Array | string} [props.contents]\n * @param {string} [props.fileMemo]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?Key[]}\n */\n this._keys = null;\n\n /**\n * @private\n * @type {Timestamp}\n */\n this._expirationTime = new Timestamp(0, 0).plusNanos(\n Long.fromNumber(Date.now())\n .mul(1000000)\n .add(DEFAULT_AUTO_RENEW_PERIOD.mul(1000000000)),\n );\n\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._contents = null;\n\n /**\n * @private\n * @type {?string}\n */\n this._fileMemo = null;\n\n this._defaultMaxTransactionFee = new Hbar(5);\n\n if (props.keys != null) {\n this.setKeys(props.keys);\n }\n\n if (props.expirationTime != null) {\n this.setExpirationTime(props.expirationTime);\n }\n\n if (props.contents != null) {\n this.setContents(props.contents);\n }\n\n if (props.fileMemo && props.fileMemo != null) {\n this.setFileMemo(props.fileMemo);\n }\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITransaction[]} transactions\n * @param {HieroProto.proto.ISignedTransaction[]} signedTransactions\n * @param {TransactionId[]} transactionIds\n * @param {AccountId[]} nodeIds\n * @param {HieroProto.proto.ITransactionBody[]} bodies\n * @returns {FileCreateTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const create =\n /** @type {HieroProto.proto.IFileCreateTransactionBody} */ (\n body.fileCreate\n );\n\n return Transaction._fromProtobufTransactions(\n new FileCreateTransaction({\n keys:\n create.keys != null\n ? create.keys.keys != null\n ? create.keys.keys.map((key) =>\n Key._fromProtobufKey(key),\n )\n : undefined\n : undefined,\n expirationTime:\n create.expirationTime != null\n ? Timestamp._fromProtobuf(create.expirationTime)\n : undefined,\n contents: create.contents != null ? create.contents : undefined,\n fileMemo: create.memo != null ? create.memo : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?Key[]}\n */\n get keys() {\n return this._keys;\n }\n\n /**\n * Set the keys which must sign any transactions modifying this file. Required.\n *\n * All keys must sign to modify the file's contents or keys. No key is required\n * to sign for extending the expiration time (except the one for the operator account\n * paying for the transaction). Only one key must sign to delete the file, however.\n *\n * To require more than one key to sign to delete a file, add them to a\n * KeyList and pass that here.\n *\n * The network currently requires a file to have at least one key (or key list or threshold key)\n * but this requirement may be lifted in the future.\n *\n * @param {Key[] | KeyList} keys\n * @returns {this}\n */\n setKeys(keys) {\n this._requireNotFrozen();\n if (keys instanceof KeyList && keys.threshold != null) {\n throw new Error(\"Cannot set threshold key as file key\");\n }\n\n this._keys = keys instanceof KeyList ? keys.toArray() : keys;\n\n return this;\n }\n\n /**\n * @returns {Timestamp}\n */\n get expirationTime() {\n return this._expirationTime;\n }\n\n /**\n * Set the instant at which this file will expire, after which its contents will no longer be\n * available.\n *\n * Defaults to 1/4 of a Julian year from the instant FileCreateTransaction\n * was invoked.\n *\n * May be extended using FileUpdateTransaction#setExpirationTime(Timestamp).\n *\n * @param {Timestamp | Date} expirationTime\n * @returns {this}\n */\n setExpirationTime(expirationTime) {\n this._requireNotFrozen();\n this._expirationTime =\n expirationTime instanceof Timestamp\n ? expirationTime\n : Timestamp.fromDate(expirationTime);\n\n return this;\n }\n\n /**\n * @returns {?Uint8Array}\n */\n get contents() {\n return this._contents;\n }\n\n /**\n * Set the given byte array as the file's contents.\n *\n * This may be omitted to create an empty file.\n *\n * Note that total size for a given transaction is limited to 6KiB (as of March 2020) by the\n * network; if you exceed this you may receive a HederaPreCheckStatusException\n * with Status#TransactionOversize.\n *\n * In this case, you will need to break the data into chunks of less than ~6KiB and execute this\n * transaction with the first chunk and then use FileAppendTransaction with\n * FileAppendTransaction#setContents(Uint8Array) for the remaining chunks.\n *\n * @param {Uint8Array | string} contents\n * @returns {this}\n */\n setContents(contents) {\n this._requireNotFrozen();\n this._contents =\n contents instanceof Uint8Array ? contents : utf8.encode(contents);\n\n return this;\n }\n\n /**\n * @returns {?string}\n */\n get fileMemo() {\n return this._fileMemo;\n }\n\n /**\n * @param {string} memo\n * @returns {this}\n */\n setFileMemo(memo) {\n this._requireNotFrozen();\n this._fileMemo = memo;\n\n return this;\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.file.createFile(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"fileCreate\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.IFileCreateTransactionBody}\n */\n _makeTransactionData() {\n return {\n keys:\n this._keys != null\n ? {\n keys: this._keys.map((key) => key._toProtobufKey()),\n }\n : null,\n expirationTime: this._expirationTime._toProtobuf(),\n contents: this._contents,\n memo: this._fileMemo,\n };\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp = /** @type {import(\"../Timestamp.js\").default} */ (\n this._transactionIds.current.validStart\n );\n return `FileCreateTransaction:${timestamp.toString()}`;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nTRANSACTION_REGISTRY.set(\"fileCreate\", FileCreateTransaction._fromProtobuf);\n"],"names":["FileCreateTransaction","Transaction","constructor","props","super","this","_keys","_expirationTime","Timestamp","plusNanos","Long","fromNumber","Date","now","mul","add","DEFAULT_AUTO_RENEW_PERIOD","_contents","_fileMemo","_defaultMaxTransactionFee","Hbar","keys","setKeys","expirationTime","setExpirationTime","contents","setContents","fileMemo","setFileMemo","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","create","_fromProtobufTransactions","map","key","Key","_fromProtobufKey","undefined","memo","_requireNotFrozen","KeyList","threshold","Error","toArray","fromDate","Uint8Array","utf8.encode","_execute","channel","request","file","createFile","_getTransactionDataCase","_makeTransactionData","_toProtobufKey","_toProtobuf","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"uRAgCe,MAAMA,UAA8BC,EAQ/C,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,MAAQ,KAMbD,KAAKE,gBAAkB,IAAIC,EAAU,EAAG,GAAGC,UACvCC,EAAKC,WAAWC,KAAKC,OAChBC,IAAI,KACJC,IAAIC,EAA0BF,IAAI,OAO3CT,KAAKY,UAAY,KAMjBZ,KAAKa,UAAY,KAEjBb,KAAKc,0BAA4B,IAAIC,EAAK,GAExB,MAAdjB,EAAMkB,MACNhB,KAAKiB,QAAQnB,EAAMkB,MAGK,MAAxBlB,EAAMoB,gBACNlB,KAAKmB,kBAAkBrB,EAAMoB,gBAGX,MAAlBpB,EAAMsB,UACNpB,KAAKqB,YAAYvB,EAAMsB,UAGvBtB,EAAMwB,UAA8B,MAAlBxB,EAAMwB,UACxBtB,KAAKuB,YAAYzB,EAAMwB,SAEnC,CAWI,oBAAOE,CACHC,EACAC,EACAC,EACAC,EACAC,GAEA,MACMC,EADOD,EAAO,GAIf,WAEL,OAAOjC,EAAYmC,0BACf,IAAIpC,EAAsB,CACtBqB,KACmB,MAAfc,EAAOd,MACmB,MAApBc,EAAOd,KAAKA,KACRc,EAAOd,KAAKA,KAAKgB,IAAKC,GAClBC,EAAIC,iBAAiBF,SAG7BG,EACVlB,eAC6B,MAAzBY,EAAOZ,eACDf,EAAUqB,cAAcM,EAAOZ,qBAC/BkB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6B"}
|
|
1
|
+
{"version":3,"file":"FileCreateTransaction.js","sources":["../../src/file/FileCreateTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Hbar from \"../Hbar.js\";\nimport Transaction, {\n TRANSACTION_REGISTRY,\n DEFAULT_AUTO_RENEW_PERIOD,\n} from \"../transaction/Transaction.js\";\nimport * as utf8 from \"../encoding/utf8.js\";\nimport Timestamp from \"../Timestamp.js\";\nimport Key from \"../Key.js\";\nimport KeyList from \"../KeyList.js\";\nimport Long from \"long\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransaction} HieroProto.proto.ITransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n * @typedef {import(\"@hiero-ledger/proto\").proto.IFileCreateTransactionBody} HieroProto.proto.IFileCreateTransactionBody\n */\n\n/**\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../account/AccountId.js\").default} AccountId\n * @typedef {import(\"../transaction/TransactionId.js\").default} TransactionId\n */\n\n/**\n * Create a new Hedera™ crypto-currency file.\n */\nexport default class FileCreateTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {Key[] | KeyList} [props.keys]\n * @param {Timestamp | Date} [props.expirationTime]\n * @param {Uint8Array | string} [props.contents]\n * @param {string} [props.fileMemo]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?Key[]}\n */\n this._keys = null;\n\n /**\n * @private\n * @type {Timestamp}\n */\n this._expirationTime = new Timestamp(0, 0).plusNanos(\n Long.fromNumber(Date.now())\n .mul(1000000)\n .add(DEFAULT_AUTO_RENEW_PERIOD.mul(1000000000)),\n );\n\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._contents = null;\n\n /**\n * @private\n * @type {?string}\n */\n this._fileMemo = null;\n\n this._defaultMaxTransactionFee = new Hbar(5);\n\n if (props.keys != null) {\n this.setKeys(props.keys);\n }\n\n if (props.expirationTime != null) {\n this.setExpirationTime(props.expirationTime);\n }\n\n if (props.contents != null) {\n this.setContents(props.contents);\n }\n\n if (props.fileMemo && props.fileMemo != null) {\n this.setFileMemo(props.fileMemo);\n }\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITransaction[]} transactions\n * @param {HieroProto.proto.ISignedTransaction[]} signedTransactions\n * @param {TransactionId[]} transactionIds\n * @param {AccountId[]} nodeIds\n * @param {HieroProto.proto.ITransactionBody[]} bodies\n * @returns {FileCreateTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const create =\n /** @type {HieroProto.proto.IFileCreateTransactionBody} */ (\n body.fileCreate\n );\n\n return Transaction._fromProtobufTransactions(\n new FileCreateTransaction({\n keys:\n create.keys != null\n ? create.keys.keys != null\n ? create.keys.keys.map((key) =>\n Key._fromProtobufKey(key),\n )\n : undefined\n : undefined,\n expirationTime:\n create.expirationTime != null\n ? Timestamp._fromProtobuf(create.expirationTime)\n : undefined,\n contents: create.contents != null ? create.contents : undefined,\n fileMemo: create.memo != null ? create.memo : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?Key[]}\n */\n get keys() {\n return this._keys;\n }\n\n /**\n * Set the keys which must sign any transactions modifying this file. Required.\n *\n * All keys must sign to modify the file's contents or keys. No key is required\n * to sign for extending the expiration time (except the one for the operator account\n * paying for the transaction). Only one key must sign to delete the file, however.\n *\n * To require more than one key to sign to delete a file, add them to a\n * KeyList and pass that here.\n *\n * The network currently requires a file to have at least one key (or key list or threshold key)\n * but this requirement may be lifted in the future.\n *\n * @param {Key[] | KeyList} keys\n * @returns {this}\n */\n setKeys(keys) {\n this._requireNotFrozen();\n if (keys instanceof KeyList && keys.threshold != null) {\n throw new Error(\"Cannot set threshold key as file key\");\n }\n\n this._keys = keys instanceof KeyList ? keys.toArray() : keys;\n\n return this;\n }\n\n /**\n * @returns {Timestamp}\n */\n get expirationTime() {\n return this._expirationTime;\n }\n\n /**\n * Set the instant at which this file will expire, after which its contents will no longer be\n * available.\n *\n * Defaults to 1/4 of a Julian year from the instant FileCreateTransaction\n * was invoked.\n *\n * May be extended using FileUpdateTransaction#setExpirationTime(Timestamp).\n *\n * @param {Timestamp | Date} expirationTime\n * @returns {this}\n */\n setExpirationTime(expirationTime) {\n this._requireNotFrozen();\n this._expirationTime =\n expirationTime instanceof Timestamp\n ? expirationTime\n : Timestamp.fromDate(expirationTime);\n\n return this;\n }\n\n /**\n * @returns {?Uint8Array}\n */\n get contents() {\n return this._contents;\n }\n\n /**\n * Set the given byte array as the file's contents.\n *\n * This may be omitted to create an empty file.\n *\n * Note that total size for a given transaction is limited to 6KiB (as of March 2020) by the\n * network; if you exceed this you may receive a HederaPreCheckStatusException\n * with Status#TransactionOversize.\n *\n * In this case, you will need to break the data into chunks of less than ~6KiB and execute this\n * transaction with the first chunk and then use FileAppendTransaction with\n * FileAppendTransaction#setContents(Uint8Array) for the remaining chunks.\n *\n * @param {Uint8Array | string} contents\n * @returns {this}\n */\n setContents(contents) {\n this._requireNotFrozen();\n this._contents =\n contents instanceof Uint8Array ? contents : utf8.encode(contents);\n\n return this;\n }\n\n /**\n * @returns {?string}\n */\n get fileMemo() {\n return this._fileMemo;\n }\n\n /**\n * @param {string} memo\n * @returns {this}\n */\n setFileMemo(memo) {\n this._requireNotFrozen();\n this._fileMemo = memo;\n\n return this;\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.file.createFile(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"fileCreate\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.IFileCreateTransactionBody}\n */\n _makeTransactionData() {\n return {\n keys:\n this._keys != null\n ? {\n keys: this._keys.map((key) => key._toProtobufKey()),\n }\n : null,\n expirationTime: this._expirationTime._toProtobuf(),\n contents: this._contents,\n memo: this._fileMemo,\n };\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp = /** @type {import(\"../Timestamp.js\").default} */ (\n this._transactionIds.current.validStart\n );\n return `FileCreateTransaction:${timestamp.toString()}`;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nTRANSACTION_REGISTRY.set(\"fileCreate\", FileCreateTransaction._fromProtobuf);\n"],"names":["FileCreateTransaction","Transaction","constructor","props","super","this","_keys","_expirationTime","Timestamp","plusNanos","Long","fromNumber","Date","now","mul","add","DEFAULT_AUTO_RENEW_PERIOD","_contents","_fileMemo","_defaultMaxTransactionFee","Hbar","keys","setKeys","expirationTime","setExpirationTime","contents","setContents","fileMemo","setFileMemo","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","create","_fromProtobufTransactions","map","key","Key","_fromProtobufKey","undefined","memo","_requireNotFrozen","KeyList","threshold","Error","toArray","fromDate","Uint8Array","utf8.encode","_execute","channel","request","file","createFile","_getTransactionDataCase","_makeTransactionData","_toProtobufKey","_toProtobuf","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"uRAgCe,MAAMA,UAA8BC,EAQ/C,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,MAAQ,KAMbD,KAAKE,gBAAkB,IAAIC,EAAU,EAAG,GAAGC,UACvCC,EAAKC,WAAWC,KAAKC,OAChBC,IAAI,KACJC,IAAIC,EAA0BF,IAAI,OAO3CT,KAAKY,UAAY,KAMjBZ,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AKR,OAJApB,KAAKsC,oBACLtC,KAAKY,UACDQ,aAAoBwB,WAAaxB,EAAWyB,EAAYzB,GAErDpB,IACf,CAKI,YAAIsB,GACA,OAAOtB,KAAKa,SACpB,CAMI,WAAAU,CAAYc,GAIR,OAHArC,KAAKsC,oBACLtC,KAAKa,UAAYwB,EAEVrC,IACf,CASI,QAAA8C,CAASC,EAASC,GACd,OAAOD,EAAQE,KAAKC,WAAWF,EACvC,CAOI,uBAAAG,GACI,MAAO,YACf,CAOI,oBAAAC,GACI,MAAO,CACHpC,KACkB,MAAdhB,KAAKC,MACC,CACIe,KAAMhB,KAAKC,MAAM+B,IAAKC,GAAQA,EAAIoB,mBAEtC,KACVnC,eAAgBlB,KAAKE,gBAAgBoD,cACrClC,SAAUpB,KAAKY,UACfyB,KAAMrC,KAAKa,UAEvB,CAKI,SAAA0C,GAII,MAAO,yBAFHvD,KAAKwD,gBAAgBC,QACxB,WACyCC,YAClD,EAIAC,EAAqBC,IAAI,aAAcjE,EAAsB6B"}
|
|
@@ -12,16 +12,16 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @namespace proto
|
|
15
|
-
* @typedef {import("@
|
|
16
|
-
* @typedef {import("@
|
|
17
|
-
* @typedef {import("@
|
|
18
|
-
* @typedef {import("@
|
|
19
|
-
* @typedef {import("@
|
|
20
|
-
* @typedef {import("@
|
|
15
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransaction} HieroProto.proto.ITransaction
|
|
16
|
+
* @typedef {import("@hiero-ledger/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
|
|
17
|
+
* @typedef {import("@hiero-ledger/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
|
|
18
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
|
|
19
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
|
|
20
|
+
* @typedef {import("@hiero-ledger/proto").proto.IFileDeleteTransactionBody} HieroProto.proto.IFileDeleteTransactionBody
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* @typedef {import("@
|
|
24
|
+
* @typedef {import("@hiero-ledger/cryptography").Key} Key
|
|
25
25
|
* @typedef {import("../channel/Channel.js").default} Channel
|
|
26
26
|
* @typedef {import("../client/Client.js").default<*, *>} Client
|
|
27
27
|
* @typedef {import("../account/AccountId.js").default} AccountId
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @namespace proto
|
|
3
|
-
* @typedef {import("@
|
|
4
|
-
* @typedef {import("@
|
|
5
|
-
* @typedef {import("@
|
|
6
|
-
* @typedef {import("@
|
|
7
|
-
* @typedef {import("@
|
|
8
|
-
* @typedef {import("@
|
|
3
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransaction} HieroProto.proto.ITransaction
|
|
4
|
+
* @typedef {import("@hiero-ledger/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
|
|
5
|
+
* @typedef {import("@hiero-ledger/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
|
|
6
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
|
|
7
|
+
* @typedef {import("@hiero-ledger/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
|
|
8
|
+
* @typedef {import("@hiero-ledger/proto").proto.IFileDeleteTransactionBody} HieroProto.proto.IFileDeleteTransactionBody
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
|
-
* @typedef {import("@
|
|
11
|
+
* @typedef {import("@hiero-ledger/cryptography").Key} Key
|
|
12
12
|
* @typedef {import("../channel/Channel.js").default} Channel
|
|
13
13
|
* @typedef {import("../client/Client.js").default<*, *>} Client
|
|
14
14
|
* @typedef {import("../account/AccountId.js").default} AccountId
|
|
@@ -67,15 +67,15 @@ export default class FileDeleteTransaction extends Transaction {
|
|
|
67
67
|
}
|
|
68
68
|
export namespace HieroProto {
|
|
69
69
|
namespace proto {
|
|
70
|
-
type ITransaction = import("@
|
|
71
|
-
type ISignedTransaction = import("@
|
|
72
|
-
type TransactionBody = import("@
|
|
73
|
-
type ITransactionBody = import("@
|
|
74
|
-
type ITransactionResponse = import("@
|
|
75
|
-
type IFileDeleteTransactionBody = import("@
|
|
70
|
+
type ITransaction = import("@hiero-ledger/proto").proto.ITransaction;
|
|
71
|
+
type ISignedTransaction = import("@hiero-ledger/proto").proto.ISignedTransaction;
|
|
72
|
+
type TransactionBody = import("@hiero-ledger/proto").proto.TransactionBody;
|
|
73
|
+
type ITransactionBody = import("@hiero-ledger/proto").proto.ITransactionBody;
|
|
74
|
+
type ITransactionResponse = import("@hiero-ledger/proto").proto.ITransactionResponse;
|
|
75
|
+
type IFileDeleteTransactionBody = import("@hiero-ledger/proto").proto.IFileDeleteTransactionBody;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
export type Key = import("@
|
|
78
|
+
export type Key = import("@hiero-ledger/cryptography").Key;
|
|
79
79
|
export type Channel = import("../channel/Channel.js").default;
|
|
80
80
|
export type Client = import("../client/Client.js").default<any, any>;
|
|
81
81
|
export type AccountId = import("../account/AccountId.js").default;
|