@twin.org/nft-models 0.0.1-next.9 → 0.0.2-next.1

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.
@@ -5,7 +5,6 @@ import type { IComponent } from "@twin.org/core";
5
5
  export interface INftComponent extends IComponent {
6
6
  /**
7
7
  * Mint an NFT.
8
- * @param issuer The issuer for the NFT, will also be the initial owner.
9
8
  * @param tag The tag for the NFT.
10
9
  * @param immutableMetadata The immutable metadata for the NFT.
11
10
  * @param metadata The metadata for the NFT.
@@ -13,14 +12,14 @@ export interface INftComponent extends IComponent {
13
12
  * @param identity The identity to perform the nft operation on.
14
13
  * @returns The id of the created NFT in urn format.
15
14
  */
16
- mint<T = unknown, U = unknown>(issuer: string, tag: string, immutableMetadata?: T, metadata?: U, namespace?: string, identity?: string): Promise<string>;
15
+ mint<T = unknown, U = unknown>(tag: string, immutableMetadata?: T, metadata?: U, namespace?: string, identity?: string): Promise<string>;
17
16
  /**
18
17
  * Resolve an NFT.
19
18
  * @param id The id of the NFT to resolve.
20
- * @param identity The identity to perform the nft operation on.
19
+ * @param controllerIdentity The identity to perform the nft operation on.
21
20
  * @returns The data for the NFT.
22
21
  */
23
- resolve<T = unknown, U = unknown>(id: string, identity?: string): Promise<{
22
+ resolve<T = unknown, U = unknown>(id: string, controllerIdentity?: string): Promise<{
24
23
  issuer: string;
25
24
  owner: string;
26
25
  tag: string;
@@ -30,25 +29,26 @@ export interface INftComponent extends IComponent {
30
29
  /**
31
30
  * Burn an NFT.
32
31
  * @param id The id of the NFT to burn in urn format.
33
- * @param identity The identity to perform the nft operation on.
32
+ * @param controllerIdentity The identity to perform the nft operation on.
34
33
  * @returns Nothing.
35
34
  */
36
- burn(id: string, identity?: string): Promise<void>;
35
+ burn(id: string, controllerIdentity?: string): Promise<void>;
37
36
  /**
38
37
  * Transfer an NFT.
39
38
  * @param id The id of the NFT to transfer in urn format.
40
- * @param recipient The recipient of the NFT.
39
+ * @param recipientIdentity The recipient identity for the NFT.
40
+ * @param recipientAddress The recipient address for the NFT.
41
41
  * @param metadata Optional mutable data to include during the transfer.
42
- * @param identity The identity to perform the nft operation on.
42
+ * @param controllerIdentity The identity to perform the nft operation on.
43
43
  * @returns Nothing.
44
44
  */
45
- transfer<T = unknown>(id: string, recipient: string, metadata?: T, identity?: string): Promise<void>;
45
+ transfer<U = unknown>(id: string, recipientIdentity: string, recipientAddress: string, metadata?: U, controllerIdentity?: string): Promise<void>;
46
46
  /**
47
47
  * Update the mutable data of the NFT.
48
48
  * @param id The id of the NFT to update in urn format.
49
49
  * @param metadata The mutable data to update.
50
- * @param identity The identity to perform the nft operation on.
50
+ * @param controllerIdentity The identity to perform the nft operation on.
51
51
  * @returns Nothing.
52
52
  */
53
- update<T = unknown>(id: string, metadata: T, identity?: string): Promise<void>;
53
+ update<U = unknown>(id: string, metadata: U, controllerIdentity?: string): Promise<void>;
54
54
  }
@@ -5,14 +5,13 @@ import type { IComponent } from "@twin.org/core";
5
5
  export interface INftConnector extends IComponent {
6
6
  /**
7
7
  * Mint an NFT.
8
- * @param controller The identity of the user to access the vault keys.
9
- * @param issuerAddress The issuer for the NFT, will also be the initial owner.
8
+ * @param controllerIdentity The identity of the user to access the vault keys.
10
9
  * @param tag The tag for the NFT.
11
10
  * @param immutableMetadata The immutable metadata for the NFT.
12
11
  * @param metadata The metadata for the NFT.
13
12
  * @returns The id of the created NFT in urn format.
14
13
  */
15
- mint<T = unknown, U = unknown>(controller: string, issuerAddress: string, tag: string, immutableMetadata?: T, metadata?: U): Promise<string>;
14
+ mint<T = unknown, U = unknown>(controllerIdentity: string, tag: string, immutableMetadata?: T, metadata?: U): Promise<string>;
16
15
  /**
17
16
  * Resolve an NFT.
18
17
  * @param id The id of the NFT to resolve.
@@ -34,19 +33,20 @@ export interface INftConnector extends IComponent {
34
33
  burn(controller: string, id: string): Promise<void>;
35
34
  /**
36
35
  * Transfer an NFT.
37
- * @param controller The controller of the NFT who can make changes.
36
+ * @param controllerIdentity The controller of the NFT who can make changes.
38
37
  * @param id The id of the NFT to transfer in urn format.
39
- * @param recipient The recipient of the NFT.
38
+ * @param recipientIdentity The recipient identity for the NFT.
39
+ * @param recipientAddress The recipient address for the NFT.
40
40
  * @param metadata Optional mutable data to include during the transfer.
41
41
  * @returns Nothing.
42
42
  */
43
- transfer<T = unknown>(controller: string, id: string, recipient: string, metadata?: T): Promise<void>;
43
+ transfer<U = unknown>(controllerIdentity: string, id: string, recipientIdentity: string, recipientAddress: string, metadata?: U): Promise<void>;
44
44
  /**
45
45
  * Update the mutable data of the NFT.
46
- * @param controller The controller of the NFT who can make changes.
46
+ * @param controllerIdentity The controller of the NFT who can make changes.
47
47
  * @param id The id of the NFT to update in urn format.
48
48
  * @param metadata The mutable data to update.
49
49
  * @returns Nothing.
50
50
  */
51
- update<T = unknown>(controller: string, id: string, metadata: T): Promise<void>;
51
+ update<U = unknown>(controllerIdentity: string, id: string, metadata: U): Promise<void>;
52
52
  }
@@ -6,10 +6,6 @@ export interface INftMintRequest {
6
6
  * The data to be used in the minting.
7
7
  */
8
8
  body: {
9
- /**
10
- * The issuer for the NFT, will also be the initial owner.
11
- */
12
- issuer: string;
13
9
  /**
14
10
  * The tag for the NFT.
15
11
  */
@@ -16,9 +16,13 @@ export interface INftTransferRequest {
16
16
  */
17
17
  body: {
18
18
  /**
19
- * The recipient for the NFT.
19
+ * The recipient identity for the NFT.
20
20
  */
21
- recipient: string;
21
+ recipientIdentity: string;
22
+ /**
23
+ * The recipient address for the NFT.
24
+ */
25
+ recipientAddress: string;
22
26
  /**
23
27
  * The metadata for the NFT.
24
28
  */
package/docs/changelog.md CHANGED
@@ -1,5 +1,83 @@
1
1
  # @twin.org/nft-models - Changelog
2
2
 
3
- ## v0.0.1-next.9
3
+ ## [0.0.2-next.1](https://github.com/twinfoundation/nft/compare/nft-models-v0.0.2-next.0...nft-models-v0.0.2-next.1) (2025-07-16)
4
+
5
+
6
+ ### Features
7
+
8
+ * update dependencies ([8660f76](https://github.com/twinfoundation/nft/commit/8660f76ca324b0f476e45544cac6bee4b3146c3b))
9
+ * use shared store mechanism ([#16](https://github.com/twinfoundation/nft/issues/16)) ([897bc78](https://github.com/twinfoundation/nft/commit/897bc7805248ba1388b2dd03df24c33f1633f344))
10
+
11
+ ## 0.0.1 (2025-07-09)
12
+
13
+
14
+ ### Features
15
+
16
+ * release to production ([4d338b3](https://github.com/twinfoundation/nft/commit/4d338b3e8a4dbccc61a1d1da3c470ba86cefe535))
17
+
18
+ ## [0.0.1-next.32](https://github.com/twinfoundation/nft/compare/nft-models-v0.0.1-next.31...nft-models-v0.0.1-next.32) (2025-06-24)
19
+
20
+
21
+ ### Miscellaneous Chores
22
+
23
+ * **nft-models:** Synchronize repo versions
24
+
25
+ ## [0.0.1-next.31](https://github.com/twinfoundation/nft/compare/nft-models-v0.0.1-next.30...nft-models-v0.0.1-next.31) (2025-06-12)
26
+
27
+
28
+ ### Features
29
+
30
+ * update dependencies ([8660f76](https://github.com/twinfoundation/nft/commit/8660f76ca324b0f476e45544cac6bee4b3146c3b))
31
+
32
+ ## [0.0.1-next.30](https://github.com/twinfoundation/nft/compare/nft-models-v0.0.1-next.29...nft-models-v0.0.1-next.30) (2025-05-22)
33
+
34
+
35
+ ### Miscellaneous Chores
36
+
37
+ * **nft-models:** Synchronize repo versions
38
+
39
+ ## [0.0.1-next.29](https://github.com/twinfoundation/nft/compare/nft-models-v0.0.1-next.28...nft-models-v0.0.1-next.29) (2025-05-21)
40
+
41
+
42
+ ### Miscellaneous Chores
43
+
44
+ * **nft-models:** Synchronize repo versions
45
+
46
+ ## [0.0.1-next.28](https://github.com/twinfoundation/nft/compare/nft-models-v0.0.1-next.27...nft-models-v0.0.1-next.28) (2025-05-06)
47
+
48
+
49
+ ### Miscellaneous Chores
50
+
51
+ * **nft-models:** Synchronize repo versions
52
+
53
+ ## [0.0.1-next.27](https://github.com/twinfoundation/nft/compare/nft-models-v0.0.1-next.26...nft-models-v0.0.1-next.27) (2025-04-24)
54
+
55
+
56
+ ### Miscellaneous Chores
57
+
58
+ * **nft-models:** Synchronize repo versions
59
+
60
+ ## [0.0.1-next.26](https://github.com/twinfoundation/nft/compare/nft-models-v0.0.1-next.25...nft-models-v0.0.1-next.26) (2025-04-17)
61
+
62
+
63
+ ### Features
64
+
65
+ * use shared store mechanism ([#16](https://github.com/twinfoundation/nft/issues/16)) ([897bc78](https://github.com/twinfoundation/nft/commit/897bc7805248ba1388b2dd03df24c33f1633f344))
66
+
67
+ ## [0.0.1-next.25](https://github.com/twinfoundation/nft/compare/nft-models-v0.0.1-next.24...nft-models-v0.0.1-next.25) (2025-04-17)
68
+
69
+
70
+ ### Miscellaneous Chores
71
+
72
+ * **nft-models:** Synchronize repo versions
73
+
74
+ ## [0.0.1-next.24](https://github.com/twinfoundation/nft/compare/nft-models-v0.0.1-next.23...nft-models-v0.0.1-next.24) (2025-03-28)
75
+
76
+
77
+ ### Miscellaneous Chores
78
+
79
+ * **nft-models:** Synchronize repo versions
80
+
81
+ ## v0.0.1-next.23
4
82
 
5
83
  - Initial Release
@@ -10,23 +10,21 @@ Interface describing an NFT component.
10
10
 
11
11
  ### mint()
12
12
 
13
- > **mint**\<`T`, `U`\>(`issuer`, `tag`, `immutableMetadata`?, `metadata`?, `namespace`?, `identity`?): `Promise`\<`string`\>
13
+ > **mint**\<`T`, `U`\>(`tag`, `immutableMetadata?`, `metadata?`, `namespace?`, `identity?`): `Promise`\<`string`\>
14
14
 
15
15
  Mint an NFT.
16
16
 
17
17
  #### Type Parameters
18
18
 
19
- **T** = `unknown`
19
+ ##### T
20
20
 
21
- **U** = `unknown`
21
+ `T` = `unknown`
22
22
 
23
- #### Parameters
24
-
25
- ##### issuer
23
+ ##### U
26
24
 
27
- `string`
25
+ `U` = `unknown`
28
26
 
29
- The issuer for the NFT, will also be the initial owner.
27
+ #### Parameters
30
28
 
31
29
  ##### tag
32
30
 
@@ -68,15 +66,19 @@ The id of the created NFT in urn format.
68
66
 
69
67
  ### resolve()
70
68
 
71
- > **resolve**\<`T`, `U`\>(`id`, `identity`?): `Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata`: `T`; `metadata`: `U`; \}\>
69
+ > **resolve**\<`T`, `U`\>(`id`, `controllerIdentity?`): `Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata?`: `T`; `metadata?`: `U`; \}\>
72
70
 
73
71
  Resolve an NFT.
74
72
 
75
73
  #### Type Parameters
76
74
 
77
- **T** = `unknown`
75
+ ##### T
76
+
77
+ `T` = `unknown`
78
78
 
79
- **U** = `unknown`
79
+ ##### U
80
+
81
+ `U` = `unknown`
80
82
 
81
83
  #### Parameters
82
84
 
@@ -86,7 +88,7 @@ Resolve an NFT.
86
88
 
87
89
  The id of the NFT to resolve.
88
90
 
89
- ##### identity?
91
+ ##### controllerIdentity?
90
92
 
91
93
  `string`
92
94
 
@@ -94,7 +96,7 @@ The identity to perform the nft operation on.
94
96
 
95
97
  #### Returns
96
98
 
97
- `Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata`: `T`; `metadata`: `U`; \}\>
99
+ `Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata?`: `T`; `metadata?`: `U`; \}\>
98
100
 
99
101
  The data for the NFT.
100
102
 
@@ -102,7 +104,7 @@ The data for the NFT.
102
104
 
103
105
  ### burn()
104
106
 
105
- > **burn**(`id`, `identity`?): `Promise`\<`void`\>
107
+ > **burn**(`id`, `controllerIdentity?`): `Promise`\<`void`\>
106
108
 
107
109
  Burn an NFT.
108
110
 
@@ -114,7 +116,7 @@ Burn an NFT.
114
116
 
115
117
  The id of the NFT to burn in urn format.
116
118
 
117
- ##### identity?
119
+ ##### controllerIdentity?
118
120
 
119
121
  `string`
120
122
 
@@ -130,13 +132,15 @@ Nothing.
130
132
 
131
133
  ### transfer()
132
134
 
133
- > **transfer**\<`T`\>(`id`, `recipient`, `metadata`?, `identity`?): `Promise`\<`void`\>
135
+ > **transfer**\<`U`\>(`id`, `recipientIdentity`, `recipientAddress`, `metadata?`, `controllerIdentity?`): `Promise`\<`void`\>
134
136
 
135
137
  Transfer an NFT.
136
138
 
137
139
  #### Type Parameters
138
140
 
139
- **T** = `unknown`
141
+ ##### U
142
+
143
+ `U` = `unknown`
140
144
 
141
145
  #### Parameters
142
146
 
@@ -146,19 +150,25 @@ Transfer an NFT.
146
150
 
147
151
  The id of the NFT to transfer in urn format.
148
152
 
149
- ##### recipient
153
+ ##### recipientIdentity
154
+
155
+ `string`
156
+
157
+ The recipient identity for the NFT.
158
+
159
+ ##### recipientAddress
150
160
 
151
161
  `string`
152
162
 
153
- The recipient of the NFT.
163
+ The recipient address for the NFT.
154
164
 
155
165
  ##### metadata?
156
166
 
157
- `T`
167
+ `U`
158
168
 
159
169
  Optional mutable data to include during the transfer.
160
170
 
161
- ##### identity?
171
+ ##### controllerIdentity?
162
172
 
163
173
  `string`
164
174
 
@@ -174,13 +184,15 @@ Nothing.
174
184
 
175
185
  ### update()
176
186
 
177
- > **update**\<`T`\>(`id`, `metadata`, `identity`?): `Promise`\<`void`\>
187
+ > **update**\<`U`\>(`id`, `metadata`, `controllerIdentity?`): `Promise`\<`void`\>
178
188
 
179
189
  Update the mutable data of the NFT.
180
190
 
181
191
  #### Type Parameters
182
192
 
183
- **T** = `unknown`
193
+ ##### U
194
+
195
+ `U` = `unknown`
184
196
 
185
197
  #### Parameters
186
198
 
@@ -192,11 +204,11 @@ The id of the NFT to update in urn format.
192
204
 
193
205
  ##### metadata
194
206
 
195
- `T`
207
+ `U`
196
208
 
197
209
  The mutable data to update.
198
210
 
199
- ##### identity?
211
+ ##### controllerIdentity?
200
212
 
201
213
  `string`
202
214
 
@@ -10,29 +10,27 @@ Interface describing an NFT connector.
10
10
 
11
11
  ### mint()
12
12
 
13
- > **mint**\<`T`, `U`\>(`controller`, `issuerAddress`, `tag`, `immutableMetadata`?, `metadata`?): `Promise`\<`string`\>
13
+ > **mint**\<`T`, `U`\>(`controllerIdentity`, `tag`, `immutableMetadata?`, `metadata?`): `Promise`\<`string`\>
14
14
 
15
15
  Mint an NFT.
16
16
 
17
17
  #### Type Parameters
18
18
 
19
- **T** = `unknown`
19
+ ##### T
20
20
 
21
- **U** = `unknown`
21
+ `T` = `unknown`
22
22
 
23
- #### Parameters
24
-
25
- ##### controller
23
+ ##### U
26
24
 
27
- `string`
25
+ `U` = `unknown`
28
26
 
29
- The identity of the user to access the vault keys.
27
+ #### Parameters
30
28
 
31
- ##### issuerAddress
29
+ ##### controllerIdentity
32
30
 
33
31
  `string`
34
32
 
35
- The issuer for the NFT, will also be the initial owner.
33
+ The identity of the user to access the vault keys.
36
34
 
37
35
  ##### tag
38
36
 
@@ -62,15 +60,19 @@ The id of the created NFT in urn format.
62
60
 
63
61
  ### resolve()
64
62
 
65
- > **resolve**\<`T`, `U`\>(`id`): `Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata`: `T`; `metadata`: `U`; \}\>
63
+ > **resolve**\<`T`, `U`\>(`id`): `Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata?`: `T`; `metadata?`: `U`; \}\>
66
64
 
67
65
  Resolve an NFT.
68
66
 
69
67
  #### Type Parameters
70
68
 
71
- **T** = `unknown`
69
+ ##### T
70
+
71
+ `T` = `unknown`
72
+
73
+ ##### U
72
74
 
73
- • **U** = `unknown`
75
+ `U` = `unknown`
74
76
 
75
77
  #### Parameters
76
78
 
@@ -82,7 +84,7 @@ The id of the NFT to resolve.
82
84
 
83
85
  #### Returns
84
86
 
85
- `Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata`: `T`; `metadata`: `U`; \}\>
87
+ `Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata?`: `T`; `metadata?`: `U`; \}\>
86
88
 
87
89
  The data for the NFT.
88
90
 
@@ -118,17 +120,19 @@ Nothing.
118
120
 
119
121
  ### transfer()
120
122
 
121
- > **transfer**\<`T`\>(`controller`, `id`, `recipient`, `metadata`?): `Promise`\<`void`\>
123
+ > **transfer**\<`U`\>(`controllerIdentity`, `id`, `recipientIdentity`, `recipientAddress`, `metadata?`): `Promise`\<`void`\>
122
124
 
123
125
  Transfer an NFT.
124
126
 
125
127
  #### Type Parameters
126
128
 
127
- **T** = `unknown`
129
+ ##### U
130
+
131
+ `U` = `unknown`
128
132
 
129
133
  #### Parameters
130
134
 
131
- ##### controller
135
+ ##### controllerIdentity
132
136
 
133
137
  `string`
134
138
 
@@ -140,15 +144,21 @@ The controller of the NFT who can make changes.
140
144
 
141
145
  The id of the NFT to transfer in urn format.
142
146
 
143
- ##### recipient
147
+ ##### recipientIdentity
144
148
 
145
149
  `string`
146
150
 
147
- The recipient of the NFT.
151
+ The recipient identity for the NFT.
152
+
153
+ ##### recipientAddress
154
+
155
+ `string`
156
+
157
+ The recipient address for the NFT.
148
158
 
149
159
  ##### metadata?
150
160
 
151
- `T`
161
+ `U`
152
162
 
153
163
  Optional mutable data to include during the transfer.
154
164
 
@@ -162,17 +172,19 @@ Nothing.
162
172
 
163
173
  ### update()
164
174
 
165
- > **update**\<`T`\>(`controller`, `id`, `metadata`): `Promise`\<`void`\>
175
+ > **update**\<`U`\>(`controllerIdentity`, `id`, `metadata`): `Promise`\<`void`\>
166
176
 
167
177
  Update the mutable data of the NFT.
168
178
 
169
179
  #### Type Parameters
170
180
 
171
- **T** = `unknown`
181
+ ##### U
182
+
183
+ `U` = `unknown`
172
184
 
173
185
  #### Parameters
174
186
 
175
- ##### controller
187
+ ##### controllerIdentity
176
188
 
177
189
  `string`
178
190
 
@@ -186,7 +198,7 @@ The id of the NFT to update in urn format.
186
198
 
187
199
  ##### metadata
188
200
 
189
- `T`
201
+ `U`
190
202
 
191
203
  The mutable data to update.
192
204
 
@@ -10,12 +10,6 @@ Mint the data and return the NFT id.
10
10
 
11
11
  The data to be used in the minting.
12
12
 
13
- #### issuer
14
-
15
- > **issuer**: `string`
16
-
17
- The issuer for the NFT, will also be the initial owner.
18
-
19
13
  #### tag
20
14
 
21
15
  > **tag**: `string`
@@ -24,11 +24,17 @@ The id of the NFT to transfer in urn format.
24
24
 
25
25
  The data to be used in the transfer.
26
26
 
27
- #### recipient
27
+ #### recipientIdentity
28
28
 
29
- > **recipient**: `string`
29
+ > **recipientIdentity**: `string`
30
30
 
31
- The recipient for the NFT.
31
+ The recipient identity for the NFT.
32
+
33
+ #### recipientAddress
34
+
35
+ > **recipientAddress**: `string`
36
+
37
+ The recipient address for the NFT.
32
38
 
33
39
  #### metadata?
34
40
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/nft-models",
3
- "version": "0.0.1-next.9",
3
+ "version": "0.0.2-next.1",
4
4
  "description": "Contains models and classes for use with NFTs",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,9 +23,9 @@
23
23
  "types": "./dist/types/index.d.ts",
24
24
  "exports": {
25
25
  ".": {
26
+ "types": "./dist/types/index.d.ts",
26
27
  "require": "./dist/cjs/index.cjs",
27
- "import": "./dist/esm/index.mjs",
28
- "types": "./dist/types/index.d.ts"
28
+ "import": "./dist/esm/index.mjs"
29
29
  }
30
30
  },
31
31
  "files": [