@getpara/user-management-client 2.0.0-alpha.19 → 2.0.0-alpha.21
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 +43 -16
- package/dist/cjs/types/auth.js +14 -0
- package/dist/cjs/types/wallet.js +23 -0
- package/dist/esm/client.js +43 -16
- package/dist/esm/types/auth.js +13 -0
- package/dist/esm/types/wallet.js +19 -0
- package/dist/types/client.d.ts +29 -4
- package/dist/types/types/auth.d.ts +28 -1
- package/dist/types/types/email.d.ts +5 -0
- package/dist/types/types/partner.d.ts +2 -1
- package/dist/types/types/wallet.d.ts +5 -0
- package/package.json +2 -2
package/dist/cjs/client.js
CHANGED
|
@@ -155,6 +155,33 @@ class Client {
|
|
|
155
155
|
const res = yield this.baseRequest.post(`/users/${userId}/verify`, body);
|
|
156
156
|
return res.data;
|
|
157
157
|
});
|
|
158
|
+
this.getLinkedAccounts = (_0) => __async(this, [_0], function* ({ userId }) {
|
|
159
|
+
const res = yield this.baseRequest.get(`/users/${userId}/linked-accounts`);
|
|
160
|
+
return res.data;
|
|
161
|
+
});
|
|
162
|
+
this.linkAccount = (_a) => __async(this, null, function* () {
|
|
163
|
+
var _b = _a, { userId } = _b, opts = __objRest(_b, ["userId"]);
|
|
164
|
+
const res = yield this.baseRequest.post(`/users/${userId}/linked-accounts`, opts);
|
|
165
|
+
return res.data;
|
|
166
|
+
});
|
|
167
|
+
this.verifyLink = (_c) => __async(this, null, function* () {
|
|
168
|
+
var _d = _c, {
|
|
169
|
+
linkedAccountId,
|
|
170
|
+
userId
|
|
171
|
+
} = _d, opts = __objRest(_d, [
|
|
172
|
+
"linkedAccountId",
|
|
173
|
+
"userId"
|
|
174
|
+
]);
|
|
175
|
+
const res = yield this.baseRequest.post(
|
|
176
|
+
`/users/${userId}/linked-accounts/${linkedAccountId}/verify`,
|
|
177
|
+
opts
|
|
178
|
+
);
|
|
179
|
+
return res.data;
|
|
180
|
+
});
|
|
181
|
+
this.unlinkAccount = (_0) => __async(this, [_0], function* ({ linkedAccountId, userId }) {
|
|
182
|
+
const res = yield this.baseRequest.delete(`/users/${userId}/linked-accounts/${linkedAccountId}`);
|
|
183
|
+
return res.data;
|
|
184
|
+
});
|
|
158
185
|
// POST /users/:userId/verify-email
|
|
159
186
|
/**
|
|
160
187
|
* @deprecated
|
|
@@ -502,17 +529,17 @@ class Client {
|
|
|
502
529
|
});
|
|
503
530
|
}
|
|
504
531
|
// POST '/users/:userId/resend-verification-code
|
|
505
|
-
resendVerificationCode(
|
|
532
|
+
resendVerificationCode(_e) {
|
|
506
533
|
return __async(this, null, function* () {
|
|
507
|
-
var
|
|
534
|
+
var _f = _e, { userId } = _f, rest = __objRest(_f, ["userId"]);
|
|
508
535
|
const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code`, rest);
|
|
509
536
|
return res;
|
|
510
537
|
});
|
|
511
538
|
}
|
|
512
539
|
// POST '/users/:userId/resend-verification-code-by-phone
|
|
513
|
-
resendVerificationCodeByPhone(
|
|
540
|
+
resendVerificationCodeByPhone(_g) {
|
|
514
541
|
return __async(this, null, function* () {
|
|
515
|
-
var
|
|
542
|
+
var _h = _g, { userId } = _h, rest = __objRest(_h, ["userId"]);
|
|
516
543
|
const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code-by-phone`, rest);
|
|
517
544
|
return res;
|
|
518
545
|
});
|
|
@@ -662,12 +689,12 @@ class Client {
|
|
|
662
689
|
return res.data;
|
|
663
690
|
});
|
|
664
691
|
}
|
|
665
|
-
createOnRampPurchase(
|
|
692
|
+
createOnRampPurchase(_i) {
|
|
666
693
|
return __async(this, null, function* () {
|
|
667
|
-
var
|
|
694
|
+
var _j = _i, {
|
|
668
695
|
userId,
|
|
669
696
|
params
|
|
670
|
-
} =
|
|
697
|
+
} = _j, walletParams = __objRest(_j, [
|
|
671
698
|
"userId",
|
|
672
699
|
"params"
|
|
673
700
|
]);
|
|
@@ -677,13 +704,13 @@ class Client {
|
|
|
677
704
|
return res.data;
|
|
678
705
|
});
|
|
679
706
|
}
|
|
680
|
-
updateOnRampPurchase(
|
|
707
|
+
updateOnRampPurchase(_k) {
|
|
681
708
|
return __async(this, null, function* () {
|
|
682
|
-
var
|
|
709
|
+
var _l = _k, {
|
|
683
710
|
userId,
|
|
684
711
|
purchaseId,
|
|
685
712
|
updates
|
|
686
|
-
} =
|
|
713
|
+
} = _l, params = __objRest(_l, [
|
|
687
714
|
"userId",
|
|
688
715
|
"purchaseId",
|
|
689
716
|
"updates"
|
|
@@ -697,12 +724,12 @@ class Client {
|
|
|
697
724
|
return res.data;
|
|
698
725
|
});
|
|
699
726
|
}
|
|
700
|
-
getOnRampPurchase(
|
|
727
|
+
getOnRampPurchase(_m) {
|
|
701
728
|
return __async(this, null, function* () {
|
|
702
|
-
var
|
|
729
|
+
var _n = _m, {
|
|
703
730
|
userId,
|
|
704
731
|
purchaseId
|
|
705
|
-
} =
|
|
732
|
+
} = _n, params = __objRest(_n, [
|
|
706
733
|
"userId",
|
|
707
734
|
"purchaseId"
|
|
708
735
|
]);
|
|
@@ -776,12 +803,12 @@ class Client {
|
|
|
776
803
|
return res.data;
|
|
777
804
|
});
|
|
778
805
|
}
|
|
779
|
-
distributeParaShare(
|
|
806
|
+
distributeParaShare(_o) {
|
|
780
807
|
return __async(this, null, function* () {
|
|
781
|
-
var
|
|
808
|
+
var _p = _o, {
|
|
782
809
|
userId,
|
|
783
810
|
walletId
|
|
784
|
-
} =
|
|
811
|
+
} = _p, rest = __objRest(_p, [
|
|
785
812
|
"userId",
|
|
786
813
|
"walletId"
|
|
787
814
|
]);
|
package/dist/cjs/types/auth.js
CHANGED
|
@@ -21,6 +21,7 @@ __export(auth_exports, {
|
|
|
21
21
|
AuthMethod: () => AuthMethod,
|
|
22
22
|
EncryptorType: () => EncryptorType,
|
|
23
23
|
KeyShareType: () => KeyShareType,
|
|
24
|
+
LINKED_ACCOUNT_TYPES: () => LINKED_ACCOUNT_TYPES,
|
|
24
25
|
OAUTH_METHODS: () => OAUTH_METHODS,
|
|
25
26
|
OAuthMethod: () => OAuthMethod,
|
|
26
27
|
PasswordStatus: () => PasswordStatus,
|
|
@@ -79,6 +80,18 @@ var OAuthMethod = /* @__PURE__ */ ((OAuthMethod2) => {
|
|
|
79
80
|
return OAuthMethod2;
|
|
80
81
|
})(OAuthMethod || {});
|
|
81
82
|
const OAUTH_METHODS = ["GOOGLE", "TWITTER", "APPLE", "DISCORD", "FACEBOOK", "FARCASTER", "TELEGRAM"];
|
|
83
|
+
const LINKED_ACCOUNT_TYPES = [
|
|
84
|
+
"EMAIL",
|
|
85
|
+
"PHONE",
|
|
86
|
+
"GOOGLE",
|
|
87
|
+
"FACEBOOK",
|
|
88
|
+
"APPLE",
|
|
89
|
+
"TWITTER",
|
|
90
|
+
"DISCORD",
|
|
91
|
+
"TELEGRAM",
|
|
92
|
+
"FARCASTER",
|
|
93
|
+
"EXTERNAL_WALLET"
|
|
94
|
+
];
|
|
82
95
|
var AuthMethod = /* @__PURE__ */ ((AuthMethod2) => {
|
|
83
96
|
AuthMethod2["PASSWORD"] = "PASSWORD";
|
|
84
97
|
AuthMethod2["PASSKEY"] = "PASSKEY";
|
|
@@ -90,6 +103,7 @@ var AuthMethod = /* @__PURE__ */ ((AuthMethod2) => {
|
|
|
90
103
|
AuthMethod,
|
|
91
104
|
EncryptorType,
|
|
92
105
|
KeyShareType,
|
|
106
|
+
LINKED_ACCOUNT_TYPES,
|
|
93
107
|
OAUTH_METHODS,
|
|
94
108
|
OAuthMethod,
|
|
95
109
|
PasswordStatus,
|
package/dist/cjs/types/wallet.js
CHANGED
|
@@ -17,10 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
var wallet_exports = {};
|
|
19
19
|
__export(wallet_exports, {
|
|
20
|
+
COSMOS_WALLETS: () => COSMOS_WALLETS,
|
|
20
21
|
Chain: () => Chain,
|
|
22
|
+
EVM_WALLETS: () => EVM_WALLETS,
|
|
23
|
+
EXTERNAL_WALLET_TYPES: () => EXTERNAL_WALLET_TYPES,
|
|
21
24
|
NON_ED25519: () => NON_ED25519,
|
|
22
25
|
Network: () => Network,
|
|
23
26
|
PREGEN_IDENTIFIER_TYPES: () => PREGEN_IDENTIFIER_TYPES,
|
|
27
|
+
SOLANA_WALLETS: () => SOLANA_WALLETS,
|
|
24
28
|
WALLET_SCHEMES: () => WALLET_SCHEMES,
|
|
25
29
|
WALLET_TYPES: () => WALLET_TYPES,
|
|
26
30
|
WalletScheme: () => WalletScheme,
|
|
@@ -72,12 +76,31 @@ const PREGEN_IDENTIFIER_TYPES = [
|
|
|
72
76
|
"FARCASTER"
|
|
73
77
|
];
|
|
74
78
|
const NON_ED25519 = ["DKLS", "CGGMP"];
|
|
79
|
+
const EVM_WALLETS = [
|
|
80
|
+
"METAMASK",
|
|
81
|
+
"RAINBOW",
|
|
82
|
+
"COINBASE",
|
|
83
|
+
"WALLETCONNECT",
|
|
84
|
+
"ZERION",
|
|
85
|
+
"SAFE",
|
|
86
|
+
"RABBY",
|
|
87
|
+
"OKX",
|
|
88
|
+
"HAHA",
|
|
89
|
+
"BACKPACK"
|
|
90
|
+
];
|
|
91
|
+
const SOLANA_WALLETS = ["PHANTOM", "GLOW", "BACKPACK", "SOLFLARE"];
|
|
92
|
+
const COSMOS_WALLETS = ["KEPLR", "LEAP", "COSMOSTATION"];
|
|
93
|
+
const EXTERNAL_WALLET_TYPES = [.../* @__PURE__ */ new Set([...EVM_WALLETS, ...SOLANA_WALLETS, ...COSMOS_WALLETS])];
|
|
75
94
|
// Annotate the CommonJS export names for ESM import in node:
|
|
76
95
|
0 && (module.exports = {
|
|
96
|
+
COSMOS_WALLETS,
|
|
77
97
|
Chain,
|
|
98
|
+
EVM_WALLETS,
|
|
99
|
+
EXTERNAL_WALLET_TYPES,
|
|
78
100
|
NON_ED25519,
|
|
79
101
|
Network,
|
|
80
102
|
PREGEN_IDENTIFIER_TYPES,
|
|
103
|
+
SOLANA_WALLETS,
|
|
81
104
|
WALLET_SCHEMES,
|
|
82
105
|
WALLET_TYPES,
|
|
83
106
|
WalletScheme,
|
package/dist/esm/client.js
CHANGED
|
@@ -78,6 +78,33 @@ class Client {
|
|
|
78
78
|
const res = yield this.baseRequest.post(`/users/${userId}/verify`, body);
|
|
79
79
|
return res.data;
|
|
80
80
|
});
|
|
81
|
+
this.getLinkedAccounts = (_0) => __async(this, [_0], function* ({ userId }) {
|
|
82
|
+
const res = yield this.baseRequest.get(`/users/${userId}/linked-accounts`);
|
|
83
|
+
return res.data;
|
|
84
|
+
});
|
|
85
|
+
this.linkAccount = (_a) => __async(this, null, function* () {
|
|
86
|
+
var _b = _a, { userId } = _b, opts = __objRest(_b, ["userId"]);
|
|
87
|
+
const res = yield this.baseRequest.post(`/users/${userId}/linked-accounts`, opts);
|
|
88
|
+
return res.data;
|
|
89
|
+
});
|
|
90
|
+
this.verifyLink = (_c) => __async(this, null, function* () {
|
|
91
|
+
var _d = _c, {
|
|
92
|
+
linkedAccountId,
|
|
93
|
+
userId
|
|
94
|
+
} = _d, opts = __objRest(_d, [
|
|
95
|
+
"linkedAccountId",
|
|
96
|
+
"userId"
|
|
97
|
+
]);
|
|
98
|
+
const res = yield this.baseRequest.post(
|
|
99
|
+
`/users/${userId}/linked-accounts/${linkedAccountId}/verify`,
|
|
100
|
+
opts
|
|
101
|
+
);
|
|
102
|
+
return res.data;
|
|
103
|
+
});
|
|
104
|
+
this.unlinkAccount = (_0) => __async(this, [_0], function* ({ linkedAccountId, userId }) {
|
|
105
|
+
const res = yield this.baseRequest.delete(`/users/${userId}/linked-accounts/${linkedAccountId}`);
|
|
106
|
+
return res.data;
|
|
107
|
+
});
|
|
81
108
|
// POST /users/:userId/verify-email
|
|
82
109
|
/**
|
|
83
110
|
* @deprecated
|
|
@@ -425,17 +452,17 @@ class Client {
|
|
|
425
452
|
});
|
|
426
453
|
}
|
|
427
454
|
// POST '/users/:userId/resend-verification-code
|
|
428
|
-
resendVerificationCode(
|
|
455
|
+
resendVerificationCode(_e) {
|
|
429
456
|
return __async(this, null, function* () {
|
|
430
|
-
var
|
|
457
|
+
var _f = _e, { userId } = _f, rest = __objRest(_f, ["userId"]);
|
|
431
458
|
const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code`, rest);
|
|
432
459
|
return res;
|
|
433
460
|
});
|
|
434
461
|
}
|
|
435
462
|
// POST '/users/:userId/resend-verification-code-by-phone
|
|
436
|
-
resendVerificationCodeByPhone(
|
|
463
|
+
resendVerificationCodeByPhone(_g) {
|
|
437
464
|
return __async(this, null, function* () {
|
|
438
|
-
var
|
|
465
|
+
var _h = _g, { userId } = _h, rest = __objRest(_h, ["userId"]);
|
|
439
466
|
const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code-by-phone`, rest);
|
|
440
467
|
return res;
|
|
441
468
|
});
|
|
@@ -585,12 +612,12 @@ class Client {
|
|
|
585
612
|
return res.data;
|
|
586
613
|
});
|
|
587
614
|
}
|
|
588
|
-
createOnRampPurchase(
|
|
615
|
+
createOnRampPurchase(_i) {
|
|
589
616
|
return __async(this, null, function* () {
|
|
590
|
-
var
|
|
617
|
+
var _j = _i, {
|
|
591
618
|
userId,
|
|
592
619
|
params
|
|
593
|
-
} =
|
|
620
|
+
} = _j, walletParams = __objRest(_j, [
|
|
594
621
|
"userId",
|
|
595
622
|
"params"
|
|
596
623
|
]);
|
|
@@ -600,13 +627,13 @@ class Client {
|
|
|
600
627
|
return res.data;
|
|
601
628
|
});
|
|
602
629
|
}
|
|
603
|
-
updateOnRampPurchase(
|
|
630
|
+
updateOnRampPurchase(_k) {
|
|
604
631
|
return __async(this, null, function* () {
|
|
605
|
-
var
|
|
632
|
+
var _l = _k, {
|
|
606
633
|
userId,
|
|
607
634
|
purchaseId,
|
|
608
635
|
updates
|
|
609
|
-
} =
|
|
636
|
+
} = _l, params = __objRest(_l, [
|
|
610
637
|
"userId",
|
|
611
638
|
"purchaseId",
|
|
612
639
|
"updates"
|
|
@@ -620,12 +647,12 @@ class Client {
|
|
|
620
647
|
return res.data;
|
|
621
648
|
});
|
|
622
649
|
}
|
|
623
|
-
getOnRampPurchase(
|
|
650
|
+
getOnRampPurchase(_m) {
|
|
624
651
|
return __async(this, null, function* () {
|
|
625
|
-
var
|
|
652
|
+
var _n = _m, {
|
|
626
653
|
userId,
|
|
627
654
|
purchaseId
|
|
628
|
-
} =
|
|
655
|
+
} = _n, params = __objRest(_n, [
|
|
629
656
|
"userId",
|
|
630
657
|
"purchaseId"
|
|
631
658
|
]);
|
|
@@ -699,12 +726,12 @@ class Client {
|
|
|
699
726
|
return res.data;
|
|
700
727
|
});
|
|
701
728
|
}
|
|
702
|
-
distributeParaShare(
|
|
729
|
+
distributeParaShare(_o) {
|
|
703
730
|
return __async(this, null, function* () {
|
|
704
|
-
var
|
|
731
|
+
var _p = _o, {
|
|
705
732
|
userId,
|
|
706
733
|
walletId
|
|
707
|
-
} =
|
|
734
|
+
} = _p, rest = __objRest(_p, [
|
|
708
735
|
"userId",
|
|
709
736
|
"walletId"
|
|
710
737
|
]);
|
package/dist/esm/types/auth.js
CHANGED
|
@@ -50,6 +50,18 @@ var OAuthMethod = /* @__PURE__ */ ((OAuthMethod2) => {
|
|
|
50
50
|
return OAuthMethod2;
|
|
51
51
|
})(OAuthMethod || {});
|
|
52
52
|
const OAUTH_METHODS = ["GOOGLE", "TWITTER", "APPLE", "DISCORD", "FACEBOOK", "FARCASTER", "TELEGRAM"];
|
|
53
|
+
const LINKED_ACCOUNT_TYPES = [
|
|
54
|
+
"EMAIL",
|
|
55
|
+
"PHONE",
|
|
56
|
+
"GOOGLE",
|
|
57
|
+
"FACEBOOK",
|
|
58
|
+
"APPLE",
|
|
59
|
+
"TWITTER",
|
|
60
|
+
"DISCORD",
|
|
61
|
+
"TELEGRAM",
|
|
62
|
+
"FARCASTER",
|
|
63
|
+
"EXTERNAL_WALLET"
|
|
64
|
+
];
|
|
53
65
|
var AuthMethod = /* @__PURE__ */ ((AuthMethod2) => {
|
|
54
66
|
AuthMethod2["PASSWORD"] = "PASSWORD";
|
|
55
67
|
AuthMethod2["PASSKEY"] = "PASSKEY";
|
|
@@ -60,6 +72,7 @@ export {
|
|
|
60
72
|
AuthMethod,
|
|
61
73
|
EncryptorType,
|
|
62
74
|
KeyShareType,
|
|
75
|
+
LINKED_ACCOUNT_TYPES,
|
|
63
76
|
OAUTH_METHODS,
|
|
64
77
|
OAuthMethod,
|
|
65
78
|
PasswordStatus,
|
package/dist/esm/types/wallet.js
CHANGED
|
@@ -44,11 +44,30 @@ const PREGEN_IDENTIFIER_TYPES = [
|
|
|
44
44
|
"FARCASTER"
|
|
45
45
|
];
|
|
46
46
|
const NON_ED25519 = ["DKLS", "CGGMP"];
|
|
47
|
+
const EVM_WALLETS = [
|
|
48
|
+
"METAMASK",
|
|
49
|
+
"RAINBOW",
|
|
50
|
+
"COINBASE",
|
|
51
|
+
"WALLETCONNECT",
|
|
52
|
+
"ZERION",
|
|
53
|
+
"SAFE",
|
|
54
|
+
"RABBY",
|
|
55
|
+
"OKX",
|
|
56
|
+
"HAHA",
|
|
57
|
+
"BACKPACK"
|
|
58
|
+
];
|
|
59
|
+
const SOLANA_WALLETS = ["PHANTOM", "GLOW", "BACKPACK", "SOLFLARE"];
|
|
60
|
+
const COSMOS_WALLETS = ["KEPLR", "LEAP", "COSMOSTATION"];
|
|
61
|
+
const EXTERNAL_WALLET_TYPES = [.../* @__PURE__ */ new Set([...EVM_WALLETS, ...SOLANA_WALLETS, ...COSMOS_WALLETS])];
|
|
47
62
|
export {
|
|
63
|
+
COSMOS_WALLETS,
|
|
48
64
|
Chain,
|
|
65
|
+
EVM_WALLETS,
|
|
66
|
+
EXTERNAL_WALLET_TYPES,
|
|
49
67
|
NON_ED25519,
|
|
50
68
|
Network,
|
|
51
69
|
PREGEN_IDENTIFIER_TYPES,
|
|
70
|
+
SOLANA_WALLETS,
|
|
52
71
|
WALLET_SCHEMES,
|
|
53
72
|
WALLET_TYPES,
|
|
54
73
|
WalletScheme,
|
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, PasswordStatus, PregenIds, PrimaryAuth, PublicKeyStatus, PublicKeyType, ServerAuthStateSignup, SessionInfo, Setup2faResponse, SignUpOrLogInResponse, TelegramAuthResponse, TPregenIdentifierType, VerificationEmailProps, VerifiedAuth, VerifyFarcasterResponse, VerifyTelegramResponse, VerifyThirdPartyAuth, WalletEntity, WalletParams, TWalletScheme, TWalletType, VerifyExternalWalletParams, IssueJwtParams, IssueJwtResponse } from './types/index.js';
|
|
2
|
+
import { AccountMetadata, Auth, AuthIdentifier, AuthMethod, BackupKitEmailProps, BiometricLocationHint, Chain, CurrentWalletIds, EncryptedKeyShare, EncryptorType, ExternalWalletInfo, LoginExternalWalletResponse, KeyShareType, Network, OnRampAsset, OnRampConfig, OnRampProvider, OnRampPurchase, OnRampPurchaseCreateParams, OnRampPurchaseUpdateParams, PasswordStatus, PregenIds, PrimaryAuth, PublicKeyStatus, PublicKeyType, ServerAuthStateSignup, SessionInfo, Setup2faResponse, SignUpOrLogInResponse, TelegramAuthResponse, TPregenIdentifierType, VerificationEmailProps, VerifiedAuth, VerifyFarcasterResponse, VerifyTelegramResponse, VerifyThirdPartyAuth, WalletEntity, WalletParams, TWalletScheme, TWalletType, VerifyExternalWalletParams, IssueJwtParams, IssueJwtResponse, LinkAccountParams, LinkedAccounts, ResendVerificationCodeParams } from './types/index.js';
|
|
3
3
|
interface ConfigOpts {
|
|
4
4
|
useFetchAdapter?: boolean;
|
|
5
5
|
}
|
|
@@ -155,6 +155,33 @@ declare class Client {
|
|
|
155
155
|
shouldTrackUser?: boolean;
|
|
156
156
|
}) => Promise<LoginExternalWalletResponse>;
|
|
157
157
|
verifyNewAccount: (userId: string, body: verifyBody) => Promise<ServerAuthStateSignup>;
|
|
158
|
+
getLinkedAccounts: ({ userId }: {
|
|
159
|
+
userId: string;
|
|
160
|
+
}) => Promise<{
|
|
161
|
+
accounts: LinkedAccounts;
|
|
162
|
+
}>;
|
|
163
|
+
linkAccount: ({ userId, ...opts }: LinkAccountParams & {
|
|
164
|
+
userId: string;
|
|
165
|
+
}) => Promise<{
|
|
166
|
+
linkedAccountId: string;
|
|
167
|
+
signatureVerificationMessage?: string;
|
|
168
|
+
} | {
|
|
169
|
+
isConflict: true;
|
|
170
|
+
}>;
|
|
171
|
+
verifyLink: ({ linkedAccountId, userId, ...opts }: {
|
|
172
|
+
linkedAccountId: string;
|
|
173
|
+
userId: string;
|
|
174
|
+
telegramAuthResponse?: TelegramAuthResponse;
|
|
175
|
+
verificationCode?: string;
|
|
176
|
+
} & Partial<VerifyExternalWalletParams>) => Promise<{
|
|
177
|
+
accounts: LinkedAccounts;
|
|
178
|
+
} | {
|
|
179
|
+
isConflict: true;
|
|
180
|
+
}>;
|
|
181
|
+
unlinkAccount: ({ linkedAccountId, userId }: {
|
|
182
|
+
linkedAccountId: string;
|
|
183
|
+
userId: string;
|
|
184
|
+
}) => Promise<LinkedAccounts>;
|
|
158
185
|
/**
|
|
159
186
|
* @deprecated
|
|
160
187
|
*/
|
|
@@ -217,9 +244,7 @@ declare class Client {
|
|
|
217
244
|
getTransmissionKeyshares(userId: string, sessionLookupId: string): Promise<any>;
|
|
218
245
|
getParaShare: (userId: string, walletId: string) => Promise<string>;
|
|
219
246
|
getBackupKit: (userId: string, walletId: string) => Promise<any>;
|
|
220
|
-
resendVerificationCode({ userId, ...rest }:
|
|
221
|
-
userId: string;
|
|
222
|
-
} & VerificationEmailProps): Promise<AxiosResponse<any, any>>;
|
|
247
|
+
resendVerificationCode({ userId, ...rest }: ResendVerificationCodeParams): Promise<AxiosResponse<any, any>>;
|
|
223
248
|
resendVerificationCodeByPhone({ userId, ...rest }: {
|
|
224
249
|
userId: string;
|
|
225
250
|
} & VerificationEmailProps): Promise<AxiosResponse<any, any>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CurrentWalletIds, ExternalWalletType, SupportedWalletTypes } from './wallet.js';
|
|
1
|
+
import { CurrentWalletIds, ExternalWalletType, SupportedWalletTypes, TExternalWallet } from './wallet.js';
|
|
2
2
|
export declare const AUTH_TYPES: readonly ["email", "phone", "phoneLegacy", "farcaster", "telegram", "userId", "externalWallet", "discord", "x", "customId", "guestId"];
|
|
3
3
|
export type AuthType = 'email' | 'phone' | 'phoneLegacy' | 'farcaster' | 'telegram' | 'userId' | 'externalWallet' | 'discord' | 'x' | 'customId' | 'guestId';
|
|
4
4
|
export type PrimaryAuthType = Extract<AuthType, 'email' | 'phone' | 'farcaster' | 'telegram' | 'externalWallet'>;
|
|
@@ -112,6 +112,9 @@ export declare enum OAuthMethod {
|
|
|
112
112
|
}
|
|
113
113
|
export declare const OAUTH_METHODS: readonly ["GOOGLE", "TWITTER", "APPLE", "DISCORD", "FACEBOOK", "FARCASTER", "TELEGRAM"];
|
|
114
114
|
export type TOAuthMethod = (typeof OAUTH_METHODS)[number];
|
|
115
|
+
export declare const LINKED_ACCOUNT_TYPES: readonly ["EMAIL", "PHONE", "GOOGLE", "FACEBOOK", "APPLE", "TWITTER", "DISCORD", "TELEGRAM", "FARCASTER", "EXTERNAL_WALLET"];
|
|
116
|
+
export type TLinkedAccountType = (typeof LINKED_ACCOUNT_TYPES)[number] | 'EXTERNAL_WALLET';
|
|
117
|
+
export type SupportedAccountLinks = (TLinkedAccountType | TExternalWallet)[];
|
|
115
118
|
export declare enum AuthMethod {
|
|
116
119
|
PASSWORD = "PASSWORD",
|
|
117
120
|
PASSKEY = "PASSKEY"
|
|
@@ -167,6 +170,7 @@ export type ExternalWalletInfo = {
|
|
|
167
170
|
address: string;
|
|
168
171
|
type: ExternalWalletType;
|
|
169
172
|
provider?: string;
|
|
173
|
+
providerId?: TExternalWallet;
|
|
170
174
|
addressBech32?: string;
|
|
171
175
|
withFullParaAuth?: boolean;
|
|
172
176
|
ensName?: string | null;
|
|
@@ -233,3 +237,26 @@ export type IssueJwtResponse = {
|
|
|
233
237
|
*/
|
|
234
238
|
keyId: string;
|
|
235
239
|
};
|
|
240
|
+
export type LinkedAccount = {
|
|
241
|
+
id?: string;
|
|
242
|
+
type: TLinkedAccountType;
|
|
243
|
+
identifier: string;
|
|
244
|
+
displayName: string;
|
|
245
|
+
externalWallet?: ExternalWalletInfo;
|
|
246
|
+
};
|
|
247
|
+
export type LinkedAccounts = {
|
|
248
|
+
userId: string;
|
|
249
|
+
primary: LinkedAccount[];
|
|
250
|
+
linked: LinkedAccount[];
|
|
251
|
+
};
|
|
252
|
+
export type LinkAccountParams = {
|
|
253
|
+
type: TLinkedAccountType;
|
|
254
|
+
identifier?: string;
|
|
255
|
+
externalWallet?: ExternalWalletInfo;
|
|
256
|
+
};
|
|
257
|
+
export type VerifyLinkParams = {
|
|
258
|
+
linkedAccountId: string;
|
|
259
|
+
userId: string;
|
|
260
|
+
telegramAuthResponse?: TelegramAuthResponse;
|
|
261
|
+
verificationCode?: string;
|
|
262
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthMethod } from './auth.js';
|
|
1
|
+
import { AuthMethod, SupportedAccountLinks } from './auth.js';
|
|
2
2
|
import { SupportedWalletTypes } from './wallet.js';
|
|
3
3
|
export interface PartnerEntity {
|
|
4
4
|
id: string;
|
|
@@ -16,5 +16,6 @@ export interface PartnerEntity {
|
|
|
16
16
|
portalUrl?: string;
|
|
17
17
|
supportedAuthMethods?: AuthMethod[];
|
|
18
18
|
supportedWalletTypes?: SupportedWalletTypes;
|
|
19
|
+
supportedAccountLinks?: SupportedAccountLinks;
|
|
19
20
|
cosmosPrefix?: string;
|
|
20
21
|
}
|
|
@@ -71,3 +71,8 @@ export type SupportedWalletTypes = {
|
|
|
71
71
|
type: TWalletType;
|
|
72
72
|
optional?: boolean;
|
|
73
73
|
}[];
|
|
74
|
+
export declare const EVM_WALLETS: readonly ["METAMASK", "RAINBOW", "COINBASE", "WALLETCONNECT", "ZERION", "SAFE", "RABBY", "OKX", "HAHA", "BACKPACK"];
|
|
75
|
+
export declare const SOLANA_WALLETS: readonly ["PHANTOM", "GLOW", "BACKPACK", "SOLFLARE"];
|
|
76
|
+
export declare const COSMOS_WALLETS: readonly ["KEPLR", "LEAP", "COSMOSTATION"];
|
|
77
|
+
export declare const EXTERNAL_WALLET_TYPES: readonly ("METAMASK" | "RAINBOW" | "COINBASE" | "WALLETCONNECT" | "ZERION" | "SAFE" | "RABBY" | "OKX" | "HAHA" | "BACKPACK" | "PHANTOM" | "GLOW" | "SOLFLARE" | "KEPLR" | "LEAP" | "COSMOSTATION")[];
|
|
78
|
+
export type TExternalWallet = (typeof EXTERNAL_WALLET_TYPES)[number];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/user-management-client",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.21",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"require": "./dist/cjs/index.js"
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "03daa3537312bc52e0640225c8abdbf8047c15da"
|
|
36
36
|
}
|