@getpara/user-management-client 2.0.0-alpha.3 → 2.0.0-alpha.6

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