@twin.org/nft-service 0.0.1-next.6 → 0.0.1-next.7
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 +0 -1
- package/dist/esm/index.mjs +0 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/INftServiceConstructorOptions.d.ts +10 -0
- package/dist/types/nftService.d.ts +2 -5
- package/docs/changelog.md +1 -1
- package/docs/reference/classes/NftService.md +56 -44
- package/docs/reference/functions/generateRestRoutesNft.md +6 -2
- package/docs/reference/functions/nftBurn.md +9 -3
- package/docs/reference/functions/nftMint.md +9 -3
- package/docs/reference/functions/nftResolve.md +9 -3
- package/docs/reference/functions/nftTransfer.md +9 -3
- package/docs/reference/functions/nftUpdate.md +9 -3
- package/docs/reference/index.md +1 -0
- package/docs/reference/interfaces/INftServiceConstructorOptions.md +11 -0
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -323,7 +323,6 @@ class NftService {
|
|
|
323
323
|
/**
|
|
324
324
|
* Create a new instance of NftService.
|
|
325
325
|
* @param options The options for the service.
|
|
326
|
-
* @param options.config The configuration for the service.
|
|
327
326
|
*/
|
|
328
327
|
constructor(options) {
|
|
329
328
|
const names = nftModels.NftConnectorFactory.names();
|
package/dist/esm/index.mjs
CHANGED
|
@@ -321,7 +321,6 @@ class NftService {
|
|
|
321
321
|
/**
|
|
322
322
|
* Create a new instance of NftService.
|
|
323
323
|
* @param options The options for the service.
|
|
324
|
-
* @param options.config The configuration for the service.
|
|
325
324
|
*/
|
|
326
325
|
constructor(options) {
|
|
327
326
|
const names = NftConnectorFactory.names();
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type INftComponent } from "@twin.org/nft-models";
|
|
2
|
-
import type {
|
|
2
|
+
import type { INftServiceConstructorOptions } from "./models/INftServiceConstructorOptions";
|
|
3
3
|
/**
|
|
4
4
|
* Service for performing NFT operations to a connector.
|
|
5
5
|
*/
|
|
@@ -15,11 +15,8 @@ export declare class NftService implements INftComponent {
|
|
|
15
15
|
/**
|
|
16
16
|
* Create a new instance of NftService.
|
|
17
17
|
* @param options The options for the service.
|
|
18
|
-
* @param options.config The configuration for the service.
|
|
19
18
|
*/
|
|
20
|
-
constructor(options?:
|
|
21
|
-
config?: INftServiceConfig;
|
|
22
|
-
});
|
|
19
|
+
constructor(options?: INftServiceConstructorOptions);
|
|
23
20
|
/**
|
|
24
21
|
* Mint an NFT.
|
|
25
22
|
* @param issuer The issuer for the NFT, will also be the initial owner.
|
package/docs/changelog.md
CHANGED
|
@@ -16,13 +16,11 @@ Create a new instance of NftService.
|
|
|
16
16
|
|
|
17
17
|
#### Parameters
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
##### options?
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
• **options.config?**: [`INftServiceConfig`](../interfaces/INftServiceConfig.md)
|
|
21
|
+
[`INftServiceConstructorOptions`](../interfaces/INftServiceConstructorOptions.md)
|
|
24
22
|
|
|
25
|
-
The
|
|
23
|
+
The options for the service.
|
|
26
24
|
|
|
27
25
|
#### Returns
|
|
28
26
|
|
|
@@ -64,27 +62,39 @@ Mint an NFT.
|
|
|
64
62
|
|
|
65
63
|
#### Parameters
|
|
66
64
|
|
|
67
|
-
|
|
65
|
+
##### issuer
|
|
66
|
+
|
|
67
|
+
`string`
|
|
68
68
|
|
|
69
69
|
The issuer for the NFT, will also be the initial owner.
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
##### tag
|
|
72
|
+
|
|
73
|
+
`string`
|
|
72
74
|
|
|
73
75
|
The tag for the NFT.
|
|
74
76
|
|
|
75
|
-
|
|
77
|
+
##### immutableMetadata?
|
|
78
|
+
|
|
79
|
+
`T`
|
|
76
80
|
|
|
77
81
|
The immutable metadata for the NFT.
|
|
78
82
|
|
|
79
|
-
|
|
83
|
+
##### metadata?
|
|
84
|
+
|
|
85
|
+
`U`
|
|
80
86
|
|
|
81
87
|
The metadata for the NFT.
|
|
82
88
|
|
|
83
|
-
|
|
89
|
+
##### namespace?
|
|
90
|
+
|
|
91
|
+
`string`
|
|
84
92
|
|
|
85
93
|
The namespace of the connector to use for the NFT, defaults to service configured namespace.
|
|
86
94
|
|
|
87
|
-
|
|
95
|
+
##### identity?
|
|
96
|
+
|
|
97
|
+
`string`
|
|
88
98
|
|
|
89
99
|
The identity to perform the nft operation on.
|
|
90
100
|
|
|
@@ -102,7 +112,7 @@ The id of the created NFT in urn format.
|
|
|
102
112
|
|
|
103
113
|
### resolve()
|
|
104
114
|
|
|
105
|
-
> **resolve**\<`T`, `U`\>(`id`, `identity`?): `Promise
|
|
115
|
+
> **resolve**\<`T`, `U`\>(`id`, `identity`?): `Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata`: `T`; `metadata`: `U`; \}\>
|
|
106
116
|
|
|
107
117
|
Resolve an NFT.
|
|
108
118
|
|
|
@@ -114,40 +124,24 @@ Resolve an NFT.
|
|
|
114
124
|
|
|
115
125
|
#### Parameters
|
|
116
126
|
|
|
117
|
-
|
|
127
|
+
##### id
|
|
128
|
+
|
|
129
|
+
`string`
|
|
118
130
|
|
|
119
131
|
The id of the NFT to resolve.
|
|
120
132
|
|
|
121
|
-
|
|
133
|
+
##### identity?
|
|
134
|
+
|
|
135
|
+
`string`
|
|
122
136
|
|
|
123
137
|
The identity to perform the nft operation on.
|
|
124
138
|
|
|
125
139
|
#### Returns
|
|
126
140
|
|
|
127
|
-
`Promise
|
|
141
|
+
`Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata`: `T`; `metadata`: `U`; \}\>
|
|
128
142
|
|
|
129
143
|
The data for the NFT.
|
|
130
144
|
|
|
131
|
-
##### issuer
|
|
132
|
-
|
|
133
|
-
> **issuer**: `string`
|
|
134
|
-
|
|
135
|
-
##### owner
|
|
136
|
-
|
|
137
|
-
> **owner**: `string`
|
|
138
|
-
|
|
139
|
-
##### tag
|
|
140
|
-
|
|
141
|
-
> **tag**: `string`
|
|
142
|
-
|
|
143
|
-
##### immutableMetadata?
|
|
144
|
-
|
|
145
|
-
> `optional` **immutableMetadata**: `T`
|
|
146
|
-
|
|
147
|
-
##### metadata?
|
|
148
|
-
|
|
149
|
-
> `optional` **metadata**: `U`
|
|
150
|
-
|
|
151
145
|
#### Implementation of
|
|
152
146
|
|
|
153
147
|
`INftComponent.resolve`
|
|
@@ -162,11 +156,15 @@ Burn an NFT.
|
|
|
162
156
|
|
|
163
157
|
#### Parameters
|
|
164
158
|
|
|
165
|
-
|
|
159
|
+
##### id
|
|
160
|
+
|
|
161
|
+
`string`
|
|
166
162
|
|
|
167
163
|
The id of the NFT to burn in urn format.
|
|
168
164
|
|
|
169
|
-
|
|
165
|
+
##### identity?
|
|
166
|
+
|
|
167
|
+
`string`
|
|
170
168
|
|
|
171
169
|
The identity to perform the nft operation on.
|
|
172
170
|
|
|
@@ -194,19 +192,27 @@ Transfer an NFT.
|
|
|
194
192
|
|
|
195
193
|
#### Parameters
|
|
196
194
|
|
|
197
|
-
|
|
195
|
+
##### id
|
|
196
|
+
|
|
197
|
+
`string`
|
|
198
198
|
|
|
199
199
|
The id of the NFT to transfer in urn format.
|
|
200
200
|
|
|
201
|
-
|
|
201
|
+
##### recipient
|
|
202
|
+
|
|
203
|
+
`string`
|
|
202
204
|
|
|
203
205
|
The recipient of the NFT.
|
|
204
206
|
|
|
205
|
-
|
|
207
|
+
##### metadata?
|
|
208
|
+
|
|
209
|
+
`T`
|
|
206
210
|
|
|
207
211
|
Optional mutable data to include during the transfer.
|
|
208
212
|
|
|
209
|
-
|
|
213
|
+
##### identity?
|
|
214
|
+
|
|
215
|
+
`string`
|
|
210
216
|
|
|
211
217
|
The identity to perform the nft operation on.
|
|
212
218
|
|
|
@@ -234,15 +240,21 @@ Update the data of the NFT.
|
|
|
234
240
|
|
|
235
241
|
#### Parameters
|
|
236
242
|
|
|
237
|
-
|
|
243
|
+
##### id
|
|
244
|
+
|
|
245
|
+
`string`
|
|
238
246
|
|
|
239
247
|
The id of the NFT to update in urn format.
|
|
240
248
|
|
|
241
|
-
|
|
249
|
+
##### metadata
|
|
250
|
+
|
|
251
|
+
`T`
|
|
242
252
|
|
|
243
253
|
The mutable data to update.
|
|
244
254
|
|
|
245
|
-
|
|
255
|
+
##### identity?
|
|
256
|
+
|
|
257
|
+
`string`
|
|
246
258
|
|
|
247
259
|
The identity to perform the nft operation on.
|
|
248
260
|
|
|
@@ -6,11 +6,15 @@ The REST routes for NFT.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### baseRouteName
|
|
10
|
+
|
|
11
|
+
`string`
|
|
10
12
|
|
|
11
13
|
Prefix to prepend to the paths.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The name of the component to use in the routes stored in the ComponentFactory.
|
|
16
20
|
|
|
@@ -6,15 +6,21 @@ Burn an NFT.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
10
12
|
|
|
11
13
|
The request context for the API.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The name of the component to use in the routes.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
`INftBurnRequest`
|
|
18
24
|
|
|
19
25
|
The request.
|
|
20
26
|
|
|
@@ -6,15 +6,21 @@ Mint an NFT.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
10
12
|
|
|
11
13
|
The request context for the API.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The name of the component to use in the routes.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
`INftMintRequest`
|
|
18
24
|
|
|
19
25
|
The request.
|
|
20
26
|
|
|
@@ -6,15 +6,21 @@ Resolve an NFT.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
10
12
|
|
|
11
13
|
The request context for the API.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The name of the component to use in the routes.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
`INftResolveRequest`
|
|
18
24
|
|
|
19
25
|
The request.
|
|
20
26
|
|
|
@@ -6,15 +6,21 @@ Transfer an NFT.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
10
12
|
|
|
11
13
|
The request context for the API.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The name of the component to use in the routes.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
`INftTransferRequest`
|
|
18
24
|
|
|
19
25
|
The request.
|
|
20
26
|
|
|
@@ -6,15 +6,21 @@ Update an NFT.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
10
12
|
|
|
11
13
|
The request context for the API.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The name of the component to use in the routes.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
`INftUpdateRequest`
|
|
18
24
|
|
|
19
25
|
The request.
|
|
20
26
|
|
package/docs/reference/index.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/nft-service",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.7",
|
|
4
4
|
"description": "NFT contract implementation and REST endpoint definitions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@twin.org/core": "next",
|
|
19
19
|
"@twin.org/entity": "next",
|
|
20
20
|
"@twin.org/nameof": "next",
|
|
21
|
-
"@twin.org/nft-models": "0.0.1-next.
|
|
21
|
+
"@twin.org/nft-models": "0.0.1-next.7",
|
|
22
22
|
"@twin.org/web": "next"
|
|
23
23
|
},
|
|
24
24
|
"main": "./dist/cjs/index.cjs",
|