@ensofinance/checkout-widget 0.1.3 → 0.1.4

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/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { CheckoutConfig } from '../../../../../../../src/types';
2
- import { CheckoutModalProps } from '../../../../../../../src/types';
3
1
  import { ComponentType } from 'react';
4
2
  import { JSX as JSX_2 } from 'react/jsx-runtime';
5
3
  import { SystemConfig as WidgetTheme } from '@chakra-ui/react';
@@ -10,14 +8,33 @@ export declare const Checkout: ({ config: { apiKey, tokenOut, chainIdOut, theme,
10
8
  onClose?: () => void;
11
9
  }) => JSX_2.Element;
12
10
 
13
- export { CheckoutConfig }
11
+ export declare type CheckoutConfig = {
12
+ tokenOut: string;
13
+ chainIdOut: number;
14
+ apiKey: string;
15
+ theme?: WidgetTheme;
16
+ enableExchange?: SupportedExchanges[];
17
+ /** Override the default CEX bridge chain mapping (maps target chains to intermediate chains for withdrawal + bridge) */
18
+ cexBridgeChainMapping?: Record<number, number>;
19
+ /** Override recipient address (defaults to connected wallet's smart account) */
20
+ recipient?: string;
21
+ /** Force the widget to open in a specific flow, bypassing the selector */
22
+ enforceFlow?: EnforceFlow;
23
+ };
14
24
 
15
25
  export declare const CheckoutModal: ({ config, setIsActive, isActive, onClose, }: CheckoutModalProps) => JSX_2.Element;
16
26
 
17
- export { CheckoutModalProps }
27
+ export declare type CheckoutModalProps = {
28
+ config: CheckoutConfig;
29
+ isActive: boolean;
30
+ setIsActive: (active: boolean) => void;
31
+ onClose?: () => void;
32
+ };
18
33
 
19
34
  export declare const DEFAULT_CEX_BRIDGE_CHAIN_MAPPING: Record<number, number>;
20
35
 
36
+ declare type EnforceFlow = "exchange" | "wallet";
37
+
21
38
  export declare enum SupportedExchanges {
22
39
  Binance = "binance",
23
40
  Kraken = "kraken",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ensofinance/checkout-widget",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "homepage": "https://www.enso.build/",
6
6
  "repository": {
@@ -60,7 +60,6 @@
60
60
  "globals": "^15.14.0",
61
61
  "orval": "^7.10.0",
62
62
  "prettier": "^3.4.2",
63
- "source-map-explorer": "^2.5.3",
64
63
  "typescript": "~5.8.2",
65
64
  "typescript-eslint": "^8.18.2",
66
65
  "vite": "^6.0.5",
@@ -8,7 +8,7 @@ import {
8
8
  type CheckoutConfig,
9
9
  type SupportedExchanges,
10
10
  type EnforceFlow,
11
- } from "@/types";
11
+ } from "../types";
12
12
  import posthog from "posthog-js";
13
13
 
14
14
  type ICheckoutContext = {
@@ -1,7 +1,7 @@
1
1
  import { useCallback } from "react";
2
2
  import { Checkout } from "./Checkout";
3
3
  import Modal from "./modal";
4
- import { type CheckoutModalProps } from "@/types";
4
+ import { type CheckoutModalProps } from "../types";
5
5
 
6
6
  export const CheckoutModal = ({
7
7
  config,
@@ -56,7 +56,7 @@ import { ConfirmExchangeStep } from "../ExchangeConfirmSecurity";
56
56
 
57
57
  import SuccessIcon from "@/assets/success.svg";
58
58
  import FailIcon from "@/assets/fail.svg";
59
- import { SupportedExchanges } from "@/types";
59
+ import { SupportedExchanges } from "../../types";
60
60
  import { useLayerZeroStatus } from "@/util/tx-tracker";
61
61
  import { STARGATE_CHAIN_NAMES, CHAINS_ETHERSCAN } from "@/util/constants";
62
62
 
package/src/index.ts CHANGED
@@ -1,22 +1,11 @@
1
- import {
2
- CheckoutModal,
3
- type CheckoutModalProps,
4
- } from "./components/CheckoutModal";
5
- import { Checkout, type CheckoutConfig } from "./components/Checkout";
1
+ import { CheckoutModal } from "./components/CheckoutModal";
2
+ import { Checkout } from "./components/Checkout";
6
3
 
7
- // Export two versions for different integration needs
8
- export {
9
- // Modal version with isActive/setIsActive control
10
- CheckoutModal,
11
- CheckoutModalProps,
4
+ // Export components
5
+ export { CheckoutModal, Checkout };
12
6
 
13
- // Standalone widget version without modal
14
- Checkout,
15
- CheckoutConfig,
16
- };
17
-
18
- // Export theme type for TypeScript users
19
- export type { WidgetTheme } from "./types";
7
+ // Export types directly from types module for proper bundling
8
+ export type { CheckoutConfig, CheckoutModalProps, WidgetTheme } from "./types";
20
9
  export { SupportedExchanges } from "./types";
21
10
 
22
11
  // Export default CEX bridge chain mapping for users to extend
package/tsconfig.json CHANGED
@@ -4,10 +4,12 @@
4
4
  "module": "ESNext",
5
5
  "moduleResolution": "Bundler",
6
6
  "skipLibCheck": true,
7
+ "baseUrl": ".",
7
8
  "paths": {
8
9
  "@/*": ["./src/*"]
9
10
  },
10
11
  "jsx": "react-jsx",
11
12
  "declaration": true
12
- }
13
+ },
14
+ "include": ["src"]
13
15
  }
package/vite.config.ts CHANGED
@@ -8,7 +8,7 @@ export default defineConfig(({ mode }) => ({
8
8
  dts({
9
9
  insertTypesEntry: true,
10
10
  rollupTypes: true,
11
- bundledPackages: ["./src/types"],
11
+ tsconfigPath: "./tsconfig.json",
12
12
  }), // generates *.d.ts beside the JS
13
13
  ].filter(Boolean),
14
14
  resolve: {