@twin.org/nft-cli 0.0.1-next.19 → 0.0.1-next.20
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 +32 -8
- package/dist/esm/index.mjs +33 -9
- package/dist/locales/en.json +14 -4
- package/dist/types/commands/nftMint.d.ts +4 -0
- package/dist/types/commands/setupCommands.d.ts +2 -0
- package/docs/changelog.md +1 -1
- package/docs/reference/functions/setupNftConnector.md +6 -0
- package/locales/en.json +14 -4
- package/package.json +4 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -9,6 +9,7 @@ var core = require('@twin.org/core');
|
|
|
9
9
|
var nftConnectorIota = require('@twin.org/nft-connector-iota');
|
|
10
10
|
var nftConnectorIotaStardust = require('@twin.org/nft-connector-iota-stardust');
|
|
11
11
|
var vaultModels = require('@twin.org/vault-models');
|
|
12
|
+
var walletModels = require('@twin.org/wallet-models');
|
|
12
13
|
var commander = require('commander');
|
|
13
14
|
var entityStorageConnectorMemory = require('@twin.org/entity-storage-connector-memory');
|
|
14
15
|
var entityStorageModels = require('@twin.org/entity-storage-models');
|
|
@@ -54,6 +55,7 @@ function setupVault() {
|
|
|
54
55
|
* @param options.nodeEndpoint The node endpoint.
|
|
55
56
|
* @param options.network The network.
|
|
56
57
|
* @param options.vaultSeedId The vault seed ID.
|
|
58
|
+
* @param options.walletAddressIndex The wallet address index.
|
|
57
59
|
* @param connector The connector to use.
|
|
58
60
|
* @returns The NFT connector.
|
|
59
61
|
*/
|
|
@@ -67,7 +69,8 @@ function setupNftConnector(options, connector) {
|
|
|
67
69
|
url: options.nodeEndpoint
|
|
68
70
|
},
|
|
69
71
|
network: options.network ?? "",
|
|
70
|
-
vaultSeedId: options.vaultSeedId
|
|
72
|
+
vaultSeedId: options.vaultSeedId,
|
|
73
|
+
walletAddressIndex: options.walletAddressIndex ?? 0
|
|
71
74
|
}
|
|
72
75
|
});
|
|
73
76
|
}
|
|
@@ -78,7 +81,8 @@ function setupNftConnector(options, connector) {
|
|
|
78
81
|
nodes: [options.nodeEndpoint],
|
|
79
82
|
localPow: true
|
|
80
83
|
},
|
|
81
|
-
vaultSeedId: options.vaultSeedId
|
|
84
|
+
vaultSeedId: options.vaultSeedId,
|
|
85
|
+
walletAddressIndex: options.walletAddressIndex ?? 0
|
|
82
86
|
}
|
|
83
87
|
});
|
|
84
88
|
}
|
|
@@ -138,6 +142,8 @@ async function actionCommandNftBurn(opts) {
|
|
|
138
142
|
const vaultSeedId = "local-seed";
|
|
139
143
|
const vaultConnector = vaultModels.VaultConnectorFactory.get("vault");
|
|
140
144
|
await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, core.Converter.bytesToBase64(seed));
|
|
145
|
+
const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
|
|
146
|
+
walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
141
147
|
const nftConnector = setupNftConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
|
|
142
148
|
if (core.Is.function(nftConnector.start)) {
|
|
143
149
|
await nftConnector.start(localIdentity);
|
|
@@ -167,6 +173,8 @@ function buildCommandNftMint() {
|
|
|
167
173
|
.summary(core.I18n.formatMessage("commands.nft-mint.summary"))
|
|
168
174
|
.description(core.I18n.formatMessage("commands.nft-mint.description"))
|
|
169
175
|
.requiredOption(core.I18n.formatMessage("commands.nft-mint.options.seed.param"), core.I18n.formatMessage("commands.nft-mint.options.seed.description"))
|
|
176
|
+
.requiredOption(core.I18n.formatMessage("commands.nft-mint.options.issuer.param"), core.I18n.formatMessage("commands.nft-mint.options.issuer.description"))
|
|
177
|
+
.option(core.I18n.formatMessage("commands.nft-mint.options.wallet-address-index.param"), core.I18n.formatMessage("commands.nft-mint.options.wallet-address-index.description"), "0")
|
|
170
178
|
.requiredOption(core.I18n.formatMessage("commands.nft-mint.options.tag.param"), core.I18n.formatMessage("commands.nft-mint.options.tag.description"))
|
|
171
179
|
.option(core.I18n.formatMessage("commands.nft-mint.options.immutable-json.param"), core.I18n.formatMessage("commands.nft-mint.options.immutable-json.description"))
|
|
172
180
|
.option(core.I18n.formatMessage("commands.nft-mint.options.mutable-json.param"), core.I18n.formatMessage("commands.nft-mint.options.mutable-json.description"));
|
|
@@ -191,6 +199,8 @@ function buildCommandNftMint() {
|
|
|
191
199
|
* Action the nft mint command.
|
|
192
200
|
* @param opts The options for the command.
|
|
193
201
|
* @param opts.seed The seed required for signing by the issuer.
|
|
202
|
+
* @param opts.issuer The identity of the issuer.
|
|
203
|
+
* @param opts.walletAddressIndex The wallet address index.
|
|
194
204
|
* @param opts.tag The tag for the NFT.
|
|
195
205
|
* @param opts.immutableJson Filename of the immutable JSON data.
|
|
196
206
|
* @param opts.mutableJson Filename of the mutable JSON data.
|
|
@@ -201,6 +211,10 @@ function buildCommandNftMint() {
|
|
|
201
211
|
*/
|
|
202
212
|
async function actionCommandNftMint(opts) {
|
|
203
213
|
const seed = cliCore.CLIParam.hexBase64("seed", opts.seed);
|
|
214
|
+
const issuer = cliCore.CLIParam.stringValue("issuer", opts.issuer);
|
|
215
|
+
const walletAddressIndex = core.Is.empty(opts.walletAddressIndex)
|
|
216
|
+
? undefined
|
|
217
|
+
: cliCore.CLIParam.integer("wallet-address-index", opts.walletAddressIndex);
|
|
204
218
|
const tag = cliCore.CLIParam.stringValue("tag", opts.tag);
|
|
205
219
|
const immutableJson = opts.immutableJson
|
|
206
220
|
? path.resolve(opts.immutableJson)
|
|
@@ -213,7 +227,11 @@ async function actionCommandNftMint(opts) {
|
|
|
213
227
|
? cliCore.CLIParam.stringValue("network", opts.network)
|
|
214
228
|
: undefined;
|
|
215
229
|
const explorerEndpoint = cliCore.CLIParam.url("explorer", opts.explorer);
|
|
216
|
-
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.nft-mint.labels.
|
|
230
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.nft-mint.labels.issuer"), issuer);
|
|
231
|
+
if (core.Is.number(walletAddressIndex)) {
|
|
232
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.nft-mint.labels.tag"), tag);
|
|
233
|
+
}
|
|
234
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.nft-mint.labels.walletAddressIndex"), walletAddressIndex);
|
|
217
235
|
if (core.Is.stringValue(immutableJson)) {
|
|
218
236
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.nft-mint.labels.immutableJsonFilename"), immutableJson);
|
|
219
237
|
}
|
|
@@ -226,11 +244,13 @@ async function actionCommandNftMint(opts) {
|
|
|
226
244
|
}
|
|
227
245
|
cliCore.CLIDisplay.break();
|
|
228
246
|
setupVault();
|
|
229
|
-
const localIdentity =
|
|
247
|
+
const localIdentity = issuer;
|
|
230
248
|
const vaultSeedId = "local-seed";
|
|
231
249
|
const vaultConnector = vaultModels.VaultConnectorFactory.get("vault");
|
|
232
250
|
await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, core.Converter.bytesToBase64(seed));
|
|
233
|
-
const
|
|
251
|
+
const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
|
|
252
|
+
walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
253
|
+
const nftConnector = setupNftConnector({ nodeEndpoint, network, vaultSeedId, walletAddressIndex }, opts.connector);
|
|
234
254
|
if (core.Is.function(nftConnector.start)) {
|
|
235
255
|
await nftConnector.start(localIdentity);
|
|
236
256
|
}
|
|
@@ -325,6 +345,8 @@ async function actionCommandNftResolve(opts) {
|
|
|
325
345
|
}
|
|
326
346
|
cliCore.CLIDisplay.break();
|
|
327
347
|
setupVault();
|
|
348
|
+
const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network }, opts.connector);
|
|
349
|
+
walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
328
350
|
const nftConnector = setupNftConnector({ nodeEndpoint, network }, opts.connector);
|
|
329
351
|
cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.nft-resolve.progress.resolvingNft"));
|
|
330
352
|
cliCore.CLIDisplay.break();
|
|
@@ -360,8 +382,8 @@ function buildCommandNftTransfer() {
|
|
|
360
382
|
.description(core.I18n.formatMessage("commands.nft-transfer.description"))
|
|
361
383
|
.requiredOption(core.I18n.formatMessage("commands.nft-transfer.options.seed.param"), core.I18n.formatMessage("commands.nft-transfer.options.seed.description"))
|
|
362
384
|
.requiredOption(core.I18n.formatMessage("commands.nft-transfer.options.id.param"), core.I18n.formatMessage("commands.nft-transfer.options.id.description"))
|
|
363
|
-
.requiredOption(core.I18n.formatMessage("commands.nft-transfer.options.
|
|
364
|
-
.requiredOption(core.I18n.formatMessage("commands.nft-transfer.options.
|
|
385
|
+
.requiredOption(core.I18n.formatMessage("commands.nft-transfer.options.recipient-identity.param"), core.I18n.formatMessage("commands.nft-transfer.options.recipient-identity.description"))
|
|
386
|
+
.requiredOption(core.I18n.formatMessage("commands.nft-transfer.options.recipient-address.param"), core.I18n.formatMessage("commands.nft-transfer.options.recipient-address.description"));
|
|
365
387
|
command
|
|
366
388
|
.addOption(new commander.Option(core.I18n.formatMessage("commands.common.options.connector.param"), core.I18n.formatMessage("commands.common.options.connector.description"))
|
|
367
389
|
.choices(Object.values(NftConnectorTypes))
|
|
@@ -405,6 +427,8 @@ async function actionCommandNftTransfer(opts) {
|
|
|
405
427
|
}
|
|
406
428
|
cliCore.CLIDisplay.break();
|
|
407
429
|
setupVault();
|
|
430
|
+
const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network }, opts.connector);
|
|
431
|
+
walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
408
432
|
const localIdentity = "local";
|
|
409
433
|
const vaultSeedId = "local-seed";
|
|
410
434
|
const vaultConnector = vaultModels.VaultConnectorFactory.get("vault");
|
|
@@ -443,7 +467,7 @@ class CLI extends cliCore.CLIBase {
|
|
|
443
467
|
return this.execute({
|
|
444
468
|
title: "TWIN NFT",
|
|
445
469
|
appName: "twin-nft",
|
|
446
|
-
version: "0.0.1-next.
|
|
470
|
+
version: "0.0.1-next.20",
|
|
447
471
|
icon: "🌍",
|
|
448
472
|
supportsEnvFiles: true,
|
|
449
473
|
overrideOutputWidth: options?.overrideOutputWidth
|
package/dist/esm/index.mjs
CHANGED
|
@@ -2,11 +2,12 @@ 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 { buildCommandFaucet } from '@twin.org/wallet-cli';
|
|
5
|
+
import { setupWalletConnector, 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 { IotaStardustNftConnector, IotaStardustNftUtils } from '@twin.org/nft-connector-iota-stardust';
|
|
9
9
|
import { VaultConnectorFactory } from '@twin.org/vault-models';
|
|
10
|
+
import { WalletConnectorFactory } from '@twin.org/wallet-models';
|
|
10
11
|
import { Command, Option } from 'commander';
|
|
11
12
|
import { MemoryEntityStorageConnector } from '@twin.org/entity-storage-connector-memory';
|
|
12
13
|
import { EntityStorageConnectorFactory } from '@twin.org/entity-storage-models';
|
|
@@ -51,6 +52,7 @@ function setupVault() {
|
|
|
51
52
|
* @param options.nodeEndpoint The node endpoint.
|
|
52
53
|
* @param options.network The network.
|
|
53
54
|
* @param options.vaultSeedId The vault seed ID.
|
|
55
|
+
* @param options.walletAddressIndex The wallet address index.
|
|
54
56
|
* @param connector The connector to use.
|
|
55
57
|
* @returns The NFT connector.
|
|
56
58
|
*/
|
|
@@ -64,7 +66,8 @@ function setupNftConnector(options, connector) {
|
|
|
64
66
|
url: options.nodeEndpoint
|
|
65
67
|
},
|
|
66
68
|
network: options.network ?? "",
|
|
67
|
-
vaultSeedId: options.vaultSeedId
|
|
69
|
+
vaultSeedId: options.vaultSeedId,
|
|
70
|
+
walletAddressIndex: options.walletAddressIndex ?? 0
|
|
68
71
|
}
|
|
69
72
|
});
|
|
70
73
|
}
|
|
@@ -75,7 +78,8 @@ function setupNftConnector(options, connector) {
|
|
|
75
78
|
nodes: [options.nodeEndpoint],
|
|
76
79
|
localPow: true
|
|
77
80
|
},
|
|
78
|
-
vaultSeedId: options.vaultSeedId
|
|
81
|
+
vaultSeedId: options.vaultSeedId,
|
|
82
|
+
walletAddressIndex: options.walletAddressIndex ?? 0
|
|
79
83
|
}
|
|
80
84
|
});
|
|
81
85
|
}
|
|
@@ -135,6 +139,8 @@ async function actionCommandNftBurn(opts) {
|
|
|
135
139
|
const vaultSeedId = "local-seed";
|
|
136
140
|
const vaultConnector = VaultConnectorFactory.get("vault");
|
|
137
141
|
await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, Converter.bytesToBase64(seed));
|
|
142
|
+
const walletConnector = setupWalletConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
|
|
143
|
+
WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
138
144
|
const nftConnector = setupNftConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
|
|
139
145
|
if (Is.function(nftConnector.start)) {
|
|
140
146
|
await nftConnector.start(localIdentity);
|
|
@@ -164,6 +170,8 @@ function buildCommandNftMint() {
|
|
|
164
170
|
.summary(I18n.formatMessage("commands.nft-mint.summary"))
|
|
165
171
|
.description(I18n.formatMessage("commands.nft-mint.description"))
|
|
166
172
|
.requiredOption(I18n.formatMessage("commands.nft-mint.options.seed.param"), I18n.formatMessage("commands.nft-mint.options.seed.description"))
|
|
173
|
+
.requiredOption(I18n.formatMessage("commands.nft-mint.options.issuer.param"), I18n.formatMessage("commands.nft-mint.options.issuer.description"))
|
|
174
|
+
.option(I18n.formatMessage("commands.nft-mint.options.wallet-address-index.param"), I18n.formatMessage("commands.nft-mint.options.wallet-address-index.description"), "0")
|
|
167
175
|
.requiredOption(I18n.formatMessage("commands.nft-mint.options.tag.param"), I18n.formatMessage("commands.nft-mint.options.tag.description"))
|
|
168
176
|
.option(I18n.formatMessage("commands.nft-mint.options.immutable-json.param"), I18n.formatMessage("commands.nft-mint.options.immutable-json.description"))
|
|
169
177
|
.option(I18n.formatMessage("commands.nft-mint.options.mutable-json.param"), I18n.formatMessage("commands.nft-mint.options.mutable-json.description"));
|
|
@@ -188,6 +196,8 @@ function buildCommandNftMint() {
|
|
|
188
196
|
* Action the nft mint command.
|
|
189
197
|
* @param opts The options for the command.
|
|
190
198
|
* @param opts.seed The seed required for signing by the issuer.
|
|
199
|
+
* @param opts.issuer The identity of the issuer.
|
|
200
|
+
* @param opts.walletAddressIndex The wallet address index.
|
|
191
201
|
* @param opts.tag The tag for the NFT.
|
|
192
202
|
* @param opts.immutableJson Filename of the immutable JSON data.
|
|
193
203
|
* @param opts.mutableJson Filename of the mutable JSON data.
|
|
@@ -198,6 +208,10 @@ function buildCommandNftMint() {
|
|
|
198
208
|
*/
|
|
199
209
|
async function actionCommandNftMint(opts) {
|
|
200
210
|
const seed = CLIParam.hexBase64("seed", opts.seed);
|
|
211
|
+
const issuer = CLIParam.stringValue("issuer", opts.issuer);
|
|
212
|
+
const walletAddressIndex = Is.empty(opts.walletAddressIndex)
|
|
213
|
+
? undefined
|
|
214
|
+
: CLIParam.integer("wallet-address-index", opts.walletAddressIndex);
|
|
201
215
|
const tag = CLIParam.stringValue("tag", opts.tag);
|
|
202
216
|
const immutableJson = opts.immutableJson
|
|
203
217
|
? path.resolve(opts.immutableJson)
|
|
@@ -210,7 +224,11 @@ async function actionCommandNftMint(opts) {
|
|
|
210
224
|
? CLIParam.stringValue("network", opts.network)
|
|
211
225
|
: undefined;
|
|
212
226
|
const explorerEndpoint = CLIParam.url("explorer", opts.explorer);
|
|
213
|
-
CLIDisplay.value(I18n.formatMessage("commands.nft-mint.labels.
|
|
227
|
+
CLIDisplay.value(I18n.formatMessage("commands.nft-mint.labels.issuer"), issuer);
|
|
228
|
+
if (Is.number(walletAddressIndex)) {
|
|
229
|
+
CLIDisplay.value(I18n.formatMessage("commands.nft-mint.labels.tag"), tag);
|
|
230
|
+
}
|
|
231
|
+
CLIDisplay.value(I18n.formatMessage("commands.nft-mint.labels.walletAddressIndex"), walletAddressIndex);
|
|
214
232
|
if (Is.stringValue(immutableJson)) {
|
|
215
233
|
CLIDisplay.value(I18n.formatMessage("commands.nft-mint.labels.immutableJsonFilename"), immutableJson);
|
|
216
234
|
}
|
|
@@ -223,11 +241,13 @@ async function actionCommandNftMint(opts) {
|
|
|
223
241
|
}
|
|
224
242
|
CLIDisplay.break();
|
|
225
243
|
setupVault();
|
|
226
|
-
const localIdentity =
|
|
244
|
+
const localIdentity = issuer;
|
|
227
245
|
const vaultSeedId = "local-seed";
|
|
228
246
|
const vaultConnector = VaultConnectorFactory.get("vault");
|
|
229
247
|
await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, Converter.bytesToBase64(seed));
|
|
230
|
-
const
|
|
248
|
+
const walletConnector = setupWalletConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
|
|
249
|
+
WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
250
|
+
const nftConnector = setupNftConnector({ nodeEndpoint, network, vaultSeedId, walletAddressIndex }, opts.connector);
|
|
231
251
|
if (Is.function(nftConnector.start)) {
|
|
232
252
|
await nftConnector.start(localIdentity);
|
|
233
253
|
}
|
|
@@ -322,6 +342,8 @@ async function actionCommandNftResolve(opts) {
|
|
|
322
342
|
}
|
|
323
343
|
CLIDisplay.break();
|
|
324
344
|
setupVault();
|
|
345
|
+
const walletConnector = setupWalletConnector({ nodeEndpoint, network }, opts.connector);
|
|
346
|
+
WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
325
347
|
const nftConnector = setupNftConnector({ nodeEndpoint, network }, opts.connector);
|
|
326
348
|
CLIDisplay.task(I18n.formatMessage("commands.nft-resolve.progress.resolvingNft"));
|
|
327
349
|
CLIDisplay.break();
|
|
@@ -357,8 +379,8 @@ function buildCommandNftTransfer() {
|
|
|
357
379
|
.description(I18n.formatMessage("commands.nft-transfer.description"))
|
|
358
380
|
.requiredOption(I18n.formatMessage("commands.nft-transfer.options.seed.param"), I18n.formatMessage("commands.nft-transfer.options.seed.description"))
|
|
359
381
|
.requiredOption(I18n.formatMessage("commands.nft-transfer.options.id.param"), I18n.formatMessage("commands.nft-transfer.options.id.description"))
|
|
360
|
-
.requiredOption(I18n.formatMessage("commands.nft-transfer.options.
|
|
361
|
-
.requiredOption(I18n.formatMessage("commands.nft-transfer.options.
|
|
382
|
+
.requiredOption(I18n.formatMessage("commands.nft-transfer.options.recipient-identity.param"), I18n.formatMessage("commands.nft-transfer.options.recipient-identity.description"))
|
|
383
|
+
.requiredOption(I18n.formatMessage("commands.nft-transfer.options.recipient-address.param"), I18n.formatMessage("commands.nft-transfer.options.recipient-address.description"));
|
|
362
384
|
command
|
|
363
385
|
.addOption(new Option(I18n.formatMessage("commands.common.options.connector.param"), I18n.formatMessage("commands.common.options.connector.description"))
|
|
364
386
|
.choices(Object.values(NftConnectorTypes))
|
|
@@ -402,6 +424,8 @@ async function actionCommandNftTransfer(opts) {
|
|
|
402
424
|
}
|
|
403
425
|
CLIDisplay.break();
|
|
404
426
|
setupVault();
|
|
427
|
+
const walletConnector = setupWalletConnector({ nodeEndpoint, network }, opts.connector);
|
|
428
|
+
WalletConnectorFactory.register("wallet", () => walletConnector);
|
|
405
429
|
const localIdentity = "local";
|
|
406
430
|
const vaultSeedId = "local-seed";
|
|
407
431
|
const vaultConnector = VaultConnectorFactory.get("vault");
|
|
@@ -440,7 +464,7 @@ class CLI extends CLIBase {
|
|
|
440
464
|
return this.execute({
|
|
441
465
|
title: "TWIN NFT",
|
|
442
466
|
appName: "twin-nft",
|
|
443
|
-
version: "0.0.1-next.
|
|
467
|
+
version: "0.0.1-next.20",
|
|
444
468
|
icon: "🌍",
|
|
445
469
|
supportsEnvFiles: true,
|
|
446
470
|
overrideOutputWidth: options?.overrideOutputWidth
|
package/dist/locales/en.json
CHANGED
|
@@ -495,6 +495,14 @@
|
|
|
495
495
|
"param": "--seed '<'seed'>'",
|
|
496
496
|
"description": "The seed for the issuer address in hex or base64 used to fund the minting, or start with ! to read environment variable."
|
|
497
497
|
},
|
|
498
|
+
"issuer": {
|
|
499
|
+
"param": "--issuer '<'issuer'>'",
|
|
500
|
+
"description": "The identity of the NFT issuer, or start with ! to read environment variable."
|
|
501
|
+
},
|
|
502
|
+
"wallet-address-index": {
|
|
503
|
+
"param": "--wallet-address-index '<'wallet-address-index'>'",
|
|
504
|
+
"description": "The wallet address index to use for storing the NFT."
|
|
505
|
+
},
|
|
498
506
|
"tag": {
|
|
499
507
|
"param": "--tag '<'tag'>'",
|
|
500
508
|
"description": "The tag for the NFT."
|
|
@@ -512,7 +520,9 @@
|
|
|
512
520
|
"mintingNft": "Minting NFT"
|
|
513
521
|
},
|
|
514
522
|
"labels": {
|
|
523
|
+
"issuer": "Issuer",
|
|
515
524
|
"tag": "Tag",
|
|
525
|
+
"walletAddressIndex": "Wallet Address Index",
|
|
516
526
|
"immutableJsonFilename": "Immutable JSON Filename",
|
|
517
527
|
"mutableJsonFilename": "Mutable JSON Filename",
|
|
518
528
|
"immutableJson": "Immutable JSON",
|
|
@@ -570,12 +580,12 @@
|
|
|
570
580
|
"param": "--id '<'id'>'",
|
|
571
581
|
"description": "The id for the NFT in urn format."
|
|
572
582
|
},
|
|
573
|
-
"
|
|
574
|
-
"param": "--
|
|
583
|
+
"recipient-identity": {
|
|
584
|
+
"param": "--recipient-identity '<'recipient-identity'>'",
|
|
575
585
|
"description": "The identity of the NFT issuer, or start with ! to read environment variable."
|
|
576
586
|
},
|
|
577
|
-
"
|
|
578
|
-
"param": "--
|
|
587
|
+
"recipient-address": {
|
|
588
|
+
"param": "--recipient-address '<'recipient-address'>'",
|
|
579
589
|
"description": "The address of the NFT recipient, or start with ! to read environment variable."
|
|
580
590
|
}
|
|
581
591
|
},
|
|
@@ -10,6 +10,8 @@ export declare function buildCommandNftMint(): Command;
|
|
|
10
10
|
* Action the nft mint command.
|
|
11
11
|
* @param opts The options for the command.
|
|
12
12
|
* @param opts.seed The seed required for signing by the issuer.
|
|
13
|
+
* @param opts.issuer The identity of the issuer.
|
|
14
|
+
* @param opts.walletAddressIndex The wallet address index.
|
|
13
15
|
* @param opts.tag The tag for the NFT.
|
|
14
16
|
* @param opts.immutableJson Filename of the immutable JSON data.
|
|
15
17
|
* @param opts.mutableJson Filename of the mutable JSON data.
|
|
@@ -20,6 +22,8 @@ export declare function buildCommandNftMint(): Command;
|
|
|
20
22
|
*/
|
|
21
23
|
export declare function actionCommandNftMint(opts: {
|
|
22
24
|
seed: string;
|
|
25
|
+
issuer: string;
|
|
26
|
+
walletAddressIndex?: string;
|
|
23
27
|
tag: string;
|
|
24
28
|
immutableJson?: string;
|
|
25
29
|
mutableJson?: string;
|
|
@@ -10,6 +10,7 @@ export declare function setupVault(): void;
|
|
|
10
10
|
* @param options.nodeEndpoint The node endpoint.
|
|
11
11
|
* @param options.network The network.
|
|
12
12
|
* @param options.vaultSeedId The vault seed ID.
|
|
13
|
+
* @param options.walletAddressIndex The wallet address index.
|
|
13
14
|
* @param connector The connector to use.
|
|
14
15
|
* @returns The NFT connector.
|
|
15
16
|
*/
|
|
@@ -17,4 +18,5 @@ export declare function setupNftConnector(options: {
|
|
|
17
18
|
nodeEndpoint: string;
|
|
18
19
|
network?: string;
|
|
19
20
|
vaultSeedId?: string;
|
|
21
|
+
walletAddressIndex?: number;
|
|
20
22
|
}, connector?: NftConnectorTypes): INftConnector;
|
package/docs/changelog.md
CHANGED
package/locales/en.json
CHANGED
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
"param": "--seed '<'seed'>'",
|
|
9
9
|
"description": "The seed for the issuer address in hex or base64 used to fund the minting, or start with ! to read environment variable."
|
|
10
10
|
},
|
|
11
|
+
"issuer": {
|
|
12
|
+
"param": "--issuer '<'issuer'>'",
|
|
13
|
+
"description": "The identity of the NFT issuer, or start with ! to read environment variable."
|
|
14
|
+
},
|
|
15
|
+
"wallet-address-index": {
|
|
16
|
+
"param": "--wallet-address-index '<'wallet-address-index'>'",
|
|
17
|
+
"description": "The wallet address index to use for storing the NFT."
|
|
18
|
+
},
|
|
11
19
|
"tag": {
|
|
12
20
|
"param": "--tag '<'tag'>'",
|
|
13
21
|
"description": "The tag for the NFT."
|
|
@@ -25,7 +33,9 @@
|
|
|
25
33
|
"mintingNft": "Minting NFT"
|
|
26
34
|
},
|
|
27
35
|
"labels": {
|
|
36
|
+
"issuer": "Issuer",
|
|
28
37
|
"tag": "Tag",
|
|
38
|
+
"walletAddressIndex": "Wallet Address Index",
|
|
29
39
|
"immutableJsonFilename": "Immutable JSON Filename",
|
|
30
40
|
"mutableJsonFilename": "Mutable JSON Filename",
|
|
31
41
|
"immutableJson": "Immutable JSON",
|
|
@@ -83,12 +93,12 @@
|
|
|
83
93
|
"param": "--id '<'id'>'",
|
|
84
94
|
"description": "The id for the NFT in urn format."
|
|
85
95
|
},
|
|
86
|
-
"
|
|
87
|
-
"param": "--
|
|
96
|
+
"recipient-identity": {
|
|
97
|
+
"param": "--recipient-identity '<'recipient-identity'>'",
|
|
88
98
|
"description": "The identity of the NFT issuer, or start with ! to read environment variable."
|
|
89
99
|
},
|
|
90
|
-
"
|
|
91
|
-
"param": "--
|
|
100
|
+
"recipient-address": {
|
|
101
|
+
"param": "--recipient-address '<'recipient-address'>'",
|
|
92
102
|
"description": "The address of the NFT recipient, or start with ! to read environment variable."
|
|
93
103
|
}
|
|
94
104
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/nft-cli",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.20",
|
|
4
4
|
"description": "A command line interface for interacting with the nft connectors",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,11 +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.1-next.
|
|
25
|
-
"@twin.org/nft-connector-iota-stardust": "0.0.1-next.
|
|
24
|
+
"@twin.org/nft-connector-iota": "0.0.1-next.20",
|
|
25
|
+
"@twin.org/nft-connector-iota-stardust": "0.0.1-next.20",
|
|
26
26
|
"@twin.org/vault-connector-entity-storage": "next",
|
|
27
27
|
"@twin.org/vault-models": "next",
|
|
28
28
|
"@twin.org/wallet-cli": "next",
|
|
29
|
+
"@twin.org/wallet-models": "next",
|
|
29
30
|
"commander": "13.1.0"
|
|
30
31
|
},
|
|
31
32
|
"main": "./dist/cjs/index.cjs",
|