@hiero-ledger/sdk 2.80.0 → 2.81.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -7
- package/dist/umd.js +2213 -318
- package/dist/umd.js.map +1 -0
- package/dist/umd.min.js +6 -5
- package/dist/umd.min.js.map +1 -0
- package/lib/Executable.cjs +7 -4
- package/lib/Executable.js +1 -1
- package/lib/Executable.js.map +1 -1
- package/lib/PublicKey.cjs +45 -26
- package/lib/PublicKey.d.ts +12 -0
- package/lib/PublicKey.js +1 -1
- package/lib/PublicKey.js.map +1 -1
- package/lib/RequestType.cjs +19 -1
- package/lib/RequestType.d.ts +2 -0
- package/lib/RequestType.js +1 -1
- package/lib/RequestType.js.map +1 -1
- package/lib/Status.cjs +203 -252
- package/lib/Status.d.ts +8 -6
- package/lib/Status.js +1 -1
- package/lib/Status.js.map +1 -1
- package/lib/Transfer.cjs +25 -2
- package/lib/Transfer.d.ts +4 -0
- package/lib/Transfer.js +1 -1
- package/lib/Transfer.js.map +1 -1
- package/lib/account/AccountCreateTransaction.cjs +38 -0
- package/lib/account/AccountCreateTransaction.d.ts +21 -0
- package/lib/account/AccountCreateTransaction.js +1 -1
- package/lib/account/AccountCreateTransaction.js.map +1 -1
- package/lib/account/AccountUpdateTransaction.cjs +74 -1
- package/lib/account/AccountUpdateTransaction.d.ts +43 -0
- package/lib/account/AccountUpdateTransaction.js +1 -1
- package/lib/account/AccountUpdateTransaction.js.map +1 -1
- package/lib/account/TransferTransaction.cjs +57 -9
- package/lib/account/TransferTransaction.d.ts +31 -1
- package/lib/account/TransferTransaction.js +1 -1
- package/lib/account/TransferTransaction.js.map +1 -1
- package/lib/browser.js +1 -1
- package/lib/client/Client.cjs +38 -0
- package/lib/client/Client.d.ts +30 -0
- package/lib/client/Client.js +1 -1
- package/lib/client/Client.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/contract/ContractCreateTransaction.cjs +37 -1
- package/lib/contract/ContractCreateTransaction.d.ts +21 -0
- package/lib/contract/ContractCreateTransaction.js +1 -1
- package/lib/contract/ContractCreateTransaction.js.map +1 -1
- package/lib/contract/ContractUpdateTransaction.cjs +74 -1
- package/lib/contract/ContractUpdateTransaction.d.ts +43 -0
- package/lib/contract/ContractUpdateTransaction.js +1 -1
- package/lib/contract/ContractUpdateTransaction.js.map +1 -1
- package/lib/exports.cjs +103 -0
- package/lib/exports.d.ts +13 -0
- package/lib/exports.js +1 -1
- package/lib/exports.js.map +1 -1
- package/lib/hooks/EvmHook.cjs +84 -0
- package/lib/hooks/EvmHook.d.ts +51 -0
- package/lib/hooks/EvmHook.js +2 -0
- package/lib/hooks/EvmHook.js.map +1 -0
- package/lib/hooks/EvmHookCall.cjs +103 -0
- package/lib/hooks/EvmHookCall.d.ts +69 -0
- package/lib/hooks/EvmHookCall.js +2 -0
- package/lib/hooks/EvmHookCall.js.map +1 -0
- package/lib/hooks/EvmHookMappingEntry.cjs +135 -0
- package/lib/hooks/EvmHookMappingEntry.d.ts +84 -0
- package/lib/hooks/EvmHookMappingEntry.js +2 -0
- package/lib/hooks/EvmHookMappingEntry.js.map +1 -0
- package/lib/hooks/EvmHookStorageUpdate.cjs +238 -0
- package/lib/hooks/EvmHookStorageUpdate.d.ts +144 -0
- package/lib/hooks/EvmHookStorageUpdate.js +2 -0
- package/lib/hooks/EvmHookStorageUpdate.js.map +1 -0
- package/lib/hooks/FungibleHookCall.cjs +67 -0
- package/lib/hooks/FungibleHookCall.d.ts +50 -0
- package/lib/hooks/FungibleHookCall.js +2 -0
- package/lib/hooks/FungibleHookCall.js.map +1 -0
- package/lib/hooks/FungibleHookType.cjs +11 -0
- package/lib/hooks/FungibleHookType.d.ts +5 -0
- package/lib/hooks/FungibleHookType.js +2 -0
- package/lib/hooks/FungibleHookType.js.map +1 -0
- package/lib/hooks/HookCall.cjs +99 -0
- package/lib/hooks/HookCall.d.ts +64 -0
- package/lib/hooks/HookCall.js +2 -0
- package/lib/hooks/HookCall.js.map +1 -0
- package/lib/hooks/HookCreationDetails.cjs +149 -0
- package/lib/hooks/HookCreationDetails.d.ts +91 -0
- package/lib/hooks/HookCreationDetails.js +2 -0
- package/lib/hooks/HookCreationDetails.js.map +1 -0
- package/lib/hooks/HookEntityId.cjs +67 -0
- package/lib/hooks/HookEntityId.d.ts +41 -0
- package/lib/hooks/HookEntityId.js +2 -0
- package/lib/hooks/HookEntityId.js.map +1 -0
- package/lib/hooks/HookExtensionPoint.cjs +31 -0
- package/lib/hooks/HookExtensionPoint.d.ts +16 -0
- package/lib/hooks/HookExtensionPoint.js +2 -0
- package/lib/hooks/HookExtensionPoint.js.map +1 -0
- package/lib/hooks/HookId.cjs +101 -0
- package/lib/hooks/HookId.d.ts +63 -0
- package/lib/hooks/HookId.js +2 -0
- package/lib/hooks/HookId.js.map +1 -0
- package/lib/hooks/HookStoreTransaction.cjs +157 -0
- package/lib/hooks/HookStoreTransaction.d.ts +77 -0
- package/lib/hooks/HookStoreTransaction.js +2 -0
- package/lib/hooks/HookStoreTransaction.js.map +1 -0
- package/lib/hooks/NftHookCall.cjs +67 -0
- package/lib/hooks/NftHookCall.d.ts +50 -0
- package/lib/hooks/NftHookCall.js +2 -0
- package/lib/hooks/NftHookCall.js.map +1 -0
- package/lib/hooks/NftHookType.cjs +13 -0
- package/lib/hooks/NftHookType.d.ts +7 -0
- package/lib/hooks/NftHookType.js +2 -0
- package/lib/hooks/NftHookType.js.map +1 -0
- package/lib/index.js +1 -1
- package/lib/native.js +1 -1
- package/lib/token/AbstractTokenTransferTransaction.cjs +17 -5
- package/lib/token/AbstractTokenTransferTransaction.d.ts +13 -2
- package/lib/token/AbstractTokenTransferTransaction.js +1 -1
- package/lib/token/AbstractTokenTransferTransaction.js.map +1 -1
- package/lib/token/TokenAirdropTransaction.cjs +1 -1
- package/lib/token/TokenAirdropTransaction.js +1 -1
- package/lib/token/TokenAirdropTransaction.js.map +1 -1
- package/lib/token/TokenNftTransfer.cjs +51 -2
- package/lib/token/TokenNftTransfer.d.ts +7 -0
- package/lib/token/TokenNftTransfer.js +1 -1
- package/lib/token/TokenNftTransfer.js.map +1 -1
- package/lib/token/TokenTransfer.cjs +26 -2
- package/lib/token/TokenTransfer.d.ts +4 -0
- package/lib/token/TokenTransfer.js +1 -1
- package/lib/token/TokenTransfer.js.map +1 -1
- package/lib/transaction/Transaction.cjs +2 -1
- package/lib/transaction/Transaction.js +1 -1
- package/lib/transaction/Transaction.js.map +1 -1
- package/lib/transaction/TransactionResponse.cjs +82 -9
- package/lib/transaction/TransactionResponse.d.ts +33 -2
- package/lib/transaction/TransactionResponse.js +1 -1
- package/lib/transaction/TransactionResponse.js.map +1 -1
- package/lib/version.js +1 -1
- package/package.json +15 -13
- package/src/Executable.js +10 -7
- package/src/PublicKey.js +53 -36
- package/src/RequestType.js +18 -0
- package/src/Status.js +201 -252
- package/src/Transfer.js +33 -1
- package/src/account/AccountCreateTransaction.js +39 -0
- package/src/account/AccountUpdateTransaction.js +78 -0
- package/src/account/TransferTransaction.js +84 -8
- package/src/client/Client.js +38 -0
- 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/contract/ContractCreateTransaction.js +37 -0
- package/src/contract/ContractUpdateTransaction.js +80 -0
- package/src/exports.js +17 -0
- package/src/hooks/EvmHook.js +83 -0
- package/src/hooks/EvmHookCall.js +100 -0
- package/src/hooks/EvmHookMappingEntry.js +140 -0
- package/src/hooks/EvmHookStorageUpdate.js +257 -0
- package/src/hooks/FungibleHookCall.js +65 -0
- package/src/hooks/FungibleHookType.js +6 -0
- package/src/hooks/HookCall.js +97 -0
- package/src/hooks/HookCreationDetails.js +155 -0
- package/src/hooks/HookEntityId.js +67 -0
- package/src/hooks/HookExtensionPoint.js +25 -0
- package/src/hooks/HookId.js +102 -0
- package/src/hooks/HookStoreTransaction.js +185 -0
- package/src/hooks/NftHookCall.js +64 -0
- package/src/hooks/NftHookType.js +8 -0
- package/src/token/AbstractTokenTransferTransaction.js +16 -1
- package/src/token/TokenAirdropTransaction.js +1 -0
- package/src/token/TokenNftTransfer.js +68 -1
- package/src/token/TokenTransfer.js +34 -1
- package/src/transaction/Transaction.js +3 -0
- package/src/transaction/TransactionResponse.js +98 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContractCreateTransaction.js","sources":["../../src/contract/ContractCreateTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Hbar from \"../Hbar.js\";\nimport AccountId from \"../account/AccountId.js\";\nimport FileId from \"../file/FileId.js\";\nimport ContractFunctionParameters from \"./ContractFunctionParameters.js\";\nimport Transaction, {\n DEFAULT_AUTO_RENEW_PERIOD,\n TRANSACTION_REGISTRY,\n} from \"../transaction/Transaction.js\";\nimport Long from \"long\";\nimport Duration from \"../Duration.js\";\nimport Key from \"../Key.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransaction} HieroProto.proto.ITransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n * @typedef {import(\"@hiero-ledger/proto\").proto.IContractCreateTransactionBody} HieroProto.proto.IContractCreateTransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.IAccountID} HieroProto.proto.IAccountID\n * @typedef {import(\"@hiero-ledger/proto\").proto.IFileID} HieroProto.proto.IFileID\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 */\n\n/**\n * Create a new smart contract.\n *\n * If this transaction succeeds, the `ContractID` for the new smart contract\n * SHALL be set in the transaction receipt.<br/>\n * The contract is defined by the initial bytecode (or `initcode`). The\n * `initcode` SHALL be stored either in a previously created file, or in the\n * transaction body itself for very small contracts.\n *\n * As part of contract creation, the constructor defined for the new smart\n * contract SHALL run with the parameters provided in the\n * `constructorParameters` field.<br/>\n * The gas to \"power\" that constructor MUST be provided via the `gas` field,\n * and SHALL be charged to the payer for this transaction.<br/>\n * If the contract _constructor_ stores information, it is charged gas for that\n * storage. There is a separate fee in HBAR to maintain that storage until the\n * expiration, and that fee SHALL be added to this transaction as part of the\n * _transaction fee_, rather than gas.\n *\n */\n\nexport default class ContractCreateTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {FileId | string} [props.bytecodeFileId]\n * @param {Uint8Array} [props.bytecode]\n * @param {Key} [props.adminKey]\n * @param {number | Long} [props.gas]\n * @param {number | string | Long | BigNumber | Hbar} [props.initialBalance]\n * @param {AccountId | string} [props.proxyAccountId]\n * @param {Duration | Long | number} [props.autoRenewPeriod]\n * @param {Uint8Array} [props.constructorParameters]\n * @param {string} [props.contractMemo]\n * @param {number} [props.maxAutomaticTokenAssociations]\n * @param {AccountId | string} [props.stakedAccountId]\n * @param {Long | number} [props.stakedNodeId]\n * @param {boolean} [props.declineStakingReward]\n * @param {AccountId} [props.autoRenewAccountId]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?FileId}\n */\n this._bytecodeFileId = null;\n\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._bytecode = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._adminKey = null;\n\n /**\n * @private\n * @type {?Long}\n */\n this._gas = null;\n\n /**\n * @private\n * @type {?Hbar}\n */\n this._initialBalance = null;\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._proxyAccountId = null;\n\n /**\n * @private\n * @type {Duration}\n */\n this._autoRenewPeriod = new Duration(DEFAULT_AUTO_RENEW_PERIOD);\n\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._constructorParameters = null;\n\n /**\n * @private\n * @type {?string}\n */\n this._contractMemo = null;\n\n /**\n * @private\n * @type {?number}\n */\n this._maxAutomaticTokenAssociations = null;\n\n this._defaultMaxTransactionFee = new Hbar(20);\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._stakedAccountId = null;\n\n /**\n * @private\n * @type {?Long}\n */\n this._stakedNodeId = null;\n\n /**\n * @private\n * @type {boolean}\n */\n this._declineStakingReward = false;\n\n /**\n * @type {?AccountId}\n */\n this._autoRenewAccountId = null;\n\n if (props.bytecodeFileId != null) {\n this.setBytecodeFileId(props.bytecodeFileId);\n }\n\n if (props.bytecode != null) {\n this.setBytecode(props.bytecode);\n }\n\n if (props.adminKey != null) {\n this.setAdminKey(props.adminKey);\n }\n\n if (props.gas != null) {\n this.setGas(props.gas);\n }\n\n if (props.initialBalance != null) {\n this.setInitialBalance(props.initialBalance);\n }\n\n if (props.proxyAccountId != null) {\n // eslint-disable-next-line deprecation/deprecation\n this.setProxyAccountId(props.proxyAccountId);\n }\n\n if (props.autoRenewPeriod != null) {\n this.setAutoRenewPeriod(props.autoRenewPeriod);\n }\n\n if (props.constructorParameters != null) {\n this.setConstructorParameters(props.constructorParameters);\n }\n\n if (props.contractMemo != null) {\n this.setContractMemo(props.contractMemo);\n }\n\n if (props.maxAutomaticTokenAssociations != null) {\n this.setMaxAutomaticTokenAssociations(\n props.maxAutomaticTokenAssociations,\n );\n }\n\n if (props.stakedAccountId != null) {\n this.setStakedAccountId(props.stakedAccountId);\n }\n\n if (props.stakedNodeId != null) {\n this.setStakedNodeId(props.stakedNodeId);\n }\n\n if (props.declineStakingReward != null) {\n this.setDeclineStakingReward(props.declineStakingReward);\n }\n\n if (props.autoRenewAccountId != null) {\n this.setAutoRenewAccountId(props.autoRenewAccountId);\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 {ContractCreateTransaction}\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.IContractCreateTransactionBody} */ (\n body.contractCreateInstance\n );\n\n return Transaction._fromProtobufTransactions(\n new ContractCreateTransaction({\n bytecodeFileId:\n create.fileID != null\n ? FileId._fromProtobuf(\n /** @type {HieroProto.proto.IFileID} */ (\n create.fileID\n ),\n )\n : undefined,\n adminKey:\n create.adminKey != null\n ? Key._fromProtobufKey(create.adminKey)\n : undefined,\n gas: create.gas != null ? create.gas : undefined,\n initialBalance:\n create.initialBalance != null\n ? Hbar.fromTinybars(create.initialBalance)\n : undefined,\n proxyAccountId:\n create.proxyAccountID != null\n ? AccountId._fromProtobuf(\n /** @type {HieroProto.proto.IAccountID} */ (\n create.proxyAccountID\n ),\n )\n : undefined,\n autoRenewPeriod:\n create.autoRenewPeriod != null\n ? create.autoRenewPeriod.seconds != null\n ? create.autoRenewPeriod.seconds\n : undefined\n : undefined,\n constructorParameters:\n create.constructorParameters != null\n ? create.constructorParameters\n : undefined,\n contractMemo: create.memo != null ? create.memo : undefined,\n maxAutomaticTokenAssociations:\n create.maxAutomaticTokenAssociations != null\n ? create.maxAutomaticTokenAssociations\n : undefined,\n stakedAccountId:\n create.stakedAccountId != null\n ? AccountId._fromProtobuf(create.stakedAccountId)\n : undefined,\n stakedNodeId:\n create.stakedNodeId != null\n ? create.stakedNodeId\n : undefined,\n declineStakingReward: create.declineReward == true,\n autoRenewAccountId:\n create.autoRenewAccountId != null\n ? AccountId._fromProtobuf(create.autoRenewAccountId)\n : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?FileId}\n */\n get bytecodeFileId() {\n return this._bytecodeFileId;\n }\n\n /**\n * @param {FileId | string} bytecodeFileId\n * @returns {this}\n */\n setBytecodeFileId(bytecodeFileId) {\n this._requireNotFrozen();\n this._bytecodeFileId =\n typeof bytecodeFileId === \"string\"\n ? FileId.fromString(bytecodeFileId)\n : bytecodeFileId.clone();\n this._bytecode = null;\n\n return this;\n }\n\n /**\n * @returns {?Uint8Array}\n */\n get bytecode() {\n return this._bytecode;\n }\n\n /**\n * @param {Uint8Array} bytecode\n * @returns {this}\n */\n setBytecode(bytecode) {\n this._requireNotFrozen();\n this._bytecode = bytecode;\n this._bytecodeFileId = null;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get adminKey() {\n return this._adminKey;\n }\n\n /**\n * @param {Key} adminKey\n * @returns {this}\n */\n setAdminKey(adminKey) {\n this._requireNotFrozen();\n this._adminKey = adminKey;\n\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get gas() {\n return this._gas;\n }\n\n /**\n * @param {number | Long} gas\n * @returns {this}\n */\n setGas(gas) {\n this._requireNotFrozen();\n this._gas = gas instanceof Long ? gas : Long.fromValue(gas);\n if (this._gas.lessThan(0)) {\n throw new Error(\"Gas cannot be negative number\");\n }\n return this;\n }\n\n /**\n * @returns {?Hbar}\n */\n get initialBalance() {\n return this._initialBalance;\n }\n\n /**\n * Set the initial amount to transfer into this contract.\n *\n * @param {number | string | Long | BigNumber | Hbar} initialBalance\n * @returns {this}\n */\n setInitialBalance(initialBalance) {\n this._requireNotFrozen();\n this._initialBalance =\n initialBalance instanceof Hbar\n ? initialBalance\n : new Hbar(initialBalance);\n\n return this;\n }\n\n /**\n * @deprecated\n * @returns {?AccountId}\n */\n get proxyAccountId() {\n return this._proxyAccountId;\n }\n\n /**\n * @deprecated\n * @param {AccountId | string} proxyAccountId\n * @returns {this}\n */\n setProxyAccountId(proxyAccountId) {\n this._requireNotFrozen();\n this._proxyAccountId =\n proxyAccountId instanceof AccountId\n ? proxyAccountId\n : AccountId.fromString(proxyAccountId);\n\n return this;\n }\n\n /**\n * @returns {Duration}\n */\n get autoRenewPeriod() {\n return this._autoRenewPeriod;\n }\n\n /**\n * An account to charge for auto-renewal of this contract. If not set, or set to an\n * account with zero hbar balance, the contract's own hbar balance will be used to\n * cover auto-renewal fees.\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 {?Uint8Array}\n */\n get constructorParameters() {\n return this._constructorParameters;\n }\n\n /**\n * @param {Uint8Array | ContractFunctionParameters} constructorParameters\n * @returns {this}\n */\n setConstructorParameters(constructorParameters) {\n this._requireNotFrozen();\n this._constructorParameters =\n constructorParameters instanceof ContractFunctionParameters\n ? constructorParameters._build()\n : constructorParameters;\n\n return this;\n }\n\n /**\n * @returns {?string}\n */\n get contractMemo() {\n return this._contractMemo;\n }\n\n /**\n * @param {string} contractMemo\n * @returns {this}\n */\n setContractMemo(contractMemo) {\n this._requireNotFrozen();\n this._contractMemo = contractMemo;\n\n return this;\n }\n\n /**\n * @returns {?number}\n */\n get maxAutomaticTokenAssociations() {\n return this._maxAutomaticTokenAssociations;\n }\n\n /**\n * @param {number} maxAutomaticTokenAssociations\n * @returns {this}\n */\n setMaxAutomaticTokenAssociations(maxAutomaticTokenAssociations) {\n this._maxAutomaticTokenAssociations = maxAutomaticTokenAssociations;\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get stakedAccountId() {\n return this._stakedAccountId;\n }\n\n /**\n * @param {AccountId | string} stakedAccountId\n * @returns {this}\n */\n setStakedAccountId(stakedAccountId) {\n this._requireNotFrozen();\n this._stakedAccountId =\n typeof stakedAccountId === \"string\"\n ? AccountId.fromString(stakedAccountId)\n : stakedAccountId;\n this._stakedNodeId = null;\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get stakedNodeId() {\n return this._stakedNodeId;\n }\n\n /**\n * @param {Long | number} stakedNodeId\n * @returns {this}\n */\n setStakedNodeId(stakedNodeId) {\n this._requireNotFrozen();\n this._stakedNodeId = Long.fromValue(stakedNodeId);\n this._stakedAccountId = null;\n return this;\n }\n\n /**\n * @returns {boolean}\n */\n get declineStakingRewards() {\n return this._declineStakingReward;\n }\n\n /**\n * @param {boolean} declineStakingReward\n * @returns {this}\n */\n setDeclineStakingReward(declineStakingReward) {\n this._requireNotFrozen();\n this._declineStakingReward = declineStakingReward;\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get autoRenewAccountId() {\n return this._autoRenewAccountId;\n }\n\n /**\n * @param {string | AccountId} autoRenewAccountId\n * @returns {this}\n */\n setAutoRenewAccountId(autoRenewAccountId) {\n this._requireNotFrozen();\n this._autoRenewAccountId =\n typeof autoRenewAccountId === \"string\"\n ? AccountId.fromString(autoRenewAccountId)\n : autoRenewAccountId;\n\n return this;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (this._bytecodeFileId != null) {\n this._bytecodeFileId.validateChecksum(client);\n }\n\n if (this._proxyAccountId != null) {\n this._proxyAccountId.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.smartContract.createContract(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"contractCreateInstance\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.IContractCreateTransactionBody}\n */\n _makeTransactionData() {\n return {\n fileID:\n this._bytecodeFileId != null\n ? this._bytecodeFileId._toProtobuf()\n : null,\n initcode: this._bytecode,\n adminKey:\n this._adminKey != null ? this._adminKey._toProtobufKey() : null,\n gas: this._gas,\n initialBalance:\n this._initialBalance != null\n ? this._initialBalance.toTinybars()\n : null,\n proxyAccountID:\n this._proxyAccountId != null\n ? this._proxyAccountId._toProtobuf()\n : null,\n autoRenewPeriod: this._autoRenewPeriod._toProtobuf(),\n constructorParameters: this._constructorParameters,\n memo: this._contractMemo,\n maxAutomaticTokenAssociations: this._maxAutomaticTokenAssociations,\n stakedAccountId:\n this.stakedAccountId != null\n ? this.stakedAccountId._toProtobuf()\n : null,\n stakedNodeId: this.stakedNodeId,\n declineReward: this.declineStakingRewards,\n autoRenewAccountId:\n this._autoRenewAccountId != null\n ? this._autoRenewAccountId._toProtobuf()\n : 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 `ContractCreateTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"contractCreateInstance\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n ContractCreateTransaction._fromProtobuf,\n);\n"],"names":["ContractCreateTransaction","Transaction","constructor","props","super","this","_bytecodeFileId","_bytecode","_adminKey","_gas","_initialBalance","_proxyAccountId","_autoRenewPeriod","Duration","DEFAULT_AUTO_RENEW_PERIOD","_constructorParameters","_contractMemo","_maxAutomaticTokenAssociations","_defaultMaxTransactionFee","Hbar","_stakedAccountId","_stakedNodeId","_declineStakingReward","_autoRenewAccountId","bytecodeFileId","setBytecodeFileId","bytecode","setBytecode","adminKey","setAdminKey","gas","setGas","initialBalance","setInitialBalance","proxyAccountId","setProxyAccountId","autoRenewPeriod","setAutoRenewPeriod","constructorParameters","setConstructorParameters","contractMemo","setContractMemo","maxAutomaticTokenAssociations","setMaxAutomaticTokenAssociations","stakedAccountId","setStakedAccountId","stakedNodeId","setStakedNodeId","declineStakingReward","setDeclineStakingReward","autoRenewAccountId","setAutoRenewAccountId","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","create","_fromProtobufTransactions","fileID","FileId","undefined","Key","_fromProtobufKey","fromTinybars","proxyAccountID","AccountId","seconds","memo","declineReward","_requireNotFrozen","fromString","clone","Long","fromValue","lessThan","Error","ContractFunctionParameters","_build","declineStakingRewards","_validateChecksums","client","validateChecksum","_execute","channel","request","smartContract","createContract","_getTransactionDataCase","_makeTransactionData","_toProtobuf","initcode","_toProtobufKey","toTinybars","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"mUAsDe,MAAMA,UAAkCC,EAkBnD,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,gBAAkB,KAMvBD,KAAKE,UAAY,KAMjBF,KAAKG,UAAY,KAMjBH,KAAKI,KAAO,KAMZJ,KAAKK,gBAAkB,KAMvBL,KAAKM,gBAAkB,KAMvBN,KAAKO,iBAAmB,IAAIC,EAASC,GAMrCT,KAAKU,uBAAyB,KAM9BV,KAAKW,cAAgB,KAMrBX,KAAKY,+BAAiC,KAEtCZ,KAAKa,0BAA4B,IAAIC,EAAK,IAM1Cd,KAAKe,iBAAmB,KAMxBf,KAAKgB,cAAgB,KAMrBhB,KAAKiB,uBAAwB,EAK7BjB,KAAKkB,oBAAsB,KAEC,MAAxBpB,EAAMqB,gBACNnB,KAAKoB,kBAAkBtB,EAAMqB,gBAGX,MAAlBrB,EAAMuB,UACNrB,KAAKsB,YAAYxB,EAAMuB,UAGL,MAAlBvB,EAAMyB,UACNvB,KAAKwB,YAAY1B,EAAM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,"file":"ContractCreateTransaction.js","sources":["../../src/contract/ContractCreateTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Hbar from \"../Hbar.js\";\nimport AccountId from \"../account/AccountId.js\";\nimport FileId from \"../file/FileId.js\";\nimport ContractFunctionParameters from \"./ContractFunctionParameters.js\";\nimport Transaction, {\n DEFAULT_AUTO_RENEW_PERIOD,\n TRANSACTION_REGISTRY,\n} from \"../transaction/Transaction.js\";\nimport Long from \"long\";\nimport Duration from \"../Duration.js\";\nimport Key from \"../Key.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransaction} HieroProto.proto.ITransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n * @typedef {import(\"@hiero-ledger/proto\").proto.IContractCreateTransactionBody} HieroProto.proto.IContractCreateTransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.IAccountID} HieroProto.proto.IAccountID\n * @typedef {import(\"@hiero-ledger/proto\").proto.IFileID} HieroProto.proto.IFileID\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 */\n\n/**\n * Create a new smart contract.\n *\n * If this transaction succeeds, the `ContractID` for the new smart contract\n * SHALL be set in the transaction receipt.<br/>\n * The contract is defined by the initial bytecode (or `initcode`). The\n * `initcode` SHALL be stored either in a previously created file, or in the\n * transaction body itself for very small contracts.\n *\n * As part of contract creation, the constructor defined for the new smart\n * contract SHALL run with the parameters provided in the\n * `constructorParameters` field.<br/>\n * The gas to \"power\" that constructor MUST be provided via the `gas` field,\n * and SHALL be charged to the payer for this transaction.<br/>\n * If the contract _constructor_ stores information, it is charged gas for that\n * storage. There is a separate fee in HBAR to maintain that storage until the\n * expiration, and that fee SHALL be added to this transaction as part of the\n * _transaction fee_, rather than gas.\n *\n */\n\nexport default class ContractCreateTransaction extends Transaction {\n /**\n * @param {object} [props]\n * @param {FileId | string} [props.bytecodeFileId]\n * @param {Uint8Array} [props.bytecode]\n * @param {Key} [props.adminKey]\n * @param {number | Long} [props.gas]\n * @param {number | string | Long | BigNumber | Hbar} [props.initialBalance]\n * @param {AccountId | string} [props.proxyAccountId]\n * @param {Duration | Long | number} [props.autoRenewPeriod]\n * @param {Uint8Array} [props.constructorParameters]\n * @param {string} [props.contractMemo]\n * @param {number} [props.maxAutomaticTokenAssociations]\n * @param {AccountId | string} [props.stakedAccountId]\n * @param {Long | number} [props.stakedNodeId]\n * @param {boolean} [props.declineStakingReward]\n * @param {AccountId} [props.autoRenewAccountId]\n * @param {import(\"../hooks/HookCreationDetails.js\").default[]} [props.hooks]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?FileId}\n */\n this._bytecodeFileId = null;\n\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._bytecode = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._adminKey = null;\n\n /**\n * @private\n * @type {?Long}\n */\n this._gas = null;\n\n /**\n * @private\n * @type {?Hbar}\n */\n this._initialBalance = null;\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._proxyAccountId = null;\n\n /**\n * @private\n * @type {Duration}\n */\n this._autoRenewPeriod = new Duration(DEFAULT_AUTO_RENEW_PERIOD);\n\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._constructorParameters = null;\n\n /**\n * @private\n * @type {?string}\n */\n this._contractMemo = null;\n\n /**\n * @private\n * @type {?number}\n */\n this._maxAutomaticTokenAssociations = null;\n\n this._defaultMaxTransactionFee = new Hbar(20);\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._stakedAccountId = null;\n\n /**\n * @private\n * @type {?Long}\n */\n this._stakedNodeId = null;\n\n /**\n * @private\n * @type {boolean}\n */\n this._declineStakingReward = false;\n\n /**\n * @type {?AccountId}\n */\n this._autoRenewAccountId = null;\n\n /**\n * @private\n * @type {import(\"../hooks/HookCreationDetails.js\").default[]}\n */\n this._hooks = [];\n\n if (props.hooks != null) {\n this._hooks = props.hooks;\n }\n\n if (props.bytecodeFileId != null) {\n this.setBytecodeFileId(props.bytecodeFileId);\n }\n\n if (props.bytecode != null) {\n this.setBytecode(props.bytecode);\n }\n\n if (props.adminKey != null) {\n this.setAdminKey(props.adminKey);\n }\n\n if (props.gas != null) {\n this.setGas(props.gas);\n }\n\n if (props.initialBalance != null) {\n this.setInitialBalance(props.initialBalance);\n }\n\n if (props.proxyAccountId != null) {\n // eslint-disable-next-line deprecation/deprecation\n this.setProxyAccountId(props.proxyAccountId);\n }\n\n if (props.autoRenewPeriod != null) {\n this.setAutoRenewPeriod(props.autoRenewPeriod);\n }\n\n if (props.constructorParameters != null) {\n this.setConstructorParameters(props.constructorParameters);\n }\n\n if (props.contractMemo != null) {\n this.setContractMemo(props.contractMemo);\n }\n\n if (props.maxAutomaticTokenAssociations != null) {\n this.setMaxAutomaticTokenAssociations(\n props.maxAutomaticTokenAssociations,\n );\n }\n\n if (props.stakedAccountId != null) {\n this.setStakedAccountId(props.stakedAccountId);\n }\n\n if (props.stakedNodeId != null) {\n this.setStakedNodeId(props.stakedNodeId);\n }\n\n if (props.declineStakingReward != null) {\n this.setDeclineStakingReward(props.declineStakingReward);\n }\n\n if (props.autoRenewAccountId != null) {\n this.setAutoRenewAccountId(props.autoRenewAccountId);\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 {ContractCreateTransaction}\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.IContractCreateTransactionBody} */ (\n body.contractCreateInstance\n );\n\n return Transaction._fromProtobufTransactions(\n new ContractCreateTransaction({\n bytecodeFileId:\n create.fileID != null\n ? FileId._fromProtobuf(\n /** @type {HieroProto.proto.IFileID} */ (\n create.fileID\n ),\n )\n : undefined,\n adminKey:\n create.adminKey != null\n ? Key._fromProtobufKey(create.adminKey)\n : undefined,\n gas: create.gas != null ? create.gas : undefined,\n initialBalance:\n create.initialBalance != null\n ? Hbar.fromTinybars(create.initialBalance)\n : undefined,\n proxyAccountId:\n create.proxyAccountID != null\n ? AccountId._fromProtobuf(\n /** @type {HieroProto.proto.IAccountID} */ (\n create.proxyAccountID\n ),\n )\n : undefined,\n autoRenewPeriod:\n create.autoRenewPeriod != null\n ? create.autoRenewPeriod.seconds != null\n ? create.autoRenewPeriod.seconds\n : undefined\n : undefined,\n constructorParameters:\n create.constructorParameters != null\n ? create.constructorParameters\n : undefined,\n contractMemo: create.memo != null ? create.memo : undefined,\n maxAutomaticTokenAssociations:\n create.maxAutomaticTokenAssociations != null\n ? create.maxAutomaticTokenAssociations\n : undefined,\n stakedAccountId:\n create.stakedAccountId != null\n ? AccountId._fromProtobuf(create.stakedAccountId)\n : undefined,\n stakedNodeId:\n create.stakedNodeId != null\n ? create.stakedNodeId\n : undefined,\n declineStakingReward: create.declineReward == true,\n autoRenewAccountId:\n create.autoRenewAccountId != null\n ? AccountId._fromProtobuf(create.autoRenewAccountId)\n : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?FileId}\n */\n get bytecodeFileId() {\n return this._bytecodeFileId;\n }\n\n /**\n * @param {FileId | string} bytecodeFileId\n * @returns {this}\n */\n setBytecodeFileId(bytecodeFileId) {\n this._requireNotFrozen();\n this._bytecodeFileId =\n typeof bytecodeFileId === \"string\"\n ? FileId.fromString(bytecodeFileId)\n : bytecodeFileId.clone();\n this._bytecode = null;\n\n return this;\n }\n\n /**\n * @returns {?Uint8Array}\n */\n get bytecode() {\n return this._bytecode;\n }\n\n /**\n * @param {Uint8Array} bytecode\n * @returns {this}\n */\n setBytecode(bytecode) {\n this._requireNotFrozen();\n this._bytecode = bytecode;\n this._bytecodeFileId = null;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get adminKey() {\n return this._adminKey;\n }\n\n /**\n * @param {Key} adminKey\n * @returns {this}\n */\n setAdminKey(adminKey) {\n this._requireNotFrozen();\n this._adminKey = adminKey;\n\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get gas() {\n return this._gas;\n }\n\n /**\n * @param {number | Long} gas\n * @returns {this}\n */\n setGas(gas) {\n this._requireNotFrozen();\n this._gas = gas instanceof Long ? gas : Long.fromValue(gas);\n if (this._gas.lessThan(0)) {\n throw new Error(\"Gas cannot be negative number\");\n }\n return this;\n }\n\n /**\n * @returns {?Hbar}\n */\n get initialBalance() {\n return this._initialBalance;\n }\n\n /**\n * Set the initial amount to transfer into this contract.\n *\n * @param {number | string | Long | BigNumber | Hbar} initialBalance\n * @returns {this}\n */\n setInitialBalance(initialBalance) {\n this._requireNotFrozen();\n this._initialBalance =\n initialBalance instanceof Hbar\n ? initialBalance\n : new Hbar(initialBalance);\n\n return this;\n }\n\n /**\n * @deprecated\n * @returns {?AccountId}\n */\n get proxyAccountId() {\n return this._proxyAccountId;\n }\n\n /**\n * @deprecated\n * @param {AccountId | string} proxyAccountId\n * @returns {this}\n */\n setProxyAccountId(proxyAccountId) {\n this._requireNotFrozen();\n this._proxyAccountId =\n proxyAccountId instanceof AccountId\n ? proxyAccountId\n : AccountId.fromString(proxyAccountId);\n\n return this;\n }\n\n /**\n * @returns {Duration}\n */\n get autoRenewPeriod() {\n return this._autoRenewPeriod;\n }\n\n /**\n * An account to charge for auto-renewal of this contract. If not set, or set to an\n * account with zero hbar balance, the contract's own hbar balance will be used to\n * cover auto-renewal fees.\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 {?Uint8Array}\n */\n get constructorParameters() {\n return this._constructorParameters;\n }\n\n /**\n * @param {Uint8Array | ContractFunctionParameters} constructorParameters\n * @returns {this}\n */\n setConstructorParameters(constructorParameters) {\n this._requireNotFrozen();\n this._constructorParameters =\n constructorParameters instanceof ContractFunctionParameters\n ? constructorParameters._build()\n : constructorParameters;\n\n return this;\n }\n\n /**\n * @returns {?string}\n */\n get contractMemo() {\n return this._contractMemo;\n }\n\n /**\n * @param {string} contractMemo\n * @returns {this}\n */\n setContractMemo(contractMemo) {\n this._requireNotFrozen();\n this._contractMemo = contractMemo;\n\n return this;\n }\n\n /**\n * @returns {?number}\n */\n get maxAutomaticTokenAssociations() {\n return this._maxAutomaticTokenAssociations;\n }\n\n /**\n * @param {number} maxAutomaticTokenAssociations\n * @returns {this}\n */\n setMaxAutomaticTokenAssociations(maxAutomaticTokenAssociations) {\n this._maxAutomaticTokenAssociations = maxAutomaticTokenAssociations;\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get stakedAccountId() {\n return this._stakedAccountId;\n }\n\n /**\n * @param {AccountId | string} stakedAccountId\n * @returns {this}\n */\n setStakedAccountId(stakedAccountId) {\n this._requireNotFrozen();\n this._stakedAccountId =\n typeof stakedAccountId === \"string\"\n ? AccountId.fromString(stakedAccountId)\n : stakedAccountId;\n this._stakedNodeId = null;\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get stakedNodeId() {\n return this._stakedNodeId;\n }\n\n /**\n * @param {Long | number} stakedNodeId\n * @returns {this}\n */\n setStakedNodeId(stakedNodeId) {\n this._requireNotFrozen();\n this._stakedNodeId = Long.fromValue(stakedNodeId);\n this._stakedAccountId = null;\n return this;\n }\n\n /**\n * @returns {boolean}\n */\n get declineStakingRewards() {\n return this._declineStakingReward;\n }\n\n /**\n * @param {boolean} declineStakingReward\n * @returns {this}\n */\n setDeclineStakingReward(declineStakingReward) {\n this._requireNotFrozen();\n this._declineStakingReward = declineStakingReward;\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get autoRenewAccountId() {\n return this._autoRenewAccountId;\n }\n\n /**\n * @param {string | AccountId} autoRenewAccountId\n * @returns {this}\n */\n setAutoRenewAccountId(autoRenewAccountId) {\n this._requireNotFrozen();\n this._autoRenewAccountId =\n typeof autoRenewAccountId === \"string\"\n ? AccountId.fromString(autoRenewAccountId)\n : autoRenewAccountId;\n\n return this;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (this._bytecodeFileId != null) {\n this._bytecodeFileId.validateChecksum(client);\n }\n\n if (this._proxyAccountId != null) {\n this._proxyAccountId.validateChecksum(client);\n }\n }\n\n /**\n * @param {import(\"../hooks/HookCreationDetails.js\").default} hook\n * @returns {this}\n */\n addHook(hook) {\n this._hooks.push(hook);\n return this;\n }\n\n /**\n * @param {import(\"../hooks/HookCreationDetails.js\").default[]} hooks\n * @returns {this}\n */\n setHooks(hooks) {\n this._hooks = hooks;\n return this;\n }\n\n /**\n * @returns {import(\"../hooks/HookCreationDetails.js\").default[]}\n */\n get hooks() {\n return this._hooks;\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.smartContract.createContract(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"contractCreateInstance\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.IContractCreateTransactionBody}\n */\n _makeTransactionData() {\n return {\n fileID:\n this._bytecodeFileId != null\n ? this._bytecodeFileId._toProtobuf()\n : null,\n initcode: this._bytecode,\n adminKey:\n this._adminKey != null ? this._adminKey._toProtobufKey() : null,\n gas: this._gas,\n initialBalance:\n this._initialBalance != null\n ? this._initialBalance.toTinybars()\n : null,\n proxyAccountID:\n this._proxyAccountId != null\n ? this._proxyAccountId._toProtobuf()\n : null,\n autoRenewPeriod: this._autoRenewPeriod._toProtobuf(),\n constructorParameters: this._constructorParameters,\n memo: this._contractMemo,\n maxAutomaticTokenAssociations: this._maxAutomaticTokenAssociations,\n stakedAccountId:\n this.stakedAccountId != null\n ? this.stakedAccountId._toProtobuf()\n : null,\n stakedNodeId: this.stakedNodeId,\n declineReward: this.declineStakingRewards,\n autoRenewAccountId:\n this._autoRenewAccountId != null\n ? this._autoRenewAccountId._toProtobuf()\n : null,\n hookCreationDetails: this.hooks.map((hook) => hook._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 `ContractCreateTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"contractCreateInstance\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n ContractCreateTransaction._fromProtobuf,\n);\n"],"names":["ContractCreateTransaction","Transaction","constructor","props","super","this","_bytecodeFileId","_bytecode","_adminKey","_gas","_initialBalance","_proxyAccountId","_autoRenewPeriod","Duration","DEFAULT_AUTO_RENEW_PERIOD","_constructorParameters","_contractMemo","_maxAutomaticTokenAssociations","_defaultMaxTransactionFee","Hbar","_stakedAccountId","_stakedNodeId","_declineStakingReward","_autoRenewAccountId","_hooks","hooks","bytecodeFileId","setBytecodeFileId","bytecode","setBytecode","adminKey","setAdminKey","gas","setGas","initialBalance","setInitialBalance","proxyAccountId","setProxyAccountId","autoRenewPeriod","setAutoRenewPeriod","constructorParameters","setConstructorParameters","contractMemo","setContractMemo","maxAutomaticTokenAssociations","setMaxAutomaticTokenAssociations","stakedAccountId","setStakedAccountId","stakedNodeId","setStakedNodeId","declineStakingReward","setDeclineStakingReward","autoRenewAccountId","setAutoRenewAccountId","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","create","_fromProtobufTransactions","fileID","FileId","undefined","Key","_fromProtobufKey","fromTinybars","proxyAccountID","AccountId","seconds","memo","declineReward","_requireNotFrozen","fromString","clone","Long","fromValue","lessThan","Error","ContractFunctionParameters","_build","declineStakingRewards","_validateChecksums","client","validateChecksum","addHook","hook","push","setHooks","_execute","channel","request","smartContract","createContract","_getTransactionDataCase","_makeTransactionData","_toProtobuf","initcode","_toProtobufKey","toTinybars","hookCreationDetails","map","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"mUAsDe,MAAMA,UAAkCC,EAmBnD,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,gBAAkB,KAMvBD,KAAKE,UAAY,KAMjBF,KAAKG,UAAY,KAMjBH,KAAKI,KAAO,KAMZJ,KAAKK,gBAAkB,KAMvBL,KAAKM,gBAAkB,KAMvBN,KAAKO,iBAAmB,IAAIC,EAASC,GAMrCT,KAAKU,uBAAyB,KAM9BV,KAAKW,cAAgB,KAMrBX,KAAKY,+BAAiC,KAEtCZ,KAAKa,0BAA4B,IAAIC,EAAK,IAM1Cd,KAAKe,iBAAmB,KAMxBf,KAAKgB,cAAgB,KAMrBhB,KAAKiB,uBAAwB,EAK7BjB,KAAKkB,oBAAsB,KAM3BlB,KAAKmB,OAAS,GAEK,MAAfrB,EAAMsB,QACNpB,KAAKmB,OAASrB,EAAMsB,OAGI,MAAxBtB,EAAMuB,gBACNrB,KAAKsB,kBAAkBxB,EAAMuB,gBAGX,MAAlBvB,EAAMyB,UACNvB,KAAKwB,YAAY1B,EAAMyB,UAGL,MAAlBzB,EAAM2B,UACNzB,KAAK0B,YAAY5B,EAAM2B,UAGV,MAAb3B,E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BAAoB0E,cACzB,KACVI,oBAAqBhG,KAAKoB,MAAM6E,IAAKf,GAASA,EAAKU,eAE/D,CAKI,SAAAM,GAII,MAAO,6BAFHlG,KAAKmG,gBAAgBC,QACxB,WAC6CC,YACtD,EAGAC,EAAqBC,IACjB,yBAEA5G,EAA0BsD"}
|
|
@@ -59,6 +59,8 @@ class ContractUpdateTransaction extends _Transaction.default {
|
|
|
59
59
|
* @param {Long | number} [props.stakedNodeId]
|
|
60
60
|
* @param {boolean} [props.declineStakingReward]
|
|
61
61
|
* @param {AccountId} [props.autoRenewAccountId]
|
|
62
|
+
* @param {import("../hooks/HookCreationDetails.js").default[]} [props.hooksToBeCreated]
|
|
63
|
+
* @param {Long[]} [props.hooksToBeDeleted]
|
|
62
64
|
*/
|
|
63
65
|
constructor(props = {}) {
|
|
64
66
|
super();
|
|
@@ -133,6 +135,18 @@ class ContractUpdateTransaction extends _Transaction.default {
|
|
|
133
135
|
* @type {?AccountId}
|
|
134
136
|
*/
|
|
135
137
|
this._autoRenewAccountId = null;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @private
|
|
141
|
+
* @type {import("../hooks/HookCreationDetails.js").default[]}
|
|
142
|
+
*/
|
|
143
|
+
this._hooksToBeCreated = [];
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @private
|
|
147
|
+
* @type {Long[]}
|
|
148
|
+
*/
|
|
149
|
+
this._hooksToBeDeleted = [];
|
|
136
150
|
if (props.contractId != null) {
|
|
137
151
|
this.setContractId(props.contractId);
|
|
138
152
|
}
|
|
@@ -170,6 +184,12 @@ class ContractUpdateTransaction extends _Transaction.default {
|
|
|
170
184
|
if (props.autoRenewAccountId != null) {
|
|
171
185
|
this.setAutoRenewAccountId(props.autoRenewAccountId);
|
|
172
186
|
}
|
|
187
|
+
if (props.hooksToBeCreated != null) {
|
|
188
|
+
this.setHooksToCreate(props.hooksToBeCreated);
|
|
189
|
+
}
|
|
190
|
+
if (props.hooksToBeDeleted != null) {
|
|
191
|
+
this.setHooksToDelete(props.hooksToBeDeleted);
|
|
192
|
+
}
|
|
173
193
|
}
|
|
174
194
|
|
|
175
195
|
/**
|
|
@@ -462,6 +482,57 @@ class ContractUpdateTransaction extends _Transaction.default {
|
|
|
462
482
|
}
|
|
463
483
|
}
|
|
464
484
|
|
|
485
|
+
/**
|
|
486
|
+
* @param {import("../hooks/HookCreationDetails.js").default} hook
|
|
487
|
+
* @returns {this}
|
|
488
|
+
*/
|
|
489
|
+
addHookToCreate(hook) {
|
|
490
|
+
this._hooksToBeCreated.push(hook);
|
|
491
|
+
return this;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* @param {import("../hooks/HookCreationDetails.js").default[]} hooks
|
|
496
|
+
* @returns {this}
|
|
497
|
+
*/
|
|
498
|
+
setHooksToCreate(hooks) {
|
|
499
|
+
this._hooksToBeCreated = hooks;
|
|
500
|
+
return this;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* @returns {import("../hooks/HookCreationDetails.js").default[]}
|
|
505
|
+
*/
|
|
506
|
+
get hooksToCreate() {
|
|
507
|
+
return this._hooksToBeCreated;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
*
|
|
512
|
+
* @param {Long} hook
|
|
513
|
+
* @returns {this}
|
|
514
|
+
*/
|
|
515
|
+
addHookToDelete(hook) {
|
|
516
|
+
this._hooksToBeDeleted.push(hook);
|
|
517
|
+
return this;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* @param {Long[]} hookIds
|
|
522
|
+
* @returns {this}
|
|
523
|
+
*/
|
|
524
|
+
setHooksToDelete(hookIds) {
|
|
525
|
+
this._hooksToBeDeleted = hookIds;
|
|
526
|
+
return this;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* @returns {Long[]}
|
|
531
|
+
*/
|
|
532
|
+
get hooksToDelete() {
|
|
533
|
+
return this._hooksToBeDeleted;
|
|
534
|
+
}
|
|
535
|
+
|
|
465
536
|
/**
|
|
466
537
|
* @override
|
|
467
538
|
* @internal
|
|
@@ -506,7 +577,9 @@ class ContractUpdateTransaction extends _Transaction.default {
|
|
|
506
577
|
declineReward: this.declineStakingRewards != null ? {
|
|
507
578
|
value: this.declineStakingRewards
|
|
508
579
|
} : null,
|
|
509
|
-
autoRenewAccountId: this._autoRenewAccountId != null ? this._autoRenewAccountId.toString() == "0.0.0" ? Proto.proto.AccountID.create() : this._autoRenewAccountId._toProtobuf() : null
|
|
580
|
+
autoRenewAccountId: this._autoRenewAccountId != null ? this._autoRenewAccountId.toString() == "0.0.0" ? Proto.proto.AccountID.create() : this._autoRenewAccountId._toProtobuf() : null,
|
|
581
|
+
hookIdsToDelete: this._hooksToBeDeleted != null ? this._hooksToBeDeleted : null,
|
|
582
|
+
hookCreationDetails: this._hooksToBeCreated != null ? this._hooksToBeCreated.map(hook => hook._toProtobuf()) : null
|
|
510
583
|
};
|
|
511
584
|
}
|
|
512
585
|
|
|
@@ -48,6 +48,8 @@ export default class ContractUpdateTransaction extends Transaction {
|
|
|
48
48
|
* @param {Long | number} [props.stakedNodeId]
|
|
49
49
|
* @param {boolean} [props.declineStakingReward]
|
|
50
50
|
* @param {AccountId} [props.autoRenewAccountId]
|
|
51
|
+
* @param {import("../hooks/HookCreationDetails.js").default[]} [props.hooksToBeCreated]
|
|
52
|
+
* @param {Long[]} [props.hooksToBeDeleted]
|
|
51
53
|
*/
|
|
52
54
|
constructor(props?: {
|
|
53
55
|
contractId?: string | ContractId | undefined;
|
|
@@ -62,6 +64,8 @@ export default class ContractUpdateTransaction extends Transaction {
|
|
|
62
64
|
stakedNodeId?: number | Long | undefined;
|
|
63
65
|
declineStakingReward?: boolean | undefined;
|
|
64
66
|
autoRenewAccountId?: AccountId | undefined;
|
|
67
|
+
hooksToBeCreated?: import("../hooks/HookCreationDetails.js").default[] | undefined;
|
|
68
|
+
hooksToBeDeleted?: Long[] | undefined;
|
|
65
69
|
});
|
|
66
70
|
/**
|
|
67
71
|
* @private
|
|
@@ -122,6 +126,16 @@ export default class ContractUpdateTransaction extends Transaction {
|
|
|
122
126
|
* @type {?AccountId}
|
|
123
127
|
*/
|
|
124
128
|
_autoRenewAccountId: AccountId | null;
|
|
129
|
+
/**
|
|
130
|
+
* @private
|
|
131
|
+
* @type {import("../hooks/HookCreationDetails.js").default[]}
|
|
132
|
+
*/
|
|
133
|
+
private _hooksToBeCreated;
|
|
134
|
+
/**
|
|
135
|
+
* @private
|
|
136
|
+
* @type {Long[]}
|
|
137
|
+
*/
|
|
138
|
+
private _hooksToBeDeleted;
|
|
125
139
|
/**
|
|
126
140
|
* @returns {?ContractId}
|
|
127
141
|
*/
|
|
@@ -247,6 +261,35 @@ export default class ContractUpdateTransaction extends Transaction {
|
|
|
247
261
|
* @returns {this}
|
|
248
262
|
*/
|
|
249
263
|
clearAutoRenewAccountId(): this;
|
|
264
|
+
/**
|
|
265
|
+
* @param {import("../hooks/HookCreationDetails.js").default} hook
|
|
266
|
+
* @returns {this}
|
|
267
|
+
*/
|
|
268
|
+
addHookToCreate(hook: import("../hooks/HookCreationDetails.js").default): this;
|
|
269
|
+
/**
|
|
270
|
+
* @param {import("../hooks/HookCreationDetails.js").default[]} hooks
|
|
271
|
+
* @returns {this}
|
|
272
|
+
*/
|
|
273
|
+
setHooksToCreate(hooks: import("../hooks/HookCreationDetails.js").default[]): this;
|
|
274
|
+
/**
|
|
275
|
+
* @returns {import("../hooks/HookCreationDetails.js").default[]}
|
|
276
|
+
*/
|
|
277
|
+
get hooksToCreate(): import("../hooks/HookCreationDetails.js").default[];
|
|
278
|
+
/**
|
|
279
|
+
*
|
|
280
|
+
* @param {Long} hook
|
|
281
|
+
* @returns {this}
|
|
282
|
+
*/
|
|
283
|
+
addHookToDelete(hook: Long): this;
|
|
284
|
+
/**
|
|
285
|
+
* @param {Long[]} hookIds
|
|
286
|
+
* @returns {this}
|
|
287
|
+
*/
|
|
288
|
+
setHooksToDelete(hookIds: Long[]): this;
|
|
289
|
+
/**
|
|
290
|
+
* @returns {Long[]}
|
|
291
|
+
*/
|
|
292
|
+
get hooksToDelete(): Long[];
|
|
250
293
|
/**
|
|
251
294
|
* @override
|
|
252
295
|
* @protected
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"../account/AccountId.js";import e from"./ContractId.js";import o from"../file/FileId.js";import n,{TRANSACTION_REGISTRY as i}from"../transaction/Transaction.js";import r from"../Duration.js";import
|
|
1
|
+
import t from"../account/AccountId.js";import e from"./ContractId.js";import o from"../file/FileId.js";import n,{TRANSACTION_REGISTRY as i}from"../transaction/Transaction.js";import r from"../Duration.js";import s from"../Timestamp.js";import a from"../Key.js";import u from"long";import*as c from"@hiero-ledger/proto";class d extends n{constructor(t={}){super(),this._contractId=null,this._expirationTime=null,this._adminKey=null,this._proxyAccountId=null,this._autoRenewPeriod=null,this._bytecodeFileId=null,this._contractMemo=null,this._maxAutomaticTokenAssociations=null,this._stakedAccountId=null,this._stakedNodeId=null,this._declineStakingReward=null,this._autoRenewAccountId=null,this._hooksToBeCreated=[],this._hooksToBeDeleted=[],null!=t.contractId&&this.setContractId(t.contractId),null!=t.expirationTime&&this.setExpirationTime(t.expirationTime),null!=t.adminKey&&this.setAdminKey(t.adminKey),null!=t.proxyAccountId&&this.setProxyAccountId(t.proxyAccountId),null!=t.autoRenewPeriod&&this.setAutoRenewPeriod(t.autoRenewPeriod),null!=t.bytecodeFileId&&this.setBytecodeFileId(t.bytecodeFileId),null!=t.contractMemo&&this.setContractMemo(t.contractMemo),null!=t.maxAutomaticTokenAssociations&&this.setMaxAutomaticTokenAssociations(t.maxAutomaticTokenAssociations),null!=t.stakedAccountId&&this.setStakedAccountId(t.stakedAccountId),null!=t.stakedNodeId&&this.setStakedNodeId(t.stakedNodeId),null!=t.declineStakingReward&&this.setDeclineStakingReward(t.declineStakingReward),null!=t.autoRenewAccountId&&this.setAutoRenewAccountId(t.autoRenewAccountId),null!=t.hooksToBeCreated&&this.setHooksToCreate(t.hooksToBeCreated),null!=t.hooksToBeDeleted&&this.setHooksToDelete(t.hooksToBeDeleted)}static _fromProtobuf(i,r,u,c,l){const h=l[0].contractUpdateInstance;let m,_,I;return null!=h.autoRenewPeriod&&null!=h.autoRenewPeriod.seconds&&(m=h.autoRenewPeriod.seconds),null!=h.memoWrapper&&Object.hasOwn(h.memoWrapper,"value")&&null!=h.memoWrapper.value&&(_=h.memoWrapper.value),null!=h.maxAutomaticTokenAssociations&&null!=h.maxAutomaticTokenAssociations.value&&(I=h.maxAutomaticTokenAssociations.value),n._fromProtobufTransactions(new d({contractId:null!=h.contractID?e._fromProtobuf(h.contractID):void 0,bytecodeFileId:null!=h.fileID?o._fromProtobuf(h.fileID):void 0,expirationTime:null!=h.expirationTime?s._fromProtobuf(h.expirationTime):void 0,adminKey:null!=h.adminKey?a._fromProtobufKey(h.adminKey):void 0,proxyAccountId:null!=h.proxyAccountID?t._fromProtobuf(h.proxyAccountID):void 0,autoRenewPeriod:m,contractMemo:_,maxAutomaticTokenAssociations:I,stakedAccountId:null!=h.stakedAccountId?t._fromProtobuf(h.stakedAccountId):void 0,stakedNodeId:null!=h.stakedNodeId?h.stakedNodeId:void 0,declineStakingReward:null!=h.declineReward&&1==Boolean(h.declineReward),autoRenewAccountId:null!=h.autoRenewAccountId?t._fromProtobuf(h.autoRenewAccountId):void 0}),i,r,u,c,l)}get contractId(){return this._contractId}setContractId(t){return this._requireNotFrozen(),this._contractId="string"==typeof t?e.fromString(t):t.clone(),this}get expirationTime(){return this._expirationTime}setExpirationTime(t){return this._requireNotFrozen(),this._expirationTime=t instanceof s?t:s.fromDate(t),this}get adminKey(){return this._adminKey}setAdminKey(t){return this._requireNotFrozen(),this._adminKey=t,this}get proxyAccountId(){return this._proxyAccountId}setProxyAccountId(e){return this._requireNotFrozen(),this._proxyAccountId="string"==typeof e?t.fromString(e):e.clone(),this}get autoRenewPeriod(){return this._autoRenewPeriod}setAutoRenewPeriod(t){return this._requireNotFrozen(),this._autoRenewPeriod=t instanceof r?t:new r(t),this}get bytecodeFileId(){return this._bytecodeFileId}setBytecodeFileId(t){return console.warn("Deprecated: there is no replacement"),this._requireNotFrozen(),this._bytecodeFileId="string"==typeof t?o.fromString(t):t.clone(),this}get contractMemo(){return this._contractMemo}setContractMemo(t){return this._requireNotFrozen(),this._contractMemo=t,this}clearContractMemo(){return this._requireNotFrozen(),this._contractMemo=null,this}get maxAutomaticTokenAssociations(){return this._maxAutomaticTokenAssociations}setMaxAutomaticTokenAssociations(t){return this._requireNotFrozen(),this._maxAutomaticTokenAssociations=t,this}get stakedAccountId(){return this._stakedAccountId}setStakedAccountId(e){return this._requireNotFrozen(),this._stakedAccountId="string"==typeof e?t.fromString(e):e,this}get stakedNodeId(){return this._stakedNodeId}setStakedNodeId(t){return this._requireNotFrozen(),this._stakedNodeId=u.fromValue(t),this}get declineStakingRewards(){return this._declineStakingReward}setDeclineStakingReward(t){return this._requireNotFrozen(),this._declineStakingReward=t,this}get autoRenewAccountId(){return this._autoRenewAccountId}setAutoRenewAccountId(e){return this._requireNotFrozen(),this._autoRenewAccountId="string"==typeof e?t.fromString(e):e,this}clearAutoRenewAccountId(){return this._autoRenewAccountId=new t(0),this}_validateChecksums(t){null!=this._contractId&&this._contractId.validateChecksum(t),null!=this._bytecodeFileId&&this._bytecodeFileId.validateChecksum(t),null!=this._proxyAccountId&&this._proxyAccountId.validateChecksum(t)}addHookToCreate(t){return this._hooksToBeCreated.push(t),this}setHooksToCreate(t){return this._hooksToBeCreated=t,this}get hooksToCreate(){return this._hooksToBeCreated}addHookToDelete(t){return this._hooksToBeDeleted.push(t),this}setHooksToDelete(t){return this._hooksToBeDeleted=t,this}get hooksToDelete(){return this._hooksToBeDeleted}_execute(t,e){return t.smartContract.updateContract(e)}_getTransactionDataCase(){return"contractUpdateInstance"}_makeTransactionData(){return{contractID:null!=this._contractId?this._contractId._toProtobuf():null,expirationTime:null!=this._expirationTime?this._expirationTime._toProtobuf():null,adminKey:null!=this._adminKey?this._adminKey._toProtobufKey():null,proxyAccountID:null!=this._proxyAccountId?this._proxyAccountId._toProtobuf():null,autoRenewPeriod:null!=this._autoRenewPeriod?this._autoRenewPeriod._toProtobuf():null,fileID:this._bytecodeFileId?this._bytecodeFileId._toProtobuf():null,memoWrapper:null!=this._contractMemo?{value:this._contractMemo}:null,maxAutomaticTokenAssociations:null!=this._maxAutomaticTokenAssociations?{value:this._maxAutomaticTokenAssociations}:null,stakedAccountId:null!=this.stakedAccountId?this.stakedAccountId._toProtobuf():null,stakedNodeId:this.stakedNodeId,declineReward:null!=this.declineStakingRewards?{value:this.declineStakingRewards}:null,autoRenewAccountId:null!=this._autoRenewAccountId?"0.0.0"==this._autoRenewAccountId.toString()?c.proto.AccountID.create():this._autoRenewAccountId._toProtobuf():null,hookIdsToDelete:null!=this._hooksToBeDeleted?this._hooksToBeDeleted:null,hookCreationDetails:null!=this._hooksToBeCreated?this._hooksToBeCreated.map(t=>t._toProtobuf()):null}}_getLogId(){return`ContractUpdateTransaction:${this._transactionIds.current.validStart.toString()}`}}i.set("contractUpdateInstance",d._fromProtobuf);export{d as default};
|
|
2
2
|
//# sourceMappingURL=ContractUpdateTransaction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContractUpdateTransaction.js","sources":["../../src/contract/ContractUpdateTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport AccountId from \"../account/AccountId.js\";\nimport ContractId from \"./ContractId.js\";\nimport FileId from \"../file/FileId.js\";\nimport Transaction, {\n TRANSACTION_REGISTRY,\n} from \"../transaction/Transaction.js\";\nimport Duration from \"../Duration.js\";\nimport Timestamp from \"../Timestamp.js\";\nimport Key from \"../Key.js\";\nimport Long from \"long\";\nimport * as Proto from \"@hiero-ledger/proto\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransaction} HieroProto.proto.ITransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n * @typedef {import(\"@hiero-ledger/proto\").proto.IContractUpdateTransactionBody} HieroProto.proto.IContractUpdateTransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.IAccountID} HieroProto.proto.IAccountID\n * @typedef {import(\"@hiero-ledger/proto\").proto.IContractID} HieroProto.proto.IContractID\n * @typedef {import(\"@hiero-ledger/proto\").proto.IFileID} HieroProto.proto.IFileID\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 * Modify a smart contract.<br/>\n * Any change other than updating the expiration time requires that the\n * contract be modifiable (has a valid `adminKey`) and that the\n * transaction be signed by the `adminKey`\n * <p>\n * Fields _not set_ on the request SHALL NOT be modified.\n */\nexport default class ContractUpdateTransaction extends Transaction {\n /**\n * @param {object} props\n * @param {ContractId | string} [props.contractId]\n * @param {FileId | string} [props.bytecodeFileId]\n * @param {Timestamp | Date} [props.expirationTime]\n * @param {Key} [props.adminKey]\n * @param {AccountId | string} [props.proxyAccountId]\n * @param {Duration | Long | number} [props.autoRenewPeriod]\n * @param {string} [props.contractMemo]\n * @param {number} [props.maxAutomaticTokenAssociations]\n * @param {AccountId | string} [props.stakedAccountId]\n * @param {Long | number} [props.stakedNodeId]\n * @param {boolean} [props.declineStakingReward]\n * @param {AccountId} [props.autoRenewAccountId]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?ContractId}\n */\n this._contractId = null;\n\n /**\n * @private\n * @type {?Timestamp}\n */\n this._expirationTime = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._adminKey = null;\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._proxyAccountId = null;\n\n /**\n * @private\n * @type {?Duration}\n */\n this._autoRenewPeriod = null;\n\n /**\n * @private\n * @type {?FileId}\n */\n this._bytecodeFileId = null;\n\n /**\n * @private\n * @type {?string}\n */\n this._contractMemo = null;\n\n /**\n * @private\n * @type {?number}\n */\n this._maxAutomaticTokenAssociations = null;\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._stakedAccountId = null;\n\n /**\n * @private\n * @type {?Long}\n */\n this._stakedNodeId = null;\n\n /**\n * @private\n * @type {?boolean}\n */\n this._declineStakingReward = null;\n\n /**\n * @type {?AccountId}\n */\n this._autoRenewAccountId = null;\n\n if (props.contractId != null) {\n this.setContractId(props.contractId);\n }\n\n if (props.expirationTime != null) {\n this.setExpirationTime(props.expirationTime);\n }\n\n if (props.adminKey != null) {\n this.setAdminKey(props.adminKey);\n }\n\n if (props.proxyAccountId != null) {\n // eslint-disable-next-line deprecation/deprecation\n this.setProxyAccountId(props.proxyAccountId);\n }\n\n if (props.autoRenewPeriod != null) {\n this.setAutoRenewPeriod(props.autoRenewPeriod);\n }\n\n if (props.bytecodeFileId != null) {\n this.setBytecodeFileId(props.bytecodeFileId);\n }\n\n if (props.contractMemo != null) {\n this.setContractMemo(props.contractMemo);\n }\n\n if (props.maxAutomaticTokenAssociations != null) {\n this.setMaxAutomaticTokenAssociations(\n props.maxAutomaticTokenAssociations,\n );\n }\n\n if (props.stakedAccountId != null) {\n this.setStakedAccountId(props.stakedAccountId);\n }\n\n if (props.stakedNodeId != null) {\n this.setStakedNodeId(props.stakedNodeId);\n }\n\n if (props.declineStakingReward != null) {\n this.setDeclineStakingReward(props.declineStakingReward);\n }\n\n if (props.autoRenewAccountId != null) {\n this.setAutoRenewAccountId(props.autoRenewAccountId);\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 {ContractUpdateTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const update =\n /** @type {HieroProto.proto.IContractUpdateTransactionBody} */ (\n body.contractUpdateInstance\n );\n\n let autoRenewPeriod = undefined;\n if (\n update.autoRenewPeriod != null &&\n update.autoRenewPeriod.seconds != null\n ) {\n autoRenewPeriod = update.autoRenewPeriod.seconds;\n }\n\n let contractMemo = undefined;\n if (\n update.memoWrapper != null &&\n Object.hasOwn(update.memoWrapper, \"value\") &&\n update.memoWrapper.value != null\n ) {\n contractMemo = update.memoWrapper.value;\n }\n\n let maxAutomaticTokenAssociations = undefined;\n if (\n update.maxAutomaticTokenAssociations != null &&\n update.maxAutomaticTokenAssociations.value != null\n ) {\n maxAutomaticTokenAssociations =\n update.maxAutomaticTokenAssociations.value;\n }\n\n return Transaction._fromProtobufTransactions(\n new ContractUpdateTransaction({\n contractId:\n update.contractID != null\n ? ContractId._fromProtobuf(\n /** @type {HieroProto.proto.IContractID} */ (\n update.contractID\n ),\n )\n : undefined,\n bytecodeFileId:\n update.fileID != null\n ? FileId._fromProtobuf(\n /** @type {HieroProto.proto.IFileID} */ (\n update.fileID\n ),\n )\n : undefined,\n expirationTime:\n update.expirationTime != null\n ? Timestamp._fromProtobuf(update.expirationTime)\n : undefined,\n adminKey:\n update.adminKey != null\n ? Key._fromProtobufKey(update.adminKey)\n : undefined,\n proxyAccountId:\n update.proxyAccountID != null\n ? AccountId._fromProtobuf(\n /** @type {HieroProto.proto.IAccountID} */ (\n update.proxyAccountID\n ),\n )\n : undefined,\n autoRenewPeriod,\n contractMemo,\n maxAutomaticTokenAssociations,\n stakedAccountId:\n update.stakedAccountId != null\n ? AccountId._fromProtobuf(update.stakedAccountId)\n : undefined,\n stakedNodeId:\n update.stakedNodeId != null\n ? update.stakedNodeId\n : undefined,\n declineStakingReward:\n update.declineReward != null &&\n Boolean(update.declineReward) == true,\n autoRenewAccountId:\n update.autoRenewAccountId != null\n ? AccountId._fromProtobuf(update.autoRenewAccountId)\n : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?ContractId}\n */\n get contractId() {\n return this._contractId;\n }\n\n /**\n * Sets the contract ID which is being deleted in this transaction.\n *\n * @param {ContractId | string} contractId\n * @returns {ContractUpdateTransaction}\n */\n setContractId(contractId) {\n this._requireNotFrozen();\n this._contractId =\n typeof contractId === \"string\"\n ? ContractId.fromString(contractId)\n : contractId.clone();\n\n return this;\n }\n\n /**\n * @returns {?Timestamp}\n */\n get expirationTime() {\n return this._expirationTime;\n }\n\n /**\n * Sets the contract ID which is being deleted in this transaction.\n *\n * @param {Timestamp | Date} expirationTime\n * @returns {ContractUpdateTransaction}\n */\n setExpirationTime(expirationTime) {\n this._requireNotFrozen();\n this._expirationTime =\n expirationTime instanceof Timestamp\n ? expirationTime\n : Timestamp.fromDate(expirationTime);\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get adminKey() {\n return this._adminKey;\n }\n\n /**\n * @param {Key} adminKey\n * @returns {this}\n */\n setAdminKey(adminKey) {\n this._requireNotFrozen();\n this._adminKey = adminKey;\n\n return this;\n }\n\n /**\n * @deprecated\n * @returns {?AccountId}\n */\n get proxyAccountId() {\n return this._proxyAccountId;\n }\n\n /**\n * @deprecated\n * @param {AccountId | string} proxyAccountId\n * @returns {this}\n */\n setProxyAccountId(proxyAccountId) {\n this._requireNotFrozen();\n this._proxyAccountId =\n typeof proxyAccountId === \"string\"\n ? AccountId.fromString(proxyAccountId)\n : proxyAccountId.clone();\n\n return this;\n }\n\n /**\n * @returns {?Duration}\n */\n get autoRenewPeriod() {\n return this._autoRenewPeriod;\n }\n\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 {?FileId}\n */\n get bytecodeFileId() {\n return this._bytecodeFileId;\n }\n\n /**\n * @param {FileId | string} bytecodeFileId\n * @returns {this}\n */\n setBytecodeFileId(bytecodeFileId) {\n console.warn(\"Deprecated: there is no replacement\");\n this._requireNotFrozen();\n this._bytecodeFileId =\n typeof bytecodeFileId === \"string\"\n ? FileId.fromString(bytecodeFileId)\n : bytecodeFileId.clone();\n\n return this;\n }\n\n /**\n * @returns {?string}\n */\n get contractMemo() {\n return this._contractMemo;\n }\n\n /**\n * @param {string} contractMemo\n * @returns {this}\n */\n setContractMemo(contractMemo) {\n this._requireNotFrozen();\n this._contractMemo = contractMemo;\n\n return this;\n }\n\n /**\n * @returns {this}\n */\n clearContractMemo() {\n this._requireNotFrozen();\n this._contractMemo = null;\n\n return this;\n }\n\n /**\n * @returns {number | null}\n */\n get maxAutomaticTokenAssociations() {\n return this._maxAutomaticTokenAssociations;\n }\n\n /**\n * @param {number} maxAutomaticTokenAssociations\n * @returns {this}\n */\n setMaxAutomaticTokenAssociations(maxAutomaticTokenAssociations) {\n this._requireNotFrozen();\n this._maxAutomaticTokenAssociations = maxAutomaticTokenAssociations;\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get stakedAccountId() {\n return this._stakedAccountId;\n }\n\n /**\n * @param {AccountId | string} stakedAccountId\n * @returns {this}\n */\n setStakedAccountId(stakedAccountId) {\n this._requireNotFrozen();\n this._stakedAccountId =\n typeof stakedAccountId === \"string\"\n ? AccountId.fromString(stakedAccountId)\n : stakedAccountId;\n\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get stakedNodeId() {\n return this._stakedNodeId;\n }\n\n /**\n * @param {Long | number} stakedNodeId\n * @returns {this}\n */\n setStakedNodeId(stakedNodeId) {\n this._requireNotFrozen();\n this._stakedNodeId = Long.fromValue(stakedNodeId);\n\n return this;\n }\n\n /**\n * @returns {?boolean}\n */\n get declineStakingRewards() {\n return this._declineStakingReward;\n }\n\n /**\n * @param {boolean} declineStakingReward\n * @returns {this}\n */\n setDeclineStakingReward(declineStakingReward) {\n this._requireNotFrozen();\n this._declineStakingReward = declineStakingReward;\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get autoRenewAccountId() {\n return this._autoRenewAccountId;\n }\n\n /**\n * If set to the sentinel <tt>0.0.0</tt> AccountID, this field removes the contract's auto-renew\n * account. Otherwise it updates the contract's auto-renew account to the referenced account.\n *\n * @param {string | AccountId} autoRenewAccountId\n * @returns {this}\n */\n setAutoRenewAccountId(autoRenewAccountId) {\n this._requireNotFrozen();\n this._autoRenewAccountId =\n typeof autoRenewAccountId === \"string\"\n ? AccountId.fromString(autoRenewAccountId)\n : autoRenewAccountId;\n\n return this;\n }\n\n /**\n * @returns {this}\n */\n clearAutoRenewAccountId() {\n this._autoRenewAccountId = new AccountId(0);\n return this;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (this._contractId != null) {\n this._contractId.validateChecksum(client);\n }\n\n if (this._bytecodeFileId != null) {\n this._bytecodeFileId.validateChecksum(client);\n }\n\n if (this._proxyAccountId != null) {\n this._proxyAccountId.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.smartContract.updateContract(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"contractUpdateInstance\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.IContractUpdateTransactionBody}\n */\n _makeTransactionData() {\n return {\n contractID:\n this._contractId != null\n ? this._contractId._toProtobuf()\n : null,\n expirationTime:\n this._expirationTime != null\n ? this._expirationTime._toProtobuf()\n : null,\n adminKey:\n this._adminKey != null ? this._adminKey._toProtobufKey() : null,\n proxyAccountID:\n this._proxyAccountId != null\n ? this._proxyAccountId._toProtobuf()\n : null,\n autoRenewPeriod:\n this._autoRenewPeriod != null\n ? this._autoRenewPeriod._toProtobuf()\n : null,\n fileID: this._bytecodeFileId\n ? this._bytecodeFileId._toProtobuf()\n : null,\n memoWrapper:\n this._contractMemo != null\n ? {\n value: this._contractMemo,\n }\n : null,\n maxAutomaticTokenAssociations:\n this._maxAutomaticTokenAssociations != null\n ? {\n value: this._maxAutomaticTokenAssociations,\n }\n : null,\n stakedAccountId:\n this.stakedAccountId != null\n ? this.stakedAccountId._toProtobuf()\n : null,\n stakedNodeId: this.stakedNodeId,\n declineReward:\n this.declineStakingRewards != null\n ? { value: this.declineStakingRewards }\n : null,\n autoRenewAccountId:\n this._autoRenewAccountId != null\n ? this._autoRenewAccountId.toString() == \"0.0.0\"\n ? Proto.proto.AccountID.create()\n : this._autoRenewAccountId._toProtobuf()\n : 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 `ContractUpdateTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"contractUpdateInstance\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n ContractUpdateTransaction._fromProtobuf,\n);\n"],"names":["ContractUpdateTransaction","Transaction","constructor","props","super","this","_contractId","_expirationTime","_adminKey","_proxyAccountId","_autoRenewPeriod","_bytecodeFileId","_contractMemo","_maxAutomaticTokenAssociations","_stakedAccountId","_stakedNodeId","_declineStakingReward","_autoRenewAccountId","contractId","setContractId","expirationTime","setExpirationTime","adminKey","setAdminKey","proxyAccountId","setProxyAccountId","autoRenewPeriod","setAutoRenewPeriod","bytecodeFileId","setBytecodeFileId","contractMemo","setContractMemo","maxAutomaticTokenAssociations","setMaxAutomaticTokenAssociations","stakedAccountId","setStakedAccountId","stakedNodeId","setStakedNodeId","declineStakingReward","setDeclineStakingReward","autoRenewAccountId","setAutoRenewAccountId","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","update","seconds","memoWrapper","Object","hasOwn","value","_fromProtobufTransactions","contractID","ContractId","undefined","fileID","FileId","Timestamp","Key","_fromProtobufKey","proxyAccountID","AccountId","declineReward","Boolean","_requireNotFrozen","fromString","clone","fromDate","Duration","console","warn","clearContractMemo","Long","fromValue","declineStakingRewards","clearAutoRenewAccountId","_validateChecksums","client","validateChecksum","_execute","channel","request","smartContract","updateContract","_getTransactionDataCase","_makeTransactionData","_toProtobuf","_toProtobufKey","toString","Proto","proto","AccountID","create","_getLogId","_transactionIds","current","TRANSACTION_REGISTRY","set"],"mappings":"+TAyCe,MAAMA,UAAkCC,EAgBnD,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,YAAc,KAMnBD,KAAKE,gBAAkB,KAMvBF,KAAKG,UAAY,KAMjBH,KAAKI,gBAAkB,KAMvBJ,KAAKK,iBAAmB,KAMxBL,KAAKM,gBAAkB,KAMvBN,KAAKO,cAAgB,KAMrBP,KAAKQ,+BAAiC,KAMtCR,KAAKS,iBAAmB,KAMxBT,KAAKU,cAAgB,KAMrBV,KAAKW,sBAAwB,KAK7BX,KAAKY,oBAAsB,KAEH,MAApBd,EAAMe,YACNb,KAAKc,cAAchB,EAAMe,YAGD,MAAxBf,EAAMiB,gBACNf,KAAKgB,kBAAkBlB,EAAMiB,gBAGX,MAAlBjB,EAAMmB,UACNjB,KAAKkB,YAAYpB,EAAMmB,UAGC,MAAxBnB,EAAMqB,gBAENnB,KAAKoB,kBAAkBtB,EAAMqB,gBAGJ,MAAzBrB,EAAMuB,iBACNrB,KAAKsB,mBAAmBxB,EAAMuB,iBAGN,MAAxBvB,EAAMyB,gBACNvB,KAAKwB,kBAAkB1B,EAAMyB,gBAGP,MAAtBzB,EAAM2B,cACN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AOD,EAAQE,cAAcC,eAAeF,EACpD,CAOI,uBAAAG,GACI,MAAO,wBACf,CAOI,oBAAAC,GACI,MAAO,CACHjC,WACwB,MAApBlD,KAAKC,YACCD,KAAKC,YAAYmF,cACjB,KACVrE,eAC4B,MAAxBf,KAAKE,gBACCF,KAAKE,gBAAgBkF,cACrB,KACVnE,SACsB,MAAlBjB,KAAKG,UAAoBH,KAAKG,UAAUkF,iBAAmB,KAC/D3B,eAC4B,MAAxB1D,KAAKI,gBACCJ,KAAKI,gBAAgBgF,cACrB,KACV/D,gBAC6B,MAAzBrB,KAAKK,iBACCL,KAAKK,iBAAiB+E,cACtB,KACV/B,OAAQrD,KAAKM,gBACPN,KAAKM,gBAAgB8E,cACrB,KACNvC,YAC0B,MAAtB7C,KAAKO,cACC,CACIyC,MAAOhD,KAAKO,eAEhB,KACVoB,8BAC2C,MAAvC3B,KAAKQ,+BACC,CACIwC,MAAOhD,KAAKQ,gCAEhB,KACVqB,gBAC4B,MAAxB7B,KAAK6B,gBACC7B,KAAK6B,gBAAgBuD,cACrB,KACVrD,aAAc/B,KAAK+B,aACnB6B,cACkC,MAA9B5D,KAAKwE,sBACC,CAAExB,MAAOhD,KAAKwE,uBACd,KACVrC,mBACgC,MAA5BnC,KAAKY,oBACwC,SAAvCZ,KAAKY,oBAAoB0E,WACrBC,EAAMC,MAAMC,UAAUC,SACtB1F,KAAKY,oBAAoBwE,cAC7B,KAEtB,CAKI,SAAAO,GAII,MAAO,6BAFH3F,KAAK4F,gBAAgBC,QACxB,WAC6CP,YACtD,EAGAQ,EAAqBC,IACjB,yBAEApG,EAA0B0C"}
|
|
1
|
+
{"version":3,"file":"ContractUpdateTransaction.js","sources":["../../src/contract/ContractUpdateTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport AccountId from \"../account/AccountId.js\";\nimport ContractId from \"./ContractId.js\";\nimport FileId from \"../file/FileId.js\";\nimport Transaction, {\n TRANSACTION_REGISTRY,\n} from \"../transaction/Transaction.js\";\nimport Duration from \"../Duration.js\";\nimport Timestamp from \"../Timestamp.js\";\nimport Key from \"../Key.js\";\nimport Long from \"long\";\nimport * as Proto from \"@hiero-ledger/proto\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransaction} HieroProto.proto.ITransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n * @typedef {import(\"@hiero-ledger/proto\").proto.IContractUpdateTransactionBody} HieroProto.proto.IContractUpdateTransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.IAccountID} HieroProto.proto.IAccountID\n * @typedef {import(\"@hiero-ledger/proto\").proto.IContractID} HieroProto.proto.IContractID\n * @typedef {import(\"@hiero-ledger/proto\").proto.IFileID} HieroProto.proto.IFileID\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 * Modify a smart contract.<br/>\n * Any change other than updating the expiration time requires that the\n * contract be modifiable (has a valid `adminKey`) and that the\n * transaction be signed by the `adminKey`\n * <p>\n * Fields _not set_ on the request SHALL NOT be modified.\n */\nexport default class ContractUpdateTransaction extends Transaction {\n /**\n * @param {object} props\n * @param {ContractId | string} [props.contractId]\n * @param {FileId | string} [props.bytecodeFileId]\n * @param {Timestamp | Date} [props.expirationTime]\n * @param {Key} [props.adminKey]\n * @param {AccountId | string} [props.proxyAccountId]\n * @param {Duration | Long | number} [props.autoRenewPeriod]\n * @param {string} [props.contractMemo]\n * @param {number} [props.maxAutomaticTokenAssociations]\n * @param {AccountId | string} [props.stakedAccountId]\n * @param {Long | number} [props.stakedNodeId]\n * @param {boolean} [props.declineStakingReward]\n * @param {AccountId} [props.autoRenewAccountId]\n * @param {import(\"../hooks/HookCreationDetails.js\").default[]} [props.hooksToBeCreated]\n * @param {Long[]} [props.hooksToBeDeleted]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?ContractId}\n */\n this._contractId = null;\n\n /**\n * @private\n * @type {?Timestamp}\n */\n this._expirationTime = null;\n\n /**\n * @private\n * @type {?Key}\n */\n this._adminKey = null;\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._proxyAccountId = null;\n\n /**\n * @private\n * @type {?Duration}\n */\n this._autoRenewPeriod = null;\n\n /**\n * @private\n * @type {?FileId}\n */\n this._bytecodeFileId = null;\n\n /**\n * @private\n * @type {?string}\n */\n this._contractMemo = null;\n\n /**\n * @private\n * @type {?number}\n */\n this._maxAutomaticTokenAssociations = null;\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._stakedAccountId = null;\n\n /**\n * @private\n * @type {?Long}\n */\n this._stakedNodeId = null;\n\n /**\n * @private\n * @type {?boolean}\n */\n this._declineStakingReward = null;\n\n /**\n * @type {?AccountId}\n */\n this._autoRenewAccountId = null;\n\n /**\n * @private\n * @type {import(\"../hooks/HookCreationDetails.js\").default[]}\n */\n this._hooksToBeCreated = [];\n\n /**\n * @private\n * @type {Long[]}\n */\n this._hooksToBeDeleted = [];\n\n if (props.contractId != null) {\n this.setContractId(props.contractId);\n }\n\n if (props.expirationTime != null) {\n this.setExpirationTime(props.expirationTime);\n }\n\n if (props.adminKey != null) {\n this.setAdminKey(props.adminKey);\n }\n\n if (props.proxyAccountId != null) {\n // eslint-disable-next-line deprecation/deprecation\n this.setProxyAccountId(props.proxyAccountId);\n }\n\n if (props.autoRenewPeriod != null) {\n this.setAutoRenewPeriod(props.autoRenewPeriod);\n }\n\n if (props.bytecodeFileId != null) {\n this.setBytecodeFileId(props.bytecodeFileId);\n }\n\n if (props.contractMemo != null) {\n this.setContractMemo(props.contractMemo);\n }\n\n if (props.maxAutomaticTokenAssociations != null) {\n this.setMaxAutomaticTokenAssociations(\n props.maxAutomaticTokenAssociations,\n );\n }\n\n if (props.stakedAccountId != null) {\n this.setStakedAccountId(props.stakedAccountId);\n }\n\n if (props.stakedNodeId != null) {\n this.setStakedNodeId(props.stakedNodeId);\n }\n\n if (props.declineStakingReward != null) {\n this.setDeclineStakingReward(props.declineStakingReward);\n }\n\n if (props.autoRenewAccountId != null) {\n this.setAutoRenewAccountId(props.autoRenewAccountId);\n }\n\n if (props.hooksToBeCreated != null) {\n this.setHooksToCreate(props.hooksToBeCreated);\n }\n\n if (props.hooksToBeDeleted != null) {\n this.setHooksToDelete(props.hooksToBeDeleted);\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 {ContractUpdateTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const update =\n /** @type {HieroProto.proto.IContractUpdateTransactionBody} */ (\n body.contractUpdateInstance\n );\n\n let autoRenewPeriod = undefined;\n if (\n update.autoRenewPeriod != null &&\n update.autoRenewPeriod.seconds != null\n ) {\n autoRenewPeriod = update.autoRenewPeriod.seconds;\n }\n\n let contractMemo = undefined;\n if (\n update.memoWrapper != null &&\n Object.hasOwn(update.memoWrapper, \"value\") &&\n update.memoWrapper.value != null\n ) {\n contractMemo = update.memoWrapper.value;\n }\n\n let maxAutomaticTokenAssociations = undefined;\n if (\n update.maxAutomaticTokenAssociations != null &&\n update.maxAutomaticTokenAssociations.value != null\n ) {\n maxAutomaticTokenAssociations =\n update.maxAutomaticTokenAssociations.value;\n }\n\n return Transaction._fromProtobufTransactions(\n new ContractUpdateTransaction({\n contractId:\n update.contractID != null\n ? ContractId._fromProtobuf(\n /** @type {HieroProto.proto.IContractID} */ (\n update.contractID\n ),\n )\n : undefined,\n bytecodeFileId:\n update.fileID != null\n ? FileId._fromProtobuf(\n /** @type {HieroProto.proto.IFileID} */ (\n update.fileID\n ),\n )\n : undefined,\n expirationTime:\n update.expirationTime != null\n ? Timestamp._fromProtobuf(update.expirationTime)\n : undefined,\n adminKey:\n update.adminKey != null\n ? Key._fromProtobufKey(update.adminKey)\n : undefined,\n proxyAccountId:\n update.proxyAccountID != null\n ? AccountId._fromProtobuf(\n /** @type {HieroProto.proto.IAccountID} */ (\n update.proxyAccountID\n ),\n )\n : undefined,\n autoRenewPeriod,\n contractMemo,\n maxAutomaticTokenAssociations,\n stakedAccountId:\n update.stakedAccountId != null\n ? AccountId._fromProtobuf(update.stakedAccountId)\n : undefined,\n stakedNodeId:\n update.stakedNodeId != null\n ? update.stakedNodeId\n : undefined,\n declineStakingReward:\n update.declineReward != null &&\n Boolean(update.declineReward) == true,\n autoRenewAccountId:\n update.autoRenewAccountId != null\n ? AccountId._fromProtobuf(update.autoRenewAccountId)\n : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?ContractId}\n */\n get contractId() {\n return this._contractId;\n }\n\n /**\n * Sets the contract ID which is being deleted in this transaction.\n *\n * @param {ContractId | string} contractId\n * @returns {ContractUpdateTransaction}\n */\n setContractId(contractId) {\n this._requireNotFrozen();\n this._contractId =\n typeof contractId === \"string\"\n ? ContractId.fromString(contractId)\n : contractId.clone();\n\n return this;\n }\n\n /**\n * @returns {?Timestamp}\n */\n get expirationTime() {\n return this._expirationTime;\n }\n\n /**\n * Sets the contract ID which is being deleted in this transaction.\n *\n * @param {Timestamp | Date} expirationTime\n * @returns {ContractUpdateTransaction}\n */\n setExpirationTime(expirationTime) {\n this._requireNotFrozen();\n this._expirationTime =\n expirationTime instanceof Timestamp\n ? expirationTime\n : Timestamp.fromDate(expirationTime);\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get adminKey() {\n return this._adminKey;\n }\n\n /**\n * @param {Key} adminKey\n * @returns {this}\n */\n setAdminKey(adminKey) {\n this._requireNotFrozen();\n this._adminKey = adminKey;\n\n return this;\n }\n\n /**\n * @deprecated\n * @returns {?AccountId}\n */\n get proxyAccountId() {\n return this._proxyAccountId;\n }\n\n /**\n * @deprecated\n * @param {AccountId | string} proxyAccountId\n * @returns {this}\n */\n setProxyAccountId(proxyAccountId) {\n this._requireNotFrozen();\n this._proxyAccountId =\n typeof proxyAccountId === \"string\"\n ? AccountId.fromString(proxyAccountId)\n : proxyAccountId.clone();\n\n return this;\n }\n\n /**\n * @returns {?Duration}\n */\n get autoRenewPeriod() {\n return this._autoRenewPeriod;\n }\n\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 {?FileId}\n */\n get bytecodeFileId() {\n return this._bytecodeFileId;\n }\n\n /**\n * @param {FileId | string} bytecodeFileId\n * @returns {this}\n */\n setBytecodeFileId(bytecodeFileId) {\n console.warn(\"Deprecated: there is no replacement\");\n this._requireNotFrozen();\n this._bytecodeFileId =\n typeof bytecodeFileId === \"string\"\n ? FileId.fromString(bytecodeFileId)\n : bytecodeFileId.clone();\n\n return this;\n }\n\n /**\n * @returns {?string}\n */\n get contractMemo() {\n return this._contractMemo;\n }\n\n /**\n * @param {string} contractMemo\n * @returns {this}\n */\n setContractMemo(contractMemo) {\n this._requireNotFrozen();\n this._contractMemo = contractMemo;\n\n return this;\n }\n\n /**\n * @returns {this}\n */\n clearContractMemo() {\n this._requireNotFrozen();\n this._contractMemo = null;\n\n return this;\n }\n\n /**\n * @returns {number | null}\n */\n get maxAutomaticTokenAssociations() {\n return this._maxAutomaticTokenAssociations;\n }\n\n /**\n * @param {number} maxAutomaticTokenAssociations\n * @returns {this}\n */\n setMaxAutomaticTokenAssociations(maxAutomaticTokenAssociations) {\n this._requireNotFrozen();\n this._maxAutomaticTokenAssociations = maxAutomaticTokenAssociations;\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get stakedAccountId() {\n return this._stakedAccountId;\n }\n\n /**\n * @param {AccountId | string} stakedAccountId\n * @returns {this}\n */\n setStakedAccountId(stakedAccountId) {\n this._requireNotFrozen();\n this._stakedAccountId =\n typeof stakedAccountId === \"string\"\n ? AccountId.fromString(stakedAccountId)\n : stakedAccountId;\n\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get stakedNodeId() {\n return this._stakedNodeId;\n }\n\n /**\n * @param {Long | number} stakedNodeId\n * @returns {this}\n */\n setStakedNodeId(stakedNodeId) {\n this._requireNotFrozen();\n this._stakedNodeId = Long.fromValue(stakedNodeId);\n\n return this;\n }\n\n /**\n * @returns {?boolean}\n */\n get declineStakingRewards() {\n return this._declineStakingReward;\n }\n\n /**\n * @param {boolean} declineStakingReward\n * @returns {this}\n */\n setDeclineStakingReward(declineStakingReward) {\n this._requireNotFrozen();\n this._declineStakingReward = declineStakingReward;\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get autoRenewAccountId() {\n return this._autoRenewAccountId;\n }\n\n /**\n * If set to the sentinel <tt>0.0.0</tt> AccountID, this field removes the contract's auto-renew\n * account. Otherwise it updates the contract's auto-renew account to the referenced account.\n *\n * @param {string | AccountId} autoRenewAccountId\n * @returns {this}\n */\n setAutoRenewAccountId(autoRenewAccountId) {\n this._requireNotFrozen();\n this._autoRenewAccountId =\n typeof autoRenewAccountId === \"string\"\n ? AccountId.fromString(autoRenewAccountId)\n : autoRenewAccountId;\n\n return this;\n }\n\n /**\n * @returns {this}\n */\n clearAutoRenewAccountId() {\n this._autoRenewAccountId = new AccountId(0);\n return this;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (this._contractId != null) {\n this._contractId.validateChecksum(client);\n }\n\n if (this._bytecodeFileId != null) {\n this._bytecodeFileId.validateChecksum(client);\n }\n\n if (this._proxyAccountId != null) {\n this._proxyAccountId.validateChecksum(client);\n }\n }\n\n /**\n * @param {import(\"../hooks/HookCreationDetails.js\").default} hook\n * @returns {this}\n */\n addHookToCreate(hook) {\n this._hooksToBeCreated.push(hook);\n return this;\n }\n\n /**\n * @param {import(\"../hooks/HookCreationDetails.js\").default[]} hooks\n * @returns {this}\n */\n setHooksToCreate(hooks) {\n this._hooksToBeCreated = hooks;\n return this;\n }\n\n /**\n * @returns {import(\"../hooks/HookCreationDetails.js\").default[]}\n */\n get hooksToCreate() {\n return this._hooksToBeCreated;\n }\n\n /**\n *\n * @param {Long} hook\n * @returns {this}\n */\n addHookToDelete(hook) {\n this._hooksToBeDeleted.push(hook);\n return this;\n }\n\n /**\n * @param {Long[]} hookIds\n * @returns {this}\n */\n setHooksToDelete(hookIds) {\n this._hooksToBeDeleted = hookIds;\n return this;\n }\n\n /**\n * @returns {Long[]}\n */\n get hooksToDelete() {\n return this._hooksToBeDeleted;\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.smartContract.updateContract(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"contractUpdateInstance\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.IContractUpdateTransactionBody}\n */\n _makeTransactionData() {\n return {\n contractID:\n this._contractId != null\n ? this._contractId._toProtobuf()\n : null,\n expirationTime:\n this._expirationTime != null\n ? this._expirationTime._toProtobuf()\n : null,\n adminKey:\n this._adminKey != null ? this._adminKey._toProtobufKey() : null,\n proxyAccountID:\n this._proxyAccountId != null\n ? this._proxyAccountId._toProtobuf()\n : null,\n autoRenewPeriod:\n this._autoRenewPeriod != null\n ? this._autoRenewPeriod._toProtobuf()\n : null,\n fileID: this._bytecodeFileId\n ? this._bytecodeFileId._toProtobuf()\n : null,\n memoWrapper:\n this._contractMemo != null\n ? {\n value: this._contractMemo,\n }\n : null,\n maxAutomaticTokenAssociations:\n this._maxAutomaticTokenAssociations != null\n ? {\n value: this._maxAutomaticTokenAssociations,\n }\n : null,\n stakedAccountId:\n this.stakedAccountId != null\n ? this.stakedAccountId._toProtobuf()\n : null,\n stakedNodeId: this.stakedNodeId,\n declineReward:\n this.declineStakingRewards != null\n ? { value: this.declineStakingRewards }\n : null,\n autoRenewAccountId:\n this._autoRenewAccountId != null\n ? this._autoRenewAccountId.toString() == \"0.0.0\"\n ? Proto.proto.AccountID.create()\n : this._autoRenewAccountId._toProtobuf()\n : null,\n\n hookIdsToDelete:\n this._hooksToBeDeleted != null ? this._hooksToBeDeleted : null,\n hookCreationDetails:\n this._hooksToBeCreated != null\n ? this._hooksToBeCreated.map((hook) => hook._toProtobuf())\n : 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 `ContractUpdateTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"contractUpdateInstance\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n ContractUpdateTransaction._fromProtobuf,\n);\n"],"names":["ContractUpdateTransaction","Transaction","constructor","props","super","this","_contractId","_expirationTime","_adminKey","_proxyAccountId","_autoRenewPeriod","_bytecodeFileId","_contractMemo","_maxAutomaticTokenAssociations","_stakedAccountId","_stakedNodeId","_declineStakingReward","_autoRenewAccountId","_hooksToBeCreated","_hooksToBeDeleted","contractId","setContractId","expirationTime","setExpirationTime","adminKey","setAdminKey","proxyAccountId","setProxyAccountId","autoRenewPeriod","setAutoRenewPeriod","bytecodeFileId","setBytecodeFileId","contractMemo","setContractMemo","maxAutomaticTokenAssociations","setMaxAutomaticTokenAssociations","stakedAccountId","setStakedAccountId","stakedNodeId","setStakedNodeId","declineStakingReward","setDeclineStakingReward","autoRenewAccountId","setAutoRenewAccountId","hooksToBeCreated","setHooksToCreate","hooksToBeDeleted","setHooksToDelete","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","update","seconds","memoWrapper","Object","hasOwn","value","_fromProtobufTransactions","contractID","ContractId","undefined","fileID","FileId","Timestamp","Key","_fromProtobufKey","proxyAccountID","AccountId","declineReward","Boolean","_requireNotFrozen","fromString","clone","fromDate","Duration","console","warn","clearContractMemo","Long","fromValue","declineStakingRewards","clearAutoRenewAccountId","_validateChecksums","client","validateChecksum","addHookToCreate","hook","push","hooks","hooksToCreate","addHookToDelete","hookIds","hooksToDelete","_execute","channel","request","smartContract","updateContract","_getTransactionDataCase","_makeTransactionData","_toProtobuf","_toProtobufKey","toString","Proto","proto","AccountID","create","hookIdsToDelete","hookCreationDetails","map","_getLogId","_transactionIds","current","TRANSACTION_REGISTRY","set"],"mappings":"+TAyCe,MAAMA,UAAkCC,EAkBnD,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,YAAc,KAMnBD,KAAKE,gBAAkB,KAMvBF,KAAKG,UAAY,KAMjBH,KAAKI,gBAAkB,KAMvBJ,KAAKK,iBAAmB,KAMxBL,KAAKM,gBAAkB,KAMvBN,KAAKO,cAAgB,KAMrBP,KAAKQ,+BAAiC,KAMtCR,KAAKS,iBAAmB,KAMxBT,KAAKU,cAAgB,KAMrBV,KAAKW,sBAAwB,KAK7BX,KAAKY,oBAAsB,KAM3BZ,KAAKa,kBAAoB,GAMzBb,KAAKc,kBAAoB,GAED,MAApBhB,EAAMiB,YACNf,KAAKgB,cAAclB,EAAMiB,YAGD,MAAxBjB,EAAMmB,gBACNjB,KAAKkB,kBAAkBpB,EAAMmB,gBAGX,MAAlBnB,EAAMqB,UACNnB,KAAKoB,YAAYtB,EAAMqB,UAGC,MAAxBrB,EA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VsB,8BAC2C,MAAvC7B,KAAKQ,+BACC,CACI8C,MAAOtD,KAAKQ,gCAEhB,KACVuB,gBAC4B,MAAxB/B,KAAK+B,gBACC/B,KAAK+B,gBAAgBmE,cACrB,KACVjE,aAAcjC,KAAKiC,aACnBiC,cACkC,MAA9BlE,KAAK8E,sBACC,CAAExB,MAAOtD,KAAK8E,uBACd,KACVzC,mBACgC,MAA5BrC,KAAKY,oBACwC,SAAvCZ,KAAKY,oBAAoBwF,WACrBC,EAAMC,MAAMC,UAAUC,SACtBxG,KAAKY,oBAAoBsF,cAC7B,KAEVO,gBAC8B,MAA1BzG,KAAKc,kBAA4Bd,KAAKc,kBAAoB,KAC9D4F,oBAC8B,MAA1B1G,KAAKa,kBACCb,KAAKa,kBAAkB8F,IAAKvB,GAASA,EAAKc,eAC1C,KAEtB,CAKI,SAAAU,GAII,MAAO,6BAFH5G,KAAK6G,gBAAgBC,QACxB,WAC6CV,YACtD,EAGAW,EAAqBC,IACjB,yBAEArH,EAA0BgD"}
|
package/lib/exports.cjs
CHANGED
|
@@ -292,6 +292,42 @@ Object.defineProperty(exports, "EvmAddress", {
|
|
|
292
292
|
return _EvmAddress.default;
|
|
293
293
|
}
|
|
294
294
|
});
|
|
295
|
+
Object.defineProperty(exports, "EvmHook", {
|
|
296
|
+
enumerable: true,
|
|
297
|
+
get: function () {
|
|
298
|
+
return _EvmHook.default;
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
Object.defineProperty(exports, "EvmHookCall", {
|
|
302
|
+
enumerable: true,
|
|
303
|
+
get: function () {
|
|
304
|
+
return _EvmHookCall.default;
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
Object.defineProperty(exports, "EvmHookMappingEntries", {
|
|
308
|
+
enumerable: true,
|
|
309
|
+
get: function () {
|
|
310
|
+
return _EvmHookStorageUpdate.EvmHookMappingEntries;
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
Object.defineProperty(exports, "EvmHookMappingEntry", {
|
|
314
|
+
enumerable: true,
|
|
315
|
+
get: function () {
|
|
316
|
+
return _EvmHookMappingEntry.default;
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
Object.defineProperty(exports, "EvmHookStorageSlot", {
|
|
320
|
+
enumerable: true,
|
|
321
|
+
get: function () {
|
|
322
|
+
return _EvmHookStorageUpdate.EvmHookStorageSlot;
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
Object.defineProperty(exports, "EvmHookStorageUpdate", {
|
|
326
|
+
enumerable: true,
|
|
327
|
+
get: function () {
|
|
328
|
+
return _EvmHookStorageUpdate.EvmHookStorageUpdate;
|
|
329
|
+
}
|
|
330
|
+
});
|
|
295
331
|
Object.defineProperty(exports, "ExchangeRate", {
|
|
296
332
|
enumerable: true,
|
|
297
333
|
get: function () {
|
|
@@ -406,6 +442,18 @@ Object.defineProperty(exports, "FreezeType", {
|
|
|
406
442
|
return _FreezeType.default;
|
|
407
443
|
}
|
|
408
444
|
});
|
|
445
|
+
Object.defineProperty(exports, "FungibleHookCall", {
|
|
446
|
+
enumerable: true,
|
|
447
|
+
get: function () {
|
|
448
|
+
return _FungibleHookCall.default;
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
Object.defineProperty(exports, "FungibleHookType", {
|
|
452
|
+
enumerable: true,
|
|
453
|
+
get: function () {
|
|
454
|
+
return _FungibleHookType.default;
|
|
455
|
+
}
|
|
456
|
+
});
|
|
409
457
|
Object.defineProperty(exports, "HEDERA_PATH", {
|
|
410
458
|
enumerable: true,
|
|
411
459
|
get: function () {
|
|
@@ -430,6 +478,36 @@ Object.defineProperty(exports, "HbarUnit", {
|
|
|
430
478
|
return _HbarUnit.default;
|
|
431
479
|
}
|
|
432
480
|
});
|
|
481
|
+
Object.defineProperty(exports, "HookCreationDetails", {
|
|
482
|
+
enumerable: true,
|
|
483
|
+
get: function () {
|
|
484
|
+
return _HookCreationDetails.default;
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
Object.defineProperty(exports, "HookEntityId", {
|
|
488
|
+
enumerable: true,
|
|
489
|
+
get: function () {
|
|
490
|
+
return _HookEntityId.default;
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
Object.defineProperty(exports, "HookExtensionPoint", {
|
|
494
|
+
enumerable: true,
|
|
495
|
+
get: function () {
|
|
496
|
+
return _HookExtensionPoint.HookExtensionPoint;
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
Object.defineProperty(exports, "HookId", {
|
|
500
|
+
enumerable: true,
|
|
501
|
+
get: function () {
|
|
502
|
+
return _HookId.default;
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
Object.defineProperty(exports, "HookStoreTransaction", {
|
|
506
|
+
enumerable: true,
|
|
507
|
+
get: function () {
|
|
508
|
+
return _HookStoreTransaction.default;
|
|
509
|
+
}
|
|
510
|
+
});
|
|
433
511
|
Object.defineProperty(exports, "Key", {
|
|
434
512
|
enumerable: true,
|
|
435
513
|
get: function () {
|
|
@@ -533,6 +611,18 @@ Object.defineProperty(exports, "NetworkVersionInfoQuery", {
|
|
|
533
611
|
return _NetworkVersionInfoQuery.default;
|
|
534
612
|
}
|
|
535
613
|
});
|
|
614
|
+
Object.defineProperty(exports, "NftHookCall", {
|
|
615
|
+
enumerable: true,
|
|
616
|
+
get: function () {
|
|
617
|
+
return _NftHookCall.default;
|
|
618
|
+
}
|
|
619
|
+
});
|
|
620
|
+
Object.defineProperty(exports, "NftHookType", {
|
|
621
|
+
enumerable: true,
|
|
622
|
+
get: function () {
|
|
623
|
+
return _NftHookType.default;
|
|
624
|
+
}
|
|
625
|
+
});
|
|
536
626
|
Object.defineProperty(exports, "NftId", {
|
|
537
627
|
enumerable: true,
|
|
538
628
|
get: function () {
|
|
@@ -1120,6 +1210,19 @@ var _FeeDataType = _interopRequireDefault(require("./FeeDataType.cjs"));
|
|
|
1120
1210
|
var _FeeSchedule = _interopRequireDefault(require("./FeeSchedule.cjs"));
|
|
1121
1211
|
var _FeeSchedules = _interopRequireDefault(require("./FeeSchedules.cjs"));
|
|
1122
1212
|
var _FileAppendTransaction = _interopRequireDefault(require("./file/FileAppendTransaction.cjs"));
|
|
1213
|
+
var _HookCreationDetails = _interopRequireDefault(require("./hooks/HookCreationDetails.cjs"));
|
|
1214
|
+
var _EvmHook = _interopRequireDefault(require("./hooks/EvmHook.cjs"));
|
|
1215
|
+
var _HookExtensionPoint = require("./hooks/HookExtensionPoint.cjs");
|
|
1216
|
+
var _FungibleHookCall = _interopRequireDefault(require("./hooks/FungibleHookCall.cjs"));
|
|
1217
|
+
var _NftHookCall = _interopRequireDefault(require("./hooks/NftHookCall.cjs"));
|
|
1218
|
+
var _EvmHookCall = _interopRequireDefault(require("./hooks/EvmHookCall.cjs"));
|
|
1219
|
+
var _FungibleHookType = _interopRequireDefault(require("./hooks/FungibleHookType.cjs"));
|
|
1220
|
+
var _NftHookType = _interopRequireDefault(require("./hooks/NftHookType.cjs"));
|
|
1221
|
+
var _HookId = _interopRequireDefault(require("./hooks/HookId.cjs"));
|
|
1222
|
+
var _HookEntityId = _interopRequireDefault(require("./hooks/HookEntityId.cjs"));
|
|
1223
|
+
var _HookStoreTransaction = _interopRequireDefault(require("./hooks/HookStoreTransaction.cjs"));
|
|
1224
|
+
var _EvmHookStorageUpdate = require("./hooks/EvmHookStorageUpdate.cjs");
|
|
1225
|
+
var _EvmHookMappingEntry = _interopRequireDefault(require("./hooks/EvmHookMappingEntry.cjs"));
|
|
1123
1226
|
var _FileContentsQuery = _interopRequireDefault(require("./file/FileContentsQuery.cjs"));
|
|
1124
1227
|
var _FileCreateTransaction = _interopRequireDefault(require("./file/FileCreateTransaction.cjs"));
|
|
1125
1228
|
var _FileDeleteTransaction = _interopRequireDefault(require("./file/FileDeleteTransaction.cjs"));
|