@multiplatform.one/web3 7.34.1 → 7.34.2
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/providers/WalletProvider.native.js +4 -3
- package/dist/cjs/providers/WalletProvider.native.js.map +1 -1
- package/dist/cjs/providers/native/webViewLoader.cjs +41 -0
- package/dist/cjs/providers/native/webViewLoader.native.js +45 -0
- package/dist/cjs/providers/native/webViewLoader.native.js.map +1 -0
- package/dist/esm/providers/WalletProvider.native.js +3 -2
- package/dist/esm/providers/WalletProvider.native.js.map +1 -1
- package/dist/esm/providers/native/webViewLoader.mjs +16 -0
- package/dist/esm/providers/native/webViewLoader.mjs.map +1 -0
- package/dist/esm/providers/native/webViewLoader.native.js +17 -0
- package/dist/esm/providers/native/webViewLoader.native.js.map +1 -0
- package/dist/jsx/providers/WalletProvider.native.js +4 -3
- package/dist/jsx/providers/WalletProvider.native.js.map +1 -1
- package/dist/jsx/providers/native/webViewLoader.mjs +16 -0
- package/dist/jsx/providers/native/webViewLoader.mjs.map +1 -0
- package/dist/jsx/providers/native/webViewLoader.native.js +45 -0
- package/dist/jsx/providers/native/webViewLoader.native.js.map +1 -0
- package/dist/keycloak/login.iife.js +540 -539
- package/package.json +19 -19
- package/src/providers/WalletProvider.native.spec.tsx +6 -0
- package/src/providers/WalletProvider.native.tsx +9 -3
- package/src/providers/native/webViewLoader.ts +27 -0
- package/types/providers/WalletProvider.native.d.ts +1 -1
- package/types/providers/WalletProvider.native.d.ts.map +1 -1
- package/types/providers/native/webViewLoader.d.ts +10 -0
- package/types/providers/native/webViewLoader.d.ts.map +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/web3",
|
|
3
|
-
"version": "7.34.
|
|
3
|
+
"version": "7.34.2",
|
|
4
4
|
"description": "Web3 wallet integration for multiplatform.one ecosystem with ConnectKit and wagmi",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"connectkit",
|
|
@@ -117,20 +117,20 @@
|
|
|
117
117
|
"access": "public"
|
|
118
118
|
},
|
|
119
119
|
"dependencies": {
|
|
120
|
-
"@aave/account": "^0.2.
|
|
121
|
-
"@coinbase/wallet-sdk": "^4.
|
|
120
|
+
"@aave/account": "^0.2.1",
|
|
121
|
+
"@coinbase/wallet-sdk": "^4.4.0",
|
|
122
122
|
"@metamask/connect-evm": "^2.1.1",
|
|
123
|
-
"@multiplatform.one/connectkit": "7.34.
|
|
124
|
-
"@multiplatform.one/gpg": "7.34.
|
|
125
|
-
"@multiplatform.one/platform": "7.34.
|
|
126
|
-
"@multiplatform.one/theme": "7.34.
|
|
123
|
+
"@multiplatform.one/connectkit": "7.34.2",
|
|
124
|
+
"@multiplatform.one/gpg": "7.34.2",
|
|
125
|
+
"@multiplatform.one/platform": "7.34.2",
|
|
126
|
+
"@multiplatform.one/theme": "7.34.2",
|
|
127
127
|
"@noble/ciphers": "^1.3.0",
|
|
128
128
|
"@noble/curves": "^1.9.7",
|
|
129
|
-
"@solana/kit": "^8.
|
|
130
|
-
"@solana/wallet-adapter-base": "^0.9.
|
|
131
|
-
"@solana/wallet-adapter-phantom": "^0.9.
|
|
132
|
-
"@solana/wallet-adapter-react": "^0.15.
|
|
133
|
-
"@solana/wallet-adapter-solflare": "^0.6.
|
|
129
|
+
"@solana/kit": "^8.5.0",
|
|
130
|
+
"@solana/wallet-adapter-base": "^0.9.28",
|
|
131
|
+
"@solana/wallet-adapter-phantom": "^0.9.30",
|
|
132
|
+
"@solana/wallet-adapter-react": "^0.15.40",
|
|
133
|
+
"@solana/wallet-adapter-solflare": "^0.6.34",
|
|
134
134
|
"@solana/web3.js": "^1.98.4",
|
|
135
135
|
"bs58": "^6.0.0",
|
|
136
136
|
"buffer": "^6.0.3",
|
|
@@ -142,20 +142,20 @@
|
|
|
142
142
|
"resize-observer-polyfill": "^1.5.1",
|
|
143
143
|
"styled-components": "^5.3.5",
|
|
144
144
|
"tamagui": "2.7.6",
|
|
145
|
-
"viem": "^2.
|
|
145
|
+
"viem": "^2.55.19",
|
|
146
146
|
"wagmi": "^3.7.1"
|
|
147
147
|
},
|
|
148
148
|
"devDependencies": {
|
|
149
|
-
"@multiplatform.one/config": "7.34.
|
|
149
|
+
"@multiplatform.one/config": "7.34.2",
|
|
150
150
|
"@tamagui/build": "2.7.6",
|
|
151
|
-
"@tanstack/react-query": "^5.
|
|
152
|
-
"@testing-library/jest-dom": "^
|
|
153
|
-
"@testing-library/react": "^16.3.
|
|
151
|
+
"@tanstack/react-query": "^5.104.3",
|
|
152
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
153
|
+
"@testing-library/react": "^16.3.3",
|
|
154
154
|
"@types/qrcode": "^1.4.2",
|
|
155
155
|
"@types/styled-components": "^5.1.25",
|
|
156
|
-
"@vitejs/plugin-react": "^6.
|
|
156
|
+
"@vitejs/plugin-react": "^6.1.2",
|
|
157
157
|
"fake-indexeddb": "^6.2.5",
|
|
158
|
-
"happy-dom": "^
|
|
158
|
+
"happy-dom": "^21.0.3",
|
|
159
159
|
"react": "19.2.5",
|
|
160
160
|
"react-dom": "19.2.5",
|
|
161
161
|
"tamagui": "2.7.6",
|
|
@@ -40,6 +40,12 @@ vi.mock("react-native", () => ({
|
|
|
40
40
|
),
|
|
41
41
|
}));
|
|
42
42
|
|
|
43
|
+
// The provider requires the peer through its loader; hand it the stand-in.
|
|
44
|
+
vi.mock("./native/webViewLoader", async () => {
|
|
45
|
+
const { WebView } = await import("react-native-webview");
|
|
46
|
+
return { loadWebView: () => WebView };
|
|
47
|
+
});
|
|
48
|
+
|
|
43
49
|
vi.mock("react-native-webview", () => ({
|
|
44
50
|
WebView: forwardRef(function WebView(props: Record<string, (event: unknown) => void>, ref) {
|
|
45
51
|
rn.webview.props = props;
|
|
@@ -2,7 +2,11 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
|
2
2
|
import type { PropsWithChildren } from "react";
|
|
3
3
|
import { createContext, useContext, useEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
4
4
|
import { AppState, Linking, StyleSheet, View } from "react-native";
|
|
5
|
-
import
|
|
5
|
+
import type {
|
|
6
|
+
WebView as WebViewInstance,
|
|
7
|
+
WebViewMessageEvent,
|
|
8
|
+
WebViewProps,
|
|
9
|
+
} from "react-native-webview";
|
|
6
10
|
import { WagmiProvider, createConfig } from "wagmi";
|
|
7
11
|
import { AuthBridge } from "../bridge/AuthBridge";
|
|
8
12
|
import { BridgeClient } from "../bridge/BridgeClient";
|
|
@@ -21,6 +25,7 @@ import {
|
|
|
21
25
|
} from "./native/deepLink";
|
|
22
26
|
import { buildConfigInjection } from "./native/inject";
|
|
23
27
|
import { initialVisibility, nextVisibility } from "./native/visibility";
|
|
28
|
+
import { loadWebView } from "./native/webViewLoader";
|
|
24
29
|
import { defineWalletFamily, type WalletFamily } from "../core/family";
|
|
25
30
|
import { SignInProvider, type SignInConfig } from "../core/signIn";
|
|
26
31
|
import { walletFamilies } from "../families";
|
|
@@ -110,7 +115,8 @@ export function Web3Provider({
|
|
|
110
115
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
111
116
|
[listedKey],
|
|
112
117
|
);
|
|
113
|
-
const
|
|
118
|
+
const WebView = loadWebView();
|
|
119
|
+
const webRef = useRef<WebViewInstance>(null);
|
|
114
120
|
const [pageLoad, setPageLoad] = useState(0);
|
|
115
121
|
const [strandedHost, setStrandedHost] = useState<NativeBridge | null>(null);
|
|
116
122
|
const [visibility, dispatchVisibility] = useReducer(nextVisibility, initialVisibility);
|
|
@@ -257,7 +263,7 @@ export function Web3Provider({
|
|
|
257
263
|
listed,
|
|
258
264
|
signIn ? <SignInProvider {...signIn}>{children}</SignInProvider> : children,
|
|
259
265
|
)}
|
|
260
|
-
{host && pageUrl && (
|
|
266
|
+
{WebView && host && pageUrl && (
|
|
261
267
|
<View
|
|
262
268
|
style={visibility.sheetOpen ? styles.visible : styles.hidden}
|
|
263
269
|
pointerEvents={visibility.sheetOpen ? "auto" : "none"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type WebViewComponent = typeof import("react-native-webview").WebView;
|
|
2
|
+
|
|
3
|
+
let cached: WebViewComponent | null | undefined;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Loads the optional `react-native-webview` peer at runtime. A static import of
|
|
7
|
+
* an absent peer stays external in the native bundle, and hermesc rejects the
|
|
8
|
+
* leftover `import` statement for the whole app (FZ-7357). The guarded
|
|
9
|
+
* `require` returns null instead; the provider then renders its children
|
|
10
|
+
* without the wallet sheet and says which package is missing.
|
|
11
|
+
*/
|
|
12
|
+
export function loadWebView(): WebViewComponent | null {
|
|
13
|
+
if (cached !== undefined) return cached;
|
|
14
|
+
try {
|
|
15
|
+
const mod = require("react-native-webview") as { WebView?: WebViewComponent };
|
|
16
|
+
cached = mod?.WebView ?? null;
|
|
17
|
+
} catch {
|
|
18
|
+
cached = null;
|
|
19
|
+
}
|
|
20
|
+
if (!cached) {
|
|
21
|
+
console.warn(
|
|
22
|
+
"[@multiplatform.one/web3] react-native-webview is not installed, so the native wallet " +
|
|
23
|
+
"sheet cannot mount. Add react-native-webview to the app's dependencies.",
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
return cached;
|
|
27
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QueryClient } from "@tanstack/react-query";
|
|
2
2
|
import type { PropsWithChildren } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import type { WebViewProps } from "react-native-webview";
|
|
4
4
|
import { SolanaBridge } from "../bridge/SolanaBridge";
|
|
5
5
|
import { type WalletFamily } from "../core/family";
|
|
6
6
|
import { type SignInConfig } from "../core/signIn";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletProvider.native.d.ts","sourceRoot":"","sources":["../../src/providers/WalletProvider.native.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,uBAAuB,CAAC;A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,MAAM,EAAE,UAAU,EAClB,QAAQ,EACR,WAAgC,EAChC,MAAM,EACN,aAAa,GACd,EAAE,iBAAiB,2CAoNnB;AAED,yCAAyC;AACzC,eAAO,MAAM,cAAc,qBAAe,CAAC;AAU3C,OAAO,EAAE,eAAe,EAAE,KAAK,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type WebViewComponent = typeof import("react-native-webview").WebView;
|
|
2
|
+
/**
|
|
3
|
+
* Loads the optional `react-native-webview` peer at runtime. A static import of
|
|
4
|
+
* an absent peer stays external in the native bundle, and hermesc rejects the
|
|
5
|
+
* leftover `import` statement for the whole app (FZ-7357). The guarded
|
|
6
|
+
* `require` returns null instead; the provider then renders its children
|
|
7
|
+
* without the wallet sheet and says which package is missing.
|
|
8
|
+
*/
|
|
9
|
+
export declare function loadWebView(): WebViewComponent | null;
|
|
10
|
+
//# sourceMappingURL=webViewLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webViewLoader.d.ts","sourceRoot":"","sources":["../../../src/providers/native/webViewLoader.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,cAAc,sBAAsB,EAAE,OAAO,CAAC;AAI7E;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,gBAAgB,GAAG,IAAI,CAerD"}
|