@getpara/user-management-client 2.0.0-dev.0 → 2.0.0-dev.2

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