@funkit/connect 1.0.27 → 1.1.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 (40) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/components/FunPayments/FunPaymentOtcType.d.ts +4 -0
  3. package/dist/components/FunkitProvider/FunkitCheckoutContext.d.ts +2 -0
  4. package/dist/components/FunkitProvider/FunkitConfigContext.d.ts +14 -1
  5. package/dist/components/FunkitProvider/FunkitConnectChainContext.d.ts +1 -1
  6. package/dist/components/FunkitProvider/FunkitProvider.d.ts +6 -5
  7. package/dist/components/ProfileDetails/ProfileDetails.d.ts +2 -4
  8. package/dist/config/getDefaultConfig.d.ts +7 -10
  9. package/dist/consts/payment.d.ts +3 -1
  10. package/dist/index.css +17 -17
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.js +1562 -2181
  13. package/dist/utils/checkout.d.ts +1 -1
  14. package/dist/utils/funkitProvider.d.ts +1 -2
  15. package/dist/wallets/walletConnectors/index.js +55 -55
  16. package/package.json +3 -3
  17. package/dist/components/FunOnramp/FunOnrampConfirmationStep.d.ts +0 -18
  18. package/dist/components/FunOnramp/FunOnrampInputStep.d.ts +0 -10
  19. package/dist/components/FunOnramp/FunOnrampPrimaryItem.d.ts +0 -5
  20. package/dist/components/FunOnramp/FunOnrampProcessingStep.d.ts +0 -6
  21. package/dist/components/FunOnramp/FunOnrampTokenPill.d.ts +0 -7
  22. package/dist/components/ProfileDetails/FunProfileViews/Deposit/Deposit.d.ts +0 -9
  23. package/dist/wallets/walletConnectors/chunk-2B3SPBRY.js +0 -100
  24. package/dist/wallets/walletConnectors/chunk-2GAW2UBU.js +0 -102
  25. package/dist/wallets/walletConnectors/chunk-7KDOXASH.js +0 -95
  26. package/dist/wallets/walletConnectors/chunk-CRSPGVPF.js +0 -105
  27. package/dist/wallets/walletConnectors/chunk-CUKVUCIP.js +0 -98
  28. package/dist/wallets/walletConnectors/chunk-DV3SI63E.js +0 -96
  29. package/dist/wallets/walletConnectors/chunk-GW6EF4G2.js +0 -92
  30. package/dist/wallets/walletConnectors/chunk-HD5VYJNC.js +0 -98
  31. package/dist/wallets/walletConnectors/chunk-IBWFKX7P.js +0 -94
  32. package/dist/wallets/walletConnectors/chunk-KGTZ6E7L.js +0 -71
  33. package/dist/wallets/walletConnectors/chunk-OKWOB3DN.js +0 -66
  34. package/dist/wallets/walletConnectors/chunk-RCWZ4KBR.js +0 -73
  35. package/dist/wallets/walletConnectors/chunk-RTW6PVQI.js +0 -107
  36. package/dist/wallets/walletConnectors/chunk-T6JVHES7.js +0 -87
  37. package/dist/wallets/walletConnectors/chunk-VSZ7PAHS.js +0 -94
  38. package/dist/wallets/walletConnectors/chunk-XNNLZXHE.js +0 -102
  39. package/dist/wallets/walletConnectors/chunk-XRMAVTK7.js +0 -178
  40. package/dist/wallets/walletConnectors/chunk-Z2HIQYVN.js +0 -96
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - dbf6465: feat: support optional wagmiConfig and queryClient in FunkitProvider
8
+
9
+ ### Patch Changes
10
+
11
+ - dbf6465: fix: getDefaultTransports export
12
+ - 3327678: feat: custom otc payment method config
13
+ - ec2761e: refactor: deprecate standalone onramp flow
14
+ - Updated dependencies [dbf6465]
15
+ - @funkit/core@1.0.12
16
+ - @funkit/wagmi-tools@1.0.14
17
+
18
+ ## 1.0.28
19
+
20
+ ### Patch Changes
21
+
22
+ - c27a0bd: fix: deprecate wagmi/connectors, fix checkout input
23
+ - Updated dependencies [c27a0bd]
24
+ - @funkit/wagmi-tools@1.0.13
25
+
3
26
  ## 1.0.27
4
27
 
5
28
  ### Patch Changes
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare function FunPaymentOtcType({ backAnimation, }: {
3
+ backAnimation?: boolean;
4
+ }): React.JSX.Element;
@@ -86,6 +86,8 @@ interface useFunkitCheckoutProps {
86
86
  onError?: (result: FunkitCheckoutResult) => void;
87
87
  /** @optional fires if the checkout fails at any point **/
88
88
  onSuccess?: (result: FunkitCheckoutResult) => void;
89
+ /** @optional fires if the checkout requires an active wallet connection. If not specified, defaults to funkit wallet connection. */
90
+ onLoginRequired?: () => void;
89
91
  }
90
92
  type useFunkitCheckoutPropsFinal = Omit<useFunkitCheckoutProps, 'config'> & {
91
93
  config: FunkitCheckoutConfig;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { ReactNode } from 'react';
2
2
  import { PaymentMethod } from '../../consts/payment';
3
3
  import { BoxProps } from '../Box/Box';
4
4
  import { FunkitSocialLoginMethod } from './FunkitWeb2Provider';
@@ -11,6 +11,7 @@ export interface FunkitTextCustomizationsConfig {
11
11
  selectAccount: string;
12
12
  enterPaymentInfo: string;
13
13
  payWith: string;
14
+ otc: string;
14
15
  }
15
16
  export declare const DEFAULT_TEXT_CUSTOMIZATIONS: FunkitTextCustomizationsConfig;
16
17
  export declare const DEFAULT_PRIVY_APP_ID = "clnatprpv00sfmi0fv3qc185b";
@@ -39,6 +40,18 @@ interface FunkitPaymentsConfig {
39
40
  allowBrokerageUnlinking?: boolean;
40
41
  /** Max width of the title of each payment method **/
41
42
  paymentTitleMaxWidth?: BoxProps['maxWidth'];
43
+ /** Custom OTC option with redirect links **/
44
+ otcConfig?: {
45
+ isEnabled: boolean;
46
+ title: string;
47
+ optionsList: {
48
+ label: string;
49
+ labelIcon: ReactNode;
50
+ url: string;
51
+ isDisabled: boolean;
52
+ tagLabel: string;
53
+ }[];
54
+ };
42
55
  }
43
56
  export type FunkitConfig = {
44
57
  /** Funkit api key **/
@@ -5,7 +5,7 @@ export interface FunkitConnectChain extends Chain {
5
5
  iconBackground?: string;
6
6
  }
7
7
  interface FunkitConnectChainProviderProps {
8
- initialChain: number;
8
+ initialChain?: number;
9
9
  children: ReactNode;
10
10
  }
11
11
  export declare function FunkitConnectChainProvider({ children, initialChain, }: FunkitConnectChainProviderProps): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { QueryClient } from '@tanstack/react-query';
2
2
  import React, { ReactNode } from 'react';
3
3
  import type { Chain } from 'wagmi/chains';
4
- import { GetDefaultConfigParameters } from '../../config/getDefaultConfig';
4
+ import { CreateFunkitWagmiConfigParameters } from '../../config/getDefaultConfig';
5
5
  import { ThemeVars } from '../../css/sprinkles.css';
6
6
  import { Locale } from '../../locales';
7
7
  import { DisclaimerComponent } from './AppContext';
@@ -15,7 +15,7 @@ export type Theme = ThemeVars | {
15
15
  darkMode: ThemeVars;
16
16
  };
17
17
  interface FunkitProviderInnerProps {
18
- initialChain: number;
18
+ initialChain?: number;
19
19
  id?: string;
20
20
  children: ReactNode;
21
21
  theme?: Theme;
@@ -30,13 +30,14 @@ interface FunkitProviderInnerProps {
30
30
  debug?: boolean | undefined;
31
31
  sandbox?: boolean | undefined;
32
32
  }
33
- export type FunkitWagmiConfig = Omit<GetDefaultConfigParameters, 'funkitApiKey' | 'initialChainId' | 'chains'> & {
33
+ export type FunkitWagmiConfig = Omit<CreateFunkitWagmiConfigParameters, 'funkitApiKey' | 'initialChainId' | 'chains' | 'appName'> & {
34
34
  chains: Chain[];
35
+ projectId: string;
35
36
  };
36
37
  export interface FunkitProviderProps extends Omit<FunkitProviderInnerProps, 'initialChain'> {
37
38
  initialChain?: Chain | number;
38
- wagmiConfig: FunkitWagmiConfig;
39
- queryClient: QueryClient;
39
+ wagmiConfig?: FunkitWagmiConfig;
40
+ queryClient?: QueryClient;
40
41
  }
41
42
  export declare function FunkitProvider(props: FunkitProviderProps): React.JSX.Element;
42
43
  export {};
@@ -3,13 +3,11 @@ export declare enum FunProfileView {
3
3
  HOME = 0,
4
4
  SETTINGS = 1,
5
5
  ACTIVITY = 2,
6
- SINGLE_ACTIVITY = 3,
7
- DEPOSIT = 4
6
+ SINGLE_ACTIVITY = 3
8
7
  }
9
8
  interface ProfileDetailsProps {
10
9
  onClose: () => void;
11
- onSoftHide: (p: boolean) => void;
12
10
  onDisconnect: () => void;
13
11
  }
14
- export declare function ProfileDetails({ onClose, onSoftHide, onDisconnect, }: ProfileDetailsProps): React.JSX.Element;
12
+ export declare function ProfileDetails({ onClose, onDisconnect }: ProfileDetailsProps): React.JSX.Element;
15
13
  export {};
@@ -1,25 +1,22 @@
1
- import { Transport } from 'viem';
1
+ import { Chain, Transport } from 'viem';
2
2
  import { CreateConfigParameters } from 'wagmi';
3
- import { WagmiProviderProps } from 'wagmi';
4
3
  import { type FunkitConnectChain } from '../components/FunkitProvider/FunkitConnectChainContext';
5
4
  import type { WalletList } from '../wallets/Wallet';
6
5
  export type _chains = readonly [FunkitConnectChain, ...FunkitConnectChain[]];
7
6
  export type _transports = Record<_chains[number]['id'], Transport>;
8
- type WagmiConfigParameters = Omit<CreateConfigParameters<_chains, _transports>, 'client' | 'connectors'>;
9
- export interface GetDefaultConfigParameters extends WagmiConfigParameters {
7
+ type WagmiConfigParameters = Omit<CreateConfigParameters<_chains, _transports>, 'client'>;
8
+ export interface CreateFunkitWagmiConfigParameters extends Omit<WagmiConfigParameters, 'chains'> {
10
9
  appName: string;
11
10
  appDescription?: string;
12
11
  appUrl?: string;
13
12
  appIcon?: string;
14
13
  wallets?: WalletList;
15
14
  projectId: string;
15
+ chains: Chain[] | [Chain, ...Chain[]];
16
16
  funkitApiKey: string;
17
- initialChainId: string;
17
+ initialChainId: string | number;
18
18
  }
19
- /**
20
- * Get the default wagmi config
21
- */
22
- export declare const getDefaultConfig: ({ appName, appDescription, appUrl, appIcon, wallets, projectId, funkitApiKey, initialChainId, ...wagmiParameters }: GetDefaultConfigParameters) => WagmiProviderProps['config'];
19
+ export declare const createFunkitWagmiConfig: (rawWagmiConfig: CreateFunkitWagmiConfigParameters) => import("wagmi").Config;
23
20
  /**
24
21
  * Get default funkit-supported checkout chains
25
22
  */
@@ -3665,5 +3662,5 @@ export declare const getDefaultChains: () => ({
3665
3662
  /**
3666
3663
  * Get the default transports record for each default chain
3667
3664
  */
3668
- export declare const getDefaultTransports: () => Record<string, string>;
3665
+ export declare const getDefaultTransports: () => _transports;
3669
3666
  export {};
@@ -13,7 +13,9 @@ export declare enum PaymentMethod {
13
13
  /** Account Balance **/
14
14
  ACCOUNT_BALANCE = "balance",
15
15
  /** Mesh - Exchange / Brokerage **/
16
- BROKERAGE = "brokerage"
16
+ BROKERAGE = "brokerage",
17
+ /** OTC - Custom option, primary off */
18
+ OTC = "otc"
17
19
  }
18
20
  /** Full payment method information used in frontend during payment flows. **/
19
21
  export interface PaymentMethodInfo {
package/dist/index.css CHANGED
@@ -4754,23 +4754,6 @@ input[type=number] {
4754
4754
  display: none;
4755
4755
  }
4756
4756
 
4757
- /* src/components/FunTransactionSummary/FunTransactionSummary.css */
4758
- .fun-container-content-expanded {
4759
- transition: all 0.5s ease-in-out;
4760
- max-height: 200px;
4761
- overflow: hidden;
4762
- }
4763
- .fun-container-content-collapsed {
4764
- max-height: 0px;
4765
- transition: all 0.4s ease-out;
4766
- overflow: hidden;
4767
- }
4768
-
4769
- /* vanilla-extract-css-ns:src/components/FunPayments/FunPaymentMoonpayType.css.ts.vanilla.css?source=Ll8xa21wZXlmMCBpZnJhbWUgewogIGJvcmRlcjogbm9uZTsKfQ== */
4770
- [data-rk] ._1kmpeyf0 iframe {
4771
- border: none;
4772
- }
4773
-
4774
4757
  /* vanilla-extract-css-ns:src/components/SkeletalLoader/SkeletalLoader.css.ts.vanilla.css?source=QGtleWZyYW1lcyBhaG55YjEwIHsKICAwJSB7CiAgICBvcGFjaXR5OiAwLjY7CiAgICB0cmFuc2Zvcm06IHNjYWxlKDEpOwogIH0KICA1MCUgewogICAgb3BhY2l0eTogMTsKICAgIHRyYW5zZm9ybTogc2NhbGUoMSwgMS4wMSk7CiAgfQogIDEwMCUgewogICAgb3BhY2l0eTogMC40OwogICAgdHJhbnNmb3JtOiBzY2FsZSgxKTsKICB9Cn0KLmFobnliMTEgewogIGFuaW1hdGlvbjogYWhueWIxMCAxcyBpbmZpbml0ZTsKfQ== */
4775
4758
  @keyframes ahnyb10 {
4776
4759
  0% {
@@ -4937,6 +4920,23 @@ input[type=number] {
4937
4920
  overflow-y: auto;
4938
4921
  }
4939
4922
 
4923
+ /* vanilla-extract-css-ns:src/components/FunPayments/FunPaymentMoonpayType.css.ts.vanilla.css?source=Ll8xa21wZXlmMCBpZnJhbWUgewogIGJvcmRlcjogbm9uZTsKfQ== */
4924
+ [data-rk] ._1kmpeyf0 iframe {
4925
+ border: none;
4926
+ }
4927
+
4928
+ /* src/components/FunTransactionSummary/FunTransactionSummary.css */
4929
+ .fun-container-content-expanded {
4930
+ transition: all 0.5s ease-in-out;
4931
+ max-height: 200px;
4932
+ overflow: hidden;
4933
+ }
4934
+ .fun-container-content-collapsed {
4935
+ max-height: 0px;
4936
+ transition: all 0.4s ease-out;
4937
+ overflow: hidden;
4938
+ }
4939
+
4940
4940
  /* vanilla-extract-css-ns:src/components/WalletButton/WalletButton.css.ts.vanilla.css?source=Ll84NXMxMXIwIHsKICBib3JkZXI6IDFweCBzb2xpZCByZ2JhKDE2LCAyMSwgMzEsIDAuMDYpOwp9Ci5fODVzMTFyMSB7CiAgbWF4LXdpZHRoOiBmaXQtY29udGVudDsKfQ== */
4941
4941
  [data-rk] ._85s11r0 {
4942
4942
  border: 1px solid rgba(16, 21, 31, 0.06);
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export { FunkitProvider } from './components/FunkitProvider/FunkitProvider';
5
5
  export { useActiveTheme } from './components/FunkitProvider/FunkitThemeProvider';
6
6
  export { FunkitSocialLoginMethod } from './components/FunkitProvider/FunkitWeb2Provider';
7
7
  export { WalletButton } from './components/WalletButton/WalletButton';
8
- export { getDefaultChains, getDefaultTransports, } from './config/getDefaultConfig';
8
+ export { createFunkitWagmiConfig, getDefaultChains, getDefaultTransports, } from './config/getDefaultConfig';
9
9
  export { getDefaultWallets } from './wallets/getDefaultWallets';
10
10
  export { __private__ } from './__private__';
11
11
  export type { DisclaimerComponent } from './components/FunkitProvider/AppContext';