@hiero-ledger/sdk 2.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +167 -0
- package/dist/umd.js +98781 -0
- package/dist/umd.min.js +122 -0
- package/lib/BadEntityIdError.cjs +27 -0
- package/lib/BadEntityIdError.d.ts +15 -0
- package/lib/BadEntityIdError.js +2 -0
- package/lib/BadEntityIdError.js.map +1 -0
- package/lib/Cache.cjs +376 -0
- package/lib/Cache.d.ts +228 -0
- package/lib/Cache.js +2 -0
- package/lib/Cache.js.map +1 -0
- package/lib/Duration.cjs +53 -0
- package/lib/Duration.d.ts +37 -0
- package/lib/Duration.js +2 -0
- package/lib/Duration.js.map +1 -0
- package/lib/EntityIdHelper.cjs +547 -0
- package/lib/EntityIdHelper.d.ts +203 -0
- package/lib/EntityIdHelper.js +2 -0
- package/lib/EntityIdHelper.js.map +1 -0
- package/lib/EthereumFlow.cjs +207 -0
- package/lib/EthereumFlow.d.ts +134 -0
- package/lib/EthereumFlow.js +2 -0
- package/lib/EthereumFlow.js.map +1 -0
- package/lib/EthereumTransaction.cjs +260 -0
- package/lib/EthereumTransaction.d.ts +161 -0
- package/lib/EthereumTransaction.js +2 -0
- package/lib/EthereumTransaction.js.map +1 -0
- package/lib/EthereumTransactionData.cjs +66 -0
- package/lib/EthereumTransactionData.d.ts +33 -0
- package/lib/EthereumTransactionData.js +2 -0
- package/lib/EthereumTransactionData.js.map +1 -0
- package/lib/EthereumTransactionDataEip1559.cjs +134 -0
- package/lib/EthereumTransactionDataEip1559.d.ts +64 -0
- package/lib/EthereumTransactionDataEip1559.js +2 -0
- package/lib/EthereumTransactionDataEip1559.js.map +1 -0
- package/lib/EthereumTransactionDataEip2930.cjs +129 -0
- package/lib/EthereumTransactionDataEip2930.d.ts +60 -0
- package/lib/EthereumTransactionDataEip2930.js +2 -0
- package/lib/EthereumTransactionDataEip2930.js.map +1 -0
- package/lib/EthereumTransactionDataLegacy.cjs +112 -0
- package/lib/EthereumTransactionDataLegacy.d.ts +52 -0
- package/lib/EthereumTransactionDataLegacy.js +2 -0
- package/lib/EthereumTransactionDataLegacy.js.map +1 -0
- package/lib/EvmAddress.cjs +84 -0
- package/lib/EvmAddress.d.ts +47 -0
- package/lib/EvmAddress.js +2 -0
- package/lib/EvmAddress.js.map +1 -0
- package/lib/ExchangeRate.cjs +113 -0
- package/lib/ExchangeRate.d.ts +75 -0
- package/lib/ExchangeRate.js +2 -0
- package/lib/ExchangeRate.js.map +1 -0
- package/lib/ExchangeRates.cjs +75 -0
- package/lib/ExchangeRates.d.ts +39 -0
- package/lib/ExchangeRates.js +2 -0
- package/lib/ExchangeRates.js.map +1 -0
- package/lib/Executable.cjs +760 -0
- package/lib/Executable.d.ts +365 -0
- package/lib/Executable.js +2 -0
- package/lib/Executable.js.map +1 -0
- package/lib/FeeComponents.cjs +170 -0
- package/lib/FeeComponents.d.ts +66 -0
- package/lib/FeeComponents.js +2 -0
- package/lib/FeeComponents.js.map +1 -0
- package/lib/FeeData.cjs +111 -0
- package/lib/FeeData.d.ts +58 -0
- package/lib/FeeData.js +2 -0
- package/lib/FeeData.js.map +1 -0
- package/lib/FeeDataType.cjs +128 -0
- package/lib/FeeDataType.d.ts +44 -0
- package/lib/FeeDataType.js +2 -0
- package/lib/FeeDataType.js.map +1 -0
- package/lib/FeeSchedule.cjs +79 -0
- package/lib/FeeSchedule.d.ts +40 -0
- package/lib/FeeSchedule.js +2 -0
- package/lib/FeeSchedule.js.map +1 -0
- package/lib/FeeSchedules.cjs +79 -0
- package/lib/FeeSchedules.d.ts +40 -0
- package/lib/FeeSchedules.js +2 -0
- package/lib/FeeSchedules.js.map +1 -0
- package/lib/FreezeType.cjs +117 -0
- package/lib/FreezeType.d.ts +42 -0
- package/lib/FreezeType.js +2 -0
- package/lib/FreezeType.js.map +1 -0
- package/lib/Hbar.cjs +139 -0
- package/lib/Hbar.d.ts +62 -0
- package/lib/Hbar.js +2 -0
- package/lib/Hbar.js.map +1 -0
- package/lib/HbarUnit.cjs +77 -0
- package/lib/HbarUnit.d.ts +46 -0
- package/lib/HbarUnit.js +2 -0
- package/lib/HbarUnit.js.map +1 -0
- package/lib/Key.cjs +62 -0
- package/lib/Key.d.ts +23 -0
- package/lib/Key.js +2 -0
- package/lib/Key.js.map +1 -0
- package/lib/KeyList.cjs +181 -0
- package/lib/KeyList.d.ts +87 -0
- package/lib/KeyList.js +2 -0
- package/lib/KeyList.js.map +1 -0
- package/lib/LedgerId.cjs +137 -0
- package/lib/LedgerId.d.ts +64 -0
- package/lib/LedgerId.js +2 -0
- package/lib/LedgerId.js.map +1 -0
- package/lib/LocalProvider.cjs +159 -0
- package/lib/LocalProvider.d.ts +120 -0
- package/lib/LocalProvider.js +2 -0
- package/lib/LocalProvider.js.map +1 -0
- package/lib/ManagedNode.cjs +245 -0
- package/lib/ManagedNode.d.ts +127 -0
- package/lib/ManagedNode.js +2 -0
- package/lib/ManagedNode.js.map +1 -0
- package/lib/ManagedNodeAddress.cjs +104 -0
- package/lib/ManagedNodeAddress.d.ts +51 -0
- package/lib/ManagedNodeAddress.js +2 -0
- package/lib/ManagedNodeAddress.js.map +1 -0
- package/lib/MaxAttemptsOrTimeoutError.cjs +48 -0
- package/lib/MaxAttemptsOrTimeoutError.d.ts +26 -0
- package/lib/MaxAttemptsOrTimeoutError.js +2 -0
- package/lib/MaxAttemptsOrTimeoutError.js.map +1 -0
- package/lib/MaxQueryPaymentExceeded.cjs +34 -0
- package/lib/MaxQueryPaymentExceeded.d.ts +21 -0
- package/lib/MaxQueryPaymentExceeded.js +2 -0
- package/lib/MaxQueryPaymentExceeded.js.map +1 -0
- package/lib/MirrorNode.cjs +48 -0
- package/lib/MirrorNode.d.ts +39 -0
- package/lib/MirrorNode.js +2 -0
- package/lib/MirrorNode.js.map +1 -0
- package/lib/Mnemonic.cjs +232 -0
- package/lib/Mnemonic.d.ts +145 -0
- package/lib/Mnemonic.js +2 -0
- package/lib/Mnemonic.js.map +1 -0
- package/lib/Node.cjs +114 -0
- package/lib/Node.d.ts +72 -0
- package/lib/Node.js +2 -0
- package/lib/Node.js.map +1 -0
- package/lib/ObjectMap.cjs +137 -0
- package/lib/ObjectMap.d.ts +88 -0
- package/lib/ObjectMap.js +2 -0
- package/lib/ObjectMap.js.map +1 -0
- package/lib/PrecheckStatusError.cjs +77 -0
- package/lib/PrecheckStatusError.d.ts +68 -0
- package/lib/PrecheckStatusError.js +2 -0
- package/lib/PrecheckStatusError.js.map +1 -0
- package/lib/PrivateKey.cjs +529 -0
- package/lib/PrivateKey.d.ts +312 -0
- package/lib/PrivateKey.js +2 -0
- package/lib/PrivateKey.js.map +1 -0
- package/lib/PrngTransaction.cjs +136 -0
- package/lib/PrngTransaction.d.ts +74 -0
- package/lib/PrngTransaction.js +2 -0
- package/lib/PrngTransaction.js.map +1 -0
- package/lib/Provider.cjs +41 -0
- package/lib/Provider.d.ts +32 -0
- package/lib/Provider.js +2 -0
- package/lib/Provider.js.map +1 -0
- package/lib/PublicKey.cjs +285 -0
- package/lib/PublicKey.d.ts +142 -0
- package/lib/PublicKey.js +2 -0
- package/lib/PublicKey.js.map +1 -0
- package/lib/ReceiptStatusError.cjs +45 -0
- package/lib/ReceiptStatusError.d.ts +38 -0
- package/lib/ReceiptStatusError.js +2 -0
- package/lib/ReceiptStatusError.js.map +1 -0
- package/lib/RecordStatusError.cjs +34 -0
- package/lib/RecordStatusError.d.ts +27 -0
- package/lib/RecordStatusError.js +2 -0
- package/lib/RecordStatusError.js.map +1 -0
- package/lib/RequestType.cjs +922 -0
- package/lib/RequestType.d.ts +131 -0
- package/lib/RequestType.js +2 -0
- package/lib/RequestType.js.map +1 -0
- package/lib/Signer.cjs +47 -0
- package/lib/Signer.d.ts +38 -0
- package/lib/Signer.js +2 -0
- package/lib/Signer.js.map +1 -0
- package/lib/SignerSignature.cjs +34 -0
- package/lib/SignerSignature.d.ts +29 -0
- package/lib/SignerSignature.js +2 -0
- package/lib/SignerSignature.js.map +1 -0
- package/lib/StakingInfo.cjs +160 -0
- package/lib/StakingInfo.d.ts +109 -0
- package/lib/StakingInfo.js +2 -0
- package/lib/StakingInfo.js.map +1 -0
- package/lib/Status.cjs +3353 -0
- package/lib/Status.d.ts +395 -0
- package/lib/Status.js +2 -0
- package/lib/Status.js.map +1 -0
- package/lib/StatusError.cjs +66 -0
- package/lib/StatusError.d.ts +41 -0
- package/lib/StatusError.js +2 -0
- package/lib/StatusError.js.map +1 -0
- package/lib/Timestamp.cjs +144 -0
- package/lib/Timestamp.d.ts +69 -0
- package/lib/Timestamp.js +2 -0
- package/lib/Timestamp.js.map +1 -0
- package/lib/TransactionFeeSchedule.cjs +85 -0
- package/lib/TransactionFeeSchedule.d.ts +39 -0
- package/lib/TransactionFeeSchedule.js +2 -0
- package/lib/TransactionFeeSchedule.js.map +1 -0
- package/lib/Transfer.cjs +104 -0
- package/lib/Transfer.d.ts +77 -0
- package/lib/Transfer.js +2 -0
- package/lib/Transfer.js.map +1 -0
- package/lib/Wallet.cjs +253 -0
- package/lib/Wallet.d.ts +147 -0
- package/lib/Wallet.js +2 -0
- package/lib/Wallet.js.map +1 -0
- package/lib/account/AccountAllowanceAdjustTransaction.cjs +366 -0
- package/lib/account/AccountAllowanceAdjustTransaction.d.ts +208 -0
- package/lib/account/AccountAllowanceAdjustTransaction.js +2 -0
- package/lib/account/AccountAllowanceAdjustTransaction.js.map +1 -0
- package/lib/account/AccountAllowanceApproveTransaction.cjs +353 -0
- package/lib/account/AccountAllowanceApproveTransaction.d.ts +194 -0
- package/lib/account/AccountAllowanceApproveTransaction.js +2 -0
- package/lib/account/AccountAllowanceApproveTransaction.js.map +1 -0
- package/lib/account/AccountAllowanceDeleteTransaction.cjs +166 -0
- package/lib/account/AccountAllowanceDeleteTransaction.d.ts +90 -0
- package/lib/account/AccountAllowanceDeleteTransaction.js +2 -0
- package/lib/account/AccountAllowanceDeleteTransaction.js.map +1 -0
- package/lib/account/AccountBalance.cjs +145 -0
- package/lib/account/AccountBalance.d.ts +72 -0
- package/lib/account/AccountBalance.js +2 -0
- package/lib/account/AccountBalance.js.map +1 -0
- package/lib/account/AccountBalanceQuery.cjs +210 -0
- package/lib/account/AccountBalanceQuery.d.ts +92 -0
- package/lib/account/AccountBalanceQuery.js +2 -0
- package/lib/account/AccountBalanceQuery.js.map +1 -0
- package/lib/account/AccountCreateTransaction.cjs +566 -0
- package/lib/account/AccountCreateTransaction.d.ts +309 -0
- package/lib/account/AccountCreateTransaction.js +2 -0
- package/lib/account/AccountCreateTransaction.js.map +1 -0
- package/lib/account/AccountDeleteTransaction.cjs +181 -0
- package/lib/account/AccountDeleteTransaction.d.ts +97 -0
- package/lib/account/AccountDeleteTransaction.js +2 -0
- package/lib/account/AccountDeleteTransaction.js.map +1 -0
- package/lib/account/AccountId.cjs +400 -0
- package/lib/account/AccountId.d.ts +149 -0
- package/lib/account/AccountId.js +2 -0
- package/lib/account/AccountId.js.map +1 -0
- package/lib/account/AccountInfo.cjs +356 -0
- package/lib/account/AccountInfo.d.ts +234 -0
- package/lib/account/AccountInfo.js +2 -0
- package/lib/account/AccountInfo.js.map +1 -0
- package/lib/account/AccountInfoFlow.cjs +88 -0
- package/lib/account/AccountInfoFlow.d.ts +53 -0
- package/lib/account/AccountInfoFlow.js +2 -0
- package/lib/account/AccountInfoFlow.js.map +1 -0
- package/lib/account/AccountInfoQuery.cjs +170 -0
- package/lib/account/AccountInfoQuery.d.ts +67 -0
- package/lib/account/AccountInfoQuery.js +2 -0
- package/lib/account/AccountInfoQuery.js.map +1 -0
- package/lib/account/AccountRecordsQuery.cjs +163 -0
- package/lib/account/AccountRecordsQuery.d.ts +67 -0
- package/lib/account/AccountRecordsQuery.js +2 -0
- package/lib/account/AccountRecordsQuery.js.map +1 -0
- package/lib/account/AccountUpdateTransaction.cjs +503 -0
- package/lib/account/AccountUpdateTransaction.d.ts +271 -0
- package/lib/account/AccountUpdateTransaction.js +2 -0
- package/lib/account/AccountUpdateTransaction.js.map +1 -0
- package/lib/account/HbarAllowance.cjs +126 -0
- package/lib/account/HbarAllowance.d.ts +85 -0
- package/lib/account/HbarAllowance.js +2 -0
- package/lib/account/HbarAllowance.js.map +1 -0
- package/lib/account/HbarTransferMap.cjs +45 -0
- package/lib/account/HbarTransferMap.d.ts +31 -0
- package/lib/account/HbarTransferMap.js +2 -0
- package/lib/account/HbarTransferMap.js.map +1 -0
- package/lib/account/LiveHash.cjs +76 -0
- package/lib/account/LiveHash.d.ts +49 -0
- package/lib/account/LiveHash.js +2 -0
- package/lib/account/LiveHash.js.map +1 -0
- package/lib/account/LiveHashAddTransaction.cjs +238 -0
- package/lib/account/LiveHashAddTransaction.d.ts +125 -0
- package/lib/account/LiveHashAddTransaction.js +2 -0
- package/lib/account/LiveHashAddTransaction.js.map +1 -0
- package/lib/account/LiveHashDeleteTransaction.cjs +170 -0
- package/lib/account/LiveHashDeleteTransaction.d.ts +88 -0
- package/lib/account/LiveHashDeleteTransaction.js +2 -0
- package/lib/account/LiveHashDeleteTransaction.js.map +1 -0
- package/lib/account/LiveHashQuery.cjs +188 -0
- package/lib/account/LiveHashQuery.d.ts +91 -0
- package/lib/account/LiveHashQuery.js +2 -0
- package/lib/account/LiveHashQuery.js.map +1 -0
- package/lib/account/NullableTokenDecimalMap.cjs +26 -0
- package/lib/account/NullableTokenDecimalMap.d.ts +19 -0
- package/lib/account/NullableTokenDecimalMap.js +2 -0
- package/lib/account/NullableTokenDecimalMap.js.map +1 -0
- package/lib/account/ProxyStaker.cjs +73 -0
- package/lib/account/ProxyStaker.d.ts +53 -0
- package/lib/account/ProxyStaker.js +2 -0
- package/lib/account/ProxyStaker.js.map +1 -0
- package/lib/account/TokenAllowance.cjs +130 -0
- package/lib/account/TokenAllowance.d.ts +93 -0
- package/lib/account/TokenAllowance.js +2 -0
- package/lib/account/TokenAllowance.js.map +1 -0
- package/lib/account/TokenBalanceMap.cjs +30 -0
- package/lib/account/TokenBalanceMap.d.ts +23 -0
- package/lib/account/TokenBalanceMap.js +2 -0
- package/lib/account/TokenBalanceMap.js.map +1 -0
- package/lib/account/TokenDecimalMap.cjs +26 -0
- package/lib/account/TokenDecimalMap.d.ts +19 -0
- package/lib/account/TokenDecimalMap.js +2 -0
- package/lib/account/TokenDecimalMap.js.map +1 -0
- package/lib/account/TokenNftAllowance.cjs +168 -0
- package/lib/account/TokenNftAllowance.d.ts +110 -0
- package/lib/account/TokenNftAllowance.js +2 -0
- package/lib/account/TokenNftAllowance.js.map +1 -0
- package/lib/account/TokenNftTransferMap.cjs +116 -0
- package/lib/account/TokenNftTransferMap.d.ts +55 -0
- package/lib/account/TokenNftTransferMap.js +2 -0
- package/lib/account/TokenNftTransferMap.js.map +1 -0
- package/lib/account/TokenRelationship.cjs +113 -0
- package/lib/account/TokenRelationship.d.ts +87 -0
- package/lib/account/TokenRelationship.js +2 -0
- package/lib/account/TokenRelationship.js.map +1 -0
- package/lib/account/TokenRelationshipMap.cjs +57 -0
- package/lib/account/TokenRelationshipMap.d.ts +33 -0
- package/lib/account/TokenRelationshipMap.js +2 -0
- package/lib/account/TokenRelationshipMap.js.map +1 -0
- package/lib/account/TokenTransferAccountMap.cjs +28 -0
- package/lib/account/TokenTransferAccountMap.d.ts +8 -0
- package/lib/account/TokenTransferAccountMap.js +2 -0
- package/lib/account/TokenTransferAccountMap.js.map +1 -0
- package/lib/account/TokenTransferMap.cjs +86 -0
- package/lib/account/TokenTransferMap.d.ts +41 -0
- package/lib/account/TokenTransferMap.js +2 -0
- package/lib/account/TokenTransferMap.js.map +1 -0
- package/lib/account/TransferTransaction.cjs +303 -0
- package/lib/account/TransferTransaction.d.ts +173 -0
- package/lib/account/TransferTransaction.js +2 -0
- package/lib/account/TransferTransaction.js.map +1 -0
- package/lib/address_book/AddressBooks.cjs +17 -0
- package/lib/address_book/AddressBooks.d.ts +4 -0
- package/lib/address_book/AddressBooks.js +2 -0
- package/lib/address_book/AddressBooks.js.map +1 -0
- package/lib/address_book/Endpoint.cjs +140 -0
- package/lib/address_book/Endpoint.d.ts +79 -0
- package/lib/address_book/Endpoint.js +2 -0
- package/lib/address_book/Endpoint.js.map +1 -0
- package/lib/address_book/IPv4Address.cjs +116 -0
- package/lib/address_book/IPv4Address.d.ts +59 -0
- package/lib/address_book/IPv4Address.js +2 -0
- package/lib/address_book/IPv4Address.js.map +1 -0
- package/lib/address_book/IPv4AddressPart.cjs +76 -0
- package/lib/address_book/IPv4AddressPart.d.ts +41 -0
- package/lib/address_book/IPv4AddressPart.js +2 -0
- package/lib/address_book/IPv4AddressPart.js.map +1 -0
- package/lib/address_book/NodeAddress.cjs +287 -0
- package/lib/address_book/NodeAddress.d.ts +170 -0
- package/lib/address_book/NodeAddress.js +2 -0
- package/lib/address_book/NodeAddress.js.map +1 -0
- package/lib/address_book/NodeAddressBook.cjs +108 -0
- package/lib/address_book/NodeAddressBook.d.ts +66 -0
- package/lib/address_book/NodeAddressBook.js +2 -0
- package/lib/address_book/NodeAddressBook.js.map +1 -0
- package/lib/array.cjs +51 -0
- package/lib/array.d.ts +14 -0
- package/lib/array.js +2 -0
- package/lib/array.js.map +1 -0
- package/lib/base32.cjs +38 -0
- package/lib/base32.d.ts +18 -0
- package/lib/base32.js +2 -0
- package/lib/base32.js.map +1 -0
- package/lib/browser.cjs +36 -0
- package/lib/browser.d.ts +3 -0
- package/lib/browser.js +2 -0
- package/lib/browser.js.map +1 -0
- package/lib/channel/Channel.cjs +293 -0
- package/lib/channel/Channel.d.ts +121 -0
- package/lib/channel/Channel.js +2 -0
- package/lib/channel/Channel.js.map +1 -0
- package/lib/channel/MirrorChannel.cjs +55 -0
- package/lib/channel/MirrorChannel.d.ts +32 -0
- package/lib/channel/MirrorChannel.js +2 -0
- package/lib/channel/MirrorChannel.js.map +1 -0
- package/lib/channel/NativeChannel.cjs +97 -0
- package/lib/channel/NativeChannel.d.ts +12 -0
- package/lib/channel/NativeChannel.js +2 -0
- package/lib/channel/NativeChannel.js.map +1 -0
- package/lib/channel/NodeChannel.cjs +173 -0
- package/lib/channel/NodeChannel.d.ts +41 -0
- package/lib/channel/NodeChannel.js +2 -0
- package/lib/channel/NodeChannel.js.map +1 -0
- package/lib/channel/NodeMirrorChannel.cjs +78 -0
- package/lib/channel/NodeMirrorChannel.d.ts +22 -0
- package/lib/channel/NodeMirrorChannel.js +2 -0
- package/lib/channel/NodeMirrorChannel.js.map +1 -0
- package/lib/channel/WebChannel.cjs +90 -0
- package/lib/channel/WebChannel.d.ts +12 -0
- package/lib/channel/WebChannel.js +2 -0
- package/lib/channel/WebChannel.js.map +1 -0
- package/lib/client/Client.cjs +818 -0
- package/lib/client/Client.d.ts +487 -0
- package/lib/client/Client.js +2 -0
- package/lib/client/Client.js.map +1 -0
- package/lib/client/ManagedNetwork.cjs +427 -0
- package/lib/client/ManagedNetwork.d.ts +175 -0
- package/lib/client/ManagedNetwork.js +2 -0
- package/lib/client/ManagedNetwork.js.map +1 -0
- package/lib/client/MirrorNetwork.cjs +89 -0
- package/lib/client/MirrorNetwork.d.ts +27 -0
- package/lib/client/MirrorNetwork.js +2 -0
- package/lib/client/MirrorNetwork.js.map +1 -0
- package/lib/client/NativeClient.cjs +210 -0
- package/lib/client/NativeClient.d.ts +72 -0
- package/lib/client/NativeClient.js +2 -0
- package/lib/client/NativeClient.js.map +1 -0
- package/lib/client/Network.cjs +257 -0
- package/lib/client/Network.d.ts +90 -0
- package/lib/client/Network.js +2 -0
- package/lib/client/Network.js.map +1 -0
- package/lib/client/NodeClient.cjs +316 -0
- package/lib/client/NodeClient.d.ts +129 -0
- package/lib/client/NodeClient.js +2 -0
- package/lib/client/NodeClient.js.map +1 -0
- package/lib/client/WebClient.cjs +280 -0
- package/lib/client/WebClient.d.ts +90 -0
- package/lib/client/WebClient.js +2 -0
- package/lib/client/WebClient.js.map +1 -0
- package/lib/client/addressbooks/mainnet.cjs +7 -0
- package/lib/client/addressbooks/mainnet.d.ts +1 -0
- package/lib/client/addressbooks/mainnet.js +2 -0
- package/lib/client/addressbooks/mainnet.js.map +1 -0
- package/lib/client/addressbooks/previewnet.cjs +7 -0
- package/lib/client/addressbooks/previewnet.d.ts +1 -0
- package/lib/client/addressbooks/previewnet.js +2 -0
- package/lib/client/addressbooks/previewnet.js.map +1 -0
- package/lib/client/addressbooks/testnet.cjs +7 -0
- package/lib/client/addressbooks/testnet.d.ts +1 -0
- package/lib/client/addressbooks/testnet.js +2 -0
- package/lib/client/addressbooks/testnet.js.map +1 -0
- package/lib/constants/ClientConstants.cjs +201 -0
- package/lib/constants/ClientConstants.d.ts +74 -0
- package/lib/constants/ClientConstants.js +2 -0
- package/lib/constants/ClientConstants.js.map +1 -0
- package/lib/contract/ContractByteCodeQuery.cjs +158 -0
- package/lib/contract/ContractByteCodeQuery.d.ts +76 -0
- package/lib/contract/ContractByteCodeQuery.js +2 -0
- package/lib/contract/ContractByteCodeQuery.js.map +1 -0
- package/lib/contract/ContractCallQuery.cjs +338 -0
- package/lib/contract/ContractCallQuery.d.ts +141 -0
- package/lib/contract/ContractCallQuery.js +2 -0
- package/lib/contract/ContractCallQuery.js.map +1 -0
- package/lib/contract/ContractCreateFlow.cjs +452 -0
- package/lib/contract/ContractCreateFlow.d.ts +243 -0
- package/lib/contract/ContractCreateFlow.js +2 -0
- package/lib/contract/ContractCreateFlow.js.map +1 -0
- package/lib/contract/ContractCreateTransaction.cjs +556 -0
- package/lib/contract/ContractCreateTransaction.d.ts +315 -0
- package/lib/contract/ContractCreateTransaction.js +2 -0
- package/lib/contract/ContractCreateTransaction.js.map +1 -0
- package/lib/contract/ContractDeleteTransaction.cjs +235 -0
- package/lib/contract/ContractDeleteTransaction.d.ts +135 -0
- package/lib/contract/ContractDeleteTransaction.js +2 -0
- package/lib/contract/ContractDeleteTransaction.js.map +1 -0
- package/lib/contract/ContractExecuteTransaction.cjs +269 -0
- package/lib/contract/ContractExecuteTransaction.d.ts +164 -0
- package/lib/contract/ContractExecuteTransaction.js +2 -0
- package/lib/contract/ContractExecuteTransaction.js.map +1 -0
- package/lib/contract/ContractFunctionParameters.cjs +1703 -0
- package/lib/contract/ContractFunctionParameters.d.ts +725 -0
- package/lib/contract/ContractFunctionParameters.js +2 -0
- package/lib/contract/ContractFunctionParameters.js.map +1 -0
- package/lib/contract/ContractFunctionResult.cjs +846 -0
- package/lib/contract/ContractFunctionResult.d.ts +510 -0
- package/lib/contract/ContractFunctionResult.js +2 -0
- package/lib/contract/ContractFunctionResult.js.map +1 -0
- package/lib/contract/ContractFunctionSelector.cjs +1775 -0
- package/lib/contract/ContractFunctionSelector.d.ts +688 -0
- package/lib/contract/ContractFunctionSelector.js +2 -0
- package/lib/contract/ContractFunctionSelector.js.map +1 -0
- package/lib/contract/ContractId.cjs +267 -0
- package/lib/contract/ContractId.d.ts +123 -0
- package/lib/contract/ContractId.js +2 -0
- package/lib/contract/ContractId.js.map +1 -0
- package/lib/contract/ContractInfo.cjs +227 -0
- package/lib/contract/ContractInfo.d.ts +151 -0
- package/lib/contract/ContractInfo.js +2 -0
- package/lib/contract/ContractInfo.js.map +1 -0
- package/lib/contract/ContractInfoQuery.cjs +172 -0
- package/lib/contract/ContractInfoQuery.d.ts +70 -0
- package/lib/contract/ContractInfoQuery.js +2 -0
- package/lib/contract/ContractInfoQuery.js.map +1 -0
- package/lib/contract/ContractLogInfo.cjs +87 -0
- package/lib/contract/ContractLogInfo.d.ts +66 -0
- package/lib/contract/ContractLogInfo.js +2 -0
- package/lib/contract/ContractLogInfo.js.map +1 -0
- package/lib/contract/ContractNonceInfo.cjs +129 -0
- package/lib/contract/ContractNonceInfo.d.ts +90 -0
- package/lib/contract/ContractNonceInfo.js +2 -0
- package/lib/contract/ContractNonceInfo.js.map +1 -0
- package/lib/contract/ContractStateChange.cjs +75 -0
- package/lib/contract/ContractStateChange.d.ts +37 -0
- package/lib/contract/ContractUpdateTransaction.cjs +525 -0
- package/lib/contract/ContractUpdateTransaction.d.ts +280 -0
- package/lib/contract/ContractUpdateTransaction.js +2 -0
- package/lib/contract/ContractUpdateTransaction.js.map +1 -0
- package/lib/contract/DelegateContractId.cjs +100 -0
- package/lib/contract/DelegateContractId.d.ts +24 -0
- package/lib/contract/DelegateContractId.js +2 -0
- package/lib/contract/DelegateContractId.js.map +1 -0
- package/lib/contract/StorageChange.cjs +73 -0
- package/lib/contract/StorageChange.d.ts +37 -0
- package/lib/cryptography/keccak.cjs +335 -0
- package/lib/cryptography/keccak.d.ts +14 -0
- package/lib/cryptography/keccak.js +2 -0
- package/lib/cryptography/keccak.js.map +1 -0
- package/lib/cryptography/sha384.browser.cjs +19 -0
- package/lib/cryptography/sha384.browser.d.ts +5 -0
- package/lib/cryptography/sha384.browser.js +2 -0
- package/lib/cryptography/sha384.browser.js.map +1 -0
- package/lib/cryptography/sha384.cjs +27 -0
- package/lib/cryptography/sha384.d.ts +10 -0
- package/lib/cryptography/sha384.js +2 -0
- package/lib/cryptography/sha384.js.map +1 -0
- package/lib/cryptography/sha384.native.cjs +21 -0
- package/lib/cryptography/sha384.native.d.ts +5 -0
- package/lib/encoding/base64.native.cjs +25 -0
- package/lib/encoding/base64.native.d.ts +10 -0
- package/lib/encoding/base64.native.js +2 -0
- package/lib/encoding/base64.native.js.map +1 -0
- package/lib/encoding/hex.browser.cjs +95 -0
- package/lib/encoding/hex.browser.d.ts +26 -0
- package/lib/encoding/hex.browser.js +2 -0
- package/lib/encoding/hex.browser.js.map +1 -0
- package/lib/encoding/hex.cjs +82 -0
- package/lib/encoding/hex.d.ts +26 -0
- package/lib/encoding/hex.js +2 -0
- package/lib/encoding/hex.js.map +1 -0
- package/lib/encoding/hex.native.cjs +127 -0
- package/lib/encoding/hex.native.d.ts +36 -0
- package/lib/encoding/utf8.browser.cjs +26 -0
- package/lib/encoding/utf8.browser.d.ts +10 -0
- package/lib/encoding/utf8.browser.js +2 -0
- package/lib/encoding/utf8.browser.js.map +1 -0
- package/lib/encoding/utf8.cjs +24 -0
- package/lib/encoding/utf8.d.ts +10 -0
- package/lib/encoding/utf8.js +2 -0
- package/lib/encoding/utf8.js.map +1 -0
- package/lib/encoding/utf8.native.cjs +29 -0
- package/lib/encoding/utf8.native.d.ts +10 -0
- package/lib/exports.cjs +1264 -0
- package/lib/exports.d.ts +200 -0
- package/lib/exports.js +2 -0
- package/lib/exports.js.map +1 -0
- package/lib/file/FileAppendTransaction.cjs +482 -0
- package/lib/file/FileAppendTransaction.d.ts +196 -0
- package/lib/file/FileAppendTransaction.js +2 -0
- package/lib/file/FileAppendTransaction.js.map +1 -0
- package/lib/file/FileContentsQuery.cjs +159 -0
- package/lib/file/FileContentsQuery.d.ts +77 -0
- package/lib/file/FileContentsQuery.js +2 -0
- package/lib/file/FileContentsQuery.js.map +1 -0
- package/lib/file/FileCreateTransaction.cjs +259 -0
- package/lib/file/FileCreateTransaction.d.ts +153 -0
- package/lib/file/FileCreateTransaction.js +2 -0
- package/lib/file/FileCreateTransaction.js.map +1 -0
- package/lib/file/FileDeleteTransaction.cjs +149 -0
- package/lib/file/FileDeleteTransaction.d.ts +84 -0
- package/lib/file/FileDeleteTransaction.js +2 -0
- package/lib/file/FileDeleteTransaction.js.map +1 -0
- package/lib/file/FileId.cjs +240 -0
- package/lib/file/FileId.d.ts +126 -0
- package/lib/file/FileId.js +2 -0
- package/lib/file/FileId.js.map +1 -0
- package/lib/file/FileInfo.cjs +128 -0
- package/lib/file/FileInfo.d.ts +76 -0
- package/lib/file/FileInfo.js +2 -0
- package/lib/file/FileInfo.js.map +1 -0
- package/lib/file/FileInfoQuery.cjs +171 -0
- package/lib/file/FileInfoQuery.d.ts +68 -0
- package/lib/file/FileInfoQuery.js +2 -0
- package/lib/file/FileInfoQuery.js.map +1 -0
- package/lib/file/FileUpdateTransaction.cjs +319 -0
- package/lib/file/FileUpdateTransaction.d.ts +188 -0
- package/lib/file/FileUpdateTransaction.js +2 -0
- package/lib/file/FileUpdateTransaction.js.map +1 -0
- package/lib/grpc/GrpcServiceError.cjs +65 -0
- package/lib/grpc/GrpcServiceError.d.ts +32 -0
- package/lib/grpc/GrpcServiceError.js +2 -0
- package/lib/grpc/GrpcServiceError.js.map +1 -0
- package/lib/grpc/GrpcStatus.cjs +145 -0
- package/lib/grpc/GrpcStatus.d.ts +46 -0
- package/lib/grpc/GrpcStatus.js +2 -0
- package/lib/grpc/GrpcStatus.js.map +1 -0
- package/lib/http/HttpError.cjs +32 -0
- package/lib/http/HttpError.d.ts +14 -0
- package/lib/http/HttpError.js +2 -0
- package/lib/http/HttpError.js.map +1 -0
- package/lib/http/HttpStatus.cjs +44 -0
- package/lib/http/HttpStatus.d.ts +24 -0
- package/lib/http/HttpStatus.js +2 -0
- package/lib/http/HttpStatus.js.map +1 -0
- package/lib/index.cjs +44 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/logger/LogLevel.cjs +77 -0
- package/lib/logger/LogLevel.d.ts +29 -0
- package/lib/logger/LogLevel.js +2 -0
- package/lib/logger/LogLevel.js.map +1 -0
- package/lib/logger/Logger.cjs +221 -0
- package/lib/logger/Logger.d.ts +132 -0
- package/lib/logger/Logger.js +2 -0
- package/lib/logger/Logger.js.map +1 -0
- package/lib/long.cjs +26 -0
- package/lib/long.d.ts +16 -0
- package/lib/long.js +2 -0
- package/lib/long.js.map +1 -0
- package/lib/native.cjs +36 -0
- package/lib/native.d.ts +3 -0
- package/lib/native.js +2 -0
- package/lib/native.js.map +1 -0
- package/lib/network/AddressBookQuery.cjs +218 -0
- package/lib/network/AddressBookQuery.d.ts +104 -0
- package/lib/network/AddressBookQuery.js +2 -0
- package/lib/network/AddressBookQuery.js.map +1 -0
- package/lib/network/AddressBookQueryWeb.cjs +326 -0
- package/lib/network/AddressBookQueryWeb.d.ts +165 -0
- package/lib/network/AddressBookQueryWeb.js +2 -0
- package/lib/network/AddressBookQueryWeb.js.map +1 -0
- package/lib/network/NetworkVersionInfo.cjs +81 -0
- package/lib/network/NetworkVersionInfo.d.ts +46 -0
- package/lib/network/NetworkVersionInfo.js +2 -0
- package/lib/network/NetworkVersionInfo.js.map +1 -0
- package/lib/network/NetworkVersionInfoQuery.cjs +112 -0
- package/lib/network/NetworkVersionInfoQuery.d.ts +50 -0
- package/lib/network/NetworkVersionInfoQuery.js +2 -0
- package/lib/network/NetworkVersionInfoQuery.js.map +1 -0
- package/lib/network/SemanticVersion.cjs +78 -0
- package/lib/network/SemanticVersion.d.ts +45 -0
- package/lib/network/SemanticVersion.js +2 -0
- package/lib/network/SemanticVersion.js.map +1 -0
- package/lib/node/NodeCreateTransaction.cjs +413 -0
- package/lib/node/NodeCreateTransaction.d.ts +239 -0
- package/lib/node/NodeCreateTransaction.js +2 -0
- package/lib/node/NodeCreateTransaction.js.map +1 -0
- package/lib/node/NodeDeleteTransaction.cjs +143 -0
- package/lib/node/NodeDeleteTransaction.d.ts +80 -0
- package/lib/node/NodeDeleteTransaction.js +2 -0
- package/lib/node/NodeDeleteTransaction.js.map +1 -0
- package/lib/node/NodeUpdateTransaction.cjs +481 -0
- package/lib/node/NodeUpdateTransaction.d.ts +274 -0
- package/lib/node/NodeUpdateTransaction.js +2 -0
- package/lib/node/NodeUpdateTransaction.js.map +1 -0
- package/lib/node/ServiceEndpoint.cjs +140 -0
- package/lib/node/ServiceEndpoint.d.ts +91 -0
- package/lib/node/ServiceEndpoint.js +2 -0
- package/lib/node/ServiceEndpoint.js.map +1 -0
- package/lib/query/CostQuery.cjs +171 -0
- package/lib/query/CostQuery.d.ts +43 -0
- package/lib/query/CostQuery.js +2 -0
- package/lib/query/CostQuery.js.map +1 -0
- package/lib/query/MirrorNodeContractCallQuery.cjs +53 -0
- package/lib/query/MirrorNodeContractCallQuery.d.ts +21 -0
- package/lib/query/MirrorNodeContractCallQuery.js +2 -0
- package/lib/query/MirrorNodeContractCallQuery.js.map +1 -0
- package/lib/query/MirrorNodeContractEstimateQuery.cjs +53 -0
- package/lib/query/MirrorNodeContractEstimateQuery.d.ts +21 -0
- package/lib/query/MirrorNodeContractEstimateQuery.js +2 -0
- package/lib/query/MirrorNodeContractEstimateQuery.js.map +1 -0
- package/lib/query/MirrorNodeContractQuery.cjs +260 -0
- package/lib/query/MirrorNodeContractQuery.d.ts +158 -0
- package/lib/query/MirrorNodeContractQuery.js +2 -0
- package/lib/query/MirrorNodeContractQuery.js.map +1 -0
- package/lib/query/Query.cjs +450 -0
- package/lib/query/Query.d.ts +173 -0
- package/lib/query/Query.js +2 -0
- package/lib/query/Query.js.map +1 -0
- package/lib/query/QueryBase.cjs +114 -0
- package/lib/query/QueryBase.d.ts +43 -0
- package/lib/query/QueryBase.js +2 -0
- package/lib/query/QueryBase.js.map +1 -0
- package/lib/schedule/ScheduleCreateTransaction.cjs +308 -0
- package/lib/schedule/ScheduleCreateTransaction.d.ts +153 -0
- package/lib/schedule/ScheduleCreateTransaction.js +2 -0
- package/lib/schedule/ScheduleCreateTransaction.js.map +1 -0
- package/lib/schedule/ScheduleDeleteTransaction.cjs +146 -0
- package/lib/schedule/ScheduleDeleteTransaction.d.ts +81 -0
- package/lib/schedule/ScheduleDeleteTransaction.js +2 -0
- package/lib/schedule/ScheduleDeleteTransaction.js.map +1 -0
- package/lib/schedule/ScheduleId.cjs +164 -0
- package/lib/schedule/ScheduleId.d.ts +96 -0
- package/lib/schedule/ScheduleId.js +2 -0
- package/lib/schedule/ScheduleId.js.map +1 -0
- package/lib/schedule/ScheduleInfo.cjs +176 -0
- package/lib/schedule/ScheduleInfo.d.ts +93 -0
- package/lib/schedule/ScheduleInfo.js +2 -0
- package/lib/schedule/ScheduleInfo.js.map +1 -0
- package/lib/schedule/ScheduleInfoQuery.cjs +170 -0
- package/lib/schedule/ScheduleInfoQuery.d.ts +66 -0
- package/lib/schedule/ScheduleInfoQuery.js +2 -0
- package/lib/schedule/ScheduleInfoQuery.js.map +1 -0
- package/lib/schedule/ScheduleSignTransaction.cjs +164 -0
- package/lib/schedule/ScheduleSignTransaction.d.ts +110 -0
- package/lib/schedule/ScheduleSignTransaction.js +2 -0
- package/lib/schedule/ScheduleSignTransaction.js.map +1 -0
- package/lib/system/FreezeTransaction.cjs +348 -0
- package/lib/system/FreezeTransaction.d.ts +188 -0
- package/lib/system/FreezeTransaction.js +2 -0
- package/lib/system/FreezeTransaction.js.map +1 -0
- package/lib/system/SystemDeleteTransaction.cjs +200 -0
- package/lib/system/SystemDeleteTransaction.d.ts +110 -0
- package/lib/system/SystemDeleteTransaction.js +2 -0
- package/lib/system/SystemDeleteTransaction.js.map +1 -0
- package/lib/system/SystemUndeleteTransaction.cjs +172 -0
- package/lib/system/SystemUndeleteTransaction.d.ts +97 -0
- package/lib/system/SystemUndeleteTransaction.js +2 -0
- package/lib/system/SystemUndeleteTransaction.js.map +1 -0
- package/lib/token/AbstractTokenTransferTransaction.cjs +406 -0
- package/lib/token/AbstractTokenTransferTransaction.d.ts +138 -0
- package/lib/token/AbstractTokenTransferTransaction.js +2 -0
- package/lib/token/AbstractTokenTransferTransaction.js.map +1 -0
- package/lib/token/AirdropPendingTransaction.cjs +65 -0
- package/lib/token/AirdropPendingTransaction.d.ts +35 -0
- package/lib/token/AirdropPendingTransaction.js +2 -0
- package/lib/token/AirdropPendingTransaction.js.map +1 -0
- package/lib/token/AssessedCustomFee.cjs +177 -0
- package/lib/token/AssessedCustomFee.d.ts +113 -0
- package/lib/token/AssessedCustomFee.js +2 -0
- package/lib/token/AssessedCustomFee.js.map +1 -0
- package/lib/token/CustomFee.cjs +88 -0
- package/lib/token/CustomFee.d.ts +57 -0
- package/lib/token/CustomFee.js +2 -0
- package/lib/token/CustomFee.js.map +1 -0
- package/lib/token/CustomFixedFee.cjs +155 -0
- package/lib/token/CustomFixedFee.d.ts +85 -0
- package/lib/token/CustomFixedFee.js +2 -0
- package/lib/token/CustomFixedFee.js.map +1 -0
- package/lib/token/CustomFractionalFee.cjs +200 -0
- package/lib/token/CustomFractionalFee.d.ts +103 -0
- package/lib/token/CustomFractionalFee.js +2 -0
- package/lib/token/CustomFractionalFee.js.map +1 -0
- package/lib/token/CustomRoyaltyFee.cjs +150 -0
- package/lib/token/CustomRoyaltyFee.d.ts +75 -0
- package/lib/token/CustomRoyaltyFee.js +2 -0
- package/lib/token/CustomRoyaltyFee.js.map +1 -0
- package/lib/token/FeeAssessmentMethod.cjs +58 -0
- package/lib/token/FeeAssessmentMethod.d.ts +29 -0
- package/lib/token/FeeAssessmentMethod.js +2 -0
- package/lib/token/FeeAssessmentMethod.js.map +1 -0
- package/lib/token/NftId.cjs +89 -0
- package/lib/token/NftId.d.ts +46 -0
- package/lib/token/NftId.js +2 -0
- package/lib/token/NftId.js.map +1 -0
- package/lib/token/PendingAirdropId.cjs +152 -0
- package/lib/token/PendingAirdropId.d.ts +81 -0
- package/lib/token/PendingAirdropId.js +2 -0
- package/lib/token/PendingAirdropId.js.map +1 -0
- package/lib/token/PendingAirdropRecord.cjs +55 -0
- package/lib/token/PendingAirdropRecord.d.ts +29 -0
- package/lib/token/PendingAirdropRecord.js +2 -0
- package/lib/token/PendingAirdropRecord.js.map +1 -0
- package/lib/token/TokenAirdropTransaction.cjs +179 -0
- package/lib/token/TokenAirdropTransaction.d.ts +119 -0
- package/lib/token/TokenAirdropTransaction.js +2 -0
- package/lib/token/TokenAirdropTransaction.js.map +1 -0
- package/lib/token/TokenAssociateTransaction.cjs +176 -0
- package/lib/token/TokenAssociateTransaction.d.ts +90 -0
- package/lib/token/TokenAssociateTransaction.js +2 -0
- package/lib/token/TokenAssociateTransaction.js.map +1 -0
- package/lib/token/TokenAssociation.cjs +117 -0
- package/lib/token/TokenAssociation.d.ts +76 -0
- package/lib/token/TokenAssociation.js +2 -0
- package/lib/token/TokenAssociation.js.map +1 -0
- package/lib/token/TokenBurnTransaction.cjs +199 -0
- package/lib/token/TokenBurnTransaction.d.ts +108 -0
- package/lib/token/TokenBurnTransaction.js +2 -0
- package/lib/token/TokenBurnTransaction.js.map +1 -0
- package/lib/token/TokenCancelAirdropTransaction.cjs +109 -0
- package/lib/token/TokenCancelAirdropTransaction.d.ts +50 -0
- package/lib/token/TokenCancelAirdropTransaction.js +2 -0
- package/lib/token/TokenCancelAirdropTransaction.js.map +1 -0
- package/lib/token/TokenClaimAirdropTransaction.cjs +109 -0
- package/lib/token/TokenClaimAirdropTransaction.d.ts +50 -0
- package/lib/token/TokenClaimAirdropTransaction.js +2 -0
- package/lib/token/TokenClaimAirdropTransaction.js.map +1 -0
- package/lib/token/TokenCreateTransaction.cjs +817 -0
- package/lib/token/TokenCreateTransaction.d.ts +446 -0
- package/lib/token/TokenCreateTransaction.js +2 -0
- package/lib/token/TokenCreateTransaction.js.map +1 -0
- package/lib/token/TokenDeleteTransaction.cjs +140 -0
- package/lib/token/TokenDeleteTransaction.d.ts +75 -0
- package/lib/token/TokenDeleteTransaction.js +2 -0
- package/lib/token/TokenDeleteTransaction.js.map +1 -0
- package/lib/token/TokenDissociateTransaction.cjs +176 -0
- package/lib/token/TokenDissociateTransaction.d.ts +90 -0
- package/lib/token/TokenDissociateTransaction.js +2 -0
- package/lib/token/TokenDissociateTransaction.js.map +1 -0
- package/lib/token/TokenFeeScheduleUpdateTransaction.cjs +172 -0
- package/lib/token/TokenFeeScheduleUpdateTransaction.d.ts +93 -0
- package/lib/token/TokenFeeScheduleUpdateTransaction.js +2 -0
- package/lib/token/TokenFeeScheduleUpdateTransaction.js.map +1 -0
- package/lib/token/TokenFreezeTransaction.cjs +172 -0
- package/lib/token/TokenFreezeTransaction.d.ts +90 -0
- package/lib/token/TokenFreezeTransaction.js +2 -0
- package/lib/token/TokenFreezeTransaction.js.map +1 -0
- package/lib/token/TokenGrantKycTransaction.cjs +172 -0
- package/lib/token/TokenGrantKycTransaction.d.ts +90 -0
- package/lib/token/TokenGrantKycTransaction.js +2 -0
- package/lib/token/TokenGrantKycTransaction.js.map +1 -0
- package/lib/token/TokenId.cjs +185 -0
- package/lib/token/TokenId.d.ts +103 -0
- package/lib/token/TokenId.js +2 -0
- package/lib/token/TokenId.js.map +1 -0
- package/lib/token/TokenInfo.cjs +349 -0
- package/lib/token/TokenInfo.d.ts +224 -0
- package/lib/token/TokenInfo.js +2 -0
- package/lib/token/TokenInfo.js.map +1 -0
- package/lib/token/TokenInfoQuery.cjs +170 -0
- package/lib/token/TokenInfoQuery.d.ts +67 -0
- package/lib/token/TokenInfoQuery.js +2 -0
- package/lib/token/TokenInfoQuery.js.map +1 -0
- package/lib/token/TokenKeyValidation.cjs +73 -0
- package/lib/token/TokenKeyValidation.d.ts +39 -0
- package/lib/token/TokenKeyValidation.js +2 -0
- package/lib/token/TokenKeyValidation.js.map +1 -0
- package/lib/token/TokenMintTransaction.cjs +219 -0
- package/lib/token/TokenMintTransaction.d.ts +113 -0
- package/lib/token/TokenMintTransaction.js +2 -0
- package/lib/token/TokenMintTransaction.js.map +1 -0
- package/lib/token/TokenNftInfo.cjs +127 -0
- package/lib/token/TokenNftInfo.d.ts +96 -0
- package/lib/token/TokenNftInfo.js +2 -0
- package/lib/token/TokenNftInfo.js.map +1 -0
- package/lib/token/TokenNftInfoQuery.cjs +312 -0
- package/lib/token/TokenNftInfoQuery.d.ts +149 -0
- package/lib/token/TokenNftInfoQuery.js +2 -0
- package/lib/token/TokenNftInfoQuery.js.map +1 -0
- package/lib/token/TokenNftTransfer.cjs +95 -0
- package/lib/token/TokenNftTransfer.d.ts +70 -0
- package/lib/token/TokenNftTransfer.js +2 -0
- package/lib/token/TokenNftTransfer.js.map +1 -0
- package/lib/token/TokenNftsUpdateTransaction.cjs +185 -0
- package/lib/token/TokenNftsUpdateTransaction.d.ts +97 -0
- package/lib/token/TokenPauseTransaction.cjs +140 -0
- package/lib/token/TokenPauseTransaction.d.ts +75 -0
- package/lib/token/TokenPauseTransaction.js +2 -0
- package/lib/token/TokenPauseTransaction.js.map +1 -0
- package/lib/token/TokenReference.cjs +41 -0
- package/lib/token/TokenReference.d.ts +29 -0
- package/lib/token/TokenReference.js +2 -0
- package/lib/token/TokenReference.js.map +1 -0
- package/lib/token/TokenRejectFlow.cjs +248 -0
- package/lib/token/TokenRejectFlow.d.ts +141 -0
- package/lib/token/TokenRejectFlow.js +2 -0
- package/lib/token/TokenRejectFlow.js.map +1 -0
- package/lib/token/TokenRejectTransaction.cjs +240 -0
- package/lib/token/TokenRejectTransaction.d.ts +120 -0
- package/lib/token/TokenRejectTransaction.js +2 -0
- package/lib/token/TokenRejectTransaction.js.map +1 -0
- package/lib/token/TokenRevokeKycTransaction.cjs +172 -0
- package/lib/token/TokenRevokeKycTransaction.d.ts +90 -0
- package/lib/token/TokenRevokeKycTransaction.js +2 -0
- package/lib/token/TokenRevokeKycTransaction.js.map +1 -0
- package/lib/token/TokenSupplyType.cjs +77 -0
- package/lib/token/TokenSupplyType.d.ts +38 -0
- package/lib/token/TokenSupplyType.js +2 -0
- package/lib/token/TokenSupplyType.js.map +1 -0
- package/lib/token/TokenTransfer.cjs +122 -0
- package/lib/token/TokenTransfer.d.ts +92 -0
- package/lib/token/TokenTransfer.js +2 -0
- package/lib/token/TokenTransfer.js.map +1 -0
- package/lib/token/TokenType.cjs +77 -0
- package/lib/token/TokenType.d.ts +38 -0
- package/lib/token/TokenType.js +2 -0
- package/lib/token/TokenType.js.map +1 -0
- package/lib/token/TokenUnfreezeTransaction.cjs +172 -0
- package/lib/token/TokenUnfreezeTransaction.d.ts +90 -0
- package/lib/token/TokenUnfreezeTransaction.js +2 -0
- package/lib/token/TokenUnfreezeTransaction.js.map +1 -0
- package/lib/token/TokenUnpauseTransaction.cjs +140 -0
- package/lib/token/TokenUnpauseTransaction.d.ts +75 -0
- package/lib/token/TokenUnpauseTransaction.js +2 -0
- package/lib/token/TokenUnpauseTransaction.js.map +1 -0
- package/lib/token/TokenUpdateNftsTransaction.cjs +189 -0
- package/lib/token/TokenUpdateNftsTransaction.d.ts +103 -0
- package/lib/token/TokenUpdateNftsTransaction.js +2 -0
- package/lib/token/TokenUpdateNftsTransaction.js.map +1 -0
- package/lib/token/TokenUpdateTransaction.cjs +672 -0
- package/lib/token/TokenUpdateTransaction.d.ts +366 -0
- package/lib/token/TokenUpdateTransaction.js +2 -0
- package/lib/token/TokenUpdateTransaction.js.map +1 -0
- package/lib/token/TokenWipeTransaction.cjs +231 -0
- package/lib/token/TokenWipeTransaction.d.ts +123 -0
- package/lib/token/TokenWipeTransaction.js +2 -0
- package/lib/token/TokenWipeTransaction.js.map +1 -0
- package/lib/topic/SubscriptionHandle.cjs +40 -0
- package/lib/topic/SubscriptionHandle.d.ts +22 -0
- package/lib/topic/SubscriptionHandle.js +2 -0
- package/lib/topic/SubscriptionHandle.js.map +1 -0
- package/lib/topic/TopicCreateTransaction.cjs +473 -0
- package/lib/topic/TopicCreateTransaction.d.ts +250 -0
- package/lib/topic/TopicCreateTransaction.js +2 -0
- package/lib/topic/TopicCreateTransaction.js.map +1 -0
- package/lib/topic/TopicDeleteTransaction.cjs +146 -0
- package/lib/topic/TopicDeleteTransaction.d.ts +80 -0
- package/lib/topic/TopicDeleteTransaction.js +2 -0
- package/lib/topic/TopicDeleteTransaction.js.map +1 -0
- package/lib/topic/TopicId.cjs +185 -0
- package/lib/topic/TopicId.d.ts +102 -0
- package/lib/topic/TopicId.js +2 -0
- package/lib/topic/TopicId.js.map +1 -0
- package/lib/topic/TopicInfo.cjs +187 -0
- package/lib/topic/TopicInfo.d.ts +119 -0
- package/lib/topic/TopicInfo.js +2 -0
- package/lib/topic/TopicInfo.js.map +1 -0
- package/lib/topic/TopicInfoQuery.cjs +174 -0
- package/lib/topic/TopicInfoQuery.d.ts +81 -0
- package/lib/topic/TopicInfoQuery.js +2 -0
- package/lib/topic/TopicInfoQuery.js.map +1 -0
- package/lib/topic/TopicMessage.cjs +116 -0
- package/lib/topic/TopicMessage.d.ts +65 -0
- package/lib/topic/TopicMessage.js +2 -0
- package/lib/topic/TopicMessage.js.map +1 -0
- package/lib/topic/TopicMessageChunk.cjs +71 -0
- package/lib/topic/TopicMessageChunk.d.ts +56 -0
- package/lib/topic/TopicMessageChunk.js +2 -0
- package/lib/topic/TopicMessageChunk.js.map +1 -0
- package/lib/topic/TopicMessageQuery.cjs +450 -0
- package/lib/topic/TopicMessageQuery.d.ts +220 -0
- package/lib/topic/TopicMessageQuery.js +2 -0
- package/lib/topic/TopicMessageQuery.js.map +1 -0
- package/lib/topic/TopicMessageSubmitTransaction.cjs +412 -0
- package/lib/topic/TopicMessageSubmitTransaction.d.ts +201 -0
- package/lib/topic/TopicMessageSubmitTransaction.js +2 -0
- package/lib/topic/TopicMessageSubmitTransaction.js.map +1 -0
- package/lib/topic/TopicUpdateTransaction.cjs +532 -0
- package/lib/topic/TopicUpdateTransaction.d.ts +284 -0
- package/lib/topic/TopicUpdateTransaction.js +2 -0
- package/lib/topic/TopicUpdateTransaction.js.map +1 -0
- package/lib/transaction/BatchTransaction.cjs +262 -0
- package/lib/transaction/BatchTransaction.d.ts +134 -0
- package/lib/transaction/BatchTransaction.js +2 -0
- package/lib/transaction/BatchTransaction.js.map +1 -0
- package/lib/transaction/CustomFeeLimit.cjs +116 -0
- package/lib/transaction/CustomFeeLimit.d.ts +64 -0
- package/lib/transaction/CustomFeeLimit.js +2 -0
- package/lib/transaction/CustomFeeLimit.js.map +1 -0
- package/lib/transaction/List.cjs +177 -0
- package/lib/transaction/List.d.ts +100 -0
- package/lib/transaction/List.js +2 -0
- package/lib/transaction/List.js.map +1 -0
- package/lib/transaction/NodeAccountIdSignatureMap.cjs +62 -0
- package/lib/transaction/NodeAccountIdSignatureMap.d.ts +23 -0
- package/lib/transaction/NodeAccountIdSignatureMap.js +2 -0
- package/lib/transaction/NodeAccountIdSignatureMap.js.map +1 -0
- package/lib/transaction/NodeAccountIdSignatureMapLegacy.cjs +39 -0
- package/lib/transaction/NodeAccountIdSignatureMapLegacy.d.ts +14 -0
- package/lib/transaction/NodeAccountIdSignatureMapLegacy.js +2 -0
- package/lib/transaction/NodeAccountIdSignatureMapLegacy.js.map +1 -0
- package/lib/transaction/SignableNodeTransactionBodyBytes.cjs +47 -0
- package/lib/transaction/SignableNodeTransactionBodyBytes.d.ts +38 -0
- package/lib/transaction/SignableNodeTransactionBodyBytes.js +2 -0
- package/lib/transaction/SignableNodeTransactionBodyBytes.js.map +1 -0
- package/lib/transaction/SignatureMap.cjs +95 -0
- package/lib/transaction/SignatureMap.d.ts +42 -0
- package/lib/transaction/SignatureMap.js +2 -0
- package/lib/transaction/SignatureMap.js.map +1 -0
- package/lib/transaction/SignatureMapLegacy.cjs +37 -0
- package/lib/transaction/SignatureMapLegacy.d.ts +15 -0
- package/lib/transaction/SignatureMapLegacy.js +2 -0
- package/lib/transaction/SignatureMapLegacy.js.map +1 -0
- package/lib/transaction/SignaturePairMap.cjs +50 -0
- package/lib/transaction/SignaturePairMap.d.ts +21 -0
- package/lib/transaction/SignaturePairMap.js +2 -0
- package/lib/transaction/SignaturePairMap.js.map +1 -0
- package/lib/transaction/TokenTransfer.cjs +2 -0
- package/lib/transaction/TokenTransfer.d.ts +0 -0
- package/lib/transaction/Transaction.cjs +1959 -0
- package/lib/transaction/Transaction.d.ts +698 -0
- package/lib/transaction/Transaction.js +2 -0
- package/lib/transaction/Transaction.js.map +1 -0
- package/lib/transaction/TransactionHashMap.cjs +44 -0
- package/lib/transaction/TransactionHashMap.d.ts +22 -0
- package/lib/transaction/TransactionHashMap.js +2 -0
- package/lib/transaction/TransactionHashMap.js.map +1 -0
- package/lib/transaction/TransactionId.cjs +224 -0
- package/lib/transaction/TransactionId.d.ts +122 -0
- package/lib/transaction/TransactionId.js +2 -0
- package/lib/transaction/TransactionId.js.map +1 -0
- package/lib/transaction/TransactionReceipt.cjs +303 -0
- package/lib/transaction/TransactionReceipt.d.ts +202 -0
- package/lib/transaction/TransactionReceipt.js +2 -0
- package/lib/transaction/TransactionReceipt.js.map +1 -0
- package/lib/transaction/TransactionReceiptQuery.cjs +347 -0
- package/lib/transaction/TransactionReceiptQuery.d.ts +96 -0
- package/lib/transaction/TransactionReceiptQuery.js +2 -0
- package/lib/transaction/TransactionReceiptQuery.js.map +1 -0
- package/lib/transaction/TransactionRecord.cjs +470 -0
- package/lib/transaction/TransactionRecord.d.ts +317 -0
- package/lib/transaction/TransactionRecord.js +2 -0
- package/lib/transaction/TransactionRecord.js.map +1 -0
- package/lib/transaction/TransactionRecordQuery.cjs +366 -0
- package/lib/transaction/TransactionRecordQuery.d.ts +99 -0
- package/lib/transaction/TransactionRecordQuery.js +2 -0
- package/lib/transaction/TransactionRecordQuery.js.map +1 -0
- package/lib/transaction/TransactionResponse.cjs +242 -0
- package/lib/transaction/TransactionResponse.d.ts +119 -0
- package/lib/transaction/TransactionResponse.js +2 -0
- package/lib/transaction/TransactionResponse.js.map +1 -0
- package/lib/util/ASN1-Decoder.cjs +276 -0
- package/lib/util/ASN1-Decoder.d.ts +104 -0
- package/lib/util/ASN1-Decoder.js +2 -0
- package/lib/util/ASN1-Decoder.js.map +1 -0
- package/lib/util.cjs +464 -0
- package/lib/util.d.ts +210 -0
- package/lib/util.js +2 -0
- package/lib/util.js.map +1 -0
- package/lib/version.cjs +8 -0
- package/lib/version.d.ts +2 -0
- package/lib/version.js +2 -0
- package/lib/version.js.map +1 -0
- package/package.json +139 -0
- package/src/BadEntityIdError.js +24 -0
- package/src/Cache.js +418 -0
- package/src/Duration.js +48 -0
- package/src/EntityIdHelper.js +620 -0
- package/src/EthereumFlow.js +244 -0
- package/src/EthereumTransaction.js +298 -0
- package/src/EthereumTransactionData.js +60 -0
- package/src/EthereumTransactionDataEip1559.js +146 -0
- package/src/EthereumTransactionDataEip2930.js +140 -0
- package/src/EthereumTransactionDataLegacy.js +121 -0
- package/src/EvmAddress.js +78 -0
- package/src/ExchangeRate.js +117 -0
- package/src/ExchangeRates.js +71 -0
- package/src/Executable.js +884 -0
- package/src/FeeComponents.js +199 -0
- package/src/FeeData.js +127 -0
- package/src/FeeDataType.js +125 -0
- package/src/FeeSchedule.js +88 -0
- package/src/FeeSchedules.js +82 -0
- package/src/FreezeType.js +113 -0
- package/src/Hbar.js +147 -0
- package/src/HbarUnit.js +90 -0
- package/src/Key.js +60 -0
- package/src/KeyList.js +179 -0
- package/src/LedgerId.js +134 -0
- package/src/LocalProvider.js +165 -0
- package/src/ManagedNode.js +269 -0
- package/src/ManagedNodeAddress.js +101 -0
- package/src/MaxAttemptsOrTimeoutError.js +42 -0
- package/src/MaxQueryPaymentExceeded.js +28 -0
- package/src/MirrorNode.js +41 -0
- package/src/Mnemonic.js +250 -0
- package/src/Node.js +106 -0
- package/src/ObjectMap.js +137 -0
- package/src/PrecheckStatusError.js +73 -0
- package/src/PrivateKey.js +547 -0
- package/src/PrngTransaction.js +152 -0
- package/src/Provider.js +40 -0
- package/src/PublicKey.js +294 -0
- package/src/ReceiptStatusError.js +41 -0
- package/src/RecordStatusError.js +30 -0
- package/src/RequestType.js +920 -0
- package/src/Signer.js +46 -0
- package/src/SignerSignature.js +27 -0
- package/src/StakingInfo.js +187 -0
- package/src/Status.js +3353 -0
- package/src/StatusError.js +64 -0
- package/src/Timestamp.js +160 -0
- package/src/TransactionFeeSchedule.js +100 -0
- package/src/Transfer.js +113 -0
- package/src/Wallet.js +300 -0
- package/src/account/AccountAllowanceAdjustTransaction.js +540 -0
- package/src/account/AccountAllowanceApproveTransaction.js +569 -0
- package/src/account/AccountAllowanceDeleteTransaction.js +199 -0
- package/src/account/AccountBalance.js +160 -0
- package/src/account/AccountBalanceQuery.js +238 -0
- package/src/account/AccountCreateTransaction.js +674 -0
- package/src/account/AccountDeleteTransaction.js +221 -0
- package/src/account/AccountId.js +486 -0
- package/src/account/AccountInfo.js +433 -0
- package/src/account/AccountInfoFlow.js +106 -0
- package/src/account/AccountInfoQuery.js +187 -0
- package/src/account/AccountRecordsQuery.js +186 -0
- package/src/account/AccountUpdateTransaction.js +634 -0
- package/src/account/HbarAllowance.js +147 -0
- package/src/account/HbarTransferMap.js +48 -0
- package/src/account/LiveHash.js +79 -0
- package/src/account/LiveHashAddTransaction.js +289 -0
- package/src/account/LiveHashDeleteTransaction.js +196 -0
- package/src/account/LiveHashQuery.js +209 -0
- package/src/account/NullableTokenDecimalMap.js +19 -0
- package/src/account/ProxyStaker.js +74 -0
- package/src/account/TokenAllowance.js +152 -0
- package/src/account/TokenBalanceMap.js +23 -0
- package/src/account/TokenDecimalMap.js +19 -0
- package/src/account/TokenNftAllowance.js +217 -0
- package/src/account/TokenNftTransferMap.js +134 -0
- package/src/account/TokenRelationship.js +125 -0
- package/src/account/TokenRelationshipMap.js +59 -0
- package/src/account/TokenTransferAccountMap.js +24 -0
- package/src/account/TokenTransferMap.js +99 -0
- package/src/account/TransferTransaction.js +372 -0
- package/src/address_book/AddressBooks.js +27 -0
- package/src/address_book/Endpoint.js +141 -0
- package/src/address_book/IPv4Address.js +125 -0
- package/src/address_book/IPv4AddressPart.js +71 -0
- package/src/address_book/NodeAddress.js +319 -0
- package/src/address_book/NodeAddressBook.js +114 -0
- package/src/array.js +60 -0
- package/src/base32.js +29 -0
- package/src/browser.js +10 -0
- package/src/channel/Channel.js +340 -0
- package/src/channel/MirrorChannel.js +49 -0
- package/src/channel/NativeChannel.js +120 -0
- package/src/channel/NodeChannel.js +196 -0
- package/src/channel/NodeMirrorChannel.js +91 -0
- package/src/channel/WebChannel.js +100 -0
- package/src/client/Client.js +871 -0
- package/src/client/ManagedNetwork.js +473 -0
- package/src/client/MirrorNetwork.js +87 -0
- package/src/client/NativeClient.js +218 -0
- package/src/client/Network.js +304 -0
- package/src/client/NodeClient.js +321 -0
- package/src/client/WebClient.js +302 -0
- package/src/client/addressbooks/mainnet.js +2 -0
- package/src/client/addressbooks/previewnet.js +2 -0
- package/src/client/addressbooks/testnet.js +2 -0
- package/src/constants/ClientConstants.js +204 -0
- package/src/contract/ContractByteCodeQuery.js +178 -0
- package/src/contract/ContractCallQuery.js +382 -0
- package/src/contract/ContractCreateFlow.js +551 -0
- package/src/contract/ContractCreateTransaction.js +677 -0
- package/src/contract/ContractDeleteTransaction.js +291 -0
- package/src/contract/ContractExecuteTransaction.js +313 -0
- package/src/contract/ContractFunctionParameters.js +1759 -0
- package/src/contract/ContractFunctionResult.js +1060 -0
- package/src/contract/ContractFunctionSelector.js +1360 -0
- package/src/contract/ContractId.js +316 -0
- package/src/contract/ContractInfo.js +264 -0
- package/src/contract/ContractInfoQuery.js +190 -0
- package/src/contract/ContractLogInfo.js +83 -0
- package/src/contract/ContractNonceInfo.js +129 -0
- package/src/contract/ContractStateChange.js +77 -0
- package/src/contract/ContractUpdateTransaction.js +665 -0
- package/src/contract/DelegateContractId.js +94 -0
- package/src/contract/StorageChange.js +71 -0
- package/src/cryptography/keccak.js +419 -0
- package/src/cryptography/sha384.browser.js +13 -0
- package/src/cryptography/sha384.js +20 -0
- package/src/cryptography/sha384.native.js +19 -0
- package/src/encoding/base64.native.js +19 -0
- package/src/encoding/hex.browser.js +95 -0
- package/src/encoding/hex.js +76 -0
- package/src/encoding/hex.native.js +386 -0
- package/src/encoding/utf8.browser.js +19 -0
- package/src/encoding/utf8.js +17 -0
- package/src/encoding/utf8.native.js +20 -0
- package/src/exports.js +213 -0
- package/src/file/FileAppendTransaction.js +586 -0
- package/src/file/FileContentsQuery.js +174 -0
- package/src/file/FileCreateTransaction.js +301 -0
- package/src/file/FileDeleteTransaction.js +167 -0
- package/src/file/FileId.js +247 -0
- package/src/file/FileInfo.js +136 -0
- package/src/file/FileInfoQuery.js +186 -0
- package/src/file/FileUpdateTransaction.js +375 -0
- package/src/grpc/GrpcServiceError.js +64 -0
- package/src/grpc/GrpcStatus.js +142 -0
- package/src/http/HttpError.js +26 -0
- package/src/http/HttpStatus.js +38 -0
- package/src/index.js +11 -0
- package/src/logger/LogLevel.js +72 -0
- package/src/logger/Logger.js +225 -0
- package/src/long.js +20 -0
- package/src/native.js +10 -0
- package/src/network/AddressBookQuery.js +272 -0
- package/src/network/AddressBookQueryWeb.js +388 -0
- package/src/network/NetworkVersionInfo.js +81 -0
- package/src/network/NetworkVersionInfoQuery.js +117 -0
- package/src/network/SemanticVersion.js +74 -0
- package/src/node/NodeCreateTransaction.js +513 -0
- package/src/node/NodeDeleteTransaction.js +161 -0
- package/src/node/NodeUpdateTransaction.js +592 -0
- package/src/node/ServiceEndpoint.js +145 -0
- package/src/query/CostQuery.js +187 -0
- package/src/query/MirrorNodeContractCallQuery.js +49 -0
- package/src/query/MirrorNodeContractEstimateQuery.js +48 -0
- package/src/query/MirrorNodeContractQuery.js +266 -0
- package/src/query/Query.js +527 -0
- package/src/query/QueryBase.js +116 -0
- package/src/schedule/ScheduleCreateTransaction.js +371 -0
- package/src/schedule/ScheduleDeleteTransaction.js +174 -0
- package/src/schedule/ScheduleId.js +173 -0
- package/src/schedule/ScheduleInfo.js +243 -0
- package/src/schedule/ScheduleInfoQuery.js +189 -0
- package/src/schedule/ScheduleSignTransaction.js +189 -0
- package/src/system/FreezeTransaction.js +390 -0
- package/src/system/SystemDeleteTransaction.js +239 -0
- package/src/system/SystemUndeleteTransaction.js +207 -0
- package/src/token/AbstractTokenTransferTransaction.js +589 -0
- package/src/token/AirdropPendingTransaction.js +58 -0
- package/src/token/AssessedCustomFee.js +198 -0
- package/src/token/CustomFee.js +87 -0
- package/src/token/CustomFixedFee.js +178 -0
- package/src/token/CustomFractionalFee.js +226 -0
- package/src/token/CustomRoyaltyFee.js +173 -0
- package/src/token/FeeAssessmentMethod.js +53 -0
- package/src/token/NftId.js +95 -0
- package/src/token/PendingAirdropId.js +157 -0
- package/src/token/PendingAirdropRecord.js +50 -0
- package/src/token/TokenAirdropTransaction.js +220 -0
- package/src/token/TokenAssociateTransaction.js +214 -0
- package/src/token/TokenAssociation.js +127 -0
- package/src/token/TokenBurnTransaction.js +229 -0
- package/src/token/TokenCancelAirdropTransaction.js +120 -0
- package/src/token/TokenClaimAirdropTransaction.js +121 -0
- package/src/token/TokenCreateTransaction.js +978 -0
- package/src/token/TokenDeleteTransaction.js +161 -0
- package/src/token/TokenDissociateTransaction.js +214 -0
- package/src/token/TokenFeeScheduleUpdateTransaction.js +198 -0
- package/src/token/TokenFreezeTransaction.js +203 -0
- package/src/token/TokenGrantKycTransaction.js +203 -0
- package/src/token/TokenId.js +203 -0
- package/src/token/TokenInfo.js +454 -0
- package/src/token/TokenInfoQuery.js +185 -0
- package/src/token/TokenKeyValidation.js +70 -0
- package/src/token/TokenMintTransaction.js +258 -0
- package/src/token/TokenNftInfo.js +135 -0
- package/src/token/TokenNftInfoQuery.js +369 -0
- package/src/token/TokenNftTransfer.js +115 -0
- package/src/token/TokenNftsUpdateTransaction.js +220 -0
- package/src/token/TokenPauseTransaction.js +161 -0
- package/src/token/TokenReference.js +40 -0
- package/src/token/TokenRejectFlow.js +261 -0
- package/src/token/TokenRejectTransaction.js +262 -0
- package/src/token/TokenRevokeKycTransaction.js +203 -0
- package/src/token/TokenSupplyType.js +74 -0
- package/src/token/TokenTransfer.js +142 -0
- package/src/token/TokenType.js +74 -0
- package/src/token/TokenUnfreezeTransaction.js +203 -0
- package/src/token/TokenUnpauseTransaction.js +161 -0
- package/src/token/TokenUpdateNftsTransaction.js +225 -0
- package/src/token/TokenUpdateTransaction.js +827 -0
- package/src/token/TokenWipeTransaction.js +271 -0
- package/src/topic/SubscriptionHandle.js +34 -0
- package/src/topic/TopicCreateTransaction.js +557 -0
- package/src/topic/TopicDeleteTransaction.js +167 -0
- package/src/topic/TopicId.js +204 -0
- package/src/topic/TopicInfo.js +254 -0
- package/src/topic/TopicInfoQuery.js +190 -0
- package/src/topic/TopicMessage.js +170 -0
- package/src/topic/TopicMessageChunk.js +76 -0
- package/src/topic/TopicMessageQuery.js +523 -0
- package/src/topic/TopicMessageSubmitTransaction.js +488 -0
- package/src/topic/TopicUpdateTransaction.js +659 -0
- package/src/transaction/BatchTransaction.js +293 -0
- package/src/transaction/CustomFeeLimit.js +121 -0
- package/src/transaction/List.js +175 -0
- package/src/transaction/NodeAccountIdSignatureMap.js +62 -0
- package/src/transaction/NodeAccountIdSignatureMapLegacy.js +41 -0
- package/src/transaction/SignableNodeTransactionBodyBytes.js +40 -0
- package/src/transaction/SignatureMap.js +104 -0
- package/src/transaction/SignatureMapLegacy.js +37 -0
- package/src/transaction/SignaturePairMap.js +53 -0
- package/src/transaction/TokenTransfer.js +1 -0
- package/src/transaction/Transaction.js +2295 -0
- package/src/transaction/TransactionHashMap.js +41 -0
- package/src/transaction/TransactionId.js +262 -0
- package/src/transaction/TransactionReceipt.js +414 -0
- package/src/transaction/TransactionReceiptQuery.js +418 -0
- package/src/transaction/TransactionRecord.js +638 -0
- package/src/transaction/TransactionRecordQuery.js +440 -0
- package/src/transaction/TransactionResponse.js +283 -0
- package/src/types.d.ts +5 -0
- package/src/util/ASN1-Decoder.js +256 -0
- package/src/util.js +479 -0
- package/src/version.js +3 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _ReceiptStatusError = _interopRequireDefault(require("../ReceiptStatusError.cjs"));
|
|
8
|
+
var _Status = _interopRequireDefault(require("../Status.cjs"));
|
|
9
|
+
var _TransactionReceiptQuery = _interopRequireDefault(require("./TransactionReceiptQuery.cjs"));
|
|
10
|
+
var _TransactionRecordQuery = _interopRequireDefault(require("./TransactionRecordQuery.cjs"));
|
|
11
|
+
var _AccountId = _interopRequireDefault(require("../account/AccountId.cjs"));
|
|
12
|
+
var _TransactionId = _interopRequireDefault(require("./TransactionId.cjs"));
|
|
13
|
+
var hex = _interopRequireWildcard(require("../encoding/hex.cjs"));
|
|
14
|
+
var _util = require("../util.cjs");
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @typedef {import("../client/Client.js").default<*, *>} Client
|
|
22
|
+
* @typedef {import("./Transaction.js").default} Transaction
|
|
23
|
+
* @typedef {import("./TransactionReceipt.js").default} TransactionReceipt
|
|
24
|
+
* @typedef {import("./TransactionRecord.js").default} TransactionRecord
|
|
25
|
+
* @typedef {import("../Signer.js").Signer} Signer
|
|
26
|
+
* @typedef {import("../logger/Logger.js").default} Logger
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @typedef {object} TransactionResponseJSON
|
|
31
|
+
* @property {string} nodeId
|
|
32
|
+
* @property {string} transactionHash
|
|
33
|
+
* @property {string} transactionId
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* When the client sends the node a transaction of any kind, the node
|
|
38
|
+
* replies with this, which simply says that the transaction passed
|
|
39
|
+
* the pre-check (so the node will submit it to the network) or it failed
|
|
40
|
+
* (so it won't). To learn the consensus result, the client should later
|
|
41
|
+
* obtain a receipt (free), or can buy a more detailed record (not free).
|
|
42
|
+
* <br>
|
|
43
|
+
* See <a href="https://docs.hedera.com/guides/docs/hedera-api/miscellaneous/transactionresponse">Hedera Documentation</a>
|
|
44
|
+
*/
|
|
45
|
+
class TransactionResponse {
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
* @param {object} props
|
|
49
|
+
* @param {AccountId} props.nodeId
|
|
50
|
+
* @param {Uint8Array} props.transactionHash
|
|
51
|
+
* @param {TransactionId} props.transactionId
|
|
52
|
+
* @param {Transaction} [props.transaction]
|
|
53
|
+
* @param {Logger | null} [props.logger]
|
|
54
|
+
*/
|
|
55
|
+
constructor(props) {
|
|
56
|
+
/** @readonly */
|
|
57
|
+
this.nodeId = props.nodeId;
|
|
58
|
+
|
|
59
|
+
/** @readonly */
|
|
60
|
+
this.transactionHash = props.transactionHash;
|
|
61
|
+
this.transactionId = props.transactionId;
|
|
62
|
+
this.transaction = props.transaction;
|
|
63
|
+
this.logger = props.logger;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @param {TransactionResponseJSON} json
|
|
68
|
+
* @returns {TransactionResponse}
|
|
69
|
+
*/
|
|
70
|
+
static fromJSON(json) {
|
|
71
|
+
return new TransactionResponse({
|
|
72
|
+
nodeId: _AccountId.default.fromString(json.nodeId),
|
|
73
|
+
transactionHash: hex.decode(json.transactionHash),
|
|
74
|
+
transactionId: _TransactionId.default.fromString(json.transactionId)
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @param {Client} client
|
|
80
|
+
* @returns {Promise<TransactionReceipt>}
|
|
81
|
+
*/
|
|
82
|
+
async getReceipt(client) {
|
|
83
|
+
let receipt;
|
|
84
|
+
try {
|
|
85
|
+
receipt = await this.getReceiptQuery().execute(client);
|
|
86
|
+
} catch (err) {
|
|
87
|
+
if (err instanceof _ReceiptStatusError.default && err.status === _Status.default.ThrottledAtConsensus) {
|
|
88
|
+
this.logger?.info("Transaction throttled at consensus");
|
|
89
|
+
// need to reset the transaction to its initial state before retrying
|
|
90
|
+
return this._retryTransaction(client);
|
|
91
|
+
}
|
|
92
|
+
throw err;
|
|
93
|
+
}
|
|
94
|
+
if (receipt.status !== _Status.default.Success && receipt.status !== _Status.default.FeeScheduleFilePartUploaded) {
|
|
95
|
+
throw new _ReceiptStatusError.default({
|
|
96
|
+
transactionReceipt: receipt,
|
|
97
|
+
status: receipt.status,
|
|
98
|
+
transactionId: this.transactionId
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return receipt;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* getRecord is calling getReceipt and in case the receipt status code is not OK, only the receipt is returned.
|
|
106
|
+
*
|
|
107
|
+
* @param {Client} client
|
|
108
|
+
* @returns {Promise<TransactionRecord>}
|
|
109
|
+
*/
|
|
110
|
+
async getRecord(client) {
|
|
111
|
+
await this.getReceipt(client);
|
|
112
|
+
return this.getRecordQuery().execute(client);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* getVerboseRecord is calling getReceipt and in case the receipt status code is not OK, the record is returned.
|
|
117
|
+
*
|
|
118
|
+
* @param {Client} client
|
|
119
|
+
* @returns {Promise<TransactionRecord>}
|
|
120
|
+
*/
|
|
121
|
+
async getVerboseRecord(client) {
|
|
122
|
+
try {
|
|
123
|
+
// The receipt needs to be called in order to wait for transaction to be included in the consensus. Otherwise we are going to get "DUPLICATE_TRANSACTION".
|
|
124
|
+
await this.getReceiptQuery().execute(client);
|
|
125
|
+
return this.getRecordQuery().execute(client);
|
|
126
|
+
} catch (e) {
|
|
127
|
+
return this.getRecordQuery().execute(client);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* @param {Signer} signer
|
|
133
|
+
* @returns {Promise<TransactionReceipt>}
|
|
134
|
+
*/
|
|
135
|
+
async getReceiptWithSigner(signer) {
|
|
136
|
+
const receipt = await this.getReceiptQuery().executeWithSigner(signer);
|
|
137
|
+
if (receipt.status !== _Status.default.Success) {
|
|
138
|
+
throw new _ReceiptStatusError.default({
|
|
139
|
+
transactionReceipt: receipt,
|
|
140
|
+
status: receipt.status,
|
|
141
|
+
transactionId: this.transactionId
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return receipt;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @param {Signer} signer
|
|
149
|
+
* @returns {Promise<TransactionRecord>}
|
|
150
|
+
*/
|
|
151
|
+
async getRecordWithSigner(signer) {
|
|
152
|
+
await this.getReceiptWithSigner(signer);
|
|
153
|
+
return this.getRecordQuery().executeWithSigner(signer);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @returns {TransactionReceiptQuery}
|
|
158
|
+
*/
|
|
159
|
+
getReceiptQuery() {
|
|
160
|
+
return new _TransactionReceiptQuery.default().setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId]);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* @returns {TransactionRecordQuery}
|
|
165
|
+
*/
|
|
166
|
+
getRecordQuery() {
|
|
167
|
+
return new _TransactionRecordQuery.default().setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId]);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @returns {TransactionResponseJSON}
|
|
172
|
+
*/
|
|
173
|
+
toJSON() {
|
|
174
|
+
return {
|
|
175
|
+
nodeId: this.nodeId.toString(),
|
|
176
|
+
transactionHash: hex.encode(this.transactionHash),
|
|
177
|
+
transactionId: this.transactionId.toString()
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
*
|
|
183
|
+
* @param {Client} client
|
|
184
|
+
* @returns {Promise<TransactionReceipt>}
|
|
185
|
+
*/
|
|
186
|
+
async _retryTransaction(client) {
|
|
187
|
+
if (!this.transaction) {
|
|
188
|
+
throw new Error("If you retry transaction you should have the transaction set");
|
|
189
|
+
}
|
|
190
|
+
if (client.operatorAccountId?.toString() !== this.transaction.transactionId?.accountId?.toString()) {
|
|
191
|
+
throw new Error("Retry mechanism is not supported when tx id is not generated by the operator account");
|
|
192
|
+
}
|
|
193
|
+
if (client.operatorAccountId === null) {
|
|
194
|
+
throw new Error("Operator account is not set");
|
|
195
|
+
}
|
|
196
|
+
const MAX_RETRIES = 5;
|
|
197
|
+
const MAX_BACKOFF = 16000;
|
|
198
|
+
let BACKOFF = 250; // milliseconds
|
|
199
|
+
|
|
200
|
+
for (let i = 0; i < MAX_RETRIES; i++) {
|
|
201
|
+
this.logger?.trace(`Transaction throttled, retry attempt ${i}`);
|
|
202
|
+
this.transaction?._resetTransaction(client);
|
|
203
|
+
if (this.transaction == null || this.transaction.transactionId == null) {
|
|
204
|
+
throw new Error("Transaction or Transaction ID is null after reset");
|
|
205
|
+
}
|
|
206
|
+
// need to set the transactionId again in case we are doing getRecord afterwards
|
|
207
|
+
this.transactionId = this.transaction.transactionId;
|
|
208
|
+
if (i > 0) {
|
|
209
|
+
// Wait with exponential backoff before retrying
|
|
210
|
+
await (0, _util.wait)(Math.min(BACKOFF, MAX_BACKOFF));
|
|
211
|
+
BACKOFF *= 2; // Double the backoff for next retry
|
|
212
|
+
}
|
|
213
|
+
try {
|
|
214
|
+
this.transaction._resetTransaction(client);
|
|
215
|
+
const resp = await this.transaction.execute(client);
|
|
216
|
+
const receipt = await new _TransactionReceiptQuery.default().setTransactionId(resp.transactionId).setNodeAccountIds([resp.nodeId]).execute(client);
|
|
217
|
+
if (receipt.status !== _Status.default.ThrottledAtConsensus) {
|
|
218
|
+
this.logger?.info(`Transaction throttle retry succeeded after attempt ${i}`);
|
|
219
|
+
return receipt;
|
|
220
|
+
}
|
|
221
|
+
} catch (err) {
|
|
222
|
+
if (err instanceof _ReceiptStatusError.default && err.status === _Status.default.ThrottledAtConsensus) {
|
|
223
|
+
this.logger?.info("Transaction throttled at consensus");
|
|
224
|
+
// Continue to next retry on error
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
this.logger?.error(`An error occurred after throttle retry: ${err instanceof Error ? err.message : String(err)}`);
|
|
228
|
+
throw err;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
this.logger?.error("Transaction throttle retry failed after maximum attempts");
|
|
232
|
+
throw new Error("Transaction retry failed after maximum attempts");
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* @returns {string}
|
|
237
|
+
*/
|
|
238
|
+
toString() {
|
|
239
|
+
return JSON.stringify(this.toJSON());
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
exports.default = TransactionResponse;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import("../client/Client.js").default<*, *>} Client
|
|
3
|
+
* @typedef {import("./Transaction.js").default} Transaction
|
|
4
|
+
* @typedef {import("./TransactionReceipt.js").default} TransactionReceipt
|
|
5
|
+
* @typedef {import("./TransactionRecord.js").default} TransactionRecord
|
|
6
|
+
* @typedef {import("../Signer.js").Signer} Signer
|
|
7
|
+
* @typedef {import("../logger/Logger.js").default} Logger
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {object} TransactionResponseJSON
|
|
11
|
+
* @property {string} nodeId
|
|
12
|
+
* @property {string} transactionHash
|
|
13
|
+
* @property {string} transactionId
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* When the client sends the node a transaction of any kind, the node
|
|
17
|
+
* replies with this, which simply says that the transaction passed
|
|
18
|
+
* the pre-check (so the node will submit it to the network) or it failed
|
|
19
|
+
* (so it won't). To learn the consensus result, the client should later
|
|
20
|
+
* obtain a receipt (free), or can buy a more detailed record (not free).
|
|
21
|
+
* <br>
|
|
22
|
+
* See <a href="https://docs.hedera.com/guides/docs/hedera-api/miscellaneous/transactionresponse">Hedera Documentation</a>
|
|
23
|
+
*/
|
|
24
|
+
export default class TransactionResponse {
|
|
25
|
+
/**
|
|
26
|
+
* @param {TransactionResponseJSON} json
|
|
27
|
+
* @returns {TransactionResponse}
|
|
28
|
+
*/
|
|
29
|
+
static fromJSON(json: TransactionResponseJSON): TransactionResponse;
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
* @param {object} props
|
|
33
|
+
* @param {AccountId} props.nodeId
|
|
34
|
+
* @param {Uint8Array} props.transactionHash
|
|
35
|
+
* @param {TransactionId} props.transactionId
|
|
36
|
+
* @param {Transaction} [props.transaction]
|
|
37
|
+
* @param {Logger | null} [props.logger]
|
|
38
|
+
*/
|
|
39
|
+
constructor(props: {
|
|
40
|
+
nodeId: AccountId;
|
|
41
|
+
transactionHash: Uint8Array;
|
|
42
|
+
transactionId: TransactionId;
|
|
43
|
+
transaction?: import("./Transaction.js").default | undefined;
|
|
44
|
+
logger?: import("../logger/Logger.js").default | null | undefined;
|
|
45
|
+
});
|
|
46
|
+
/** @readonly */
|
|
47
|
+
readonly nodeId: AccountId;
|
|
48
|
+
/** @readonly */
|
|
49
|
+
readonly transactionHash: Uint8Array<ArrayBufferLike>;
|
|
50
|
+
transactionId: TransactionId;
|
|
51
|
+
transaction: import("./Transaction.js").default | undefined;
|
|
52
|
+
logger: import("../logger/Logger.js").default | null | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* @param {Client} client
|
|
55
|
+
* @returns {Promise<TransactionReceipt>}
|
|
56
|
+
*/
|
|
57
|
+
getReceipt(client: Client): Promise<TransactionReceipt>;
|
|
58
|
+
/**
|
|
59
|
+
* getRecord is calling getReceipt and in case the receipt status code is not OK, only the receipt is returned.
|
|
60
|
+
*
|
|
61
|
+
* @param {Client} client
|
|
62
|
+
* @returns {Promise<TransactionRecord>}
|
|
63
|
+
*/
|
|
64
|
+
getRecord(client: Client): Promise<TransactionRecord>;
|
|
65
|
+
/**
|
|
66
|
+
* getVerboseRecord is calling getReceipt and in case the receipt status code is not OK, the record is returned.
|
|
67
|
+
*
|
|
68
|
+
* @param {Client} client
|
|
69
|
+
* @returns {Promise<TransactionRecord>}
|
|
70
|
+
*/
|
|
71
|
+
getVerboseRecord(client: Client): Promise<TransactionRecord>;
|
|
72
|
+
/**
|
|
73
|
+
* @param {Signer} signer
|
|
74
|
+
* @returns {Promise<TransactionReceipt>}
|
|
75
|
+
*/
|
|
76
|
+
getReceiptWithSigner(signer: Signer): Promise<TransactionReceipt>;
|
|
77
|
+
/**
|
|
78
|
+
* @param {Signer} signer
|
|
79
|
+
* @returns {Promise<TransactionRecord>}
|
|
80
|
+
*/
|
|
81
|
+
getRecordWithSigner(signer: Signer): Promise<TransactionRecord>;
|
|
82
|
+
/**
|
|
83
|
+
* @returns {TransactionReceiptQuery}
|
|
84
|
+
*/
|
|
85
|
+
getReceiptQuery(): TransactionReceiptQuery;
|
|
86
|
+
/**
|
|
87
|
+
* @returns {TransactionRecordQuery}
|
|
88
|
+
*/
|
|
89
|
+
getRecordQuery(): TransactionRecordQuery;
|
|
90
|
+
/**
|
|
91
|
+
* @returns {TransactionResponseJSON}
|
|
92
|
+
*/
|
|
93
|
+
toJSON(): TransactionResponseJSON;
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
* @param {Client} client
|
|
97
|
+
* @returns {Promise<TransactionReceipt>}
|
|
98
|
+
*/
|
|
99
|
+
_retryTransaction(client: Client): Promise<TransactionReceipt>;
|
|
100
|
+
/**
|
|
101
|
+
* @returns {string}
|
|
102
|
+
*/
|
|
103
|
+
toString(): string;
|
|
104
|
+
}
|
|
105
|
+
export type Client = import("../client/Client.js").default<any, any>;
|
|
106
|
+
export type Transaction = import("./Transaction.js").default;
|
|
107
|
+
export type TransactionReceipt = import("./TransactionReceipt.js").default;
|
|
108
|
+
export type TransactionRecord = import("./TransactionRecord.js").default;
|
|
109
|
+
export type Signer = import("../Signer.js").Signer;
|
|
110
|
+
export type Logger = import("../logger/Logger.js").default;
|
|
111
|
+
export type TransactionResponseJSON = {
|
|
112
|
+
nodeId: string;
|
|
113
|
+
transactionHash: string;
|
|
114
|
+
transactionId: string;
|
|
115
|
+
};
|
|
116
|
+
import AccountId from "../account/AccountId.js";
|
|
117
|
+
import TransactionId from "./TransactionId.js";
|
|
118
|
+
import TransactionReceiptQuery from "./TransactionReceiptQuery.js";
|
|
119
|
+
import TransactionRecordQuery from "./TransactionRecordQuery.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import t from"../ReceiptStatusError.js";import r from"../Status.js";import e from"./TransactionReceiptQuery.js";import n from"./TransactionRecordQuery.js";import s from"../account/AccountId.js";import a from"./TransactionId.js";import{decode as o,encode as i}from"../encoding/hex.js";import{wait as c}from"../util.js";class h{constructor(t){this.nodeId=t.nodeId,this.transactionHash=t.transactionHash,this.transactionId=t.transactionId,this.transaction=t.transaction,this.logger=t.logger}static fromJSON(t){return new h({nodeId:s.fromString(t.nodeId),transactionHash:o(t.transactionHash),transactionId:a.fromString(t.transactionId)})}async getReceipt(e){let n;try{n=await this.getReceiptQuery().execute(e)}catch(n){if(n instanceof t&&n.status===r.ThrottledAtConsensus)return this.logger?.info("Transaction throttled at consensus"),this._retryTransaction(e);throw n}if(n.status!==r.Success&&n.status!==r.FeeScheduleFilePartUploaded)throw new t({transactionReceipt:n,status:n.status,transactionId:this.transactionId});return n}async getRecord(t){return await this.getReceipt(t),this.getRecordQuery().execute(t)}async getVerboseRecord(t){try{return await this.getReceiptQuery().execute(t),this.getRecordQuery().execute(t)}catch(r){return this.getRecordQuery().execute(t)}}async getReceiptWithSigner(e){const n=await this.getReceiptQuery().executeWithSigner(e);if(n.status!==r.Success)throw new t({transactionReceipt:n,status:n.status,transactionId:this.transactionId});return n}async getRecordWithSigner(t){return await this.getReceiptWithSigner(t),this.getRecordQuery().executeWithSigner(t)}getReceiptQuery(){return(new e).setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId])}getRecordQuery(){return(new n).setTransactionId(this.transactionId).setNodeAccountIds([this.nodeId])}toJSON(){return{nodeId:this.nodeId.toString(),transactionHash:i(this.transactionHash),transactionId:this.transactionId.toString()}}async _retryTransaction(n){if(!this.transaction)throw new Error("If you retry transaction you should have the transaction set");if(n.operatorAccountId?.toString()!==this.transaction.transactionId?.accountId?.toString())throw new Error("Retry mechanism is not supported when tx id is not generated by the operator account");if(null===n.operatorAccountId)throw new Error("Operator account is not set");let s=250;for(let a=0;a<5;a++){if(this.logger?.trace(`Transaction throttled, retry attempt ${a}`),this.transaction?._resetTransaction(n),null==this.transaction||null==this.transaction.transactionId)throw new Error("Transaction or Transaction ID is null after reset");this.transactionId=this.transaction.transactionId,a>0&&(await c(Math.min(s,16e3)),s*=2);try{this.transaction._resetTransaction(n);const t=await this.transaction.execute(n),s=await(new e).setTransactionId(t.transactionId).setNodeAccountIds([t.nodeId]).execute(n);if(s.status!==r.ThrottledAtConsensus)return this.logger?.info(`Transaction throttle retry succeeded after attempt ${a}`),s}catch(e){if(e instanceof t&&e.status===r.ThrottledAtConsensus){this.logger?.info("Transaction throttled at consensus");continue}throw this.logger?.error(`An error occurred after throttle retry: ${e instanceof Error?e.message:String(e)}`),e}}throw this.logger?.error("Transaction throttle retry failed after maximum attempts"),new Error("Transaction retry failed after maximum attempts")}toString(){return JSON.stringify(this.toJSON())}}export{h as default};
|
|
2
|
+
//# sourceMappingURL=TransactionResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransactionResponse.js","sources":["../../src/transaction/TransactionResponse.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport ReceiptStatusError from \"../ReceiptStatusError.js\";\nimport Status from \"../Status.js\";\nimport TransactionReceiptQuery from \"./TransactionReceiptQuery.js\";\nimport TransactionRecordQuery from \"./TransactionRecordQuery.js\";\nimport AccountId from \"../account/AccountId.js\";\nimport TransactionId from \"./TransactionId.js\";\nimport * as hex from \"../encoding/hex.js\";\nimport { wait } from \"../util.js\";\n\n/**\n * @typedef {import(\"../client/Client.js\").default<*, *>} Client\n * @typedef {import(\"./Transaction.js\").default} Transaction\n * @typedef {import(\"./TransactionReceipt.js\").default} TransactionReceipt\n * @typedef {import(\"./TransactionRecord.js\").default} TransactionRecord\n * @typedef {import(\"../Signer.js\").Signer} Signer\n * @typedef {import(\"../logger/Logger.js\").default} Logger\n */\n\n/**\n * @typedef {object} TransactionResponseJSON\n * @property {string} nodeId\n * @property {string} transactionHash\n * @property {string} transactionId\n */\n\n/**\n * When the client sends the node a transaction of any kind, the node\n * replies with this, which simply says that the transaction passed\n * the pre-check (so the node will submit it to the network) or it failed\n * (so it won't). To learn the consensus result, the client should later\n * obtain a receipt (free), or can buy a more detailed record (not free).\n * <br>\n * See <a href=\"https://docs.hedera.com/guides/docs/hedera-api/miscellaneous/transactionresponse\">Hedera Documentation</a>\n */\nexport default class TransactionResponse {\n /**\n * @internal\n * @param {object} props\n * @param {AccountId} props.nodeId\n * @param {Uint8Array} props.transactionHash\n * @param {TransactionId} props.transactionId\n * @param {Transaction} [props.transaction]\n * @param {Logger | null} [props.logger]\n */\n constructor(props) {\n /** @readonly */\n this.nodeId = props.nodeId;\n\n /** @readonly */\n this.transactionHash = props.transactionHash;\n\n this.transactionId = props.transactionId;\n\n this.transaction = props.transaction;\n\n this.logger = props.logger;\n }\n\n /**\n * @param {TransactionResponseJSON} json\n * @returns {TransactionResponse}\n */\n static fromJSON(json) {\n return new TransactionResponse({\n nodeId: AccountId.fromString(json.nodeId),\n transactionHash: hex.decode(json.transactionHash),\n transactionId: TransactionId.fromString(json.transactionId),\n });\n }\n\n /**\n * @param {Client} client\n * @returns {Promise<TransactionReceipt>}\n */\n async getReceipt(client) {\n let receipt;\n try {\n receipt = await this.getReceiptQuery().execute(client);\n } catch (err) {\n if (\n err instanceof ReceiptStatusError &&\n err.status === Status.ThrottledAtConsensus\n ) {\n this.logger?.info(\"Transaction throttled at consensus\");\n // need to reset the transaction to its initial state before retrying\n return this._retryTransaction(client);\n }\n throw err;\n }\n\n if (\n receipt.status !== Status.Success &&\n receipt.status !== Status.FeeScheduleFilePartUploaded\n ) {\n throw new ReceiptStatusError({\n transactionReceipt: receipt,\n status: receipt.status,\n transactionId: this.transactionId,\n });\n }\n\n return receipt;\n }\n\n /**\n * getRecord is calling getReceipt and in case the receipt status code is not OK, only the receipt is returned.\n *\n * @param {Client} client\n * @returns {Promise<TransactionRecord>}\n */\n async getRecord(client) {\n await this.getReceipt(client);\n\n return this.getRecordQuery().execute(client);\n }\n\n /**\n * getVerboseRecord is calling getReceipt and in case the receipt status code is not OK, the record is returned.\n *\n * @param {Client} client\n * @returns {Promise<TransactionRecord>}\n */\n async getVerboseRecord(client) {\n try {\n // The receipt needs to be called in order to wait for transaction to be included in the consensus. Otherwise we are going to get \"DUPLICATE_TRANSACTION\".\n await this.getReceiptQuery().execute(client);\n return this.getRecordQuery().execute(client);\n } catch (e) {\n return this.getRecordQuery().execute(client);\n }\n }\n\n /**\n * @param {Signer} signer\n * @returns {Promise<TransactionReceipt>}\n */\n async getReceiptWithSigner(signer) {\n const receipt = await this.getReceiptQuery().executeWithSigner(signer);\n\n if (receipt.status !== Status.Success) {\n throw new ReceiptStatusError({\n transactionReceipt: receipt,\n status: receipt.status,\n transactionId: this.transactionId,\n });\n }\n\n return receipt;\n }\n\n /**\n * @param {Signer} signer\n * @returns {Promise<TransactionRecord>}\n */\n async getRecordWithSigner(signer) {\n await this.getReceiptWithSigner(signer);\n\n return this.getRecordQuery().executeWithSigner(signer);\n }\n\n /**\n * @returns {TransactionReceiptQuery}\n */\n getReceiptQuery() {\n return new TransactionReceiptQuery()\n .setTransactionId(this.transactionId)\n .setNodeAccountIds([this.nodeId]);\n }\n\n /**\n * @returns {TransactionRecordQuery}\n */\n getRecordQuery() {\n return new TransactionRecordQuery()\n .setTransactionId(this.transactionId)\n .setNodeAccountIds([this.nodeId]);\n }\n\n /**\n * @returns {TransactionResponseJSON}\n */\n toJSON() {\n return {\n nodeId: this.nodeId.toString(),\n transactionHash: hex.encode(this.transactionHash),\n transactionId: this.transactionId.toString(),\n };\n }\n\n /**\n *\n * @param {Client} client\n * @returns {Promise<TransactionReceipt>}\n */\n async _retryTransaction(client) {\n if (!this.transaction) {\n throw new Error(\n \"If you retry transaction you should have the transaction set\",\n );\n }\n\n if (\n client.operatorAccountId?.toString() !==\n this.transaction.transactionId?.accountId?.toString()\n ) {\n throw new Error(\n \"Retry mechanism is not supported when tx id is not generated by the operator account\",\n );\n }\n\n if (client.operatorAccountId === null) {\n throw new Error(\"Operator account is not set\");\n }\n\n const MAX_RETRIES = 5;\n const MAX_BACKOFF = 16000;\n let BACKOFF = 250; // milliseconds\n\n for (let i = 0; i < MAX_RETRIES; i++) {\n this.logger?.trace(`Transaction throttled, retry attempt ${i}`);\n this.transaction?._resetTransaction(client);\n if (\n this.transaction == null ||\n this.transaction.transactionId == null\n ) {\n throw new Error(\n \"Transaction or Transaction ID is null after reset\",\n );\n }\n // need to set the transactionId again in case we are doing getRecord afterwards\n this.transactionId = this.transaction.transactionId;\n if (i > 0) {\n // Wait with exponential backoff before retrying\n await wait(Math.min(BACKOFF, MAX_BACKOFF));\n BACKOFF *= 2; // Double the backoff for next retry\n }\n\n try {\n this.transaction._resetTransaction(client);\n const resp = await this.transaction.execute(client);\n\n const receipt = await new TransactionReceiptQuery()\n .setTransactionId(resp.transactionId)\n .setNodeAccountIds([resp.nodeId])\n .execute(client);\n\n if (receipt.status !== Status.ThrottledAtConsensus) {\n this.logger?.info(\n `Transaction throttle retry succeeded after attempt ${i}`,\n );\n return receipt;\n }\n } catch (err) {\n if (\n err instanceof ReceiptStatusError &&\n err.status === Status.ThrottledAtConsensus\n ) {\n this.logger?.info(\"Transaction throttled at consensus\");\n // Continue to next retry on error\n continue;\n }\n this.logger?.error(\n `An error occurred after throttle retry: ${err instanceof Error ? err.message : String(err)}`,\n );\n throw err;\n }\n }\n\n this.logger?.error(\n \"Transaction throttle retry failed after maximum attempts\",\n );\n throw new Error(\"Transaction retry failed after maximum attempts\");\n }\n\n /**\n * @returns {string}\n */\n toString() {\n return JSON.stringify(this.toJSON());\n }\n}\n"],"names":["TransactionResponse","constructor","props","this","nodeId","transactionHash","transactionId","transaction","logger","fromJSON","json","AccountId","fromString","hex.decode","TransactionId","getReceipt","client","receipt","getReceiptQuery","execute","err","ReceiptStatusError","status","Status","ThrottledAtConsensus","info","_retryTransaction","Success","FeeScheduleFilePartUploaded","transactionReceipt","getRecord","getRecordQuery","getVerboseRecord","e","getReceiptWithSigner","signer","executeWithSigner","getRecordWithSigner","TransactionReceiptQuery","setTransactionId","setNodeAccountIds","TransactionRecordQuery","toJSON","toString","hex.encode","Error","operatorAccountId","accountId","BACKOFF","i","trace","_resetTransaction","wait","Math","min","resp","error","message","String","JSON","stringify"],"mappings":"8TAoCe,MAAMA,EAUjB,WAAAC,CAAYC,GAERC,KAAKC,OAASF,EAAME,OAGpBD,KAAKE,gBAAkBH,EAAMG,gBAE7BF,KAAKG,cAAgBJ,EAAMI,cAE3BH,KAAKI,YAAcL,EAAMK,YAEzBJ,KAAKK,OAASN,EAAMM,MAC5B,CAMI,eAAOC,CAASC,GACZ,OAAO,IAAIV,EAAoB,CAC3BI,OAAQO,EAAUC,WAAWF,EAAKN,QAClCC,gBAAiBQ,EAAWH,EAAKL,iBACjCC,cAAeQ,EAAcF,WAAWF,EAAKJ,gBAEzD,CAMI,gBAAMS,CAAWC,GACb,IAAIC,EACJ,IACIA,QAAgBd,KAAKe,kBAAkBC,QAAQH,EAClD,CAAC,MAAOI,GACL,GACIA,aAAeC,GACfD,EAAIE,SAAWC,EAAOC,qBAItB,OAFArB,KAAKK,QAAQiB,KAAK,sCAEXtB,KAAKuB,kBAAkBV,GAElC,MAAMI,CAClB,CAEQ,GACIH,EAAQK,SAAWC,EAAOI,SAC1BV,EAAQK,SAAWC,EAAOK,4BAE1B,MAAM,IAAIP,EAAmB,CACzBQ,mBAAoBZ,EACpBK,OAAQL,EAAQK,OAChBhB,cAAeH,KAAKG,gBAI5B,OAAOW,CACf,CAQI,eAAMa,CAAUd,GAGZ,aAFMb,KAAKY,WAAWC,GAEfb,KAAK4B,iBAAiBZ,QAAQH,EAC7C,CAQI,sBAAMgB,CAAiBhB,GACnB,IAGI,aADMb,KAAKe,kBAAkBC,QAAQH,GAC9Bb,KAAK4B,iBAAiBZ,QAAQH,EACxC,CAAC,MAAOiB,GACL,OAAO9B,KAAK4B,iBAAiBZ,QAAQH,EACjD,CACA,CAMI,0BAAMkB,CAAqBC,GACvB,MAAMlB,QAAgBd,KAAKe,kBAAkBkB,kBAAkBD,GAE/D,GAAIlB,EAAQK,SAAWC,EAAOI,QAC1B,MAAM,IAAIN,EAAmB,CACzBQ,mBAAoBZ,EACpBK,OAAQL,EAAQK,OAChBhB,cAAeH,KAAKG,gBAI5B,OAAOW,CACf,CAMI,yBAAMoB,CAAoBF,GAGtB,aAFMhC,KAAK+B,qBAAqBC,GAEzBhC,KAAK4B,iBAAiBK,kBAAkBD,EACvD,CAKI,eAAAjB,GACI,OAAO,IAAIoB,GACNC,iBAAiBpC,KAAKG,eACtBkC,kBAAkB,CAACrC,KAAKC,QACrC,CAKI,cAAA2B,GACI,OAAO,IAAIU,GACNF,iBAAiBpC,KAAKG,eACtBkC,kBAAkB,CAACrC,KAAKC,QACrC,CAKI,MAAAsC,GACI,MAAO,CACHtC,OAAQD,KAAKC,OAAOuC,WACpBtC,gBAAiBuC,EAAWzC,KAAKE,iBACjCC,cAAeH,KAAKG,cAAcqC,WAE9C,CAOI,uBAAMjB,CAAkBV,GACpB,IAAKb,KAAKI,YACN,MAAM,IAAIsC,MACN,gEAIR,GACI7B,EAAO8B,mBAAmBH,aAC1BxC,KAAKI,YAAYD,eAAeyC,WAAWJ,WAE3C,MAAM,IAAIE,MACN,wFAIR,GAAiC,OAA7B7B,EAAO8B,kBACP,MAAM,IAAID,MAAM,+BAKpB,IAAIG,EAAU,IAEd,IAAK,IAAIC,EAAI,EAAGA,EAJI,EAIaA,IAAK,CAGlC,GAFA9C,KAAKK,QAAQ0C,MAAM,wCAAwCD,KAC3D9C,KAAKI,aAAa4C,kBAAkBnC,GAEZ,MAApBb,KAAKI,aAC6B,MAAlCJ,KAAKI,YAAYD,cAEjB,MAAM,IAAIuC,MACN,qDAIR1C,KAAKG,cAAgBH,KAAKI,YAAYD,cAClC2C,EAAI,UAEEG,EAAKC,KAAKC,IAAIN,EAlBR,OAmBZA,GAAW,GAGf,IACI7C,KAAKI,YAAY4C,kBAAkBnC,GACnC,MAAMuC,QAAapD,KAAKI,YAAYY,QAAQH,GAEtCC,QAAgB,IAAIqB,GACrBC,iBAAiBgB,EAAKjD,eACtBkC,kBAAkB,CAACe,EAAKnD,SACxBe,QAAQH,GAEb,GAAIC,EAAQK,SAAWC,EAAOC,qBAI1B,OAHArB,KAAKK,QAAQiB,KACT,sDAAsDwB,KAEnDhC,CAEd,CAAC,MAAOG,GACL,GACIA,aAAeC,GACfD,EAAIE,SAAWC,EAAOC,qBACxB,CACErB,KAAKK,QAAQiB,KAAK,sCAElB,QACpB,CAIgB,MAHAtB,KAAKK,QAAQgD,MACT,2CAA2CpC,aAAeyB,MAAQzB,EAAIqC,QAAUC,OAAOtC,MAErFA,CACtB,CACA,CAKQ,MAHAjB,KAAKK,QAAQgD,MACT,4DAEE,IAAIX,MAAM,kDACxB,CAKI,QAAAF,GACI,OAAOgB,KAAKC,UAAUzD,KAAKuC,SACnC"}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.asn1DecodeStringDer = exports.ASN1Decoder = void 0;
|
|
7
|
+
var _proto = require("@hashgraph/proto");
|
|
8
|
+
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
9
|
+
/**
|
|
10
|
+
* A class to decode ASN.1 encoded data, typically used for parsing cryptographic key data.
|
|
11
|
+
* @class
|
|
12
|
+
*/
|
|
13
|
+
class ASN1Decoder {
|
|
14
|
+
/**
|
|
15
|
+
* Creates a new ASN1Decoder instance.
|
|
16
|
+
* @param {Uint8Array|ArrayBuffer} data - The ASN.1 encoded data to decode.
|
|
17
|
+
*/
|
|
18
|
+
constructor(data) {
|
|
19
|
+
/**
|
|
20
|
+
* @private
|
|
21
|
+
* @type {Uint8Array}
|
|
22
|
+
*/
|
|
23
|
+
this.data = new Uint8Array(data);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @private
|
|
27
|
+
* @type {number}
|
|
28
|
+
*/
|
|
29
|
+
this.pos = 0;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @private
|
|
33
|
+
* @type {string[]}
|
|
34
|
+
*/
|
|
35
|
+
this.oids = [];
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @private
|
|
39
|
+
* @type {{[key: string]: string}}
|
|
40
|
+
*/
|
|
41
|
+
this.oidMap = {
|
|
42
|
+
"1.3.132.0.10": "ecdsa",
|
|
43
|
+
"1.3.101.112": "ed25519",
|
|
44
|
+
"1.2.840.10045.2.1": "pubkey"
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @private
|
|
49
|
+
* @type {boolean}
|
|
50
|
+
*/
|
|
51
|
+
this.isPublicKey = false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Reads the length field from the ASN.1 data.
|
|
56
|
+
* @private
|
|
57
|
+
* @returns {number} The length value.
|
|
58
|
+
*/
|
|
59
|
+
readLength() {
|
|
60
|
+
let length = this.data[this.pos++];
|
|
61
|
+
if (length & 0x80) {
|
|
62
|
+
let numBytes = length & 0x7f;
|
|
63
|
+
length = 0;
|
|
64
|
+
for (let i = 0; i < numBytes; i++) {
|
|
65
|
+
length = length << 8 | this.data[this.pos++];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return length;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Reads the type field from the ASN.1 data.
|
|
73
|
+
* @private
|
|
74
|
+
* @returns {number} The type value.
|
|
75
|
+
*/
|
|
76
|
+
readType() {
|
|
77
|
+
return this.data[this.pos++];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Reads an integer value from the ASN.1 data.
|
|
82
|
+
* @private
|
|
83
|
+
* @returns {{integer: number}} Object containing the integer value.
|
|
84
|
+
*/
|
|
85
|
+
readInteger() {
|
|
86
|
+
const length = this.readLength();
|
|
87
|
+
let value = 0;
|
|
88
|
+
for (let i = 0; i < length; i++) {
|
|
89
|
+
value = value << 8 | this.data[this.pos++];
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
integer: value
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Reads an octet string from the ASN.1 data.
|
|
98
|
+
* @private
|
|
99
|
+
* @returns {{pkey: Uint8Array}} Object containing the private key data.
|
|
100
|
+
*/
|
|
101
|
+
readOctetString() {
|
|
102
|
+
const length = this.readLength();
|
|
103
|
+
const value = this.data.slice(this.pos, this.pos + length);
|
|
104
|
+
this.pos += length;
|
|
105
|
+
return {
|
|
106
|
+
pkey: value
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Reads a bit string from the ASN.1 data.
|
|
112
|
+
* @private
|
|
113
|
+
* @returns {{unusedBits: number, pubkey: Uint8Array}} Object containing the public key data and unused bits.
|
|
114
|
+
*/
|
|
115
|
+
readBitString() {
|
|
116
|
+
const length = this.readLength();
|
|
117
|
+
const unusedBits = this.data[this.pos++]; // First byte indicates the number of unused bits
|
|
118
|
+
const value = this.data.slice(this.pos, this.pos + length - 1);
|
|
119
|
+
this.pos += length - 1;
|
|
120
|
+
return {
|
|
121
|
+
unusedBits,
|
|
122
|
+
pubkey: value
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Reads an object identifier from the ASN.1 data.
|
|
128
|
+
* @private
|
|
129
|
+
* @returns {{oid: string}} Object containing the OID as a string.
|
|
130
|
+
*/
|
|
131
|
+
readObjectIdentifier() {
|
|
132
|
+
const length = this.readLength();
|
|
133
|
+
const endPos = this.pos + length;
|
|
134
|
+
const oid = [];
|
|
135
|
+
let value = 0;
|
|
136
|
+
|
|
137
|
+
// The first byte contains the first two components
|
|
138
|
+
const firstByte = this.data[this.pos++];
|
|
139
|
+
oid.push(Math.floor(firstByte / 40));
|
|
140
|
+
oid.push(firstByte % 40);
|
|
141
|
+
while (this.pos < endPos) {
|
|
142
|
+
const byte = this.data[this.pos++];
|
|
143
|
+
value = value << 7 | byte & 0x7f;
|
|
144
|
+
if (!(byte & 0x80)) {
|
|
145
|
+
oid.push(value);
|
|
146
|
+
value = 0;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const oidStr = oid.join(".");
|
|
150
|
+
this.oids.push(oidStr);
|
|
151
|
+
return {
|
|
152
|
+
oid: oidStr
|
|
153
|
+
}; // Return OID as a string
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Gets the list of object identifiers found during decoding.
|
|
158
|
+
* @returns {string[]} Array of OID strings.
|
|
159
|
+
*/
|
|
160
|
+
getOids() {
|
|
161
|
+
return this.oids;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Gets the key types corresponding to the OIDs found during decoding.
|
|
166
|
+
* @returns {string[]} Array of key type strings.
|
|
167
|
+
*/
|
|
168
|
+
getOidKeyTypes() {
|
|
169
|
+
return this.oids.map(oid => this.oidMap[oid] || "unknown");
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Reads a sequence from the ASN.1 data.
|
|
174
|
+
* @private
|
|
175
|
+
* @returns {Array<any>} Array of decoded items in the sequence.
|
|
176
|
+
*/
|
|
177
|
+
readSequence() {
|
|
178
|
+
const length = this.readLength();
|
|
179
|
+
const endPos = this.pos + length;
|
|
180
|
+
const items = []; // this would better be map or obj
|
|
181
|
+
while (this.pos < endPos) {
|
|
182
|
+
items.push(this.read());
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
186
|
+
return items;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Reads and decodes the next ASN.1 element.
|
|
191
|
+
* @returns {any} The decoded ASN.1 element.
|
|
192
|
+
* @throws {Error} If an unsupported type is encountered.
|
|
193
|
+
*/
|
|
194
|
+
read() {
|
|
195
|
+
const type = this.readType();
|
|
196
|
+
switch (type) {
|
|
197
|
+
case 0x02:
|
|
198
|
+
// INTEGER
|
|
199
|
+
return this.readInteger();
|
|
200
|
+
case 0x03:
|
|
201
|
+
// BIT STRING FOR PUBKEY
|
|
202
|
+
return this.readBitString();
|
|
203
|
+
case 0x04:
|
|
204
|
+
// OCTET STRING FOR PKEY
|
|
205
|
+
return this.readOctetString();
|
|
206
|
+
case 0x06:
|
|
207
|
+
// OBJECT IDENTIFIER FOR CURVE TYPE
|
|
208
|
+
return this.readObjectIdentifier();
|
|
209
|
+
case 0x30:
|
|
210
|
+
// SEQUENCE
|
|
211
|
+
return this.readSequence();
|
|
212
|
+
case 0xa0:
|
|
213
|
+
// NODE TAG COULD BE TREATED AS SEQUENCE
|
|
214
|
+
return this.readSequence();
|
|
215
|
+
case 0xa1:
|
|
216
|
+
// NODE TAG COULD BE TREATED AS SEQUENCE
|
|
217
|
+
return this.readSequence();
|
|
218
|
+
default:
|
|
219
|
+
throw new Error(`Unsupported type: ${type}`);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Checks if the decoded key is a public key.
|
|
225
|
+
* @returns {boolean} True if the key is a public key, false otherwise.
|
|
226
|
+
*/
|
|
227
|
+
isPublicKeyType() {
|
|
228
|
+
return this.isPublicKey;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Processes a hexadecimal string representation of an ASN.1 encoded key.
|
|
234
|
+
* Checks if the input is a list of keys in hexadecimal format. If not, it decodes
|
|
235
|
+
* the ASN.1 data to extract key types and identify if the key is a public key.
|
|
236
|
+
*
|
|
237
|
+
* @param {string} keyString - The hexadecimal string representation of the ASN.1 encoded key.
|
|
238
|
+
* @returns {{keyTypes: string[], isPublicKey: boolean, isKeyListHex: boolean}} Object containing information about the decoded key.
|
|
239
|
+
*/
|
|
240
|
+
exports.ASN1Decoder = ASN1Decoder;
|
|
241
|
+
const asn1DecodeStringDer = keyString => {
|
|
242
|
+
const isKeyListHex = isHexKeyList(keyString);
|
|
243
|
+
if (isKeyListHex) {
|
|
244
|
+
return {
|
|
245
|
+
keyTypes: [],
|
|
246
|
+
isPublicKey: false,
|
|
247
|
+
isKeyListHex
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
const signerData = Uint8Array.from(Buffer.from(keyString, "hex"));
|
|
251
|
+
const decoder = new ASN1Decoder(signerData);
|
|
252
|
+
decoder.read();
|
|
253
|
+
const keyTypes = decoder.getOidKeyTypes();
|
|
254
|
+
const isPublicKey = decoder.isPublicKeyType();
|
|
255
|
+
return {
|
|
256
|
+
keyTypes,
|
|
257
|
+
isPublicKey,
|
|
258
|
+
isKeyListHex: false
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Checks if the input is a list of keys in hexadecimal format.
|
|
264
|
+
* @param {string} hexString - The hexadecimal string representation of the ASN.1 encoded key.
|
|
265
|
+
* @returns {boolean} True if the key is a public key, false otherwise.
|
|
266
|
+
*/
|
|
267
|
+
exports.asn1DecodeStringDer = asn1DecodeStringDer;
|
|
268
|
+
const isHexKeyList = hexString => {
|
|
269
|
+
try {
|
|
270
|
+
const binaryData = Buffer.from(hexString, "hex");
|
|
271
|
+
const decodedData = _proto.proto.KeyList.decode(binaryData);
|
|
272
|
+
return !!decodedData.keys && Array.isArray(decodedData.keys);
|
|
273
|
+
} catch (error) {
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
276
|
+
};
|