@coinflowlabs/react-native 3.1.0 → 3.1.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/build/CoinflowPurchase.d.ts +3 -2
- package/build/CoinflowPurchase.js +11 -53
- package/build/CoinflowPurchase.js.map +1 -1
- package/build/CoinflowPurchaseHistory.d.ts +3 -2
- package/build/CoinflowPurchaseHistory.js +10 -18
- package/build/CoinflowPurchaseHistory.js.map +1 -1
- package/build/CoinflowWebView.d.ts +10 -2
- package/build/CoinflowWebView.js +18 -5
- package/build/CoinflowWebView.js.map +1 -1
- package/build/CoinflowWithdraw.d.ts +3 -2
- package/build/CoinflowWithdraw.js +12 -36
- package/build/CoinflowWithdraw.js.map +1 -1
- package/build/CoinflowWithdrawHistory.d.ts +3 -2
- package/build/CoinflowWithdrawHistory.js +10 -18
- package/build/CoinflowWithdrawHistory.js.map +1 -1
- package/build/common/CoinflowLibMessageHandlers.d.ts +21 -0
- package/build/common/CoinflowLibMessageHandlers.js +180 -0
- package/build/common/CoinflowLibMessageHandlers.js.map +1 -0
- package/build/{CoinflowTypes.d.ts → common/CoinflowTypes.d.ts} +69 -88
- package/build/{CoinflowTypes.js → common/CoinflowTypes.js} +2 -3
- package/build/common/CoinflowTypes.js.map +1 -0
- package/build/common/CoinflowUtils.d.ts +21 -0
- package/build/common/CoinflowUtils.js +219 -0
- package/build/common/CoinflowUtils.js.map +1 -0
- package/build/common/SolanaPeerDeps.d.ts +5 -0
- package/build/common/SolanaPeerDeps.js +17 -0
- package/build/common/SolanaPeerDeps.js.map +1 -0
- package/build/common/index.d.ts +3 -0
- package/build/common/index.js +4 -0
- package/build/common/index.js.map +1 -0
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/package.json +21 -6
- package/build/CoinflowTypes.js.map +0 -1
- package/build/ReactNativeCoinflowUtils.d.ts +0 -8
- package/build/ReactNativeCoinflowUtils.js +0 -79
- package/build/ReactNativeCoinflowUtils.js.map +0 -1
- package/build/wallet/EthIFrameMessageHandlers.d.ts +0 -5
- package/build/wallet/EthIFrameMessageHandlers.js +0 -37
- package/build/wallet/EthIFrameMessageHandlers.js.map +0 -1
- package/build/wallet/NearIFrameMessageHandlers.d.ts +0 -5
- package/build/wallet/NearIFrameMessageHandlers.js +0 -27
- package/build/wallet/NearIFrameMessageHandlers.js.map +0 -1
- package/build/wallet/SolanaIFrameMessageHandlers.d.ts +0 -18
- package/build/wallet/SolanaIFrameMessageHandlers.js +0 -134
- package/build/wallet/SolanaIFrameMessageHandlers.js.map +0 -1
- package/build/wallet/useWebViewWallet.d.ts +0 -11
- package/build/wallet/useWebViewWallet.js +0 -102
- package/build/wallet/useWebViewWallet.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { WithOnLoad, WithStyles } from './CoinflowWebView';
|
|
3
|
+
import { CoinflowPurchaseProps } from './common';
|
|
4
|
+
export declare function CoinflowPurchase(purchaseProps: CoinflowPurchaseProps & WithStyles & WithOnLoad): React.JSX.Element;
|
|
@@ -1,57 +1,15 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
-
import { CoinflowWebView } from './CoinflowWebView';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return React.createElement(EvmPurchase, __assign({}, props));
|
|
15
|
-
case 'eth':
|
|
16
|
-
return React.createElement(EvmPurchase, __assign({}, props));
|
|
17
|
-
case 'base':
|
|
18
|
-
return React.createElement(EvmPurchase, __assign({}, props));
|
|
19
|
-
case 'near':
|
|
20
|
-
return React.createElement(NearPurchase, __assign({}, props));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
function SolanaPurchase(props) {
|
|
24
|
-
var _a;
|
|
25
|
-
var handlers = useSolanaIFrameMessageHandlers(props);
|
|
26
|
-
var _b = useWebViewWallet(handlers, props), WebViewRef = _b.WebViewRef, handleIframeMessages = _b.handleIframeMessages;
|
|
27
|
-
var transaction = useMemo(function () {
|
|
28
|
-
if (!props.transaction)
|
|
29
|
-
return undefined;
|
|
30
|
-
return base58.encode(props.transaction.serialize({
|
|
31
|
-
requireAllSignatures: false,
|
|
32
|
-
verifySignatures: false,
|
|
33
|
-
}));
|
|
34
|
-
}, []);
|
|
35
|
-
return (React.createElement(CoinflowWebView, __assign({ publicKey: (_a = props.wallet.publicKey) === null || _a === void 0 ? void 0 : _a.toString(), WebViewRef: WebViewRef, route: "/purchase/".concat(props.merchantId) }, props, { transaction: transaction, handleIframeMessages: handleIframeMessages })));
|
|
36
|
-
}
|
|
37
|
-
function EvmPurchase(props) {
|
|
38
|
-
var handlers = useEthIFrameMessageHandlers(props);
|
|
39
|
-
var _a = useWebViewWallet(handlers, props), WebViewRef = _a.WebViewRef, handleIframeMessages = _a.handleIframeMessages;
|
|
40
|
-
var transaction = useMemo(function () {
|
|
41
|
-
if (!props.transaction)
|
|
42
|
-
return undefined;
|
|
43
|
-
return Buffer.from(JSON.stringify(props.transaction)).toString('base64');
|
|
44
|
-
}, [props.transaction]);
|
|
45
|
-
return (React.createElement(CoinflowWebView, __assign({ publicKey: props.wallet.address, WebViewRef: WebViewRef, route: "/purchase/".concat(props.merchantId) }, props, { transaction: transaction, handleIframeMessages: handleIframeMessages })));
|
|
46
|
-
}
|
|
47
|
-
function NearPurchase(props) {
|
|
48
|
-
var handlers = useNearIFrameMessageHandlers(props);
|
|
49
|
-
var _a = useWebViewWallet(handlers, props), WebViewRef = _a.WebViewRef, handleIframeMessages = _a.handleIframeMessages;
|
|
50
|
-
var transaction = useMemo(function () {
|
|
51
|
-
return props.action
|
|
52
|
-
? Buffer.from(JSON.stringify(props.action)).toString('base64')
|
|
53
|
-
: undefined;
|
|
54
|
-
}, [props.action]);
|
|
55
|
-
return (React.createElement(CoinflowWebView, __assign({ publicKey: props.wallet.accountId, WebViewRef: WebViewRef, route: "/purchase/".concat(props.merchantId) }, props, { transaction: transaction, handleIframeMessages: handleIframeMessages })));
|
|
3
|
+
import { CoinflowWebView, } from './CoinflowWebView';
|
|
4
|
+
import { getWalletPubkey, getHandlers, CoinflowUtils, } from './common';
|
|
5
|
+
export function CoinflowPurchase(purchaseProps) {
|
|
6
|
+
var webviewProps = useMemo(function () {
|
|
7
|
+
var walletPubkey = getWalletPubkey(purchaseProps);
|
|
8
|
+
return __assign(__assign({}, purchaseProps), { walletPubkey: walletPubkey, route: "/purchase/".concat(purchaseProps.merchantId), transaction: CoinflowUtils.getTransaction(purchaseProps), onLoad: purchaseProps.onLoad });
|
|
9
|
+
}, [purchaseProps]);
|
|
10
|
+
var messageHandlers = useMemo(function () {
|
|
11
|
+
return __assign(__assign({}, getHandlers(purchaseProps)), { handleHeightChange: purchaseProps.handleHeightChange });
|
|
12
|
+
}, [purchaseProps]);
|
|
13
|
+
return React.createElement(CoinflowWebView, __assign({}, webviewProps, messageHandlers));
|
|
56
14
|
}
|
|
57
15
|
//# sourceMappingURL=CoinflowPurchase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowPurchase.js","sourceRoot":"","sources":["../src/CoinflowPurchase.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"CoinflowPurchase.js","sourceRoot":"","sources":["../src/CoinflowPurchase.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EACL,eAAe,GAIhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,eAAe,EACf,WAAW,EAEX,aAAa,GACd,MAAM,UAAU,CAAC;AAElB,MAAM,UAAU,gBAAgB,CAC9B,aAA8D;IAE9D,IAAM,YAAY,GAAG,OAAO,CAAuB;QACjD,IAAM,YAAY,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC;QACpD,6BACK,aAAa,KAChB,YAAY,cAAA,EACZ,KAAK,EAAE,oBAAa,aAAa,CAAC,UAAU,CAAE,EAC9C,WAAW,EAAE,aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,EACxD,MAAM,EAAE,aAAa,CAAC,MAAM,IAC5B;IACJ,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,IAAM,eAAe,GAAG,OAAO,CAAwB;QACrD,6BACK,WAAW,CAAC,aAAa,CAAC,KAC7B,kBAAkB,EAAE,aAAa,CAAC,kBAAkB,IACpD;IACJ,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO,oBAAC,eAAe,eAAK,YAAY,EAAM,eAAe,EAAI,CAAC;AACpE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { WithOnLoad, WithStyles } from './CoinflowWebView';
|
|
3
|
+
import { CoinflowHistoryProps } from './common';
|
|
4
|
+
export declare function CoinflowPurchaseHistory(props: CoinflowHistoryProps & WithStyles & WithOnLoad): React.JSX.Element;
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
-
import { CoinflowWebView } from './CoinflowWebView';
|
|
3
|
+
import { CoinflowWebView, } from './CoinflowWebView';
|
|
4
|
+
import { getWalletPubkey, getHandlers, } from './common';
|
|
4
5
|
export function CoinflowPurchaseHistory(props) {
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
case 'polygon':
|
|
14
|
-
return props.wallet.address;
|
|
15
|
-
case 'eth':
|
|
16
|
-
return props.wallet.address;
|
|
17
|
-
case 'base':
|
|
18
|
-
return props.wallet.address;
|
|
19
|
-
}
|
|
20
|
-
}, []);
|
|
21
|
-
return (React.createElement(CoinflowWebView, __assign({ publicKey: publicKey, WebViewRef: WebViewRef, handleIframeMessages: function () { return Promise.resolve(); }, route: "/history/purchase/".concat(props.merchantId) }, props)));
|
|
6
|
+
var webviewProps = useMemo(function () {
|
|
7
|
+
var walletPubkey = getWalletPubkey(props);
|
|
8
|
+
return __assign(__assign({}, props), { walletPubkey: walletPubkey, route: "/history/purchase/".concat(props.merchantId), onLoad: props.onLoad });
|
|
9
|
+
}, [props]);
|
|
10
|
+
var messageHandlers = useMemo(function () {
|
|
11
|
+
return __assign(__assign({}, getHandlers(props)), { handleHeightChange: props.handleHeightChange });
|
|
12
|
+
}, [props]);
|
|
13
|
+
return React.createElement(CoinflowWebView, __assign({}, webviewProps, messageHandlers));
|
|
22
14
|
}
|
|
23
15
|
//# sourceMappingURL=CoinflowPurchaseHistory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowPurchaseHistory.js","sourceRoot":"","sources":["../src/CoinflowPurchaseHistory.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"CoinflowPurchaseHistory.js","sourceRoot":"","sources":["../src/CoinflowPurchaseHistory.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EACL,eAAe,GAIhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,eAAe,EACf,WAAW,GAGZ,MAAM,UAAU,CAAC;AAElB,MAAM,UAAU,uBAAuB,CACrC,KAAqD;IAErD,IAAM,YAAY,GAAG,OAAO,CAAuB;QACjD,IAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;QAC5C,6BACK,KAAK,KACR,YAAY,cAAA,EACZ,KAAK,EAAE,4BAAqB,KAAK,CAAC,UAAU,CAAE,EAC9C,MAAM,EAAE,KAAK,CAAC,MAAM,IACpB;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,IAAM,eAAe,GAAG,OAAO,CAAwB;QACrD,6BACK,WAAW,CAAC,KAAK,CAAC,KACrB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,IAC5C;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,oBAAC,eAAe,eAAK,YAAY,EAAM,eAAe,EAAI,CAAC;AACpE,CAAC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { CoinflowIFrameProps, IFrameMessageHandlers } from './common';
|
|
4
|
+
export type WithStyles = {
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
};
|
|
7
|
+
export type WithOnLoad = {
|
|
8
|
+
onLoad?: () => void;
|
|
9
|
+
};
|
|
10
|
+
export type CoinflowWebViewProps = Omit<CoinflowIFrameProps, 'IFrameRef'> & WithOnLoad;
|
|
11
|
+
export declare function CoinflowWebView(props: CoinflowWebViewProps & WithStyles & IFrameMessageHandlers): React.JSX.Element | null;
|
package/build/CoinflowWebView.js
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
import React, { useCallback, useMemo } from 'react';
|
|
1
|
+
import React, { useCallback, useMemo, useRef } from 'react';
|
|
2
2
|
import WebView from 'react-native-webview';
|
|
3
3
|
import { Linking, Platform } from 'react-native';
|
|
4
|
-
import {
|
|
4
|
+
import { CoinflowUtils, handleIFrameMessage, } from './common';
|
|
5
5
|
export function CoinflowWebView(props) {
|
|
6
|
+
var WebViewRef = useRef(null);
|
|
6
7
|
var url = useMemo(function () {
|
|
7
|
-
return
|
|
8
|
+
return CoinflowUtils.getCoinflowUrl(props);
|
|
8
9
|
}, [props]);
|
|
9
|
-
var
|
|
10
|
+
var sendMessage = useCallback(function (message) {
|
|
11
|
+
if (!(WebViewRef === null || WebViewRef === void 0 ? void 0 : WebViewRef.current))
|
|
12
|
+
throw new Error('WebViewRef not defined');
|
|
13
|
+
WebViewRef.current.postMessage(message);
|
|
14
|
+
}, [WebViewRef]);
|
|
15
|
+
var handleIframeMessages = useCallback(function (_a) {
|
|
16
|
+
var data = _a.data;
|
|
17
|
+
var promise = handleIFrameMessage(data, props);
|
|
18
|
+
if (!promise)
|
|
19
|
+
return;
|
|
20
|
+
promise.then(sendMessage).catch(function (e) { return sendMessage('ERROR ' + e.message); });
|
|
21
|
+
}, [props, sendMessage]);
|
|
22
|
+
var style = props.style, onLoad = props.onLoad;
|
|
10
23
|
var onShouldStartLoadWithRequest = useCallback(function (request) {
|
|
11
24
|
var whitelist = [
|
|
12
25
|
'solscan',
|
|
@@ -28,7 +41,7 @@ export function CoinflowWebView(props) {
|
|
|
28
41
|
return false;
|
|
29
42
|
}, []);
|
|
30
43
|
return useMemo(function () {
|
|
31
|
-
if (!props.
|
|
44
|
+
if (!props.walletPubkey)
|
|
32
45
|
return null;
|
|
33
46
|
var enableApplePay = !props.disableApplePay &&
|
|
34
47
|
props.route.includes('/purchase/') &&
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
{"version":3,"file":"CoinflowWebView.js","sourceRoot":"","sources":["../src/CoinflowWebView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AAC1D,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC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xC,4BAA4B,EAAE,KAAK,EACnC,4BAA4B,EAAE,4BAA4B,EAC1D,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,EAAC,GAAG,EAAE,GAAG,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"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { WithOnLoad, WithStyles } from './CoinflowWebView';
|
|
3
|
+
import { CoinflowWithdrawProps } from './common';
|
|
4
|
+
export declare function CoinflowWithdraw(withdrawProps: CoinflowWithdrawProps & WithStyles & WithOnLoad): React.JSX.Element;
|
|
@@ -1,39 +1,15 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
case 'eth':
|
|
15
|
-
return React.createElement(EvmContent, __assign({}, props));
|
|
16
|
-
case 'base':
|
|
17
|
-
return React.createElement(EvmContent, __assign({}, props));
|
|
18
|
-
case 'near':
|
|
19
|
-
return React.createElement(NearPurchase, __assign({}, props));
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function SolanaContent(props) {
|
|
23
|
-
var _a;
|
|
24
|
-
var handlers = useSolanaIFrameMessageHandlers(props);
|
|
25
|
-
var _b = useWebViewWallet(handlers, props), WebViewRef = _b.WebViewRef, handleIframeMessages = _b.handleIframeMessages;
|
|
26
|
-
var webviewProps = __assign(__assign({}, props), { supportsVersionedTransactions: props.supportsVersionedTransactions !== false });
|
|
27
|
-
return (React.createElement(CoinflowWebView, __assign({ publicKey: (_a = props.wallet.publicKey) === null || _a === void 0 ? void 0 : _a.toString(), WebViewRef: WebViewRef, route: "/withdraw/".concat(props.merchantId) }, webviewProps, { handleIframeMessages: handleIframeMessages })));
|
|
28
|
-
}
|
|
29
|
-
function EvmContent(props) {
|
|
30
|
-
var handlers = useEthIFrameMessageHandlers(props);
|
|
31
|
-
var _a = useWebViewWallet(handlers, props), WebViewRef = _a.WebViewRef, handleIframeMessages = _a.handleIframeMessages;
|
|
32
|
-
return (React.createElement(CoinflowWebView, __assign({ publicKey: props.wallet.address, WebViewRef: WebViewRef, route: "/withdraw/".concat(props.merchantId) }, props, { handleIframeMessages: handleIframeMessages })));
|
|
33
|
-
}
|
|
34
|
-
function NearPurchase(props) {
|
|
35
|
-
var handlers = useNearIFrameMessageHandlers(props);
|
|
36
|
-
var _a = useWebViewWallet(handlers, props), WebViewRef = _a.WebViewRef, handleIframeMessages = _a.handleIframeMessages;
|
|
37
|
-
return (React.createElement(CoinflowWebView, __assign({ publicKey: props.wallet.accountId, WebViewRef: WebViewRef, route: "/withdraw/".concat(props.merchantId) }, props, { handleIframeMessages: handleIframeMessages })));
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { CoinflowWebView, } from './CoinflowWebView';
|
|
4
|
+
import { getWalletPubkey, getHandlers, } from './common';
|
|
5
|
+
export function CoinflowWithdraw(withdrawProps) {
|
|
6
|
+
var webviewProps = useMemo(function () {
|
|
7
|
+
var walletPubkey = getWalletPubkey(withdrawProps);
|
|
8
|
+
return __assign(__assign({}, withdrawProps), { walletPubkey: walletPubkey, route: "/withdraw/".concat(withdrawProps.merchantId), onLoad: withdrawProps.onLoad });
|
|
9
|
+
}, [withdrawProps]);
|
|
10
|
+
var messageHandlers = useMemo(function () {
|
|
11
|
+
return __assign(__assign({}, getHandlers(withdrawProps)), { handleHeightChange: withdrawProps.handleHeightChange });
|
|
12
|
+
}, [withdrawProps]);
|
|
13
|
+
return React.createElement(CoinflowWebView, __assign({}, webviewProps, messageHandlers));
|
|
38
14
|
}
|
|
39
15
|
//# sourceMappingURL=CoinflowWithdraw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowWithdraw.js","sourceRoot":"","sources":["../src/CoinflowWithdraw.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CoinflowWithdraw.js","sourceRoot":"","sources":["../src/CoinflowWithdraw.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EACL,eAAe,GAIhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,eAAe,EACf,WAAW,GAGZ,MAAM,UAAU,CAAC;AAElB,MAAM,UAAU,gBAAgB,CAC9B,aAA8D;IAE9D,IAAM,YAAY,GAAG,OAAO,CAAuB;QACjD,IAAM,YAAY,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC;QACpD,6BACK,aAAa,KAChB,YAAY,cAAA,EACZ,KAAK,EAAE,oBAAa,aAAa,CAAC,UAAU,CAAE,EAC9C,MAAM,EAAE,aAAa,CAAC,MAAM,IAC5B;IACJ,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,IAAM,eAAe,GAAG,OAAO,CAAwB;QACrD,6BACK,WAAW,CAAC,aAAa,CAAC,KAC7B,kBAAkB,EAAE,aAAa,CAAC,kBAAkB,IACpD;IACJ,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO,oBAAC,eAAe,eAAK,YAAY,EAAM,eAAe,EAAI,CAAC;AACpE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { WithOnLoad, WithStyles } from './CoinflowWebView';
|
|
3
|
+
import { CoinflowHistoryProps } from './common';
|
|
4
|
+
export declare function CoinflowWithdrawHistory(props: CoinflowHistoryProps & WithStyles & WithOnLoad): React.JSX.Element;
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
-
import { CoinflowWebView } from './CoinflowWebView';
|
|
3
|
+
import { CoinflowWebView, } from './CoinflowWebView';
|
|
4
|
+
import { getWalletPubkey, getHandlers, } from './common';
|
|
4
5
|
export function CoinflowWithdrawHistory(props) {
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
case 'polygon':
|
|
14
|
-
return props.wallet.address;
|
|
15
|
-
case 'eth':
|
|
16
|
-
return props.wallet.address;
|
|
17
|
-
case 'base':
|
|
18
|
-
return props.wallet.address;
|
|
19
|
-
}
|
|
20
|
-
}, []);
|
|
21
|
-
return (React.createElement(CoinflowWebView, __assign({ publicKey: publicKey, WebViewRef: WebViewRef, handleIframeMessages: function () { return Promise.resolve(); }, route: "/history/withdraw/".concat(props.merchantId) }, props)));
|
|
6
|
+
var webviewProps = useMemo(function () {
|
|
7
|
+
var walletPubkey = getWalletPubkey(props);
|
|
8
|
+
return __assign(__assign({}, props), { walletPubkey: walletPubkey, route: "/history/withdraw/".concat(props.merchantId), onLoad: props.onLoad });
|
|
9
|
+
}, [props]);
|
|
10
|
+
var messageHandlers = useMemo(function () {
|
|
11
|
+
return __assign(__assign({}, getHandlers(props)), { handleHeightChange: props.handleHeightChange });
|
|
12
|
+
}, [props]);
|
|
13
|
+
return React.createElement(CoinflowWebView, __assign({}, webviewProps, messageHandlers));
|
|
22
14
|
}
|
|
23
15
|
//# sourceMappingURL=CoinflowWithdrawHistory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowWithdrawHistory.js","sourceRoot":"","sources":["../src/CoinflowWithdrawHistory.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"CoinflowWithdrawHistory.js","sourceRoot":"","sources":["../src/CoinflowWithdrawHistory.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EACL,eAAe,GAIhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,eAAe,EACf,WAAW,GAGZ,MAAM,UAAU,CAAC;AAElB,MAAM,UAAU,uBAAuB,CACrC,KAAqD;IAErD,IAAM,YAAY,GAAG,OAAO,CAAuB;QACjD,IAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;QAC5C,6BACK,KAAK,KACR,YAAY,cAAA,EACZ,KAAK,EAAE,4BAAqB,KAAK,CAAC,UAAU,CAAE,EAC9C,MAAM,EAAE,KAAK,CAAC,MAAM,IACpB;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,IAAM,eAAe,GAAG,OAAO,CAAwB;QACrD,6BACK,WAAW,CAAC,KAAK,CAAC,KACrB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,IAC5C;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,oBAAC,eAAe,eAAK,YAAY,EAAM,eAAe,EAAI,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CoinflowPurchaseProps } from './CoinflowTypes';
|
|
2
|
+
export type WalletCall = {
|
|
3
|
+
method: IFrameMessageMethods;
|
|
4
|
+
data: string;
|
|
5
|
+
};
|
|
6
|
+
export interface IFrameMessageHandlers {
|
|
7
|
+
handleSendTransaction: (transaction: string) => Promise<string>;
|
|
8
|
+
handleSignMessage?: (message: string) => Promise<string>;
|
|
9
|
+
handleSignTransaction?: (transaction: string) => Promise<string>;
|
|
10
|
+
handleHeightChange?: (height: string) => void;
|
|
11
|
+
}
|
|
12
|
+
declare enum IFrameMessageMethods {
|
|
13
|
+
SignMessage = "signMessage",
|
|
14
|
+
SignTransaction = "signTransaction",
|
|
15
|
+
SendTransaction = "sendTransaction",
|
|
16
|
+
HeightChange = "heightChange"
|
|
17
|
+
}
|
|
18
|
+
export declare function getWalletPubkey({ wallet, }: Pick<CoinflowPurchaseProps, 'wallet'>): string | null | undefined;
|
|
19
|
+
export declare function handleIFrameMessage(rawMessage: string, handlers: IFrameMessageHandlers): Promise<string> | void;
|
|
20
|
+
export declare function getHandlers({ wallet, blockchain, }: Pick<CoinflowPurchaseProps, 'wallet' | 'blockchain'>): Omit<IFrameMessageHandlers, 'handleHeightChange'>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { __awaiter, __generator } from "tslib";
|
|
2
|
+
import { CoinflowUtils } from './CoinflowUtils';
|
|
3
|
+
import { web3, base58 } from './SolanaPeerDeps';
|
|
4
|
+
var IFrameMessageMethods;
|
|
5
|
+
(function (IFrameMessageMethods) {
|
|
6
|
+
IFrameMessageMethods["SignMessage"] = "signMessage";
|
|
7
|
+
IFrameMessageMethods["SignTransaction"] = "signTransaction";
|
|
8
|
+
IFrameMessageMethods["SendTransaction"] = "sendTransaction";
|
|
9
|
+
IFrameMessageMethods["HeightChange"] = "heightChange";
|
|
10
|
+
})(IFrameMessageMethods || (IFrameMessageMethods = {}));
|
|
11
|
+
export function getWalletPubkey(_a) {
|
|
12
|
+
var wallet = _a.wallet;
|
|
13
|
+
if ('publicKey' in wallet) {
|
|
14
|
+
return wallet.publicKey.toString();
|
|
15
|
+
}
|
|
16
|
+
if ('address' in wallet) {
|
|
17
|
+
return wallet.address;
|
|
18
|
+
}
|
|
19
|
+
if ('accountId' in wallet) {
|
|
20
|
+
return wallet.accountId;
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
export function handleIFrameMessage(rawMessage, handlers) {
|
|
25
|
+
var walletCall;
|
|
26
|
+
try {
|
|
27
|
+
walletCall = JSON.parse(rawMessage);
|
|
28
|
+
if (!('method' in walletCall) || !('data' in walletCall))
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
console.error('handleIFrameMessage JSON parse', e);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
var data = walletCall.data, method = walletCall.method;
|
|
36
|
+
switch (method) {
|
|
37
|
+
case IFrameMessageMethods.SignMessage:
|
|
38
|
+
if (!handlers.handleSignMessage)
|
|
39
|
+
return;
|
|
40
|
+
return handlers.handleSignMessage(data);
|
|
41
|
+
case IFrameMessageMethods.SignTransaction:
|
|
42
|
+
if (!handlers.handleSignTransaction)
|
|
43
|
+
return;
|
|
44
|
+
return handlers.handleSignTransaction(data);
|
|
45
|
+
case IFrameMessageMethods.SendTransaction:
|
|
46
|
+
return handlers.handleSendTransaction(data);
|
|
47
|
+
case IFrameMessageMethods.HeightChange:
|
|
48
|
+
if (!handlers.handleHeightChange)
|
|
49
|
+
return;
|
|
50
|
+
return handlers.handleHeightChange(data);
|
|
51
|
+
}
|
|
52
|
+
console.warn("Didn't expect to get here, handleIFrameMessage method:".concat(method, " is not one of ").concat(Object.values(IFrameMessageMethods)));
|
|
53
|
+
}
|
|
54
|
+
export function getHandlers(_a) {
|
|
55
|
+
var wallet = _a.wallet, blockchain = _a.blockchain;
|
|
56
|
+
return CoinflowUtils.byBlockchain(blockchain, {
|
|
57
|
+
solana: function () { return getSolanaWalletHandlers({ wallet: wallet }); },
|
|
58
|
+
near: function () { return getNearWalletHandlers({ wallet: wallet }); },
|
|
59
|
+
eth: function () { return getEvmWalletHandlers({ wallet: wallet }); },
|
|
60
|
+
polygon: function () { return getEvmWalletHandlers({ wallet: wallet }); },
|
|
61
|
+
base: function () { return getEvmWalletHandlers({ wallet: wallet }); },
|
|
62
|
+
})();
|
|
63
|
+
}
|
|
64
|
+
function getSolanaWalletHandlers(_a) {
|
|
65
|
+
var _this = this;
|
|
66
|
+
var wallet = _a.wallet;
|
|
67
|
+
return {
|
|
68
|
+
handleSendTransaction: function (transaction) { return __awaiter(_this, void 0, void 0, function () {
|
|
69
|
+
var tx;
|
|
70
|
+
return __generator(this, function (_a) {
|
|
71
|
+
switch (_a.label) {
|
|
72
|
+
case 0:
|
|
73
|
+
tx = getSolanaTransaction(transaction);
|
|
74
|
+
return [4 /*yield*/, wallet.sendTransaction(tx)];
|
|
75
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}); },
|
|
79
|
+
handleSignMessage: function (message) { return __awaiter(_this, void 0, void 0, function () {
|
|
80
|
+
var signMessage, signedMessage;
|
|
81
|
+
return __generator(this, function (_a) {
|
|
82
|
+
switch (_a.label) {
|
|
83
|
+
case 0:
|
|
84
|
+
signMessage = wallet.signMessage;
|
|
85
|
+
if (!signMessage) {
|
|
86
|
+
throw new Error('signMessage is not supported by this wallet');
|
|
87
|
+
}
|
|
88
|
+
return [4 /*yield*/, signMessage(new TextEncoder().encode(message))];
|
|
89
|
+
case 1:
|
|
90
|
+
signedMessage = _a.sent();
|
|
91
|
+
if (!base58)
|
|
92
|
+
throw new Error('bs58 dependency is required');
|
|
93
|
+
return [2 /*return*/, base58.encode(signedMessage)];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}); },
|
|
97
|
+
handleSignTransaction: function (transaction) { return __awaiter(_this, void 0, void 0, function () {
|
|
98
|
+
var signTransaction, tx, signedTransaction;
|
|
99
|
+
return __generator(this, function (_a) {
|
|
100
|
+
switch (_a.label) {
|
|
101
|
+
case 0:
|
|
102
|
+
signTransaction = wallet.signTransaction;
|
|
103
|
+
if (!signTransaction) {
|
|
104
|
+
throw new Error('signTransaction is not supported by this wallet');
|
|
105
|
+
}
|
|
106
|
+
tx = getSolanaTransaction(transaction);
|
|
107
|
+
return [4 /*yield*/, signTransaction(tx)];
|
|
108
|
+
case 1:
|
|
109
|
+
signedTransaction = _a.sent();
|
|
110
|
+
if (!base58)
|
|
111
|
+
throw new Error('bs58 dependency is required');
|
|
112
|
+
return [2 /*return*/, base58.encode(signedTransaction.serialize({
|
|
113
|
+
requireAllSignatures: false,
|
|
114
|
+
verifySignatures: false,
|
|
115
|
+
}))];
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}); },
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function getSolanaTransaction(data) {
|
|
122
|
+
if (!web3)
|
|
123
|
+
throw new Error('@solana/web3.js is not defined. Please install @solana/web3.js into your project');
|
|
124
|
+
if (!base58)
|
|
125
|
+
throw new Error('bs58 is not defined. Please install bs58 into your project');
|
|
126
|
+
var parsedUInt8Array = base58.decode(data);
|
|
127
|
+
var vtx = web3.VersionedTransaction.deserialize(parsedUInt8Array);
|
|
128
|
+
if (vtx.version === 'legacy')
|
|
129
|
+
return web3.Transaction.from(parsedUInt8Array);
|
|
130
|
+
return vtx;
|
|
131
|
+
}
|
|
132
|
+
function getNearWalletHandlers(_a) {
|
|
133
|
+
var _this = this;
|
|
134
|
+
var wallet = _a.wallet;
|
|
135
|
+
var nearWallet = wallet;
|
|
136
|
+
return {
|
|
137
|
+
handleSendTransaction: function (transaction) { return __awaiter(_this, void 0, void 0, function () {
|
|
138
|
+
var action, executionOutcome, transactionResult;
|
|
139
|
+
return __generator(this, function (_a) {
|
|
140
|
+
switch (_a.label) {
|
|
141
|
+
case 0:
|
|
142
|
+
action = JSON.parse(Buffer.from(transaction, 'base64').toString());
|
|
143
|
+
return [4 /*yield*/, nearWallet.signAndSendTransaction(action)];
|
|
144
|
+
case 1:
|
|
145
|
+
executionOutcome = _a.sent();
|
|
146
|
+
if (!executionOutcome)
|
|
147
|
+
throw new Error('Transaction did not send');
|
|
148
|
+
transactionResult = executionOutcome.transaction;
|
|
149
|
+
return [2 /*return*/, transactionResult.hash];
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}); },
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function getEvmWalletHandlers(_a) {
|
|
156
|
+
var _this = this;
|
|
157
|
+
var wallet = _a.wallet;
|
|
158
|
+
var evmWallet = wallet;
|
|
159
|
+
return {
|
|
160
|
+
handleSendTransaction: function (transaction) { return __awaiter(_this, void 0, void 0, function () {
|
|
161
|
+
var tx, hash;
|
|
162
|
+
return __generator(this, function (_a) {
|
|
163
|
+
switch (_a.label) {
|
|
164
|
+
case 0:
|
|
165
|
+
tx = JSON.parse(Buffer.from(transaction, 'base64').toString());
|
|
166
|
+
return [4 /*yield*/, evmWallet.sendTransaction(tx)];
|
|
167
|
+
case 1:
|
|
168
|
+
hash = (_a.sent()).hash;
|
|
169
|
+
return [2 /*return*/, hash];
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}); },
|
|
173
|
+
handleSignMessage: function (message) { return __awaiter(_this, void 0, void 0, function () {
|
|
174
|
+
return __generator(this, function (_a) {
|
|
175
|
+
return [2 /*return*/, evmWallet.signMessage(message)];
|
|
176
|
+
});
|
|
177
|
+
}); },
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=CoinflowLibMessageHandlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoinflowLibMessageHandlers.js","sourceRoot":"","sources":["../../src/common/CoinflowLibMessageHandlers.ts"],"names":[],"mappings":";AAMA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAC,IAAI,EAAE,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAW9C,IAAK,oBAKJ;AALD,WAAK,oBAAoB;IACvB,mDAA2B,CAAA;IAC3B,2DAAmC,CAAA;IACnC,2DAAmC,CAAA;IACnC,qDAA6B,CAAA;AAC/B,CAAC,EALI,oBAAoB,KAApB,oBAAoB,QAKxB;AAED,MAAM,UAAU,eAAe,CAAC,EAEQ;QADtC,MAAM,YAAA;IAEN,IA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