@twin.org/nft-models 0.0.1-next.16 → 0.0.1-next.18
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/types/models/INftComponent.d.ts +11 -11
- package/dist/types/models/INftConnector.d.ts +8 -8
- package/dist/types/models/api/INftMintRequest.d.ts +0 -4
- package/dist/types/models/api/INftTransferRequest.d.ts +6 -2
- package/docs/changelog.md +1 -1
- package/docs/reference/interfaces/INftComponent.md +21 -21
- package/docs/reference/interfaces/INftConnector.md +18 -18
- package/docs/reference/interfaces/INftMintRequest.md +0 -6
- package/docs/reference/interfaces/INftTransferRequest.md +9 -3
- package/package.json +1 -1
|
@@ -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>(
|
|
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
|
|
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,
|
|
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
|
|
32
|
+
* @param controllerIdentity The identity to perform the nft operation on.
|
|
34
33
|
* @returns Nothing.
|
|
35
34
|
*/
|
|
36
|
-
burn(id: string,
|
|
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
|
|
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
|
|
42
|
+
* @param controllerIdentity The identity to perform the nft operation on.
|
|
43
43
|
* @returns Nothing.
|
|
44
44
|
*/
|
|
45
|
-
transfer<
|
|
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
|
|
50
|
+
* @param controllerIdentity The identity to perform the nft operation on.
|
|
51
51
|
* @returns Nothing.
|
|
52
52
|
*/
|
|
53
|
-
update<
|
|
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
|
|
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>(
|
|
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
|
|
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
|
|
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<
|
|
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
|
|
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<
|
|
51
|
+
update<U = unknown>(controllerIdentity: string, id: string, metadata: U): Promise<void>;
|
|
52
52
|
}
|
|
@@ -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
|
-
|
|
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
|
@@ -10,7 +10,7 @@ Interface describing an NFT component.
|
|
|
10
10
|
|
|
11
11
|
### mint()
|
|
12
12
|
|
|
13
|
-
> **mint**\<`T`, `U`\>(`
|
|
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`, `
|
|
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
|
-
#####
|
|
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`, `
|
|
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
|
-
#####
|
|
111
|
+
##### controllerIdentity?
|
|
118
112
|
|
|
119
113
|
`string`
|
|
120
114
|
|
|
@@ -130,13 +124,13 @@ Nothing.
|
|
|
130
124
|
|
|
131
125
|
### transfer()
|
|
132
126
|
|
|
133
|
-
> **transfer**\<`
|
|
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
|
-
• **
|
|
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
|
-
#####
|
|
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
|
|
153
|
+
The recipient address for the NFT.
|
|
154
154
|
|
|
155
155
|
##### metadata?
|
|
156
156
|
|
|
157
|
-
`
|
|
157
|
+
`U`
|
|
158
158
|
|
|
159
159
|
Optional mutable data to include during the transfer.
|
|
160
160
|
|
|
161
|
-
#####
|
|
161
|
+
##### controllerIdentity?
|
|
162
162
|
|
|
163
163
|
`string`
|
|
164
164
|
|
|
@@ -174,13 +174,13 @@ Nothing.
|
|
|
174
174
|
|
|
175
175
|
### update()
|
|
176
176
|
|
|
177
|
-
> **update**\<`
|
|
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
|
-
• **
|
|
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
|
-
`
|
|
195
|
+
`U`
|
|
196
196
|
|
|
197
197
|
The mutable data to update.
|
|
198
198
|
|
|
199
|
-
#####
|
|
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`\>(`
|
|
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
|
-
#####
|
|
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**\<`
|
|
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
|
-
• **
|
|
121
|
+
• **U** = `unknown`
|
|
128
122
|
|
|
129
123
|
#### Parameters
|
|
130
124
|
|
|
131
|
-
#####
|
|
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
|
-
#####
|
|
137
|
+
##### recipientIdentity
|
|
144
138
|
|
|
145
139
|
`string`
|
|
146
140
|
|
|
147
|
-
The recipient
|
|
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
|
-
`
|
|
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**\<`
|
|
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
|
-
• **
|
|
171
|
+
• **U** = `unknown`
|
|
172
172
|
|
|
173
173
|
#### Parameters
|
|
174
174
|
|
|
175
|
-
#####
|
|
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
|
-
`
|
|
189
|
+
`U`
|
|
190
190
|
|
|
191
191
|
The mutable data to update.
|
|
192
192
|
|
|
@@ -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
|
-
####
|
|
27
|
+
#### recipientIdentity
|
|
28
28
|
|
|
29
|
-
> **
|
|
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
|
|