@portal-hq/webview 4.1.0-beta2 → 4.1.0

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.
@@ -59,11 +59,18 @@ const Webview = (0, react_1.memo)((0, react_1.forwardRef)(({ onNavigationStateCh
59
59
  const source = (0, react_1.useMemo)(() => ({
60
60
  uri: currentUrl,
61
61
  }), [currentUrl]);
62
+ // Filter out "eip155:" from the gateway config.
63
+ const onlyEip155GatewayConfig = {};
64
+ Object.entries(portal.gatewayConfig).forEach(([key, value]) => {
65
+ if (key.startsWith('eip155:')) {
66
+ onlyEip155GatewayConfig[key.replace('eip155:', '')] = value;
67
+ }
68
+ });
62
69
  const scriptToInject = (0, injected_provider_1.injectionScript)({
63
70
  address: walletAddress,
64
71
  apiKey: portal.apiKey,
65
72
  chainId: portal.chainId,
66
- gatewayConfig: portal.gatewayConfig,
73
+ gatewayConfig: onlyEip155GatewayConfig,
67
74
  });
68
75
  const handleBackPress = () => {
69
76
  var _a;
package/lib/esm/index.js CHANGED
@@ -31,11 +31,18 @@ const Webview = memo(forwardRef(({ onNavigationStateChange, onSigningRequested,
31
31
  const source = useMemo(() => ({
32
32
  uri: currentUrl,
33
33
  }), [currentUrl]);
34
+ // Filter out "eip155:" from the gateway config.
35
+ const onlyEip155GatewayConfig = {};
36
+ Object.entries(portal.gatewayConfig).forEach(([key, value]) => {
37
+ if (key.startsWith('eip155:')) {
38
+ onlyEip155GatewayConfig[key.replace('eip155:', '')] = value;
39
+ }
40
+ });
34
41
  const scriptToInject = injectionScript({
35
42
  address: walletAddress,
36
43
  apiKey: portal.apiKey,
37
44
  chainId: portal.chainId,
38
- gatewayConfig: portal.gatewayConfig,
45
+ gatewayConfig: onlyEip155GatewayConfig,
39
46
  });
40
47
  const handleBackPress = () => {
41
48
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portal-hq/webview",
3
- "version": "4.1.0-beta2",
3
+ "version": "4.1.0",
4
4
  "license": "MIT",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/esm/index",
@@ -18,9 +18,9 @@
18
18
  "test": "jest --passWithNoTests"
19
19
  },
20
20
  "dependencies": {
21
- "@portal-hq/core": "^4.1.0-beta2",
22
- "@portal-hq/injected-provider": "^4.1.0-beta2",
23
- "@portal-hq/utils": "^4.1.0-beta2"
21
+ "@portal-hq/core": "^4.1.0",
22
+ "@portal-hq/injected-provider": "^4.1.0",
23
+ "@portal-hq/utils": "^4.1.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/jest": "^29.2.0",
@@ -36,5 +36,5 @@
36
36
  "react-native": "*",
37
37
  "react-native-webview": "*"
38
38
  },
39
- "gitHead": "5a1ad407588a072e2559f1d0410dcfef84394580"
39
+ "gitHead": "d53139e2dae6d0ede12d647ae4d11f4915b896f1"
40
40
  }
package/src/index.tsx CHANGED
@@ -56,11 +56,19 @@ const Webview = memo(
56
56
  [currentUrl],
57
57
  )
58
58
 
59
+ // Filter out "eip155:" from the gateway config.
60
+ const onlyEip155GatewayConfig: typeof portal.gatewayConfig = {}
61
+ Object.entries(portal.gatewayConfig).forEach(([key, value]) => {
62
+ if (key.startsWith('eip155:')) {
63
+ onlyEip155GatewayConfig[key.replace('eip155:', '')] = value
64
+ }
65
+ })
66
+
59
67
  const scriptToInject = injectionScript({
60
68
  address: walletAddress as string,
61
69
  apiKey: portal.apiKey,
62
70
  chainId: portal.chainId,
63
- gatewayConfig: portal.gatewayConfig,
71
+ gatewayConfig: onlyEip155GatewayConfig,
64
72
  })
65
73
 
66
74
  const handleBackPress = (): boolean => {