@funkit/connect 5.2.0 → 5.3.1

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 (129) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/{chunk-QBCQK5KX.js → chunk-C63T33UV.js} +6 -1
  3. package/dist/{chunk-2C7D5NQG.js → chunk-CRPOYQ6X.js} +24 -4
  4. package/dist/{chunk-PKXUTXYG.js → chunk-LEJS74SX.js} +6 -1
  5. package/dist/components/Box/Box.d.ts +29 -29
  6. package/dist/components/Dialog/Dialog.css.d.ts +4 -2
  7. package/dist/components/Dialog/Dialog.d.ts +11 -3
  8. package/dist/components/Dialog/DialogContent.css.d.ts +2 -0
  9. package/dist/components/Dropdown/BaseDropdown.css.d.ts +1 -1
  10. package/dist/components/Dropdown/BaseDropdown.d.ts +4 -3
  11. package/dist/components/FunAsset/FunAssetLoading.d.ts +6 -3
  12. package/dist/components/FunBadge/BridgeCustomerStatusBadge.d.ts +9 -0
  13. package/dist/components/FunBadge/FunBadge.d.ts +4 -2
  14. package/dist/components/FunButton/FunIconButton.d.ts +1 -0
  15. package/dist/components/FunButton/FunLinkButton.d.ts +4 -0
  16. package/dist/components/FunCheckbox/FunCheckbox.d.ts +9 -0
  17. package/dist/components/FunCheckoutHistory/FunCheckoutStatus.d.ts +11 -2
  18. package/dist/components/FunCheckoutHistory/FunDirectExecutionStatus.d.ts +7 -0
  19. package/dist/components/FunFeatureList/FunFeatureList.d.ts +13 -0
  20. package/dist/components/FunFeatureList/FunFeatureListItem.d.ts +10 -0
  21. package/dist/components/FunGuarantees/FunGuarantees.d.ts +7 -3
  22. package/dist/components/FunInput/FunInput.d.ts +3 -1
  23. package/dist/components/FunInput/FunTextAreaInput.d.ts +1 -1
  24. package/dist/components/FunInputButton/FunInputButton.d.ts +14 -0
  25. package/dist/components/FunOptionBox/FunOptionBox.css.d.ts +1 -1
  26. package/dist/components/FunPayments/FunPaymentMethods.d.ts +8 -1
  27. package/dist/components/FunSelect/FunSelect.d.ts +3 -0
  28. package/dist/components/FunTooltip/FunTooltip.css.d.ts +1 -0
  29. package/dist/components/FunTooltip/FunTooltip.d.ts +15 -1
  30. package/dist/components/FunTransactionSummary/PaymentAmountSummary.d.ts +3 -4
  31. package/dist/components/Icons/CheckIcon.d.ts +1 -1
  32. package/dist/components/Icons/HomeIcon.d.ts +4 -0
  33. package/dist/components/Icons/Icons.css.d.ts +0 -1
  34. package/dist/components/Icons/New/BankIcon.d.ts +7 -0
  35. package/dist/components/Icons/New/BanknoteIcon.d.ts +4 -0
  36. package/dist/components/Icons/New/CoinsHandIcon.d.ts +4 -0
  37. package/dist/components/Icons/New/FiatAccountIcon.d.ts +4 -0
  38. package/dist/components/Icons/New/HelpIcon.d.ts +2 -0
  39. package/dist/components/Icons/New/LightningBoltOutlineIcon.d.ts +4 -0
  40. package/dist/components/Icons/New/ShieldCheckIcon.d.ts +4 -0
  41. package/dist/components/Icons/New/TimeIcon.d.ts +4 -0
  42. package/dist/components/Icons/New/UserIcon.d.ts +4 -0
  43. package/dist/components/Icons/SpinnerIconWithBackground.d.ts +6 -4
  44. package/dist/components/Icons/SuccessIcon.d.ts +3 -1
  45. package/dist/components/Icons/UserSquareIcon.d.ts +4 -0
  46. package/dist/components/Icons/VerificationFailedIcon.d.ts +4 -0
  47. package/dist/components/Icons/VerificationPendingIcon.d.ts +4 -0
  48. package/dist/components/Icons/VerificationSuccessIcon.d.ts +4 -0
  49. package/dist/components/Icons/VerifyIdentityIcon.d.ts +4 -0
  50. package/dist/components/SourcePaymentMethodItem/SourcePaymentMethodItem.d.ts +1 -2
  51. package/dist/components/Tabs/Tabs.d.ts +11 -0
  52. package/dist/components/Text/Text.d.ts +1 -1
  53. package/dist/components/TransferTokenDetails/TransferTokenDetails.d.ts +2 -2
  54. package/dist/components/VirtualFiatAccount/CreateAccountScreen/CreateAccountScreen.d.ts +15 -0
  55. package/dist/components/VirtualFiatAccount/IntroScreen/IntroScreen.d.ts +6 -0
  56. package/dist/components/VirtualFiatAccount/VerifyAccountScreen/VerifyAccountScreen.d.ts +15 -0
  57. package/dist/config/getDefaultConfig.d.ts +291 -150
  58. package/dist/consts/customers.d.ts +1 -0
  59. package/dist/consts/funkit.d.ts +0 -1
  60. package/dist/consts/quote.d.ts +3 -10
  61. package/dist/css/sprinkles.css.d.ts +45 -29
  62. package/dist/domains/bridge.d.ts +25 -0
  63. package/dist/domains/fees.d.ts +14 -1
  64. package/dist/domains/paymentMethods.d.ts +25 -4
  65. package/dist/domains/quote.d.ts +17 -14
  66. package/dist/domains/relay.d.ts +52 -0
  67. package/dist/hooks/useCheckoutAccountBalanceTransfer.d.ts +1 -1
  68. package/dist/hooks/useCheckoutDirectExecution.d.ts +30 -0
  69. package/dist/hooks/useCheckoutDirectExecutionHistory.d.ts +11 -0
  70. package/dist/hooks/useCheckoutTimeEstimate.d.ts +2 -1
  71. package/dist/hooks/useCopyToClipboard.d.ts +7 -3
  72. package/dist/hooks/useFrogAccount.d.ts +335 -0
  73. package/dist/hooks/useIsUsBankrUser.d.ts +1 -0
  74. package/dist/hooks/usePaymentMethodIcon.d.ts +1 -0
  75. package/dist/hooks/usePaymentSources.d.ts +1 -1
  76. package/dist/hooks/useReceiveAmountLabel.d.ts +4 -0
  77. package/dist/hooks/useRelayBypass.d.ts +11 -7
  78. package/dist/hooks/useRelayExecutionInfo.d.ts +7 -0
  79. package/dist/hooks/useTokenTransfer.d.ts +3 -2
  80. package/dist/index.css +2723 -2456
  81. package/dist/index.d.ts +1 -1
  82. package/dist/index.js +17595 -14237
  83. package/dist/modals/CheckoutModal/ConfirmationStep/useQuoteRefresh.d.ts +5 -1
  84. package/dist/modals/CheckoutModal/InputAmount/utils.d.ts +1 -1
  85. package/dist/modals/CheckoutModal/LoadingAccount.d.ts +4 -1
  86. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +8 -3
  87. package/dist/modals/CheckoutModal/VirtualFiatAccount/BridgeCustomer.d.ts +13 -0
  88. package/dist/modals/CheckoutModal/VirtualFiatAccount/BridgeKyc.d.ts +22 -0
  89. package/dist/modals/CheckoutModal/VirtualFiatAccount/ErrorScreen.d.ts +7 -0
  90. package/dist/modals/CheckoutModal/VirtualFiatAccount/FiatAccountDetail.d.ts +9 -0
  91. package/dist/modals/CheckoutModal/VirtualFiatAccount/KycIframe.d.ts +5 -0
  92. package/dist/modals/CheckoutModal/VirtualFiatAccount/VirtualFiatAccount.d.ts +9 -0
  93. package/dist/modals/CheckoutModal/stepTransition.d.ts +26 -1
  94. package/dist/modals/CheckoutModal/useNewCheckoutQuote.d.ts +1 -1
  95. package/dist/providers/FunkitCheckoutContext.d.ts +10 -3
  96. package/dist/providers/FunkitConfigContext.d.ts +1 -0
  97. package/dist/providers/FunkitQuoteContext.d.ts +4 -1
  98. package/dist/providers/FunkitThemeProvider.d.ts +24 -0
  99. package/dist/providers/GeneralWalletProvider.d.ts +10 -74
  100. package/dist/providers/ModalContext.d.ts +1 -1
  101. package/dist/themes/baseTheme.js +1 -1
  102. package/dist/themes/darkTheme.js +2 -2
  103. package/dist/themes/lightTheme.js +2 -2
  104. package/dist/utils/checkout.d.ts +20 -10
  105. package/dist/utils/flags/config.d.ts +49 -2
  106. package/dist/utils/flags/types.d.ts +2 -0
  107. package/dist/utils/mesh.d.ts +1 -0
  108. package/dist/utils/tokenIconUrl.d.ts +2 -0
  109. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  110. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  111. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  112. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  113. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  114. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  115. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  116. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  117. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  118. package/dist/wallets/walletConnectors/index.js +65 -65
  119. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  120. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  121. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  122. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  123. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  124. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  125. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  126. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  127. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  128. package/package.json +8 -7
  129. /package/dist/components/{TransferTokenDetails/TransferTokenDetails.css.d.ts → FunFeatureList/FunFeatureList.css.d.ts} +0 -0
@@ -4,6 +4,10 @@ interface UseQuoteRefreshOptions {
4
4
  * Freeze the latest quote state, e.g. so we do not change the quote mid-confirmation
5
5
  */
6
6
  isOnHold: boolean;
7
+ /**
8
+ * Controls in what interval to refresh the quote data in case of a hard refresh, in case of pre-loading it controls when to set the data, should be more than `BEFORE_COUNTDOWN_ENDS_SEC` by at least 10 seconds to provide the API the time needed to complete the call
9
+ */
10
+ refreshIntervalSeconds: number;
7
11
  }
8
12
  interface UseQuoteRefreshResult {
9
13
  /** Quoting state indicated a bit in advance for UX reasons */
@@ -15,5 +19,5 @@ interface UseQuoteRefreshResult {
15
19
  /** Safe to call asynchronously */
16
20
  refreshQuote(ignorePreloaded?: boolean): Promise<void>;
17
21
  }
18
- export declare function useQuoteRefresh({ isOnHold, }: UseQuoteRefreshOptions): UseQuoteRefreshResult;
22
+ export declare function useQuoteRefresh({ isOnHold, refreshIntervalSeconds, }: UseQuoteRefreshOptions): UseQuoteRefreshResult;
19
23
  export {};
@@ -4,4 +4,4 @@ export declare const USD_DECIMALS = 2;
4
4
  export declare const USD_INITIAL_AMOUNT = 100;
5
5
  export declare const USD_PREFIX = "$";
6
6
  export declare function getUsdMaxAmount(paymentMethod: PaymentMethod, maxUsd: number): number | null;
7
- export declare function getUsdMinAmount(paymentMethod: PaymentMethod, minUsd?: number | undefined): number;
7
+ export declare function getUsdMinAmount(paymentMethod: PaymentMethod, minUsd?: number): number;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { PaymentMethod, type PaymentMethodAccountInfo, type PaymentMethodBrokerageInfo } from '../../domains/paymentMethods';
2
+ import { PaymentMethod, type PaymentMethodAccountInfo, type PaymentMethodBrokerageInfo, type PaymentMethodVirtualBankInfo } from '../../domains/paymentMethods';
3
3
  import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from './stepTransition';
4
4
  export type LoadingAccountState = CheckoutModalCommonState;
5
5
  export type LoadingAccountNext = {
@@ -8,6 +8,9 @@ export type LoadingAccountNext = {
8
8
  } | {
9
9
  usablePaymentMethod: PaymentMethod.BROKERAGE;
10
10
  paymentMethodInfo: PaymentMethodBrokerageInfo;
11
+ } | {
12
+ usablePaymentMethod: PaymentMethod.VIRTUAL_BANK;
13
+ paymentMethodInfo: PaymentMethodVirtualBankInfo;
11
14
  } | {
12
15
  usablePaymentMethod: null | PaymentMethod.TOKEN_TRANSFER;
13
16
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type ConnectablePaymentMethodInfo, PaymentMethod, type PaymentMethodCardInfo } from '~/domains/paymentMethods';
2
+ import { type ConnectablePaymentMethodInfo, PaymentMethod, type PaymentMethodCardInfo, type PaymentMethodVirtualBankIncompleteInfo } from '~/domains/paymentMethods';
3
3
  import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
4
4
  export type SourceChangeState = CheckoutModalCommonState & {
5
5
  paymentMethodInfo: ConnectablePaymentMethodInfo | null;
@@ -10,7 +10,12 @@ export type SourceChangeNext = {
10
10
  brokerageFailed: false;
11
11
  } | {
12
12
  connectNew: true;
13
- paymentMethod: Exclude<PaymentMethod, PaymentMethod.CARD>;
13
+ paymentMethod: Exclude<PaymentMethod, PaymentMethod.CARD | PaymentMethod.VIRTUAL_BANK>;
14
+ brokerageFailed: false;
15
+ } | {
16
+ connectNew: true;
17
+ paymentMethod: PaymentMethod.VIRTUAL_BANK;
18
+ paymentMethodInfo: PaymentMethodVirtualBankIncompleteInfo;
14
19
  brokerageFailed: false;
15
20
  } | {
16
21
  connectNew: true;
@@ -22,4 +27,4 @@ export type SourceChangeNext = {
22
27
  paymentMethodInfo: ConnectablePaymentMethodInfo;
23
28
  };
24
29
  export declare const SourceChangeInfo: ModalStepInfo<FunCheckoutStep.SOURCE_CHANGE>;
25
- export declare function SourceChange({ modalState, onNext, onClose, }: ModalStepComponentProps<FunCheckoutStep.SOURCE_CHANGE>): React.JSX.Element;
30
+ export declare function SourceChange({ modalState, onNext, onClose, setModalState, }: ModalStepComponentProps<FunCheckoutStep.SOURCE_CHANGE>): React.JSX.Element;
@@ -0,0 +1,13 @@
1
+ import type { PaymentMethodVirtualBankIncompleteInfo } from '~/domains/paymentMethods';
2
+ import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepInfo } from '~/modals/CheckoutModal/stepTransition';
3
+ export type BridgeCustomerNext = {
4
+ hasError?: false;
5
+ kycLink: string;
6
+ } | {
7
+ hasError: true;
8
+ errorCode: string;
9
+ };
10
+ export type BridgeCustomerState = CheckoutModalCommonState & {
11
+ paymentMethodInfo: PaymentMethodVirtualBankIncompleteInfo;
12
+ };
13
+ export declare const BridgeCustomerInfo: ModalStepInfo<FunCheckoutStep.BRIDGE_CUSTOMER>;
@@ -0,0 +1,22 @@
1
+ import { type BridgeCustomer, type BridgeVirtualBankAccount, type Guid } from '@funkit/api-base';
2
+ import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepInfo } from '~/modals/CheckoutModal/stepTransition';
3
+ export declare enum NextStep {
4
+ ShowSource = "ShowSource",
5
+ ShowKyc = "ShowKyc",
6
+ ShowError = "ShowError"
7
+ }
8
+ export type BridgeKycNext = {
9
+ nextStep: NextStep.ShowSource;
10
+ bridgeCustomer: BridgeCustomer;
11
+ virtualFiatAccount: BridgeVirtualBankAccount;
12
+ } | {
13
+ nextStep: NextStep.ShowError;
14
+ } | {
15
+ nextStep: NextStep.ShowKyc;
16
+ guidForKyc: Guid;
17
+ };
18
+ export type BridgeKycState = CheckoutModalCommonState & {
19
+ kycLink?: string;
20
+ kycIframeCompleted?: boolean;
21
+ };
22
+ export declare const BridgeKycInfo: ModalStepInfo<FunCheckoutStep.BRIDGE_KYC>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { CheckoutModalCommonState, FunCheckoutStep, ModalStepInfo } from '~/modals/CheckoutModal/stepTransition';
3
+ export type ErrorScreenState = CheckoutModalCommonState & {
4
+ errorCode: string;
5
+ };
6
+ export declare const ErrorScreen: () => React.JSX.Element;
7
+ export declare const ErrorScreenInfo: ModalStepInfo<FunCheckoutStep.ERROR_SCREEN>;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { type PaymentMethodVirtualBankInfo } from '~/domains/paymentMethods';
3
+ import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
4
+ export type FiatAccountDetailState = CheckoutModalCommonState & {
5
+ paymentMethodInfo: PaymentMethodVirtualBankInfo;
6
+ };
7
+ export type FiatAccountDetailNext = Record<string, never>;
8
+ export declare const AccountDetailsScreen: ({ modalState, onNext, }: ModalStepComponentProps<FunCheckoutStep.FIAT_ACCOUNT_DETAIL>) => React.JSX.Element;
9
+ export declare const FiatAccountDetail: ModalStepInfo<FunCheckoutStep.FIAT_ACCOUNT_DETAIL>;
@@ -0,0 +1,5 @@
1
+ import { type KycLinkLoad } from '~/hooks/useFrogAccount';
2
+ import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepInfo } from '~/modals/CheckoutModal/stepTransition';
3
+ export type KycIframeState = CheckoutModalCommonState & KycLinkLoad;
4
+ export type KycIframeNext = Record<string, never>;
5
+ export declare const KycIframeInfo: ModalStepInfo<FunCheckoutStep.KYC_IFRAME>;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { PaymentMethodVirtualBankIncompleteInfo } from '~/domains/paymentMethods';
3
+ import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '~/modals/CheckoutModal/stepTransition';
4
+ export type VirtualFiatAccountNext = Record<string, never>;
5
+ export type VirtualFiatAccountState = CheckoutModalCommonState & {
6
+ paymentMethodInfo: PaymentMethodVirtualBankIncompleteInfo;
7
+ };
8
+ export declare const VirtualFiatAccountInfo: ModalStepInfo<FunCheckoutStep.CREATE_FIAT_ACCOUNT>;
9
+ export declare function VirtualFiatAccount({ onNext, }: ModalStepComponentProps<FunCheckoutStep.CREATE_FIAT_ACCOUNT>): React.JSX.Element;
@@ -1,4 +1,8 @@
1
1
  import { type ComponentType, type SetStateAction } from 'react';
2
+ import { type BridgeCustomerNext, type BridgeCustomerState } from '~/modals/CheckoutModal/VirtualFiatAccount/BridgeCustomer';
3
+ import { type BridgeKycNext, type BridgeKycState } from '~/modals/CheckoutModal/VirtualFiatAccount/BridgeKyc';
4
+ import { type ErrorScreenState } from '~/modals/CheckoutModal/VirtualFiatAccount/ErrorScreen';
5
+ import { type VirtualFiatAccountNext, type VirtualFiatAccountState } from '~/modals/CheckoutModal/VirtualFiatAccount/VirtualFiatAccount';
2
6
  import type { FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
3
7
  import { type FunkitTextCustomizationsConfig } from '../../providers/FunkitConfigContext';
4
8
  import { type CheckoutCompleteNext, type CheckoutCompleteState } from './CheckoutComplete/CheckoutComplete';
@@ -13,6 +17,8 @@ import { type SelectAssetNext, type SelectAssetState } from './SelectAsset';
13
17
  import { type SelectBrokerageNext, type SelectBrokerageState } from './SelectBrokerage';
14
18
  import { type SourceChangeNext, type SourceChangeState } from './SourceChange/SourceChange';
15
19
  import { type TransferTokenNext, type TransferTokenState } from './TransferToken/TransferToken';
20
+ import { type FiatAccountDetailNext, type FiatAccountDetailState } from './VirtualFiatAccount/FiatAccountDetail';
21
+ import { type KycIframeNext, type KycIframeState } from './VirtualFiatAccount/KycIframe';
16
22
  export interface CheckoutModalCommonState {
17
23
  checkoutId: string;
18
24
  /** Handles soft hiding of the dialog (without removing it from the DOM) */
@@ -41,7 +47,13 @@ export declare enum FunCheckoutStep {
41
47
  MESH_VERIFICATION = "mesh_verification",
42
48
  CHECKOUT_COMPLETE = "checkout_complete",
43
49
  CHECKOUT_HELP = "checkout_help",
44
- TRANSFER_TOKEN = "transfer_token"
50
+ TRANSFER_TOKEN = "transfer_token",
51
+ CREATE_FIAT_ACCOUNT = "create_fiat_account",
52
+ BRIDGE_CUSTOMER = "bridge_customer",
53
+ BRIDGE_KYC = "bridge_kyc",
54
+ KYC_IFRAME = "KYC_IFRAME",
55
+ FIAT_ACCOUNT_DETAIL = "fiat_account_detail",
56
+ ERROR_SCREEN = "error_screen"
45
57
  }
46
58
  export type ModalStepInfo<S extends FunCheckoutStep> = {
47
59
  Component: ComponentType<ModalStepComponentProps<S>>;
@@ -73,6 +85,12 @@ type CheckoutModalState<S extends FunCheckoutStep = FunCheckoutStep> = {
73
85
  [FunCheckoutStep.SELECT_BROKERAGE]: SelectBrokerageState;
74
86
  [FunCheckoutStep.SOURCE_CHANGE]: SourceChangeState;
75
87
  [FunCheckoutStep.TRANSFER_TOKEN]: TransferTokenState;
88
+ [FunCheckoutStep.CREATE_FIAT_ACCOUNT]: VirtualFiatAccountState;
89
+ [FunCheckoutStep.BRIDGE_KYC]: BridgeKycState;
90
+ [FunCheckoutStep.KYC_IFRAME]: KycIframeState;
91
+ [FunCheckoutStep.BRIDGE_CUSTOMER]: BridgeCustomerState;
92
+ [FunCheckoutStep.FIAT_ACCOUNT_DETAIL]: FiatAccountDetailState;
93
+ [FunCheckoutStep.ERROR_SCREEN]: ErrorScreenState;
76
94
  }[T] & {
77
95
  step: T;
78
96
  };
@@ -90,8 +108,15 @@ type NextPayload<S extends FunCheckoutStep = FunCheckoutStep> = {
90
108
  [FunCheckoutStep.SELECT_BROKERAGE]: SelectBrokerageNext;
91
109
  [FunCheckoutStep.SOURCE_CHANGE]: SourceChangeNext;
92
110
  [FunCheckoutStep.TRANSFER_TOKEN]: TransferTokenNext;
111
+ [FunCheckoutStep.CREATE_FIAT_ACCOUNT]: VirtualFiatAccountNext;
112
+ [FunCheckoutStep.BRIDGE_KYC]: BridgeKycNext;
113
+ [FunCheckoutStep.KYC_IFRAME]: KycIframeNext;
114
+ [FunCheckoutStep.BRIDGE_CUSTOMER]: BridgeCustomerNext;
115
+ [FunCheckoutStep.FIAT_ACCOUNT_DETAIL]: FiatAccountDetailNext;
116
+ [FunCheckoutStep.ERROR_SCREEN]: null;
93
117
  }[S] & {
94
118
  reverseAnimation?: boolean;
119
+ skipAnimation?: boolean;
95
120
  wipeHistory?: boolean;
96
121
  };
97
122
  export declare function useCheckoutModalTransition(checkoutItem: FunkitActiveCheckoutItem, onClose: () => void): {
@@ -2,6 +2,6 @@ import { type DeepPartial } from '@funkit/utils';
2
2
  import { type FunkitActiveCheckoutItem } from '~/providers/FunkitCheckoutContext';
3
3
  export declare function useNewCheckoutQuote(): (overridingCheckoutItem?: DeepPartial<FunkitActiveCheckoutItem>) => Promise<{
4
4
  baseQuote: import("@funkit/api-base").CheckoutQuoteResponse;
5
+ checkedAssetAmount: import("~/domains/quote").CheckedAssetAmount;
5
6
  finalEstimation: import("~/domains/quote").FunkitCheckoutQuoteResult;
6
- availableAssetAmount: number | undefined;
7
7
  }>;
@@ -1,6 +1,6 @@
1
1
  import { type ApiCheckoutClientMetadata, type ApiFunkitCheckoutActionParams, type ApiFunkitCheckoutConfig, type FunAddress } from '@funkit/api-base';
2
2
  import React, { type ReactNode } from 'react';
3
- import { type Address } from 'viem';
3
+ import type { Address } from 'viem';
4
4
  import type { AssetHoldingsItem } from '~/utils/assets';
5
5
  import { type PaymentMethodInfo } from '../domains/paymentMethods';
6
6
  import { type FunkitCheckoutQuoteResult } from './FunkitHistoryContext';
@@ -74,8 +74,15 @@ export interface UseFunkitCheckoutProps {
74
74
  onError?: (result: FunkitCheckoutResult) => void;
75
75
  /** @optional fires if the checkout fails at any point **/
76
76
  onSuccess?: (result: FunkitCheckoutResult) => void;
77
- /** @optional fires if the checkout requires an active wallet connection. If not specified, defaults to funkit wallet connection. */
78
- onLoginRequired?: () => void;
77
+ /**
78
+ * @optional
79
+ * fires if the checkout requires an active wallet connection. If not specified, defaults to funkit wallet connection.
80
+ * Call the provided `onLoginFinished()` callback once login is completed to resume the checkout flow (and unhide the soft-hidden modal).
81
+ * It is strongly recommended to call `onLoginFinished()` after login is completed. If not called, the checkout modal may remain hidden.
82
+ */
83
+ onLoginRequired?: ({ onLoginFinished, }: {
84
+ onLoginFinished?: () => void;
85
+ }) => void;
79
86
  }
80
87
  /** Ensures that config is defined */
81
88
  export interface UseFunkitCheckoutPropsWithFullConfig extends UseFunkitCheckoutProps {
@@ -1,6 +1,7 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type FunkitPrioritizedLoginType, FunkitSocialLoginMethod } from '../consts/funkit';
3
3
  export interface FunkitTextCustomizationsConfig {
4
+ virtualFiat: string;
4
5
  brokerageOrExchange: string;
5
6
  debitOrCredit: string;
6
7
  accountBalance: string;
@@ -3,9 +3,12 @@ import { type PaymentMethodInfo } from '../domains/paymentMethods';
3
3
  import type { FunkitCheckoutQuoteResult } from '../domains/quote';
4
4
  import { type FunkitActiveCheckoutItem } from './FunkitCheckoutContext';
5
5
  export type CheckoutQuoteError = {
6
- maxTargetAssetAmount: number;
6
+ maxTargetAssetAmount?: number;
7
+ minTargetAssetAmount?: number;
7
8
  reason: 'insufficientBalance';
8
9
  } | {
10
+ maxTargetAssetAmount?: number;
11
+ minTargetAssetAmount?: number;
9
12
  minTargetUsdAmount?: number;
10
13
  reason: 'insufficientAmount';
11
14
  } | {
@@ -78,6 +78,7 @@ export declare const useActiveTheme: () => {
78
78
  buttonBackground: string;
79
79
  buttonBackgroundHover: string;
80
80
  buttonBackgroundDisabled: string;
81
+ buttonBorderHover: string;
81
82
  buttonTextSecondaryDisabled: string;
82
83
  buttonTextSecondary: string;
83
84
  buttonIconBackgroundHover: string;
@@ -91,6 +92,9 @@ export declare const useActiveTheme: () => {
91
92
  newBadgeBackground: string;
92
93
  newBadgeBorder: string;
93
94
  newBadgeText: string;
95
+ red_50: string;
96
+ red_100: string;
97
+ red_800: string;
94
98
  inputAmountQuickOptionBaseBackground: string;
95
99
  inputAmountQuickOptionHoverBackground: string;
96
100
  inputAmountQuickOptionActiveBackground: string;
@@ -172,6 +176,10 @@ export declare const useActiveTheme: () => {
172
176
  youPayYouReceive: string;
173
177
  inputAmountSwitcher: string;
174
178
  qrCode: string;
179
+ skeleton: string;
180
+ tooltip: string;
181
+ dropdown: string;
182
+ dropdownItem: string;
175
183
  };
176
184
  shadows: {
177
185
  connectButton: string;
@@ -249,6 +257,7 @@ export declare const useActiveTheme: () => {
249
257
  buttonBackground: string;
250
258
  buttonBackgroundHover: string;
251
259
  buttonBackgroundDisabled: string;
260
+ buttonBorderHover: string;
252
261
  buttonTextSecondaryDisabled: string;
253
262
  buttonTextSecondary: string;
254
263
  buttonIconBackgroundHover: string;
@@ -262,6 +271,9 @@ export declare const useActiveTheme: () => {
262
271
  newBadgeBackground: string;
263
272
  newBadgeBorder: string;
264
273
  newBadgeText: string;
274
+ red_50: string;
275
+ red_100: string;
276
+ red_800: string;
265
277
  inputAmountQuickOptionBaseBackground: string;
266
278
  inputAmountQuickOptionHoverBackground: string;
267
279
  inputAmountQuickOptionActiveBackground: string;
@@ -343,6 +355,10 @@ export declare const useActiveTheme: () => {
343
355
  youPayYouReceive: string;
344
356
  inputAmountSwitcher: string;
345
357
  qrCode: string;
358
+ skeleton: string;
359
+ tooltip: string;
360
+ dropdown: string;
361
+ dropdownItem: string;
346
362
  };
347
363
  shadows: {
348
364
  connectButton: string;
@@ -418,6 +434,7 @@ export declare const useActiveTheme: () => {
418
434
  buttonBackground: string;
419
435
  buttonBackgroundHover: string;
420
436
  buttonBackgroundDisabled: string;
437
+ buttonBorderHover: string;
421
438
  buttonTextSecondaryDisabled: string;
422
439
  buttonTextSecondary: string;
423
440
  buttonIconBackgroundHover: string;
@@ -431,6 +448,9 @@ export declare const useActiveTheme: () => {
431
448
  newBadgeBackground: string;
432
449
  newBadgeBorder: string;
433
450
  newBadgeText: string;
451
+ red_50: string;
452
+ red_100: string;
453
+ red_800: string;
434
454
  inputAmountQuickOptionBaseBackground: string;
435
455
  inputAmountQuickOptionHoverBackground: string;
436
456
  inputAmountQuickOptionActiveBackground: string;
@@ -512,6 +532,10 @@ export declare const useActiveTheme: () => {
512
532
  youPayYouReceive: string;
513
533
  inputAmountSwitcher: string;
514
534
  qrCode: string;
535
+ skeleton: string;
536
+ tooltip: string;
537
+ dropdown: string;
538
+ dropdownItem: string;
515
539
  };
516
540
  shadows: {
517
541
  connectButton: string;
@@ -2,7 +2,7 @@ import type { AssetBalanceInfo } from '@funkit/api-base';
2
2
  import { Auth, FunWallet } from '@funkit/core';
3
3
  import React, { type ReactNode } from 'react';
4
4
  import type { Address } from 'viem';
5
- import { type Config } from 'wagmi';
5
+ import { type Config, type UseDisconnectReturnType, type UseReconnectReturnType } from 'wagmi';
6
6
  import type { SwitchChainVariables } from 'wagmi/query';
7
7
  import { type FunkitUserInfo } from '../consts/funkit';
8
8
  /** AssetBalanceInfo with known price and totalUsdValue */
@@ -86,82 +86,18 @@ export declare const useFunkitAccount: () => {
86
86
  status: "connecting";
87
87
  };
88
88
  export declare const useFunkitUserInfo: () => FunkitUserInfo;
89
+ export type FunkitDisconnectReturnType = UseDisconnectReturnType & {
90
+ disconnect: () => Promise<void> | void;
91
+ disconnectAsync: () => Promise<void> | void;
92
+ };
89
93
  /**
90
94
  * Replacement for wagmi's `disconnect` from `useDisconnect`
91
95
  */
92
- export declare const useFunkitDisconnect: () => {
93
- disconnect: () => void;
94
- disconnectAsync: () => void;
95
- reset: () => void;
96
- error: null;
97
- data: undefined;
98
- status: "idle";
99
- isPaused: boolean;
100
- context: unknown;
101
- isError: false;
102
- isPending: false;
103
- isSuccess: false;
104
- failureCount: number;
105
- failureReason: import("@wagmi/core").DisconnectErrorType | null;
106
- variables: undefined;
107
- isIdle: true;
108
- submittedAt: number;
109
- connectors: readonly import("wagmi").Connector[];
110
- } | {
111
- disconnect: () => void;
112
- disconnectAsync: () => void;
113
- reset: () => void;
114
- error: null;
115
- data: undefined;
116
- status: "pending";
117
- isPaused: boolean;
118
- context: unknown;
119
- isError: false;
120
- isPending: true;
121
- isSuccess: false;
122
- failureCount: number;
123
- failureReason: import("@wagmi/core").DisconnectErrorType | null;
124
- variables: import("wagmi/query").DisconnectVariables;
125
- isIdle: false;
126
- submittedAt: number;
127
- connectors: readonly import("wagmi").Connector[];
128
- } | {
129
- disconnect: () => void;
130
- disconnectAsync: () => void;
131
- reset: () => void;
132
- error: import("@wagmi/core").DisconnectErrorType;
133
- data: undefined;
134
- status: "error";
135
- isPaused: boolean;
136
- context: unknown;
137
- isError: true;
138
- isPending: false;
139
- isSuccess: false;
140
- failureCount: number;
141
- failureReason: import("@wagmi/core").DisconnectErrorType | null;
142
- variables: import("wagmi/query").DisconnectVariables;
143
- isIdle: false;
144
- submittedAt: number;
145
- connectors: readonly import("wagmi").Connector[];
146
- } | {
147
- disconnect: () => void;
148
- disconnectAsync: () => void;
149
- reset: () => void;
150
- error: null;
151
- data: void;
152
- status: "success";
153
- isPaused: boolean;
154
- context: unknown;
155
- isError: false;
156
- isPending: false;
157
- isSuccess: true;
158
- failureCount: number;
159
- failureReason: import("@wagmi/core").DisconnectErrorType | null;
160
- variables: import("wagmi/query").DisconnectVariables;
161
- isIdle: false;
162
- submittedAt: number;
163
- connectors: readonly import("wagmi").Connector[];
164
- };
96
+ export declare const useFunkitDisconnect: () => FunkitDisconnectReturnType;
97
+ /**
98
+ * Replacement for wagmi's `useReconnect`
99
+ */
100
+ export declare const useFunkitReconnect: () => UseReconnectReturnType;
165
101
  /**
166
102
  * Replacement for wagmi's useSwitchChains
167
103
  */
@@ -21,7 +21,7 @@ export declare function useWalletConnectOpenState(): {
21
21
  isWalletConnectModalOpen: boolean;
22
22
  setIsWalletConnectModalOpen: (isWalletConnectModalOpen: boolean) => void;
23
23
  };
24
- export declare function useConnectModal(): {
24
+ export declare function useConnectModal(onClose?: () => void): {
25
25
  connectModalOpen: boolean;
26
26
  openConnectModal: ((walletsOnly?: boolean) => void) | undefined;
27
27
  };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  baseTheme,
4
4
  systemFontStack
5
- } from "../chunk-2C7D5NQG.js";
5
+ } from "../chunk-CRPOYQ6X.js";
6
6
  export {
7
7
  baseTheme,
8
8
  systemFontStack
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  darkTheme
4
- } from "../chunk-PKXUTXYG.js";
5
- import "../chunk-2C7D5NQG.js";
4
+ } from "../chunk-LEJS74SX.js";
5
+ import "../chunk-CRPOYQ6X.js";
6
6
  export {
7
7
  darkTheme
8
8
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  lightTheme
4
- } from "../chunk-QBCQK5KX.js";
5
- import "../chunk-2C7D5NQG.js";
4
+ } from "../chunk-C63T33UV.js";
5
+ import "../chunk-CRPOYQ6X.js";
6
6
  export {
7
7
  lightTheme
8
8
  };
@@ -1,12 +1,13 @@
1
- import { type CheckoutHistoryItem } from '@funkit/api-base';
1
+ import { type CheckoutHistoryItem, type CheckoutQuoteResponse } from '@funkit/api-base';
2
2
  import { type Config } from '@wagmi/core';
3
3
  import { type Address } from 'viem';
4
4
  import type { UseConfigReturnType } from 'wagmi';
5
5
  import type { ServerCheckoutConfig } from '~/domains/clientMetadata';
6
6
  import type { FunkitCheckoutQuoteResult } from '~/domains/quote';
7
- import type { FunkitActiveCheckoutItem, FunkitCheckoutActionParams, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
7
+ import type { FunkitCheckoutActionParams, FunkitCheckoutConfig } from '../providers/FunkitCheckoutContext';
8
8
  export declare const MOONPAY_TIME_ESTIMATE_MS = 120000;
9
9
  export declare const MESH_TIME_ESTIMATE_MS = 300000;
10
+ export declare const BANK_TIME_ESTIMATE_MS = 0;
10
11
  export declare const DUMMY_TRANSFER_PARAMS: {
11
12
  toAddress: "0x000000000000000000000000000000000000dEaD";
12
13
  tokenAmount: number;
@@ -52,7 +53,6 @@ export declare function getFunkitEnvForCheckoutEstimation({ chainId, bypassWalle
52
53
  bypassInit: boolean;
53
54
  apiKey?: string;
54
55
  nonce?: bigint | undefined;
55
- logger?: import("@funkit/api-base").Logger | undefined;
56
56
  fee?: {
57
57
  token?: string;
58
58
  amount?: number;
@@ -60,6 +60,7 @@ export declare function getFunkitEnvForCheckoutEstimation({ chainId, bypassWalle
60
60
  recipient: Address;
61
61
  } | undefined;
62
62
  skipDBAction?: boolean | undefined;
63
+ logger?: import("@funkit/api-base").Logger | undefined;
63
64
  };
64
65
  export type TokenInfo = {
65
66
  symbol: string;
@@ -100,6 +101,22 @@ export declare function getCheckoutItemDisplay({ checkoutConfig, hideAmount, }:
100
101
  checkoutConfig: FunkitCheckoutConfig | ServerCheckoutConfig;
101
102
  hideAmount?: boolean;
102
103
  }): string;
104
+ /**
105
+ * Given the result of a quote, calculate the effective fees (in source asset).
106
+ *
107
+ * _These are only the fees from our base quote, **not** including the initial transfer / brokerage / card processing fees._
108
+ */
109
+ export declare function getBaseQuoteTotalFeesFromAmount(baseQuote: CheckoutQuoteResponse): number;
110
+ /**
111
+ * Given the result of a quote, calculate the effective fees (in source asset).
112
+ *
113
+ * _These also including the initial transfer / brokerage / card processing fees._
114
+ */
115
+ export declare function getQuoteTotalFeesFromAmount(finalQuote: FunkitCheckoutQuoteResult): number;
116
+ /**
117
+ * Given the result of a quote, calculate the effective exchange rate (target asset / source asset).
118
+ */
119
+ export declare function getQuoteExchangeRate(config: FunkitCheckoutConfig, baseQuote: CheckoutQuoteResponse): number;
103
120
  /**
104
121
  * Given the result of a quote, estimate the maximum targetAssetAmount for which the checkout should succeed.
105
122
  * The result is then reduced by 1% to further reduce the risk of insufficient funds.
@@ -123,12 +140,5 @@ export declare function isCheckoutPostActionRequired(config: FunkitCheckoutConfi
123
140
  * @returns whether we should show the checkout to the user (ie. supported in current sdk version & not cancelled)
124
141
  */
125
142
  export declare const isCheckoutValid: (checkout: CheckoutHistoryItem) => boolean;
126
- /**
127
- * @returns true if the source and target are the same, a post action is required, is wallet balance, and is for vertex (for now)
128
- */
129
- export declare const isDirectExecutionFlow: ({ checkoutItem, apiKey, }: {
130
- checkoutItem: FunkitActiveCheckoutItem | null;
131
- apiKey: string;
132
- }) => boolean;
133
143
  export declare const isCheckoutHistoryDirectExecution: (checkoutId: string) => boolean;
134
144
  export {};
@@ -55,6 +55,25 @@ export declare const flagConfig: {
55
55
  value: true;
56
56
  }[];
57
57
  };
58
+ enable_fiat_deposit: {
59
+ type: "boolean";
60
+ default_value: false;
61
+ overrides: ({
62
+ if_any: {
63
+ key: "userId";
64
+ type: "isAnyOf";
65
+ values: string[];
66
+ }[];
67
+ value: true;
68
+ } | {
69
+ if_any: {
70
+ key: "apiKey";
71
+ type: "isAnyOf";
72
+ values: string[];
73
+ }[];
74
+ value: true;
75
+ })[];
76
+ };
58
77
  token_transfer_source_chains_and_assets: {
59
78
  type: "string";
60
79
  default_value: string;
@@ -117,6 +136,14 @@ export declare const flagConfig: {
117
136
  show_info_banner: {
118
137
  type: "string";
119
138
  default_value: string;
139
+ overrides: {
140
+ if_any: {
141
+ key: "apiKey";
142
+ type: "isAnyOf";
143
+ values: string[];
144
+ }[];
145
+ value: string;
146
+ }[];
120
147
  };
121
148
  checkout_notifications_refresh_interval: {
122
149
  type: "string";
@@ -124,11 +151,11 @@ export declare const flagConfig: {
124
151
  };
125
152
  display_solana_new_badge: {
126
153
  type: "boolean";
127
- default_value: true;
154
+ default_value: false;
128
155
  };
129
156
  display_solana_deposits_banner: {
130
157
  type: "boolean";
131
- default_value: true;
158
+ default_value: false;
132
159
  };
133
160
  token_transfer_new_tokens: {
134
161
  type: "string";
@@ -141,6 +168,14 @@ export declare const flagConfig: {
141
168
  is_relay_bypass_enabled: {
142
169
  type: "boolean";
143
170
  default_value: false;
171
+ overrides: {
172
+ if_any: {
173
+ key: "userId";
174
+ type: "isAnyOf";
175
+ values: string[];
176
+ }[];
177
+ value: true;
178
+ }[];
144
179
  };
145
180
  relay_bypass_source_chains_and_assets: {
146
181
  type: "string";
@@ -150,4 +185,16 @@ export declare const flagConfig: {
150
185
  type: "string";
151
186
  default_value: string;
152
187
  };
188
+ help_tutorial_url: {
189
+ type: "string";
190
+ default_value: string;
191
+ overrides: {
192
+ if_any: {
193
+ key: "apiKey";
194
+ type: "isAnyOf";
195
+ values: string[];
196
+ }[];
197
+ value: string;
198
+ }[];
199
+ };
153
200
  };
@@ -22,6 +22,8 @@ export type InferFlagType<F extends FlagConfig> = F['type'] extends 'number' ? n
22
22
  type Override<T> = {
23
23
  /** non-empty list of conditions, any condition will cause the value to match */
24
24
  if_any: Condition[];
25
+ /** non-empty list of conditions, all condition will cause the value to match */
26
+ if_all?: Condition[];
25
27
  value: T;
26
28
  };
27
29
  export type Condition = {