@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
|
@@ -16,8 +16,7 @@ var _CustomRoyaltyFee = _interopRequireDefault(require("./CustomRoyaltyFee.cjs")
|
|
|
16
16
|
var _TokenType = _interopRequireDefault(require("./TokenType.cjs"));
|
|
17
17
|
var _TokenSupplyType = _interopRequireDefault(require("./TokenSupplyType.cjs"));
|
|
18
18
|
var _Key = _interopRequireDefault(require("../Key.cjs"));
|
|
19
|
-
function
|
|
20
|
-
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; }
|
|
19
|
+
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); }
|
|
21
20
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
21
|
// SPDX-License-Identifier: Apache-2.0
|
|
23
22
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"../Hbar.js";import t,{TRANSACTION_REGISTRY as o,DEFAULT_AUTO_RENEW_PERIOD as u}from"../transaction/Transaction.js";import i from"long";import n from"../account/AccountId.js";import s from"../Timestamp.js";import r from"../Duration.js";import l from"./CustomFixedFee.js";import a from"./CustomFractionalFee.js";import y from"./CustomRoyaltyFee.js";import h from"./TokenType.js";import p from"./TokenSupplyType.js";import m from"../Key.js";class _ extends t{constructor(t={}){super(),this._tokenName=null,this._tokenSymbol=null,this._decimals=null,this._initialSupply=null,this._treasuryAccountId=null,this._adminKey=null,this._kycKey=null,this._freezeKey=null,this._pauseKey=null,this._wipeKey=null,this._supplyKey=null,this._feeScheduleKey=null,this._freezeDefault=null,this._autoRenewAccountId=null,this._expirationTime=new s(Math.floor(Date.now()/1e3+u.toNumber()),0),this._autoRenewPeriod=new r(u),this._tokenMemo=null,this._customFees=[],this._tokenType=null,this._supplyType=null,this._maxSupply=null,this._defaultMaxTransactionFee=new e(30),this._metadataKey=null,this._metadata=null,null!=t.tokenName&&this.setTokenName(t.tokenName),null!=t.tokenSymbol&&this.setTokenSymbol(t.tokenSymbol),null!=t.decimals&&this.setDecimals(t.decimals),null!=t.initialSupply&&this.setInitialSupply(t.initialSupply),null!=t.treasuryAccountId&&this.setTreasuryAccountId(t.treasuryAccountId),null!=t.adminKey&&this.setAdminKey(t.adminKey),null!=t.kycKey&&this.setKycKey(t.kycKey),null!=t.freezeKey&&this.setFreezeKey(t.freezeKey),null!=t.pauseKey&&this.setPauseKey(t.pauseKey),null!=t.wipeKey&&this.setWipeKey(t.wipeKey),null!=t.supplyKey&&this.setSupplyKey(t.supplyKey),null!=t.feeScheduleKey&&this.setFeeScheduleKey(t.feeScheduleKey),null!=t.freezeDefault&&this.setFreezeDefault(t.freezeDefault),null!=t.autoRenewAccountId&&this.setAutoRenewAccountId(t.autoRenewAccountId),null!=t.expirationTime&&this.setExpirationTime(t.expirationTime),null!=t.autoRenewPeriod&&this.setAutoRenewPeriod(t.autoRenewPeriod),null!=t.tokenMemo&&this.setTokenMemo(t.tokenMemo),null!=t.customFees&&this.setCustomFees(t.customFees),null!=t.tokenType&&this.setTokenType(t.tokenType),null!=t.supplyType&&this.setSupplyType(t.supplyType),null!=t.maxSupply&&this.setMaxSupply(t.maxSupply),null!=t.metadataKey&&this.setMetadataKey(t.metadataKey),null!=t.metadata&&this.setMetadata(t.metadata)}static _fromProtobuf(e,o,u,i,c){const d=c[0].tokenCreation;return t._fromProtobufTransactions(new _({tokenName:null!=d.name?d.name:void 0,tokenSymbol:null!=d.symbol?d.symbol:void 0,decimals:null!=d.decimals?d.decimals:void 0,initialSupply:null!=d.initialSupply?d.initialSupply:void 0,treasuryAccountId:null!=d.treasury?n._fromProtobuf(d.treasury):void 0,adminKey:null!=d.adminKey?m._fromProtobufKey(d.adminKey):void 0,kycKey:null!=d.kycKey?m._fromProtobufKey(d.kycKey):void 0,freezeKey:null!=d.freezeKey?m._fromProtobufKey(d.freezeKey):void 0,pauseKey:null!=d.pauseKey?m._fromProtobufKey(d.pauseKey):void 0,wipeKey:null!=d.wipeKey?m._fromProtobufKey(d.wipeKey):void 0,supplyKey:null!=d.supplyKey?m._fromProtobufKey(d.supplyKey):void 0,feeScheduleKey:null!=d.feeScheduleKey?m._fromProtobufKey(d.feeScheduleKey):void 0,freezeDefault:null!=d.freezeDefault?d.freezeDefault:void 0,autoRenewAccountId:null!=d.autoRenewAccount?n._fromProtobuf(d.autoRenewAccount):void 0,expirationTime:null!=d.expiry?s._fromProtobuf(d.expiry):void 0,autoRenewPeriod:null!=d.autoRenewPeriod?r._fromProtobuf(d.autoRenewPeriod):void 0,tokenMemo:null!=d.memo?d.memo:void 0,customFees:null!=d.customFees?d.customFees.map(
|
|
1
|
+
import e from"../Hbar.js";import t,{TRANSACTION_REGISTRY as o,DEFAULT_AUTO_RENEW_PERIOD as u}from"../transaction/Transaction.js";import i from"long";import n from"../account/AccountId.js";import s from"../Timestamp.js";import r from"../Duration.js";import l from"./CustomFixedFee.js";import a from"./CustomFractionalFee.js";import y from"./CustomRoyaltyFee.js";import h from"./TokenType.js";import p from"./TokenSupplyType.js";import m from"../Key.js";class _ extends t{constructor(t={}){super(),this._tokenName=null,this._tokenSymbol=null,this._decimals=null,this._initialSupply=null,this._treasuryAccountId=null,this._adminKey=null,this._kycKey=null,this._freezeKey=null,this._pauseKey=null,this._wipeKey=null,this._supplyKey=null,this._feeScheduleKey=null,this._freezeDefault=null,this._autoRenewAccountId=null,this._expirationTime=new s(Math.floor(Date.now()/1e3+u.toNumber()),0),this._autoRenewPeriod=new r(u),this._tokenMemo=null,this._customFees=[],this._tokenType=null,this._supplyType=null,this._maxSupply=null,this._defaultMaxTransactionFee=new e(30),this._metadataKey=null,this._metadata=null,null!=t.tokenName&&this.setTokenName(t.tokenName),null!=t.tokenSymbol&&this.setTokenSymbol(t.tokenSymbol),null!=t.decimals&&this.setDecimals(t.decimals),null!=t.initialSupply&&this.setInitialSupply(t.initialSupply),null!=t.treasuryAccountId&&this.setTreasuryAccountId(t.treasuryAccountId),null!=t.adminKey&&this.setAdminKey(t.adminKey),null!=t.kycKey&&this.setKycKey(t.kycKey),null!=t.freezeKey&&this.setFreezeKey(t.freezeKey),null!=t.pauseKey&&this.setPauseKey(t.pauseKey),null!=t.wipeKey&&this.setWipeKey(t.wipeKey),null!=t.supplyKey&&this.setSupplyKey(t.supplyKey),null!=t.feeScheduleKey&&this.setFeeScheduleKey(t.feeScheduleKey),null!=t.freezeDefault&&this.setFreezeDefault(t.freezeDefault),null!=t.autoRenewAccountId&&this.setAutoRenewAccountId(t.autoRenewAccountId),null!=t.expirationTime&&this.setExpirationTime(t.expirationTime),null!=t.autoRenewPeriod&&this.setAutoRenewPeriod(t.autoRenewPeriod),null!=t.tokenMemo&&this.setTokenMemo(t.tokenMemo),null!=t.customFees&&this.setCustomFees(t.customFees),null!=t.tokenType&&this.setTokenType(t.tokenType),null!=t.supplyType&&this.setSupplyType(t.supplyType),null!=t.maxSupply&&this.setMaxSupply(t.maxSupply),null!=t.metadataKey&&this.setMetadataKey(t.metadataKey),null!=t.metadata&&this.setMetadata(t.metadata)}static _fromProtobuf(e,o,u,i,c){const d=c[0].tokenCreation;return t._fromProtobufTransactions(new _({tokenName:null!=d.name?d.name:void 0,tokenSymbol:null!=d.symbol?d.symbol:void 0,decimals:null!=d.decimals?d.decimals:void 0,initialSupply:null!=d.initialSupply?d.initialSupply:void 0,treasuryAccountId:null!=d.treasury?n._fromProtobuf(d.treasury):void 0,adminKey:null!=d.adminKey?m._fromProtobufKey(d.adminKey):void 0,kycKey:null!=d.kycKey?m._fromProtobufKey(d.kycKey):void 0,freezeKey:null!=d.freezeKey?m._fromProtobufKey(d.freezeKey):void 0,pauseKey:null!=d.pauseKey?m._fromProtobufKey(d.pauseKey):void 0,wipeKey:null!=d.wipeKey?m._fromProtobufKey(d.wipeKey):void 0,supplyKey:null!=d.supplyKey?m._fromProtobufKey(d.supplyKey):void 0,feeScheduleKey:null!=d.feeScheduleKey?m._fromProtobufKey(d.feeScheduleKey):void 0,freezeDefault:null!=d.freezeDefault?d.freezeDefault:void 0,autoRenewAccountId:null!=d.autoRenewAccount?n._fromProtobuf(d.autoRenewAccount):void 0,expirationTime:null!=d.expiry?s._fromProtobuf(d.expiry):void 0,autoRenewPeriod:null!=d.autoRenewPeriod?r._fromProtobuf(d.autoRenewPeriod):void 0,tokenMemo:null!=d.memo?d.memo:void 0,customFees:null!=d.customFees?d.customFees.map(e=>null!=e.fixedFee?l._fromProtobuf(e):null!=e.fractionalFee?a._fromProtobuf(e):y._fromProtobuf(e)):void 0,tokenType:null!=d.tokenType?h._fromCode(d.tokenType):void 0,supplyType:null!=d.supplyType?p._fromCode(d.supplyType):void 0,maxSupply:null!=d.maxSupply?d.maxSupply:void 0,metadataKey:null!=d.metadataKey?m._fromProtobufKey(d.metadataKey):void 0,metadata:null!=d.metadata?d.metadata:void 0}),e,o,u,i,c)}get tokenName(){return this._tokenName}setTokenName(e){return this._requireNotFrozen(),this._tokenName=e,this}get tokenSymbol(){return this._tokenSymbol}setTokenSymbol(e){return this._requireNotFrozen(),this._tokenSymbol=e,this}get decimals(){return this._decimals}setDecimals(e){return this._requireNotFrozen(),this._decimals=e instanceof i?e:i.fromValue(e),this}get initialSupply(){return this._initialSupply}setInitialSupply(e){return this._requireNotFrozen(),this._initialSupply=i.fromValue(e),this}get treasuryAccountId(){return this._treasuryAccountId}setTreasuryAccountId(e){return this._requireNotFrozen(),this._treasuryAccountId="string"==typeof e?n.fromString(e):e.clone(),this}get adminKey(){return this._adminKey}setAdminKey(e){return this._requireNotFrozen(),this._adminKey=e,this}get kycKey(){return this._kycKey}setKycKey(e){return this._requireNotFrozen(),this._kycKey=e,this}get freezeKey(){return this._freezeKey}freezeWith(e){return!this._autoRenewAccountId&&this.transactionId?.accountId&&null!=this.autoRenewPeriod?this.setAutoRenewAccountId(this.transactionId?.accountId):!this._autoRenewAccountId&&e?.operatorAccountId&&null!=this.autoRenewPeriod&&this.setAutoRenewAccountId(e.operatorAccountId),super.freezeWith(e)}setFreezeKey(e){return this._requireNotFrozen(),this._freezeKey=e,this}get pauseKey(){return this._pauseKey}setPauseKey(e){return this._requireNotFrozen(),this._pauseKey=e,this}get wipeKey(){return this._wipeKey}setWipeKey(e){return this._requireNotFrozen(),this._wipeKey=e,this}get supplyKey(){return this._supplyKey}setSupplyKey(e){return this._requireNotFrozen(),this._supplyKey=e,this}get feeScheduleKey(){return this._feeScheduleKey}setFeeScheduleKey(e){return this._requireNotFrozen(),this._feeScheduleKey=e,this}get freezeDefault(){return this._freezeDefault}setFreezeDefault(e){return this._requireNotFrozen(),this._freezeDefault=e,this}get expirationTime(){return this._expirationTime}setExpirationTime(e){return this._requireNotFrozen(),this._expirationTime=e instanceof s?e:s.fromDate(e),this._autoRenewPeriod=null,this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId=e instanceof n?e:n.fromString(e),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(e){return this._requireNotFrozen(),this._autoRenewPeriod=e instanceof r?e:new r(e),this}get tokenMemo(){return this._tokenMemo}setTokenMemo(e){return this._requireNotFrozen(),this._tokenMemo=e,this}get customFees(){return this._customFees}setCustomFees(e){return this._customFees=e,this}get tokenType(){return this._tokenType}setTokenType(e){return this._tokenType=e,this}get supplyType(){return this._supplyType}setSupplyType(e){return this._supplyType=e,this}get maxSupply(){return this._maxSupply}setMaxSupply(e){return this._maxSupply="number"==typeof e?i.fromNumber(e):e,this}get metadataKey(){return this._metadataKey}setMetadataKey(e){return this._requireNotFrozen(),this._metadataKey=e,this}get metadata(){return this._metadata}setMetadata(e){return this._requireNotFrozen(),this._metadata=e,this}_validateChecksums(e){null!=this._treasuryAccountId&&this._treasuryAccountId.validateChecksum(e),null!=this._autoRenewAccountId&&this._autoRenewAccountId.validateChecksum(e)}_execute(e,t){return e.token.createToken(t)}_getTransactionDataCase(){return"tokenCreation"}_makeTransactionData(){return{name:this._tokenName,symbol:this._tokenSymbol,decimals:null!=this._decimals?this._decimals.toInt():null,initialSupply:this._initialSupply,treasury:null!=this._treasuryAccountId?this._treasuryAccountId._toProtobuf():null,adminKey:null!=this._adminKey?this._adminKey._toProtobufKey():null,kycKey:null!=this._kycKey?this._kycKey._toProtobufKey():null,freezeKey:null!=this._freezeKey?this._freezeKey._toProtobufKey():null,pauseKey:null!=this._pauseKey?this._pauseKey._toProtobufKey():null,wipeKey:null!=this._wipeKey?this._wipeKey._toProtobufKey():null,supplyKey:null!=this._supplyKey?this._supplyKey._toProtobufKey():null,feeScheduleKey:null!=this._feeScheduleKey?this._feeScheduleKey._toProtobufKey():null,freezeDefault:this._freezeDefault,autoRenewAccount:null!=this._autoRenewAccountId?this._autoRenewAccountId._toProtobuf():null,expiry:null!=this._expirationTime?this._expirationTime._toProtobuf():null,autoRenewPeriod:null!=this._autoRenewPeriod?this._autoRenewPeriod._toProtobuf():null,memo:this._tokenMemo,customFees:this.customFees.map(e=>e._toProtobuf()),tokenType:null!=this._tokenType?this._tokenType._code:null,supplyType:null!=this._supplyType?this._supplyType._code:null,maxSupply:this.maxSupply,metadataKey:null!=this._metadataKey?this._metadataKey._toProtobufKey():null,metadata:null!=this._metadata?this._metadata:void 0}}_getLogId(){return`TokenCreateTransaction:${this._transactionIds.current.validStart.toString()}`}}o.set("tokenCreation",_._fromProtobuf);export{_ as default};
|
|
2
2
|
//# sourceMappingURL=TokenCreateTransaction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenCreateTransaction.js","sources":["../../src/token/TokenCreateTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Hbar from \"../Hbar.js\";\nimport Transaction, {\n DEFAULT_AUTO_RENEW_PERIOD,\n TRANSACTION_REGISTRY,\n} from \"../transaction/Transaction.js\";\nimport Long from \"long\";\nimport AccountId from \"../account/AccountId.js\";\nimport Timestamp from \"../Timestamp.js\";\nimport Duration from \"../Duration.js\";\nimport CustomFixedFee from \"./CustomFixedFee.js\";\nimport CustomFractionalFee from \"./CustomFractionalFee.js\";\nimport CustomRoyaltyFee from \"./CustomRoyaltyFee.js\";\nimport TokenType from \"./TokenType.js\";\nimport TokenSupplyType from \"./TokenSupplyType.js\";\nimport Key from \"../Key.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.ITokenCreateTransactionBody} HieroProto.proto.ITokenCreateTransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenID} HieroProto.proto.ITokenID\n */\n\n/**\n * @typedef {import(\"bignumber.js\").default} BigNumber\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(\"./CustomFee.js\").default} CustomFee\n */\n\n/**\n * Create a new Hedera™ crypto-currency token.\n */\nexport default class TokenCreateTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {string} [props.tokenName]\n * @param {string} [props.tokenSymbol]\n * @param {Long | number} [props.decimals]\n * @param {Long | number} [props.initialSupply]\n * @param {AccountId | string} [props.treasuryAccountId]\n * @param {Key} [props.adminKey]\n * @param {Key} [props.kycKey]\n * @param {Key} [props.freezeKey]\n * @param {Key} [props.pauseKey]\n * @param {Key} [props.wipeKey]\n * @param {Key} [props.supplyKey]\n * @param {Key} [props.feeScheduleKey]\n * @param {boolean} [props.freezeDefault]\n * @param {AccountId | string} [props.autoRenewAccountId]\n * @param {Timestamp | Date} [props.expirationTime]\n * @param {Duration | Long | number} [props.autoRenewPeriod]\n * @param {string} [props.tokenMemo]\n * @param {CustomFee[]} [props.customFees]\n * @param {TokenType} [props.tokenType]\n * @param {TokenSupplyType} [props.supplyType]\n * @param {Long | number} [props.maxSupply]\n * @param {Key} [props.metadataKey]\n * @param {Uint8Array} [props.metadata]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?string}\n */\n this._tokenName = null;\n\n /**\n * @private\n * @type {?string}\n */\n this._tokenSymbol = null;\n\n /**\n * @private\n * @type {?Long}\n */\n this._decimals = null;\n\n /**\n * @private\n * @type {?Long}\n */\n this._initialSupply = null;\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._treasuryAccountId = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._adminKey = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._kycKey = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._freezeKey = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._pauseKey = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._wipeKey = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._supplyKey = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._feeScheduleKey = null;\n\n /**\n * @private\n * @type {?boolean}\n */\n this._freezeDefault = null;\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._autoRenewAccountId = null;\n\n /**\n * @private\n * @type {?Timestamp}\n */\n this._expirationTime = new Timestamp(\n Math.floor(\n Date.now() / 1000 + DEFAULT_AUTO_RENEW_PERIOD.toNumber(),\n ),\n 0,\n );\n\n /**\n * @private\n * @type {?Duration}\n */\n this._autoRenewPeriod = new Duration(DEFAULT_AUTO_RENEW_PERIOD);\n\n /**\n * @private\n * @type {?string}\n */\n this._tokenMemo = null;\n\n /**\n * @private\n * @type {CustomFee[]}\n */\n this._customFees = [];\n\n /**\n * @private\n * @type {?TokenType}\n */\n this._tokenType = null;\n\n /**\n * @private\n * @type {?TokenSupplyType}\n */\n this._supplyType = null;\n\n /**\n * @private\n * @type {?Long}\n */\n this._maxSupply = null;\n\n this._defaultMaxTransactionFee = new Hbar(30);\n\n /**\n * @private\n * @type {?Key}\n */\n this._metadataKey = null;\n\n /**\n * @private\n * @description Metadata of the created token definition.\n * @type {?Uint8Array}\n */\n this._metadata = null;\n\n if (props.tokenName != null) {\n this.setTokenName(props.tokenName);\n }\n\n if (props.tokenSymbol != null) {\n this.setTokenSymbol(props.tokenSymbol);\n }\n\n if (props.decimals != null) {\n this.setDecimals(props.decimals);\n }\n\n if (props.initialSupply != null) {\n this.setInitialSupply(props.initialSupply);\n }\n\n if (props.treasuryAccountId != null) {\n this.setTreasuryAccountId(props.treasuryAccountId);\n }\n\n if (props.adminKey != null) {\n this.setAdminKey(props.adminKey);\n }\n\n if (props.kycKey != null) {\n this.setKycKey(props.kycKey);\n }\n\n if (props.freezeKey != null) {\n this.setFreezeKey(props.freezeKey);\n }\n\n if (props.pauseKey != null) {\n this.setPauseKey(props.pauseKey);\n }\n\n if (props.wipeKey != null) {\n this.setWipeKey(props.wipeKey);\n }\n\n if (props.supplyKey != null) {\n this.setSupplyKey(props.supplyKey);\n }\n\n if (props.feeScheduleKey != null) {\n this.setFeeScheduleKey(props.feeScheduleKey);\n }\n\n if (props.freezeDefault != null) {\n this.setFreezeDefault(props.freezeDefault);\n }\n\n if (props.autoRenewAccountId != null) {\n this.setAutoRenewAccountId(props.autoRenewAccountId);\n }\n\n if (props.expirationTime != null) {\n this.setExpirationTime(props.expirationTime);\n }\n\n if (props.autoRenewPeriod != null) {\n this.setAutoRenewPeriod(props.autoRenewPeriod);\n }\n\n if (props.tokenMemo != null) {\n this.setTokenMemo(props.tokenMemo);\n }\n\n if (props.customFees != null) {\n this.setCustomFees(props.customFees);\n }\n\n if (props.tokenType != null) {\n this.setTokenType(props.tokenType);\n }\n\n if (props.supplyType != null) {\n this.setSupplyType(props.supplyType);\n }\n\n if (props.maxSupply != null) {\n this.setMaxSupply(props.maxSupply);\n }\n\n if (props.metadataKey != null) {\n this.setMetadataKey(props.metadataKey);\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 {TokenCreateTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const create =\n /** @type {HieroProto.proto.ITokenCreateTransactionBody} */ (\n body.tokenCreation\n );\n\n return Transaction._fromProtobufTransactions(\n new TokenCreateTransaction({\n tokenName: create.name != null ? create.name : undefined,\n tokenSymbol: create.symbol != null ? create.symbol : undefined,\n decimals: create.decimals != null ? create.decimals : undefined,\n initialSupply:\n create.initialSupply != null\n ? create.initialSupply\n : undefined,\n treasuryAccountId:\n create.treasury != null\n ? AccountId._fromProtobuf(create.treasury)\n : undefined,\n adminKey:\n create.adminKey != null\n ? Key._fromProtobufKey(create.adminKey)\n : undefined,\n kycKey:\n create.kycKey != null\n ? Key._fromProtobufKey(create.kycKey)\n : undefined,\n freezeKey:\n create.freezeKey != null\n ? Key._fromProtobufKey(create.freezeKey)\n : undefined,\n pauseKey:\n create.pauseKey != null\n ? Key._fromProtobufKey(create.pauseKey)\n : undefined,\n wipeKey:\n create.wipeKey != null\n ? Key._fromProtobufKey(create.wipeKey)\n : undefined,\n supplyKey:\n create.supplyKey != null\n ? Key._fromProtobufKey(create.supplyKey)\n : undefined,\n feeScheduleKey:\n create.feeScheduleKey != null\n ? Key._fromProtobufKey(create.feeScheduleKey)\n : undefined,\n freezeDefault:\n create.freezeDefault != null\n ? create.freezeDefault\n : undefined,\n autoRenewAccountId:\n create.autoRenewAccount != null\n ? AccountId._fromProtobuf(create.autoRenewAccount)\n : undefined,\n expirationTime:\n create.expiry != null\n ? Timestamp._fromProtobuf(create.expiry)\n : undefined,\n autoRenewPeriod:\n create.autoRenewPeriod != null\n ? Duration._fromProtobuf(create.autoRenewPeriod)\n : undefined,\n tokenMemo: create.memo != null ? create.memo : undefined,\n customFees:\n create.customFees != null\n ? create.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 : undefined,\n tokenType:\n create.tokenType != null\n ? TokenType._fromCode(create.tokenType)\n : undefined,\n supplyType:\n create.supplyType != null\n ? TokenSupplyType._fromCode(create.supplyType)\n : undefined,\n maxSupply:\n create.maxSupply != null ? create.maxSupply : undefined,\n metadataKey:\n create.metadataKey != null\n ? Key._fromProtobufKey(create.metadataKey)\n : undefined,\n metadata: create.metadata != null ? create.metadata : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?string}\n */\n get tokenName() {\n return this._tokenName;\n }\n\n /**\n * @param {string} name\n * @returns {this}\n */\n setTokenName(name) {\n this._requireNotFrozen();\n this._tokenName = name;\n\n return this;\n }\n\n /**\n * @returns {?string}\n */\n get tokenSymbol() {\n return this._tokenSymbol;\n }\n\n /**\n * @param {string} symbol\n * @returns {this}\n */\n setTokenSymbol(symbol) {\n this._requireNotFrozen();\n this._tokenSymbol = symbol;\n\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get decimals() {\n return this._decimals;\n }\n\n /**\n * @param {Long | number} decimals\n * @returns {this}\n */\n setDecimals(decimals) {\n this._requireNotFrozen();\n this._decimals =\n decimals instanceof Long ? decimals : Long.fromValue(decimals);\n\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get initialSupply() {\n return this._initialSupply;\n }\n\n /**\n * @param {Long | number} initialSupply\n * @returns {this}\n */\n setInitialSupply(initialSupply) {\n this._requireNotFrozen();\n this._initialSupply = Long.fromValue(initialSupply);\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get treasuryAccountId() {\n return this._treasuryAccountId;\n }\n\n /**\n * @param {AccountId | string} id\n * @returns {this}\n */\n setTreasuryAccountId(id) {\n this._requireNotFrozen();\n this._treasuryAccountId =\n typeof id === \"string\" ? AccountId.fromString(id) : id.clone();\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get adminKey() {\n return this._adminKey;\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setAdminKey(key) {\n this._requireNotFrozen();\n this._adminKey = key;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get kycKey() {\n return this._kycKey;\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setKycKey(key) {\n this._requireNotFrozen();\n this._kycKey = key;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get freezeKey() {\n return this._freezeKey;\n }\n\n /**\n * @override\n * @param {?import(\"../client/Client.js\").default<Channel, *>} client\n * @returns {this}\n */\n freezeWith(client) {\n if (\n !this._autoRenewAccountId &&\n this.transactionId?.accountId &&\n this.autoRenewPeriod != null\n ) {\n this.setAutoRenewAccountId(this.transactionId?.accountId);\n } else if (\n !this._autoRenewAccountId &&\n client?.operatorAccountId &&\n this.autoRenewPeriod != null\n ) {\n this.setAutoRenewAccountId(client.operatorAccountId);\n }\n return super.freezeWith(client);\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setFreezeKey(key) {\n this._requireNotFrozen();\n this._freezeKey = key;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get pauseKey() {\n return this._pauseKey;\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setPauseKey(key) {\n this._requireNotFrozen();\n this._pauseKey = key;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get wipeKey() {\n return this._wipeKey;\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setWipeKey(key) {\n this._requireNotFrozen();\n this._wipeKey = key;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get supplyKey() {\n return this._supplyKey;\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setSupplyKey(key) {\n this._requireNotFrozen();\n this._supplyKey = key;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get feeScheduleKey() {\n return this._feeScheduleKey;\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setFeeScheduleKey(key) {\n this._requireNotFrozen();\n this._feeScheduleKey = key;\n\n return this;\n }\n\n /**\n * @returns {?boolean}\n */\n get freezeDefault() {\n return this._freezeDefault;\n }\n\n /**\n * @param {boolean} freeze\n * @returns {this}\n */\n setFreezeDefault(freeze) {\n this._requireNotFrozen();\n this._freezeDefault = freeze;\n\n return this;\n }\n\n /**\n * @returns {?Timestamp}\n */\n get expirationTime() {\n return this._expirationTime;\n }\n\n /**\n * If autoRenewPeriod is set - this value will be ignored and the expiration time will be calculated based on the autoRenewPeriod + time.now()\n * Setting this value will clear the autoRenewPeriod as the autoRenewPeriod period has default value of 7890000 seconds and leaving it set will override the expiration time\n * @param {Timestamp | Date} time\n * @returns {this}\n */\n setExpirationTime(time) {\n this._requireNotFrozen();\n this._expirationTime =\n time instanceof Timestamp ? time : Timestamp.fromDate(time);\n this._autoRenewPeriod = null;\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get autoRenewAccountId() {\n return this._autoRenewAccountId;\n }\n\n /**\n * @param {AccountId | string} id\n * @returns {this}\n */\n setAutoRenewAccountId(id) {\n this._requireNotFrozen();\n this._autoRenewAccountId =\n id instanceof AccountId ? id : AccountId.fromString(id);\n\n return this;\n }\n\n /**\n * @returns {?Duration}\n */\n get autoRenewPeriod() {\n return this._autoRenewPeriod;\n }\n\n /**\n * If expirationTime is set - autoRenewPeriod will be effectively ignored and it's effect will be replaced by expirationTime\n *\n * @param {Duration | Long | number} autoRenewPeriod\n * @returns {this}\n */\n setAutoRenewPeriod(autoRenewPeriod) {\n this._requireNotFrozen();\n this._autoRenewPeriod =\n autoRenewPeriod instanceof Duration\n ? autoRenewPeriod\n : new Duration(autoRenewPeriod);\n\n return this;\n }\n\n /**\n * @returns {?string}\n */\n get tokenMemo() {\n return this._tokenMemo;\n }\n\n /**\n * @param {string} memo\n * @returns {this}\n */\n setTokenMemo(memo) {\n this._requireNotFrozen();\n this._tokenMemo = memo;\n\n return this;\n }\n\n /**\n * @returns {CustomFee[]}\n */\n get customFees() {\n return this._customFees;\n }\n\n /**\n * @param {CustomFee[]} customFees\n * @returns {this}\n */\n setCustomFees(customFees) {\n this._customFees = customFees;\n return this;\n }\n\n /**\n * @returns {?TokenType}\n */\n get tokenType() {\n return this._tokenType;\n }\n\n /**\n * @param {TokenType} tokenType\n * @returns {this}\n */\n setTokenType(tokenType) {\n this._tokenType = tokenType;\n return this;\n }\n\n /**\n * @returns {?TokenSupplyType}\n */\n get supplyType() {\n return this._supplyType;\n }\n\n /**\n * @param {TokenSupplyType} supplyType\n * @returns {this}\n */\n setSupplyType(supplyType) {\n this._supplyType = supplyType;\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get maxSupply() {\n return this._maxSupply;\n }\n\n /**\n * @param {Long | number} maxSupply\n * @returns {this}\n */\n setMaxSupply(maxSupply) {\n this._maxSupply =\n typeof maxSupply === \"number\"\n ? Long.fromNumber(maxSupply)\n : maxSupply;\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get metadataKey() {\n return this._metadataKey;\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setMetadataKey(key) {\n this._requireNotFrozen();\n this._metadataKey = key;\n\n return this;\n }\n\n /**\n * @returns {?Uint8Array}\n */\n get metadata() {\n return this._metadata;\n }\n\n /**\n * @param {Uint8Array} metadata\n * @returns {this}\n */\n setMetadata(metadata) {\n this._requireNotFrozen();\n this._metadata = metadata;\n\n return this;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (this._treasuryAccountId != null) {\n this._treasuryAccountId.validateChecksum(client);\n }\n\n if (this._autoRenewAccountId != null) {\n this._autoRenewAccountId.validateChecksum(client);\n }\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.token.createToken(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"tokenCreation\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.ITokenCreateTransactionBody}\n */\n _makeTransactionData() {\n return {\n name: this._tokenName,\n symbol: this._tokenSymbol,\n decimals: this._decimals != null ? this._decimals.toInt() : null,\n initialSupply: this._initialSupply,\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\n ? this._freezeKey._toProtobufKey()\n : 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\n ? this._supplyKey._toProtobufKey()\n : null,\n feeScheduleKey:\n this._feeScheduleKey != null\n ? this._feeScheduleKey._toProtobufKey()\n : null,\n freezeDefault: this._freezeDefault,\n autoRenewAccount:\n this._autoRenewAccountId != null\n ? this._autoRenewAccountId._toProtobuf()\n : null,\n expiry:\n this._expirationTime != null\n ? this._expirationTime._toProtobuf()\n : null,\n autoRenewPeriod:\n this._autoRenewPeriod != null\n ? this._autoRenewPeriod._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:\n this._supplyType != null ? this._supplyType._code : null,\n maxSupply: this.maxSupply,\n metadataKey:\n this._metadataKey != null\n ? this._metadataKey._toProtobufKey()\n : null,\n metadata: this._metadata != null ? this._metadata : undefined,\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 `TokenCreateTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"tokenCreation\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n TokenCreateTransaction._fromProtobuf,\n);\n"],"names":["TokenCreateTransaction","Transaction","constructor","props","super","this","_tokenName","_tokenSymbol","_decimals","_initialSupply","_treasuryAccountId","_adminKey","_kycKey","_freezeKey","_pauseKey","_wipeKey","_supplyKey","_feeScheduleKey","_freezeDefault","_autoRenewAccountId","_expirationTime","Timestamp","Math","floor","Date","now","DEFAULT_AUTO_RENEW_PERIOD","toNumber","_autoRenewPeriod","Duration","_tokenMemo","_customFees","_tokenType","_supplyType","_maxSupply","_defaultMaxTransactionFee","Hbar","_metadataKey","_metadata","tokenName","setTokenName","tokenSymbol","setTokenSymbol","decimals","setDecimals","initialSupply","setInitialSupply","treasuryAccountId","setTreasuryAccountId","adminKey","setAdminKey","kycKey","setKycKey","freezeKey","setFreezeKey","pauseKey","setPauseKey","wipeKey","setWipeKey","supplyKey","setSupplyKey","feeScheduleKey","setFeeScheduleKey","freezeDefault","setFreezeDefault","autoRenewAccountId","setAutoRenewAccountId","expirationTime","setExpirationTime","autoRenewPeriod","setAutoRenewPeriod","tokenMemo","setTokenMemo","customFees","setCustomFees","tokenType","setTokenType","supplyType","setSupplyType","maxSupply","setMaxSupply","metadataKey","setMetadataKey","metadata","setMetadata","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","create","_fromProtobufTransactions","name","undefined","symbol","treasury","AccountId","Key","_fromProtobufKey","autoRenewAccount","expiry","memo","map","fee","fixedFee","CustomFixedFee","fractionalFee","CustomFractionalFee","CustomRoyaltyFee","TokenType","_fromCode","TokenSupplyType","_requireNotFrozen","Long","fromValue","id","fromString","clone","key","freezeWith","client","transactionId","accountId","operatorAccountId","freeze","time","fromDate","fromNumber","_validateChecksums","validateChecksum","_execute","channel","request","token","createToken","_getTransactionDataCase","_makeTransactionData","toInt","_toProtobuf","_toProtobufKey","_code","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"ocAwCe,MAAMA,UAA+BC,EA2BhD,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,WAAa,KAMlBD,KAAKE,aAAe,KAMpBF,KAAKG,UAAY,KAMjBH,KAAKI,eAAiB,KAMtBJ,KAAKK,mBAAqB,KAM1BL,KAAKM,UAAY,KAMjBN,KAAKO,QAAU,KAMfP,KAAKQ,WAAa,KAMlBR,KAAKS,UAAY,KAMjBT,KAAKU,SAAW,KAMhBV,KAAKW,WAAa,KAMlBX,KAAKY,gBAAkB,KAMvBZ,KAAKa,eAAiB,KAMtBb,KAAKc,oBAAsB,KAM3Bd,KAAKe,gBAAkB,IAAIC,EACvBC,KAAKC,MACDC,KAAKC,MAAQ,IAAOC,EAA0BC,YAElD,GAOJtB,KAAKuB,iBAAmB,IAAIC,EAASH,GAMrCrB,KAAKyB,WAAa,KAMlBzB,KAAK0B,YAAc,GAMnB1B,KAAK2B,WAAa,KAMlB3B,KAAK4B,YAAc,KAMnB5B,KAAK6B,WAAa,KAElB7B,KAAK8B,0BAA4B,IAAIC,EAAK,IAM1C/B,KAAKgC,aAAe,KAOpBhC,KAAKiC,UAAY,KAEM,MAAnBnC,EAAMoC,WACNlC,KAAKmC,aAAarC,EAAMoC,WAGH,MAArBpC,EAAMsC,aACNpC,KAAKqC,eAAevC,EAAMsC,aAGR,MAAlBtC,EAAMwC,UACNtC,KAAKuC,YAAYzC,EAAMwC,UAGA,MAAvBxC,EAAM0C,eACNxC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iBAAiB+G,cACtB,KACVrC,KAAMjG,KAAKyB,WACX2C,WAAYpE,KAAKoE,WAAW8B,KAAKC,GAAQA,EAAImC,gBAC7ChE,UAA8B,MAAnBtE,KAAK2B,WAAqB3B,KAAK2B,WAAW6G,MAAQ,KAC7DhE,WACwB,MAApBxE,KAAK4B,YAAsB5B,KAAK4B,YAAY4G,MAAQ,KACxD9D,UAAW1E,KAAK0E,UAChBE,YACyB,MAArB5E,KAAKgC,aACChC,KAAKgC,aAAauG,iBAClB,KACVzD,SAA4B,MAAlB9E,KAAKiC,UAAoBjC,KAAKiC,eAAYwD,EAEhE,CAKI,SAAAgD,GAII,MAAO,0BAFHzI,KAAK0I,gBAAgBC,QACxB,WAC0CC,YACnD,EAGAC,EAAqBC,IACjB,gBAEAnJ,EAAuBqF"}
|
|
1
|
+
{"version":3,"file":"TokenCreateTransaction.js","sources":["../../src/token/TokenCreateTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Hbar from \"../Hbar.js\";\nimport Transaction, {\n DEFAULT_AUTO_RENEW_PERIOD,\n TRANSACTION_REGISTRY,\n} from \"../transaction/Transaction.js\";\nimport Long from \"long\";\nimport AccountId from \"../account/AccountId.js\";\nimport Timestamp from \"../Timestamp.js\";\nimport Duration from \"../Duration.js\";\nimport CustomFixedFee from \"./CustomFixedFee.js\";\nimport CustomFractionalFee from \"./CustomFractionalFee.js\";\nimport CustomRoyaltyFee from \"./CustomRoyaltyFee.js\";\nimport TokenType from \"./TokenType.js\";\nimport TokenSupplyType from \"./TokenSupplyType.js\";\nimport Key from \"../Key.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.ITokenCreateTransactionBody} HieroProto.proto.ITokenCreateTransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenID} HieroProto.proto.ITokenID\n */\n\n/**\n * @typedef {import(\"bignumber.js\").default} BigNumber\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(\"./CustomFee.js\").default} CustomFee\n */\n\n/**\n * Create a new Hedera™ crypto-currency token.\n */\nexport default class TokenCreateTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {string} [props.tokenName]\n * @param {string} [props.tokenSymbol]\n * @param {Long | number} [props.decimals]\n * @param {Long | number} [props.initialSupply]\n * @param {AccountId | string} [props.treasuryAccountId]\n * @param {Key} [props.adminKey]\n * @param {Key} [props.kycKey]\n * @param {Key} [props.freezeKey]\n * @param {Key} [props.pauseKey]\n * @param {Key} [props.wipeKey]\n * @param {Key} [props.supplyKey]\n * @param {Key} [props.feeScheduleKey]\n * @param {boolean} [props.freezeDefault]\n * @param {AccountId | string} [props.autoRenewAccountId]\n * @param {Timestamp | Date} [props.expirationTime]\n * @param {Duration | Long | number} [props.autoRenewPeriod]\n * @param {string} [props.tokenMemo]\n * @param {CustomFee[]} [props.customFees]\n * @param {TokenType} [props.tokenType]\n * @param {TokenSupplyType} [props.supplyType]\n * @param {Long | number} [props.maxSupply]\n * @param {Key} [props.metadataKey]\n * @param {Uint8Array} [props.metadata]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?string}\n */\n this._tokenName = null;\n\n /**\n * @private\n * @type {?string}\n */\n this._tokenSymbol = null;\n\n /**\n * @private\n * @type {?Long}\n */\n this._decimals = null;\n\n /**\n * @private\n * @type {?Long}\n */\n this._initialSupply = null;\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._treasuryAccountId = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._adminKey = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._kycKey = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._freezeKey = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._pauseKey = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._wipeKey = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._supplyKey = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._feeScheduleKey = null;\n\n /**\n * @private\n * @type {?boolean}\n */\n this._freezeDefault = null;\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._autoRenewAccountId = null;\n\n /**\n * @private\n * @type {?Timestamp}\n */\n this._expirationTime = new Timestamp(\n Math.floor(\n Date.now() / 1000 + DEFAULT_AUTO_RENEW_PERIOD.toNumber(),\n ),\n 0,\n );\n\n /**\n * @private\n * @type {?Duration}\n */\n this._autoRenewPeriod = new Duration(DEFAULT_AUTO_RENEW_PERIOD);\n\n /**\n * @private\n * @type {?string}\n */\n this._tokenMemo = null;\n\n /**\n * @private\n * @type {CustomFee[]}\n */\n this._customFees = [];\n\n /**\n * @private\n * @type {?TokenType}\n */\n this._tokenType = null;\n\n /**\n * @private\n * @type {?TokenSupplyType}\n */\n this._supplyType = null;\n\n /**\n * @private\n * @type {?Long}\n */\n this._maxSupply = null;\n\n this._defaultMaxTransactionFee = new Hbar(30);\n\n /**\n * @private\n * @type {?Key}\n */\n this._metadataKey = null;\n\n /**\n * @private\n * @description Metadata of the created token definition.\n * @type {?Uint8Array}\n */\n this._metadata = null;\n\n if (props.tokenName != null) {\n this.setTokenName(props.tokenName);\n }\n\n if (props.tokenSymbol != null) {\n this.setTokenSymbol(props.tokenSymbol);\n }\n\n if (props.decimals != null) {\n this.setDecimals(props.decimals);\n }\n\n if (props.initialSupply != null) {\n this.setInitialSupply(props.initialSupply);\n }\n\n if (props.treasuryAccountId != null) {\n this.setTreasuryAccountId(props.treasuryAccountId);\n }\n\n if (props.adminKey != null) {\n this.setAdminKey(props.adminKey);\n }\n\n if (props.kycKey != null) {\n this.setKycKey(props.kycKey);\n }\n\n if (props.freezeKey != null) {\n this.setFreezeKey(props.freezeKey);\n }\n\n if (props.pauseKey != null) {\n this.setPauseKey(props.pauseKey);\n }\n\n if (props.wipeKey != null) {\n this.setWipeKey(props.wipeKey);\n }\n\n if (props.supplyKey != null) {\n this.setSupplyKey(props.supplyKey);\n }\n\n if (props.feeScheduleKey != null) {\n this.setFeeScheduleKey(props.feeScheduleKey);\n }\n\n if (props.freezeDefault != null) {\n this.setFreezeDefault(props.freezeDefault);\n }\n\n if (props.autoRenewAccountId != null) {\n this.setAutoRenewAccountId(props.autoRenewAccountId);\n }\n\n if (props.expirationTime != null) {\n this.setExpirationTime(props.expirationTime);\n }\n\n if (props.autoRenewPeriod != null) {\n this.setAutoRenewPeriod(props.autoRenewPeriod);\n }\n\n if (props.tokenMemo != null) {\n this.setTokenMemo(props.tokenMemo);\n }\n\n if (props.customFees != null) {\n this.setCustomFees(props.customFees);\n }\n\n if (props.tokenType != null) {\n this.setTokenType(props.tokenType);\n }\n\n if (props.supplyType != null) {\n this.setSupplyType(props.supplyType);\n }\n\n if (props.maxSupply != null) {\n this.setMaxSupply(props.maxSupply);\n }\n\n if (props.metadataKey != null) {\n this.setMetadataKey(props.metadataKey);\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 {TokenCreateTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const create =\n /** @type {HieroProto.proto.ITokenCreateTransactionBody} */ (\n body.tokenCreation\n );\n\n return Transaction._fromProtobufTransactions(\n new TokenCreateTransaction({\n tokenName: create.name != null ? create.name : undefined,\n tokenSymbol: create.symbol != null ? create.symbol : undefined,\n decimals: create.decimals != null ? create.decimals : undefined,\n initialSupply:\n create.initialSupply != null\n ? create.initialSupply\n : undefined,\n treasuryAccountId:\n create.treasury != null\n ? AccountId._fromProtobuf(create.treasury)\n : undefined,\n adminKey:\n create.adminKey != null\n ? Key._fromProtobufKey(create.adminKey)\n : undefined,\n kycKey:\n create.kycKey != null\n ? Key._fromProtobufKey(create.kycKey)\n : undefined,\n freezeKey:\n create.freezeKey != null\n ? Key._fromProtobufKey(create.freezeKey)\n : undefined,\n pauseKey:\n create.pauseKey != null\n ? Key._fromProtobufKey(create.pauseKey)\n : undefined,\n wipeKey:\n create.wipeKey != null\n ? Key._fromProtobufKey(create.wipeKey)\n : undefined,\n supplyKey:\n create.supplyKey != null\n ? Key._fromProtobufKey(create.supplyKey)\n : undefined,\n feeScheduleKey:\n create.feeScheduleKey != null\n ? Key._fromProtobufKey(create.feeScheduleKey)\n : undefined,\n freezeDefault:\n create.freezeDefault != null\n ? create.freezeDefault\n : undefined,\n autoRenewAccountId:\n create.autoRenewAccount != null\n ? AccountId._fromProtobuf(create.autoRenewAccount)\n : undefined,\n expirationTime:\n create.expiry != null\n ? Timestamp._fromProtobuf(create.expiry)\n : undefined,\n autoRenewPeriod:\n create.autoRenewPeriod != null\n ? Duration._fromProtobuf(create.autoRenewPeriod)\n : undefined,\n tokenMemo: create.memo != null ? create.memo : undefined,\n customFees:\n create.customFees != null\n ? create.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 : undefined,\n tokenType:\n create.tokenType != null\n ? TokenType._fromCode(create.tokenType)\n : undefined,\n supplyType:\n create.supplyType != null\n ? TokenSupplyType._fromCode(create.supplyType)\n : undefined,\n maxSupply:\n create.maxSupply != null ? create.maxSupply : undefined,\n metadataKey:\n create.metadataKey != null\n ? Key._fromProtobufKey(create.metadataKey)\n : undefined,\n metadata: create.metadata != null ? create.metadata : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?string}\n */\n get tokenName() {\n return this._tokenName;\n }\n\n /**\n * @param {string} name\n * @returns {this}\n */\n setTokenName(name) {\n this._requireNotFrozen();\n this._tokenName = name;\n\n return this;\n }\n\n /**\n * @returns {?string}\n */\n get tokenSymbol() {\n return this._tokenSymbol;\n }\n\n /**\n * @param {string} symbol\n * @returns {this}\n */\n setTokenSymbol(symbol) {\n this._requireNotFrozen();\n this._tokenSymbol = symbol;\n\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get decimals() {\n return this._decimals;\n }\n\n /**\n * @param {Long | number} decimals\n * @returns {this}\n */\n setDecimals(decimals) {\n this._requireNotFrozen();\n this._decimals =\n decimals instanceof Long ? decimals : Long.fromValue(decimals);\n\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get initialSupply() {\n return this._initialSupply;\n }\n\n /**\n * @param {Long | number} initialSupply\n * @returns {this}\n */\n setInitialSupply(initialSupply) {\n this._requireNotFrozen();\n this._initialSupply = Long.fromValue(initialSupply);\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get treasuryAccountId() {\n return this._treasuryAccountId;\n }\n\n /**\n * @param {AccountId | string} id\n * @returns {this}\n */\n setTreasuryAccountId(id) {\n this._requireNotFrozen();\n this._treasuryAccountId =\n typeof id === \"string\" ? AccountId.fromString(id) : id.clone();\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get adminKey() {\n return this._adminKey;\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setAdminKey(key) {\n this._requireNotFrozen();\n this._adminKey = key;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get kycKey() {\n return this._kycKey;\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setKycKey(key) {\n this._requireNotFrozen();\n this._kycKey = key;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get freezeKey() {\n return this._freezeKey;\n }\n\n /**\n * @override\n * @param {?import(\"../client/Client.js\").default<Channel, *>} client\n * @returns {this}\n */\n freezeWith(client) {\n if (\n !this._autoRenewAccountId &&\n this.transactionId?.accountId &&\n this.autoRenewPeriod != null\n ) {\n this.setAutoRenewAccountId(this.transactionId?.accountId);\n } else if (\n !this._autoRenewAccountId &&\n client?.operatorAccountId &&\n this.autoRenewPeriod != null\n ) {\n this.setAutoRenewAccountId(client.operatorAccountId);\n }\n return super.freezeWith(client);\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setFreezeKey(key) {\n this._requireNotFrozen();\n this._freezeKey = key;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get pauseKey() {\n return this._pauseKey;\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setPauseKey(key) {\n this._requireNotFrozen();\n this._pauseKey = key;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get wipeKey() {\n return this._wipeKey;\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setWipeKey(key) {\n this._requireNotFrozen();\n this._wipeKey = key;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get supplyKey() {\n return this._supplyKey;\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setSupplyKey(key) {\n this._requireNotFrozen();\n this._supplyKey = key;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get feeScheduleKey() {\n return this._feeScheduleKey;\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setFeeScheduleKey(key) {\n this._requireNotFrozen();\n this._feeScheduleKey = key;\n\n return this;\n }\n\n /**\n * @returns {?boolean}\n */\n get freezeDefault() {\n return this._freezeDefault;\n }\n\n /**\n * @param {boolean} freeze\n * @returns {this}\n */\n setFreezeDefault(freeze) {\n this._requireNotFrozen();\n this._freezeDefault = freeze;\n\n return this;\n }\n\n /**\n * @returns {?Timestamp}\n */\n get expirationTime() {\n return this._expirationTime;\n }\n\n /**\n * If autoRenewPeriod is set - this value will be ignored and the expiration time will be calculated based on the autoRenewPeriod + time.now()\n * Setting this value will clear the autoRenewPeriod as the autoRenewPeriod period has default value of 7890000 seconds and leaving it set will override the expiration time\n * @param {Timestamp | Date} time\n * @returns {this}\n */\n setExpirationTime(time) {\n this._requireNotFrozen();\n this._expirationTime =\n time instanceof Timestamp ? time : Timestamp.fromDate(time);\n this._autoRenewPeriod = null;\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get autoRenewAccountId() {\n return this._autoRenewAccountId;\n }\n\n /**\n * @param {AccountId | string} id\n * @returns {this}\n */\n setAutoRenewAccountId(id) {\n this._requireNotFrozen();\n this._autoRenewAccountId =\n id instanceof AccountId ? id : AccountId.fromString(id);\n\n return this;\n }\n\n /**\n * @returns {?Duration}\n */\n get autoRenewPeriod() {\n return this._autoRenewPeriod;\n }\n\n /**\n * If expirationTime is set - autoRenewPeriod will be effectively ignored and it's effect will be replaced by expirationTime\n *\n * @param {Duration | Long | number} autoRenewPeriod\n * @returns {this}\n */\n setAutoRenewPeriod(autoRenewPeriod) {\n this._requireNotFrozen();\n this._autoRenewPeriod =\n autoRenewPeriod instanceof Duration\n ? autoRenewPeriod\n : new Duration(autoRenewPeriod);\n\n return this;\n }\n\n /**\n * @returns {?string}\n */\n get tokenMemo() {\n return this._tokenMemo;\n }\n\n /**\n * @param {string} memo\n * @returns {this}\n */\n setTokenMemo(memo) {\n this._requireNotFrozen();\n this._tokenMemo = memo;\n\n return this;\n }\n\n /**\n * @returns {CustomFee[]}\n */\n get customFees() {\n return this._customFees;\n }\n\n /**\n * @param {CustomFee[]} customFees\n * @returns {this}\n */\n setCustomFees(customFees) {\n this._customFees = customFees;\n return this;\n }\n\n /**\n * @returns {?TokenType}\n */\n get tokenType() {\n return this._tokenType;\n }\n\n /**\n * @param {TokenType} tokenType\n * @returns {this}\n */\n setTokenType(tokenType) {\n this._tokenType = tokenType;\n return this;\n }\n\n /**\n * @returns {?TokenSupplyType}\n */\n get supplyType() {\n return this._supplyType;\n }\n\n /**\n * @param {TokenSupplyType} supplyType\n * @returns {this}\n */\n setSupplyType(supplyType) {\n this._supplyType = supplyType;\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get maxSupply() {\n return this._maxSupply;\n }\n\n /**\n * @param {Long | number} maxSupply\n * @returns {this}\n */\n setMaxSupply(maxSupply) {\n this._maxSupply =\n typeof maxSupply === \"number\"\n ? Long.fromNumber(maxSupply)\n : maxSupply;\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get metadataKey() {\n return this._metadataKey;\n }\n\n /**\n * @param {Key} key\n * @returns {this}\n */\n setMetadataKey(key) {\n this._requireNotFrozen();\n this._metadataKey = key;\n\n return this;\n }\n\n /**\n * @returns {?Uint8Array}\n */\n get metadata() {\n return this._metadata;\n }\n\n /**\n * @param {Uint8Array} metadata\n * @returns {this}\n */\n setMetadata(metadata) {\n this._requireNotFrozen();\n this._metadata = metadata;\n\n return this;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (this._treasuryAccountId != null) {\n this._treasuryAccountId.validateChecksum(client);\n }\n\n if (this._autoRenewAccountId != null) {\n this._autoRenewAccountId.validateChecksum(client);\n }\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.token.createToken(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"tokenCreation\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.ITokenCreateTransactionBody}\n */\n _makeTransactionData() {\n return {\n name: this._tokenName,\n symbol: this._tokenSymbol,\n decimals: this._decimals != null ? this._decimals.toInt() : null,\n initialSupply: this._initialSupply,\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\n ? this._freezeKey._toProtobufKey()\n : 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\n ? this._supplyKey._toProtobufKey()\n : null,\n feeScheduleKey:\n this._feeScheduleKey != null\n ? this._feeScheduleKey._toProtobufKey()\n : null,\n freezeDefault: this._freezeDefault,\n autoRenewAccount:\n this._autoRenewAccountId != null\n ? this._autoRenewAccountId._toProtobuf()\n : null,\n expiry:\n this._expirationTime != null\n ? this._expirationTime._toProtobuf()\n : null,\n autoRenewPeriod:\n this._autoRenewPeriod != null\n ? this._autoRenewPeriod._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:\n this._supplyType != null ? this._supplyType._code : null,\n maxSupply: this.maxSupply,\n metadataKey:\n this._metadataKey != null\n ? this._metadataKey._toProtobufKey()\n : null,\n metadata: this._metadata != null ? this._metadata : undefined,\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 `TokenCreateTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"tokenCreation\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n TokenCreateTransaction._fromProtobuf,\n);\n"],"names":["TokenCreateTransaction","Transaction","constructor","props","super","this","_tokenName","_tokenSymbol","_decimals","_initialSupply","_treasuryAccountId","_adminKey","_kycKey","_freezeKey","_pauseKey","_wipeKey","_supplyKey","_feeScheduleKey","_freezeDefault","_autoRenewAccountId","_expirationTime","Timestamp","Math","floor","Date","now","DEFAULT_AUTO_RENEW_PERIOD","toNumber","_autoRenewPeriod","Duration","_tokenMemo","_customFees","_tokenType","_supplyType","_maxSupply","_defaultMaxTransactionFee","Hbar","_metadataKey","_metadata","tokenName","setTokenName","tokenSymbol","setTokenSymbol","decimals","setDecimals","initialSupply","setInitialSupply","treasuryAccountId","setTreasuryAccountId","adminKey","setAdminKey","kycKey","setKycKey","freezeKey","setFreezeKey","pauseKey","setPauseKey","wipeKey","setWipeKey","supplyKey","setSupplyKey","feeScheduleKey","setFeeScheduleKey","freezeDefault","setFreezeDefault","autoRenewAccountId","setAutoRenewAccountId","expirationTime","setExpirationTime","autoRenewPeriod","setAutoRenewPeriod","tokenMemo","setTokenMemo","customFees","setCustomFees","tokenType","setTokenType","supplyType","setSupplyType","maxSupply","setMaxSupply","metadataKey","setMetadataKey","metadata","setMetadata","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","create","_fromProtobufTransactions","name","undefined","symbol","treasury","AccountId","Key","_fromProtobufKey","autoRenewAccount","expiry","memo","map","fee","fixedFee","CustomFixedFee","fractionalFee","CustomFractionalFee","CustomRoyaltyFee","TokenType","_fromCode","TokenSupplyType","_requireNotFrozen","Long","fromValue","id","fromString","clone","key","freezeWith","client","transactionId","accountId","operatorAccountId","freeze","time","fromDate","fromNumber","_validateChecksums","validateChecksum","_execute","channel","request","token","createToken","_getTransactionDataCase","_makeTransactionData","toInt","_toProtobuf","_toProtobufKey","_code","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"ocAwCe,MAAMA,UAA+BC,EA2BhD,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,WAAa,KAMlBD,KAAKE,aAAe,KAMpBF,KAAKG,UAAY,KAMjBH,KAAKI,eAAiB,KAMtBJ,KAAKK,mBAAqB,KAM1BL,KAAKM,U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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
|
|
|
@@ -8,8 +8,7 @@ var _Hbar = _interopRequireDefault(require("../Hbar.cjs"));
|
|
|
8
8
|
var _TokenId = _interopRequireDefault(require("./TokenId.cjs"));
|
|
9
9
|
var _AccountId = _interopRequireDefault(require("../account/AccountId.cjs"));
|
|
10
10
|
var _Transaction = _interopRequireWildcard(require("../transaction/Transaction.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"../Hbar.js";import o from"./TokenId.js";import n from"../account/AccountId.js";import s,{TRANSACTION_REGISTRY as e}from"../transaction/Transaction.js";class r extends s{constructor(o={}){super(),this._tokenIds=null,this._accountId=null,this._defaultMaxTransactionFee=new t(5),null!=o.tokenIds&&this.setTokenIds(o.tokenIds),null!=o.accountId&&this.setAccountId(o.accountId)}static _fromProtobuf(t,e,c,a,i){const u=i[0].tokenDissociate;return s._fromProtobufTransactions(new r({tokenIds:null!=u.tokens?u.tokens.map(
|
|
1
|
+
import t from"../Hbar.js";import o from"./TokenId.js";import n from"../account/AccountId.js";import s,{TRANSACTION_REGISTRY as e}from"../transaction/Transaction.js";class r extends s{constructor(o={}){super(),this._tokenIds=null,this._accountId=null,this._defaultMaxTransactionFee=new t(5),null!=o.tokenIds&&this.setTokenIds(o.tokenIds),null!=o.accountId&&this.setAccountId(o.accountId)}static _fromProtobuf(t,e,c,a,i){const u=i[0].tokenDissociate;return s._fromProtobufTransactions(new r({tokenIds:null!=u.tokens?u.tokens.map(t=>o._fromProtobuf(t)):void 0,accountId:null!=u.account?n._fromProtobuf(u.account):void 0}),t,e,c,a,i)}get tokenIds(){return this._tokenIds}setTokenIds(t){return this._requireNotFrozen(),this._tokenIds=t.map(t=>"string"==typeof t?o.fromString(t):t.clone()),this}get accountId(){return this._accountId}setAccountId(t){return this._requireNotFrozen(),this._accountId="string"==typeof t?n.fromString(t):t.clone(),this}_validateChecksums(t){null!=this._accountId&&this._accountId.validateChecksum(t);for(const o of null!=this._tokenIds?this._tokenIds:[])null!=o&&o.validateChecksum(t)}_execute(t,o){return t.token.dissociateTokens(o)}_getTransactionDataCase(){return"tokenDissociate"}_makeTransactionData(){return{tokens:null!=this._tokenIds?this._tokenIds.map(t=>t._toProtobuf()):null,account:null!=this._accountId?this._accountId._toProtobuf():null}}_getLogId(){return`TokenDissociateTransaction:${this._transactionIds.current.validStart.toString()}`}}e.set("tokenDissociate",r._fromProtobuf);export{r as default};
|
|
2
2
|
//# sourceMappingURL=TokenDissociateTransaction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenDissociateTransaction.js","sources":["../../src/token/TokenDissociateTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Hbar from \"../Hbar.js\";\nimport TokenId from \"./TokenId.js\";\nimport AccountId from \"../account/AccountId.js\";\nimport Transaction, {\n TRANSACTION_REGISTRY,\n} from \"../transaction/Transaction.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.ITokenDissociateTransactionBody} HieroProto.proto.ITokenDissociateTransactionBody\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(\"../transaction/TransactionId.js\").default} TransactionId\n */\n\n/**\n * Dissociate a new Hedera™ crypto-currency token.\n */\nexport default class TokenDissociateTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {(TokenId | string)[]} [props.tokenIds]\n * @param {AccountId | string} [props.accountId]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?TokenId[]}\n */\n this._tokenIds = null;\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._accountId = null;\n\n this._defaultMaxTransactionFee = new Hbar(5);\n\n if (props.tokenIds != null) {\n this.setTokenIds(props.tokenIds);\n }\n\n if (props.accountId != null) {\n this.setAccountId(props.accountId);\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 {TokenDissociateTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const dissociateToken =\n /** @type {HieroProto.proto.ITokenDissociateTransactionBody} */ (\n body.tokenDissociate\n );\n\n return Transaction._fromProtobufTransactions(\n new TokenDissociateTransaction({\n tokenIds:\n dissociateToken.tokens != null\n ? dissociateToken.tokens.map((token) =>\n TokenId._fromProtobuf(token),\n )\n : undefined,\n accountId:\n dissociateToken.account != null\n ? AccountId._fromProtobuf(dissociateToken.account)\n : undefined,\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 | string)[]} tokenIds\n * @returns {this}\n */\n setTokenIds(tokenIds) {\n this._requireNotFrozen();\n this._tokenIds = tokenIds.map((tokenId) =>\n typeof tokenId === \"string\"\n ? TokenId.fromString(tokenId)\n : tokenId.clone(),\n );\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get accountId() {\n return this._accountId;\n }\n\n /**\n * @param {AccountId | string} accountId\n * @returns {this}\n */\n setAccountId(accountId) {\n this._requireNotFrozen();\n this._accountId =\n typeof accountId === \"string\"\n ? AccountId.fromString(accountId)\n : accountId.clone();\n\n return this;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (this._accountId != null) {\n this._accountId.validateChecksum(client);\n }\n\n for (const tokenId of this._tokenIds != null ? this._tokenIds : []) {\n if (tokenId != null) {\n tokenId.validateChecksum(client);\n }\n }\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.token.dissociateTokens(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"tokenDissociate\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.ITokenDissociateTransactionBody}\n */\n _makeTransactionData() {\n return {\n tokens:\n this._tokenIds != null\n ? this._tokenIds.map((tokenId) => tokenId._toProtobuf())\n : null,\n account:\n this._accountId != null ? this._accountId._toProtobuf() : null,\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 `TokenDissociateTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"tokenDissociate\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n TokenDissociateTransaction._fromProtobuf,\n);\n"],"names":["TokenDissociateTransaction","Transaction","constructor","props","super","this","_tokenIds","_accountId","_defaultMaxTransactionFee","Hbar","tokenIds","setTokenIds","accountId","setAccountId","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","dissociateToken","_fromProtobufTransactions","tokens","map","token","TokenId","undefined","account","AccountId","_requireNotFrozen","tokenId","fromString","clone","_validateChecksums","client","validateChecksum","_execute","channel","request","dissociateTokens","_getTransactionDataCase","_makeTransactionData","_toProtobuf","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"qKA6Be,MAAMA,UAAmCC,EAMpD,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,UAAY,KAMjBD,KAAKE,WAAa,KAElBF,KAAKG,0BAA4B,IAAIC,EAAK,GAEpB,MAAlBN,EAAMO,UACNL,KAAKM,YAAYR,EAAMO,UAGJ,MAAnBP,EAAMS,WACNP,KAAKQ,aAAaV,EAAMS,UAEpC,CAWI,oBAAOE,CACHC,EACAC,EACAC,EACAC,EACAC,GAEA,MACMC,EADOD,EAAO,GAIf,gBAEL,OAAOlB,EAAYoB,0BACf,IAAIrB,EAA2B,CAC3BU,SAC8B,MAA1BU,EAAgBE,OACVF,EAAgBE,OAAOC,
|
|
1
|
+
{"version":3,"file":"TokenDissociateTransaction.js","sources":["../../src/token/TokenDissociateTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Hbar from \"../Hbar.js\";\nimport TokenId from \"./TokenId.js\";\nimport AccountId from \"../account/AccountId.js\";\nimport Transaction, {\n TRANSACTION_REGISTRY,\n} from \"../transaction/Transaction.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.ITokenDissociateTransactionBody} HieroProto.proto.ITokenDissociateTransactionBody\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(\"../transaction/TransactionId.js\").default} TransactionId\n */\n\n/**\n * Dissociate a new Hedera™ crypto-currency token.\n */\nexport default class TokenDissociateTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {(TokenId | string)[]} [props.tokenIds]\n * @param {AccountId | string} [props.accountId]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?TokenId[]}\n */\n this._tokenIds = null;\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._accountId = null;\n\n this._defaultMaxTransactionFee = new Hbar(5);\n\n if (props.tokenIds != null) {\n this.setTokenIds(props.tokenIds);\n }\n\n if (props.accountId != null) {\n this.setAccountId(props.accountId);\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 {TokenDissociateTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const dissociateToken =\n /** @type {HieroProto.proto.ITokenDissociateTransactionBody} */ (\n body.tokenDissociate\n );\n\n return Transaction._fromProtobufTransactions(\n new TokenDissociateTransaction({\n tokenIds:\n dissociateToken.tokens != null\n ? dissociateToken.tokens.map((token) =>\n TokenId._fromProtobuf(token),\n )\n : undefined,\n accountId:\n dissociateToken.account != null\n ? AccountId._fromProtobuf(dissociateToken.account)\n : undefined,\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 | string)[]} tokenIds\n * @returns {this}\n */\n setTokenIds(tokenIds) {\n this._requireNotFrozen();\n this._tokenIds = tokenIds.map((tokenId) =>\n typeof tokenId === \"string\"\n ? TokenId.fromString(tokenId)\n : tokenId.clone(),\n );\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get accountId() {\n return this._accountId;\n }\n\n /**\n * @param {AccountId | string} accountId\n * @returns {this}\n */\n setAccountId(accountId) {\n this._requireNotFrozen();\n this._accountId =\n typeof accountId === \"string\"\n ? AccountId.fromString(accountId)\n : accountId.clone();\n\n return this;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (this._accountId != null) {\n this._accountId.validateChecksum(client);\n }\n\n for (const tokenId of this._tokenIds != null ? this._tokenIds : []) {\n if (tokenId != null) {\n tokenId.validateChecksum(client);\n }\n }\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.token.dissociateTokens(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"tokenDissociate\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.ITokenDissociateTransactionBody}\n */\n _makeTransactionData() {\n return {\n tokens:\n this._tokenIds != null\n ? this._tokenIds.map((tokenId) => tokenId._toProtobuf())\n : null,\n account:\n this._accountId != null ? this._accountId._toProtobuf() : null,\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 `TokenDissociateTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"tokenDissociate\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n TokenDissociateTransaction._fromProtobuf,\n);\n"],"names":["TokenDissociateTransaction","Transaction","constructor","props","super","this","_tokenIds","_accountId","_defaultMaxTransactionFee","Hbar","tokenIds","setTokenIds","accountId","setAccountId","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","dissociateToken","_fromProtobufTransactions","tokens","map","token","TokenId","undefined","account","AccountId","_requireNotFrozen","tokenId","fromString","clone","_validateChecksums","client","validateChecksum","_execute","channel","request","dissociateTokens","_getTransactionDataCase","_makeTransactionData","_toProtobuf","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"qKA6Be,MAAMA,UAAmCC,EAMpD,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,UAAY,KAMjBD,KAAKE,WAAa,KAElBF,KAAKG,0BAA4B,IAAIC,EAAK,GAEpB,MAAlBN,EAAMO,UACNL,KAAKM,YAAYR,EAAMO,UAGJ,MAAnBP,EAAMS,WACNP,KAAKQ,aAAaV,EAAMS,UAEpC,CAWI,oBAAOE,CACHC,EACAC,EACAC,EACAC,EACAC,GAEA,MACMC,EADOD,EAAO,GAIf,gBAEL,OAAOlB,EAAYoB,0BACf,IAAIrB,EAA2B,CAC3BU,SAC8B,MAA1BU,EAAgBE,OACVF,EAAgBE,OAAOC,IAAKC,GACxBC,EAAQX,cAAcU,SAE1BE,EACVd,UAC+B,MAA3BQ,EAAgBO,QACVC,EAAUd,cAAcM,EAAgBO,cACxCD,IAEdX,EACAC,EACAC,EACAC,EACAC,EAEZ,CAKI,YAAIT,GACA,OAAOL,KAAKC,SACpB,CAMI,WAAAK,CAAYD,GAQR,OAPAL,KAAKwB,oBACLxB,KAAKC,UAAYI,EAASa,IAAKO,GACR,iBAAZA,EACDL,EAAQM,WAAWD,GACnBA,EAAQE,SAGX3B,IACf,CAKI,aAAIO,GACA,OAAOP,KAAKE,UACpB,CAMI,YAAAM,CAAaD,GAOT,OANAP,KAAKwB,oBACLxB,KAAKE,WACoB,iBAAdK,EACDgB,EAAUG,WAAWnB,GACrBA,EAAUoB,QAEb3B,IACf,CAKI,kBAAA4B,CAAmBC,GACQ,MAAnB7B,KAAKE,YACLF,KAAKE,WAAW4B,iBAAiBD,GAGrC,IAAK,MAAMJ,KAA6B,MAAlBzB,KAAKC,UAAoBD,KAAKC,UAAY,GAC7C,MAAXwB,GACAA,EAAQK,iBAAiBD,EAGzC,CASI,QAAAE,CAASC,EAASC,GACd,OAAOD,EAAQb,MAAMe,iBAAiBD,EAC9C,CAOI,uBAAAE,GACI,MAAO,iBACf,CAOI,oBAAAC,GACI,MAAO,CACHnB,OACsB,MAAlBjB,KAAKC,UACCD,KAAKC,UAAUiB,IAAKO,GAAYA,EAAQY,eACxC,KACVf,QACuB,MAAnBtB,KAAKE,WAAqBF,KAAKE,WAAWmC,cAAgB,KAE1E,CAKI,SAAAC,GAII,MAAO,8BAFHtC,KAAKuC,gBAAgBC,QACxB,WAC8CC,YACvD,EAGAC,EAAqBC,IACjB,kBAEAhD,EAA2Bc"}
|
|
@@ -9,8 +9,7 @@ var _Transaction = _interopRequireWildcard(require("../transaction/Transaction.c
|
|
|
9
9
|
var _CustomFixedFee = _interopRequireDefault(require("./CustomFixedFee.cjs"));
|
|
10
10
|
var _CustomFractionalFee = _interopRequireDefault(require("./CustomFractionalFee.cjs"));
|
|
11
11
|
var _CustomRoyaltyFee = _interopRequireDefault(require("./CustomRoyaltyFee.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
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"./TokenId.js";import e,{TRANSACTION_REGISTRY as o}from"../transaction/Transaction.js";import s from"./CustomFixedFee.js";import r from"./CustomFractionalFee.js";import n from"./CustomRoyaltyFee.js";class u extends e{constructor(t={}){super(),this._tokenId=null,this._customFees=[],null!=t.tokenId&&this.setTokenId(t.tokenId),null!=t.customFees&&this.setCustomFees(t.customFees)}static _fromProtobuf(o,i,a,m,d){const c=d[0].tokenFeeScheduleUpdate;return e._fromProtobufTransactions(new u({tokenId:null!=c.tokenId?t._fromProtobuf(c.tokenId):void 0,customFees:null!=c.customFees?c.customFees.map(
|
|
1
|
+
import t from"./TokenId.js";import e,{TRANSACTION_REGISTRY as o}from"../transaction/Transaction.js";import s from"./CustomFixedFee.js";import r from"./CustomFractionalFee.js";import n from"./CustomRoyaltyFee.js";class u extends e{constructor(t={}){super(),this._tokenId=null,this._customFees=[],null!=t.tokenId&&this.setTokenId(t.tokenId),null!=t.customFees&&this.setCustomFees(t.customFees)}static _fromProtobuf(o,i,a,m,d){const c=d[0].tokenFeeScheduleUpdate;return e._fromProtobufTransactions(new u({tokenId:null!=c.tokenId?t._fromProtobuf(c.tokenId):void 0,customFees:null!=c.customFees?c.customFees.map(t=>null!=t.fixedFee?s._fromProtobuf(t):null!=t.fractionalFee?r._fromProtobuf(t):n._fromProtobuf(t)):void 0}),o,i,a,m,d)}get tokenId(){return this._tokenId}setTokenId(e){return this._requireNotFrozen(),this._tokenId="string"==typeof e?t.fromString(e):t._fromProtobuf(e._toProtobuf()),this}get customFees(){return this._customFees}setCustomFees(t){return this._requireNotFrozen(),this._customFees=t,this}_execute(t,e){return t.token.updateTokenFeeSchedule(e)}_getTransactionDataCase(){return"tokenFeeScheduleUpdate"}_makeTransactionData(){return{tokenId:null!=this._tokenId?this._tokenId._toProtobuf():null,customFees:this._customFees.map(t=>t._toProtobuf())}}_getLogId(){return`TokenFeeScheduleUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}}o.set("tokenFeeScheduleUpdate",u._fromProtobuf);export{u as default};
|
|
2
2
|
//# sourceMappingURL=TokenFeeScheduleUpdateTransaction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenFeeScheduleUpdateTransaction.js","sources":["../../src/token/TokenFeeScheduleUpdateTransaction.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 CustomFixedFee from \"./CustomFixedFee.js\";\nimport CustomFractionalFee from \"./CustomFractionalFee.js\";\nimport CustomRoyaltyFee from \"./CustomRoyaltyFee.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.ITokenFeeScheduleUpdateTransactionBody} HieroProto.proto.ITokenFeeScheduleUpdateTransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenID} HieroProto.proto.ITokenID\n */\n\n/**\n * @typedef {import(\"bignumber.js\").default} BigNumber\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../transaction/TransactionId.js\").default} TransactionId\n * @typedef {import(\"./CustomFee.js\").default} CustomFee\n * @typedef {import(\"../account/AccountId.js\").default} AccountId\n */\n\n/**\n * FeeScheduleUpdate a new Hedera™ crypto-currency token.\n */\nexport default class TokenFeeScheduleUpdateTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {TokenId | string} [props.tokenId]\n * @param {CustomFee[]} [props.customFees]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?TokenId}\n */\n this._tokenId = null;\n\n /**\n * @private\n * @type {CustomFee[]}\n */\n this._customFees = [];\n\n if (props.tokenId != null) {\n this.setTokenId(props.tokenId);\n }\n\n if (props.customFees != null) {\n this.setCustomFees(props.customFees);\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 {TokenFeeScheduleUpdateTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const feeScheduleUpdate =\n /** @type {HieroProto.proto.ITokenFeeScheduleUpdateTransactionBody} */ (\n body.tokenFeeScheduleUpdate\n );\n\n return Transaction._fromProtobufTransactions(\n new TokenFeeScheduleUpdateTransaction({\n tokenId:\n feeScheduleUpdate.tokenId != null\n ? TokenId._fromProtobuf(feeScheduleUpdate.tokenId)\n : undefined,\n customFees:\n feeScheduleUpdate.customFees != null\n ? feeScheduleUpdate.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 : 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._fromProtobuf(tokenId._toProtobuf());\n\n return this;\n }\n\n /**\n * @returns {CustomFee[]}\n */\n get customFees() {\n return this._customFees;\n }\n\n /**\n * @param {CustomFee[]} fees\n * @returns {this}\n */\n setCustomFees(fees) {\n this._requireNotFrozen();\n this._customFees = fees;\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.updateTokenFeeSchedule(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"tokenFeeScheduleUpdate\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.ITokenFeeScheduleUpdateTransactionBody}\n */\n _makeTransactionData() {\n return {\n tokenId: this._tokenId != null ? this._tokenId._toProtobuf() : null,\n customFees: this._customFees.map((fee) => fee._toProtobuf()),\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 `TokenFeeScheduleUpdateTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"tokenFeeScheduleUpdate\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n TokenFeeScheduleUpdateTransaction._fromProtobuf,\n);\n"],"names":["TokenFeeScheduleUpdateTransaction","Transaction","constructor","props","super","this","_tokenId","_customFees","tokenId","setTokenId","customFees","setCustomFees","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","feeScheduleUpdate","_fromProtobufTransactions","TokenId","undefined","map","fee","fixedFee","CustomFixedFee","fractionalFee","CustomFractionalFee","CustomRoyaltyFee","_requireNotFrozen","fromString","_toProtobuf","fees","_execute","channel","request","token","updateTokenFeeSchedule","_getTransactionDataCase","_makeTransactionData","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"oNAgCe,MAAMA,UAA0CC,EAM3D,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,SAAW,KAMhBD,KAAKE,YAAc,GAEE,MAAjBJ,EAAMK,SACNH,KAAKI,WAAWN,EAAMK,SAGF,MAApBL,EAAMO,YACNL,KAAKM,cAAcR,EAAMO,WAErC,CAWI,oBAAOE,CACHC,EACAC,EACAC,EACAC,EACAC,GAEA,MACMC,EADOD,EAAO,GAIf,uBAEL,OAAOhB,EAAYkB,0BACf,IAAInB,EAAkC,CAClCQ,QACiC,MAA7BU,EAAkBV,QACZY,EAAQR,cAAcM,EAAkBV,cACxCa,EACVX,WACoC,MAAhCQ,EAAkBR,WACZQ,EAAkBR,WAAWY,
|
|
1
|
+
{"version":3,"file":"TokenFeeScheduleUpdateTransaction.js","sources":["../../src/token/TokenFeeScheduleUpdateTransaction.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 CustomFixedFee from \"./CustomFixedFee.js\";\nimport CustomFractionalFee from \"./CustomFractionalFee.js\";\nimport CustomRoyaltyFee from \"./CustomRoyaltyFee.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.ITokenFeeScheduleUpdateTransactionBody} HieroProto.proto.ITokenFeeScheduleUpdateTransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITokenID} HieroProto.proto.ITokenID\n */\n\n/**\n * @typedef {import(\"bignumber.js\").default} BigNumber\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../transaction/TransactionId.js\").default} TransactionId\n * @typedef {import(\"./CustomFee.js\").default} CustomFee\n * @typedef {import(\"../account/AccountId.js\").default} AccountId\n */\n\n/**\n * FeeScheduleUpdate a new Hedera™ crypto-currency token.\n */\nexport default class TokenFeeScheduleUpdateTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {TokenId | string} [props.tokenId]\n * @param {CustomFee[]} [props.customFees]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?TokenId}\n */\n this._tokenId = null;\n\n /**\n * @private\n * @type {CustomFee[]}\n */\n this._customFees = [];\n\n if (props.tokenId != null) {\n this.setTokenId(props.tokenId);\n }\n\n if (props.customFees != null) {\n this.setCustomFees(props.customFees);\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 {TokenFeeScheduleUpdateTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const feeScheduleUpdate =\n /** @type {HieroProto.proto.ITokenFeeScheduleUpdateTransactionBody} */ (\n body.tokenFeeScheduleUpdate\n );\n\n return Transaction._fromProtobufTransactions(\n new TokenFeeScheduleUpdateTransaction({\n tokenId:\n feeScheduleUpdate.tokenId != null\n ? TokenId._fromProtobuf(feeScheduleUpdate.tokenId)\n : undefined,\n customFees:\n feeScheduleUpdate.customFees != null\n ? feeScheduleUpdate.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 : 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._fromProtobuf(tokenId._toProtobuf());\n\n return this;\n }\n\n /**\n * @returns {CustomFee[]}\n */\n get customFees() {\n return this._customFees;\n }\n\n /**\n * @param {CustomFee[]} fees\n * @returns {this}\n */\n setCustomFees(fees) {\n this._requireNotFrozen();\n this._customFees = fees;\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.updateTokenFeeSchedule(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"tokenFeeScheduleUpdate\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.ITokenFeeScheduleUpdateTransactionBody}\n */\n _makeTransactionData() {\n return {\n tokenId: this._tokenId != null ? this._tokenId._toProtobuf() : null,\n customFees: this._customFees.map((fee) => fee._toProtobuf()),\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 `TokenFeeScheduleUpdateTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"tokenFeeScheduleUpdate\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n TokenFeeScheduleUpdateTransaction._fromProtobuf,\n);\n"],"names":["TokenFeeScheduleUpdateTransaction","Transaction","constructor","props","super","this","_tokenId","_customFees","tokenId","setTokenId","customFees","setCustomFees","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","feeScheduleUpdate","_fromProtobufTransactions","TokenId","undefined","map","fee","fixedFee","CustomFixedFee","fractionalFee","CustomFractionalFee","CustomRoyaltyFee","_requireNotFrozen","fromString","_toProtobuf","fees","_execute","channel","request","token","updateTokenFeeSchedule","_getTransactionDataCase","_makeTransactionData","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"oNAgCe,MAAMA,UAA0CC,EAM3D,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,SAAW,KAMhBD,KAAKE,YAAc,GAEE,MAAjBJ,EAAMK,SACNH,KAAKI,WAAWN,EAAMK,SAGF,MAApBL,EAAMO,YACNL,KAAKM,cAAcR,EAAMO,WAErC,CAWI,oBAAOE,CACHC,EACAC,EACAC,EACAC,EACAC,GAEA,MACMC,EADOD,EAAO,GAIf,uBAEL,OAAOhB,EAAYkB,0BACf,IAAInB,EAAkC,CAClCQ,QACiC,MAA7BU,EAAkBV,QACZY,EAAQR,cAAcM,EAAkBV,cACxCa,EACVX,WACoC,MAAhCQ,EAAkBR,WACZQ,EAAkBR,WAAWY,IAAKC,GACV,MAAhBA,EAAIC,SACGC,EAAeb,cAAcW,GACR,MAArBA,EAAIG,cACJC,EAAoBf,cAAcW,GAElCK,EAAiBhB,cAAcW,SAG9CF,IAEdR,EACAC,EACAC,EACAC,EACAC,EAEZ,CAKI,WAAIT,GACA,OAAOH,KAAKC,QACpB,CAMI,UAAAG,CAAWD,GAOP,OANAH,KAAKwB,oBACLxB,KAAKC,SACkB,iBAAZE,EACDY,EAAQU,WAAWtB,GACnBY,EAAQR,cAAcJ,EAAQuB,eAEjC1B,IACf,CAKI,cAAIK,GACA,OAAOL,KAAKE,WACpB,CAMI,aAAAI,CAAcqB,GAIV,OAHA3B,KAAKwB,oBACLxB,KAAKE,YAAcyB,EAEZ3B,IACf,CASI,QAAA4B,CAASC,EAASC,GACd,OAAOD,EAAQE,MAAMC,uBAAuBF,EACpD,CAOI,uBAAAG,GACI,MAAO,wBACf,CAOI,oBAAAC,GACI,MAAO,CACH/B,QAA0B,MAAjBH,KAAKC,SAAmBD,KAAKC,SAASyB,cAAgB,KAC/DrB,WAAYL,KAAKE,YAAYe,IAAKC,GAAQA,EAAIQ,eAE1D,CAKI,SAAAS,GAII,MAAO,qCAFHnC,KAAKoC,gBAAgBC,QACxB,WACqDC,YAC9D,EAGAC,EAAqBC,IACjB,yBAEA7C,EAAkCY"}
|
|
@@ -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
|
|
package/lib/token/TokenId.cjs
CHANGED
|
@@ -9,8 +9,7 @@ var HieroProto = _interopRequireWildcard(require("@hashgraph/proto"));
|
|
|
9
9
|
var _EvmAddress = _interopRequireDefault(require("../EvmAddress.cjs"));
|
|
10
10
|
var util = _interopRequireWildcard(require("../util.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
|
/**
|
package/lib/token/TokenInfo.cjs
CHANGED
|
@@ -17,8 +17,7 @@ var _CustomFractionalFee = _interopRequireDefault(require("./CustomFractionalFee
|
|
|
17
17
|
var _CustomRoyaltyFee = _interopRequireDefault(require("./CustomRoyaltyFee.cjs"));
|
|
18
18
|
var _Key = _interopRequireDefault(require("../Key.cjs"));
|
|
19
19
|
var _LedgerId = _interopRequireDefault(require("../LedgerId.cjs"));
|
|
20
|
-
function
|
|
21
|
-
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; }
|
|
20
|
+
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); }
|
|
22
21
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
22
|
// SPDX-License-Identifier: Apache-2.0
|
|
24
23
|
|
package/lib/token/TokenInfo.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"./TokenId.js";import t from"../account/AccountId.js";import o from"../Duration.js";import u from"../Timestamp.js";import l from"long";import*as s from"@hashgraph/proto";import a from"./TokenType.js";import n from"./TokenSupplyType.js";import y from"./CustomFixedFee.js";import r from"./CustomFractionalFee.js";import i from"./CustomRoyaltyFee.js";import p from"../Key.js";import m from"../LedgerId.js";class d{constructor(e){this.tokenId=e.tokenId,this.name=e.name,this.symbol=e.symbol,this.decimals=e.decimals,this.totalSupply=e.totalSupply,this.treasuryAccountId=e.treasuryAccountId,this.adminKey=e.adminKey,this.kycKey=e.kycKey,this.freezeKey=e.freezeKey,this.pauseKey=e.pauseKey,this.wipeKey=e.wipeKey,this.supplyKey=e.supplyKey,this.feeScheduleKey=e.feeScheduleKey,this.defaultFreezeStatus=e.defaultFreezeStatus,this.defaultKycStatus=e.defaultKycStatus,this.pauseStatus=e.pauseStatus,this.isDeleted=e.isDeleted,this.autoRenewAccountId=e.autoRenewAccountId,this.autoRenewPeriod=e.autoRenewPeriod,this.expirationTime=e.expirationTime,this.tokenMemo=e.tokenMemo,this.customFees=e.customFees,this.tokenType=e.tokenType,this.supplyType=e.supplyType,this.maxSupply=e.maxSupply,this.ledgerId=e.ledgerId,this.metadataKey=e.metadataKey,this.metadata=e.metadata}static _fromProtobuf(s){const f=s.defaultFreezeStatus,h=s.defaultKycStatus,K=s.pauseStatus,c=null!=s.autoRenewAccount?t._fromProtobuf(s.autoRenewAccount):new t(0);return new d({tokenId:e._fromProtobuf(s.tokenId),name:s.name,symbol:s.symbol,decimals:s.decimals,totalSupply:l.fromValue(s.totalSupply),treasuryAccountId:null!=s.treasury?t._fromProtobuf(s.treasury):null,adminKey:null!=s.adminKey?p._fromProtobufKey(s.adminKey):null,kycKey:null!=s.kycKey?p._fromProtobufKey(s.kycKey):null,freezeKey:null!=s.freezeKey?p._fromProtobufKey(s.freezeKey):null,pauseKey:null!=s.pauseKey?p._fromProtobufKey(s.pauseKey):null,wipeKey:null!=s.wipeKey?p._fromProtobufKey(s.wipeKey):null,supplyKey:null!=s.supplyKey?p._fromProtobufKey(s.supplyKey):null,feeScheduleKey:null!=s.feeScheduleKey?p._fromProtobufKey(s.feeScheduleKey):null,defaultFreezeStatus:0===f?null:1==f,defaultKycStatus:0===h?null:1==h,pauseStatus:0===K?null:1==K,isDeleted:s.deleted,autoRenewAccountId:0!=c.shard.toInt()||0!=c.realm.toInt()||0!=c.num.toInt()?c:null,autoRenewPeriod:null!=s.autoRenewPeriod?o._fromProtobuf(s.autoRenewPeriod):null,expirationTime:null!=s.expiry?u._fromProtobuf(s.expiry):null,tokenMemo:null!=s.memo?s.memo:"",customFees:null!=s.customFees?s.customFees.map(
|
|
1
|
+
import e from"./TokenId.js";import t from"../account/AccountId.js";import o from"../Duration.js";import u from"../Timestamp.js";import l from"long";import*as s from"@hashgraph/proto";import a from"./TokenType.js";import n from"./TokenSupplyType.js";import y from"./CustomFixedFee.js";import r from"./CustomFractionalFee.js";import i from"./CustomRoyaltyFee.js";import p from"../Key.js";import m from"../LedgerId.js";class d{constructor(e){this.tokenId=e.tokenId,this.name=e.name,this.symbol=e.symbol,this.decimals=e.decimals,this.totalSupply=e.totalSupply,this.treasuryAccountId=e.treasuryAccountId,this.adminKey=e.adminKey,this.kycKey=e.kycKey,this.freezeKey=e.freezeKey,this.pauseKey=e.pauseKey,this.wipeKey=e.wipeKey,this.supplyKey=e.supplyKey,this.feeScheduleKey=e.feeScheduleKey,this.defaultFreezeStatus=e.defaultFreezeStatus,this.defaultKycStatus=e.defaultKycStatus,this.pauseStatus=e.pauseStatus,this.isDeleted=e.isDeleted,this.autoRenewAccountId=e.autoRenewAccountId,this.autoRenewPeriod=e.autoRenewPeriod,this.expirationTime=e.expirationTime,this.tokenMemo=e.tokenMemo,this.customFees=e.customFees,this.tokenType=e.tokenType,this.supplyType=e.supplyType,this.maxSupply=e.maxSupply,this.ledgerId=e.ledgerId,this.metadataKey=e.metadataKey,this.metadata=e.metadata}static _fromProtobuf(s){const f=s.defaultFreezeStatus,h=s.defaultKycStatus,K=s.pauseStatus,c=null!=s.autoRenewAccount?t._fromProtobuf(s.autoRenewAccount):new t(0);return new d({tokenId:e._fromProtobuf(s.tokenId),name:s.name,symbol:s.symbol,decimals:s.decimals,totalSupply:l.fromValue(s.totalSupply),treasuryAccountId:null!=s.treasury?t._fromProtobuf(s.treasury):null,adminKey:null!=s.adminKey?p._fromProtobufKey(s.adminKey):null,kycKey:null!=s.kycKey?p._fromProtobufKey(s.kycKey):null,freezeKey:null!=s.freezeKey?p._fromProtobufKey(s.freezeKey):null,pauseKey:null!=s.pauseKey?p._fromProtobufKey(s.pauseKey):null,wipeKey:null!=s.wipeKey?p._fromProtobufKey(s.wipeKey):null,supplyKey:null!=s.supplyKey?p._fromProtobufKey(s.supplyKey):null,feeScheduleKey:null!=s.feeScheduleKey?p._fromProtobufKey(s.feeScheduleKey):null,defaultFreezeStatus:0===f?null:1==f,defaultKycStatus:0===h?null:1==h,pauseStatus:0===K?null:1==K,isDeleted:s.deleted,autoRenewAccountId:0!=c.shard.toInt()||0!=c.realm.toInt()||0!=c.num.toInt()?c:null,autoRenewPeriod:null!=s.autoRenewPeriod?o._fromProtobuf(s.autoRenewPeriod):null,expirationTime:null!=s.expiry?u._fromProtobuf(s.expiry):null,tokenMemo:null!=s.memo?s.memo:"",customFees:null!=s.customFees?s.customFees.map(e=>null!=e.fixedFee?y._fromProtobuf(e):null!=e.fractionalFee?r._fromProtobuf(e):i._fromProtobuf(e)):[],tokenType:null!=s.tokenType?a._fromCode(s.tokenType):null,supplyType:null!=s.supplyType?n._fromCode(s.supplyType):null,maxSupply:null!=s.maxSupply?s.maxSupply:null,ledgerId:null!=s.ledgerId?m.fromBytes(s.ledgerId):null,metadataKey:null!=s.metadataKey?p._fromProtobufKey(s.metadataKey):null,metadata:null!=s.metadata?s.metadata:new Uint8Array})}_toProtobuf(){return{tokenId:this.tokenId._toProtobuf(),name:this.name,symbol:this.symbol,decimals:this.decimals,totalSupply:this.totalSupply,treasury:null!=this.treasuryAccountId?this.treasuryAccountId._toProtobuf():null,adminKey:null!=this.adminKey?this.adminKey._toProtobufKey():null,kycKey:null!=this.kycKey?this.kycKey._toProtobufKey():null,freezeKey:null!=this.freezeKey?this.freezeKey._toProtobufKey():null,pauseKey:null!=this.pauseKey?this.pauseKey._toProtobufKey():null,wipeKey:null!=this.wipeKey?this.wipeKey._toProtobufKey():null,supplyKey:null!=this.supplyKey?this.supplyKey._toProtobufKey():null,feeScheduleKey:null!=this.feeScheduleKey?this.feeScheduleKey._toProtobufKey():null,defaultFreezeStatus:null==this.defaultFreezeStatus?0:this.defaultFreezeStatus?1:2,defaultKycStatus:null==this.defaultKycStatus?0:this.defaultKycStatus?1:2,pauseStatus:null==this.pauseStatus?0:this.pauseStatus?1:2,deleted:this.isDeleted,autoRenewAccount:null!=this.autoRenewAccountId?this.autoRenewAccountId._toProtobuf():void 0,autoRenewPeriod:null!=this.autoRenewPeriod?this.autoRenewPeriod._toProtobuf():null,expiry:null!=this.expirationTime?this.expirationTime._toProtobuf():null,memo:this.tokenMemo,customFees:this.customFees.map(e=>e._toProtobuf()),tokenType:null!=this.tokenType?this.tokenType._code:null,supplyType:null!=this.supplyType?this.supplyType._code:null,maxSupply:this.maxSupply,ledgerId:null!=this.ledgerId?this.ledgerId.toBytes():null,metadataKey:null!=this.metadataKey?this.metadataKey._toProtobufKey():null,metadata:null!=this.metadata?this.metadata:null}}static fromBytes(e){return d._fromProtobuf(s.proto.TokenInfo.decode(e))}toBytes(){return s.proto.TokenInfo.encode(this._toProtobuf()).finish()}}export{d as default};
|
|
2
2
|
//# sourceMappingURL=TokenInfo.js.map
|