@funkit/connect 6.14.11 → 6.14.13

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 (58) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/components/FunPayments/FunPaymentMethods.d.ts +11 -2
  3. package/dist/components/FunSelectBrokerage/FunBrokerageItem.css.d.ts +1 -0
  4. package/dist/components/FunSelectBrokerage/FunBrokerageItem.d.ts +8 -0
  5. package/dist/components/FunSelectBrokerage/FunSelectBrokerage.d.ts +9 -0
  6. package/dist/consts/bluvo.d.ts +37 -0
  7. package/dist/consts/customers.d.ts +1 -0
  8. package/dist/domains/asset.d.ts +2 -2
  9. package/dist/domains/fees.d.ts +5 -6
  10. package/dist/domains/paymentMethods.d.ts +10 -2
  11. package/dist/domains/quote.d.ts +2 -1
  12. package/dist/domains/wallet.d.ts +6 -2
  13. package/dist/hooks/track/CheckoutModalEvent.d.ts +30 -0
  14. package/dist/hooks/track/WithdrawModalEvent.d.ts +4 -1
  15. package/dist/hooks/track/useTrack.d.ts +1 -27
  16. package/dist/hooks/useBluvo.d.ts +225 -0
  17. package/dist/hooks/useCheckoutAccountBalanceTransfer.d.ts +1 -1
  18. package/dist/hooks/usePaymentSources.d.ts +1 -0
  19. package/dist/hooks/useTokenTransfer.d.ts +11 -0
  20. package/dist/index.css +32 -24
  21. package/dist/index.js +6899 -4955
  22. package/dist/modals/CheckoutModal/Brokerage/SelectBrokerage.d.ts +14 -0
  23. package/dist/modals/CheckoutModal/ConnectExchange.d.ts +12 -0
  24. package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +4 -1
  25. package/dist/modals/CheckoutModal/InputAmount/state.d.ts +3 -3
  26. package/dist/modals/CheckoutModal/InputAmount/utils.d.ts +2 -2
  27. package/dist/modals/CheckoutModal/MeshVerification.d.ts +48 -0
  28. package/dist/modals/CheckoutModal/SelectAsset.d.ts +4 -0
  29. package/dist/modals/CheckoutModal/TransferToken/CheckoutNotifications.track.d.ts +1 -1
  30. package/dist/modals/CheckoutModal/stepTransition.d.ts +11 -0
  31. package/dist/modals/CheckoutModal/stepTransition.track.d.ts +1 -1
  32. package/dist/providers/FunkitBrokerageProvider.d.ts +16 -0
  33. package/dist/providers/FunkitCheckoutContext.track.d.ts +4 -3
  34. package/dist/providers/FunkitConfigContext.d.ts +1 -0
  35. package/dist/providers/FunkitQuoteContext.track.d.ts +4 -2
  36. package/dist/utils/bluvo.d.ts +31 -0
  37. package/dist/utils/checkout.d.ts +2 -2
  38. package/dist/utils/flags/config.d.ts +62 -14
  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/clvWallet/clvWallet.js +2 -2
  43. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  44. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  45. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  46. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  47. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  48. package/dist/wallets/walletConnectors/index.js +47 -47
  49. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  50. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  51. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  52. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  53. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  54. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  55. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  56. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  57. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  58. package/package.json +9 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 6.14.13
4
+
5
+ ### Patch Changes
6
+
7
+ - b1477ac: feat: added tracking for closing withdrawal modal
8
+ - 1b21c9c: add exchange rate in tooltip
9
+ - 3dda7fc: feat(connect, api, apps): avantis theme
10
+ - 1fdce23: feat: added tracking for withdrawal quote on statsig
11
+ - 614c9e4: feat(connect,utils): add new feature flag for bluvo exchange
12
+ - 820d81e: fix(connect): indicate "Withdrawal tx" correctly after performing withdrawal
13
+ - b259fe8: refactor(connect): move checkout modal event to its own file
14
+ - 1e97461: feat(connect,utils): integrate bluvo quoting and fees
15
+ - c3e64b1: feat: added title placement config in FunkitConfig
16
+ - fa772a1: feat: added tracking of withdraw modal open
17
+ - 8bc8d04: feat: added tracking of withdrawal success
18
+ - 8fa45aa: feat(connect): update min deposit logic for brokerage flow - adheres to transfer token mins
19
+ - Updated dependencies [3dda7fc]
20
+ - Updated dependencies [977b232]
21
+ - Updated dependencies [614c9e4]
22
+ - Updated dependencies [1e97461]
23
+ - @funkit/api-base@1.12.11
24
+ - @funkit/fun-relay@2.1.3
25
+ - @funkit/utils@1.1.14
26
+ - @funkit/core@2.3.56
27
+ - @funkit/wagmi-tools@3.0.79
28
+
29
+ ## 6.14.12
30
+
31
+ ### Patch Changes
32
+
33
+ - 3b3fba8: feat: add isMobile flag to statsig log
34
+ - 985dd4c: show send amount in confirmation page
35
+ - 0fdee65: chore: move apiKey to statsig customID for better analytics
36
+ - 5a379cb: add missing function in server config
37
+ - a13f742: feat(connect,fun-relay): handle known Relay errors
38
+ - 2e4c75d: change label from deposit to receive
39
+ - Updated dependencies [a26c8c5]
40
+ - Updated dependencies [a13f742]
41
+ - Updated dependencies [a13f742]
42
+ - @funkit/api-base@1.12.10
43
+ - @funkit/core@2.3.55
44
+ - @funkit/fun-relay@2.1.2
45
+ - @funkit/wagmi-tools@3.0.78
46
+
3
47
  ## 6.14.11
4
48
 
5
49
  ### Patch Changes
@@ -1,10 +1,19 @@
1
1
  import React, { type ReactNode } from 'react';
2
- import { PaymentMethod, type PaymentMethodVirtualBankInfo } from '../../domains/paymentMethods';
2
+ import { PaymentMethod, type PaymentMethodBrokerageInfo, 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, showSelectedCheckmark, }: ConnectedMeshPaymentMethodItemProps) => React.JSX.Element;
8
17
  interface ConnectedPaymentMethodItemProps {
9
18
  isSelected: boolean;
10
19
  showSelectedCheckmark?: boolean;
@@ -27,7 +36,7 @@ type BasePaymentMethodItemProps = {
27
36
  export declare function AddPaymentMethodItem({ paymentMethod, isClickable, isActive, onClick, customValueIcon, testId, }: BasePaymentMethodItemProps & {
28
37
  paymentMethod: PaymentMethod;
29
38
  dynamicLimit?: string;
30
- }): React.JSX.Element | null | undefined;
39
+ }): React.JSX.Element | undefined;
31
40
  export declare function PayPalPaymentMethodItem({ isActive, isClickable, onClick, isLoading, }: BasePaymentMethodItemProps & {
32
41
  isLoading: boolean;
33
42
  }): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const brokerageItemStyle: string;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export interface FunBrokerageItemProps {
3
+ exchangeName: string;
4
+ exchangeIcon: React.ReactNode;
5
+ hasActiveConnection: boolean;
6
+ badgeText?: string | null;
7
+ }
8
+ export declare const FunBrokerageItem: ({ exchangeName, exchangeIcon, hasActiveConnection, badgeText, }: FunBrokerageItemProps) => React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { type BluvoExchangeType } from '~/consts/bluvo';
3
+ interface FunSelectBrokerageProps {
4
+ isDisabled?: boolean;
5
+ onSelect: (value: BluvoExchangeType) => void;
6
+ selectedValue: BluvoExchangeType | undefined;
7
+ }
8
+ export declare function FunSelectBrokerage({ isDisabled, onSelect, selectedValue, }: FunSelectBrokerageProps): React.JSX.Element;
9
+ export {};
@@ -0,0 +1,37 @@
1
+ import type { UseBluvoFlowHook } from '@bluvo/react';
2
+ export declare const BROKERAGE_MIN_TRANSFER: {
3
+ mainnet: number;
4
+ nonMainnet: number;
5
+ };
6
+ export type BluvoQuote = UseBluvoFlowHook['quote'];
7
+ export type BluvoWithdrawableBalance = UseBluvoFlowHook['walletBalances'];
8
+ export type BluvoWithdrawal = UseBluvoFlowHook['withdrawal'];
9
+ export declare enum BluvoExchangeType {
10
+ Coinbase = "coinbase",
11
+ Gemini = "gemini",
12
+ Kraken = "kraken"
13
+ }
14
+ type BluvoExchangeInfo = {
15
+ icon: (size: number) => JSX.Element | null;
16
+ name: string;
17
+ };
18
+ export declare enum BluvoExchangeStatus {
19
+ Live = "live",
20
+ Offline = "offline",
21
+ Maintenance = "maintenance",
22
+ ComingSoon = "coming_soon"
23
+ }
24
+ export declare const SUPPORTED_EXCHANGES: readonly [{
25
+ readonly exchange: BluvoExchangeType.Coinbase;
26
+ readonly status: BluvoExchangeStatus.Live;
27
+ }, {
28
+ readonly exchange: BluvoExchangeType.Kraken;
29
+ readonly status: BluvoExchangeStatus.ComingSoon;
30
+ }, {
31
+ readonly exchange: BluvoExchangeType.Gemini;
32
+ readonly status: BluvoExchangeStatus.ComingSoon;
33
+ }];
34
+ export declare const BLUVO_EXCHANGES: Readonly<Record<BluvoExchangeType, BluvoExchangeInfo>>;
35
+ export declare function getExchangeIcon(brokerType: BluvoExchangeType, size: number): JSX.Element | null;
36
+ export declare function getExchangeName(brokerType: BluvoExchangeType): string;
37
+ export {};
@@ -9,3 +9,4 @@ export declare function isHyperdashCustomer(apiKey: string): apiKey is "di9ZSqn1
9
9
  export declare function isMonkeyTiltCustomer(apiKey: string): apiKey is "2SrxurU07T2XPDxCAItjj4yYEMXlwV8K2kJB78AX";
10
10
  export declare function isBasedCustomer(apiKey: string): apiKey is "clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e";
11
11
  export declare function isHyenaCustomer(apiKey: string): apiKey is "pLQBJsA6zS9tg990rbdBD6UdABkWRv5O60vlrVcW";
12
+ export declare function isAvantisCustomer(apiKey: string): apiKey is "6TUi99Tq3O9MWj1IFX8Pv6spmPXzcvhy9NvBoeW2";
@@ -19,9 +19,9 @@ interface AssetUsableToPayParms {
19
19
  assetUsdAmount: number | null;
20
20
  loginType: LoginType;
21
21
  isAllowedForCheckout: boolean;
22
- minValueThreshold?: number;
22
+ minUsdRequired?: number;
23
23
  }
24
- export declare const isAssetUsableToPayForCheckout: ({ config, payerAddress, paymentMethod, targetChainId, targetTokenAddress, assetChainId, assetTokenAddress, assetUsdAmount, loginType, isAllowedForCheckout, }: AssetUsableToPayParms) => {
24
+ export declare const isAssetUsableToPayForCheckout: ({ config, payerAddress, paymentMethod, targetChainId, targetTokenAddress, assetChainId, assetTokenAddress, assetUsdAmount, loginType, isAllowedForCheckout, minUsdRequired, }: AssetUsableToPayParms) => {
25
25
  isUsable: boolean;
26
26
  reason: string;
27
27
  };
@@ -1,17 +1,14 @@
1
+ import type { WalletwithdrawquotequotationResponse as WithdrawalQuotation } from '@bluvo/sdk-ts';
1
2
  import type { CheckoutQuoteResponse } from '@funkit/utils';
2
3
  import type { Config } from 'wagmi';
3
4
  import { LoginType } from '~/providers/GeneralWalletProvider';
4
5
  import type { FunkitActiveCheckoutItem } from '../providers/FunkitCheckoutContext';
5
6
  import { PaymentMethod, type PaymentMethodInfo } from './paymentMethods';
6
7
  export interface BrokerageDetails {
7
- availableBalance: number;
8
- availableBalanceInFiat: number;
9
8
  isAboveMaximum: boolean;
10
9
  isBelowMinimum: boolean;
11
10
  maximumAmount: number | undefined | null;
12
- maximumAmountInFiat: number | undefined | null;
13
11
  minimumAmount: number;
14
- minimumAmountInFiat: number;
15
12
  }
16
13
  interface BaseCheckoutFees {
17
14
  paymentMethod: PaymentMethod;
@@ -36,7 +33,6 @@ interface CardCheckoutFees extends BaseCheckoutFees {
36
33
  interface BrokerageCheckoutFees extends BaseCheckoutFees {
37
34
  paymentMethod: PaymentMethod.BROKERAGE;
38
35
  exchangeFeeUsd: number;
39
- meshCostUsd: number;
40
36
  }
41
37
  export type CheckoutFees = WalletCheckoutFees | CardCheckoutFees | BrokerageCheckoutFees;
42
38
  interface EvaluateFeeBreakdownItem {
@@ -48,7 +44,10 @@ interface EvaluateFeeBreakdownItem {
48
44
  loginType: LoginType;
49
45
  isWithdrawal?: boolean;
50
46
  }
51
- export declare function evaluateFeeBreakdown(evalItem: EvaluateFeeBreakdownItem): Promise<{
47
+ export declare function evaluateFeeBreakdown(evalItem: EvaluateFeeBreakdownItem & {
48
+ brokerageQuote?: WithdrawalQuotation;
49
+ }): Promise<{
52
50
  fees: CheckoutFees;
51
+ brokerage?: BrokerageDetails;
53
52
  }>;
54
53
  export {};
@@ -1,11 +1,13 @@
1
1
  import type { BridgeCustomer, BridgeVirtualBankAccount } from '@funkit/api-base';
2
+ import { type BluvoExchangeType } from '~/consts/bluvo';
3
+ import type { BrokerageAssetHoldingsItem } from './wallet';
2
4
  /** Supported payment methods in FunkitConnect. **/
3
5
  export declare enum PaymentMethod {
4
6
  /** Meld - Credit / Debit Card **/
5
7
  CARD = "card",
6
8
  /** Account Balance **/
7
9
  ACCOUNT_BALANCE = "balance",
8
- /** Mesh - Exchange / Brokerage **/
10
+ /** Bluvo - Exchange / Brokerage **/
9
11
  BROKERAGE = "brokerage",
10
12
  TOKEN_TRANSFER = "token_transfer",
11
13
  VIRTUAL_BANK = "virtual_bank"
@@ -21,6 +23,9 @@ export interface PaymentMethodCardInfo extends PaymentMethodInfoBase {
21
23
  }
22
24
  export interface PaymentMethodBrokerageInfo extends PaymentMethodInfoBase {
23
25
  paymentMethod: PaymentMethod.BROKERAGE;
26
+ deviceId: string;
27
+ exchange: BluvoExchangeType;
28
+ asset?: Partial<BrokerageAssetHoldingsItem>;
24
29
  }
25
30
  export interface PaymentMethodAccountInfo extends PaymentMethodInfoBase {
26
31
  paymentMethod: PaymentMethod.ACCOUNT_BALANCE;
@@ -50,6 +55,9 @@ interface AccountPaymentMethodParams {
50
55
  }
51
56
  interface BrokeragePaymentMethodParams {
52
57
  paymentMethod: PaymentMethod.BROKERAGE;
58
+ deviceId: string;
59
+ exchange: BluvoExchangeType;
60
+ asset?: Partial<BrokerageAssetHoldingsItem>;
53
61
  }
54
62
  interface TokenTransferPaymentMethodParams {
55
63
  paymentMethod: PaymentMethod.TOKEN_TRANSFER;
@@ -66,8 +74,8 @@ interface VirtualBankPaymentMethodParams {
66
74
  }
67
75
  export declare function createPaymentMethodInfo(params: CardPaymentMethodParams): PaymentMethodCardInfo;
68
76
  export declare function createPaymentMethodInfo(params: AccountPaymentMethodParams): PaymentMethodAccountInfo;
69
- export declare function createPaymentMethodInfo(params: BrokeragePaymentMethodParams): PaymentMethodBrokerageInfo;
70
77
  export declare function createPaymentMethodInfo(params: TokenTransferPaymentMethodParams): PaymentMethodTokenTransferInfo;
71
78
  export declare function createPaymentMethodInfo(params: VirtualBankPaymentMethodIncompleteParams): PaymentMethodVirtualBankIncompleteInfo;
72
79
  export declare function createPaymentMethodInfo(params: VirtualBankPaymentMethodParams): PaymentMethodVirtualBankInfo;
80
+ export declare function createPaymentMethodInfo(params: BrokeragePaymentMethodParams): PaymentMethodBrokerageInfo;
73
81
  export {};
@@ -3,6 +3,7 @@ import type { Address } from 'viem';
3
3
  import type { Config } from 'wagmi';
4
4
  import type { FunkitActiveCheckoutItem } from '~/providers/FunkitCheckoutContext';
5
5
  import type { LoginType } from '~/providers/GeneralWalletProvider';
6
+ import type { WalletwithdrawquotequotationResponse as WithdrawalQuotation } from '@bluvo/sdk-ts';
6
7
  import type { FunkitDirectExecutionInfo } from '~/hooks/useCheckoutDirectExecution';
7
8
  import { type BrokerageDetails, type CheckoutFees } from './fees';
8
9
  import { type PaymentMethodInfo } from './paymentMethods';
@@ -11,7 +12,7 @@ export interface FunkitCheckoutQuoteResult extends Omit<ApiFunkitCheckoutQuoteRe
11
12
  finalFeesBreakdown: CheckoutFees;
12
13
  }
13
14
  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, isWithdrawal?: boolean): Promise<{
15
+ export declare function getQuoteFinalEstimation(baseQuote: CheckoutQuoteResponse, checkoutItem: FunkitActiveCheckoutItem, newPaymentMethodInfo: PaymentMethodInfo, wagmiConfig: Config, apiKey: string, loginType: LoginType, isWithdrawal?: boolean, brokerageQuote?: WithdrawalQuotation): Promise<{
15
16
  finalEstimation: FunkitCheckoutQuoteResult;
16
17
  brokerage?: BrokerageDetails;
17
18
  }>;
@@ -11,8 +11,12 @@ export interface AssetHoldingsItem {
11
11
  export interface KnownAssetHoldingsItem extends AssetHoldingsItem {
12
12
  usdAmount: number;
13
13
  }
14
- export interface AssetHoldingsMap {
15
- [symbol: string]: AssetHoldingsItem;
14
+ export interface BrokerageAssetHoldingsItem extends AssetHoldingsItem {
15
+ maxAmount: string;
16
+ minAmount: string;
17
+ }
18
+ export interface AssetHoldingsMap<T extends AssetHoldingsItem = AssetHoldingsItem> {
19
+ [symbol: string]: T;
16
20
  }
17
21
  /**
18
22
  * @returns formatted max usable USD balance from a given assets map
@@ -0,0 +1,30 @@
1
+ export declare enum CheckoutModalEvent {
2
+ MODAL_OPENED = "fc::modal_opened",
3
+ MODAL_CLOSED = "fc::modal_closed",
4
+ NAVIGATE_SOURCE_CHANGE = "fc::navigate::source_change",
5
+ NAVIGATE_SELECT_ASSET = "fc::navigate::select_asset",
6
+ NAVIGATE_CONFIRMATION = "fc::navigate::confirmation",
7
+ NAVIGATE_CHECKOUT_COMPLETE = "fc::navigate::checkout_complete",
8
+ NAVIGATE_TRANSFER_TOKEN = "fc::navigate::transfer_token",
9
+ NAVIGATE_INPUT_AMOUNT = "fc::navigate::input_amount",
10
+ NAVIGATE_ERROR_SCREEN = "fc::navigate::error_screen",
11
+ NAVIGATE_FIAT_ACCOUNT_DETAIL = "fc::navigate::fiat_account_detail",
12
+ NAVIGATE_BRIDGE_KYC = "fc::navigate::bridge_kyc",
13
+ NAVIGATE_BRIDGE_CUSTOMER = "fc::navigate::bridge_customer",
14
+ NAVIGATE_MOONPAY_SETUP = "fc::navigate::moonpay_setup",
15
+ NAVIGATE_MELD_QUOTES = "fc::navigate::meld_quotes",
16
+ NAVIGATE_MELD_REDIRECT = "fc::navigate::meld_redirect",
17
+ NAVIGATE_MELD_CURRENCY_SELECT = "fc::navigate::meld_currency_select",
18
+ NAVIGATE_DIRECT_EXECUTION_NOTIF_CENTER = "fc::navigate::direct_execution_notif_center",
19
+ NAVIGATE_KYC_IFRAME = "fc::navigate::kyc_iframe",
20
+ NAVIGATE_CREATE_FIAT_ACCOUNT = "fc::navigate::create_fiat_account",
21
+ NAVIGATE_LOADING_ACCOUNT = "fc::navigate::loading_account",
22
+ NAVIGATE_CHECKOUT_HELP = "fc::navigate::checkout_help",
23
+ NAVIGATE_SELECT_BROKERAGE = "fc::navigate::select_brokerage",
24
+ NAVIGATE_CONNECT_EXCHANGE = "fc::navigate::connect_exchange",
25
+ NAVIGATE_MESH_VERIFICATION = "fc::navigate::mesh_verification",
26
+ FINAL_QUOTE = "fc::quote::final_quote",
27
+ ACCOUNT_BALANCE_SUCCESS = "fc::success::account_balance",
28
+ TOKEN_TRANSFER_SUCCESS = "fc::success::token_transfer",
29
+ BLUVO_WITHDRAWAL_COMPLETED = "fc::success::bluvo_withdrawal_completed"
30
+ }
@@ -1,4 +1,7 @@
1
1
  export declare enum WithdrawModalEvent {
2
2
  MODAL_OPENED = "fw::modal_opened",
3
- MODAL_CLOSED = "fw::modal_closed"
3
+ MODAL_CLOSED = "fw::modal_closed",
4
+ FINAL_QUOTE = "fw::quote::final_quote",
5
+ PENDING_CALLBACK = "fw::pending_callback",
6
+ SUCCESS = "fw::success"
4
7
  }
@@ -1,32 +1,6 @@
1
1
  import type { FunkitUserInfo } from '~/consts/funkit';
2
+ import type { CheckoutModalEvent } from './CheckoutModalEvent';
2
3
  import type { WithdrawModalEvent } from './WithdrawModalEvent';
3
- export declare enum CheckoutModalEvent {
4
- MODAL_OPENED = "fc::modal_opened",
5
- MODAL_CLOSED = "fc::modal_closed",
6
- NAVIGATE_SOURCE_CHANGE = "fc::navigate::source_change",
7
- NAVIGATE_SELECT_ASSET = "fc::navigate::select_asset",
8
- NAVIGATE_CONFIRMATION = "fc::navigate::confirmation",
9
- NAVIGATE_CHECKOUT_COMPLETE = "fc::navigate::checkout_complete",
10
- NAVIGATE_TRANSFER_TOKEN = "fc::navigate::transfer_token",
11
- NAVIGATE_INPUT_AMOUNT = "fc::navigate::input_amount",
12
- NAVIGATE_ERROR_SCREEN = "fc::navigate::error_screen",
13
- NAVIGATE_FIAT_ACCOUNT_DETAIL = "fc::navigate::fiat_account_detail",
14
- NAVIGATE_BRIDGE_KYC = "fc::navigate::bridge_kyc",
15
- NAVIGATE_BRIDGE_CUSTOMER = "fc::navigate::bridge_customer",
16
- NAVIGATE_MOONPAY_SETUP = "fc::navigate::moonpay_setup",
17
- NAVIGATE_MELD_QUOTES = "fc::navigate::meld_quotes",
18
- NAVIGATE_MELD_REDIRECT = "fc::navigate::meld_redirect",
19
- NAVIGATE_MELD_CURRENCY_SELECT = "fc::navigate::meld_currency_select",
20
- NAVIGATE_DIRECT_EXECUTION_NOTIF_CENTER = "fc::navigate::direct_execution_notif_center",
21
- NAVIGATE_KYC_IFRAME = "fc::navigate::kyc_iframe",
22
- NAVIGATE_CREATE_FIAT_ACCOUNT = "fc::navigate::create_fiat_account",
23
- NAVIGATE_LOADING_ACCOUNT = "fc::navigate::loading_account",
24
- NAVIGATE_CHECKOUT_HELP = "fc::navigate::checkout_help",
25
- FINAL_QUOTE = "fc::quote::final_quote",
26
- ACCOUNT_BALANCE_SUCCESS = "fc::success::account_balance",
27
- TOKEN_TRANSFER_SUCCESS = "fc::success::token_transfer",
28
- WITHDRAWAL_SUCCESS = "fc::success::withdrawal"
29
- }
30
4
  export interface TrackEventData {
31
5
  eventName: CheckoutModalEvent | WithdrawModalEvent;
32
6
  value?: string | number;
@@ -0,0 +1,225 @@
1
+ import type { WalletwithdrawquotequotationResponse as WithdrawalQuotation } from '@bluvo/sdk-ts';
2
+ import { BluvoExchangeStatus, type BluvoExchangeType } from '~/consts/bluvo';
3
+ import { type FunkitActiveCheckoutItem } from '~/providers/FunkitCheckoutContext';
4
+ import type { FunBrokerageItemProps } from '../components/FunSelectBrokerage/FunBrokerageItem';
5
+ type SupportedExchangeOption = FunBrokerageItemProps & {
6
+ exchange: BluvoExchangeType;
7
+ status: BluvoExchangeStatus;
8
+ };
9
+ type BluvoCheckoutQuoteParams = {
10
+ chainId: FunkitActiveCheckoutItem['selectedSourceAssetInfo']['chainId'];
11
+ symbol: FunkitActiveCheckoutItem['selectedSourceAssetInfo']['symbol'];
12
+ amount: string;
13
+ };
14
+ export declare const useBluvoExchangeBalance: ({ exchange, }: {
15
+ exchange: BluvoExchangeType | undefined;
16
+ }) => {
17
+ data: import("~/domains/wallet").AssetHoldingsMap<import("~/domains/wallet").BrokerageAssetHoldingsItem>;
18
+ totalBalance: number;
19
+ isLoading: boolean;
20
+ isError: boolean;
21
+ };
22
+ export declare const useBluvoCheckoutQuote: () => {
23
+ getBluvoCheckoutQuote: ({ amount, symbol, chainId, }: BluvoCheckoutQuoteParams) => Promise<WithdrawalQuotation | undefined>;
24
+ };
25
+ export declare const useBluvoSupportedExchanges: ({ fullInfo, iconSize, filterBy, }: {
26
+ fullInfo?: boolean;
27
+ iconSize?: number;
28
+ filterBy?: BluvoExchangeStatus[];
29
+ }) => {
30
+ exchangeOptions: ReadonlyArray<SupportedExchangeOption>;
31
+ };
32
+ export declare const useBluvo: () => {
33
+ exchangeType: BluvoExchangeType | undefined;
34
+ bluvoClient: {
35
+ listExchanges: (status?: "live" | "offline" | "maintenance" | "coming_soon") => Promise<{
36
+ id: string;
37
+ name: string;
38
+ logoUrl: string;
39
+ status: import("@bluvo/sdk-ts").StatusEnum;
40
+ }[] | null>;
41
+ startWithdrawalFlow: (flowOptions: import("@bluvo/sdk-ts").WithdrawalFlowOptions) => Promise<{
42
+ machine: import("@bluvo/sdk-ts").Machine<import("@bluvo/sdk-ts").FlowState, import("@bluvo/sdk-ts").FlowActionType>;
43
+ closeOAuthWindow: null;
44
+ } | {
45
+ machine: import("@bluvo/sdk-ts").Machine<import("@bluvo/sdk-ts").FlowState, import("@bluvo/sdk-ts").FlowActionType>;
46
+ closeOAuthWindow: () => void;
47
+ }>;
48
+ resumeWithdrawalFlow: (flowOptions: import("@bluvo/sdk-ts").ResumeWithdrawalFlowOptions) => Promise<{
49
+ machine: import("@bluvo/sdk-ts").Machine<import("@bluvo/sdk-ts").FlowState, import("@bluvo/sdk-ts").FlowActionType>;
50
+ closeOAuthWindow: null;
51
+ }>;
52
+ silentResumeWithdrawalFlow: (flowOptions: import("@bluvo/sdk-ts").SilentResumeWithdrawalFlowOptions) => Promise<{
53
+ machine: import("@bluvo/sdk-ts").Machine<import("@bluvo/sdk-ts").FlowState, import("@bluvo/sdk-ts").FlowActionType>;
54
+ } | null>;
55
+ requestQuote: (options: import("@bluvo/sdk-ts").QuoteRequestOptions) => Promise<{
56
+ rawQuote: {
57
+ id: string;
58
+ asset: string;
59
+ amountWithFee?: number | null;
60
+ amountNoFee?: number | null;
61
+ estimatedFee?: number | null;
62
+ amountWithFeeInFiat?: number | null;
63
+ amountNoFeeInFiat?: number | null;
64
+ estimatedFeeInFiat?: number | null;
65
+ destinationAddress: string;
66
+ network?: string | null;
67
+ tag?: string | null;
68
+ estimatedTotal?: number;
69
+ feeDetails?: Array<{
70
+ category: import("@bluvo/sdk-ts").CategoryEnum;
71
+ currency: string;
72
+ amount: number;
73
+ amountInFiat: number;
74
+ fiatCurrency: string;
75
+ }>;
76
+ expiresAt: string;
77
+ additionalInfo: {
78
+ minWithdrawal: string | null;
79
+ maxWithdrawal?: string | null;
80
+ };
81
+ };
82
+ quoteData: {
83
+ id: string;
84
+ asset: string;
85
+ amount: string;
86
+ estimatedFee: string;
87
+ estimatedTotal: string;
88
+ amountWithFeeInFiat: string;
89
+ amountNoFeeInFiat: string;
90
+ estimatedFeeInFiat: string;
91
+ additionalInfo: {
92
+ minWithdrawal: string | null;
93
+ maxWithdrawal?: string | null;
94
+ };
95
+ expiresAt: number;
96
+ };
97
+ } | undefined>;
98
+ executeWithdrawal: (quoteId: string) => Promise<{
99
+ success: boolean;
100
+ error?: string;
101
+ type?: import("@bluvo/sdk-ts").TypeEnum2;
102
+ result?: unknown;
103
+ } | null | undefined>;
104
+ submit2FA: (code: string) => Promise<{
105
+ success: boolean;
106
+ error?: string;
107
+ type?: import("@bluvo/sdk-ts").TypeEnum2;
108
+ result?: unknown;
109
+ } | null | undefined>;
110
+ retryWithdrawal: () => Promise<{
111
+ success: boolean;
112
+ error?: string;
113
+ type?: import("@bluvo/sdk-ts").TypeEnum2;
114
+ result?: unknown;
115
+ } | null | undefined>;
116
+ cancel: () => void;
117
+ testWithdrawalComplete: (transactionId?: string) => void;
118
+ isIdle: boolean;
119
+ isFlowCancelled: boolean;
120
+ isExchangesLoading: boolean;
121
+ isExchangesReady: boolean;
122
+ isExchangesError: boolean;
123
+ exchangesError: Error | null;
124
+ isOAuthPending: boolean;
125
+ isOAuthWaiting: boolean;
126
+ isOAuthProcessing: boolean;
127
+ isOAuthError: boolean;
128
+ isOAuthFatal: boolean;
129
+ isWalletConnectionInvalid: boolean;
130
+ isOAuthComplete: boolean;
131
+ isOAuthWindowBeenClosedByTheUser: boolean;
132
+ isWalletLoading: boolean;
133
+ isWalletError: boolean;
134
+ isWalletReady: boolean;
135
+ isQuoteLoading: boolean;
136
+ isQuoteReady: boolean;
137
+ isQuoteExpired: boolean;
138
+ isQuoteError: boolean;
139
+ isWithdrawing: boolean;
140
+ isWithdrawProcessing: boolean;
141
+ isWithdrawalComplete: boolean;
142
+ isWithdrawBlocked: boolean;
143
+ hasFatalError: boolean;
144
+ requires2FA: boolean;
145
+ requiresSMS: boolean;
146
+ requiresKYC: boolean;
147
+ requiresValid2FAMethod: boolean;
148
+ requiresEmailVerification: boolean;
149
+ hasInsufficientBalance: boolean;
150
+ canRetry: boolean;
151
+ hasAmountError: boolean;
152
+ hasAddressError: boolean;
153
+ hasNetworkError: boolean;
154
+ hasWalletNotFoundError: boolean;
155
+ hasInvalidCredentialsError: boolean;
156
+ invalid2FAAttempts: number;
157
+ retryAttempts: number;
158
+ maxRetryAttempts: number;
159
+ exchanges: {
160
+ id: string;
161
+ name: string;
162
+ logoUrl: string;
163
+ status: string;
164
+ }[];
165
+ walletBalances: {
166
+ asset: string;
167
+ balance: string;
168
+ balanceInFiat?: string;
169
+ networks?: Array<{
170
+ id: string;
171
+ name: string;
172
+ displayName: string;
173
+ minWithdrawal: string;
174
+ maxWithdrawal?: string;
175
+ assetName: string;
176
+ addressRegex?: string | null;
177
+ }>;
178
+ extra?: {
179
+ slug?: string;
180
+ assetId?: string;
181
+ };
182
+ }[];
183
+ quote: {
184
+ id: string;
185
+ asset: string;
186
+ amount: string;
187
+ estimatedFee: string;
188
+ estimatedTotal: string;
189
+ amountWithFeeInFiat: string;
190
+ amountNoFeeInFiat: string;
191
+ estimatedFeeInFiat: string;
192
+ additionalInfo: {
193
+ minWithdrawal: string | null;
194
+ maxWithdrawal?: string | null;
195
+ };
196
+ expiresAt: number;
197
+ } | undefined;
198
+ withdrawal: {
199
+ id: string;
200
+ status: string;
201
+ transactionId?: string;
202
+ } | undefined;
203
+ valid2FAMethods: string[] | undefined;
204
+ client: import("@bluvo/sdk-ts").BluvoFlowClient;
205
+ state: import("@bluvo/sdk-ts").FlowState | null;
206
+ send: (action: import("@bluvo/sdk-ts").FlowActionType) => void;
207
+ isInState: (stateType: import("@bluvo/sdk-ts").FlowState["type"]) => boolean;
208
+ hasError: boolean;
209
+ error: Error | null | undefined;
210
+ context: (Record<string, any> & import("@bluvo/sdk-ts").FlowContext) | undefined;
211
+ };
212
+ isConnected: boolean;
213
+ walletId: string | undefined;
214
+ authorizedConnections: Partial<Record<BluvoExchangeType, string>>;
215
+ handleStartWithdrawal: (brokerType: BluvoExchangeType) => Promise<{
216
+ machine: import("@bluvo/sdk-ts").Machine<import("@bluvo/sdk-ts").FlowState, import("@bluvo/sdk-ts").FlowActionType>;
217
+ closeOAuthWindow: null;
218
+ } | {
219
+ machine: import("@bluvo/sdk-ts").Machine<import("@bluvo/sdk-ts").FlowState, import("@bluvo/sdk-ts").FlowActionType>;
220
+ closeOAuthWindow: () => void;
221
+ } | undefined>;
222
+ quoteExpiresAt: number | undefined;
223
+ };
224
+ export declare const useUnlinkBluvo: () => () => void;
225
+ export {};
@@ -14,7 +14,6 @@ export declare function useCheckoutAccountBalanceTransfer(): {
14
14
  bypassInit: boolean;
15
15
  apiKey?: string;
16
16
  nonce?: bigint | undefined;
17
- logger?: import("@funkit/api-base").Logger | undefined;
18
17
  fee?: {
19
18
  token?: string;
20
19
  amount?: number;
@@ -22,6 +21,7 @@ export declare function useCheckoutAccountBalanceTransfer(): {
22
21
  recipient: import("viem").Address;
23
22
  } | undefined;
24
23
  skipDBAction?: boolean | undefined;
24
+ logger?: import("@funkit/api-base").Logger | undefined;
25
25
  };
26
26
  } | {
27
27
  rFunWallet: null;
@@ -6,6 +6,7 @@ export declare function usePaymentMethodEnablement({ checkoutConfig, }: {
6
6
  isFiatEnabled: boolean;
7
7
  isTokenTransferEnabled: boolean;
8
8
  isCardEnabled: boolean;
9
+ isBrokerageEnabled: boolean;
9
10
  };
10
11
  export declare const usePaymentSources: (paymentMethodInfo: ConnectablePaymentMethodInfo | null, targetChainId: string, checkoutConfig?: FunkitCheckoutConfig) => {
11
12
  preferred: PaymentMethod[] | (import("~/domains/paymentMethods").PaymentMethodBrokerageInfo | import("~/domains/paymentMethods").PaymentMethodAccountInfo | import("~/domains/paymentMethods").PaymentMethodVirtualBankInfo)[];
@@ -21,4 +21,15 @@ interface UseTokenTransferResult {
21
21
  blockchain: 'ethereum' | 'solana' | 'bitcoin';
22
22
  }
23
23
  export declare const useTokenTransfer: (selectedChainId: number, selectedToken: string, chainIds?: number[]) => UseTokenTransferResult;
24
+ /**
25
+ * Differentiates limit for Canada/Australia users to avoid confusion with non american dollars
26
+ */
27
+ export declare const useMinTransferLimits: () => {
28
+ mainnet: number;
29
+ nonMainnet: number;
30
+ };
31
+ export declare function getMinTransferValueForChain(chainId: number, limits: {
32
+ mainnet: number;
33
+ nonMainnet: number;
34
+ }): number;
24
35
  export {};