@twin.org/nft-models 0.0.1-next.16 → 0.0.1-next.17

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,5 @@
1
1
  # @twin.org/nft-models - Changelog
2
2
 
3
- ## v0.0.1-next.16
3
+ ## v0.0.1-next.17
4
4
 
5
5
  - Initial Release
@@ -10,7 +10,7 @@ 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
 
@@ -22,12 +22,6 @@ Mint an NFT.
22
22
 
23
23
  #### Parameters
24
24
 
25
- ##### issuer
26
-
27
- `string`
28
-
29
- The issuer for the NFT, will also be the initial owner.
30
-
31
25
  ##### tag
32
26
 
33
27
  `string`
@@ -68,7 +62,7 @@ The id of the created NFT in urn format.
68
62
 
69
63
  ### resolve()
70
64
 
71
- > **resolve**\<`T`, `U`\>(`id`, `identity`?): `Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata`: `T`; `metadata`: `U`; \}\>
65
+ > **resolve**\<`T`, `U`\>(`id`, `controllerIdentity`?): `Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata`: `T`; `metadata`: `U`; \}\>
72
66
 
73
67
  Resolve an NFT.
74
68
 
@@ -86,7 +80,7 @@ Resolve an NFT.
86
80
 
87
81
  The id of the NFT to resolve.
88
82
 
89
- ##### identity?
83
+ ##### controllerIdentity?
90
84
 
91
85
  `string`
92
86
 
@@ -102,7 +96,7 @@ The data for the NFT.
102
96
 
103
97
  ### burn()
104
98
 
105
- > **burn**(`id`, `identity`?): `Promise`\<`void`\>
99
+ > **burn**(`id`, `controllerIdentity`?): `Promise`\<`void`\>
106
100
 
107
101
  Burn an NFT.
108
102
 
@@ -114,7 +108,7 @@ Burn an NFT.
114
108
 
115
109
  The id of the NFT to burn in urn format.
116
110
 
117
- ##### identity?
111
+ ##### controllerIdentity?
118
112
 
119
113
  `string`
120
114
 
@@ -130,13 +124,13 @@ Nothing.
130
124
 
131
125
  ### transfer()
132
126
 
133
- > **transfer**\<`T`\>(`id`, `recipient`, `metadata`?, `identity`?): `Promise`\<`void`\>
127
+ > **transfer**\<`U`\>(`id`, `recipientIdentity`, `recipientAddress`, `metadata`?, `controllerIdentity`?): `Promise`\<`void`\>
134
128
 
135
129
  Transfer an NFT.
136
130
 
137
131
  #### Type Parameters
138
132
 
139
- • **T** = `unknown`
133
+ • **U** = `unknown`
140
134
 
141
135
  #### Parameters
142
136
 
@@ -146,19 +140,25 @@ Transfer an NFT.
146
140
 
147
141
  The id of the NFT to transfer in urn format.
148
142
 
149
- ##### recipient
143
+ ##### recipientIdentity
144
+
145
+ `string`
146
+
147
+ The recipient identity for the NFT.
148
+
149
+ ##### recipientAddress
150
150
 
151
151
  `string`
152
152
 
153
- The recipient of the NFT.
153
+ The recipient address for the NFT.
154
154
 
155
155
  ##### metadata?
156
156
 
157
- `T`
157
+ `U`
158
158
 
159
159
  Optional mutable data to include during the transfer.
160
160
 
161
- ##### identity?
161
+ ##### controllerIdentity?
162
162
 
163
163
  `string`
164
164
 
@@ -174,13 +174,13 @@ Nothing.
174
174
 
175
175
  ### update()
176
176
 
177
- > **update**\<`T`\>(`id`, `metadata`, `identity`?): `Promise`\<`void`\>
177
+ > **update**\<`U`\>(`id`, `metadata`, `controllerIdentity`?): `Promise`\<`void`\>
178
178
 
179
179
  Update the mutable data of the NFT.
180
180
 
181
181
  #### Type Parameters
182
182
 
183
- • **T** = `unknown`
183
+ • **U** = `unknown`
184
184
 
185
185
  #### Parameters
186
186
 
@@ -192,11 +192,11 @@ The id of the NFT to update in urn format.
192
192
 
193
193
  ##### metadata
194
194
 
195
- `T`
195
+ `U`
196
196
 
197
197
  The mutable data to update.
198
198
 
199
- ##### identity?
199
+ ##### controllerIdentity?
200
200
 
201
201
  `string`
202
202
 
@@ -10,7 +10,7 @@ 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
 
@@ -22,18 +22,12 @@ Mint an NFT.
22
22
 
23
23
  #### Parameters
24
24
 
25
- ##### controller
25
+ ##### controllerIdentity
26
26
 
27
27
  `string`
28
28
 
29
29
  The identity of the user to access the vault keys.
30
30
 
31
- ##### issuerAddress
32
-
33
- `string`
34
-
35
- The issuer for the NFT, will also be the initial owner.
36
-
37
31
  ##### tag
38
32
 
39
33
  `string`
@@ -118,17 +112,17 @@ Nothing.
118
112
 
119
113
  ### transfer()
120
114
 
121
- > **transfer**\<`T`\>(`controller`, `id`, `recipient`, `metadata`?): `Promise`\<`void`\>
115
+ > **transfer**\<`U`\>(`controllerIdentity`, `id`, `recipientIdentity`, `recipientAddress`, `metadata`?): `Promise`\<`void`\>
122
116
 
123
117
  Transfer an NFT.
124
118
 
125
119
  #### Type Parameters
126
120
 
127
- • **T** = `unknown`
121
+ • **U** = `unknown`
128
122
 
129
123
  #### Parameters
130
124
 
131
- ##### controller
125
+ ##### controllerIdentity
132
126
 
133
127
  `string`
134
128
 
@@ -140,15 +134,21 @@ The controller of the NFT who can make changes.
140
134
 
141
135
  The id of the NFT to transfer in urn format.
142
136
 
143
- ##### recipient
137
+ ##### recipientIdentity
144
138
 
145
139
  `string`
146
140
 
147
- The recipient of the NFT.
141
+ The recipient identity for the NFT.
142
+
143
+ ##### recipientAddress
144
+
145
+ `string`
146
+
147
+ The recipient address for the NFT.
148
148
 
149
149
  ##### metadata?
150
150
 
151
- `T`
151
+ `U`
152
152
 
153
153
  Optional mutable data to include during the transfer.
154
154
 
@@ -162,17 +162,17 @@ Nothing.
162
162
 
163
163
  ### update()
164
164
 
165
- > **update**\<`T`\>(`controller`, `id`, `metadata`): `Promise`\<`void`\>
165
+ > **update**\<`U`\>(`controllerIdentity`, `id`, `metadata`): `Promise`\<`void`\>
166
166
 
167
167
  Update the mutable data of the NFT.
168
168
 
169
169
  #### Type Parameters
170
170
 
171
- • **T** = `unknown`
171
+ • **U** = `unknown`
172
172
 
173
173
  #### Parameters
174
174
 
175
- ##### controller
175
+ ##### controllerIdentity
176
176
 
177
177
  `string`
178
178
 
@@ -186,7 +186,7 @@ The id of the NFT to update in urn format.
186
186
 
187
187
  ##### metadata
188
188
 
189
- `T`
189
+ `U`
190
190
 
191
191
  The mutable data to update.
192
192
 
@@ -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.16",
3
+ "version": "0.0.1-next.17",
4
4
  "description": "Contains models and classes for use with NFTs",
5
5
  "repository": {
6
6
  "type": "git",