@twin.org/move-to-json 0.0.3-next.9 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/cli.js +1 -1
- package/dist/es/cli.js.map +1 -1
- package/dist/es/commands/deploy.js +26 -3
- package/dist/es/commands/deploy.js.map +1 -1
- package/dist/es/index.js +1 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IContractConfig.js +4 -0
- package/dist/es/models/IContractConfig.js.map +1 -0
- package/dist/es/models/INetworkConfig.js.map +1 -1
- package/dist/locales/en.json +72 -8
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/IContractConfig.d.ts +19 -0
- package/dist/types/models/INetworkConfig.d.ts +2 -7
- package/docs/changelog.md +143 -0
- package/docs/reference/index.md +1 -0
- package/docs/reference/interfaces/IContractConfig.md +31 -0
- package/docs/reference/interfaces/INetworkConfig.md +1 -1
- package/package.json +15 -11
package/dist/es/cli.js
CHANGED
|
@@ -21,7 +21,7 @@ export class CLI extends CLIBase {
|
|
|
21
21
|
return this.execute({
|
|
22
22
|
title: "TWIN Move to JSON",
|
|
23
23
|
appName: "move-to-json",
|
|
24
|
-
version: "0.0
|
|
24
|
+
version: "0.9.0", // x-release-please-version
|
|
25
25
|
icon: "⚙️ ",
|
|
26
26
|
supportsEnvFiles: true,
|
|
27
27
|
overrideOutputWidth: options?.overrideOutputWidth
|
package/dist/es/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAA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,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { CLIBase } from \"@twin.org/cli-core\";\nimport type { Command } from \"commander\";\nimport { buildCommandBuild } from \"./commands/build.js\";\nimport { buildCommandDeploy } from \"./commands/deploy.js\";\n\n/**\n * The main entry point for the Move to JSON CLI.\n */\nexport class CLI extends CLIBase {\n\t/**\n\t * Run the app.\n\t * @param argv The process arguments.\n\t * @param localesDirectory The directory for the locales, default to relative to the script.\n\t * @param options Additional options.\n\t * @param options.overrideOutputWidth Override the output width.\n\t * @returns The exit code.\n\t */\n\tpublic async run(\n\t\targv: string[],\n\t\tlocalesDirectory?: string,\n\t\toptions?: {\n\t\t\toverrideOutputWidth?: number;\n\t\t}\n\t): Promise<number> {\n\t\treturn this.execute(\n\t\t\t{\n\t\t\t\ttitle: \"TWIN Move to JSON\",\n\t\t\t\tappName: \"move-to-json\",\n\t\t\t\tversion: \"0.9.0\", // x-release-please-version\n\t\t\t\ticon: \"⚙️ \",\n\t\t\t\tsupportsEnvFiles: true,\n\t\t\t\toverrideOutputWidth: options?.overrideOutputWidth\n\t\t\t},\n\t\t\tlocalesDirectory ?? path.join(path.dirname(fileURLToPath(import.meta.url)), \"../locales\"),\n\t\t\targv\n\t\t);\n\t}\n\n\t/**\n\t * Configure any options or actions at the root program level.\n\t * @param program The root program command.\n\t */\n\tprotected configureRoot(program: Command): void {\n\t\tbuildCommandBuild(program);\n\t\tbuildCommandDeploy(program);\n\t}\n}\n"]}
|
|
@@ -8,6 +8,9 @@ import { CLIDisplay, CLIParam, CLIUtils } from "@twin.org/cli-core";
|
|
|
8
8
|
import { Coerce, Converter, GeneralError, Guards, I18n, Is, RandomHelper } from "@twin.org/core";
|
|
9
9
|
import { Bip39, Bip44 } from "@twin.org/crypto";
|
|
10
10
|
import { Iota, NetworkTypes } from "@twin.org/dlt-iota";
|
|
11
|
+
import { MemoryEntityStorageConnector } from "@twin.org/entity-storage-connector-memory";
|
|
12
|
+
import { EntityStorageConnectorFactory } from "@twin.org/entity-storage-models";
|
|
13
|
+
import { EntityStorageVaultConnector, initSchema } from "@twin.org/vault-connector-entity-storage";
|
|
11
14
|
import { cleanBuildArtifactsInPath } from "../utils/buildArtifactUtils.js";
|
|
12
15
|
import { ensureEnvironment, execAsyncWithError } from "../utils/environmentUtils.js";
|
|
13
16
|
import { getDeploymentMnemonic, getDeploymentSeed, validateDeploymentEnvironment } from "../utils/envSetup.js";
|
|
@@ -674,6 +677,7 @@ async function deployContract(contractName, contractData, config, network, dryRu
|
|
|
674
677
|
* @returns The wallet address.
|
|
675
678
|
*/
|
|
676
679
|
async function getDeploymentWalletAddress(network, addressIndex, deployerMnemonic, deployerSeed) {
|
|
680
|
+
const vault = setupVault();
|
|
677
681
|
// Try to use seed first if available
|
|
678
682
|
const hexSeed = await getDeploymentSeed(network, deployerSeed);
|
|
679
683
|
let seed;
|
|
@@ -682,10 +686,29 @@ async function getDeploymentWalletAddress(network, addressIndex, deployerMnemoni
|
|
|
682
686
|
}
|
|
683
687
|
else {
|
|
684
688
|
const mnemonic = await getDeploymentMnemonic(network, deployerMnemonic);
|
|
689
|
+
await vault.setSecret("deployment/mnemonic", mnemonic);
|
|
685
690
|
seed = Bip39.mnemonicToSeed(mnemonic);
|
|
686
691
|
}
|
|
687
|
-
|
|
688
|
-
return
|
|
692
|
+
await vault.setSecret("deployment/seed", seed);
|
|
693
|
+
return Iota.getAddress(vault, {}, "deployment", 0, addressIndex);
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* Setup vault connectors for storing deployment keys and secrets.
|
|
697
|
+
* @returns An instance of IVaultConnector for use in deployment.
|
|
698
|
+
*/
|
|
699
|
+
function setupVault() {
|
|
700
|
+
initSchema();
|
|
701
|
+
const keyEntityStorage = new MemoryEntityStorageConnector({
|
|
702
|
+
entitySchema: "VaultKey",
|
|
703
|
+
config: { storageKey: "vault-key" }
|
|
704
|
+
});
|
|
705
|
+
const secretEntityStorage = new MemoryEntityStorageConnector({
|
|
706
|
+
entitySchema: "VaultSecret",
|
|
707
|
+
config: { storageKey: "vault-secret" }
|
|
708
|
+
});
|
|
709
|
+
EntityStorageConnectorFactory.register("vault-key", () => keyEntityStorage);
|
|
710
|
+
EntityStorageConnectorFactory.register("vault-secret", () => secretEntityStorage);
|
|
711
|
+
return new EntityStorageVaultConnector();
|
|
689
712
|
}
|
|
690
713
|
/**
|
|
691
714
|
* Convert nanos to IOTA (1 IOTA = 1,000,000,000 nanos).
|
|
@@ -883,7 +906,7 @@ export async function ensureCorrectDeployerKey(network, aliasName, expectedAddre
|
|
|
883
906
|
// Verify the address exists in client addresses
|
|
884
907
|
const { stdout: addressListOutput } = await execAsyncWithError("iota client addresses --json");
|
|
885
908
|
const addressInfo = JSON.parse(addressListOutput);
|
|
886
|
-
const addressExists = addressInfo.addresses.some(([
|
|
909
|
+
const addressExists = addressInfo.addresses.some(([a, addr]) => addr === expectedAddress);
|
|
887
910
|
if (!addressExists) {
|
|
888
911
|
throw new GeneralError("commands", "commands.deploy.addressNotInClient", {
|
|
889
912
|
expectedAddress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../src/commands/deploy.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE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Q,GAAG,MAAM,qBAAqB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IACxE,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;IAE7F,MAAM,kBAAkB,CACvB,wBAAwB,QAAQ,cAAc,cAAc,cAAc,SAAS,GAAG,CACtF,CAAC;IAEF,UAAU,CAAC,KAAK,CACf,IAAI,CAAC,aAAa,CAAC,4CAA4C,CAAC,EAChE,GAAG,SAAS,KAAK,aAAa,GAAG,EACjC,CAAC,CACD,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { promises as fsPromises } from \"node:fs\";\nimport path from \"node:path\";\nimport { IotaClient } from \"@iota/iota-sdk/client\";\nimport { requestIotaFromFaucetV0 } from \"@iota/iota-sdk/faucet\";\nimport { CLIDisplay, CLIParam, CLIUtils } from \"@twin.org/cli-core\";\nimport { Coerce, Converter, GeneralError, Guards, I18n, Is, RandomHelper } from \"@twin.org/core\";\nimport { Bip39, Bip44 } from \"@twin.org/crypto\";\nimport {\n\tIota,\n\tNetworkTypes,\n\ttype IContractData,\n\ttype ISmartContractDeployments\n} from \"@twin.org/dlt-iota\";\nimport { nameof } from \"@twin.org/nameof\";\nimport type { Command } from \"commander\";\nimport type { INetworkConfig } from \"../models/INetworkConfig.js\";\nimport { cleanBuildArtifactsInPath } from \"../utils/buildArtifactUtils.js\";\nimport { ensureEnvironment, execAsyncWithError } from \"../utils/environmentUtils.js\";\nimport {\n\tgetDeploymentMnemonic,\n\tgetDeploymentSeed,\n\tvalidateDeploymentEnvironment\n} from \"../utils/envSetup.js\";\nimport { verifyIotaSDK } from \"../utils/iotaUtils.js\";\nimport { searchDirectoryForMoveToml } from \"../utils/moveToJsonUtils.js\";\n\n/**\n * Build the deploy command.\n * @param program The command program.\n */\nexport function buildCommandDeploy(program: Command): void {\n\tprogram\n\t\t.command(\"deploy\")\n\t\t.description(I18n.formatMessage(\"commands.deploy.description\"))\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.contracts.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.contracts.description\"),\n\t\t\t\"smart-contract-deployments.json\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.network.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.network.description\"),\n\t\t\t\"!NETWORK\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.dryRun.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.dryRun.description\")\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.force.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.force.description\")\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.rpcUrl.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.rpcUrl.description\"),\n\t\t\t\"!RPC_URL\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.addressIndex.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.addressIndex.description\"),\n\t\t\t\"!ADDRESS_INDEX\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.rpcTimeout.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.rpcTimeout.description\"),\n\t\t\t\"!RPC_TIMEOUT\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.gasBudget.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.gasBudget.description\"),\n\t\t\t\"!GAS_BUDGET\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.confirmationTimeout.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.confirmationTimeout.description\"),\n\t\t\t\"!CONFIRMATION_TIMEOUT\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.faucetUrl.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.faucetUrl.description\"),\n\t\t\t\"!FAUCET_URL\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.deployerMnemonic.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.deployerMnemonic.description\"),\n\t\t\t\"!DEPLOYER_MNEMONIC\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.deployerSeed.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.deployerSeed.description\"),\n\t\t\t\"!DEPLOYER_SEED\"\n\t\t)\n\t\t.action(actionCommandDeploy);\n}\n\n/**\n * Action for the deploy command.\n * @param opts Command options.\n * @param opts.contracts Path to compiled modules JSON.\n * @param opts.network Network identifier - optional if NETWORK env var is set.\n * @param opts.dryRun Simulate deployment without executing.\n * @param opts.force Force redeployment of existing packages.\n * @param opts.rpcUrl RPC endpoint URL for the network.\n * @param opts.addressIndex Address index for key derivation.\n * @param opts.rpcTimeout RPC request timeout in milliseconds.\n * @param opts.gasBudget Gas budget for transactions.\n * @param opts.confirmationTimeout Transaction confirmation timeout in milliseconds.\n * @param opts.faucetUrl Faucet URL for requesting test tokens.\n * @param opts.deployerMnemonic Deployer wallet mnemonic phrase.\n * @param opts.deployerSeed Deployer wallet seed (alternative to mnemonic).\n */\nexport async function actionCommandDeploy(opts: {\n\tcontracts?: string;\n\tnetwork?: NetworkTypes;\n\tdryRun?: boolean;\n\tforce?: boolean;\n\trpcUrl?: string;\n\taddressIndex?: string;\n\trpcTimeout?: string;\n\tgasBudget?: string;\n\tconfirmationTimeout?: string;\n\tfaucetUrl?: string;\n\tdeployerMnemonic?: string;\n\tdeployerSeed?: string;\n}): Promise<void> {\n\tconst network = CLIParam.arrayOneOf<NetworkTypes>(\n\t\t\"network\",\n\t\topts.network,\n\t\tObject.values(NetworkTypes),\n\t\ttrue\n\t);\n\n\tconst contractsPath = opts.contracts ?? \"smart-contract-deployments.json\";\n\tconst dryRun = opts.dryRun ?? false;\n\tconst force = opts.force ?? false;\n\n\tCLIDisplay.section(I18n.formatMessage(\"commands.deploy.section.deployContracts\"));\n\tCLIDisplay.section(contractsPath);\n\n\t// Verify the IOTA SDK before we do anything else\n\tawait verifyIotaSDK();\n\n\t// Get configuration values needed for environment setup\n\tconst rpcUrl: string = CLIParam.stringValue(\"rpcUrl\", opts.rpcUrl);\n\tconst addressIndex = CLIParam.number(\"addressIndex\", opts.addressIndex) ?? 0;\n\tconst rpcTimeout = CLIParam.number(\"rpcTimeout\", opts.rpcTimeout);\n\tconst gasBudget = CLIParam.number(\"gasBudget\", opts.gasBudget);\n\tconst confirmationTimeout = CLIParam.number(\"confirmationTimeout\", opts.confirmationTimeout);\n\tconst faucetUrl: string | undefined =\n\t\tnetwork === NetworkTypes.Mainnet\n\t\t\t? undefined\n\t\t\t: CLIParam.stringValue(\"faucetUrl\", opts.faucetUrl);\n\n\tlet deployerMnemonic: string | undefined;\n\ttry {\n\t\tdeployerMnemonic = CLIParam.stringValue(\"deployerMnemonic\", opts.deployerMnemonic);\n\t} catch {\n\t\t// Optional parameter, can be undefined\n\t\tdeployerMnemonic = undefined;\n\t}\n\n\tlet deployerSeed: string | undefined;\n\ttry {\n\t\tdeployerSeed = CLIParam.stringValue(\"deployerSeed\", opts.deployerSeed);\n\t} catch {\n\t\t// Optional parameter, can be undefined\n\t\tdeployerSeed = undefined;\n\t}\n\n\t// Validate that at least one deployer credential is provided\n\tconst hasValidMnemonic = Is.stringValue(deployerMnemonic);\n\tconst hasValidSeed = Is.stringValue(deployerSeed);\n\n\tif (!hasValidMnemonic && !hasValidSeed) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.deployerCredentialRequired\", {\n\t\t\tnetwork\n\t\t});\n\t}\n\n\t// Check/switch to target network environment BEFORE loading config\n\tawait setIotaEnvironment(network, rpcUrl, addressIndex, dryRun, deployerMnemonic, deployerSeed);\n\n\tconst config = await createNetworkConfig(\n\t\tnetwork,\n\t\trpcUrl,\n\t\taddressIndex,\n\t\trpcTimeout,\n\t\tgasBudget,\n\t\tconfirmationTimeout\n\t);\n\tvalidateNetworkConfig(config, network);\n\n\tconst contractsData = await loadCompiledContracts(contractsPath);\n\n\tif (network === NetworkTypes.Mainnet) {\n\t\tconst validatedMnemonic = await getDeploymentMnemonic(\n\t\t\tnetwork,\n\t\t\thasValidMnemonic ? deployerMnemonic : undefined\n\t\t);\n\t\tawait validateDeploymentEnvironment(network, validatedMnemonic);\n\t}\n\n\tconst networkContracts = contractsData[network];\n\tif (!Is.object<IContractData>(networkContracts)) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.noContractsFound\", {\n\t\t\tnetwork,\n\t\t\tcontractsPath\n\t\t});\n\t}\n\n\tawait deployContract(\n\t\t\"contract\",\n\t\tnetworkContracts,\n\t\tconfig,\n\t\tnetwork,\n\t\tdryRun,\n\t\tforce,\n\t\tfaucetUrl,\n\t\tdeployerMnemonic,\n\t\tdeployerSeed\n\t);\n\n\tif (!dryRun) {\n\t\tawait updateContractsFile(contractsPath, contractsData);\n\t}\n\n\tCLIDisplay.done();\n}\n\n/**\n * Switch IOTA CLI to the target network environment and set the active address.\n * @param network Target network to switch to\n * @param rpcUrl The RPC URL for the network\n * @param addressIndex The address index to derive the target address\n * @param dryRun Whether this is a dry run (checks environment but doesn't switch)\n * @param deployerMnemonic The deployer mnemonic from environment variables.\n * @param deployerSeed The deployer seed from environment variables (optional).\n */\nasync function setIotaEnvironment(\n\tnetwork: NetworkTypes,\n\trpcUrl: string,\n\taddressIndex: number,\n\tdryRun: boolean = false,\n\tdeployerMnemonic?: string,\n\tdeployerSeed?: string\n): Promise<void> {\n\ttry {\n\t\tCLIDisplay.task(\n\t\t\tdryRun\n\t\t\t\t? I18n.formatMessage(\"commands.deploy.progress.checkingEnvironment\")\n\t\t\t\t: I18n.formatMessage(\"commands.deploy.progress.settingEnvironment\")\n\t\t);\n\n\t\t// Ensure environment exists, create if necessary\n\t\tGuards.stringValue(\"setIotaEnvironment\", nameof(rpcUrl), rpcUrl);\n\n\t\tawait ensureEnvironment(network, rpcUrl);\n\n\t\tif (dryRun) {\n\t\t\tCLIDisplay.value(\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.iotaEnvironmentCheck\"),\n\t\t\t\t`✅ ${network} environment exists`,\n\t\t\t\t1\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Derive the target address from existing mnemonic/seed\n\t\tconst targetAddress = await getDeploymentWalletAddress(\n\t\t\tnetwork,\n\t\t\taddressIndex,\n\t\t\tdeployerMnemonic,\n\t\t\tdeployerSeed\n\t\t);\n\n\t\t// Ensure the correct deployer key exists in the keystore\n\t\tconst aliasName = `deployer-${network}`;\n\t\tconst validatedMnemonic = await getDeploymentMnemonic(network, deployerMnemonic);\n\t\tawait ensureCorrectDeployerKey(\n\t\t\tnetwork,\n\t\t\taliasName,\n\t\t\ttargetAddress,\n\t\t\taddressIndex,\n\t\t\tvalidatedMnemonic\n\t\t);\n\n\t\t// Switch both environment and address in one command\n\t\tawait execAsyncWithError(`iota client switch --env ${network} --address ${targetAddress}`);\n\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.switchedIotaEnvironment\"),\n\t\t\tnetwork,\n\t\t\t1\n\t\t);\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.switchedActiveAddress\"),\n\t\t\ttargetAddress,\n\t\t\t1\n\t\t);\n\n\t\t// Verify the switch was successful\n\t\tconst { stdout: activeEnv } = await execAsyncWithError(\"iota client active-env\");\n\t\tif (!activeEnv.includes(network)) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.environmentSwitchFailed\", {\n\t\t\t\tnetwork,\n\t\t\t\tactiveEnv\n\t\t\t});\n\t\t}\n\n\t\t// Verify address switch was successful\n\t\tconst { stdout: activeAddressOutput } = await execAsyncWithError(\"iota client active-address\");\n\t\tconst activeAddress = activeAddressOutput.trim();\n\t\tif (activeAddress !== targetAddress) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.addressSwitchFailed\", {\n\t\t\t\tnetwork,\n\t\t\t\ttargetAddress,\n\t\t\t\tactiveAddress\n\t\t\t});\n\t\t}\n\t} catch (error) {\n\t\tthrow new GeneralError(\n\t\t\t\"commands\",\n\t\t\t\"commands.deploy.environmentOperationFailed\",\n\t\t\t{ network, operation: dryRun ? \"check\" : \"switch to\" },\n\t\t\terror\n\t\t);\n\t}\n}\n\n/**\n * Creates the network configuration.\n * @param network Target network to determine which env file to load.\n * @param rpcUrl The RPC URL for the network.\n * @param addressIndex The address index for the wallet.\n * @param rpcTimeout The RPC timeout in milliseconds.\n * @param gasBudget The gas budget for deployment.\n * @param confirmationTimeout The confirmation timeout in seconds.\n * @returns Network configuration.\n */\nasync function createNetworkConfig(\n\tnetwork: NetworkTypes,\n\trpcUrl: string,\n\taddressIndex: number,\n\trpcTimeout?: number,\n\tgasBudget?: number,\n\tconfirmationTimeout?: number\n): Promise<INetworkConfig> {\n\ttry {\n\t\tGuards.stringValue(\"createNetworkConfig\", nameof(rpcUrl), rpcUrl);\n\n\t\tconst config: INetworkConfig = {\n\t\t\tnetwork,\n\t\t\tplatform: \"iota\",\n\t\t\trpc: {\n\t\t\t\turl: rpcUrl,\n\t\t\t\ttimeout: rpcTimeout ?? 60000\n\t\t\t},\n\t\t\tdeployment: {\n\t\t\t\tgasBudget: gasBudget ?? 50000000,\n\t\t\t\tconfirmationTimeout: confirmationTimeout ?? 60,\n\t\t\t\twallet: {\n\t\t\t\t\taddressIndex\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\treturn config;\n\t} catch (err) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.networkConfigInvalid\", { network }, err);\n\t}\n}\n\n/**\n * Validate network configuration matches expected network.\n * @param config Network configuration.\n * @param expectedNetwork Expected network type.\n * @throws GeneralError if the network configuration is invalid.\n */\nfunction validateNetworkConfig(config: INetworkConfig, expectedNetwork: NetworkTypes): void {\n\tif (config.network !== expectedNetwork) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.networkMismatch\", {\n\t\t\texpected: expectedNetwork,\n\t\t\tactual: config.network,\n\t\t\thelp: `Configuration file specifies '${config.network}' but command targets '${expectedNetwork}'`\n\t\t});\n\t}\n\n\tif (!Is.stringValue(config.rpc?.url)) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.rpcUrlRequired\", {\n\t\t\tnetwork: expectedNetwork\n\t\t});\n\t}\n\n\tif (!Is.number(config.deployment?.gasBudget)) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.gasBudgetRequired\", {\n\t\t\tnetwork: expectedNetwork\n\t\t});\n\t}\n}\n\n/**\n * Load compiled contracts from file.\n * @param contractsPath Path to contracts file.\n * @returns Compiled contracts data.\n */\nasync function loadCompiledContracts(contractsPath: string): Promise<ISmartContractDeployments> {\n\ttry {\n\t\tif (!(await CLIUtils.fileExists(contractsPath))) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.contractsFileNotFound\", {\n\t\t\t\tcontractsPath\n\t\t\t});\n\t\t}\n\n\t\tconst contracts = await CLIUtils.readJsonFile<ISmartContractDeployments>(contractsPath);\n\n\t\tif (!Is.object(contracts)) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.invalidContractsFile\");\n\t\t}\n\n\t\treturn contracts;\n\t} catch (err) {\n\t\tthrow new GeneralError(\n\t\t\t\"commands\",\n\t\t\t\"commands.deploy.contractsLoadFailed\",\n\t\t\t{ contractsPath },\n\t\t\terr\n\t\t);\n\t}\n}\n\n/**\n * Validate environment and setup for deployment based on network type.\n * @param network Target network.\n * @param config Network configuration.\n * @param isDryRun Whether this is a dry run.\n * @param faucetUrl The faucet URL (optional, defaults to network-specific URL).\n * @param deployerMnemonic The deployer mnemonic for validation.\n * @param deployerSeed The deployer seed (optional).\n * @returns Wallet address for the deployment.\n */\nasync function validateEnvironmentForNetwork(\n\tnetwork: NetworkTypes,\n\tconfig: INetworkConfig,\n\tisDryRun: boolean = false,\n\tfaucetUrl?: string,\n\tdeployerMnemonic?: string,\n\tdeployerSeed?: string\n): Promise<string> {\n\tconst walletAddress = await getDeploymentWalletAddress(\n\t\tnetwork,\n\t\tconfig.deployment.wallet.addressIndex,\n\t\tdeployerMnemonic,\n\t\tdeployerSeed\n\t);\n\n\tif (isDryRun) {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.dryRunWalletAddress\"),\n\t\t\twalletAddress,\n\t\t\t1\n\t\t);\n\t} else {\n\t\tCLIDisplay.value(I18n.formatMessage(\"commands.deploy.labels.walletAddress\"), walletAddress, 1);\n\t}\n\n\tif (network === NetworkTypes.Mainnet) {\n\t\tconst validatedMnemonic = await getDeploymentMnemonic(network, deployerMnemonic);\n\t\tawait validateDeploymentEnvironment(network, validatedMnemonic);\n\t} else if ((network === NetworkTypes.Testnet || network === NetworkTypes.Devnet) && !isDryRun) {\n\t\t// For testnet/devnet, check balance first and only request funds if needed\n\t\tawait checkBalanceAndRequestFaucetIfNeeded(network, config, walletAddress, faucetUrl);\n\t}\n\n\treturn walletAddress;\n}\n\n/**\n * Check wallet balance and display relevant information.\n * @param network Target network.\n * @param config Network configuration.\n * @param walletAddress Wallet address.\n * @param isDryRun Whether this is a dry run.\n * @returns Balance in nanos.\n */\nasync function checkWalletBalance(\n\tnetwork: NetworkTypes,\n\tconfig: INetworkConfig,\n\twalletAddress: string,\n\tisDryRun: boolean = false\n): Promise<number> {\n\tconst client = new IotaClient({ url: config.rpc.url });\n\tconst balanceResponse = await client.getBalance({ owner: walletAddress });\n\tconst balanceInNanos = Number(balanceResponse.totalBalance);\n\tconst requiredInNanos = config.deployment.gasBudget;\n\n\tconst balanceInIota = nanosToIota(balanceInNanos);\n\tconst requiredInIota = nanosToIota(requiredInNanos);\n\n\tconst balanceLabel = isDryRun\n\t\t? \"commands.deploy.labels.dryRunWalletBalance\"\n\t\t: \"commands.deploy.labels.walletBalance\";\n\tconst gasBudgetLabel = isDryRun\n\t\t? \"commands.deploy.labels.dryRunGasBudget\"\n\t\t: \"commands.deploy.labels.gasBudget\";\n\n\tCLIDisplay.value(I18n.formatMessage(balanceLabel), `${balanceInIota.toFixed(2)} IOTA`, 1);\n\tCLIDisplay.value(I18n.formatMessage(gasBudgetLabel), `${requiredInIota.toFixed(2)} IOTA`, 1);\n\n\t// Handle insufficient balance based on network and run type (compare in same units - nanos)\n\tif (balanceInNanos < requiredInNanos) {\n\t\tif (isDryRun) {\n\t\t\tCLIDisplay.value(\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.warning\"),\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.insufficientBalanceWarning\", {\n\t\t\t\t\tcurrentBalance: balanceInIota.toFixed(2),\n\t\t\t\t\trequiredBalance: requiredInIota.toFixed(2)\n\t\t\t\t}),\n\t\t\t\t2\n\t\t\t);\n\t\t} else if (network === NetworkTypes.Mainnet) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.insufficientBalance\", {\n\t\t\t\tbalance: balanceInIota,\n\t\t\t\trequired: requiredInIota,\n\t\t\t\twalletAddress\n\t\t\t});\n\t\t} else {\n\t\t\t// For testnet/devnet, show warning but continue\n\t\t\tCLIDisplay.value(\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.warning\"),\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.insufficientBalanceAfterFaucet\", {\n\t\t\t\t\tnetwork,\n\t\t\t\t\tbalance: balanceInIota.toFixed(2),\n\t\t\t\t\trequired: requiredInIota.toFixed(2),\n\t\t\t\t\twalletAddress\n\t\t\t\t}),\n\t\t\t\t2\n\t\t\t);\n\t\t}\n\t}\n\n\treturn balanceInNanos;\n}\n\n/**\n * Handle dry run validation and display.\n * @param contractName Name of the contract.\n * @param contractData Contract data.\n * @param config Network configuration.\n * @param network Target network.\n * @param faucetUrl The faucet URL (optional, defaults to network-specific URL).\n * @param deployerMnemonic The deployer mnemonic from environment variables.\n * @param deployerSeed The deployer seed from environment variables (optional).\n */\nasync function handleDryRunValidation(\n\tcontractName: string,\n\tcontractData: IContractData,\n\tconfig: INetworkConfig,\n\tnetwork: NetworkTypes,\n\tfaucetUrl?: string,\n\tdeployerMnemonic?: string,\n\tdeployerSeed?: string\n): Promise<void> {\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.dryRunWouldDeploy\"),\n\t\t`${contractName} (${network})`,\n\t\t1\n\t);\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.dryRunPackageId\"),\n\t\tcontractData.packageId,\n\t\t1\n\t);\n\tCLIDisplay.value(I18n.formatMessage(\"commands.deploy.labels.dryRunRpcUrl\"), config.rpc.url, 1);\n\n\ttry {\n\t\tconst walletAddress = await validateEnvironmentForNetwork(\n\t\t\tnetwork,\n\t\t\tconfig,\n\t\t\ttrue,\n\t\t\tfaucetUrl,\n\t\t\tdeployerMnemonic,\n\t\t\tdeployerSeed\n\t\t);\n\t\tawait checkWalletBalance(network, config, walletAddress, true);\n\t} catch (err) {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.warning\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.environmentValidationWarning\", {\n\t\t\t\tmessage: (err as Error).message\n\t\t\t}),\n\t\t\t2\n\t\t);\n\t}\n}\n\n/**\n * Handle actual deployment execution.\n * @param contractName Name of the contract.\n * @param contractData Contract data.\n * @param config Network configuration.\n * @param network Target network.\n * @param faucetUrl The faucet URL (optional, defaults to network-specific URL).\n * @param deployerMnemonic The deployer mnemonic from environment variables.\n * @param deployerSeed The deployer seed from environment variables (optional).\n */\nasync function handleActualDeployment(\n\tcontractName: string,\n\tcontractData: IContractData,\n\tconfig: INetworkConfig,\n\tnetwork: NetworkTypes,\n\tfaucetUrl?: string,\n\tdeployerMnemonic?: string,\n\tdeployerSeed?: string\n): Promise<void> {\n\ttry {\n\t\tconst walletAddress = await validateEnvironmentForNetwork(\n\t\t\tnetwork,\n\t\t\tconfig,\n\t\t\tfalse,\n\t\t\tfaucetUrl,\n\t\t\tdeployerMnemonic,\n\t\t\tdeployerSeed\n\t\t);\n\t\tawait checkWalletBalance(network, config, walletAddress, false);\n\n\t\tconst deploymentResult = await deployWithIotaCli(config.deployment.gasBudget);\n\n\t\tcontractData.deployedPackageId = deploymentResult.packageId;\n\t\tcontractData.upgradeCapabilityId = deploymentResult.upgradeCap;\n\n\t\tif (deploymentResult.migrationStateId) {\n\t\t\tcontractData.migrationStateId = deploymentResult.migrationStateId;\n\t\t}\n\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.deployedPackageIdResult\"),\n\t\t\tdeploymentResult.packageId,\n\t\t\t1\n\t\t);\n\t\tif (deploymentResult.upgradeCap) {\n\t\t\tCLIDisplay.value(\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.upgradeCapabilityIdResult\"),\n\t\t\t\tdeploymentResult.upgradeCap,\n\t\t\t\t1\n\t\t\t);\n\t\t}\n\t\tif (contractData.migrationStateId) {\n\t\t\tCLIDisplay.value(\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.migrationStateIdResult\"),\n\t\t\t\tcontractData.migrationStateId,\n\t\t\t\t1\n\t\t\t);\n\t\t}\n\t} catch (err) {\n\t\tthrow new GeneralError(\n\t\t\t\"commands\",\n\t\t\t\"commands.deploy.deploymentFailed\",\n\t\t\t{ contract: contractName },\n\t\t\terr\n\t\t);\n\t}\n}\n\n/**\n * Determine the deployment strategy based on contract state.\n * @param contractData Contract data to analyze.\n * @returns Deployment strategy: initial-deploy, upgrade or already-deployed.\n */\nasync function determineDeploymentStrategy(\n\tcontractData: IContractData\n): Promise<\"initial-deploy\" | \"upgrade\" | \"already-deployed\"> {\n\tif (Is.stringValue(contractData.deployedPackageId)) {\n\t\treturn \"already-deployed\";\n\t}\n\n\tif (Is.stringValue(contractData.lastDeployedPackageId)) {\n\t\treturn \"upgrade\";\n\t}\n\n\treturn \"initial-deploy\";\n}\n\n/**\n * Query the on-chain UpgradeCap object to get the actual latest package ID.\n * This is used to validate/correct the `published-at` value before upgrades,\n * preventing failures when the deployment JSON is stale.\n * @param rpcUrl RPC endpoint URL for the network.\n * @param upgradeCapabilityId The UpgradeCap object ID on-chain.\n * @returns The on-chain package ID and version, or undefined if query fails.\n */\nasync function queryUpgradeCapPackage(\n\trpcUrl: string,\n\tupgradeCapabilityId: string\n): Promise<{ package: string; version: number } | undefined> {\n\ttry {\n\t\tconst client = new IotaClient({ url: rpcUrl });\n\t\tconst response = await client.getObject({\n\t\t\tid: upgradeCapabilityId,\n\t\t\toptions: { showContent: true }\n\t\t});\n\n\t\tif (response.data?.content?.dataType === \"moveObject\") {\n\t\t\tconst fields = response.data.content.fields as { [key: string]: unknown };\n\t\t\tconst fieldPackage = Coerce.string(fields.package);\n\t\t\tconst fieldVersion = Coerce.number(fields.version);\n\t\t\tif (Is.stringValue(fieldPackage) && Is.number(fieldVersion)) {\n\t\t\t\treturn {\n\t\t\t\t\tpackage: fieldPackage,\n\t\t\t\t\tversion: fieldVersion\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t} catch {\n\t\t// If query fails (e.g. network issue), return undefined to fall back to JSON value\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Execute contract upgrade using iota client upgrade command.\n * @param contractData Contract data containing upgrade capability.\n * @param config Network configuration.\n * @returns Upgrade result with package ID and upgrade capability.\n */\nasync function executeContractUpgrade(\n\tcontractData: IContractData,\n\tconfig: INetworkConfig\n): Promise<{ packageId: string; upgradeCap: string; migrationStateId?: string }> {\n\t// Start with lastDeployedPackageId from JSON as the candidate for \"published-at\"\n\tlet publishedAtPackageId = contractData.lastDeployedPackageId;\n\n\t// Query the on-chain UpgradeCap to get the actual latest package ID.\n\t// This prevents failures when the JSON is stale\n\tif (Is.stringValue(contractData.upgradeCapabilityId)) {\n\t\tCLIDisplay.task(I18n.formatMessage(\"commands.deploy.progress.queryingUpgradeCap\"));\n\t\tconst onChainCap = await queryUpgradeCapPackage(\n\t\t\tconfig.rpc.url,\n\t\t\tcontractData.upgradeCapabilityId\n\t\t);\n\t\tif (onChainCap) {\n\t\t\tCLIDisplay.value(\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.onChainPackageId\"),\n\t\t\t\tonChainCap.package,\n\t\t\t\t1\n\t\t\t);\n\t\t\tCLIDisplay.value(\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.onChainVersion\"),\n\t\t\t\tString(onChainCap.version),\n\t\t\t\t1\n\t\t\t);\n\n\t\t\tif (publishedAtPackageId !== onChainCap.package) {\n\t\t\t\tCLIDisplay.value(\n\t\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.warning\"),\n\t\t\t\t\tI18n.formatMessage(\"commands.deploy.messages.staleJsonDetected\", {\n\t\t\t\t\t\tjsonPackageId: publishedAtPackageId ?? \"none\",\n\t\t\t\t\t\tonChainPackageId: onChainCap.package\n\t\t\t\t\t}),\n\t\t\t\t\t2\n\t\t\t\t);\n\t\t\t\tpublishedAtPackageId = onChainCap.package;\n\t\t\t\tcontractData.lastDeployedPackageId = onChainCap.package;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!publishedAtPackageId) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.noPreviousDeploymentForUpgrade\");\n\t}\n\n\tconst moveTomlPaths: string[] = [];\n\tawait searchDirectoryForMoveToml(process.cwd(), moveTomlPaths);\n\n\tif (moveTomlPaths.length === 0) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.noMoveTomlFilesFound\", {\n\t\t\tcurrentDir: process.cwd()\n\t\t});\n\t}\n\n\tconst currentDirMoveToml = path.join(process.cwd(), \"Move.toml\");\n\tconst selectedMoveToml = moveTomlPaths.find(p => p === currentDirMoveToml) ?? moveTomlPaths[0];\n\tconst moveTomlPath = selectedMoveToml;\n\tconst projectRoot = path.dirname(moveTomlPath);\n\n\tconst backupPath = await backupMoveToml(moveTomlPath);\n\n\ttry {\n\t\t// Update Move.toml with \"published-at\" = validated package ID (from chain or JSON)\n\t\tawait updateMoveTomlPublishedAt(moveTomlPath, publishedAtPackageId);\n\n\t\tawait validateContractIsBuilt(contractData, projectRoot);\n\n\t\t// Execute upgrade command\n\t\tconst upgradeCapabilityId = contractData.upgradeCapabilityId;\n\t\tif (!upgradeCapabilityId) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.upgradeCapabilityNotFound\");\n\t\t}\n\t\tconst upgradeResult = await executeUpgradeWithIotaCli(\n\t\t\tupgradeCapabilityId,\n\t\t\tconfig.deployment.gasBudget,\n\t\t\tprojectRoot\n\t\t);\n\n\t\t// Update contract data with new package ID\n\t\tcontractData.deployedPackageId = upgradeResult.packageId;\n\n\t\treturn upgradeResult;\n\t} finally {\n\t\t// Always restore original Move.toml\n\t\tawait restoreMoveToml(moveTomlPath, backupPath);\n\t}\n}\n\n/**\n * Execute upgrade using iota client upgrade command.\n * @param upgradeCapabilityId Upgrade capability ID.\n * @param gasBudget Gas budget for upgrade.\n * @param moveProjectRoot Move project root directory.\n * @returns Upgrade result.\n */\nasync function executeUpgradeWithIotaCli(\n\tupgradeCapabilityId: string,\n\tgasBudget: number,\n\tmoveProjectRoot: string\n): Promise<{ packageId: string; upgradeCap: string; migrationStateId?: string }> {\n\t// Clean build artifacts and lock files before upgrade to prevent permission issues\n\tawait cleanBuildArtifactsInPath(moveProjectRoot);\n\n\tconst upgradeCmd = `iota client upgrade --upgrade-capability ${upgradeCapabilityId} . --gas-budget ${gasBudget} --json`;\n\n\tCLIDisplay.value(I18n.formatMessage(\"commands.deploy.labels.publishCommand\"), upgradeCmd, 1);\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.workingDirectory\"),\n\t\tmoveProjectRoot,\n\t\t1\n\t);\n\n\ttry {\n\t\tconst { stdout: output } = await execAsyncWithError(upgradeCmd, {\n\t\t\tcwd: moveProjectRoot\n\t\t});\n\t\tconst result = JSON.parse(output);\n\n\t\t// Parse upgrade response (different from publish response)\n\t\tconst packageId = result.objectChanges?.find(\n\t\t\t(change: { type: string; packageId?: string }) => change.type === \"published\"\n\t\t)?.packageId;\n\n\t\tif (!packageId) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.upgradePackageIdNotFound\", { result });\n\t\t}\n\n\t\t// UpgradeCap persists with same ID\n\t\tconst upgradeCap = upgradeCapabilityId;\n\n\t\treturn { packageId, upgradeCap };\n\t} catch (err) {\n\t\t// Clean up on error too\n\t\tawait cleanBuildArtifactsInPath(moveProjectRoot);\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.upgradeFailed\", undefined, err);\n\t}\n}\n\n/**\n * Backup Move.toml file.\n * @param moveTomlPath Path to Move.toml file.\n * @returns Path to backup file.\n */\nasync function backupMoveToml(moveTomlPath: string): Promise<string> {\n\tconst backupPath = `${moveTomlPath}.backup.${Date.now()}`;\n\tawait fsPromises.copyFile(moveTomlPath, backupPath);\n\treturn backupPath;\n}\n\n/**\n * Restore Move.toml file from backup.\n * @param moveTomlPath Path to Move.toml file.\n * @param backupPath Path to backup file.\n */\nasync function restoreMoveToml(moveTomlPath: string, backupPath: string): Promise<void> {\n\tawait fsPromises.copyFile(backupPath, moveTomlPath);\n\tawait fsPromises.unlink(backupPath);\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.moveTomlRestored\"),\n\t\tI18n.formatMessage(\"commands.deploy.messages.originalConfigurationRestored\"),\n\t\t1\n\t);\n}\n\n/**\n * Update Move.toml published-at field.\n * @param moveTomlPath Path to Move.toml file.\n * @param publishedAt Published-at value to set.\n */\nasync function updateMoveTomlPublishedAt(moveTomlPath: string, publishedAt: string): Promise<void> {\n\tconst content = await fsPromises.readFile(moveTomlPath, \"utf-8\");\n\n\t// Parse TOML and update \"published-at\" field\n\tconst lines = content.split(\"\\n\");\n\tlet updated = false;\n\n\tfor (let i = 0; i < lines.length; i++) {\n\t\tif (lines[i].trim().startsWith(\"published-at\")) {\n\t\t\tlines[i] = `published-at = \"${publishedAt}\"`;\n\t\t\tupdated = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!updated) {\n\t\t// Add \"published-at\" to \"[package]\" section\n\t\tconst packageSectionIndex = lines.findIndex(line => line.trim() === \"[package]\");\n\t\tif (packageSectionIndex >= 0) {\n\t\t\tlines.splice(packageSectionIndex + 1, 0, `published-at = \"${publishedAt}\"`);\n\t\t}\n\t}\n\n\tawait fsPromises.writeFile(moveTomlPath, lines.join(\"\\n\"));\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.moveTomlUpdated\"),\n\t\t`published-at = \"${publishedAt}\"`,\n\t\t1\n\t);\n}\n\n/**\n * Validate that contract has been built.\n * @param contractData Contract data to validate.\n * @param projectRoot Project root directory.\n */\nasync function validateContractIsBuilt(\n\tcontractData: IContractData,\n\tprojectRoot: string\n): Promise<void> {\n\t// Check if build directory exists and has been built\n\tconst buildDir = path.join(projectRoot, \"build\");\n\ttry {\n\t\tconst stats = await fsPromises.stat(buildDir);\n\t\tif (!stats.isDirectory()) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.buildPathNotDirectory\", {\n\t\t\t\tbuildDir\n\t\t\t});\n\t\t}\n\t} catch {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.contractNotBuilt\", {\n\t\t\tprojectRoot\n\t\t});\n\t}\n\n\t// Verify that the contract data has current packageId (build should have been run)\n\tif (!contractData.packageId || !contractData.packageBytecode) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.contractDataOutdated\");\n\t}\n\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.buildValidation\"),\n\t\tI18n.formatMessage(\"commands.deploy.messages.contractBuiltAndReadyForUpgrade\"),\n\t\t1\n\t);\n}\n\n/**\n * Handle contract upgrade execution.\n * @param contractName Name of the contract.\n * @param contractData Contract data.\n * @param config Network configuration.\n * @param network Target network.\n * @param faucetUrl The faucet URL (optional, defaults to network-specific URL).\n * @param deployerMnemonic The deployer mnemonic from environment variables.\n * @param deployerSeed The deployer seed from environment variables (optional).\n */\nasync function handleContractUpgrade(\n\tcontractName: string,\n\tcontractData: IContractData,\n\tconfig: INetworkConfig,\n\tnetwork: NetworkTypes,\n\tfaucetUrl?: string,\n\tdeployerMnemonic?: string,\n\tdeployerSeed?: string\n): Promise<void> {\n\tCLIDisplay.task(`Upgrading contract: ${contractName}`);\n\n\tconst walletAddress = await validateEnvironmentForNetwork(\n\t\tnetwork,\n\t\tconfig,\n\t\tfalse,\n\t\tfaucetUrl,\n\t\tdeployerMnemonic,\n\t\tdeployerSeed\n\t);\n\tawait checkWalletBalance(network, config, walletAddress, false);\n\n\tconst upgradeResult = await executeContractUpgrade(contractData, config);\n\n\t// Update contract data with upgrade chain tracking\n\tcontractData.deployedPackageId = upgradeResult.packageId;\n\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.upgradeSuccessful\"),\n\t\tupgradeResult.packageId,\n\t\t1\n\t);\n\tif (contractData.lastDeployedPackageId) {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.previousDeployment\"),\n\t\t\tcontractData.lastDeployedPackageId,\n\t\t\t1\n\t\t);\n\t}\n\tif (contractData.upgradeCapabilityId) {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.upgradeCapabilityPreserved\"),\n\t\t\tcontractData.upgradeCapabilityId,\n\t\t\t1\n\t\t);\n\t}\n}\n\n/**\n * Deploy a single contract.\n * @param contractName Name of the contract\n * @param contractData Contract compilation data\n * @param contractData.packageId Package ID\n * @param contractData.packageBytecode Package bytecode\n * @param contractData.deployedPackageId Deployed package ID\n * @param config Network configuration\n * @param network Target network\n * @param dryRun Whether this is a dry run\n * @param force Whether to force redeployment\n * @param faucetUrl The faucet URL (optional, defaults to network-specific URL).\n * @param deployerMnemonic The deployer mnemonic from environment variables.\n * @param deployerSeed The deployer seed from environment variables (optional).\n */\nasync function deployContract(\n\tcontractName: string,\n\tcontractData: IContractData,\n\tconfig: INetworkConfig,\n\tnetwork: NetworkTypes,\n\tdryRun: boolean,\n\tforce: boolean,\n\tfaucetUrl?: string,\n\tdeployerMnemonic?: string,\n\tdeployerSeed?: string\n): Promise<void> {\n\tCLIDisplay.task(\n\t\tI18n.formatMessage(\"commands.deploy.progress.deployingContract\", { contractName, network })\n\t);\n\n\tconst strategy = await determineDeploymentStrategy(contractData);\n\n\tif (strategy === \"already-deployed\" && !force) {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.contractStatus\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.messages.contractAlreadyDeployed\"),\n\t\t\t1\n\t\t);\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.upgradeGuidance\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.messages.upgradeGuidanceMessage\"),\n\t\t\t1\n\t\t);\n\t\treturn;\n\t}\n\n\t// Show deployment strategy\n\tCLIDisplay.section(I18n.formatMessage(\"commands.deploy.labels.smartDeployAnalysis\"));\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.upgradeCapability\"),\n\t\tcontractData.upgradeCapabilityId ??\n\t\t\tI18n.formatMessage(\"commands.deploy.messages.noneInitialDeployment\")\n\t);\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.currentDeployment\"),\n\t\tcontractData.deployedPackageId ??\n\t\t\tI18n.formatMessage(\"commands.deploy.messages.noneNeedsDeploymentUpgrade\")\n\t);\n\tCLIDisplay.value(I18n.formatMessage(\"commands.deploy.labels.detectedStrategy\"), strategy);\n\n\tif (dryRun) {\n\t\tawait handleDryRunValidation(\n\t\t\tcontractName,\n\t\t\tcontractData,\n\t\t\tconfig,\n\t\t\tnetwork,\n\t\t\tfaucetUrl,\n\t\t\tdeployerMnemonic,\n\t\t\tdeployerSeed\n\t\t);\n\t\treturn;\n\t}\n\n\tif (strategy === \"upgrade\") {\n\t\tawait handleContractUpgrade(\n\t\t\tcontractName,\n\t\t\tcontractData,\n\t\t\tconfig,\n\t\t\tnetwork,\n\t\t\tfaucetUrl,\n\t\t\tdeployerMnemonic,\n\t\t\tdeployerSeed\n\t\t);\n\t} else {\n\t\tawait handleActualDeployment(\n\t\t\tcontractName,\n\t\t\tcontractData,\n\t\t\tconfig,\n\t\t\tnetwork,\n\t\t\tfaucetUrl,\n\t\t\tdeployerMnemonic,\n\t\t\tdeployerSeed\n\t\t);\n\t}\n}\n\n/**\n * Get wallet address for deployment, preferring seed over mnemonic if available.\n * @param network The target network.\n * @param addressIndex The address index to derive.\n * @param deployerMnemonic The deployer mnemonic from environment variables.\n * @param deployerSeed The deployer seed from environment variables (optional).\n * @returns The wallet address.\n */\nasync function getDeploymentWalletAddress(\n\tnetwork: NetworkTypes,\n\taddressIndex: number,\n\tdeployerMnemonic?: string,\n\tdeployerSeed?: string\n): Promise<string> {\n\t// Try to use seed first if available\n\tconst hexSeed = await getDeploymentSeed(network, deployerSeed);\n\tlet seed: Uint8Array | undefined;\n\tif (Is.stringValue(hexSeed)) {\n\t\tseed = Converter.hexToBytes(hexSeed);\n\t} else {\n\t\tconst mnemonic = await getDeploymentMnemonic(network, deployerMnemonic);\n\t\tseed = Bip39.mnemonicToSeed(mnemonic);\n\t}\n\n\tconst addresses = Iota.getAddresses(seed, Iota.DEFAULT_COIN_TYPE, 0, addressIndex, 1, false);\n\n\treturn addresses[0];\n}\n\n/**\n * Convert nanos to IOTA (1 IOTA = 1,000,000,000 nanos).\n * @param nanos Balance in nanos.\n * @returns Balance in IOTA.\n */\nfunction nanosToIota(nanos: number): number {\n\treturn nanos / 1_000_000_000;\n}\n\n/**\n * Request funds from the faucet for testnet or devnet deployment.\n * @param network The target network (testnet or devnet).\n * @param walletAddress The wallet address to fund.\n * @param rpcUrl The RPC URL for the network.\n * @param faucetUrl The faucet URL (optional, defaults to network-specific URL).\n * @returns Promise that resolves when funding is complete.\n */\nasync function requestFaucetFunds(\n\tnetwork: NetworkTypes,\n\twalletAddress: string,\n\trpcUrl: string,\n\tfaucetUrl: string\n): Promise<void> {\n\tCLIDisplay.task(\n\t\tI18n.formatMessage(\"commands.deploy.progress.requestingFaucetFunds\", { network })\n\t);\n\n\tconst response = await requestIotaFromFaucetV0({\n\t\thost: faucetUrl,\n\t\trecipient: walletAddress\n\t});\n\n\tif (response?.error) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.fundingFailed\", undefined, response.error);\n\t}\n\n\tconst client = new IotaClient({ url: rpcUrl });\n\tconst balanceResponse = await client.getBalance({ owner: walletAddress });\n\tconst balanceInNanos = Number(balanceResponse.totalBalance);\n\n\tif (balanceInNanos > 0) {\n\t\tconst amountInIota = nanosToIota(balanceInNanos);\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.faucetFundsRequested\"),\n\t\t\t`${amountInIota.toFixed(2)} IOTA`,\n\t\t\t1\n\t\t);\n\t} else {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.warning\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.faucetNoFundsAdded\", { network }),\n\t\t\t2\n\t\t);\n\t}\n}\n\n/**\n * Check wallet balance and request faucet funds only if needed.\n * @param network The target network (testnet or devnet).\n * @param config Network configuration.\n * @param walletAddress The wallet address to check and potentially fund.\n * @param faucetUrl The faucet URL (optional, defaults to network-specific URL).\n * @returns Promise that resolves when balance check and optional funding is complete.\n */\nasync function checkBalanceAndRequestFaucetIfNeeded(\n\tnetwork: NetworkTypes,\n\tconfig: INetworkConfig,\n\twalletAddress: string,\n\tfaucetUrl?: string\n): Promise<void> {\n\t// Check current balance\n\tconst client = new IotaClient({ url: config.rpc.url });\n\tconst balanceResponse = await client.getBalance({ owner: walletAddress });\n\tconst balanceInNanos = Number(balanceResponse.totalBalance);\n\tconst requiredInNanos = config.deployment.gasBudget;\n\t// Convert to IOTA for display purposes\n\tconst balanceInIota = nanosToIota(balanceInNanos);\n\tconst requiredInIota = nanosToIota(requiredInNanos);\n\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.walletBalance\"),\n\t\t`${balanceInIota.toFixed(2)} IOTA`,\n\t\t1\n\t);\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.gasBudget\"),\n\t\t`${requiredInIota.toFixed(2)} IOTA`,\n\t\t1\n\t);\n\n\t// Only request faucet funds if balance is insufficient (compare in same units - nanos)\n\tif (balanceInNanos < requiredInNanos) {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.warning\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.insufficientBalance\", {\n\t\t\t\tcurrentBalance: balanceInIota.toFixed(2),\n\t\t\t\trequiredBalance: requiredInIota.toFixed(2)\n\t\t\t}),\n\t\t\t1\n\t\t);\n\n\t\tif (!Is.stringValue(faucetUrl)) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.noFaucetConfigured\");\n\t\t}\n\n\t\tCLIDisplay.task(I18n.formatMessage(\"commands.deploy.progress.requestingAdditionalFaucetFunds\"));\n\t\tawait requestFaucetFunds(network, walletAddress, config.rpc.url, faucetUrl);\n\n\t\t// Check balance again after faucet request\n\t\tconst updatedBalanceResponse = await client.getBalance({ owner: walletAddress });\n\t\tconst updatedBalanceInNanos = Number(updatedBalanceResponse.totalBalance);\n\t\tconst updatedBalanceInIota = nanosToIota(updatedBalanceInNanos);\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.updatedWalletBalance\"),\n\t\t\t`${updatedBalanceInIota.toFixed(2)} IOTA`,\n\t\t\t1\n\t\t);\n\t} else {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.balanceCheck\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.sufficientFundsAvailable\"),\n\t\t\t1\n\t\t);\n\t}\n}\n\n/**\n * Deploy contract using IOTA CLI.\n * @param gasBudget Gas budget for deployment.\n * @returns Deployment result with package ID, upgrade cap, and migration state ID.\n */\nasync function deployWithIotaCli(\n\tgasBudget: number\n): Promise<{ packageId: string; upgradeCap?: string; migrationStateId?: string }> {\n\t// Find the Move project directory\n\tconst moveTomlPaths: string[] = [];\n\tconst cwd = process.cwd();\n\tawait searchDirectoryForMoveToml(cwd, moveTomlPaths);\n\n\tif (moveTomlPaths.length === 0) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.noMoveTomlFilesFound\", {\n\t\t\tcurrentDir: cwd\n\t\t});\n\t}\n\n\t// Prioritize Move.toml in current directory, then use first found\n\tconst currentDirMoveToml = path.join(cwd, \"Move.toml\");\n\tconst selectedMoveToml = moveTomlPaths.find(p => p === currentDirMoveToml) ?? moveTomlPaths[0];\n\n\t// Use the actual Move project directory\n\tconst moveProjectRoot = path.dirname(selectedMoveToml);\n\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.moveProjectRoot\"),\n\t\tmoveProjectRoot,\n\t\t1\n\t);\n\n\tconst publishCmd = `iota client publish --gas-budget ${gasBudget} --json`;\n\n\tCLIDisplay.value(I18n.formatMessage(\"commands.deploy.labels.publishCommand\"), publishCmd, 1);\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.workingDirectory\"),\n\t\tmoveProjectRoot,\n\t\t1\n\t);\n\n\ttry {\n\t\tconst { stdout: output } = await execAsyncWithError(publishCmd, { cwd: moveProjectRoot });\n\t\tconst result = JSON.parse(output);\n\n\t\t// Extract package ID from published object\n\t\tconst packageId = result.objectChanges?.find(\n\t\t\t(change: { type: string; packageId?: string }) => change.type === \"published\"\n\t\t)?.packageId;\n\n\t\tif (!packageId) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.packageIdNotFound\", {\n\t\t\t\tresult\n\t\t\t});\n\t\t}\n\n\t\t// Extract UpgradeCap ID from created objects\n\t\tconst upgradeCap = result.objectChanges?.find(\n\t\t\t(change: { objectType?: string; objectId?: string }) =>\n\t\t\t\tchange.objectType === \"0x2::package::UpgradeCap\"\n\t\t)?.objectId;\n\n\t\t// Extract MigrationState ID from created objects\n\t\tconst migrationStateId = result.objectChanges?.find(\n\t\t\t(change: { objectType?: string; objectId?: string }) =>\n\t\t\t\tchange.objectType?.endsWith(\"::MigrationState\")\n\t\t)?.objectId;\n\n\t\treturn {\n\t\t\tpackageId,\n\t\t\tupgradeCap,\n\t\t\tmigrationStateId\n\t\t};\n\t} catch (err) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.deploymentFailed\", undefined, err);\n\t}\n}\n\n/**\n * Update contracts file with deployed package IDs.\n * @param contractsPath Path to contracts file.\n * @param contractsData Updated contracts data.\n */\nasync function updateContractsFile(\n\tcontractsPath: string,\n\tcontractsData: ISmartContractDeployments\n): Promise<void> {\n\ttry {\n\t\tawait CLIUtils.writeJsonFile(contractsPath, contractsData, false);\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.updatedContractsFile\"),\n\t\t\tcontractsPath,\n\t\t\t1\n\t\t);\n\t} catch (err) {\n\t\tthrow new GeneralError(\n\t\t\t\"commands\",\n\t\t\t\"commands.deploy.contractsFileUpdateFailed\",\n\t\t\t{ contractsPath },\n\t\t\terr\n\t\t);\n\t}\n}\n\n/**\n * Generate a unique backup alias that doesn't conflict with existing keys.\n * Uses cryptographically secure random bytes to avoid conflicts.\n * @param baseAlias The original alias name.\n * @param existingKeys Array of existing keys from keystore.\n * @returns A unique backup alias name.\n */\nexport function generateUniqueBackupAlias(\n\tbaseAlias: string,\n\texistingKeys: { alias: string; iotaAddress: string }[]\n): string {\n\tconst existingAliases = new Set(existingKeys.map(key => key.alias));\n\n\t// Generate cryptographically secure random identifier\n\tconst randomSuffix = Converter.bytesToHex(RandomHelper.generate(4));\n\tconst backupAlias = `${baseAlias}-backup-${randomSuffix}`;\n\n\t// In the extremely unlikely event of collision, add timestamp\n\tif (existingAliases.has(backupAlias)) {\n\t\treturn `${baseAlias}-backup-${Date.now()}-${randomSuffix}`;\n\t}\n\n\treturn backupAlias;\n}\n\n/**\n * Ensure the correct deployer key exists in the keystore with the expected address.\n * If a conflicting alias exists, rename it and import the correct key.\n * @param network The target network.\n * @param aliasName The desired alias name (e.g., \"deployer-testnet\").\n * @param expectedAddress The expected address from the current mnemonic.\n * @param addressIndex The address index to use.\n * @param deployerMnemonic The deployer mnemonic.\n */\nexport async function ensureCorrectDeployerKey(\n\tnetwork: NetworkTypes,\n\taliasName: string,\n\texpectedAddress: string,\n\taddressIndex: number,\n\tdeployerMnemonic: string\n): Promise<void> {\n\ttry {\n\t\t// Check if the alias already exists in keystore\n\t\tconst { stdout: keysListOutput } = await execAsyncWithError(\"iota keytool list --json\");\n\t\tconst keysList = JSON.parse(keysListOutput);\n\n\t\t// Find existing key with the target alias\n\t\tconst existingKey = keysList.find(\n\t\t\t(key: { alias: string; iotaAddress: string }) => key.alias === aliasName\n\t\t);\n\n\t\tif (existingKey) {\n\t\t\t// Check if existing key has the correct address\n\t\t\tconst existingAddress = existingKey.iotaAddress;\n\n\t\t\tif (existingAddress !== expectedAddress) {\n\t\t\t\t// Conflicting alias exists with wrong mnemonic - rename it\n\t\t\t\tCLIDisplay.task(\n\t\t\t\t\tI18n.formatMessage(\"commands.deploy.progress.renamingConflictingKey\", { aliasName })\n\t\t\t\t);\n\n\t\t\t\tconst backupAlias = generateUniqueBackupAlias(aliasName, keysList);\n\t\t\t\tawait execAsyncWithError(`iota keytool update-alias \"${aliasName}\" \"${backupAlias}\"`);\n\n\t\t\t\tCLIDisplay.value(\n\t\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.renamedExistingKey\"),\n\t\t\t\t\t`${aliasName} → ${backupAlias} (${existingAddress})`,\n\t\t\t\t\t1\n\t\t\t\t);\n\n\t\t\t\t// Now import the correct key with the desired alias\n\t\t\t\tawait importCorrectDeployerKey(\n\t\t\t\t\tnetwork,\n\t\t\t\t\taliasName,\n\t\t\t\t\taddressIndex,\n\t\t\t\t\texpectedAddress,\n\t\t\t\t\tdeployerMnemonic\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// Existing key is correct - no action needed\n\t\t\t\tCLIDisplay.value(\n\t\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.usingExistingCorrectKey\"),\n\t\t\t\t\t`${aliasName} (${expectedAddress})`,\n\t\t\t\t\t1\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\t// No existing alias - import the key\n\t\t\tawait importCorrectDeployerKey(\n\t\t\t\tnetwork,\n\t\t\t\taliasName,\n\t\t\t\taddressIndex,\n\t\t\t\texpectedAddress,\n\t\t\t\tdeployerMnemonic\n\t\t\t);\n\t\t}\n\n\t\t// Verify the address exists in client addresses\n\t\tconst { stdout: addressListOutput } = await execAsyncWithError(\"iota client addresses --json\");\n\t\tconst addressInfo = JSON.parse(addressListOutput);\n\t\tconst addressExists: boolean = addressInfo.addresses.some(\n\t\t\t([_, addr]: [string, string]) => addr === expectedAddress\n\t\t);\n\n\t\tif (!addressExists) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.addressNotInClient\", {\n\t\t\t\texpectedAddress,\n\t\t\t\taliasName\n\t\t\t});\n\t\t}\n\t} catch (error) {\n\t\tthrow new GeneralError(\n\t\t\t\"commands\",\n\t\t\t\"commands.deploy.deployerKeySetupFailed\",\n\t\t\t{ network, aliasName, expectedAddress },\n\t\t\terror\n\t\t);\n\t}\n}\n\n/**\n * Import the deployer key with the correct mnemonic.\n * @param network The target network.\n * @param aliasName The alias name to use.\n * @param addressIndex The address index.\n * @param targetAddress The expected target address (avoids redundant calculation).\n * @param deployerMnemonic The deployer mnemonic.\n */\nasync function importCorrectDeployerKey(\n\tnetwork: NetworkTypes,\n\taliasName: string,\n\taddressIndex: number,\n\ttargetAddress: string,\n\tdeployerMnemonic: string\n): Promise<void> {\n\tCLIDisplay.task(\n\t\tI18n.formatMessage(\"commands.deploy.progress.importingDeployerKey\", { aliasName })\n\t);\n\n\tconst mnemonic = await getDeploymentMnemonic(network, deployerMnemonic);\n\tconst derivationPath = Bip44.path(Iota.DEFAULT_COIN_TYPE, 0, false, addressIndex).toString();\n\n\tawait execAsyncWithError(\n\t\t`iota keytool import \"${mnemonic}\" ed25519 \"${derivationPath}\" --alias \"${aliasName}\"`\n\t);\n\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.importedDeployerKey\"),\n\t\t`${aliasName} (${targetAddress})`,\n\t\t1\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../src/commands/deploy.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACjG,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EACN,IAAI,EACJ,YAAY,EAGZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAA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aAAa,EAAE,CAAC;YACpB,MAAM,IAAI,YAAY,CAAC,UAAU,EAAE,oCAAoC,EAAE;gBACxE,eAAe;gBACf,SAAS;aACT,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,YAAY,CACrB,UAAU,EACV,wCAAwC,EACxC,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,EACvC,KAAK,CACL,CAAC;IACH,CAAC;AACF,CAAC;AAED;;;;;;;GAOG;AACH,KAAK,UAAU,wBAAwB,CACtC,OAAqB,EACrB,SAAiB,EACjB,YAAoB,EACpB,aAAqB,EACrB,gBAAwB;IAExB,UAAU,CAAC,IAAI,CACd,IAAI,CAAC,aAAa,CAAC,+CAA+C,EAAE,EAAE,SAAS,EAAE,CAAC,CAClF,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IACxE,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;IAE7F,MAAM,kBAAkB,CACvB,wBAAwB,QAAQ,cAAc,cAAc,cAAc,SAAS,GAAG,CACtF,CAAC;IAEF,UAAU,CAAC,KAAK,CACf,IAAI,CAAC,aAAa,CAAC,4CAA4C,CAAC,EAChE,GAAG,SAAS,KAAK,aAAa,GAAG,EACjC,CAAC,CACD,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { promises as fsPromises } from \"node:fs\";\nimport path from \"node:path\";\nimport { IotaClient } from \"@iota/iota-sdk/client\";\nimport { requestIotaFromFaucetV0 } from \"@iota/iota-sdk/faucet\";\nimport { CLIDisplay, CLIParam, CLIUtils } from \"@twin.org/cli-core\";\nimport { Coerce, Converter, GeneralError, Guards, I18n, Is, RandomHelper } from \"@twin.org/core\";\nimport { Bip39, Bip44 } from \"@twin.org/crypto\";\nimport {\n\tIota,\n\tNetworkTypes,\n\ttype IContractData,\n\ttype ISmartContractDeployments\n} from \"@twin.org/dlt-iota\";\nimport { MemoryEntityStorageConnector } from \"@twin.org/entity-storage-connector-memory\";\nimport { EntityStorageConnectorFactory } from \"@twin.org/entity-storage-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport {\n\tEntityStorageVaultConnector,\n\tinitSchema,\n\ttype VaultKey,\n\ttype VaultSecret\n} from \"@twin.org/vault-connector-entity-storage\";\nimport type { IVaultConnector } from \"@twin.org/vault-models\";\nimport type { Command } from \"commander\";\nimport type { INetworkConfig } from \"../models/INetworkConfig.js\";\nimport { cleanBuildArtifactsInPath } from \"../utils/buildArtifactUtils.js\";\nimport { ensureEnvironment, execAsyncWithError } from \"../utils/environmentUtils.js\";\nimport {\n\tgetDeploymentMnemonic,\n\tgetDeploymentSeed,\n\tvalidateDeploymentEnvironment\n} from \"../utils/envSetup.js\";\nimport { verifyIotaSDK } from \"../utils/iotaUtils.js\";\nimport { searchDirectoryForMoveToml } from \"../utils/moveToJsonUtils.js\";\n\n/**\n * Build the deploy command.\n * @param program The command program.\n */\nexport function buildCommandDeploy(program: Command): void {\n\tprogram\n\t\t.command(\"deploy\")\n\t\t.description(I18n.formatMessage(\"commands.deploy.description\"))\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.contracts.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.contracts.description\"),\n\t\t\t\"smart-contract-deployments.json\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.network.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.network.description\"),\n\t\t\t\"!NETWORK\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.dryRun.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.dryRun.description\")\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.force.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.force.description\")\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.rpcUrl.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.rpcUrl.description\"),\n\t\t\t\"!RPC_URL\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.addressIndex.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.addressIndex.description\"),\n\t\t\t\"!ADDRESS_INDEX\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.rpcTimeout.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.rpcTimeout.description\"),\n\t\t\t\"!RPC_TIMEOUT\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.gasBudget.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.gasBudget.description\"),\n\t\t\t\"!GAS_BUDGET\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.confirmationTimeout.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.confirmationTimeout.description\"),\n\t\t\t\"!CONFIRMATION_TIMEOUT\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.faucetUrl.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.faucetUrl.description\"),\n\t\t\t\"!FAUCET_URL\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.deployerMnemonic.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.deployerMnemonic.description\"),\n\t\t\t\"!DEPLOYER_MNEMONIC\"\n\t\t)\n\t\t.option(\n\t\t\tI18n.formatMessage(\"commands.deploy.options.deployerSeed.param\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.options.deployerSeed.description\"),\n\t\t\t\"!DEPLOYER_SEED\"\n\t\t)\n\t\t.action(actionCommandDeploy);\n}\n\n/**\n * Action for the deploy command.\n * @param opts Command options.\n * @param opts.contracts Path to compiled modules JSON.\n * @param opts.network Network identifier - optional if NETWORK env var is set.\n * @param opts.dryRun Simulate deployment without executing.\n * @param opts.force Force redeployment of existing packages.\n * @param opts.rpcUrl RPC endpoint URL for the network.\n * @param opts.addressIndex Address index for key derivation.\n * @param opts.rpcTimeout RPC request timeout in milliseconds.\n * @param opts.gasBudget Gas budget for transactions.\n * @param opts.confirmationTimeout Transaction confirmation timeout in milliseconds.\n * @param opts.faucetUrl Faucet URL for requesting test tokens.\n * @param opts.deployerMnemonic Deployer wallet mnemonic phrase.\n * @param opts.deployerSeed Deployer wallet seed (alternative to mnemonic).\n */\nexport async function actionCommandDeploy(opts: {\n\tcontracts?: string;\n\tnetwork?: NetworkTypes;\n\tdryRun?: boolean;\n\tforce?: boolean;\n\trpcUrl?: string;\n\taddressIndex?: string;\n\trpcTimeout?: string;\n\tgasBudget?: string;\n\tconfirmationTimeout?: string;\n\tfaucetUrl?: string;\n\tdeployerMnemonic?: string;\n\tdeployerSeed?: string;\n}): Promise<void> {\n\tconst network = CLIParam.arrayOneOf<NetworkTypes>(\n\t\t\"network\",\n\t\topts.network,\n\t\tObject.values(NetworkTypes),\n\t\ttrue\n\t);\n\n\tconst contractsPath = opts.contracts ?? \"smart-contract-deployments.json\";\n\tconst dryRun = opts.dryRun ?? false;\n\tconst force = opts.force ?? false;\n\n\tCLIDisplay.section(I18n.formatMessage(\"commands.deploy.section.deployContracts\"));\n\tCLIDisplay.section(contractsPath);\n\n\t// Verify the IOTA SDK before we do anything else\n\tawait verifyIotaSDK();\n\n\t// Get configuration values needed for environment setup\n\tconst rpcUrl: string = CLIParam.stringValue(\"rpcUrl\", opts.rpcUrl);\n\tconst addressIndex = CLIParam.number(\"addressIndex\", opts.addressIndex) ?? 0;\n\tconst rpcTimeout = CLIParam.number(\"rpcTimeout\", opts.rpcTimeout);\n\tconst gasBudget = CLIParam.number(\"gasBudget\", opts.gasBudget);\n\tconst confirmationTimeout = CLIParam.number(\"confirmationTimeout\", opts.confirmationTimeout);\n\tconst faucetUrl: string | undefined =\n\t\tnetwork === NetworkTypes.Mainnet\n\t\t\t? undefined\n\t\t\t: CLIParam.stringValue(\"faucetUrl\", opts.faucetUrl);\n\n\tlet deployerMnemonic: string | undefined;\n\ttry {\n\t\tdeployerMnemonic = CLIParam.stringValue(\"deployerMnemonic\", opts.deployerMnemonic);\n\t} catch {\n\t\t// Optional parameter, can be undefined\n\t\tdeployerMnemonic = undefined;\n\t}\n\n\tlet deployerSeed: string | undefined;\n\ttry {\n\t\tdeployerSeed = CLIParam.stringValue(\"deployerSeed\", opts.deployerSeed);\n\t} catch {\n\t\t// Optional parameter, can be undefined\n\t\tdeployerSeed = undefined;\n\t}\n\n\t// Validate that at least one deployer credential is provided\n\tconst hasValidMnemonic = Is.stringValue(deployerMnemonic);\n\tconst hasValidSeed = Is.stringValue(deployerSeed);\n\n\tif (!hasValidMnemonic && !hasValidSeed) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.deployerCredentialRequired\", {\n\t\t\tnetwork\n\t\t});\n\t}\n\n\t// Check/switch to target network environment BEFORE loading config\n\tawait setIotaEnvironment(network, rpcUrl, addressIndex, dryRun, deployerMnemonic, deployerSeed);\n\n\tconst config = await createNetworkConfig(\n\t\tnetwork,\n\t\trpcUrl,\n\t\taddressIndex,\n\t\trpcTimeout,\n\t\tgasBudget,\n\t\tconfirmationTimeout\n\t);\n\tvalidateNetworkConfig(config, network);\n\n\tconst contractsData = await loadCompiledContracts(contractsPath);\n\n\tif (network === NetworkTypes.Mainnet) {\n\t\tconst validatedMnemonic = await getDeploymentMnemonic(\n\t\t\tnetwork,\n\t\t\thasValidMnemonic ? deployerMnemonic : undefined\n\t\t);\n\t\tawait validateDeploymentEnvironment(network, validatedMnemonic);\n\t}\n\n\tconst networkContracts = contractsData[network];\n\tif (!Is.object<IContractData>(networkContracts)) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.noContractsFound\", {\n\t\t\tnetwork,\n\t\t\tcontractsPath\n\t\t});\n\t}\n\n\tawait deployContract(\n\t\t\"contract\",\n\t\tnetworkContracts,\n\t\tconfig,\n\t\tnetwork,\n\t\tdryRun,\n\t\tforce,\n\t\tfaucetUrl,\n\t\tdeployerMnemonic,\n\t\tdeployerSeed\n\t);\n\n\tif (!dryRun) {\n\t\tawait updateContractsFile(contractsPath, contractsData);\n\t}\n\n\tCLIDisplay.done();\n}\n\n/**\n * Switch IOTA CLI to the target network environment and set the active address.\n * @param network Target network to switch to\n * @param rpcUrl The RPC URL for the network\n * @param addressIndex The address index to derive the target address\n * @param dryRun Whether this is a dry run (checks environment but doesn't switch)\n * @param deployerMnemonic The deployer mnemonic from environment variables.\n * @param deployerSeed The deployer seed from environment variables (optional).\n */\nasync function setIotaEnvironment(\n\tnetwork: NetworkTypes,\n\trpcUrl: string,\n\taddressIndex: number,\n\tdryRun: boolean = false,\n\tdeployerMnemonic?: string,\n\tdeployerSeed?: string\n): Promise<void> {\n\ttry {\n\t\tCLIDisplay.task(\n\t\t\tdryRun\n\t\t\t\t? I18n.formatMessage(\"commands.deploy.progress.checkingEnvironment\")\n\t\t\t\t: I18n.formatMessage(\"commands.deploy.progress.settingEnvironment\")\n\t\t);\n\n\t\t// Ensure environment exists, create if necessary\n\t\tGuards.stringValue(\"setIotaEnvironment\", nameof(rpcUrl), rpcUrl);\n\n\t\tawait ensureEnvironment(network, rpcUrl);\n\n\t\tif (dryRun) {\n\t\t\tCLIDisplay.value(\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.iotaEnvironmentCheck\"),\n\t\t\t\t`✅ ${network} environment exists`,\n\t\t\t\t1\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Derive the target address from existing mnemonic/seed\n\t\tconst targetAddress = await getDeploymentWalletAddress(\n\t\t\tnetwork,\n\t\t\taddressIndex,\n\t\t\tdeployerMnemonic,\n\t\t\tdeployerSeed\n\t\t);\n\n\t\t// Ensure the correct deployer key exists in the keystore\n\t\tconst aliasName = `deployer-${network}`;\n\t\tconst validatedMnemonic = await getDeploymentMnemonic(network, deployerMnemonic);\n\t\tawait ensureCorrectDeployerKey(\n\t\t\tnetwork,\n\t\t\taliasName,\n\t\t\ttargetAddress,\n\t\t\taddressIndex,\n\t\t\tvalidatedMnemonic\n\t\t);\n\n\t\t// Switch both environment and address in one command\n\t\tawait execAsyncWithError(`iota client switch --env ${network} --address ${targetAddress}`);\n\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.switchedIotaEnvironment\"),\n\t\t\tnetwork,\n\t\t\t1\n\t\t);\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.switchedActiveAddress\"),\n\t\t\ttargetAddress,\n\t\t\t1\n\t\t);\n\n\t\t// Verify the switch was successful\n\t\tconst { stdout: activeEnv } = await execAsyncWithError(\"iota client active-env\");\n\t\tif (!activeEnv.includes(network)) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.environmentSwitchFailed\", {\n\t\t\t\tnetwork,\n\t\t\t\tactiveEnv\n\t\t\t});\n\t\t}\n\n\t\t// Verify address switch was successful\n\t\tconst { stdout: activeAddressOutput } = await execAsyncWithError(\"iota client active-address\");\n\t\tconst activeAddress = activeAddressOutput.trim();\n\t\tif (activeAddress !== targetAddress) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.addressSwitchFailed\", {\n\t\t\t\tnetwork,\n\t\t\t\ttargetAddress,\n\t\t\t\tactiveAddress\n\t\t\t});\n\t\t}\n\t} catch (error) {\n\t\tthrow new GeneralError(\n\t\t\t\"commands\",\n\t\t\t\"commands.deploy.environmentOperationFailed\",\n\t\t\t{ network, operation: dryRun ? \"check\" : \"switch to\" },\n\t\t\terror\n\t\t);\n\t}\n}\n\n/**\n * Creates the network configuration.\n * @param network Target network to determine which env file to load.\n * @param rpcUrl The RPC URL for the network.\n * @param addressIndex The address index for the wallet.\n * @param rpcTimeout The RPC timeout in milliseconds.\n * @param gasBudget The gas budget for deployment.\n * @param confirmationTimeout The confirmation timeout in seconds.\n * @returns Network configuration.\n */\nasync function createNetworkConfig(\n\tnetwork: NetworkTypes,\n\trpcUrl: string,\n\taddressIndex: number,\n\trpcTimeout?: number,\n\tgasBudget?: number,\n\tconfirmationTimeout?: number\n): Promise<INetworkConfig> {\n\ttry {\n\t\tGuards.stringValue(\"createNetworkConfig\", nameof(rpcUrl), rpcUrl);\n\n\t\tconst config: INetworkConfig = {\n\t\t\tnetwork,\n\t\t\tplatform: \"iota\",\n\t\t\trpc: {\n\t\t\t\turl: rpcUrl,\n\t\t\t\ttimeout: rpcTimeout ?? 60000\n\t\t\t},\n\t\t\tdeployment: {\n\t\t\t\tgasBudget: gasBudget ?? 50000000,\n\t\t\t\tconfirmationTimeout: confirmationTimeout ?? 60,\n\t\t\t\twallet: {\n\t\t\t\t\taddressIndex\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\treturn config;\n\t} catch (err) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.networkConfigInvalid\", { network }, err);\n\t}\n}\n\n/**\n * Validate network configuration matches expected network.\n * @param config Network configuration.\n * @param expectedNetwork Expected network type.\n * @throws GeneralError if the network configuration is invalid.\n */\nfunction validateNetworkConfig(config: INetworkConfig, expectedNetwork: NetworkTypes): void {\n\tif (config.network !== expectedNetwork) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.networkMismatch\", {\n\t\t\texpected: expectedNetwork,\n\t\t\tactual: config.network,\n\t\t\thelp: `Configuration file specifies '${config.network}' but command targets '${expectedNetwork}'`\n\t\t});\n\t}\n\n\tif (!Is.stringValue(config.rpc?.url)) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.rpcUrlRequired\", {\n\t\t\tnetwork: expectedNetwork\n\t\t});\n\t}\n\n\tif (!Is.number(config.deployment?.gasBudget)) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.gasBudgetRequired\", {\n\t\t\tnetwork: expectedNetwork\n\t\t});\n\t}\n}\n\n/**\n * Load compiled contracts from file.\n * @param contractsPath Path to contracts file.\n * @returns Compiled contracts data.\n */\nasync function loadCompiledContracts(contractsPath: string): Promise<ISmartContractDeployments> {\n\ttry {\n\t\tif (!(await CLIUtils.fileExists(contractsPath))) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.contractsFileNotFound\", {\n\t\t\t\tcontractsPath\n\t\t\t});\n\t\t}\n\n\t\tconst contracts = await CLIUtils.readJsonFile<ISmartContractDeployments>(contractsPath);\n\n\t\tif (!Is.object(contracts)) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.invalidContractsFile\");\n\t\t}\n\n\t\treturn contracts;\n\t} catch (err) {\n\t\tthrow new GeneralError(\n\t\t\t\"commands\",\n\t\t\t\"commands.deploy.contractsLoadFailed\",\n\t\t\t{ contractsPath },\n\t\t\terr\n\t\t);\n\t}\n}\n\n/**\n * Validate environment and setup for deployment based on network type.\n * @param network Target network.\n * @param config Network configuration.\n * @param isDryRun Whether this is a dry run.\n * @param faucetUrl The faucet URL (optional, defaults to network-specific URL).\n * @param deployerMnemonic The deployer mnemonic for validation.\n * @param deployerSeed The deployer seed (optional).\n * @returns Wallet address for the deployment.\n */\nasync function validateEnvironmentForNetwork(\n\tnetwork: NetworkTypes,\n\tconfig: INetworkConfig,\n\tisDryRun: boolean = false,\n\tfaucetUrl?: string,\n\tdeployerMnemonic?: string,\n\tdeployerSeed?: string\n): Promise<string> {\n\tconst walletAddress = await getDeploymentWalletAddress(\n\t\tnetwork,\n\t\tconfig.deployment.wallet.addressIndex,\n\t\tdeployerMnemonic,\n\t\tdeployerSeed\n\t);\n\n\tif (isDryRun) {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.dryRunWalletAddress\"),\n\t\t\twalletAddress,\n\t\t\t1\n\t\t);\n\t} else {\n\t\tCLIDisplay.value(I18n.formatMessage(\"commands.deploy.labels.walletAddress\"), walletAddress, 1);\n\t}\n\n\tif (network === NetworkTypes.Mainnet) {\n\t\tconst validatedMnemonic = await getDeploymentMnemonic(network, deployerMnemonic);\n\t\tawait validateDeploymentEnvironment(network, validatedMnemonic);\n\t} else if ((network === NetworkTypes.Testnet || network === NetworkTypes.Devnet) && !isDryRun) {\n\t\t// For testnet/devnet, check balance first and only request funds if needed\n\t\tawait checkBalanceAndRequestFaucetIfNeeded(network, config, walletAddress, faucetUrl);\n\t}\n\n\treturn walletAddress;\n}\n\n/**\n * Check wallet balance and display relevant information.\n * @param network Target network.\n * @param config Network configuration.\n * @param walletAddress Wallet address.\n * @param isDryRun Whether this is a dry run.\n * @returns Balance in nanos.\n */\nasync function checkWalletBalance(\n\tnetwork: NetworkTypes,\n\tconfig: INetworkConfig,\n\twalletAddress: string,\n\tisDryRun: boolean = false\n): Promise<number> {\n\tconst client = new IotaClient({ url: config.rpc.url });\n\tconst balanceResponse = await client.getBalance({ owner: walletAddress });\n\tconst balanceInNanos = Number(balanceResponse.totalBalance);\n\tconst requiredInNanos = config.deployment.gasBudget;\n\n\tconst balanceInIota = nanosToIota(balanceInNanos);\n\tconst requiredInIota = nanosToIota(requiredInNanos);\n\n\tconst balanceLabel = isDryRun\n\t\t? \"commands.deploy.labels.dryRunWalletBalance\"\n\t\t: \"commands.deploy.labels.walletBalance\";\n\tconst gasBudgetLabel = isDryRun\n\t\t? \"commands.deploy.labels.dryRunGasBudget\"\n\t\t: \"commands.deploy.labels.gasBudget\";\n\n\tCLIDisplay.value(I18n.formatMessage(balanceLabel), `${balanceInIota.toFixed(2)} IOTA`, 1);\n\tCLIDisplay.value(I18n.formatMessage(gasBudgetLabel), `${requiredInIota.toFixed(2)} IOTA`, 1);\n\n\t// Handle insufficient balance based on network and run type (compare in same units - nanos)\n\tif (balanceInNanos < requiredInNanos) {\n\t\tif (isDryRun) {\n\t\t\tCLIDisplay.value(\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.warning\"),\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.insufficientBalanceWarning\", {\n\t\t\t\t\tcurrentBalance: balanceInIota.toFixed(2),\n\t\t\t\t\trequiredBalance: requiredInIota.toFixed(2)\n\t\t\t\t}),\n\t\t\t\t2\n\t\t\t);\n\t\t} else if (network === NetworkTypes.Mainnet) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.insufficientBalance\", {\n\t\t\t\tbalance: balanceInIota,\n\t\t\t\trequired: requiredInIota,\n\t\t\t\twalletAddress\n\t\t\t});\n\t\t} else {\n\t\t\t// For testnet/devnet, show warning but continue\n\t\t\tCLIDisplay.value(\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.warning\"),\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.insufficientBalanceAfterFaucet\", {\n\t\t\t\t\tnetwork,\n\t\t\t\t\tbalance: balanceInIota.toFixed(2),\n\t\t\t\t\trequired: requiredInIota.toFixed(2),\n\t\t\t\t\twalletAddress\n\t\t\t\t}),\n\t\t\t\t2\n\t\t\t);\n\t\t}\n\t}\n\n\treturn balanceInNanos;\n}\n\n/**\n * Handle dry run validation and display.\n * @param contractName Name of the contract.\n * @param contractData Contract data.\n * @param config Network configuration.\n * @param network Target network.\n * @param faucetUrl The faucet URL (optional, defaults to network-specific URL).\n * @param deployerMnemonic The deployer mnemonic from environment variables.\n * @param deployerSeed The deployer seed from environment variables (optional).\n */\nasync function handleDryRunValidation(\n\tcontractName: string,\n\tcontractData: IContractData,\n\tconfig: INetworkConfig,\n\tnetwork: NetworkTypes,\n\tfaucetUrl?: string,\n\tdeployerMnemonic?: string,\n\tdeployerSeed?: string\n): Promise<void> {\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.dryRunWouldDeploy\"),\n\t\t`${contractName} (${network})`,\n\t\t1\n\t);\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.dryRunPackageId\"),\n\t\tcontractData.packageId,\n\t\t1\n\t);\n\tCLIDisplay.value(I18n.formatMessage(\"commands.deploy.labels.dryRunRpcUrl\"), config.rpc.url, 1);\n\n\ttry {\n\t\tconst walletAddress = await validateEnvironmentForNetwork(\n\t\t\tnetwork,\n\t\t\tconfig,\n\t\t\ttrue,\n\t\t\tfaucetUrl,\n\t\t\tdeployerMnemonic,\n\t\t\tdeployerSeed\n\t\t);\n\t\tawait checkWalletBalance(network, config, walletAddress, true);\n\t} catch (err) {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.warning\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.environmentValidationWarning\", {\n\t\t\t\tmessage: (err as Error).message\n\t\t\t}),\n\t\t\t2\n\t\t);\n\t}\n}\n\n/**\n * Handle actual deployment execution.\n * @param contractName Name of the contract.\n * @param contractData Contract data.\n * @param config Network configuration.\n * @param network Target network.\n * @param faucetUrl The faucet URL (optional, defaults to network-specific URL).\n * @param deployerMnemonic The deployer mnemonic from environment variables.\n * @param deployerSeed The deployer seed from environment variables (optional).\n */\nasync function handleActualDeployment(\n\tcontractName: string,\n\tcontractData: IContractData,\n\tconfig: INetworkConfig,\n\tnetwork: NetworkTypes,\n\tfaucetUrl?: string,\n\tdeployerMnemonic?: string,\n\tdeployerSeed?: string\n): Promise<void> {\n\ttry {\n\t\tconst walletAddress = await validateEnvironmentForNetwork(\n\t\t\tnetwork,\n\t\t\tconfig,\n\t\t\tfalse,\n\t\t\tfaucetUrl,\n\t\t\tdeployerMnemonic,\n\t\t\tdeployerSeed\n\t\t);\n\t\tawait checkWalletBalance(network, config, walletAddress, false);\n\n\t\tconst deploymentResult = await deployWithIotaCli(config.deployment.gasBudget);\n\n\t\tcontractData.deployedPackageId = deploymentResult.packageId;\n\t\tcontractData.upgradeCapabilityId = deploymentResult.upgradeCap;\n\n\t\tif (deploymentResult.migrationStateId) {\n\t\t\tcontractData.migrationStateId = deploymentResult.migrationStateId;\n\t\t}\n\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.deployedPackageIdResult\"),\n\t\t\tdeploymentResult.packageId,\n\t\t\t1\n\t\t);\n\t\tif (deploymentResult.upgradeCap) {\n\t\t\tCLIDisplay.value(\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.upgradeCapabilityIdResult\"),\n\t\t\t\tdeploymentResult.upgradeCap,\n\t\t\t\t1\n\t\t\t);\n\t\t}\n\t\tif (contractData.migrationStateId) {\n\t\t\tCLIDisplay.value(\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.migrationStateIdResult\"),\n\t\t\t\tcontractData.migrationStateId,\n\t\t\t\t1\n\t\t\t);\n\t\t}\n\t} catch (err) {\n\t\tthrow new GeneralError(\n\t\t\t\"commands\",\n\t\t\t\"commands.deploy.deploymentFailed\",\n\t\t\t{ contract: contractName },\n\t\t\terr\n\t\t);\n\t}\n}\n\n/**\n * Determine the deployment strategy based on contract state.\n * @param contractData Contract data to analyze.\n * @returns Deployment strategy: initial-deploy, upgrade or already-deployed.\n */\nasync function determineDeploymentStrategy(\n\tcontractData: IContractData\n): Promise<\"initial-deploy\" | \"upgrade\" | \"already-deployed\"> {\n\tif (Is.stringValue(contractData.deployedPackageId)) {\n\t\treturn \"already-deployed\";\n\t}\n\n\tif (Is.stringValue(contractData.lastDeployedPackageId)) {\n\t\treturn \"upgrade\";\n\t}\n\n\treturn \"initial-deploy\";\n}\n\n/**\n * Query the on-chain UpgradeCap object to get the actual latest package ID.\n * This is used to validate/correct the `published-at` value before upgrades,\n * preventing failures when the deployment JSON is stale.\n * @param rpcUrl RPC endpoint URL for the network.\n * @param upgradeCapabilityId The UpgradeCap object ID on-chain.\n * @returns The on-chain package ID and version, or undefined if query fails.\n */\nasync function queryUpgradeCapPackage(\n\trpcUrl: string,\n\tupgradeCapabilityId: string\n): Promise<{ package: string; version: number } | undefined> {\n\ttry {\n\t\tconst client = new IotaClient({ url: rpcUrl });\n\t\tconst response = await client.getObject({\n\t\t\tid: upgradeCapabilityId,\n\t\t\toptions: { showContent: true }\n\t\t});\n\n\t\tif (response.data?.content?.dataType === \"moveObject\") {\n\t\t\tconst fields = response.data.content.fields as { [key: string]: unknown };\n\t\t\tconst fieldPackage = Coerce.string(fields.package);\n\t\t\tconst fieldVersion = Coerce.number(fields.version);\n\t\t\tif (Is.stringValue(fieldPackage) && Is.number(fieldVersion)) {\n\t\t\t\treturn {\n\t\t\t\t\tpackage: fieldPackage,\n\t\t\t\t\tversion: fieldVersion\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t} catch {\n\t\t// If query fails (e.g. network issue), return undefined to fall back to JSON value\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Execute contract upgrade using iota client upgrade command.\n * @param contractData Contract data containing upgrade capability.\n * @param config Network configuration.\n * @returns Upgrade result with package ID and upgrade capability.\n */\nasync function executeContractUpgrade(\n\tcontractData: IContractData,\n\tconfig: INetworkConfig\n): Promise<{ packageId: string; upgradeCap: string; migrationStateId?: string }> {\n\t// Start with lastDeployedPackageId from JSON as the candidate for \"published-at\"\n\tlet publishedAtPackageId = contractData.lastDeployedPackageId;\n\n\t// Query the on-chain UpgradeCap to get the actual latest package ID.\n\t// This prevents failures when the JSON is stale\n\tif (Is.stringValue(contractData.upgradeCapabilityId)) {\n\t\tCLIDisplay.task(I18n.formatMessage(\"commands.deploy.progress.queryingUpgradeCap\"));\n\t\tconst onChainCap = await queryUpgradeCapPackage(\n\t\t\tconfig.rpc.url,\n\t\t\tcontractData.upgradeCapabilityId\n\t\t);\n\t\tif (onChainCap) {\n\t\t\tCLIDisplay.value(\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.onChainPackageId\"),\n\t\t\t\tonChainCap.package,\n\t\t\t\t1\n\t\t\t);\n\t\t\tCLIDisplay.value(\n\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.onChainVersion\"),\n\t\t\t\tString(onChainCap.version),\n\t\t\t\t1\n\t\t\t);\n\n\t\t\tif (publishedAtPackageId !== onChainCap.package) {\n\t\t\t\tCLIDisplay.value(\n\t\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.warning\"),\n\t\t\t\t\tI18n.formatMessage(\"commands.deploy.messages.staleJsonDetected\", {\n\t\t\t\t\t\tjsonPackageId: publishedAtPackageId ?? \"none\",\n\t\t\t\t\t\tonChainPackageId: onChainCap.package\n\t\t\t\t\t}),\n\t\t\t\t\t2\n\t\t\t\t);\n\t\t\t\tpublishedAtPackageId = onChainCap.package;\n\t\t\t\tcontractData.lastDeployedPackageId = onChainCap.package;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!publishedAtPackageId) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.noPreviousDeploymentForUpgrade\");\n\t}\n\n\tconst moveTomlPaths: string[] = [];\n\tawait searchDirectoryForMoveToml(process.cwd(), moveTomlPaths);\n\n\tif (moveTomlPaths.length === 0) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.noMoveTomlFilesFound\", {\n\t\t\tcurrentDir: process.cwd()\n\t\t});\n\t}\n\n\tconst currentDirMoveToml = path.join(process.cwd(), \"Move.toml\");\n\tconst selectedMoveToml = moveTomlPaths.find(p => p === currentDirMoveToml) ?? moveTomlPaths[0];\n\tconst moveTomlPath = selectedMoveToml;\n\tconst projectRoot = path.dirname(moveTomlPath);\n\n\tconst backupPath = await backupMoveToml(moveTomlPath);\n\n\ttry {\n\t\t// Update Move.toml with \"published-at\" = validated package ID (from chain or JSON)\n\t\tawait updateMoveTomlPublishedAt(moveTomlPath, publishedAtPackageId);\n\n\t\tawait validateContractIsBuilt(contractData, projectRoot);\n\n\t\t// Execute upgrade command\n\t\tconst upgradeCapabilityId = contractData.upgradeCapabilityId;\n\t\tif (!upgradeCapabilityId) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.upgradeCapabilityNotFound\");\n\t\t}\n\t\tconst upgradeResult = await executeUpgradeWithIotaCli(\n\t\t\tupgradeCapabilityId,\n\t\t\tconfig.deployment.gasBudget,\n\t\t\tprojectRoot\n\t\t);\n\n\t\t// Update contract data with new package ID\n\t\tcontractData.deployedPackageId = upgradeResult.packageId;\n\n\t\treturn upgradeResult;\n\t} finally {\n\t\t// Always restore original Move.toml\n\t\tawait restoreMoveToml(moveTomlPath, backupPath);\n\t}\n}\n\n/**\n * Execute upgrade using iota client upgrade command.\n * @param upgradeCapabilityId Upgrade capability ID.\n * @param gasBudget Gas budget for upgrade.\n * @param moveProjectRoot Move project root directory.\n * @returns Upgrade result.\n */\nasync function executeUpgradeWithIotaCli(\n\tupgradeCapabilityId: string,\n\tgasBudget: number,\n\tmoveProjectRoot: string\n): Promise<{ packageId: string; upgradeCap: string; migrationStateId?: string }> {\n\t// Clean build artifacts and lock files before upgrade to prevent permission issues\n\tawait cleanBuildArtifactsInPath(moveProjectRoot);\n\n\tconst upgradeCmd = `iota client upgrade --upgrade-capability ${upgradeCapabilityId} . --gas-budget ${gasBudget} --json`;\n\n\tCLIDisplay.value(I18n.formatMessage(\"commands.deploy.labels.publishCommand\"), upgradeCmd, 1);\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.workingDirectory\"),\n\t\tmoveProjectRoot,\n\t\t1\n\t);\n\n\ttry {\n\t\tconst { stdout: output } = await execAsyncWithError(upgradeCmd, {\n\t\t\tcwd: moveProjectRoot\n\t\t});\n\t\tconst result = JSON.parse(output);\n\n\t\t// Parse upgrade response (different from publish response)\n\t\tconst packageId = result.objectChanges?.find(\n\t\t\t(change: { type: string; packageId?: string }) => change.type === \"published\"\n\t\t)?.packageId;\n\n\t\tif (!packageId) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.upgradePackageIdNotFound\", { result });\n\t\t}\n\n\t\t// UpgradeCap persists with same ID\n\t\tconst upgradeCap = upgradeCapabilityId;\n\n\t\treturn { packageId, upgradeCap };\n\t} catch (err) {\n\t\t// Clean up on error too\n\t\tawait cleanBuildArtifactsInPath(moveProjectRoot);\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.upgradeFailed\", undefined, err);\n\t}\n}\n\n/**\n * Backup Move.toml file.\n * @param moveTomlPath Path to Move.toml file.\n * @returns Path to backup file.\n */\nasync function backupMoveToml(moveTomlPath: string): Promise<string> {\n\tconst backupPath = `${moveTomlPath}.backup.${Date.now()}`;\n\tawait fsPromises.copyFile(moveTomlPath, backupPath);\n\treturn backupPath;\n}\n\n/**\n * Restore Move.toml file from backup.\n * @param moveTomlPath Path to Move.toml file.\n * @param backupPath Path to backup file.\n */\nasync function restoreMoveToml(moveTomlPath: string, backupPath: string): Promise<void> {\n\tawait fsPromises.copyFile(backupPath, moveTomlPath);\n\tawait fsPromises.unlink(backupPath);\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.moveTomlRestored\"),\n\t\tI18n.formatMessage(\"commands.deploy.messages.originalConfigurationRestored\"),\n\t\t1\n\t);\n}\n\n/**\n * Update Move.toml published-at field.\n * @param moveTomlPath Path to Move.toml file.\n * @param publishedAt Published-at value to set.\n */\nasync function updateMoveTomlPublishedAt(moveTomlPath: string, publishedAt: string): Promise<void> {\n\tconst content = await fsPromises.readFile(moveTomlPath, \"utf-8\");\n\n\t// Parse TOML and update \"published-at\" field\n\tconst lines = content.split(\"\\n\");\n\tlet updated = false;\n\n\tfor (let i = 0; i < lines.length; i++) {\n\t\tif (lines[i].trim().startsWith(\"published-at\")) {\n\t\t\tlines[i] = `published-at = \"${publishedAt}\"`;\n\t\t\tupdated = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!updated) {\n\t\t// Add \"published-at\" to \"[package]\" section\n\t\tconst packageSectionIndex = lines.findIndex(line => line.trim() === \"[package]\");\n\t\tif (packageSectionIndex >= 0) {\n\t\t\tlines.splice(packageSectionIndex + 1, 0, `published-at = \"${publishedAt}\"`);\n\t\t}\n\t}\n\n\tawait fsPromises.writeFile(moveTomlPath, lines.join(\"\\n\"));\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.moveTomlUpdated\"),\n\t\t`published-at = \"${publishedAt}\"`,\n\t\t1\n\t);\n}\n\n/**\n * Validate that contract has been built.\n * @param contractData Contract data to validate.\n * @param projectRoot Project root directory.\n */\nasync function validateContractIsBuilt(\n\tcontractData: IContractData,\n\tprojectRoot: string\n): Promise<void> {\n\t// Check if build directory exists and has been built\n\tconst buildDir = path.join(projectRoot, \"build\");\n\ttry {\n\t\tconst stats = await fsPromises.stat(buildDir);\n\t\tif (!stats.isDirectory()) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.buildPathNotDirectory\", {\n\t\t\t\tbuildDir\n\t\t\t});\n\t\t}\n\t} catch {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.contractNotBuilt\", {\n\t\t\tprojectRoot\n\t\t});\n\t}\n\n\t// Verify that the contract data has current packageId (build should have been run)\n\tif (!contractData.packageId || !contractData.packageBytecode) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.contractDataOutdated\");\n\t}\n\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.buildValidation\"),\n\t\tI18n.formatMessage(\"commands.deploy.messages.contractBuiltAndReadyForUpgrade\"),\n\t\t1\n\t);\n}\n\n/**\n * Handle contract upgrade execution.\n * @param contractName Name of the contract.\n * @param contractData Contract data.\n * @param config Network configuration.\n * @param network Target network.\n * @param faucetUrl The faucet URL (optional, defaults to network-specific URL).\n * @param deployerMnemonic The deployer mnemonic from environment variables.\n * @param deployerSeed The deployer seed from environment variables (optional).\n */\nasync function handleContractUpgrade(\n\tcontractName: string,\n\tcontractData: IContractData,\n\tconfig: INetworkConfig,\n\tnetwork: NetworkTypes,\n\tfaucetUrl?: string,\n\tdeployerMnemonic?: string,\n\tdeployerSeed?: string\n): Promise<void> {\n\tCLIDisplay.task(`Upgrading contract: ${contractName}`);\n\n\tconst walletAddress = await validateEnvironmentForNetwork(\n\t\tnetwork,\n\t\tconfig,\n\t\tfalse,\n\t\tfaucetUrl,\n\t\tdeployerMnemonic,\n\t\tdeployerSeed\n\t);\n\tawait checkWalletBalance(network, config, walletAddress, false);\n\n\tconst upgradeResult = await executeContractUpgrade(contractData, config);\n\n\t// Update contract data with upgrade chain tracking\n\tcontractData.deployedPackageId = upgradeResult.packageId;\n\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.upgradeSuccessful\"),\n\t\tupgradeResult.packageId,\n\t\t1\n\t);\n\tif (contractData.lastDeployedPackageId) {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.previousDeployment\"),\n\t\t\tcontractData.lastDeployedPackageId,\n\t\t\t1\n\t\t);\n\t}\n\tif (contractData.upgradeCapabilityId) {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.upgradeCapabilityPreserved\"),\n\t\t\tcontractData.upgradeCapabilityId,\n\t\t\t1\n\t\t);\n\t}\n}\n\n/**\n * Deploy a single contract.\n * @param contractName Name of the contract\n * @param contractData Contract compilation data\n * @param contractData.packageId Package ID\n * @param contractData.packageBytecode Package bytecode\n * @param contractData.deployedPackageId Deployed package ID\n * @param config Network configuration\n * @param network Target network\n * @param dryRun Whether this is a dry run\n * @param force Whether to force redeployment\n * @param faucetUrl The faucet URL (optional, defaults to network-specific URL).\n * @param deployerMnemonic The deployer mnemonic from environment variables.\n * @param deployerSeed The deployer seed from environment variables (optional).\n */\nasync function deployContract(\n\tcontractName: string,\n\tcontractData: IContractData,\n\tconfig: INetworkConfig,\n\tnetwork: NetworkTypes,\n\tdryRun: boolean,\n\tforce: boolean,\n\tfaucetUrl?: string,\n\tdeployerMnemonic?: string,\n\tdeployerSeed?: string\n): Promise<void> {\n\tCLIDisplay.task(\n\t\tI18n.formatMessage(\"commands.deploy.progress.deployingContract\", { contractName, network })\n\t);\n\n\tconst strategy = await determineDeploymentStrategy(contractData);\n\n\tif (strategy === \"already-deployed\" && !force) {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.contractStatus\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.messages.contractAlreadyDeployed\"),\n\t\t\t1\n\t\t);\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.upgradeGuidance\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.messages.upgradeGuidanceMessage\"),\n\t\t\t1\n\t\t);\n\t\treturn;\n\t}\n\n\t// Show deployment strategy\n\tCLIDisplay.section(I18n.formatMessage(\"commands.deploy.labels.smartDeployAnalysis\"));\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.upgradeCapability\"),\n\t\tcontractData.upgradeCapabilityId ??\n\t\t\tI18n.formatMessage(\"commands.deploy.messages.noneInitialDeployment\")\n\t);\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.currentDeployment\"),\n\t\tcontractData.deployedPackageId ??\n\t\t\tI18n.formatMessage(\"commands.deploy.messages.noneNeedsDeploymentUpgrade\")\n\t);\n\tCLIDisplay.value(I18n.formatMessage(\"commands.deploy.labels.detectedStrategy\"), strategy);\n\n\tif (dryRun) {\n\t\tawait handleDryRunValidation(\n\t\t\tcontractName,\n\t\t\tcontractData,\n\t\t\tconfig,\n\t\t\tnetwork,\n\t\t\tfaucetUrl,\n\t\t\tdeployerMnemonic,\n\t\t\tdeployerSeed\n\t\t);\n\t\treturn;\n\t}\n\n\tif (strategy === \"upgrade\") {\n\t\tawait handleContractUpgrade(\n\t\t\tcontractName,\n\t\t\tcontractData,\n\t\t\tconfig,\n\t\t\tnetwork,\n\t\t\tfaucetUrl,\n\t\t\tdeployerMnemonic,\n\t\t\tdeployerSeed\n\t\t);\n\t} else {\n\t\tawait handleActualDeployment(\n\t\t\tcontractName,\n\t\t\tcontractData,\n\t\t\tconfig,\n\t\t\tnetwork,\n\t\t\tfaucetUrl,\n\t\t\tdeployerMnemonic,\n\t\t\tdeployerSeed\n\t\t);\n\t}\n}\n\n/**\n * Get wallet address for deployment, preferring seed over mnemonic if available.\n * @param network The target network.\n * @param addressIndex The address index to derive.\n * @param deployerMnemonic The deployer mnemonic from environment variables.\n * @param deployerSeed The deployer seed from environment variables (optional).\n * @returns The wallet address.\n */\nasync function getDeploymentWalletAddress(\n\tnetwork: NetworkTypes,\n\taddressIndex: number,\n\tdeployerMnemonic?: string,\n\tdeployerSeed?: string\n): Promise<string> {\n\tconst vault = setupVault();\n\n\t// Try to use seed first if available\n\tconst hexSeed = await getDeploymentSeed(network, deployerSeed);\n\tlet seed: Uint8Array | undefined;\n\tif (Is.stringValue(hexSeed)) {\n\t\tseed = Converter.hexToBytes(hexSeed);\n\t} else {\n\t\tconst mnemonic = await getDeploymentMnemonic(network, deployerMnemonic);\n\t\tawait vault.setSecret(\"deployment/mnemonic\", mnemonic);\n\n\t\tseed = Bip39.mnemonicToSeed(mnemonic);\n\t}\n\tawait vault.setSecret(\"deployment/seed\", seed);\n\n\treturn Iota.getAddress(vault, {}, \"deployment\", 0, addressIndex);\n}\n\n/**\n * Setup vault connectors for storing deployment keys and secrets.\n * @returns An instance of IVaultConnector for use in deployment.\n */\nfunction setupVault(): IVaultConnector {\n\tinitSchema();\n\n\tconst keyEntityStorage = new MemoryEntityStorageConnector<VaultKey>({\n\t\tentitySchema: nameof<VaultKey>(),\n\t\tconfig: { storageKey: \"vault-key\" }\n\t});\n\tconst secretEntityStorage = new MemoryEntityStorageConnector<VaultSecret>({\n\t\tentitySchema: nameof<VaultSecret>(),\n\t\tconfig: { storageKey: \"vault-secret\" }\n\t});\n\n\tEntityStorageConnectorFactory.register(\"vault-key\", () => keyEntityStorage);\n\tEntityStorageConnectorFactory.register(\"vault-secret\", () => secretEntityStorage);\n\n\treturn new EntityStorageVaultConnector();\n}\n\n/**\n * Convert nanos to IOTA (1 IOTA = 1,000,000,000 nanos).\n * @param nanos Balance in nanos.\n * @returns Balance in IOTA.\n */\nfunction nanosToIota(nanos: number): number {\n\treturn nanos / 1_000_000_000;\n}\n\n/**\n * Request funds from the faucet for testnet or devnet deployment.\n * @param network The target network (testnet or devnet).\n * @param walletAddress The wallet address to fund.\n * @param rpcUrl The RPC URL for the network.\n * @param faucetUrl The faucet URL (optional, defaults to network-specific URL).\n * @returns Promise that resolves when funding is complete.\n */\nasync function requestFaucetFunds(\n\tnetwork: NetworkTypes,\n\twalletAddress: string,\n\trpcUrl: string,\n\tfaucetUrl: string\n): Promise<void> {\n\tCLIDisplay.task(\n\t\tI18n.formatMessage(\"commands.deploy.progress.requestingFaucetFunds\", { network })\n\t);\n\n\tconst response = await requestIotaFromFaucetV0({\n\t\thost: faucetUrl,\n\t\trecipient: walletAddress\n\t});\n\n\tif (response?.error) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.fundingFailed\", undefined, response.error);\n\t}\n\n\tconst client = new IotaClient({ url: rpcUrl });\n\tconst balanceResponse = await client.getBalance({ owner: walletAddress });\n\tconst balanceInNanos = Number(balanceResponse.totalBalance);\n\n\tif (balanceInNanos > 0) {\n\t\tconst amountInIota = nanosToIota(balanceInNanos);\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.faucetFundsRequested\"),\n\t\t\t`${amountInIota.toFixed(2)} IOTA`,\n\t\t\t1\n\t\t);\n\t} else {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.warning\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.faucetNoFundsAdded\", { network }),\n\t\t\t2\n\t\t);\n\t}\n}\n\n/**\n * Check wallet balance and request faucet funds only if needed.\n * @param network The target network (testnet or devnet).\n * @param config Network configuration.\n * @param walletAddress The wallet address to check and potentially fund.\n * @param faucetUrl The faucet URL (optional, defaults to network-specific URL).\n * @returns Promise that resolves when balance check and optional funding is complete.\n */\nasync function checkBalanceAndRequestFaucetIfNeeded(\n\tnetwork: NetworkTypes,\n\tconfig: INetworkConfig,\n\twalletAddress: string,\n\tfaucetUrl?: string\n): Promise<void> {\n\t// Check current balance\n\tconst client = new IotaClient({ url: config.rpc.url });\n\tconst balanceResponse = await client.getBalance({ owner: walletAddress });\n\tconst balanceInNanos = Number(balanceResponse.totalBalance);\n\tconst requiredInNanos = config.deployment.gasBudget;\n\t// Convert to IOTA for display purposes\n\tconst balanceInIota = nanosToIota(balanceInNanos);\n\tconst requiredInIota = nanosToIota(requiredInNanos);\n\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.walletBalance\"),\n\t\t`${balanceInIota.toFixed(2)} IOTA`,\n\t\t1\n\t);\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.gasBudget\"),\n\t\t`${requiredInIota.toFixed(2)} IOTA`,\n\t\t1\n\t);\n\n\t// Only request faucet funds if balance is insufficient (compare in same units - nanos)\n\tif (balanceInNanos < requiredInNanos) {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.warning\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.insufficientBalance\", {\n\t\t\t\tcurrentBalance: balanceInIota.toFixed(2),\n\t\t\t\trequiredBalance: requiredInIota.toFixed(2)\n\t\t\t}),\n\t\t\t1\n\t\t);\n\n\t\tif (!Is.stringValue(faucetUrl)) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.noFaucetConfigured\");\n\t\t}\n\n\t\tCLIDisplay.task(I18n.formatMessage(\"commands.deploy.progress.requestingAdditionalFaucetFunds\"));\n\t\tawait requestFaucetFunds(network, walletAddress, config.rpc.url, faucetUrl);\n\n\t\t// Check balance again after faucet request\n\t\tconst updatedBalanceResponse = await client.getBalance({ owner: walletAddress });\n\t\tconst updatedBalanceInNanos = Number(updatedBalanceResponse.totalBalance);\n\t\tconst updatedBalanceInIota = nanosToIota(updatedBalanceInNanos);\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.updatedWalletBalance\"),\n\t\t\t`${updatedBalanceInIota.toFixed(2)} IOTA`,\n\t\t\t1\n\t\t);\n\t} else {\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.balanceCheck\"),\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.sufficientFundsAvailable\"),\n\t\t\t1\n\t\t);\n\t}\n}\n\n/**\n * Deploy contract using IOTA CLI.\n * @param gasBudget Gas budget for deployment.\n * @returns Deployment result with package ID, upgrade cap, and migration state ID.\n */\nasync function deployWithIotaCli(\n\tgasBudget: number\n): Promise<{ packageId: string; upgradeCap?: string; migrationStateId?: string }> {\n\t// Find the Move project directory\n\tconst moveTomlPaths: string[] = [];\n\tconst cwd = process.cwd();\n\tawait searchDirectoryForMoveToml(cwd, moveTomlPaths);\n\n\tif (moveTomlPaths.length === 0) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.noMoveTomlFilesFound\", {\n\t\t\tcurrentDir: cwd\n\t\t});\n\t}\n\n\t// Prioritize Move.toml in current directory, then use first found\n\tconst currentDirMoveToml = path.join(cwd, \"Move.toml\");\n\tconst selectedMoveToml = moveTomlPaths.find(p => p === currentDirMoveToml) ?? moveTomlPaths[0];\n\n\t// Use the actual Move project directory\n\tconst moveProjectRoot = path.dirname(selectedMoveToml);\n\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.moveProjectRoot\"),\n\t\tmoveProjectRoot,\n\t\t1\n\t);\n\n\tconst publishCmd = `iota client publish --gas-budget ${gasBudget} --json`;\n\n\tCLIDisplay.value(I18n.formatMessage(\"commands.deploy.labels.publishCommand\"), publishCmd, 1);\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.workingDirectory\"),\n\t\tmoveProjectRoot,\n\t\t1\n\t);\n\n\ttry {\n\t\tconst { stdout: output } = await execAsyncWithError(publishCmd, { cwd: moveProjectRoot });\n\t\tconst result = JSON.parse(output);\n\n\t\t// Extract package ID from published object\n\t\tconst packageId = result.objectChanges?.find(\n\t\t\t(change: { type: string; packageId?: string }) => change.type === \"published\"\n\t\t)?.packageId;\n\n\t\tif (!packageId) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.packageIdNotFound\", {\n\t\t\t\tresult\n\t\t\t});\n\t\t}\n\n\t\t// Extract UpgradeCap ID from created objects\n\t\tconst upgradeCap = result.objectChanges?.find(\n\t\t\t(change: { objectType?: string; objectId?: string }) =>\n\t\t\t\tchange.objectType === \"0x2::package::UpgradeCap\"\n\t\t)?.objectId;\n\n\t\t// Extract MigrationState ID from created objects\n\t\tconst migrationStateId = result.objectChanges?.find(\n\t\t\t(change: { objectType?: string; objectId?: string }) =>\n\t\t\t\tchange.objectType?.endsWith(\"::MigrationState\")\n\t\t)?.objectId;\n\n\t\treturn {\n\t\t\tpackageId,\n\t\t\tupgradeCap,\n\t\t\tmigrationStateId\n\t\t};\n\t} catch (err) {\n\t\tthrow new GeneralError(\"commands\", \"commands.deploy.deploymentFailed\", undefined, err);\n\t}\n}\n\n/**\n * Update contracts file with deployed package IDs.\n * @param contractsPath Path to contracts file.\n * @param contractsData Updated contracts data.\n */\nasync function updateContractsFile(\n\tcontractsPath: string,\n\tcontractsData: ISmartContractDeployments\n): Promise<void> {\n\ttry {\n\t\tawait CLIUtils.writeJsonFile(contractsPath, contractsData, false);\n\t\tCLIDisplay.value(\n\t\t\tI18n.formatMessage(\"commands.deploy.labels.updatedContractsFile\"),\n\t\t\tcontractsPath,\n\t\t\t1\n\t\t);\n\t} catch (err) {\n\t\tthrow new GeneralError(\n\t\t\t\"commands\",\n\t\t\t\"commands.deploy.contractsFileUpdateFailed\",\n\t\t\t{ contractsPath },\n\t\t\terr\n\t\t);\n\t}\n}\n\n/**\n * Generate a unique backup alias that doesn't conflict with existing keys.\n * Uses cryptographically secure random bytes to avoid conflicts.\n * @param baseAlias The original alias name.\n * @param existingKeys Array of existing keys from keystore.\n * @returns A unique backup alias name.\n */\nexport function generateUniqueBackupAlias(\n\tbaseAlias: string,\n\texistingKeys: { alias: string; iotaAddress: string }[]\n): string {\n\tconst existingAliases = new Set(existingKeys.map(key => key.alias));\n\n\t// Generate cryptographically secure random identifier\n\tconst randomSuffix = Converter.bytesToHex(RandomHelper.generate(4));\n\tconst backupAlias = `${baseAlias}-backup-${randomSuffix}`;\n\n\t// In the extremely unlikely event of collision, add timestamp\n\tif (existingAliases.has(backupAlias)) {\n\t\treturn `${baseAlias}-backup-${Date.now()}-${randomSuffix}`;\n\t}\n\n\treturn backupAlias;\n}\n\n/**\n * Ensure the correct deployer key exists in the keystore with the expected address.\n * If a conflicting alias exists, rename it and import the correct key.\n * @param network The target network.\n * @param aliasName The desired alias name (e.g., \"deployer-testnet\").\n * @param expectedAddress The expected address from the current mnemonic.\n * @param addressIndex The address index to use.\n * @param deployerMnemonic The deployer mnemonic.\n */\nexport async function ensureCorrectDeployerKey(\n\tnetwork: NetworkTypes,\n\taliasName: string,\n\texpectedAddress: string,\n\taddressIndex: number,\n\tdeployerMnemonic: string\n): Promise<void> {\n\ttry {\n\t\t// Check if the alias already exists in keystore\n\t\tconst { stdout: keysListOutput } = await execAsyncWithError(\"iota keytool list --json\");\n\t\tconst keysList = JSON.parse(keysListOutput);\n\n\t\t// Find existing key with the target alias\n\t\tconst existingKey = keysList.find(\n\t\t\t(key: { alias: string; iotaAddress: string }) => key.alias === aliasName\n\t\t);\n\n\t\tif (existingKey) {\n\t\t\t// Check if existing key has the correct address\n\t\t\tconst existingAddress = existingKey.iotaAddress;\n\n\t\t\tif (existingAddress !== expectedAddress) {\n\t\t\t\t// Conflicting alias exists with wrong mnemonic - rename it\n\t\t\t\tCLIDisplay.task(\n\t\t\t\t\tI18n.formatMessage(\"commands.deploy.progress.renamingConflictingKey\", { aliasName })\n\t\t\t\t);\n\n\t\t\t\tconst backupAlias = generateUniqueBackupAlias(aliasName, keysList);\n\t\t\t\tawait execAsyncWithError(`iota keytool update-alias \"${aliasName}\" \"${backupAlias}\"`);\n\n\t\t\t\tCLIDisplay.value(\n\t\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.renamedExistingKey\"),\n\t\t\t\t\t`${aliasName} → ${backupAlias} (${existingAddress})`,\n\t\t\t\t\t1\n\t\t\t\t);\n\n\t\t\t\t// Now import the correct key with the desired alias\n\t\t\t\tawait importCorrectDeployerKey(\n\t\t\t\t\tnetwork,\n\t\t\t\t\taliasName,\n\t\t\t\t\taddressIndex,\n\t\t\t\t\texpectedAddress,\n\t\t\t\t\tdeployerMnemonic\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// Existing key is correct - no action needed\n\t\t\t\tCLIDisplay.value(\n\t\t\t\t\tI18n.formatMessage(\"commands.deploy.labels.usingExistingCorrectKey\"),\n\t\t\t\t\t`${aliasName} (${expectedAddress})`,\n\t\t\t\t\t1\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\t// No existing alias - import the key\n\t\t\tawait importCorrectDeployerKey(\n\t\t\t\tnetwork,\n\t\t\t\taliasName,\n\t\t\t\taddressIndex,\n\t\t\t\texpectedAddress,\n\t\t\t\tdeployerMnemonic\n\t\t\t);\n\t\t}\n\n\t\t// Verify the address exists in client addresses\n\t\tconst { stdout: addressListOutput } = await execAsyncWithError(\"iota client addresses --json\");\n\t\tconst addressInfo = JSON.parse(addressListOutput);\n\t\tconst addressExists: boolean = addressInfo.addresses.some(\n\t\t\t([a, addr]: [string, string]) => addr === expectedAddress\n\t\t);\n\n\t\tif (!addressExists) {\n\t\t\tthrow new GeneralError(\"commands\", \"commands.deploy.addressNotInClient\", {\n\t\t\t\texpectedAddress,\n\t\t\t\taliasName\n\t\t\t});\n\t\t}\n\t} catch (error) {\n\t\tthrow new GeneralError(\n\t\t\t\"commands\",\n\t\t\t\"commands.deploy.deployerKeySetupFailed\",\n\t\t\t{ network, aliasName, expectedAddress },\n\t\t\terror\n\t\t);\n\t}\n}\n\n/**\n * Import the deployer key with the correct mnemonic.\n * @param network The target network.\n * @param aliasName The alias name to use.\n * @param addressIndex The address index.\n * @param targetAddress The expected target address (avoids redundant calculation).\n * @param deployerMnemonic The deployer mnemonic.\n */\nasync function importCorrectDeployerKey(\n\tnetwork: NetworkTypes,\n\taliasName: string,\n\taddressIndex: number,\n\ttargetAddress: string,\n\tdeployerMnemonic: string\n): Promise<void> {\n\tCLIDisplay.task(\n\t\tI18n.formatMessage(\"commands.deploy.progress.importingDeployerKey\", { aliasName })\n\t);\n\n\tconst mnemonic = await getDeploymentMnemonic(network, deployerMnemonic);\n\tconst derivationPath = Bip44.path(Iota.DEFAULT_COIN_TYPE, 0, false, addressIndex).toString();\n\n\tawait execAsyncWithError(\n\t\t`iota keytool import \"${mnemonic}\" ed25519 \"${derivationPath}\" --alias \"${aliasName}\"`\n\t);\n\n\tCLIDisplay.value(\n\t\tI18n.formatMessage(\"commands.deploy.labels.importedDeployerKey\"),\n\t\t`${aliasName} (${targetAddress})`,\n\t\t1\n\t);\n}\n"]}
|
package/dist/es/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export * from "./cli.js";
|
|
4
4
|
export * from "./commands/build.js";
|
|
5
5
|
export * from "./commands/deploy.js";
|
|
6
|
+
export * from "./models/IContractConfig.js";
|
|
6
7
|
export * from "./models/INetworkConfig.js";
|
|
7
8
|
export * from "./utils/envSetup.js";
|
|
8
9
|
export * from "./utils/iotaUtils.js";
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./cli.js\";\nexport * from \"./commands/build.js\";\nexport * from \"./commands/deploy.js\";\nexport * from \"./models/IContractConfig.js\";\nexport * from \"./models/INetworkConfig.js\";\nexport * from \"./utils/envSetup.js\";\nexport * from \"./utils/iotaUtils.js\";\nexport * from \"./utils/moveToJsonUtils.js\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IContractConfig.js","sourceRoot":"","sources":["../../../src/models/IContractConfig.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Contract configuration interface\n */\nexport interface IContractConfig {\n\t/**\n\t * The module name\n\t */\n\tmoduleName: string;\n\t/**\n\t * The dependencies\n\t */\n\tdependencies?: string[];\n\t/**\n\t * The package controller configuration\n\t */\n\tpackageController?: {\n\t\taddressIndex: number;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"INetworkConfig.js","sourceRoot":"","sources":["../../../src/models/INetworkConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { NetworkTypes } from \"@twin.org/dlt-iota\";\n\n/**\n * Network configuration interface\n */\nexport interface INetworkConfig {\n\t/**\n\t * The network type\n\t */\n\tnetwork: NetworkTypes;\n\t/**\n\t * The platform type\n\t */\n\tplatform: \"iota\";\n\t/**\n\t * The RPC configuration\n\t */\n\trpc: {\n\t\turl: string;\n\t\ttimeout?: number;\n\t};\n\t/**\n\t * The deployment configuration\n\t */\n\tdeployment: {\n\t\tgasBudget: number;\n\t\tconfirmationTimeout?: number;\n\t\twallet: {\n\t\t\taddressIndex: number;\n\t\t};\n\t\tgasStation?: {\n\t\t\turl: string;\n\t\t\tauthToken: string;\n\t\t};\n\t};\n\t/**\n\t * The contracts configuration\n\t */\n\tcontracts?: {\n\t\t[key: string]:
|
|
1
|
+
{"version":3,"file":"INetworkConfig.js","sourceRoot":"","sources":["../../../src/models/INetworkConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { NetworkTypes } from \"@twin.org/dlt-iota\";\nimport type { IContractConfig } from \"./IContractConfig.js\";\n\n/**\n * Network configuration interface\n */\nexport interface INetworkConfig {\n\t/**\n\t * The network type\n\t */\n\tnetwork: NetworkTypes;\n\t/**\n\t * The platform type\n\t */\n\tplatform: \"iota\";\n\t/**\n\t * The RPC configuration\n\t */\n\trpc: {\n\t\turl: string;\n\t\ttimeout?: number;\n\t};\n\t/**\n\t * The deployment configuration\n\t */\n\tdeployment: {\n\t\tgasBudget: number;\n\t\tconfirmationTimeout?: number;\n\t\twallet: {\n\t\t\taddressIndex: number;\n\t\t};\n\t\tgasStation?: {\n\t\t\turl: string;\n\t\t\tauthToken: string;\n\t\t};\n\t};\n\t/**\n\t * The contracts configuration\n\t */\n\tcontracts?: {\n\t\t[key: string]: IContractConfig;\n\t};\n}\n"]}
|
package/dist/locales/en.json
CHANGED
|
@@ -108,6 +108,9 @@
|
|
|
108
108
|
"bigint": "Property \"{property}\" must be a bigint, it is \"{value}\"",
|
|
109
109
|
"boolean": "Property \"{property}\" must be a boolean, it is \"{value}\"",
|
|
110
110
|
"date": "Property \"{property}\" must be a date, it is \"{value}\"",
|
|
111
|
+
"dateString": "Property \"{property}\" must be a date-only string in ISO 8601 format, it is \"{value}\"",
|
|
112
|
+
"dateTimeString": "Property \"{property}\" must be a date-time string in ISO 8601 format, it is \"{value}\"",
|
|
113
|
+
"timeString": "Property \"{property}\" must be a time string in ISO 8601 format, it is \"{value}\"",
|
|
111
114
|
"timestampMilliseconds": "Property \"{property}\" must be a timestamp in milliseconds, it is \"{value}\"",
|
|
112
115
|
"timestampSeconds": "Property \"{property}\" must be a timestamp in seconds, it is \"{value}\"",
|
|
113
116
|
"objectUndefined": "Property \"{property}\" must be an object, it is \"undefined\"",
|
|
@@ -120,11 +123,12 @@
|
|
|
120
123
|
"arrayEndsWith": "Property \"{property}\" must be an array ending with [{endValues}], it is \"{value}\"",
|
|
121
124
|
"uint8Array": "Property \"{property}\" must be a Uint8Array, it is \"{value}\"",
|
|
122
125
|
"function": "Property \"{property}\" must be a function, it is \"{value}\"",
|
|
123
|
-
"urn": "Property \"{property}\" must be a
|
|
124
|
-
"url": "Property \"{property}\" must be a
|
|
126
|
+
"urn": "Property \"{property}\" must be a URN formatted string, it is \"{value}\"",
|
|
127
|
+
"url": "Property \"{property}\" must be a URL formatted string, it is \"{value}\"",
|
|
125
128
|
"email": "Property \"{property}\" must be string in e-mail format, it is \"{value}\"",
|
|
126
129
|
"uuidV7": "Property \"{property}\" must be a UUIDv7 formatted string, it is \"{value}\"",
|
|
127
130
|
"uuidV7Compact": "Property \"{property}\" must be a UUIDv7 formatted string in compact mode, it is \"{value}\"",
|
|
131
|
+
"duration": "Property \"{property}\" must be an ISO 8601 duration string, it is \"{value}\"",
|
|
128
132
|
"length32Multiple": "Property \"{property}\" should be a multiple of 32, it is {value}",
|
|
129
133
|
"lengthEntropy": "Property \"{property}\" should be a multiple of 4, >=16 and <= 32, it is {value}"
|
|
130
134
|
},
|
|
@@ -157,6 +161,18 @@
|
|
|
157
161
|
"jsonHelper": {
|
|
158
162
|
"failedPatch": "Failed to patch the JSON object, patch index \"{index}\" failed"
|
|
159
163
|
},
|
|
164
|
+
"mutex": {
|
|
165
|
+
"lockNotFound": "The key \"{key}\" has no active lock",
|
|
166
|
+
"lockAlreadyReleased": "The key \"{key}\" is not currently locked",
|
|
167
|
+
"lockTimeout": "Failed to acquire lock for key \"{key}\" within the timeout of {timeout} milliseconds",
|
|
168
|
+
"bufferFetchFailed": "Failed to retrieve shared buffer for key \"{key}\" from the main thread",
|
|
169
|
+
"invalidTimeout": "The timeout value \"{timeoutMs}\" is invalid, it must be a non-negative integer"
|
|
170
|
+
},
|
|
171
|
+
"sharedObjectBuffer": {
|
|
172
|
+
"notCreated": "The shared buffer for object \"{objectId}\" has not been created",
|
|
173
|
+
"capacityExceeded": "The payload size of {required} bytes exceeds the maximum capacity of {capacity} bytes for object \"{objectId}\"",
|
|
174
|
+
"bufferFetchFailed": "Failed to retrieve shared buffer for object \"{objectId}\" from the main thread"
|
|
175
|
+
},
|
|
160
176
|
"ed25519": {
|
|
161
177
|
"privateKeyLength": "The private key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\"",
|
|
162
178
|
"publicKeyLength": "The public key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\""
|
|
@@ -193,6 +209,9 @@
|
|
|
193
209
|
"slip0010": {
|
|
194
210
|
"invalidSeed": "The seed is invalid \"{seed}\""
|
|
195
211
|
},
|
|
212
|
+
"pbkdf2": {
|
|
213
|
+
"keyLengthTooSmall": "The key length must be at least 1, it is \"{keyLength}\""
|
|
214
|
+
},
|
|
196
215
|
"iota": {
|
|
197
216
|
"insufficientFunds": "There were insufficient funds to complete the operation",
|
|
198
217
|
"packageNotFoundOnNetwork": "The package \"{packageId}\" was not found on the network",
|
|
@@ -201,7 +220,13 @@
|
|
|
201
220
|
"transactionFailed": "The transaction failed",
|
|
202
221
|
"addressNotFound": "The address is missing could not be found from the seed \"{address}\"",
|
|
203
222
|
"gasStationTransactionFailed": "The gas station transaction failed",
|
|
204
|
-
"dryRunFailed": "The dry run execution failed"
|
|
223
|
+
"dryRunFailed": "The dry run execution failed",
|
|
224
|
+
"fundingFailed": "Fund the address from faucet failed",
|
|
225
|
+
"faucetRateLimit": "Faucet rate limit exceeded",
|
|
226
|
+
"missingPublicKey": "The public key is missing for vault key \"{keyName}\""
|
|
227
|
+
},
|
|
228
|
+
"vaultJwkStorage": {
|
|
229
|
+
"generateNotSupported": "Key generation is not supported; keys are managed by the vault"
|
|
205
230
|
},
|
|
206
231
|
"iotaIdentityUtils": {
|
|
207
232
|
"getControllerCapInfoFailed": "Getting the controller capability info for the identity failed",
|
|
@@ -226,13 +251,18 @@
|
|
|
226
251
|
"adminCapNotFound": "AdminCap object not found for type \"{adminCapType}\" and address \"{adminAddress}\"",
|
|
227
252
|
"migrationStateNotFound": "MigrationState object not found for type \"{migrationStateType}\" and address \"{adminAddress}\""
|
|
228
253
|
},
|
|
254
|
+
"entitySchemaDiffHelper": {
|
|
255
|
+
"duplicateOldProperty": "The oldProperties array contains a duplicate property key \"{property}\"",
|
|
256
|
+
"duplicateNewProperty": "The newProperties array contains a duplicate property key \"{property}\""
|
|
257
|
+
},
|
|
229
258
|
"entitySchemaHelper": {
|
|
230
259
|
"noIsPrimary": "Property \"entitySchema.properties\" must contain a value with isPrimary set",
|
|
231
260
|
"multipleIsPrimary": "Property \"entitySchema.properties\" contains more than one property with isPrimary set",
|
|
232
261
|
"invalidEntityProperties": "The schema has no properties defined, but the entity has properties",
|
|
233
262
|
"invalidEntityProperty": "The entity value of \"{value}\" does not match the type \"{type}\" for property \"{property}\"",
|
|
234
263
|
"invalidOptional": "The entity property \"{property}\" of type \"{type}\" is not optional, but no value has been provided",
|
|
235
|
-
"invalidEntityKeys": "The entity had additional properties that are not in the schema, \"{keys}\""
|
|
264
|
+
"invalidEntityKeys": "The entity had additional properties that are not in the schema, \"{keys}\"",
|
|
265
|
+
"versionMustBeGreaterThanOrEqualZero": "Property \"entitySchema.version\" must be an integer >= 0, but got {version}"
|
|
236
266
|
},
|
|
237
267
|
"vaultConnectorHelper": {
|
|
238
268
|
"invalidSignature": "The JSON Web token signature could not be verified"
|
|
@@ -263,13 +293,33 @@
|
|
|
263
293
|
"invalidLinkHeaderURL": "URL for Link header cannot contain \">\" character.",
|
|
264
294
|
"invalidLinkHeaderRel": "Relation type for Link header cannot contain \" character."
|
|
265
295
|
},
|
|
296
|
+
"contextIdHelper": {
|
|
297
|
+
"contextIdMissing": "The context ID \"{key}\" is missing from the provided context IDs",
|
|
298
|
+
"contextIdSplitMismatch": "The context ID split parts length \"{actual}\" does not match the provided keys length \"{expected}\""
|
|
299
|
+
},
|
|
300
|
+
"contextIdStore": {
|
|
301
|
+
"asyncHooksNotAvailable": "Async Hooks are not available in this environment, please ensure you are running in Node.js"
|
|
302
|
+
},
|
|
303
|
+
"entityStorageHelper": {
|
|
304
|
+
"sortNotIndexed": "The property \"{property}\" is not indexed and cannot be used for sorting",
|
|
305
|
+
"propertyNotInSchema": "The property \"{property}\" does not exist in the schema and cannot be used for projection"
|
|
306
|
+
},
|
|
307
|
+
"migrationHelper": {
|
|
308
|
+
"migrateSchemaFailed": "Migration failed for schema \"{schemaName}\".",
|
|
309
|
+
"transformRequiredForProperty": "A transformation function is required to migrate property \"{from}\" to \"{to}\" of type \"{type}\"",
|
|
310
|
+
"coercionProducedUndefined": "Coercion of property \"{property}\" to type \"{type}\" produced undefined but the property is not optional"
|
|
311
|
+
},
|
|
312
|
+
"entityStorageVaultConnector": {
|
|
313
|
+
"keyAlreadyExists": "The key \"{existingId}\" already exists in the vault",
|
|
314
|
+
"keyNotFound": "The key \"{notFoundId}\" was not found in the vault",
|
|
315
|
+
"secretNotFound": "The secret \"{notFoundId}\" was not found in the vault",
|
|
316
|
+
"unsupportedKeyType": "The key type \"{keyType}\" is not supported",
|
|
317
|
+
"symmetricKeyHasNoPrivateKey": "The symmetric key \"{name}\" does not have a separate private key component",
|
|
318
|
+
"keyTypeMismatch": "The key type \"{keyType}\" does not match the requested encryption method \"{encryptionType}\""
|
|
319
|
+
},
|
|
266
320
|
"iotaWalletConnector": {
|
|
267
321
|
"transferFailed": "The wallet transfer failed."
|
|
268
322
|
},
|
|
269
|
-
"iotaFaucetConnector": {
|
|
270
|
-
"fundingFailed": "Fund the address from faucet failed",
|
|
271
|
-
"faucetRateLimit": "Faucet rate limit exceeded"
|
|
272
|
-
},
|
|
273
323
|
"envSetup": {
|
|
274
324
|
"mnemonicMissing": "Missing required DEPLOYER_MNEMONIC environment variable for {network}. Set DEPLOYER_MNEMONIC in your environment or use --load-env to load from configuration file (e.g., configs/{network}.env).\n\nYou can generate a mnemonic using:\nnpx \"@twin.org/wallet-cli\" mnemonic --env wallet.env\n\nThen add the MNEMONIC value to your configs/{network}.env file:\n{mnemonicVar}=\"word1 word2 word3 ... word24\"\n\nSee configs/{network}.env.example for reference.",
|
|
275
325
|
"mnemonicInvalidFormat": "Invalid DEPLOYER_MNEMONIC environment variable format for {network}. Please ensure {mnemonicVar} in your environment or configs/{network}.env contains a valid 24-word mnemonic phrase.",
|
|
@@ -351,6 +401,20 @@
|
|
|
351
401
|
"info": {
|
|
352
402
|
"iota": {
|
|
353
403
|
"transactionCosts": "Transaction costs for operation \"{operation}\", \"{cost}\""
|
|
404
|
+
},
|
|
405
|
+
"memoryEntityStorageConnector": {
|
|
406
|
+
"storeTearingDown": "Tearing down entity storage",
|
|
407
|
+
"storeTornDown": "Entity storage torn down"
|
|
408
|
+
},
|
|
409
|
+
"migrationHelper": {
|
|
410
|
+
"migrateSchemaStarting": "Migrating schema \"{schemaName}\"",
|
|
411
|
+
"migrateSchemaFinalizing": "Finalizing migration of schema \"{schemaName}\"",
|
|
412
|
+
"migrateSchemaComplete": "Migration of schema \"{schemaName}\" complete"
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
"health": {
|
|
416
|
+
"memoryEntityStorageConnector": {
|
|
417
|
+
"healthDescription": "Memory entity storage for \"{entityType}\" is always available"
|
|
354
418
|
}
|
|
355
419
|
},
|
|
356
420
|
"commands": {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./cli.js";
|
|
2
2
|
export * from "./commands/build.js";
|
|
3
3
|
export * from "./commands/deploy.js";
|
|
4
|
+
export * from "./models/IContractConfig.js";
|
|
4
5
|
export * from "./models/INetworkConfig.js";
|
|
5
6
|
export * from "./utils/envSetup.js";
|
|
6
7
|
export * from "./utils/iotaUtils.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract configuration interface
|
|
3
|
+
*/
|
|
4
|
+
export interface IContractConfig {
|
|
5
|
+
/**
|
|
6
|
+
* The module name
|
|
7
|
+
*/
|
|
8
|
+
moduleName: string;
|
|
9
|
+
/**
|
|
10
|
+
* The dependencies
|
|
11
|
+
*/
|
|
12
|
+
dependencies?: string[];
|
|
13
|
+
/**
|
|
14
|
+
* The package controller configuration
|
|
15
|
+
*/
|
|
16
|
+
packageController?: {
|
|
17
|
+
addressIndex: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { NetworkTypes } from "@twin.org/dlt-iota";
|
|
2
|
+
import type { IContractConfig } from "./IContractConfig.js";
|
|
2
3
|
/**
|
|
3
4
|
* Network configuration interface
|
|
4
5
|
*/
|
|
@@ -36,12 +37,6 @@ export interface INetworkConfig {
|
|
|
36
37
|
* The contracts configuration
|
|
37
38
|
*/
|
|
38
39
|
contracts?: {
|
|
39
|
-
[key: string]:
|
|
40
|
-
moduleName: string;
|
|
41
|
-
dependencies?: string[];
|
|
42
|
-
packageController?: {
|
|
43
|
-
addressIndex: number;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
40
|
+
[key: string]: IContractConfig;
|
|
46
41
|
};
|
|
47
42
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,148 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.9.0](https://github.com/iotaledger/twin-dlt/compare/move-to-json-v0.9.0...move-to-json-v0.9.0) (2026-06-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add header for CLI check ([#8](https://github.com/iotaledger/twin-dlt/issues/8)) ([0b9f271](https://github.com/iotaledger/twin-dlt/commit/0b9f2711fb3a9eb859e481725bfa1e2139e14053))
|
|
9
|
+
* release to production ([fe6a7f7](https://github.com/iotaledger/twin-dlt/commit/fe6a7f751138ea92ac22c70438261b0cea6fb238))
|
|
10
|
+
* release to production ([#82](https://github.com/iotaledger/twin-dlt/issues/82)) ([b628936](https://github.com/iotaledger/twin-dlt/commit/b62893622f0fe2d4a817297ebed39066f40c0bce))
|
|
11
|
+
* release to production ([#86](https://github.com/iotaledger/twin-dlt/issues/86)) ([687e24b](https://github.com/iotaledger/twin-dlt/commit/687e24b0061231900f5e5ac8bb8b7ef2a2bdc830))
|
|
12
|
+
* update dependencies ([f7b71c2](https://github.com/iotaledger/twin-dlt/commit/f7b71c24274b71e2d37c26c4a7e5e6d9df1dc9b7))
|
|
13
|
+
* use shared store mechanism ([#10](https://github.com/iotaledger/twin-dlt/issues/10)) ([ce36214](https://github.com/iotaledger/twin-dlt/commit/ce36214577f02cbb9642f831cb2c21335c31cc9a))
|
|
14
|
+
|
|
15
|
+
## [0.9.0-next.1](https://github.com/iotaledger/twin-dlt/compare/move-to-json-v0.9.0-next.0...move-to-json-v0.9.0-next.1) (2026-06-23)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* add context id features ([#51](https://github.com/iotaledger/twin-dlt/issues/51)) ([fb68498](https://github.com/iotaledger/twin-dlt/commit/fb6849897957904ec90cf6368153aeff3bef261a))
|
|
21
|
+
* add header for CLI check ([#8](https://github.com/iotaledger/twin-dlt/issues/8)) ([0b9f271](https://github.com/iotaledger/twin-dlt/commit/0b9f2711fb3a9eb859e481725bfa1e2139e14053))
|
|
22
|
+
* add IotaIdentityUtils to resolve IOTA identity controller cap info ([#57](https://github.com/iotaledger/twin-dlt/issues/57)) ([f15281a](https://github.com/iotaledger/twin-dlt/commit/f15281af3b2812bde5130a1813f9c0143f1462bf))
|
|
23
|
+
* add validate-locales ([8465099](https://github.com/iotaledger/twin-dlt/commit/8465099626ab1891d419a35870fae447efc3008d))
|
|
24
|
+
* add vault signers ([#76](https://github.com/iotaledger/twin-dlt/issues/76)) ([bfdd701](https://github.com/iotaledger/twin-dlt/commit/bfdd701a010ad45d4f0cffb06d829360cf380a40))
|
|
25
|
+
* bytecode change detection ([#43](https://github.com/iotaledger/twin-dlt/issues/43)) ([528469c](https://github.com/iotaledger/twin-dlt/commit/528469c1e4f032c6a936a9724a692abe403d92f6))
|
|
26
|
+
* consolidate environment management ([#41](https://github.com/iotaledger/twin-dlt/issues/41)) ([add1618](https://github.com/iotaledger/twin-dlt/commit/add161828e5dc42880fb0a5f9d3e61e611cf92bb))
|
|
27
|
+
* eslint migration to flat config ([83b56f0](https://github.com/iotaledger/twin-dlt/commit/83b56f02b1483f77c5f4cb9d7a1c345c56631333))
|
|
28
|
+
* eslint migration to flat config ([da1d12d](https://github.com/iotaledger/twin-dlt/commit/da1d12dcf5b24e7ba6204f540c27de191bca098e))
|
|
29
|
+
* methods for alias handling and tests ([#38](https://github.com/iotaledger/twin-dlt/issues/38)) ([43e0062](https://github.com/iotaledger/twin-dlt/commit/43e006220b4cf3df1aceb52b62178be0395ede00))
|
|
30
|
+
* move to json build deploy commands ([#30](https://github.com/iotaledger/twin-dlt/issues/30)) ([91aa00a](https://github.com/iotaledger/twin-dlt/commit/91aa00a29a8d7e3a99a46cea89e879a12dffc188))
|
|
31
|
+
* remove local error handling as CLI base already handles this ([fc5a083](https://github.com/iotaledger/twin-dlt/commit/fc5a083303f8c92cc264f782a2d292436da18031))
|
|
32
|
+
* typescript 6 update ([94a1ed6](https://github.com/iotaledger/twin-dlt/commit/94a1ed60e1da9847a29dc9cc85669067725edcf8))
|
|
33
|
+
* update dependencies ([cd1bdef](https://github.com/iotaledger/twin-dlt/commit/cd1bdef487bb3cfe3ea57f584395ad2ae1105245))
|
|
34
|
+
* update dependencies ([bfbe8fc](https://github.com/iotaledger/twin-dlt/commit/bfbe8fcfda80aa59d04f4ade3e4012e5291c8877))
|
|
35
|
+
* update dependencies ([f7b71c2](https://github.com/iotaledger/twin-dlt/commit/f7b71c24274b71e2d37c26c4a7e5e6d9df1dc9b7))
|
|
36
|
+
* update framework core ([79fc4b9](https://github.com/iotaledger/twin-dlt/commit/79fc4b961bd755437cad98d733ca9e25476bc03f))
|
|
37
|
+
* upgrade capabilities ([#32](https://github.com/iotaledger/twin-dlt/issues/32)) ([437219f](https://github.com/iotaledger/twin-dlt/commit/437219f0f784ec38353c01e1c8ce6bfba3b1b530))
|
|
38
|
+
* use new CLIParam.arrayOnOf ([1f6458a](https://github.com/iotaledger/twin-dlt/commit/1f6458a44486dfa5ddbf61bd63b85a98ec561728))
|
|
39
|
+
* use shared store mechanism ([#10](https://github.com/iotaledger/twin-dlt/issues/10)) ([ce36214](https://github.com/iotaledger/twin-dlt/commit/ce36214577f02cbb9642f831cb2c21335c31cc9a))
|
|
40
|
+
* validate published-at against on-chain UpgradeCap before upgrade ([#62](https://github.com/iotaledger/twin-dlt/issues/62)) ([23b49e2](https://github.com/iotaledger/twin-dlt/commit/23b49e247b89d2e363f9420b01fa35941f73be12))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Bug Fixes
|
|
44
|
+
|
|
45
|
+
* adding dependencies ([#45](https://github.com/iotaledger/twin-dlt/issues/45)) ([969f598](https://github.com/iotaledger/twin-dlt/commit/969f59807a0a0585dfe7d078b2cb38f197afb5d6))
|
|
46
|
+
* additional debugging ([0d335a5](https://github.com/iotaledger/twin-dlt/commit/0d335a594a34dea047fa0ee4143b2d519183b704))
|
|
47
|
+
* buffer usage required for identity ([#60](https://github.com/iotaledger/twin-dlt/issues/60)) ([0ba7d16](https://github.com/iotaledger/twin-dlt/commit/0ba7d165662b0083aa2b4c1325dd8c2e65defa2e))
|
|
48
|
+
* docs ([cade544](https://github.com/iotaledger/twin-dlt/commit/cade5443a4b955d592c1622f07499ad8a3d554b6))
|
|
49
|
+
* i18n messages ([4b61495](https://github.com/iotaledger/twin-dlt/commit/4b614957ea84d8af43345892cae3256dfa457483))
|
|
50
|
+
* missing dependency ([16f363c](https://github.com/iotaledger/twin-dlt/commit/16f363cde935d3b30cf86e01cb12f0390bfc8648))
|
|
51
|
+
* modifying logging type param ([#36](https://github.com/iotaledger/twin-dlt/issues/36)) ([b884fcc](https://github.com/iotaledger/twin-dlt/commit/b884fccef5bea5c6818cf8bfa8af197d3622cac6))
|
|
52
|
+
* update console output ([8cb193e](https://github.com/iotaledger/twin-dlt/commit/8cb193e2704e1e391d4c3c5899b765ca12471ef3))
|
|
53
|
+
* use async getStore in tests ([0a7d4ac](https://github.com/iotaledger/twin-dlt/commit/0a7d4ac3e524481c2ca49d7fbb3507556b42473e))
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Dependencies
|
|
57
|
+
|
|
58
|
+
* The following workspace dependencies were updated
|
|
59
|
+
* dependencies
|
|
60
|
+
* @twin.org/dlt-iota bumped from 0.9.0-next.0 to 0.9.0-next.1
|
|
61
|
+
|
|
62
|
+
## [0.0.3-next.15](https://github.com/iotaledger/twin-dlt/compare/move-to-json-v0.0.3-next.14...move-to-json-v0.0.3-next.15) (2026-06-17)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
### Features
|
|
66
|
+
|
|
67
|
+
* add vault signers ([#76](https://github.com/iotaledger/twin-dlt/issues/76)) ([bfdd701](https://github.com/iotaledger/twin-dlt/commit/bfdd701a010ad45d4f0cffb06d829360cf380a40))
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### Dependencies
|
|
71
|
+
|
|
72
|
+
* The following workspace dependencies were updated
|
|
73
|
+
* dependencies
|
|
74
|
+
* @twin.org/dlt-iota bumped from 0.0.3-next.14 to 0.0.3-next.15
|
|
75
|
+
|
|
76
|
+
## [0.0.3-next.14](https://github.com/iotaledger/twin-dlt/compare/move-to-json-v0.0.3-next.13...move-to-json-v0.0.3-next.14) (2026-06-15)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
### Bug Fixes
|
|
80
|
+
|
|
81
|
+
* use async getStore in tests ([0a7d4ac](https://github.com/iotaledger/twin-dlt/commit/0a7d4ac3e524481c2ca49d7fbb3507556b42473e))
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
### Dependencies
|
|
85
|
+
|
|
86
|
+
* The following workspace dependencies were updated
|
|
87
|
+
* dependencies
|
|
88
|
+
* @twin.org/dlt-iota bumped from 0.0.3-next.13 to 0.0.3-next.14
|
|
89
|
+
|
|
90
|
+
## [0.0.3-next.13](https://github.com/iotaledger/twin-dlt/compare/move-to-json-v0.0.3-next.12...move-to-json-v0.0.3-next.13) (2026-05-20)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### Features
|
|
94
|
+
|
|
95
|
+
* update dependencies ([cd1bdef](https://github.com/iotaledger/twin-dlt/commit/cd1bdef487bb3cfe3ea57f584395ad2ae1105245))
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
### Dependencies
|
|
99
|
+
|
|
100
|
+
* The following workspace dependencies were updated
|
|
101
|
+
* dependencies
|
|
102
|
+
* @twin.org/dlt-iota bumped from 0.0.3-next.12 to 0.0.3-next.13
|
|
103
|
+
|
|
104
|
+
## [0.0.3-next.12](https://github.com/iotaledger/twin-dlt/compare/move-to-json-v0.0.3-next.11...move-to-json-v0.0.3-next.12) (2026-05-12)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
### Miscellaneous Chores
|
|
108
|
+
|
|
109
|
+
* **move-to-json:** Synchronize repo versions
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
### Dependencies
|
|
113
|
+
|
|
114
|
+
* The following workspace dependencies were updated
|
|
115
|
+
* dependencies
|
|
116
|
+
* @twin.org/dlt-iota bumped from 0.0.3-next.11 to 0.0.3-next.12
|
|
117
|
+
|
|
118
|
+
## [0.0.3-next.11](https://github.com/iotaledger/twin-dlt/compare/move-to-json-v0.0.3-next.10...move-to-json-v0.0.3-next.11) (2026-05-12)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
### Miscellaneous Chores
|
|
122
|
+
|
|
123
|
+
* **move-to-json:** Synchronize repo versions
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
### Dependencies
|
|
127
|
+
|
|
128
|
+
* The following workspace dependencies were updated
|
|
129
|
+
* dependencies
|
|
130
|
+
* @twin.org/dlt-iota bumped from 0.0.3-next.10 to 0.0.3-next.11
|
|
131
|
+
|
|
132
|
+
## [0.0.3-next.10](https://github.com/iotaledger/twin-dlt/compare/move-to-json-v0.0.3-next.9...move-to-json-v0.0.3-next.10) (2026-05-12)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
### Features
|
|
136
|
+
|
|
137
|
+
* typescript 6 update ([94a1ed6](https://github.com/iotaledger/twin-dlt/commit/94a1ed60e1da9847a29dc9cc85669067725edcf8))
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
### Dependencies
|
|
141
|
+
|
|
142
|
+
* The following workspace dependencies were updated
|
|
143
|
+
* dependencies
|
|
144
|
+
* @twin.org/dlt-iota bumped from 0.0.3-next.9 to 0.0.3-next.10
|
|
145
|
+
|
|
3
146
|
## [0.0.3-next.9](https://github.com/iotaledger/twin-dlt/compare/move-to-json-v0.0.3-next.8...move-to-json-v0.0.3-next.9) (2026-05-11)
|
|
4
147
|
|
|
5
148
|
|
package/docs/reference/index.md
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Interface: IContractConfig
|
|
2
|
+
|
|
3
|
+
Contract configuration interface
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### moduleName {#modulename}
|
|
8
|
+
|
|
9
|
+
> **moduleName**: `string`
|
|
10
|
+
|
|
11
|
+
The module name
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### dependencies? {#dependencies}
|
|
16
|
+
|
|
17
|
+
> `optional` **dependencies?**: `string`[]
|
|
18
|
+
|
|
19
|
+
The dependencies
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### packageController? {#packagecontroller}
|
|
24
|
+
|
|
25
|
+
> `optional` **packageController?**: `object`
|
|
26
|
+
|
|
27
|
+
The package controller configuration
|
|
28
|
+
|
|
29
|
+
#### addressIndex
|
|
30
|
+
|
|
31
|
+
> **addressIndex**: `number`
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/move-to-json",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "CLI for compiling Move contracts and preparing deployment JSON for IOTA networks.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/iotaledger/dlt.git",
|
|
7
|
+
"url": "git+https://github.com/iotaledger/twin-dlt.git",
|
|
8
8
|
"directory": "packages/move-to-json"
|
|
9
9
|
},
|
|
10
10
|
"author": "cornel.filip@iota.org",
|
|
@@ -14,14 +14,18 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@iota/iota-sdk": "1.
|
|
18
|
-
"@twin.org/cli-core": "
|
|
19
|
-
"@twin.org/core": "
|
|
20
|
-
"@twin.org/crypto": "
|
|
21
|
-
"@twin.org/dlt-iota": "0.0
|
|
22
|
-
"@twin.org/
|
|
23
|
-
"@twin.org/
|
|
24
|
-
"
|
|
17
|
+
"@iota/iota-sdk": "1.14.0",
|
|
18
|
+
"@twin.org/cli-core": "^0.9.0",
|
|
19
|
+
"@twin.org/core": "^0.9.0",
|
|
20
|
+
"@twin.org/crypto": "^0.9.0",
|
|
21
|
+
"@twin.org/dlt-iota": "^0.9.0",
|
|
22
|
+
"@twin.org/entity-storage-connector-memory": "^0.9.0",
|
|
23
|
+
"@twin.org/entity-storage-models": "^0.9.0",
|
|
24
|
+
"@twin.org/nameof": "^0.9.0",
|
|
25
|
+
"@twin.org/vault-connector-entity-storage": "^0.9.0",
|
|
26
|
+
"@twin.org/vault-models": "^0.9.0",
|
|
27
|
+
"@twin.org/wallet-connector-iota": "^0.9.0-next.1",
|
|
28
|
+
"commander": "15.0.0",
|
|
25
29
|
"fast-glob": "3.3.3"
|
|
26
30
|
},
|
|
27
31
|
"main": "./dist/es/index.js",
|
|
@@ -53,7 +57,7 @@
|
|
|
53
57
|
"dlt"
|
|
54
58
|
],
|
|
55
59
|
"bugs": {
|
|
56
|
-
"url": "git+https://github.com/iotaledger/dlt/issues"
|
|
60
|
+
"url": "git+https://github.com/iotaledger/twin-dlt/issues"
|
|
57
61
|
},
|
|
58
62
|
"homepage": "https://twindev.org"
|
|
59
63
|
}
|