@twin.org/nft-cli 0.0.2-next.7 → 0.0.2-next.8
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/cjs/index.cjs +20 -57
- package/dist/esm/index.mjs +23 -59
- package/dist/locales/en.json +20 -66
- package/dist/types/commands/nftBurn.d.ts +0 -3
- package/dist/types/commands/nftMint.d.ts +0 -3
- package/dist/types/commands/nftResolve.d.ts +0 -3
- package/dist/types/commands/nftTransfer.d.ts +0 -3
- package/dist/types/commands/setupCommands.d.ts +1 -3
- package/dist/types/index.d.ts +0 -1
- package/docs/changelog.md +14 -0
- package/docs/reference/functions/actionCommandNftBurn.md +0 -6
- package/docs/reference/functions/actionCommandNftTransfer.md +0 -6
- package/docs/reference/functions/setupNftConnector.md +1 -7
- package/docs/reference/index.md +0 -8
- package/locales/en.json +4 -8
- package/package.json +19 -4
- package/dist/types/models/nftConnectorTypes.d.ts +0 -13
- package/docs/reference/type-aliases/NftConnectorTypes.md +0 -5
- package/docs/reference/variables/NftConnectorTypes.md +0 -13
package/dist/cjs/index.cjs
CHANGED
|
@@ -15,19 +15,6 @@ var entityStorageModels = require('@twin.org/entity-storage-models');
|
|
|
15
15
|
var vaultConnectorEntityStorage = require('@twin.org/vault-connector-entity-storage');
|
|
16
16
|
|
|
17
17
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
18
|
-
// Copyright 2024 IOTA Stiftung.
|
|
19
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
20
|
-
/**
|
|
21
|
-
* The NFT connector types.
|
|
22
|
-
*/
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
24
|
-
const NftConnectorTypes = {
|
|
25
|
-
/**
|
|
26
|
-
* IOTA.
|
|
27
|
-
*/
|
|
28
|
-
Iota: "iota"
|
|
29
|
-
};
|
|
30
|
-
|
|
31
18
|
// Copyright 2024 IOTA Stiftung.
|
|
32
19
|
// SPDX-License-Identifier: Apache-2.0.
|
|
33
20
|
/**
|
|
@@ -51,11 +38,9 @@ function setupVault() {
|
|
|
51
38
|
* @param options.network The network.
|
|
52
39
|
* @param options.vaultSeedId The vault seed ID.
|
|
53
40
|
* @param options.walletAddressIndex The wallet address index.
|
|
54
|
-
* @param connector The connector to use.
|
|
55
41
|
* @returns The NFT connector.
|
|
56
42
|
*/
|
|
57
|
-
function setupNftConnector(options
|
|
58
|
-
connector ??= NftConnectorTypes.Iota;
|
|
43
|
+
function setupNftConnector(options) {
|
|
59
44
|
return new nftConnectorIota.IotaNftConnector({
|
|
60
45
|
config: {
|
|
61
46
|
clientOptions: {
|
|
@@ -83,9 +68,6 @@ function buildCommandNftBurn() {
|
|
|
83
68
|
.requiredOption(core.I18n.formatMessage("commands.nft-burn.options.seed.param"), core.I18n.formatMessage("commands.nft-burn.options.seed.description"))
|
|
84
69
|
.requiredOption(core.I18n.formatMessage("commands.nft-burn.options.id.param"), core.I18n.formatMessage("commands.nft-burn.options.id.description"));
|
|
85
70
|
command
|
|
86
|
-
.addOption(new commander.Option(core.I18n.formatMessage("commands.common.options.connector.param"), core.I18n.formatMessage("commands.common.options.connector.description"))
|
|
87
|
-
.choices(Object.values(NftConnectorTypes))
|
|
88
|
-
.default(NftConnectorTypes.Iota))
|
|
89
71
|
.option(core.I18n.formatMessage("commands.common.options.node.param"), core.I18n.formatMessage("commands.common.options.node.description"), "!NODE_URL")
|
|
90
72
|
.option(core.I18n.formatMessage("commands.common.options.network.param"), core.I18n.formatMessage("commands.common.options.network.description"), "!NETWORK")
|
|
91
73
|
.option(core.I18n.formatMessage("commands.common.options.explorer.param"), core.I18n.formatMessage("commands.common.options.explorer.description"), "!EXPLORER_URL")
|
|
@@ -97,7 +79,6 @@ function buildCommandNftBurn() {
|
|
|
97
79
|
* @param opts The options for the command.
|
|
98
80
|
* @param opts.seed The seed required for signing by the issuer.
|
|
99
81
|
* @param opts.id The id of the NFT to burn in urn format.
|
|
100
|
-
* @param opts.connector The connector to perform the operations with.
|
|
101
82
|
* @param opts.node The node URL.
|
|
102
83
|
* @param opts.network The network to use for connector.
|
|
103
84
|
* @param opts.explorer The explorer URL.
|
|
@@ -106,9 +87,7 @@ async function actionCommandNftBurn(opts) {
|
|
|
106
87
|
const seed = cliCore.CLIParam.hexBase64("seed", opts.seed);
|
|
107
88
|
const id = cliCore.CLIParam.stringValue("id", opts.id);
|
|
108
89
|
const nodeEndpoint = cliCore.CLIParam.url("node", opts.node);
|
|
109
|
-
const network =
|
|
110
|
-
? cliCore.CLIParam.stringValue("network", opts.network)
|
|
111
|
-
: undefined;
|
|
90
|
+
const network = cliCore.CLIParam.stringValue("network", opts.network);
|
|
112
91
|
const explorerEndpoint = cliCore.CLIParam.url("explorer", opts.explorer);
|
|
113
92
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.nft-burn.labels.nftId"), id);
|
|
114
93
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
|
|
@@ -121,9 +100,9 @@ async function actionCommandNftBurn(opts) {
|
|
|
121
100
|
const vaultSeedId = "local-seed";
|
|
122
101
|
const vaultConnector = vaultModels.VaultConnectorFactory.get("vault");
|
|
123
102
|
await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, core.Converter.bytesToBase64(seed));
|
|
124
|
-
const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network, vaultSeedId },
|
|
103
|
+
const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network, vaultSeedId }, walletCli.WalletConnectorTypes.Iota);
|
|
125
104
|
walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
126
|
-
const nftConnector = setupNftConnector({ nodeEndpoint, network, vaultSeedId }
|
|
105
|
+
const nftConnector = setupNftConnector({ nodeEndpoint, network, vaultSeedId });
|
|
127
106
|
if (core.Is.function(nftConnector.start)) {
|
|
128
107
|
await nftConnector.start(localIdentity);
|
|
129
108
|
}
|
|
@@ -163,9 +142,6 @@ function buildCommandNftMint() {
|
|
|
163
142
|
mergeEnv: true
|
|
164
143
|
});
|
|
165
144
|
command
|
|
166
|
-
.addOption(new commander.Option(core.I18n.formatMessage("commands.common.options.connector.param"), core.I18n.formatMessage("commands.common.options.connector.description"))
|
|
167
|
-
.choices(Object.values(NftConnectorTypes))
|
|
168
|
-
.default(NftConnectorTypes.Iota))
|
|
169
145
|
.option(core.I18n.formatMessage("commands.common.options.network.param"), core.I18n.formatMessage("commands.common.options.network.description"), "!NETWORK")
|
|
170
146
|
.option(core.I18n.formatMessage("commands.common.options.explorer.param"), core.I18n.formatMessage("commands.common.options.explorer.description"), "!EXPLORER_URL")
|
|
171
147
|
.option(core.I18n.formatMessage("commands.common.options.node.param"), core.I18n.formatMessage("commands.common.options.node.description"), "!NODE_URL")
|
|
@@ -181,7 +157,6 @@ function buildCommandNftMint() {
|
|
|
181
157
|
* @param opts.tag The tag for the NFT.
|
|
182
158
|
* @param opts.immutableJson Filename of the immutable JSON data.
|
|
183
159
|
* @param opts.mutableJson Filename of the mutable JSON data.
|
|
184
|
-
* @param opts.connector The connector to perform the operations with.
|
|
185
160
|
* @param opts.node The node URL.
|
|
186
161
|
* @param opts.network The network to use for connector.
|
|
187
162
|
* @param opts.explorer The explorer URL.
|
|
@@ -200,9 +175,7 @@ async function actionCommandNftMint(opts) {
|
|
|
200
175
|
? path.resolve(opts.mutableJson)
|
|
201
176
|
: undefined;
|
|
202
177
|
const nodeEndpoint = cliCore.CLIParam.url("node", opts.node);
|
|
203
|
-
const network =
|
|
204
|
-
? cliCore.CLIParam.stringValue("network", opts.network)
|
|
205
|
-
: undefined;
|
|
178
|
+
const network = cliCore.CLIParam.stringValue("network", opts.network);
|
|
206
179
|
const explorerEndpoint = cliCore.CLIParam.url("explorer", opts.explorer);
|
|
207
180
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.nft-mint.labels.issuer"), issuer);
|
|
208
181
|
if (core.Is.integer(walletAddressIndex)) {
|
|
@@ -225,9 +198,14 @@ async function actionCommandNftMint(opts) {
|
|
|
225
198
|
const vaultSeedId = "local-seed";
|
|
226
199
|
const vaultConnector = vaultModels.VaultConnectorFactory.get("vault");
|
|
227
200
|
await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, core.Converter.bytesToBase64(seed));
|
|
228
|
-
const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network, vaultSeedId },
|
|
201
|
+
const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network, vaultSeedId }, walletCli.WalletConnectorTypes.Iota);
|
|
229
202
|
walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
230
|
-
const nftConnector = setupNftConnector({
|
|
203
|
+
const nftConnector = setupNftConnector({
|
|
204
|
+
nodeEndpoint,
|
|
205
|
+
network,
|
|
206
|
+
vaultSeedId,
|
|
207
|
+
walletAddressIndex
|
|
208
|
+
});
|
|
231
209
|
if (core.Is.function(nftConnector.start)) {
|
|
232
210
|
await nftConnector.start(localIdentity);
|
|
233
211
|
}
|
|
@@ -288,9 +266,6 @@ function buildCommandNftResolve() {
|
|
|
288
266
|
mergeEnv: false
|
|
289
267
|
});
|
|
290
268
|
command
|
|
291
|
-
.addOption(new commander.Option(core.I18n.formatMessage("commands.common.options.connector.param"), core.I18n.formatMessage("commands.common.options.connector.description"))
|
|
292
|
-
.choices(Object.values(NftConnectorTypes))
|
|
293
|
-
.default(NftConnectorTypes.Iota))
|
|
294
269
|
.option(core.I18n.formatMessage("commands.common.options.node.param"), core.I18n.formatMessage("commands.common.options.node.description"), "!NODE_URL")
|
|
295
270
|
.option(core.I18n.formatMessage("commands.common.options.network.param"), core.I18n.formatMessage("commands.common.options.network.description"), "!NETWORK")
|
|
296
271
|
.option(core.I18n.formatMessage("commands.common.options.explorer.param"), core.I18n.formatMessage("commands.common.options.explorer.description"), "!EXPLORER_URL")
|
|
@@ -301,7 +276,6 @@ function buildCommandNftResolve() {
|
|
|
301
276
|
* Action the nft resolve command.
|
|
302
277
|
* @param opts The options for the command.
|
|
303
278
|
* @param opts.id The id of the NFT to resolve in urn format.
|
|
304
|
-
* @param opts.connector The connector to perform the operations with.
|
|
305
279
|
* @param opts.node The node URL.
|
|
306
280
|
* @param opts.network The network to use for connector.
|
|
307
281
|
* @param opts.explorer The explorer URL.
|
|
@@ -309,9 +283,7 @@ function buildCommandNftResolve() {
|
|
|
309
283
|
async function actionCommandNftResolve(opts) {
|
|
310
284
|
const id = cliCore.CLIParam.stringValue("id", opts.id);
|
|
311
285
|
const nodeEndpoint = cliCore.CLIParam.url("node", opts.node);
|
|
312
|
-
const network =
|
|
313
|
-
? cliCore.CLIParam.stringValue("network", opts.network)
|
|
314
|
-
: undefined;
|
|
286
|
+
const network = cliCore.CLIParam.stringValue("network", opts.network);
|
|
315
287
|
const explorerEndpoint = cliCore.CLIParam.url("explorer", opts.explorer);
|
|
316
288
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.nft-resolve.labels.nftId"), id);
|
|
317
289
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
|
|
@@ -320,9 +292,9 @@ async function actionCommandNftResolve(opts) {
|
|
|
320
292
|
}
|
|
321
293
|
cliCore.CLIDisplay.break();
|
|
322
294
|
setupVault();
|
|
323
|
-
const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network },
|
|
295
|
+
const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network }, walletCli.WalletConnectorTypes.Iota);
|
|
324
296
|
walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
325
|
-
const nftConnector = setupNftConnector({ nodeEndpoint, network }
|
|
297
|
+
const nftConnector = setupNftConnector({ nodeEndpoint, network });
|
|
326
298
|
cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.nft-resolve.progress.resolvingNft"));
|
|
327
299
|
cliCore.CLIDisplay.break();
|
|
328
300
|
cliCore.CLIDisplay.spinnerStart();
|
|
@@ -358,9 +330,6 @@ function buildCommandNftTransfer() {
|
|
|
358
330
|
.requiredOption(core.I18n.formatMessage("commands.nft-transfer.options.recipient-identity.param"), core.I18n.formatMessage("commands.nft-transfer.options.recipient-identity.description"))
|
|
359
331
|
.requiredOption(core.I18n.formatMessage("commands.nft-transfer.options.recipient-address.param"), core.I18n.formatMessage("commands.nft-transfer.options.recipient-address.description"));
|
|
360
332
|
command
|
|
361
|
-
.addOption(new commander.Option(core.I18n.formatMessage("commands.common.options.connector.param"), core.I18n.formatMessage("commands.common.options.connector.description"))
|
|
362
|
-
.choices(Object.values(NftConnectorTypes))
|
|
363
|
-
.default(NftConnectorTypes.Iota))
|
|
364
333
|
.option(core.I18n.formatMessage("commands.common.options.node.param"), core.I18n.formatMessage("commands.common.options.node.description"), "!NODE_URL")
|
|
365
334
|
.option(core.I18n.formatMessage("commands.common.options.network.param"), core.I18n.formatMessage("commands.common.options.network.description"), "!NETWORK")
|
|
366
335
|
.option(core.I18n.formatMessage("commands.common.options.explorer.param"), core.I18n.formatMessage("commands.common.options.explorer.description"), "!EXPLORER_URL")
|
|
@@ -374,7 +343,6 @@ function buildCommandNftTransfer() {
|
|
|
374
343
|
* @param opts.id The id of the NFT to transfer in urn format.
|
|
375
344
|
* @param opts.recipientIdentity The recipient address of the NFT.
|
|
376
345
|
* @param opts.recipientAddress The recipient address of the NFT.
|
|
377
|
-
* @param opts.connector The connector to perform the operations with.
|
|
378
346
|
* @param opts.node The node URL.
|
|
379
347
|
* @param opts.network The network to use for connector.
|
|
380
348
|
* @param opts.explorer The explorer URL.
|
|
@@ -383,13 +351,9 @@ async function actionCommandNftTransfer(opts) {
|
|
|
383
351
|
const seed = cliCore.CLIParam.hexBase64("seed", opts.seed);
|
|
384
352
|
const id = cliCore.CLIParam.stringValue("id", opts.id);
|
|
385
353
|
const recipientIdentity = cliCore.CLIParam.stringValue("recipientIdentity", opts.recipientIdentity);
|
|
386
|
-
const recipientAddress = opts.
|
|
387
|
-
? core.Converter.bytesToHex(cliCore.CLIParam.hex("recipientAddress", opts.recipientAddress), true)
|
|
388
|
-
: cliCore.CLIParam.bech32("recipientAddress", opts.recipientAddress);
|
|
354
|
+
const recipientAddress = core.Converter.bytesToHex(cliCore.CLIParam.hex("recipientAddress", opts.recipientAddress), true);
|
|
389
355
|
const nodeEndpoint = cliCore.CLIParam.url("node", opts.node);
|
|
390
|
-
const network =
|
|
391
|
-
? cliCore.CLIParam.stringValue("network", opts.network)
|
|
392
|
-
: undefined;
|
|
356
|
+
const network = cliCore.CLIParam.stringValue("network", opts.network);
|
|
393
357
|
const explorerEndpoint = cliCore.CLIParam.url("explorer", opts.explorer);
|
|
394
358
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.nft-transfer.labels.nftId"), id);
|
|
395
359
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.nft-transfer.labels.recipientIdentity"), recipientIdentity);
|
|
@@ -400,13 +364,13 @@ async function actionCommandNftTransfer(opts) {
|
|
|
400
364
|
}
|
|
401
365
|
cliCore.CLIDisplay.break();
|
|
402
366
|
setupVault();
|
|
403
|
-
const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network },
|
|
367
|
+
const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network }, walletCli.WalletConnectorTypes.Iota);
|
|
404
368
|
walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
405
369
|
const localIdentity = "local";
|
|
406
370
|
const vaultSeedId = "local-seed";
|
|
407
371
|
const vaultConnector = vaultModels.VaultConnectorFactory.get("vault");
|
|
408
372
|
await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, core.Converter.bytesToBase64(seed));
|
|
409
|
-
const nftConnector = setupNftConnector({ nodeEndpoint, network, vaultSeedId }
|
|
373
|
+
const nftConnector = setupNftConnector({ nodeEndpoint, network, vaultSeedId });
|
|
410
374
|
if (core.Is.function(nftConnector.start)) {
|
|
411
375
|
await nftConnector.start(localIdentity);
|
|
412
376
|
}
|
|
@@ -438,7 +402,7 @@ class CLI extends cliCore.CLIBase {
|
|
|
438
402
|
return this.execute({
|
|
439
403
|
title: "TWIN NFT",
|
|
440
404
|
appName: "twin-nft",
|
|
441
|
-
version: "0.0.2-next.
|
|
405
|
+
version: "0.0.2-next.8", // x-release-please-version
|
|
442
406
|
icon: "🌍",
|
|
443
407
|
supportsEnvFiles: true,
|
|
444
408
|
overrideOutputWidth: options?.overrideOutputWidth,
|
|
@@ -464,7 +428,6 @@ class CLI extends cliCore.CLIBase {
|
|
|
464
428
|
}
|
|
465
429
|
|
|
466
430
|
exports.CLI = CLI;
|
|
467
|
-
exports.NftConnectorTypes = NftConnectorTypes;
|
|
468
431
|
exports.actionCommandNftBurn = actionCommandNftBurn;
|
|
469
432
|
exports.actionCommandNftMint = actionCommandNftMint;
|
|
470
433
|
exports.actionCommandNftResolve = actionCommandNftResolve;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -2,29 +2,16 @@ import path from 'node:path';
|
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import { CLIParam, CLIDisplay, CLIOptions, CLIUtils, CLIBase } from '@twin.org/cli-core';
|
|
4
4
|
import { buildCommandMnemonic, buildCommandAddress } from '@twin.org/crypto-cli';
|
|
5
|
-
import { setupWalletConnector, buildCommandFaucet } from '@twin.org/wallet-cli';
|
|
5
|
+
import { setupWalletConnector, WalletConnectorTypes, buildCommandFaucet } from '@twin.org/wallet-cli';
|
|
6
6
|
import { I18n, Is, Converter, StringHelper } from '@twin.org/core';
|
|
7
7
|
import { IotaNftConnector, IotaNftUtils } from '@twin.org/nft-connector-iota';
|
|
8
8
|
import { VaultConnectorFactory } from '@twin.org/vault-models';
|
|
9
9
|
import { WalletConnectorFactory } from '@twin.org/wallet-models';
|
|
10
|
-
import { Command
|
|
10
|
+
import { Command } from 'commander';
|
|
11
11
|
import { MemoryEntityStorageConnector } from '@twin.org/entity-storage-connector-memory';
|
|
12
12
|
import { EntityStorageConnectorFactory } from '@twin.org/entity-storage-models';
|
|
13
13
|
import { initSchema, EntityStorageVaultConnector } from '@twin.org/vault-connector-entity-storage';
|
|
14
14
|
|
|
15
|
-
// Copyright 2024 IOTA Stiftung.
|
|
16
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
17
|
-
/**
|
|
18
|
-
* The NFT connector types.
|
|
19
|
-
*/
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
21
|
-
const NftConnectorTypes = {
|
|
22
|
-
/**
|
|
23
|
-
* IOTA.
|
|
24
|
-
*/
|
|
25
|
-
Iota: "iota"
|
|
26
|
-
};
|
|
27
|
-
|
|
28
15
|
// Copyright 2024 IOTA Stiftung.
|
|
29
16
|
// SPDX-License-Identifier: Apache-2.0.
|
|
30
17
|
/**
|
|
@@ -48,11 +35,9 @@ function setupVault() {
|
|
|
48
35
|
* @param options.network The network.
|
|
49
36
|
* @param options.vaultSeedId The vault seed ID.
|
|
50
37
|
* @param options.walletAddressIndex The wallet address index.
|
|
51
|
-
* @param connector The connector to use.
|
|
52
38
|
* @returns The NFT connector.
|
|
53
39
|
*/
|
|
54
|
-
function setupNftConnector(options
|
|
55
|
-
connector ??= NftConnectorTypes.Iota;
|
|
40
|
+
function setupNftConnector(options) {
|
|
56
41
|
return new IotaNftConnector({
|
|
57
42
|
config: {
|
|
58
43
|
clientOptions: {
|
|
@@ -80,9 +65,6 @@ function buildCommandNftBurn() {
|
|
|
80
65
|
.requiredOption(I18n.formatMessage("commands.nft-burn.options.seed.param"), I18n.formatMessage("commands.nft-burn.options.seed.description"))
|
|
81
66
|
.requiredOption(I18n.formatMessage("commands.nft-burn.options.id.param"), I18n.formatMessage("commands.nft-burn.options.id.description"));
|
|
82
67
|
command
|
|
83
|
-
.addOption(new Option(I18n.formatMessage("commands.common.options.connector.param"), I18n.formatMessage("commands.common.options.connector.description"))
|
|
84
|
-
.choices(Object.values(NftConnectorTypes))
|
|
85
|
-
.default(NftConnectorTypes.Iota))
|
|
86
68
|
.option(I18n.formatMessage("commands.common.options.node.param"), I18n.formatMessage("commands.common.options.node.description"), "!NODE_URL")
|
|
87
69
|
.option(I18n.formatMessage("commands.common.options.network.param"), I18n.formatMessage("commands.common.options.network.description"), "!NETWORK")
|
|
88
70
|
.option(I18n.formatMessage("commands.common.options.explorer.param"), I18n.formatMessage("commands.common.options.explorer.description"), "!EXPLORER_URL")
|
|
@@ -94,7 +76,6 @@ function buildCommandNftBurn() {
|
|
|
94
76
|
* @param opts The options for the command.
|
|
95
77
|
* @param opts.seed The seed required for signing by the issuer.
|
|
96
78
|
* @param opts.id The id of the NFT to burn in urn format.
|
|
97
|
-
* @param opts.connector The connector to perform the operations with.
|
|
98
79
|
* @param opts.node The node URL.
|
|
99
80
|
* @param opts.network The network to use for connector.
|
|
100
81
|
* @param opts.explorer The explorer URL.
|
|
@@ -103,9 +84,7 @@ async function actionCommandNftBurn(opts) {
|
|
|
103
84
|
const seed = CLIParam.hexBase64("seed", opts.seed);
|
|
104
85
|
const id = CLIParam.stringValue("id", opts.id);
|
|
105
86
|
const nodeEndpoint = CLIParam.url("node", opts.node);
|
|
106
|
-
const network =
|
|
107
|
-
? CLIParam.stringValue("network", opts.network)
|
|
108
|
-
: undefined;
|
|
87
|
+
const network = CLIParam.stringValue("network", opts.network);
|
|
109
88
|
const explorerEndpoint = CLIParam.url("explorer", opts.explorer);
|
|
110
89
|
CLIDisplay.value(I18n.formatMessage("commands.nft-burn.labels.nftId"), id);
|
|
111
90
|
CLIDisplay.value(I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
|
|
@@ -118,9 +97,9 @@ async function actionCommandNftBurn(opts) {
|
|
|
118
97
|
const vaultSeedId = "local-seed";
|
|
119
98
|
const vaultConnector = VaultConnectorFactory.get("vault");
|
|
120
99
|
await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, Converter.bytesToBase64(seed));
|
|
121
|
-
const walletConnector = setupWalletConnector({ nodeEndpoint, network, vaultSeedId },
|
|
100
|
+
const walletConnector = setupWalletConnector({ nodeEndpoint, network, vaultSeedId }, WalletConnectorTypes.Iota);
|
|
122
101
|
WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
123
|
-
const nftConnector = setupNftConnector({ nodeEndpoint, network, vaultSeedId }
|
|
102
|
+
const nftConnector = setupNftConnector({ nodeEndpoint, network, vaultSeedId });
|
|
124
103
|
if (Is.function(nftConnector.start)) {
|
|
125
104
|
await nftConnector.start(localIdentity);
|
|
126
105
|
}
|
|
@@ -160,9 +139,6 @@ function buildCommandNftMint() {
|
|
|
160
139
|
mergeEnv: true
|
|
161
140
|
});
|
|
162
141
|
command
|
|
163
|
-
.addOption(new Option(I18n.formatMessage("commands.common.options.connector.param"), I18n.formatMessage("commands.common.options.connector.description"))
|
|
164
|
-
.choices(Object.values(NftConnectorTypes))
|
|
165
|
-
.default(NftConnectorTypes.Iota))
|
|
166
142
|
.option(I18n.formatMessage("commands.common.options.network.param"), I18n.formatMessage("commands.common.options.network.description"), "!NETWORK")
|
|
167
143
|
.option(I18n.formatMessage("commands.common.options.explorer.param"), I18n.formatMessage("commands.common.options.explorer.description"), "!EXPLORER_URL")
|
|
168
144
|
.option(I18n.formatMessage("commands.common.options.node.param"), I18n.formatMessage("commands.common.options.node.description"), "!NODE_URL")
|
|
@@ -178,7 +154,6 @@ function buildCommandNftMint() {
|
|
|
178
154
|
* @param opts.tag The tag for the NFT.
|
|
179
155
|
* @param opts.immutableJson Filename of the immutable JSON data.
|
|
180
156
|
* @param opts.mutableJson Filename of the mutable JSON data.
|
|
181
|
-
* @param opts.connector The connector to perform the operations with.
|
|
182
157
|
* @param opts.node The node URL.
|
|
183
158
|
* @param opts.network The network to use for connector.
|
|
184
159
|
* @param opts.explorer The explorer URL.
|
|
@@ -197,9 +172,7 @@ async function actionCommandNftMint(opts) {
|
|
|
197
172
|
? path.resolve(opts.mutableJson)
|
|
198
173
|
: undefined;
|
|
199
174
|
const nodeEndpoint = CLIParam.url("node", opts.node);
|
|
200
|
-
const network =
|
|
201
|
-
? CLIParam.stringValue("network", opts.network)
|
|
202
|
-
: undefined;
|
|
175
|
+
const network = CLIParam.stringValue("network", opts.network);
|
|
203
176
|
const explorerEndpoint = CLIParam.url("explorer", opts.explorer);
|
|
204
177
|
CLIDisplay.value(I18n.formatMessage("commands.nft-mint.labels.issuer"), issuer);
|
|
205
178
|
if (Is.integer(walletAddressIndex)) {
|
|
@@ -222,9 +195,14 @@ async function actionCommandNftMint(opts) {
|
|
|
222
195
|
const vaultSeedId = "local-seed";
|
|
223
196
|
const vaultConnector = VaultConnectorFactory.get("vault");
|
|
224
197
|
await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, Converter.bytesToBase64(seed));
|
|
225
|
-
const walletConnector = setupWalletConnector({ nodeEndpoint, network, vaultSeedId },
|
|
198
|
+
const walletConnector = setupWalletConnector({ nodeEndpoint, network, vaultSeedId }, WalletConnectorTypes.Iota);
|
|
226
199
|
WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
227
|
-
const nftConnector = setupNftConnector({
|
|
200
|
+
const nftConnector = setupNftConnector({
|
|
201
|
+
nodeEndpoint,
|
|
202
|
+
network,
|
|
203
|
+
vaultSeedId,
|
|
204
|
+
walletAddressIndex
|
|
205
|
+
});
|
|
228
206
|
if (Is.function(nftConnector.start)) {
|
|
229
207
|
await nftConnector.start(localIdentity);
|
|
230
208
|
}
|
|
@@ -285,9 +263,6 @@ function buildCommandNftResolve() {
|
|
|
285
263
|
mergeEnv: false
|
|
286
264
|
});
|
|
287
265
|
command
|
|
288
|
-
.addOption(new Option(I18n.formatMessage("commands.common.options.connector.param"), I18n.formatMessage("commands.common.options.connector.description"))
|
|
289
|
-
.choices(Object.values(NftConnectorTypes))
|
|
290
|
-
.default(NftConnectorTypes.Iota))
|
|
291
266
|
.option(I18n.formatMessage("commands.common.options.node.param"), I18n.formatMessage("commands.common.options.node.description"), "!NODE_URL")
|
|
292
267
|
.option(I18n.formatMessage("commands.common.options.network.param"), I18n.formatMessage("commands.common.options.network.description"), "!NETWORK")
|
|
293
268
|
.option(I18n.formatMessage("commands.common.options.explorer.param"), I18n.formatMessage("commands.common.options.explorer.description"), "!EXPLORER_URL")
|
|
@@ -298,7 +273,6 @@ function buildCommandNftResolve() {
|
|
|
298
273
|
* Action the nft resolve command.
|
|
299
274
|
* @param opts The options for the command.
|
|
300
275
|
* @param opts.id The id of the NFT to resolve in urn format.
|
|
301
|
-
* @param opts.connector The connector to perform the operations with.
|
|
302
276
|
* @param opts.node The node URL.
|
|
303
277
|
* @param opts.network The network to use for connector.
|
|
304
278
|
* @param opts.explorer The explorer URL.
|
|
@@ -306,9 +280,7 @@ function buildCommandNftResolve() {
|
|
|
306
280
|
async function actionCommandNftResolve(opts) {
|
|
307
281
|
const id = CLIParam.stringValue("id", opts.id);
|
|
308
282
|
const nodeEndpoint = CLIParam.url("node", opts.node);
|
|
309
|
-
const network =
|
|
310
|
-
? CLIParam.stringValue("network", opts.network)
|
|
311
|
-
: undefined;
|
|
283
|
+
const network = CLIParam.stringValue("network", opts.network);
|
|
312
284
|
const explorerEndpoint = CLIParam.url("explorer", opts.explorer);
|
|
313
285
|
CLIDisplay.value(I18n.formatMessage("commands.nft-resolve.labels.nftId"), id);
|
|
314
286
|
CLIDisplay.value(I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
|
|
@@ -317,9 +289,9 @@ async function actionCommandNftResolve(opts) {
|
|
|
317
289
|
}
|
|
318
290
|
CLIDisplay.break();
|
|
319
291
|
setupVault();
|
|
320
|
-
const walletConnector = setupWalletConnector({ nodeEndpoint, network },
|
|
292
|
+
const walletConnector = setupWalletConnector({ nodeEndpoint, network }, WalletConnectorTypes.Iota);
|
|
321
293
|
WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
322
|
-
const nftConnector = setupNftConnector({ nodeEndpoint, network }
|
|
294
|
+
const nftConnector = setupNftConnector({ nodeEndpoint, network });
|
|
323
295
|
CLIDisplay.task(I18n.formatMessage("commands.nft-resolve.progress.resolvingNft"));
|
|
324
296
|
CLIDisplay.break();
|
|
325
297
|
CLIDisplay.spinnerStart();
|
|
@@ -355,9 +327,6 @@ function buildCommandNftTransfer() {
|
|
|
355
327
|
.requiredOption(I18n.formatMessage("commands.nft-transfer.options.recipient-identity.param"), I18n.formatMessage("commands.nft-transfer.options.recipient-identity.description"))
|
|
356
328
|
.requiredOption(I18n.formatMessage("commands.nft-transfer.options.recipient-address.param"), I18n.formatMessage("commands.nft-transfer.options.recipient-address.description"));
|
|
357
329
|
command
|
|
358
|
-
.addOption(new Option(I18n.formatMessage("commands.common.options.connector.param"), I18n.formatMessage("commands.common.options.connector.description"))
|
|
359
|
-
.choices(Object.values(NftConnectorTypes))
|
|
360
|
-
.default(NftConnectorTypes.Iota))
|
|
361
330
|
.option(I18n.formatMessage("commands.common.options.node.param"), I18n.formatMessage("commands.common.options.node.description"), "!NODE_URL")
|
|
362
331
|
.option(I18n.formatMessage("commands.common.options.network.param"), I18n.formatMessage("commands.common.options.network.description"), "!NETWORK")
|
|
363
332
|
.option(I18n.formatMessage("commands.common.options.explorer.param"), I18n.formatMessage("commands.common.options.explorer.description"), "!EXPLORER_URL")
|
|
@@ -371,7 +340,6 @@ function buildCommandNftTransfer() {
|
|
|
371
340
|
* @param opts.id The id of the NFT to transfer in urn format.
|
|
372
341
|
* @param opts.recipientIdentity The recipient address of the NFT.
|
|
373
342
|
* @param opts.recipientAddress The recipient address of the NFT.
|
|
374
|
-
* @param opts.connector The connector to perform the operations with.
|
|
375
343
|
* @param opts.node The node URL.
|
|
376
344
|
* @param opts.network The network to use for connector.
|
|
377
345
|
* @param opts.explorer The explorer URL.
|
|
@@ -380,13 +348,9 @@ async function actionCommandNftTransfer(opts) {
|
|
|
380
348
|
const seed = CLIParam.hexBase64("seed", opts.seed);
|
|
381
349
|
const id = CLIParam.stringValue("id", opts.id);
|
|
382
350
|
const recipientIdentity = CLIParam.stringValue("recipientIdentity", opts.recipientIdentity);
|
|
383
|
-
const recipientAddress = opts.
|
|
384
|
-
? Converter.bytesToHex(CLIParam.hex("recipientAddress", opts.recipientAddress), true)
|
|
385
|
-
: CLIParam.bech32("recipientAddress", opts.recipientAddress);
|
|
351
|
+
const recipientAddress = Converter.bytesToHex(CLIParam.hex("recipientAddress", opts.recipientAddress), true);
|
|
386
352
|
const nodeEndpoint = CLIParam.url("node", opts.node);
|
|
387
|
-
const network =
|
|
388
|
-
? CLIParam.stringValue("network", opts.network)
|
|
389
|
-
: undefined;
|
|
353
|
+
const network = CLIParam.stringValue("network", opts.network);
|
|
390
354
|
const explorerEndpoint = CLIParam.url("explorer", opts.explorer);
|
|
391
355
|
CLIDisplay.value(I18n.formatMessage("commands.nft-transfer.labels.nftId"), id);
|
|
392
356
|
CLIDisplay.value(I18n.formatMessage("commands.nft-transfer.labels.recipientIdentity"), recipientIdentity);
|
|
@@ -397,13 +361,13 @@ async function actionCommandNftTransfer(opts) {
|
|
|
397
361
|
}
|
|
398
362
|
CLIDisplay.break();
|
|
399
363
|
setupVault();
|
|
400
|
-
const walletConnector = setupWalletConnector({ nodeEndpoint, network },
|
|
364
|
+
const walletConnector = setupWalletConnector({ nodeEndpoint, network }, WalletConnectorTypes.Iota);
|
|
401
365
|
WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
402
366
|
const localIdentity = "local";
|
|
403
367
|
const vaultSeedId = "local-seed";
|
|
404
368
|
const vaultConnector = VaultConnectorFactory.get("vault");
|
|
405
369
|
await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, Converter.bytesToBase64(seed));
|
|
406
|
-
const nftConnector = setupNftConnector({ nodeEndpoint, network, vaultSeedId }
|
|
370
|
+
const nftConnector = setupNftConnector({ nodeEndpoint, network, vaultSeedId });
|
|
407
371
|
if (Is.function(nftConnector.start)) {
|
|
408
372
|
await nftConnector.start(localIdentity);
|
|
409
373
|
}
|
|
@@ -435,7 +399,7 @@ class CLI extends CLIBase {
|
|
|
435
399
|
return this.execute({
|
|
436
400
|
title: "TWIN NFT",
|
|
437
401
|
appName: "twin-nft",
|
|
438
|
-
version: "0.0.2-next.
|
|
402
|
+
version: "0.0.2-next.8", // x-release-please-version
|
|
439
403
|
icon: "🌍",
|
|
440
404
|
supportsEnvFiles: true,
|
|
441
405
|
overrideOutputWidth: options?.overrideOutputWidth,
|
|
@@ -460,4 +424,4 @@ class CLI extends CLIBase {
|
|
|
460
424
|
}
|
|
461
425
|
}
|
|
462
426
|
|
|
463
|
-
export { CLI,
|
|
427
|
+
export { CLI, actionCommandNftBurn, actionCommandNftMint, actionCommandNftResolve, actionCommandNftTransfer, buildCommandNftBurn, buildCommandNftMint, buildCommandNftResolve, buildCommandNftTransfer, setupNftConnector, setupVault };
|
package/dist/locales/en.json
CHANGED
|
@@ -39,8 +39,13 @@
|
|
|
39
39
|
"beUrl": "{fieldName} must be a correctly formatted url",
|
|
40
40
|
"beJSON": "{fieldName} must be correctly formatted JSON",
|
|
41
41
|
"beEmail": "{fieldName} must be a correctly formatted e-mail address",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
42
|
+
"minLengthRequired": "The value length should be at least {minLength}, it is {actualLength}",
|
|
43
|
+
"maxLengthRequired": "The value length should be at most {maxLength}, it is {actualLength}",
|
|
44
|
+
"repeatedCharacters": "The value should not contain repeated characters in sequence",
|
|
45
|
+
"atLeastOneLowerCase": "The value should contain at least one lowercase character",
|
|
46
|
+
"atLeastOneUpperCase": "The value should contain at least one uppercase character",
|
|
47
|
+
"atLeastOneNumber": "The value should contain at least one number",
|
|
48
|
+
"atLeastOneSpecialChar": "The value should contain at least one symbol"
|
|
44
49
|
},
|
|
45
50
|
"guard": {
|
|
46
51
|
"undefined": "Property \"{property}\" must be defined, it is \"{value}\"",
|
|
@@ -73,9 +78,7 @@
|
|
|
73
78
|
"url": "Property \"{property}\" must be a Url formatted string, it is \"{value}\"",
|
|
74
79
|
"email": "Property \"{property}\" must be string in e-mail format, it is \"{value}\"",
|
|
75
80
|
"length32Multiple": "Property \"{property}\" should be a multiple of 32, it is {value}",
|
|
76
|
-
"lengthEntropy": "Property \"{property}\" should be a multiple of 4, >=16 and <= 32, it is {value}"
|
|
77
|
-
"length3Multiple": "Property \"{property}\" should be a multiple of 3, it is {value}",
|
|
78
|
-
"greaterThan0": "Property \"{property}\" must be greater than zero, it is {value}"
|
|
81
|
+
"lengthEntropy": "Property \"{property}\" should be a multiple of 4, >=16 and <= 32, it is {value}"
|
|
79
82
|
},
|
|
80
83
|
"objectHelper": {
|
|
81
84
|
"failedBytesToJSON": "Failed converting bytes to JSON",
|
|
@@ -91,7 +94,7 @@
|
|
|
91
94
|
"noGet": "The requested {typeName} \"{name}\" does not exist in the factory"
|
|
92
95
|
},
|
|
93
96
|
"bitString": {
|
|
94
|
-
"outOfRange": "The index should be >= 0 and less than the length of the bit string"
|
|
97
|
+
"outOfRange": "The index should be >= 0 and less than the length of the bit string, the index is \"{index}\" and the number of bit is \"{numberBits}\""
|
|
95
98
|
},
|
|
96
99
|
"base32": {
|
|
97
100
|
"invalidCharacter": "Data contains a character \"{invalidCharacter}\" which is not in the charset"
|
|
@@ -105,10 +108,6 @@
|
|
|
105
108
|
"jsonHelper": {
|
|
106
109
|
"failedPatch": "Failed to patch the JSON object, patch index \"{index}\" failed"
|
|
107
110
|
},
|
|
108
|
-
"bip39": {
|
|
109
|
-
"missingMnemonicWord": "The mnemonic contains a word not in the wordlist, \"{value}\"",
|
|
110
|
-
"checksumMismatch": "The checksum does not match \"{newChecksum}\" != \"{checksumBits}\""
|
|
111
|
-
},
|
|
112
111
|
"ed25519": {
|
|
113
112
|
"privateKeyLength": "The private key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\"",
|
|
114
113
|
"publicKeyLength": "The public key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\""
|
|
@@ -117,13 +116,6 @@
|
|
|
117
116
|
"privateKeyLength": "The private key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\"",
|
|
118
117
|
"publicKeyLength": "The public key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\""
|
|
119
118
|
},
|
|
120
|
-
"x25519": {
|
|
121
|
-
"invalidPublicKey": "Invalid Ed25519 Public Key"
|
|
122
|
-
},
|
|
123
|
-
"blake2b": {
|
|
124
|
-
"outputLength64": "The output length should be between 1 and 64, it is \"{outputLength}\"",
|
|
125
|
-
"keyLength64": "The key length should be between 1 and 64, it is \"{keyLength}\""
|
|
126
|
-
},
|
|
127
119
|
"sha512": {
|
|
128
120
|
"bitSize": "Only 224, 256, 384 or 512 bits are supported, it is \"{bitSize}\""
|
|
129
121
|
},
|
|
@@ -146,41 +138,20 @@
|
|
|
146
138
|
"lowerUpper": "The address my use either lowercase or uppercase, \"{bech32}\"",
|
|
147
139
|
"dataTooShort": "The address does not contain enough data to decode, \"{bech32}\""
|
|
148
140
|
},
|
|
149
|
-
"pbkdf2": {
|
|
150
|
-
"keyTooLong": "The requested key length \"{keyLength}\" is too long, based on the \"{macLength}\""
|
|
151
|
-
},
|
|
152
|
-
"chaCha20Poly1305": {
|
|
153
|
-
"noAadWithData": "You can not set the aad when there is already data",
|
|
154
|
-
"noAuthTag": "Can not finalise when the auth tag is not set",
|
|
155
|
-
"authenticationFailed": "The data could not be authenticated",
|
|
156
|
-
"authTagDecrypting": "Can not get the auth tag when decrypting",
|
|
157
|
-
"authTagEncrypting": "Can not set the auth tag when encrypting",
|
|
158
|
-
"noAuthTagSet": "The auth tag has not been set"
|
|
159
|
-
},
|
|
160
141
|
"bip44": {
|
|
161
142
|
"unsupportedKeyType": "The key type \"{keyType}\" is not supported"
|
|
162
143
|
},
|
|
163
144
|
"slip0010": {
|
|
164
145
|
"invalidSeed": "The seed is invalid \"{seed}\""
|
|
165
146
|
},
|
|
166
|
-
"rsa": {
|
|
167
|
-
"noPrivateKey": "Private key is required for this operation",
|
|
168
|
-
"invalidKeySize": "Invalid RSA key size"
|
|
169
|
-
},
|
|
170
147
|
"commands": {
|
|
171
148
|
"common": {
|
|
172
149
|
"missingEnv": "The \"{option}\" option is configured as an environment variable, but there is no environment variable with the name \"{value}\" set.",
|
|
173
150
|
"optionInvalidHex": "The \"{option}\" does not appear to be hex. \"{value}\"",
|
|
174
151
|
"optionInvalidBase64": "The \"{option}\" does not appear to be base64. \"{value}\"",
|
|
175
152
|
"optionInvalidHexBase64": "The \"{option}\" does not appear to be hex or base64. \"{value}\"",
|
|
176
|
-
"optionInvalidBech32": "The \"{option}\" does not appear to be bech32. \"{value}\"",
|
|
177
153
|
"optionMinValue": "The \"{option}\" option must be greater than or equal to {minValue}, it is {value}.",
|
|
178
154
|
"optionMaxValue": "The \"{option}\" option must be less than or equal to {maxValue}, it is {value}."
|
|
179
|
-
},
|
|
180
|
-
"address": {
|
|
181
|
-
"seedMissingEnv": "The seed does not appear to be hex or base64, assuming it is an environment variable, but there is no environment variable with the name \"{env}\" set.",
|
|
182
|
-
"seedInvalidEnv": "The seed does not appear to be hex or base64, assuming it is an environment variable, but there the environment variable is neither hex or base64. \"{envValue}\"",
|
|
183
|
-
"seedInvalidFormat": "The seed does not appear to be hex, base64 or an environment variable. \"{seed}\""
|
|
184
155
|
}
|
|
185
156
|
},
|
|
186
157
|
"entitySchemaHelper": {
|
|
@@ -223,8 +194,7 @@
|
|
|
223
194
|
"transactionFailed": "The transaction failed",
|
|
224
195
|
"addressNotFound": "The address is missing could not be found from the seed \"{address}\"",
|
|
225
196
|
"gasStationTransactionFailed": "The gas station transaction failed",
|
|
226
|
-
"
|
|
227
|
-
"gasStationExecutionFailed": "The gas station execution failed"
|
|
197
|
+
"dryRunFailed": "The dry run execution failed"
|
|
228
198
|
},
|
|
229
199
|
"iotaSmartContractUtils": {
|
|
230
200
|
"migrationFailed": "Smart contract migration failed",
|
|
@@ -247,11 +217,12 @@
|
|
|
247
217
|
"invalidSignature": "The JSON Web token signature could not be verified"
|
|
248
218
|
},
|
|
249
219
|
"fetchHelper": {
|
|
250
|
-
"decodingJSON": "Decoding JSON failed for route \"{
|
|
220
|
+
"decodingJSON": "Decoding JSON failed for route \"{url}\"",
|
|
251
221
|
"failureStatusText": "The request to the API failed: \"{statusText}\"",
|
|
252
222
|
"connectivity": "The request failed, the API could be offline, or there are other connectivity issues",
|
|
253
223
|
"timeout": "The request timed out",
|
|
254
|
-
"general": "A general failure occurred during the request"
|
|
224
|
+
"general": "A general failure occurred during the request",
|
|
225
|
+
"retryLimitExceeded": "The retry limit was exceeded for route \"{url}\""
|
|
255
226
|
},
|
|
256
227
|
"jwt": {
|
|
257
228
|
"noKeyOrSigner": "No key or signer was provided for JWT creation",
|
|
@@ -292,7 +263,8 @@
|
|
|
292
263
|
"alreadyExistsError": "Already Exists",
|
|
293
264
|
"notImplementedError": "Not Implemented",
|
|
294
265
|
"validationError": "Validation",
|
|
295
|
-
"unprocessableError": "Unprocessable"
|
|
266
|
+
"unprocessableError": "Unprocessable",
|
|
267
|
+
"unauthorizedError": "Unauthorized"
|
|
296
268
|
},
|
|
297
269
|
"validation": {
|
|
298
270
|
"defaultFieldName": "The field"
|
|
@@ -357,27 +329,11 @@
|
|
|
357
329
|
"param": "--seed-format '<'format'>'",
|
|
358
330
|
"description": "The format to output the seed."
|
|
359
331
|
},
|
|
360
|
-
"no-console": {
|
|
361
|
-
"param": "--no-console",
|
|
362
|
-
"description": "Hides the mnemonic and seed in the console."
|
|
363
|
-
},
|
|
364
|
-
"json": {
|
|
365
|
-
"param": "--json '<'filename'>'",
|
|
366
|
-
"description": "Creates a JSON file containing the mnemonic and seed."
|
|
367
|
-
},
|
|
368
|
-
"env": {
|
|
369
|
-
"param": "--env '<'filename'>'",
|
|
370
|
-
"description": "Creates an env file containing the mnemonic and seed."
|
|
371
|
-
},
|
|
372
332
|
"env-prefix": {
|
|
373
333
|
"param": "--env-prefix '<'prefix'>'",
|
|
374
334
|
"description": "Prefixes the env variables with the value."
|
|
375
335
|
}
|
|
376
336
|
},
|
|
377
|
-
"progress": {
|
|
378
|
-
"writingJsonFile": "Writing JSON file",
|
|
379
|
-
"writingEnvFile": "Writing env file"
|
|
380
|
-
},
|
|
381
337
|
"labels": {
|
|
382
338
|
"mnemonic": "Mnemonic",
|
|
383
339
|
"seed": "Seed",
|
|
@@ -492,7 +448,7 @@
|
|
|
492
448
|
"options": {
|
|
493
449
|
"connector": {
|
|
494
450
|
"param": "--connector '<'connector'>'",
|
|
495
|
-
"description": "The connector to use for the
|
|
451
|
+
"description": "The connector to use for the wallet operation."
|
|
496
452
|
},
|
|
497
453
|
"node": {
|
|
498
454
|
"param": "--node '<'url'>'",
|
|
@@ -514,8 +470,7 @@
|
|
|
514
470
|
"explorer": "Explorer",
|
|
515
471
|
"explore": "Explore",
|
|
516
472
|
"connector": "Connector",
|
|
517
|
-
"network": "Network"
|
|
518
|
-
"did": "DID"
|
|
473
|
+
"network": "Network"
|
|
519
474
|
}
|
|
520
475
|
},
|
|
521
476
|
"nft-mint": {
|
|
@@ -595,7 +550,6 @@
|
|
|
595
550
|
"burningNft": "Burning NFT"
|
|
596
551
|
},
|
|
597
552
|
"labels": {
|
|
598
|
-
"issuer": "Issuer",
|
|
599
553
|
"nftId": "NFT Id"
|
|
600
554
|
}
|
|
601
555
|
},
|
|
@@ -632,10 +586,10 @@
|
|
|
632
586
|
},
|
|
633
587
|
"info": {
|
|
634
588
|
"iotaNftConnector": {
|
|
635
|
-
"contractAlreadyDeployed": "Contract already deployed",
|
|
636
|
-
"contractDeploymentStarted": "Contract deployment started",
|
|
637
|
-
"contractDeploymentCompleted": "Contract deployment completed",
|
|
638
589
|
"contractReady": "Contract ready for use"
|
|
590
|
+
},
|
|
591
|
+
"iota": {
|
|
592
|
+
"transactionCosts": "Transaction costs for operation \"{operation}\", \"{cost}\""
|
|
639
593
|
}
|
|
640
594
|
},
|
|
641
595
|
"errorMessages": {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { NftConnectorTypes } from "../models/nftConnectorTypes";
|
|
3
2
|
/**
|
|
4
3
|
* Build the nft burn command for the CLI.
|
|
5
4
|
* @returns The command.
|
|
@@ -10,7 +9,6 @@ export declare function buildCommandNftBurn(): Command;
|
|
|
10
9
|
* @param opts The options for the command.
|
|
11
10
|
* @param opts.seed The seed required for signing by the issuer.
|
|
12
11
|
* @param opts.id The id of the NFT to burn in urn format.
|
|
13
|
-
* @param opts.connector The connector to perform the operations with.
|
|
14
12
|
* @param opts.node The node URL.
|
|
15
13
|
* @param opts.network The network to use for connector.
|
|
16
14
|
* @param opts.explorer The explorer URL.
|
|
@@ -18,7 +16,6 @@ export declare function buildCommandNftBurn(): Command;
|
|
|
18
16
|
export declare function actionCommandNftBurn(opts: {
|
|
19
17
|
seed: string;
|
|
20
18
|
id: string;
|
|
21
|
-
connector?: NftConnectorTypes;
|
|
22
19
|
node: string;
|
|
23
20
|
network?: string;
|
|
24
21
|
explorer: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type CliOutputOptions } from "@twin.org/cli-core";
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
-
import { NftConnectorTypes } from "../models/nftConnectorTypes";
|
|
4
3
|
/**
|
|
5
4
|
* Build the nft mint command for the CLI.
|
|
6
5
|
* @returns The command.
|
|
@@ -15,7 +14,6 @@ export declare function buildCommandNftMint(): Command;
|
|
|
15
14
|
* @param opts.tag The tag for the NFT.
|
|
16
15
|
* @param opts.immutableJson Filename of the immutable JSON data.
|
|
17
16
|
* @param opts.mutableJson Filename of the mutable JSON data.
|
|
18
|
-
* @param opts.connector The connector to perform the operations with.
|
|
19
17
|
* @param opts.node The node URL.
|
|
20
18
|
* @param opts.network The network to use for connector.
|
|
21
19
|
* @param opts.explorer The explorer URL.
|
|
@@ -27,7 +25,6 @@ export declare function actionCommandNftMint(opts: {
|
|
|
27
25
|
tag: string;
|
|
28
26
|
immutableJson?: string;
|
|
29
27
|
mutableJson?: string;
|
|
30
|
-
connector?: NftConnectorTypes;
|
|
31
28
|
node: string;
|
|
32
29
|
network?: string;
|
|
33
30
|
explorer: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type CliOutputOptions } from "@twin.org/cli-core";
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
-
import { NftConnectorTypes } from "../models/nftConnectorTypes";
|
|
4
3
|
/**
|
|
5
4
|
* Build the nft resolve command for the CLI.
|
|
6
5
|
* @returns The command.
|
|
@@ -10,14 +9,12 @@ export declare function buildCommandNftResolve(): Command;
|
|
|
10
9
|
* Action the nft resolve command.
|
|
11
10
|
* @param opts The options for the command.
|
|
12
11
|
* @param opts.id The id of the NFT to resolve in urn format.
|
|
13
|
-
* @param opts.connector The connector to perform the operations with.
|
|
14
12
|
* @param opts.node The node URL.
|
|
15
13
|
* @param opts.network The network to use for connector.
|
|
16
14
|
* @param opts.explorer The explorer URL.
|
|
17
15
|
*/
|
|
18
16
|
export declare function actionCommandNftResolve(opts: {
|
|
19
17
|
id: string;
|
|
20
|
-
connector?: NftConnectorTypes;
|
|
21
18
|
node: string;
|
|
22
19
|
network?: string;
|
|
23
20
|
explorer: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { NftConnectorTypes } from "../models/nftConnectorTypes";
|
|
3
2
|
/**
|
|
4
3
|
* Build the nft transfer command for the CLI.
|
|
5
4
|
* @returns The command.
|
|
@@ -12,7 +11,6 @@ export declare function buildCommandNftTransfer(): Command;
|
|
|
12
11
|
* @param opts.id The id of the NFT to transfer in urn format.
|
|
13
12
|
* @param opts.recipientIdentity The recipient address of the NFT.
|
|
14
13
|
* @param opts.recipientAddress The recipient address of the NFT.
|
|
15
|
-
* @param opts.connector The connector to perform the operations with.
|
|
16
14
|
* @param opts.node The node URL.
|
|
17
15
|
* @param opts.network The network to use for connector.
|
|
18
16
|
* @param opts.explorer The explorer URL.
|
|
@@ -22,7 +20,6 @@ export declare function actionCommandNftTransfer(opts: {
|
|
|
22
20
|
id: string;
|
|
23
21
|
recipientIdentity: string;
|
|
24
22
|
recipientAddress: string;
|
|
25
|
-
connector?: NftConnectorTypes;
|
|
26
23
|
node: string;
|
|
27
24
|
network?: string;
|
|
28
25
|
explorer: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { INftConnector } from "@twin.org/nft-models";
|
|
2
|
-
import { NftConnectorTypes } from "../models/nftConnectorTypes";
|
|
3
2
|
/**
|
|
4
3
|
* Setup the vault for use in the CLI commands.
|
|
5
4
|
*/
|
|
@@ -11,7 +10,6 @@ export declare function setupVault(): void;
|
|
|
11
10
|
* @param options.network The network.
|
|
12
11
|
* @param options.vaultSeedId The vault seed ID.
|
|
13
12
|
* @param options.walletAddressIndex The wallet address index.
|
|
14
|
-
* @param connector The connector to use.
|
|
15
13
|
* @returns The NFT connector.
|
|
16
14
|
*/
|
|
17
15
|
export declare function setupNftConnector(options: {
|
|
@@ -19,4 +17,4 @@ export declare function setupNftConnector(options: {
|
|
|
19
17
|
network?: string;
|
|
20
18
|
vaultSeedId?: string;
|
|
21
19
|
walletAddressIndex?: number;
|
|
22
|
-
}
|
|
20
|
+
}): INftConnector;
|
package/dist/types/index.d.ts
CHANGED
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @twin.org/nft-cli - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.8](https://github.com/twinfoundation/nft/compare/nft-cli-v0.0.2-next.7...nft-cli-v0.0.2-next.8) (2025-10-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add validate-locales ([0055a56](https://github.com/twinfoundation/nft/commit/0055a56ed166946f1db860aa0725ad53248b3427))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/nft-connector-iota bumped from 0.0.2-next.7 to 0.0.2-next.8
|
|
16
|
+
|
|
3
17
|
## [0.0.2-next.7](https://github.com/twinfoundation/nft/compare/nft-cli-v0.0.2-next.6...nft-cli-v0.0.2-next.7) (2025-09-26)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Function: setupNftConnector()
|
|
2
2
|
|
|
3
|
-
> **setupNftConnector**(`options
|
|
3
|
+
> **setupNftConnector**(`options`): `INftConnector`
|
|
4
4
|
|
|
5
5
|
Setup the NFT connector for use in the CLI commands.
|
|
6
6
|
|
|
@@ -34,12 +34,6 @@ The vault seed ID.
|
|
|
34
34
|
|
|
35
35
|
The wallet address index.
|
|
36
36
|
|
|
37
|
-
### connector?
|
|
38
|
-
|
|
39
|
-
`"iota"`
|
|
40
|
-
|
|
41
|
-
The connector to use.
|
|
42
|
-
|
|
43
37
|
## Returns
|
|
44
38
|
|
|
45
39
|
`INftConnector`
|
package/docs/reference/index.md
CHANGED
|
@@ -4,14 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
- [CLI](classes/CLI.md)
|
|
6
6
|
|
|
7
|
-
## Type Aliases
|
|
8
|
-
|
|
9
|
-
- [NftConnectorTypes](type-aliases/NftConnectorTypes.md)
|
|
10
|
-
|
|
11
|
-
## Variables
|
|
12
|
-
|
|
13
|
-
- [NftConnectorTypes](variables/NftConnectorTypes.md)
|
|
14
|
-
|
|
15
7
|
## Functions
|
|
16
8
|
|
|
17
9
|
- [buildCommandNftBurn](functions/buildCommandNftBurn.md)
|
package/locales/en.json
CHANGED
|
@@ -77,7 +77,6 @@
|
|
|
77
77
|
"burningNft": "Burning NFT"
|
|
78
78
|
},
|
|
79
79
|
"labels": {
|
|
80
|
-
"issuer": "Issuer",
|
|
81
80
|
"nftId": "NFT Id"
|
|
82
81
|
}
|
|
83
82
|
},
|
|
@@ -113,10 +112,6 @@
|
|
|
113
112
|
},
|
|
114
113
|
"common": {
|
|
115
114
|
"options": {
|
|
116
|
-
"connector": {
|
|
117
|
-
"param": "--connector '<'connector'>'",
|
|
118
|
-
"description": "The connector to use for the NFT operation."
|
|
119
|
-
},
|
|
120
115
|
"network": {
|
|
121
116
|
"param": "--network '<'network'>'",
|
|
122
117
|
"description": "The network to use for the NFT operation."
|
|
@@ -124,14 +119,15 @@
|
|
|
124
119
|
"node": {
|
|
125
120
|
"param": "--node '<'url'>'",
|
|
126
121
|
"description": "The url for the node endpoint, or an environment variable name containing the url."
|
|
122
|
+
},
|
|
123
|
+
"explorer": {
|
|
124
|
+
"param": "--explorer '<'url'>'",
|
|
125
|
+
"description": "The url for the explorer endpoint, or an environment variable name containing the url."
|
|
127
126
|
}
|
|
128
127
|
},
|
|
129
128
|
"labels": {
|
|
130
|
-
"did": "DID",
|
|
131
129
|
"node": "Node",
|
|
132
|
-
"explorer": "Explorer",
|
|
133
130
|
"explore": "Explore",
|
|
134
|
-
"connector": "Connector",
|
|
135
131
|
"network": "Network"
|
|
136
132
|
}
|
|
137
133
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/nft-cli",
|
|
3
|
-
"version": "0.0.2-next.
|
|
3
|
+
"version": "0.0.2-next.8",
|
|
4
4
|
"description": "A command line interface for interacting with the nft connectors",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"@twin.org/entity": "next",
|
|
22
22
|
"@twin.org/entity-storage-connector-memory": "next",
|
|
23
23
|
"@twin.org/nameof": "next",
|
|
24
|
-
"@twin.org/nft-connector-iota": "0.0.2-next.
|
|
24
|
+
"@twin.org/nft-connector-iota": "0.0.2-next.8",
|
|
25
25
|
"@twin.org/vault-connector-entity-storage": "next",
|
|
26
26
|
"@twin.org/vault-models": "next",
|
|
27
27
|
"@twin.org/wallet-cli": "next",
|
|
28
28
|
"@twin.org/wallet-models": "next",
|
|
29
|
-
"commander": "14.0.
|
|
29
|
+
"commander": "14.0.1"
|
|
30
30
|
},
|
|
31
31
|
"main": "./dist/cjs/index.cjs",
|
|
32
32
|
"module": "./dist/esm/index.mjs",
|
|
@@ -49,5 +49,20 @@
|
|
|
49
49
|
],
|
|
50
50
|
"bin": {
|
|
51
51
|
"twin-nft": "bin/index.js"
|
|
52
|
-
}
|
|
52
|
+
},
|
|
53
|
+
"keywords": [
|
|
54
|
+
"twin",
|
|
55
|
+
"trade",
|
|
56
|
+
"iota",
|
|
57
|
+
"framework",
|
|
58
|
+
"blockchain",
|
|
59
|
+
"nft",
|
|
60
|
+
"tokens",
|
|
61
|
+
"non-fungible",
|
|
62
|
+
"assets"
|
|
63
|
+
],
|
|
64
|
+
"bugs": {
|
|
65
|
+
"url": "git+https://github.com/twinfoundation/nft/issues"
|
|
66
|
+
},
|
|
67
|
+
"homepage": "https://twindev.org"
|
|
53
68
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The NFT connector types.
|
|
3
|
-
*/
|
|
4
|
-
export declare const NftConnectorTypes: {
|
|
5
|
-
/**
|
|
6
|
-
* IOTA.
|
|
7
|
-
*/
|
|
8
|
-
readonly Iota: "iota";
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* The NFT connector types.
|
|
12
|
-
*/
|
|
13
|
-
export type NftConnectorTypes = (typeof NftConnectorTypes)[keyof typeof NftConnectorTypes];
|