@settlemint/sdk-cli 0.6.41-pr0ed5f08 → 0.6.41-pr10151ed
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/cli.js +222 -309
- package/dist/cli.js.map +18 -20
- package/package.json +4 -3
package/dist/cli.js
CHANGED
|
@@ -268061,9 +268061,8 @@ var DotEnvSchema = z4.object({
|
|
|
268061
268061
|
SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema.optional(),
|
|
268062
268062
|
SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema.optional(),
|
|
268063
268063
|
SETTLEMINT_NEW_PROJECT_NAME: z4.string().optional(),
|
|
268064
|
-
|
|
268065
|
-
|
|
268066
|
-
SETTLEMINT_SMART_CONTRACT_SET_DEPLOYMENT_ID: z4.string().optional()
|
|
268064
|
+
SETTLEMINT_SMART_CONTRACT_ADDRESS: z4.string().optional(),
|
|
268065
|
+
SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z4.string().optional()
|
|
268067
268066
|
});
|
|
268068
268067
|
var DotEnvSchemaPartial = DotEnvSchema.partial();
|
|
268069
268068
|
function validate(schema, value4) {
|
|
@@ -268530,9 +268529,8 @@ async function writeEnvSpinner(prod, env2) {
|
|
|
268530
268529
|
SETTLEMINT_BLOCKSCOUT: env2.SETTLEMINT_BLOCKSCOUT,
|
|
268531
268530
|
SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: env2.SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT,
|
|
268532
268531
|
SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: env2.SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT,
|
|
268533
|
-
|
|
268534
|
-
|
|
268535
|
-
SETTLEMINT_SMART_CONTRACT_SET_DEPLOYMENT_ID: env2.SETTLEMINT_SMART_CONTRACT_SET_DEPLOYMENT_ID
|
|
268532
|
+
SETTLEMINT_SMART_CONTRACT_ADDRESS: env2.SETTLEMINT_SMART_CONTRACT_ADDRESS,
|
|
268533
|
+
SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: env2.SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID
|
|
268536
268534
|
}, false);
|
|
268537
268535
|
await writeEnv(prod, {
|
|
268538
268536
|
SETTLEMINT_ACCESS_TOKEN: env2.SETTLEMINT_ACCESS_TOKEN,
|
|
@@ -268747,9 +268745,8 @@ var DotEnvSchema2 = z4.object({
|
|
|
268747
268745
|
SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema2.optional(),
|
|
268748
268746
|
SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema2.optional(),
|
|
268749
268747
|
SETTLEMINT_NEW_PROJECT_NAME: z4.string().optional(),
|
|
268750
|
-
|
|
268751
|
-
|
|
268752
|
-
SETTLEMINT_SMART_CONTRACT_SET_DEPLOYMENT_ID: z4.string().optional()
|
|
268748
|
+
SETTLEMINT_SMART_CONTRACT_ADDRESS: z4.string().optional(),
|
|
268749
|
+
SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z4.string().optional()
|
|
268753
268750
|
});
|
|
268754
268751
|
var DotEnvSchemaPartial2 = DotEnvSchema2.partial();
|
|
268755
268752
|
function validate2(schema, value4) {
|
|
@@ -272337,7 +272334,7 @@ function connectCommand() {
|
|
|
272337
272334
|
var package_default = {
|
|
272338
272335
|
name: "@settlemint/sdk-cli",
|
|
272339
272336
|
description: "SettleMint SDK, integrate SettleMint into your application with ease.",
|
|
272340
|
-
version: "0.6.41-
|
|
272337
|
+
version: "0.6.41-pr10151ed",
|
|
272341
272338
|
type: "module",
|
|
272342
272339
|
private: false,
|
|
272343
272340
|
license: "FSL-1.1-MIT",
|
|
@@ -272368,6 +272365,7 @@ var package_default = {
|
|
|
272368
272365
|
},
|
|
272369
272366
|
scripts: {
|
|
272370
272367
|
build: "bun run build.ts",
|
|
272368
|
+
dev: "tsup-node --watch",
|
|
272371
272369
|
test: "bun test",
|
|
272372
272370
|
"test:coverage": "bun test --coverage",
|
|
272373
272371
|
typecheck: "tsc --noEmit",
|
|
@@ -272387,8 +272385,8 @@ var package_default = {
|
|
|
272387
272385
|
"@inquirer/input": "4.1.0",
|
|
272388
272386
|
"@inquirer/password": "4.0.3",
|
|
272389
272387
|
"@inquirer/select": "4.0.3",
|
|
272390
|
-
"@settlemint/sdk-js": "0.6.41-
|
|
272391
|
-
"@settlemint/sdk-utils": "0.6.41-
|
|
272388
|
+
"@settlemint/sdk-js": "0.6.41-pr10151ed",
|
|
272389
|
+
"@settlemint/sdk-utils": "0.6.41-pr10151ed",
|
|
272392
272390
|
"get-tsconfig": "4.8.1",
|
|
272393
272391
|
giget: "1.2.3"
|
|
272394
272392
|
},
|
|
@@ -273499,9 +273497,13 @@ function capitalizeFirstLetter(val) {
|
|
|
273499
273497
|
async function executeCommand2(command, args, options) {
|
|
273500
273498
|
const child = spawn2(command, args, { env: { ...process.env, ...options?.env } });
|
|
273501
273499
|
process.stdin.pipe(child.stdin);
|
|
273500
|
+
const output = [];
|
|
273502
273501
|
return new Promise((resolve22, reject) => {
|
|
273503
273502
|
child.stdout.on("data", (data) => {
|
|
273504
|
-
|
|
273503
|
+
if (!options?.silent) {
|
|
273504
|
+
console.log(data.toString());
|
|
273505
|
+
}
|
|
273506
|
+
output.push(data.toString());
|
|
273505
273507
|
});
|
|
273506
273508
|
child.stderr.on("data", (data) => {
|
|
273507
273509
|
console.error(data.toString());
|
|
@@ -273509,7 +273511,8 @@ async function executeCommand2(command, args, options) {
|
|
|
273509
273511
|
child.on("error", (err) => reject(err));
|
|
273510
273512
|
child.on("close", (code2) => {
|
|
273511
273513
|
if (code2 === 0 || code2 === null || code2 === 143) {
|
|
273512
|
-
|
|
273514
|
+
process.stdin.unpipe(child.stdin);
|
|
273515
|
+
resolve22(output);
|
|
273513
273516
|
return;
|
|
273514
273517
|
}
|
|
273515
273518
|
reject(new Error(`Command "${command}" exited with code ${code2}`));
|
|
@@ -273567,9 +273570,8 @@ var DotEnvSchema3 = z4.object({
|
|
|
273567
273570
|
SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema3.optional(),
|
|
273568
273571
|
SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema3.optional(),
|
|
273569
273572
|
SETTLEMINT_NEW_PROJECT_NAME: z4.string().optional(),
|
|
273570
|
-
|
|
273571
|
-
|
|
273572
|
-
SETTLEMINT_SMART_CONTRACT_SET_DEPLOYMENT_ID: z4.string().optional()
|
|
273573
|
+
SETTLEMINT_SMART_CONTRACT_ADDRESS: z4.string().optional(),
|
|
273574
|
+
SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z4.string().optional()
|
|
273573
273575
|
});
|
|
273574
273576
|
var DotEnvSchemaPartial3 = DotEnvSchema3.partial();
|
|
273575
273577
|
function validate3(schema, value4) {
|
|
@@ -274218,27 +274220,15 @@ function graphMiddlewareCreateCommand() {
|
|
|
274218
274220
|
type: "middleware",
|
|
274219
274221
|
alias: "gr",
|
|
274220
274222
|
execute: (cmd2, baseAction) => {
|
|
274221
|
-
addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").option("--
|
|
274222
|
-
applicationId,
|
|
274223
|
-
smartContractSetId,
|
|
274224
|
-
storageId,
|
|
274225
|
-
blockchainNodeId,
|
|
274226
|
-
provider,
|
|
274227
|
-
region,
|
|
274228
|
-
size,
|
|
274229
|
-
type: type4,
|
|
274230
|
-
...defaultArgs
|
|
274231
|
-
}) => {
|
|
274223
|
+
addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").option("--storage-id <storageId>", "Storage ID (IFPS)").option("--blockchain-node-id <blockchainNodeId>", "Blockchain Node ID").action(async (name2, { applicationId, storageId, blockchainNodeId, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
274232
274224
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274233
274225
|
const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
|
|
274234
|
-
const smartContractSet = smartContractSetId ?? env2.SETTLEMINT_SMART_CONTRACT_SET;
|
|
274235
274226
|
const blockchainNode = blockchainNodeId ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274236
274227
|
const storage = storageId ?? env2.SETTLEMINT_IPFS;
|
|
274237
274228
|
const result = await settlemint.middleware.create({
|
|
274238
274229
|
name: name2,
|
|
274239
274230
|
applicationId: application,
|
|
274240
274231
|
interface: "HA_GRAPH",
|
|
274241
|
-
smartContractSetId: smartContractSet,
|
|
274242
274232
|
storageId: storage,
|
|
274243
274233
|
blockchainNodeId: blockchainNode,
|
|
274244
274234
|
provider,
|
|
@@ -274267,7 +274257,7 @@ function graphMiddlewareCreateCommand() {
|
|
|
274267
274257
|
},
|
|
274268
274258
|
{
|
|
274269
274259
|
description: "Create a graph middleware in a different application",
|
|
274270
|
-
command: "platform create middleware graph my-graph --application-id 123456789 --
|
|
274260
|
+
command: "platform create middleware graph my-graph --application-id 123456789 --blockchain-node-id node-123 --storage-id storage-123"
|
|
274271
274261
|
}
|
|
274272
274262
|
]
|
|
274273
274263
|
});
|
|
@@ -274350,7 +274340,7 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
274350
274340
|
},
|
|
274351
274341
|
{
|
|
274352
274342
|
description: "Create a smart contract portal middleware in a different application",
|
|
274353
|
-
command: "platform create middleware smart-contract-portal my-portal --application-id 123456789 --
|
|
274343
|
+
command: "platform create middleware smart-contract-portal my-portal --application-id 123456789 --blockchain-node-id node-123"
|
|
274354
274344
|
}
|
|
274355
274345
|
]
|
|
274356
274346
|
});
|
|
@@ -274458,223 +274448,6 @@ function privateKeyCreateCommand() {
|
|
|
274458
274448
|
return new Command2("private-key").alias("pk").description("Create a private key in the SettleMint platform").addCommand(privateKeyHdCreateCommand()).addCommand(privateKeyHsmCreateCommand());
|
|
274459
274449
|
}
|
|
274460
274450
|
|
|
274461
|
-
// src/constants/smart-contract-sets.ts
|
|
274462
|
-
var SMART_CONTRACT_SET_DETAILS = [
|
|
274463
|
-
{
|
|
274464
|
-
id: "solidity-empty",
|
|
274465
|
-
name: "Empty",
|
|
274466
|
-
image: {
|
|
274467
|
-
registry: "ghcr.io",
|
|
274468
|
-
repository: "settlemint/solidity-empty",
|
|
274469
|
-
tag: "7.7.7"
|
|
274470
|
-
}
|
|
274471
|
-
},
|
|
274472
|
-
{
|
|
274473
|
-
id: "solidity-token-erc20",
|
|
274474
|
-
name: "ERC20 token",
|
|
274475
|
-
image: {
|
|
274476
|
-
registry: "ghcr.io",
|
|
274477
|
-
repository: "settlemint/solidity-token-erc20",
|
|
274478
|
-
tag: "7.7.7"
|
|
274479
|
-
}
|
|
274480
|
-
},
|
|
274481
|
-
{
|
|
274482
|
-
id: "solidity-token-erc1155",
|
|
274483
|
-
name: "ERC1155 token",
|
|
274484
|
-
image: {
|
|
274485
|
-
registry: "ghcr.io",
|
|
274486
|
-
repository: "settlemint/solidity-token-erc1155",
|
|
274487
|
-
tag: "7.7.7"
|
|
274488
|
-
}
|
|
274489
|
-
},
|
|
274490
|
-
{
|
|
274491
|
-
id: "solidity-token-erc20-metatx",
|
|
274492
|
-
name: "ERC20 token with MetaTx",
|
|
274493
|
-
image: {
|
|
274494
|
-
registry: "ghcr.io",
|
|
274495
|
-
repository: "settlemint/solidity-token-erc20-metatx",
|
|
274496
|
-
tag: "7.7.7"
|
|
274497
|
-
}
|
|
274498
|
-
},
|
|
274499
|
-
{
|
|
274500
|
-
id: "solidity-supplychain",
|
|
274501
|
-
name: "Supplychain",
|
|
274502
|
-
image: {
|
|
274503
|
-
registry: "ghcr.io",
|
|
274504
|
-
repository: "settlemint/solidity-supplychain",
|
|
274505
|
-
tag: "7.7.7"
|
|
274506
|
-
}
|
|
274507
|
-
},
|
|
274508
|
-
{
|
|
274509
|
-
id: "chaincode-ts-empty",
|
|
274510
|
-
name: "Empty typescript",
|
|
274511
|
-
image: {
|
|
274512
|
-
registry: "ghcr.io",
|
|
274513
|
-
repository: "settlemint/chaincode-typescript-empty",
|
|
274514
|
-
tag: "7.0.13"
|
|
274515
|
-
}
|
|
274516
|
-
},
|
|
274517
|
-
{
|
|
274518
|
-
id: "chaincode-ts-empty-pdc",
|
|
274519
|
-
name: "Empty typescript with PDC",
|
|
274520
|
-
image: {
|
|
274521
|
-
registry: "ghcr.io",
|
|
274522
|
-
repository: "settlemint/chaincode-typescript-empty-pdc",
|
|
274523
|
-
tag: "7.0.1"
|
|
274524
|
-
}
|
|
274525
|
-
},
|
|
274526
|
-
{
|
|
274527
|
-
id: "chaincode-go-empty",
|
|
274528
|
-
name: "Empty go",
|
|
274529
|
-
image: {
|
|
274530
|
-
registry: "ghcr.io",
|
|
274531
|
-
repository: "settlemint/chaincode-go-empty",
|
|
274532
|
-
tag: "7.0.5"
|
|
274533
|
-
}
|
|
274534
|
-
},
|
|
274535
|
-
{
|
|
274536
|
-
id: "solidity-statemachine",
|
|
274537
|
-
name: "State Machine",
|
|
274538
|
-
image: {
|
|
274539
|
-
registry: "ghcr.io",
|
|
274540
|
-
repository: "settlemint/solidity-statemachine",
|
|
274541
|
-
tag: "7.7.7"
|
|
274542
|
-
}
|
|
274543
|
-
},
|
|
274544
|
-
{
|
|
274545
|
-
id: "solidity-token-erc20-crowdsale",
|
|
274546
|
-
name: "ERC20 token with crowdsale mechanism",
|
|
274547
|
-
image: {
|
|
274548
|
-
registry: "ghcr.io",
|
|
274549
|
-
repository: "settlemint/solidity-token-erc20-crowdsale",
|
|
274550
|
-
tag: "7.7.7"
|
|
274551
|
-
}
|
|
274552
|
-
},
|
|
274553
|
-
{
|
|
274554
|
-
id: "solidity-token-erc721",
|
|
274555
|
-
name: "ERC721",
|
|
274556
|
-
image: {
|
|
274557
|
-
registry: "ghcr.io",
|
|
274558
|
-
repository: "settlemint/solidity-token-erc721",
|
|
274559
|
-
tag: "7.7.7"
|
|
274560
|
-
}
|
|
274561
|
-
},
|
|
274562
|
-
{
|
|
274563
|
-
id: "solidity-token-erc721a",
|
|
274564
|
-
name: "ERC721a",
|
|
274565
|
-
image: {
|
|
274566
|
-
registry: "ghcr.io",
|
|
274567
|
-
repository: "settlemint/solidity-token-erc721a",
|
|
274568
|
-
tag: "7.7.7"
|
|
274569
|
-
}
|
|
274570
|
-
},
|
|
274571
|
-
{
|
|
274572
|
-
id: "solidity-token-erc721-generative-art",
|
|
274573
|
-
name: "ERC721 Generative Art",
|
|
274574
|
-
image: {
|
|
274575
|
-
registry: "ghcr.io",
|
|
274576
|
-
repository: "settlemint/solidity-token-erc721-generative-art",
|
|
274577
|
-
tag: "7.7.7"
|
|
274578
|
-
}
|
|
274579
|
-
},
|
|
274580
|
-
{
|
|
274581
|
-
id: "solidity-token-soulbound",
|
|
274582
|
-
name: "Soulbound Token",
|
|
274583
|
-
image: {
|
|
274584
|
-
registry: "ghcr.io",
|
|
274585
|
-
repository: "settlemint/solidity-token-soulbound",
|
|
274586
|
-
tag: "7.7.7"
|
|
274587
|
-
}
|
|
274588
|
-
},
|
|
274589
|
-
{
|
|
274590
|
-
id: "solidity-diamond-bond",
|
|
274591
|
-
name: "Diamond bond",
|
|
274592
|
-
image: {
|
|
274593
|
-
registry: "ghcr.io",
|
|
274594
|
-
repository: "settlemint/solidity-diamond-bond",
|
|
274595
|
-
tag: "7.7.7"
|
|
274596
|
-
}
|
|
274597
|
-
},
|
|
274598
|
-
{
|
|
274599
|
-
id: "solidity-attestation-service",
|
|
274600
|
-
name: "Attestation Service",
|
|
274601
|
-
image: {
|
|
274602
|
-
registry: "ghcr.io",
|
|
274603
|
-
repository: "settlemint/solidity-attestation-service",
|
|
274604
|
-
tag: "7.7.7"
|
|
274605
|
-
}
|
|
274606
|
-
},
|
|
274607
|
-
{
|
|
274608
|
-
id: "solidity-zeto",
|
|
274609
|
-
name: "Zeto",
|
|
274610
|
-
featureflagged: true,
|
|
274611
|
-
image: {
|
|
274612
|
-
registry: "ghcr.io",
|
|
274613
|
-
repository: "settlemint/solidity-zeto",
|
|
274614
|
-
tag: "7.7.7"
|
|
274615
|
-
}
|
|
274616
|
-
},
|
|
274617
|
-
{
|
|
274618
|
-
id: "solidity-starterkit",
|
|
274619
|
-
name: "Starterkit",
|
|
274620
|
-
featureflagged: true,
|
|
274621
|
-
image: {
|
|
274622
|
-
registry: "ghcr.io",
|
|
274623
|
-
repository: "settlemint/solidity-predeployed",
|
|
274624
|
-
tag: "7.7.7"
|
|
274625
|
-
}
|
|
274626
|
-
}
|
|
274627
|
-
];
|
|
274628
|
-
var SMART_CONTRACT_SETS = SMART_CONTRACT_SET_DETAILS.map((set) => set.id);
|
|
274629
|
-
|
|
274630
|
-
// src/commands/platform/smart-contract-set/create.ts
|
|
274631
|
-
function smartContractSetCreateCommand() {
|
|
274632
|
-
return getCreateCommand({
|
|
274633
|
-
name: "smart-contract-set",
|
|
274634
|
-
type: "smart contract set",
|
|
274635
|
-
alias: "scs",
|
|
274636
|
-
execute: (cmd2, baseAction) => {
|
|
274637
|
-
addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").option("--blockchain-node-id <blockchainNodeId>", "Blockchain Node ID").addOption(new Option("--use-case <useCase>", "Use case for the smart contract set").choices(SMART_CONTRACT_SETS).makeOptionMandatory()).option("--user-id <userId>", "User ID").action(async (name2, { applicationId, blockchainNodeId, provider, region, size, type: type4, useCase, userId, ...defaultArgs }) => {
|
|
274638
|
-
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274639
|
-
const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
|
|
274640
|
-
const blockchainNode = blockchainNodeId ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274641
|
-
const result = await settlemint.smartContractSet.create({
|
|
274642
|
-
name: name2,
|
|
274643
|
-
applicationId: application,
|
|
274644
|
-
blockchainNodeId: blockchainNode,
|
|
274645
|
-
provider,
|
|
274646
|
-
region,
|
|
274647
|
-
size,
|
|
274648
|
-
type: type4,
|
|
274649
|
-
useCase,
|
|
274650
|
-
userId
|
|
274651
|
-
});
|
|
274652
|
-
return {
|
|
274653
|
-
result,
|
|
274654
|
-
mapDefaultEnv: () => {
|
|
274655
|
-
return {
|
|
274656
|
-
SETTLEMINT_APPLICATION: application,
|
|
274657
|
-
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode,
|
|
274658
|
-
SETTLEMINT_SMART_CONTRACT_SET: result.id
|
|
274659
|
-
};
|
|
274660
|
-
}
|
|
274661
|
-
};
|
|
274662
|
-
});
|
|
274663
|
-
});
|
|
274664
|
-
},
|
|
274665
|
-
examples: [
|
|
274666
|
-
{
|
|
274667
|
-
description: "Create a smart contract set and save as default",
|
|
274668
|
-
command: "platform create smart-contract-set my-contracts --use-case nft --accept-defaults -d"
|
|
274669
|
-
},
|
|
274670
|
-
{
|
|
274671
|
-
description: "Create a smart contract set in a different application",
|
|
274672
|
-
command: "platform create smart-contract-set my-contracts --application-id 123456789 --blockchain-node-id node-123 --use-case nft --user-id user-123"
|
|
274673
|
-
}
|
|
274674
|
-
]
|
|
274675
|
-
});
|
|
274676
|
-
}
|
|
274677
|
-
|
|
274678
274451
|
// src/commands/platform/storage/ipfs/create.ts
|
|
274679
274452
|
function ipfsStorageCreateCommand() {
|
|
274680
274453
|
return getCreateCommand({
|
|
@@ -274727,7 +274500,7 @@ function storageCreateCommand() {
|
|
|
274727
274500
|
|
|
274728
274501
|
// src/commands/platform/create.ts
|
|
274729
274502
|
function createCommand3() {
|
|
274730
|
-
return new Command2("create").alias("c").description("Create a resource in the SettleMint platform").addCommand(workspaceCreateCommand()).addCommand(applicationCreateCommand()).addCommand(blockchainNetworkCreateCommand()).addCommand(privateKeyCreateCommand()).addCommand(
|
|
274503
|
+
return new Command2("create").alias("c").description("Create a resource in the SettleMint platform").addCommand(workspaceCreateCommand()).addCommand(applicationCreateCommand()).addCommand(blockchainNetworkCreateCommand()).addCommand(privateKeyCreateCommand()).addCommand(middlewareCreateCommand()).addCommand(storageCreateCommand()).addCommand(integrationToolCreateCommand()).addCommand(insightsCreateCommand()).addCommand(applicationAccessTokenCreateCommand());
|
|
274731
274504
|
}
|
|
274732
274505
|
|
|
274733
274506
|
// src/commands/platform/prompts/delete-confirmation.prompt.ts
|
|
@@ -275024,19 +274797,6 @@ function privateKeyRestartCommand() {
|
|
|
275024
274797
|
return new Command2("private-key").alias("pk").description("Restart a private key in the SettleMint platform").addCommand(hdEcdsaP256RestartCommand());
|
|
275025
274798
|
}
|
|
275026
274799
|
|
|
275027
|
-
// src/commands/platform/smart-contract-set/restart.ts
|
|
275028
|
-
function smartContractSetRestartCommand() {
|
|
275029
|
-
return getRestartCommand({
|
|
275030
|
-
name: "smart-contract-set",
|
|
275031
|
-
type: "smart contract set",
|
|
275032
|
-
alias: "scs",
|
|
275033
|
-
envKey: "SETTLEMINT_SMART_CONTRACT_SET",
|
|
275034
|
-
restartFunction: async (settlemint, id) => {
|
|
275035
|
-
return settlemint.smartContractSet.restart(id);
|
|
275036
|
-
}
|
|
275037
|
-
});
|
|
275038
|
-
}
|
|
275039
|
-
|
|
275040
274800
|
// src/commands/platform/storage/ipfs/restart.ts
|
|
275041
274801
|
function ipfsRestartCommand() {
|
|
275042
274802
|
return getRestartCommand({
|
|
@@ -275057,7 +274817,7 @@ function storageRestartCommand() {
|
|
|
275057
274817
|
|
|
275058
274818
|
// src/commands/platform/restart.ts
|
|
275059
274819
|
function restartCommand() {
|
|
275060
|
-
const cmd2 = new Command2("restart").description("Restart a resource in the SettleMint platform").addCommand(blockchainNetworkRestartCommand()).addCommand(customDeploymentRestartCommand()).addCommand(insightsRestartCommand()).addCommand(integrationToolRestartCommand()).addCommand(middlewareRestartCommand()).addCommand(privateKeyRestartCommand()).addCommand(
|
|
274820
|
+
const cmd2 = new Command2("restart").description("Restart a resource in the SettleMint platform").addCommand(blockchainNetworkRestartCommand()).addCommand(customDeploymentRestartCommand()).addCommand(insightsRestartCommand()).addCommand(integrationToolRestartCommand()).addCommand(middlewareRestartCommand()).addCommand(privateKeyRestartCommand()).addCommand(storageRestartCommand());
|
|
275061
274821
|
return cmd2;
|
|
275062
274822
|
}
|
|
275063
274823
|
|
|
@@ -275107,6 +274867,175 @@ function platformCommand() {
|
|
|
275107
274867
|
import { rmdir } from "node:fs/promises";
|
|
275108
274868
|
import { join as join7 } from "node:path";
|
|
275109
274869
|
|
|
274870
|
+
// src/constants/smart-contract-sets.ts
|
|
274871
|
+
var SMART_CONTRACT_SET_DETAILS = [
|
|
274872
|
+
{
|
|
274873
|
+
id: "solidity-empty",
|
|
274874
|
+
name: "Empty",
|
|
274875
|
+
image: {
|
|
274876
|
+
registry: "ghcr.io",
|
|
274877
|
+
repository: "settlemint/solidity-empty",
|
|
274878
|
+
tag: "7.7.7"
|
|
274879
|
+
}
|
|
274880
|
+
},
|
|
274881
|
+
{
|
|
274882
|
+
id: "solidity-token-erc20",
|
|
274883
|
+
name: "ERC20 token",
|
|
274884
|
+
image: {
|
|
274885
|
+
registry: "ghcr.io",
|
|
274886
|
+
repository: "settlemint/solidity-token-erc20",
|
|
274887
|
+
tag: "7.7.7"
|
|
274888
|
+
}
|
|
274889
|
+
},
|
|
274890
|
+
{
|
|
274891
|
+
id: "solidity-token-erc1155",
|
|
274892
|
+
name: "ERC1155 token",
|
|
274893
|
+
image: {
|
|
274894
|
+
registry: "ghcr.io",
|
|
274895
|
+
repository: "settlemint/solidity-token-erc1155",
|
|
274896
|
+
tag: "7.7.7"
|
|
274897
|
+
}
|
|
274898
|
+
},
|
|
274899
|
+
{
|
|
274900
|
+
id: "solidity-token-erc20-metatx",
|
|
274901
|
+
name: "ERC20 token with MetaTx",
|
|
274902
|
+
image: {
|
|
274903
|
+
registry: "ghcr.io",
|
|
274904
|
+
repository: "settlemint/solidity-token-erc20-metatx",
|
|
274905
|
+
tag: "7.7.7"
|
|
274906
|
+
}
|
|
274907
|
+
},
|
|
274908
|
+
{
|
|
274909
|
+
id: "solidity-supplychain",
|
|
274910
|
+
name: "Supplychain",
|
|
274911
|
+
image: {
|
|
274912
|
+
registry: "ghcr.io",
|
|
274913
|
+
repository: "settlemint/solidity-supplychain",
|
|
274914
|
+
tag: "7.7.7"
|
|
274915
|
+
}
|
|
274916
|
+
},
|
|
274917
|
+
{
|
|
274918
|
+
id: "chaincode-ts-empty",
|
|
274919
|
+
name: "Empty typescript",
|
|
274920
|
+
image: {
|
|
274921
|
+
registry: "ghcr.io",
|
|
274922
|
+
repository: "settlemint/chaincode-typescript-empty",
|
|
274923
|
+
tag: "7.0.13"
|
|
274924
|
+
}
|
|
274925
|
+
},
|
|
274926
|
+
{
|
|
274927
|
+
id: "chaincode-ts-empty-pdc",
|
|
274928
|
+
name: "Empty typescript with PDC",
|
|
274929
|
+
image: {
|
|
274930
|
+
registry: "ghcr.io",
|
|
274931
|
+
repository: "settlemint/chaincode-typescript-empty-pdc",
|
|
274932
|
+
tag: "7.0.1"
|
|
274933
|
+
}
|
|
274934
|
+
},
|
|
274935
|
+
{
|
|
274936
|
+
id: "chaincode-go-empty",
|
|
274937
|
+
name: "Empty go",
|
|
274938
|
+
image: {
|
|
274939
|
+
registry: "ghcr.io",
|
|
274940
|
+
repository: "settlemint/chaincode-go-empty",
|
|
274941
|
+
tag: "7.0.5"
|
|
274942
|
+
}
|
|
274943
|
+
},
|
|
274944
|
+
{
|
|
274945
|
+
id: "solidity-statemachine",
|
|
274946
|
+
name: "State Machine",
|
|
274947
|
+
image: {
|
|
274948
|
+
registry: "ghcr.io",
|
|
274949
|
+
repository: "settlemint/solidity-statemachine",
|
|
274950
|
+
tag: "7.7.7"
|
|
274951
|
+
}
|
|
274952
|
+
},
|
|
274953
|
+
{
|
|
274954
|
+
id: "solidity-token-erc20-crowdsale",
|
|
274955
|
+
name: "ERC20 token with crowdsale mechanism",
|
|
274956
|
+
image: {
|
|
274957
|
+
registry: "ghcr.io",
|
|
274958
|
+
repository: "settlemint/solidity-token-erc20-crowdsale",
|
|
274959
|
+
tag: "7.7.7"
|
|
274960
|
+
}
|
|
274961
|
+
},
|
|
274962
|
+
{
|
|
274963
|
+
id: "solidity-token-erc721",
|
|
274964
|
+
name: "ERC721",
|
|
274965
|
+
image: {
|
|
274966
|
+
registry: "ghcr.io",
|
|
274967
|
+
repository: "settlemint/solidity-token-erc721",
|
|
274968
|
+
tag: "7.7.7"
|
|
274969
|
+
}
|
|
274970
|
+
},
|
|
274971
|
+
{
|
|
274972
|
+
id: "solidity-token-erc721a",
|
|
274973
|
+
name: "ERC721a",
|
|
274974
|
+
image: {
|
|
274975
|
+
registry: "ghcr.io",
|
|
274976
|
+
repository: "settlemint/solidity-token-erc721a",
|
|
274977
|
+
tag: "7.7.7"
|
|
274978
|
+
}
|
|
274979
|
+
},
|
|
274980
|
+
{
|
|
274981
|
+
id: "solidity-token-erc721-generative-art",
|
|
274982
|
+
name: "ERC721 Generative Art",
|
|
274983
|
+
image: {
|
|
274984
|
+
registry: "ghcr.io",
|
|
274985
|
+
repository: "settlemint/solidity-token-erc721-generative-art",
|
|
274986
|
+
tag: "7.7.7"
|
|
274987
|
+
}
|
|
274988
|
+
},
|
|
274989
|
+
{
|
|
274990
|
+
id: "solidity-token-soulbound",
|
|
274991
|
+
name: "Soulbound Token",
|
|
274992
|
+
image: {
|
|
274993
|
+
registry: "ghcr.io",
|
|
274994
|
+
repository: "settlemint/solidity-token-soulbound",
|
|
274995
|
+
tag: "7.7.7"
|
|
274996
|
+
}
|
|
274997
|
+
},
|
|
274998
|
+
{
|
|
274999
|
+
id: "solidity-diamond-bond",
|
|
275000
|
+
name: "Diamond bond",
|
|
275001
|
+
image: {
|
|
275002
|
+
registry: "ghcr.io",
|
|
275003
|
+
repository: "settlemint/solidity-diamond-bond",
|
|
275004
|
+
tag: "7.7.7"
|
|
275005
|
+
}
|
|
275006
|
+
},
|
|
275007
|
+
{
|
|
275008
|
+
id: "solidity-attestation-service",
|
|
275009
|
+
name: "Attestation Service",
|
|
275010
|
+
image: {
|
|
275011
|
+
registry: "ghcr.io",
|
|
275012
|
+
repository: "settlemint/solidity-attestation-service",
|
|
275013
|
+
tag: "7.7.7"
|
|
275014
|
+
}
|
|
275015
|
+
},
|
|
275016
|
+
{
|
|
275017
|
+
id: "solidity-zeto",
|
|
275018
|
+
name: "Zeto",
|
|
275019
|
+
featureflagged: true,
|
|
275020
|
+
image: {
|
|
275021
|
+
registry: "ghcr.io",
|
|
275022
|
+
repository: "settlemint/solidity-zeto",
|
|
275023
|
+
tag: "7.7.7"
|
|
275024
|
+
}
|
|
275025
|
+
},
|
|
275026
|
+
{
|
|
275027
|
+
id: "solidity-starterkit",
|
|
275028
|
+
name: "Starterkit",
|
|
275029
|
+
featureflagged: true,
|
|
275030
|
+
image: {
|
|
275031
|
+
registry: "ghcr.io",
|
|
275032
|
+
repository: "settlemint/solidity-predeployed",
|
|
275033
|
+
tag: "7.7.7"
|
|
275034
|
+
}
|
|
275035
|
+
}
|
|
275036
|
+
];
|
|
275037
|
+
var SMART_CONTRACT_SETS = SMART_CONTRACT_SET_DETAILS.map((set) => set.id);
|
|
275038
|
+
|
|
275110
275039
|
// src/commands/smart-contract-set/prompts/use-case.prompt.ts
|
|
275111
275040
|
async function useCasePrompt(argument) {
|
|
275112
275041
|
if (SMART_CONTRACT_SETS.length === 0) {
|
|
@@ -275254,7 +275183,7 @@ async function addressPrompt({
|
|
|
275254
275183
|
hardhatConfig
|
|
275255
275184
|
}) {
|
|
275256
275185
|
const possiblePrivateKeys = node.privateKeys?.filter((privateKey) => privateKey.privateKeyType !== "HD_ECDSA_P256") ?? [];
|
|
275257
|
-
const defaultAddress = env2.
|
|
275186
|
+
const defaultAddress = env2.SETTLEMINT_SMART_CONTRACT_ADDRESS ?? hardhatConfig.networks?.btp?.from ?? possiblePrivateKeys[0]?.address;
|
|
275258
275187
|
const defaultPossible = accept && defaultAddress;
|
|
275259
275188
|
if (defaultPossible) {
|
|
275260
275189
|
return defaultAddress;
|
|
@@ -275270,10 +275199,10 @@ async function addressPrompt({
|
|
|
275270
275199
|
})),
|
|
275271
275200
|
default: defaultAddress ?? possiblePrivateKeys[0]?.address
|
|
275272
275201
|
});
|
|
275273
|
-
if (address && address !== env2.
|
|
275202
|
+
if (address && address !== env2.SETTLEMINT_SMART_CONTRACT_ADDRESS) {
|
|
275274
275203
|
await writeEnvSpinner(!!prod, {
|
|
275275
275204
|
...env2,
|
|
275276
|
-
|
|
275205
|
+
SETTLEMINT_SMART_CONTRACT_ADDRESS: address
|
|
275277
275206
|
});
|
|
275278
275207
|
}
|
|
275279
275208
|
return address;
|
|
@@ -275281,7 +275210,7 @@ async function addressPrompt({
|
|
|
275281
275210
|
|
|
275282
275211
|
// src/commands/smart-contract-set/prompts/deployment-id.prompt.ts
|
|
275283
275212
|
async function deploymentIdPrompt(env2, accept, prod) {
|
|
275284
|
-
const defaultDeploymentId = env2.
|
|
275213
|
+
const defaultDeploymentId = env2.SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID;
|
|
275285
275214
|
if (accept) {
|
|
275286
275215
|
return defaultDeploymentId;
|
|
275287
275216
|
}
|
|
@@ -275293,7 +275222,7 @@ async function deploymentIdPrompt(env2, accept, prod) {
|
|
|
275293
275222
|
if (deploymentId !== defaultDeploymentId) {
|
|
275294
275223
|
await writeEnvSpinner(!!prod, {
|
|
275295
275224
|
...env2,
|
|
275296
|
-
|
|
275225
|
+
SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: deploymentId
|
|
275297
275226
|
});
|
|
275298
275227
|
}
|
|
275299
275228
|
return deploymentId;
|
|
@@ -275302,18 +275231,26 @@ async function deploymentIdPrompt(env2, accept, prod) {
|
|
|
275302
275231
|
// src/utils/hardhat-config.ts
|
|
275303
275232
|
async function getHardhatConfigData(envConfig) {
|
|
275304
275233
|
try {
|
|
275305
|
-
|
|
275306
|
-
|
|
275307
|
-
|
|
275308
|
-
|
|
275309
|
-
|
|
275310
|
-
|
|
275234
|
+
const { command, args } = await getPackageManagerExecutable();
|
|
275235
|
+
const output = await executeCommand2(command, [...args, "ts-node", "-e", `import hardhat from "hardhat";
|
|
275236
|
+
console.log(JSON.stringify(hardhat.userConfig));`], {
|
|
275237
|
+
env: envConfig,
|
|
275238
|
+
silent: true
|
|
275239
|
+
});
|
|
275240
|
+
const config4 = JSON.parse(output.join(" "));
|
|
275241
|
+
if (isHardhatConfig(config4)) {
|
|
275242
|
+
return config4;
|
|
275243
|
+
}
|
|
275244
|
+
throw new Error("Invalid hardhat config");
|
|
275311
275245
|
} catch (err) {
|
|
275312
275246
|
const error5 = err;
|
|
275313
275247
|
note(`Error reading hardhat.config.ts: ${error5.message}`);
|
|
275314
275248
|
return {};
|
|
275315
275249
|
}
|
|
275316
275250
|
}
|
|
275251
|
+
function isHardhatConfig(config4) {
|
|
275252
|
+
return typeof config4 === "object" && config4 !== null && "networks" in config4;
|
|
275253
|
+
}
|
|
275317
275254
|
|
|
275318
275255
|
// src/commands/smart-contract-set/hardhat/deploy/remote.ts
|
|
275319
275256
|
function hardhatDeployRemoteCommand() {
|
|
@@ -275330,17 +275267,9 @@ function hardhatDeployRemoteCommand() {
|
|
|
275330
275267
|
accessToken,
|
|
275331
275268
|
instance
|
|
275332
275269
|
});
|
|
275333
|
-
let nodeId = blockchainNodeId
|
|
275270
|
+
let nodeId = blockchainNodeId;
|
|
275334
275271
|
if (!nodeId) {
|
|
275335
|
-
const
|
|
275336
|
-
if (!personalAccessToken) {
|
|
275337
|
-
return missingPersonalAccessTokenError();
|
|
275338
|
-
}
|
|
275339
|
-
const settlemintPat = createSettleMintClient({
|
|
275340
|
-
accessToken: personalAccessToken.personalAccessToken,
|
|
275341
|
-
instance
|
|
275342
|
-
});
|
|
275343
|
-
const blockchainNodes = await settlemintPat.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
275272
|
+
const blockchainNodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
275344
275273
|
const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes, autoAccept);
|
|
275345
275274
|
if (!blockchainNode) {
|
|
275346
275275
|
cancel2("No Blockchain Node selected. Please select one to continue.");
|
|
@@ -275419,17 +275348,9 @@ function hardhatScriptRemoteCommand() {
|
|
|
275419
275348
|
accessToken,
|
|
275420
275349
|
instance
|
|
275421
275350
|
});
|
|
275422
|
-
let nodeId = blockchainNodeId
|
|
275351
|
+
let nodeId = blockchainNodeId;
|
|
275423
275352
|
if (!nodeId) {
|
|
275424
|
-
const
|
|
275425
|
-
if (!personalAccessToken) {
|
|
275426
|
-
return missingPersonalAccessTokenError();
|
|
275427
|
-
}
|
|
275428
|
-
const settlemintPat = createSettleMintClient({
|
|
275429
|
-
accessToken: personalAccessToken.personalAccessToken,
|
|
275430
|
-
instance
|
|
275431
|
-
});
|
|
275432
|
-
const blockchainNodes = await settlemintPat.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
275353
|
+
const blockchainNodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
275433
275354
|
const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes, autoAccept);
|
|
275434
275355
|
if (!blockchainNode) {
|
|
275435
275356
|
cancel2("No Blockchain Node selected. Please select one to continue.");
|
|
@@ -275615,24 +275536,16 @@ async function getTheGraphMiddleware({
|
|
|
275615
275536
|
accessToken,
|
|
275616
275537
|
autoAccept
|
|
275617
275538
|
}) {
|
|
275539
|
+
const settlemintClient = createSettleMintClient({
|
|
275540
|
+
accessToken,
|
|
275541
|
+
instance
|
|
275542
|
+
});
|
|
275618
275543
|
if (autoAccept && env2.SETTLEMINT_THEGRAPH) {
|
|
275619
|
-
const
|
|
275620
|
-
accessToken,
|
|
275621
|
-
instance
|
|
275622
|
-
});
|
|
275623
|
-
const defaultTheGraphMiddleware = await settlemintClient2.middleware.read(env2.SETTLEMINT_THEGRAPH);
|
|
275544
|
+
const defaultTheGraphMiddleware = await settlemintClient.middleware.read(env2.SETTLEMINT_THEGRAPH);
|
|
275624
275545
|
if (defaultTheGraphMiddleware && defaultTheGraphMiddleware.__typename === "HAGraphMiddleware") {
|
|
275625
275546
|
return defaultTheGraphMiddleware;
|
|
275626
275547
|
}
|
|
275627
275548
|
}
|
|
275628
|
-
const personalAccessToken = await getInstanceCredentials(instance);
|
|
275629
|
-
if (!personalAccessToken) {
|
|
275630
|
-
return missingPersonalAccessTokenError();
|
|
275631
|
-
}
|
|
275632
|
-
const settlemintClient = createSettleMintClient({
|
|
275633
|
-
accessToken: personalAccessToken.personalAccessToken,
|
|
275634
|
-
instance
|
|
275635
|
-
});
|
|
275636
275549
|
const middlewares = await settlemintClient.middleware.list(env2.SETTLEMINT_APPLICATION);
|
|
275637
275550
|
return theGraphPrompt(env2, middlewares, autoAccept);
|
|
275638
275551
|
}
|
|
@@ -275815,4 +275728,4 @@ sdkcli.parseAsync(process.argv).catch((reason) => {
|
|
|
275815
275728
|
cancel2(reason);
|
|
275816
275729
|
});
|
|
275817
275730
|
|
|
275818
|
-
//# debugId=
|
|
275731
|
+
//# debugId=B144A3DD05D5EF9F64756E2164756E21
|