@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.
@@ -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();
@@ -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();
@@ -1,4 +1,5 @@
1
1
  export * from "./models/INftServiceConfig";
2
+ export * from "./models/INftServiceConstructorOptions";
2
3
  export * from "./nftRoutes";
3
4
  export * from "./nftService";
4
5
  export * from "./restEntryPoints";
@@ -0,0 +1,10 @@
1
+ import type { INftServiceConfig } from "./INftServiceConfig";
2
+ /**
3
+ * Options for the nft service constructor.
4
+ */
5
+ export interface INftServiceConstructorOptions {
6
+ /**
7
+ * The configuration for the service.
8
+ */
9
+ config?: INftServiceConfig;
10
+ }
@@ -1,5 +1,5 @@
1
1
  import { type INftComponent } from "@twin.org/nft-models";
2
- import type { INftServiceConfig } from "./models/INftServiceConfig";
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
@@ -1,5 +1,5 @@
1
1
  # @twin.org/nft-service - Changelog
2
2
 
3
- ## v0.0.1-next.6
3
+ ## v0.0.1-next.7
4
4
 
5
5
  - Initial Release
@@ -16,13 +16,11 @@ Create a new instance of NftService.
16
16
 
17
17
  #### Parameters
18
18
 
19
- **options?**
19
+ ##### options?
20
20
 
21
- The options for the service.
22
-
23
- • **options.config?**: [`INftServiceConfig`](../interfaces/INftServiceConfig.md)
21
+ [`INftServiceConstructorOptions`](../interfaces/INftServiceConstructorOptions.md)
24
22
 
25
- The configuration for the service.
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
- **issuer**: `string`
65
+ ##### issuer
66
+
67
+ `string`
68
68
 
69
69
  The issuer for the NFT, will also be the initial owner.
70
70
 
71
- **tag**: `string`
71
+ ##### tag
72
+
73
+ `string`
72
74
 
73
75
  The tag for the NFT.
74
76
 
75
- **immutableMetadata?**: `T`
77
+ ##### immutableMetadata?
78
+
79
+ `T`
76
80
 
77
81
  The immutable metadata for the NFT.
78
82
 
79
- **metadata?**: `U`
83
+ ##### metadata?
84
+
85
+ `U`
80
86
 
81
87
  The metadata for the NFT.
82
88
 
83
- **namespace?**: `string`
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
- **identity?**: `string`
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`\<`object`\>
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
- **id**: `string`
127
+ ##### id
128
+
129
+ `string`
118
130
 
119
131
  The id of the NFT to resolve.
120
132
 
121
- **identity?**: `string`
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`\<`object`\>
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
- **id**: `string`
159
+ ##### id
160
+
161
+ `string`
166
162
 
167
163
  The id of the NFT to burn in urn format.
168
164
 
169
- **identity?**: `string`
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
- **id**: `string`
195
+ ##### id
196
+
197
+ `string`
198
198
 
199
199
  The id of the NFT to transfer in urn format.
200
200
 
201
- **recipient**: `string`
201
+ ##### recipient
202
+
203
+ `string`
202
204
 
203
205
  The recipient of the NFT.
204
206
 
205
- **metadata?**: `T`
207
+ ##### metadata?
208
+
209
+ `T`
206
210
 
207
211
  Optional mutable data to include during the transfer.
208
212
 
209
- **identity?**: `string`
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
- **id**: `string`
243
+ ##### id
244
+
245
+ `string`
238
246
 
239
247
  The id of the NFT to update in urn format.
240
248
 
241
- **metadata**: `T`
249
+ ##### metadata
250
+
251
+ `T`
242
252
 
243
253
  The mutable data to update.
244
254
 
245
- **identity?**: `string`
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
- **baseRouteName**: `string`
9
+ ### baseRouteName
10
+
11
+ `string`
10
12
 
11
13
  Prefix to prepend to the paths.
12
14
 
13
- **componentName**: `string`
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
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `INftBurnRequest`
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
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `INftMintRequest`
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
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `INftResolveRequest`
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
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `INftTransferRequest`
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
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `INftUpdateRequest`
21
+ ### request
22
+
23
+ `INftUpdateRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -7,6 +7,7 @@
7
7
  ## Interfaces
8
8
 
9
9
  - [INftServiceConfig](interfaces/INftServiceConfig.md)
10
+ - [INftServiceConstructorOptions](interfaces/INftServiceConstructorOptions.md)
10
11
 
11
12
  ## Variables
12
13
 
@@ -0,0 +1,11 @@
1
+ # Interface: INftServiceConstructorOptions
2
+
3
+ Options for the nft service constructor.
4
+
5
+ ## Properties
6
+
7
+ ### config?
8
+
9
+ > `optional` **config**: [`INftServiceConfig`](INftServiceConfig.md)
10
+
11
+ The configuration for the service.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/nft-service",
3
- "version": "0.0.1-next.6",
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.6",
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",