@dynamic-labs/sdk-api 0.0.614 → 0.0.616
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/package.json +1 -1
- package/src/apis/SDKApi.cjs +36 -0
- package/src/apis/SDKApi.d.ts +13 -0
- package/src/apis/SDKApi.js +36 -0
- package/src/apis/UsersApi.cjs +161 -4
- package/src/apis/UsersApi.d.ts +51 -0
- package/src/apis/UsersApi.js +161 -4
- package/src/apis/WalletsApi.cjs +162 -4
- package/src/apis/WalletsApi.d.ts +51 -0
- package/src/apis/WalletsApi.js +162 -4
- package/src/models/ImportWaasPrivateKeyRequest.cjs +7 -7
- package/src/models/ImportWaasPrivateKeyRequest.js +7 -7
package/src/apis/WalletsApi.js
CHANGED
|
@@ -169,6 +169,9 @@ class WalletsApi extends BaseAPI {
|
|
|
169
169
|
*/
|
|
170
170
|
createWalletRaw(requestParameters, initOverrides) {
|
|
171
171
|
return __awaiter(this, void 0, void 0, function* () {
|
|
172
|
+
if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
|
|
173
|
+
throw new RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling createWallet.');
|
|
174
|
+
}
|
|
172
175
|
if (requestParameters.userId === null || requestParameters.userId === undefined) {
|
|
173
176
|
throw new RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling createWallet.');
|
|
174
177
|
}
|
|
@@ -186,7 +189,7 @@ class WalletsApi extends BaseAPI {
|
|
|
186
189
|
}
|
|
187
190
|
}
|
|
188
191
|
const response = yield this.request({
|
|
189
|
-
path: `/users/{userId}/wallets`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
|
|
192
|
+
path: `/environments/{environmentId}/users/{userId}/wallets`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
|
|
190
193
|
method: 'POST',
|
|
191
194
|
headers: headerParameters,
|
|
192
195
|
query: queryParameters,
|
|
@@ -205,11 +208,56 @@ class WalletsApi extends BaseAPI {
|
|
|
205
208
|
return yield response.value();
|
|
206
209
|
});
|
|
207
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Creates a new wallet for the user. Note that this API is not meant for creating embedded wallets. To create embedded wallets use the /embeddedWallets endpoint.
|
|
213
|
+
* Creates a new wallet for the user (deprecated - use /environments/{environmentId}/users/{userId}/wallets instead)
|
|
214
|
+
*/
|
|
215
|
+
createWalletLegacyRaw(requestParameters, initOverrides) {
|
|
216
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
+
if (requestParameters.userId === null || requestParameters.userId === undefined) {
|
|
218
|
+
throw new RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling createWalletLegacy.');
|
|
219
|
+
}
|
|
220
|
+
if (requestParameters.createWalletRequest === null || requestParameters.createWalletRequest === undefined) {
|
|
221
|
+
throw new RequiredError('createWalletRequest', 'Required parameter requestParameters.createWalletRequest was null or undefined when calling createWalletLegacy.');
|
|
222
|
+
}
|
|
223
|
+
const queryParameters = {};
|
|
224
|
+
const headerParameters = {};
|
|
225
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
226
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
227
|
+
const token = this.configuration.accessToken;
|
|
228
|
+
const tokenString = yield token("bearerAuth", []);
|
|
229
|
+
if (tokenString) {
|
|
230
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
const response = yield this.request({
|
|
234
|
+
path: `/users/{userId}/wallets`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
|
|
235
|
+
method: 'POST',
|
|
236
|
+
headers: headerParameters,
|
|
237
|
+
query: queryParameters,
|
|
238
|
+
body: CreateWalletRequestToJSON(requestParameters.createWalletRequest),
|
|
239
|
+
}, initOverrides);
|
|
240
|
+
return new JSONApiResponse(response, (jsonValue) => WalletFromJSON(jsonValue));
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Creates a new wallet for the user. Note that this API is not meant for creating embedded wallets. To create embedded wallets use the /embeddedWallets endpoint.
|
|
245
|
+
* Creates a new wallet for the user (deprecated - use /environments/{environmentId}/users/{userId}/wallets instead)
|
|
246
|
+
*/
|
|
247
|
+
createWalletLegacy(requestParameters, initOverrides) {
|
|
248
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
249
|
+
const response = yield this.createWalletLegacyRaw(requestParameters, initOverrides);
|
|
250
|
+
return yield response.value();
|
|
251
|
+
});
|
|
252
|
+
}
|
|
208
253
|
/**
|
|
209
254
|
* Delete wallet
|
|
210
255
|
*/
|
|
211
256
|
deleteWalletByIdRaw(requestParameters, initOverrides) {
|
|
212
257
|
return __awaiter(this, void 0, void 0, function* () {
|
|
258
|
+
if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
|
|
259
|
+
throw new RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling deleteWalletById.');
|
|
260
|
+
}
|
|
213
261
|
if (requestParameters.walletId === null || requestParameters.walletId === undefined) {
|
|
214
262
|
throw new RequiredError('walletId', 'Required parameter requestParameters.walletId was null or undefined when calling deleteWalletById.');
|
|
215
263
|
}
|
|
@@ -223,7 +271,7 @@ class WalletsApi extends BaseAPI {
|
|
|
223
271
|
}
|
|
224
272
|
}
|
|
225
273
|
const response = yield this.request({
|
|
226
|
-
path: `/wallets/{walletId}`.replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
|
|
274
|
+
path: `/environments/{environmentId}/wallets/{walletId}`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
|
|
227
275
|
method: 'DELETE',
|
|
228
276
|
headers: headerParameters,
|
|
229
277
|
query: queryParameters,
|
|
@@ -239,11 +287,48 @@ class WalletsApi extends BaseAPI {
|
|
|
239
287
|
yield this.deleteWalletByIdRaw(requestParameters, initOverrides);
|
|
240
288
|
});
|
|
241
289
|
}
|
|
290
|
+
/**
|
|
291
|
+
* Delete wallet (deprecated - use /environments/{environmentId}/wallets/{walletId} instead)
|
|
292
|
+
*/
|
|
293
|
+
deleteWalletByIdLegacyRaw(requestParameters, initOverrides) {
|
|
294
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
295
|
+
if (requestParameters.walletId === null || requestParameters.walletId === undefined) {
|
|
296
|
+
throw new RequiredError('walletId', 'Required parameter requestParameters.walletId was null or undefined when calling deleteWalletByIdLegacy.');
|
|
297
|
+
}
|
|
298
|
+
const queryParameters = {};
|
|
299
|
+
const headerParameters = {};
|
|
300
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
301
|
+
const token = this.configuration.accessToken;
|
|
302
|
+
const tokenString = yield token("bearerAuth", []);
|
|
303
|
+
if (tokenString) {
|
|
304
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
const response = yield this.request({
|
|
308
|
+
path: `/wallets/{walletId}`.replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
|
|
309
|
+
method: 'DELETE',
|
|
310
|
+
headers: headerParameters,
|
|
311
|
+
query: queryParameters,
|
|
312
|
+
}, initOverrides);
|
|
313
|
+
return new VoidApiResponse(response);
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Delete wallet (deprecated - use /environments/{environmentId}/wallets/{walletId} instead)
|
|
318
|
+
*/
|
|
319
|
+
deleteWalletByIdLegacy(requestParameters, initOverrides) {
|
|
320
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
321
|
+
yield this.deleteWalletByIdLegacyRaw(requestParameters, initOverrides);
|
|
322
|
+
});
|
|
323
|
+
}
|
|
242
324
|
/**
|
|
243
325
|
* Get a wallet using the ID
|
|
244
326
|
*/
|
|
245
327
|
getWalletByIdRaw(requestParameters, initOverrides) {
|
|
246
328
|
return __awaiter(this, void 0, void 0, function* () {
|
|
329
|
+
if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
|
|
330
|
+
throw new RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling getWalletById.');
|
|
331
|
+
}
|
|
247
332
|
if (requestParameters.walletId === null || requestParameters.walletId === undefined) {
|
|
248
333
|
throw new RequiredError('walletId', 'Required parameter requestParameters.walletId was null or undefined when calling getWalletById.');
|
|
249
334
|
}
|
|
@@ -257,7 +342,7 @@ class WalletsApi extends BaseAPI {
|
|
|
257
342
|
}
|
|
258
343
|
}
|
|
259
344
|
const response = yield this.request({
|
|
260
|
-
path: `/wallets/{walletId}`.replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
|
|
345
|
+
path: `/environments/{environmentId}/wallets/{walletId}`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
|
|
261
346
|
method: 'GET',
|
|
262
347
|
headers: headerParameters,
|
|
263
348
|
query: queryParameters,
|
|
@@ -274,11 +359,49 @@ class WalletsApi extends BaseAPI {
|
|
|
274
359
|
return yield response.value();
|
|
275
360
|
});
|
|
276
361
|
}
|
|
362
|
+
/**
|
|
363
|
+
* Get a wallet using the ID (deprecated - use /environments/{environmentId}/wallets/{walletId} instead)
|
|
364
|
+
*/
|
|
365
|
+
getWalletByIdLegacyRaw(requestParameters, initOverrides) {
|
|
366
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
367
|
+
if (requestParameters.walletId === null || requestParameters.walletId === undefined) {
|
|
368
|
+
throw new RequiredError('walletId', 'Required parameter requestParameters.walletId was null or undefined when calling getWalletByIdLegacy.');
|
|
369
|
+
}
|
|
370
|
+
const queryParameters = {};
|
|
371
|
+
const headerParameters = {};
|
|
372
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
373
|
+
const token = this.configuration.accessToken;
|
|
374
|
+
const tokenString = yield token("bearerAuth", []);
|
|
375
|
+
if (tokenString) {
|
|
376
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
const response = yield this.request({
|
|
380
|
+
path: `/wallets/{walletId}`.replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
|
|
381
|
+
method: 'GET',
|
|
382
|
+
headers: headerParameters,
|
|
383
|
+
query: queryParameters,
|
|
384
|
+
}, initOverrides);
|
|
385
|
+
return new JSONApiResponse(response, (jsonValue) => WalletFromJSON(jsonValue));
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Get a wallet using the ID (deprecated - use /environments/{environmentId}/wallets/{walletId} instead)
|
|
390
|
+
*/
|
|
391
|
+
getWalletByIdLegacy(requestParameters, initOverrides) {
|
|
392
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
393
|
+
const response = yield this.getWalletByIdLegacyRaw(requestParameters, initOverrides);
|
|
394
|
+
return yield response.value();
|
|
395
|
+
});
|
|
396
|
+
}
|
|
277
397
|
/**
|
|
278
398
|
* Get wallets by user
|
|
279
399
|
*/
|
|
280
400
|
getWalletsByUserIdRaw(requestParameters, initOverrides) {
|
|
281
401
|
return __awaiter(this, void 0, void 0, function* () {
|
|
402
|
+
if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
|
|
403
|
+
throw new RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling getWalletsByUserId.');
|
|
404
|
+
}
|
|
282
405
|
if (requestParameters.userId === null || requestParameters.userId === undefined) {
|
|
283
406
|
throw new RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling getWalletsByUserId.');
|
|
284
407
|
}
|
|
@@ -292,7 +415,7 @@ class WalletsApi extends BaseAPI {
|
|
|
292
415
|
}
|
|
293
416
|
}
|
|
294
417
|
const response = yield this.request({
|
|
295
|
-
path: `/users/{userId}/wallets`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
|
|
418
|
+
path: `/environments/{environmentId}/users/{userId}/wallets`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
|
|
296
419
|
method: 'GET',
|
|
297
420
|
headers: headerParameters,
|
|
298
421
|
query: queryParameters,
|
|
@@ -309,6 +432,41 @@ class WalletsApi extends BaseAPI {
|
|
|
309
432
|
return yield response.value();
|
|
310
433
|
});
|
|
311
434
|
}
|
|
435
|
+
/**
|
|
436
|
+
* Get wallets by user (deprecated - use /environments/{environmentId}/users/{userId}/wallets instead)
|
|
437
|
+
*/
|
|
438
|
+
getWalletsByUserIdLegacyRaw(requestParameters, initOverrides) {
|
|
439
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
440
|
+
if (requestParameters.userId === null || requestParameters.userId === undefined) {
|
|
441
|
+
throw new RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling getWalletsByUserIdLegacy.');
|
|
442
|
+
}
|
|
443
|
+
const queryParameters = {};
|
|
444
|
+
const headerParameters = {};
|
|
445
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
446
|
+
const token = this.configuration.accessToken;
|
|
447
|
+
const tokenString = yield token("bearerAuth", []);
|
|
448
|
+
if (tokenString) {
|
|
449
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
const response = yield this.request({
|
|
453
|
+
path: `/users/{userId}/wallets`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
|
|
454
|
+
method: 'GET',
|
|
455
|
+
headers: headerParameters,
|
|
456
|
+
query: queryParameters,
|
|
457
|
+
}, initOverrides);
|
|
458
|
+
return new JSONApiResponse(response, (jsonValue) => UserWalletsResponseFromJSON(jsonValue));
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Get wallets by user (deprecated - use /environments/{environmentId}/users/{userId}/wallets instead)
|
|
463
|
+
*/
|
|
464
|
+
getWalletsByUserIdLegacy(requestParameters, initOverrides) {
|
|
465
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
466
|
+
const response = yield this.getWalletsByUserIdLegacyRaw(requestParameters, initOverrides);
|
|
467
|
+
return yield response.value();
|
|
468
|
+
});
|
|
469
|
+
}
|
|
312
470
|
}
|
|
313
471
|
|
|
314
472
|
export { WalletsApi };
|
|
@@ -10,13 +10,13 @@ function ImportWaasPrivateKeyRequestFromJSON(json) {
|
|
|
10
10
|
return ImportWaasPrivateKeyRequestFromJSONTyped(json);
|
|
11
11
|
}
|
|
12
12
|
function ImportWaasPrivateKeyRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
13
|
-
if (json === undefined || json === null) {
|
|
13
|
+
if ((json === undefined) || (json === null)) {
|
|
14
14
|
return json;
|
|
15
15
|
}
|
|
16
16
|
return {
|
|
17
|
-
chain: ChainEnum.ChainEnumFromJSON(json['chain']),
|
|
18
|
-
clientKeygenIds: json['clientKeygenIds'],
|
|
19
|
-
thresholdSignatureScheme: ThresholdSignatureScheme.ThresholdSignatureSchemeFromJSON(json['thresholdSignatureScheme']),
|
|
17
|
+
'chain': ChainEnum.ChainEnumFromJSON(json['chain']),
|
|
18
|
+
'clientKeygenIds': json['clientKeygenIds'],
|
|
19
|
+
'thresholdSignatureScheme': ThresholdSignatureScheme.ThresholdSignatureSchemeFromJSON(json['thresholdSignatureScheme']),
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
function ImportWaasPrivateKeyRequestToJSON(value) {
|
|
@@ -27,9 +27,9 @@ function ImportWaasPrivateKeyRequestToJSON(value) {
|
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
29
|
return {
|
|
30
|
-
chain: ChainEnum.ChainEnumToJSON(value.chain),
|
|
31
|
-
clientKeygenIds: value.clientKeygenIds,
|
|
32
|
-
thresholdSignatureScheme: ThresholdSignatureScheme.ThresholdSignatureSchemeToJSON(value.thresholdSignatureScheme),
|
|
30
|
+
'chain': ChainEnum.ChainEnumToJSON(value.chain),
|
|
31
|
+
'clientKeygenIds': value.clientKeygenIds,
|
|
32
|
+
'thresholdSignatureScheme': ThresholdSignatureScheme.ThresholdSignatureSchemeToJSON(value.thresholdSignatureScheme),
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -6,13 +6,13 @@ function ImportWaasPrivateKeyRequestFromJSON(json) {
|
|
|
6
6
|
return ImportWaasPrivateKeyRequestFromJSONTyped(json);
|
|
7
7
|
}
|
|
8
8
|
function ImportWaasPrivateKeyRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
9
|
-
if (json === undefined || json === null) {
|
|
9
|
+
if ((json === undefined) || (json === null)) {
|
|
10
10
|
return json;
|
|
11
11
|
}
|
|
12
12
|
return {
|
|
13
|
-
chain: ChainEnumFromJSON(json['chain']),
|
|
14
|
-
clientKeygenIds: json['clientKeygenIds'],
|
|
15
|
-
thresholdSignatureScheme: ThresholdSignatureSchemeFromJSON(json['thresholdSignatureScheme']),
|
|
13
|
+
'chain': ChainEnumFromJSON(json['chain']),
|
|
14
|
+
'clientKeygenIds': json['clientKeygenIds'],
|
|
15
|
+
'thresholdSignatureScheme': ThresholdSignatureSchemeFromJSON(json['thresholdSignatureScheme']),
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
function ImportWaasPrivateKeyRequestToJSON(value) {
|
|
@@ -23,9 +23,9 @@ function ImportWaasPrivateKeyRequestToJSON(value) {
|
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
25
|
return {
|
|
26
|
-
chain: ChainEnumToJSON(value.chain),
|
|
27
|
-
clientKeygenIds: value.clientKeygenIds,
|
|
28
|
-
thresholdSignatureScheme: ThresholdSignatureSchemeToJSON(value.thresholdSignatureScheme),
|
|
26
|
+
'chain': ChainEnumToJSON(value.chain),
|
|
27
|
+
'clientKeygenIds': value.clientKeygenIds,
|
|
28
|
+
'thresholdSignatureScheme': ThresholdSignatureSchemeToJSON(value.thresholdSignatureScheme),
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
|