@twin.org/nft-cli 0.0.1-next.26 → 0.0.1-next.28

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.
@@ -7,7 +7,6 @@ var cryptoCli = require('@twin.org/crypto-cli');
7
7
  var walletCli = require('@twin.org/wallet-cli');
8
8
  var core = require('@twin.org/core');
9
9
  var nftConnectorIota = require('@twin.org/nft-connector-iota');
10
- var nftConnectorIotaStardust = require('@twin.org/nft-connector-iota-stardust');
11
10
  var vaultModels = require('@twin.org/vault-models');
12
11
  var walletModels = require('@twin.org/wallet-models');
13
12
  var commander = require('commander');
@@ -26,11 +25,7 @@ const NftConnectorTypes = {
26
25
  /**
27
26
  * IOTA.
28
27
  */
29
- Iota: "iota",
30
- /**
31
- * IOTA Stardust.
32
- */
33
- IotaStardust: "iota-stardust"
28
+ Iota: "iota"
34
29
  };
35
30
 
36
31
  // Copyright 2024 IOTA Stiftung.
@@ -61,32 +56,16 @@ function setupVault() {
61
56
  */
62
57
  function setupNftConnector(options, connector) {
63
58
  connector ??= NftConnectorTypes.Iota;
64
- let instance;
65
- if (connector === NftConnectorTypes.Iota) {
66
- instance = new nftConnectorIota.IotaNftConnector({
67
- config: {
68
- clientOptions: {
69
- url: options.nodeEndpoint
70
- },
71
- network: options.network ?? "",
72
- vaultSeedId: options.vaultSeedId,
73
- walletAddressIndex: options.walletAddressIndex ?? 0
74
- }
75
- });
76
- }
77
- else {
78
- instance = new nftConnectorIotaStardust.IotaStardustNftConnector({
79
- config: {
80
- clientOptions: {
81
- nodes: [options.nodeEndpoint],
82
- localPow: true
83
- },
84
- vaultSeedId: options.vaultSeedId,
85
- walletAddressIndex: options.walletAddressIndex ?? 0
86
- }
87
- });
88
- }
89
- return instance;
59
+ return new nftConnectorIota.IotaNftConnector({
60
+ config: {
61
+ clientOptions: {
62
+ url: options.nodeEndpoint
63
+ },
64
+ network: options.network ?? "",
65
+ vaultSeedId: options.vaultSeedId,
66
+ walletAddressIndex: options.walletAddressIndex ?? 0
67
+ }
68
+ });
90
69
  }
91
70
 
92
71
  // Copyright 2024 IOTA Stiftung.
@@ -153,9 +132,7 @@ async function actionCommandNftBurn(opts) {
153
132
  cliCore.CLIDisplay.spinnerStart();
154
133
  await nftConnector.burn(localIdentity, id);
155
134
  cliCore.CLIDisplay.spinnerStop();
156
- cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.explore"), opts.connector === NftConnectorTypes.Iota
157
- ? `${core.StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${nftConnectorIota.IotaNftUtils.nftIdToObjectId(id)}?network=${network}`
158
- : `${core.StringHelper.trimTrailingSlashes(explorerEndpoint)}/addr/${nftConnectorIotaStardust.IotaStardustNftUtils.nftIdToAddress(id)}`);
135
+ cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.explore"), `${core.StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${nftConnectorIota.IotaNftUtils.nftIdToObjectId(id)}?network=${network}`);
159
136
  cliCore.CLIDisplay.break();
160
137
  cliCore.CLIDisplay.done();
161
138
  }
@@ -285,9 +262,7 @@ async function actionCommandNftMint(opts) {
285
262
  if (core.Is.stringValue(opts?.env)) {
286
263
  await cliCore.CLIUtils.writeEnvFile(opts.env, [`NFT_ID="${nftId}"`], opts.mergeEnv);
287
264
  }
288
- cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.explore"), opts.connector === NftConnectorTypes.Iota
289
- ? `${core.StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${nftConnectorIota.IotaNftUtils.nftIdToObjectId(nftId)}?network=${network}`
290
- : `${core.StringHelper.trimTrailingSlashes(explorerEndpoint)}/addr/${nftConnectorIotaStardust.IotaStardustNftUtils.nftIdToAddress(nftId)}`);
265
+ cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.explore"), `${core.StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${nftConnectorIota.IotaNftUtils.nftIdToObjectId(nftId)}?network=${network}`);
291
266
  cliCore.CLIDisplay.break();
292
267
  cliCore.CLIDisplay.done();
293
268
  }
@@ -361,9 +336,7 @@ async function actionCommandNftResolve(opts) {
361
336
  if (core.Is.stringValue(opts?.json)) {
362
337
  await cliCore.CLIUtils.writeJsonFile(opts.json, nft, opts.mergeJson);
363
338
  }
364
- cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.explore"), opts.connector === NftConnectorTypes.Iota
365
- ? `${core.StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${nftConnectorIota.IotaNftUtils.nftIdToObjectId(id)}?network=${network}`
366
- : `${core.StringHelper.trimTrailingSlashes(explorerEndpoint)}/addr/${nftConnectorIotaStardust.IotaStardustNftUtils.nftIdToAddress(id)}`);
339
+ cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.explore"), `${core.StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${nftConnectorIota.IotaNftUtils.nftIdToObjectId(id)}?network=${network}`);
367
340
  cliCore.CLIDisplay.break();
368
341
  cliCore.CLIDisplay.done();
369
342
  }
@@ -442,9 +415,7 @@ async function actionCommandNftTransfer(opts) {
442
415
  cliCore.CLIDisplay.spinnerStart();
443
416
  await nftConnector.transfer(localIdentity, id, recipientIdentity, recipientAddress);
444
417
  cliCore.CLIDisplay.spinnerStop();
445
- cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.explore"), opts.connector === NftConnectorTypes.Iota
446
- ? `${core.StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${nftConnectorIota.IotaNftUtils.nftIdToObjectId(id)}?network=${network}`
447
- : `${core.StringHelper.trimTrailingSlashes(explorerEndpoint)}/addr/${nftConnectorIotaStardust.IotaStardustNftUtils.nftIdToAddress(id)}`);
418
+ cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.explore"), `${core.StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${nftConnectorIota.IotaNftUtils.nftIdToObjectId(id)}?network=${network}`);
448
419
  cliCore.CLIDisplay.break();
449
420
  cliCore.CLIDisplay.done();
450
421
  }
@@ -467,7 +438,7 @@ class CLI extends cliCore.CLIBase {
467
438
  return this.execute({
468
439
  title: "TWIN NFT",
469
440
  appName: "twin-nft",
470
- version: "0.0.1-next.26", // x-release-please-version
441
+ version: "0.0.1-next.28", // x-release-please-version
471
442
  icon: "🌍",
472
443
  supportsEnvFiles: true,
473
444
  overrideOutputWidth: options?.overrideOutputWidth
@@ -5,7 +5,6 @@ import { buildCommandMnemonic, buildCommandAddress } from '@twin.org/crypto-cli'
5
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
- import { IotaStardustNftConnector, IotaStardustNftUtils } from '@twin.org/nft-connector-iota-stardust';
9
8
  import { VaultConnectorFactory } from '@twin.org/vault-models';
10
9
  import { WalletConnectorFactory } from '@twin.org/wallet-models';
11
10
  import { Command, Option } from 'commander';
@@ -23,11 +22,7 @@ const NftConnectorTypes = {
23
22
  /**
24
23
  * IOTA.
25
24
  */
26
- Iota: "iota",
27
- /**
28
- * IOTA Stardust.
29
- */
30
- IotaStardust: "iota-stardust"
25
+ Iota: "iota"
31
26
  };
32
27
 
33
28
  // Copyright 2024 IOTA Stiftung.
@@ -58,32 +53,16 @@ function setupVault() {
58
53
  */
59
54
  function setupNftConnector(options, connector) {
60
55
  connector ??= NftConnectorTypes.Iota;
61
- let instance;
62
- if (connector === NftConnectorTypes.Iota) {
63
- instance = new IotaNftConnector({
64
- config: {
65
- clientOptions: {
66
- url: options.nodeEndpoint
67
- },
68
- network: options.network ?? "",
69
- vaultSeedId: options.vaultSeedId,
70
- walletAddressIndex: options.walletAddressIndex ?? 0
71
- }
72
- });
73
- }
74
- else {
75
- instance = new IotaStardustNftConnector({
76
- config: {
77
- clientOptions: {
78
- nodes: [options.nodeEndpoint],
79
- localPow: true
80
- },
81
- vaultSeedId: options.vaultSeedId,
82
- walletAddressIndex: options.walletAddressIndex ?? 0
83
- }
84
- });
85
- }
86
- return instance;
56
+ return new IotaNftConnector({
57
+ config: {
58
+ clientOptions: {
59
+ url: options.nodeEndpoint
60
+ },
61
+ network: options.network ?? "",
62
+ vaultSeedId: options.vaultSeedId,
63
+ walletAddressIndex: options.walletAddressIndex ?? 0
64
+ }
65
+ });
87
66
  }
88
67
 
89
68
  // Copyright 2024 IOTA Stiftung.
@@ -150,9 +129,7 @@ async function actionCommandNftBurn(opts) {
150
129
  CLIDisplay.spinnerStart();
151
130
  await nftConnector.burn(localIdentity, id);
152
131
  CLIDisplay.spinnerStop();
153
- CLIDisplay.value(I18n.formatMessage("commands.common.labels.explore"), opts.connector === NftConnectorTypes.Iota
154
- ? `${StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${IotaNftUtils.nftIdToObjectId(id)}?network=${network}`
155
- : `${StringHelper.trimTrailingSlashes(explorerEndpoint)}/addr/${IotaStardustNftUtils.nftIdToAddress(id)}`);
132
+ CLIDisplay.value(I18n.formatMessage("commands.common.labels.explore"), `${StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${IotaNftUtils.nftIdToObjectId(id)}?network=${network}`);
156
133
  CLIDisplay.break();
157
134
  CLIDisplay.done();
158
135
  }
@@ -282,9 +259,7 @@ async function actionCommandNftMint(opts) {
282
259
  if (Is.stringValue(opts?.env)) {
283
260
  await CLIUtils.writeEnvFile(opts.env, [`NFT_ID="${nftId}"`], opts.mergeEnv);
284
261
  }
285
- CLIDisplay.value(I18n.formatMessage("commands.common.labels.explore"), opts.connector === NftConnectorTypes.Iota
286
- ? `${StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${IotaNftUtils.nftIdToObjectId(nftId)}?network=${network}`
287
- : `${StringHelper.trimTrailingSlashes(explorerEndpoint)}/addr/${IotaStardustNftUtils.nftIdToAddress(nftId)}`);
262
+ CLIDisplay.value(I18n.formatMessage("commands.common.labels.explore"), `${StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${IotaNftUtils.nftIdToObjectId(nftId)}?network=${network}`);
288
263
  CLIDisplay.break();
289
264
  CLIDisplay.done();
290
265
  }
@@ -358,9 +333,7 @@ async function actionCommandNftResolve(opts) {
358
333
  if (Is.stringValue(opts?.json)) {
359
334
  await CLIUtils.writeJsonFile(opts.json, nft, opts.mergeJson);
360
335
  }
361
- CLIDisplay.value(I18n.formatMessage("commands.common.labels.explore"), opts.connector === NftConnectorTypes.Iota
362
- ? `${StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${IotaNftUtils.nftIdToObjectId(id)}?network=${network}`
363
- : `${StringHelper.trimTrailingSlashes(explorerEndpoint)}/addr/${IotaStardustNftUtils.nftIdToAddress(id)}`);
336
+ CLIDisplay.value(I18n.formatMessage("commands.common.labels.explore"), `${StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${IotaNftUtils.nftIdToObjectId(id)}?network=${network}`);
364
337
  CLIDisplay.break();
365
338
  CLIDisplay.done();
366
339
  }
@@ -439,9 +412,7 @@ async function actionCommandNftTransfer(opts) {
439
412
  CLIDisplay.spinnerStart();
440
413
  await nftConnector.transfer(localIdentity, id, recipientIdentity, recipientAddress);
441
414
  CLIDisplay.spinnerStop();
442
- CLIDisplay.value(I18n.formatMessage("commands.common.labels.explore"), opts.connector === NftConnectorTypes.Iota
443
- ? `${StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${IotaNftUtils.nftIdToObjectId(id)}?network=${network}`
444
- : `${StringHelper.trimTrailingSlashes(explorerEndpoint)}/addr/${IotaStardustNftUtils.nftIdToAddress(id)}`);
415
+ CLIDisplay.value(I18n.formatMessage("commands.common.labels.explore"), `${StringHelper.trimTrailingSlashes(explorerEndpoint)}/object/${IotaNftUtils.nftIdToObjectId(id)}?network=${network}`);
445
416
  CLIDisplay.break();
446
417
  CLIDisplay.done();
447
418
  }
@@ -464,7 +435,7 @@ class CLI extends CLIBase {
464
435
  return this.execute({
465
436
  title: "TWIN NFT",
466
437
  appName: "twin-nft",
467
- version: "0.0.1-next.26", // x-release-please-version
438
+ version: "0.0.1-next.28", // x-release-please-version
468
439
  icon: "🌍",
469
440
  supportsEnvFiles: true,
470
441
  overrideOutputWidth: options?.overrideOutputWidth
@@ -235,21 +235,6 @@
235
235
  "createFailed": "Failed to create JWS",
236
236
  "verifyFailed": "Failed to verify JWS"
237
237
  },
238
- "iotaStardustNftConnector": {
239
- "inclusionFailed": "The transaction generated for the NFT was not included in a reasonable amount of time",
240
- "mintingFailed": "Minting the NFT failed",
241
- "resolvingFailed": "Resolving the NFT failed",
242
- "burningFailed": "Burning the NFT failed",
243
- "transferFailed": "Transferring the NFT failed",
244
- "updateFailed": "Updating the NFT failed",
245
- "namespaceMismatch": "The namespace in the urn \"{id}\" does not match the namespace of the IOTA NFT connector \"{namespace}\"",
246
- "insufficientFunds": "There were insufficient funds to complete the operation",
247
- "walletConnectorMissing": "The wallet connector must be available to perform this operation"
248
- },
249
- "iotaStardust": {
250
- "inclusionFailed": "The transaction generated was not included in a reasonable amount of time",
251
- "insufficientFunds": "There were insufficient funds to complete the operation"
252
- },
253
238
  "entityStorageVaultConnector": {
254
239
  "keyAlreadyExists": "The key \"{existingId}\" already exists in the vault",
255
240
  "keyNotFound": "The key \"{notFoundId}\" was not found in the vault",
@@ -262,15 +247,6 @@
262
247
  },
263
248
  "iotaFaucetConnector": {
264
249
  "fundingFailed": "Fund the address from faucet failed"
265
- },
266
- "iotaStardustWalletConnector": {
267
- "transferFailed": "The wallet transfer failed.",
268
- "inclusionFailed": "The transaction generated was not included in a reasonable amount of time",
269
- "insufficientFunds": "There were insufficient funds to complete the operation"
270
- },
271
- "iotaStardustFaucetConnector": {
272
- "fundingFailed": "Fund the address from faucet failed",
273
- "insufficientFunds": "There were insufficient funds to complete the operation"
274
250
  }
275
251
  },
276
252
  "errorNames": {
@@ -6,10 +6,6 @@ export declare const NftConnectorTypes: {
6
6
  * IOTA.
7
7
  */
8
8
  readonly Iota: "iota";
9
- /**
10
- * IOTA Stardust.
11
- */
12
- readonly IotaStardust: "iota-stardust";
13
9
  };
14
10
  /**
15
11
  * The NFT connector types.
package/docs/changelog.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @twin.org/nft-cli - Changelog
2
2
 
3
+ ## [0.0.1-next.28](https://github.com/twinfoundation/nft/compare/nft-cli-v0.0.1-next.27...nft-cli-v0.0.1-next.28) (2025-05-06)
4
+
5
+
6
+ ### Features
7
+
8
+ * iota rebased release ([8d05d1f](https://github.com/twinfoundation/nft/commit/8d05d1f58c1aacac983c100697ab40a314ad34ea))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/nft-connector-iota bumped from 0.0.1-next.27 to 0.0.1-next.28
16
+
17
+ ## [0.0.1-next.27](https://github.com/twinfoundation/nft/compare/nft-cli-v0.0.1-next.26...nft-cli-v0.0.1-next.27) (2025-04-24)
18
+
19
+
20
+ ### Miscellaneous Chores
21
+
22
+ * **nft-cli:** Synchronize repo versions
23
+
24
+
25
+ ### Dependencies
26
+
27
+ * The following workspace dependencies were updated
28
+ * dependencies
29
+ * @twin.org/nft-connector-iota bumped from 0.0.1-next.26 to 0.0.1-next.27
30
+
3
31
  ## [0.0.1-next.26](https://github.com/twinfoundation/nft/compare/nft-cli-v0.0.1-next.25...nft-cli-v0.0.1-next.26) (2025-04-17)
4
32
 
5
33
 
@@ -13,7 +41,6 @@
13
41
  * The following workspace dependencies were updated
14
42
  * dependencies
15
43
  * @twin.org/nft-connector-iota bumped from 0.0.1-next.25 to 0.0.1-next.26
16
- * @twin.org/nft-connector-iota-stardust bumped from 0.0.1-next.25 to 0.0.1-next.26
17
44
 
18
45
  ## [0.0.1-next.25](https://github.com/twinfoundation/nft/compare/nft-cli-v0.0.1-next.24...nft-cli-v0.0.1-next.25) (2025-04-17)
19
46
 
@@ -28,7 +55,6 @@
28
55
  * The following workspace dependencies were updated
29
56
  * dependencies
30
57
  * @twin.org/nft-connector-iota bumped from 0.0.1-next.24 to 0.0.1-next.25
31
- * @twin.org/nft-connector-iota-stardust bumped from 0.0.1-next.24 to 0.0.1-next.25
32
58
 
33
59
  ## [0.0.1-next.24](https://github.com/twinfoundation/nft/compare/nft-cli-v0.0.1-next.23...nft-cli-v0.0.1-next.24) (2025-03-28)
34
60
 
@@ -43,7 +69,6 @@
43
69
  * The following workspace dependencies were updated
44
70
  * dependencies
45
71
  * @twin.org/nft-connector-iota bumped from 0.0.1-next.23 to 0.0.1-next.24
46
- * @twin.org/nft-connector-iota-stardust bumped from 0.0.1-next.23 to 0.0.1-next.24
47
72
 
48
73
  ## v0.0.1-next.23
49
74
 
@@ -24,7 +24,7 @@ The id of the NFT to burn in urn format.
24
24
 
25
25
  #### connector?
26
26
 
27
- [`NftConnectorTypes`](../type-aliases/NftConnectorTypes.md)
27
+ `"iota"`
28
28
 
29
29
  The connector to perform the operations with.
30
30
 
@@ -36,7 +36,7 @@ The recipient address of the NFT.
36
36
 
37
37
  #### connector?
38
38
 
39
- [`NftConnectorTypes`](../type-aliases/NftConnectorTypes.md)
39
+ `"iota"`
40
40
 
41
41
  The connector to perform the operations with.
42
42
 
@@ -36,7 +36,7 @@ The wallet address index.
36
36
 
37
37
  ### connector?
38
38
 
39
- [`NftConnectorTypes`](../type-aliases/NftConnectorTypes.md)
39
+ `"iota"`
40
40
 
41
41
  The connector to use.
42
42
 
@@ -11,9 +11,3 @@ The NFT connector types.
11
11
  > `readonly` **Iota**: `"iota"` = `"iota"`
12
12
 
13
13
  IOTA.
14
-
15
- ### IotaStardust
16
-
17
- > `readonly` **IotaStardust**: `"iota-stardust"` = `"iota-stardust"`
18
-
19
- IOTA Stardust.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/nft-cli",
3
- "version": "0.0.1-next.26",
3
+ "version": "0.0.1-next.28",
4
4
  "description": "A command line interface for interacting with the nft connectors",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,8 +21,7 @@
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.26",
25
- "@twin.org/nft-connector-iota-stardust": "0.0.1-next.26",
24
+ "@twin.org/nft-connector-iota": "0.0.1-next.28",
26
25
  "@twin.org/vault-connector-entity-storage": "next",
27
26
  "@twin.org/vault-models": "next",
28
27
  "@twin.org/wallet-cli": "next",