@twin.org/nft-cli 0.0.1-next.12 → 0.0.1-next.15
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 +145 -48
- package/dist/esm/index.mjs +145 -51
- package/dist/locales/en.json +57 -10
- package/dist/types/commands/nftBurn.d.ts +5 -0
- package/dist/types/commands/nftMint.d.ts +5 -0
- package/dist/types/commands/nftResolve.d.ts +5 -0
- package/dist/types/commands/nftTransfer.d.ts +5 -0
- package/dist/types/commands/setupCommands.d.ts +16 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/models/nftConnectorTypes.d.ts +17 -0
- package/docs/changelog.md +1 -1
- package/docs/examples.md +6 -6
- package/docs/reference/functions/actionCommandNftBurn.md +12 -0
- package/docs/reference/functions/actionCommandNftTransfer.md +12 -0
- package/docs/reference/functions/setupNftConnector.md +41 -0
- package/docs/reference/functions/setupVault.md +9 -0
- package/docs/reference/index.md +10 -0
- package/docs/reference/type-aliases/NftConnectorTypes.md +5 -0
- package/docs/reference/variables/NftConnectorTypes.md +19 -0
- package/locales/en.json +14 -4
- package/package.json +6 -5
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NFT connector types.
|
|
3
|
+
*/
|
|
4
|
+
export declare const NftConnectorTypes: {
|
|
5
|
+
/**
|
|
6
|
+
* IOTA.
|
|
7
|
+
*/
|
|
8
|
+
readonly Iota: "iota";
|
|
9
|
+
/**
|
|
10
|
+
* IOTA Rebased.
|
|
11
|
+
*/
|
|
12
|
+
readonly IotaRebased: "iota-rebased";
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The NFT connector types.
|
|
16
|
+
*/
|
|
17
|
+
export type NftConnectorTypes = (typeof NftConnectorTypes)[keyof typeof NftConnectorTypes];
|
package/docs/changelog.md
CHANGED
package/docs/examples.md
CHANGED
|
@@ -30,7 +30,7 @@ Options:
|
|
|
30
30
|
|
|
31
31
|
Commands:
|
|
32
32
|
mnemonic [options] Create a mnemonic.
|
|
33
|
-
address [options] Create
|
|
33
|
+
address [options] Create addresses and keys from the seed.
|
|
34
34
|
faucet [options] Request funds from the faucet.
|
|
35
35
|
nft-mint [options] Mint an NFT.
|
|
36
36
|
nft-resolve [options] Resolve an NFT.
|
|
@@ -55,7 +55,7 @@ Mint an NFT.
|
|
|
55
55
|
|
|
56
56
|
Options:
|
|
57
57
|
--seed <seed> The seed for the issuer address in hex or base64 used to fund the minting, or start with ! to read environment variable.
|
|
58
|
-
--issuer <issuer> The
|
|
58
|
+
--issuer <issuer> The address of the NFT issuer, or start with ! to read environment variable.
|
|
59
59
|
--tag <tag> The tag for the NFT.
|
|
60
60
|
--immutable-json <immutable-json> A JSON file to read which includes the immutable data for the NFT.
|
|
61
61
|
--mutable-json <mutable-json> A JSON file to read which includes the mutable data for the NFT.
|
|
@@ -111,10 +111,10 @@ To request some funds and mint the NFT you can issue the following commands:
|
|
|
111
111
|
|
|
112
112
|
```shell
|
|
113
113
|
# Fund the controller address from the faucet loading the config and wallet env files
|
|
114
|
-
twin-nft faucet --load-env config.env wallet.env --address !
|
|
114
|
+
twin-nft faucet --load-env config.env wallet.env --address !ADDRESS_0
|
|
115
115
|
|
|
116
116
|
# Mint the NFT and store the id in the nft.env file
|
|
117
|
-
twin-nft nft-mint --load-env config.env wallet.env --seed !SEED --issuer !
|
|
117
|
+
twin-nft nft-mint --load-env config.env wallet.env --seed !SEED --issuer !ADDRESS_0 --tag MY-NFT --immutable-json immutable.json --env nft.env
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
### nft-resolve
|
|
@@ -130,7 +130,7 @@ twin-nft nft-resolve --load-env config.env nft.env --id !NFT_ID
|
|
|
130
130
|
You can transfer the NFT to another address using the following command. You must provide the seed from the current issuer/owner so that it can be unlocked and transferred. In this example we read the nft id from the env file and transfer to the second address we created earlier.
|
|
131
131
|
|
|
132
132
|
```shell
|
|
133
|
-
twin-nft nft-transfer --load-env config.env wallet.env nft.env --seed !SEED --id !NFT_ID --recipient !
|
|
133
|
+
twin-nft nft-transfer --load-env config.env wallet.env nft.env --seed !SEED --id !NFT_ID --recipient !ADDRESS_1
|
|
134
134
|
```
|
|
135
135
|
|
|
136
136
|
### nft-burn
|
|
@@ -138,5 +138,5 @@ twin-nft nft-transfer --load-env config.env wallet.env nft.env --seed !SEED --id
|
|
|
138
138
|
To burn the NFT and reclaim the funds we issue the following command. We still require the seed as we need to transfer the deposit funds back to the issuer/owner.
|
|
139
139
|
|
|
140
140
|
```shell
|
|
141
|
-
twin-nft nft-burn --load-env config.env wallet.env nft.env --seed !SEED --issuer !
|
|
141
|
+
twin-nft nft-burn --load-env config.env wallet.env nft.env --seed !SEED --issuer !ADDRESS_1 --id !NFT_ID
|
|
142
142
|
```
|
|
@@ -28,12 +28,24 @@ The issuer address of the NFT.
|
|
|
28
28
|
|
|
29
29
|
The id of the NFT to burn in urn format.
|
|
30
30
|
|
|
31
|
+
#### connector
|
|
32
|
+
|
|
33
|
+
[`NftConnectorTypes`](../type-aliases/NftConnectorTypes.md)
|
|
34
|
+
|
|
35
|
+
The connector to perform the operations with.
|
|
36
|
+
|
|
31
37
|
#### node
|
|
32
38
|
|
|
33
39
|
`string`
|
|
34
40
|
|
|
35
41
|
The node URL.
|
|
36
42
|
|
|
43
|
+
#### network
|
|
44
|
+
|
|
45
|
+
`string`
|
|
46
|
+
|
|
47
|
+
The network to use for rebased connector.
|
|
48
|
+
|
|
37
49
|
#### explorer
|
|
38
50
|
|
|
39
51
|
`string`
|
|
@@ -28,12 +28,24 @@ The id of the NFT to transfer in urn format.
|
|
|
28
28
|
|
|
29
29
|
The recipient address of the NFT.
|
|
30
30
|
|
|
31
|
+
#### connector
|
|
32
|
+
|
|
33
|
+
[`NftConnectorTypes`](../type-aliases/NftConnectorTypes.md)
|
|
34
|
+
|
|
35
|
+
The connector to perform the operations with.
|
|
36
|
+
|
|
31
37
|
#### node
|
|
32
38
|
|
|
33
39
|
`string`
|
|
34
40
|
|
|
35
41
|
The node URL.
|
|
36
42
|
|
|
43
|
+
#### network
|
|
44
|
+
|
|
45
|
+
`string`
|
|
46
|
+
|
|
47
|
+
The network to use for rebased connector.
|
|
48
|
+
|
|
37
49
|
#### explorer
|
|
38
50
|
|
|
39
51
|
`string`
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Function: setupNftConnector()
|
|
2
|
+
|
|
3
|
+
> **setupNftConnector**(`options`, `connector`?): `INftConnector`
|
|
4
|
+
|
|
5
|
+
Setup the NFT connector for use in the CLI commands.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### options
|
|
10
|
+
|
|
11
|
+
The options for the NFT connector.
|
|
12
|
+
|
|
13
|
+
#### nodeEndpoint
|
|
14
|
+
|
|
15
|
+
`string`
|
|
16
|
+
|
|
17
|
+
The node endpoint.
|
|
18
|
+
|
|
19
|
+
#### network
|
|
20
|
+
|
|
21
|
+
`string`
|
|
22
|
+
|
|
23
|
+
The network.
|
|
24
|
+
|
|
25
|
+
#### vaultSeedId
|
|
26
|
+
|
|
27
|
+
`string`
|
|
28
|
+
|
|
29
|
+
The vault seed ID.
|
|
30
|
+
|
|
31
|
+
### connector?
|
|
32
|
+
|
|
33
|
+
[`NftConnectorTypes`](../type-aliases/NftConnectorTypes.md)
|
|
34
|
+
|
|
35
|
+
The connector to use.
|
|
36
|
+
|
|
37
|
+
## Returns
|
|
38
|
+
|
|
39
|
+
`INftConnector`
|
|
40
|
+
|
|
41
|
+
The NFT connector.
|
package/docs/reference/index.md
CHANGED
|
@@ -4,6 +4,14 @@
|
|
|
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
|
+
|
|
7
15
|
## Functions
|
|
8
16
|
|
|
9
17
|
- [buildCommandNftBurn](functions/buildCommandNftBurn.md)
|
|
@@ -14,3 +22,5 @@
|
|
|
14
22
|
- [actionCommandNftResolve](functions/actionCommandNftResolve.md)
|
|
15
23
|
- [buildCommandNftTransfer](functions/buildCommandNftTransfer.md)
|
|
16
24
|
- [actionCommandNftTransfer](functions/actionCommandNftTransfer.md)
|
|
25
|
+
- [setupVault](functions/setupVault.md)
|
|
26
|
+
- [setupNftConnector](functions/setupNftConnector.md)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Variable: NftConnectorTypes
|
|
2
|
+
|
|
3
|
+
> `const` **NftConnectorTypes**: `object`
|
|
4
|
+
|
|
5
|
+
The NFT connector types.
|
|
6
|
+
|
|
7
|
+
## Type declaration
|
|
8
|
+
|
|
9
|
+
### Iota
|
|
10
|
+
|
|
11
|
+
> `readonly` **Iota**: `"iota"` = `"iota"`
|
|
12
|
+
|
|
13
|
+
IOTA.
|
|
14
|
+
|
|
15
|
+
### IotaRebased
|
|
16
|
+
|
|
17
|
+
> `readonly` **IotaRebased**: `"iota-rebased"` = `"iota-rebased"`
|
|
18
|
+
|
|
19
|
+
IOTA Rebased.
|
package/locales/en.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"issuer": {
|
|
12
12
|
"param": "--issuer '<'issuer'>'",
|
|
13
|
-
"description": "The
|
|
13
|
+
"description": "The address of the NFT issuer, or start with ! to read environment variable."
|
|
14
14
|
},
|
|
15
15
|
"tag": {
|
|
16
16
|
"param": "--tag '<'tag'>'",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"issuer": {
|
|
67
67
|
"param": "--issuer '<'issuer'>'",
|
|
68
|
-
"description": "The
|
|
68
|
+
"description": "The address of the NFT issuer, or start with ! to read environment variable."
|
|
69
69
|
},
|
|
70
70
|
"id": {
|
|
71
71
|
"param": "--id '<'id'>'",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
},
|
|
95
95
|
"recipient": {
|
|
96
96
|
"param": "--recipient '<'recipient'>'",
|
|
97
|
-
"description": "The
|
|
97
|
+
"description": "The address of the NFT recipient, or start with ! to read environment variable."
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
"progress": {
|
|
@@ -107,6 +107,14 @@
|
|
|
107
107
|
},
|
|
108
108
|
"common": {
|
|
109
109
|
"options": {
|
|
110
|
+
"connector": {
|
|
111
|
+
"param": "--connector '<'connector'>'",
|
|
112
|
+
"description": "The connector to use for the NFT operation."
|
|
113
|
+
},
|
|
114
|
+
"network": {
|
|
115
|
+
"param": "--network '<'network'>'",
|
|
116
|
+
"description": "The network to use for the NFT operation."
|
|
117
|
+
},
|
|
110
118
|
"node": {
|
|
111
119
|
"param": "--node '<'url'>'",
|
|
112
120
|
"description": "The url for the node endpoint, or an environment variable name containing the url."
|
|
@@ -116,7 +124,9 @@
|
|
|
116
124
|
"did": "DID",
|
|
117
125
|
"node": "Node",
|
|
118
126
|
"explorer": "Explorer",
|
|
119
|
-
"explore": "Explore"
|
|
127
|
+
"explore": "Explore",
|
|
128
|
+
"connector": "Connector",
|
|
129
|
+
"network": "Network"
|
|
120
130
|
}
|
|
121
131
|
}
|
|
122
132
|
}
|
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.15",
|
|
4
4
|
"description": "A command line interface for interacting with the nft connectors",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,20 +21,21 @@
|
|
|
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.
|
|
24
|
+
"@twin.org/nft-connector-iota": "0.0.1-next.15",
|
|
25
|
+
"@twin.org/nft-connector-iota-rebased": "0.0.1-next.15",
|
|
25
26
|
"@twin.org/vault-connector-entity-storage": "next",
|
|
26
27
|
"@twin.org/vault-models": "next",
|
|
27
28
|
"@twin.org/wallet-cli": "next",
|
|
28
|
-
"commander": "13.
|
|
29
|
+
"commander": "13.1.0"
|
|
29
30
|
},
|
|
30
31
|
"main": "./dist/cjs/index.cjs",
|
|
31
32
|
"module": "./dist/esm/index.mjs",
|
|
32
33
|
"types": "./dist/types/index.d.ts",
|
|
33
34
|
"exports": {
|
|
34
35
|
".": {
|
|
36
|
+
"types": "./dist/types/index.d.ts",
|
|
35
37
|
"require": "./dist/cjs/index.cjs",
|
|
36
|
-
"import": "./dist/esm/index.mjs"
|
|
37
|
-
"types": "./dist/types/index.d.ts"
|
|
38
|
+
"import": "./dist/esm/index.mjs"
|
|
38
39
|
}
|
|
39
40
|
},
|
|
40
41
|
"files": [
|