@twin.org/nft-rest-client 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.
@@ -23,19 +23,16 @@ class NftClient extends apiCore.BaseRestClient {
23
23
  }
24
24
  /**
25
25
  * Mint an NFT.
26
- * @param issuer The issuer for the NFT, will also be the initial owner.
27
26
  * @param tag The tag for the NFT.
28
27
  * @param immutableMetadata The immutable metadata for the NFT.
29
28
  * @param metadata The metadata for the NFT.
30
29
  * @param namespace The namespace of the connector to use for the NFT, defaults to component configured namespace.
31
30
  * @returns The id of the created NFT in urn format.
32
31
  */
33
- async mint(issuer, tag, immutableMetadata, metadata, namespace) {
34
- core.Guards.stringValue(this.CLASS_NAME, "issuer", issuer);
32
+ async mint(tag, immutableMetadata, metadata, namespace) {
35
33
  core.Guards.stringValue(this.CLASS_NAME, "tag", tag);
36
34
  const response = await this.fetch("/", "POST", {
37
35
  body: {
38
- issuer,
39
36
  tag,
40
37
  immutableMetadata,
41
38
  metadata,
@@ -74,19 +71,22 @@ class NftClient extends apiCore.BaseRestClient {
74
71
  /**
75
72
  * Transfer an NFT.
76
73
  * @param id The id of the NFT to transfer in urn format.
77
- * @param recipient The recipient of the NFT.
74
+ * @param recipientIdentity The recipient identity for the NFT.
75
+ * @param recipientAddress The recipient address for the NFT.
78
76
  * @param metadata Optional mutable data to include during the transfer.
79
77
  * @returns Nothing.
80
78
  */
81
- async transfer(id, recipient, metadata) {
79
+ async transfer(id, recipientIdentity, recipientAddress, metadata) {
82
80
  core.Guards.stringValue(this.CLASS_NAME, "id", id);
83
- core.Guards.stringValue(this.CLASS_NAME, "recipient", recipient);
81
+ core.Guards.stringValue(this.CLASS_NAME, "recipientIdentity", recipientIdentity);
82
+ core.Guards.stringValue(this.CLASS_NAME, "recipientAddress", recipientAddress);
84
83
  await this.fetch("/:id/transfer", "POST", {
85
84
  pathParams: {
86
85
  id
87
86
  },
88
87
  body: {
89
- recipient,
88
+ recipientIdentity,
89
+ recipientAddress,
90
90
  metadata
91
91
  }
92
92
  });
@@ -21,19 +21,16 @@ class NftClient extends BaseRestClient {
21
21
  }
22
22
  /**
23
23
  * Mint an NFT.
24
- * @param issuer The issuer for the NFT, will also be the initial owner.
25
24
  * @param tag The tag for the NFT.
26
25
  * @param immutableMetadata The immutable metadata for the NFT.
27
26
  * @param metadata The metadata for the NFT.
28
27
  * @param namespace The namespace of the connector to use for the NFT, defaults to component configured namespace.
29
28
  * @returns The id of the created NFT in urn format.
30
29
  */
31
- async mint(issuer, tag, immutableMetadata, metadata, namespace) {
32
- Guards.stringValue(this.CLASS_NAME, "issuer", issuer);
30
+ async mint(tag, immutableMetadata, metadata, namespace) {
33
31
  Guards.stringValue(this.CLASS_NAME, "tag", tag);
34
32
  const response = await this.fetch("/", "POST", {
35
33
  body: {
36
- issuer,
37
34
  tag,
38
35
  immutableMetadata,
39
36
  metadata,
@@ -72,19 +69,22 @@ class NftClient extends BaseRestClient {
72
69
  /**
73
70
  * Transfer an NFT.
74
71
  * @param id The id of the NFT to transfer in urn format.
75
- * @param recipient The recipient of the NFT.
72
+ * @param recipientIdentity The recipient identity for the NFT.
73
+ * @param recipientAddress The recipient address for the NFT.
76
74
  * @param metadata Optional mutable data to include during the transfer.
77
75
  * @returns Nothing.
78
76
  */
79
- async transfer(id, recipient, metadata) {
77
+ async transfer(id, recipientIdentity, recipientAddress, metadata) {
80
78
  Guards.stringValue(this.CLASS_NAME, "id", id);
81
- Guards.stringValue(this.CLASS_NAME, "recipient", recipient);
79
+ Guards.stringValue(this.CLASS_NAME, "recipientIdentity", recipientIdentity);
80
+ Guards.stringValue(this.CLASS_NAME, "recipientAddress", recipientAddress);
82
81
  await this.fetch("/:id/transfer", "POST", {
83
82
  pathParams: {
84
83
  id
85
84
  },
86
85
  body: {
87
- recipient,
86
+ recipientIdentity,
87
+ recipientAddress,
88
88
  metadata
89
89
  }
90
90
  });
@@ -16,14 +16,13 @@ export declare class NftClient extends BaseRestClient implements INftComponent {
16
16
  constructor(config: IBaseRestClientConfig);
17
17
  /**
18
18
  * Mint an NFT.
19
- * @param issuer The issuer for the NFT, will also be the initial owner.
20
19
  * @param tag The tag for the NFT.
21
20
  * @param immutableMetadata The immutable metadata for the NFT.
22
21
  * @param metadata The metadata for the NFT.
23
22
  * @param namespace The namespace of the connector to use for the NFT, defaults to component configured namespace.
24
23
  * @returns The id of the created NFT in urn format.
25
24
  */
26
- mint<T = unknown, U = unknown>(issuer: string, tag: string, immutableMetadata?: T, metadata?: U, namespace?: string): Promise<string>;
25
+ mint<T = unknown, U = unknown>(tag: string, immutableMetadata?: T, metadata?: U, namespace?: string): Promise<string>;
27
26
  /**
28
27
  * Resolve an NFT.
29
28
  * @param id The id of the NFT to resolve.
@@ -45,16 +44,17 @@ export declare class NftClient extends BaseRestClient implements INftComponent {
45
44
  /**
46
45
  * Transfer an NFT.
47
46
  * @param id The id of the NFT to transfer in urn format.
48
- * @param recipient The recipient of the NFT.
47
+ * @param recipientIdentity The recipient identity for the NFT.
48
+ * @param recipientAddress The recipient address for the NFT.
49
49
  * @param metadata Optional mutable data to include during the transfer.
50
50
  * @returns Nothing.
51
51
  */
52
- transfer<T = unknown>(id: string, recipient: string, metadata?: T): Promise<void>;
52
+ transfer<T = unknown>(id: string, recipientIdentity: string, recipientAddress: string, metadata?: T): Promise<void>;
53
53
  /**
54
54
  * Update the data of the NFT.
55
55
  * @param id The id of the NFT to update in urn format.
56
56
  * @param metadata The mutable data to update.
57
57
  * @returns Nothing.
58
58
  */
59
- update<T = unknown>(id: string, metadata: T): Promise<void>;
59
+ update<U = unknown>(id: string, metadata: U): Promise<void>;
60
60
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,160 @@
1
1
  # @twin.org/nft-rest-client - Changelog
2
2
 
3
- ## v0.0.1-next.9
3
+ ## [0.0.2-next.1](https://github.com/twinfoundation/nft/compare/nft-rest-client-v0.0.2-next.0...nft-rest-client-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
+
12
+ ### Dependencies
13
+
14
+ * The following workspace dependencies were updated
15
+ * dependencies
16
+ * @twin.org/nft-models bumped from 0.0.2-next.0 to 0.0.2-next.1
17
+
18
+ ## 0.0.1 (2025-07-09)
19
+
20
+
21
+ ### Features
22
+
23
+ * release to production ([4d338b3](https://github.com/twinfoundation/nft/commit/4d338b3e8a4dbccc61a1d1da3c470ba86cefe535))
24
+
25
+
26
+ ### Dependencies
27
+
28
+ * The following workspace dependencies were updated
29
+ * dependencies
30
+ * @twin.org/nft-models bumped from ^0.0.0 to ^0.0.1
31
+
32
+ ## [0.0.1-next.32](https://github.com/twinfoundation/nft/compare/nft-rest-client-v0.0.1-next.31...nft-rest-client-v0.0.1-next.32) (2025-06-24)
33
+
34
+
35
+ ### Miscellaneous Chores
36
+
37
+ * **nft-rest-client:** Synchronize repo versions
38
+
39
+
40
+ ### Dependencies
41
+
42
+ * The following workspace dependencies were updated
43
+ * dependencies
44
+ * @twin.org/nft-models bumped from 0.0.1-next.31 to 0.0.1-next.32
45
+
46
+ ## [0.0.1-next.31](https://github.com/twinfoundation/nft/compare/nft-rest-client-v0.0.1-next.30...nft-rest-client-v0.0.1-next.31) (2025-06-12)
47
+
48
+
49
+ ### Features
50
+
51
+ * update dependencies ([8660f76](https://github.com/twinfoundation/nft/commit/8660f76ca324b0f476e45544cac6bee4b3146c3b))
52
+
53
+
54
+ ### Dependencies
55
+
56
+ * The following workspace dependencies were updated
57
+ * dependencies
58
+ * @twin.org/nft-models bumped from 0.0.1-next.30 to 0.0.1-next.31
59
+
60
+ ## [0.0.1-next.30](https://github.com/twinfoundation/nft/compare/nft-rest-client-v0.0.1-next.29...nft-rest-client-v0.0.1-next.30) (2025-05-22)
61
+
62
+
63
+ ### Miscellaneous Chores
64
+
65
+ * **nft-rest-client:** Synchronize repo versions
66
+
67
+
68
+ ### Dependencies
69
+
70
+ * The following workspace dependencies were updated
71
+ * dependencies
72
+ * @twin.org/nft-models bumped from 0.0.1-next.29 to 0.0.1-next.30
73
+
74
+ ## [0.0.1-next.29](https://github.com/twinfoundation/nft/compare/nft-rest-client-v0.0.1-next.28...nft-rest-client-v0.0.1-next.29) (2025-05-21)
75
+
76
+
77
+ ### Miscellaneous Chores
78
+
79
+ * **nft-rest-client:** Synchronize repo versions
80
+
81
+
82
+ ### Dependencies
83
+
84
+ * The following workspace dependencies were updated
85
+ * dependencies
86
+ * @twin.org/nft-models bumped from 0.0.1-next.28 to 0.0.1-next.29
87
+
88
+ ## [0.0.1-next.28](https://github.com/twinfoundation/nft/compare/nft-rest-client-v0.0.1-next.27...nft-rest-client-v0.0.1-next.28) (2025-05-06)
89
+
90
+
91
+ ### Miscellaneous Chores
92
+
93
+ * **nft-rest-client:** Synchronize repo versions
94
+
95
+
96
+ ### Dependencies
97
+
98
+ * The following workspace dependencies were updated
99
+ * dependencies
100
+ * @twin.org/nft-models bumped from 0.0.1-next.27 to 0.0.1-next.28
101
+
102
+ ## [0.0.1-next.27](https://github.com/twinfoundation/nft/compare/nft-rest-client-v0.0.1-next.26...nft-rest-client-v0.0.1-next.27) (2025-04-24)
103
+
104
+
105
+ ### Miscellaneous Chores
106
+
107
+ * **nft-rest-client:** Synchronize repo versions
108
+
109
+
110
+ ### Dependencies
111
+
112
+ * The following workspace dependencies were updated
113
+ * dependencies
114
+ * @twin.org/nft-models bumped from 0.0.1-next.26 to 0.0.1-next.27
115
+
116
+ ## [0.0.1-next.26](https://github.com/twinfoundation/nft/compare/nft-rest-client-v0.0.1-next.25...nft-rest-client-v0.0.1-next.26) (2025-04-17)
117
+
118
+
119
+ ### Features
120
+
121
+ * use shared store mechanism ([#16](https://github.com/twinfoundation/nft/issues/16)) ([897bc78](https://github.com/twinfoundation/nft/commit/897bc7805248ba1388b2dd03df24c33f1633f344))
122
+
123
+
124
+ ### Dependencies
125
+
126
+ * The following workspace dependencies were updated
127
+ * dependencies
128
+ * @twin.org/nft-models bumped from 0.0.1-next.25 to 0.0.1-next.26
129
+
130
+ ## [0.0.1-next.25](https://github.com/twinfoundation/nft/compare/nft-rest-client-v0.0.1-next.24...nft-rest-client-v0.0.1-next.25) (2025-04-17)
131
+
132
+
133
+ ### Miscellaneous Chores
134
+
135
+ * **nft-rest-client:** Synchronize repo versions
136
+
137
+
138
+ ### Dependencies
139
+
140
+ * The following workspace dependencies were updated
141
+ * dependencies
142
+ * @twin.org/nft-models bumped from 0.0.1-next.24 to 0.0.1-next.25
143
+
144
+ ## [0.0.1-next.24](https://github.com/twinfoundation/nft/compare/nft-rest-client-v0.0.1-next.23...nft-rest-client-v0.0.1-next.24) (2025-03-28)
145
+
146
+
147
+ ### Miscellaneous Chores
148
+
149
+ * **nft-rest-client:** Synchronize repo versions
150
+
151
+
152
+ ### Dependencies
153
+
154
+ * The following workspace dependencies were updated
155
+ * dependencies
156
+ * @twin.org/nft-models bumped from 0.0.1-next.23 to 0.0.1-next.24
157
+
158
+ ## v0.0.1-next.23
4
159
 
5
160
  - Initial Release
@@ -12,9 +12,9 @@ Client for performing NFT through to REST endpoints.
12
12
 
13
13
  ## Constructors
14
14
 
15
- ### new NftClient()
15
+ ### Constructor
16
16
 
17
- > **new NftClient**(`config`): [`NftClient`](NftClient.md)
17
+ > **new NftClient**(`config`): `NftClient`
18
18
 
19
19
  Create a new instance of NftClient.
20
20
 
@@ -28,7 +28,7 @@ The configuration for the client.
28
28
 
29
29
  #### Returns
30
30
 
31
- [`NftClient`](NftClient.md)
31
+ `NftClient`
32
32
 
33
33
  #### Overrides
34
34
 
@@ -50,23 +50,21 @@ Runtime name for the class.
50
50
 
51
51
  ### mint()
52
52
 
53
- > **mint**\<`T`, `U`\>(`issuer`, `tag`, `immutableMetadata`?, `metadata`?, `namespace`?): `Promise`\<`string`\>
53
+ > **mint**\<`T`, `U`\>(`tag`, `immutableMetadata?`, `metadata?`, `namespace?`): `Promise`\<`string`\>
54
54
 
55
55
  Mint an NFT.
56
56
 
57
57
  #### Type Parameters
58
58
 
59
- **T** = `unknown`
59
+ ##### T
60
60
 
61
- **U** = `unknown`
61
+ `T` = `unknown`
62
62
 
63
- #### Parameters
64
-
65
- ##### issuer
63
+ ##### U
66
64
 
67
- `string`
65
+ `U` = `unknown`
68
66
 
69
- The issuer for the NFT, will also be the initial owner.
67
+ #### Parameters
70
68
 
71
69
  ##### tag
72
70
 
@@ -106,15 +104,19 @@ The id of the created NFT in urn format.
106
104
 
107
105
  ### resolve()
108
106
 
109
- > **resolve**\<`T`, `U`\>(`id`): `Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata`: `T`; `metadata`: `U`; \}\>
107
+ > **resolve**\<`T`, `U`\>(`id`): `Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata?`: `T`; `metadata?`: `U`; \}\>
110
108
 
111
109
  Resolve an NFT.
112
110
 
113
111
  #### Type Parameters
114
112
 
115
- **T** = `unknown`
113
+ ##### T
116
114
 
117
- **U** = `unknown`
115
+ `T` = `unknown`
116
+
117
+ ##### U
118
+
119
+ `U` = `unknown`
118
120
 
119
121
  #### Parameters
120
122
 
@@ -126,7 +128,7 @@ The id of the NFT to resolve.
126
128
 
127
129
  #### Returns
128
130
 
129
- `Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata`: `T`; `metadata`: `U`; \}\>
131
+ `Promise`\<\{ `issuer`: `string`; `owner`: `string`; `tag`: `string`; `immutableMetadata?`: `T`; `metadata?`: `U`; \}\>
130
132
 
131
133
  The data for the NFT.
132
134
 
@@ -164,13 +166,15 @@ Nothing.
164
166
 
165
167
  ### transfer()
166
168
 
167
- > **transfer**\<`T`\>(`id`, `recipient`, `metadata`?): `Promise`\<`void`\>
169
+ > **transfer**\<`T`\>(`id`, `recipientIdentity`, `recipientAddress`, `metadata?`): `Promise`\<`void`\>
168
170
 
169
171
  Transfer an NFT.
170
172
 
171
173
  #### Type Parameters
172
174
 
173
- **T** = `unknown`
175
+ ##### T
176
+
177
+ `T` = `unknown`
174
178
 
175
179
  #### Parameters
176
180
 
@@ -180,11 +184,17 @@ Transfer an NFT.
180
184
 
181
185
  The id of the NFT to transfer in urn format.
182
186
 
183
- ##### recipient
187
+ ##### recipientIdentity
184
188
 
185
189
  `string`
186
190
 
187
- The recipient of the NFT.
191
+ The recipient identity for the NFT.
192
+
193
+ ##### recipientAddress
194
+
195
+ `string`
196
+
197
+ The recipient address for the NFT.
188
198
 
189
199
  ##### metadata?
190
200
 
@@ -206,13 +216,15 @@ Nothing.
206
216
 
207
217
  ### update()
208
218
 
209
- > **update**\<`T`\>(`id`, `metadata`): `Promise`\<`void`\>
219
+ > **update**\<`U`\>(`id`, `metadata`): `Promise`\<`void`\>
210
220
 
211
221
  Update the data of the NFT.
212
222
 
213
223
  #### Type Parameters
214
224
 
215
- **T** = `unknown`
225
+ ##### U
226
+
227
+ `U` = `unknown`
216
228
 
217
229
  #### Parameters
218
230
 
@@ -224,7 +236,7 @@ The id of the NFT to update in urn format.
224
236
 
225
237
  ##### metadata
226
238
 
227
- `T`
239
+ `U`
228
240
 
229
241
  The mutable data to update.
230
242
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/nft-rest-client",
3
- "version": "0.0.1-next.9",
3
+ "version": "0.0.2-next.1",
4
4
  "description": "NFT contract implementation which can connect to REST endpoints",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,7 +19,7 @@
19
19
  "@twin.org/core": "next",
20
20
  "@twin.org/entity": "next",
21
21
  "@twin.org/nameof": "next",
22
- "@twin.org/nft-models": "0.0.1-next.9",
22
+ "@twin.org/nft-models": "0.0.2-next.1",
23
23
  "@twin.org/web": "next"
24
24
  },
25
25
  "main": "./dist/cjs/index.cjs",
@@ -27,9 +27,9 @@
27
27
  "types": "./dist/types/index.d.ts",
28
28
  "exports": {
29
29
  ".": {
30
+ "types": "./dist/types/index.d.ts",
30
31
  "require": "./dist/cjs/index.cjs",
31
- "import": "./dist/esm/index.mjs",
32
- "types": "./dist/types/index.d.ts"
32
+ "import": "./dist/esm/index.mjs"
33
33
  },
34
34
  "./locales/*.json": "./locales/*.json"
35
35
  },