@getpara/user-management-client 2.0.0-alpha.52 → 2.0.0-alpha.54
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/client.js +75 -5
- package/dist/cjs/index.js +3 -3
- package/dist/esm/client.js +75 -5
- package/dist/esm/index.js +1 -1
- package/dist/types/client.d.ts +59 -8
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils.d.ts +1 -3
- package/package.json +3 -2
- package/dist/cjs/types/auth.js +0 -120
- package/dist/cjs/types/email.js +0 -31
- package/dist/cjs/types/index.js +0 -29
- package/dist/cjs/types/onRamp.js +0 -63
- package/dist/cjs/types/partner.js +0 -15
- package/dist/cjs/types/wallet.js +0 -112
- package/dist/esm/types/auth.js +0 -88
- package/dist/esm/types/email.js +0 -9
- package/dist/esm/types/index.js +0 -5
- package/dist/esm/types/onRamp.js +0 -38
- package/dist/esm/types/partner.js +0 -0
- package/dist/esm/types/wallet.js +0 -79
- package/dist/types/types/auth.d.ts +0 -271
- package/dist/types/types/email.d.ts +0 -27
- package/dist/types/types/index.d.ts +0 -5
- package/dist/types/types/onRamp.d.ts +0 -69
- package/dist/types/types/partner.d.ts +0 -21
- package/dist/types/types/wallet.d.ts +0 -79
package/dist/cjs/client.js
CHANGED
|
@@ -132,9 +132,13 @@ class Client {
|
|
|
132
132
|
});
|
|
133
133
|
return res.data;
|
|
134
134
|
});
|
|
135
|
-
this.verifyTelegram = (
|
|
135
|
+
this.verifyTelegram = (_0) => __async(this, [_0], function* ({
|
|
136
|
+
authObject,
|
|
137
|
+
sessionLookupId
|
|
138
|
+
}) {
|
|
136
139
|
return (yield this.baseRequest.post("/users/telegram/v2", {
|
|
137
|
-
authObject
|
|
140
|
+
authObject,
|
|
141
|
+
sessionLookupId
|
|
138
142
|
})).data;
|
|
139
143
|
});
|
|
140
144
|
this.verifyOAuth = () => __async(this, null, function* () {
|
|
@@ -152,7 +156,10 @@ class Client {
|
|
|
152
156
|
return res.data;
|
|
153
157
|
});
|
|
154
158
|
this.verifyAccount = (userId, body) => __async(this, null, function* () {
|
|
155
|
-
const res = yield this.baseRequest.post(
|
|
159
|
+
const res = yield this.baseRequest.post(
|
|
160
|
+
`/users/${userId}/verify`,
|
|
161
|
+
body
|
|
162
|
+
);
|
|
156
163
|
return res.data;
|
|
157
164
|
});
|
|
158
165
|
// POST /users/send-login-code
|
|
@@ -271,11 +278,21 @@ class Client {
|
|
|
271
278
|
const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/origin`);
|
|
272
279
|
return res.data;
|
|
273
280
|
});
|
|
281
|
+
// GET /sessions/:sessionLookupId/login-method
|
|
282
|
+
this.sessionLoginMethod = (sessionLookupId) => __async(this, null, function* () {
|
|
283
|
+
const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/login-method`);
|
|
284
|
+
return res.data;
|
|
285
|
+
});
|
|
274
286
|
// GET /sessions/:sessionLookupId/auth-verified
|
|
275
287
|
this.sessionAuthVerified = (sessionLookupId) => __async(this, null, function* () {
|
|
276
288
|
const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/auth-verified`);
|
|
277
289
|
return res.data;
|
|
278
290
|
});
|
|
291
|
+
// GET /sessions/:sessionLookupId/auth
|
|
292
|
+
this.sessionAuth = (sessionLookupId) => __async(this, null, function* () {
|
|
293
|
+
const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/auth`);
|
|
294
|
+
return res.data;
|
|
295
|
+
});
|
|
279
296
|
// POST /biometrics/verify
|
|
280
297
|
this.verifyWebChallenge = (partnerId, body) => __async(this, null, function* () {
|
|
281
298
|
const res = yield this.baseRequest.post(`/biometrics/verify`, body, {
|
|
@@ -432,12 +449,65 @@ class Client {
|
|
|
432
449
|
const res = yield this.baseRequest.post(`/auth/jwt`, { keyIndex });
|
|
433
450
|
return res.data;
|
|
434
451
|
});
|
|
452
|
+
this.getProfileBalance = (_0) => __async(this, [_0], function* ({
|
|
453
|
+
config,
|
|
454
|
+
wallets,
|
|
455
|
+
refetch
|
|
456
|
+
}) {
|
|
457
|
+
const res = yield this.baseRequest.post(`/assets/balances`, {
|
|
458
|
+
config,
|
|
459
|
+
wallets,
|
|
460
|
+
refetch
|
|
461
|
+
});
|
|
462
|
+
return res.data;
|
|
463
|
+
});
|
|
464
|
+
this.getAssetInfo = () => __async(this, null, function* () {
|
|
465
|
+
const res = yield this.baseRequest.get(`/assets`);
|
|
466
|
+
return res.data;
|
|
467
|
+
});
|
|
435
468
|
this.trackError = (opts) => __async(this, null, function* () {
|
|
436
469
|
yield this.baseRequest.post("/errors/sdk", opts);
|
|
437
470
|
});
|
|
438
471
|
this.trackReactSdkAnalytics = (opts) => __async(this, null, function* () {
|
|
439
472
|
yield this.baseRequest.post("/partners/analytics/react-sdk", opts);
|
|
440
473
|
});
|
|
474
|
+
// ENCLAVE METHODS
|
|
475
|
+
/**
|
|
476
|
+
* Get the enclave's public key for encryption
|
|
477
|
+
*/
|
|
478
|
+
this.getEnclavePublicKey = () => __async(this, null, function* () {
|
|
479
|
+
const res = yield this.baseRequest.get(
|
|
480
|
+
"/enclave/public-key"
|
|
481
|
+
);
|
|
482
|
+
return res.data;
|
|
483
|
+
});
|
|
484
|
+
/**
|
|
485
|
+
* Persist encrypted key shares to the enclave
|
|
486
|
+
* @param encryptedPayload JSON string containing the encrypted ECIES payload
|
|
487
|
+
*/
|
|
488
|
+
this.persistEnclaveShares = (encryptedPayload) => __async(this, null, function* () {
|
|
489
|
+
const body = { encryptedPayload };
|
|
490
|
+
const res = yield this.baseRequest.post("/enclave/key-shares", body);
|
|
491
|
+
return res.data;
|
|
492
|
+
});
|
|
493
|
+
/**
|
|
494
|
+
* Retrieve encrypted key shares from the enclave
|
|
495
|
+
* @param encryptedPayload JSON string containing the encrypted ECIES query
|
|
496
|
+
*/
|
|
497
|
+
this.retrieveEnclaveShares = (encryptedPayload) => __async(this, null, function* () {
|
|
498
|
+
const res = yield this.baseRequest.get(
|
|
499
|
+
`/enclave/key-shares?encryptedPayload=${encodeURIComponent(encryptedPayload)}`
|
|
500
|
+
);
|
|
501
|
+
return res.data;
|
|
502
|
+
});
|
|
503
|
+
this.issueEnclaveJwt = (encryptedPayload) => __async(this, null, function* () {
|
|
504
|
+
const res = yield this.baseRequest.post(`/enclave/jwt/issue`, { encryptedPayload });
|
|
505
|
+
return res.data;
|
|
506
|
+
});
|
|
507
|
+
this.refreshEnclaveJwt = (encryptedPayload) => __async(this, null, function* () {
|
|
508
|
+
const res = yield this.baseRequest.post(`/enclave/jwt/refresh`, { encryptedPayload });
|
|
509
|
+
return res.data;
|
|
510
|
+
});
|
|
441
511
|
const headers = __spreadValues(__spreadValues({}, apiKey && { [import_consts.API_KEY_HEADER_NAME]: apiKey }), partnerId && { [import_consts.PARTNER_ID_HEADER_NAME]: partnerId });
|
|
442
512
|
const axiosConfig = {
|
|
443
513
|
baseURL: userManagementHost,
|
|
@@ -613,8 +683,8 @@ class Client {
|
|
|
613
683
|
});
|
|
614
684
|
}
|
|
615
685
|
getFarcasterAuthStatus() {
|
|
616
|
-
return __async(this,
|
|
617
|
-
const res = yield this.baseRequest.post(`/auth/farcaster/status/v2
|
|
686
|
+
return __async(this, arguments, function* ({ sessionLookupId } = {}) {
|
|
687
|
+
const res = yield this.baseRequest.post(`/auth/farcaster/status/v2`, { sessionLookupId });
|
|
618
688
|
return res.data;
|
|
619
689
|
});
|
|
620
690
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -32,15 +32,15 @@ __export(src_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(src_exports);
|
|
34
34
|
__reExport(src_exports, require("./client.js"), module.exports);
|
|
35
|
-
__reExport(src_exports, require("./types/index.js"), module.exports);
|
|
36
35
|
__reExport(src_exports, require("./utils.js"), module.exports);
|
|
37
36
|
__reExport(src_exports, require("./error.js"), module.exports);
|
|
37
|
+
__reExport(src_exports, require("@getpara/shared"), module.exports);
|
|
38
38
|
var import_client = __toESM(require("./client.js"));
|
|
39
39
|
var src_default = import_client.default;
|
|
40
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
41
|
0 && (module.exports = {
|
|
42
42
|
...require("./client.js"),
|
|
43
|
-
...require("./types/index.js"),
|
|
44
43
|
...require("./utils.js"),
|
|
45
|
-
...require("./error.js")
|
|
44
|
+
...require("./error.js"),
|
|
45
|
+
...require("@getpara/shared")
|
|
46
46
|
});
|
package/dist/esm/client.js
CHANGED
|
@@ -55,9 +55,13 @@ class Client {
|
|
|
55
55
|
});
|
|
56
56
|
return res.data;
|
|
57
57
|
});
|
|
58
|
-
this.verifyTelegram = (
|
|
58
|
+
this.verifyTelegram = (_0) => __async(this, [_0], function* ({
|
|
59
|
+
authObject,
|
|
60
|
+
sessionLookupId
|
|
61
|
+
}) {
|
|
59
62
|
return (yield this.baseRequest.post("/users/telegram/v2", {
|
|
60
|
-
authObject
|
|
63
|
+
authObject,
|
|
64
|
+
sessionLookupId
|
|
61
65
|
})).data;
|
|
62
66
|
});
|
|
63
67
|
this.verifyOAuth = () => __async(this, null, function* () {
|
|
@@ -75,7 +79,10 @@ class Client {
|
|
|
75
79
|
return res.data;
|
|
76
80
|
});
|
|
77
81
|
this.verifyAccount = (userId, body) => __async(this, null, function* () {
|
|
78
|
-
const res = yield this.baseRequest.post(
|
|
82
|
+
const res = yield this.baseRequest.post(
|
|
83
|
+
`/users/${userId}/verify`,
|
|
84
|
+
body
|
|
85
|
+
);
|
|
79
86
|
return res.data;
|
|
80
87
|
});
|
|
81
88
|
// POST /users/send-login-code
|
|
@@ -194,11 +201,21 @@ class Client {
|
|
|
194
201
|
const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/origin`);
|
|
195
202
|
return res.data;
|
|
196
203
|
});
|
|
204
|
+
// GET /sessions/:sessionLookupId/login-method
|
|
205
|
+
this.sessionLoginMethod = (sessionLookupId) => __async(this, null, function* () {
|
|
206
|
+
const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/login-method`);
|
|
207
|
+
return res.data;
|
|
208
|
+
});
|
|
197
209
|
// GET /sessions/:sessionLookupId/auth-verified
|
|
198
210
|
this.sessionAuthVerified = (sessionLookupId) => __async(this, null, function* () {
|
|
199
211
|
const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/auth-verified`);
|
|
200
212
|
return res.data;
|
|
201
213
|
});
|
|
214
|
+
// GET /sessions/:sessionLookupId/auth
|
|
215
|
+
this.sessionAuth = (sessionLookupId) => __async(this, null, function* () {
|
|
216
|
+
const res = yield this.baseRequest.get(`/sessions/${sessionLookupId}/auth`);
|
|
217
|
+
return res.data;
|
|
218
|
+
});
|
|
202
219
|
// POST /biometrics/verify
|
|
203
220
|
this.verifyWebChallenge = (partnerId, body) => __async(this, null, function* () {
|
|
204
221
|
const res = yield this.baseRequest.post(`/biometrics/verify`, body, {
|
|
@@ -355,12 +372,65 @@ class Client {
|
|
|
355
372
|
const res = yield this.baseRequest.post(`/auth/jwt`, { keyIndex });
|
|
356
373
|
return res.data;
|
|
357
374
|
});
|
|
375
|
+
this.getProfileBalance = (_0) => __async(this, [_0], function* ({
|
|
376
|
+
config,
|
|
377
|
+
wallets,
|
|
378
|
+
refetch
|
|
379
|
+
}) {
|
|
380
|
+
const res = yield this.baseRequest.post(`/assets/balances`, {
|
|
381
|
+
config,
|
|
382
|
+
wallets,
|
|
383
|
+
refetch
|
|
384
|
+
});
|
|
385
|
+
return res.data;
|
|
386
|
+
});
|
|
387
|
+
this.getAssetInfo = () => __async(this, null, function* () {
|
|
388
|
+
const res = yield this.baseRequest.get(`/assets`);
|
|
389
|
+
return res.data;
|
|
390
|
+
});
|
|
358
391
|
this.trackError = (opts) => __async(this, null, function* () {
|
|
359
392
|
yield this.baseRequest.post("/errors/sdk", opts);
|
|
360
393
|
});
|
|
361
394
|
this.trackReactSdkAnalytics = (opts) => __async(this, null, function* () {
|
|
362
395
|
yield this.baseRequest.post("/partners/analytics/react-sdk", opts);
|
|
363
396
|
});
|
|
397
|
+
// ENCLAVE METHODS
|
|
398
|
+
/**
|
|
399
|
+
* Get the enclave's public key for encryption
|
|
400
|
+
*/
|
|
401
|
+
this.getEnclavePublicKey = () => __async(this, null, function* () {
|
|
402
|
+
const res = yield this.baseRequest.get(
|
|
403
|
+
"/enclave/public-key"
|
|
404
|
+
);
|
|
405
|
+
return res.data;
|
|
406
|
+
});
|
|
407
|
+
/**
|
|
408
|
+
* Persist encrypted key shares to the enclave
|
|
409
|
+
* @param encryptedPayload JSON string containing the encrypted ECIES payload
|
|
410
|
+
*/
|
|
411
|
+
this.persistEnclaveShares = (encryptedPayload) => __async(this, null, function* () {
|
|
412
|
+
const body = { encryptedPayload };
|
|
413
|
+
const res = yield this.baseRequest.post("/enclave/key-shares", body);
|
|
414
|
+
return res.data;
|
|
415
|
+
});
|
|
416
|
+
/**
|
|
417
|
+
* Retrieve encrypted key shares from the enclave
|
|
418
|
+
* @param encryptedPayload JSON string containing the encrypted ECIES query
|
|
419
|
+
*/
|
|
420
|
+
this.retrieveEnclaveShares = (encryptedPayload) => __async(this, null, function* () {
|
|
421
|
+
const res = yield this.baseRequest.get(
|
|
422
|
+
`/enclave/key-shares?encryptedPayload=${encodeURIComponent(encryptedPayload)}`
|
|
423
|
+
);
|
|
424
|
+
return res.data;
|
|
425
|
+
});
|
|
426
|
+
this.issueEnclaveJwt = (encryptedPayload) => __async(this, null, function* () {
|
|
427
|
+
const res = yield this.baseRequest.post(`/enclave/jwt/issue`, { encryptedPayload });
|
|
428
|
+
return res.data;
|
|
429
|
+
});
|
|
430
|
+
this.refreshEnclaveJwt = (encryptedPayload) => __async(this, null, function* () {
|
|
431
|
+
const res = yield this.baseRequest.post(`/enclave/jwt/refresh`, { encryptedPayload });
|
|
432
|
+
return res.data;
|
|
433
|
+
});
|
|
364
434
|
const headers = __spreadValues(__spreadValues({}, apiKey && { [API_KEY_HEADER_NAME]: apiKey }), partnerId && { [PARTNER_ID_HEADER_NAME]: partnerId });
|
|
365
435
|
const axiosConfig = {
|
|
366
436
|
baseURL: userManagementHost,
|
|
@@ -536,8 +606,8 @@ class Client {
|
|
|
536
606
|
});
|
|
537
607
|
}
|
|
538
608
|
getFarcasterAuthStatus() {
|
|
539
|
-
return __async(this,
|
|
540
|
-
const res = yield this.baseRequest.post(`/auth/farcaster/status/v2
|
|
609
|
+
return __async(this, arguments, function* ({ sessionLookupId } = {}) {
|
|
610
|
+
const res = yield this.baseRequest.post(`/auth/farcaster/status/v2`, { sessionLookupId });
|
|
541
611
|
return res.data;
|
|
542
612
|
});
|
|
543
613
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./chunk-BBZEL7EG.js";
|
|
2
2
|
export * from "./client.js";
|
|
3
|
-
export * from "./types/index.js";
|
|
4
3
|
export * from "./utils.js";
|
|
5
4
|
export * from "./error.js";
|
|
5
|
+
export * from "@getpara/shared";
|
|
6
6
|
import Client from "./client.js";
|
|
7
7
|
var src_default = Client;
|
|
8
8
|
export {
|
package/dist/types/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
|
-
import { AccountMetadata, Auth, AuthIdentifier, AuthMethod, BackupKitEmailProps, BiometricLocationHint, Chain, CurrentWalletIds, EncryptedKeyShare, EncryptorType, ExternalWalletInfo, LoginExternalWalletResponse, KeyShareType, Network, OnRampAsset, OnRampConfig, OnRampProvider, OnRampPurchase, OnRampPurchaseCreateParams, OnRampPurchaseUpdateParams,
|
|
2
|
+
import { AccountMetadata, Auth, AuthIdentifier, AuthMethod, BackupKitEmailProps, BiometricLocationHint, Chain, CurrentWalletIds, EncryptedKeyShare, EncryptorType, ExternalWalletInfo, LoginExternalWalletResponse, KeyShareType, Network, OnRampAsset, OnRampConfig, OnRampProvider, OnRampPurchase, OnRampPurchaseCreateParams, OnRampPurchaseUpdateParams, AuthMethodStatus, PregenIds, PrimaryAuth, PublicKeyType, ServerAuthStateSignup, SessionInfo, Setup2faResponse, SignUpOrLogInResponse, TelegramAuthResponse, TPregenIdentifierType, VerificationEmailProps, VerifiedAuth, VerifyFarcasterResponse, VerifyTelegramResponse, VerifyThirdPartyAuth, WalletEntity, WalletParams, TWalletScheme, TWalletType, VerifyExternalWalletParams, IssueJwtParams, IssueJwtResponse, LinkAccountParams, LinkedAccounts, ResendVerificationCodeParams, AssetMetadataIndexed, GetProfileBalanceParams, ProfileBalance, LegacyAuthMethod, PrimaryAuthInfo, ServerAuthStateLogin, ServerAuthStateDone } from '@getpara/shared';
|
|
3
3
|
interface ConfigOpts {
|
|
4
4
|
useFetchAdapter?: boolean;
|
|
5
5
|
}
|
|
@@ -27,7 +27,7 @@ interface getWebChallengeRes {
|
|
|
27
27
|
interface sessionPublicKeyBody {
|
|
28
28
|
publicKey?: string;
|
|
29
29
|
sigDerivedPublicKey?: string;
|
|
30
|
-
status?:
|
|
30
|
+
status?: AuthMethodStatus;
|
|
31
31
|
type?: PublicKeyType;
|
|
32
32
|
cosePublicKey?: string;
|
|
33
33
|
clientDataJSON?: string;
|
|
@@ -65,7 +65,7 @@ interface GetWalletsRes {
|
|
|
65
65
|
interface PasswordEntity {
|
|
66
66
|
id: string;
|
|
67
67
|
userId: string;
|
|
68
|
-
status:
|
|
68
|
+
status: AuthMethodStatus;
|
|
69
69
|
sigDerivedPublicKey: string;
|
|
70
70
|
salt: string;
|
|
71
71
|
isPIN?: boolean;
|
|
@@ -114,7 +114,7 @@ interface AcceptScopesBody {
|
|
|
114
114
|
partnerId: string;
|
|
115
115
|
}
|
|
116
116
|
interface sessionPasswordBody {
|
|
117
|
-
status?:
|
|
117
|
+
status?: AuthMethodStatus;
|
|
118
118
|
sigDerivedPublicKey?: string;
|
|
119
119
|
salt?: string;
|
|
120
120
|
encryptedWalletPrivateKey?: string;
|
|
@@ -151,13 +151,16 @@ declare class Client {
|
|
|
151
151
|
*/
|
|
152
152
|
createUser: (body: VerifiedAuth & VerificationEmailProps) => Promise<createUserIdRes>;
|
|
153
153
|
checkUserExists: (auth: VerifiedAuth) => Promise<any>;
|
|
154
|
-
verifyTelegram: (authObject
|
|
154
|
+
verifyTelegram: ({ authObject, sessionLookupId, }: {
|
|
155
|
+
authObject: TelegramAuthResponse;
|
|
156
|
+
sessionLookupId?: string;
|
|
157
|
+
}) => Promise<VerifyTelegramResponse>;
|
|
155
158
|
verifyOAuth: () => Promise<VerifyThirdPartyAuth | null>;
|
|
156
159
|
loginExternalWallet: ({ externalWallet, shouldTrackUser, }: {
|
|
157
160
|
externalWallet: ExternalWalletInfo;
|
|
158
161
|
shouldTrackUser?: boolean;
|
|
159
162
|
}) => Promise<LoginExternalWalletResponse>;
|
|
160
|
-
verifyAccount: (userId: string, body: verifyBody) => Promise<ServerAuthStateSignup | ServerAuthStateLogin>;
|
|
163
|
+
verifyAccount: (userId: string, body: verifyBody) => Promise<ServerAuthStateSignup | ServerAuthStateLogin | ServerAuthStateDone>;
|
|
161
164
|
sendLoginVerificationCode: (auth: PrimaryAuthInfo, isRecovery?: boolean) => Promise<{
|
|
162
165
|
userId: string;
|
|
163
166
|
}>;
|
|
@@ -208,9 +211,21 @@ declare class Client {
|
|
|
208
211
|
sessionOrigin: (sessionLookupId: string) => Promise<{
|
|
209
212
|
origin?: string;
|
|
210
213
|
}>;
|
|
214
|
+
sessionLoginMethod: (sessionLookupId: string) => Promise<{
|
|
215
|
+
loginMethod?: string;
|
|
216
|
+
}>;
|
|
211
217
|
sessionAuthVerified: (sessionLookupId: string) => Promise<{
|
|
212
218
|
authVerified?: boolean;
|
|
213
219
|
}>;
|
|
220
|
+
sessionAuth: (sessionLookupId: string) => Promise<{
|
|
221
|
+
userId: string;
|
|
222
|
+
authVerified?: boolean;
|
|
223
|
+
loginAuthMethods: {
|
|
224
|
+
methods: AuthMethod[];
|
|
225
|
+
};
|
|
226
|
+
auth: PrimaryAuth;
|
|
227
|
+
isNewUser: boolean;
|
|
228
|
+
}>;
|
|
214
229
|
verifyWebChallenge: (partnerId: string, body: verifyWebChallengeBody) => Promise<any>;
|
|
215
230
|
getSessionChallenge: (userId: string) => Promise<any>;
|
|
216
231
|
verifySessionChallenge: (userId: string, body: verifySessionChallengeBody) => Promise<any>;
|
|
@@ -266,7 +281,9 @@ declare class Client {
|
|
|
266
281
|
initializeFarcasterLogin({ appScheme }?: {
|
|
267
282
|
appScheme?: string;
|
|
268
283
|
}): Promise<any>;
|
|
269
|
-
getFarcasterAuthStatus(
|
|
284
|
+
getFarcasterAuthStatus({ sessionLookupId }?: {
|
|
285
|
+
sessionLookupId?: string;
|
|
286
|
+
}): Promise<VerifyFarcasterResponse>;
|
|
270
287
|
initializeRecoveryForPhone(phone: string, countryCode: string): Promise<AxiosResponse<any, any>>;
|
|
271
288
|
finalizeRecovery(userId: string, walletId: string): Promise<AxiosResponse<any, any>>;
|
|
272
289
|
recoverUserShares(userId: string, walletId: string): Promise<AxiosResponse<{
|
|
@@ -309,7 +326,7 @@ declare class Client {
|
|
|
309
326
|
getOnRampPurchase({ userId, purchaseId, ...params }: {
|
|
310
327
|
userId: string;
|
|
311
328
|
purchaseId: string;
|
|
312
|
-
} & WalletParams): Promise<AxiosResponse<
|
|
329
|
+
} & WalletParams): Promise<AxiosResponse<import("@getpara/shared").IOnRampPurchase, any>>;
|
|
313
330
|
signMoonPayUrl(userId: string, { url, type, cosmosPrefix, testMode, walletId, externalWalletAddress, }: {
|
|
314
331
|
url: string;
|
|
315
332
|
type: TWalletType;
|
|
@@ -402,6 +419,12 @@ declare class Client {
|
|
|
402
419
|
rpcUrl?: string;
|
|
403
420
|
}) => Promise<GetWalletBalanceRes>;
|
|
404
421
|
issueJwt: ({ keyIndex }?: IssueJwtParams) => Promise<IssueJwtResponse>;
|
|
422
|
+
getProfileBalance: ({ config, wallets, refetch, }: GetProfileBalanceParams) => Promise<{
|
|
423
|
+
balance: ProfileBalance;
|
|
424
|
+
}>;
|
|
425
|
+
getAssetInfo: () => Promise<{
|
|
426
|
+
assets: AssetMetadataIndexed;
|
|
427
|
+
}>;
|
|
405
428
|
trackError: (opts: {
|
|
406
429
|
methodName: string;
|
|
407
430
|
error: {
|
|
@@ -415,5 +438,33 @@ declare class Client {
|
|
|
415
438
|
props: object;
|
|
416
439
|
reactSdkVersion: string;
|
|
417
440
|
}) => Promise<void>;
|
|
441
|
+
/**
|
|
442
|
+
* Get the enclave's public key for encryption
|
|
443
|
+
*/
|
|
444
|
+
getEnclavePublicKey: () => Promise<{
|
|
445
|
+
publicKey: string;
|
|
446
|
+
keyFingerprint: string;
|
|
447
|
+
generatedAt: string;
|
|
448
|
+
}>;
|
|
449
|
+
/**
|
|
450
|
+
* Persist encrypted key shares to the enclave
|
|
451
|
+
* @param encryptedPayload JSON string containing the encrypted ECIES payload
|
|
452
|
+
*/
|
|
453
|
+
persistEnclaveShares: (encryptedPayload: string) => Promise<{
|
|
454
|
+
payload: any;
|
|
455
|
+
}>;
|
|
456
|
+
/**
|
|
457
|
+
* Retrieve encrypted key shares from the enclave
|
|
458
|
+
* @param encryptedPayload JSON string containing the encrypted ECIES query
|
|
459
|
+
*/
|
|
460
|
+
retrieveEnclaveShares: (encryptedPayload: string) => Promise<{
|
|
461
|
+
payload: any;
|
|
462
|
+
}>;
|
|
463
|
+
issueEnclaveJwt: (encryptedPayload: string) => Promise<{
|
|
464
|
+
payload: string;
|
|
465
|
+
}>;
|
|
466
|
+
refreshEnclaveJwt: (encryptedPayload: string) => Promise<{
|
|
467
|
+
payload: string;
|
|
468
|
+
}>;
|
|
418
469
|
}
|
|
419
470
|
export default Client;
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Auth, AuthInfo, AuthParams, PrimaryAuth, PrimaryAuthInfo, VerifiedAuth, WalletParams, WalletRef } from '
|
|
2
|
-
import { AccountMetadata, AccountMetadataKey, LinkedAccounts, PregenAuth, PregenAuthInfo, PregenOrGuestAuth } from './types/auth.js';
|
|
3
|
-
import { PregenIds, TPregenIdentifierType } from './types/wallet.js';
|
|
1
|
+
import { Auth, AuthInfo, AuthParams, PrimaryAuth, PrimaryAuthInfo, VerifiedAuth, WalletParams, WalletRef, AccountMetadata, AccountMetadataKey, LinkedAccounts, PregenAuth, PregenAuthInfo, PregenOrGuestAuth, PregenIds, TPregenIdentifierType } from '@getpara/shared';
|
|
4
2
|
export declare function isWalletId(params: WalletParams): params is {
|
|
5
3
|
walletId: string;
|
|
6
4
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/user-management-client",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.54",
|
|
4
4
|
"dependencies": {
|
|
5
|
+
"@getpara/shared": "1.1.0",
|
|
5
6
|
"axios": "^1.8.4",
|
|
6
7
|
"libphonenumber-js": "^1.11.7"
|
|
7
8
|
},
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
"dist",
|
|
20
21
|
"package.json"
|
|
21
22
|
],
|
|
22
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "680049700f7b36b7ef407cab0fbfadad8c069d74",
|
|
23
24
|
"main": "dist/cjs/index.js",
|
|
24
25
|
"module": "dist/esm/index.js",
|
|
25
26
|
"scripts": {
|
package/dist/cjs/types/auth.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var auth_exports = {};
|
|
19
|
-
__export(auth_exports, {
|
|
20
|
-
AUTH_TYPES: () => AUTH_TYPES,
|
|
21
|
-
AuthMethod: () => AuthMethod,
|
|
22
|
-
EncryptorType: () => EncryptorType,
|
|
23
|
-
KeyShareType: () => KeyShareType,
|
|
24
|
-
LINKED_ACCOUNT_TYPES: () => LINKED_ACCOUNT_TYPES,
|
|
25
|
-
LegacyAuthMethod: () => LegacyAuthMethod,
|
|
26
|
-
OAUTH_METHODS: () => OAUTH_METHODS,
|
|
27
|
-
OAuthMethod: () => OAuthMethod,
|
|
28
|
-
PasswordStatus: () => PasswordStatus,
|
|
29
|
-
PublicKeyStatus: () => PublicKeyStatus,
|
|
30
|
-
PublicKeyType: () => PublicKeyType
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(auth_exports);
|
|
33
|
-
const AUTH_TYPES = [
|
|
34
|
-
"email",
|
|
35
|
-
"phone",
|
|
36
|
-
"phoneLegacy",
|
|
37
|
-
"farcaster",
|
|
38
|
-
"telegram",
|
|
39
|
-
"userId",
|
|
40
|
-
"externalWallet",
|
|
41
|
-
"discord",
|
|
42
|
-
"x",
|
|
43
|
-
"customId",
|
|
44
|
-
"guestId"
|
|
45
|
-
];
|
|
46
|
-
var EncryptorType = /* @__PURE__ */ ((EncryptorType2) => {
|
|
47
|
-
EncryptorType2["USER"] = "USER";
|
|
48
|
-
EncryptorType2["RECOVERY"] = "RECOVERY";
|
|
49
|
-
EncryptorType2["BIOMETRICS"] = "BIOMETRICS";
|
|
50
|
-
EncryptorType2["PASSWORD"] = "PASSWORD";
|
|
51
|
-
return EncryptorType2;
|
|
52
|
-
})(EncryptorType || {});
|
|
53
|
-
var KeyShareType = /* @__PURE__ */ ((KeyShareType2) => {
|
|
54
|
-
KeyShareType2["USER"] = "USER";
|
|
55
|
-
KeyShareType2["RECOVERY"] = "RECOVERY";
|
|
56
|
-
return KeyShareType2;
|
|
57
|
-
})(KeyShareType || {});
|
|
58
|
-
var PasswordStatus = /* @__PURE__ */ ((PasswordStatus2) => {
|
|
59
|
-
PasswordStatus2["PENDING"] = "PENDING";
|
|
60
|
-
PasswordStatus2["COMPLETE"] = "COMPLETE";
|
|
61
|
-
return PasswordStatus2;
|
|
62
|
-
})(PasswordStatus || {});
|
|
63
|
-
var PublicKeyStatus = /* @__PURE__ */ ((PublicKeyStatus2) => {
|
|
64
|
-
PublicKeyStatus2["PENDING"] = "PENDING";
|
|
65
|
-
PublicKeyStatus2["COMPLETE"] = "COMPLETE";
|
|
66
|
-
return PublicKeyStatus2;
|
|
67
|
-
})(PublicKeyStatus || {});
|
|
68
|
-
var PublicKeyType = /* @__PURE__ */ ((PublicKeyType2) => {
|
|
69
|
-
PublicKeyType2["MOBILE"] = "MOBILE";
|
|
70
|
-
PublicKeyType2["WEB"] = "WEB";
|
|
71
|
-
return PublicKeyType2;
|
|
72
|
-
})(PublicKeyType || {});
|
|
73
|
-
var OAuthMethod = /* @__PURE__ */ ((OAuthMethod2) => {
|
|
74
|
-
OAuthMethod2["GOOGLE"] = "GOOGLE";
|
|
75
|
-
OAuthMethod2["TWITTER"] = "TWITTER";
|
|
76
|
-
OAuthMethod2["APPLE"] = "APPLE";
|
|
77
|
-
OAuthMethod2["DISCORD"] = "DISCORD";
|
|
78
|
-
OAuthMethod2["FACEBOOK"] = "FACEBOOK";
|
|
79
|
-
OAuthMethod2["FARCASTER"] = "FARCASTER";
|
|
80
|
-
OAuthMethod2["TELEGRAM"] = "TELEGRAM";
|
|
81
|
-
return OAuthMethod2;
|
|
82
|
-
})(OAuthMethod || {});
|
|
83
|
-
const OAUTH_METHODS = ["GOOGLE", "TWITTER", "APPLE", "DISCORD", "FACEBOOK", "FARCASTER", "TELEGRAM"];
|
|
84
|
-
const LINKED_ACCOUNT_TYPES = [
|
|
85
|
-
"EMAIL",
|
|
86
|
-
"PHONE",
|
|
87
|
-
"GOOGLE",
|
|
88
|
-
"FACEBOOK",
|
|
89
|
-
"APPLE",
|
|
90
|
-
"TWITTER",
|
|
91
|
-
"DISCORD",
|
|
92
|
-
"TELEGRAM",
|
|
93
|
-
"FARCASTER",
|
|
94
|
-
"EXTERNAL_WALLET"
|
|
95
|
-
];
|
|
96
|
-
var AuthMethod = /* @__PURE__ */ ((AuthMethod2) => {
|
|
97
|
-
AuthMethod2["PASSWORD"] = "PASSWORD";
|
|
98
|
-
AuthMethod2["PASSKEY"] = "PASSKEY";
|
|
99
|
-
AuthMethod2["PIN"] = "PIN";
|
|
100
|
-
return AuthMethod2;
|
|
101
|
-
})(AuthMethod || {});
|
|
102
|
-
var LegacyAuthMethod = /* @__PURE__ */ ((LegacyAuthMethod2) => {
|
|
103
|
-
LegacyAuthMethod2["PASSWORD"] = "PASSWORD";
|
|
104
|
-
LegacyAuthMethod2["BIOMETRIC"] = "BIOMETRIC";
|
|
105
|
-
return LegacyAuthMethod2;
|
|
106
|
-
})(LegacyAuthMethod || {});
|
|
107
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
108
|
-
0 && (module.exports = {
|
|
109
|
-
AUTH_TYPES,
|
|
110
|
-
AuthMethod,
|
|
111
|
-
EncryptorType,
|
|
112
|
-
KeyShareType,
|
|
113
|
-
LINKED_ACCOUNT_TYPES,
|
|
114
|
-
LegacyAuthMethod,
|
|
115
|
-
OAUTH_METHODS,
|
|
116
|
-
OAuthMethod,
|
|
117
|
-
PasswordStatus,
|
|
118
|
-
PublicKeyStatus,
|
|
119
|
-
PublicKeyType
|
|
120
|
-
});
|
package/dist/cjs/types/email.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var email_exports = {};
|
|
19
|
-
__export(email_exports, {
|
|
20
|
-
EmailTheme: () => EmailTheme
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(email_exports);
|
|
23
|
-
var EmailTheme = /* @__PURE__ */ ((EmailTheme2) => {
|
|
24
|
-
EmailTheme2["LIGHT"] = "light";
|
|
25
|
-
EmailTheme2["DARK"] = "dark";
|
|
26
|
-
return EmailTheme2;
|
|
27
|
-
})(EmailTheme || {});
|
|
28
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
-
0 && (module.exports = {
|
|
30
|
-
EmailTheme
|
|
31
|
-
});
|
package/dist/cjs/types/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var types_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(types_exports);
|
|
17
|
-
__reExport(types_exports, require("./auth.js"), module.exports);
|
|
18
|
-
__reExport(types_exports, require("./email.js"), module.exports);
|
|
19
|
-
__reExport(types_exports, require("./onRamp.js"), module.exports);
|
|
20
|
-
__reExport(types_exports, require("./partner.js"), module.exports);
|
|
21
|
-
__reExport(types_exports, require("./wallet.js"), module.exports);
|
|
22
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
-
0 && (module.exports = {
|
|
24
|
-
...require("./auth.js"),
|
|
25
|
-
...require("./email.js"),
|
|
26
|
-
...require("./onRamp.js"),
|
|
27
|
-
...require("./partner.js"),
|
|
28
|
-
...require("./wallet.js")
|
|
29
|
-
});
|