@funkit/connect 0.1.4 → 0.1.5

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.
Files changed (54) hide show
  1. package/dist/{chunk-P6ZB76ND.js → chunk-HS4VFULE.js} +1432 -1133
  2. package/dist/{chunk-IRPFZ4HK.js → chunk-LKGTFED3.js} +7 -6
  3. package/dist/{chunk-U7T37VQU.js → chunk-VGM7OU7P.js} +8 -3
  4. package/dist/{chunk-AHK324EF.js → chunk-WJHR5YCY.js} +1432 -1133
  5. package/dist/components/Box/Box.d.ts +7 -7
  6. package/dist/components/FunButton/FunButton.css.d.ts +1 -0
  7. package/dist/components/FunButton/FunIconButton.d.ts +2 -1
  8. package/dist/components/FunDivider/FunDivider.d.ts +2 -1
  9. package/dist/components/FunInput/FunInput.d.ts +3 -2
  10. package/dist/components/FunNotification/FunNotification.d.ts +3 -1
  11. package/dist/components/FunPayments/FunPaymentMoonpayType.css.d.ts +1 -0
  12. package/dist/components/FunSelect/FunSelect.d.ts +2 -1
  13. package/dist/components/FunkitProvider/FunkitCheckoutContext.d.ts +13 -8
  14. package/dist/components/FunkitProvider/FunkitProvider.d.ts +3 -3
  15. package/dist/components/FunkitWeb2Provider/FunkitWeb2Provider.d.ts +4 -0
  16. package/dist/components/Icons/NoAssetsFoundIcon.d.ts +4 -0
  17. package/dist/components/Icons/SearchIcon.d.ts +3 -1
  18. package/dist/components/SkeletalLoader/SkeletalLoader.css.d.ts +1 -0
  19. package/dist/components/SkeletalLoader/SkeletalLoader.d.ts +2 -0
  20. package/dist/components/index.css +874 -805
  21. package/dist/components/index.js +2 -2
  22. package/dist/css/sprinkles.css.d.ts +21 -0
  23. package/dist/index.css +874 -805
  24. package/dist/index.d.ts +0 -1
  25. package/dist/index.js +5 -10
  26. package/dist/themes/baseTheme.d.ts +1 -1
  27. package/dist/themes/darkTheme.d.ts +4 -0
  28. package/dist/themes/darkTheme.js +1 -1
  29. package/dist/themes/lightTheme.d.ts +4 -0
  30. package/dist/themes/lightTheme.js +1 -1
  31. package/dist/utils/checkout.d.ts +28 -1
  32. package/dist/utils/formatNumber.d.ts +2 -0
  33. package/dist/wallets/walletConnectors/argentWallet/argentWallet.js +2 -2
  34. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  35. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  36. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  37. package/dist/wallets/walletConnectors/index.js +52 -52
  38. package/dist/wallets/walletConnectors/ledgerWallet/ledgerWallet.js +2 -2
  39. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  40. package/dist/wallets/walletConnectors/oktoWallet/oktoWallet.js +2 -2
  41. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  42. package/dist/wallets/walletConnectors/omniWallet/omniWallet.js +2 -2
  43. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  44. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  45. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  46. package/dist/wallets/walletConnectors/walletConnectWallet/walletConnectWallet.js +2 -2
  47. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  48. package/package.json +4 -4
  49. package/dist/chunk-FDHEHORE.js +0 -68
  50. package/dist/chunk-U7C2G4O4.js +0 -67
  51. package/dist/themes/funTheme.d.ts +0 -63
  52. package/dist/themes/funTheme.js +0 -8
  53. package/dist/themes/midnightTheme.d.ts +0 -59
  54. package/dist/themes/midnightTheme.js +0 -8
@@ -35,7 +35,7 @@ export declare const Box: React.ForwardRefExoticComponent<{
35
35
  readonly alignSelf?: "flex-start" | "flex-end" | "center" | undefined;
36
36
  readonly backgroundSize?: "cover" | undefined;
37
37
  readonly borderRadius?: "1" | "actionButton" | "connectButton" | "menuButton" | "modal" | "modalMobile" | "6" | "10" | "13" | "16" | "24" | "25%" | "full" | undefined;
38
- readonly borderStyle?: "solid" | "dotted" | undefined;
38
+ readonly borderStyle?: "solid" | "dotted" | "hidden" | undefined;
39
39
  readonly borderWidth?: "0" | "1" | "2" | "4" | undefined;
40
40
  readonly cursor?: "pointer" | undefined;
41
41
  readonly flexDirection?: "row" | "column" | undefined;
@@ -43,17 +43,17 @@ export declare const Box: React.ForwardRefExoticComponent<{
43
43
  readonly fontSize?: "10" | "13" | "16" | "12" | "14" | "18" | "20" | "23" | "57" | undefined;
44
44
  readonly fontWeight?: "regular" | "medium" | "semibold" | "bold" | "heavy" | undefined;
45
45
  readonly gap?: "0" | "1" | "2" | "3" | "6" | "10" | "16" | "24" | "4" | "12" | "14" | "18" | "20" | "-1" | "5" | "8" | "28" | "30" | "32" | "36" | "44" | "64" | undefined;
46
- readonly height?: "1" | "2" | "24" | "full" | "4" | "12" | "20" | "400" | "8" | "28" | "30" | "32" | "36" | "44" | "34" | "40" | "48" | "54" | "60" | "93" | "100" | "108" | "162" | "192" | "200" | "210" | "220" | "230" | "240" | "256" | "320" | "600" | "half" | "max" | undefined;
46
+ readonly height?: "1" | "2" | "24" | "full" | "4" | "12" | "20" | "400" | "8" | "28" | "30" | "32" | "36" | "44" | "34" | "40" | "48" | "54" | "60" | "93" | "100" | "108" | "162" | "192" | "200" | "210" | "220" | "230" | "240" | "256" | "320" | "440" | "600" | "half" | "max" | undefined;
47
47
  readonly justifyContent?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | undefined;
48
48
  readonly textAlign?: "left" | "inherit" | "center" | undefined;
49
49
  readonly marginBottom?: "0" | "1" | "2" | "3" | "6" | "10" | "16" | "24" | "4" | "12" | "14" | "18" | "20" | "-1" | "5" | "8" | "28" | "30" | "32" | "36" | "44" | "64" | undefined;
50
50
  readonly marginLeft?: "0" | "1" | "2" | "3" | "6" | "10" | "16" | "24" | "4" | "12" | "14" | "18" | "20" | "-1" | "5" | "8" | "28" | "30" | "32" | "36" | "44" | "64" | undefined;
51
51
  readonly marginRight?: "0" | "1" | "2" | "3" | "6" | "10" | "16" | "24" | "4" | "12" | "14" | "18" | "20" | "-1" | "5" | "8" | "28" | "30" | "32" | "36" | "44" | "64" | undefined;
52
52
  readonly marginTop?: "0" | "1" | "2" | "3" | "6" | "10" | "16" | "24" | "4" | "12" | "14" | "18" | "20" | "-1" | "5" | "8" | "28" | "30" | "32" | "36" | "44" | "64" | undefined;
53
- readonly minHeight?: "1" | "2" | "24" | "full" | "4" | "12" | "20" | "400" | "8" | "28" | "30" | "32" | "36" | "44" | "34" | "40" | "48" | "54" | "60" | "93" | "100" | "108" | "162" | "192" | "200" | "210" | "220" | "230" | "240" | "256" | "320" | "600" | "half" | "max" | undefined;
54
- readonly maxHeight?: "1" | "2" | "24" | "full" | "4" | "12" | "20" | "400" | "8" | "28" | "30" | "32" | "36" | "44" | "34" | "40" | "48" | "54" | "60" | "93" | "100" | "108" | "162" | "192" | "200" | "210" | "220" | "230" | "240" | "256" | "320" | "600" | "half" | "max" | undefined;
55
- readonly maxWidth?: "1" | "2" | "24" | "full" | "4" | "12" | "20" | "400" | "8" | "28" | "30" | "32" | "36" | "44" | "34" | "40" | "48" | "54" | "60" | "93" | "100" | "108" | "162" | "192" | "200" | "210" | "220" | "230" | "240" | "256" | "320" | "600" | "half" | "max" | undefined;
56
- readonly minWidth?: "1" | "2" | "24" | "full" | "4" | "12" | "20" | "400" | "8" | "28" | "30" | "32" | "36" | "44" | "34" | "40" | "48" | "54" | "60" | "93" | "100" | "108" | "162" | "192" | "200" | "210" | "220" | "230" | "240" | "256" | "320" | "600" | "half" | "max" | undefined;
53
+ readonly minHeight?: "1" | "2" | "24" | "full" | "4" | "12" | "20" | "400" | "8" | "28" | "30" | "32" | "36" | "44" | "34" | "40" | "48" | "54" | "60" | "93" | "100" | "108" | "162" | "192" | "200" | "210" | "220" | "230" | "240" | "256" | "320" | "440" | "600" | "half" | "max" | undefined;
54
+ readonly maxHeight?: "1" | "2" | "24" | "full" | "4" | "12" | "20" | "400" | "8" | "28" | "30" | "32" | "36" | "44" | "34" | "40" | "48" | "54" | "60" | "93" | "100" | "108" | "162" | "192" | "200" | "210" | "220" | "230" | "240" | "256" | "320" | "440" | "600" | "half" | "max" | undefined;
55
+ readonly maxWidth?: "1" | "2" | "24" | "full" | "4" | "12" | "20" | "400" | "8" | "28" | "30" | "32" | "36" | "44" | "34" | "40" | "48" | "54" | "60" | "93" | "100" | "108" | "162" | "192" | "200" | "210" | "220" | "230" | "240" | "256" | "320" | "440" | "600" | "half" | "max" | undefined;
56
+ readonly minWidth?: "1" | "2" | "24" | "full" | "4" | "12" | "20" | "400" | "8" | "28" | "30" | "32" | "36" | "44" | "34" | "40" | "48" | "54" | "60" | "93" | "100" | "108" | "162" | "192" | "200" | "210" | "220" | "230" | "240" | "256" | "320" | "440" | "600" | "half" | "max" | undefined;
57
57
  readonly overflow?: "hidden" | undefined;
58
58
  readonly paddingBottom?: "0" | "1" | "2" | "3" | "6" | "10" | "16" | "24" | "4" | "12" | "14" | "18" | "20" | "-1" | "5" | "8" | "28" | "30" | "32" | "36" | "44" | "64" | undefined;
59
59
  readonly paddingLeft?: "0" | "1" | "2" | "3" | "6" | "10" | "16" | "24" | "4" | "12" | "14" | "18" | "20" | "-1" | "5" | "8" | "28" | "30" | "32" | "36" | "44" | "64" | undefined;
@@ -63,7 +63,7 @@ export declare const Box: React.ForwardRefExoticComponent<{
63
63
  readonly right?: "0" | undefined;
64
64
  readonly transition?: "default" | "transform" | undefined;
65
65
  readonly userSelect?: "none" | undefined;
66
- readonly width?: "1" | "2" | "24" | "full" | "4" | "12" | "20" | "400" | "8" | "28" | "30" | "32" | "36" | "44" | "34" | "40" | "48" | "54" | "60" | "93" | "100" | "108" | "162" | "192" | "200" | "210" | "220" | "230" | "240" | "256" | "320" | "600" | "half" | "max" | undefined;
66
+ readonly width?: "1" | "2" | "24" | "full" | "4" | "12" | "20" | "400" | "8" | "28" | "30" | "32" | "36" | "44" | "34" | "40" | "48" | "54" | "60" | "93" | "100" | "108" | "162" | "192" | "200" | "210" | "220" | "230" | "240" | "256" | "320" | "440" | "600" | "half" | "max" | undefined;
67
67
  readonly backdropFilter?: "modalOverlay" | undefined;
68
68
  margin?: "0" | "1" | "2" | "3" | "6" | "10" | "16" | "24" | "4" | "12" | "14" | "18" | "20" | "-1" | "5" | "8" | "28" | "30" | "32" | "36" | "44" | "64" | undefined;
69
69
  marginX?: "0" | "1" | "2" | "3" | "6" | "10" | "16" | "24" | "4" | "12" | "14" | "18" | "20" | "-1" | "5" | "8" | "28" | "30" | "32" | "36" | "44" | "64" | undefined;
@@ -1 +1,2 @@
1
1
  export declare const funLinkButtonStyle: string;
2
+ export declare const funIconButtonStyle: string;
@@ -3,9 +3,10 @@ import { BoxProps } from '../Box/Box';
3
3
  /**
4
4
  * Circular icon button with dynamic height and width
5
5
  */
6
- export declare const FunIconButton: ({ onClick, icon, size, showBorder, }: {
6
+ export declare const FunIconButton: ({ onClick, icon, size, showBorder, ariaLabel, }: {
7
7
  onClick: () => void;
8
8
  icon: React.ReactNode;
9
9
  size?: BoxProps['height'];
10
10
  showBorder?: boolean | undefined;
11
+ ariaLabel?: string | undefined;
11
12
  }) => React.JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { BoxProps } from '../Box/Box';
3
- export declare function FunDivider({ marginY, }: {
3
+ export declare function FunDivider({ marginY, transparent, }: {
4
4
  marginY?: BoxProps['margin'];
5
+ transparent?: boolean;
5
6
  }): React.JSX.Element;
@@ -3,6 +3,7 @@ import React, { HTMLInputTypeAttribute, ReactNode } from 'react';
3
3
  import { BoxProps } from '../Box/Box';
4
4
  export interface FunInputProps {
5
5
  prefix?: ReactNode;
6
+ prefixIcon?: 'SearchIcon' | '$';
6
7
  placeholder?: string;
7
8
  value: string | number | readonly string[] | undefined;
8
9
  label?: string;
@@ -18,11 +19,11 @@ export interface FunInputProps {
18
19
  [x: string]: any;
19
20
  };
20
21
  ref?: any;
21
- error?: boolean;
22
+ error?: string | boolean;
22
23
  focused?: boolean;
23
24
  textColor?: BoxProps['color'];
24
25
  inputClass?: string;
25
26
  }
26
- export declare function FunInputDefault({ prefix, placeholder, value, label, onChange, onKeyDown, onKeySubmit, onPaste, onMouseDown, hasBackground, textColor, inputStyle, inputProps, error, focused, inputClass, }: FunInputProps): React.JSX.Element;
27
+ export declare function FunInputDefault({ prefix, prefixIcon, placeholder, value, label, onChange, onKeyDown, onKeySubmit, onPaste, onMouseDown, hasBackground, textColor, inputStyle, inputProps, error, focused: _focused, inputClass, }: FunInputProps): React.JSX.Element;
27
28
  export declare const FunInputWithRef: React.ForwardRefExoticComponent<Omit<FunInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
28
29
  export declare function FunInput(props: FunInputProps): React.JSX.Element;
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
+ import { Box } from '../Box/Box';
2
3
  import { TextProps } from '../Text/Text';
3
4
  interface FunNotificationProps {
4
5
  type?: FunNotificationType;
5
6
  description: string;
6
7
  textProps?: Omit<TextProps, 'color'>;
8
+ containerProps?: React.ComponentProps<typeof Box>;
7
9
  }
8
10
  type FunNotificationType = 'default' | 'error';
9
- export declare function FunNotification({ type, description, textProps, }: FunNotificationProps): React.JSX.Element;
11
+ export declare function FunNotification({ type, description, textProps, containerProps, }: FunNotificationProps): React.JSX.Element;
10
12
  export {};
@@ -2,6 +2,7 @@ export declare const contentAnimationDefaults: {
2
2
  animationDuration: string;
3
3
  animationTimingFunction: string;
4
4
  animationFillMode: string;
5
+ height: string;
5
6
  };
6
7
  export declare const animateContentInClass: string;
7
8
  export declare const animateContentOutClass: string;
@@ -4,12 +4,13 @@ export interface FunSelectOption {
4
4
  value: string;
5
5
  label: ReactNode;
6
6
  }
7
- export declare function FunSelectDropdown({ handleSelect, isDropdownOpen, options, selectedValue, optionItemPadding, }: {
7
+ export declare function FunSelectDropdown({ handleSelect, isDropdownOpen, options, selectedValue, optionItemPadding, showBorder, }: {
8
8
  handleSelect: (newValue: FunSelectOption['value']) => void;
9
9
  isDropdownOpen: boolean;
10
10
  options: FunSelectOption[];
11
11
  selectedValue: FunSelectOption['value'];
12
12
  optionItemPadding?: BoxProps['padding'];
13
+ showBorder?: boolean;
13
14
  }): React.JSX.Element | null;
14
15
  interface FunSelectProps {
15
16
  initValue?: FunSelectOption['value'];
@@ -1,4 +1,4 @@
1
- import { CheckoutCoreQuoteResponse, CheckoutHistoryItem, ExecutionReceipt } from '@funkit/core';
1
+ import { CheckoutCoreQuoteResponse, CheckoutHistoryItem, Operation } from '@funkit/core';
2
2
  import React, { ReactNode } from 'react';
3
3
  import { Abi, Address } from 'viem';
4
4
  import { CheckoutHistoryStateMap } from '../../utils/checkout';
@@ -23,8 +23,6 @@ export interface FunkitCheckoutConfig {
23
23
  targetAssetAmount: number;
24
24
  /** Timestamp (in milliseconds) after which the checkout should not be performed, and the funds will become rescuable. Min: 300000 (5 mins), Max: 3600000 (1 hour). **/
25
25
  expirationTimestampMs: number;
26
- /** Whether direct checkout execution should be allowed **/
27
- enableDirectExecution?: boolean;
28
26
  /** ****************************************
29
27
  * Checkout ModalUI-related configurations *
30
28
  *******************************************/
@@ -44,9 +42,10 @@ interface FunkitCheckoutValidationResult {
44
42
  message: string;
45
43
  }
46
44
  type FunkitCheckoutQuoteResult = CheckoutCoreQuoteResponse;
47
- export type FunkitDirectExecutionResult = {
48
- receipt: ExecutionReceipt | string | null;
49
- type: 'web2' | 'web3';
45
+ export type FunkitCheckoutResult = {
46
+ type: 'error' | 'success';
47
+ message: string;
48
+ metadata: object | Error;
50
49
  };
51
50
  interface useFunkitCheckoutProps {
52
51
  /** @required the checkout config object **/
@@ -57,8 +56,10 @@ interface useFunkitCheckoutProps {
57
56
  onEstimation?: (result: FunkitCheckoutQuoteResult) => void;
58
57
  /** @optional fires when a checkout if confirmed with the funkit server **/
59
58
  onConfirmation?: () => void;
60
- /** @optional fires if the checkout is unneeded and the transaction can be executed directly. Recommended to implement this if `config.enableDirectExecution` is set to true.**/
61
- onDirectExecution?: (result: FunkitDirectExecutionResult) => void;
59
+ /** @optional fires if the checkout fails at any point */
60
+ onError?: (result: FunkitCheckoutResult) => void;
61
+ /** @optional fires if the checkout fails at any point */
62
+ onSuccess?: (result: FunkitCheckoutResult) => void;
62
63
  }
63
64
  /**
64
65
  * Checkout Item for frontend use
@@ -86,6 +87,8 @@ export interface FunkitActiveCheckoutItem {
86
87
  symbol: string | null;
87
88
  chainId: string;
88
89
  };
90
+ /** Whether the checkout is a direct execution. If true, the initSettings.actionsParamfalse, it would go through the fun checkout protocol. */
91
+ isDirectExecution: boolean;
89
92
  }
90
93
  export declare function FunkitCheckoutProvider({ children }: {
91
94
  children: ReactNode;
@@ -96,6 +99,8 @@ interface useFunkitPreCheckoutInternalReturn {
96
99
  confirmCheckout: (paymentMethod: PaymentMethod) => Promise<Address>;
97
100
  getCheckoutDraftDollarValue: () => Promise<void>;
98
101
  getCheckoutQuote: (sponsorInitialTransferGasLimit: number) => Promise<void>;
102
+ handleWeb2DirectExecution: () => Promise<void>;
103
+ generateSignedBatchOperationForDirectExecution: () => Promise<Operation | null>;
99
104
  }
100
105
  /**
101
106
  * Internal hook to handle frontend pre-checkout operations, PER-CHECKOUT ITEM.
@@ -14,7 +14,7 @@ export type Theme = ThemeVars | {
14
14
  lightMode: ThemeVars;
15
15
  darkMode: ThemeVars;
16
16
  };
17
- export interface RainbowKitProviderProps {
17
+ export interface FunkitProviderProps {
18
18
  wagmiConfig: CreateConfigParameters;
19
19
  chains: RainbowKitChain[];
20
20
  initialChain?: RainbowKitChain | number;
@@ -33,5 +33,5 @@ export interface RainbowKitProviderProps {
33
33
  funkitConfig: FunkitConfig;
34
34
  }
35
35
  export declare const RESERVED_GROUP_NAME = "funkit-web2";
36
- export declare function FunkitProvider(props: PropsWithChildren<RainbowKitProviderProps>): React.JSX.Element;
37
- export declare function FunkitProviderInner({ appInfo, avatar, chains, children, coolMode, id, initialChain, locale, modalSize, showRecentTransactions, theme, funkitConfig, }: PropsWithChildren<RainbowKitProviderProps>): React.JSX.Element;
36
+ export declare function FunkitProvider(props: PropsWithChildren<FunkitProviderProps>): React.JSX.Element;
37
+ export declare function FunkitProviderInner({ appInfo, avatar, chains, children, coolMode, id, initialChain, locale, modalSize, showRecentTransactions, theme, funkitConfig, }: PropsWithChildren<FunkitProviderProps>): React.JSX.Element;
@@ -5,6 +5,10 @@ interface OtpErrors {
5
5
  otpValue: string;
6
6
  }
7
7
  type OtpErrorType = OtpErrors | null;
8
+ export declare const PRIVY_ERROR_CODES: {
9
+ readonly INVALID_CREDENTIALS: "invalid_credentials";
10
+ readonly NETWORK_ERROR: "network_error";
11
+ };
8
12
  interface FunkitWeb2ContextType {
9
13
  privy: PrivyJS | null;
10
14
  loading: boolean;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const NotFoundIcon: ({ size }: {
3
+ size?: number | undefined;
4
+ }) => React.JSX.Element;
@@ -1,2 +1,4 @@
1
1
  import React from 'react';
2
- export declare const SearchIcon: () => React.JSX.Element;
2
+ export declare const SearchIcon: ({ selected }: {
3
+ selected?: boolean | undefined;
4
+ }) => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const pulseAnimation: string;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const SkeletalLoader: () => React.JSX.Element[];