@getpara/user-management-client 1.7.1 → 1.8.0

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
@@ -1,38 +1,9 @@
1
1
  var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
5
  var __getProtoOf = Object.getPrototypeOf;
9
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
- var __spreadValues = (a, b) => {
13
- for (var prop in b || (b = {}))
14
- if (__hasOwnProp.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- if (__getOwnPropSymbols)
17
- for (var prop of __getOwnPropSymbols(b)) {
18
- if (__propIsEnum.call(b, prop))
19
- __defNormalProp(a, prop, b[prop]);
20
- }
21
- return a;
22
- };
23
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
- var __objRest = (source, exclude) => {
25
- var target = {};
26
- for (var prop in source)
27
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
28
- target[prop] = source[prop];
29
- if (source != null && __getOwnPropSymbols)
30
- for (var prop of __getOwnPropSymbols(source)) {
31
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
32
- target[prop] = source[prop];
33
- }
34
- return target;
35
- };
36
7
  var __export = (target, all) => {
37
8
  for (var name in all)
38
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -45,6 +16,7 @@ var __copyProps = (to, from, except, desc) => {
45
16
  }
46
17
  return to;
47
18
  };
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
48
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
49
21
  // If the importer is in node compatibility mode or this is not an ESM
50
22
  // file that has been converted to a CommonJS file using a Babel-
@@ -54,1149 +26,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
54
26
  mod
55
27
  ));
56
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
57
- var __async = (__this, __arguments, generator) => {
58
- return new Promise((resolve, reject) => {
59
- var fulfilled = (value) => {
60
- try {
61
- step(generator.next(value));
62
- } catch (e) {
63
- reject(e);
64
- }
65
- };
66
- var rejected = (value) => {
67
- try {
68
- step(generator.throw(value));
69
- } catch (e) {
70
- reject(e);
71
- }
72
- };
73
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
74
- step((generator = generator.apply(__this, __arguments)).next());
75
- });
76
- };
77
-
78
- // src/index.ts
79
29
  var src_exports = {};
80
30
  __export(src_exports, {
81
- AuthMethod: () => AuthMethod,
82
- Chain: () => Chain,
83
- EmailTheme: () => EmailTheme,
84
- EncryptorType: () => EncryptorType,
85
- KeyShareType: () => KeyShareType,
86
- NON_ED25519: () => NON_ED25519,
87
- Network: () => Network,
88
- OAuthMethod: () => OAuthMethod,
89
- OnRampAsset: () => OnRampAsset,
90
- OnRampProvider: () => OnRampProvider,
91
- OnRampPurchaseStatus: () => OnRampPurchaseStatus,
92
- OnRampPurchaseType: () => OnRampPurchaseType,
93
- PREGEN_IDENTIFIER_TYPES: () => PREGEN_IDENTIFIER_TYPES,
94
- PasswordStatus: () => PasswordStatus,
95
- PublicKeyStatus: () => PublicKeyStatus,
96
- PublicKeyType: () => PublicKeyType,
97
- WalletScheme: () => WalletScheme,
98
- WalletType: () => WalletType,
99
- default: () => src_default,
100
- extractAuthInfo: () => extractAuthInfo,
101
- extractWalletRef: () => extractWalletRef,
102
- handleResponseError: () => handleResponseError,
103
- handleResponseSuccess: () => handleResponseSuccess,
104
- isEmail: () => isEmail,
105
- isExternalWallet: () => isExternalWallet,
106
- isExternalWalletAddress: () => isExternalWalletAddress,
107
- isFarcaster: () => isFarcaster,
108
- isPhone: () => isPhone,
109
- isTelegram: () => isTelegram,
110
- isUserId: () => isUserId,
111
- isWalletId: () => isWalletId
31
+ default: () => src_default
112
32
  });
113
33
  module.exports = __toCommonJS(src_exports);
114
-
115
- // src/client.ts
116
- var import_axios = __toESM(require("axios"));
117
- var import_qs = __toESM(require("qs"));
118
-
119
- // src/utils.ts
120
- function isWalletId(params) {
121
- return !!params.walletId && !params.externalWalletAddress;
122
- }
123
- function isExternalWalletAddress(params) {
124
- return !!params.externalWalletAddress && !params.walletId;
125
- }
126
- function extractWalletRef(params) {
127
- if (isWalletId(params)) {
128
- return ["walletId", params.walletId];
129
- } else if (isExternalWalletAddress(params)) {
130
- return ["externalWalletAddress", params.externalWalletAddress];
131
- }
132
- throw new Error("invalid wallet params");
133
- }
134
- function isValid(s) {
135
- return !!s && s !== "null" && s !== "undefined" && s !== "";
136
- }
137
- function isEmail(params) {
138
- return isValid(params.email) && !isValid(params.phone) && !isValid(params.countryCode) && !isValid(params.farcasterUsername) && !isValid(params.telegramUserId) && !isValid(params.externalWalletUserId);
139
- }
140
- function isPhone(params) {
141
- return isValid(params.phone) && isValid(params.countryCode) && !isValid(params.email) && !isValid(params.farcasterUsername) && !isValid(params.telegramUserId) && !isValid(params.externalWalletUserId);
142
- }
143
- function isFarcaster(params) {
144
- return isValid(params.farcasterUsername) && !isValid(params.email) && !isValid(params.phone) && !isValid(params.countryCode) && !isValid(params.telegramUserId) && !isValid(params.externalWalletUserId);
145
- }
146
- function isTelegram(params) {
147
- return isValid(params.telegramUserId) && !isValid(params.email) && !isValid(params.phone) && !isValid(params.countryCode) && !isValid(params.farcasterUsername) && !isValid(params.externalWalletUserId);
148
- }
149
- function isUserId(params) {
150
- return isValid(params.userId) && !isValid(params.email) && !isValid(params.phone) && !isValid(params.countryCode) && !isValid(params.farcasterUsername) && !isValid(params.telegramUserId) && !isValid(params.externalWalletUserId);
151
- }
152
- function isExternalWallet(params) {
153
- return isValid(params.externalWalletAddress) && !isValid(params.email) && !isValid(params.phone) && !isValid(params.countryCode) && !isValid(params.farcasterUsername) && !isValid(params.telegramUserId);
154
- }
155
- function extractAuthInfo(obj, { allowUserId = false, isRequired = false } = {}) {
156
- switch (true) {
157
- case isEmail(obj):
158
- return { auth: { email: obj.email }, authType: "email", identifier: obj.email, publicKeyIdentifier: obj.email };
159
- case isPhone(obj):
160
- return {
161
- auth: { phone: obj.phone, countryCode: obj.countryCode },
162
- authType: "phone",
163
- identifier: `${obj.countryCode}${obj.phone}`,
164
- publicKeyIdentifier: `${obj.countryCode}${obj.phone}`
165
- };
166
- case isFarcaster(obj):
167
- return {
168
- auth: { farcasterUsername: obj.farcasterUsername },
169
- authType: "farcaster",
170
- identifier: obj.farcasterUsername,
171
- publicKeyIdentifier: `${obj.farcasterUsername}-farcaster`
172
- };
173
- case isTelegram(obj):
174
- return {
175
- auth: { telegramUserId: obj.telegramUserId },
176
- authType: "telegram",
177
- identifier: obj.telegramUserId,
178
- publicKeyIdentifier: `${obj.telegramUserId}-telegram`
179
- };
180
- case isExternalWallet(obj):
181
- return {
182
- auth: { externalWalletAddress: obj.externalWalletAddress },
183
- authType: "externalWallet",
184
- identifier: obj.externalWalletAddress,
185
- publicKeyIdentifier: `${obj.externalWalletAddress}-external-wallet`
186
- };
187
- case (isUserId(obj) && allowUserId):
188
- return { auth: { userId: obj.userId }, authType: "userId", identifier: obj.userId, publicKeyIdentifier: obj.userId };
189
- default:
190
- if (isRequired) {
191
- throw new Error("invalid auth object");
192
- }
193
- return void 0;
194
- }
195
- }
196
-
197
- // src/consts.ts
198
- var SESSION_COOKIE_HEADER_NAME = "x-capsule-sid";
199
- var VERSION_HEADER_NAME = "x-para-version";
200
- var PARTNER_ID_HEADER_NAME = "x-partner-id";
201
- var API_KEY_HEADER_NAME = "X-External-API-Key";
202
-
203
- // src/error.ts
204
- function ParaApiError(message, code, status, responseURL) {
205
- Error.call(this);
206
- if (Error.captureStackTrace) {
207
- Error.captureStackTrace(this, this.constructor);
208
- } else {
209
- this.stack = new Error().stack;
210
- }
211
- this.message = message;
212
- this.name = "ParaApiError";
213
- code && (this.code = code);
214
- status && (this.status = status);
215
- responseURL && (this.responseURL = responseURL);
216
- }
217
- var prototype = ParaApiError.prototype;
218
- Object.defineProperty(prototype, "isParaApiError", { value: true });
219
-
220
- // src/client.ts
221
- var handleResponseSuccess = (response) => {
222
- if (response.status === 200) {
223
- return response;
224
- }
225
- throw new ParaApiError("Invalid status code");
226
- };
227
- var handleResponseError = (error) => {
228
- var _a, _b, _c;
229
- if (error === null) throw new ParaApiError("Error is null");
230
- if (import_axios.default.isAxiosError(error)) {
231
- let message = (_b = (_a = error.response) == null ? void 0 : _a.data) != null ? _b : "Unknown error";
232
- if (error.code === "ERR_NETWORK") {
233
- message = "Connection error";
234
- } else if (error.code === "ERR_CANCELED") {
235
- message = "Connection canceled";
236
- }
237
- throw new ParaApiError(message, error.code, error.response.status, (_c = error.request) == null ? void 0 : _c.responseURL);
238
- }
239
- throw new ParaApiError("Unknown error");
240
- };
241
- var Client = class {
242
- constructor({
243
- userManagementHost,
244
- apiKey,
245
- partnerId,
246
- version,
247
- opts,
248
- retrieveSessionCookie,
249
- persistSessionCookie
250
- }) {
251
- this.createUser = (body) => __async(this, null, function* () {
252
- const res = yield this.baseRequest.post(`/users`, body);
253
- return res.data;
254
- });
255
- this.checkUserExists = (auth) => __async(this, null, function* () {
256
- const res = yield this.baseRequest.get("/users/exists", {
257
- params: __spreadValues({}, auth)
258
- });
259
- return res;
260
- });
261
- this.verifyTelegram = (authObject) => __async(this, null, function* () {
262
- return (yield this.baseRequest.post("/users/telegram", {
263
- authObject
264
- })).data;
265
- });
266
- this.externalWalletLogin = (body) => __async(this, null, function* () {
267
- const res = yield this.baseRequest.post(`/users/external-wallets/login`, body);
268
- return res.data;
269
- });
270
- // POST /users/:userId/verify-email
271
- this.verifyEmail = (userId, body) => __async(this, null, function* () {
272
- const res = yield this.baseRequest.post(`/users/${userId}/verify-email`, body);
273
- return res;
274
- });
275
- this.verifyPhone = (userId, body) => __async(this, null, function* () {
276
- const res = yield this.baseRequest.post(`/users/${userId}/verify-identifier`, body);
277
- return res;
278
- });
279
- this.verifyExternalWallet = (userId, body) => __async(this, null, function* () {
280
- const res = yield this.baseRequest.post(`/users/${userId}/external-wallets/verify`, body);
281
- return res;
282
- });
283
- // POST /users/:userId/biometrics/key
284
- this.addSessionPublicKey = (userId, body) => __async(this, null, function* () {
285
- const res = yield this.baseRequest.post(`/users/${userId}/biometrics/key`, body);
286
- return res;
287
- });
288
- // GET /users/:userId/biometrics/keys
289
- this.getSessionPublicKeys = (userId) => __async(this, null, function* () {
290
- const res = yield this.baseRequest.get(`/users/${userId}/biometrics/keys`);
291
- return res;
292
- });
293
- // GET /biometrics/location-hints
294
- this.getBiometricLocationHints = (params) => __async(this, null, function* () {
295
- const res = yield this.baseRequest.get(`/biometrics/location-hints`, { params });
296
- return res.data.hints;
297
- });
298
- // GET /users/:userId/biometrics/:biometricId
299
- this.getSessionPublicKey = (userId, biometricId) => __async(this, null, function* () {
300
- const res = yield this.baseRequest.get(`/users/${userId}/biometrics/${biometricId}`);
301
- return res;
302
- });
303
- // PATCH /users/:userId/biometrics/:biometricId
304
- this.patchSessionPublicKey = (partnerId, userId, biometricId, body) => __async(this, null, function* () {
305
- const res = yield this.baseRequest.patch(`/users/${userId}/biometrics/${biometricId}`, body, {
306
- headers: {
307
- [PARTNER_ID_HEADER_NAME]: partnerId
308
- }
309
- });
310
- return res;
311
- });
312
- // GET /biometrics/challenge?email&publicKey
313
- this.getWebChallenge = (auth) => __async(this, null, function* () {
314
- const res = yield this.baseRequest.get("/biometrics/challenge", {
315
- params: __spreadValues({}, auth || {})
316
- });
317
- return res.data;
318
- });
319
- // POST /touch
320
- this.touchSession = (regenerate) => __async(this, null, function* () {
321
- const res = yield this.baseRequest.post(
322
- `/touch?regenerate=${!!regenerate}`
323
- );
324
- return res;
325
- });
326
- // GET /session/origin
327
- this.sessionOrigin = (sessionLookupId) => __async(this, null, function* () {
328
- const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/origin`);
329
- return res.data;
330
- });
331
- // POST /biometrics/verify
332
- this.verifyWebChallenge = (partnerId, body) => __async(this, null, function* () {
333
- const res = yield this.baseRequest.post(`/biometrics/verify`, body, {
334
- headers: {
335
- [PARTNER_ID_HEADER_NAME]: partnerId
336
- }
337
- });
338
- return res;
339
- });
340
- // GET /users/:userId/biometrics/challenge
341
- this.getSessionChallenge = (userId) => __async(this, null, function* () {
342
- const res = yield this.baseRequest.get(`/users/${userId}/biometrics/challenge`);
343
- return res;
344
- });
345
- // POST /users/:userId/biometrics/verify
346
- this.verifySessionChallenge = (userId, body) => __async(this, null, function* () {
347
- const res = yield this.baseRequest.post(`/users/${userId}/biometrics/verify`, body);
348
- return res;
349
- });
350
- // POST /users/:userId/wallets
351
- this.createWallet = (userId, body) => __async(this, null, function* () {
352
- const res = yield this.baseRequest.post(`/users/${userId}/wallets`, body);
353
- return res.data;
354
- });
355
- // POST /wallets/pregen
356
- this.createPregenWallet = (body) => __async(this, null, function* () {
357
- const res = yield this.baseRequest.post(`/wallets/pregen`, body);
358
- return res.data;
359
- });
360
- // GET /wallets/pregen?pregenIdentifier={pregenIdentifier}&pregenIdentifierType={pregenIdentifierType}
361
- this.getPregenWallets = (pregenIds, isPortal = false, userId) => __async(this, null, function* () {
362
- const res = yield this.baseRequest.get("/wallets/pregen", {
363
- params: { ids: pregenIds, expand: isPortal, userId }
364
- });
365
- return res.data;
366
- });
367
- // POST /wallets/pregen/claim
368
- this.claimPregenWallets = (body) => __async(this, null, function* () {
369
- const res = yield this.baseRequest.post(`/wallets/pregen/claim`, body);
370
- return res.data;
371
- });
372
- // POST /users/:userId/wallets/:walletId/transactions/send
373
- this.sendTransaction = (userId, walletId, body) => __async(this, null, function* () {
374
- const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/transactions/send`, body);
375
- return res;
376
- });
377
- // functionality changed to only sign transactions and not send them
378
- // POST /users/:userId/wallets/:walletId/transactions/sign
379
- this.signTransaction = (userId, walletId, body) => __async(this, null, function* () {
380
- const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/transactions/sign`, body);
381
- return res;
382
- });
383
- // POST /users/:userId/wallets/:walletId/refresh
384
- this.refreshKeys = (userId, walletId, oldPartnerId, newPartnerId, keyShareProtocolId) => __async(this, null, function* () {
385
- const body = { oldPartnerId, newPartnerId, keyShareProtocolId };
386
- const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/refresh`, body);
387
- return res;
388
- });
389
- // PATCH /wallets/pregen/:walletId
390
- this.updatePregenWallet = (walletId, body) => __async(this, null, function* () {
391
- const res = yield this.baseRequest.patch(`/wallets/pregen/${walletId}`, body);
392
- return res.data;
393
- });
394
- // GET /users/:userId/wallets
395
- this.getWallets = (userId, includePartnerData) => __async(this, null, function* () {
396
- const res = yield this.baseRequest.get(
397
- `/users/${userId}/wallets${includePartnerData ? `?includePartnerData=${encodeURIComponent(includePartnerData)}` : ""}`
398
- );
399
- return res;
400
- });
401
- // GET /users/:userId/all-wallets
402
- this.getAllWallets = (userId) => __async(this, null, function* () {
403
- const res = yield this.baseRequest.get(`/users/${userId}/all-wallets`);
404
- return res;
405
- });
406
- // POST /users/:userId/wallets/set
407
- this.setCurrentWalletIds = (userId, walletIds, needsWallet = false, sessionLookupId, newDeviceSessionLookupId) => __async(this, null, function* () {
408
- const res = yield this.baseRequest.post(`/users/${userId}/wallets/set`, {
409
- walletIds,
410
- needsWallet,
411
- sessionLookupId,
412
- newDeviceSessionLookupId
413
- });
414
- return res;
415
- });
416
- // POST /login
417
- this.login = (props) => __async(this, null, function* () {
418
- const body = props;
419
- const res = yield this.baseRequest.post("/login", body);
420
- return res;
421
- });
422
- // POST /login
423
- this.verifyLogin = (verificationCode) => __async(this, null, function* () {
424
- const body = { verificationCode };
425
- const res = yield this.baseRequest.post("/login/verify-email", body);
426
- return res;
427
- });
428
- // GET /logout
429
- this.logout = () => __async(this, null, function* () {
430
- const res = yield this.baseRequest.get("/logout");
431
- return res;
432
- });
433
- // POST /recovery/verification
434
- this.recoveryVerification = (email, verificationCode) => __async(this, null, function* () {
435
- const body = { email, verificationCode };
436
- const res = yield this.baseRequest.post("/recovery/verification", body);
437
- return res;
438
- });
439
- // POST /recovery
440
- this.recoveryInit = (email) => __async(this, null, function* () {
441
- const body = { email };
442
- const res = yield this.baseRequest.post("/recovery", body);
443
- return res;
444
- });
445
- this.preSignMessage = (userId, walletId, message, scheme, cosmosSignDoc) => __async(this, null, function* () {
446
- const body = { message, scheme, cosmosSignDoc };
447
- const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/messages/sign`, body);
448
- return res.data;
449
- });
450
- //DELETE /users/:userId
451
- this.deleteSelf = (userId) => __async(this, null, function* () {
452
- const res = yield this.baseRequest.delete(`/users/${userId}`);
453
- return res;
454
- });
455
- // GET /users/:userId/wallets/:walletId/capsule-share
456
- this.getParaShare = (userId, walletId) => __async(this, null, function* () {
457
- const res = yield this.baseRequest.get(`/users/${userId}/wallets/${walletId}/capsule-share`);
458
- return res.data.share;
459
- });
460
- // GET /users/:userId/wallets/:walletId/download-backup-kit
461
- this.getBackupKit = (userId, walletId) => __async(this, null, function* () {
462
- const res = yield this.baseRequest.get(`/users/${userId}/wallets/${walletId}/download-backup-kit`, {
463
- responseType: "blob"
464
- });
465
- return res;
466
- });
467
- // PATCH /users/:userId/biometrics/:biometricId
468
- this.patchSessionPassword = (partnerId, userId, passwordId, body) => __async(this, null, function* () {
469
- const res = yield this.baseRequest.patch(`/users/${userId}/passwords/${passwordId}`, body, {
470
- headers: {
471
- [PARTNER_ID_HEADER_NAME]: partnerId
472
- }
473
- });
474
- return res;
475
- });
476
- const headers = __spreadValues(__spreadValues({}, apiKey && { [API_KEY_HEADER_NAME]: apiKey }), partnerId && { [PARTNER_ID_HEADER_NAME]: partnerId });
477
- const axiosConfig = {
478
- baseURL: userManagementHost,
479
- withCredentials: true,
480
- headers
481
- };
482
- if (retrieveSessionCookie) {
483
- const defaultTransformRequest = Array.isArray(import_axios.default.defaults.transformRequest) ? import_axios.default.defaults.transformRequest : [import_axios.default.defaults.transformRequest];
484
- axiosConfig.transformRequest = [
485
- function(data, headers2) {
486
- const currentSessionCookie = retrieveSessionCookie();
487
- if (currentSessionCookie) {
488
- headers2[SESSION_COOKIE_HEADER_NAME] = currentSessionCookie;
489
- }
490
- if (version) {
491
- headers2[VERSION_HEADER_NAME] = version;
492
- }
493
- return data;
494
- },
495
- ...defaultTransformRequest
496
- ];
497
- }
498
- if (persistSessionCookie) {
499
- const defaultTransformResponse = Array.isArray(import_axios.default.defaults.transformResponse) ? import_axios.default.defaults.transformResponse : [import_axios.default.defaults.transformResponse];
500
- axiosConfig.transformResponse = [
501
- ...defaultTransformResponse,
502
- function(data, headers2, _status) {
503
- if (headers2 == null ? void 0 : headers2[SESSION_COOKIE_HEADER_NAME]) {
504
- persistSessionCookie(headers2[SESSION_COOKIE_HEADER_NAME]);
505
- }
506
- return data;
507
- }
508
- ];
509
- }
510
- this.baseRequest = import_axios.default.create(axiosConfig);
511
- if (opts == null ? void 0 : opts.useFetchAdapter) {
512
- import_axios.default.defaults.adapter = function(config) {
513
- return fetch(config.baseURL + config.url.substring(1), {
514
- method: config.method,
515
- headers: config.headers,
516
- body: config.data,
517
- credentials: config.withCredentials ? "include" : void 0
518
- }).then(
519
- (response) => response.text().then((text) => ({
520
- data: text,
521
- status: response.status,
522
- statusText: response.statusText,
523
- headers: response.headers,
524
- config,
525
- request: fetch
526
- }))
527
- ).catch(function(reason) {
528
- throw reason;
529
- });
530
- };
531
- }
532
- this.baseRequest.interceptors.response.use(handleResponseSuccess, handleResponseError);
533
- }
534
- // DEPRECATED: use uploadUserKeyShares instead
535
- // POST /users/:userId/wallets/:walletId/key-shares
536
- uploadKeyshares(userId, walletId, encryptedKeyshares) {
537
- return __async(this, null, function* () {
538
- const body = { keyShares: encryptedKeyshares };
539
- const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/key-shares`, body);
540
- return res;
541
- });
542
- }
543
- // POST /users/:userId/key-shares
544
- uploadUserKeyShares(userId, encryptedKeyshares) {
545
- return __async(this, null, function* () {
546
- const body = { keyShares: encryptedKeyshares };
547
- const res = yield this.baseRequest.post(`/users/${userId}/key-shares`, body);
548
- return res;
549
- });
550
- }
551
- // GET /users/:userId/wallets/:walletId/key-shares
552
- getKeyshare(userId, walletId, type, encryptor) {
553
- return __async(this, null, function* () {
554
- const res = yield this.baseRequest.get(
555
- `/users/${userId}/wallets/${walletId}/key-shares?type=${type}${encryptor ? `&encryptor=${encryptor}` : ""}`
556
- );
557
- return res;
558
- });
559
- }
560
- // GET /users/:userId/biometrics/key-shares
561
- getBiometricKeyshares(userId, biometricPublicKey, getAll) {
562
- return __async(this, null, function* () {
563
- const res = yield this.baseRequest.get(
564
- `/users/${userId}/biometrics/key-shares?publicKey=${biometricPublicKey}&all=${!!getAll}`
565
- );
566
- return res;
567
- });
568
- }
569
- // GET /users/:userId/key-shares
570
- getPasswordKeyshares(userId, passwordId, getAll) {
571
- return __async(this, null, function* () {
572
- const res = yield this.baseRequest.get(
573
- `/users/${userId}/passwords/key-shares?passwordId=${passwordId}&all=${!!getAll}`
574
- );
575
- return res;
576
- });
577
- }
578
- // POST '/users/:userId/temporary-shares',
579
- uploadTransmissionKeyshares(userId, shares) {
580
- return __async(this, null, function* () {
581
- const body = { shares };
582
- const res = yield this.baseRequest.post(`/users/${userId}/temporary-shares`, body);
583
- return res;
584
- });
585
- }
586
- // GET /users/:userId/temporary-shares returns { temporaryShares: { userId: string, walletId: string, encryptedShare: string, encryptedKey?: string }[] }
587
- getTransmissionKeyshares(userId, sessionLookupId) {
588
- return __async(this, null, function* () {
589
- const res = yield this.baseRequest.get(`/users/${userId}/temporary-shares?sessionLookupId=${sessionLookupId}`);
590
- return res;
591
- });
592
- }
593
- // POST '/users/:userId/resend-verification-code
594
- resendVerificationCode(_a) {
595
- return __async(this, null, function* () {
596
- var _b = _a, { userId } = _b, rest = __objRest(_b, ["userId"]);
597
- const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code`, rest);
598
- return res;
599
- });
600
- }
601
- // POST '/users/:userId/resend-verification-code-by-phone
602
- resendVerificationCodeByPhone(_c) {
603
- return __async(this, null, function* () {
604
- var _d = _c, { userId } = _d, rest = __objRest(_d, ["userId"]);
605
- const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code-by-phone`, rest);
606
- return res;
607
- });
608
- }
609
- // POST recovery/cancel
610
- cancelRecoveryAttempt(email) {
611
- return __async(this, null, function* () {
612
- const res = yield this.baseRequest.post(`/recovery/cancel`, { email });
613
- return res;
614
- });
615
- }
616
- // GET '/2fa/users/:userId/check-status'
617
- check2FAStatus(userId) {
618
- return __async(this, null, function* () {
619
- const res = yield this.baseRequest.get(`/2fa/users/${userId}/check-status`);
620
- return res;
621
- });
622
- }
623
- // POST '/2fa/users/:userId/enable'
624
- enable2FA(userId, verificationCode) {
625
- return __async(this, null, function* () {
626
- const res = yield this.baseRequest.post(`/2fa/users/${userId}/enable`, { verificationCode });
627
- return res;
628
- });
629
- }
630
- // POST '/2fa/users/:userId/setup'
631
- setup2FA(userId) {
632
- return __async(this, null, function* () {
633
- const res = yield this.baseRequest.post(`/2fa/users/${userId}/setup`);
634
- return res;
635
- });
636
- }
637
- // POST /recovery/init
638
- initializeRecovery(email) {
639
- return __async(this, null, function* () {
640
- const res = yield this.baseRequest.post(`/recovery/init`, { email });
641
- return res;
642
- });
643
- }
644
- // POST /auth/farcaster/init
645
- initializeFarcasterLogin() {
646
- return __async(this, null, function* () {
647
- const res = yield this.baseRequest.post(`/auth/farcaster/init`);
648
- return res;
649
- });
650
- }
651
- // POST /auth/farcaster/status
652
- getFarcasterAuthStatus() {
653
- return __async(this, null, function* () {
654
- const res = yield this.baseRequest.post(`/auth/farcaster/status`);
655
- return res;
656
- });
657
- }
658
- // POST /recovery/init
659
- initializeRecoveryForPhone(phone, countryCode) {
660
- return __async(this, null, function* () {
661
- const res = yield this.baseRequest.post(`/recovery/init`, { phone, countryCode });
662
- return res;
663
- });
664
- }
665
- // POST /recovery/users/:userId/wallets/:walletId/finish
666
- finalizeRecovery(userId, walletId) {
667
- return __async(this, null, function* () {
668
- const res = yield this.baseRequest.post(`/recovery/users/${userId}/wallets/${walletId}/finish`);
669
- return res;
670
- });
671
- }
672
- // GET /recovery/users/:userId/wallets/:walletId/key-shares
673
- recoverUserShares(userId, walletId) {
674
- return __async(this, null, function* () {
675
- const res = yield this.baseRequest.get(`/recovery/users/${userId}/wallets/${walletId}/key-shares?type=USER&encryptor=RECOVERY`);
676
- return res;
677
- });
678
- }
679
- // POST /recovery/verify-email
680
- verifyEmailForRecovery(email, verificationCode) {
681
- return __async(this, null, function* () {
682
- const body = { email, verificationCode };
683
- const res = yield this.baseRequest.post(`/recovery/verify-email`, body);
684
- return res;
685
- });
686
- }
687
- // POST /recovery/verify-identifier
688
- verifyPhoneForRecovery(phone, countryCode, verificationCode) {
689
- return __async(this, null, function* () {
690
- const body = { phone, countryCode, verificationCode };
691
- const res = yield this.baseRequest.post(`/recovery/verify-identifier`, body);
692
- return res;
693
- });
694
- }
695
- // POST /2fa/verify
696
- verify2FA(email, verificationCode) {
697
- return __async(this, null, function* () {
698
- const body = { email, verificationCode };
699
- const res = yield this.baseRequest.post("/2fa/verify", body);
700
- return res;
701
- });
702
- }
703
- // POST /2fa/phone/verify
704
- verify2FAForPhone(phone, countryCode, verificationCode) {
705
- return __async(this, null, function* () {
706
- const body = { phone, countryCode, verificationCode };
707
- const res = yield this.baseRequest.post("/2fa/verify", body);
708
- return res;
709
- });
710
- }
711
- tempTrasmissionInit(message, userId) {
712
- return __async(this, null, function* () {
713
- const body = { message, userId };
714
- const res = yield this.baseRequest.post("/temporary-transmissions", body);
715
- return res;
716
- });
717
- }
718
- tempTrasmission(id) {
719
- return __async(this, null, function* () {
720
- const res = yield this.baseRequest.get(`/temporary-transmissions/${id}`);
721
- return res;
722
- });
723
- }
724
- getPartner(partnerId) {
725
- return __async(this, null, function* () {
726
- const res = yield this.baseRequest.get(`/partners/${partnerId}`);
727
- return res;
728
- });
729
- }
730
- acceptScopes(userId, walletId, body) {
731
- return __async(this, null, function* () {
732
- const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/scopes/accept`, body);
733
- return res;
734
- });
735
- }
736
- getPendingTransaction(userId, pendingTransactionId) {
737
- return __async(this, null, function* () {
738
- const res = yield this.baseRequest.get(`/users/${userId}/pending-transactions/${pendingTransactionId}`);
739
- return res;
740
- });
741
- }
742
- acceptPendingTransaction(userId, pendingTransactionId) {
743
- return __async(this, null, function* () {
744
- const res = yield this.baseRequest.post(`/users/${userId}/pending-transactions/${pendingTransactionId}/accept`);
745
- return res;
746
- });
747
- }
748
- getOnRampConfig() {
749
- return __async(this, null, function* () {
750
- const res = yield this.baseRequest.get(`/on-ramp-config`);
751
- return res.data;
752
- });
753
- }
754
- createOnRampPurchase(_e) {
755
- return __async(this, null, function* () {
756
- var _f = _e, {
757
- userId,
758
- params: {
759
- type,
760
- walletType,
761
- address,
762
- provider,
763
- networks,
764
- assets,
765
- defaultNetwork,
766
- defaultAsset,
767
- fiat,
768
- fiatQuantity,
769
- testMode = false
770
- }
771
- } = _f, params = __objRest(_f, [
772
- "userId",
773
- "params"
774
- ]);
775
- const [key, identifier] = extractWalletRef(params);
776
- const walletString = key === "walletId" ? `wallets/${identifier}` : `external-wallets/${identifier}`;
777
- const res = yield this.baseRequest.post(`/users/${userId}/${walletString}/purchases`, {
778
- type,
779
- provider,
780
- walletType,
781
- address,
782
- networks,
783
- assets,
784
- defaultAsset,
785
- defaultNetwork,
786
- fiat,
787
- fiatQuantity,
788
- testMode
789
- });
790
- return res.data;
791
- });
792
- }
793
- updateOnRampPurchase(_g) {
794
- return __async(this, null, function* () {
795
- var _h = _g, {
796
- userId,
797
- purchaseId,
798
- updates
799
- } = _h, params = __objRest(_h, [
800
- "userId",
801
- "purchaseId",
802
- "updates"
803
- ]);
804
- const [key, identifier] = extractWalletRef(params);
805
- const walletString = key === "walletId" ? `wallets/${identifier}` : `external-wallets/${identifier}`;
806
- const res = yield this.baseRequest.patch(
807
- `/users/${userId}/${walletString}/purchases/${purchaseId}`,
808
- updates
809
- );
810
- return res.data;
811
- });
812
- }
813
- getOnRampPurchase(_i) {
814
- return __async(this, null, function* () {
815
- var _j = _i, {
816
- userId,
817
- purchaseId
818
- } = _j, params = __objRest(_j, [
819
- "userId",
820
- "purchaseId"
821
- ]);
822
- const [key, identifier] = extractWalletRef(params);
823
- const walletString = key === "walletId" ? `wallets/${identifier}` : `external-wallets/${identifier}`;
824
- const res = yield this.baseRequest.get(`/users/${userId}/${walletString}/purchases/${purchaseId}`);
825
- return res;
826
- });
827
- }
828
- signMoonPayUrl(_0, _1) {
829
- return __async(this, arguments, function* (userId, {
830
- url,
831
- type,
832
- cosmosPrefix,
833
- testMode,
834
- walletId,
835
- externalWalletAddress
836
- }) {
837
- const walletString = walletId ? `wallets/${walletId}` : `external-wallets/${externalWalletAddress}`;
838
- const res = yield this.baseRequest.post(`/users/${userId}/${walletString}/moonpay-sign`, {
839
- url,
840
- type,
841
- cosmosPrefix,
842
- testMode
843
- });
844
- return res;
845
- });
846
- }
847
- generateOffRampTx(_0, _1) {
848
- return __async(this, arguments, function* (userId, {
849
- provider,
850
- chainId,
851
- contractAddress,
852
- testMode,
853
- walletId,
854
- walletType,
855
- destinationAddress,
856
- sourceAddress,
857
- assetQuantity
858
- }) {
859
- const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/offramp-generate`, {
860
- provider,
861
- testMode,
862
- chainId,
863
- contractAddress,
864
- walletId,
865
- walletType,
866
- destinationAddress,
867
- sourceAddress,
868
- assetQuantity
869
- });
870
- return res.data;
871
- });
872
- }
873
- sendOffRampTx(_0, _1) {
874
- return __async(this, arguments, function* (userId, {
875
- tx,
876
- signature,
877
- network,
878
- walletId,
879
- walletType
880
- }) {
881
- const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/offramp-send`, {
882
- tx,
883
- signature,
884
- network,
885
- walletType
886
- });
887
- return res.data;
888
- });
889
- }
890
- distributeParaShare(_k) {
891
- return __async(this, null, function* () {
892
- var _l = _k, {
893
- userId,
894
- walletId
895
- } = _l, rest = __objRest(_l, [
896
- "userId",
897
- "walletId"
898
- ]);
899
- const body = rest;
900
- const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/capsule-share/distribute`, body);
901
- return res;
902
- });
903
- }
904
- keepSessionAlive(userId) {
905
- return __async(this, null, function* () {
906
- const res = yield this.baseRequest.post(`/users/${userId}/session/keep-alive`);
907
- return res.data;
908
- });
909
- }
910
- persistRecoveryPublicKeys(userId, publicKeys) {
911
- return __async(this, null, function* () {
912
- const res = yield this.baseRequest.post(`/users/${userId}/recovery-public-keys`, { publicKeys });
913
- return res.data;
914
- });
915
- }
916
- getRecoveryPublicKeys(userId) {
917
- return __async(this, null, function* () {
918
- const res = yield this.baseRequest.get(`/users/${userId}/recovery-public-keys`);
919
- return res.data;
920
- });
921
- }
922
- uploadEncryptedWalletPrivateKey(userId, encryptedWalletPrivateKey, encryptionKeyHash, biometricPublicKey, passwordId) {
923
- return __async(this, null, function* () {
924
- const body = { encryptedWalletPrivateKey, encryptionKeyHash, biometricPublicKey, passwordId };
925
- const res = yield this.baseRequest.post(`/users/${userId}/encrypted-wallet-private-keys`, body);
926
- return res.data;
927
- });
928
- }
929
- getEncryptedWalletPrivateKeys(userId, encryptionKeyHash) {
930
- return __async(this, null, function* () {
931
- const res = yield this.baseRequest.get(`/users/${userId}/encrypted-wallet-private-keys/${encryptionKeyHash}`);
932
- return res.data;
933
- });
934
- }
935
- getConversionRate(chainId, symbol, currency) {
936
- return __async(this, null, function* () {
937
- const params = { symbol, currency };
938
- const res = yield this.baseRequest.get(`/chains/${chainId}/conversion-rate`, { params });
939
- return res.data;
940
- });
941
- }
942
- getGasEstimate(chainId, totalGasPrice) {
943
- return __async(this, null, function* () {
944
- const params = { totalGasPrice };
945
- const res = yield this.baseRequest.get(`/chains/${chainId}/gas-estimate`, { params });
946
- return res.data;
947
- });
948
- }
949
- getGasOracle(chainId) {
950
- return __async(this, null, function* () {
951
- const res = yield this.baseRequest.get(`/chains/${chainId}/gas-oracle`);
952
- return res.data;
953
- });
954
- }
955
- // GET /users/:userId/wallets/:walletId/refresh-done
956
- isRefreshDone(userId, walletId, partnerId, protocolId) {
957
- return __async(this, null, function* () {
958
- const queryParams = {};
959
- if (partnerId) queryParams["partnerId"] = partnerId;
960
- if (protocolId) queryParams["protocolId"] = protocolId;
961
- const query = import_qs.default.stringify(queryParams);
962
- const res = yield this.baseRequest.get(`/users/${userId}/wallets/${walletId}/refresh-done?${query}`);
963
- return res.data;
964
- });
965
- }
966
- deletePendingTransaction(userId, pendingTransactionId) {
967
- return __async(this, null, function* () {
968
- const res = yield this.baseRequest.delete(`/users/${userId}/pending-transactions/${pendingTransactionId}`);
969
- return res.data;
970
- });
971
- }
972
- // POST /users/:userId/passwords/key
973
- addSessionPasswordPublicKey(userId, body) {
974
- return __async(this, null, function* () {
975
- const res = yield this.baseRequest.post(`/users/${userId}/passwords/key`, body);
976
- return res;
977
- });
978
- }
979
- getSupportedAuthMethods(auth) {
980
- return __async(this, null, function* () {
981
- const res = yield this.baseRequest.get("/users/supported-auth-methods", {
982
- params: __spreadValues({}, auth)
983
- });
984
- return res.data;
985
- });
986
- }
987
- getPasswords(auth) {
988
- return __async(this, null, function* () {
989
- const res = yield this.baseRequest.get("/users/passwords", {
990
- params: __spreadValues({}, auth)
991
- });
992
- return res.data.passwords;
993
- });
994
- }
995
- // POST /passwords/verify
996
- verifyPasswordChallenge(partnerId, body) {
997
- return __async(this, null, function* () {
998
- const res = yield this.baseRequest.post(`/passwords/verify`, body, {
999
- headers: {
1000
- [PARTNER_ID_HEADER_NAME]: partnerId
1001
- }
1002
- });
1003
- return res;
1004
- });
1005
- }
1006
- getEncryptedWalletPrivateKey(passwordId) {
1007
- return __async(this, null, function* () {
1008
- const queryParams = {};
1009
- queryParams["passwordId"] = passwordId;
1010
- const query = import_qs.default.stringify(queryParams);
1011
- const res = yield this.baseRequest.get(`/encrypted-wallet-private-keys?${query}`);
1012
- return res;
1013
- });
1014
- }
1015
- // GET /users/:userId
1016
- getUser(userId) {
1017
- return __async(this, null, function* () {
1018
- const res = yield this.baseRequest.get(`/users/${userId}`);
1019
- return res.data;
1020
- });
1021
- }
1022
- // GET /users/:userId/accounts
1023
- getAccountMetadata(userId, partnerId) {
1024
- return __async(this, null, function* () {
1025
- const res = yield this.baseRequest.get(`/users/${userId}/oauth/accounts`, {
1026
- params: { partnerId }
1027
- });
1028
- return {
1029
- accountMetadata: Object.entries(res.data.accountMetadata || {}).reduce(
1030
- (acc, [method, obj]) => __spreadProps(__spreadValues({}, acc), {
1031
- [method]: __spreadProps(__spreadValues({}, obj), {
1032
- date: new Date(obj.date)
1033
- })
1034
- }),
1035
- {}
1036
- )
1037
- };
1038
- });
1039
- }
1040
- };
1041
- var client_default = Client;
1042
-
1043
- // src/types/auth.ts
1044
- var EncryptorType = /* @__PURE__ */ ((EncryptorType2) => {
1045
- EncryptorType2["USER"] = "USER";
1046
- EncryptorType2["RECOVERY"] = "RECOVERY";
1047
- EncryptorType2["BIOMETRICS"] = "BIOMETRICS";
1048
- EncryptorType2["PASSWORD"] = "PASSWORD";
1049
- return EncryptorType2;
1050
- })(EncryptorType || {});
1051
- var KeyShareType = /* @__PURE__ */ ((KeyShareType2) => {
1052
- KeyShareType2["USER"] = "USER";
1053
- KeyShareType2["RECOVERY"] = "RECOVERY";
1054
- return KeyShareType2;
1055
- })(KeyShareType || {});
1056
- var PasswordStatus = /* @__PURE__ */ ((PasswordStatus2) => {
1057
- PasswordStatus2["PENDING"] = "PENDING";
1058
- PasswordStatus2["COMPLETE"] = "COMPLETE";
1059
- return PasswordStatus2;
1060
- })(PasswordStatus || {});
1061
- var PublicKeyStatus = /* @__PURE__ */ ((PublicKeyStatus2) => {
1062
- PublicKeyStatus2["PENDING"] = "PENDING";
1063
- PublicKeyStatus2["COMPLETE"] = "COMPLETE";
1064
- return PublicKeyStatus2;
1065
- })(PublicKeyStatus || {});
1066
- var PublicKeyType = /* @__PURE__ */ ((PublicKeyType2) => {
1067
- PublicKeyType2["MOBILE"] = "MOBILE";
1068
- PublicKeyType2["WEB"] = "WEB";
1069
- return PublicKeyType2;
1070
- })(PublicKeyType || {});
1071
- var OAuthMethod = /* @__PURE__ */ ((OAuthMethod2) => {
1072
- OAuthMethod2["GOOGLE"] = "GOOGLE";
1073
- OAuthMethod2["TWITTER"] = "TWITTER";
1074
- OAuthMethod2["APPLE"] = "APPLE";
1075
- OAuthMethod2["DISCORD"] = "DISCORD";
1076
- OAuthMethod2["FACEBOOK"] = "FACEBOOK";
1077
- OAuthMethod2["FARCASTER"] = "FARCASTER";
1078
- OAuthMethod2["TELEGRAM"] = "TELEGRAM";
1079
- return OAuthMethod2;
1080
- })(OAuthMethod || {});
1081
- var AuthMethod = /* @__PURE__ */ ((AuthMethod2) => {
1082
- AuthMethod2["PASSWORD"] = "PASSWORD";
1083
- AuthMethod2["PASSKEY"] = "PASSKEY";
1084
- return AuthMethod2;
1085
- })(AuthMethod || {});
1086
-
1087
- // src/types/email.ts
1088
- var EmailTheme = /* @__PURE__ */ ((EmailTheme2) => {
1089
- EmailTheme2["LIGHT"] = "light";
1090
- EmailTheme2["DARK"] = "dark";
1091
- return EmailTheme2;
1092
- })(EmailTheme || {});
1093
-
1094
- // src/types/onRamp.ts
1095
- var OnRampProvider = /* @__PURE__ */ ((OnRampProvider2) => {
1096
- OnRampProvider2["RAMP"] = "RAMP";
1097
- OnRampProvider2["STRIPE"] = "STRIPE";
1098
- OnRampProvider2["MOONPAY"] = "MOONPAY";
1099
- return OnRampProvider2;
1100
- })(OnRampProvider || {});
1101
- var OnRampAsset = /* @__PURE__ */ ((OnRampAsset2) => {
1102
- OnRampAsset2["ETHEREUM"] = "ETHEREUM";
1103
- OnRampAsset2["USDC"] = "USDC";
1104
- OnRampAsset2["TETHER"] = "TETHER";
1105
- OnRampAsset2["POLYGON"] = "POLYGON";
1106
- OnRampAsset2["SOLANA"] = "SOLANA";
1107
- OnRampAsset2["ATOM"] = "ATOM";
1108
- OnRampAsset2["CELO"] = "CELO";
1109
- OnRampAsset2["CUSD"] = "CUSD";
1110
- OnRampAsset2["CEUR"] = "CEUR";
1111
- OnRampAsset2["CREAL"] = "CREAL";
1112
- return OnRampAsset2;
1113
- })(OnRampAsset || {});
1114
- var OnRampPurchaseStatus = /* @__PURE__ */ ((OnRampPurchaseStatus2) => {
1115
- OnRampPurchaseStatus2["INITIATED"] = "INITIATED";
1116
- OnRampPurchaseStatus2["FINISHED"] = "FINISHED";
1117
- OnRampPurchaseStatus2["CANCELLED"] = "CANCELLED";
1118
- return OnRampPurchaseStatus2;
1119
- })(OnRampPurchaseStatus || {});
1120
- var OnRampPurchaseType = /* @__PURE__ */ ((OnRampPurchaseType2) => {
1121
- OnRampPurchaseType2["BUY"] = "BUY";
1122
- OnRampPurchaseType2["SELL"] = "SELL";
1123
- return OnRampPurchaseType2;
1124
- })(OnRampPurchaseType || {});
1125
-
1126
- // src/types/wallet.ts
1127
- var WalletScheme = /* @__PURE__ */ ((WalletScheme2) => {
1128
- WalletScheme2["DKLS"] = "DKLS";
1129
- WalletScheme2["CGGMP"] = "CGGMP";
1130
- WalletScheme2["ED25519"] = "ED25519";
1131
- return WalletScheme2;
1132
- })(WalletScheme || {});
1133
- var WalletType = /* @__PURE__ */ ((WalletType2) => {
1134
- WalletType2["EVM"] = "EVM";
1135
- WalletType2["SOLANA"] = "SOLANA";
1136
- WalletType2["COSMOS"] = "COSMOS";
1137
- return WalletType2;
1138
- })(WalletType || {});
1139
- var Chain = /* @__PURE__ */ ((Chain2) => {
1140
- Chain2["ETH"] = "ETH";
1141
- Chain2["CELO"] = "CELO";
1142
- Chain2["MATIC"] = "MATIC";
1143
- return Chain2;
1144
- })(Chain || {});
1145
- var Network = /* @__PURE__ */ ((Network2) => {
1146
- Network2["ETHEREUM"] = "ETHEREUM";
1147
- Network2["SEPOLIA"] = "SEPOLIA";
1148
- Network2["ARBITRUM"] = "ARBITRUM";
1149
- Network2["BASE"] = "BASE";
1150
- Network2["OPTIMISM"] = "OPTIMISM";
1151
- Network2["POLYGON"] = "POLYGON";
1152
- Network2["SOLANA"] = "SOLANA";
1153
- Network2["COSMOS"] = "COSMOS";
1154
- Network2["CELO"] = "CELO";
1155
- Network2["NOBLE"] = "NOBLE";
1156
- return Network2;
1157
- })(Network || {});
1158
- var PREGEN_IDENTIFIER_TYPES = [
1159
- "EMAIL",
1160
- "PHONE",
1161
- "CUSTOM_ID",
1162
- "DISCORD" /* DISCORD */,
1163
- "TWITTER" /* TWITTER */,
1164
- "TELEGRAM" /* TELEGRAM */
1165
- ];
1166
- var NON_ED25519 = ["DKLS" /* DKLS */, "CGGMP" /* CGGMP */];
1167
-
1168
- // src/index.ts
1169
- var src_default = client_default;
34
+ __reExport(src_exports, require("./client.js"), module.exports);
35
+ __reExport(src_exports, require("./types/index.js"), module.exports);
36
+ __reExport(src_exports, require("./utils.js"), module.exports);
37
+ var import_client = __toESM(require("./client.js"));
38
+ var src_default = import_client.default;
1170
39
  // Annotate the CommonJS export names for ESM import in node:
1171
40
  0 && (module.exports = {
1172
- AuthMethod,
1173
- Chain,
1174
- EmailTheme,
1175
- EncryptorType,
1176
- KeyShareType,
1177
- NON_ED25519,
1178
- Network,
1179
- OAuthMethod,
1180
- OnRampAsset,
1181
- OnRampProvider,
1182
- OnRampPurchaseStatus,
1183
- OnRampPurchaseType,
1184
- PREGEN_IDENTIFIER_TYPES,
1185
- PasswordStatus,
1186
- PublicKeyStatus,
1187
- PublicKeyType,
1188
- WalletScheme,
1189
- WalletType,
1190
- extractAuthInfo,
1191
- extractWalletRef,
1192
- handleResponseError,
1193
- handleResponseSuccess,
1194
- isEmail,
1195
- isExternalWallet,
1196
- isExternalWalletAddress,
1197
- isFarcaster,
1198
- isPhone,
1199
- isTelegram,
1200
- isUserId,
1201
- isWalletId
41
+ ...require("./client.js"),
42
+ ...require("./types/index.js"),
43
+ ...require("./utils.js")
1202
44
  });