@coinflowlabs/react 4.3.0 → 4.4.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.
- package/README.md +52 -40
- package/build/cjs/CoinflowApplePayButton.d.ts +3 -8
- package/build/cjs/CoinflowApplePayButton.js +18 -50
- package/build/cjs/CoinflowApplePayButton.js.map +1 -1
- package/build/cjs/CoinflowGooglePayButton.d.ts +1 -1
- package/build/cjs/CoinflowGooglePayButton.js +31 -2
- package/build/cjs/CoinflowGooglePayButton.js.map +1 -1
- package/build/cjs/CoinflowPurchase.d.ts +2 -1
- package/build/cjs/CoinflowPurchase.js +98 -3
- package/build/cjs/CoinflowPurchase.js.map +1 -1
- package/build/cjs/MobileWalletButton.d.ts +12 -0
- package/build/cjs/MobileWalletButton.js +64 -0
- package/build/cjs/MobileWalletButton.js.map +1 -0
- package/build/cjs/common/CoinflowTypes.d.ts +5 -1
- package/build/cjs/common/CoinflowTypes.js.map +1 -1
- package/build/cjs/common/CoinflowUtils.d.ts +1 -1
- package/build/cjs/common/CoinflowUtils.js +3 -1
- package/build/cjs/common/CoinflowUtils.js.map +1 -1
- package/build/cjs/useOverlay.d.ts +8 -0
- package/build/cjs/useOverlay.js +30 -0
- package/build/cjs/useOverlay.js.map +1 -0
- package/build/esm/CoinflowApplePayButton.d.ts +3 -8
- package/build/esm/CoinflowApplePayButton.js +17 -50
- package/build/esm/CoinflowApplePayButton.js.map +1 -1
- package/build/esm/CoinflowGooglePayButton.d.ts +1 -1
- package/build/esm/CoinflowGooglePayButton.js +31 -2
- package/build/esm/CoinflowGooglePayButton.js.map +1 -1
- package/build/esm/CoinflowPurchase.d.ts +2 -1
- package/build/esm/CoinflowPurchase.js +100 -6
- package/build/esm/CoinflowPurchase.js.map +1 -1
- package/build/esm/MobileWalletButton.d.ts +12 -0
- package/build/esm/MobileWalletButton.js +61 -0
- package/build/esm/MobileWalletButton.js.map +1 -0
- package/build/esm/common/CoinflowTypes.d.ts +5 -1
- package/build/esm/common/CoinflowTypes.js.map +1 -1
- package/build/esm/common/CoinflowUtils.d.ts +1 -1
- package/build/esm/common/CoinflowUtils.js +3 -1
- package/build/esm/common/CoinflowUtils.js.map +1 -1
- package/build/esm/useOverlay.d.ts +8 -0
- package/build/esm/useOverlay.js +26 -0
- package/build/esm/useOverlay.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Coinflow React
|
|
2
2
|
|
|
3
3
|
## Withdraw Usage
|
|
4
|
+
|
|
4
5
|
```
|
|
5
6
|
import {useWallet} from '@solana/wallet-adapter-react';
|
|
6
7
|
const wallet = useWallet();
|
|
@@ -10,23 +11,25 @@ const connection = useConnection();
|
|
|
10
11
|
```
|
|
11
12
|
|
|
12
13
|
Props:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
|
|
15
|
+
- `wallet`: The Solana Wallet Adapter Wallet
|
|
16
|
+
- `merchantId`: Your Merchant ID (Contact Coinflow support for this)
|
|
17
|
+
- `connection`: Solana Connection
|
|
18
|
+
- `env` (optional): This defaults to `prod`
|
|
19
|
+
- For testing set to `staging`
|
|
20
|
+
- `onSuccess` (optional): function to run when the withdrawal process is successful
|
|
21
|
+
- `lockAmount` (optional): Whether to let the user select the amount to withdraw or to disable the input
|
|
22
|
+
- `amount` (optional): The amount to withdraw - required if `lockAmount=true`
|
|
23
|
+
- `tokens` (optional): Define a list to filter the available tokens
|
|
24
|
+
- `lockDefaultToken` (optional): Only allow the default token to be used
|
|
25
|
+
- `email` (optional): Set the default email to be used in entry fields
|
|
26
|
+
- `bankAccountLinkRedirect` (optional): The URL to be used for bank account setup
|
|
27
|
+
- `additionalWallets` (optional): Define additional wallets to assign to the user
|
|
28
|
+
- `usePermit` (optional): Pass as false to disable permit message signing for EVM and use approve transactions
|
|
29
|
+
- `transactionSigner` (optional): Public Key of the wallet which will actually execute the withdrawal transaction. Must be associated with the same withdrawer as the main wallet.
|
|
28
30
|
|
|
29
31
|
## Purchase Usage
|
|
32
|
+
|
|
30
33
|
```
|
|
31
34
|
import {useWallet} from '@solana/wallet-adapter-react';
|
|
32
35
|
const wallet = useWallet();
|
|
@@ -36,37 +39,47 @@ const connection = useConnection();
|
|
|
36
39
|
```
|
|
37
40
|
|
|
38
41
|
Props:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
|
|
43
|
+
- `wallet`: The Solana Wallet Adapter Wallet
|
|
44
|
+
- `merchantId`: Your Merchant ID (Contact Coinflow support for this)
|
|
45
|
+
- `connection`: Solana Connection
|
|
46
|
+
- `env` (optional): This defaults to `prod`
|
|
43
47
|
- For testing set to `staging`
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
- `onSuccess` (optional): function to run when the purchase process is successful
|
|
49
|
+
- `transaction` (optional): transaction for the user to run which redeems their credits with your smart contract. Create this transaction just like you would for a normal user who has USDC in their account.
|
|
50
|
+
- `partialSigners` (optional): Keypairs of Partial Signers to sign the transaction with, this is necessary when initializing new accounts as the new account Keypair must sign the transaction.
|
|
51
|
+
- `debugTx` (optional): Setting this to `true` will sign the transaction with the wallet, and send the transaction with no preflight checks allowing for easier debug of any issues.
|
|
52
|
+
- `token` (optional): The token to use for the purchase. Defaults to USDC. Currently only supported for the Solana Blockchain.
|
|
53
|
+
- `planCode` (optional): When a subscription is being purchased, the code of the subscription plan.
|
|
54
|
+
- `settlementType` (optional): The settlement method to use for the proceeds of a purchase. (Credits, USDC, or Bank)
|
|
55
|
+
- `amount` (optional): Fix the amount of purchase
|
|
56
|
+
- `webhookInfo` (optional): Product or transaction based information that you want transmitted when you receive webhooks regarding the purchase
|
|
57
|
+
- `email` (optional): Set the default email to use in email entry fields
|
|
58
|
+
- `chargebackProtectionData` (optional):
|
|
59
|
+
- `disableApplePay` (optional): Ability to disable Apple Pay
|
|
60
|
+
- `disableGooglePay` (optional): Ability to disable Google Pay
|
|
61
|
+
- `customerInfo` (optional): Additional information about the customer
|
|
62
|
+
- `rent` (optional, Solana only): Specify the blockchain rent amount to add to the total
|
|
63
|
+
- `nativeSolToConvert` (optional, Solana only): Specify the amount of native SOL to convert wSOL for the purchase
|
|
64
|
+
- `jwtToken` (optional): A JWT token which encodes verified checkout parameters to prevent spoofing of arguments.
|
|
65
|
+
- `supportEmail` (optional): Your business support email address to use for support inquiries
|
|
61
66
|
|
|
62
67
|
## Utils
|
|
63
68
|
|
|
64
69
|
`CoinflowUtils`
|
|
65
70
|
|
|
66
|
-
|
|
71
|
+
- `getFeePayer` - Return the `PublicKey` of the Coinflow Fee Payer
|
|
67
72
|
|
|
68
73
|
# Changelog
|
|
69
74
|
|
|
75
|
+
## 4.4.0
|
|
76
|
+
|
|
77
|
+
- Added overlay to digital wallet buttons to make the loading time 0
|
|
78
|
+
|
|
79
|
+
## 4.3.1
|
|
80
|
+
|
|
81
|
+
- CoinflowPurchaseV2 component added for a modernized purchase flow
|
|
82
|
+
|
|
70
83
|
## 4.3.0
|
|
71
84
|
|
|
72
85
|
- Added arbitrum blockchain support
|
|
@@ -158,16 +171,15 @@ Props:
|
|
|
158
171
|
|
|
159
172
|
### 2.6.1
|
|
160
173
|
|
|
161
|
-
- Added built in support for SSR which fixes a "window not defined" error.
|
|
174
|
+
- Added built in support for SSR which fixes a "window not defined" error.
|
|
162
175
|
|
|
163
176
|
### 2.6.0
|
|
164
177
|
|
|
165
178
|
- Added support for Apple Pay and Google Pay
|
|
166
179
|
|
|
167
|
-
|
|
168
180
|
### 2.5.0
|
|
169
181
|
|
|
170
|
-
- Added the `CoinflowCardForm` component which allows merchants to collect credit card information from their users in a PCI compliant way. Tokenize it, and then utilize the remainder of Coinflow's APIs.
|
|
182
|
+
- Added the `CoinflowCardForm` component which allows merchants to collect credit card information from their users in a PCI compliant way. Tokenize it, and then utilize the remainder of Coinflow's APIs.
|
|
171
183
|
|
|
172
184
|
### 2.4.0
|
|
173
185
|
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { CoinflowPurchaseProps } from './common';
|
|
2
|
-
import React from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { MobileWalletButtonProps } from './MobileWalletButton';
|
|
3
4
|
export declare function CoinflowApplePayButton(props: CoinflowPurchaseProps & MobileWalletButtonProps): React.JSX.Element;
|
|
4
|
-
export declare function
|
|
5
|
-
props: CoinflowPurchaseProps;
|
|
6
|
-
route: string;
|
|
7
|
-
}): React.JSX.Element;
|
|
8
|
-
export interface MobileWalletButtonProps {
|
|
9
|
-
color: "white" | "black";
|
|
10
|
-
}
|
|
5
|
+
export declare function AppleButtonOverlayLogo({ color, }: Pick<MobileWalletButtonProps, 'color'>): React.JSX.Element;
|
|
@@ -1,58 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CoinflowApplePayButton = CoinflowApplePayButton;
|
|
4
|
-
exports.
|
|
4
|
+
exports.AppleButtonOverlayLogo = AppleButtonOverlayLogo;
|
|
5
5
|
var tslib_1 = require("tslib");
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
7
|
+
var MobileWalletButton_1 = require("./MobileWalletButton");
|
|
9
8
|
function CoinflowApplePayButton(props) {
|
|
10
|
-
return react_1.default.createElement(MobileWalletButton, { props: props, route: 'apple-pay' }
|
|
9
|
+
return (react_1.default.createElement(MobileWalletButton_1.MobileWalletButton, { props: props, route: 'apple-pay' },
|
|
10
|
+
react_1.default.createElement(AppleButtonOverlayLogo, { color: props.color })));
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
catch (e) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
}).then(function (data) { return onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(data); });
|
|
30
|
-
}, [onSuccess]);
|
|
31
|
-
var iframeProps = (0, react_1.useMemo)(function () {
|
|
32
|
-
var walletPubkey = (0, common_1.getWalletPubkey)(props);
|
|
33
|
-
return tslib_1.__assign(tslib_1.__assign({}, props), { walletPubkey: walletPubkey, transaction: undefined, routePrefix: 'form', route: "/".concat(route, "/").concat(props.merchantId) });
|
|
34
|
-
}, [props, route]);
|
|
35
|
-
var messageHandlers = (0, react_1.useMemo)(function () {
|
|
36
|
-
return tslib_1.__assign(tslib_1.__assign({}, (0, common_1.getHandlers)(props)), { handleHeightChange: props.handleHeightChange });
|
|
37
|
-
}, [props]);
|
|
38
|
-
return react_1.default.createElement(CoinflowIFrame_1.CoinflowIFrame, tslib_1.__assign({ ref: iframeRef }, iframeProps, messageHandlers));
|
|
12
|
+
function AppleButtonOverlayLogo(_a) {
|
|
13
|
+
var color = _a.color;
|
|
14
|
+
var fill = color === 'white' ? '#000' : '#FFF';
|
|
15
|
+
return (react_1.default.createElement("svg", { id: "svg-logo", viewBox: "0 0 35 15" },
|
|
16
|
+
react_1.default.createElement("svg", { id: "svg-logo", x: "0", y: "3.85", height: "7.3", width: "35", className: "logo", viewBox: "0 0 105 43", version: "1.1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink" },
|
|
17
|
+
react_1.default.createElement("title", null, "Apple Logo"),
|
|
18
|
+
react_1.default.createElement("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" },
|
|
19
|
+
react_1.default.createElement("g", { fill: fill },
|
|
20
|
+
react_1.default.createElement("path", { d: "M19.4028,5.5674 C20.6008,4.0684 21.4138,2.0564 21.1998,0.0004 C19.4458,0.0874 17.3058,1.1574 16.0668,2.6564 C14.9538,3.9414 13.9688,6.0374 14.2258,8.0074 C16.1948,8.1784 18.1618,7.0244 19.4028,5.5674" }),
|
|
21
|
+
react_1.default.createElement("path", { d: "M21.1772,8.3926 C18.3182,8.2226 15.8872,10.0156 14.5212,10.0156 C13.1552,10.0156 11.0642,8.4786 8.8022,8.5196 C5.8592,8.5626 3.1282,10.2276 1.6342,12.8746 C-1.4378,18.1696 0.8232,26.0246 3.8112,30.3376 C5.2622,32.4716 7.0102,34.8206 9.3142,34.7366 C11.4912,34.6506 12.3442,33.3266 14.9902,33.3266 C17.6352,33.3266 18.4042,34.7366 20.7082,34.6936 C23.0972,34.6506 24.5922,32.5586 26.0422,30.4226 C27.7072,27.9906 28.3882,25.6426 28.4312,25.5126 C28.3882,25.4706 23.8232,23.7186 23.7812,18.4676 C23.7382,14.0706 27.3652,11.9786 27.5362,11.8496 C25.4882,8.8196 22.2872,8.4786 21.1772,8.3926" }),
|
|
22
|
+
react_1.default.createElement("path", { d: "M85.5508,43.0381 L85.5508,39.1991 C85.8628,39.2421 86.6158,39.2871 87.0158,39.2871 C89.2138,39.2871 90.4558,38.3551 91.2108,35.9581 L91.6548,34.5371 L83.2428,11.2321 L88.4368,11.2321 L94.2958,30.1421 L94.4068,30.1421 L100.2668,11.2321 L105.3278,11.2321 L96.6048,35.7141 C94.6078,41.3291 92.3208,43.1721 87.4828,43.1721 C87.1048,43.1721 85.8838,43.1271 85.5508,43.0381" }),
|
|
23
|
+
react_1.default.createElement("path", { d: "M42.6499,19.3555 L48.3549,19.3555 C52.6829,19.3555 55.1469,17.0255 55.1469,12.9855 C55.1469,8.9455 52.6829,6.6375 48.3769,6.6375 L42.6499,6.6375 L42.6499,19.3555 Z M49.6869,2.4425 C55.9009,2.4425 60.2289,6.7265 60.2289,12.9625 C60.2289,19.2225 55.8129,23.5285 49.5309,23.5285 L42.6499,23.5285 L42.6499,34.4705 L37.6779,34.4705 L37.6779,2.4425 L49.6869,2.4425 Z" }),
|
|
24
|
+
react_1.default.createElement("path", { d: "M76.5547,25.7705 L76.5547,23.9715 L71.0287,24.3275 C67.9207,24.5275 66.3007,25.6815 66.3007,27.7015 C66.3007,29.6545 67.9887,30.9195 70.6287,30.9195 C74.0027,30.9195 76.5547,28.7665 76.5547,25.7705 M61.4617,27.8345 C61.4617,23.7285 64.5917,21.3755 70.3627,21.0205 L76.5547,20.6425 L76.5547,18.8675 C76.5547,16.2705 74.8457,14.8495 71.8057,14.8495 C69.2967,14.8495 67.4777,16.1375 67.0997,18.1125 L62.6167,18.1125 C62.7497,13.9615 66.6567,10.9435 71.9387,10.9435 C77.6207,10.9435 81.3267,13.9175 81.3267,18.5345 L81.3267,34.4705 L76.7327,34.4705 L76.7327,30.6305 L76.6217,30.6305 C75.3127,33.1395 72.4267,34.7145 69.2967,34.7145 C64.6807,34.7145 61.4617,31.9625 61.4617,27.8345" }))))));
|
|
39
25
|
}
|
|
40
|
-
// TODO
|
|
41
|
-
// export function useGetTokenHandler(props: CoinflowPurchaseProps) {
|
|
42
|
-
// const {onSuccess} = props;
|
|
43
|
-
//
|
|
44
|
-
// useEffect(() => {
|
|
45
|
-
// const handler = getMessageHandler('getToken', (data: string) => {
|
|
46
|
-
// if (data.startsWith('ERROR')) {
|
|
47
|
-
// console.error('Mobile Wallet Payment Error', data.replace('ERROR', ''));
|
|
48
|
-
// return;
|
|
49
|
-
// }
|
|
50
|
-
//
|
|
51
|
-
// onSuccess?.(data);
|
|
52
|
-
// });
|
|
53
|
-
//
|
|
54
|
-
// if (!window) throw new Error('Window not defined');
|
|
55
|
-
// window.addEventListener('message', handler);
|
|
56
|
-
// }, [onSuccess]);
|
|
57
|
-
// }
|
|
58
26
|
//# sourceMappingURL=CoinflowApplePayButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowApplePayButton.js","sourceRoot":"","sources":["../../src/CoinflowApplePayButton.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"CoinflowApplePayButton.js","sourceRoot":"","sources":["../../src/CoinflowApplePayButton.tsx"],"names":[],"mappings":";;AAOA,wDAQC;AAED,wDA+BC;;AA/CD,wDAA0B;AAC1B,2DAG8B;AAE9B,SAAgB,sBAAsB,CACpC,KAAsD;IAEtD,OAAO,CACL,8BAAC,uCAAkB,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW;QAClD,8BAAC,sBAAsB,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,GAAI,CAC3B,CACtB,CAAC;AACJ,CAAC;AAED,SAAgB,sBAAsB,CAAC,EAEE;QADvC,KAAK,WAAA;IAEL,IAAM,IAAI,GAAG,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IACjD,OAAO,CACL,uCAAK,EAAE,EAAC,UAAU,EAAC,OAAO,EAAC,WAAW;QACpC,uCACE,EAAE,EAAC,UAAU,EACb,CAAC,EAAC,GAAG,EACL,CAAC,EAAC,MAAM,EACR,MAAM,EAAC,KAAK,EACZ,KAAK,EAAC,IAAI,EACV,SAAS,EAAC,MAAM,EAChB,OAAO,EAAC,YAAY,EACpB,OAAO,EAAC,KAAK,EACb,KAAK,EAAC,4BAA4B,EAClC,UAAU,EAAC,8BAA8B;YAEzC,0DAAyB;YACzB,qCAAG,MAAM,EAAC,MAAM,kBAAc,GAAG,EAAC,IAAI,EAAC,MAAM,eAAW,SAAS;gBAC/D,qCAAG,IAAI,EAAE,IAAI;oBACX,wCAAM,CAAC,EAAC,yMAAyM,GAAQ;oBACzN,wCAAM,CAAC,EAAC,6kBAA6kB,GAAQ;oBAC7lB,wCAAM,CAAC,EAAC,iXAAiX,GAAQ;oBACjY,wCAAM,CAAC,EAAC,0WAA0W,GAAQ;oBAC1X,wCAAM,CAAC,EAAC,sqBAAsqB,GAAQ,CACprB,CACF,CACA,CACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CoinflowPurchaseProps } from './common';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { MobileWalletButtonProps } from './
|
|
3
|
+
import { MobileWalletButtonProps } from './MobileWalletButton';
|
|
4
4
|
export declare function CoinflowGooglePayButton(props: CoinflowPurchaseProps & MobileWalletButtonProps): React.JSX.Element;
|
|
@@ -3,8 +3,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CoinflowGooglePayButton = CoinflowGooglePayButton;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
var
|
|
6
|
+
var MobileWalletButton_1 = require("./MobileWalletButton");
|
|
7
7
|
function CoinflowGooglePayButton(props) {
|
|
8
|
-
return react_1.default.createElement(
|
|
8
|
+
return (react_1.default.createElement(MobileWalletButton_1.MobileWalletButton, { props: props, route: 'google-pay', overlayDisplayOverride: 'flex', alignItems: 'center' },
|
|
9
|
+
react_1.default.createElement(GooglePayLogo, { color: props.color })));
|
|
10
|
+
}
|
|
11
|
+
function GooglePayLogo(_a) {
|
|
12
|
+
var color = _a.color;
|
|
13
|
+
if (color === 'white') {
|
|
14
|
+
return react_1.default.createElement(GooglePayLogoLight, null);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return react_1.default.createElement(GooglePayLogoDark, null);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function GooglePayLogoLight() {
|
|
21
|
+
return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "41", height: "17" },
|
|
22
|
+
react_1.default.createElement("g", { fill: "none", "fill-rule": "evenodd" },
|
|
23
|
+
react_1.default.createElement("path", { d: "M19.526 2.635v4.083h2.518c.6 0 1.096-.202 1.488-.605.403-.402.605-.882.605-1.437 0-.544-.202-1.018-.605-1.422-.392-.413-.888-.62-1.488-.62h-2.518zm0 5.52v4.736h-1.504V1.198h3.99c1.013 0 1.873.337 2.582 1.012.72.675 1.08 1.497 1.08 2.466 0 .991-.36 1.819-1.08 2.482-.697.665-1.559.996-2.583.996h-2.485v.001zm7.668 2.287c0 .392.166.718.499.98.332.26.722.391 1.168.391.633 0 1.196-.234 1.692-.701.497-.469.744-1.019.744-1.65-.469-.37-1.123-.555-1.962-.555-.61 0-1.12.148-1.528.442-.409.294-.613.657-.613 1.093m1.946-5.815c1.112 0 1.989.297 2.633.89.642.594.964 1.408.964 2.442v4.932h-1.439v-1.11h-.065c-.622.914-1.45 1.372-2.486 1.372-.882 0-1.621-.262-2.215-.784-.594-.523-.891-1.176-.891-1.96 0-.828.313-1.486.94-1.976s1.463-.735 2.51-.735c.892 0 1.629.163 2.206.49v-.344c0-.522-.207-.966-.621-1.33a2.132 2.132 0 0 0-1.455-.547c-.84 0-1.504.353-1.995 1.062l-1.324-.834c.73-1.045 1.81-1.568 3.238-1.568m11.853.262l-5.02 11.53H34.42l1.864-4.034-3.302-7.496h1.635l2.387 5.749h.032l2.322-5.75z", fill: "#5F6368" }),
|
|
24
|
+
react_1.default.createElement("path", { d: "M13.448 7.134c0-.473-.04-.93-.116-1.366H6.988v2.588h3.634a3.11 3.11 0 0 1-1.344 2.042v1.68h2.169c1.27-1.17 2.001-2.9 2.001-4.944", fill: "#4285F4" }),
|
|
25
|
+
react_1.default.createElement("path", { d: "M6.988 13.7c1.816 0 3.344-.595 4.459-1.621l-2.169-1.681c-.603.406-1.38.643-2.29.643-1.754 0-3.244-1.182-3.776-2.774H.978v1.731a6.728 6.728 0 0 0 6.01 3.703", fill: "#34A853" }),
|
|
26
|
+
react_1.default.createElement("path", { d: "M3.212 8.267a4.034 4.034 0 0 1 0-2.572V3.964H.978A6.678 6.678 0 0 0 .261 6.98c0 1.085.26 2.11.717 3.017l2.234-1.731z", fill: "#FABB05" }),
|
|
27
|
+
react_1.default.createElement("path", { d: "M6.988 2.921c.992 0 1.88.34 2.58 1.008v.001l1.92-1.918C10.324.928 8.804.262 6.989.262a6.728 6.728 0 0 0-6.01 3.702l2.234 1.731c.532-1.592 2.022-2.774 3.776-2.774", fill: "#E94235" }),
|
|
28
|
+
react_1.default.createElement("path", { d: "M0 0h41.285v18H0z" }))));
|
|
29
|
+
}
|
|
30
|
+
function GooglePayLogoDark() {
|
|
31
|
+
return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "41", height: "17" },
|
|
32
|
+
react_1.default.createElement("g", { fill: "none", "fill-rule": "evenodd" },
|
|
33
|
+
react_1.default.createElement("path", { d: "M19.526 2.635v4.083h2.518c.6 0 1.096-.202 1.488-.605.403-.402.605-.882.605-1.437 0-.544-.202-1.018-.605-1.422-.392-.413-.888-.62-1.488-.62h-2.518zm0 5.52v4.736h-1.504V1.198h3.99c1.013 0 1.873.337 2.582 1.012.72.675 1.08 1.497 1.08 2.466 0 .991-.36 1.819-1.08 2.482-.697.665-1.559.996-2.583.996h-2.485v.001zm7.668 2.287c0 .392.166.718.499.98.332.26.722.391 1.168.391.633 0 1.196-.234 1.692-.701.497-.469.744-1.019.744-1.65-.469-.37-1.123-.555-1.962-.555-.61 0-1.12.148-1.528.442-.409.294-.613.657-.613 1.093m1.946-5.815c1.112 0 1.989.297 2.633.89.642.594.964 1.408.964 2.442v4.932h-1.439v-1.11h-.065c-.622.914-1.45 1.372-2.486 1.372-.882 0-1.621-.262-2.215-.784-.594-.523-.891-1.176-.891-1.96 0-.828.313-1.486.94-1.976s1.463-.735 2.51-.735c.892 0 1.629.163 2.206.49v-.344c0-.522-.207-.966-.621-1.33a2.132 2.132 0 0 0-1.455-.547c-.84 0-1.504.353-1.995 1.062l-1.324-.834c.73-1.045 1.81-1.568 3.238-1.568m11.853.262l-5.02 11.53H34.42l1.864-4.034-3.302-7.496h1.635l2.387 5.749h.032l2.322-5.75z", fill: "#FFF" }),
|
|
34
|
+
react_1.default.createElement("path", { d: "M13.448 7.134c0-.473-.04-.93-.116-1.366H6.988v2.588h3.634a3.11 3.11 0 0 1-1.344 2.042v1.68h2.169c1.27-1.17 2.001-2.9 2.001-4.944", fill: "#4285F4" }),
|
|
35
|
+
react_1.default.createElement("path", { d: "M6.988 13.7c1.816 0 3.344-.595 4.459-1.621l-2.169-1.681c-.603.406-1.38.643-2.29.643-1.754 0-3.244-1.182-3.776-2.774H.978v1.731a6.728 6.728 0 0 0 6.01 3.703", fill: "#34A853" }),
|
|
36
|
+
react_1.default.createElement("path", { d: "M3.212 8.267a4.034 4.034 0 0 1 0-2.572V3.964H.978A6.678 6.678 0 0 0 .261 6.98c0 1.085.26 2.11.717 3.017l2.234-1.731z", fill: "#FABB05" }),
|
|
37
|
+
react_1.default.createElement("path", { d: "M6.988 2.921c.992 0 1.88.34 2.58 1.008v.001l1.92-1.918C10.324.928 8.804.262 6.989.262a6.728 6.728 0 0 0-6.01 3.702l2.234 1.731c.532-1.592 2.022-2.774 3.776-2.774", fill: "#E94235" }))));
|
|
9
38
|
}
|
|
10
39
|
//# sourceMappingURL=CoinflowGooglePayButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowGooglePayButton.js","sourceRoot":"","sources":["../../src/CoinflowGooglePayButton.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"CoinflowGooglePayButton.js","sourceRoot":"","sources":["../../src/CoinflowGooglePayButton.tsx"],"names":[],"mappings":";;AAOA,0DAaC;;AAnBD,wDAA0B;AAC1B,2DAG8B;AAE9B,SAAgB,uBAAuB,CACrC,KAAsD;IAEtD,OAAO,CACL,8BAAC,uCAAkB,IACjB,KAAK,EAAE,KAAK,EACZ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/J,IAAI,EAAC,SAAS,GACd;YACF,wCACE,CAAC,EAAC,sHAAsH,EACxH,IAAI,EAAC,SAAS,GACd;YACF,wCACE,CAAC,EAAC,mKAAmK,EACrK,IAAI,EAAC,SAAS,GACd,CACA,CACA,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { CoinflowPurchaseProps } from './common';
|
|
3
|
+
export declare function CoinflowPurchaseLegacy(purchaseProps: CoinflowPurchaseProps): React.JSX.Element;
|
|
3
4
|
export declare function CoinflowPurchase(purchaseProps: CoinflowPurchaseProps): React.JSX.Element;
|
|
@@ -1,18 +1,113 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CoinflowPurchaseLegacy = CoinflowPurchaseLegacy;
|
|
3
4
|
exports.CoinflowPurchase = CoinflowPurchase;
|
|
4
5
|
var tslib_1 = require("tslib");
|
|
5
6
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
7
|
var common_1 = require("./common");
|
|
7
8
|
var CoinflowIFrame_1 = require("./CoinflowIFrame");
|
|
8
|
-
|
|
9
|
+
var useOverlay_1 = require("./useOverlay");
|
|
10
|
+
function useCoinflowPurchase(purchaseProps, version) {
|
|
9
11
|
var iframeProps = (0, react_1.useMemo)(function () {
|
|
10
12
|
var walletPubkey = (0, common_1.getWalletPubkey)(purchaseProps);
|
|
11
|
-
return tslib_1.__assign(tslib_1.__assign({}, purchaseProps), { walletPubkey: walletPubkey, route: "/purchase/".concat(purchaseProps.merchantId), transaction: common_1.CoinflowUtils.getTransaction(purchaseProps) });
|
|
12
|
-
}, [purchaseProps]);
|
|
13
|
+
return tslib_1.__assign(tslib_1.__assign({}, purchaseProps), { walletPubkey: walletPubkey, route: "/purchase".concat(version, "/").concat(purchaseProps.merchantId), transaction: common_1.CoinflowUtils.getTransaction(purchaseProps) });
|
|
14
|
+
}, [purchaseProps, version]);
|
|
13
15
|
var messageHandlers = (0, react_1.useMemo)(function () {
|
|
14
16
|
return tslib_1.__assign(tslib_1.__assign({}, (0, common_1.getHandlers)(purchaseProps)), { handleHeightChange: purchaseProps.handleHeightChange });
|
|
15
17
|
}, [purchaseProps]);
|
|
18
|
+
return { iframeProps: iframeProps, messageHandlers: messageHandlers };
|
|
19
|
+
}
|
|
20
|
+
function CoinflowPurchaseLegacy(purchaseProps) {
|
|
21
|
+
var _a = useCoinflowPurchase(purchaseProps, ''), iframeProps = _a.iframeProps, messageHandlers = _a.messageHandlers;
|
|
16
22
|
return react_1.default.createElement(CoinflowIFrame_1.CoinflowIFrame, tslib_1.__assign({}, iframeProps, messageHandlers));
|
|
17
23
|
}
|
|
24
|
+
function CoinflowPurchase(purchaseProps) {
|
|
25
|
+
var iframeRef = (0, react_1.useRef)(null);
|
|
26
|
+
var _a = useCoinflowPurchase(purchaseProps, '-v2'), iframeProps = _a.iframeProps, messageHandlers = _a.messageHandlers;
|
|
27
|
+
var showOverlay = (0, useOverlay_1.useOverlay)(iframeRef).showOverlay;
|
|
28
|
+
var loaderBackground = iframeProps.loaderBackground || '#ffffff'; // white default bg
|
|
29
|
+
var invertedColor = invertHexColor(loaderBackground);
|
|
30
|
+
return (react_1.default.createElement("div", { style: styles.container(loaderBackground) },
|
|
31
|
+
react_1.default.createElement(CoinflowIFrame_1.CoinflowIFrame, tslib_1.__assign({ ref: iframeRef }, iframeProps, messageHandlers)),
|
|
32
|
+
showOverlay && (react_1.default.createElement(LoaderOverlay, { loaderBackground: loaderBackground, invertedColor: invertedColor }))));
|
|
33
|
+
}
|
|
34
|
+
function LoaderOverlay(_a) {
|
|
35
|
+
var loaderBackground = _a.loaderBackground, invertedColor = _a.invertedColor;
|
|
36
|
+
return (react_1.default.createElement("div", { style: styles.overlay(loaderBackground) },
|
|
37
|
+
react_1.default.createElement(LoaderGrid, { columns: 2 },
|
|
38
|
+
react_1.default.createElement(Loader, { loaderBackground: invertedColor }),
|
|
39
|
+
react_1.default.createElement(Loader, { loaderBackground: invertedColor })),
|
|
40
|
+
react_1.default.createElement(LoaderGrid, { columns: 1 },
|
|
41
|
+
react_1.default.createElement(Loader, { height: 80, loaderBackground: invertedColor })),
|
|
42
|
+
tslib_1.__spreadArray([], Array(3), true).map(function (_, index) { return (react_1.default.createElement(LoaderRow, { key: index },
|
|
43
|
+
react_1.default.createElement(Loader, { width: index < 2 ? 80 : 120, height: index < 2 ? 15 : 20, loaderBackground: invertedColor }),
|
|
44
|
+
react_1.default.createElement(Loader, { width: index < 2 ? 60 : 100, height: index < 2 ? 15 : 20, loaderBackground: invertedColor }))); }),
|
|
45
|
+
react_1.default.createElement(LoaderGrid, { columns: 1 },
|
|
46
|
+
react_1.default.createElement(Loader, { height: 60, loaderBackground: invertedColor })),
|
|
47
|
+
react_1.default.createElement(LoaderGrid, { columns: 1, width: "50%" },
|
|
48
|
+
react_1.default.createElement(Loader, { height: 10, loaderBackground: invertedColor })),
|
|
49
|
+
react_1.default.createElement(LoaderGrid, { columns: 1, width: "40%" },
|
|
50
|
+
react_1.default.createElement(Loader, { height: 6, loaderBackground: invertedColor }))));
|
|
51
|
+
}
|
|
52
|
+
function LoaderGrid(_a) {
|
|
53
|
+
var children = _a.children, columns = _a.columns, _b = _a.width, width = _b === void 0 ? '100%' : _b;
|
|
54
|
+
return (react_1.default.createElement("div", { style: tslib_1.__assign(tslib_1.__assign({}, styles.grid), { gridTemplateColumns: "repeat(".concat(columns, ", 1fr)"), width: width }) }, children));
|
|
55
|
+
}
|
|
56
|
+
function LoaderRow(_a) {
|
|
57
|
+
var children = _a.children;
|
|
58
|
+
return react_1.default.createElement("div", { style: styles.row }, children);
|
|
59
|
+
}
|
|
60
|
+
function Loader(_a) {
|
|
61
|
+
var loaderBackground = _a.loaderBackground, _b = _a.height, height = _b === void 0 ? 40 : _b, width = _a.width;
|
|
62
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
63
|
+
react_1.default.createElement("div", { style: styles.loader(loaderBackground, height, width) }),
|
|
64
|
+
react_1.default.createElement("style", null, styles.keyframes)));
|
|
65
|
+
}
|
|
66
|
+
function invertHexColor(hex) {
|
|
67
|
+
var _a;
|
|
68
|
+
hex = hex.replace(/^#/, '');
|
|
69
|
+
var rgb = ((_a = hex.match(/.{2}/g)) === null || _a === void 0 ? void 0 : _a.map(function (val) { return 255 - parseInt(val, 16); })) || [];
|
|
70
|
+
return "#".concat(rgb.map(function (val) { return val.toString(16).padStart(2, '0'); }).join(''));
|
|
71
|
+
}
|
|
72
|
+
var styles = {
|
|
73
|
+
container: function (bg) { return ({
|
|
74
|
+
position: 'relative',
|
|
75
|
+
height: '100%',
|
|
76
|
+
backgroundColor: bg,
|
|
77
|
+
}); },
|
|
78
|
+
overlay: function (bg) { return ({
|
|
79
|
+
backgroundColor: bg,
|
|
80
|
+
display: 'flex',
|
|
81
|
+
color: 'gray',
|
|
82
|
+
position: 'absolute',
|
|
83
|
+
top: 0,
|
|
84
|
+
left: 0,
|
|
85
|
+
right: 0,
|
|
86
|
+
bottom: 0,
|
|
87
|
+
fontSize: 24,
|
|
88
|
+
alignItems: 'center',
|
|
89
|
+
flexDirection: 'column',
|
|
90
|
+
gap: '20px',
|
|
91
|
+
zIndex: 10,
|
|
92
|
+
padding: '20px',
|
|
93
|
+
}); },
|
|
94
|
+
grid: {
|
|
95
|
+
display: 'grid',
|
|
96
|
+
gap: '20px',
|
|
97
|
+
width: '100%',
|
|
98
|
+
},
|
|
99
|
+
row: {
|
|
100
|
+
display: 'flex',
|
|
101
|
+
justifyContent: 'space-between',
|
|
102
|
+
width: '100%',
|
|
103
|
+
},
|
|
104
|
+
loader: function (bg, height, width) { return ({
|
|
105
|
+
width: width ? "".concat(width, "px") : '100%',
|
|
106
|
+
height: "".concat(height, "px"),
|
|
107
|
+
backgroundColor: bg,
|
|
108
|
+
borderRadius: '4px',
|
|
109
|
+
animation: 'pulse 1.5s infinite',
|
|
110
|
+
}); },
|
|
111
|
+
keyframes: "\n @keyframes pulse {\n 0%, 100% { opacity: 0.07; }\n 50% { opacity: 0.03; }\n }\n ",
|
|
112
|
+
};
|
|
18
113
|
//# sourceMappingURL=CoinflowPurchase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowPurchase.js","sourceRoot":"","sources":["../../src/CoinflowPurchase.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"CoinflowPurchase.js","sourceRoot":"","sources":["../../src/CoinflowPurchase.tsx"],"names":[],"mappings":";;AAoCA,wDAGC;AAED,4CAuBC;;AAhED,qDAA+C;AAC/C,mCAOkB;AAClB,mDAAkF;AAClF,2CAA0C;AAE1C,SAAS,mBAAmB,CAC1B,aAAoC,EACpC,OAAe;IAEf,IAAM,WAAW,GAAG,IAAA,eAAO,EAAsB;QAC/C,IAAM,YAAY,GAAG,IAAA,wBAAe,EAAC,aAAa,CAAC,CAAC;QACpD,6CACK,aAAa,KAChB,YAAY,cAAA,EACZ,KAAK,EAAE,mBAAY,OAAO,cAAI,aAAa,CAAC,UAAU,CAAE,EACxD,WAAW,EAAE,sBAAa,CAAC,cAAc,CAAC,aAAa,CAAC,IACxD;IACJ,CAAC,EAAE,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;IAE7B,IAAM,eAAe,GAAG,IAAA,eAAO,EAAwB;QACrD,6CACK,IAAA,oBAAW,EAAC,aAAa,CAAC,KAC7B,kBAAkB,EAAE,aAAa,CAAC,kBAAkB,IACpD;IACJ,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO,EAAC,WAAW,aAAA,EAAE,eAAe,iBAAA,EAAC,CAAC;AACxC,CAAC;AAED,SAAgB,sBAAsB,CAAC,aAAoC;IACnE,IAAA,KAAiC,mBAAmB,CAAC,aAAa,EAAE,EAAE,CAAC,EAAtE,WAAW,iBAAA,EAAE,eAAe,qBAA0C,CAAC;IAC9E,OAAO,8BAAC,+BAAc,uBA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,MAAM;QACf,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,UAAmB;QAC7B,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,QAAiB;QAChC,GAAG,EAAE,MAAM;QACX,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,MAAM;KAChB,CAAC,EAfuB,CAevB;IACF,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM;QACf,GAAG,EAAE,MAAM;QACX,KAAK,EAAE,MAAM;KACd;IACD,GAAG,EAAE;QACH,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,eAAe;QAC/B,KAAK,EAAE,MAAM;KACd;IACD,MAAM,EAAE,UAAC,EAAU,EAAE,MAAc,EAAE,KAAc,IAAK,OAAA,CAAC;QACvD,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,UAAG,KAAK,OAAI,CAAC,CAAC,CAAC,MAAM;QACpC,MAAM,EAAE,UAAG,MAAM,OAAI;QACrB,eAAe,EAAE,EAAE;QACnB,YAAY,EAAE,KAAK;QACnB,SAAS,EAAE,qBAAqB;KACjC,CAAC,EANsD,CAMtD;IACF,SAAS,EAAE,sGAKV;CACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CoinflowPurchaseProps } from './common';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare function MobileWalletButton({ props, route, overlayDisplayOverride, children, alignItems, }: {
|
|
4
|
+
props: CoinflowPurchaseProps & MobileWalletButtonProps;
|
|
5
|
+
route: string;
|
|
6
|
+
overlayDisplayOverride?: string;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
alignItems?: string;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export interface MobileWalletButtonProps {
|
|
11
|
+
color: 'white' | 'black';
|
|
12
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MobileWalletButton = MobileWalletButton;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var common_1 = require("./common");
|
|
6
|
+
var react_1 = tslib_1.__importStar(require("react"));
|
|
7
|
+
var CoinflowIFrame_1 = require("./CoinflowIFrame");
|
|
8
|
+
var useOverlay_1 = require("./useOverlay");
|
|
9
|
+
function MobileWalletButton(_a) {
|
|
10
|
+
var props = _a.props, route = _a.route, overlayDisplayOverride = _a.overlayDisplayOverride, children = _a.children, alignItems = _a.alignItems;
|
|
11
|
+
var iframeRef = (0, react_1.useRef)(null);
|
|
12
|
+
var _b = (0, useOverlay_1.useOverlay)(iframeRef), opacity = _b.opacity, display = _b.display;
|
|
13
|
+
var onSuccess = props.onSuccess;
|
|
14
|
+
(0, react_1.useEffect)(function () {
|
|
15
|
+
if (!onSuccess)
|
|
16
|
+
return;
|
|
17
|
+
if (!(iframeRef === null || iframeRef === void 0 ? void 0 : iframeRef.current))
|
|
18
|
+
return;
|
|
19
|
+
iframeRef.current
|
|
20
|
+
.listenForMessage(function (data) {
|
|
21
|
+
try {
|
|
22
|
+
var res = JSON.parse(data);
|
|
23
|
+
return 'method' in res && res.method === 'getToken';
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
.then(function (data) { return onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(data); });
|
|
30
|
+
}, [onSuccess]);
|
|
31
|
+
var iframeProps = (0, react_1.useMemo)(function () {
|
|
32
|
+
var walletPubkey = (0, common_1.getWalletPubkey)(props);
|
|
33
|
+
return tslib_1.__assign(tslib_1.__assign({}, props), { walletPubkey: walletPubkey, transaction: undefined, routePrefix: 'form', route: "/".concat(route, "/").concat(props.merchantId) });
|
|
34
|
+
}, [props, route]);
|
|
35
|
+
var messageHandlers = (0, react_1.useMemo)(function () {
|
|
36
|
+
return tslib_1.__assign(tslib_1.__assign({}, (0, common_1.getHandlers)(props)), { handleHeightChange: props.handleHeightChange });
|
|
37
|
+
}, [props]);
|
|
38
|
+
return (react_1.default.createElement("div", { style: {
|
|
39
|
+
position: 'relative',
|
|
40
|
+
height: '100%',
|
|
41
|
+
} },
|
|
42
|
+
react_1.default.createElement("div", { style: {
|
|
43
|
+
backgroundColor: props.color,
|
|
44
|
+
width: '100%',
|
|
45
|
+
height: '40px',
|
|
46
|
+
position: 'absolute',
|
|
47
|
+
top: 0,
|
|
48
|
+
bottom: 0,
|
|
49
|
+
left: 0,
|
|
50
|
+
zIndex: 20,
|
|
51
|
+
display: overlayDisplayOverride !== null && overlayDisplayOverride !== void 0 ? overlayDisplayOverride : display,
|
|
52
|
+
opacity: opacity,
|
|
53
|
+
justifyContent: 'center',
|
|
54
|
+
alignItems: alignItems,
|
|
55
|
+
pointerEvents: 'none',
|
|
56
|
+
} }, children),
|
|
57
|
+
react_1.default.createElement("div", { style: {
|
|
58
|
+
position: 'relative',
|
|
59
|
+
zIndex: 10,
|
|
60
|
+
height: '100%',
|
|
61
|
+
} },
|
|
62
|
+
react_1.default.createElement(CoinflowIFrame_1.CoinflowIFrame, tslib_1.__assign({ ref: iframeRef }, iframeProps, messageHandlers)))));
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=MobileWalletButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MobileWalletButton.js","sourceRoot":"","sources":["../../src/MobileWalletButton.tsx"],"names":[],"mappings":";;AAWA,gDAsFC;;AAjGD,mCAMkB;AAClB,qDAAwD;AACxD,mDAAgF;AAChF,2CAAwC;AAExC,SAAgB,kBAAkB,CAAC,EAYlC;QAXC,KAAK,WAAA,EACL,KAAK,WAAA,EACL,sBAAsB,4BAAA,EACtB,QAAQ,cAAA,EACR,UAAU,gBAAA;IAQV,IAAM,SAAS,GAAG,IAAA,cAAM,EAAiC,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ACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,CACL,uCACE,KAAK,EAAE;YACL,QAAQ,EAAE,UAAU;YACpB,MAAM,EAAE,MAAM;SACf;QAED,uCACE,KAAK,EAAE;gBACL,eAAe,EAAE,KAAK,CAAC,KAAK;gBAC5B,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,UAAU;gBACpB,GAAG,EAAE,CAAC;gBACN,MAAM,EAAE,CAAC;gBACT,IAAI,EAAE,CAAC;gBACP,MAAM,EAAE,EAAE;gBACV,OAAO,EAAE,sBAAsB,aAAtB,sBAAsB,cAAtB,sBAAsB,GAAI,OAAO;gBAC1C,OAAO,SAAA;gBACP,cAAc,EAAE,QAAQ;gBACxB,UAAU,YAAA;gBACV,aAAa,EAAE,MAAM;aACtB,IAEA,QAAQ,CACL;QACN,uCACE,KAAK,EAAE;gBACL,QAAQ,EAAE,UAAU;gBACpB,MAAM,EAAE,EAAE;gBACV,MAAM,EAAE,MAAM;aACf;YAED,8BAAC,+BAAc,qBAAC,GAAG,EAAE,SAAS,IAAM,WAAW,EAAM,eAAe,EAAI,CACpE,CACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -169,6 +169,10 @@ export interface CoinflowCommonPurchaseProps extends CoinflowTypes {
|
|
|
169
169
|
authOnly?: boolean;
|
|
170
170
|
deviceId?: string;
|
|
171
171
|
jwtToken?: string;
|
|
172
|
+
/**
|
|
173
|
+
* Your company email address that the customer can contact.
|
|
174
|
+
*/
|
|
175
|
+
supportEmail?: string;
|
|
172
176
|
/**
|
|
173
177
|
* If rendering the Coinflow component within multiple nested iframes, all ancestors in the chain must be provided as a comma-separated list.
|
|
174
178
|
*
|
|
@@ -307,7 +311,7 @@ export interface TokenRedeem extends CommonEvmRedeem {
|
|
|
307
311
|
destination: string;
|
|
308
312
|
}
|
|
309
313
|
export type EvmTransactionData = SafeMintRedeem | ReturnedTokenIdRedeem | ReservoirRedeem | KnownTokenIdRedeem | NormalRedeem | TokenRedeem;
|
|
310
|
-
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'webhookInfo' | 'amount' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'token'> {
|
|
314
|
+
export interface CoinflowIFrameProps extends Omit<CoinflowTypes, 'merchantId'>, Pick<CoinflowCommonPurchaseProps, 'chargebackProtectionData' | 'webhookInfo' | 'amount' | 'customerInfo' | 'settlementType' | 'email' | 'planCode' | 'deviceId' | 'jwtToken' | 'origins' | 'threeDsChallengePreference' | 'supportEmail'>, Pick<CoinflowCommonWithdrawProps, 'bankAccountLinkRedirect' | 'additionalWallets' | 'transactionSigner' | 'lockAmount' | 'lockDefaultToken' | 'origins'>, Pick<CoinflowEvmPurchaseProps, 'authOnly'>, Pick<CoinflowSolanaPurchaseProps, 'rent' | 'nativeSolToConvert' | 'token'> {
|
|
311
315
|
walletPubkey: string | null | undefined;
|
|
312
316
|
route: string;
|
|
313
317
|
routePrefix?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../../../src/common/CoinflowTypes.ts"],"names":[],"mappings":";;;AAQA,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAED,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAuND,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACpC,2DAA6B,CAAA;IAC7B,2DAA6B,CAAA;IAC7B,qDAAuB,CAAA;AACzB,CAAC,EAJW,0BAA0B,0CAA1B,0BAA0B,QAIrC;
|
|
1
|
+
{"version":3,"file":"CoinflowTypes.js","sourceRoot":"","sources":["../../../src/common/CoinflowTypes.ts"],"names":[],"mappings":";;;AAQA,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAED,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAuND,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACpC,2DAA6B,CAAA;IAC7B,2DAA6B,CAAA;IAC7B,qDAAuB,CAAA;AACzB,CAAC,EAJW,0BAA0B,0CAA1B,0BAA0B,QAIrC;AAmPD,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,+BAAmB,CAAA;IACnB,yBAAa,CAAA;IACb,6BAAiB,CAAA;AACnB,CAAC,EALW,QAAQ,wBAAR,QAAQ,QAKnB"}
|
|
@@ -9,7 +9,7 @@ export declare class CoinflowUtils {
|
|
|
9
9
|
}>;
|
|
10
10
|
static getCoinflowBaseUrl(env?: CoinflowEnvs): string;
|
|
11
11
|
static getCoinflowApiUrl(env?: CoinflowEnvs): string;
|
|
12
|
-
static getCoinflowUrl({ walletPubkey, route, routePrefix, env, amount, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChange, bankAccountLinkRedirect, additionalWallets, nearDeposit, chargebackProtectionData, merchantCss, color, rent, lockDefaultToken, token, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, }: CoinflowIFrameProps): string;
|
|
12
|
+
static getCoinflowUrl({ walletPubkey, route, routePrefix, env, amount, transaction, blockchain, webhookInfo, email, loaderBackground, handleHeightChange, bankAccountLinkRedirect, additionalWallets, nearDeposit, chargebackProtectionData, merchantCss, color, rent, lockDefaultToken, token, tokens, planCode, disableApplePay, disableGooglePay, customerInfo, settlementType, lockAmount, nativeSolToConvert, theme, usePermit, transactionSigner, authOnly, deviceId, jwtToken, origins, threeDsChallengePreference, supportEmail, }: CoinflowIFrameProps): string;
|
|
13
13
|
static getTransaction(props: CoinflowPurchaseProps): string | undefined;
|
|
14
14
|
static byBlockchain<T>(blockchain: CoinflowBlockchain, args: {
|
|
15
15
|
solana: T;
|
|
@@ -67,7 +67,7 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
67
67
|
};
|
|
68
68
|
CoinflowUtils.getCoinflowUrl = function (_a) {
|
|
69
69
|
var _b;
|
|
70
|
-
var walletPubkey = _a.walletPubkey, route = _a.route, routePrefix = _a.routePrefix, env = _a.env, amount = _a.amount, transaction = _a.transaction, blockchain = _a.blockchain, webhookInfo = _a.webhookInfo, email = _a.email, loaderBackground = _a.loaderBackground, handleHeightChange = _a.handleHeightChange, bankAccountLinkRedirect = _a.bankAccountLinkRedirect, additionalWallets = _a.additionalWallets, nearDeposit = _a.nearDeposit, chargebackProtectionData = _a.chargebackProtectionData, merchantCss = _a.merchantCss, color = _a.color, rent = _a.rent, lockDefaultToken = _a.lockDefaultToken, token = _a.token, tokens = _a.tokens, planCode = _a.planCode, disableApplePay = _a.disableApplePay, disableGooglePay = _a.disableGooglePay, customerInfo = _a.customerInfo, settlementType = _a.settlementType, lockAmount = _a.lockAmount, nativeSolToConvert = _a.nativeSolToConvert, theme = _a.theme, usePermit = _a.usePermit, transactionSigner = _a.transactionSigner, authOnly = _a.authOnly, deviceId = _a.deviceId, jwtToken = _a.jwtToken, origins = _a.origins, threeDsChallengePreference = _a.threeDsChallengePreference;
|
|
70
|
+
var walletPubkey = _a.walletPubkey, route = _a.route, routePrefix = _a.routePrefix, env = _a.env, amount = _a.amount, transaction = _a.transaction, blockchain = _a.blockchain, webhookInfo = _a.webhookInfo, email = _a.email, loaderBackground = _a.loaderBackground, handleHeightChange = _a.handleHeightChange, bankAccountLinkRedirect = _a.bankAccountLinkRedirect, additionalWallets = _a.additionalWallets, nearDeposit = _a.nearDeposit, chargebackProtectionData = _a.chargebackProtectionData, merchantCss = _a.merchantCss, color = _a.color, rent = _a.rent, lockDefaultToken = _a.lockDefaultToken, token = _a.token, tokens = _a.tokens, planCode = _a.planCode, disableApplePay = _a.disableApplePay, disableGooglePay = _a.disableGooglePay, customerInfo = _a.customerInfo, settlementType = _a.settlementType, lockAmount = _a.lockAmount, nativeSolToConvert = _a.nativeSolToConvert, theme = _a.theme, usePermit = _a.usePermit, transactionSigner = _a.transactionSigner, authOnly = _a.authOnly, deviceId = _a.deviceId, jwtToken = _a.jwtToken, origins = _a.origins, threeDsChallengePreference = _a.threeDsChallengePreference, supportEmail = _a.supportEmail;
|
|
71
71
|
var prefix = routePrefix
|
|
72
72
|
? "/".concat(routePrefix, "/").concat(blockchain)
|
|
73
73
|
: "/".concat(blockchain);
|
|
@@ -91,6 +91,8 @@ var CoinflowUtils = /** @class */ (function () {
|
|
|
91
91
|
if (email) {
|
|
92
92
|
url.searchParams.append('email', email);
|
|
93
93
|
}
|
|
94
|
+
if (supportEmail)
|
|
95
|
+
url.searchParams.append('supportEmail', supportEmail);
|
|
94
96
|
if (token) {
|
|
95
97
|
url.searchParams.append('token', token.toString());
|
|
96
98
|
}
|