@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,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This method is called by most entity ID constructors. It's purpose is to
|
|
3
|
+
* deduplicate the constuctors.
|
|
4
|
+
*
|
|
5
|
+
* @param {number | Long | IEntityId} props
|
|
6
|
+
* @param {(number | null | Long)=} realmOrNull
|
|
7
|
+
* @param {(number | null | Long)=} numOrNull
|
|
8
|
+
* @returns {IEntityIdResult}
|
|
9
|
+
*/
|
|
10
|
+
export function constructor(props: number | Long | IEntityId, realmOrNull?: (number | null | Long) | undefined, numOrNull?: (number | null | Long) | undefined): IEntityIdResult;
|
|
11
|
+
/**
|
|
12
|
+
* A simple comparison function for comparing entity IDs
|
|
13
|
+
*
|
|
14
|
+
* @param {[Long, Long, Long]} a
|
|
15
|
+
* @param {[Long, Long, Long]} b
|
|
16
|
+
* @returns {number}
|
|
17
|
+
*/
|
|
18
|
+
export function compare(a: [Long, Long, Long], b: [Long, Long, Long]): number;
|
|
19
|
+
/**
|
|
20
|
+
* This type is part of the entity ID checksums feature which
|
|
21
|
+
* is responsible for checking if an entity ID was created on
|
|
22
|
+
* the same ledger ID as the client is currently using.
|
|
23
|
+
*
|
|
24
|
+
* @typedef {object} ParseAddressResult
|
|
25
|
+
* @property {number} status
|
|
26
|
+
* @property {Long} [num1]
|
|
27
|
+
* @property {Long} [num2]
|
|
28
|
+
* @property {Long} [num3]
|
|
29
|
+
* @property {string} [correctChecksum]
|
|
30
|
+
* @property {string} [givenChecksum]
|
|
31
|
+
* @property {string} [noChecksumFormat]
|
|
32
|
+
* @property {string} [withChecksumFormat]
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* @param {string} text
|
|
36
|
+
* @returns {IEntityIdParts}
|
|
37
|
+
*/
|
|
38
|
+
export function fromStringSplitter(text: string): IEntityIdParts;
|
|
39
|
+
/**
|
|
40
|
+
* @param {string} text
|
|
41
|
+
* @returns {IEntityIdResultWithChecksum}
|
|
42
|
+
*/
|
|
43
|
+
export function fromString(text: string): IEntityIdResultWithChecksum;
|
|
44
|
+
/**
|
|
45
|
+
* Return the shard, realm, and num from a solidity address.
|
|
46
|
+
*
|
|
47
|
+
* Solidity addresses are 20 bytes long and hex encoded, where the first 4
|
|
48
|
+
* bytes represent the shard, the next 8 bytes represent the realm, and
|
|
49
|
+
* the last 8 bytes represent the num. All in Big Endian format
|
|
50
|
+
*
|
|
51
|
+
* @param {string} address
|
|
52
|
+
* @returns {[Long, Long, Long]}
|
|
53
|
+
*/
|
|
54
|
+
export function fromSolidityAddress(address: string): [Long, Long, Long];
|
|
55
|
+
/**
|
|
56
|
+
* Parse an EVM address and return shard, realm, entity num, and optional EVM address.
|
|
57
|
+
*
|
|
58
|
+
* For long zero addresses (first 12 bytes are zeros): returns [shard, realm, entityNum, null]
|
|
59
|
+
* For regular EVM addresses: returns [shard, realm, 0, EvmAddress]
|
|
60
|
+
*
|
|
61
|
+
* @param {Long | number} shard - The shard number to use
|
|
62
|
+
* @param {Long | number} realm - The realm number to use
|
|
63
|
+
* @param {string} address - The EVM address to parse (with or without 0x prefix)
|
|
64
|
+
* @returns {[Long, Long, Long, EvmAddress | null]} - [shard, realm, entityNum, evmAddressOrNull]
|
|
65
|
+
*/
|
|
66
|
+
export function fromEvmAddress(shard: Long | number, realm: Long | number, address: string): [Long, Long, Long, EvmAddress | null];
|
|
67
|
+
/**
|
|
68
|
+
* Convert shard, realm, and num into a solidity address.
|
|
69
|
+
*
|
|
70
|
+
* See `fromSolidityAddress()` for more documentation.
|
|
71
|
+
*
|
|
72
|
+
* @param {[Long,Long,Long] | [number,number,number]} address
|
|
73
|
+
* @returns {string}
|
|
74
|
+
*/
|
|
75
|
+
export function toSolidityAddress(address: [Long, Long, Long] | [number, number, number]): string;
|
|
76
|
+
/**
|
|
77
|
+
* @overload
|
|
78
|
+
* @param {Uint8Array} evmAddressBytes - EVM address bytes to convert to hex
|
|
79
|
+
* @returns {string}
|
|
80
|
+
*/
|
|
81
|
+
export function toEvmAddress(evmAddressBytes: Uint8Array): string;
|
|
82
|
+
/**
|
|
83
|
+
* @overload
|
|
84
|
+
* @param {Long} accountNum - Account number to convert to long-zero EVM address
|
|
85
|
+
* @returns {string}
|
|
86
|
+
*/
|
|
87
|
+
export function toEvmAddress(accountNum: Long): string;
|
|
88
|
+
/**
|
|
89
|
+
* Parse the address string addr and return an object with the results (8 fields).
|
|
90
|
+
* The first four fields are numbers, which could be implemented as signed 32 bit
|
|
91
|
+
* integers, and the last four are strings.
|
|
92
|
+
*
|
|
93
|
+
* status; //the status of the parsed address
|
|
94
|
+
* // 0 = syntax error
|
|
95
|
+
* // 1 = an invalid with-checksum address (bad checksum)
|
|
96
|
+
* // 2 = a valid no-checksum address
|
|
97
|
+
* // 3 = a valid with-checksum address
|
|
98
|
+
* num1; //the 3 numbers in the address, such as 1.2.3, with leading zeros removed
|
|
99
|
+
* num2;
|
|
100
|
+
* num3;
|
|
101
|
+
* correctchecksum; //the correct checksum
|
|
102
|
+
* givenChecksum; //the checksum in the address that was parsed
|
|
103
|
+
* noChecksumFormat; //the address in no-checksum format
|
|
104
|
+
* withChecksumFormat; //the address in with-checksum format
|
|
105
|
+
*
|
|
106
|
+
* @param {Uint8Array} ledgerId
|
|
107
|
+
* @param {string} addr
|
|
108
|
+
* @returns {ParseAddressResult}
|
|
109
|
+
*/
|
|
110
|
+
export function _parseAddress(ledgerId: Uint8Array, addr: string): ParseAddressResult;
|
|
111
|
+
/**
|
|
112
|
+
* Given an address like "0.0.123", return a checksum like "laujm"
|
|
113
|
+
*
|
|
114
|
+
* @param {Uint8Array} ledgerId
|
|
115
|
+
* @param {string} addr
|
|
116
|
+
* @returns {string}
|
|
117
|
+
*/
|
|
118
|
+
export function _checksum(ledgerId: Uint8Array, addr: string): string;
|
|
119
|
+
/**
|
|
120
|
+
* Validate an entity ID checksum against a client
|
|
121
|
+
*
|
|
122
|
+
* @param {Long} shard
|
|
123
|
+
* @param {Long} realm
|
|
124
|
+
* @param {Long} num
|
|
125
|
+
* @param {string | null} checksum
|
|
126
|
+
* @param {Client} client
|
|
127
|
+
*/
|
|
128
|
+
export function validateChecksum(shard: Long, realm: Long, num: Long, checksum: string | null, client: Client): void;
|
|
129
|
+
/**
|
|
130
|
+
* Stringify the entity ID with a checksum.
|
|
131
|
+
*
|
|
132
|
+
* @param {string} string
|
|
133
|
+
* @param {Client} client
|
|
134
|
+
* @returns {string}
|
|
135
|
+
*/
|
|
136
|
+
export function toStringWithChecksum(string: string, client: Client): string;
|
|
137
|
+
/**
|
|
138
|
+
* Deserialize the alias to public key.
|
|
139
|
+
* Alias is created from ed25519 or ECDSASecp256k1 types of accounts. If hollow account is used, the alias is created from evm address.
|
|
140
|
+
* For hollow accounts, please use aliasToEvmAddress.
|
|
141
|
+
*
|
|
142
|
+
* @param {string} alias
|
|
143
|
+
* @returns {PublicKey | null}
|
|
144
|
+
*/
|
|
145
|
+
export function aliasToPublicKey(alias: string): PublicKey | null;
|
|
146
|
+
/**
|
|
147
|
+
* Deserialize the alias to evm address.
|
|
148
|
+
* Alias is created from hollow account.
|
|
149
|
+
* For ed25519 or ECDSASecp256k1 accounts, please use aliasToPublicKey.
|
|
150
|
+
*
|
|
151
|
+
* @param {string} alias
|
|
152
|
+
* @returns {string | null}
|
|
153
|
+
*/
|
|
154
|
+
export function aliasToEvmAddress(alias: string): string | null;
|
|
155
|
+
/**
|
|
156
|
+
* Serialize the public key to alias.
|
|
157
|
+
* Alias is created from ed25519 or ECDSASecp256k1 types of accounts. If hollow account is used, the alias is created from evm address.
|
|
158
|
+
*
|
|
159
|
+
* @param {string | PublicKey} publicKey
|
|
160
|
+
* @returns {string | null}
|
|
161
|
+
*/
|
|
162
|
+
export function publicKeyToAlias(publicKey: string | PublicKey): string | null;
|
|
163
|
+
/**
|
|
164
|
+
* This type is part of the entity ID checksums feature which
|
|
165
|
+
* is responsible for checking if an entity ID was created on
|
|
166
|
+
* the same ledger ID as the client is currently using.
|
|
167
|
+
*/
|
|
168
|
+
export type ParseAddressResult = {
|
|
169
|
+
status: number;
|
|
170
|
+
num1?: Long | undefined;
|
|
171
|
+
num2?: Long | undefined;
|
|
172
|
+
num3?: Long | undefined;
|
|
173
|
+
correctChecksum?: string | undefined;
|
|
174
|
+
givenChecksum?: string | undefined;
|
|
175
|
+
noChecksumFormat?: string | undefined;
|
|
176
|
+
withChecksumFormat?: string | undefined;
|
|
177
|
+
};
|
|
178
|
+
export type Client = import("./client/Client.js").default<any, any>;
|
|
179
|
+
export type IEntityId = {
|
|
180
|
+
num: number | Long;
|
|
181
|
+
shard?: (number | Long) | undefined;
|
|
182
|
+
realm?: (number | Long) | undefined;
|
|
183
|
+
};
|
|
184
|
+
export type IEntityIdResult = {
|
|
185
|
+
shard: Long;
|
|
186
|
+
realm: Long;
|
|
187
|
+
num: Long;
|
|
188
|
+
};
|
|
189
|
+
export type IEntityIdParts = {
|
|
190
|
+
shard: string | null;
|
|
191
|
+
realm: string | null;
|
|
192
|
+
numOrHex: string;
|
|
193
|
+
checksum: string | null;
|
|
194
|
+
};
|
|
195
|
+
export type IEntityIdResultWithChecksum = {
|
|
196
|
+
shard: Long;
|
|
197
|
+
realm: Long;
|
|
198
|
+
num: Long;
|
|
199
|
+
checksum: string | null;
|
|
200
|
+
};
|
|
201
|
+
import Long from "long";
|
|
202
|
+
import EvmAddress from "./EvmAddress.js";
|
|
203
|
+
import PublicKey from "./PublicKey.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"long";import{isHexString as r,decode as t,encode as n}from"./encoding/hex.js";import o from"./BadEntityIdError.js";import{isLongZeroAddress as l,safeView as i,convertToNumber as s}from"./util.js";import a from"./base32.js";import*as u from"@hashgraph/proto";import c from"./PublicKey.js";import{arrayify as m}from"@ethersproject/bytes";import f from"./EvmAddress.js";const h=/"^(0|(?:[1-9]\\d*))\\.(0|(?:[1-9]\\d*))\\.(0|(?:[1-9]\\d*))(?:-([a-z]{5}))?$/,d=/^(\d+)(?:\.(\d+)\.([a-fA-F0-9]+))?(?:-([a-z]{5}))?$/;function g(r,t,n){if(null==t&&null!=n||null!=t&&null==n)throw new Error("invalid entity ID");const[o,l,i]="number"==typeof r||e.isLong(r)?[null!=n?e.fromValue(r):e.ZERO,null!=t?e.fromValue(t):e.ZERO,null!=n?e.fromValue(n):e.fromValue(r)]:[null!=r.shard?e.fromValue(r.shard):e.ZERO,null!=r.realm?e.fromValue(r.realm):e.ZERO,e.fromValue(r.num)];if(o.isNegative()||l.isNegative()||i.isNegative())throw new Error("negative numbers are not allowed in IDs");return{shard:o,realm:l,num:i}}function w(e,r){let t=e[0].compare(r[0]);return 0!=t?t:(t=e[1].compare(r[1]),0!=t?t:e[2].compare(r[2]))}function y(e){const r=d.exec(e);if(null==r)throw new Error(`failed to parse entity id: ${e}`);return null==r[2]&&null==r[3]?{shard:"0",realm:"0",numOrHex:r[1],checksum:r[4]}:{shard:r[1],realm:r[2],numOrHex:r[3],checksum:r[4]}}function p(r){const t=y(r);if(Number.isNaN(t.shard)||Number.isNaN(t.realm)||Number.isNaN(t.numOrHex))throw new Error("invalid format for entity ID");return{shard:null!=t.shard?e.fromString(t.shard):e.ZERO,realm:null!=t.realm?e.fromString(t.realm):e.ZERO,num:e.fromString(t.numOrHex),checksum:t.checksum}}function E(r){const n=r.startsWith("0x")?t(r.slice(2)):t(r);if(20!==n.length)throw new Error(`Invalid hex encoded solidity address length:\n expected length 40, got length ${r.length}`);return[e.fromBytesBE([0,0,0,0,...n.slice(0,4)]),e.fromBytesBE(Array.from(n.slice(4,12))),e.fromBytesBE(Array.from(n.slice(12,20)))]}function S(n,o,i){if(!r(i))throw new Error(`Invalid EVM address hex string: ${i}`);const s=i.startsWith("0x")?t(i.slice(2)):t(i);if(20!==s.length)throw new Error(`Invalid hex encoded evm address length:\n expected length 20, got length ${i.length}`);let a=e.ZERO;return l(s)&&(a=e.fromBytesBE(Array.from(s.slice(12,20)))),[n instanceof e?n:e.fromNumber(n),o instanceof e?o:e.fromNumber(o),a,a.isZero()?f.fromBytes(s):null]}function x(e){const r=new Uint8Array(20),t=i(r),[o,l,a]=e;return t.setUint32(0,s(o)),t.setUint32(8,s(l)),t.setUint32(16,s(a)),n(r)}function k(e){if(e instanceof Uint8Array)return n(e);const r=e,t=new Uint8Array(20);return i(t).setUint32(16,s(r)),n(t)}function A(r,t){let n=h.exec(t);if(null===n){return{status:0}}let o=[e.fromString(n[1]),e.fromString(n[2]),e.fromString(n[3])],l=`${o[0].toString()}.${o[1].toString()}.${o[2].toString()}`,i=$(r,l);return{status:void 0===n[4]?2:i==n[4]?3:1,num1:o[0],num2:o[1],num3:o[2],givenChecksum:n[4],correctChecksum:i,noChecksumFormat:l,withChecksumFormat:`${l}-${i}`}}function $(e,r){let t="",n=[],o=0,l=0,i=0,s=0,a=0;const u=11881376,c="a".charCodeAt(0);let m=new Uint8Array(e.length+6);m.set(e,0),m.set([0,0,0,0,0,0],e.length);for(let e=0;e<r.length;e++)n.push("."===r[e]?10:parseInt(r[e],10));for(let e=0;e<n.length;e++)i=(31*i+n[e])%17576,e%2==0?o=(o+n[e])%11:l=(l+n[e])%11;for(let e=0;e<m.length;e++)s=(31*s+m[e])%u;a=(17576*(11*(r.length%5*11+o)+l)+i+s)%u,a=1000003*a%u;for(let e=0;e<5;e++)t=String.fromCharCode(c+a%26)+t,a/=26;return t}function b(e,r,t,n,l){if(null==l._network._ledgerId||null==n)return;const i=$(l._network._ledgerId._ledgerId,`${e.toString()}.${r.toString()}.${t.toString()}`);if(n!=i)throw new o(e,r,t,n,i)}function v(e,r){if(null==r)throw new Error("client cannot be null");if(null==r._network._ledgerId)throw new Error("cannot calculate checksum with a client that does not contain a recognzied ledger ID");return`${e}-${$(r._network._ledgerId._ledgerId,e)}`}function I(e){const r=a.decode(e);if(!r)return null;let t;try{t=u.proto.Key.decode(r)}catch(e){throw new Error("The alias is created with hollow account. Please use aliasToEvmAddress!")}return null!=t.ed25519&&t.ed25519.byteLength>0?c.fromBytes(t.ed25519):null!=t.ECDSASecp256k1&&t.ECDSASecp256k1.byteLength>0?c.fromBytes(t.ECDSASecp256k1):null}function N(e){const r=a.decode(e);if(!r)return null;try{throw u.proto.Key.decode(r),new Error("The alias is created with ed25519 or ECDSASecp256k1 account. Please use aliasToPublicKey!")}catch(e){return function(e){var r="0x";return e.forEach((function(e){r+=("0"+(255&e).toString(16)).slice(-2)})),r}(r)}}function _(e){if("string"==typeof e&&(e.startsWith("0x")&&42==e.length||40==e.length)){e.startsWith("0x")||(e=`0x${e}`);const r=m(e);return r?a.encode(r):null}const r="string"==typeof e?c.fromString(e):e;let t=r.toStringRaw(),n="";"secp256k1"===r._key._type&&(n="0x3A21"),"ED25519"===r._key._type&&(n="0x1220"),t.startsWith("0x")||(t=`0x${t}`);const o=m(n),l=m(t),i=(s=o,u=l,(f=new Uint8Array(s.byteLength+u.byteLength)).set(new Uint8Array(s),0),f.set(new Uint8Array(u),s.byteLength),f);var s,u,f;return a.encode(i)}export{$ as _checksum,A as _parseAddress,N as aliasToEvmAddress,I as aliasToPublicKey,w as compare,g as constructor,S as fromEvmAddress,E as fromSolidityAddress,p as fromString,y as fromStringSplitter,_ as publicKeyToAlias,k as toEvmAddress,x as toSolidityAddress,v as toStringWithChecksum,b as validateChecksum};
|
|
2
|
+
//# sourceMappingURL=EntityIdHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityIdHelper.js","sources":["../src/EntityIdHelper.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Long from \"long\";\nimport * as hex from \"./encoding/hex.js\";\nimport BadEntityIdError from \"./BadEntityIdError.js\";\nimport * as util from \"./util.js\";\nimport base32 from \"./base32.js\";\nimport * as HieroProto from \"@hashgraph/proto\";\nimport PublicKey from \"./PublicKey.js\";\nimport { arrayify } from \"@ethersproject/bytes\";\nimport EvmAddress from \"./EvmAddress.js\";\n\n/**\n * @typedef {import(\"./client/Client.js\").default<*, *>} Client\n */\n\n/**\n * @typedef {object} IEntityId\n * @property {number | Long} num\n * @property {(number | Long)=} shard\n * @property {(number | Long)=} realm\n */\n\n/**\n * @typedef {object} IEntityIdResult\n * @property {Long} shard\n * @property {Long} realm\n * @property {Long} num\n */\n\n/**\n * @typedef {object} IEntityIdParts\n * @property {string?} shard\n * @property {string?} realm\n * @property {string} numOrHex\n * @property {string?} checksum\n */\n\n/**\n * @typedef {object} IEntityIdResultWithChecksum\n * @property {Long} shard\n * @property {Long} realm\n * @property {Long} num\n * @property {string | null} checksum\n */\n\nconst regex =\n /\"^(0|(?:[1-9]\\\\d*))\\\\.(0|(?:[1-9]\\\\d*))\\\\.(0|(?:[1-9]\\\\d*))(?:-([a-z]{5}))?$/;\n\n/**\n * This regex supports entity IDs\n * - as stand alone nubmers\n * - as shard.realm.num\n * - as shard.realm.hex\n * - can optionally provide checksum for any of the above\n */\nconst ENTITY_ID_REGEX = /^(\\d+)(?:\\.(\\d+)\\.([a-fA-F0-9]+))?(?:-([a-z]{5}))?$/;\n\n/**\n * @description The length of an EVM address in bytes.\n */\nconst EVM_ADDRESS_LENGTH = 20;\n\n/**\n * @description The length of the long-zero prefix in bytes.\n */\nconst LONG_ZERO_PREFIX_LENGTH = 12;\n\n/**\n * @description The offset of the entity number in the EVM address.\n */\nconst ENTITY_NUM_OFFSET = 16;\n\n/**\n * This method is called by most entity ID constructors. It's purpose is to\n * deduplicate the constuctors.\n *\n * @param {number | Long | IEntityId} props\n * @param {(number | null | Long)=} realmOrNull\n * @param {(number | null | Long)=} numOrNull\n * @returns {IEntityIdResult}\n */\nexport function constructor(props, realmOrNull, numOrNull) {\n // Make sure either both the second and third parameter are\n // set or not set; we shouldn't have one set, but the other not set.\n //\n //NOSONAR\n if (\n (realmOrNull == null && numOrNull != null) ||\n (realmOrNull != null && numOrNull == null)\n ) {\n throw new Error(\"invalid entity ID\");\n }\n\n // If the first parameter is a number then we need to convert the\n // first, second, and third parameters into numbers. Otherwise,\n // we should look at the fields `shard`, `realm`, and `num` on\n // `props`\n const [shard, realm, num] =\n typeof props === \"number\" || Long.isLong(props)\n ? [\n numOrNull != null\n ? Long.fromValue(/** @type {Long | number} */ (props))\n : Long.ZERO,\n realmOrNull != null ? Long.fromValue(realmOrNull) : Long.ZERO,\n numOrNull != null\n ? Long.fromValue(numOrNull)\n : Long.fromValue(/** @type {Long | number} */ (props)),\n ]\n : [\n props.shard != null ? Long.fromValue(props.shard) : Long.ZERO,\n props.realm != null ? Long.fromValue(props.realm) : Long.ZERO,\n Long.fromValue(props.num),\n ];\n\n // Make sure none of the numbers are negative\n if (shard.isNegative() || realm.isNegative() || num.isNegative()) {\n throw new Error(\"negative numbers are not allowed in IDs\");\n }\n\n return {\n shard,\n realm,\n num,\n };\n}\n\n/**\n * A simple comparison function for comparing entity IDs\n *\n * @param {[Long, Long, Long]} a\n * @param {[Long, Long, Long]} b\n * @returns {number}\n */\nexport function compare(a, b) {\n let comparison = a[0].compare(b[0]);\n if (comparison != 0) {\n return comparison;\n }\n\n comparison = a[1].compare(b[1]);\n if (comparison != 0) {\n return comparison;\n }\n\n return a[2].compare(b[2]);\n}\n\n/**\n * This type is part of the entity ID checksums feature which\n * is responsible for checking if an entity ID was created on\n * the same ledger ID as the client is currently using.\n *\n * @typedef {object} ParseAddressResult\n * @property {number} status\n * @property {Long} [num1]\n * @property {Long} [num2]\n * @property {Long} [num3]\n * @property {string} [correctChecksum]\n * @property {string} [givenChecksum]\n * @property {string} [noChecksumFormat]\n * @property {string} [withChecksumFormat]\n */\n\n/**\n * @param {string} text\n * @returns {IEntityIdParts}\n */\nexport function fromStringSplitter(text) {\n const match = ENTITY_ID_REGEX.exec(text);\n\n if (match == null) {\n throw new Error(`failed to parse entity id: ${text}`);\n }\n\n if (match[2] == null && match[3] == null) {\n return {\n shard: \"0\",\n realm: \"0\",\n numOrHex: match[1],\n checksum: match[4],\n };\n } else {\n return {\n shard: match[1],\n realm: match[2],\n numOrHex: match[3],\n checksum: match[4],\n };\n }\n}\n\n/**\n * @param {string} text\n * @returns {IEntityIdResultWithChecksum}\n */\nexport function fromString(text) {\n const result = fromStringSplitter(text);\n\n if (\n Number.isNaN(result.shard) ||\n Number.isNaN(result.realm) ||\n Number.isNaN(result.numOrHex)\n ) {\n throw new Error(\"invalid format for entity ID\");\n }\n\n return {\n shard: result.shard != null ? Long.fromString(result.shard) : Long.ZERO,\n realm: result.realm != null ? Long.fromString(result.realm) : Long.ZERO,\n num: Long.fromString(result.numOrHex),\n checksum: result.checksum,\n };\n}\n\n/**\n * Return the shard, realm, and num from a solidity address.\n *\n * Solidity addresses are 20 bytes long and hex encoded, where the first 4\n * bytes represent the shard, the next 8 bytes represent the realm, and\n * the last 8 bytes represent the num. All in Big Endian format\n *\n * @param {string} address\n * @returns {[Long, Long, Long]}\n */\nexport function fromSolidityAddress(address) {\n const addr = address.startsWith(\"0x\")\n ? hex.decode(address.slice(2))\n : hex.decode(address);\n\n if (addr.length !== EVM_ADDRESS_LENGTH) {\n throw new Error(`Invalid hex encoded solidity address length:\n expected length 40, got length ${address.length}`);\n }\n\n const shard = Long.fromBytesBE([0, 0, 0, 0, ...addr.slice(0, 4)]);\n const realm = Long.fromBytesBE(Array.from(addr.slice(4, 12)));\n const num = Long.fromBytesBE(Array.from(addr.slice(12, 20)));\n\n return [shard, realm, num];\n}\n\n/**\n * Parse an EVM address and return shard, realm, entity num, and optional EVM address.\n *\n * For long zero addresses (first 12 bytes are zeros): returns [shard, realm, entityNum, null]\n * For regular EVM addresses: returns [shard, realm, 0, EvmAddress]\n *\n * @param {Long | number} shard - The shard number to use\n * @param {Long | number} realm - The realm number to use\n * @param {string} address - The EVM address to parse (with or without 0x prefix)\n * @returns {[Long, Long, Long, EvmAddress | null]} - [shard, realm, entityNum, evmAddressOrNull]\n */\nexport function fromEvmAddress(shard, realm, address) {\n if (!hex.isHexString(address)) {\n throw new Error(`Invalid EVM address hex string: ${address}`);\n }\n\n const addr = address.startsWith(\"0x\")\n ? hex.decode(address.slice(2))\n : hex.decode(address);\n\n if (addr.length !== EVM_ADDRESS_LENGTH) {\n throw new Error(`Invalid hex encoded evm address length:\n expected length ${EVM_ADDRESS_LENGTH}, got length ${address.length}`);\n }\n\n let num = Long.ZERO;\n\n if (util.isLongZeroAddress(addr)) {\n num = Long.fromBytesBE(\n Array.from(addr.slice(LONG_ZERO_PREFIX_LENGTH, EVM_ADDRESS_LENGTH)),\n );\n }\n\n let shardLong = shard instanceof Long ? shard : Long.fromNumber(shard);\n let realmLong = realm instanceof Long ? realm : Long.fromNumber(realm);\n\n return [\n shardLong,\n realmLong,\n num,\n num.isZero() ? EvmAddress.fromBytes(addr) : null,\n ];\n}\n\n/**\n * Convert shard, realm, and num into a solidity address.\n *\n * See `fromSolidityAddress()` for more documentation.\n *\n * @param {[Long,Long,Long] | [number,number,number]} address\n * @returns {string}\n */\nexport function toSolidityAddress(address) {\n const buffer = new Uint8Array(20);\n const view = util.safeView(buffer);\n const [shard, realm, num] = address;\n\n view.setUint32(0, util.convertToNumber(shard));\n view.setUint32(8, util.convertToNumber(realm));\n view.setUint32(16, util.convertToNumber(num));\n\n return hex.encode(buffer);\n}\n\n/**\n * @overload\n * @param {Uint8Array} evmAddressBytes - EVM address bytes to convert to hex\n * @returns {string}\n */\n\n/**\n * @overload\n * @param {Long} accountNum - Account number to convert to long-zero EVM address\n * @returns {string}\n */\n\n/**\n * Convert EVM address bytes to hex string or account num to long-zero EVM address.\n *\n * @param {Uint8Array | Long} evmAddressBytesOrAccountNum\n * @returns {string}\n */\nexport function toEvmAddress(evmAddressBytesOrAccountNum) {\n if (evmAddressBytesOrAccountNum instanceof Uint8Array) {\n return hex.encode(evmAddressBytesOrAccountNum);\n }\n\n const accountNum = evmAddressBytesOrAccountNum;\n const buffer = new Uint8Array(EVM_ADDRESS_LENGTH);\n const view = util.safeView(buffer);\n\n view.setUint32(ENTITY_NUM_OFFSET, util.convertToNumber(accountNum));\n\n return hex.encode(buffer);\n}\n\n/**\n * Parse the address string addr and return an object with the results (8 fields).\n * The first four fields are numbers, which could be implemented as signed 32 bit\n * integers, and the last four are strings.\n *\n * status; //the status of the parsed address\n * // 0 = syntax error\n * // 1 = an invalid with-checksum address (bad checksum)\n * // 2 = a valid no-checksum address\n * // 3 = a valid with-checksum address\n * num1; //the 3 numbers in the address, such as 1.2.3, with leading zeros removed\n * num2;\n * num3;\n * correctchecksum; //the correct checksum\n * givenChecksum; //the checksum in the address that was parsed\n * noChecksumFormat; //the address in no-checksum format\n * withChecksumFormat; //the address in with-checksum format\n *\n * @param {Uint8Array} ledgerId\n * @param {string} addr\n * @returns {ParseAddressResult}\n */\nexport function _parseAddress(ledgerId, addr) {\n let match = regex.exec(addr);\n if (match === null) {\n let result = { status: 0 }; // When status == 0, the rest of the fields should be ignored\n return result;\n }\n let a = [\n Long.fromString(match[1]),\n Long.fromString(match[2]),\n Long.fromString(match[3]),\n ];\n let ad = `${a[0].toString()}.${a[1].toString()}.${a[2].toString()}`;\n let c = _checksum(ledgerId, ad);\n let s = match[4] === undefined ? 2 : c == match[4] ? 3 : 1; //NOSONAR\n return {\n status: s,\n num1: a[0],\n num2: a[1],\n num3: a[2],\n givenChecksum: match[4],\n correctChecksum: c,\n noChecksumFormat: ad,\n withChecksumFormat: `${ad}-${c}`,\n };\n}\n\n/**\n * Given an address like \"0.0.123\", return a checksum like \"laujm\"\n *\n * @param {Uint8Array} ledgerId\n * @param {string} addr\n * @returns {string}\n */\nexport function _checksum(ledgerId, addr) {\n let answer = \"\";\n let d = []; // Digits with 10 for \".\", so if addr == \"0.0.123\" then d == [0, 10, 0, 10, 1, 2, 3]\n let s0 = 0; // Sum of even positions (mod 11)\n let s1 = 0; // Sum of odd positions (mod 11)\n let s = 0; // Weighted sum of all positions (mod p3)\n let sh = 0; // Hash of the ledger ID\n let c = 0; // The checksum, as a single number\n const p3 = 26 * 26 * 26; // 3 digits in base 26\n const p5 = 26 * 26 * 26 * 26 * 26; // 5 digits in base 26\n const ascii_a = \"a\".charCodeAt(0); // 97\n const m = 1000003; // Min prime greater than a million. Used for the final permutation.\n const w = 31; // Sum s of digit values weights them by powers of w. Should be coprime to p5.\n\n let h = new Uint8Array(ledgerId.length + 6);\n h.set(ledgerId, 0);\n h.set([0, 0, 0, 0, 0, 0], ledgerId.length);\n for (let i = 0; i < addr.length; i++) {\n //NOSONAR\n d.push(addr[i] === \".\" ? 10 : parseInt(addr[i], 10));\n }\n for (let i = 0; i < d.length; i++) {\n s = (w * s + d[i]) % p3;\n if (i % 2 === 0) {\n s0 = (s0 + d[i]) % 11;\n } else {\n s1 = (s1 + d[i]) % 11;\n }\n }\n for (let i = 0; i < h.length; i++) {\n sh = (w * sh + h[i]) % p5;\n }\n c = ((((addr.length % 5) * 11 + s0) * 11 + s1) * p3 + s + sh) % p5;\n c = (c * m) % p5;\n\n for (let i = 0; i < 5; i++) {\n answer = String.fromCharCode(ascii_a + (c % 26)) + answer;\n c /= 26;\n }\n\n return answer;\n}\n\n/**\n * Validate an entity ID checksum against a client\n *\n * @param {Long} shard\n * @param {Long} realm\n * @param {Long} num\n * @param {string | null} checksum\n * @param {Client} client\n */\nexport function validateChecksum(shard, realm, num, checksum, client) {\n if (client._network._ledgerId == null || checksum == null) {\n return;\n }\n\n const expectedChecksum = _checksum(\n client._network._ledgerId._ledgerId,\n `${shard.toString()}.${realm.toString()}.${num.toString()}`,\n );\n\n if (checksum != expectedChecksum) {\n throw new BadEntityIdError(\n shard,\n realm,\n num,\n checksum,\n expectedChecksum,\n );\n }\n}\n\n/**\n * Stringify the entity ID with a checksum.\n *\n * @param {string} string\n * @param {Client} client\n * @returns {string}\n */\nexport function toStringWithChecksum(string, client) {\n if (client == null) {\n throw new Error(\"client cannot be null\");\n }\n\n if (client._network._ledgerId == null) {\n throw new Error(\n \"cannot calculate checksum with a client that does not contain a recognzied ledger ID\",\n );\n }\n\n const checksum = _checksum(client._network._ledgerId._ledgerId, string);\n\n return `${string}-${checksum}`;\n}\n\n/**\n * Append Buffers.\n * @param {Uint8Array} buffer1\n * @param {Uint8Array} buffer2\n * @returns {Uint8Array}\n */\nfunction appendBuffer(buffer1, buffer2) {\n var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);\n tmp.set(new Uint8Array(buffer1), 0);\n tmp.set(new Uint8Array(buffer2), buffer1.byteLength);\n return tmp;\n}\n\n/**\n * Convert bytes to hex string.\n * @param {Uint8Array} bytes\n * @returns {string}\n */\nfunction toHexString(bytes) {\n var s = \"0x\";\n bytes.forEach(function (byte) {\n s += (\"0\" + (byte & 0xff).toString(16)).slice(-2);\n });\n return s;\n}\n\n/**\n * Deserialize the alias to public key.\n * Alias is created from ed25519 or ECDSASecp256k1 types of accounts. If hollow account is used, the alias is created from evm address.\n * For hollow accounts, please use aliasToEvmAddress.\n *\n * @param {string} alias\n * @returns {PublicKey | null}\n */\nexport function aliasToPublicKey(alias) {\n const bytes = base32.decode(alias);\n if (!bytes) {\n return null;\n }\n let key;\n try {\n key = HieroProto.proto.Key.decode(bytes);\n } catch (e) {\n throw new Error(\n \"The alias is created with hollow account. Please use aliasToEvmAddress!\",\n );\n }\n\n if (key.ed25519 != null && key.ed25519.byteLength > 0) {\n return PublicKey.fromBytes(key.ed25519);\n }\n\n if (key.ECDSASecp256k1 != null && key.ECDSASecp256k1.byteLength > 0) {\n return PublicKey.fromBytes(key.ECDSASecp256k1);\n }\n\n return null;\n}\n\n/**\n * Deserialize the alias to evm address.\n * Alias is created from hollow account.\n * For ed25519 or ECDSASecp256k1 accounts, please use aliasToPublicKey.\n *\n * @param {string} alias\n * @returns {string | null}\n */\nexport function aliasToEvmAddress(alias) {\n const bytes = base32.decode(alias);\n if (!bytes) {\n return null;\n }\n try {\n HieroProto.proto.Key.decode(bytes);\n throw new Error(\n \"The alias is created with ed25519 or ECDSASecp256k1 account. Please use aliasToPublicKey!\",\n );\n } catch (e) {\n return toHexString(bytes);\n }\n}\n\n/**\n * Serialize the public key to alias.\n * Alias is created from ed25519 or ECDSASecp256k1 types of accounts. If hollow account is used, the alias is created from evm address.\n *\n * @param {string | PublicKey} publicKey\n * @returns {string | null}\n */\nexport function publicKeyToAlias(publicKey) {\n if (\n typeof publicKey === \"string\" &&\n ((publicKey.startsWith(\"0x\") && publicKey.length == 42) ||\n publicKey.length == 40)\n ) {\n if (!publicKey.startsWith(\"0x\")) {\n publicKey = `0x${publicKey}`;\n }\n\n const bytes = arrayify(publicKey);\n if (!bytes) {\n return null;\n }\n return base32.encode(bytes);\n }\n\n const publicKeyRaw =\n typeof publicKey === \"string\"\n ? PublicKey.fromString(publicKey)\n : publicKey;\n let publicKeyHex = publicKeyRaw.toStringRaw();\n let leadingHex = \"\";\n\n if (publicKeyRaw._key._type === \"secp256k1\") {\n leadingHex = \"0x3A21\"; // LEADING BYTES FROM PROTOBUFS\n }\n\n if (publicKeyRaw._key._type === \"ED25519\") {\n leadingHex = \"0x1220\"; // LEADING BYTES FROM PROTOBUFS\n }\n\n if (!publicKeyHex.startsWith(\"0x\")) {\n publicKeyHex = `0x${publicKeyHex}`;\n }\n\n const leadingBytes = arrayify(leadingHex);\n const publicKeyBytes = arrayify(publicKeyHex);\n const publicKeyInBytes = appendBuffer(leadingBytes, publicKeyBytes);\n const alias = base32.encode(publicKeyInBytes);\n return alias;\n}\n"],"names":["regex","ENTITY_ID_REGEX","constructor","props","realmOrNull","numOrNull","Error","shard","realm","num","Long","isLong","fromValue","ZERO","isNegative","compare","a","b","comparison","fromStringSplitter","text","match","exec","numOrHex","checksum","fromString","result","Number","isNaN","fromSolidityAddress","address","addr","startsWith","hex.decode","slice","length","fromBytesBE","Array","from","fromEvmAddress","hex.isHexString","util.isLongZeroAddress","fromNumber","isZero","EvmAddress","fromBytes","toSolidityAddress","buffer","Uint8Array","view","util.safeView","setUint32","util.convertToNumber","hex.encode","toEvmAddress","evmAddressBytesOrAccountNum","accountNum","_parseAddress","ledgerId","status","ad","toString","c","_checksum","undefined","num1","num2","num3","givenChecksum","correctChecksum","noChecksumFormat","withChecksumFormat","answer","d","s0","s1","s","sh","p5","ascii_a","charCodeAt","h","set","i","push","parseInt","String","fromCharCode","validateChecksum","client","_network","_ledgerId","expectedChecksum","BadEntityIdError","toStringWithChecksum","string","aliasToPublicKey","alias","bytes","base32","decode","key","HieroProto","proto","Key","e","ed25519","byteLength","PublicKey","ECDSASecp256k1","aliasToEvmAddress","forEach","byte","toHexString","publicKeyToAlias","publicKey","arrayify","encode","publicKeyRaw","publicKeyHex","toStringRaw","leadingHex","_key","_type","leadingBytes","publicKeyBytes","publicKeyInBytes","buffer1","buffer2","tmp"],"mappings":"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"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _Hbar = _interopRequireDefault(require("./Hbar.cjs"));
|
|
8
|
+
var _EthereumTransaction = _interopRequireDefault(require("./EthereumTransaction.cjs"));
|
|
9
|
+
var _EthereumTransactionData = _interopRequireDefault(require("./EthereumTransactionData.cjs"));
|
|
10
|
+
var _FileCreateTransaction = _interopRequireDefault(require("./file/FileCreateTransaction.cjs"));
|
|
11
|
+
var _FileAppendTransaction = _interopRequireDefault(require("./file/FileAppendTransaction.cjs"));
|
|
12
|
+
var hex = _interopRequireWildcard(require("./encoding/hex.cjs"));
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @namespace proto
|
|
20
|
+
* @typedef {import("@hashgraph/proto").proto.ITransaction} HieroProto.proto.ITransaction
|
|
21
|
+
* @typedef {import("@hashgraph/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
|
|
22
|
+
* @typedef {import("@hashgraph/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
|
|
23
|
+
* @typedef {import("@hashgraph/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
|
|
24
|
+
* @typedef {import("@hashgraph/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
|
|
25
|
+
* @typedef {import("@hashgraph/proto").proto.IEthereumTransactionBody} HieroProto.proto.IEthereumTransactionBody
|
|
26
|
+
* @typedef {import("@hashgraph/proto").proto.IAccountID} HieroProto.proto.IAccountID
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @typedef {import("bignumber.js").default} BigNumber
|
|
31
|
+
* @typedef {import("./account/AccountId.js").default} AccountId
|
|
32
|
+
* @typedef {import("./file/FileId.js").default} FileId
|
|
33
|
+
* @typedef {import("./channel/Channel.js").default} Channel
|
|
34
|
+
* @typedef {import("./channel/MirrorChannel.js").default} MirrorChannel
|
|
35
|
+
* @typedef {import("./client/Client.js").default<*, *>} Client
|
|
36
|
+
* @typedef {import("./Timestamp.js").default} Timestamp
|
|
37
|
+
* @typedef {import("./transaction/TransactionId.js").default} TransactionId
|
|
38
|
+
* @typedef {import("./transaction/TransactionResponse.js").default} TransactionResponse
|
|
39
|
+
* @typedef {import("long")} Long
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Create a new Hedera™ transaction wrapped ethereum transaction.
|
|
44
|
+
* @deprecated - use EthereumTransaction instead. With the introduction of jumbo transactions, it should always be less cost and more efficient to use EthereumTransaction instead.
|
|
45
|
+
*/
|
|
46
|
+
class EthereumFlow {
|
|
47
|
+
/**
|
|
48
|
+
* @param {object} [props]
|
|
49
|
+
* @param {Uint8Array} [props.ethereumData]
|
|
50
|
+
* @param {FileId} [props.callData]
|
|
51
|
+
* @param {number | string | Long | BigNumber | Hbar} [props.maxGasAllowance]
|
|
52
|
+
*/
|
|
53
|
+
constructor(props = {}) {
|
|
54
|
+
/**
|
|
55
|
+
* @private
|
|
56
|
+
* @type {?EthereumTransactionData}
|
|
57
|
+
*/
|
|
58
|
+
this._ethereumData = null;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @private
|
|
62
|
+
* @type {?FileId}
|
|
63
|
+
*/
|
|
64
|
+
this._callDataFileId = null;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @private
|
|
68
|
+
* @type {?Hbar}
|
|
69
|
+
*/
|
|
70
|
+
this._maxGasAllowance = null;
|
|
71
|
+
if (props.ethereumData != null) {
|
|
72
|
+
this.setEthereumData(props.ethereumData);
|
|
73
|
+
}
|
|
74
|
+
if (props.maxGasAllowance != null) {
|
|
75
|
+
this.setMaxGasAllowanceHbar(props.maxGasAllowance);
|
|
76
|
+
}
|
|
77
|
+
this._maxChunks = null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @returns {number | null}
|
|
82
|
+
*/
|
|
83
|
+
get maxChunks() {
|
|
84
|
+
return this._maxChunks;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @param {number} maxChunks
|
|
89
|
+
* @returns {this}
|
|
90
|
+
*/
|
|
91
|
+
setMaxChunks(maxChunks) {
|
|
92
|
+
this._maxChunks = maxChunks;
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @returns {?EthereumTransactionData}
|
|
98
|
+
*/
|
|
99
|
+
get ethereumData() {
|
|
100
|
+
return this._ethereumData;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The raw Ethereum transaction (RLP encoded type 0, 1, and 2). Complete
|
|
105
|
+
* unless the callData field is set.
|
|
106
|
+
*
|
|
107
|
+
* @param {EthereumTransactionData | Uint8Array} ethereumData
|
|
108
|
+
* @returns {this}
|
|
109
|
+
*/
|
|
110
|
+
setEthereumData(ethereumData) {
|
|
111
|
+
this._ethereumData = ethereumData instanceof Uint8Array ? _EthereumTransactionData.default.fromBytes(ethereumData) : ethereumData;
|
|
112
|
+
return this;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @returns {?Hbar}
|
|
117
|
+
*/
|
|
118
|
+
get maxGasAllowance() {
|
|
119
|
+
return this._maxGasAllowance;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @deprecated - use masGasAllowanceHbar instead.
|
|
124
|
+
* @param {number | string | Long | BigNumber | Hbar} maxGasAllowance
|
|
125
|
+
* @returns {this}
|
|
126
|
+
*/
|
|
127
|
+
setMaxGasAllowance(maxGasAllowance) {
|
|
128
|
+
return this.setMaxGasAllowanceHbar(maxGasAllowance);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The maximum amount, in hbars, that the payer of the hedera transaction
|
|
133
|
+
* is willing to pay to complete the transaction.
|
|
134
|
+
*
|
|
135
|
+
* Ordinarily the account with the ECDSA alias corresponding to the public
|
|
136
|
+
* key that is extracted from the ethereum_data signature is responsible for
|
|
137
|
+
* fees that result from the execution of the transaction. If that amount of
|
|
138
|
+
* authorized fees is not sufficient then the payer of the transaction can be
|
|
139
|
+
* charged, up to but not exceeding this amount. If the ethereum_data
|
|
140
|
+
* transaction authorized an amount that was insufficient then the payer will
|
|
141
|
+
* only be charged the amount needed to make up the difference. If the gas
|
|
142
|
+
* price in the transaction was set to zero then the payer will be assessed
|
|
143
|
+
* the entire fee.
|
|
144
|
+
*
|
|
145
|
+
* @param {number | string | Long | BigNumber | Hbar} maxGasAllowance
|
|
146
|
+
* @returns {this}
|
|
147
|
+
*/
|
|
148
|
+
setMaxGasAllowanceHbar(maxGasAllowance) {
|
|
149
|
+
this._maxGasAllowance = maxGasAllowance instanceof _Hbar.default ? maxGasAllowance : new _Hbar.default(maxGasAllowance);
|
|
150
|
+
return this;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @template {Channel} ChannelT
|
|
155
|
+
* @template {MirrorChannel} MirrorChannelT
|
|
156
|
+
* @param {import("./client/Client.js").default<ChannelT, MirrorChannelT>} client
|
|
157
|
+
* @returns {Promise<TransactionResponse>}
|
|
158
|
+
*/
|
|
159
|
+
async execute(client) {
|
|
160
|
+
if (this._ethereumData == null) {
|
|
161
|
+
throw new Error("cannot submit ethereum transaction with no ethereum data");
|
|
162
|
+
}
|
|
163
|
+
const ethereumTransaction = new _EthereumTransaction.default();
|
|
164
|
+
const ethereumTransactionDataBytes = this._ethereumData.toBytes();
|
|
165
|
+
if (this._maxGasAllowance != null) {
|
|
166
|
+
ethereumTransaction.setMaxGasAllowanceHbar(this._maxGasAllowance);
|
|
167
|
+
}
|
|
168
|
+
if (this._callDataFileId != null) {
|
|
169
|
+
if (this._ethereumData.callData.length === 0) {
|
|
170
|
+
throw new Error("call data file ID provided, but ethereum data already contains call data");
|
|
171
|
+
}
|
|
172
|
+
ethereumTransaction.setEthereumData(ethereumTransactionDataBytes).setCallDataFileId(this._callDataFileId);
|
|
173
|
+
// in the consensus node config file, the maximum size of the call data file is 128000 bytes
|
|
174
|
+
// so we need to check if the call data is less than or equal to 128000 bytes
|
|
175
|
+
} else if (ethereumTransactionDataBytes.length <= 128000) {
|
|
176
|
+
ethereumTransaction.setEthereumData(ethereumTransactionDataBytes);
|
|
177
|
+
} else {
|
|
178
|
+
const fileId = await createFile(this._ethereumData.callData, client, this._maxChunks);
|
|
179
|
+
this._ethereumData.callData = new Uint8Array();
|
|
180
|
+
ethereumTransaction.setEthereumData(this._ethereumData.toBytes()).setCallDataFileId(fileId);
|
|
181
|
+
}
|
|
182
|
+
return ethereumTransaction.execute(client);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* @template {Channel} ChannelT
|
|
188
|
+
* @template {MirrorChannel} MirrorChannelT
|
|
189
|
+
* @param {Uint8Array} callData
|
|
190
|
+
* @param {import("./client/Client.js").default<ChannelT, MirrorChannelT>} client
|
|
191
|
+
* @param {?number} maxChunks
|
|
192
|
+
* @returns {Promise<FileId>}
|
|
193
|
+
*/
|
|
194
|
+
exports.default = EthereumFlow;
|
|
195
|
+
async function createFile(callData, client, maxChunks) {
|
|
196
|
+
const hexedCallData = hex.encode(callData);
|
|
197
|
+
const fileId = /** @type {FileId} */
|
|
198
|
+
(await (await new _FileCreateTransaction.default().setContents(hexedCallData.substring(0, 4096)).setKeys(client.operatorPublicKey ? [client.operatorPublicKey] : []).execute(client)).getReceipt(client)).fileId;
|
|
199
|
+
if (callData.length > 4096) {
|
|
200
|
+
let fileAppendTransaction = new _FileAppendTransaction.default().setFileId(fileId).setContents(hexedCallData.substring(4096, hexedCallData.length));
|
|
201
|
+
if (maxChunks != null) {
|
|
202
|
+
fileAppendTransaction.setMaxChunks(maxChunks);
|
|
203
|
+
}
|
|
204
|
+
await (await fileAppendTransaction.execute(client)).getReceipt(client);
|
|
205
|
+
}
|
|
206
|
+
return fileId;
|
|
207
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @namespace proto
|
|
3
|
+
* @typedef {import("@hashgraph/proto").proto.ITransaction} HieroProto.proto.ITransaction
|
|
4
|
+
* @typedef {import("@hashgraph/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
|
|
5
|
+
* @typedef {import("@hashgraph/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
|
|
6
|
+
* @typedef {import("@hashgraph/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
|
|
7
|
+
* @typedef {import("@hashgraph/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
|
|
8
|
+
* @typedef {import("@hashgraph/proto").proto.IEthereumTransactionBody} HieroProto.proto.IEthereumTransactionBody
|
|
9
|
+
* @typedef {import("@hashgraph/proto").proto.IAccountID} HieroProto.proto.IAccountID
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {import("bignumber.js").default} BigNumber
|
|
13
|
+
* @typedef {import("./account/AccountId.js").default} AccountId
|
|
14
|
+
* @typedef {import("./file/FileId.js").default} FileId
|
|
15
|
+
* @typedef {import("./channel/Channel.js").default} Channel
|
|
16
|
+
* @typedef {import("./channel/MirrorChannel.js").default} MirrorChannel
|
|
17
|
+
* @typedef {import("./client/Client.js").default<*, *>} Client
|
|
18
|
+
* @typedef {import("./Timestamp.js").default} Timestamp
|
|
19
|
+
* @typedef {import("./transaction/TransactionId.js").default} TransactionId
|
|
20
|
+
* @typedef {import("./transaction/TransactionResponse.js").default} TransactionResponse
|
|
21
|
+
* @typedef {import("long")} Long
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Create a new Hedera™ transaction wrapped ethereum transaction.
|
|
25
|
+
* @deprecated - use EthereumTransaction instead. With the introduction of jumbo transactions, it should always be less cost and more efficient to use EthereumTransaction instead.
|
|
26
|
+
*/
|
|
27
|
+
export default class EthereumFlow {
|
|
28
|
+
/**
|
|
29
|
+
* @param {object} [props]
|
|
30
|
+
* @param {Uint8Array} [props.ethereumData]
|
|
31
|
+
* @param {FileId} [props.callData]
|
|
32
|
+
* @param {number | string | Long | BigNumber | Hbar} [props.maxGasAllowance]
|
|
33
|
+
*/
|
|
34
|
+
constructor(props?: {
|
|
35
|
+
ethereumData?: Uint8Array<ArrayBufferLike> | undefined;
|
|
36
|
+
callData?: import("./file/FileId.js").default | undefined;
|
|
37
|
+
maxGasAllowance?: string | number | import("long") | import("bignumber.js").BigNumber | Hbar | undefined;
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* @private
|
|
41
|
+
* @type {?EthereumTransactionData}
|
|
42
|
+
*/
|
|
43
|
+
private _ethereumData;
|
|
44
|
+
/**
|
|
45
|
+
* @private
|
|
46
|
+
* @type {?FileId}
|
|
47
|
+
*/
|
|
48
|
+
private _callDataFileId;
|
|
49
|
+
/**
|
|
50
|
+
* @private
|
|
51
|
+
* @type {?Hbar}
|
|
52
|
+
*/
|
|
53
|
+
private _maxGasAllowance;
|
|
54
|
+
_maxChunks: number | null;
|
|
55
|
+
/**
|
|
56
|
+
* @returns {number | null}
|
|
57
|
+
*/
|
|
58
|
+
get maxChunks(): number | null;
|
|
59
|
+
/**
|
|
60
|
+
* @param {number} maxChunks
|
|
61
|
+
* @returns {this}
|
|
62
|
+
*/
|
|
63
|
+
setMaxChunks(maxChunks: number): this;
|
|
64
|
+
/**
|
|
65
|
+
* @returns {?EthereumTransactionData}
|
|
66
|
+
*/
|
|
67
|
+
get ethereumData(): EthereumTransactionData | null;
|
|
68
|
+
/**
|
|
69
|
+
* The raw Ethereum transaction (RLP encoded type 0, 1, and 2). Complete
|
|
70
|
+
* unless the callData field is set.
|
|
71
|
+
*
|
|
72
|
+
* @param {EthereumTransactionData | Uint8Array} ethereumData
|
|
73
|
+
* @returns {this}
|
|
74
|
+
*/
|
|
75
|
+
setEthereumData(ethereumData: EthereumTransactionData | Uint8Array): this;
|
|
76
|
+
/**
|
|
77
|
+
* @returns {?Hbar}
|
|
78
|
+
*/
|
|
79
|
+
get maxGasAllowance(): Hbar | null;
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated - use masGasAllowanceHbar instead.
|
|
82
|
+
* @param {number | string | Long | BigNumber | Hbar} maxGasAllowance
|
|
83
|
+
* @returns {this}
|
|
84
|
+
*/
|
|
85
|
+
setMaxGasAllowance(maxGasAllowance: number | string | Long | BigNumber | Hbar): this;
|
|
86
|
+
/**
|
|
87
|
+
* The maximum amount, in hbars, that the payer of the hedera transaction
|
|
88
|
+
* is willing to pay to complete the transaction.
|
|
89
|
+
*
|
|
90
|
+
* Ordinarily the account with the ECDSA alias corresponding to the public
|
|
91
|
+
* key that is extracted from the ethereum_data signature is responsible for
|
|
92
|
+
* fees that result from the execution of the transaction. If that amount of
|
|
93
|
+
* authorized fees is not sufficient then the payer of the transaction can be
|
|
94
|
+
* charged, up to but not exceeding this amount. If the ethereum_data
|
|
95
|
+
* transaction authorized an amount that was insufficient then the payer will
|
|
96
|
+
* only be charged the amount needed to make up the difference. If the gas
|
|
97
|
+
* price in the transaction was set to zero then the payer will be assessed
|
|
98
|
+
* the entire fee.
|
|
99
|
+
*
|
|
100
|
+
* @param {number | string | Long | BigNumber | Hbar} maxGasAllowance
|
|
101
|
+
* @returns {this}
|
|
102
|
+
*/
|
|
103
|
+
setMaxGasAllowanceHbar(maxGasAllowance: number | string | Long | BigNumber | Hbar): this;
|
|
104
|
+
/**
|
|
105
|
+
* @template {Channel} ChannelT
|
|
106
|
+
* @template {MirrorChannel} MirrorChannelT
|
|
107
|
+
* @param {import("./client/Client.js").default<ChannelT, MirrorChannelT>} client
|
|
108
|
+
* @returns {Promise<TransactionResponse>}
|
|
109
|
+
*/
|
|
110
|
+
execute<ChannelT extends Channel, MirrorChannelT extends MirrorChannel>(client: import("./client/Client.js").default<ChannelT, MirrorChannelT>): Promise<TransactionResponse>;
|
|
111
|
+
}
|
|
112
|
+
export namespace HieroProto {
|
|
113
|
+
namespace proto {
|
|
114
|
+
type ITransaction = import("@hashgraph/proto").proto.ITransaction;
|
|
115
|
+
type ISignedTransaction = import("@hashgraph/proto").proto.ISignedTransaction;
|
|
116
|
+
type TransactionBody = import("@hashgraph/proto").proto.TransactionBody;
|
|
117
|
+
type ITransactionBody = import("@hashgraph/proto").proto.ITransactionBody;
|
|
118
|
+
type ITransactionResponse = import("@hashgraph/proto").proto.ITransactionResponse;
|
|
119
|
+
type IEthereumTransactionBody = import("@hashgraph/proto").proto.IEthereumTransactionBody;
|
|
120
|
+
type IAccountID = import("@hashgraph/proto").proto.IAccountID;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
export type BigNumber = import("bignumber.js").default;
|
|
124
|
+
export type AccountId = import("./account/AccountId.js").default;
|
|
125
|
+
export type FileId = import("./file/FileId.js").default;
|
|
126
|
+
export type Channel = import("./channel/Channel.js").default;
|
|
127
|
+
export type MirrorChannel = import("./channel/MirrorChannel.js").default;
|
|
128
|
+
export type Client = import("./client/Client.js").default<any, any>;
|
|
129
|
+
export type Timestamp = import("./Timestamp.js").default;
|
|
130
|
+
export type TransactionId = import("./transaction/TransactionId.js").default;
|
|
131
|
+
export type TransactionResponse = import("./transaction/TransactionResponse.js").default;
|
|
132
|
+
export type Long = import("long");
|
|
133
|
+
import EthereumTransactionData from "./EthereumTransactionData.js";
|
|
134
|
+
import Hbar from "./Hbar.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import t from"./Hbar.js";import e from"./EthereumTransaction.js";import a from"./EthereumTransactionData.js";import s from"./file/FileCreateTransaction.js";import l from"./file/FileAppendTransaction.js";import{encode as n}from"./encoding/hex.js";class r{constructor(t={}){this._ethereumData=null,this._callDataFileId=null,this._maxGasAllowance=null,null!=t.ethereumData&&this.setEthereumData(t.ethereumData),null!=t.maxGasAllowance&&this.setMaxGasAllowanceHbar(t.maxGasAllowance),this._maxChunks=null}get maxChunks(){return this._maxChunks}setMaxChunks(t){return this._maxChunks=t,this}get ethereumData(){return this._ethereumData}setEthereumData(t){return this._ethereumData=t instanceof Uint8Array?a.fromBytes(t):t,this}get maxGasAllowance(){return this._maxGasAllowance}setMaxGasAllowance(t){return this.setMaxGasAllowanceHbar(t)}setMaxGasAllowanceHbar(e){return this._maxGasAllowance=e instanceof t?e:new t(e),this}async execute(t){if(null==this._ethereumData)throw new Error("cannot submit ethereum transaction with no ethereum data");const a=new e,r=this._ethereumData.toBytes();if(null!=this._maxGasAllowance&&a.setMaxGasAllowanceHbar(this._maxGasAllowance),null!=this._callDataFileId){if(0===this._ethereumData.callData.length)throw new Error("call data file ID provided, but ethereum data already contains call data");a.setEthereumData(r).setCallDataFileId(this._callDataFileId)}else if(r.length<=128e3)a.setEthereumData(r);else{const e=await async function(t,e,a){const r=n(t),i=(await(await(new s).setContents(r.substring(0,4096)).setKeys(e.operatorPublicKey?[e.operatorPublicKey]:[]).execute(e)).getReceipt(e)).fileId;if(t.length>4096){let t=(new l).setFileId(i).setContents(r.substring(4096,r.length));null!=a&&t.setMaxChunks(a),await(await t.execute(e)).getReceipt(e)}return i}(this._ethereumData.callData,t,this._maxChunks);this._ethereumData.callData=new Uint8Array,a.setEthereumData(this._ethereumData.toBytes()).setCallDataFileId(e)}return a.execute(t)}}export{r as default};
|
|
2
|
+
//# sourceMappingURL=EthereumFlow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EthereumFlow.js","sources":["../src/EthereumFlow.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Hbar from \"./Hbar.js\";\nimport EthereumTransaction from \"./EthereumTransaction.js\";\nimport EthereumTransactionData from \"./EthereumTransactionData.js\";\nimport FileCreateTransaction from \"./file/FileCreateTransaction.js\";\nimport FileAppendTransaction from \"./file/FileAppendTransaction.js\";\nimport * as hex from \"./encoding/hex.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hashgraph/proto\").proto.ITransaction} HieroProto.proto.ITransaction\n * @typedef {import(\"@hashgraph/proto\").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction\n * @typedef {import(\"@hashgraph/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n * @typedef {import(\"@hashgraph/proto\").proto.IEthereumTransactionBody} HieroProto.proto.IEthereumTransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.IAccountID} HieroProto.proto.IAccountID\n */\n\n/**\n * @typedef {import(\"bignumber.js\").default} BigNumber\n * @typedef {import(\"./account/AccountId.js\").default} AccountId\n * @typedef {import(\"./file/FileId.js\").default} FileId\n * @typedef {import(\"./channel/Channel.js\").default} Channel\n * @typedef {import(\"./channel/MirrorChannel.js\").default} MirrorChannel\n * @typedef {import(\"./client/Client.js\").default<*, *>} Client\n * @typedef {import(\"./Timestamp.js\").default} Timestamp\n * @typedef {import(\"./transaction/TransactionId.js\").default} TransactionId\n * @typedef {import(\"./transaction/TransactionResponse.js\").default} TransactionResponse\n * @typedef {import(\"long\")} Long\n */\n\n/**\n * Create a new Hedera™ transaction wrapped ethereum transaction.\n * @deprecated - use EthereumTransaction instead. With the introduction of jumbo transactions, it should always be less cost and more efficient to use EthereumTransaction instead.\n */\nexport default class EthereumFlow {\n /**\n * @param {object} [props]\n * @param {Uint8Array} [props.ethereumData]\n * @param {FileId} [props.callData]\n * @param {number | string | Long | BigNumber | Hbar} [props.maxGasAllowance]\n */\n constructor(props = {}) {\n /**\n * @private\n * @type {?EthereumTransactionData}\n */\n this._ethereumData = null;\n\n /**\n * @private\n * @type {?FileId}\n */\n this._callDataFileId = null;\n\n /**\n * @private\n * @type {?Hbar}\n */\n this._maxGasAllowance = null;\n\n if (props.ethereumData != null) {\n this.setEthereumData(props.ethereumData);\n }\n\n if (props.maxGasAllowance != null) {\n this.setMaxGasAllowanceHbar(props.maxGasAllowance);\n }\n\n this._maxChunks = null;\n }\n\n /**\n * @returns {number | null}\n */\n get maxChunks() {\n return this._maxChunks;\n }\n\n /**\n * @param {number} maxChunks\n * @returns {this}\n */\n setMaxChunks(maxChunks) {\n this._maxChunks = maxChunks;\n return this;\n }\n\n /**\n * @returns {?EthereumTransactionData}\n */\n get ethereumData() {\n return this._ethereumData;\n }\n\n /**\n * The raw Ethereum transaction (RLP encoded type 0, 1, and 2). Complete\n * unless the callData field is set.\n *\n * @param {EthereumTransactionData | Uint8Array} ethereumData\n * @returns {this}\n */\n setEthereumData(ethereumData) {\n this._ethereumData =\n ethereumData instanceof Uint8Array\n ? EthereumTransactionData.fromBytes(ethereumData)\n : ethereumData;\n return this;\n }\n\n /**\n * @returns {?Hbar}\n */\n get maxGasAllowance() {\n return this._maxGasAllowance;\n }\n\n /**\n * @deprecated - use masGasAllowanceHbar instead.\n * @param {number | string | Long | BigNumber | Hbar} maxGasAllowance\n * @returns {this}\n */\n setMaxGasAllowance(maxGasAllowance) {\n return this.setMaxGasAllowanceHbar(maxGasAllowance);\n }\n\n /**\n * The maximum amount, in hbars, that the payer of the hedera transaction\n * is willing to pay to complete the transaction.\n *\n * Ordinarily the account with the ECDSA alias corresponding to the public\n * key that is extracted from the ethereum_data signature is responsible for\n * fees that result from the execution of the transaction. If that amount of\n * authorized fees is not sufficient then the payer of the transaction can be\n * charged, up to but not exceeding this amount. If the ethereum_data\n * transaction authorized an amount that was insufficient then the payer will\n * only be charged the amount needed to make up the difference. If the gas\n * price in the transaction was set to zero then the payer will be assessed\n * the entire fee.\n *\n * @param {number | string | Long | BigNumber | Hbar} maxGasAllowance\n * @returns {this}\n */\n setMaxGasAllowanceHbar(maxGasAllowance) {\n this._maxGasAllowance =\n maxGasAllowance instanceof Hbar\n ? maxGasAllowance\n : new Hbar(maxGasAllowance);\n return this;\n }\n\n /**\n * @template {Channel} ChannelT\n * @template {MirrorChannel} MirrorChannelT\n * @param {import(\"./client/Client.js\").default<ChannelT, MirrorChannelT>} client\n * @returns {Promise<TransactionResponse>}\n */\n async execute(client) {\n if (this._ethereumData == null) {\n throw new Error(\n \"cannot submit ethereum transaction with no ethereum data\",\n );\n }\n\n const ethereumTransaction = new EthereumTransaction();\n const ethereumTransactionDataBytes = this._ethereumData.toBytes();\n\n if (this._maxGasAllowance != null) {\n ethereumTransaction.setMaxGasAllowanceHbar(this._maxGasAllowance);\n }\n\n if (this._callDataFileId != null) {\n if (this._ethereumData.callData.length === 0) {\n throw new Error(\n \"call data file ID provided, but ethereum data already contains call data\",\n );\n }\n\n ethereumTransaction\n .setEthereumData(ethereumTransactionDataBytes)\n .setCallDataFileId(this._callDataFileId);\n // in the consensus node config file, the maximum size of the call data file is 128000 bytes\n // so we need to check if the call data is less than or equal to 128000 bytes\n } else if (ethereumTransactionDataBytes.length <= 128000) {\n ethereumTransaction.setEthereumData(ethereumTransactionDataBytes);\n } else {\n const fileId = await createFile(\n this._ethereumData.callData,\n client,\n this._maxChunks,\n );\n\n this._ethereumData.callData = new Uint8Array();\n\n ethereumTransaction\n .setEthereumData(this._ethereumData.toBytes())\n .setCallDataFileId(fileId);\n }\n\n return ethereumTransaction.execute(client);\n }\n}\n\n/**\n * @template {Channel} ChannelT\n * @template {MirrorChannel} MirrorChannelT\n * @param {Uint8Array} callData\n * @param {import(\"./client/Client.js\").default<ChannelT, MirrorChannelT>} client\n * @param {?number} maxChunks\n * @returns {Promise<FileId>}\n */\nasync function createFile(callData, client, maxChunks) {\n const hexedCallData = hex.encode(callData);\n\n const fileId = /** @type {FileId} */ (\n (\n await (\n await new FileCreateTransaction()\n .setContents(hexedCallData.substring(0, 4096))\n .setKeys(\n client.operatorPublicKey\n ? [client.operatorPublicKey]\n : [],\n )\n .execute(client)\n ).getReceipt(client)\n ).fileId\n );\n\n if (callData.length > 4096) {\n let fileAppendTransaction = new FileAppendTransaction()\n .setFileId(fileId)\n .setContents(hexedCallData.substring(4096, hexedCallData.length));\n if (maxChunks != null) {\n fileAppendTransaction.setMaxChunks(maxChunks);\n }\n\n await (await fileAppendTransaction.execute(client)).getReceipt(client);\n }\n\n return fileId;\n}\n"],"names":["EthereumFlow","constructor","props","this","_ethereumData","_callDataFileId","_maxGasAllowance","ethereumData","setEthereumData","maxGasAllowance","setMaxGasAllowanceHbar","_maxChunks","maxChunks","setMaxChunks","Uint8Array","EthereumTransactionData","fromBytes","setMaxGasAllowance","Hbar","execute","client","Error","ethereumTransaction","EthereumTransaction","ethereumTransactionDataBytes","toBytes","callData","length","setCallDataFileId","fileId","async","hexedCallData","hex.encode","FileCreateTransaction","setContents","substring","setKeys","operatorPublicKey","getReceipt","fileAppendTransaction","FileAppendTransaction","setFileId","createFile"],"mappings":"sPAqCe,MAAMA,EAOjB,WAAAC,CAAYC,EAAQ,IAKhBC,KAAKC,cAAgB,KAMrBD,KAAKE,gBAAkB,KAMvBF,KAAKG,iBAAmB,KAEE,MAAtBJ,EAAMK,cACNJ,KAAKK,gBAAgBN,EAAMK,cAGF,MAAzBL,EAAMO,iBACNN,KAAKO,uBAAuBR,EAAMO,iBAGtCN,KAAKQ,WAAa,IAC1B,CAKI,aAAIC,GACA,OAAOT,KAAKQ,UACpB,CAMI,YAAAE,CAAaD,GAET,OADAT,KAAKQ,WAAaC,EACXT,IACf,CAKI,gBAAII,GACA,OAAOJ,KAAKC,aACpB,CASI,eAAAI,CAAgBD,GAKZ,OAJAJ,KAAKC,cACDG,aAAwBO,WAClBC,EAAwBC,UAAUT,GAClCA,EACHJ,IACf,CAKI,mBAAIM,GACA,OAAON,KAAKG,gBACpB,CAOI,kBAAAW,CAAmBR,GACf,OAAON,KAAKO,uBAAuBD,EAC3C,CAmBI,sBAAAC,CAAuBD,GAKnB,OAJAN,KAAKG,iBACDG,aAA2BS,EACrBT,EACA,IAAIS,EAAKT,GACZN,IACf,CAQI,aAAMgB,CAAQC,GACV,GAA0B,MAAtBjB,KAAKC,cACL,MAAM,IAAIiB,MACN,4DAIR,MAAMC,EAAsB,IAAIC,EAC1BC,EAA+BrB,KAAKC,cAAcqB,UAMxD,GAJ6B,MAAzBtB,KAAKG,kBACLgB,EAAoBZ,uBAAuBP,KAAKG,kBAGxB,MAAxBH,KAAKE,gBAAyB,CAC9B,GAA2C,IAAvCF,KAAKC,cAAcsB,SAASC,OAC5B,MAAM,IAAIN,MACN,4EAIRC,EACKd,gBAAgBgB,GAChBI,kBAAkBzB,KAAKE,gBAGxC,MAAe,GAAImB,EAA6BG,QAAU,MAC9CL,EAAoBd,gBAAgBgB,OACjC,CACH,MAAMK,QAyBlBC,eAA0BJ,EAAUN,EAAQR,GACxC,MAAMmB,EAAgBC,EAAWN,GAE3BG,eAGY,IAAII,GACLC,YAAYH,EAAcI,UAAU,EAAG,OACvCC,QACGhB,EAAOiB,kBACD,CAACjB,EAAOiB,mBACR,IAETlB,QAAQC,IACfkB,WAAWlB,IAEpB,OAED,GAAIM,EAASC,OAAS,KAAM,CACxB,IAAIY,GAAwB,IAAIC,GAC3BC,UAAUZ,GACVK,YAAYH,EAAcI,UAAU,KAAMJ,EAAcJ,SAC5C,MAAbf,GACA2B,EAAsB1B,aAAaD,eAG1B2B,EAAsBpB,QAAQC,IAASkB,WAAWlB,EACvE,CAEI,OAAOS,CACX,CAvDiCa,CACjBvC,KAAKC,cAAcsB,SACnBN,EACAjB,KAAKQ,YAGTR,KAAKC,cAAcsB,SAAW,IAAIZ,WAElCQ,EACKd,gBAAgBL,KAAKC,cAAcqB,WACnCG,kBAAkBC,EACnC,CAEQ,OAAOP,EAAoBH,QAAQC,EAC3C"}
|