@funkit/connect 6.14.10 → 6.14.12

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 (35) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/components/FunCheckoutHistory/FunDirectExecutionHistoryDetail.d.ts +2 -1
  3. package/dist/components/FunPayments/FunPaymentMethods.d.ts +1 -1
  4. package/dist/components/FunSelectBrokerage/FunBrokerageItem.css.d.ts +1 -0
  5. package/dist/components/FunSelectBrokerage/FunBrokerageItem.d.ts +8 -0
  6. package/dist/components/FunSelectBrokerage/FunSelectBrokerage.d.ts +9 -0
  7. package/dist/components/YouPayYouReceive/YouPayYouReceive.d.ts +4 -1
  8. package/dist/consts/bluvo.d.ts +15 -0
  9. package/dist/domains/paymentMethods.d.ts +9 -1
  10. package/dist/domains/wallet.d.ts +6 -2
  11. package/dist/hooks/queries/useRecentDirectExecutions.d.ts +9 -1
  12. package/dist/hooks/track/WithdrawModalEvent.d.ts +4 -0
  13. package/dist/hooks/track/useTrack.d.ts +4 -1
  14. package/dist/hooks/useBluvo.d.ts +24 -0
  15. package/dist/hooks/useCheckoutDirectExecutionHistory.d.ts +10 -0
  16. package/dist/hooks/usePaymentSources.d.ts +1 -0
  17. package/dist/index.css +18 -10
  18. package/dist/index.js +3078 -2346
  19. package/dist/modals/CheckoutModal/Brokerage/SelectBrokerage.d.ts +10 -0
  20. package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +3 -1
  21. package/dist/modals/CheckoutModal/InputAmount/InputAmount.d.ts +2 -1
  22. package/dist/modals/CheckoutModal/MeldCurrencySelect/utils.d.ts +1 -0
  23. package/dist/modals/CheckoutModal/MeldRedirect/MeldRedirect.d.ts +14 -0
  24. package/dist/modals/CheckoutModal/TransferToken/DirectExecutionNotification.d.ts +2 -2
  25. package/dist/modals/CheckoutModal/TransferToken/types.d.ts +3 -2
  26. package/dist/modals/CheckoutModal/stepTransition.d.ts +6 -0
  27. package/dist/providers/FunkitBrokerageProvider.d.ts +14 -0
  28. package/dist/providers/FunkitCheckoutContext.d.ts +1 -1
  29. package/dist/providers/FunkitCheckoutContext.track.d.ts +4 -3
  30. package/dist/utils/bluvo.d.ts +7 -0
  31. package/dist/utils/directExecution.d.ts +1 -0
  32. package/dist/utils/flags/config.d.ts +2 -9
  33. package/dist/utils/safeJSON.d.ts +1 -0
  34. package/dist/wallets/walletConnectors/index.js +47 -47
  35. package/package.json +8 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 6.14.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 3b3fba8: feat: add isMobile flag to statsig log
8
+ - 985dd4c: show send amount in confirmation page
9
+ - 0fdee65: chore: move apiKey to statsig customID for better analytics
10
+ - 5a379cb: add missing function in server config
11
+ - a13f742: feat(connect,fun-relay): handle known Relay errors
12
+ - 2e4c75d: change label from deposit to receive
13
+ - Updated dependencies [a26c8c5]
14
+ - Updated dependencies [a13f742]
15
+ - Updated dependencies [a13f742]
16
+ - @funkit/api-base@1.12.10
17
+ - @funkit/core@2.3.55
18
+ - @funkit/fun-relay@2.1.2
19
+ - @funkit/wagmi-tools@3.0.78
20
+
21
+ ## 6.14.11
22
+
23
+ ### Patch Changes
24
+
25
+ - 953fb4c: feat: add eusde icon
26
+ - b96de20: feat(connect): merge multi-step direct execution notification data
27
+ - 175deb9: feat(connect): add Meld redirect state screen
28
+ - 071fbbf: refactor: remove initNewCheckout from beginWithdrawal
29
+ - d01122c: feat: add wusde icon
30
+ - 071fbbf: refactor(connect): added WithdrawModalEvent for tracking opening of withdrawal modal
31
+ - 569094d: fix: apply getMinDepositUSD to transfer checkout
32
+ - 0914811: audit and performance improvements
33
+ - Updated dependencies [96408f4]
34
+ - @funkit/api-base@1.12.9
35
+ - @funkit/core@2.3.54
36
+ - @funkit/wagmi-tools@3.0.77
37
+
3
38
  ## 6.14.10
4
39
 
5
40
  ### Patch Changes
@@ -1,5 +1,6 @@
1
1
  import type { DirectExecution } from '@funkit/api-base';
2
2
  import React from 'react';
3
+ import type { MergedMultiStepDirectExecution } from '~/hooks/queries/useRecentDirectExecutions';
3
4
  export declare function FunDirectExecutionHistoryDetail({ bottomBarId, directExecution, isActiveCheckout, onClose, onAnimationComplete, }: {
4
5
  bottomBarId: string;
5
6
  directExecution: DirectExecution;
@@ -10,5 +11,5 @@ export declare function FunDirectExecutionHistoryDetail({ bottomBarId, directExe
10
11
  onAnimationComplete?: (callback: () => void) => void;
11
12
  }): React.JSX.Element;
12
13
  export declare function DirectExecutionOrderDetailSection({ directExecution, }: {
13
- directExecution: DirectExecution;
14
+ directExecution: MergedMultiStepDirectExecution;
14
15
  }): React.JSX.Element;
@@ -27,7 +27,7 @@ type BasePaymentMethodItemProps = {
27
27
  export declare function AddPaymentMethodItem({ paymentMethod, isClickable, isActive, onClick, customValueIcon, testId, }: BasePaymentMethodItemProps & {
28
28
  paymentMethod: PaymentMethod;
29
29
  dynamicLimit?: string;
30
- }): React.JSX.Element | null | undefined;
30
+ }): React.JSX.Element | undefined;
31
31
  export declare function PayPalPaymentMethodItem({ isActive, isClickable, onClick, isLoading, }: BasePaymentMethodItemProps & {
32
32
  isLoading: boolean;
33
33
  }): 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
+ fullInfo: boolean;
6
+ hasActiveConnection: boolean;
7
+ }
8
+ export declare const FunBrokerageItem: ({ exchangeName, exchangeIcon, fullInfo, hasActiveConnection, }: 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 {};
@@ -2,16 +2,19 @@ import React from 'react';
2
2
  interface YouPayYouReceiveProps {
3
3
  payLabel?: string;
4
4
  receiveLabel?: string;
5
+ fiatCurrencyLabel?: string;
5
6
  payTokenSymbol: string;
6
7
  receiveTokenSymbol: string;
8
+ fiatCurrencySymbol?: string;
7
9
  payTokenIconSrc: string;
8
10
  receiveTokenIconSrc: string;
9
11
  payTokenChainId?: string;
10
12
  receiveTokenChainId?: string;
11
13
  showYouPaySection?: boolean;
14
+ showFiatCurrencySection?: boolean;
12
15
  prioritizeDefaults?: boolean;
13
16
  }
14
- export declare const YouPayYouReceive: ({ payLabel, receiveLabel, payTokenSymbol, receiveTokenSymbol, payTokenIconSrc, receiveTokenIconSrc, payTokenChainId, receiveTokenChainId, showYouPaySection, prioritizeDefaults, }: YouPayYouReceiveProps) => React.JSX.Element;
17
+ export declare const YouPayYouReceive: ({ payLabel, receiveLabel, fiatCurrencyLabel, payTokenSymbol, receiveTokenSymbol, fiatCurrencySymbol, payTokenIconSrc, receiveTokenIconSrc, payTokenChainId, receiveTokenChainId, showYouPaySection, showFiatCurrencySection, prioritizeDefaults, }: YouPayYouReceiveProps) => React.JSX.Element;
15
18
  export declare const YouPayYouReceiveBottomBarLayoutWrapper: ({ children, }: {
16
19
  children: React.ReactNode;
17
20
  }) => React.JSX.Element;
@@ -0,0 +1,15 @@
1
+ import type { UseBluvoFlowHook } from '@bluvo/react';
2
+ export type BluvoQuote = UseBluvoFlowHook['quote'];
3
+ export declare enum BluvoExchangeType {
4
+ Coinbase = "coinbase",
5
+ Gemini = "gemini",
6
+ Kraken = "kraken"
7
+ }
8
+ type BluvoExchangeInfo = {
9
+ icon: (size: number) => JSX.Element | null;
10
+ name: string;
11
+ };
12
+ export declare const BLUVO_EXCHANGES: Readonly<Record<BluvoExchangeType, BluvoExchangeInfo>>;
13
+ export declare function getExchangeIcon(brokerType: BluvoExchangeType, size: number): JSX.Element | null;
14
+ export declare function getExchangeName(brokerType: BluvoExchangeType): string;
15
+ 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;
@@ -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
@@ -3,10 +3,18 @@ interface RecentDirectExecutionsQuery {
3
3
  isVisible: boolean;
4
4
  filterFunc?: (de: DirectExecution) => boolean;
5
5
  }
6
+ export interface MergedMultiStepDirectExecution extends DirectExecution {
7
+ /**
8
+ * In a multi-step DE chain, represents the latest **present** DE of the chain.
9
+ *
10
+ * Always `undefined` for single-step DEs.
11
+ */
12
+ latestStep?: DirectExecution;
13
+ }
6
14
  export declare function isTokenTransferDirectExecution(de: DirectExecution): boolean;
7
15
  export declare function isWithdrawalDirectExecution(de: DirectExecution): boolean;
8
16
  /**
9
17
  * @returns recent direct executions tied to a recipient address used in the token transfer flow
10
18
  */
11
- export declare const useRecentDirectExecutions: ({ isVisible, filterFunc, }: RecentDirectExecutionsQuery) => import("@tanstack/react-query").UseQueryResult<DirectExecution[], Error>;
19
+ export declare const useRecentDirectExecutions: ({ isVisible, filterFunc, }: RecentDirectExecutionsQuery) => import("@tanstack/react-query").UseQueryResult<MergedMultiStepDirectExecution[], Error>;
12
20
  export {};
@@ -0,0 +1,4 @@
1
+ export declare enum WithdrawModalEvent {
2
+ MODAL_OPENED = "fw::modal_opened",
3
+ MODAL_CLOSED = "fw::modal_closed"
4
+ }
@@ -1,4 +1,5 @@
1
1
  import type { FunkitUserInfo } from '~/consts/funkit';
2
+ import type { WithdrawModalEvent } from './WithdrawModalEvent';
2
3
  export declare enum CheckoutModalEvent {
3
4
  MODAL_OPENED = "fc::modal_opened",
4
5
  MODAL_CLOSED = "fc::modal_closed",
@@ -14,19 +15,21 @@ export declare enum CheckoutModalEvent {
14
15
  NAVIGATE_BRIDGE_CUSTOMER = "fc::navigate::bridge_customer",
15
16
  NAVIGATE_MOONPAY_SETUP = "fc::navigate::moonpay_setup",
16
17
  NAVIGATE_MELD_QUOTES = "fc::navigate::meld_quotes",
18
+ NAVIGATE_MELD_REDIRECT = "fc::navigate::meld_redirect",
17
19
  NAVIGATE_MELD_CURRENCY_SELECT = "fc::navigate::meld_currency_select",
18
20
  NAVIGATE_DIRECT_EXECUTION_NOTIF_CENTER = "fc::navigate::direct_execution_notif_center",
19
21
  NAVIGATE_KYC_IFRAME = "fc::navigate::kyc_iframe",
20
22
  NAVIGATE_CREATE_FIAT_ACCOUNT = "fc::navigate::create_fiat_account",
21
23
  NAVIGATE_LOADING_ACCOUNT = "fc::navigate::loading_account",
22
24
  NAVIGATE_CHECKOUT_HELP = "fc::navigate::checkout_help",
25
+ NAVIGATE_SELECT_BROKERAGE = "fc::navigate::select_brokerage",
23
26
  FINAL_QUOTE = "fc::quote::final_quote",
24
27
  ACCOUNT_BALANCE_SUCCESS = "fc::success::account_balance",
25
28
  TOKEN_TRANSFER_SUCCESS = "fc::success::token_transfer",
26
29
  WITHDRAWAL_SUCCESS = "fc::success::withdrawal"
27
30
  }
28
31
  export interface TrackEventData {
29
- eventName: CheckoutModalEvent;
32
+ eventName: CheckoutModalEvent | WithdrawModalEvent;
30
33
  value?: string | number;
31
34
  metadata?: object;
32
35
  }
@@ -0,0 +1,24 @@
1
+ import type { WithdrawalQuotation } from '@bluvo/sdk-ts';
2
+ import { BluvoExchangeType } from '~/consts/bluvo';
3
+ import type { FunBrokerageItemProps } from '../components/FunSelectBrokerage/FunBrokerageItem';
4
+ type SupportedExchangeOption = FunBrokerageItemProps & {
5
+ exchange: BluvoExchangeType;
6
+ };
7
+ export declare const useBluvoExchangeBalance: ({ exchange, }: {
8
+ exchange: BluvoExchangeType | undefined;
9
+ }) => {
10
+ data: import("../domains/wallet").AssetHoldingsMap<import("../domains/wallet").BrokerageAssetHoldingsItem>;
11
+ totalBalance: number;
12
+ isLoading: boolean;
13
+ isError: boolean;
14
+ };
15
+ export declare const useBluvoCheckoutQuote: () => {
16
+ getBluvoCheckoutQuote: (amount: string) => Promise<WithdrawalQuotation | undefined>;
17
+ };
18
+ export declare const useBluvoSupportedExchanges: ({ fullInfo, iconSize, }: {
19
+ fullInfo?: boolean;
20
+ iconSize?: number;
21
+ }) => {
22
+ exchangeOptions: ReadonlyArray<SupportedExchangeOption>;
23
+ };
24
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { CheckoutRefundState, CheckoutState, type DirectExecution, RelayExecutionStatus } from '@funkit/api-base';
2
+ import type { MergedMultiStepDirectExecution } from './queries/useRecentDirectExecutions';
2
3
  export declare function mapRelayExecutionStatusToCheckoutState(status: RelayExecutionStatus): CheckoutState;
3
4
  export declare function mapRelayExecutionStatusToRefundState(status: RelayExecutionStatus): CheckoutRefundState | undefined;
4
5
  export declare function useCheckoutDirectExecutionHistory({ initDirectExecution, }: {
@@ -12,3 +13,12 @@ export declare function useCheckoutDirectExecutionHistory({ initDirectExecution,
12
13
  isDelayed: boolean;
13
14
  isProcessing: boolean;
14
15
  };
16
+ export declare function useMultiStepDirectExecutionStatus(multiStepDirectExecution: MergedMultiStepDirectExecution): {
17
+ isCompleted: boolean;
18
+ isDelayed: boolean;
19
+ isFailed: boolean;
20
+ isFinalStep: boolean;
21
+ isProcessing: boolean;
22
+ isRefunded: boolean;
23
+ latestDirectExecution: DirectExecution;
24
+ };
@@ -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)[];
package/dist/index.css CHANGED
@@ -9908,6 +9908,24 @@
9908
9908
  animation-name: stgjxld;
9909
9909
  }
9910
9910
 
9911
+ /* vanilla-extract-css-ns:src/css/scrollStyles.css.ts.vanilla.css?source=Ll8xNjNlaG1rMDo6LXdlYmtpdC1zY3JvbGxiYXIgewogIGRpc3BsYXk6IG5vbmU7Cn0KLl8xNjNlaG1rMSB7CiAgbWF4LWhlaWdodDogMzYwcHg7CiAgb3ZlcmZsb3cteTogYXV0bzsKICBvdmVyZmxvdy14OiBoaWRkZW47Cn0= */
9912
+ [data-rk] ._163ehmk0::-webkit-scrollbar {
9913
+ display: none;
9914
+ }
9915
+ [data-rk] ._163ehmk1 {
9916
+ max-height: 360px;
9917
+ overflow-y: auto;
9918
+ overflow-x: hidden;
9919
+ }
9920
+
9921
+ /* vanilla-extract-css-ns:src/components/FunSelectBrokerage/FunBrokerageItem.css.ts.vanilla.css?source=LmFuMzR5OTAgewogIGRpc3BsYXk6IGZsZXg7CiAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuOwogIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAgZmxleDogMTsKfQ== */
9922
+ [data-rk] .an34y90 {
9923
+ display: flex;
9924
+ justify-content: space-between;
9925
+ align-items: center;
9926
+ flex: 1;
9927
+ }
9928
+
9911
9929
  /* vanilla-extract-css-ns:src/components/FunCheckoutHistory/FunCheckoutHistoryTransaction.css.ts.vanilla.css?source=Lm14dmF0aTAgewogIGN1cnNvcjogcG9pbnRlcjsKfQoubXh2YXRpMDpmb2N1cy12aXNpYmxlIHsKICBvdXRsaW5lOiAxcHggc29saWQ7CiAgb3V0bGluZS1jb2xvcjogdmFyKC0tcmstY29sb3JzLXRlcnRpYXJ5VGV4dCk7Cn0= */
9912
9930
  [data-rk] .mxvati0 {
9913
9931
  cursor: pointer;
@@ -9971,16 +9989,6 @@
9971
9989
  var(--rk-colors-offBackground) 91.45%);
9972
9990
  }
9973
9991
 
9974
- /* vanilla-extract-css-ns:src/css/scrollStyles.css.ts.vanilla.css?source=Ll8xNjNlaG1rMDo6LXdlYmtpdC1zY3JvbGxiYXIgewogIGRpc3BsYXk6IG5vbmU7Cn0KLl8xNjNlaG1rMSB7CiAgbWF4LWhlaWdodDogMzYwcHg7CiAgb3ZlcmZsb3cteTogYXV0bzsKICBvdmVyZmxvdy14OiBoaWRkZW47Cn0= */
9975
- [data-rk] ._163ehmk0::-webkit-scrollbar {
9976
- display: none;
9977
- }
9978
- [data-rk] ._163ehmk1 {
9979
- max-height: 360px;
9980
- overflow-y: auto;
9981
- overflow-x: hidden;
9982
- }
9983
-
9984
9992
  /* vanilla-extract-css-ns:src/components/FunPayments/FunPaymentMoonpayType.css.ts.vanilla.css?source=Ll8xa21wZXlmMCB7CiAgaGVpZ2h0OiB1bnNldCAhaW1wb3J0YW50OwogIHdpZHRoOiB1bnNldCAhaW1wb3J0YW50OwogIGZsZXg6IDEgIWltcG9ydGFudDsKfQouXzFrbXBleWYwIGlmcmFtZSB7CiAgYm9yZGVyOiBub25lOwp9Ci5fMWttcGV5ZjEgewogIGRpc3BsYXk6IGZsZXg7CiAgZmxleDogMTsKfQ== */
9985
9993
  [data-rk] ._1kmpeyf0 {
9986
9994
  height: unset !important;