@hiero-ledger/sdk 2.72.0 → 2.73.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/umd.js +648 -338
- package/dist/umd.min.js +16 -15
- package/lib/EntityIdHelper.cjs +1 -2
- package/lib/EntityIdHelper.js +1 -1
- package/lib/EntityIdHelper.js.map +1 -1
- package/lib/EthereumFlow.cjs +1 -2
- package/lib/EthereumTransaction.cjs +1 -2
- package/lib/EthereumTransactionDataEip1559.cjs +1 -2
- package/lib/EthereumTransactionDataEip1559.js +1 -1
- package/lib/EthereumTransactionDataEip1559.js.map +1 -1
- package/lib/EthereumTransactionDataEip2930.cjs +1 -2
- package/lib/EthereumTransactionDataEip2930.js +1 -1
- package/lib/EthereumTransactionDataEip2930.js.map +1 -1
- package/lib/EthereumTransactionDataLegacy.cjs +1 -2
- package/lib/EthereumTransactionDataLegacy.js +1 -1
- package/lib/EthereumTransactionDataLegacy.js.map +1 -1
- package/lib/EvmAddress.cjs +1 -2
- package/lib/ExchangeRates.cjs +1 -2
- package/lib/Executable.cjs +1 -2
- package/lib/Executable.js +1 -1
- package/lib/Executable.js.map +1 -1
- package/lib/FeeComponents.cjs +1 -2
- package/lib/FeeData.cjs +1 -2
- package/lib/FeeSchedule.cjs +1 -2
- package/lib/FeeSchedule.js +1 -1
- package/lib/FeeSchedule.js.map +1 -1
- package/lib/FeeSchedules.cjs +1 -2
- package/lib/KeyList.js +1 -1
- package/lib/KeyList.js.map +1 -1
- package/lib/LedgerId.cjs +1 -2
- package/lib/LocalProviderWeb.cjs +165 -0
- package/lib/LocalProviderWeb.d.ts +127 -0
- package/lib/LocalProviderWeb.js +2 -0
- package/lib/LocalProviderWeb.js.map +1 -0
- package/lib/ManagedNode.js +1 -1
- package/lib/ManagedNode.js.map +1 -1
- package/lib/ObjectMap.js +1 -1
- package/lib/ObjectMap.js.map +1 -1
- package/lib/PrivateKey.js +1 -1
- package/lib/PrivateKey.js.map +1 -1
- package/lib/PrngTransaction.cjs +1 -2
- package/lib/PublicKey.js +1 -1
- package/lib/PublicKey.js.map +1 -1
- package/lib/StakingInfo.cjs +1 -2
- package/lib/Timestamp.js.map +1 -1
- package/lib/TransactionFeeSchedule.cjs +1 -2
- package/lib/TransactionFeeSchedule.js +1 -1
- package/lib/TransactionFeeSchedule.js.map +1 -1
- package/lib/Wallet.cjs +1 -2
- package/lib/Wallet.js +1 -1
- package/lib/Wallet.js.map +1 -1
- package/lib/account/AccountAllowanceAdjustTransaction.cjs +1 -2
- package/lib/account/AccountAllowanceAdjustTransaction.js +1 -1
- package/lib/account/AccountAllowanceAdjustTransaction.js.map +1 -1
- package/lib/account/AccountAllowanceApproveTransaction.cjs +1 -2
- package/lib/account/AccountAllowanceApproveTransaction.js +1 -1
- package/lib/account/AccountAllowanceApproveTransaction.js.map +1 -1
- package/lib/account/AccountAllowanceDeleteTransaction.cjs +1 -2
- package/lib/account/AccountAllowanceDeleteTransaction.js +1 -1
- package/lib/account/AccountAllowanceDeleteTransaction.js.map +1 -1
- package/lib/account/AccountBalance.cjs +1 -2
- package/lib/account/AccountBalanceQuery.cjs +1 -2
- package/lib/account/AccountCreateTransaction.cjs +1 -2
- package/lib/account/AccountDeleteTransaction.cjs +1 -2
- package/lib/account/AccountId.cjs +1 -2
- package/lib/account/AccountId.js +1 -1
- package/lib/account/AccountId.js.map +1 -1
- package/lib/account/AccountInfo.cjs +1 -2
- package/lib/account/AccountInfo.js +1 -1
- package/lib/account/AccountInfo.js.map +1 -1
- package/lib/account/AccountInfoQuery.cjs +1 -2
- package/lib/account/AccountRecordsQuery.cjs +1 -2
- package/lib/account/AccountRecordsQuery.js +1 -1
- package/lib/account/AccountRecordsQuery.js.map +1 -1
- package/lib/account/AccountUpdateTransaction.cjs +1 -2
- package/lib/account/HbarTransferMap.js +1 -1
- package/lib/account/HbarTransferMap.js.map +1 -1
- package/lib/account/LiveHashAddTransaction.cjs +1 -2
- package/lib/account/LiveHashAddTransaction.js +1 -1
- package/lib/account/LiveHashAddTransaction.js.map +1 -1
- package/lib/account/LiveHashDeleteTransaction.cjs +1 -2
- package/lib/account/LiveHashQuery.cjs +1 -2
- package/lib/account/NullableTokenDecimalMap.js +1 -1
- package/lib/account/NullableTokenDecimalMap.js.map +1 -1
- package/lib/account/TokenBalanceMap.js +1 -1
- package/lib/account/TokenBalanceMap.js.map +1 -1
- package/lib/account/TokenDecimalMap.js +1 -1
- package/lib/account/TokenDecimalMap.js.map +1 -1
- package/lib/account/TokenNftAllowance.js +1 -1
- package/lib/account/TokenNftAllowance.js.map +1 -1
- package/lib/account/TokenNftTransferMap.js +1 -1
- package/lib/account/TokenNftTransferMap.js.map +1 -1
- package/lib/account/TokenRelationshipMap.js +1 -1
- package/lib/account/TokenRelationshipMap.js.map +1 -1
- package/lib/account/TokenTransferAccountMap.js +1 -1
- package/lib/account/TokenTransferAccountMap.js.map +1 -1
- package/lib/account/TokenTransferMap.js +1 -1
- package/lib/account/TokenTransferMap.js.map +1 -1
- package/lib/account/TransferTransaction.cjs +1 -2
- package/lib/account/TransferTransaction.js +1 -1
- package/lib/account/TransferTransaction.js.map +1 -1
- package/lib/address_book/AddressBooks.cjs +1 -2
- package/lib/address_book/NodeAddress.cjs +1 -2
- package/lib/address_book/NodeAddress.js +1 -1
- package/lib/address_book/NodeAddress.js.map +1 -1
- package/lib/address_book/NodeAddressBook.cjs +1 -2
- package/lib/address_book/NodeAddressBook.js +1 -1
- package/lib/address_book/NodeAddressBook.js.map +1 -1
- package/lib/browser.cjs +8 -0
- package/lib/browser.d.ts +1 -0
- package/lib/browser.js +1 -1
- package/lib/channel/Channel.cjs +1 -2
- package/lib/channel/NativeChannel.cjs +1 -2
- package/lib/channel/NativeChannel.js +1 -1
- package/lib/channel/NativeChannel.js.map +1 -1
- package/lib/channel/NodeChannel.js +1 -1
- package/lib/channel/NodeChannel.js.map +1 -1
- package/lib/channel/NodeMirrorChannel.cjs +1 -2
- package/lib/channel/NodeMirrorChannel.js +1 -1
- package/lib/channel/NodeMirrorChannel.js.map +1 -1
- package/lib/channel/WebChannel.cjs +1 -2
- package/lib/client/Client.js +1 -1
- package/lib/client/Client.js.map +1 -1
- package/lib/client/ManagedNetwork.cjs +1 -2
- package/lib/client/ManagedNetwork.js +1 -1
- package/lib/client/ManagedNetwork.js.map +1 -1
- package/lib/client/MirrorNetwork.js +1 -1
- package/lib/client/MirrorNetwork.js.map +1 -1
- package/lib/client/NativeClient.js.map +1 -1
- package/lib/client/Network.js +1 -1
- package/lib/client/Network.js.map +1 -1
- package/lib/client/NodeClient.cjs +4 -11
- package/lib/client/NodeClient.d.ts +5 -6
- package/lib/client/NodeClient.js +1 -1
- package/lib/client/NodeClient.js.map +1 -1
- package/lib/client/WebClient.cjs +32 -7
- package/lib/client/WebClient.d.ts +10 -0
- package/lib/client/WebClient.js +1 -1
- package/lib/client/WebClient.js.map +1 -1
- package/lib/client/addressbooks/mainnet.cjs +1 -1
- package/lib/client/addressbooks/mainnet.d.ts +1 -1
- package/lib/client/addressbooks/mainnet.js +1 -1
- package/lib/client/addressbooks/mainnet.js.map +1 -1
- package/lib/client/addressbooks/previewnet.cjs +1 -1
- package/lib/client/addressbooks/previewnet.d.ts +1 -1
- package/lib/client/addressbooks/previewnet.js +1 -1
- package/lib/client/addressbooks/previewnet.js.map +1 -1
- package/lib/client/addressbooks/testnet.cjs +1 -1
- package/lib/client/addressbooks/testnet.d.ts +1 -1
- package/lib/client/addressbooks/testnet.js +1 -1
- package/lib/client/addressbooks/testnet.js.map +1 -1
- package/lib/constants/ClientConstants.cjs +21 -2
- package/lib/constants/ClientConstants.d.ts +17 -0
- package/lib/constants/ClientConstants.js +1 -1
- package/lib/constants/ClientConstants.js.map +1 -1
- package/lib/contract/ContractByteCodeQuery.cjs +1 -2
- package/lib/contract/ContractCallQuery.cjs +1 -2
- package/lib/contract/ContractCreateFlow.cjs +1 -2
- package/lib/contract/ContractCreateFlow.js +1 -1
- package/lib/contract/ContractCreateFlow.js.map +1 -1
- package/lib/contract/ContractCreateTransaction.cjs +1 -2
- package/lib/contract/ContractDeleteTransaction.cjs +1 -2
- package/lib/contract/ContractExecuteTransaction.cjs +1 -2
- package/lib/contract/ContractFunctionParameters.cjs +1 -2
- package/lib/contract/ContractFunctionParameters.js +1 -1
- package/lib/contract/ContractFunctionParameters.js.map +1 -1
- package/lib/contract/ContractFunctionResult.cjs +1 -2
- package/lib/contract/ContractFunctionResult.js +1 -1
- package/lib/contract/ContractFunctionResult.js.map +1 -1
- package/lib/contract/ContractFunctionSelector.cjs +1 -2
- package/lib/contract/ContractId.cjs +1 -2
- package/lib/contract/ContractId.js +1 -1
- package/lib/contract/ContractId.js.map +1 -1
- package/lib/contract/ContractInfo.cjs +1 -2
- package/lib/contract/ContractInfoQuery.cjs +1 -2
- package/lib/contract/ContractNonceInfo.cjs +1 -2
- package/lib/contract/ContractStateChange.cjs +1 -2
- package/lib/contract/ContractUpdateTransaction.cjs +1 -2
- package/lib/contract/DelegateContractId.js +1 -1
- package/lib/contract/DelegateContractId.js.map +1 -1
- package/lib/contract/StorageChange.cjs +1 -2
- package/lib/cryptography/keccak.js +1 -1
- package/lib/cryptography/keccak.js.map +1 -1
- package/lib/cryptography/sha384.native.cjs +1 -2
- package/lib/encoding/base64.native.js +1 -1
- package/lib/encoding/base64.native.js.map +1 -1
- package/lib/encoding/hex.browser.js +1 -1
- package/lib/encoding/hex.browser.js.map +1 -1
- package/lib/encoding/utf8.native.cjs +1 -2
- package/lib/exports.cjs +1 -2
- package/lib/file/FileAppendTransaction.cjs +1 -2
- package/lib/file/FileContentsQuery.cjs +1 -2
- package/lib/file/FileCreateTransaction.cjs +1 -2
- package/lib/file/FileCreateTransaction.js +1 -1
- package/lib/file/FileCreateTransaction.js.map +1 -1
- package/lib/file/FileDeleteTransaction.cjs +1 -2
- package/lib/file/FileId.cjs +1 -2
- package/lib/file/FileInfo.cjs +1 -2
- package/lib/file/FileInfoQuery.cjs +1 -2
- package/lib/file/FileUpdateTransaction.cjs +1 -2
- package/lib/file/FileUpdateTransaction.js +1 -1
- package/lib/file/FileUpdateTransaction.js.map +1 -1
- package/lib/network/AddressBookQuery.cjs +1 -2
- package/lib/network/AddressBookQuery.js +1 -1
- package/lib/network/AddressBookQuery.js.map +1 -1
- package/lib/network/AddressBookQueryWeb.js +1 -1
- package/lib/network/AddressBookQueryWeb.js.map +1 -1
- package/lib/network/NetworkVersionInfo.cjs +1 -2
- package/lib/network/NetworkVersionInfoQuery.cjs +1 -2
- package/lib/network/SemanticVersion.cjs +1 -2
- package/lib/node/NodeCreateTransaction.cjs +1 -2
- package/lib/node/NodeCreateTransaction.js +1 -1
- package/lib/node/NodeCreateTransaction.js.map +1 -1
- package/lib/node/NodeDeleteTransaction.cjs +15 -3
- package/lib/node/NodeDeleteTransaction.d.ts +2 -1
- package/lib/node/NodeDeleteTransaction.js +1 -1
- package/lib/node/NodeDeleteTransaction.js.map +1 -1
- package/lib/node/NodeUpdateTransaction.cjs +13 -3
- package/lib/node/NodeUpdateTransaction.d.ts +2 -1
- package/lib/node/NodeUpdateTransaction.js +1 -1
- package/lib/node/NodeUpdateTransaction.js.map +1 -1
- package/lib/query/CostQuery.cjs +1 -2
- package/lib/query/MirrorNodeContractCallQuery.cjs +1 -2
- package/lib/query/MirrorNodeContractEstimateQuery.cjs +1 -2
- package/lib/query/MirrorNodeContractQuery.cjs +2 -1
- package/lib/query/MirrorNodeContractQuery.js +1 -1
- package/lib/query/MirrorNodeContractQuery.js.map +1 -1
- package/lib/query/Query.cjs +1 -2
- package/lib/query/Query.js +1 -1
- package/lib/query/Query.js.map +1 -1
- package/lib/query/QueryBase.cjs +1 -2
- package/lib/schedule/ScheduleCreateTransaction.cjs +1 -2
- package/lib/schedule/ScheduleCreateTransaction.js +1 -1
- package/lib/schedule/ScheduleCreateTransaction.js.map +1 -1
- package/lib/schedule/ScheduleDeleteTransaction.cjs +1 -2
- package/lib/schedule/ScheduleId.cjs +1 -2
- package/lib/schedule/ScheduleInfo.cjs +1 -2
- package/lib/schedule/ScheduleInfoQuery.cjs +1 -2
- package/lib/schedule/ScheduleSignTransaction.cjs +1 -2
- package/lib/system/FreezeTransaction.cjs +1 -2
- package/lib/system/SystemDeleteTransaction.cjs +1 -2
- package/lib/system/SystemUndeleteTransaction.cjs +1 -2
- package/lib/token/AbstractTokenTransferTransaction.js +1 -1
- package/lib/token/AbstractTokenTransferTransaction.js.map +1 -1
- package/lib/token/AssessedCustomFee.js +1 -1
- package/lib/token/AssessedCustomFee.js.map +1 -1
- package/lib/token/NftId.cjs +1 -2
- package/lib/token/TokenAirdropTransaction.cjs +1 -2
- package/lib/token/TokenAssociateTransaction.cjs +1 -2
- package/lib/token/TokenAssociateTransaction.js +1 -1
- package/lib/token/TokenAssociateTransaction.js.map +1 -1
- package/lib/token/TokenBurnTransaction.cjs +1 -2
- package/lib/token/TokenBurnTransaction.js +1 -1
- package/lib/token/TokenBurnTransaction.js.map +1 -1
- package/lib/token/TokenCancelAirdropTransaction.cjs +1 -2
- package/lib/token/TokenCancelAirdropTransaction.js +1 -1
- package/lib/token/TokenCancelAirdropTransaction.js.map +1 -1
- package/lib/token/TokenClaimAirdropTransaction.cjs +1 -2
- package/lib/token/TokenClaimAirdropTransaction.js +1 -1
- package/lib/token/TokenClaimAirdropTransaction.js.map +1 -1
- package/lib/token/TokenCreateTransaction.cjs +1 -2
- package/lib/token/TokenCreateTransaction.js +1 -1
- package/lib/token/TokenCreateTransaction.js.map +1 -1
- package/lib/token/TokenDeleteTransaction.cjs +1 -2
- package/lib/token/TokenDissociateTransaction.cjs +1 -2
- package/lib/token/TokenDissociateTransaction.js +1 -1
- package/lib/token/TokenDissociateTransaction.js.map +1 -1
- package/lib/token/TokenFeeScheduleUpdateTransaction.cjs +1 -2
- package/lib/token/TokenFeeScheduleUpdateTransaction.js +1 -1
- package/lib/token/TokenFeeScheduleUpdateTransaction.js.map +1 -1
- package/lib/token/TokenFreezeTransaction.cjs +1 -2
- package/lib/token/TokenGrantKycTransaction.cjs +1 -2
- package/lib/token/TokenId.cjs +1 -2
- package/lib/token/TokenInfo.cjs +1 -2
- package/lib/token/TokenInfo.js +1 -1
- package/lib/token/TokenInfo.js.map +1 -1
- package/lib/token/TokenInfoQuery.cjs +1 -2
- package/lib/token/TokenMintTransaction.cjs +1 -2
- package/lib/token/TokenMintTransaction.js +1 -1
- package/lib/token/TokenMintTransaction.js.map +1 -1
- package/lib/token/TokenNftInfo.cjs +1 -2
- package/lib/token/TokenNftInfoQuery.cjs +1 -2
- package/lib/token/TokenNftInfoQuery.js +1 -1
- package/lib/token/TokenNftInfoQuery.js.map +1 -1
- package/lib/token/TokenNftsUpdateTransaction.cjs +1 -2
- package/lib/token/TokenPauseTransaction.cjs +1 -2
- package/lib/token/TokenRejectFlow.js +1 -1
- package/lib/token/TokenRejectFlow.js.map +1 -1
- package/lib/token/TokenRejectTransaction.cjs +1 -2
- package/lib/token/TokenRejectTransaction.js +1 -1
- package/lib/token/TokenRejectTransaction.js.map +1 -1
- package/lib/token/TokenRevokeKycTransaction.cjs +1 -2
- package/lib/token/TokenUnfreezeTransaction.cjs +1 -2
- package/lib/token/TokenUnpauseTransaction.cjs +1 -2
- package/lib/token/TokenUpdateNftsTransaction.cjs +1 -2
- package/lib/token/TokenUpdateTransaction.cjs +1 -2
- package/lib/token/TokenWipeTransaction.cjs +1 -2
- package/lib/token/TokenWipeTransaction.js +1 -1
- package/lib/token/TokenWipeTransaction.js.map +1 -1
- package/lib/topic/TopicCreateTransaction.cjs +1 -2
- package/lib/topic/TopicCreateTransaction.js +1 -1
- package/lib/topic/TopicCreateTransaction.js.map +1 -1
- package/lib/topic/TopicDeleteTransaction.cjs +1 -2
- package/lib/topic/TopicId.cjs +1 -2
- package/lib/topic/TopicInfo.cjs +1 -2
- package/lib/topic/TopicInfo.js +1 -1
- package/lib/topic/TopicInfo.js.map +1 -1
- package/lib/topic/TopicInfoQuery.cjs +1 -2
- package/lib/topic/TopicMessage.js +1 -1
- package/lib/topic/TopicMessage.js.map +1 -1
- package/lib/topic/TopicMessageQuery.cjs +1 -2
- package/lib/topic/TopicMessageQuery.js +1 -1
- package/lib/topic/TopicMessageQuery.js.map +1 -1
- package/lib/topic/TopicMessageSubmitTransaction.cjs +1 -2
- package/lib/topic/TopicUpdateTransaction.cjs +1 -2
- package/lib/topic/TopicUpdateTransaction.js +1 -1
- package/lib/topic/TopicUpdateTransaction.js.map +1 -1
- package/lib/transaction/BatchTransaction.cjs +1 -2
- package/lib/transaction/BatchTransaction.js +1 -1
- package/lib/transaction/BatchTransaction.js.map +1 -1
- package/lib/transaction/CustomFeeLimit.js +1 -1
- package/lib/transaction/CustomFeeLimit.js.map +1 -1
- package/lib/transaction/NodeAccountIdSignatureMap.cjs +1 -2
- package/lib/transaction/NodeAccountIdSignatureMap.js +1 -1
- package/lib/transaction/NodeAccountIdSignatureMap.js.map +1 -1
- package/lib/transaction/NodeAccountIdSignatureMapLegacy.js +1 -1
- package/lib/transaction/NodeAccountIdSignatureMapLegacy.js.map +1 -1
- package/lib/transaction/SignatureMap.js +1 -1
- package/lib/transaction/SignatureMap.js.map +1 -1
- package/lib/transaction/SignatureMapLegacy.js +1 -1
- package/lib/transaction/SignatureMapLegacy.js.map +1 -1
- package/lib/transaction/SignaturePairMap.js +1 -1
- package/lib/transaction/SignaturePairMap.js.map +1 -1
- package/lib/transaction/Transaction.cjs +1 -2
- package/lib/transaction/Transaction.js +1 -1
- package/lib/transaction/Transaction.js.map +1 -1
- package/lib/transaction/TransactionHashMap.cjs +1 -2
- package/lib/transaction/TransactionHashMap.js +1 -1
- package/lib/transaction/TransactionHashMap.js.map +1 -1
- package/lib/transaction/TransactionId.cjs +1 -2
- package/lib/transaction/TransactionReceipt.cjs +1 -2
- package/lib/transaction/TransactionReceipt.js +1 -1
- package/lib/transaction/TransactionReceipt.js.map +1 -1
- package/lib/transaction/TransactionReceiptQuery.cjs +1 -2
- package/lib/transaction/TransactionRecord.cjs +1 -2
- package/lib/transaction/TransactionRecord.js +1 -1
- package/lib/transaction/TransactionRecord.js.map +1 -1
- package/lib/transaction/TransactionRecordQuery.cjs +1 -2
- package/lib/transaction/TransactionResponse.cjs +1 -2
- package/lib/transaction/TransactionResponse.js.map +1 -1
- package/lib/util/ASN1-Decoder.js +1 -1
- package/lib/util/ASN1-Decoder.js.map +1 -1
- package/lib/util.js +1 -1
- package/lib/util.js.map +1 -1
- package/lib/version.js +1 -1
- package/package.json +75 -71
- package/src/Executable.js +10 -4
- package/src/LocalProviderWeb.js +165 -0
- package/src/Timestamp.js +2 -2
- package/src/account/AccountAllowanceAdjustTransaction.js +48 -48
- package/src/account/AccountAllowanceApproveTransaction.js +48 -48
- package/src/account/TokenNftAllowance.js +4 -4
- package/src/browser.js +1 -0
- package/src/client/NodeClient.js +6 -9
- package/src/client/WebClient.js +33 -8
- package/src/client/addressbooks/mainnet.js +1 -1
- package/src/client/addressbooks/previewnet.js +1 -1
- package/src/client/addressbooks/testnet.js +1 -1
- package/src/constants/ClientConstants.js +25 -0
- package/src/network/AddressBookQueryWeb.js +8 -2
- package/src/node/NodeDeleteTransaction.js +20 -1
- package/src/node/NodeUpdateTransaction.js +19 -1
- package/src/query/MirrorNodeContractQuery.js +8 -1
- package/src/token/TokenInfo.js +4 -4
- package/src/topic/TopicMessageQuery.js +7 -5
- package/src/transaction/TransactionRecord.js +5 -5
- package/src/transaction/TransactionResponse.js +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenInfo.js","sources":["../../src/token/TokenInfo.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport TokenId from \"./TokenId.js\";\nimport AccountId from \"../account/AccountId.js\";\nimport Duration from \"../Duration.js\";\nimport Timestamp from \"../Timestamp.js\";\nimport Long from \"long\";\nimport * as HieroProto from \"@hashgraph/proto\";\nimport TokenType from \"./TokenType.js\";\nimport TokenSupplyType from \"./TokenSupplyType.js\";\nimport CustomFixedFee from \"./CustomFixedFee.js\";\nimport CustomFractionalFee from \"./CustomFractionalFee.js\";\nimport CustomRoyaltyFee from \"./CustomRoyaltyFee.js\";\nimport Key from \"../Key.js\";\nimport LedgerId from \"../LedgerId.js\";\n\n/**\n * @typedef {import(\"./CustomFee.js\").default} CustomFee\n */\n\n/**\n * Response when the client sends the node TokenGetInfoQuery.\n */\nexport default class TokenInfo {\n /**\n * @private\n * @param {object} props\n * @param {TokenId} props.tokenId;\n * @param {string} props.name;\n * @param {string} props.symbol;\n * @param {number} props.decimals;\n * @param {Long} props.totalSupply;\n * @param {AccountId | null} props.treasuryAccountId;\n * @param {Key | null} props.adminKey;\n * @param {Key | null} props.kycKey;\n * @param {Key | null} props.freezeKey;\n * @param {Key | null} props.pauseKey;\n * @param {Key | null} props.wipeKey;\n * @param {Key | null} props.supplyKey;\n * @param {Key | null} props.feeScheduleKey;\n * @param {boolean | null} props.defaultFreezeStatus;\n * @param {boolean | null} props.defaultKycStatus;\n * @param {boolean | null} props.pauseStatus;\n * @param {boolean} props.isDeleted;\n * @param {AccountId | null} props.autoRenewAccountId;\n * @param {Duration | null} props.autoRenewPeriod;\n * @param {Timestamp | null} props.expirationTime;\n * @param {string} props.tokenMemo;\n * @param {CustomFee[]} props.customFees;\n * @param {TokenType | null} props.tokenType;\n * @param {TokenSupplyType | null} props.supplyType;\n * @param {Long | null} props.maxSupply;\n * @param {LedgerId|null} props.ledgerId;\n * @param {Key | null} props.metadataKey;\n * @param {Uint8Array | null} props.metadata;\n */\n constructor(props) {\n /**\n * ID of the token instance\n *\n * @readonly\n */\n this.tokenId = props.tokenId;\n\n /**\n * The name of the token. It is a string of ASCII only characters\n *\n * @readonly\n */\n this.name = props.name;\n\n /**\n * The symbol of the token. It is a UTF-8 capitalized alphabetical string\n *\n * @readonly\n */\n this.symbol = props.symbol;\n\n /**\n * The number of decimal places a token is divisible by\n *\n * @readonly\n */\n this.decimals = props.decimals;\n\n /**\n * The total supply of tokens that are currently in circulation\n *\n * @readonly\n */\n this.totalSupply = props.totalSupply;\n\n /**\n * The ID of the account which is set as treasuryAccountId\n *\n * @readonly\n */\n this.treasuryAccountId = props.treasuryAccountId;\n\n /**\n * The key which can perform update/delete operations on the token. If empty, the token can be perceived as\n * immutable (not being able to be updated/deleted)\n *\n * @readonly\n */\n this.adminKey = props.adminKey;\n\n /**\n * The key which can grant or revoke KYC of an account for the token's transactions. If empty, KYC is not required,\n * and KYC grant or revoke operations are not possible.\n *\n * @readonly\n */\n this.kycKey = props.kycKey;\n\n /**\n * The key which can freeze or unfreeze an account for token transactions. If empty, freezing is not possible\n *\n * @readonly\n */\n this.freezeKey = props.freezeKey;\n\n /**\n * The Key which can pause and unpause the Token.\n *\n * @readonly\n */\n this.pauseKey = props.pauseKey;\n\n /**\n * The key which can wipe token balance of an account. If empty, wipe is not possible\n *\n * @readonly\n */\n this.wipeKey = props.wipeKey;\n\n /**\n * The key which can change the supply of a token. The key is used to sign Token Mint/Burn operations\n *\n * @readonly\n */\n this.supplyKey = props.supplyKey;\n\n this.feeScheduleKey = props.feeScheduleKey;\n\n /**\n * The default Freeze status (not applicable = null, frozen = false, or unfrozen = true) of Hedera accounts relative to this token.\n * FreezeNotApplicable is returned if Token Freeze Key is empty. Frozen is returned if Token Freeze Key is set and\n * defaultFreeze is set to true. Unfrozen is returned if Token Freeze Key is set and defaultFreeze is set to false\n * FreezeNotApplicable = null;\n * Frozen = true;\n * Unfrozen = false;\n *\n * @readonly\n */\n this.defaultFreezeStatus = props.defaultFreezeStatus;\n\n /**\n * The default KYC status (KycNotApplicable or Revoked) of Hedera accounts relative to this token. KycNotApplicable\n * is returned if KYC key is not set, otherwise Revoked\n * KycNotApplicable = null;\n * Granted = true;\n * Revoked = false;\n *\n * @readonly\n */\n this.defaultKycStatus = props.defaultKycStatus;\n\n /**\n * The default pause status of Hedera accounts relative to this token.\n * PauseNotApplicable is returned if pauseKey is not set\n * PauseNotApplicable = null;\n * Paused = true;\n * Unpaused = false;\n *\n * @readonly\n */\n this.pauseStatus = props.pauseStatus;\n\n /**\n * Specifies whether the token was deleted or not\n *\n * @readonly\n */\n this.isDeleted = props.isDeleted;\n\n /**\n * An account which will be automatically charged to renew the token's expiration, at autoRenewPeriod interval\n *\n * @readonly\n */\n this.autoRenewAccountId = props.autoRenewAccountId;\n\n /**\n * The interval at which the auto-renew account will be charged to extend the token's expiry\n *\n * @readonly\n */\n this.autoRenewPeriod = props.autoRenewPeriod;\n\n /**\n * The epoch second at which the token expire: will; if an auto-renew account and period are specified,\n * this is coerced to the current epoch second plus the autoRenewPeriod\n *\n * @readonly\n */\n this.expirationTime = props.expirationTime;\n\n /**\n * The memo associated with the token.\n *\n * @readonly\n */\n this.tokenMemo = props.tokenMemo;\n\n this.customFees = props.customFees;\n\n this.tokenType = props.tokenType;\n\n this.supplyType = props.supplyType;\n\n this.maxSupply = props.maxSupply;\n\n this.ledgerId = props.ledgerId;\n\n /**\n * @description The key which can change the metadata of a token (token definition and individual NFTs).\n *\n * @readonly\n */\n this.metadataKey = props.metadataKey;\n\n /**\n * @description Metadata of the created token definition.\n * @readonly\n */\n this.metadata = props.metadata;\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITokenInfo} info\n * @returns {TokenInfo}\n */\n static _fromProtobuf(info) {\n const defaultFreezeStatus =\n /** @type {HieroProto.proto.TokenFreezeStatus} */ (\n info.defaultFreezeStatus\n );\n const defaultKycStatus =\n /** @type {HieroProto.proto.TokenKycStatus} */ (\n info.defaultKycStatus\n );\n const pauseStatus = /**@type {HieroProto.proto.TokenPauseStatus} */ (\n info.pauseStatus\n );\n\n const autoRenewAccountId =\n info.autoRenewAccount != null\n ? AccountId._fromProtobuf(info.autoRenewAccount)\n : new AccountId(0);\n\n return new TokenInfo({\n tokenId: TokenId._fromProtobuf(\n /** @type {HieroProto.proto.ITokenID} */ (info.tokenId),\n ),\n name: /** @type {string} */ (info.name),\n symbol: /** @type {string} */ (info.symbol),\n decimals: /** @type {number} */ (info.decimals),\n totalSupply: Long.fromValue(/** @type {Long} */ (info.totalSupply)),\n treasuryAccountId:\n info.treasury != null\n ? AccountId._fromProtobuf(\n /** @type {HieroProto.proto.IAccountID} */ (\n info.treasury\n ),\n )\n : null,\n adminKey:\n info.adminKey != null\n ? Key._fromProtobufKey(info.adminKey)\n : null,\n kycKey:\n info.kycKey != null ? Key._fromProtobufKey(info.kycKey) : null,\n freezeKey:\n info.freezeKey != null\n ? Key._fromProtobufKey(info.freezeKey)\n : null,\n pauseKey:\n info.pauseKey != null\n ? Key._fromProtobufKey(info.pauseKey)\n : null,\n wipeKey:\n info.wipeKey != null\n ? Key._fromProtobufKey(info.wipeKey)\n : null,\n supplyKey:\n info.supplyKey != null\n ? Key._fromProtobufKey(info.supplyKey)\n : null,\n feeScheduleKey:\n info.feeScheduleKey != null\n ? Key._fromProtobufKey(info.feeScheduleKey)\n : null,\n defaultFreezeStatus:\n defaultFreezeStatus === 0 ? null : defaultFreezeStatus == 1,\n defaultKycStatus:\n defaultKycStatus === 0 ? null : defaultKycStatus == 1,\n pauseStatus: pauseStatus === 0 ? null : pauseStatus == 1,\n isDeleted: /** @type {boolean} */ (info.deleted),\n autoRenewAccountId: !(\n autoRenewAccountId.shard.toInt() == 0 &&\n autoRenewAccountId.realm.toInt() == 0 &&\n autoRenewAccountId.num.toInt() == 0\n )\n ? autoRenewAccountId\n : null,\n autoRenewPeriod:\n info.autoRenewPeriod != null\n ? Duration._fromProtobuf(\n /** @type {HieroProto.proto.IDuration} */ (\n info.autoRenewPeriod\n ),\n )\n : null,\n expirationTime:\n info.expiry != null\n ? Timestamp._fromProtobuf(\n /** @type {HieroProto.proto.ITimestamp} */ (\n info.expiry\n ),\n )\n : null,\n tokenMemo: info.memo != null ? info.memo : \"\",\n customFees:\n info.customFees != null\n ? info.customFees.map((fee) => {\n if (fee.fixedFee != null) {\n return CustomFixedFee._fromProtobuf(fee);\n } else if (fee.fractionalFee != null) {\n return CustomFractionalFee._fromProtobuf(fee);\n } else {\n return CustomRoyaltyFee._fromProtobuf(fee);\n }\n })\n : [],\n tokenType:\n info.tokenType != null\n ? TokenType._fromCode(info.tokenType)\n : null,\n supplyType:\n info.supplyType != null\n ? TokenSupplyType._fromCode(info.supplyType)\n : null,\n maxSupply: info.maxSupply != null ? info.maxSupply : null,\n ledgerId:\n info.ledgerId != null\n ? LedgerId.fromBytes(info.ledgerId)\n : null,\n metadataKey:\n info.metadataKey != null\n ? Key._fromProtobufKey(info.metadataKey)\n : null,\n metadata: info.metadata != null ? info.metadata : new Uint8Array(),\n });\n }\n\n /**\n * @returns {HieroProto.proto.ITokenInfo}\n */\n _toProtobuf() {\n return {\n tokenId: this.tokenId._toProtobuf(),\n name: this.name,\n symbol: this.symbol,\n decimals: this.decimals,\n totalSupply: this.totalSupply,\n treasury:\n this.treasuryAccountId != null\n ? this.treasuryAccountId._toProtobuf()\n : null,\n adminKey:\n this.adminKey != null ? this.adminKey._toProtobufKey() : null,\n kycKey: this.kycKey != null ? this.kycKey._toProtobufKey() : null,\n freezeKey:\n this.freezeKey != null ? this.freezeKey._toProtobufKey() : null,\n pauseKey:\n this.pauseKey != null ? this.pauseKey._toProtobufKey() : null,\n wipeKey:\n this.wipeKey != null ? this.wipeKey._toProtobufKey() : null,\n supplyKey:\n this.supplyKey != null ? this.supplyKey._toProtobufKey() : null,\n feeScheduleKey:\n this.feeScheduleKey != null\n ? this.feeScheduleKey._toProtobufKey()\n : null,\n defaultFreezeStatus:\n this.defaultFreezeStatus == null\n ? 0\n : this.defaultFreezeStatus\n ? 1\n : 2,\n defaultKycStatus:\n this.defaultKycStatus == null\n ? 0\n : this.defaultKycStatus\n ? 1\n : 2,\n pauseStatus:\n this.pauseStatus == null ? 0 : this.pauseStatus ? 1 : 2,\n deleted: this.isDeleted,\n autoRenewAccount:\n this.autoRenewAccountId != null\n ? this.autoRenewAccountId._toProtobuf()\n : undefined,\n autoRenewPeriod:\n this.autoRenewPeriod != null\n ? this.autoRenewPeriod._toProtobuf()\n : null,\n expiry:\n this.expirationTime != null\n ? this.expirationTime._toProtobuf()\n : null,\n memo: this.tokenMemo,\n customFees: this.customFees.map((fee) => fee._toProtobuf()),\n tokenType: this.tokenType != null ? this.tokenType._code : null,\n supplyType: this.supplyType != null ? this.supplyType._code : null,\n maxSupply: this.maxSupply,\n ledgerId: this.ledgerId != null ? this.ledgerId.toBytes() : null,\n metadataKey:\n this.metadataKey != null\n ? this.metadataKey._toProtobufKey()\n : null,\n metadata: this.metadata != null ? this.metadata : null,\n };\n }\n\n /**\n * @param {Uint8Array} bytes\n * @returns {TokenInfo}\n */\n static fromBytes(bytes) {\n return TokenInfo._fromProtobuf(\n HieroProto.proto.TokenInfo.decode(bytes),\n );\n }\n\n /**\n * @returns {Uint8Array}\n */\n toBytes() {\n return HieroProto.proto.TokenInfo.encode(this._toProtobuf()).finish();\n }\n}\n"],"names":["TokenInfo","constructor","props","this","tokenId","name","symbol","decimals","totalSupply","treasuryAccountId","adminKey","kycKey","freezeKey","pauseKey","wipeKey","supplyKey","feeScheduleKey","defaultFreezeStatus","defaultKycStatus","pauseStatus","isDeleted","autoRenewAccountId","autoRenewPeriod","expirationTime","tokenMemo","customFees","tokenType","supplyType","maxSupply","ledgerId","metadataKey","metadata","_fromProtobuf","info","autoRenewAccount","AccountId","TokenId","Long","fromValue","treasury","Key","_fromProtobufKey","shard","toInt","realm","num","Duration","expiry","Timestamp","memo","map","fee","fixedFee","CustomFixedFee","fractionalFee","CustomFractionalFee","CustomRoyaltyFee","TokenType","_fromCode","TokenSupplyType","LedgerId","fromBytes","Uint8Array","_toProtobuf","_toProtobufKey","deleted","undefined","_code","toBytes","bytes","HieroProto","proto","decode","encode","finish"],"mappings":"gaAuBe,MAAMA,EAiCjB,WAAAC,CAAYC,GAMRC,KAAKC,QAAUF,EAAME,QAOrBD,KAAKE,KAAOH,EAAMG,KAOlBF,KAAKG,OAASJ,EAAMI,OAOpBH,KAAKI,SAAWL,EAAMK,SAOtBJ,KAAKK,YAAcN,EAAMM,YAOzBL,KAAKM,kBAAoBP,EAAMO,kBAQ/BN,KAAKO,S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,cACpB,KACVd,KAAM9C,KAAKqB,UACXC,WAAYtB,KAAKsB,WAAWyB,KAAKC,GAAQA,EAAIY,gBAC7CrC,UAA6B,MAAlBvB,KAAKuB,UAAoBvB,KAAKuB,UAAUyC,MAAQ,KAC3DxC,WAA+B,MAAnBxB,KAAKwB,WAAqBxB,KAAKwB,WAAWwC,MAAQ,KAC9DvC,UAAWzB,KAAKyB,UAChBC,SAA2B,MAAjB1B,KAAK0B,SAAmB1B,KAAK0B,SAASuC,UAAY,KAC5DtC,YACwB,MAApB3B,KAAK2B,YACC3B,KAAK2B,YAAYkC,iBACjB,KACVjC,SAA2B,MAAjB5B,KAAK4B,SAAmB5B,KAAK4B,SAAW,KAE9D,CAMI,gBAAO8B,CAAUQ,GACb,OAAOrE,EAAUgC,cACbsC,EAAWC,MAAMvE,UAAUwE,OAAOH,GAE9C,CAKI,OAAAD,GACI,OAAOE,EAAWC,MAAMvE,UAAUyE,OAAOtE,KAAK4D,eAAeW,QACrE"}
|
|
1
|
+
{"version":3,"file":"TokenInfo.js","sources":["../../src/token/TokenInfo.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport TokenId from \"./TokenId.js\";\nimport AccountId from \"../account/AccountId.js\";\nimport Duration from \"../Duration.js\";\nimport Timestamp from \"../Timestamp.js\";\nimport Long from \"long\";\nimport * as HieroProto from \"@hashgraph/proto\";\nimport TokenType from \"./TokenType.js\";\nimport TokenSupplyType from \"./TokenSupplyType.js\";\nimport CustomFixedFee from \"./CustomFixedFee.js\";\nimport CustomFractionalFee from \"./CustomFractionalFee.js\";\nimport CustomRoyaltyFee from \"./CustomRoyaltyFee.js\";\nimport Key from \"../Key.js\";\nimport LedgerId from \"../LedgerId.js\";\n\n/**\n * @typedef {import(\"./CustomFee.js\").default} CustomFee\n */\n\n/**\n * Response when the client sends the node TokenGetInfoQuery.\n */\nexport default class TokenInfo {\n /**\n * @private\n * @param {object} props\n * @param {TokenId} props.tokenId;\n * @param {string} props.name;\n * @param {string} props.symbol;\n * @param {number} props.decimals;\n * @param {Long} props.totalSupply;\n * @param {AccountId | null} props.treasuryAccountId;\n * @param {Key | null} props.adminKey;\n * @param {Key | null} props.kycKey;\n * @param {Key | null} props.freezeKey;\n * @param {Key | null} props.pauseKey;\n * @param {Key | null} props.wipeKey;\n * @param {Key | null} props.supplyKey;\n * @param {Key | null} props.feeScheduleKey;\n * @param {boolean | null} props.defaultFreezeStatus;\n * @param {boolean | null} props.defaultKycStatus;\n * @param {boolean | null} props.pauseStatus;\n * @param {boolean} props.isDeleted;\n * @param {AccountId | null} props.autoRenewAccountId;\n * @param {Duration | null} props.autoRenewPeriod;\n * @param {Timestamp | null} props.expirationTime;\n * @param {string} props.tokenMemo;\n * @param {CustomFee[]} props.customFees;\n * @param {TokenType | null} props.tokenType;\n * @param {TokenSupplyType | null} props.supplyType;\n * @param {Long | null} props.maxSupply;\n * @param {LedgerId|null} props.ledgerId;\n * @param {Key | null} props.metadataKey;\n * @param {Uint8Array | null} props.metadata;\n */\n constructor(props) {\n /**\n * ID of the token instance\n *\n * @readonly\n */\n this.tokenId = props.tokenId;\n\n /**\n * The name of the token. It is a string of ASCII only characters\n *\n * @readonly\n */\n this.name = props.name;\n\n /**\n * The symbol of the token. It is a UTF-8 capitalized alphabetical string\n *\n * @readonly\n */\n this.symbol = props.symbol;\n\n /**\n * The number of decimal places a token is divisible by\n *\n * @readonly\n */\n this.decimals = props.decimals;\n\n /**\n * The total supply of tokens that are currently in circulation\n *\n * @readonly\n */\n this.totalSupply = props.totalSupply;\n\n /**\n * The ID of the account which is set as treasuryAccountId\n *\n * @readonly\n */\n this.treasuryAccountId = props.treasuryAccountId;\n\n /**\n * The key which can perform update/delete operations on the token. If empty, the token can be perceived as\n * immutable (not being able to be updated/deleted)\n *\n * @readonly\n */\n this.adminKey = props.adminKey;\n\n /**\n * The key which can grant or revoke KYC of an account for the token's transactions. If empty, KYC is not required,\n * and KYC grant or revoke operations are not possible.\n *\n * @readonly\n */\n this.kycKey = props.kycKey;\n\n /**\n * The key which can freeze or unfreeze an account for token transactions. If empty, freezing is not possible\n *\n * @readonly\n */\n this.freezeKey = props.freezeKey;\n\n /**\n * The Key which can pause and unpause the Token.\n *\n * @readonly\n */\n this.pauseKey = props.pauseKey;\n\n /**\n * The key which can wipe token balance of an account. If empty, wipe is not possible\n *\n * @readonly\n */\n this.wipeKey = props.wipeKey;\n\n /**\n * The key which can change the supply of a token. The key is used to sign Token Mint/Burn operations\n *\n * @readonly\n */\n this.supplyKey = props.supplyKey;\n\n this.feeScheduleKey = props.feeScheduleKey;\n\n /**\n * The default Freeze status (not applicable = null, frozen = false, or unfrozen = true) of Hedera accounts relative to this token.\n * FreezeNotApplicable is returned if Token Freeze Key is empty. Frozen is returned if Token Freeze Key is set and\n * defaultFreeze is set to true. Unfrozen is returned if Token Freeze Key is set and defaultFreeze is set to false\n * FreezeNotApplicable = null;\n * Frozen = true;\n * Unfrozen = false;\n *\n * @readonly\n */\n this.defaultFreezeStatus = props.defaultFreezeStatus;\n\n /**\n * The default KYC status (KycNotApplicable or Revoked) of Hedera accounts relative to this token. KycNotApplicable\n * is returned if KYC key is not set, otherwise Revoked\n * KycNotApplicable = null;\n * Granted = true;\n * Revoked = false;\n *\n * @readonly\n */\n this.defaultKycStatus = props.defaultKycStatus;\n\n /**\n * The default pause status of Hedera accounts relative to this token.\n * PauseNotApplicable is returned if pauseKey is not set\n * PauseNotApplicable = null;\n * Paused = true;\n * Unpaused = false;\n *\n * @readonly\n */\n this.pauseStatus = props.pauseStatus;\n\n /**\n * Specifies whether the token was deleted or not\n *\n * @readonly\n */\n this.isDeleted = props.isDeleted;\n\n /**\n * An account which will be automatically charged to renew the token's expiration, at autoRenewPeriod interval\n *\n * @readonly\n */\n this.autoRenewAccountId = props.autoRenewAccountId;\n\n /**\n * The interval at which the auto-renew account will be charged to extend the token's expiry\n *\n * @readonly\n */\n this.autoRenewPeriod = props.autoRenewPeriod;\n\n /**\n * The epoch second at which the token expire: will; if an auto-renew account and period are specified,\n * this is coerced to the current epoch second plus the autoRenewPeriod\n *\n * @readonly\n */\n this.expirationTime = props.expirationTime;\n\n /**\n * The memo associated with the token.\n *\n * @readonly\n */\n this.tokenMemo = props.tokenMemo;\n\n this.customFees = props.customFees;\n\n this.tokenType = props.tokenType;\n\n this.supplyType = props.supplyType;\n\n this.maxSupply = props.maxSupply;\n\n this.ledgerId = props.ledgerId;\n\n /**\n * @description The key which can change the metadata of a token (token definition and individual NFTs).\n *\n * @readonly\n */\n this.metadataKey = props.metadataKey;\n\n /**\n * @description Metadata of the created token definition.\n * @readonly\n */\n this.metadata = props.metadata;\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITokenInfo} info\n * @returns {TokenInfo}\n */\n static _fromProtobuf(info) {\n const defaultFreezeStatus =\n /** @type {HieroProto.proto.TokenFreezeStatus} */ (\n info.defaultFreezeStatus\n );\n const defaultKycStatus =\n /** @type {HieroProto.proto.TokenKycStatus} */ (\n info.defaultKycStatus\n );\n const pauseStatus = /**@type {HieroProto.proto.TokenPauseStatus} */ (\n info.pauseStatus\n );\n\n const autoRenewAccountId =\n info.autoRenewAccount != null\n ? AccountId._fromProtobuf(info.autoRenewAccount)\n : new AccountId(0);\n\n return new TokenInfo({\n tokenId: TokenId._fromProtobuf(\n /** @type {HieroProto.proto.ITokenID} */ (info.tokenId),\n ),\n name: /** @type {string} */ (info.name),\n symbol: /** @type {string} */ (info.symbol),\n decimals: /** @type {number} */ (info.decimals),\n totalSupply: Long.fromValue(/** @type {Long} */ (info.totalSupply)),\n treasuryAccountId:\n info.treasury != null\n ? AccountId._fromProtobuf(\n /** @type {HieroProto.proto.IAccountID} */ (\n info.treasury\n ),\n )\n : null,\n adminKey:\n info.adminKey != null\n ? Key._fromProtobufKey(info.adminKey)\n : null,\n kycKey:\n info.kycKey != null ? Key._fromProtobufKey(info.kycKey) : null,\n freezeKey:\n info.freezeKey != null\n ? Key._fromProtobufKey(info.freezeKey)\n : null,\n pauseKey:\n info.pauseKey != null\n ? Key._fromProtobufKey(info.pauseKey)\n : null,\n wipeKey:\n info.wipeKey != null\n ? Key._fromProtobufKey(info.wipeKey)\n : null,\n supplyKey:\n info.supplyKey != null\n ? Key._fromProtobufKey(info.supplyKey)\n : null,\n feeScheduleKey:\n info.feeScheduleKey != null\n ? Key._fromProtobufKey(info.feeScheduleKey)\n : null,\n defaultFreezeStatus:\n defaultFreezeStatus === 0 ? null : defaultFreezeStatus == 1,\n defaultKycStatus:\n defaultKycStatus === 0 ? null : defaultKycStatus == 1,\n pauseStatus: pauseStatus === 0 ? null : pauseStatus == 1,\n isDeleted: /** @type {boolean} */ (info.deleted),\n autoRenewAccountId: !(\n autoRenewAccountId.shard.toInt() == 0 &&\n autoRenewAccountId.realm.toInt() == 0 &&\n autoRenewAccountId.num.toInt() == 0\n )\n ? autoRenewAccountId\n : null,\n autoRenewPeriod:\n info.autoRenewPeriod != null\n ? Duration._fromProtobuf(\n /** @type {HieroProto.proto.IDuration} */ (\n info.autoRenewPeriod\n ),\n )\n : null,\n expirationTime:\n info.expiry != null\n ? Timestamp._fromProtobuf(\n /** @type {HieroProto.proto.ITimestamp} */ (\n info.expiry\n ),\n )\n : null,\n tokenMemo: info.memo != null ? info.memo : \"\",\n customFees:\n info.customFees != null\n ? info.customFees.map((fee) => {\n if (fee.fixedFee != null) {\n return CustomFixedFee._fromProtobuf(fee);\n } else if (fee.fractionalFee != null) {\n return CustomFractionalFee._fromProtobuf(fee);\n } else {\n return CustomRoyaltyFee._fromProtobuf(fee);\n }\n })\n : [],\n tokenType:\n info.tokenType != null\n ? TokenType._fromCode(info.tokenType)\n : null,\n supplyType:\n info.supplyType != null\n ? TokenSupplyType._fromCode(info.supplyType)\n : null,\n maxSupply: info.maxSupply != null ? info.maxSupply : null,\n ledgerId:\n info.ledgerId != null\n ? LedgerId.fromBytes(info.ledgerId)\n : null,\n metadataKey:\n info.metadataKey != null\n ? Key._fromProtobufKey(info.metadataKey)\n : null,\n metadata: info.metadata != null ? info.metadata : new Uint8Array(),\n });\n }\n\n /**\n * @returns {HieroProto.proto.ITokenInfo}\n */\n _toProtobuf() {\n return {\n tokenId: this.tokenId._toProtobuf(),\n name: this.name,\n symbol: this.symbol,\n decimals: this.decimals,\n totalSupply: this.totalSupply,\n treasury:\n this.treasuryAccountId != null\n ? this.treasuryAccountId._toProtobuf()\n : null,\n adminKey:\n this.adminKey != null ? this.adminKey._toProtobufKey() : null,\n kycKey: this.kycKey != null ? this.kycKey._toProtobufKey() : null,\n freezeKey:\n this.freezeKey != null ? this.freezeKey._toProtobufKey() : null,\n pauseKey:\n this.pauseKey != null ? this.pauseKey._toProtobufKey() : null,\n wipeKey:\n this.wipeKey != null ? this.wipeKey._toProtobufKey() : null,\n supplyKey:\n this.supplyKey != null ? this.supplyKey._toProtobufKey() : null,\n feeScheduleKey:\n this.feeScheduleKey != null\n ? this.feeScheduleKey._toProtobufKey()\n : null,\n defaultFreezeStatus:\n this.defaultFreezeStatus == null\n ? 0\n : this.defaultFreezeStatus\n ? 1\n : 2,\n defaultKycStatus:\n this.defaultKycStatus == null\n ? 0\n : this.defaultKycStatus\n ? 1\n : 2,\n pauseStatus:\n this.pauseStatus == null ? 0 : this.pauseStatus ? 1 : 2,\n deleted: this.isDeleted,\n autoRenewAccount:\n this.autoRenewAccountId != null\n ? this.autoRenewAccountId._toProtobuf()\n : undefined,\n autoRenewPeriod:\n this.autoRenewPeriod != null\n ? this.autoRenewPeriod._toProtobuf()\n : null,\n expiry:\n this.expirationTime != null\n ? this.expirationTime._toProtobuf()\n : null,\n memo: this.tokenMemo,\n customFees: this.customFees.map((fee) => fee._toProtobuf()),\n tokenType: this.tokenType != null ? this.tokenType._code : null,\n supplyType: this.supplyType != null ? this.supplyType._code : null,\n maxSupply: this.maxSupply,\n ledgerId: this.ledgerId != null ? this.ledgerId.toBytes() : null,\n metadataKey:\n this.metadataKey != null\n ? this.metadataKey._toProtobufKey()\n : null,\n metadata: this.metadata != null ? this.metadata : null,\n };\n }\n\n /**\n * @param {Uint8Array} bytes\n * @returns {TokenInfo}\n */\n static fromBytes(bytes) {\n return TokenInfo._fromProtobuf(\n HieroProto.proto.TokenInfo.decode(bytes),\n );\n }\n\n /**\n * @returns {Uint8Array}\n */\n toBytes() {\n return HieroProto.proto.TokenInfo.encode(this._toProtobuf()).finish();\n }\n}\n"],"names":["TokenInfo","constructor","props","this","tokenId","name","symbol","decimals","totalSupply","treasuryAccountId","adminKey","kycKey","freezeKey","pauseKey","wipeKey","supplyKey","feeScheduleKey","defaultFreezeStatus","defaultKycStatus","pauseStatus","isDeleted","autoRenewAccountId","autoRenewPeriod","expirationTime","tokenMemo","customFees","tokenType","supplyType","maxSupply","ledgerId","metadataKey","metadata","_fromProtobuf","info","autoRenewAccount","AccountId","TokenId","Long","fromValue","treasury","Key","_fromProtobufKey","shard","toInt","realm","num","Duration","expiry","Timestamp","memo","map","fee","fixedFee","CustomFixedFee","fractionalFee","CustomFractionalFee","CustomRoyaltyFee","TokenType","_fromCode","TokenSupplyType","LedgerId","fromBytes","Uint8Array","_toProtobuf","_toProtobufKey","deleted","undefined","_code","toBytes","bytes","HieroProto","proto","decode","encode","finish"],"mappings":"gaAuBe,MAAMA,EAiCjB,WAAAC,CAAYC,GAMRC,KAAKC,QAAUF,EAAME,QAOrBD,KAAKE,KAAOH,EAAMG,KAOlBF,KAAKG,OAASJ,EAAMI,OAOpBH,KAAKI,SAAWL,EAAMK,SAOtBJ,KAAKK,YAAcN,EAAMM,YAOzBL,KAAKM,kBAAoBP,EAAMO,kBAQ/BN,KAAKO,SAAWR,EAAMQ,SAQtBP,KAAKQ,OAAST,EAAMS,OAOpBR,KAAKS,UAAYV,EAAMU,UAOvBT,KAAKU,SAAWX,EAAMW,SAOtBV,KAAKW,QAAUZ,EAAMY,QAOrBX,KAAKY,UAAYb,EAAMa,UAEvBZ,KAAKa,eAAiBd,EAAMc,eAY5Bb,KAAKc,oBAAsBf,EAAMe,oBAWjCd,KAAKe,iBAAmBhB,EAAMgB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1B,KAAK0B,SAAmB1B,KAAK0B,SAASuC,UAAY,KAC5DtC,YACwB,MAApB3B,KAAK2B,YACC3B,KAAK2B,YAAYkC,iBACjB,KACVjC,SAA2B,MAAjB5B,KAAK4B,SAAmB5B,KAAK4B,SAAW,KAE9D,CAMI,gBAAO8B,CAAUQ,GACb,OAAOrE,EAAUgC,cACbsC,EAAWC,MAAMvE,UAAUwE,OAAOH,GAE9C,CAKI,OAAAD,GACI,OAAOE,EAAWC,MAAMvE,UAAUyE,OAAOtE,KAAK4D,eAAeW,QACrE"}
|
|
@@ -9,8 +9,7 @@ var _TokenId = _interopRequireDefault(require("./TokenId.cjs"));
|
|
|
9
9
|
var _TokenInfo = _interopRequireDefault(require("./TokenInfo.cjs"));
|
|
10
10
|
var _Hbar = _interopRequireDefault(require("../Hbar.cjs"));
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
function
|
|
13
|
-
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; }
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
13
|
// SPDX-License-Identifier: Apache-2.0
|
|
15
14
|
|
|
16
15
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -8,8 +8,7 @@ var _TokenId = _interopRequireDefault(require("./TokenId.cjs"));
|
|
|
8
8
|
var _Transaction = _interopRequireWildcard(require("../transaction/Transaction.cjs"));
|
|
9
9
|
var _long = _interopRequireDefault(require("long"));
|
|
10
10
|
var hex = _interopRequireWildcard(require("../encoding/hex.cjs"));
|
|
11
|
-
function
|
|
12
|
-
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; }
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
13
|
// SPDX-License-Identifier: Apache-2.0
|
|
15
14
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"./TokenId.js";import e,{TRANSACTION_REGISTRY as n}from"../transaction/Transaction.js";import a from"long";import{decode as o}from"../encoding/hex.js";class r extends e{constructor(t={}){super(),this._tokenId=null,this._amount=null,this._metadata=[],null!=t.tokenId&&this.setTokenId(t.tokenId),null!=t.amount&&this.setAmount(t.amount),null!=t.metadata&&this.setMetadata(t.metadata)}static _fromProtobuf(n,a,o,s,i){const d=i[0].tokenMint;return e._fromProtobufTransactions(new r({tokenId:null!=d.token?t._fromProtobuf(d.token):void 0,amount:null!=d.amount?d.amount:void 0,metadata:null!=d.metadata?d.metadata:void 0}),n,a,o,s,i)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId="string"==typeof e?t.fromString(e):e.clone(),this}get amount(){return this._amount}setAmount(t){return this._requireNotFrozen(),this._amount=t instanceof a?t:a.fromValue(t),this}_validateChecksums(t){null!=this._tokenId&&this._tokenId.validateChecksum(t)}get metadata(){return this._metadata}addMetadata(t){return this._requireNotFrozen(),"string"==typeof t&&console.warn("Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead."),this._metadata.push("string"==typeof t?o(t):t),this}setMetadata(t){this._requireNotFrozen();for(const e of t)if("string"==typeof e){console.warn("Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead.");break}return this._metadata=t.map(
|
|
1
|
+
import t from"./TokenId.js";import e,{TRANSACTION_REGISTRY as n}from"../transaction/Transaction.js";import a from"long";import{decode as o}from"../encoding/hex.js";class r extends e{constructor(t={}){super(),this._tokenId=null,this._amount=null,this._metadata=[],null!=t.tokenId&&this.setTokenId(t.tokenId),null!=t.amount&&this.setAmount(t.amount),null!=t.metadata&&this.setMetadata(t.metadata)}static _fromProtobuf(n,a,o,s,i){const d=i[0].tokenMint;return e._fromProtobufTransactions(new r({tokenId:null!=d.token?t._fromProtobuf(d.token):void 0,amount:null!=d.amount?d.amount:void 0,metadata:null!=d.metadata?d.metadata:void 0}),n,a,o,s,i)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId="string"==typeof e?t.fromString(e):e.clone(),this}get amount(){return this._amount}setAmount(t){return this._requireNotFrozen(),this._amount=t instanceof a?t:a.fromValue(t),this}_validateChecksums(t){null!=this._tokenId&&this._tokenId.validateChecksum(t)}get metadata(){return this._metadata}addMetadata(t){return this._requireNotFrozen(),"string"==typeof t&&console.warn("Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead."),this._metadata.push("string"==typeof t?o(t):t),this}setMetadata(t){this._requireNotFrozen();for(const e of t)if("string"==typeof e){console.warn("Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead.");break}return this._metadata=t.map(t=>"string"==typeof t?o(t):t),this}_execute(t,e){return t.token.mintToken(e)}_getTransactionDataCase(){return"tokenMint"}_makeTransactionData(){return{amount:this._amount,token:null!=this._tokenId?this._tokenId._toProtobuf():null,metadata:this._metadata}}_getLogId(){return`TokenMintTransaction:${this._transactionIds.current.validStart.toString()}`}}n.set("tokenMint",r._fromProtobuf);export{r as default};
|
|
2
2
|
//# sourceMappingURL=TokenMintTransaction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenMintTransaction.js","sources":["../../src/token/TokenMintTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport TokenId from \"./TokenId.js\";\nimport Transaction, {\n TRANSACTION_REGISTRY,\n} from \"../transaction/Transaction.js\";\nimport Long from \"long\";\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.ITokenMintTransactionBody} HieroProto.proto.ITokenMintTransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenID} HieroProto.proto.ITokenID\n */\n\n/**\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../client/Client.js\").default<*, *>} Client\n * @typedef {import(\"../account/AccountId.js\").default} AccountId\n * @typedef {import(\"../transaction/TransactionId.js\").default} TransactionId\n */\n\n/**\n * Mint a new Hedera™ crypto-currency token.\n */\nexport default class TokenMintTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {TokenId | string} [props.tokenId]\n * @param {Long | number} [props.amount]\n * @param {Uint8Array[]} [props.metadata]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?TokenId}\n */\n this._tokenId = null;\n\n /**\n * @private\n * @type {?Long}\n */\n this._amount = null;\n\n /**\n * @private\n * @type {Uint8Array[]}\n */\n this._metadata = [];\n\n if (props.tokenId != null) {\n this.setTokenId(props.tokenId);\n }\n\n if (props.amount != null) {\n this.setAmount(props.amount);\n }\n\n if (props.metadata != null) {\n this.setMetadata(props.metadata);\n }\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITransaction[]} transactions\n * @param {HieroProto.proto.ISignedTransaction[]} signedTransactions\n * @param {TransactionId[]} transactionIds\n * @param {AccountId[]} nodeIds\n * @param {HieroProto.proto.ITransactionBody[]} bodies\n * @returns {TokenMintTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const mintToken =\n /** @type {HieroProto.proto.ITokenMintTransactionBody} */ (\n body.tokenMint\n );\n\n return Transaction._fromProtobufTransactions(\n new TokenMintTransaction({\n tokenId:\n mintToken.token != null\n ? TokenId._fromProtobuf(mintToken.token)\n : undefined,\n amount: mintToken.amount != null ? mintToken.amount : undefined,\n metadata:\n mintToken.metadata != null ? mintToken.metadata : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?TokenId}\n */\n get tokenId() {\n return this._tokenId;\n }\n\n /**\n * @param {TokenId | string} tokenId\n * @returns {this}\n */\n setTokenId(tokenId) {\n this._requireNotFrozen();\n this._tokenId =\n typeof tokenId === \"string\"\n ? TokenId.fromString(tokenId)\n : tokenId.clone();\n\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get amount() {\n return this._amount;\n }\n\n /**\n * @param {Long | number} amount\n * @returns {this}\n */\n setAmount(amount) {\n this._requireNotFrozen();\n this._amount = amount instanceof Long ? amount : Long.fromValue(amount);\n\n return this;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (this._tokenId != null) {\n this._tokenId.validateChecksum(client);\n }\n }\n\n /**\n * @returns {Uint8Array[]}\n */\n get metadata() {\n return this._metadata;\n }\n\n /**\n * @param {Uint8Array | string} metadata\n * @returns {this}\n */\n addMetadata(metadata) {\n this._requireNotFrozen();\n\n if (typeof metadata === \"string\") {\n console.warn(\n \"Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead.\",\n );\n }\n\n this._metadata.push(\n typeof metadata === \"string\" ? hex.decode(metadata) : metadata,\n );\n\n return this;\n }\n\n /**\n * @param {Uint8Array[]} metadata\n * @returns {this}\n */\n setMetadata(metadata) {\n this._requireNotFrozen();\n\n for (const data of metadata) {\n if (typeof data === \"string\") {\n console.warn(\n \"Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead.\",\n );\n break;\n }\n }\n\n this._metadata = metadata.map((data) =>\n typeof data === \"string\" ? hex.decode(data) : data,\n );\n\n return this;\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.token.mintToken(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"tokenMint\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.ITokenMintTransactionBody}\n */\n _makeTransactionData() {\n return {\n amount: this._amount,\n token: this._tokenId != null ? this._tokenId._toProtobuf() : null,\n metadata: this._metadata,\n };\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp = /** @type {import(\"../Timestamp.js\").default} */ (\n this._transactionIds.current.validStart\n );\n return `TokenMintTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"tokenMint\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n TokenMintTransaction._fromProtobuf,\n);\n"],"names":["TokenMintTransaction","Transaction","constructor","props","super","this","_tokenId","_amount","_metadata","tokenId","setTokenId","amount","setAmount","metadata","setMetadata","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","mintToken","_fromProtobufTransactions","token","TokenId","undefined","_requireNotFrozen","fromString","clone","Long","fromValue","_validateChecksums","client","validateChecksum","addMetadata","console","warn","push","hex.decode","data","map","_execute","channel","request","_getTransactionDataCase","_makeTransactionData","_toProtobuf","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"oKA8Be,MAAMA,UAA6BC,EAO9C,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,SAAW,KAMhBD,KAAKE,QAAU,KAMfF,KAAKG,UAAY,GAEI,MAAjBL,EAAMM,SACNJ,KAAKK,WAAWP,EAAMM,SAGN,MAAhBN,EAAMQ,QACNN,KAAKO,UAAUT,EAAMQ,QAGH,MAAlBR,EAAMU,UACNR,KAAKS,YAAYX,EAAMU,SAEnC,CAWI,oBAAOE,CACHC,EACAC,EACAC,EACAC,EACAC,GAEA,MACMC,EADOD,EAAO,GAIf,UAEL,OAAOnB,EAAYqB,0BACf,IAAItB,EAAqB,CACrBS,QACuB,MAAnBY,EAAUE,MACJC,EAAQT,cAAcM,EAAUE,YAChCE,EACVd,OAA4B,MAApBU,EAAUV,OAAiBU,EAAUV,YAASc,EACtDZ,SAC0B,MAAtBQ,EAAUR,SAAmBQ,EAAUR,cAAWY,IAE1DT,EACAC,EACAC,EACAC,EACAC,EAEZ,CAKI,WAAIX,GACA,OAAOJ,KAAKC,QACpB,CAMI,UAAAI,CAAWD,GAOP,OANAJ,KAAKqB,oBACLrB,KAAKC,SACkB,iBAAZG,EACDe,EAAQG,WAAWlB,GACnBA,EAAQmB,QAEXvB,IACf,CAKI,UAAIM,GACA,OAAON,KAAKE,OACpB,CAMI,SAAAK,CAAUD,GAIN,OAHAN,KAAKqB,oBACLrB,KAAKE,QAAUI,aAAkBkB,EAAOlB,EAASkB,EAAKC,UAAUnB,GAEzDN,IACf,CAKI,kBAAA0B,CAAmBC,GACM,MAAjB3B,KAAKC,UACLD,KAAKC,SAAS2B,iBAAiBD,EAE3C,CAKI,YAAInB,GACA,OAAOR,KAAKG,SACpB,CAMI,WAAA0B,CAAYrB,GAaR,OAZAR,KAAKqB,oBAEmB,iBAAbb,GACPsB,QAAQC,KACJ,2HAIR/B,KAAKG,UAAU6B,KACS,iBAAbxB,EAAwByB,EAAWzB,GAAYA,GAGnDR,IACf,CAMI,WAAAS,CAAYD,GACRR,KAAKqB,oBAEL,IAAK,MAAMa,KAAQ1B,EACf,GAAoB,iBAAT0B,EAAmB,CAC1BJ,QAAQC,KACJ,2HAEJ,KAChB,CAOQ,OAJA/B,KAAKG,UAAYK,EAAS2B,
|
|
1
|
+
{"version":3,"file":"TokenMintTransaction.js","sources":["../../src/token/TokenMintTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport TokenId from \"./TokenId.js\";\nimport Transaction, {\n TRANSACTION_REGISTRY,\n} from \"../transaction/Transaction.js\";\nimport Long from \"long\";\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.ITokenMintTransactionBody} HieroProto.proto.ITokenMintTransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenID} HieroProto.proto.ITokenID\n */\n\n/**\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../client/Client.js\").default<*, *>} Client\n * @typedef {import(\"../account/AccountId.js\").default} AccountId\n * @typedef {import(\"../transaction/TransactionId.js\").default} TransactionId\n */\n\n/**\n * Mint a new Hedera™ crypto-currency token.\n */\nexport default class TokenMintTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {TokenId | string} [props.tokenId]\n * @param {Long | number} [props.amount]\n * @param {Uint8Array[]} [props.metadata]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?TokenId}\n */\n this._tokenId = null;\n\n /**\n * @private\n * @type {?Long}\n */\n this._amount = null;\n\n /**\n * @private\n * @type {Uint8Array[]}\n */\n this._metadata = [];\n\n if (props.tokenId != null) {\n this.setTokenId(props.tokenId);\n }\n\n if (props.amount != null) {\n this.setAmount(props.amount);\n }\n\n if (props.metadata != null) {\n this.setMetadata(props.metadata);\n }\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITransaction[]} transactions\n * @param {HieroProto.proto.ISignedTransaction[]} signedTransactions\n * @param {TransactionId[]} transactionIds\n * @param {AccountId[]} nodeIds\n * @param {HieroProto.proto.ITransactionBody[]} bodies\n * @returns {TokenMintTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const mintToken =\n /** @type {HieroProto.proto.ITokenMintTransactionBody} */ (\n body.tokenMint\n );\n\n return Transaction._fromProtobufTransactions(\n new TokenMintTransaction({\n tokenId:\n mintToken.token != null\n ? TokenId._fromProtobuf(mintToken.token)\n : undefined,\n amount: mintToken.amount != null ? mintToken.amount : undefined,\n metadata:\n mintToken.metadata != null ? mintToken.metadata : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?TokenId}\n */\n get tokenId() {\n return this._tokenId;\n }\n\n /**\n * @param {TokenId | string} tokenId\n * @returns {this}\n */\n setTokenId(tokenId) {\n this._requireNotFrozen();\n this._tokenId =\n typeof tokenId === \"string\"\n ? TokenId.fromString(tokenId)\n : tokenId.clone();\n\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get amount() {\n return this._amount;\n }\n\n /**\n * @param {Long | number} amount\n * @returns {this}\n */\n setAmount(amount) {\n this._requireNotFrozen();\n this._amount = amount instanceof Long ? amount : Long.fromValue(amount);\n\n return this;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (this._tokenId != null) {\n this._tokenId.validateChecksum(client);\n }\n }\n\n /**\n * @returns {Uint8Array[]}\n */\n get metadata() {\n return this._metadata;\n }\n\n /**\n * @param {Uint8Array | string} metadata\n * @returns {this}\n */\n addMetadata(metadata) {\n this._requireNotFrozen();\n\n if (typeof metadata === \"string\") {\n console.warn(\n \"Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead.\",\n );\n }\n\n this._metadata.push(\n typeof metadata === \"string\" ? hex.decode(metadata) : metadata,\n );\n\n return this;\n }\n\n /**\n * @param {Uint8Array[]} metadata\n * @returns {this}\n */\n setMetadata(metadata) {\n this._requireNotFrozen();\n\n for (const data of metadata) {\n if (typeof data === \"string\") {\n console.warn(\n \"Passing a `string` for token metadata is considered a bug, and has been removed. Please provide a `Uint8Array` instead.\",\n );\n break;\n }\n }\n\n this._metadata = metadata.map((data) =>\n typeof data === \"string\" ? hex.decode(data) : data,\n );\n\n return this;\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.token.mintToken(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"tokenMint\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.ITokenMintTransactionBody}\n */\n _makeTransactionData() {\n return {\n amount: this._amount,\n token: this._tokenId != null ? this._tokenId._toProtobuf() : null,\n metadata: this._metadata,\n };\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp = /** @type {import(\"../Timestamp.js\").default} */ (\n this._transactionIds.current.validStart\n );\n return `TokenMintTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"tokenMint\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n TokenMintTransaction._fromProtobuf,\n);\n"],"names":["TokenMintTransaction","Transaction","constructor","props","super","this","_tokenId","_amount","_metadata","tokenId","setTokenId","amount","setAmount","metadata","setMetadata","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","mintToken","_fromProtobufTransactions","token","TokenId","undefined","_requireNotFrozen","fromString","clone","Long","fromValue","_validateChecksums","client","validateChecksum","addMetadata","console","warn","push","hex.decode","data","map","_execute","channel","request","_getTransactionDataCase","_makeTransactionData","_toProtobuf","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"oKA8Be,MAAMA,UAA6BC,EAO9C,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,SAAW,KAMhBD,KAAKE,QAAU,KAMfF,KAAKG,UAAY,GAEI,MAAjBL,EAAMM,SACNJ,KAAKK,WAAWP,EAAMM,SAGN,MAAhBN,EAAMQ,QACNN,KAAKO,UAAUT,EAAMQ,QA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,GACd,OAAOD,EAAQnB,MAAMF,UAAUsB,EACvC,CAOI,uBAAAC,GACI,MAAO,WACf,CAOI,oBAAAC,GACI,MAAO,CACHlC,OAAQN,KAAKE,QACbgB,MAAwB,MAAjBlB,KAAKC,SAAmBD,KAAKC,SAASwC,cAAgB,KAC7DjC,SAAUR,KAAKG,UAE3B,CAKI,SAAAuC,GAII,MAAO,wBAFH1C,KAAK2C,gBAAgBC,QACxB,WACwCC,YACjD,EAGAC,EAAqBC,IACjB,YAEApD,EAAqBe"}
|
|
@@ -9,8 +9,7 @@ var _AccountId = _interopRequireDefault(require("../account/AccountId.cjs"));
|
|
|
9
9
|
var _Timestamp = _interopRequireDefault(require("../Timestamp.cjs"));
|
|
10
10
|
var hex = _interopRequireWildcard(require("../encoding/hex.cjs"));
|
|
11
11
|
var _LedgerId = _interopRequireDefault(require("../LedgerId.cjs"));
|
|
12
|
-
function
|
|
13
|
-
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; }
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
14
|
// SPDX-License-Identifier: Apache-2.0
|
|
16
15
|
|
|
@@ -12,8 +12,7 @@ var _TokenNftInfo = _interopRequireDefault(require("./TokenNftInfo.cjs"));
|
|
|
12
12
|
var _Hbar = _interopRequireDefault(require("../Hbar.cjs"));
|
|
13
13
|
var _long = _interopRequireDefault(require("long"));
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
function
|
|
16
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
17
16
|
// SPDX-License-Identifier: Apache-2.0
|
|
18
17
|
|
|
19
18
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t,{QUERY_REGISTRY as e}from"../query/Query.js";import n from"./NftId.js";import o from"../account/AccountId.js";import r from"./TokenId.js";import s from"./TokenNftInfo.js";import"bignumber.js";import"../HbarUnit.js";import f from"long";class u extends t{constructor(t={}){super(),this._nftId=null,null!=t.nftId&&this.setNftId(t.nftId),this._accountId=null,null!=t.accountId&&this.setAccountId(t.accountId),this._tokenId=null,null!=t.tokenId&&this.setTokenId(t.tokenId),this._start=null,null!=t.start&&this.setStart(t.start),this._end=null,null!=t.end&&this.setEnd(t.end)}static _fromProtobuf(t){if(null!=t.tokenGetNftInfo){const e=t.tokenGetNftInfo;return new u({nftId:null!=e.nftID?n._fromProtobuf(e.nftID):void 0})}if(null!=t.tokenGetAccountNftInfos){const e=t.tokenGetAccountNftInfos;return new u({accountId:null!=e.accountID?o._fromProtobuf(e.accountID):void 0,start:null!=e.start?e.start:void 0,end:null!=e.end?e.end:void 0})}{const e=t.tokenGetNftInfos;return new u({tokenId:null!=e.tokenID?r._fromProtobuf(e.tokenID):void 0,start:null!=e.start?e.start:void 0,end:null!=e.end?e.end:void 0})}}get nftId(){return this._nftId}setNftId(t){return this._nftId="string"==typeof t?n.fromString(t):n._fromProtobuf(t._toProtobuf()),this}get accountId(){return console.warn("`TokenNftInfoQuery.accountId` is deprecated with no replacement"),this._accountId}setAccountId(t){return console.warn("`TokenNftInfoQuery.setAccountId()` is deprecated with no replacement"),this._accountId="string"==typeof t?o.fromString(t):o._fromProtobuf(t._toProtobuf()),this}get tokenId(){return console.warn("`TokenNftInfoQuery.tokenId` is deprecated with no replacement"),this._tokenId}setTokenId(t){return console.warn("`TokenNftInfoQuery.setTokenId()` is deprecated with no replacement"),this._tokenId="string"==typeof t?r.fromString(t):r._fromProtobuf(t._toProtobuf()),this}get start(){return console.warn("`TokenNftInfoQuery.start` is deprecated with no replacement"),this._start}setStart(t){return console.warn("`TokenNftInfoQuery.setStart()` is deprecated with no replacement"),this._start="number"==typeof t?f.fromNumber(t):t,this}get end(){return console.warn("`TokenNftInfoQuery.end` is deprecated with no replacement"),this._end}setEnd(t){return console.warn("`TokenNftInfoQuery.setEnd()` is deprecated with no replacement"),this._end="number"==typeof t?f.fromNumber(t):t,this}async getCost(t){return super.getCost(t)}_execute(t,e){return t.token.getTokenNftInfo(e)}_mapResponseHeader(t){return t.tokenGetNftInfo.header}_mapResponse(t,e,n){const o=[t.tokenGetNftInfo.nft];return Promise.resolve(o.map(
|
|
1
|
+
import t,{QUERY_REGISTRY as e}from"../query/Query.js";import n from"./NftId.js";import o from"../account/AccountId.js";import r from"./TokenId.js";import s from"./TokenNftInfo.js";import"bignumber.js";import"../HbarUnit.js";import f from"long";class u extends t{constructor(t={}){super(),this._nftId=null,null!=t.nftId&&this.setNftId(t.nftId),this._accountId=null,null!=t.accountId&&this.setAccountId(t.accountId),this._tokenId=null,null!=t.tokenId&&this.setTokenId(t.tokenId),this._start=null,null!=t.start&&this.setStart(t.start),this._end=null,null!=t.end&&this.setEnd(t.end)}static _fromProtobuf(t){if(null!=t.tokenGetNftInfo){const e=t.tokenGetNftInfo;return new u({nftId:null!=e.nftID?n._fromProtobuf(e.nftID):void 0})}if(null!=t.tokenGetAccountNftInfos){const e=t.tokenGetAccountNftInfos;return new u({accountId:null!=e.accountID?o._fromProtobuf(e.accountID):void 0,start:null!=e.start?e.start:void 0,end:null!=e.end?e.end:void 0})}{const e=t.tokenGetNftInfos;return new u({tokenId:null!=e.tokenID?r._fromProtobuf(e.tokenID):void 0,start:null!=e.start?e.start:void 0,end:null!=e.end?e.end:void 0})}}get nftId(){return this._nftId}setNftId(t){return this._nftId="string"==typeof t?n.fromString(t):n._fromProtobuf(t._toProtobuf()),this}get accountId(){return console.warn("`TokenNftInfoQuery.accountId` is deprecated with no replacement"),this._accountId}setAccountId(t){return console.warn("`TokenNftInfoQuery.setAccountId()` is deprecated with no replacement"),this._accountId="string"==typeof t?o.fromString(t):o._fromProtobuf(t._toProtobuf()),this}get tokenId(){return console.warn("`TokenNftInfoQuery.tokenId` is deprecated with no replacement"),this._tokenId}setTokenId(t){return console.warn("`TokenNftInfoQuery.setTokenId()` is deprecated with no replacement"),this._tokenId="string"==typeof t?r.fromString(t):r._fromProtobuf(t._toProtobuf()),this}get start(){return console.warn("`TokenNftInfoQuery.start` is deprecated with no replacement"),this._start}setStart(t){return console.warn("`TokenNftInfoQuery.setStart()` is deprecated with no replacement"),this._start="number"==typeof t?f.fromNumber(t):t,this}get end(){return console.warn("`TokenNftInfoQuery.end` is deprecated with no replacement"),this._end}setEnd(t){return console.warn("`TokenNftInfoQuery.setEnd()` is deprecated with no replacement"),this._end="number"==typeof t?f.fromNumber(t):t,this}async getCost(t){return super.getCost(t)}_execute(t,e){return t.token.getTokenNftInfo(e)}_mapResponseHeader(t){return t.tokenGetNftInfo.header}_mapResponse(t,e,n){const o=[t.tokenGetNftInfo.nft];return Promise.resolve(o.map(t=>s._fromProtobuf(t)))}_onMakeRequest(t){return{tokenGetNftInfo:{header:t,nftID:null!=this._nftId?this._nftId._toProtobuf():null}}}_getLogId(){return`TokenNftInfoQuery:${(null!=this._paymentTransactionId&&null!=this._paymentTransactionId.validStart?this._paymentTransactionId.validStart:this._timestamp).toString()}`}}e.set("tokenGetNftInfo",u._fromProtobuf);export{u as default};
|
|
2
2
|
//# sourceMappingURL=TokenNftInfoQuery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenNftInfoQuery.js","sources":["../../src/token/TokenNftInfoQuery.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Query, { QUERY_REGISTRY } from \"../query/Query.js\";\nimport NftId from \"./NftId.js\";\nimport AccountId from \"../account/AccountId.js\";\nimport TokenId from \"../token/TokenId.js\";\nimport TokenNftInfo from \"./TokenNftInfo.js\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport Hbar from \"../Hbar.js\";\nimport Long from \"long\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hashgraph/proto\").proto.IQuery} HieroProto.proto.IQuery\n * @typedef {import(\"@hashgraph/proto\").proto.IQueryHeader} HieroProto.proto.IQueryHeader\n * @typedef {import(\"@hashgraph/proto\").proto.IResponse} HieroProto.proto.IResponse\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenNftInfo} HieroProto.proto.ITokenNftInfo\n * @typedef {import(\"@hashgraph/proto\").proto.IResponseHeader} HieroProto.proto.IResponseHeader\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenGetNftInfoQuery} HieroProto.proto.ITokenGetNftInfoQuery\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenGetNftInfosQuery} HieroProto.proto.ITokenGetNftInfosQuery\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenGetAccountNftInfosQuery} HieroProto.proto.ITokenGetAccountNftInfosQuery\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenGetNftInfoResponse} HieroProto.proto.ITokenGetNftInfoResponse\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenGetNftInfosResponse} HieroProto.proto.ITokenGetNftInfosResponse\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenGetAccountNftInfosResponse} HieroProto.proto.ITokenGetAccountNftInfosResponse\n */\n\n/**\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n */\n\n/**\n * @augments {Query<TokenNftInfo[]>}\n */\nexport default class TokenNftInfoQuery extends Query {\n /**\n * @param {object} properties\n * @param {NftId | string} [properties.nftId]\n * @param {AccountId | string} [properties.accountId]\n * @param {TokenId | string} [properties.tokenId]\n * @param {Long | number} [properties.start]\n * @param {Long | number} [properties.end]\n */\n constructor(properties = {}) {\n super();\n\n /**\n * @private\n * @type {?NftId}\n */\n this._nftId = null;\n if (properties.nftId != null) {\n this.setNftId(properties.nftId);\n }\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._accountId = null;\n if (properties.accountId != null) {\n // eslint-disable-next-line deprecation/deprecation\n this.setAccountId(properties.accountId);\n }\n\n /**\n * @private\n * @type {?TokenId}\n */\n this._tokenId = null;\n if (properties.tokenId != null) {\n // eslint-disable-next-line deprecation/deprecation\n this.setTokenId(properties.tokenId);\n }\n\n /**\n * @private\n * @type {?Long}\n */\n this._start = null;\n if (properties.start != null) {\n // eslint-disable-next-line deprecation/deprecation\n this.setStart(properties.start);\n }\n\n /**\n * @private\n * @type {?Long}\n */\n this._end = null;\n if (properties.end != null) {\n // eslint-disable-next-line deprecation/deprecation\n this.setEnd(properties.end);\n }\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.IQuery} query\n * @returns {TokenNftInfoQuery}\n */\n static _fromProtobuf(query) {\n if (query.tokenGetNftInfo != null) {\n const info = /** @type {HieroProto.proto.ITokenGetNftInfoQuery} */ (\n query.tokenGetNftInfo\n );\n\n return new TokenNftInfoQuery({\n nftId:\n info.nftID != null\n ? NftId._fromProtobuf(info.nftID)\n : undefined,\n });\n } else if (query.tokenGetAccountNftInfos != null) {\n const info =\n /** @type {HieroProto.proto.ITokenGetAccountNftInfosQuery} */ (\n query.tokenGetAccountNftInfos\n );\n\n return new TokenNftInfoQuery({\n accountId:\n info.accountID != null\n ? AccountId._fromProtobuf(info.accountID)\n : undefined,\n start: info.start != null ? info.start : undefined,\n end: info.end != null ? info.end : undefined,\n });\n } else {\n const info =\n /** @type {HieroProto.proto.ITokenGetNftInfosQuery} */ (\n query.tokenGetNftInfos\n );\n\n return new TokenNftInfoQuery({\n tokenId:\n info.tokenID != null\n ? TokenId._fromProtobuf(info.tokenID)\n : undefined,\n start: info.start != null ? info.start : undefined,\n end: info.end != null ? info.end : undefined,\n });\n }\n }\n\n /**\n * @returns {?NftId}\n */\n get nftId() {\n return this._nftId;\n }\n\n /**\n * Set the token ID for which the info is being requested.\n *\n * @param {NftId | string} nftId\n * @returns {TokenNftInfoQuery}\n */\n setNftId(nftId) {\n this._nftId =\n typeof nftId === \"string\"\n ? NftId.fromString(nftId)\n : NftId._fromProtobuf(nftId._toProtobuf());\n\n return this;\n }\n\n /**\n * @deprecated with no replacement\n * @returns {?AccountId}\n */\n get accountId() {\n console.warn(\n \"`TokenNftInfoQuery.accountId` is deprecated with no replacement\",\n );\n return this._accountId;\n }\n\n /**\n * @deprecated with no replacement\n * Set the token ID for which the info is being requested.\n * @param {AccountId | string} accountId\n * @returns {TokenNftInfoQuery}\n */\n setAccountId(accountId) {\n console.warn(\n \"`TokenNftInfoQuery.setAccountId()` is deprecated with no replacement\",\n );\n this._accountId =\n typeof accountId === \"string\"\n ? AccountId.fromString(accountId)\n : AccountId._fromProtobuf(accountId._toProtobuf());\n\n return this;\n }\n\n /**\n * @deprecated with no replacement\n * @returns {?TokenId}\n */\n get tokenId() {\n console.warn(\n \"`TokenNftInfoQuery.tokenId` is deprecated with no replacement\",\n );\n return this._tokenId;\n }\n\n /**\n * @deprecated with no replacement\n * Set the token ID for which the info is being requested.\n * @param {TokenId | string} tokenId\n * @returns {TokenNftInfoQuery}\n */\n setTokenId(tokenId) {\n console.warn(\n \"`TokenNftInfoQuery.setTokenId()` is deprecated with no replacement\",\n );\n this._tokenId =\n typeof tokenId === \"string\"\n ? TokenId.fromString(tokenId)\n : TokenId._fromProtobuf(tokenId._toProtobuf());\n\n return this;\n }\n\n /**\n * @deprecated with no replacement\n * @returns {?Long}\n */\n get start() {\n console.warn(\n \"`TokenNftInfoQuery.start` is deprecated with no replacement\",\n );\n return this._start;\n }\n\n /**\n * @deprecated with no replacement\n * Set the token ID for which the info is being requested.\n * @param {Long | number} start\n * @returns {TokenNftInfoQuery}\n */\n setStart(start) {\n console.warn(\n \"`TokenNftInfoQuery.setStart()` is deprecated with no replacement\",\n );\n this._start =\n typeof start === \"number\" ? Long.fromNumber(start) : start;\n\n return this;\n }\n\n /**\n * @deprecated with no replacement\n * @returns {?Long}\n */\n get end() {\n console.warn(\n \"`TokenNftInfoQuery.end` is deprecated with no replacement\",\n );\n return this._end;\n }\n\n /**\n * @deprecated with no replacement\n * Set the token ID for which the info is being requested.\n * @param {Long | number} end\n * @returns {TokenNftInfoQuery}\n */\n setEnd(end) {\n console.warn(\n \"`TokenNftInfoQuery.setEnd()` is deprecated with no replacement\",\n );\n this._end = typeof end === \"number\" ? Long.fromNumber(end) : end;\n\n return this;\n }\n\n /**\n * @override\n * @param {import(\"../client/Client.js\").default<Channel, *>} client\n * @returns {Promise<Hbar>}\n */\n async getCost(client) {\n return super.getCost(client);\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.IQuery} request\n * @returns {Promise<HieroProto.proto.IResponse>}\n */\n _execute(channel, request) {\n return channel.token.getTokenNftInfo(request);\n }\n\n /**\n * @override\n * @internal\n * @param {HieroProto.proto.IResponse} response\n * @returns {HieroProto.proto.IResponseHeader}\n */\n _mapResponseHeader(response) {\n const infos = /** @type {HieroProto.proto.ITokenGetNftInfoResponse} */ (\n response.tokenGetNftInfo\n );\n\n return /** @type {HieroProto.proto.IResponseHeader} */ (infos.header);\n }\n\n /**\n * @override\n * @internal\n * @param {HieroProto.proto.IResponse} response\n * @param {AccountId} nodeAccountId\n * @param {HieroProto.proto.IQuery} request\n * @returns {Promise<TokenNftInfo[]>}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _mapResponse(response, nodeAccountId, request) {\n const nfts = [\n /** @type {HieroProto.proto.ITokenNftInfo} */\n (\n /** @type {HieroProto.proto.ITokenGetNftInfoResponse} */ (\n response.tokenGetNftInfo\n ).nft\n ),\n ];\n\n return Promise.resolve(\n nfts.map((nft) =>\n TokenNftInfo._fromProtobuf(\n /** @type {HieroProto.proto.ITokenNftInfo} */ (nft),\n ),\n ),\n );\n }\n\n /**\n * @override\n * @internal\n * @param {HieroProto.proto.IQueryHeader} header\n * @returns {HieroProto.proto.IQuery}\n */\n _onMakeRequest(header) {\n return {\n tokenGetNftInfo: {\n header,\n nftID: this._nftId != null ? this._nftId._toProtobuf() : null,\n },\n };\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp =\n this._paymentTransactionId != null &&\n this._paymentTransactionId.validStart != null\n ? this._paymentTransactionId.validStart\n : this._timestamp;\n\n return `TokenNftInfoQuery:${timestamp.toString()}`;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nQUERY_REGISTRY.set(\"tokenGetNftInfo\", TokenNftInfoQuery._fromProtobuf);\n"],"names":["TokenNftInfoQuery","Query","constructor","properties","super","this","_nftId","nftId","setNftId","_accountId","accountId","setAccountId","_tokenId","tokenId","setTokenId","_start","start","setStart","_end","end","setEnd","_fromProtobuf","query","tokenGetNftInfo","info","nftID","NftId","undefined","tokenGetAccountNftInfos","accountID","AccountId","tokenID","TokenId","fromString","_toProtobuf","console","warn","Long","fromNumber","getCost","client","_execute","channel","request","token","getTokenNftInfo","_mapResponseHeader","response","_mapResponse","nodeAccountId","nfts","Promise","resolve","map","nft","TokenNftInfo","_onMakeRequest","header","_getLogId","_paymentTransactionId","validStart","_timestamp","toString","QUERY_REGISTRY","set"],"mappings":"oPAiCe,MAAMA,UAA0BC,EAS3C,WAAAC,CAAYC,EAAa,IACrBC,QAMAC,KAAKC,OAAS,KACU,MAApBH,EAAWI,OACXF,KAAKG,SAASL,EAAWI,OAO7BF,KAAKI,WAAa,KACU,MAAxBN,EAAWO,WAEXL,KAAKM,aAAaR,EAAWO,WAOjCL,KAAKO,SAAW,KACU,MAAtBT,EAAWU,SAEXR,KAAKS,WAAWX,EAAWU,SAO/BR,KAAKU,OAAS,KACU,MAApBZ,EAAWa,OAEXX,KAAKY,SAASd,EAAWa,OAO7BX,KAAKa,KAAO,KACU,MAAlBf,EAAWgB,KAEXd,KAAKe,OAAOjB,EAAWgB,IAEnC,CAOI,oBAAOE,CAAcC,GACjB,GAA6B,MAAzBA,EAAMC,gBAAyB,CAC/B,MAAMC,EACFF,EACH,gBAED,OAAO,IAAItB,EAAkB,CACzBO,MACkB,MAAdiB,EAAKC,MACCC,EAAML,cAAcG,EAAKC,YACzBE,GAE1B,CAAe,GAAqC,MAAjCL,EAAMM,wBAAiC,CAC9C,MAAMJ,EAEEF,EACH,wBAEL,OAAO,IAAItB,EAAkB,CACzBU,UACsB,MAAlBc,EAAKK,UACCC,EAAUT,cAAc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B,QAAQC,KACJ,kEAEJ/B,KAAKa,KAAsB,iBAARC,EAAmBkB,EAAKC,WAAWnB,GAAOA,EAEtDd,IACf,CAOI,aAAMkC,CAAQC,GACV,OAAOpC,MAAMmC,QAAQC,EAC7B,CASI,QAAAC,CAASC,EAASC,GACd,OAAOD,EAAQE,MAAMC,gBAAgBF,EAC7C,CAQI,kBAAAG,CAAmBC,GAKf,OAHIA,EACH,gBAEmE,MAC5E,CAWI,YAAAC,CAAaD,EAAUE,EAAeN,GAClC,MAAMO,EAAO,CAIDH,EACF,gBAClB,KAGQ,OAAOI,QAAQC,QACXF,EAAKG,KAAKC,GACNC,EAAalC,cAC7B,KAIA,CAQI,cAAAmC,CAAeC,GACX,MAAO,CACHlC,gBAAiB,CACbkC,SACAhC,MAAsB,MAAfpB,KAAKC,OAAiBD,KAAKC,OAAO4B,cAAgB,MAGzE,CAKI,SAAAwB,GAOI,MAAO,sBAL2B,MAA9BrD,KAAKsD,uBACoC,MAAzCtD,KAAKsD,sBAAsBC,WACrBvD,KAAKsD,sBAAsBC,WAC3BvD,KAAKwD,YAEuBC,YAC9C,EAIAC,EAAeC,IAAI,kBAAmBhE,EAAkBqB"}
|
|
1
|
+
{"version":3,"file":"TokenNftInfoQuery.js","sources":["../../src/token/TokenNftInfoQuery.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Query, { QUERY_REGISTRY } from \"../query/Query.js\";\nimport NftId from \"./NftId.js\";\nimport AccountId from \"../account/AccountId.js\";\nimport TokenId from \"../token/TokenId.js\";\nimport TokenNftInfo from \"./TokenNftInfo.js\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport Hbar from \"../Hbar.js\";\nimport Long from \"long\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hashgraph/proto\").proto.IQuery} HieroProto.proto.IQuery\n * @typedef {import(\"@hashgraph/proto\").proto.IQueryHeader} HieroProto.proto.IQueryHeader\n * @typedef {import(\"@hashgraph/proto\").proto.IResponse} HieroProto.proto.IResponse\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenNftInfo} HieroProto.proto.ITokenNftInfo\n * @typedef {import(\"@hashgraph/proto\").proto.IResponseHeader} HieroProto.proto.IResponseHeader\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenGetNftInfoQuery} HieroProto.proto.ITokenGetNftInfoQuery\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenGetNftInfosQuery} HieroProto.proto.ITokenGetNftInfosQuery\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenGetAccountNftInfosQuery} HieroProto.proto.ITokenGetAccountNftInfosQuery\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenGetNftInfoResponse} HieroProto.proto.ITokenGetNftInfoResponse\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenGetNftInfosResponse} HieroProto.proto.ITokenGetNftInfosResponse\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenGetAccountNftInfosResponse} HieroProto.proto.ITokenGetAccountNftInfosResponse\n */\n\n/**\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n */\n\n/**\n * @augments {Query<TokenNftInfo[]>}\n */\nexport default class TokenNftInfoQuery extends Query {\n /**\n * @param {object} properties\n * @param {NftId | string} [properties.nftId]\n * @param {AccountId | string} [properties.accountId]\n * @param {TokenId | string} [properties.tokenId]\n * @param {Long | number} [properties.start]\n * @param {Long | number} [properties.end]\n */\n constructor(properties = {}) {\n super();\n\n /**\n * @private\n * @type {?NftId}\n */\n this._nftId = null;\n if (properties.nftId != null) {\n this.setNftId(properties.nftId);\n }\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._accountId = null;\n if (properties.accountId != null) {\n // eslint-disable-next-line deprecation/deprecation\n this.setAccountId(properties.accountId);\n }\n\n /**\n * @private\n * @type {?TokenId}\n */\n this._tokenId = null;\n if (properties.tokenId != null) {\n // eslint-disable-next-line deprecation/deprecation\n this.setTokenId(properties.tokenId);\n }\n\n /**\n * @private\n * @type {?Long}\n */\n this._start = null;\n if (properties.start != null) {\n // eslint-disable-next-line deprecation/deprecation\n this.setStart(properties.start);\n }\n\n /**\n * @private\n * @type {?Long}\n */\n this._end = null;\n if (properties.end != null) {\n // eslint-disable-next-line deprecation/deprecation\n this.setEnd(properties.end);\n }\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.IQuery} query\n * @returns {TokenNftInfoQuery}\n */\n static _fromProtobuf(query) {\n if (query.tokenGetNftInfo != null) {\n const info = /** @type {HieroProto.proto.ITokenGetNftInfoQuery} */ (\n query.tokenGetNftInfo\n );\n\n return new TokenNftInfoQuery({\n nftId:\n info.nftID != null\n ? NftId._fromProtobuf(info.nftID)\n : undefined,\n });\n } else if (query.tokenGetAccountNftInfos != null) {\n const info =\n /** @type {HieroProto.proto.ITokenGetAccountNftInfosQuery} */ (\n query.tokenGetAccountNftInfos\n );\n\n return new TokenNftInfoQuery({\n accountId:\n info.accountID != null\n ? AccountId._fromProtobuf(info.accountID)\n : undefined,\n start: info.start != null ? info.start : undefined,\n end: info.end != null ? info.end : undefined,\n });\n } else {\n const info =\n /** @type {HieroProto.proto.ITokenGetNftInfosQuery} */ (\n query.tokenGetNftInfos\n );\n\n return new TokenNftInfoQuery({\n tokenId:\n info.tokenID != null\n ? TokenId._fromProtobuf(info.tokenID)\n : undefined,\n start: info.start != null ? info.start : undefined,\n end: info.end != null ? info.end : undefined,\n });\n }\n }\n\n /**\n * @returns {?NftId}\n */\n get nftId() {\n return this._nftId;\n }\n\n /**\n * Set the token ID for which the info is being requested.\n *\n * @param {NftId | string} nftId\n * @returns {TokenNftInfoQuery}\n */\n setNftId(nftId) {\n this._nftId =\n typeof nftId === \"string\"\n ? NftId.fromString(nftId)\n : NftId._fromProtobuf(nftId._toProtobuf());\n\n return this;\n }\n\n /**\n * @deprecated with no replacement\n * @returns {?AccountId}\n */\n get accountId() {\n console.warn(\n \"`TokenNftInfoQuery.accountId` is deprecated with no replacement\",\n );\n return this._accountId;\n }\n\n /**\n * @deprecated with no replacement\n * Set the token ID for which the info is being requested.\n * @param {AccountId | string} accountId\n * @returns {TokenNftInfoQuery}\n */\n setAccountId(accountId) {\n console.warn(\n \"`TokenNftInfoQuery.setAccountId()` is deprecated with no replacement\",\n );\n this._accountId =\n typeof accountId === \"string\"\n ? AccountId.fromString(accountId)\n : AccountId._fromProtobuf(accountId._toProtobuf());\n\n return this;\n }\n\n /**\n * @deprecated with no replacement\n * @returns {?TokenId}\n */\n get tokenId() {\n console.warn(\n \"`TokenNftInfoQuery.tokenId` is deprecated with no replacement\",\n );\n return this._tokenId;\n }\n\n /**\n * @deprecated with no replacement\n * Set the token ID for which the info is being requested.\n * @param {TokenId | string} tokenId\n * @returns {TokenNftInfoQuery}\n */\n setTokenId(tokenId) {\n console.warn(\n \"`TokenNftInfoQuery.setTokenId()` is deprecated with no replacement\",\n );\n this._tokenId =\n typeof tokenId === \"string\"\n ? TokenId.fromString(tokenId)\n : TokenId._fromProtobuf(tokenId._toProtobuf());\n\n return this;\n }\n\n /**\n * @deprecated with no replacement\n * @returns {?Long}\n */\n get start() {\n console.warn(\n \"`TokenNftInfoQuery.start` is deprecated with no replacement\",\n );\n return this._start;\n }\n\n /**\n * @deprecated with no replacement\n * Set the token ID for which the info is being requested.\n * @param {Long | number} start\n * @returns {TokenNftInfoQuery}\n */\n setStart(start) {\n console.warn(\n \"`TokenNftInfoQuery.setStart()` is deprecated with no replacement\",\n );\n this._start =\n typeof start === \"number\" ? Long.fromNumber(start) : start;\n\n return this;\n }\n\n /**\n * @deprecated with no replacement\n * @returns {?Long}\n */\n get end() {\n console.warn(\n \"`TokenNftInfoQuery.end` is deprecated with no replacement\",\n );\n return this._end;\n }\n\n /**\n * @deprecated with no replacement\n * Set the token ID for which the info is being requested.\n * @param {Long | number} end\n * @returns {TokenNftInfoQuery}\n */\n setEnd(end) {\n console.warn(\n \"`TokenNftInfoQuery.setEnd()` is deprecated with no replacement\",\n );\n this._end = typeof end === \"number\" ? Long.fromNumber(end) : end;\n\n return this;\n }\n\n /**\n * @override\n * @param {import(\"../client/Client.js\").default<Channel, *>} client\n * @returns {Promise<Hbar>}\n */\n async getCost(client) {\n return super.getCost(client);\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.IQuery} request\n * @returns {Promise<HieroProto.proto.IResponse>}\n */\n _execute(channel, request) {\n return channel.token.getTokenNftInfo(request);\n }\n\n /**\n * @override\n * @internal\n * @param {HieroProto.proto.IResponse} response\n * @returns {HieroProto.proto.IResponseHeader}\n */\n _mapResponseHeader(response) {\n const infos = /** @type {HieroProto.proto.ITokenGetNftInfoResponse} */ (\n response.tokenGetNftInfo\n );\n\n return /** @type {HieroProto.proto.IResponseHeader} */ (infos.header);\n }\n\n /**\n * @override\n * @internal\n * @param {HieroProto.proto.IResponse} response\n * @param {AccountId} nodeAccountId\n * @param {HieroProto.proto.IQuery} request\n * @returns {Promise<TokenNftInfo[]>}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _mapResponse(response, nodeAccountId, request) {\n const nfts = [\n /** @type {HieroProto.proto.ITokenNftInfo} */\n (\n /** @type {HieroProto.proto.ITokenGetNftInfoResponse} */ (\n response.tokenGetNftInfo\n ).nft\n ),\n ];\n\n return Promise.resolve(\n nfts.map((nft) =>\n TokenNftInfo._fromProtobuf(\n /** @type {HieroProto.proto.ITokenNftInfo} */ (nft),\n ),\n ),\n );\n }\n\n /**\n * @override\n * @internal\n * @param {HieroProto.proto.IQueryHeader} header\n * @returns {HieroProto.proto.IQuery}\n */\n _onMakeRequest(header) {\n return {\n tokenGetNftInfo: {\n header,\n nftID: this._nftId != null ? this._nftId._toProtobuf() : null,\n },\n };\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp =\n this._paymentTransactionId != null &&\n this._paymentTransactionId.validStart != null\n ? this._paymentTransactionId.validStart\n : this._timestamp;\n\n return `TokenNftInfoQuery:${timestamp.toString()}`;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nQUERY_REGISTRY.set(\"tokenGetNftInfo\", TokenNftInfoQuery._fromProtobuf);\n"],"names":["TokenNftInfoQuery","Query","constructor","properties","super","this","_nftId","nftId","setNftId","_accountId","accountId","setAccountId","_tokenId","tokenId","setTokenId","_start","start","setStart","_end","end","setEnd","_fromProtobuf","query","tokenGetNftInfo","info","nftID","NftId","undefined","tokenGetAccountNftInfos","accountID","AccountId","tokenID","TokenId","fromString","_toProtobuf","console","warn","Long","fromNumber","getCost","client","_execute","channel","request","token","getTokenNftInfo","_mapResponseHeader","response","_mapResponse","nodeAccountId","nfts","Promise","resolve","map","nft","TokenNftInfo","_onMakeRequest","header","_getLogId","_paymentTransactionId","validStart","_timestamp","toString","QUERY_REGISTRY","set"],"mappings":"oPAiCe,MAAMA,UAA0BC,EAS3C,WAAAC,CAAYC,EAAa,IACrBC,QAMAC,KAAKC,OAAS,KACU,MAApBH,EAAWI,OACXF,KAAKG,SAASL,EAAWI,OAO7BF,KAAKI,WAAa,KACU,MAAxBN,EAAWO,WAEXL,KAAKM,aAAaR,EAAWO,WAOjCL,KAAKO,SAAW,KACU,MAAtBT,EAAWU,SAEXR,KAAKS,WAAWX,EAAWU,SAO/BR,KAAKU,OAAS,KACU,MAApBZ,EAAWa,OAEXX,KAAKY,SAASd,EAAWa,OAO7BX,KAAKa,KAAO,KACU,MAAlBf,EAAWgB,KAEXd,KAAKe,OAAOjB,EAAWgB,IAEnC,CAOI,oBAAOE,CAAcC,GACjB,GAA6B,MAAzBA,EAAMC,gBAAyB,CAC/B,MAAMC,EACFF,EACH,gBAED,OAAO,IAAItB,EAAkB,CACzBO,MACkB,MAAdiB,EAAKC,MACCC,EAAML,cAAcG,EAAKC,YACzBE,GAE1B,CAAe,GAAqC,MAAjCL,EAAMM,wBAAiC,CAC9C,MAAMJ,EAEEF,EACH,wBAEL,OAAO,IAAItB,EAAkB,CACzBU,UACsB,MAAlBc,EAAKK,UACCC,EAAUT,cAAcG,EAAKK,gBAC7BF,EACVX,MAAqB,MAAdQ,EAAK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C,EAAmBkB,EAAKC,WAAWnB,GAAOA,EAEtDd,IACf,CAOI,aAAMkC,CAAQC,GACV,OAAOpC,MAAMmC,QAAQC,EAC7B,CASI,QAAAC,CAASC,EAASC,GACd,OAAOD,EAAQE,MAAMC,gBAAgBF,EAC7C,CAQI,kBAAAG,CAAmBC,GAKf,OAHIA,EACH,gBAEmE,MAC5E,CAWI,YAAAC,CAAaD,EAAUE,EAAeN,GAClC,MAAMO,EAAO,CAIDH,EACF,gBAClB,KAGQ,OAAOI,QAAQC,QACXF,EAAKG,IAAKC,GACNC,EAAalC,cAC7B,IAIA,CAQI,cAAAmC,CAAeC,GACX,MAAO,CACHlC,gBAAiB,CACbkC,SACAhC,MAAsB,MAAfpB,KAAKC,OAAiBD,KAAKC,OAAO4B,cAAgB,MAGzE,CAKI,SAAAwB,GAOI,MAAO,sBAL2B,MAA9BrD,KAAKsD,uBACoC,MAAzCtD,KAAKsD,sBAAsBC,WACrBvD,KAAKsD,sBAAsBC,WAC3BvD,KAAKwD,YAEuBC,YAC9C,EAIAC,EAAeC,IAAI,kBAAmBhE,EAAkBqB"}
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _TokenId = _interopRequireDefault(require("./TokenId.cjs"));
|
|
8
8
|
var _Transaction = _interopRequireWildcard(require("../transaction/Transaction.cjs"));
|
|
9
|
-
function
|
|
10
|
-
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; }
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
11
|
// SPDX-License-Identifier: Apache-2.0
|
|
13
12
|
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _TokenId = _interopRequireDefault(require("./TokenId.cjs"));
|
|
8
8
|
var _Transaction = _interopRequireWildcard(require("../transaction/Transaction.cjs"));
|
|
9
|
-
function
|
|
10
|
-
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; }
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
11
|
// SPDX-License-Identifier: Apache-2.0
|
|
13
12
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"./TokenRejectTransaction.js";import e from"./TokenDissociateTransaction.js";class i{constructor(){this._ownerId=null,this._tokenIds=[],this._nftIds=[],this._freezeWithClient=null,this._signPrivateKey=null,this._signPublicKey=null,this._transactionSigner=null}setOwnerId(t){return this.requireNotFrozen(),this._ownerId=t,this}get ownerId(){return this._ownerId}setTokenIds(t){return this.requireNotFrozen(),this._tokenIds=t,this}addTokenId(t){return this.requireNotFrozen(),this._tokenIds.push(t),this}get tokenIds(){return this._tokenIds}setNftIds(t){return this.requireNotFrozen(),this._nftIds=t,this}addNftId(t){return this.requireNotFrozen(),this._nftIds.push(t),this}get nftIds(){return this._nftIds}sign(t){return this._signPrivateKey=t,this._signPublicKey=null,this._transactionSigner=null,this}signWith(t,e){return this._signPublicKey=t,this._transactionSigner=e,this._signPrivateKey=null,this}signWithOperator(t){const e=t.getOperator();if(null==e)throw new Error("Client operator must be set");return this._signPublicKey=e.publicKey,this._transactionSigner=e.transactionSigner,this._signPrivateKey=null,this}fillOutTransaction(t){this._freezeWithClient&&t.freezeWith(this._freezeWithClient),this._signPrivateKey?t.sign(this._signPrivateKey):this._signPublicKey&&this._transactionSigner&&t.signWith(this._signPublicKey,this._transactionSigner)}freezeWith(t){return this._freezeWithClient=t,this}async execute(i){const n=(new t).setTokenIds(this.tokenIds).setNftIds(this.nftIds);this.ownerId&&n.setOwnerId(this.ownerId),this.fillOutTransaction(n);const s=this.nftIds.map(
|
|
1
|
+
import t from"./TokenRejectTransaction.js";import e from"./TokenDissociateTransaction.js";class i{constructor(){this._ownerId=null,this._tokenIds=[],this._nftIds=[],this._freezeWithClient=null,this._signPrivateKey=null,this._signPublicKey=null,this._transactionSigner=null}setOwnerId(t){return this.requireNotFrozen(),this._ownerId=t,this}get ownerId(){return this._ownerId}setTokenIds(t){return this.requireNotFrozen(),this._tokenIds=t,this}addTokenId(t){return this.requireNotFrozen(),this._tokenIds.push(t),this}get tokenIds(){return this._tokenIds}setNftIds(t){return this.requireNotFrozen(),this._nftIds=t,this}addNftId(t){return this.requireNotFrozen(),this._nftIds.push(t),this}get nftIds(){return this._nftIds}sign(t){return this._signPrivateKey=t,this._signPublicKey=null,this._transactionSigner=null,this}signWith(t,e){return this._signPublicKey=t,this._transactionSigner=e,this._signPrivateKey=null,this}signWithOperator(t){const e=t.getOperator();if(null==e)throw new Error("Client operator must be set");return this._signPublicKey=e.publicKey,this._transactionSigner=e.transactionSigner,this._signPrivateKey=null,this}fillOutTransaction(t){this._freezeWithClient&&t.freezeWith(this._freezeWithClient),this._signPrivateKey?t.sign(this._signPrivateKey):this._signPublicKey&&this._transactionSigner&&t.signWith(this._signPublicKey,this._transactionSigner)}freezeWith(t){return this._freezeWithClient=t,this}async execute(i){const n=(new t).setTokenIds(this.tokenIds).setNftIds(this.nftIds);this.ownerId&&n.setOwnerId(this.ownerId),this.fillOutTransaction(n);const s=this.nftIds.map(t=>t.tokenId).filter(function(t,e,i){return i.indexOf(t)===e}),r=(new e).setTokenIds([...this.tokenIds,...s]);null!=this.ownerId&&r.setAccountId(this.ownerId),this.fillOutTransaction(r);const o=await n.execute(i);await o.getReceipt(i);const h=await r.execute(i);return await h.getReceipt(i),o}requireNotFrozen(){if(null!=this._freezeWithClient)throw new Error("Transaction is already frozen and cannot be modified")}}export{i as default};
|
|
2
2
|
//# sourceMappingURL=TokenRejectFlow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenRejectFlow.js","sources":["../../src/token/TokenRejectFlow.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport TokenRejectTransaction from \"../token/TokenRejectTransaction.js\";\nimport TokenDissociateTransaction from \"../token/TokenDissociateTransaction.js\";\n\n/**\n * @typedef {import(\"../PrivateKey.js\").default} PrivateKey\n * @typedef {import(\"../client/Client.js\").default<*, *>} Client\n * @typedef {import(\"../Signer.js\").default} Signer\n * @typedef {import(\"../transaction/TransactionId.js\").default} TransactionId\n * @typedef {import(\"../transaction/Transaction.js\").default} Transaction\n * @typedef {import(\"../transaction/TransactionResponse.js\").default} TransactionResponse\n * @typedef {import(\"../token/TokenId.js\").default} TokenId\n * @typedef {import(\"../token/NftId.js\").default} NftId\n * @typedef {import(\"../PublicKey.js\").default} PublicKey\n * @typedef {import(\"../account/AccountId.js\").default} AccountId\n */\n\n/**\n * Reject undesired token(s) and dissociate in a single flow.\n */\nexport default class TokenRejectFlow {\n constructor() {\n /**\n * @private\n * @type {?AccountId}\n */\n this._ownerId = null;\n\n /**\n * @private\n * @type {TokenId[]}\n */\n this._tokenIds = [];\n\n /**\n * @private\n * @type {NftId[]}\n */\n this._nftIds = [];\n\n /**\n * @private\n * @type {?Client}\n */\n this._freezeWithClient = null;\n\n /**\n * @private\n * @type {?PrivateKey}\n */\n this._signPrivateKey = null;\n\n /**\n * @private\n * @type {?PublicKey}\n */\n this._signPublicKey = null;\n\n /**\n * @private\n * @type {?(message: Uint8Array) => Promise<Uint8Array>}\n */\n this._transactionSigner = null;\n }\n\n /**\n *\n * @param {AccountId} ownerId\n * @returns {this}\n */\n setOwnerId(ownerId) {\n this.requireNotFrozen();\n this._ownerId = ownerId;\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get ownerId() {\n return this._ownerId;\n }\n\n /**\n *\n * @param {TokenId[]} ids\n * @returns {this}\n */\n setTokenIds(ids) {\n this.requireNotFrozen();\n this._tokenIds = ids;\n return this;\n }\n\n /**\n *\n * @param {TokenId} id\n * @returns {this}\n */\n addTokenId(id) {\n this.requireNotFrozen();\n this._tokenIds.push(id);\n return this;\n }\n\n /**\n *\n * @returns {TokenId[]}\n */\n get tokenIds() {\n return this._tokenIds;\n }\n\n /**\n *\n * @param {NftId[]} ids\n * @returns {this}\n */\n setNftIds(ids) {\n this.requireNotFrozen();\n this._nftIds = ids;\n return this;\n }\n\n /**\n *\n * @param {NftId} id\n * @returns {this}\n */\n addNftId(id) {\n this.requireNotFrozen();\n this._nftIds.push(id);\n return this;\n }\n\n /**\n *\n * @returns {NftId[]}\n */\n get nftIds() {\n return this._nftIds;\n }\n\n /**\n *\n * @param {PrivateKey} privateKey\n * @returns {this}\n */\n sign(privateKey) {\n this._signPrivateKey = privateKey;\n this._signPublicKey = null;\n this._transactionSigner = null;\n return this;\n }\n\n /**\n *\n * @param {PublicKey} publicKey\n * @param {((message: Uint8Array) => Promise<Uint8Array>)} signer\n * @returns {this}\n */\n signWith(publicKey, signer) {\n this._signPublicKey = publicKey;\n this._transactionSigner = signer;\n this._signPrivateKey = null;\n return this;\n }\n\n /**\n * @param {Client} client\n * @returns {this}\n */\n signWithOperator(client) {\n const operator = client.getOperator();\n if (operator == null) {\n throw new Error(\"Client operator must be set\");\n }\n this._signPublicKey = operator.publicKey;\n this._transactionSigner = operator.transactionSigner;\n this._signPrivateKey = null;\n return this;\n }\n\n /**\n * @private\n * @param {Transaction} transaction\n */\n fillOutTransaction(transaction) {\n if (this._freezeWithClient) {\n transaction.freezeWith(this._freezeWithClient);\n }\n if (this._signPrivateKey) {\n void transaction.sign(this._signPrivateKey);\n } else if (this._signPublicKey && this._transactionSigner) {\n void transaction.signWith(\n this._signPublicKey,\n this._transactionSigner,\n );\n }\n }\n /**\n *\n * @param {Client} client\n * @returns {this}\n */\n freezeWith(client) {\n this._freezeWithClient = client;\n return this;\n }\n\n /**\n * @param {Client} client\n * @returns {Promise<TransactionResponse>}\n */\n async execute(client) {\n const tokenRejectTxn = new TokenRejectTransaction()\n .setTokenIds(this.tokenIds)\n .setNftIds(this.nftIds);\n\n if (this.ownerId) {\n tokenRejectTxn.setOwnerId(this.ownerId);\n }\n\n this.fillOutTransaction(tokenRejectTxn);\n\n /* Get all token ids from NFT and remove duplicates as duplicated IDs \n will trigger a TOKEN_REFERENCE_REPEATED error. */\n const nftTokenIds = this.nftIds\n .map((nftId) => nftId.tokenId)\n .filter(function (value, index, array) {\n return array.indexOf(value) === index;\n });\n\n const tokenDissociateTxn = new TokenDissociateTransaction().setTokenIds(\n [...this.tokenIds, ...nftTokenIds],\n );\n\n if (this.ownerId != null) {\n tokenDissociateTxn.setAccountId(this.ownerId);\n }\n\n this.fillOutTransaction(tokenDissociateTxn);\n\n const tokenRejectResponse = await tokenRejectTxn.execute(client);\n await tokenRejectResponse.getReceipt(client);\n\n const tokenDissociateResponse =\n await tokenDissociateTxn.execute(client);\n await tokenDissociateResponse.getReceipt(client);\n\n return tokenRejectResponse;\n }\n\n requireNotFrozen() {\n if (this._freezeWithClient != null) {\n throw new Error(\n \"Transaction is already frozen and cannot be modified\",\n );\n }\n }\n}\n"],"names":["TokenRejectFlow","constructor","this","_ownerId","_tokenIds","_nftIds","_freezeWithClient","_signPrivateKey","_signPublicKey","_transactionSigner","setOwnerId","ownerId","requireNotFrozen","setTokenIds","ids","addTokenId","id","push","tokenIds","setNftIds","addNftId","nftIds","sign","privateKey","signWith","publicKey","signer","signWithOperator","client","operator","getOperator","Error","transactionSigner","fillOutTransaction","transaction","freezeWith","execute","tokenRejectTxn","TokenRejectTransaction","nftTokenIds","map","nftId","tokenId","filter","value","index","array","indexOf","tokenDissociateTxn","TokenDissociateTransaction","setAccountId","tokenRejectResponse","getReceipt","tokenDissociateResponse"],"mappings":"0FAoBe,MAAMA,EACjB,WAAAC,GAKIC,KAAKC,SAAW,KAMhBD,KAAKE,UAAY,GAMjBF,KAAKG,QAAU,GAMfH,KAAKI,kBAAoB,KAMzBJ,KAAKK,gBAAkB,KAMvBL,KAAKM,eAAiB,KAMtBN,KAAKO,mBAAqB,IAClC,CAOI,UAAAC,CAAWC,GAGP,OAFAT,KAAKU,mBACLV,KAAKC,SAAWQ,EACTT,IACf,CAKI,WAAIS,GACA,OAAOT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KS,SACL0B,EAAe3B,WAAWR,KAAKS,SAGnCT,KAAK+B,mBAAmBI,GAIxB,MAAME,EAAcrC,KAAKmB,OACpBmB,
|
|
1
|
+
{"version":3,"file":"TokenRejectFlow.js","sources":["../../src/token/TokenRejectFlow.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport TokenRejectTransaction from \"../token/TokenRejectTransaction.js\";\nimport TokenDissociateTransaction from \"../token/TokenDissociateTransaction.js\";\n\n/**\n * @typedef {import(\"../PrivateKey.js\").default} PrivateKey\n * @typedef {import(\"../client/Client.js\").default<*, *>} Client\n * @typedef {import(\"../Signer.js\").default} Signer\n * @typedef {import(\"../transaction/TransactionId.js\").default} TransactionId\n * @typedef {import(\"../transaction/Transaction.js\").default} Transaction\n * @typedef {import(\"../transaction/TransactionResponse.js\").default} TransactionResponse\n * @typedef {import(\"../token/TokenId.js\").default} TokenId\n * @typedef {import(\"../token/NftId.js\").default} NftId\n * @typedef {import(\"../PublicKey.js\").default} PublicKey\n * @typedef {import(\"../account/AccountId.js\").default} AccountId\n */\n\n/**\n * Reject undesired token(s) and dissociate in a single flow.\n */\nexport default class TokenRejectFlow {\n constructor() {\n /**\n * @private\n * @type {?AccountId}\n */\n this._ownerId = null;\n\n /**\n * @private\n * @type {TokenId[]}\n */\n this._tokenIds = [];\n\n /**\n * @private\n * @type {NftId[]}\n */\n this._nftIds = [];\n\n /**\n * @private\n * @type {?Client}\n */\n this._freezeWithClient = null;\n\n /**\n * @private\n * @type {?PrivateKey}\n */\n this._signPrivateKey = null;\n\n /**\n * @private\n * @type {?PublicKey}\n */\n this._signPublicKey = null;\n\n /**\n * @private\n * @type {?(message: Uint8Array) => Promise<Uint8Array>}\n */\n this._transactionSigner = null;\n }\n\n /**\n *\n * @param {AccountId} ownerId\n * @returns {this}\n */\n setOwnerId(ownerId) {\n this.requireNotFrozen();\n this._ownerId = ownerId;\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get ownerId() {\n return this._ownerId;\n }\n\n /**\n *\n * @param {TokenId[]} ids\n * @returns {this}\n */\n setTokenIds(ids) {\n this.requireNotFrozen();\n this._tokenIds = ids;\n return this;\n }\n\n /**\n *\n * @param {TokenId} id\n * @returns {this}\n */\n addTokenId(id) {\n this.requireNotFrozen();\n this._tokenIds.push(id);\n return this;\n }\n\n /**\n *\n * @returns {TokenId[]}\n */\n get tokenIds() {\n return this._tokenIds;\n }\n\n /**\n *\n * @param {NftId[]} ids\n * @returns {this}\n */\n setNftIds(ids) {\n this.requireNotFrozen();\n this._nftIds = ids;\n return this;\n }\n\n /**\n *\n * @param {NftId} id\n * @returns {this}\n */\n addNftId(id) {\n this.requireNotFrozen();\n this._nftIds.push(id);\n return this;\n }\n\n /**\n *\n * @returns {NftId[]}\n */\n get nftIds() {\n return this._nftIds;\n }\n\n /**\n *\n * @param {PrivateKey} privateKey\n * @returns {this}\n */\n sign(privateKey) {\n this._signPrivateKey = privateKey;\n this._signPublicKey = null;\n this._transactionSigner = null;\n return this;\n }\n\n /**\n *\n * @param {PublicKey} publicKey\n * @param {((message: Uint8Array) => Promise<Uint8Array>)} signer\n * @returns {this}\n */\n signWith(publicKey, signer) {\n this._signPublicKey = publicKey;\n this._transactionSigner = signer;\n this._signPrivateKey = null;\n return this;\n }\n\n /**\n * @param {Client} client\n * @returns {this}\n */\n signWithOperator(client) {\n const operator = client.getOperator();\n if (operator == null) {\n throw new Error(\"Client operator must be set\");\n }\n this._signPublicKey = operator.publicKey;\n this._transactionSigner = operator.transactionSigner;\n this._signPrivateKey = null;\n return this;\n }\n\n /**\n * @private\n * @param {Transaction} transaction\n */\n fillOutTransaction(transaction) {\n if (this._freezeWithClient) {\n transaction.freezeWith(this._freezeWithClient);\n }\n if (this._signPrivateKey) {\n void transaction.sign(this._signPrivateKey);\n } else if (this._signPublicKey && this._transactionSigner) {\n void transaction.signWith(\n this._signPublicKey,\n this._transactionSigner,\n );\n }\n }\n /**\n *\n * @param {Client} client\n * @returns {this}\n */\n freezeWith(client) {\n this._freezeWithClient = client;\n return this;\n }\n\n /**\n * @param {Client} client\n * @returns {Promise<TransactionResponse>}\n */\n async execute(client) {\n const tokenRejectTxn = new TokenRejectTransaction()\n .setTokenIds(this.tokenIds)\n .setNftIds(this.nftIds);\n\n if (this.ownerId) {\n tokenRejectTxn.setOwnerId(this.ownerId);\n }\n\n this.fillOutTransaction(tokenRejectTxn);\n\n /* Get all token ids from NFT and remove duplicates as duplicated IDs \n will trigger a TOKEN_REFERENCE_REPEATED error. */\n const nftTokenIds = this.nftIds\n .map((nftId) => nftId.tokenId)\n .filter(function (value, index, array) {\n return array.indexOf(value) === index;\n });\n\n const tokenDissociateTxn = new TokenDissociateTransaction().setTokenIds(\n [...this.tokenIds, ...nftTokenIds],\n );\n\n if (this.ownerId != null) {\n tokenDissociateTxn.setAccountId(this.ownerId);\n }\n\n this.fillOutTransaction(tokenDissociateTxn);\n\n const tokenRejectResponse = await tokenRejectTxn.execute(client);\n await tokenRejectResponse.getReceipt(client);\n\n const tokenDissociateResponse =\n await tokenDissociateTxn.execute(client);\n await tokenDissociateResponse.getReceipt(client);\n\n return tokenRejectResponse;\n }\n\n requireNotFrozen() {\n if (this._freezeWithClient != null) {\n throw new Error(\n \"Transaction is already frozen and cannot be modified\",\n );\n }\n }\n}\n"],"names":["TokenRejectFlow","constructor","this","_ownerId","_tokenIds","_nftIds","_freezeWithClient","_signPrivateKey","_signPublicKey","_transactionSigner","setOwnerId","ownerId","requireNotFrozen","setTokenIds","ids","addTokenId","id","push","tokenIds","setNftIds","addNftId","nftIds","sign","privateKey","signWith","publicKey","signer","signWithOperator","client","operator","getOperator","Error","transactionSigner","fillOutTransaction","transaction","freezeWith","execute","tokenRejectTxn","TokenRejectTransaction","nftTokenIds","map","nftId","tokenId","filter","value","index","array","indexOf","tokenDissociateTxn","TokenDissociateTransaction","setAccountId","tokenRejectResponse","getReceipt","tokenDissociateResponse"],"mappings":"0FAoBe,MAAMA,EACjB,WAAAC,GAKIC,KAAKC,SAAW,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AkBN,KAAKO,oBAC9ByB,EAAYV,SACbtB,KAAKM,eACLN,KAAKO,mBAGrB,CAMI,UAAA0B,CAAWP,GAEP,OADA1B,KAAKI,kBAAoBsB,EAClB1B,IACf,CAMI,aAAMkC,CAAQR,GACV,MAAMS,GAAiB,IAAIC,GACtBzB,YAAYX,KAAKgB,UACjBC,UAAUjB,KAAKmB,QAEhBnB,KAAKS,SACL0B,EAAe3B,WAAWR,KAAKS,SAGnCT,KAAK+B,mBAAmBI,GAIxB,MAAME,EAAcrC,KAAKmB,OACpBmB,IAAKC,GAAUA,EAAMC,SACrBC,OAAO,SAAUC,EAAOC,EAAOC,GAC5B,OAAOA,EAAMC,QAAQH,KAAWC,CAChD,GAEcG,GAAqB,IAAIC,GAA6BpC,YACxD,IAAIX,KAAKgB,YAAaqB,IAGN,MAAhBrC,KAAKS,SACLqC,EAAmBE,aAAahD,KAAKS,SAGzCT,KAAK+B,mBAAmBe,GAExB,MAAMG,QAA4Bd,EAAeD,QAAQR,SACnDuB,EAAoBC,WAAWxB,GAErC,MAAMyB,QACIL,EAAmBZ,QAAQR,GAGrC,aAFMyB,EAAwBD,WAAWxB,GAElCuB,CACf,CAEI,gBAAAvC,GACI,GAA8B,MAA1BV,KAAKI,kBACL,MAAM,IAAIyB,MACN,uDAGhB"}
|
|
@@ -7,8 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _AccountId = _interopRequireDefault(require("../account/AccountId.cjs"));
|
|
8
8
|
var _Transaction = _interopRequireWildcard(require("../transaction/Transaction.cjs"));
|
|
9
9
|
var _TokenReference = _interopRequireDefault(require("../token/TokenReference.cjs"));
|
|
10
|
-
function
|
|
11
|
-
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; }
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
12
|
// SPDX-License-Identifier: Apache-2.0
|
|
14
13
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"../account/AccountId.js";import e,{TRANSACTION_REGISTRY as n}from"../transaction/Transaction.js";import r from"./TokenReference.js";class o extends e{constructor(t={}){super(),this._owner=null,null!=t.owner&&this.setOwnerId(t.owner),this._tokenIds=[],this._nftIds=[],null!=t.tokenIds&&this.setTokenIds(t.tokenIds),null!=t.nftIds&&this.setNftIds(t.nftIds)}static _fromProtobuf(n,s,i,u,f){const d=f[0].tokenReject,a=d.rejections?.map(
|
|
1
|
+
import t from"../account/AccountId.js";import e,{TRANSACTION_REGISTRY as n}from"../transaction/Transaction.js";import r from"./TokenReference.js";class o extends e{constructor(t={}){super(),this._owner=null,null!=t.owner&&this.setOwnerId(t.owner),this._tokenIds=[],this._nftIds=[],null!=t.tokenIds&&this.setTokenIds(t.tokenIds),null!=t.nftIds&&this.setNftIds(t.nftIds)}static _fromProtobuf(n,s,i,u,f){const d=f[0].tokenReject,a=d.rejections?.map(t=>r._fromProtobuf(t)),h=a?.filter(t=>t.fungibleToken).map(({fungibleToken:t})=>{if(null==t)throw new Error("Fungible Token cannot be null");return t}),c=a?.filter(t=>t.nft).map(({nft:t})=>{if(null==t)throw new Error("Nft cannot be null");return t});return e._fromProtobufTransactions(new o({owner:null!=d.owner?t._fromProtobuf(d.owner):void 0,tokenIds:h,nftIds:c}),n,s,i,u,f)}get tokenIds(){return this._tokenIds}setTokenIds(t){return this._requireNotFrozen(),this._tokenIds=t,this}addTokenId(t){return this._requireNotFrozen(),this._tokenIds?.push(t),this}get nftIds(){return this._nftIds}setNftIds(t){return this._requireNotFrozen(),this._nftIds=t,this}addNftId(t){return this._requireNotFrozen(),this._nftIds?.push(t),this}get ownerId(){return this._owner}setOwnerId(t){return this._requireNotFrozen(),this._owner=t,this}_execute(t,e){return t.token.rejectToken(e)}_getTransactionDataCase(){return"tokenReject"}_makeTransactionData(){const t=[];for(const e of this._tokenIds)t.push({fungibleToken:e._toProtobuf()});for(const e of this._nftIds)t.push({nft:e._toProtobuf()});return{owner:this.ownerId?._toProtobuf()??null,rejections:t}}_getLogId(){return`TokenRejectTransaction:${this._transactionIds.current.validStart.toString()}`}}n.set("tokenReject",o._fromProtobuf);export{o as default};
|
|
2
2
|
//# sourceMappingURL=TokenRejectTransaction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenRejectTransaction.js","sources":["../../src/token/TokenRejectTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport AccountId from \"../account/AccountId.js\";\nimport Transaction from \"../transaction/Transaction.js\";\nimport { TRANSACTION_REGISTRY } from \"../transaction/Transaction.js\";\nimport TokenReference from \"../token/TokenReference.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.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n * @typedef {import(\"@hashgraph/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenRejectTransactionBody} HieroProto.proto.ITokenRejectTransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.TokenReference} HieroProto.proto.TokenReference\n */\n\n/**\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../client/Client.js\").default<*, *>} Client\n * @typedef {import(\"../transaction/TransactionId.js\").default} TransactionId\n * @typedef {import(\"../token/TokenId.js\").default} TokenId\n * @typedef {import(\"../token/NftId.js\").default} NftId\n */\n\n/**\n * Reject a new Hedera™ crypto-currency token.\n */\nexport default class TokenRejectTransaction extends Transaction {\n /**\n *\n * @param {object} [props]\n * @param {?AccountId} [props.owner]\n * @param {NftId[]} [props.nftIds]\n * @param {TokenId[]} [props.tokenIds]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._owner = null;\n\n if (props.owner != null) {\n this.setOwnerId(props.owner);\n }\n\n /**\n * @private\n * @type {TokenId[]}\n */\n this._tokenIds = [];\n\n /**\n * @private\n * @type {NftId[]}\n */\n this._nftIds = [];\n\n if (props.tokenIds != null) {\n this.setTokenIds(props.tokenIds);\n }\n\n if (props.nftIds != null) {\n this.setNftIds(props.nftIds);\n }\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITransaction[]} transactions\n * @param {HieroProto.proto.ISignedTransaction[]} signedTransactions\n * @param {TransactionId[]} transactionIds\n * @param {AccountId[]} nodeIds\n * @param {HieroProto.proto.ITransactionBody[]} bodies\n * @returns {TokenRejectTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const rejectToken =\n /** @type {HieroProto.proto.ITokenRejectTransactionBody} */ (\n body.tokenReject\n );\n\n const tokenIds = rejectToken.rejections?.map((rejection) =>\n TokenReference._fromProtobuf(rejection),\n );\n const ftIds = tokenIds\n ?.filter((token) => token.fungibleToken)\n .map(({ fungibleToken }) => {\n if (fungibleToken == null) {\n throw new Error(\"Fungible Token cannot be null\");\n }\n return fungibleToken;\n });\n\n const nftIds = tokenIds\n ?.filter((token) => token.nft)\n .map(({ nft }) => {\n if (nft == null) {\n throw new Error(\"Nft cannot be null\");\n }\n return nft;\n });\n\n return Transaction._fromProtobufTransactions(\n new TokenRejectTransaction({\n owner:\n rejectToken.owner != null\n ? AccountId._fromProtobuf(rejectToken.owner)\n : undefined,\n\n tokenIds: ftIds,\n nftIds: nftIds,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {TokenId[]}\n */\n get tokenIds() {\n return this._tokenIds;\n }\n\n /**\n * @param {TokenId[]} tokenIds\n * @returns {this}\n */\n setTokenIds(tokenIds) {\n this._requireNotFrozen();\n this._tokenIds = tokenIds;\n return this;\n }\n\n /**\n * @param {TokenId} tokenId\n * @returns {this}\n */\n addTokenId(tokenId) {\n this._requireNotFrozen();\n this._tokenIds?.push(tokenId);\n return this;\n }\n\n /**\n * @returns {NftId[]}\n *\n */\n get nftIds() {\n return this._nftIds;\n }\n\n /**\n *\n * @param {NftId[]} nftIds\n * @returns {this}\n */\n setNftIds(nftIds) {\n this._requireNotFrozen();\n this._nftIds = nftIds;\n return this;\n }\n\n /**\n * @param {NftId} nftId\n * @returns {this}\n */\n addNftId(nftId) {\n this._requireNotFrozen();\n this._nftIds?.push(nftId);\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get ownerId() {\n return this._owner;\n }\n\n /**\n * @param {AccountId} owner\n * @returns {this}\n */\n setOwnerId(owner) {\n this._requireNotFrozen();\n this._owner = owner;\n return this;\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.token.rejectToken(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"tokenReject\";\n }\n\n /**\n * @returns {HieroProto.proto.ITokenRejectTransactionBody}\n */\n _makeTransactionData() {\n /** @type {HieroProto.proto.TokenReference[]} */\n const rejections = [];\n for (const tokenId of this._tokenIds) {\n rejections.push({\n fungibleToken: tokenId._toProtobuf(),\n });\n }\n\n for (const nftId of this._nftIds) {\n rejections.push({\n nft: nftId._toProtobuf(),\n });\n }\n return {\n owner: this.ownerId?._toProtobuf() ?? null,\n rejections,\n };\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp = /** @type {import(\"../Timestamp.js\").default} */ (\n this._transactionIds.current.validStart\n );\n return `TokenRejectTransaction:${timestamp.toString()}`;\n }\n}\nTRANSACTION_REGISTRY.set(\n \"tokenReject\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n TokenRejectTransaction._fromProtobuf,\n);\n"],"names":["TokenRejectTransaction","Transaction","constructor","props","super","this","_owner","owner","setOwnerId","_tokenIds","_nftIds","tokenIds","setTokenIds","nftIds","setNftIds","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","rejectToken","rejections","map","rejection","TokenReference","ftIds","filter","token","fungibleToken","Error","nft","_fromProtobufTransactions","AccountId","undefined","_requireNotFrozen","addTokenId","tokenId","push","addNftId","nftId","ownerId","_execute","channel","request","_getTransactionDataCase","_makeTransactionData","_toProtobuf","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"kJA4Be,MAAMA,UAA+BC,EAQhD,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,OAAS,KAEK,MAAfH,EAAMI,OACNF,KAAKG,WAAWL,EAAMI,OAO1BF,KAAKI,UAAY,GAMjBJ,KAAKK,QAAU,GAEO,MAAlBP,EAAMQ,UACNN,KAAKO,YAAYT,EAAMQ,UAGP,MAAhBR,EAAMU,QACNR,KAAKS,UAAUX,EAAMU,OAEjC,CAWI,oBAAOE,CACHC,EACAC,EACAC,EACAC,EACAC,GAEA,MACMC,EADOD,EAAO,GAIf,YAECT,EAAWU,EAAYC,YAAYC,
|
|
1
|
+
{"version":3,"file":"TokenRejectTransaction.js","sources":["../../src/token/TokenRejectTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport AccountId from \"../account/AccountId.js\";\nimport Transaction from \"../transaction/Transaction.js\";\nimport { TRANSACTION_REGISTRY } from \"../transaction/Transaction.js\";\nimport TokenReference from \"../token/TokenReference.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.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n * @typedef {import(\"@hashgraph/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenRejectTransactionBody} HieroProto.proto.ITokenRejectTransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.TokenReference} HieroProto.proto.TokenReference\n */\n\n/**\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../client/Client.js\").default<*, *>} Client\n * @typedef {import(\"../transaction/TransactionId.js\").default} TransactionId\n * @typedef {import(\"../token/TokenId.js\").default} TokenId\n * @typedef {import(\"../token/NftId.js\").default} NftId\n */\n\n/**\n * Reject a new Hedera™ crypto-currency token.\n */\nexport default class TokenRejectTransaction extends Transaction {\n /**\n *\n * @param {object} [props]\n * @param {?AccountId} [props.owner]\n * @param {NftId[]} [props.nftIds]\n * @param {TokenId[]} [props.tokenIds]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._owner = null;\n\n if (props.owner != null) {\n this.setOwnerId(props.owner);\n }\n\n /**\n * @private\n * @type {TokenId[]}\n */\n this._tokenIds = [];\n\n /**\n * @private\n * @type {NftId[]}\n */\n this._nftIds = [];\n\n if (props.tokenIds != null) {\n this.setTokenIds(props.tokenIds);\n }\n\n if (props.nftIds != null) {\n this.setNftIds(props.nftIds);\n }\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITransaction[]} transactions\n * @param {HieroProto.proto.ISignedTransaction[]} signedTransactions\n * @param {TransactionId[]} transactionIds\n * @param {AccountId[]} nodeIds\n * @param {HieroProto.proto.ITransactionBody[]} bodies\n * @returns {TokenRejectTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const rejectToken =\n /** @type {HieroProto.proto.ITokenRejectTransactionBody} */ (\n body.tokenReject\n );\n\n const tokenIds = rejectToken.rejections?.map((rejection) =>\n TokenReference._fromProtobuf(rejection),\n );\n const ftIds = tokenIds\n ?.filter((token) => token.fungibleToken)\n .map(({ fungibleToken }) => {\n if (fungibleToken == null) {\n throw new Error(\"Fungible Token cannot be null\");\n }\n return fungibleToken;\n });\n\n const nftIds = tokenIds\n ?.filter((token) => token.nft)\n .map(({ nft }) => {\n if (nft == null) {\n throw new Error(\"Nft cannot be null\");\n }\n return nft;\n });\n\n return Transaction._fromProtobufTransactions(\n new TokenRejectTransaction({\n owner:\n rejectToken.owner != null\n ? AccountId._fromProtobuf(rejectToken.owner)\n : undefined,\n\n tokenIds: ftIds,\n nftIds: nftIds,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {TokenId[]}\n */\n get tokenIds() {\n return this._tokenIds;\n }\n\n /**\n * @param {TokenId[]} tokenIds\n * @returns {this}\n */\n setTokenIds(tokenIds) {\n this._requireNotFrozen();\n this._tokenIds = tokenIds;\n return this;\n }\n\n /**\n * @param {TokenId} tokenId\n * @returns {this}\n */\n addTokenId(tokenId) {\n this._requireNotFrozen();\n this._tokenIds?.push(tokenId);\n return this;\n }\n\n /**\n * @returns {NftId[]}\n *\n */\n get nftIds() {\n return this._nftIds;\n }\n\n /**\n *\n * @param {NftId[]} nftIds\n * @returns {this}\n */\n setNftIds(nftIds) {\n this._requireNotFrozen();\n this._nftIds = nftIds;\n return this;\n }\n\n /**\n * @param {NftId} nftId\n * @returns {this}\n */\n addNftId(nftId) {\n this._requireNotFrozen();\n this._nftIds?.push(nftId);\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get ownerId() {\n return this._owner;\n }\n\n /**\n * @param {AccountId} owner\n * @returns {this}\n */\n setOwnerId(owner) {\n this._requireNotFrozen();\n this._owner = owner;\n return this;\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.token.rejectToken(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"tokenReject\";\n }\n\n /**\n * @returns {HieroProto.proto.ITokenRejectTransactionBody}\n */\n _makeTransactionData() {\n /** @type {HieroProto.proto.TokenReference[]} */\n const rejections = [];\n for (const tokenId of this._tokenIds) {\n rejections.push({\n fungibleToken: tokenId._toProtobuf(),\n });\n }\n\n for (const nftId of this._nftIds) {\n rejections.push({\n nft: nftId._toProtobuf(),\n });\n }\n return {\n owner: this.ownerId?._toProtobuf() ?? null,\n rejections,\n };\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp = /** @type {import(\"../Timestamp.js\").default} */ (\n this._transactionIds.current.validStart\n );\n return `TokenRejectTransaction:${timestamp.toString()}`;\n }\n}\nTRANSACTION_REGISTRY.set(\n \"tokenReject\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n TokenRejectTransaction._fromProtobuf,\n);\n"],"names":["TokenRejectTransaction","Transaction","constructor","props","super","this","_owner","owner","setOwnerId","_tokenIds","_nftIds","tokenIds","setTokenIds","nftIds","setNftIds","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","rejectToken","rejections","map","rejection","TokenReference","ftIds","filter","token","fungibleToken","Error","nft","_fromProtobufTransactions","AccountId","undefined","_requireNotFrozen","addTokenId","tokenId","push","addNftId","nftId","ownerId","_execute","channel","request","_getTransactionDataCase","_makeTransactionData","_toProtobuf","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"kJA4Be,MAAMA,UAA+BC,EAQhD,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,OAAS,KAEK,MAAfH,EAAMI,OACNF,KAAKG,WAAWL,EAAMI,OAO1BF,KAAKI,UAAY,GAMjBJ,KAAKK,QAAU,GAEO,MAAlBP,EAAMQ,UACNN,KAAKO,YAAYT,EAAMQ,UAGP,MAAhBR,EAAMU,QACNR,KAAKS,UAAUX,EAAMU,OAEjC,CAWI,oBAAOE,CACHC,EACAC,EACAC,EACAC,EACAC,GAEA,MACMC,EADOD,EAAO,GAIf,YAECT,EAAWU,EAAYC,YAAYC,IAAKC,GAC1CC,EAAeV,cAAcS,IAE3BE,EAAQf,GACRgB,OAAQC,GAAUA,EAAMC,eACzBN,IAAI,EAAGM,oBACJ,GAAqB,MAAjBA,EACA,MAAM,IAAIC,MAAM,iCAEpB,OAAOD,IAGThB,EAASF,GACTgB,OAAQC,GAAUA,EAAMG,KACzBR,IAAI,EAAGQ,UACJ,GAAW,MAAPA,EACA,MAAM,IAAID,MAAM,sBAEpB,OAAOC,IAGf,OAAO9B,EAAY+B,0BACf,IAAIhC,EAAuB,CACvBO,MACyB,MAArBc,EAAYd,MACN0B,EAAUlB,cAAcM,EAAYd,YACpC2B,EAEVvB,SAAUe,EACVb,OAAQA,IAEZG,EACAC,EACAC,EACAC,EACAC,EAEZ,CAKI,YAAIT,GACA,OAAON,KAAKI,SACpB,CAMI,WAAAG,CAAYD,GAGR,OAFAN,KAAK8B,oBACL9B,KAAKI,UAAYE,EACVN,IACf,CAMI,UAAA+B,CAAWC,GAGP,OAFAhC,KAAK8B,oBACL9B,KAAKI,WAAW6B,KAAKD,GACdhC,IACf,CAMI,UAAIQ,GACA,OAAOR,KAAKK,OACpB,CAOI,SAAAI,CAAUD,GAGN,OAFAR,KAAK8B,oBACL9B,KAAKK,QAAUG,EACRR,IACf,CAMI,QAAAkC,CAASC,GAGL,OAFAnC,KAAK8B,oBACL9B,KAAKK,SAAS4B,KAAKE,GACZnC,IACf,CAKI,WAAIoC,GACA,OAAOpC,KAAKC,MACpB,CAMI,UAAAE,CAAWD,GAGP,OAFAF,KAAK8B,oBACL9B,KAAKC,OAASC,EACPF,IACf,CASI,QAAAqC,CAASC,EAASC,GACd,OAAOD,EAAQf,MAAMP,YAAYuB,EACzC,CAOI,uBAAAC,GACI,MAAO,aACf,CAKI,oBAAAC,GAEI,MAAMxB,EAAa,GACnB,IAAK,MAAMe,KAAWhC,KAAKI,UACvBa,EAAWgB,KAAK,CACZT,cAAeQ,EAAQU,gBAI/B,IAAK,MAAMP,KAASnC,KAAKK,QACrBY,EAAWgB,KAAK,CACZP,IAAKS,EAAMO,gBAGnB,MAAO,CACHxC,MAAOF,KAAKoC,SAASM,eAAiB,KACtCzB,aAEZ,CAKI,SAAA0B,GAII,MAAO,0BAFH3C,KAAK4C,gBAAgBC,QACxB,WAC0CC,YACnD,EAEAC,EAAqBC,IACjB,cAEArD,EAAuBe"}
|
|
@@ -7,8 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _TokenId = _interopRequireDefault(require("./TokenId.cjs"));
|
|
8
8
|
var _AccountId = _interopRequireDefault(require("../account/AccountId.cjs"));
|
|
9
9
|
var _Transaction = _interopRequireWildcard(require("../transaction/Transaction.cjs"));
|
|
10
|
-
function
|
|
11
|
-
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; }
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
12
|
// SPDX-License-Identifier: Apache-2.0
|
|
14
13
|
|
|
@@ -7,8 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _TokenId = _interopRequireDefault(require("./TokenId.cjs"));
|
|
8
8
|
var _AccountId = _interopRequireDefault(require("../account/AccountId.cjs"));
|
|
9
9
|
var _Transaction = _interopRequireWildcard(require("../transaction/Transaction.cjs"));
|
|
10
|
-
function
|
|
11
|
-
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; }
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
12
|
// SPDX-License-Identifier: Apache-2.0
|
|
14
13
|
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _TokenId = _interopRequireDefault(require("./TokenId.cjs"));
|
|
8
8
|
var _Transaction = _interopRequireWildcard(require("../transaction/Transaction.cjs"));
|
|
9
|
-
function
|
|
10
|
-
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; }
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
11
|
// SPDX-License-Identifier: Apache-2.0
|
|
13
12
|
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _TokenId = _interopRequireDefault(require("./TokenId.cjs"));
|
|
8
8
|
var _Transaction = _interopRequireWildcard(require("../transaction/Transaction.cjs"));
|
|
9
|
-
function
|
|
10
|
-
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; }
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
11
|
// SPDX-License-Identifier: Apache-2.0
|
|
13
12
|
|
|
@@ -11,8 +11,7 @@ var _Timestamp = _interopRequireDefault(require("../Timestamp.cjs"));
|
|
|
11
11
|
var _Duration = _interopRequireDefault(require("../Duration.cjs"));
|
|
12
12
|
var _Key = _interopRequireDefault(require("../Key.cjs"));
|
|
13
13
|
var _TokenKeyValidation = _interopRequireDefault(require("./TokenKeyValidation.cjs"));
|
|
14
|
-
function
|
|
15
|
-
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; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
16
|
// SPDX-License-Identifier: Apache-2.0
|
|
18
17
|
|