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