@coinflowlabs/react-native 0.2.1 → 0.2.3
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.
|
@@ -10,6 +10,7 @@ type CoinflowPurchaseProps = {
|
|
|
10
10
|
transaction?: Transaction;
|
|
11
11
|
partialSigners?: Signer[];
|
|
12
12
|
debugTx?: boolean;
|
|
13
|
+
onLoad?: () => void;
|
|
13
14
|
} & CoinflowWebViewProps;
|
|
14
|
-
export declare function CoinflowPurchase({ wallet, merchantId, env, transaction, amount, style, WebViewRef, handleIframeMessages, }: CoinflowPurchaseProps & WithStyles): JSX.Element | null;
|
|
15
|
+
export declare function CoinflowPurchase({ wallet, merchantId, env, transaction, amount, style, WebViewRef, handleIframeMessages, onLoad, }: CoinflowPurchaseProps & WithStyles): JSX.Element | null;
|
|
15
16
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CoinflowWebView, } from './CoinflowWebView';
|
|
3
|
-
export function CoinflowPurchase({ wallet, merchantId, env, transaction, amount, style, WebViewRef, handleIframeMessages, }) {
|
|
3
|
+
export function CoinflowPurchase({ wallet, merchantId, env, transaction, amount, style, WebViewRef, handleIframeMessages, onLoad, }) {
|
|
4
4
|
if (!wallet.publicKey || !wallet.connected)
|
|
5
5
|
return null;
|
|
6
|
-
return (React.createElement(CoinflowWebView, { publicKey: wallet.publicKey.toString(), WebViewRef: WebViewRef, route: `/purchase/${merchantId}`, env: env, transaction: transaction, amount: amount, handleIframeMessages: handleIframeMessages, style: style }));
|
|
6
|
+
return (React.createElement(CoinflowWebView, { publicKey: wallet.publicKey.toString(), WebViewRef: WebViewRef, route: `/purchase/${merchantId}`, env: env, transaction: transaction, amount: amount, handleIframeMessages: handleIframeMessages, style: style, onLoad: onLoad }));
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=CoinflowPurchase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowPurchase.js","sourceRoot":"","sources":["../src/CoinflowPurchase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,eAAe,GAGhB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"CoinflowPurchase.js","sourceRoot":"","sources":["../src/CoinflowPurchase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,eAAe,GAGhB,MAAM,mBAAmB,CAAC;AAe3B,MAAM,UAAU,gBAAgB,CAAC,EAC/B,MAAM,EACN,UAAU,EACV,GAAG,EACH,WAAW,EACX,MAAM,EACN,KAAK,EACL,UAAU,EACV,oBAAoB,EACpB,MAAM,GAC6B;IACnC,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAExD,OAAO,CACL,oBAAC,eAAe,IACd,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,EACtC,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,aAAa,UAAU,EAAE,EAChC,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,oBAAoB,EAC1C,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,GACd,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -10,6 +10,7 @@ type CoinflowIFrameProps = {
|
|
|
10
10
|
route: string;
|
|
11
11
|
amount?: number;
|
|
12
12
|
transaction?: Transaction;
|
|
13
|
+
onLoad?: () => void;
|
|
13
14
|
};
|
|
14
15
|
export type CoinflowWebViewProps = Omit<CoinflowIFrameProps, 'IFrameRef'> & {
|
|
15
16
|
handleIframeMessages: ({ data }: {
|
|
@@ -20,5 +21,5 @@ export type CoinflowWebViewProps = Omit<CoinflowIFrameProps, 'IFrameRef'> & {
|
|
|
20
21
|
export type WithStyles = {
|
|
21
22
|
style?: StyleProp<ViewStyle>;
|
|
22
23
|
};
|
|
23
|
-
export declare function CoinflowWebView({ publicKey, env, route, transaction, amount, handleIframeMessages, WebViewRef, style, }: CoinflowWebViewProps & WithStyles): JSX.Element;
|
|
24
|
+
export declare function CoinflowWebView({ publicKey, env, route, transaction, amount, handleIframeMessages, WebViewRef, style, onLoad, }: CoinflowWebViewProps & WithStyles): JSX.Element;
|
|
24
25
|
export {};
|
package/build/CoinflowWebView.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import WebView from 'react-native-webview';
|
|
3
|
+
import { Linking } from 'react-native';
|
|
3
4
|
import { ReactNativeCoinflowUtils, } from './ReactNativeCoinflowUtils';
|
|
4
|
-
export function CoinflowWebView({ publicKey, env, route, transaction, amount, handleIframeMessages, WebViewRef, style, }) {
|
|
5
|
+
export function CoinflowWebView({ publicKey, env, route, transaction, amount, handleIframeMessages, WebViewRef, style, onLoad, }) {
|
|
5
6
|
const url = useMemo(() => {
|
|
6
7
|
return ReactNativeCoinflowUtils.getCoinflowUrl({
|
|
7
8
|
amount,
|
|
@@ -16,6 +17,12 @@ export function CoinflowWebView({ publicKey, env, route, transaction, amount, ha
|
|
|
16
17
|
flex: 1,
|
|
17
18
|
},
|
|
18
19
|
style,
|
|
19
|
-
],
|
|
20
|
+
], keyboardDisplayRequiresUserAction: false, showsVerticalScrollIndicator: false, onShouldStartLoadWithRequest: request => {
|
|
21
|
+
if (request.url.includes('solscan')) {
|
|
22
|
+
Linking.openURL(request.url).catch();
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}, ref: WebViewRef, source: { uri: url }, onMessage: event => handleIframeMessages({ data: event.nativeEvent.data }), onLoad: onLoad })), [url]);
|
|
20
27
|
}
|
|
21
28
|
//# sourceMappingURL=CoinflowWebView.js.map
|
|
@@ -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;AACrC,OAAO,OAAO,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"CoinflowWebView.js","sourceRoot":"","sources":["../src/CoinflowWebView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAC,OAAO,EAAuB,MAAM,cAAc,CAAC;AAC3D,OAAO,EAEL,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AAoBpC,MAAM,UAAU,eAAe,CAAC,EAC9B,SAAS,EACT,GAAG,EACH,KAAK,EACL,WAAW,EACX,MAAM,EACN,oBAAoB,EACpB,UAAU,EACV,KAAK,EACL,MAAM,GAC4B;IAClC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;QACvB,OAAO,wBAAwB,CAAC,cAAc,CAAC;YAC7C,MAAM;YACN,GAAG;YACH,SAAS;YACT,KAAK;YACL,WAAW;SACZ,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;IAEjD,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CACJ,oBAAC,OAAO,IACN,KAAK,EAAE;YACL;gBACE,IAAI,EAAE,CAAC;aACR;YACD,KAAK;SACN,EACD,iCAAiC,EAAE,KAAK,EACxC,4BAA4B,EAAE,KAAK,EACnC,4BAA4B,EAAE,OAAO,CAAC,EAAE;YACtC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;gBACnC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;gBACrC,OAAO,KAAK,CAAC;aACd;YACD,OAAO,IAAI,CAAC;QACd,CAAC,EACD,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,EAAC,GAAG,EAAE,GAAG,EAAC,EAClB,SAAS,EAAE,KAAK,CAAC,EAAE,CACjB,oBAAoB,CAAC,EAAC,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI,EAAC,CAAC,EAEtD,MAAM,EAAE,MAAM,GACd,CACH,EACD,CAAC,GAAG,CAAC,CACN,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinflowlabs/react-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "React Native Component for Coinflow Withdraw",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"bs58": "^5.0.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/react": "^18.0.
|
|
33
|
-
"@types/react-native": "^0.
|
|
32
|
+
"@types/react": "^18.0.28",
|
|
33
|
+
"@types/react-native": "^0.71.2",
|
|
34
34
|
"eslint-config-react-app": "^7.0.1",
|
|
35
|
-
"typescript": "^4.9.
|
|
35
|
+
"typescript": "^4.9.5"
|
|
36
36
|
}
|
|
37
37
|
}
|