@funkit/connect 6.0.1 → 6.0.2

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 (32) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/components/Dialog/hooks.d.ts +11 -0
  3. package/dist/components/FunInfoBanner/InfoBanner.d.ts +2 -2
  4. package/dist/components/FunPayments/FunPaymentMethods.d.ts +2 -11
  5. package/dist/consts/customers.d.ts +0 -1
  6. package/dist/domains/fees.d.ts +2 -3
  7. package/dist/domains/meld.d.ts +4 -3
  8. package/dist/domains/paymentMethods.d.ts +1 -8
  9. package/dist/domains/quote.d.ts +2 -3
  10. package/dist/hooks/usePaymentSources.d.ts +0 -1
  11. package/dist/index.css +14 -22
  12. package/dist/index.js +2971 -4962
  13. package/dist/modals/CheckoutModal/InputAmount/InputAmount.d.ts +0 -1
  14. package/dist/modals/CheckoutModal/InputAmount/InputAmountLoading.d.ts +1 -1
  15. package/dist/modals/CheckoutModal/LoadingAccount.d.ts +0 -1
  16. package/dist/modals/CheckoutModal/SelectAsset.d.ts +0 -1
  17. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +2 -7
  18. package/dist/modals/CheckoutModal/TransferToken/TransferToken.d.ts +0 -1
  19. package/dist/modals/CheckoutModal/VirtualFiatAccount/FiatAccountDetail.d.ts +0 -1
  20. package/dist/modals/CheckoutModal/stepTransition.d.ts +0 -12
  21. package/dist/modals/CheckoutModal/useSourceAssetConfirm.d.ts +1 -3
  22. package/dist/providers/FunkitConfigContext.d.ts +2 -0
  23. package/dist/providers/FunkitMeshProvider.d.ts +1 -19
  24. package/dist/utils/flags/impl.d.ts +1 -0
  25. package/dist/utils/flags/types.d.ts +3 -2
  26. package/dist/wallets/walletConnectors/index.js +42 -42
  27. package/package.json +5 -5
  28. package/dist/components/Icons/EtherFiIcon.d.ts +0 -4
  29. package/dist/hooks/useMesh.d.ts +0 -19
  30. package/dist/modals/CheckoutModal/ConnectExchange.d.ts +0 -12
  31. package/dist/modals/CheckoutModal/MeshVerification.d.ts +0 -17
  32. package/dist/modals/CheckoutModal/SelectBrokerage.d.ts +0 -14
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 6.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 3de98c8: add ipLocation feature flag
8
+ - 9069cc7: hyperbeat dark theme border set
9
+ - e45077e: fix(connect): bug fix on tooltip
10
+ - a31784b: show loading when user switches
11
+ - 11d8dec: feat(connect): fix Safari popup issue by opening window immediately and setting URL async
12
+ - a979dd1: feat(connect): adjust Katana High Cost banner
13
+ - 2dd4ee5: feat(connect): adjust auto-picking of meld provider quotes based on amount relation
14
+ - f4e5d31: remove new user logic
15
+ - a7e8276: Remove obsolete EtherFi API key and integration components
16
+
17
+ This removes all EtherFi-related code including API keys, theme components, customer functions, and UI customizations. The EtherFi integration was marked as obsolete and has been completely removed from the codebase.
18
+
19
+ **Breaking Changes:**
20
+
21
+ - Removed `ETHERFI_API_KEY` constant from `@funkit/api-base`
22
+ - Removed `isEtherFiCustomer` function from `@funkit/connect`
23
+ - Removed `EtherFiIcon` component from `@funkit/connect`
24
+ - Removed EtherFi theme and configuration options
25
+ - Cleaned up EtherFi-specific UI logic from checkout modals
26
+
27
+ - 2bcc68e: preferDestinationWhenSame: when source and destination are the same address, show destination as payment method instead of source
28
+ - a27a6e8: feat(connect): adjust modal bottom padding for Hyperbeat
29
+ - ceb2b3a: fix(connect): inaccurate total time estimate
30
+ - Updated dependencies [f5db915]
31
+ - Updated dependencies [a7e8276]
32
+ - @funkit/chains@0.3.7
33
+ - @funkit/api-base@1.9.11
34
+ - @funkit/core@2.3.35
35
+ - @funkit/wagmi-tools@3.0.57
36
+
3
37
  ## 6.0.0
4
38
 
5
39
  ### Major Changes
@@ -1,9 +1,20 @@
1
+ export declare const MODAL_BOTTOM_BAR_WRAPPER_ID = "fun-modal-bottom-bar-wrapper";
1
2
  export declare const MODAL_BOTTOM_BAR_IDS: {
2
3
  readonly checkout: "checkout-modal-bottom-bar";
3
4
  readonly withdrawal: "withdrawal-modal-bottom-bar";
4
5
  };
6
+ export declare const MODAL_DIVIDER_ID = "fun-modal-divider";
5
7
  type ModalBottomBarIdType = keyof typeof MODAL_BOTTOM_BAR_IDS;
6
8
  export declare function useBottomSectionRef(modalBottomBarIdType?: ModalBottomBarIdType): HTMLElement | null;
7
9
  export declare const CHECKOUT_MODAL_TITLE_COUNTDOWN_ID = "checkout-modal-title-countdown";
8
10
  export declare function useTitleCountdownRef(): HTMLElement | null;
11
+ export declare function useGeneralBottomBarElement(): HTMLElement | null;
12
+ export declare function useCheckoutBottomBarElement(): HTMLElement | null;
13
+ export declare function useWithdrawalBottomBarElement(): HTMLElement | null;
14
+ /**
15
+ * Hook to observe if a ref's children are empty, with special handling for bottom bar nodes.
16
+ * @param ref - React ref to the DOM node to observe
17
+ * @param setHasNoChildren - Setter to update if the node has no children
18
+ */
19
+ export declare function useBottomBarHasNoChildren(): boolean;
9
20
  export {};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export type InfoBannerProps = {
3
- /** Contents of the banner, supports HTML markup for more structured announcements (eg. link to a blogpost) */
4
- message: string;
3
+ /** Contents of the banner, supports HTML markup for more structured announcements (eg. link to a blogpost) or a `ReactNode` for more complex content with React components */
4
+ message: string | React.ReactNode;
5
5
  type: 'warning' | 'alert' | 'announcement';
6
6
  expireAtMs?: number;
7
7
  };
@@ -1,19 +1,10 @@
1
1
  import React, { type ReactNode } from 'react';
2
- import { PaymentMethod, type PaymentMethodBrokerageInfo, type PaymentMethodVirtualBankInfo } from '../../domains/paymentMethods';
2
+ import { PaymentMethod, type PaymentMethodVirtualBankInfo } from '../../domains/paymentMethods';
3
3
  export declare const getDynamicValueIconComponent: () => React.JSX.Element;
4
4
  export declare function PaymentMethodIcon({ paymentIcon, keyIconSize, }: {
5
5
  paymentIcon: ReactNode;
6
6
  keyIconSize: number;
7
7
  }): React.JSX.Element;
8
- interface ConnectedMeshPaymentMethodItemProps extends ConnectedPaymentMethodItemProps {
9
- paymentMethodInfo: PaymentMethodBrokerageInfo;
10
- onBrokerageError?: () => void;
11
- }
12
- /** it is different from BrokeragePaymentMethodItem
13
- * this component is for connected mesh brokerage like robinhood
14
- * the other one is for connecting new brokerage button
15
- * */
16
- export declare const ConnectedMeshPaymentMethodItem: ({ paymentMethodInfo, isSelected, onSelect, onBrokerageError, targetChainId, showSelectedCheckmark, }: ConnectedMeshPaymentMethodItemProps) => React.JSX.Element;
17
8
  interface ConnectedPaymentMethodItemProps {
18
9
  isSelected: boolean;
19
10
  showSelectedCheckmark?: boolean;
@@ -33,5 +24,5 @@ type BasePaymentMethodItemProps = {
33
24
  export declare function AddPaymentMethodItem({ paymentMethod, isClickable, isActive, onClick, customValueIcon, }: BasePaymentMethodItemProps & {
34
25
  paymentMethod: PaymentMethod;
35
26
  dynamicLimit?: string;
36
- }): React.JSX.Element | undefined;
27
+ }): React.JSX.Element | null | undefined;
37
28
  export {};
@@ -5,5 +5,4 @@ export declare function isBankrCustomer(apiKey: string): apiKey is "vWe20Dfyui2o
5
5
  export declare function isBsxCustomer(apiKey: string): apiKey is "zN1zrkmLQn4oZtLUW9Qt02uuBI3Jvrgj8Ni40Gf1";
6
6
  export declare function isEtherealCustomer(apiKey: string): apiKey is "M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um";
7
7
  export declare function isKatanaCustomer(apiKey: string): apiKey is "OXLUmejkh9PlNDS4gSvi9gcEWacOpTz2KUVepVf4";
8
- export declare function isEtherFiCustomer(apiKey: string): apiKey is "GyJMyQ3juDarKooebGRu16Ncogwhm59h2DIjCu1p";
9
8
  export declare function isHyperbeatCustomer(apiKey: string): apiKey is "lUzTaIRxs95iin3pCAafB1ChA5akBiuQ1tjhXnau";
@@ -1,4 +1,4 @@
1
- import { type CheckoutQuoteResponse } from '@funkit/utils';
1
+ import type { CheckoutQuoteResponse } from '@funkit/utils';
2
2
  import type { Config } from 'wagmi';
3
3
  import { LoginType } from '~/providers/GeneralWalletProvider';
4
4
  import type { FunkitActiveCheckoutItem } from '../providers/FunkitCheckoutContext';
@@ -48,8 +48,7 @@ interface EvaluateFeeBreakdownItem {
48
48
  loginType: LoginType;
49
49
  isWithdrawal?: boolean;
50
50
  }
51
- export declare function evaluateFeeBreakdown(evalItem: EvaluateFeeBreakdownItem, enableFrogProxyServer?: boolean): Promise<{
51
+ export declare function evaluateFeeBreakdown(evalItem: EvaluateFeeBreakdownItem): Promise<{
52
52
  fees: CheckoutFees;
53
- brokerage?: BrokerageDetails;
54
53
  }>;
55
54
  export {};
@@ -1,10 +1,11 @@
1
1
  import { type MeldQuote } from '@funkit/api-base';
2
2
  /**
3
3
  * Auto-pick the best quote for the user.
4
- * 1. Pick the quote with the highest customerScore, at least >= 30
4
+ * 1. If a quote has a customerScore >= 30, pick it
5
5
  * 2. If no quote has customerScore >= 30, pick either Coinbase or Binance
6
- * 2a. If both are available, pick the one with the highest destinationAmount
7
- * 2b. If only one is available, pick it
6
+ * 2a. If both are available and they are at least 96% of the highest destinationAmount, pick the one with the best customerScore
7
+ * 2aa. If they're have the same customerScore, pick the one with the highest destinationAmount
8
+ * 2b. If both are available and they are less than 96% of the highest destinationAmount, pick the one with the highest destinationAmount
8
9
  * 3. If no quote has customerScore >= 30 and no Coinbase or Binance is available, pick the quote with the highest destinationAmount
9
10
  * @param quotes - the quotes to pick from
10
11
  * @returns the best quote based on the criteria
@@ -1,4 +1,4 @@
1
- import type { BridgeCustomer, BridgeVirtualBankAccount, PreviewTransferResult } from '@funkit/api-base';
1
+ import type { BridgeCustomer, BridgeVirtualBankAccount } from '@funkit/api-base';
2
2
  import type { MeshConnectionInfo } from '~/providers/FunkitMeshProvider';
3
3
  /** Supported payment methods in FunkitConnect. **/
4
4
  export declare enum PaymentMethod {
@@ -11,12 +11,6 @@ export declare enum PaymentMethod {
11
11
  TOKEN_TRANSFER = "token_transfer",
12
12
  VIRTUAL_BANK = "virtual_bank"
13
13
  }
14
- type MeshMeta = MeshConnectionInfo & {
15
- networkId?: string;
16
- previewResult?: PreviewTransferResult & {
17
- previewExpiresAt: number;
18
- };
19
- };
20
14
  /** Full payment method information used in frontend during payment flows. **/
21
15
  interface PaymentMethodInfoBase {
22
16
  description: string;
@@ -28,7 +22,6 @@ export interface PaymentMethodCardInfo extends PaymentMethodInfoBase {
28
22
  }
29
23
  export interface PaymentMethodBrokerageInfo extends PaymentMethodInfoBase {
30
24
  paymentMethod: PaymentMethod.BROKERAGE;
31
- meta: MeshMeta;
32
25
  }
33
26
  export interface PaymentMethodAccountInfo extends PaymentMethodInfoBase {
34
27
  paymentMethod: PaymentMethod.ACCOUNT_BALANCE;
@@ -11,7 +11,7 @@ export interface FunkitCheckoutQuoteResult extends Omit<ApiFunkitCheckoutQuoteRe
11
11
  finalFeesBreakdown: CheckoutFees;
12
12
  }
13
13
  export declare function getCheckoutBaseQuote(checkoutItem: FunkitActiveCheckoutItem, userId: string, walletAddress: Address, apiKey: string, sponsorInitialTransferGasLimit: number, wagmiConfig: Config, directExecutionInfo: FunkitDirectExecutionInfo, senderAddress?: Address, isWithdrawal?: boolean): Promise<CheckoutQuoteResponse>;
14
- export declare function getQuoteFinalEstimation(baseQuote: CheckoutQuoteResponse, checkoutItem: FunkitActiveCheckoutItem, newPaymentMethodInfo: PaymentMethodInfo, wagmiConfig: Config, apiKey: string, loginType: LoginType, enableFrogProxyServer?: boolean, isWithdrawal?: boolean): Promise<{
14
+ export declare function getQuoteFinalEstimation(baseQuote: CheckoutQuoteResponse, checkoutItem: FunkitActiveCheckoutItem, newPaymentMethodInfo: PaymentMethodInfo, wagmiConfig: Config, apiKey: string, loginType: LoginType, isWithdrawal?: boolean): Promise<{
15
15
  finalEstimation: FunkitCheckoutQuoteResult;
16
16
  brokerage?: BrokerageDetails;
17
17
  }>;
@@ -31,7 +31,6 @@ export interface CheckoutQuoteParams {
31
31
  newPaymentMethodInfo: PaymentMethodInfo;
32
32
  wagmiConfig: Config;
33
33
  loginType: LoginType;
34
- enableFrogProxyServer?: boolean;
35
34
  directExecutionInfo: FunkitDirectExecutionInfo;
36
35
  /** when sender address is different from wallet address
37
36
  * this happens when withdrawing from a different wallet
@@ -39,7 +38,7 @@ export interface CheckoutQuoteParams {
39
38
  senderAddress?: Address;
40
39
  isWithdrawal?: boolean;
41
40
  }
42
- export declare function getQuoteAndEstimation({ checkoutItem, userId, walletAddress, apiKey, sponsorInitialTransferGasLimit, newPaymentMethodInfo, wagmiConfig, loginType, enableFrogProxyServer, directExecutionInfo, senderAddress, isWithdrawal, }: CheckoutQuoteParams): Promise<{
41
+ export declare function getQuoteAndEstimation({ checkoutItem, userId, walletAddress, apiKey, sponsorInitialTransferGasLimit, newPaymentMethodInfo, wagmiConfig, loginType, directExecutionInfo, senderAddress, isWithdrawal, }: CheckoutQuoteParams): Promise<{
43
42
  baseQuote: CheckoutQuoteResponse;
44
43
  checkedAssetAmount: CheckedAssetAmount;
45
44
  finalEstimation: FunkitCheckoutQuoteResult;
@@ -5,7 +5,6 @@ export declare function usePaymentMethodEnablement({ checkoutConfig, }: {
5
5
  }): {
6
6
  isFiatEnabled: boolean;
7
7
  isTokenTransferEnabled: boolean;
8
- isBrokerageEnabled: boolean;
9
8
  isCardEnabled: boolean;
10
9
  };
11
10
  export declare const usePaymentSources: (paymentMethodInfo: ConnectablePaymentMethodInfo | null, targetChainId: string, checkoutConfig?: FunkitCheckoutConfig) => {
package/dist/index.css CHANGED
@@ -8990,14 +8990,6 @@
8990
8990
  opacity: 0;
8991
8991
  }
8992
8992
 
8993
- /* vanilla-extract-css-ns:src/components/FunSelectBrokerage/FunBrokerageItem.css.ts.vanilla.css?source=LmFuMzR5OTAgewogIGRpc3BsYXk6IGZsZXg7CiAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuOwogIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAgZmxleDogMTsKfQ== */
8994
- [data-rk] .an34y90 {
8995
- display: flex;
8996
- justify-content: space-between;
8997
- align-items: center;
8998
- flex: 1;
8999
- }
9000
-
9001
8993
  /* vanilla-extract-css-ns:src/components/FunOptionBox/FunOptionBox.css.ts.vanilla.css?source=Ll8xcmZjbHVoMCB7CiAgb3V0bGluZTogbm9uZTsKICB0cmFuc2l0aW9uOiBhbGwgMTUwbXMgY3ViaWMtYmV6aWVyKDAuMywgMCwgMC4wNiwgMSk7Cn0KLl8xcmZjbHVoMDpmb2N1cyB7CiAgb3V0bGluZTogbm9uZTsKfQ== */
9002
8994
  [data-rk] ._1rfcluh0 {
9003
8995
  outline: none;
@@ -9196,6 +9188,20 @@
9196
9188
  overflow-x: hidden;
9197
9189
  }
9198
9190
 
9191
+ /* vanilla-extract-css-ns:src/components/FunPayments/FunPaymentMoonpayType.css.ts.vanilla.css?source=Ll8xa21wZXlmMCB7CiAgaGVpZ2h0OiB1bnNldCAhaW1wb3J0YW50OwogIHdpZHRoOiB1bnNldCAhaW1wb3J0YW50OwogIGZsZXg6IDEgIWltcG9ydGFudDsKfQouXzFrbXBleWYwIGlmcmFtZSB7CiAgYm9yZGVyOiBub25lOwp9Ci5fMWttcGV5ZjEgewogIGRpc3BsYXk6IGZsZXg7CiAgZmxleDogMTsKfQ== */
9192
+ [data-rk] ._1kmpeyf0 {
9193
+ height: unset !important;
9194
+ width: unset !important;
9195
+ flex: 1 !important;
9196
+ }
9197
+ [data-rk] ._1kmpeyf0 iframe {
9198
+ border: none;
9199
+ }
9200
+ [data-rk] ._1kmpeyf1 {
9201
+ display: flex;
9202
+ flex: 1;
9203
+ }
9204
+
9199
9205
  /* vanilla-extract-css-ns:src/components/CopyAddress/CopyInputDisplayedAddress.css.ts.vanilla.css?source=#H4sIAAAAAAAAE81WXavbOBB9v79iKFxIwDJyUqe97ktp90e0+7LI8jgRkSUjKfcmXe5/L5LtxLLTNN2FUgKx9TEzZ2aOj/Rxj6fasAYt/JPty28onhD+fQCgj+EB4AxTttamIdqIrVAF5PQR6OOHeLXoX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9206
  @keyframes _1kbzei9e {
9201
9207
  0% {
@@ -9342,20 +9348,6 @@
9342
9348
  opacity: var(--animation-opacity, 0);
9343
9349
  }
9344
9350
 
9345
- /* vanilla-extract-css-ns:src/components/FunPayments/FunPaymentMoonpayType.css.ts.vanilla.css?source=Ll8xa21wZXlmMCB7CiAgaGVpZ2h0OiB1bnNldCAhaW1wb3J0YW50OwogIHdpZHRoOiB1bnNldCAhaW1wb3J0YW50OwogIGZsZXg6IDEgIWltcG9ydGFudDsKfQouXzFrbXBleWYwIGlmcmFtZSB7CiAgYm9yZGVyOiBub25lOwp9Ci5fMWttcGV5ZjEgewogIGRpc3BsYXk6IGZsZXg7CiAgZmxleDogMTsKfQ== */
9346
- [data-rk] ._1kmpeyf0 {
9347
- height: unset !important;
9348
- width: unset !important;
9349
- flex: 1 !important;
9350
- }
9351
- [data-rk] ._1kmpeyf0 iframe {
9352
- border: none;
9353
- }
9354
- [data-rk] ._1kmpeyf1 {
9355
- display: flex;
9356
- flex: 1;
9357
- }
9358
-
9359
9351
  /* vanilla-extract-css-ns:src/components/FunFeatureList/FunFeatureList.css.ts.vanilla.css?source=Ll8xMDQ1cXI3MSB7CiAgb3V0bGluZS1jb2xvcjogdmFyKC0tcmstY29sb3JzLWFjdGlvbkNvbG9yRGlzYWJsZWQpOwogIHRyYW5zaXRpb246IGFsbCAxNTBtcyBjdWJpYy1iZXppZXIoMC4zLCAwLCAwLjA2LCAxKTsKfQ== */
9360
9352
  [data-rk] ._1045qr71 {
9361
9353
  outline-color: var(--rk-colors-actionColorDisabled);