@ensofinance/checkout-widget 0.0.18 → 0.0.19
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/dist/checkout-widget.es.js +2531 -2523
- package/dist/checkout-widget.es.js.map +1 -1
- package/dist/checkout-widget.umd.js +17 -17
- package/dist/checkout-widget.umd.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/ChakraProvider.tsx +3 -0
- package/src/components/Checkout.tsx +4 -2
- package/src/components/steps/CardBuyFlow.tsx +778 -0
- package/src/store.ts +8 -0
- package/src/types/index.ts +2 -0
- package/src/util/constants.tsx +1 -9
- package/src/util/enso-hooks.tsx +12 -5
- package/src/util/meld-hooks.tsx +319 -0
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ComponentType } from 'react';
|
|
|
4
4
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
5
5
|
import { SystemConfig as WidgetTheme } from '@chakra-ui/react';
|
|
6
6
|
|
|
7
|
-
export declare const Checkout: ({ config: { apiKey, tokenOut, chainIdOut, theme, enableExchange, cexBridgeChainMapping }, onClose, wrapper, }: {
|
|
7
|
+
export declare const Checkout: ({ config: { apiKey, tokenOut, chainIdOut, theme, enableExchange, cexBridgeChainMapping, recipient }, onClose, wrapper, }: {
|
|
8
8
|
config: CheckoutConfig;
|
|
9
9
|
wrapper?: ComponentType;
|
|
10
10
|
onClose?: () => void;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ type ICheckoutContext = {
|
|
|
15
15
|
const CheckoutContext = createContext<ICheckoutContext>({} as ICheckoutContext);
|
|
16
16
|
|
|
17
17
|
const Checkout = ({
|
|
18
|
-
config: { apiKey, tokenOut, chainIdOut, theme, enableExchange, cexBridgeChainMapping },
|
|
18
|
+
config: { apiKey, tokenOut, chainIdOut, theme, enableExchange, cexBridgeChainMapping, recipient },
|
|
19
19
|
onClose,
|
|
20
20
|
wrapper,
|
|
21
21
|
}: {
|
|
@@ -26,6 +26,7 @@ const Checkout = ({
|
|
|
26
26
|
const setEnsoApiToken = useAppStore((state) => state.setEnsoApiToken);
|
|
27
27
|
const setTokenOut = useAppStore((state) => state.setTokenOut);
|
|
28
28
|
const setChainIdOut = useAppStore((state) => state.setChainIdOut);
|
|
29
|
+
const setRecipient = useAppStore((state) => state.setRecipient);
|
|
29
30
|
|
|
30
31
|
const handleClose = useMemo(
|
|
31
32
|
() =>
|
|
@@ -42,7 +43,8 @@ const Checkout = ({
|
|
|
42
43
|
useEffect(() => {
|
|
43
44
|
setTokenOut(tokenOut);
|
|
44
45
|
setChainIdOut(chainIdOut);
|
|
45
|
-
|
|
46
|
+
setRecipient(recipient);
|
|
47
|
+
}, [tokenOut, chainIdOut, recipient]);
|
|
46
48
|
|
|
47
49
|
useEffect(() => {
|
|
48
50
|
if (!apiKey) alert("Please provide an API key");
|