@portal-hq/webview 4.1.0-beta2 → 4.1.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.
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -59,11 +69,18 @@ const Webview = (0, react_1.memo)((0, react_1.forwardRef)(({ onNavigationStateCh
59
69
  const source = (0, react_1.useMemo)(() => ({
60
70
  uri: currentUrl,
61
71
  }), [currentUrl]);
72
+ // Filter out "eip155:" from the gateway config.
73
+ const onlyEip155GatewayConfig = {};
74
+ Object.entries(portal.gatewayConfig).forEach(([key, value]) => {
75
+ if (key.startsWith('eip155:')) {
76
+ onlyEip155GatewayConfig[key.replace('eip155:', '')] = value;
77
+ }
78
+ });
62
79
  const scriptToInject = (0, injected_provider_1.injectionScript)({
63
80
  address: walletAddress,
64
81
  apiKey: portal.apiKey,
65
82
  chainId: portal.chainId,
66
- gatewayConfig: portal.gatewayConfig,
83
+ gatewayConfig: onlyEip155GatewayConfig,
67
84
  });
68
85
  const handleBackPress = () => {
69
86
  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.1",
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.1",
22
+ "@portal-hq/injected-provider": "^4.1.1",
23
+ "@portal-hq/utils": "^4.1.1"
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": "3c03bd4a6573b23865f655856cd0161706f3f30d"
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 => {