@funkit/connect 1.2.6 → 1.2.7

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 (41) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/components/Box/Box.d.ts +3 -3
  3. package/dist/components/CloseButton/CloseButton.d.ts +1 -1
  4. package/dist/components/FunButton/FunIconButton.d.ts +7 -7
  5. package/dist/components/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.d.ts +1 -1
  6. package/dist/components/FunNotification/FunCheckoutNotification.d.ts +1 -1
  7. package/dist/components/FunTransactionSummary/FunTxSummaryHistory.d.ts +1 -1
  8. package/dist/components/FunkitProvider/AppContext.d.ts +3 -3
  9. package/dist/components/FunkitProvider/CoolModeContext.d.ts +0 -1
  10. package/dist/components/FunkitProvider/FunkitCheckoutContext.d.ts +2 -7
  11. package/dist/components/FunkitProvider/FunkitConfigContext.d.ts +1 -1
  12. package/dist/components/FunkitProvider/FunkitSandboxContext.d.ts +0 -1
  13. package/dist/components/FunkitProvider/FunkitWeb2Provider.d.ts +2 -15
  14. package/dist/components/FunkitProvider/GeneralWalletProvider.d.ts +8 -8
  15. package/dist/components/FunkitProvider/ShowRecentTransactionsContext.d.ts +0 -1
  16. package/dist/components/FunkitProvider/provideFunkitConnectChains.d.ts +1 -1
  17. package/dist/components/FunkitProvider/useCoolMode.d.ts +0 -1
  18. package/dist/components/InfoButton/InfoButton.d.ts +1 -1
  19. package/dist/config/getDefaultConfig.d.ts +510 -510
  20. package/dist/consts/funkit.d.ts +30 -9
  21. package/dist/css/atoms.d.ts +0 -1
  22. package/dist/hooks/useCheckoutAccountBalanceTransfer.d.ts +10 -10
  23. package/dist/hooks/useCheckoutStateBooleans.d.ts +1 -1
  24. package/dist/index.css +3 -3
  25. package/dist/index.d.ts +1 -2
  26. package/dist/index.js +426 -137
  27. package/dist/themes/baseTheme.d.ts +1 -1
  28. package/dist/utils/checkout.d.ts +25 -25
  29. package/dist/utils/flags/config.d.ts +14 -0
  30. package/dist/utils/flags/endpoint.d.ts +22 -0
  31. package/dist/utils/flags/hash.d.ts +13 -0
  32. package/dist/utils/flags/impl.d.ts +26 -0
  33. package/dist/utils/flags/index.d.ts +7 -0
  34. package/dist/utils/flags/types.d.ts +39 -0
  35. package/dist/utils/funLogger.d.ts +7 -1
  36. package/dist/utils/memoize.d.ts +3 -0
  37. package/dist/utils/mesh.d.ts +0 -1
  38. package/dist/wallets/computeWalletConnectMetaData.d.ts +1 -1
  39. package/dist/wallets/walletConnectors/funkitConnectWallet/funkitConnectWallet.js +4 -5
  40. package/dist/wallets/walletConnectors/index.js +55 -55
  41. package/package.json +9 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 1.2.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 048f4aa: feat: add flag connect_sign_in_show_social_label
8
+ - 82d1a77: feat: log more user info to datadog log context
9
+ - 3cd566b: feat: add feature flagging library
10
+ - 3a65cb2: feat: support CANCELLED checkout state
11
+ - 82d1a77: refactor: internal userInfo data model
12
+ - 82d1a77: refactor: register updated funkit userIds to mesh and moonpay transactions
13
+ - Updated dependencies [3a65cb2]
14
+ - Updated dependencies [3a65cb2]
15
+ - Updated dependencies [10819e5]
16
+ - @funkit/api-base@0.0.4
17
+ - @funkit/core@1.0.17
18
+ - @funkit/wagmi-tools@2.0.2
19
+
3
20
  ## 1.2.6
4
21
 
5
22
  ### Patch Changes
@@ -76,11 +76,11 @@ export declare const Box: React.ForwardRefExoticComponent<{
76
76
  paddingX?: "0" | "1" | "10" | "12" | "14" | "16" | "18" | "20" | "2" | "3" | "6" | "24" | "4" | "8" | "28" | "30" | "32" | "36" | "44" | "-1" | "5" | "64" | undefined;
77
77
  paddingY?: "0" | "1" | "10" | "12" | "14" | "16" | "18" | "20" | "2" | "3" | "6" | "24" | "4" | "8" | "28" | "30" | "32" | "36" | "44" | "-1" | "5" | "64" | undefined;
78
78
  } & {
79
- reset?: keyof JSX.IntrinsicElements | undefined;
79
+ reset?: keyof JSX.IntrinsicElements;
80
80
  } & HTMLProperties<HTMLElement> & {
81
- as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
81
+ as?: React.ElementType;
82
82
  className?: ClassValue;
83
- testId?: string | undefined;
83
+ testId?: string;
84
84
  } & React.RefAttributes<HTMLElement>>;
85
85
  export type BoxProps = Parameters<typeof Box>[0];
86
86
  export {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  export declare const CloseButton: ({ "aria-label": ariaLabel, onClose, }: {
3
- 'aria-label'?: string;
3
+ "aria-label"?: string;
4
4
  onClose: () => void;
5
5
  }) => React.JSX.Element;
@@ -6,14 +6,14 @@ import { BoxProps } from '../Box/Box';
6
6
  export declare const FunIconButton: ({ onClick, icon, size, showBorder, paddingX, paddingY, borderRadius, ariaLabel, color, background, width, rotateIconAnimation, }: {
7
7
  onClick: () => void;
8
8
  icon: React.ReactNode;
9
- size?: BoxProps['height'];
10
- paddingX?: BoxProps['paddingX'];
11
- paddingY?: BoxProps['paddingY'];
12
- borderRadius?: BoxProps['borderRadius'];
9
+ size?: BoxProps["height"];
10
+ paddingX?: BoxProps["paddingX"];
11
+ paddingY?: BoxProps["paddingY"];
12
+ borderRadius?: BoxProps["borderRadius"];
13
13
  showBorder?: boolean;
14
14
  ariaLabel?: string;
15
- color?: BoxProps['color'];
16
- background?: BoxProps['background'];
17
- width?: BoxProps['width'];
15
+ color?: BoxProps["color"];
16
+ background?: BoxProps["background"];
17
+ width?: BoxProps["width"];
18
18
  rotateIconAnimation?: boolean;
19
19
  }) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import { CheckoutHistoryItem } from '@funkit/core';
1
+ import { CheckoutHistoryItem } from '@funkit/api-base';
2
2
  import React, { Dispatch, SetStateAction } from 'react';
3
3
  import { HistoryContentPages } from '../../utils/checkoutHistory';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { CheckoutHistoryItem } from '@funkit/core';
1
+ import { CheckoutHistoryItem } from '@funkit/api-base';
2
2
  import React from 'react';
3
3
  import { HistoryContentPages } from '../../utils/checkoutHistory';
4
4
  export declare function FunCheckoutNotification({ checkoutHistoryItem, onSelect, }: {
@@ -1,4 +1,4 @@
1
- import { CheckoutHistoryItem } from '@funkit/core';
1
+ import { CheckoutHistoryItem } from '@funkit/api-base';
2
2
  import React from 'react';
3
3
  export declare function FunTxSummaryHistory({ checkoutHistoryItem, }: {
4
4
  checkoutHistoryItem: CheckoutHistoryItem;
@@ -14,7 +14,7 @@ export declare const defaultAppInfo: {
14
14
  learnMoreUrl: string;
15
15
  };
16
16
  export declare const AppContext: React.Context<{
17
- appName?: string | undefined;
18
- learnMoreUrl?: string | undefined;
19
- disclaimer?: DisclaimerComponent | undefined;
17
+ appName?: string;
18
+ learnMoreUrl?: string;
19
+ disclaimer?: DisclaimerComponent;
20
20
  }>;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const CoolModeContext: import("react").Context<boolean>;
@@ -1,9 +1,4 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- /// <reference types="node" />
4
- /// <reference types="node" />
5
- /// <reference types="node" />
6
- import { CheckoutCoreQuoteResponse, CheckoutHistoryItem } from '@funkit/core';
1
+ import { CheckoutHistoryItem, CheckoutQuoteResponse } from '@funkit/api-base';
7
2
  import React, { ReactNode } from 'react';
8
3
  import { Abi, Address } from 'viem';
9
4
  import { PaymentMethodInfo } from '../../consts/payment';
@@ -56,7 +51,7 @@ export interface FunkitCheckoutConfig {
56
51
  externalCheckoutUserId?: string;
57
52
  }
58
53
  type FunkitCheckoutQuoteResult = {
59
- baseQuote: CheckoutCoreQuoteResponse;
54
+ baseQuote: CheckoutQuoteResponse;
60
55
  finalTimeEstimationMs: number;
61
56
  finalPaymentTokenAmount: string;
62
57
  finalTotalUsd: string;
@@ -1,7 +1,7 @@
1
1
  import React, { ReactNode } from 'react';
2
+ import { FunkitSocialLoginMethod } from '../../consts/funkit';
2
3
  import { PaymentMethod } from '../../consts/payment';
3
4
  import { BoxProps } from '../Box/Box';
4
- import { FunkitSocialLoginMethod } from './FunkitWeb2Provider';
5
5
  export interface FunkitTextCustomizationsConfig {
6
6
  selectPaymentMethod: string;
7
7
  brokerageOrExchange: string;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  export declare const FunkitSandboxContext: import("react").Context<boolean>;
3
2
  export declare const useIsFunkitSandboxMode: () => boolean;
@@ -1,6 +1,6 @@
1
1
  import { OAuthProviderType } from '@privy-io/js-sdk-core';
2
2
  import React, { ReactNode } from 'react';
3
- import { FunkitUserInfo } from '../../consts/funkit';
3
+ import { FunkitUserInfoBase, PrivyLoginMethod } from '../../consts/funkit';
4
4
  export declare const ERROR_MESSAGES: {
5
5
  readonly MISSING_LOGIN_CODES: "Missing login codes";
6
6
  readonly INVALID_LOGIN_METHOD: "Invalid login method";
@@ -44,20 +44,7 @@ interface FunkitWeb2ContextType {
44
44
  isCompleted: boolean;
45
45
  fcMeta: any;
46
46
  }>;
47
- web2AccountInfo: FunkitUserInfo;
48
- }
49
- export declare enum PrivyLoginMethod {
50
- email = "email",
51
- farcaster = "farcaster",
52
- google_oauth = "google_oauth",
53
- twitter_oauth = "twitter_oauth",
54
- apple_oauth = "apple_oauth"
55
- }
56
- export declare enum FunkitSocialLoginMethod {
57
- GOOGLE = "google_oauth",
58
- TWITTER = "twitter_oauth",
59
- APPLE = "apple_oauth",
60
- FARCASTER = "farcaster"
47
+ web2UserInfo: FunkitUserInfoBase;
61
48
  }
62
49
  interface FunkitWeb2ProviderProps {
63
50
  children: ReactNode;
@@ -1,6 +1,6 @@
1
1
  import { Auth, FunWallet } from '@funkit/core';
2
2
  import React from 'react';
3
- import { FinalFunkitUserInfo } from '../../consts/funkit';
3
+ import { FunkitUserInfo } from '../../consts/funkit';
4
4
  import { PaymentMethodInfo } from '../../consts/payment';
5
5
  type GeneralWalletAssets = null | {
6
6
  [x: string]: any;
@@ -11,7 +11,7 @@ interface GeneralWalletContextProps {
11
11
  isUserLoggedIn: boolean;
12
12
  isWeb2Login: boolean;
13
13
  isWeb3Login: boolean;
14
- userInfo: FinalFunkitUserInfo;
14
+ userInfo: FunkitUserInfo;
15
15
  isFetchingAssets: boolean;
16
16
  walletAssets: GeneralWalletAssets;
17
17
  startAssetsListener: () => void;
@@ -45,8 +45,8 @@ export declare const useFunkitAccount: () => {
45
45
  isConnected: boolean;
46
46
  isWeb2Login: boolean;
47
47
  isWeb3Login: boolean;
48
- address: `0x${string}`;
49
- addresses: readonly [`0x${string}`, ...`0x${string}`[]];
48
+ address: import("viem").Address;
49
+ addresses: readonly [import("viem").Address, ...import("viem").Address[]];
50
50
  chain: import("viem").Chain | undefined;
51
51
  chainId: number;
52
52
  connector: import("wagmi").Connector;
@@ -59,8 +59,8 @@ export declare const useFunkitAccount: () => {
59
59
  isConnected: boolean;
60
60
  isWeb2Login: boolean;
61
61
  isWeb3Login: boolean;
62
- address: `0x${string}` | undefined;
63
- addresses: readonly `0x${string}`[] | undefined;
62
+ address: import("viem").Address | undefined;
63
+ addresses: readonly import("viem").Address[] | undefined;
64
64
  chain: import("viem").Chain | undefined;
65
65
  chainId: number | undefined;
66
66
  connector: import("wagmi").Connector | undefined;
@@ -73,8 +73,8 @@ export declare const useFunkitAccount: () => {
73
73
  isConnected: boolean;
74
74
  isWeb2Login: boolean;
75
75
  isWeb3Login: boolean;
76
- address: `0x${string}` | undefined;
77
- addresses: readonly `0x${string}`[] | undefined;
76
+ address: import("viem").Address | undefined;
77
+ addresses: readonly import("viem").Address[] | undefined;
78
78
  chain: import("viem").Chain | undefined;
79
79
  chainId: number | undefined;
80
80
  connector: import("wagmi").Connector | undefined;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ShowRecentTransactionsContext: import("react").Context<boolean>;
@@ -1,7 +1,7 @@
1
1
  import { FunkitConnectChain } from './FunkitConnectChainContext';
2
2
  export declare const chainMetadataById: {
3
3
  [k: string]: {
4
- name?: string | undefined;
4
+ name?: string;
5
5
  iconUrl: () => Promise<string>;
6
6
  iconBackground: string;
7
7
  };
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const useCoolMode: (imageUrl: string | (() => Promise<string>)) => import("react").RefObject<HTMLElement>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  export declare const InfoButton: ({ "aria-label": ariaLabel, onClick, }: {
3
- 'aria-label'?: string;
3
+ "aria-label"?: string;
4
4
  onClick: () => void;
5
5
  }) => React.JSX.Element;