@getpara/react-sdk-lite 2.0.0-alpha.50 → 2.0.0-alpha.51
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/modal/components/AddFunds/AddFunds.js +0 -1
- package/dist/modal/constants/constants.js +1 -1
- package/dist/provider/ParaProviderMin.js +1 -3
- package/dist/provider/providers/AccountLinkProvider.js +1 -1
- package/dist/provider/providers/ExternalWalletProvider.js +14 -6
- package/dist/provider/stores/types.d.ts +2 -2
- package/package.json +8 -8
|
@@ -26,7 +26,6 @@ const AddFunds = () => {
|
|
|
26
26
|
const { data: activeWallet } = useWallet();
|
|
27
27
|
const { embedded } = useAccount();
|
|
28
28
|
const isGuestMode = (embedded == null ? void 0 : embedded.isConnected) && embedded.isGuestMode;
|
|
29
|
-
console.log(onRampConfig);
|
|
30
29
|
const tabs = TABS.filter(
|
|
31
30
|
([enabledFlow, key]) => !!(onRampConfig == null ? void 0 : onRampConfig[key]) && (!isGuestMode || enabledFlow === EnabledFlow.RECEIVE)
|
|
32
31
|
);
|
|
@@ -88,9 +88,7 @@ const ParaProviderMin = forwardRef(({ children, paraClientConfig, callbacks, con
|
|
|
88
88
|
console.warn("createLinkedEmbeddedForExternalWallets has no effect when using connection only external wallets");
|
|
89
89
|
setExternalWalletsWithFullAuth([]);
|
|
90
90
|
} else {
|
|
91
|
-
setExternalWalletsWithFullAuth(
|
|
92
|
-
(externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets) === "ALL" ? [...EXTERNAL_WALLET_TYPES] : (_b = externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets) != null ? _b : []
|
|
93
|
-
);
|
|
91
|
+
setExternalWalletsWithFullAuth((_b = externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets) != null ? _b : []);
|
|
94
92
|
}
|
|
95
93
|
}
|
|
96
94
|
}, [externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets]);
|
|
@@ -114,7 +114,7 @@ const AccountLinkProvider = ({ children }) => {
|
|
|
114
114
|
reset: resetVerifyExternalWalletLink
|
|
115
115
|
} = useVerifyExternalWalletLink();
|
|
116
116
|
const { embedded } = account;
|
|
117
|
-
const isEnabled = (embedded == null ? void 0 : embedded.isConnected) || !(embedded == null ? void 0 : embedded.isGuestMode) && (!((_a = para.authInfo) == null ? void 0 : _a.externalWallet) || includeWalletVerification || externalWalletsWithFullAuth.includes((_c = (_b = para.authInfo) == null ? void 0 : _b.externalWallet) == null ? void 0 : _c.providerId));
|
|
117
|
+
const isEnabled = (embedded == null ? void 0 : embedded.isConnected) || !(embedded == null ? void 0 : embedded.isGuestMode) && (!((_a = para.authInfo) == null ? void 0 : _a.externalWallet) || includeWalletVerification || externalWalletsWithFullAuth === "ALL" || externalWalletsWithFullAuth.includes((_c = (_b = para.authInfo) == null ? void 0 : _b.externalWallet) == null ? void 0 : _c.providerId));
|
|
118
118
|
const [accountLinkInProgress, setAccountLinkInProgress] = useState(
|
|
119
119
|
coreAccountLinkInProgress || void 0
|
|
120
120
|
);
|
|
@@ -124,11 +124,11 @@ function ExternalWalletProvider({ children }) {
|
|
|
124
124
|
(w) => (w.internalId !== "FARCASTER" || (para == null ? void 0 : para.isFarcasterMiniApp)) && externalWallets.includes(w.internalId)
|
|
125
125
|
).sort(
|
|
126
126
|
(a, b) => externalWallets.indexOf(a.internalId) - externalWallets.indexOf(b.internalId)
|
|
127
|
-
)
|
|
127
|
+
);
|
|
128
128
|
const injectedWallets = allWallets.filter(
|
|
129
129
|
(w) => (w == null ? void 0 : w.id) !== "Para" && !wallets.some((wallet2) => wallet2.id === w.id) && w.installed
|
|
130
130
|
);
|
|
131
|
-
wallets = [...wallets, ...injectedWallets];
|
|
131
|
+
wallets = [...wallets, ...injectedWallets].sort((a, b) => a.installed === b.installed ? 0 : a.installed ? -1 : 1);
|
|
132
132
|
const wallet = useMemo(
|
|
133
133
|
() => wallets.find((w) => w.id === (selectedExternalWallet == null ? void 0 : selectedExternalWallet.id) && w.type === (selectedExternalWallet == null ? void 0 : selectedExternalWallet.type)),
|
|
134
134
|
[wallets, selectedExternalWallet]
|
|
@@ -147,6 +147,15 @@ function ExternalWalletProvider({ children }) {
|
|
|
147
147
|
setQrUri(void 0);
|
|
148
148
|
}
|
|
149
149
|
}, [wallet]);
|
|
150
|
+
const isWithFullAuth = (wallet2) => {
|
|
151
|
+
if (connectionOnly) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
if (externalWalletsWithFullAuth === "ALL") {
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
return !!wallet2.name && externalWalletsWithFullAuth.includes(wallet2.name.toUpperCase());
|
|
158
|
+
};
|
|
150
159
|
const getWalletBalance = useCallback(() => __async(this, null, function* () {
|
|
151
160
|
var _a;
|
|
152
161
|
const walletType = (_a = Object.values(para.externalWallets || {})[0]) == null ? void 0 : _a.type;
|
|
@@ -237,14 +246,13 @@ function ExternalWalletProvider({ children }) {
|
|
|
237
246
|
[evmSwitchChain, cosmosSwitchChain]
|
|
238
247
|
);
|
|
239
248
|
const verifyWalletSignature = useCallback(() => __async(this, null, function* () {
|
|
240
|
-
var _a;
|
|
241
249
|
setExternalWalletError();
|
|
242
250
|
const wallet2 = Object.values(para.externalWallets)[0];
|
|
243
251
|
const walletType = wallet2 == null ? void 0 : wallet2.type;
|
|
244
252
|
let verifyExternalWalletParams;
|
|
245
253
|
const withVerification = includeWalletVerification;
|
|
246
254
|
const isConnectionOnly = connectionOnly;
|
|
247
|
-
const withFullParaAuth = (wallet2 == null ? void 0 : wallet2.name) ?
|
|
255
|
+
const withFullParaAuth = (wallet2 == null ? void 0 : wallet2.name) ? isWithFullAuth(wallet2) : false;
|
|
248
256
|
const defaultWalletInfo = {
|
|
249
257
|
withVerification,
|
|
250
258
|
isConnectionOnly,
|
|
@@ -322,7 +330,7 @@ function ExternalWalletProvider({ children }) {
|
|
|
322
330
|
try {
|
|
323
331
|
const d = yield verifyExternalWalletAsync(verifyExternalWalletParams);
|
|
324
332
|
yield queryClient.refetchQueries({ queryKey: [IS_FULLY_LOGGED_IN_BASE_KEY] });
|
|
325
|
-
if (wallet2 && (
|
|
333
|
+
if (wallet2 && isWithFullAuth(wallet2)) {
|
|
326
334
|
yield onNewAuthState(d);
|
|
327
335
|
} else {
|
|
328
336
|
setStep(ModalStep.LOGIN_DONE);
|
|
@@ -412,7 +420,7 @@ function ExternalWalletProvider({ children }) {
|
|
|
412
420
|
return;
|
|
413
421
|
}
|
|
414
422
|
} else if (address) {
|
|
415
|
-
if (!!authState && ((
|
|
423
|
+
if (!!authState && (isWithFullAuth(wallet2) || includeWalletVerification)) {
|
|
416
424
|
onNewAuthState(authState);
|
|
417
425
|
} else {
|
|
418
426
|
setStep(ModalStep.LOGIN_DONE);
|
|
@@ -53,8 +53,8 @@ export interface ExternalWalletsSlice {
|
|
|
53
53
|
setConnectionOnly: (_: boolean) => void;
|
|
54
54
|
includeWalletVerification: boolean;
|
|
55
55
|
setIncludeWalletVerification: (_: boolean) => void;
|
|
56
|
-
externalWalletsWithFullAuth: TExternalWallet[];
|
|
57
|
-
setExternalWalletsWithFullAuth: (_: TExternalWallet[]) => void;
|
|
56
|
+
externalWalletsWithFullAuth: TExternalWallet[] | 'ALL';
|
|
57
|
+
setExternalWalletsWithFullAuth: (_: TExternalWallet[] | 'ALL') => void;
|
|
58
58
|
evmLib: typeof paraEvmLib | undefined;
|
|
59
59
|
setEvmLib: (_: typeof paraEvmLib) => void;
|
|
60
60
|
evmContext: Context<EvmExternalWalletContextType>;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-sdk-lite",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.51",
|
|
4
4
|
"bin": {
|
|
5
5
|
"setup-para": "dist/cli/cli.mjs"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@getpara/react-common": "2.0.0-alpha.
|
|
9
|
-
"@getpara/react-components": "2.0.0-alpha.
|
|
10
|
-
"@getpara/web-sdk": "2.0.0-alpha.
|
|
8
|
+
"@getpara/react-common": "2.0.0-alpha.51",
|
|
9
|
+
"@getpara/react-components": "2.0.0-alpha.51",
|
|
10
|
+
"@getpara/web-sdk": "2.0.0-alpha.51",
|
|
11
11
|
"date-fns": "^3.6.0",
|
|
12
12
|
"framer-motion": "^11.3.31",
|
|
13
13
|
"libphonenumber-js": "^1.11.7",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"zustand-sync-tabs": "^0.2.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@getpara/cosmos-wallet-connectors": "2.0.0-alpha.
|
|
20
|
-
"@getpara/evm-wallet-connectors": "2.0.0-alpha.
|
|
21
|
-
"@getpara/solana-wallet-connectors": "2.0.0-alpha.
|
|
19
|
+
"@getpara/cosmos-wallet-connectors": "2.0.0-alpha.51",
|
|
20
|
+
"@getpara/evm-wallet-connectors": "2.0.0-alpha.51",
|
|
21
|
+
"@getpara/solana-wallet-connectors": "2.0.0-alpha.51",
|
|
22
22
|
"@tanstack/react-query": "^5.74.0",
|
|
23
23
|
"@testing-library/dom": "^10.4.0",
|
|
24
24
|
"@testing-library/react": "^16.3.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"package.json",
|
|
39
39
|
"styles.css"
|
|
40
40
|
],
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "f5b6354bac51de2e6988af340d7490dbdb62bc88",
|
|
42
42
|
"main": "dist/index.js",
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@tanstack/react-query": ">=5.0.0",
|