@funkit/connect 1.2.6 → 1.3.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.
Files changed (79) hide show
  1. package/CHANGELOG.md +34 -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 +547 -191
  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 +24 -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 +9 -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/bifrostWallet/bifrostWallet.js +2 -2
  40. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  41. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  42. package/dist/wallets/walletConnectors/chunk-2DWBVWFI.js +87 -0
  43. package/dist/wallets/walletConnectors/chunk-32KBKKGT.js +182 -0
  44. package/dist/wallets/walletConnectors/chunk-3CLNL7LR.js +73 -0
  45. package/dist/wallets/walletConnectors/chunk-5L2OLU3J.js +102 -0
  46. package/dist/wallets/walletConnectors/chunk-7GGRZNT3.js +96 -0
  47. package/dist/wallets/walletConnectors/chunk-7YDZTPO4.js +100 -0
  48. package/dist/wallets/walletConnectors/chunk-BCXBFAL4.js +98 -0
  49. package/dist/wallets/walletConnectors/chunk-CMXZK5RR.js +94 -0
  50. package/dist/wallets/walletConnectors/chunk-F4EJ42XO.js +105 -0
  51. package/dist/wallets/walletConnectors/chunk-FL2VIO76.js +71 -0
  52. package/dist/wallets/walletConnectors/chunk-IIJOJ6AD.js +102 -0
  53. package/dist/wallets/walletConnectors/chunk-KZFAL4RZ.js +27 -0
  54. package/dist/wallets/walletConnectors/chunk-LJRV5JY7.js +95 -0
  55. package/dist/wallets/walletConnectors/chunk-M4SPCKW4.js +66 -0
  56. package/dist/wallets/walletConnectors/chunk-MSRKKVDE.js +98 -0
  57. package/dist/wallets/walletConnectors/chunk-NK3DYIAB.js +92 -0
  58. package/dist/wallets/walletConnectors/chunk-OMKARG6Y.js +94 -0
  59. package/dist/wallets/walletConnectors/chunk-R5GNFRXW.js +96 -0
  60. package/dist/wallets/walletConnectors/chunk-XB2GFXBL.js +107 -0
  61. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  62. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  63. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  64. package/dist/wallets/walletConnectors/dawnWallet/dawnWallet.js +2 -2
  65. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  66. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  67. package/dist/wallets/walletConnectors/funkitConnectWallet/funkitConnectWallet.js +4 -5
  68. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  69. package/dist/wallets/walletConnectors/index.js +72 -72
  70. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  71. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  72. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  73. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  74. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  75. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  76. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  77. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  78. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  79. package/package.json +11 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 1.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6c315a2: feat: enable checkout transfers
8
+
9
+ ### Patch Changes
10
+
11
+ - 5f70055: refactor: switch over to userId-based checkout apis
12
+ - 70d3eb8: fix: quote gas estimation error fallback
13
+ - 8e6f93f: feat: add flags select_payment_method_text, payment_method_copy_v1
14
+ - Updated dependencies [5f70055]
15
+ - Updated dependencies [5f70055]
16
+ - @funkit/api-base@0.0.5
17
+ - @funkit/core@1.0.18
18
+ - @funkit/wagmi-tools@2.0.3
19
+
20
+ ## 1.2.7
21
+
22
+ ### Patch Changes
23
+
24
+ - 048f4aa: feat: add flag connect_sign_in_show_social_label
25
+ - 82d1a77: feat: log more user info to datadog log context
26
+ - 3cd566b: feat: add feature flagging library
27
+ - 3a65cb2: feat: support CANCELLED checkout state
28
+ - 82d1a77: refactor: internal userInfo data model
29
+ - 82d1a77: refactor: register updated funkit userIds to mesh and moonpay transactions
30
+ - Updated dependencies [3a65cb2]
31
+ - Updated dependencies [3a65cb2]
32
+ - Updated dependencies [10819e5]
33
+ - @funkit/api-base@0.0.4
34
+ - @funkit/core@1.0.17
35
+ - @funkit/wagmi-tools@2.0.2
36
+
3
37
  ## 1.2.6
4
38
 
5
39
  ### 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;