@funkit/connect 5.5.13-next.0 → 5.5.13-next.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 (45) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/components/AnimatedDollarValue/AnimatedDollarValue.d.ts +1 -0
  3. package/dist/components/Dropdown/ChainDropdown.d.ts +3 -1
  4. package/dist/components/Dropdown/TokenAndChainDropdown.d.ts +5 -2
  5. package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +1 -2
  6. package/dist/components/TransferTokenDetails/TransferTokenDetails.d.ts +1 -2
  7. package/dist/components/Withdraw/WithdrawContent.d.ts +5 -3
  8. package/dist/domains/meld.d.ts +19 -0
  9. package/dist/hooks/queries/useWithdrawalRisk.d.ts +1 -0
  10. package/dist/hooks/useCheckoutDirectExecutionHistory.d.ts +1 -0
  11. package/dist/hooks/useCheckoutTransferInit.d.ts +4 -2
  12. package/dist/hooks/useTokenChain.d.ts +3 -1
  13. package/dist/hooks/useTokenTransfer.d.ts +4 -1
  14. package/dist/hooks/useWithdrawal.d.ts +15 -0
  15. package/dist/index.js +12316 -12231
  16. package/dist/modals/CheckoutModal/ConfirmationStep/usePostCheckout.d.ts +1 -0
  17. package/dist/modals/CheckoutModal/InputAmount/InputAmount.d.ts +1 -0
  18. package/dist/modals/CheckoutModal/LoadingAccount.d.ts +6 -2
  19. package/dist/modals/CheckoutModal/SelectAsset.d.ts +1 -0
  20. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +7 -2
  21. package/dist/modals/CheckoutModal/TransferToken/TransferToken.d.ts +1 -0
  22. package/dist/modals/CheckoutModal/VirtualFiatAccount/FiatAccountDetail.d.ts +1 -0
  23. package/dist/providers/FunkitCheckoutContext.d.ts +3 -2
  24. package/dist/utils/directExecution.d.ts +2 -4
  25. package/dist/utils/flags/config.d.ts +8 -12
  26. package/dist/wallets/walletConnectors/index.js +47 -47
  27. package/package.json +6 -6
  28. package/dist/wallets/walletConnectors/chunk-25VW5TZP.js +0 -92
  29. package/dist/wallets/walletConnectors/chunk-3NC26XLM.js +0 -92
  30. package/dist/wallets/walletConnectors/chunk-3U3BMEH5.js +0 -94
  31. package/dist/wallets/walletConnectors/chunk-4UM4GTKZ.js +0 -103
  32. package/dist/wallets/walletConnectors/chunk-545L7Y4M.js +0 -69
  33. package/dist/wallets/walletConnectors/chunk-6LPM6LUQ.js +0 -110
  34. package/dist/wallets/walletConnectors/chunk-7GSNBOD3.js +0 -99
  35. package/dist/wallets/walletConnectors/chunk-ETTNDQQG.js +0 -100
  36. package/dist/wallets/walletConnectors/chunk-FRGSRLTS.js +0 -93
  37. package/dist/wallets/walletConnectors/chunk-HKV7EMYZ.js +0 -96
  38. package/dist/wallets/walletConnectors/chunk-IPOC2VJX.js +0 -106
  39. package/dist/wallets/walletConnectors/chunk-JXP2QPW7.js +0 -95
  40. package/dist/wallets/walletConnectors/chunk-KFFJPS5R.js +0 -96
  41. package/dist/wallets/walletConnectors/chunk-LEXSM5KI.js +0 -87
  42. package/dist/wallets/walletConnectors/chunk-MOOBCMMB.js +0 -70
  43. package/dist/wallets/walletConnectors/chunk-N2NIIUW6.js +0 -146
  44. package/dist/wallets/walletConnectors/chunk-W5O4YSZN.js +0 -98
  45. package/dist/wallets/walletConnectors/chunk-XYBEMO3C.js +0 -66
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 5.5.13-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 17e47e1: move withdrawSourceBalance to top level config
8
+ - df1b830: chore: deprecate dydx fee handling
9
+ - 9ce2ee3: chore(connect): add meld util tests
10
+
11
+ ## 5.5.13-next.1
12
+
13
+ ### Patch Changes
14
+
15
+ - e88a3d2: feat(connect): adjust auto-picking of provider quotes for Meld
16
+ - 0bf9fe3: feat(connect): update colors of tooltip texts for Withdrawal
17
+ - bd7721e: feat(connect): withdrawal handle wallet signature rejection
18
+ - 3d7fc1d: fix bridge fee in ui
19
+ - 85809cb: feat(connect): add risk assessment check for withdrawal address
20
+ - 5217122: feat: omit eoa calls in withdrawal flow
21
+ - cdf268c: refactor: rename fill gas to fill cost
22
+ - 3c8d98d: feat(connect): if the user is new, default to the Payment Methods screen, hide the SourcePaymentMethodItem, and enable the back button
23
+ - b095215: feat(connect): unify rendering of fees for withdrawal with relay
24
+ - 66b28fe: fix: update asset price refresh interval in withdrawal
25
+ - 6db3c9c: add loading state to withdrawal in progress
26
+ - e389c2b: wider price impact tooltip
27
+ - e3bba71: feat(connect): transfer crypto - minimum amount info"
28
+ - Updated dependencies [f49824b]
29
+ - Updated dependencies [57f6bd8]
30
+ - Updated dependencies [b223027]
31
+ - @funkit/fun-relay@0.1.9-next.1
32
+ - @funkit/api-base@1.9.5-next.1
33
+ - @funkit/core@2.3.27-next.1
34
+ - @funkit/wagmi-tools@3.0.49-next.1
35
+
3
36
  ## 5.5.13-next.0
4
37
 
5
38
  ### Patch Changes
@@ -2,6 +2,7 @@ import { type NumberFlowProps, type NumberFlowElement } from '@number-flow/react
2
2
  import React from 'react';
3
3
  type AnimatedDollarValueProps = Omit<NumberFlowProps, 'format'> & {
4
4
  ref?: React.Ref<NumberFlowElement>;
5
+ dynamicMinFractionDigits?: boolean;
5
6
  };
6
7
  export declare const AnimatedDollarValue: React.ForwardRefExoticComponent<Omit<AnimatedDollarValueProps, "ref"> & React.RefAttributes<NumberFlowElement>>;
7
8
  export {};
@@ -15,10 +15,12 @@ interface ChainDropdownProps {
15
15
  allowUnselect?: boolean;
16
16
  activeItemProps?: BaseDropdownProps['activeItemProps'];
17
17
  openDropdownBackgroundColor?: BaseDropdownProps['openDropdownBackgroundColor'];
18
+ openDropdownFullWidth?: BaseDropdownProps['openDropdownFullWidth'];
18
19
  size?: BaseActiveDropdownItemProps['size'];
19
20
  isLoading?: BaseDropdownProps['isLoading'];
20
21
  alwaysOpenToTop?: BaseDropdownProps['alwaysOpenToTop'];
21
22
  maxDropdownHeight?: BaseDropdownProps['maxDropdownHeight'];
23
+ tagComponent?: (value: string) => React.ReactNode;
22
24
  }
23
- export declare const ChainDropdown: ({ assets, chainIds: chains, selectedChainId: propSelectedChainId, allowUnselect, onChainSelected, activeItemProps, size, openDropdownBackgroundColor, isLoading, alwaysOpenToTop, maxDropdownHeight, }: ChainDropdownProps) => React.JSX.Element;
25
+ export declare const ChainDropdown: ({ assets, chainIds: chains, selectedChainId: propSelectedChainId, allowUnselect, onChainSelected, activeItemProps, size, openDropdownBackgroundColor, openDropdownFullWidth, isLoading, alwaysOpenToTop, maxDropdownHeight, tagComponent, }: ChainDropdownProps) => React.JSX.Element;
24
26
  export {};
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { type ReactNode } from 'react';
2
2
  import type { TokenTransferSourceChainsAndAssets } from '~/modals/CheckoutModal/TransferToken/TransferToken';
3
3
  import type { BaseDropdownProps } from './BaseDropdown';
4
4
  interface TokenAndChainDropdownProps {
@@ -16,10 +16,13 @@ interface TokenAndChainDropdownProps {
16
16
  onChainSelected: (chainId?: number, autoUpdate?: boolean) => void;
17
17
  tokenLabel?: string;
18
18
  chainLabel?: string;
19
+ chainLabelAddon?: ReactNode;
19
20
  alwaysOpenToTop?: boolean;
20
21
  maxTokenDropdownHeight?: BaseDropdownProps['maxDropdownHeight'];
21
22
  maxChainDropdownHeight?: BaseDropdownProps['maxDropdownHeight'];
23
+ openChainDropdownFullWidth?: BaseDropdownProps['openDropdownFullWidth'];
24
+ chainTagComponent?: (value: string) => ReactNode;
22
25
  }
23
26
  /** Combines together chain and token dropdowns */
24
- export declare const TokenAndChainDropdown: ({ isLoading, selectedToken, selectedChainId, assets, onTokenSelected, onChainSelected, tokenLabel, chainLabel, alwaysOpenToTop, maxTokenDropdownHeight, maxChainDropdownHeight, }: TokenAndChainDropdownProps) => React.JSX.Element;
27
+ export declare const TokenAndChainDropdown: ({ isLoading, selectedToken, selectedChainId, assets, onTokenSelected, onChainSelected, tokenLabel, chainLabel, chainLabelAddon, alwaysOpenToTop, maxTokenDropdownHeight, maxChainDropdownHeight, openChainDropdownFullWidth, chainTagComponent, }: TokenAndChainDropdownProps) => React.JSX.Element;
25
28
  export {};
@@ -6,7 +6,6 @@ interface PaymentFeesSummaryProps {
6
6
  quote: FunkitCheckoutQuoteResult | null | undefined;
7
7
  /** If set and quote is missing, display fees based on this data */
8
8
  fallbackFees?: CheckoutFees;
9
- showWithdrawalBreakdown?: boolean;
10
9
  }
11
- export declare function PaymentFeesSummary({ isLoading, quote, fallbackFees, showWithdrawalBreakdown, }: PaymentFeesSummaryProps): React.JSX.Element;
10
+ export declare function PaymentFeesSummary({ isLoading, quote, fallbackFees, }: PaymentFeesSummaryProps): React.JSX.Element;
12
11
  export {};
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
2
  import type { FeeValue } from '~/hooks/useTokenTransfer';
3
3
  interface TransferTokenDetailsProps {
4
- minAmount?: number;
5
4
  disabled?: boolean;
6
5
  estPriceImpact: FeeValue | undefined;
7
6
  maxSlippage: FeeValue | undefined;
8
7
  }
9
- export declare const TransferTokenDetails: ({ minAmount, disabled, estPriceImpact, maxSlippage, }: TransferTokenDetailsProps) => React.JSX.Element;
8
+ export declare const TransferTokenDetails: ({ disabled, estPriceImpact, maxSlippage, }: TransferTokenDetailsProps) => React.JSX.Element;
10
9
  export {};
@@ -1,7 +1,8 @@
1
1
  import { type CheckoutQuoteResponse } from '@funkit/utils';
2
2
  import React from 'react';
3
+ import { type Hex } from 'viem';
3
4
  import type { Address } from 'viem';
4
- import type { FunkitWithdrawalConfig } from '~/providers/FunkitCheckoutContext';
5
+ import type { FunkitActiveWithdrawalItem, FunkitWithdrawalConfig } from '~/providers/FunkitCheckoutContext';
5
6
  export type WithdrawalFormData = {
6
7
  destinationAddress: Address;
7
8
  amount: string;
@@ -10,8 +11,9 @@ export type WithdrawalFormData = {
10
11
  quote: CheckoutQuoteResponse;
11
12
  };
12
13
  interface WithdrawContentProps {
13
- onContinue: (withdrawal: WithdrawalFormData) => void;
14
+ onContinue: (withdrawal: WithdrawalFormData, txHash: Hex) => void;
14
15
  config: FunkitWithdrawalConfig;
16
+ withdrawalItem: FunkitActiveWithdrawalItem | null;
15
17
  }
16
- export declare const WithdrawContent: ({ onContinue, config, }: WithdrawContentProps) => React.JSX.Element;
18
+ export declare const WithdrawContent: ({ onContinue, config, withdrawalItem, }: WithdrawContentProps) => React.JSX.Element;
17
19
  export {};
@@ -0,0 +1,19 @@
1
+ import { type MeldQuote } from '@funkit/api-base';
2
+ /**
3
+ * Auto-pick the best quote for the user.
4
+ * 1. Pick the quote with the highest customerScore, at least >= 30
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
8
+ * 3. If no quote has customerScore >= 30 and no Coinbase or Binance is available, pick the quote with the highest destinationAmount
9
+ * @param quotes - the quotes to pick from
10
+ * @returns the best quote based on the criteria
11
+ */
12
+ export declare function autoPickBestQuote(quotes: MeldQuote[]): MeldQuote | undefined;
13
+ /**
14
+ * Check if the quote is the best price quote.
15
+ * @param sourceQuotes - the quotes to check
16
+ * @param targetQuote - the quote to check
17
+ * @returns true if the quote is the best price quote, false otherwise
18
+ */
19
+ export declare function isBestPriceQuote(sourceQuotes: MeldQuote[] | undefined, targetQuote: MeldQuote | undefined): boolean;
@@ -0,0 +1 @@
1
+ export declare const useWithdrawalRisk: (apiKey: string, receiveAddress: string) => import("@tanstack/react-query").UseQueryResult<boolean, Error>;
@@ -1,5 +1,6 @@
1
1
  import { CheckoutRefundState, CheckoutState, type DirectExecution, RelayExecutionStatus } from '@funkit/api-base';
2
2
  export declare function mapRelayExecutionStatusToCheckoutState(status: RelayExecutionStatus): CheckoutState;
3
+ export declare function mapRelayExecutionStatusToRefundState(status: RelayExecutionStatus): CheckoutRefundState | undefined;
3
4
  export declare function useCheckoutDirectExecutionHistory({ initDirectExecution, }: {
4
5
  initDirectExecution?: DirectExecution;
5
6
  }): {
@@ -1,8 +1,10 @@
1
1
  import { type CheckoutInitTokenTransferResponse, type FunAddress } from '@funkit/api-base';
2
- import type { FunkitCheckoutConfig } from '~/providers/FunkitCheckoutContext';
3
2
  interface UseCheckoutTransferInitResponse {
4
3
  transferInit: CheckoutInitTokenTransferResponse | undefined;
5
4
  recipientAddr: FunAddress;
6
5
  }
7
- export declare const useCheckoutTransferInit: (checkoutConfig: FunkitCheckoutConfig | undefined) => UseCheckoutTransferInitResponse;
6
+ /**
7
+ * creates QR code transfer EOA
8
+ */
9
+ export declare const useCheckoutTransferInit: () => UseCheckoutTransferInitResponse;
8
10
  export {};
@@ -1,3 +1,4 @@
1
+ import type { CheckoutInitTokenTransferResponse } from '@funkit/api-base';
1
2
  import type { TokenTransferSourceChainsAndAssets } from '~/modals/CheckoutModal/TransferToken/TransferToken';
2
3
  export type TransferTokenDefault = {
3
4
  token: string;
@@ -13,6 +14,7 @@ interface UseTokenChainResult {
13
14
  /**
14
15
  * Semi reusable hook (tied into token transfer configuration)
15
16
  * ensures token&chain dropdown preselection logic is reusable
17
+ * @param transferInit - used for chain&token solana filtering, can be omitted if not needed
16
18
  */
17
- export declare const useTokenAndChainSelection: (defaultValues?: TransferTokenDefault) => UseTokenChainResult;
19
+ export declare const useTokenAndChainSelection: (transferInit: CheckoutInitTokenTransferResponse | undefined, defaultValues?: TransferTokenDefault) => UseTokenChainResult;
18
20
  export {};
@@ -10,9 +10,12 @@ interface UseTokenTransferResult {
10
10
  /** the final destination of the money */
11
11
  recipientAddr: string;
12
12
  minTransferUsd: number;
13
+ minTransferUsdPerChain: {
14
+ [chainId: string]: number;
15
+ };
13
16
  showOriginalRecipient: boolean;
14
17
  estPriceImpact: FeeValue | undefined;
15
18
  maxSlippage: FeeValue | undefined;
16
19
  }
17
- export declare const useTokenTransfer: (selectedChainId: number, selectedToken: string) => UseTokenTransferResult;
20
+ export declare const useTokenTransfer: (selectedChainId: number, selectedToken: string, chainIds?: number[]) => UseTokenTransferResult;
18
21
  export {};
@@ -0,0 +1,15 @@
1
+ import type { Hex } from 'viem';
2
+ import type { WithdrawalFormData } from '~/components/Withdraw/WithdrawContent';
3
+ import type { FunkitActiveWithdrawalItem } from '~/providers/FunkitCheckoutContext';
4
+ import type { WithdrawalClient } from '~/wallets/Wallet';
5
+ interface UseWithdrawalResult {
6
+ handleWithdrawal: (withdrawal: WithdrawalFormData) => Promise<void>;
7
+ isWithdrawing: boolean;
8
+ }
9
+ export declare function useWithdrawal({ withdrawalWallet, withdrawalItem, onSuccess, onError, }: {
10
+ withdrawalWallet: WithdrawalClient;
11
+ withdrawalItem: FunkitActiveWithdrawalItem | null;
12
+ onSuccess: (withdrawal: WithdrawalFormData, txHash: Hex) => void;
13
+ onError: (error: Error) => void;
14
+ }): UseWithdrawalResult;
15
+ export {};