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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -357,7 +357,18 @@ var Client = class {
357
357
  });
358
358
  return res;
359
359
  });
360
+ this.checkUserExistsV2 = (auth) => __async(this, null, function* () {
361
+ const res = yield this.baseRequest.get("/users/exists", {
362
+ params: __spreadValues({}, auth)
363
+ });
364
+ return res.data;
365
+ });
360
366
  this.verifyTelegram = (authObject) => __async(this, null, function* () {
367
+ return (yield this.baseRequest.post("/users/telegram", {
368
+ authObject
369
+ })).data;
370
+ });
371
+ this.verifyTelegramV2 = (authObject) => __async(this, null, function* () {
361
372
  return (yield this.baseRequest.post("/users/telegram/v2", {
362
373
  authObject
363
374
  })).data;
@@ -366,7 +377,11 @@ var Client = class {
366
377
  const res = yield this.baseRequest.post("/users/verify-oauth");
367
378
  return res.data;
368
379
  });
369
- this.loginExternalWallet = (_0) => __async(this, [_0], function* ({
380
+ this.externalWalletLogin = (body) => __async(this, null, function* () {
381
+ const res = yield this.baseRequest.post(`/users/external-wallets/login`, body);
382
+ return res.data;
383
+ });
384
+ this.loginExternalWalletV2 = (_0) => __async(this, [_0], function* ({
370
385
  externalWallet,
371
386
  shouldTrackUser
372
387
  }) {
@@ -396,6 +411,10 @@ var Client = class {
396
411
  return res;
397
412
  });
398
413
  this.verifyExternalWallet = (userId, body) => __async(this, null, function* () {
414
+ const res = yield this.baseRequest.post(`/users/${userId}/external-wallets/verify`, body);
415
+ return res;
416
+ });
417
+ this.verifyExternalWalletV2 = (userId, body) => __async(this, null, function* () {
399
418
  const res = yield this.baseRequest.post(`/users/${userId}/external-wallets/verify/v2`, body);
400
419
  return res.data;
401
420
  });
@@ -476,16 +495,28 @@ var Client = class {
476
495
  const res = yield this.baseRequest.post(`/wallets/pregen`, body);
477
496
  return res.data;
478
497
  });
498
+ // GET /wallets/pregen?pregenIdentifier={pregenIdentifier}&pregenIdentifierType={pregenIdentifierType}
479
499
  this.getPregenWallets = (pregenIds, isPortal = false, userId) => __async(this, null, function* () {
480
500
  const res = yield this.baseRequest.get("/wallets/pregen", {
481
501
  params: { ids: pregenIds, expand: isPortal, userId }
482
502
  });
483
503
  return res.data;
484
504
  });
505
+ this.getPregenWalletsV2 = (pregenIds, isPortal = false, userId) => __async(this, null, function* () {
506
+ const res = yield this.baseRequest.get("/wallets/pregen", {
507
+ params: { ids: pregenIds, expand: isPortal, userId }
508
+ });
509
+ return res.data;
510
+ });
511
+ // POST /wallets/pregen/claim
485
512
  this.claimPregenWallets = (body) => __async(this, null, function* () {
486
513
  const res = yield this.baseRequest.post(`/wallets/pregen/claim`, body);
487
514
  return res.data;
488
515
  });
516
+ this.claimPregenWalletsV2 = (body) => __async(this, null, function* () {
517
+ const res = yield this.baseRequest.post(`/wallets/pregen/claim`, body);
518
+ return res.data;
519
+ });
489
520
  // POST /users/:userId/wallets/:walletId/transactions/send
490
521
  this.sendTransaction = (userId, walletId, body) => __async(this, null, function* () {
491
522
  const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/transactions/send`, body);
@@ -742,7 +773,14 @@ var Client = class {
742
773
  return res;
743
774
  });
744
775
  }
776
+ // POST '/2fa/users/:userId/setup'
745
777
  setup2FA(userId) {
778
+ return __async(this, null, function* () {
779
+ const res = yield this.baseRequest.post(`/2fa/users/${userId}/setup`);
780
+ return res;
781
+ });
782
+ }
783
+ setup2FAV2(userId) {
746
784
  return __async(this, null, function* () {
747
785
  const res = yield this.baseRequest.post(`/2fa/users/${userId}/setup`);
748
786
  return res.data;
@@ -762,7 +800,14 @@ var Client = class {
762
800
  return res;
763
801
  });
764
802
  }
803
+ // POST /auth/farcaster/status
765
804
  getFarcasterAuthStatus() {
805
+ return __async(this, null, function* () {
806
+ const res = yield this.baseRequest.post(`/auth/farcaster/status`);
807
+ return res;
808
+ });
809
+ }
810
+ getFarcasterAuthStatusV2() {
766
811
  return __async(this, null, function* () {
767
812
  const res = yield this.baseRequest.post(`/auth/farcaster/status/v2`);
768
813
  return res.data;
@@ -805,7 +850,15 @@ var Client = class {
805
850
  return res;
806
851
  });
807
852
  }
808
- verify2FA(auth, verificationCode) {
853
+ // POST /2fa/verify
854
+ verify2FA(email, verificationCode) {
855
+ return __async(this, null, function* () {
856
+ const body = { email, verificationCode };
857
+ const res = yield this.baseRequest.post("/2fa/verify", body);
858
+ return res;
859
+ });
860
+ }
861
+ verify2FAV2(auth, verificationCode) {
809
862
  return __async(this, null, function* () {
810
863
  const body = __spreadProps(__spreadValues({}, auth), { verificationCode });
811
864
  const res = yield this.baseRequest.post("/2fa/verify", body);
Binary file
Binary file
package/dist/esm/index.js CHANGED
@@ -284,7 +284,18 @@ var Client = class {
284
284
  });
285
285
  return res;
286
286
  });
287
+ this.checkUserExistsV2 = (auth) => __async(this, null, function* () {
288
+ const res = yield this.baseRequest.get("/users/exists", {
289
+ params: __spreadValues({}, auth)
290
+ });
291
+ return res.data;
292
+ });
287
293
  this.verifyTelegram = (authObject) => __async(this, null, function* () {
294
+ return (yield this.baseRequest.post("/users/telegram", {
295
+ authObject
296
+ })).data;
297
+ });
298
+ this.verifyTelegramV2 = (authObject) => __async(this, null, function* () {
288
299
  return (yield this.baseRequest.post("/users/telegram/v2", {
289
300
  authObject
290
301
  })).data;
@@ -293,7 +304,11 @@ var Client = class {
293
304
  const res = yield this.baseRequest.post("/users/verify-oauth");
294
305
  return res.data;
295
306
  });
296
- this.loginExternalWallet = (_0) => __async(this, [_0], function* ({
307
+ this.externalWalletLogin = (body) => __async(this, null, function* () {
308
+ const res = yield this.baseRequest.post(`/users/external-wallets/login`, body);
309
+ return res.data;
310
+ });
311
+ this.loginExternalWalletV2 = (_0) => __async(this, [_0], function* ({
297
312
  externalWallet,
298
313
  shouldTrackUser
299
314
  }) {
@@ -323,6 +338,10 @@ var Client = class {
323
338
  return res;
324
339
  });
325
340
  this.verifyExternalWallet = (userId, body) => __async(this, null, function* () {
341
+ const res = yield this.baseRequest.post(`/users/${userId}/external-wallets/verify`, body);
342
+ return res;
343
+ });
344
+ this.verifyExternalWalletV2 = (userId, body) => __async(this, null, function* () {
326
345
  const res = yield this.baseRequest.post(`/users/${userId}/external-wallets/verify/v2`, body);
327
346
  return res.data;
328
347
  });
@@ -403,16 +422,28 @@ var Client = class {
403
422
  const res = yield this.baseRequest.post(`/wallets/pregen`, body);
404
423
  return res.data;
405
424
  });
425
+ // GET /wallets/pregen?pregenIdentifier={pregenIdentifier}&pregenIdentifierType={pregenIdentifierType}
406
426
  this.getPregenWallets = (pregenIds, isPortal = false, userId) => __async(this, null, function* () {
407
427
  const res = yield this.baseRequest.get("/wallets/pregen", {
408
428
  params: { ids: pregenIds, expand: isPortal, userId }
409
429
  });
410
430
  return res.data;
411
431
  });
432
+ this.getPregenWalletsV2 = (pregenIds, isPortal = false, userId) => __async(this, null, function* () {
433
+ const res = yield this.baseRequest.get("/wallets/pregen", {
434
+ params: { ids: pregenIds, expand: isPortal, userId }
435
+ });
436
+ return res.data;
437
+ });
438
+ // POST /wallets/pregen/claim
412
439
  this.claimPregenWallets = (body) => __async(this, null, function* () {
413
440
  const res = yield this.baseRequest.post(`/wallets/pregen/claim`, body);
414
441
  return res.data;
415
442
  });
443
+ this.claimPregenWalletsV2 = (body) => __async(this, null, function* () {
444
+ const res = yield this.baseRequest.post(`/wallets/pregen/claim`, body);
445
+ return res.data;
446
+ });
416
447
  // POST /users/:userId/wallets/:walletId/transactions/send
417
448
  this.sendTransaction = (userId, walletId, body) => __async(this, null, function* () {
418
449
  const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/transactions/send`, body);
@@ -669,7 +700,14 @@ var Client = class {
669
700
  return res;
670
701
  });
671
702
  }
703
+ // POST '/2fa/users/:userId/setup'
672
704
  setup2FA(userId) {
705
+ return __async(this, null, function* () {
706
+ const res = yield this.baseRequest.post(`/2fa/users/${userId}/setup`);
707
+ return res;
708
+ });
709
+ }
710
+ setup2FAV2(userId) {
673
711
  return __async(this, null, function* () {
674
712
  const res = yield this.baseRequest.post(`/2fa/users/${userId}/setup`);
675
713
  return res.data;
@@ -689,7 +727,14 @@ var Client = class {
689
727
  return res;
690
728
  });
691
729
  }
730
+ // POST /auth/farcaster/status
692
731
  getFarcasterAuthStatus() {
732
+ return __async(this, null, function* () {
733
+ const res = yield this.baseRequest.post(`/auth/farcaster/status`);
734
+ return res;
735
+ });
736
+ }
737
+ getFarcasterAuthStatusV2() {
693
738
  return __async(this, null, function* () {
694
739
  const res = yield this.baseRequest.post(`/auth/farcaster/status/v2`);
695
740
  return res.data;
@@ -732,7 +777,15 @@ var Client = class {
732
777
  return res;
733
778
  });
734
779
  }
735
- verify2FA(auth, verificationCode) {
780
+ // POST /2fa/verify
781
+ verify2FA(email, verificationCode) {
782
+ return __async(this, null, function* () {
783
+ const body = { email, verificationCode };
784
+ const res = yield this.baseRequest.post("/2fa/verify", body);
785
+ return res;
786
+ });
787
+ }
788
+ verify2FAV2(auth, verificationCode) {
736
789
  return __async(this, null, function* () {
737
790
  const body = __spreadProps(__spreadValues({}, auth), { verificationCode });
738
791
  const res = yield this.baseRequest.post("/2fa/verify", body);
Binary file
Binary file
@@ -12,6 +12,18 @@ type ClientConfig = {
12
12
  retrieveSessionCookie?: () => string | undefined;
13
13
  persistSessionCookie?: (cookie: string) => void;
14
14
  };
15
+ interface ExternalWalletLoginBody {
16
+ externalAddress: string;
17
+ type: 'EVM' | 'SOLANA' | 'COSMOS';
18
+ externalWalletProvider?: string;
19
+ shouldTrackUser?: boolean;
20
+ }
21
+ export interface ExternalWalletLoginRes {
22
+ userId: string;
23
+ userExists: boolean;
24
+ isVerified: boolean;
25
+ signatureVerificationMessage: string;
26
+ }
15
27
  interface createUserIdRes {
16
28
  protocolId: string;
17
29
  userId: string;
@@ -19,6 +31,12 @@ interface createUserIdRes {
19
31
  interface verifyBody {
20
32
  verificationCode: string;
21
33
  }
34
+ interface verifyExternalWalletBody {
35
+ address: string;
36
+ signedMessage: string;
37
+ cosmosPublicKeyHex?: string;
38
+ cosmosSigner?: string;
39
+ }
22
40
  interface getWebChallengeRes {
23
41
  challenge: string;
24
42
  allowedPublicKeys?: string[];
@@ -134,9 +152,14 @@ declare class Client {
134
152
  */
135
153
  createUser: (body: VerifiedAuth & VerificationEmailProps) => Promise<createUserIdRes>;
136
154
  checkUserExists: (auth: VerifiedAuth) => Promise<any>;
137
- verifyTelegram: (authObject: TelegramAuthResponse) => Promise<VerifyTelegramResponse>;
155
+ checkUserExistsV2: (auth: VerifiedAuth) => Promise<{
156
+ exists: boolean;
157
+ }>;
158
+ verifyTelegram: (authObject: TelegramAuthResponse) => Promise<VerifyTelegramRes>;
159
+ verifyTelegramV2: (authObject: TelegramAuthResponse) => Promise<VerifyTelegramResponse>;
138
160
  verifyOAuth: () => Promise<VerifyThirdPartyAuth | null>;
139
- loginExternalWallet: ({ externalWallet, shouldTrackUser, }: {
161
+ externalWalletLogin: (body: ExternalWalletLoginBody) => Promise<ExternalWalletLoginRes>;
162
+ loginExternalWalletV2: ({ externalWallet, shouldTrackUser, }: {
140
163
  externalWallet: ExternalWalletInfo;
141
164
  shouldTrackUser?: boolean;
142
165
  }) => Promise<LoginExternalWalletResponse>;
@@ -149,13 +172,14 @@ declare class Client {
149
172
  * @deprecated
150
173
  */
151
174
  verifyPhone: (userId: string, body: verifyBody) => Promise<any>;
152
- verifyExternalWallet: (userId: string, body: VerifyExternalWalletParams) => Promise<ServerAuthStateSignup>;
175
+ verifyExternalWallet: (userId: string, body: verifyExternalWalletBody) => Promise<any>;
176
+ verifyExternalWalletV2: (userId: string, body: VerifyExternalWalletParams) => Promise<ServerAuthStateSignup>;
153
177
  addSessionPublicKey: (userId: string, body: sessionPublicKeyBody) => Promise<any>;
154
178
  getSessionPublicKeys: (userId: string) => Promise<any>;
155
179
  getBiometricLocationHints: (auth: PrimaryAuth) => Promise<BiometricLocationHint[]>;
156
180
  getSessionPublicKey: (userId: string, biometricId: string) => Promise<any>;
157
181
  patchSessionPublicKey: (partnerId: string, userId: string, biometricId: string, body: sessionPublicKeyBody) => Promise<any>;
158
- getWebChallenge: (auth?: PrimaryAuth | Auth<"userId">) => Promise<getWebChallengeRes>;
182
+ getWebChallenge: (auth?: PrimaryAuth) => Promise<getWebChallengeRes>;
159
183
  touchSession: (regenerate?: boolean) => Promise<SessionInfo>;
160
184
  sessionOrigin: (sessionLookupId: string) => Promise<{
161
185
  origin?: string;
@@ -165,10 +189,16 @@ declare class Client {
165
189
  verifySessionChallenge: (userId: string, body: verifySessionChallengeBody) => Promise<any>;
166
190
  createWallet: (userId: string, body?: createWalletBody) => Promise<createWalletRes>;
167
191
  createPregenWallet: (body?: createPregenWalletBody) => Promise<createWalletRes>;
168
- getPregenWallets: (pregenIds: PregenIds, isPortal?: boolean, userId?: string) => Promise<{
192
+ getPregenWallets: <ReturnType = {
193
+ wallets: WalletEntity[];
194
+ }>(pregenIds: PregenIds, isPortal?: boolean, userId?: string) => Promise<ReturnType>;
195
+ getPregenWalletsV2: (pregenIds: PregenIds, isPortal?: boolean, userId?: string) => Promise<{
169
196
  wallets: WalletEntity[];
170
197
  }>;
171
- claimPregenWallets: (body?: claimPreGenWalletsBody) => Promise<{
198
+ claimPregenWallets: <ReturnType = {
199
+ walletIds?: string[];
200
+ }>(body?: claimPreGenWalletsBody) => Promise<ReturnType>;
201
+ claimPregenWalletsV2: (body?: claimPreGenWalletsBody) => Promise<{
172
202
  walletIds: string[];
173
203
  }>;
174
204
  sendTransaction: (userId: string, walletId: string, body: sendTransactionBody) => Promise<any>;
@@ -212,10 +242,12 @@ declare class Client {
212
242
  cancelRecoveryAttempt(email: string): Promise<AxiosResponse<any, any>>;
213
243
  check2FAStatus(userId: string): Promise<AxiosResponse<any, any>>;
214
244
  enable2FA(userId: string, verificationCode: string): Promise<AxiosResponse<any, any>>;
215
- setup2FA(userId: string): Promise<Setup2faResponse>;
245
+ setup2FA(userId: string): Promise<AxiosResponse<any, any>>;
246
+ setup2FAV2(userId: string): Promise<Setup2faResponse>;
216
247
  initializeRecovery(email: string): Promise<AxiosResponse<any, any>>;
217
248
  initializeFarcasterLogin(): Promise<AxiosResponse<any, any>>;
218
- getFarcasterAuthStatus(): Promise<VerifyFarcasterResponse>;
249
+ getFarcasterAuthStatus(): Promise<AxiosResponse<any, any>>;
250
+ getFarcasterAuthStatusV2(): Promise<VerifyFarcasterResponse>;
219
251
  initializeRecoveryForPhone(phone: string, countryCode: string): Promise<AxiosResponse<any, any>>;
220
252
  finalizeRecovery(userId: string, walletId: string): Promise<AxiosResponse<any, any>>;
221
253
  recoverUserShares(userId: string, walletId: string): Promise<AxiosResponse<{
@@ -234,7 +266,8 @@ declare class Client {
234
266
  }, any>>;
235
267
  verifyEmailForRecovery(email: string, verificationCode: string): Promise<AxiosResponse<any, any>>;
236
268
  verifyPhoneForRecovery(phone: string, countryCode: string, verificationCode: string): Promise<AxiosResponse<any, any>>;
237
- verify2FA(auth: VerifiedAuth, verificationCode: string): Promise<any>;
269
+ verify2FA(email: string, verificationCode: string): Promise<AxiosResponse<any, any>>;
270
+ verify2FAV2(auth: VerifiedAuth, verificationCode: string): Promise<any>;
238
271
  /**
239
272
  * @deprecated
240
273
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/user-management-client",
3
- "version": "2.0.0-alpha.3",
3
+ "version": "2.0.0-dev.1",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -33,5 +33,5 @@
33
33
  "require": "./dist/cjs/index.js"
34
34
  }
35
35
  },
36
- "gitHead": "77a1e04b06258842ca9c81e3db2a2b0092517659"
36
+ "gitHead": "426e843bd6084fb2e5f30ab87b02c79fc2f52832"
37
37
  }