@getpara/user-management-client 1.4.4 → 1.5.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.
package/dist/cjs/index.js CHANGED
@@ -2,8 +2,34 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
6
  var __getProtoOf = Object.getPrototypeOf;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __spreadValues = (a, b) => {
11
+ for (var prop in b || (b = {}))
12
+ if (__hasOwnProp.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ if (__getOwnPropSymbols)
15
+ for (var prop of __getOwnPropSymbols(b)) {
16
+ if (__propIsEnum.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ }
19
+ return a;
20
+ };
21
+ var __objRest = (source, exclude) => {
22
+ var target = {};
23
+ for (var prop in source)
24
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
+ target[prop] = source[prop];
26
+ if (source != null && __getOwnPropSymbols)
27
+ for (var prop of __getOwnPropSymbols(source)) {
28
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
+ target[prop] = source[prop];
30
+ }
31
+ return target;
32
+ };
7
33
  var __export = (target, all) => {
8
34
  for (var name in all)
9
35
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -25,6 +51,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
51
  mod
26
52
  ));
27
53
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
54
+ var __async = (__this, __arguments, generator) => {
55
+ return new Promise((resolve, reject) => {
56
+ var fulfilled = (value) => {
57
+ try {
58
+ step(generator.next(value));
59
+ } catch (e) {
60
+ reject(e);
61
+ }
62
+ };
63
+ var rejected = (value) => {
64
+ try {
65
+ step(generator.throw(value));
66
+ } catch (e) {
67
+ reject(e);
68
+ }
69
+ };
70
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
71
+ step((generator = generator.apply(__this, __arguments)).next());
72
+ });
73
+ };
28
74
 
29
75
  // src/index.ts
30
76
  var src_exports = {};
@@ -165,15 +211,16 @@ var handleResponseSuccess = (response) => {
165
211
  throw new ParaApiError("Invalid status code");
166
212
  };
167
213
  var handleResponseError = (error) => {
214
+ var _a, _b, _c;
168
215
  if (error === null) throw new ParaApiError("Error is null");
169
216
  if (import_axios.default.isAxiosError(error)) {
170
- let message = error.response?.data ?? "Unknown error";
217
+ let message = (_b = (_a = error.response) == null ? void 0 : _a.data) != null ? _b : "Unknown error";
171
218
  if (error.code === "ERR_NETWORK") {
172
219
  message = "Connection error";
173
220
  } else if (error.code === "ERR_CANCELED") {
174
221
  message = "Connection canceled";
175
222
  }
176
- throw new ParaApiError(message, error.code, error.response.status, error.request?.responseURL);
223
+ throw new ParaApiError(message, error.code, error.response.status, (_c = error.request) == null ? void 0 : _c.responseURL);
177
224
  }
178
225
  throw new ParaApiError("Unknown error");
179
226
  };
@@ -187,233 +234,230 @@ var Client = class {
187
234
  retrieveSessionCookie,
188
235
  persistSessionCookie
189
236
  }) {
190
- this.createUser = async (body) => {
191
- const res = await this.baseRequest.post(`/users`, body);
237
+ this.createUser = (body) => __async(this, null, function* () {
238
+ const res = yield this.baseRequest.post(`/users`, body);
192
239
  return res.data;
193
- };
194
- this.checkUserExists = async (auth) => {
195
- const res = await this.baseRequest.get("/users/exists", {
196
- params: { ...auth }
240
+ });
241
+ this.checkUserExists = (auth) => __async(this, null, function* () {
242
+ const res = yield this.baseRequest.get("/users/exists", {
243
+ params: __spreadValues({}, auth)
197
244
  });
198
245
  return res;
199
- };
200
- this.verifyTelegram = async (authObject) => {
201
- return (await this.baseRequest.post("/users/telegram", {
246
+ });
247
+ this.verifyTelegram = (authObject) => __async(this, null, function* () {
248
+ return (yield this.baseRequest.post("/users/telegram", {
202
249
  authObject
203
250
  })).data;
204
- };
205
- this.externalWalletLogin = async (body) => {
206
- const res = await this.baseRequest.post(`/users/external-wallets/login`, body);
251
+ });
252
+ this.externalWalletLogin = (body) => __async(this, null, function* () {
253
+ const res = yield this.baseRequest.post(`/users/external-wallets/login`, body);
207
254
  return res.data;
208
- };
255
+ });
209
256
  // POST /users/:userId/verify-email
210
- this.verifyEmail = async (userId, body) => {
211
- const res = await this.baseRequest.post(`/users/${userId}/verify-email`, body);
257
+ this.verifyEmail = (userId, body) => __async(this, null, function* () {
258
+ const res = yield this.baseRequest.post(`/users/${userId}/verify-email`, body);
212
259
  return res;
213
- };
214
- this.verifyPhone = async (userId, body) => {
215
- const res = await this.baseRequest.post(`/users/${userId}/verify-identifier`, body);
260
+ });
261
+ this.verifyPhone = (userId, body) => __async(this, null, function* () {
262
+ const res = yield this.baseRequest.post(`/users/${userId}/verify-identifier`, body);
216
263
  return res;
217
- };
218
- this.verifyExternalWallet = async (userId, body) => {
219
- const res = await this.baseRequest.post(`/users/${userId}/external-wallets/verify`, body);
264
+ });
265
+ this.verifyExternalWallet = (userId, body) => __async(this, null, function* () {
266
+ const res = yield this.baseRequest.post(`/users/${userId}/external-wallets/verify`, body);
220
267
  return res;
221
- };
268
+ });
222
269
  // POST /users/:userId/biometrics/key
223
- this.addSessionPublicKey = async (userId, body) => {
224
- const res = await this.baseRequest.post(`/users/${userId}/biometrics/key`, body);
270
+ this.addSessionPublicKey = (userId, body) => __async(this, null, function* () {
271
+ const res = yield this.baseRequest.post(`/users/${userId}/biometrics/key`, body);
225
272
  return res;
226
- };
273
+ });
227
274
  // GET /users/:userId/biometrics/keys
228
- this.getSessionPublicKeys = async (userId) => {
229
- const res = await this.baseRequest.get(`/users/${userId}/biometrics/keys`);
275
+ this.getSessionPublicKeys = (userId) => __async(this, null, function* () {
276
+ const res = yield this.baseRequest.get(`/users/${userId}/biometrics/keys`);
230
277
  return res;
231
- };
278
+ });
232
279
  // GET /biometrics/location-hints
233
- this.getBiometricLocationHints = async (params) => {
234
- const res = await this.baseRequest.get(`/biometrics/location-hints`, { params });
280
+ this.getBiometricLocationHints = (params) => __async(this, null, function* () {
281
+ const res = yield this.baseRequest.get(`/biometrics/location-hints`, { params });
235
282
  return res.data.hints;
236
- };
283
+ });
237
284
  // GET /users/:userId/biometrics/:biometricId
238
- this.getSessionPublicKey = async (userId, biometricId) => {
239
- const res = await this.baseRequest.get(`/users/${userId}/biometrics/${biometricId}`);
285
+ this.getSessionPublicKey = (userId, biometricId) => __async(this, null, function* () {
286
+ const res = yield this.baseRequest.get(`/users/${userId}/biometrics/${biometricId}`);
240
287
  return res;
241
- };
288
+ });
242
289
  // PATCH /users/:userId/biometrics/:biometricId
243
- this.patchSessionPublicKey = async (partnerId, userId, biometricId, body) => {
244
- const res = await this.baseRequest.patch(`/users/${userId}/biometrics/${biometricId}`, body, {
290
+ this.patchSessionPublicKey = (partnerId, userId, biometricId, body) => __async(this, null, function* () {
291
+ const res = yield this.baseRequest.patch(`/users/${userId}/biometrics/${biometricId}`, body, {
245
292
  headers: {
246
293
  [PARTNER_ID_HEADER_NAME]: partnerId
247
294
  }
248
295
  });
249
296
  return res;
250
- };
297
+ });
251
298
  // GET /biometrics/challenge?email&publicKey
252
- this.getWebChallenge = async (auth) => {
253
- const res = await this.baseRequest.get("/biometrics/challenge", {
254
- params: { ...auth || {} }
299
+ this.getWebChallenge = (auth) => __async(this, null, function* () {
300
+ const res = yield this.baseRequest.get("/biometrics/challenge", {
301
+ params: __spreadValues({}, auth || {})
255
302
  });
256
303
  return res.data;
257
- };
304
+ });
258
305
  // POST /touch
259
- this.touchSession = async (regenerate) => {
260
- const res = await this.baseRequest.post(
306
+ this.touchSession = (regenerate) => __async(this, null, function* () {
307
+ const res = yield this.baseRequest.post(
261
308
  `/touch?regenerate=${!!regenerate}`
262
309
  );
263
310
  return res;
264
- };
311
+ });
265
312
  // GET /session/origin
266
- this.sessionOrigin = async (sessionLookupId) => {
267
- const res = await this.baseRequest.get(`/sessions/${sessionLookupId}/origin`);
313
+ this.sessionOrigin = (sessionLookupId) => __async(this, null, function* () {
314
+ const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/origin`);
268
315
  return res.data;
269
- };
316
+ });
270
317
  // POST /biometrics/verify
271
- this.verifyWebChallenge = async (partnerId, body) => {
272
- const res = await this.baseRequest.post(`/biometrics/verify`, body, {
318
+ this.verifyWebChallenge = (partnerId, body) => __async(this, null, function* () {
319
+ const res = yield this.baseRequest.post(`/biometrics/verify`, body, {
273
320
  headers: {
274
321
  [PARTNER_ID_HEADER_NAME]: partnerId
275
322
  }
276
323
  });
277
324
  return res;
278
- };
325
+ });
279
326
  // GET /users/:userId/biometrics/challenge
280
- this.getSessionChallenge = async (userId) => {
281
- const res = await this.baseRequest.get(`/users/${userId}/biometrics/challenge`);
327
+ this.getSessionChallenge = (userId) => __async(this, null, function* () {
328
+ const res = yield this.baseRequest.get(`/users/${userId}/biometrics/challenge`);
282
329
  return res;
283
- };
330
+ });
284
331
  // POST /users/:userId/biometrics/verify
285
- this.verifySessionChallenge = async (userId, body) => {
286
- const res = await this.baseRequest.post(`/users/${userId}/biometrics/verify`, body);
332
+ this.verifySessionChallenge = (userId, body) => __async(this, null, function* () {
333
+ const res = yield this.baseRequest.post(`/users/${userId}/biometrics/verify`, body);
287
334
  return res;
288
- };
335
+ });
289
336
  // POST /users/:userId/wallets
290
- this.createWallet = async (userId, body) => {
291
- const res = await this.baseRequest.post(`/users/${userId}/wallets`, body);
337
+ this.createWallet = (userId, body) => __async(this, null, function* () {
338
+ const res = yield this.baseRequest.post(`/users/${userId}/wallets`, body);
292
339
  return res.data;
293
- };
340
+ });
294
341
  // POST /wallets/pregen
295
- this.createPregenWallet = async (body) => {
296
- const res = await this.baseRequest.post(`/wallets/pregen`, body);
342
+ this.createPregenWallet = (body) => __async(this, null, function* () {
343
+ const res = yield this.baseRequest.post(`/wallets/pregen`, body);
297
344
  return res.data;
298
- };
345
+ });
299
346
  // GET /wallets/pregen?pregenIdentifier={pregenIdentifier}&pregenIdentifierType={pregenIdentifierType}
300
- this.getPregenWallets = async (pregenIds, isPortal = false, userId) => {
301
- const res = await this.baseRequest.get("/wallets/pregen", {
347
+ this.getPregenWallets = (pregenIds, isPortal = false, userId) => __async(this, null, function* () {
348
+ const res = yield this.baseRequest.get("/wallets/pregen", {
302
349
  params: { ids: pregenIds, expand: isPortal, userId }
303
350
  });
304
351
  return res.data;
305
- };
352
+ });
306
353
  // POST /wallets/pregen/claim
307
- this.claimPregenWallets = async (body) => {
308
- const res = await this.baseRequest.post(`/wallets/pregen/claim`, body);
354
+ this.claimPregenWallets = (body) => __async(this, null, function* () {
355
+ const res = yield this.baseRequest.post(`/wallets/pregen/claim`, body);
309
356
  return res.data;
310
- };
357
+ });
311
358
  // POST /users/:userId/wallets/:walletId/transactions/send
312
- this.sendTransaction = async (userId, walletId, body) => {
313
- const res = await this.baseRequest.post(`/users/${userId}/wallets/${walletId}/transactions/send`, body);
359
+ this.sendTransaction = (userId, walletId, body) => __async(this, null, function* () {
360
+ const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/transactions/send`, body);
314
361
  return res;
315
- };
362
+ });
316
363
  // functionality changed to only sign transactions and not send them
317
364
  // POST /users/:userId/wallets/:walletId/transactions/sign
318
- this.signTransaction = async (userId, walletId, body) => {
319
- const res = await this.baseRequest.post(`/users/${userId}/wallets/${walletId}/transactions/sign`, body);
365
+ this.signTransaction = (userId, walletId, body) => __async(this, null, function* () {
366
+ const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/transactions/sign`, body);
320
367
  return res;
321
- };
368
+ });
322
369
  // POST /users/:userId/wallets/:walletId/refresh
323
- this.refreshKeys = async (userId, walletId, oldPartnerId, newPartnerId, keyShareProtocolId) => {
370
+ this.refreshKeys = (userId, walletId, oldPartnerId, newPartnerId, keyShareProtocolId) => __async(this, null, function* () {
324
371
  const body = { oldPartnerId, newPartnerId, keyShareProtocolId };
325
- const res = await this.baseRequest.post(`/users/${userId}/wallets/${walletId}/refresh`, body);
372
+ const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/refresh`, body);
326
373
  return res;
327
- };
374
+ });
328
375
  // PATCH /wallets/pregen/:walletId
329
- this.updatePregenWallet = async (walletId, body) => {
330
- const res = await this.baseRequest.patch(`/wallets/pregen/${walletId}`, body);
376
+ this.updatePregenWallet = (walletId, body) => __async(this, null, function* () {
377
+ const res = yield this.baseRequest.patch(`/wallets/pregen/${walletId}`, body);
331
378
  return res.data;
332
- };
379
+ });
333
380
  // GET /users/:userId/wallets
334
- this.getWallets = async (userId, includePartnerData) => {
335
- const res = await this.baseRequest.get(
381
+ this.getWallets = (userId, includePartnerData) => __async(this, null, function* () {
382
+ const res = yield this.baseRequest.get(
336
383
  `/users/${userId}/wallets${includePartnerData ? `?includePartnerData=${encodeURIComponent(includePartnerData)}` : ""}`
337
384
  );
338
385
  return res;
339
- };
386
+ });
340
387
  // GET /users/:userId/all-wallets
341
- this.getAllWallets = async (userId) => {
342
- const res = await this.baseRequest.get(`/users/${userId}/all-wallets`);
388
+ this.getAllWallets = (userId) => __async(this, null, function* () {
389
+ const res = yield this.baseRequest.get(`/users/${userId}/all-wallets`);
343
390
  return res;
344
- };
391
+ });
345
392
  // POST /users/:userId/wallets/set
346
- this.setCurrentWalletIds = async (userId, walletIds, needsWallet = false, sessionLookupId, newDeviceSessionLookupId) => {
347
- const res = await this.baseRequest.post(`/users/${userId}/wallets/set`, {
393
+ this.setCurrentWalletIds = (userId, walletIds, needsWallet = false, sessionLookupId, newDeviceSessionLookupId) => __async(this, null, function* () {
394
+ const res = yield this.baseRequest.post(`/users/${userId}/wallets/set`, {
348
395
  walletIds,
349
396
  needsWallet,
350
397
  sessionLookupId,
351
398
  newDeviceSessionLookupId
352
399
  });
353
400
  return res;
354
- };
401
+ });
355
402
  // POST /login
356
- this.login = async (props) => {
403
+ this.login = (props) => __async(this, null, function* () {
357
404
  const body = props;
358
- const res = await this.baseRequest.post("/login", body);
405
+ const res = yield this.baseRequest.post("/login", body);
359
406
  return res;
360
- };
407
+ });
361
408
  // POST /login
362
- this.verifyLogin = async (verificationCode) => {
409
+ this.verifyLogin = (verificationCode) => __async(this, null, function* () {
363
410
  const body = { verificationCode };
364
- const res = await this.baseRequest.post("/login/verify-email", body);
411
+ const res = yield this.baseRequest.post("/login/verify-email", body);
365
412
  return res;
366
- };
413
+ });
367
414
  // GET /logout
368
- this.logout = async () => {
369
- const res = await this.baseRequest.get("/logout");
415
+ this.logout = () => __async(this, null, function* () {
416
+ const res = yield this.baseRequest.get("/logout");
370
417
  return res;
371
- };
418
+ });
372
419
  // POST /recovery/verification
373
- this.recoveryVerification = async (email, verificationCode) => {
420
+ this.recoveryVerification = (email, verificationCode) => __async(this, null, function* () {
374
421
  const body = { email, verificationCode };
375
- const res = await this.baseRequest.post("/recovery/verification", body);
422
+ const res = yield this.baseRequest.post("/recovery/verification", body);
376
423
  return res;
377
- };
424
+ });
378
425
  // POST /recovery
379
- this.recoveryInit = async (email) => {
426
+ this.recoveryInit = (email) => __async(this, null, function* () {
380
427
  const body = { email };
381
- const res = await this.baseRequest.post("/recovery", body);
428
+ const res = yield this.baseRequest.post("/recovery", body);
382
429
  return res;
383
- };
384
- this.preSignMessage = async (userId, walletId, message, scheme, cosmosSignDoc) => {
430
+ });
431
+ this.preSignMessage = (userId, walletId, message, scheme, cosmosSignDoc) => __async(this, null, function* () {
385
432
  const body = { message, scheme, cosmosSignDoc };
386
- const res = await this.baseRequest.post(`/users/${userId}/wallets/${walletId}/messages/sign`, body);
433
+ const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/messages/sign`, body);
387
434
  return res.data;
388
- };
435
+ });
389
436
  //DELETE /users/:userId
390
- this.deleteSelf = async (userId) => {
391
- const res = await this.baseRequest.delete(`/users/${userId}`);
437
+ this.deleteSelf = (userId) => __async(this, null, function* () {
438
+ const res = yield this.baseRequest.delete(`/users/${userId}`);
392
439
  return res;
393
- };
440
+ });
394
441
  // GET /users/:userId/wallets/:walletId/capsule-share
395
- this.getParaShare = async (userId, walletId) => {
396
- const res = await this.baseRequest.get(`/users/${userId}/wallets/${walletId}/capsule-share`);
442
+ this.getParaShare = (userId, walletId) => __async(this, null, function* () {
443
+ const res = yield this.baseRequest.get(`/users/${userId}/wallets/${walletId}/capsule-share`);
397
444
  return res.data.share;
398
- };
445
+ });
399
446
  // GET /download-backup-kit/:userId
400
- this.getBackupKit = async (userId) => {
401
- const res = await this.baseRequest.get(`/download-backup-kit/${userId}`, { responseType: "blob" });
447
+ this.getBackupKit = (userId) => __async(this, null, function* () {
448
+ const res = yield this.baseRequest.get(`/download-backup-kit/${userId}`, { responseType: "blob" });
402
449
  return res;
403
- };
450
+ });
404
451
  // PATCH /users/:userId/biometrics/:biometricId
405
- this.patchSessionPassword = async (partnerId, userId, passwordId, body) => {
406
- const res = await this.baseRequest.patch(`/users/${userId}/passwords/${passwordId}`, body, {
452
+ this.patchSessionPassword = (partnerId, userId, passwordId, body) => __async(this, null, function* () {
453
+ const res = yield this.baseRequest.patch(`/users/${userId}/passwords/${passwordId}`, body, {
407
454
  headers: {
408
455
  [PARTNER_ID_HEADER_NAME]: partnerId
409
456
  }
410
457
  });
411
458
  return res;
412
- };
413
- const headers = {
414
- ...apiKey && { [API_KEY_HEADER_NAME]: apiKey },
415
- ...partnerId && { [PARTNER_ID_HEADER_NAME]: partnerId }
416
- };
459
+ });
460
+ const headers = __spreadValues(__spreadValues({}, apiKey && { [API_KEY_HEADER_NAME]: apiKey }), partnerId && { [PARTNER_ID_HEADER_NAME]: partnerId });
417
461
  const axiosConfig = {
418
462
  baseURL: userManagementHost,
419
463
  withCredentials: true,
@@ -440,7 +484,7 @@ var Client = class {
440
484
  axiosConfig.transformResponse = [
441
485
  ...defaultTransformResponse,
442
486
  function(data, headers2, _status) {
443
- if (headers2?.[SESSION_COOKIE_HEADER_NAME]) {
487
+ if (headers2 == null ? void 0 : headers2[SESSION_COOKIE_HEADER_NAME]) {
444
488
  persistSessionCookie(headers2[SESSION_COOKIE_HEADER_NAME]);
445
489
  }
446
490
  return data;
@@ -448,7 +492,7 @@ var Client = class {
448
492
  ];
449
493
  }
450
494
  this.baseRequest = import_axios.default.create(axiosConfig);
451
- if (opts?.useFetchAdapter) {
495
+ if (opts == null ? void 0 : opts.useFetchAdapter) {
452
496
  import_axios.default.defaults.adapter = function(config) {
453
497
  return fetch(config.baseURL + config.url.substring(1), {
454
498
  method: config.method,
@@ -473,370 +517,491 @@ var Client = class {
473
517
  }
474
518
  // DEPRECATED: use uploadUserKeyShares instead
475
519
  // POST /users/:userId/wallets/:walletId/key-shares
476
- async uploadKeyshares(userId, walletId, encryptedKeyshares) {
477
- const body = { keyShares: encryptedKeyshares };
478
- const res = await this.baseRequest.post(`/users/${userId}/wallets/${walletId}/key-shares`, body);
479
- return res;
520
+ uploadKeyshares(userId, walletId, encryptedKeyshares) {
521
+ return __async(this, null, function* () {
522
+ const body = { keyShares: encryptedKeyshares };
523
+ const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/key-shares`, body);
524
+ return res;
525
+ });
480
526
  }
481
527
  // POST /users/:userId/key-shares
482
- async uploadUserKeyShares(userId, encryptedKeyshares) {
483
- const body = { keyShares: encryptedKeyshares };
484
- const res = await this.baseRequest.post(`/users/${userId}/key-shares`, body);
485
- return res;
528
+ uploadUserKeyShares(userId, encryptedKeyshares) {
529
+ return __async(this, null, function* () {
530
+ const body = { keyShares: encryptedKeyshares };
531
+ const res = yield this.baseRequest.post(`/users/${userId}/key-shares`, body);
532
+ return res;
533
+ });
486
534
  }
487
535
  // GET /users/:userId/wallets/:walletId/key-shares
488
- async getKeyshare(userId, walletId, type, encryptor) {
489
- const res = await this.baseRequest.get(
490
- `/users/${userId}/wallets/${walletId}/key-shares?type=${type}${encryptor ? `&encryptor=${encryptor}` : ""}`
491
- );
492
- return res;
536
+ getKeyshare(userId, walletId, type, encryptor) {
537
+ return __async(this, null, function* () {
538
+ const res = yield this.baseRequest.get(
539
+ `/users/${userId}/wallets/${walletId}/key-shares?type=${type}${encryptor ? `&encryptor=${encryptor}` : ""}`
540
+ );
541
+ return res;
542
+ });
493
543
  }
494
544
  // GET /users/:userId/biometrics/key-shares
495
- async getBiometricKeyshares(userId, biometricPublicKey, getAll) {
496
- const res = await this.baseRequest.get(
497
- `/users/${userId}/biometrics/key-shares?publicKey=${biometricPublicKey}&all=${!!getAll}`
498
- );
499
- return res;
545
+ getBiometricKeyshares(userId, biometricPublicKey, getAll) {
546
+ return __async(this, null, function* () {
547
+ const res = yield this.baseRequest.get(
548
+ `/users/${userId}/biometrics/key-shares?publicKey=${biometricPublicKey}&all=${!!getAll}`
549
+ );
550
+ return res;
551
+ });
500
552
  }
501
553
  // GET /users/:userId/key-shares
502
- async getPasswordKeyshares(userId, passwordId, getAll) {
503
- const res = await this.baseRequest.get(
504
- `/users/${userId}/passwords/key-shares?passwordId=${passwordId}&all=${!!getAll}`
505
- );
506
- return res;
554
+ getPasswordKeyshares(userId, passwordId, getAll) {
555
+ return __async(this, null, function* () {
556
+ const res = yield this.baseRequest.get(
557
+ `/users/${userId}/passwords/key-shares?passwordId=${passwordId}&all=${!!getAll}`
558
+ );
559
+ return res;
560
+ });
507
561
  }
508
562
  // POST '/users/:userId/temporary-shares',
509
- async uploadTransmissionKeyshares(userId, shares) {
510
- const body = { shares };
511
- const res = await this.baseRequest.post(`/users/${userId}/temporary-shares`, body);
512
- return res;
563
+ uploadTransmissionKeyshares(userId, shares) {
564
+ return __async(this, null, function* () {
565
+ const body = { shares };
566
+ const res = yield this.baseRequest.post(`/users/${userId}/temporary-shares`, body);
567
+ return res;
568
+ });
513
569
  }
514
570
  // GET /users/:userId/temporary-shares returns { temporaryShares: { userId: string, walletId: string, encryptedShare: string, encryptedKey?: string }[] }
515
- async getTransmissionKeyshares(userId, sessionLookupId) {
516
- const res = await this.baseRequest.get(`/users/${userId}/temporary-shares?sessionLookupId=${sessionLookupId}`);
517
- return res;
571
+ getTransmissionKeyshares(userId, sessionLookupId) {
572
+ return __async(this, null, function* () {
573
+ const res = yield this.baseRequest.get(`/users/${userId}/temporary-shares?sessionLookupId=${sessionLookupId}`);
574
+ return res;
575
+ });
518
576
  }
519
577
  // POST '/users/:userId/resend-verification-code
520
- async resendVerificationCode({ userId, ...rest }) {
521
- const res = await this.baseRequest.post(`/users/${userId}/resend-verification-code`, rest);
522
- return res;
578
+ resendVerificationCode(_a) {
579
+ return __async(this, null, function* () {
580
+ var _b = _a, { userId } = _b, rest = __objRest(_b, ["userId"]);
581
+ const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code`, rest);
582
+ return res;
583
+ });
523
584
  }
524
585
  // POST '/users/:userId/resend-verification-code-by-phone
525
- async resendVerificationCodeByPhone({ userId, ...rest }) {
526
- const res = await this.baseRequest.post(`/users/${userId}/resend-verification-code-by-phone`, rest);
527
- return res;
586
+ resendVerificationCodeByPhone(_c) {
587
+ return __async(this, null, function* () {
588
+ var _d = _c, { userId } = _d, rest = __objRest(_d, ["userId"]);
589
+ const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code-by-phone`, rest);
590
+ return res;
591
+ });
528
592
  }
529
593
  // POST recovery/cancel
530
- async cancelRecoveryAttempt(email) {
531
- const res = await this.baseRequest.post(`/recovery/cancel`, { email });
532
- return res;
594
+ cancelRecoveryAttempt(email) {
595
+ return __async(this, null, function* () {
596
+ const res = yield this.baseRequest.post(`/recovery/cancel`, { email });
597
+ return res;
598
+ });
533
599
  }
534
600
  // GET '/2fa/users/:userId/check-status'
535
- async check2FAStatus(userId) {
536
- const res = await this.baseRequest.get(`/2fa/users/${userId}/check-status`);
537
- return res;
601
+ check2FAStatus(userId) {
602
+ return __async(this, null, function* () {
603
+ const res = yield this.baseRequest.get(`/2fa/users/${userId}/check-status`);
604
+ return res;
605
+ });
538
606
  }
539
607
  // POST '/2fa/users/:userId/enable'
540
- async enable2FA(userId, verificationCode) {
541
- const res = await this.baseRequest.post(`/2fa/users/${userId}/enable`, { verificationCode });
542
- return res;
608
+ enable2FA(userId, verificationCode) {
609
+ return __async(this, null, function* () {
610
+ const res = yield this.baseRequest.post(`/2fa/users/${userId}/enable`, { verificationCode });
611
+ return res;
612
+ });
543
613
  }
544
614
  // POST '/2fa/users/:userId/setup'
545
- async setup2FA(userId) {
546
- const res = await this.baseRequest.post(`/2fa/users/${userId}/setup`);
547
- return res;
615
+ setup2FA(userId) {
616
+ return __async(this, null, function* () {
617
+ const res = yield this.baseRequest.post(`/2fa/users/${userId}/setup`);
618
+ return res;
619
+ });
548
620
  }
549
621
  // POST /recovery/init
550
- async initializeRecovery(email) {
551
- const res = await this.baseRequest.post(`/recovery/init`, { email });
552
- return res;
622
+ initializeRecovery(email) {
623
+ return __async(this, null, function* () {
624
+ const res = yield this.baseRequest.post(`/recovery/init`, { email });
625
+ return res;
626
+ });
553
627
  }
554
628
  // POST /auth/farcaster/init
555
- async initializeFarcasterLogin() {
556
- const res = await this.baseRequest.post(`/auth/farcaster/init`);
557
- return res;
629
+ initializeFarcasterLogin() {
630
+ return __async(this, null, function* () {
631
+ const res = yield this.baseRequest.post(`/auth/farcaster/init`);
632
+ return res;
633
+ });
558
634
  }
559
635
  // POST /auth/farcaster/status
560
- async getFarcasterAuthStatus() {
561
- const res = await this.baseRequest.post(`/auth/farcaster/status`);
562
- return res;
636
+ getFarcasterAuthStatus() {
637
+ return __async(this, null, function* () {
638
+ const res = yield this.baseRequest.post(`/auth/farcaster/status`);
639
+ return res;
640
+ });
563
641
  }
564
642
  // POST /recovery/init
565
- async initializeRecoveryForPhone(phone, countryCode) {
566
- const res = await this.baseRequest.post(`/recovery/init`, { phone, countryCode });
567
- return res;
643
+ initializeRecoveryForPhone(phone, countryCode) {
644
+ return __async(this, null, function* () {
645
+ const res = yield this.baseRequest.post(`/recovery/init`, { phone, countryCode });
646
+ return res;
647
+ });
568
648
  }
569
649
  // POST /recovery/users/:userId/wallets/:walletId/finish
570
- async finalizeRecovery(userId, walletId) {
571
- const res = await this.baseRequest.post(`/recovery/users/${userId}/wallets/${walletId}/finish`);
572
- return res;
650
+ finalizeRecovery(userId, walletId) {
651
+ return __async(this, null, function* () {
652
+ const res = yield this.baseRequest.post(`/recovery/users/${userId}/wallets/${walletId}/finish`);
653
+ return res;
654
+ });
573
655
  }
574
656
  // GET /recovery/users/:userId/wallets/:walletId/key-shares
575
- async recoverUserShares(userId, walletId) {
576
- const res = await this.baseRequest.get(`/recovery/users/${userId}/wallets/${walletId}/key-shares?type=USER&encryptor=RECOVERY`);
577
- return res;
657
+ recoverUserShares(userId, walletId) {
658
+ return __async(this, null, function* () {
659
+ const res = yield this.baseRequest.get(`/recovery/users/${userId}/wallets/${walletId}/key-shares?type=USER&encryptor=RECOVERY`);
660
+ return res;
661
+ });
578
662
  }
579
663
  // POST /recovery/verify-email
580
- async verifyEmailForRecovery(email, verificationCode) {
581
- const body = { email, verificationCode };
582
- const res = await this.baseRequest.post(`/recovery/verify-email`, body);
583
- return res;
664
+ verifyEmailForRecovery(email, verificationCode) {
665
+ return __async(this, null, function* () {
666
+ const body = { email, verificationCode };
667
+ const res = yield this.baseRequest.post(`/recovery/verify-email`, body);
668
+ return res;
669
+ });
584
670
  }
585
671
  // POST /recovery/verify-identifier
586
- async verifyPhoneForRecovery(phone, countryCode, verificationCode) {
587
- const body = { phone, countryCode, verificationCode };
588
- const res = await this.baseRequest.post(`/recovery/verify-identifier`, body);
589
- return res;
672
+ verifyPhoneForRecovery(phone, countryCode, verificationCode) {
673
+ return __async(this, null, function* () {
674
+ const body = { phone, countryCode, verificationCode };
675
+ const res = yield this.baseRequest.post(`/recovery/verify-identifier`, body);
676
+ return res;
677
+ });
590
678
  }
591
679
  // POST /2fa/verify
592
- async verify2FA(email, verificationCode) {
593
- const body = { email, verificationCode };
594
- const res = await this.baseRequest.post("/2fa/verify", body);
595
- return res;
680
+ verify2FA(email, verificationCode) {
681
+ return __async(this, null, function* () {
682
+ const body = { email, verificationCode };
683
+ const res = yield this.baseRequest.post("/2fa/verify", body);
684
+ return res;
685
+ });
596
686
  }
597
687
  // POST /2fa/phone/verify
598
- async verify2FAForPhone(phone, countryCode, verificationCode) {
599
- const body = { phone, countryCode, verificationCode };
600
- const res = await this.baseRequest.post("/2fa/verify", body);
601
- return res;
602
- }
603
- async tempTrasmissionInit(message, userId) {
604
- const body = { message, userId };
605
- const res = await this.baseRequest.post("/temporary-transmissions", body);
606
- return res;
607
- }
608
- async tempTrasmission(id) {
609
- const res = await this.baseRequest.get(`/temporary-transmissions/${id}`);
610
- return res;
611
- }
612
- async getPartner(partnerId) {
613
- const res = await this.baseRequest.get(`/partners/${partnerId}`);
614
- return res;
615
- }
616
- async acceptScopes(userId, walletId, body) {
617
- const res = await this.baseRequest.post(`/users/${userId}/wallets/${walletId}/scopes/accept`, body);
618
- return res;
619
- }
620
- async getPendingTransaction(userId, pendingTransactionId) {
621
- const res = await this.baseRequest.get(`/users/${userId}/pending-transactions/${pendingTransactionId}`);
622
- return res;
623
- }
624
- async acceptPendingTransaction(userId, pendingTransactionId) {
625
- const res = await this.baseRequest.post(`/users/${userId}/pending-transactions/${pendingTransactionId}/accept`);
626
- return res;
627
- }
628
- async getOnRampConfig() {
629
- const res = await this.baseRequest.get(`/on-ramp-config`);
630
- return res.data;
631
- }
632
- async createOnRampPurchase({
633
- userId,
634
- params: {
635
- type,
636
- walletType,
637
- address,
638
- provider,
639
- networks,
640
- assets,
641
- defaultNetwork,
642
- defaultAsset,
643
- fiat,
644
- fiatQuantity,
645
- testMode = false
646
- },
647
- ...params
648
- }) {
649
- const [key, identifier] = extractWalletRef(params);
650
- const walletString = key === "walletId" ? `wallets/${identifier}` : `external-wallets/${identifier}`;
651
- const res = await this.baseRequest.post(`/users/${userId}/${walletString}/purchases`, {
652
- type,
653
- provider,
654
- walletType,
655
- address,
656
- networks,
657
- assets,
658
- defaultAsset,
659
- defaultNetwork,
660
- fiat,
661
- fiatQuantity,
662
- testMode
663
- });
664
- return res.data;
665
- }
666
- async updateOnRampPurchase({
667
- userId,
668
- purchaseId,
669
- updates,
670
- ...params
671
- }) {
672
- const [key, identifier] = extractWalletRef(params);
673
- const walletString = key === "walletId" ? `wallets/${identifier}` : `external-wallets/${identifier}`;
674
- const res = await this.baseRequest.patch(
675
- `/users/${userId}/${walletString}/purchases/${purchaseId}`,
676
- updates
677
- );
678
- return res.data;
679
- }
680
- async getOnRampPurchase({
681
- userId,
682
- purchaseId,
683
- ...params
684
- }) {
685
- const [key, identifier] = extractWalletRef(params);
686
- const walletString = key === "walletId" ? `wallets/${identifier}` : `external-wallets/${identifier}`;
687
- const res = await this.baseRequest.get(`/users/${userId}/${walletString}/purchases/${purchaseId}`);
688
- return res;
689
- }
690
- async signMoonPayUrl(userId, {
691
- url,
692
- type,
693
- cosmosPrefix,
694
- testMode,
695
- walletId,
696
- externalWalletAddress
697
- }) {
698
- const walletString = walletId ? `wallets/${walletId}` : `external-wallets/${externalWalletAddress}`;
699
- const res = await this.baseRequest.post(`/users/${userId}/${walletString}/moonpay-sign`, {
688
+ verify2FAForPhone(phone, countryCode, verificationCode) {
689
+ return __async(this, null, function* () {
690
+ const body = { phone, countryCode, verificationCode };
691
+ const res = yield this.baseRequest.post("/2fa/verify", body);
692
+ return res;
693
+ });
694
+ }
695
+ tempTrasmissionInit(message, userId) {
696
+ return __async(this, null, function* () {
697
+ const body = { message, userId };
698
+ const res = yield this.baseRequest.post("/temporary-transmissions", body);
699
+ return res;
700
+ });
701
+ }
702
+ tempTrasmission(id) {
703
+ return __async(this, null, function* () {
704
+ const res = yield this.baseRequest.get(`/temporary-transmissions/${id}`);
705
+ return res;
706
+ });
707
+ }
708
+ getPartner(partnerId) {
709
+ return __async(this, null, function* () {
710
+ const res = yield this.baseRequest.get(`/partners/${partnerId}`);
711
+ return res;
712
+ });
713
+ }
714
+ acceptScopes(userId, walletId, body) {
715
+ return __async(this, null, function* () {
716
+ const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/scopes/accept`, body);
717
+ return res;
718
+ });
719
+ }
720
+ getPendingTransaction(userId, pendingTransactionId) {
721
+ return __async(this, null, function* () {
722
+ const res = yield this.baseRequest.get(`/users/${userId}/pending-transactions/${pendingTransactionId}`);
723
+ return res;
724
+ });
725
+ }
726
+ acceptPendingTransaction(userId, pendingTransactionId) {
727
+ return __async(this, null, function* () {
728
+ const res = yield this.baseRequest.post(`/users/${userId}/pending-transactions/${pendingTransactionId}/accept`);
729
+ return res;
730
+ });
731
+ }
732
+ getOnRampConfig() {
733
+ return __async(this, null, function* () {
734
+ const res = yield this.baseRequest.get(`/on-ramp-config`);
735
+ return res.data;
736
+ });
737
+ }
738
+ createOnRampPurchase(_e) {
739
+ return __async(this, null, function* () {
740
+ var _f = _e, {
741
+ userId,
742
+ params: {
743
+ type,
744
+ walletType,
745
+ address,
746
+ provider,
747
+ networks,
748
+ assets,
749
+ defaultNetwork,
750
+ defaultAsset,
751
+ fiat,
752
+ fiatQuantity,
753
+ testMode = false
754
+ }
755
+ } = _f, params = __objRest(_f, [
756
+ "userId",
757
+ "params"
758
+ ]);
759
+ const [key, identifier] = extractWalletRef(params);
760
+ const walletString = key === "walletId" ? `wallets/${identifier}` : `external-wallets/${identifier}`;
761
+ const res = yield this.baseRequest.post(`/users/${userId}/${walletString}/purchases`, {
762
+ type,
763
+ provider,
764
+ walletType,
765
+ address,
766
+ networks,
767
+ assets,
768
+ defaultAsset,
769
+ defaultNetwork,
770
+ fiat,
771
+ fiatQuantity,
772
+ testMode
773
+ });
774
+ return res.data;
775
+ });
776
+ }
777
+ updateOnRampPurchase(_g) {
778
+ return __async(this, null, function* () {
779
+ var _h = _g, {
780
+ userId,
781
+ purchaseId,
782
+ updates
783
+ } = _h, params = __objRest(_h, [
784
+ "userId",
785
+ "purchaseId",
786
+ "updates"
787
+ ]);
788
+ const [key, identifier] = extractWalletRef(params);
789
+ const walletString = key === "walletId" ? `wallets/${identifier}` : `external-wallets/${identifier}`;
790
+ const res = yield this.baseRequest.patch(
791
+ `/users/${userId}/${walletString}/purchases/${purchaseId}`,
792
+ updates
793
+ );
794
+ return res.data;
795
+ });
796
+ }
797
+ getOnRampPurchase(_i) {
798
+ return __async(this, null, function* () {
799
+ var _j = _i, {
800
+ userId,
801
+ purchaseId
802
+ } = _j, params = __objRest(_j, [
803
+ "userId",
804
+ "purchaseId"
805
+ ]);
806
+ const [key, identifier] = extractWalletRef(params);
807
+ const walletString = key === "walletId" ? `wallets/${identifier}` : `external-wallets/${identifier}`;
808
+ const res = yield this.baseRequest.get(`/users/${userId}/${walletString}/purchases/${purchaseId}`);
809
+ return res;
810
+ });
811
+ }
812
+ signMoonPayUrl(_0, _1) {
813
+ return __async(this, arguments, function* (userId, {
700
814
  url,
701
815
  type,
702
816
  cosmosPrefix,
703
- testMode
704
- });
705
- return res;
706
- }
707
- async generateOffRampTx(userId, {
708
- provider,
709
- chainId,
710
- contractAddress,
711
- testMode,
712
- walletId,
713
- walletType,
714
- destinationAddress,
715
- sourceAddress,
716
- assetQuantity
717
- }) {
718
- const res = await this.baseRequest.post(`/users/${userId}/wallets/${walletId}/offramp-generate`, {
719
- provider,
720
817
  testMode,
818
+ walletId,
819
+ externalWalletAddress
820
+ }) {
821
+ const walletString = walletId ? `wallets/${walletId}` : `external-wallets/${externalWalletAddress}`;
822
+ const res = yield this.baseRequest.post(`/users/${userId}/${walletString}/moonpay-sign`, {
823
+ url,
824
+ type,
825
+ cosmosPrefix,
826
+ testMode
827
+ });
828
+ return res;
829
+ });
830
+ }
831
+ generateOffRampTx(_0, _1) {
832
+ return __async(this, arguments, function* (userId, {
833
+ provider,
721
834
  chainId,
722
835
  contractAddress,
836
+ testMode,
723
837
  walletId,
724
838
  walletType,
725
839
  destinationAddress,
726
840
  sourceAddress,
727
841
  assetQuantity
842
+ }) {
843
+ const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/offramp-generate`, {
844
+ provider,
845
+ testMode,
846
+ chainId,
847
+ contractAddress,
848
+ walletId,
849
+ walletType,
850
+ destinationAddress,
851
+ sourceAddress,
852
+ assetQuantity
853
+ });
854
+ return res.data;
728
855
  });
729
- return res.data;
730
856
  }
731
- async sendOffRampTx(userId, {
732
- tx,
733
- signature,
734
- network,
735
- walletId,
736
- walletType
737
- }) {
738
- const res = await this.baseRequest.post(`/users/${userId}/wallets/${walletId}/offramp-send`, {
857
+ sendOffRampTx(_0, _1) {
858
+ return __async(this, arguments, function* (userId, {
739
859
  tx,
740
860
  signature,
741
861
  network,
862
+ walletId,
742
863
  walletType
864
+ }) {
865
+ const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/offramp-send`, {
866
+ tx,
867
+ signature,
868
+ network,
869
+ walletType
870
+ });
871
+ return res.data;
743
872
  });
744
- return res.data;
745
873
  }
746
- async distributeParaShare({
747
- userId,
748
- walletId,
749
- ...rest
750
- }) {
751
- const body = rest;
752
- const res = await this.baseRequest.post(`/users/${userId}/wallets/${walletId}/capsule-share/distribute`, body);
753
- return res;
874
+ distributeParaShare(_k) {
875
+ return __async(this, null, function* () {
876
+ var _l = _k, {
877
+ userId,
878
+ walletId
879
+ } = _l, rest = __objRest(_l, [
880
+ "userId",
881
+ "walletId"
882
+ ]);
883
+ const body = rest;
884
+ const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/capsule-share/distribute`, body);
885
+ return res;
886
+ });
754
887
  }
755
- async keepSessionAlive(userId) {
756
- const res = await this.baseRequest.post(`/users/${userId}/session/keep-alive`);
757
- return res.data;
888
+ keepSessionAlive(userId) {
889
+ return __async(this, null, function* () {
890
+ const res = yield this.baseRequest.post(`/users/${userId}/session/keep-alive`);
891
+ return res.data;
892
+ });
758
893
  }
759
- async persistRecoveryPublicKeys(userId, publicKeys) {
760
- const res = await this.baseRequest.post(`/users/${userId}/recovery-public-keys`, { publicKeys });
761
- return res.data;
894
+ persistRecoveryPublicKeys(userId, publicKeys) {
895
+ return __async(this, null, function* () {
896
+ const res = yield this.baseRequest.post(`/users/${userId}/recovery-public-keys`, { publicKeys });
897
+ return res.data;
898
+ });
762
899
  }
763
- async getRecoveryPublicKeys(userId) {
764
- const res = await this.baseRequest.get(`/users/${userId}/recovery-public-keys`);
765
- return res.data;
900
+ getRecoveryPublicKeys(userId) {
901
+ return __async(this, null, function* () {
902
+ const res = yield this.baseRequest.get(`/users/${userId}/recovery-public-keys`);
903
+ return res.data;
904
+ });
766
905
  }
767
- async uploadEncryptedWalletPrivateKey(userId, encryptedWalletPrivateKey, encryptionKeyHash, biometricPublicKey, passwordId) {
768
- const body = { encryptedWalletPrivateKey, encryptionKeyHash, biometricPublicKey, passwordId };
769
- const res = await this.baseRequest.post(`/users/${userId}/encrypted-wallet-private-keys`, body);
770
- return res.data;
906
+ uploadEncryptedWalletPrivateKey(userId, encryptedWalletPrivateKey, encryptionKeyHash, biometricPublicKey, passwordId) {
907
+ return __async(this, null, function* () {
908
+ const body = { encryptedWalletPrivateKey, encryptionKeyHash, biometricPublicKey, passwordId };
909
+ const res = yield this.baseRequest.post(`/users/${userId}/encrypted-wallet-private-keys`, body);
910
+ return res.data;
911
+ });
771
912
  }
772
- async getEncryptedWalletPrivateKeys(userId, encryptionKeyHash) {
773
- const res = await this.baseRequest.get(`/users/${userId}/encrypted-wallet-private-keys/${encryptionKeyHash}`);
774
- return res.data;
913
+ getEncryptedWalletPrivateKeys(userId, encryptionKeyHash) {
914
+ return __async(this, null, function* () {
915
+ const res = yield this.baseRequest.get(`/users/${userId}/encrypted-wallet-private-keys/${encryptionKeyHash}`);
916
+ return res.data;
917
+ });
775
918
  }
776
- async getConversionRate(chainId, symbol, currency) {
777
- const params = { symbol, currency };
778
- const res = await this.baseRequest.get(`/chains/${chainId}/conversion-rate`, { params });
779
- return res.data;
919
+ getConversionRate(chainId, symbol, currency) {
920
+ return __async(this, null, function* () {
921
+ const params = { symbol, currency };
922
+ const res = yield this.baseRequest.get(`/chains/${chainId}/conversion-rate`, { params });
923
+ return res.data;
924
+ });
780
925
  }
781
- async getGasEstimate(chainId, totalGasPrice) {
782
- const params = { totalGasPrice };
783
- const res = await this.baseRequest.get(`/chains/${chainId}/gas-estimate`, { params });
784
- return res.data;
926
+ getGasEstimate(chainId, totalGasPrice) {
927
+ return __async(this, null, function* () {
928
+ const params = { totalGasPrice };
929
+ const res = yield this.baseRequest.get(`/chains/${chainId}/gas-estimate`, { params });
930
+ return res.data;
931
+ });
785
932
  }
786
- async getGasOracle(chainId) {
787
- const res = await this.baseRequest.get(`/chains/${chainId}/gas-oracle`);
788
- return res.data;
933
+ getGasOracle(chainId) {
934
+ return __async(this, null, function* () {
935
+ const res = yield this.baseRequest.get(`/chains/${chainId}/gas-oracle`);
936
+ return res.data;
937
+ });
789
938
  }
790
939
  // GET /users/:userId/wallets/:walletId/refresh-done
791
- async isRefreshDone(userId, walletId, partnerId, protocolId) {
792
- const queryParams = {};
793
- if (partnerId) queryParams["partnerId"] = partnerId;
794
- if (protocolId) queryParams["protocolId"] = protocolId;
795
- const query = import_qs.default.stringify(queryParams);
796
- const res = await this.baseRequest.get(`/users/${userId}/wallets/${walletId}/refresh-done?${query}`);
797
- return res.data;
798
- }
799
- async deletePendingTransaction(userId, pendingTransactionId) {
800
- const res = await this.baseRequest.delete(`/users/${userId}/pending-transactions/${pendingTransactionId}`);
801
- return res.data;
940
+ isRefreshDone(userId, walletId, partnerId, protocolId) {
941
+ return __async(this, null, function* () {
942
+ const queryParams = {};
943
+ if (partnerId) queryParams["partnerId"] = partnerId;
944
+ if (protocolId) queryParams["protocolId"] = protocolId;
945
+ const query = import_qs.default.stringify(queryParams);
946
+ const res = yield this.baseRequest.get(`/users/${userId}/wallets/${walletId}/refresh-done?${query}`);
947
+ return res.data;
948
+ });
949
+ }
950
+ deletePendingTransaction(userId, pendingTransactionId) {
951
+ return __async(this, null, function* () {
952
+ const res = yield this.baseRequest.delete(`/users/${userId}/pending-transactions/${pendingTransactionId}`);
953
+ return res.data;
954
+ });
802
955
  }
803
956
  // POST /users/:userId/passwords/key
804
- async addSessionPasswordPublicKey(userId, body) {
805
- const res = await this.baseRequest.post(`/users/${userId}/passwords/key`, body);
806
- return res;
957
+ addSessionPasswordPublicKey(userId, body) {
958
+ return __async(this, null, function* () {
959
+ const res = yield this.baseRequest.post(`/users/${userId}/passwords/key`, body);
960
+ return res;
961
+ });
807
962
  }
808
- async getSupportedAuthMethods(auth) {
809
- const res = await this.baseRequest.get("/users/supported-auth-methods", {
810
- params: { ...auth }
963
+ getSupportedAuthMethods(auth) {
964
+ return __async(this, null, function* () {
965
+ const res = yield this.baseRequest.get("/users/supported-auth-methods", {
966
+ params: __spreadValues({}, auth)
967
+ });
968
+ return res.data;
811
969
  });
812
- return res.data;
813
970
  }
814
- async getPasswords(auth) {
815
- const res = await this.baseRequest.get("/users/passwords", {
816
- params: { ...auth }
971
+ getPasswords(auth) {
972
+ return __async(this, null, function* () {
973
+ const res = yield this.baseRequest.get("/users/passwords", {
974
+ params: __spreadValues({}, auth)
975
+ });
976
+ return res.data.passwords;
817
977
  });
818
- return res.data.passwords;
819
978
  }
820
979
  // POST /passwords/verify
821
- async verifyPasswordChallenge(partnerId, body) {
822
- const res = await this.baseRequest.post(`/passwords/verify`, body, {
823
- headers: {
824
- [PARTNER_ID_HEADER_NAME]: partnerId
825
- }
980
+ verifyPasswordChallenge(partnerId, body) {
981
+ return __async(this, null, function* () {
982
+ const res = yield this.baseRequest.post(`/passwords/verify`, body, {
983
+ headers: {
984
+ [PARTNER_ID_HEADER_NAME]: partnerId
985
+ }
986
+ });
987
+ return res;
826
988
  });
827
- return res;
828
989
  }
829
- async getEncryptedWalletPrivateKey(passwordId) {
830
- const queryParams = {};
831
- queryParams["passwordId"] = passwordId;
832
- const query = import_qs.default.stringify(queryParams);
833
- const res = await this.baseRequest.get(`/encrypted-wallet-private-keys?${query}`);
834
- return res;
990
+ getEncryptedWalletPrivateKey(passwordId) {
991
+ return __async(this, null, function* () {
992
+ const queryParams = {};
993
+ queryParams["passwordId"] = passwordId;
994
+ const query = import_qs.default.stringify(queryParams);
995
+ const res = yield this.baseRequest.get(`/encrypted-wallet-private-keys?${query}`);
996
+ return res;
997
+ });
835
998
  }
836
999
  // GET /users/:userId
837
- async getUser(userId) {
838
- const res = await this.baseRequest.get(`/users/${userId}`);
839
- return res.data;
1000
+ getUser(userId) {
1001
+ return __async(this, null, function* () {
1002
+ const res = yield this.baseRequest.get(`/users/${userId}`);
1003
+ return res.data;
1004
+ });
840
1005
  }
841
1006
  };
842
1007
  var client_default = Client;