@coinflowlabs/react-native 2.1.6-SNAPSHOT.1 → 2.1.6
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/build/CoinflowTypes.d.ts
CHANGED
|
@@ -151,8 +151,8 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
|
151
151
|
email?: string;
|
|
152
152
|
deviceId?: string;
|
|
153
153
|
chargebackProtectionData?: ChargebackProtectionData;
|
|
154
|
-
disableApplePay
|
|
155
|
-
disableGooglePay
|
|
154
|
+
disableApplePay?: boolean;
|
|
155
|
+
disableGooglePay?: boolean;
|
|
156
156
|
}
|
|
157
157
|
export interface CoinflowSolanaPurchaseProps extends CoinflowCommonPurchaseProps {
|
|
158
158
|
wallet: SolanaWallet;
|
package/build/CoinflowWebView.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import WebView from 'react-native-webview';
|
|
3
3
|
import { Linking, Platform } from 'react-native';
|
|
4
4
|
import { ReactNativeCoinflowUtils } from './ReactNativeCoinflowUtils';
|
|
@@ -7,35 +7,38 @@ export function CoinflowWebView(props) {
|
|
|
7
7
|
return ReactNativeCoinflowUtils.getCoinflowUrl(props);
|
|
8
8
|
}, [props]);
|
|
9
9
|
var handleIframeMessages = props.handleIframeMessages, WebViewRef = props.WebViewRef, style = props.style, onLoad = props.onLoad;
|
|
10
|
+
var onShouldStartLoadWithRequest = useCallback(function (request) {
|
|
11
|
+
var whitelist = [
|
|
12
|
+
'solscan',
|
|
13
|
+
'etherscan',
|
|
14
|
+
'persona',
|
|
15
|
+
'polyscan',
|
|
16
|
+
'near.org',
|
|
17
|
+
'plaid',
|
|
18
|
+
'coinflow.cash',
|
|
19
|
+
];
|
|
20
|
+
var blacklist = ['pay.google.com'];
|
|
21
|
+
var shouldRedirect = (request.url.includes('https') || request.url.includes('http')) &&
|
|
22
|
+
whitelist.some(function (item) { return request.url.includes(item); }) &&
|
|
23
|
+
!blacklist.some(function (item) { return request.url.includes(item); });
|
|
24
|
+
var isCurrentUrl = request.url.split('?')[0] === url.split('?')[0];
|
|
25
|
+
if (!shouldRedirect || isCurrentUrl)
|
|
26
|
+
return true;
|
|
27
|
+
Linking.openURL(request.url).catch();
|
|
28
|
+
return false;
|
|
29
|
+
}, []);
|
|
10
30
|
return useMemo(function () {
|
|
11
31
|
if (!props.publicKey)
|
|
12
32
|
return null;
|
|
13
|
-
var enableApplePay = props.
|
|
33
|
+
var enableApplePay = !props.disableApplePay &&
|
|
34
|
+
props.route.includes('/purchase/') &&
|
|
35
|
+
Platform.OS === 'ios';
|
|
14
36
|
return (React.createElement(WebView, { style: [
|
|
15
37
|
{
|
|
16
38
|
flex: 1,
|
|
17
39
|
},
|
|
18
40
|
style,
|
|
19
|
-
], enableApplePay: enableApplePay, keyboardDisplayRequiresUserAction: false, showsVerticalScrollIndicator: false, onShouldStartLoadWithRequest: function (
|
|
20
|
-
var whitelist = [
|
|
21
|
-
'solscan',
|
|
22
|
-
'etherscan',
|
|
23
|
-
'persona',
|
|
24
|
-
'polyscan',
|
|
25
|
-
'near.org',
|
|
26
|
-
'plaid',
|
|
27
|
-
'coinflow.cash',
|
|
28
|
-
];
|
|
29
|
-
var blacklist = ['pay.google.com'];
|
|
30
|
-
var shouldRedirect = (request.url.includes('https') || request.url.includes('http')) &&
|
|
31
|
-
whitelist.some(function (item) { return request.url.includes(item); }) &&
|
|
32
|
-
!blacklist.some(function (item) { return request.url.includes(item); });
|
|
33
|
-
var isCurrentUrl = request.url.split('?')[0] === url.split('?')[0];
|
|
34
|
-
if (!shouldRedirect || isCurrentUrl)
|
|
35
|
-
return true;
|
|
36
|
-
Linking.openURL(request.url).catch();
|
|
37
|
-
return false;
|
|
38
|
-
}, ref: WebViewRef, source: { uri: url }, onMessage: function (event) {
|
|
41
|
+
], enableApplePay: enableApplePay, keyboardDisplayRequiresUserAction: false, showsVerticalScrollIndicator: false, onShouldStartLoadWithRequest: onShouldStartLoadWithRequest, ref: WebViewRef, source: { uri: url }, onMessage: function (event) {
|
|
39
42
|
return handleIframeMessages({ data: event.nativeEvent.data });
|
|
40
43
|
}, onLoad: onLoad }));
|
|
41
44
|
}, [url]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowWebView.js","sourceRoot":"","sources":["../src/CoinflowWebView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CoinflowWebView.js","sourceRoot":"","sources":["../src/CoinflowWebView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AAIpE,MAAM,UAAU,eAAe,CAAC,KAAwC;IACtE,IAAM,GAAG,GAAG,OAAO,CAAC;QAClB,OAAO,wBAAwB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEL,IAAA,oBAAoB,GAA+B,KAAK,qBAApC,EAAE,UAAU,GAAmB,KAAK,WAAxB,EAAE,KAAK,GAAY,KAAK,MAAjB,EAAE,MAAM,GAAI,KAAK,OAAT,CAAU;IAEhE,IAAM,4BAA4B,GAAG,WAAW,CAC9C,UAAC,OAA+B;QAC9B,IAAM,SAAS,GAAG;YAChB,SAAS;YACT,WAAW;YACX,SAAS;YACT,UAAU;YACV,UAAU;YACV,OAAO;YACP,eAAe;SAChB,CAAC;QAEF,IAAM,SAAS,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAErC,IAAM,cAAc,GA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AAG,EAAC,EAClB,SAAS,EAAE,UAAA,KAAK;gBACd,OAAA,oBAAoB,CAAC,EAAC,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI,EAAC,CAAC;YAApD,CAAoD,EAEtD,MAAM,EAAE,MAAM,GACd,CACH,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACZ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinflowlabs/react-native",
|
|
3
|
-
"version": "2.1.6
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"description": "React Native Component for Coinflow",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@solana/web3.js": "^1.87.3"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@types/react": "^18.2.
|
|
39
|
+
"@types/react": "^18.2.47",
|
|
40
40
|
"@types/react-native": "^0.72.7",
|
|
41
41
|
"eslint-config-react-app": "^7.0.1",
|
|
42
42
|
"typescript": "^5.3.2",
|