@funkit/connect 6.14.4 → 6.14.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/Dialog/Dialog.d.ts +2 -1
  3. package/dist/components/Dropdown/BaseDropdown.d.ts +2 -1
  4. package/dist/components/Dropdown/ChainDropdown.d.ts +2 -1
  5. package/dist/components/Dropdown/TokenDropdown.d.ts +5 -1
  6. package/dist/components/FunAlert/FunAlert.d.ts +2 -1
  7. package/dist/components/FunAsset/FunAssetItem.d.ts +2 -1
  8. package/dist/components/FunButton/FunButton.d.ts +2 -1
  9. package/dist/components/FunButton/FunIconButton.d.ts +2 -1
  10. package/dist/components/FunInput/FunInput.d.ts +1 -0
  11. package/dist/components/FunNotification/FunNotification.d.ts +2 -1
  12. package/dist/components/FunPaymentMethodItem/FunPaymentMethodItem.d.ts +4 -2
  13. package/dist/components/FunPayments/FunPaymentMethods.d.ts +6 -3
  14. package/dist/components/MeldQuoteItem/MeldQuoteItem.d.ts +2 -1
  15. package/dist/components/SourceMeldQuoteItem/SourceMeldQuoteItem.d.ts +2 -1
  16. package/dist/components/SourcePaymentMethodItem/SourcePaymentMethodItem.d.ts +2 -1
  17. package/dist/components/Text/Text.d.ts +1 -0
  18. package/dist/consts/customers.d.ts +1 -0
  19. package/dist/hooks/useCheckoutAccountBalanceTransfer.d.ts +1 -1
  20. package/dist/hooks/useIsUsUser.d.ts +1 -0
  21. package/dist/index.js +1968 -1736
  22. package/dist/modals/CheckoutModal/InputAmount/InputAmountLoaded.d.ts +2 -5
  23. package/dist/modals/CheckoutModal/InputAmount/state.d.ts +5 -1
  24. package/dist/modals/CheckoutModal/InputAmount/useAmountInput.d.ts +1 -2
  25. package/dist/modals/CheckoutModal/InputAmount/useMeld.d.ts +38 -0
  26. package/dist/modals/CheckoutModal/TransferToken/CheckoutNotifications.d.ts +1 -9
  27. package/dist/modals/CheckoutModal/TransferToken/types.d.ts +15 -0
  28. package/dist/modals/CheckoutModal/stepTransition.d.ts +1 -1
  29. package/dist/providers/FunkitCheckoutContext.d.ts +10 -0
  30. package/dist/utils/checkout.d.ts +1 -1
  31. package/dist/wallets/walletConnectors/index.js +51 -51
  32. package/package.json +5 -5
@@ -1,6 +1,6 @@
1
- import { type ExchangeRates } from '@funkit/api-base';
1
+ import type { ExchangeRates } from '@funkit/api-base';
2
2
  import React from 'react';
3
- import { type FunkitTextCustomizationsConfig } from '~/providers/FunkitConfigContext';
3
+ import type { FunkitTextCustomizationsConfig } from '~/providers/FunkitConfigContext';
4
4
  import type { AssetHoldingsItem } from '~/utils/assets';
5
5
  import type { FunkitCheckoutConfig } from '../../../providers/FunkitCheckoutContext';
6
6
  import { FunCheckoutStep, type ModalStepComponentProps } from '../stepTransition';
@@ -15,8 +15,5 @@ interface InputAmountLoadedProps extends ModalStepComponentProps<FunCheckoutStep
15
15
  defaultFiatCurrency?: string;
16
16
  textCustomizations: FunkitTextCustomizationsConfig['confirmationScreen'];
17
17
  }
18
- export declare function openMeldPopup(linkGetter: () => Promise<{
19
- widgetUrl: string;
20
- }>): Promise<void>;
21
18
  export declare function InputAmountLoaded({ checkoutConfig, modalState, onNext, onClose, sourceHolding, unitPrice, currencyExchangeRates, defaultFiatCurrency, textCustomizations, }: InputAmountLoadedProps): React.JSX.Element;
22
19
  export {};
@@ -47,6 +47,10 @@ export interface AmountInputState {
47
47
  fiatCurrencyExchangeRate: number | undefined;
48
48
  /** Whether meld is enabled */
49
49
  meldEnabled: boolean;
50
+ /** Whether the input amount is in vault deposit mode
51
+ * https://linear.app/funxyz/issue/CUS-142/product-enable-customers-to-pass-in-an-exchange-rate-for-vault
52
+ **/
53
+ isVaultDeposit: boolean;
50
54
  }
51
55
  /** Derived state includes additional fields that are pure functions of base state */
52
56
  export interface AmountInputDerivedState extends AmountInputState {
@@ -100,4 +104,4 @@ export type AmountInputError = {
100
104
  export declare function calcInitialFiatAmount(balance: number): number;
101
105
  export declare function initializeState({ checkoutConfig, defaultAmount, fiatCurrency, locale, maxUsd, minUsd, paymentMethod, quickOptions, sourceHolding, unitPrice: realUnitPrice, fiatCurrencyExchangeRate, meldEnabled, }: AmountInputInitOptions): AmountInputState;
102
106
  export declare function reduceState(state: AmountInputState, action: AmountInputAction): AmountInputState;
103
- export declare function getDerivedState(state: AmountInputState): AmountInputDerivedState;
107
+ export declare function getDerivedState(state: AmountInputState, targetAssetTicker: string): AmountInputDerivedState;
@@ -2,7 +2,7 @@ import { type RefObject } from 'react';
2
2
  import type { FunInputChangeEvent } from '~/components/FunInput/FunInput';
3
3
  import { type AmountInputDerivedState, type AmountInputInitOptions } from './state';
4
4
  import { type InputAmountSuggestion } from './utils';
5
- interface UseAmountInputResult extends AmountInputDerivedState {
5
+ export interface UseAmountInputResult extends AmountInputDerivedState {
6
6
  fontSize: number;
7
7
  inputWidth: number | undefined;
8
8
  onChange(event: FunInputChangeEvent): void;
@@ -13,4 +13,3 @@ interface UseAmountInputResult extends AmountInputDerivedState {
13
13
  toggleInputInFiat: () => void;
14
14
  }
15
15
  export declare function useAmountInput(options: AmountInputInitOptions): UseAmountInputResult;
16
- export {};
@@ -0,0 +1,38 @@
1
+ import { type MeldQuote, MeldServiceProvider } from '@funkit/api-base';
2
+ import React from 'react';
3
+ import type { ErrorNotification } from '~/components/FunNotification/FunNotification';
4
+ import { FunCheckoutStep, type NextPayload } from '../stepTransition';
5
+ export declare function useMeldUI({ meldEnabled, manuallySelectedQuote, fiatAmount, fiatCurrency, onNext, onClose, }: {
6
+ meldEnabled: boolean;
7
+ manuallySelectedQuote: MeldQuote | undefined;
8
+ fiatAmount: number | undefined;
9
+ fiatCurrency: string | undefined;
10
+ onNext: (data: NextPayload<FunCheckoutStep.INPUT_AMOUNT>) => void;
11
+ onClose: () => void;
12
+ }): {
13
+ getMeldFooter: () => React.JSX.Element;
14
+ handleMeldContinue: () => Promise<void>;
15
+ isMeldContinueDisabled: boolean | undefined;
16
+ isMeldLinkPending: boolean;
17
+ getMeldError: () => ErrorNotification | undefined;
18
+ };
19
+ export declare function useMeld(meldEnabled: boolean, manuallySelectedQuote: MeldQuote | undefined, usdAmount: number | undefined, fiatCurrency: string | undefined): {
20
+ meldQuotesQuery: import("@tanstack/react-query").UseQueryResult<MeldQuote[]> & {
21
+ isOutdated: boolean;
22
+ };
23
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@funkit/api-base").MeldCreateCryptoWidgetResponse, Error, MeldServiceProvider, unknown>;
24
+ isMeldLinkPending: boolean;
25
+ meldLimitError: {
26
+ issue: string;
27
+ suggestion: string;
28
+ } | undefined;
29
+ bestRateQuote: MeldQuote | undefined;
30
+ selectedQuote: MeldQuote | undefined;
31
+ isSelectedQuoteUnavailable: boolean | undefined;
32
+ isMeldMoonpaySelected: boolean;
33
+ isMeldContinueDisabled: boolean | undefined;
34
+ getMeldError: () => ErrorNotification | undefined;
35
+ };
36
+ export declare function openMeldPopup(linkGetter: () => Promise<{
37
+ widgetUrl: string;
38
+ }>): Promise<void>;
@@ -1,11 +1,3 @@
1
1
  import React from 'react';
2
- import type { Address } from 'viem';
3
- type NotificationVariant = 'withdrawal' | 'token_transfer';
4
- interface CheckoutNotificationsProps {
5
- onHelp: (depositAddress: Address) => void;
6
- /** To control notifications visibility on specific pages, without changing internal dismissal state */
7
- isVisible: boolean;
8
- variant: NotificationVariant | undefined;
9
- }
2
+ import type { CheckoutNotificationsProps } from './types';
10
3
  export declare const CheckoutNotifications: ({ onHelp, isVisible, variant, }: CheckoutNotificationsProps) => React.JSX.Element | null;
11
- export {};
@@ -0,0 +1,15 @@
1
+ import type { CheckoutHistoryItem, DirectExecution } from '@funkit/api-base';
2
+ import type { Address } from 'viem';
3
+ export type NotificationItem = (DirectExecution & {
4
+ isDirectExecution: true;
5
+ }) | (CheckoutHistoryItem & {
6
+ isDirectExecution: false;
7
+ });
8
+ type NotificationVariant = 'withdrawal' | 'token_transfer';
9
+ export interface CheckoutNotificationsProps {
10
+ onHelp: (depositAddress: Address) => void;
11
+ /** To control notifications visibility on specific pages, without changing internal dismissal state */
12
+ isVisible: boolean;
13
+ variant: NotificationVariant | undefined;
14
+ }
15
+ export {};
@@ -105,7 +105,7 @@ type CheckoutModalState<S extends FunCheckoutStep = FunCheckoutStep> = {
105
105
  step: T;
106
106
  };
107
107
  }[S];
108
- type NextPayload<S extends FunCheckoutStep = FunCheckoutStep> = {
108
+ export type NextPayload<S extends FunCheckoutStep = FunCheckoutStep> = {
109
109
  [FunCheckoutStep.CHECKOUT_HELP]: null;
110
110
  [FunCheckoutStep.CHECKOUT_COMPLETE]: CheckoutCompleteNext;
111
111
  [FunCheckoutStep.CONFIRMATION]: ConfirmationStepNext;
@@ -17,6 +17,14 @@ export interface DynamicTargetAssetCandidate extends TokenInfo {
17
17
  isDefault?: boolean;
18
18
  badgeText?: string;
19
19
  targetAssetMinAmount?: number;
20
+ /**
21
+ * Exchange rate of the target asset in terms of the staking token.
22
+ * Represents how many staking tokens one unit of the target asset can be exchanged for.
23
+ *
24
+ * Example: If `targetAsset`/`stakingToken` is USDT/hbUSDT and the rate is 1.01,
25
+ * 1 USDT can be exchanged for 1.01 hbUSDT.
26
+ */
27
+ stakingTokenRate?: number;
20
28
  }
21
29
  export declare enum FunCheckoutStartingStep {
22
30
  SOURCE_CHANGE = "source_change",
@@ -66,6 +74,8 @@ export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'gen
66
74
  /** For Checkout with Custom Action, QRCode needs special action type
67
75
  * to specify the onchain action to execute after deposit */
68
76
  qrcodeActionType?: string;
77
+ /** set this if you want enable vault like deposit*/
78
+ stakingToken?: DynamicTargetAssetCandidate;
69
79
  }
70
80
  export interface WithdrawalConfigBase {
71
81
  /** Title to show in the checkout modal. Defaults to "Checkout" **/
@@ -55,7 +55,6 @@ export declare function getFunkitEnvForCheckoutEstimation({ chainId, bypassWalle
55
55
  bypassInit: boolean;
56
56
  apiKey?: string;
57
57
  nonce?: bigint | undefined;
58
- logger?: import("@funkit/api-base").Logger | undefined;
59
58
  fee?: {
60
59
  token?: string;
61
60
  amount?: number;
@@ -63,6 +62,7 @@ export declare function getFunkitEnvForCheckoutEstimation({ chainId, bypassWalle
63
62
  recipient: Address;
64
63
  } | undefined;
65
64
  skipDBAction?: boolean | undefined;
65
+ logger?: import("@funkit/api-base").Logger | undefined;
66
66
  };
67
67
  export type TokenInfo = {
68
68
  symbol: string;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
- uniswapWallet
4
- } from "./chunk-LH7BMNFZ.js";
3
+ xdefiWallet
4
+ } from "./chunk-BOU4WKRZ.js";
5
5
  import {
6
6
  zerionWallet
7
7
  } from "./chunk-SULRQO27.js";
@@ -9,65 +9,65 @@ import {
9
9
  zealWallet
10
10
  } from "./chunk-RNBEDQHF.js";
11
11
  import {
12
- talismanWallet
13
- } from "./chunk-DRO6WYMM.js";
12
+ tahoWallet
13
+ } from "./chunk-ZZZRUXZE.js";
14
14
  import {
15
15
  subWallet
16
16
  } from "./chunk-JWFF4AAL.js";
17
17
  import {
18
- tahoWallet
19
- } from "./chunk-ZZZRUXZE.js";
18
+ talismanWallet
19
+ } from "./chunk-DRO6WYMM.js";
20
20
  import {
21
21
  tokenPocketWallet
22
22
  } from "./chunk-2L43XSW3.js";
23
- import {
24
- tokenaryWallet
25
- } from "./chunk-D6AOOO5F.js";
26
23
  import {
27
24
  trustWallet
28
25
  } from "./chunk-VYBAYMP3.js";
29
26
  import {
30
- xdefiWallet
31
- } from "./chunk-BOU4WKRZ.js";
27
+ tokenaryWallet
28
+ } from "./chunk-D6AOOO5F.js";
29
+ import {
30
+ uniswapWallet
31
+ } from "./chunk-LH7BMNFZ.js";
32
32
  import {
33
33
  walletConnectWallet
34
34
  } from "./chunk-NP5QGWNL.js";
35
35
  import {
36
- phantomWallet
37
- } from "./chunk-362NXNTM.js";
38
- import {
39
- rabbyWallet
40
- } from "./chunk-BBOM42DL.js";
36
+ oneKeyWallet
37
+ } from "./chunk-SHBUZ7U7.js";
41
38
  import {
42
39
  rainbowWallet
43
40
  } from "./chunk-2KUBG3S6.js";
44
- import {
45
- roninWallet
46
- } from "./chunk-NWIQNBJU.js";
47
41
  import {
48
42
  safeWallet
49
43
  } from "./chunk-BQQQL6UD.js";
50
- import {
51
- safepalWallet
52
- } from "./chunk-NT2HYJKW.js";
53
- import {
54
- safeheronWallet
55
- } from "./chunk-RZIO5TFF.js";
56
44
  import {
57
45
  ramperWallet
58
46
  } from "./chunk-BYXPFMI7.js";
59
47
  import {
60
- ledgerWallet
61
- } from "./chunk-BRBKM4PW.js";
48
+ metaMaskWallet
49
+ } from "./chunk-2HYNUNAS.js";
62
50
  import {
63
51
  kresusWallet
64
52
  } from "./chunk-MJXPRJZT.js";
65
53
  import {
66
- mewWallet
67
- } from "./chunk-OL5ZO7E4.js";
54
+ safeheronWallet
55
+ } from "./chunk-RZIO5TFF.js";
56
+ import {
57
+ safepalWallet
58
+ } from "./chunk-NT2HYJKW.js";
59
+ import {
60
+ ledgerWallet
61
+ } from "./chunk-BRBKM4PW.js";
68
62
  import {
69
63
  oktoWallet
70
64
  } from "./chunk-ADIXAKUL.js";
65
+ import {
66
+ omniWallet
67
+ } from "./chunk-7CUY5G6R.js";
68
+ import {
69
+ phantomWallet
70
+ } from "./chunk-362NXNTM.js";
71
71
  import {
72
72
  okxWallet
73
73
  } from "./chunk-TDIEHTMB.js";
@@ -75,17 +75,14 @@ import {
75
75
  oneInchWallet
76
76
  } from "./chunk-OESTDX6I.js";
77
77
  import {
78
- omniWallet
79
- } from "./chunk-7CUY5G6R.js";
80
- import {
81
- oneKeyWallet
82
- } from "./chunk-SHBUZ7U7.js";
78
+ roninWallet
79
+ } from "./chunk-NWIQNBJU.js";
83
80
  import {
84
- enkryptWallet
85
- } from "./chunk-OLOIXTYS.js";
81
+ rabbyWallet
82
+ } from "./chunk-BBOM42DL.js";
86
83
  import {
87
- frameWallet
88
- } from "./chunk-IFON7E6U.js";
84
+ foxWallet
85
+ } from "./chunk-7QONTUXT.js";
89
86
  import {
90
87
  frontierWallet
91
88
  } from "./chunk-TCAGNB4B.js";
@@ -95,18 +92,21 @@ import {
95
92
  import {
96
93
  imTokenWallet
97
94
  } from "./chunk-COZ7MIQS.js";
95
+ import {
96
+ enkryptWallet
97
+ } from "./chunk-OLOIXTYS.js";
98
98
  import {
99
99
  injectedWallet
100
100
  } from "./chunk-XWUJE7MW.js";
101
101
  import {
102
- metaMaskWallet
103
- } from "./chunk-2HYNUNAS.js";
104
- import {
105
- bitskiWallet
106
- } from "./chunk-HS3C7OQV.js";
102
+ mewWallet
103
+ } from "./chunk-OL5ZO7E4.js";
107
104
  import {
108
105
  bybitWallet
109
106
  } from "./chunk-2STUC6QL.js";
107
+ import {
108
+ clvWallet
109
+ } from "./chunk-M3NZ6R2E.js";
110
110
  import {
111
111
  coin98Wallet
112
112
  } from "./chunk-OBOVHCEI.js";
@@ -123,8 +123,8 @@ import {
123
123
  desigWallet
124
124
  } from "./chunk-OPAZMNA7.js";
125
125
  import {
126
- foxWallet
127
- } from "./chunk-7QONTUXT.js";
126
+ frameWallet
127
+ } from "./chunk-IFON7E6U.js";
128
128
  import {
129
129
  argentWallet
130
130
  } from "./chunk-WSQ2YJO2.js";
@@ -132,21 +132,21 @@ import {
132
132
  bifrostWallet
133
133
  } from "./chunk-A5N6B5UW.js";
134
134
  import {
135
- bloomWallet
136
- } from "./chunk-S27IADFU.js";
135
+ bitskiWallet
136
+ } from "./chunk-HS3C7OQV.js";
137
137
  import {
138
138
  bitgetWallet
139
139
  } from "./chunk-TDAVGY5F.js";
140
140
  import {
141
141
  bitverseWallet
142
142
  } from "./chunk-3HZRRP4Y.js";
143
+ import {
144
+ bloomWallet
145
+ } from "./chunk-S27IADFU.js";
146
+ import "./chunk-23WIEY36.js";
143
147
  import {
144
148
  braveWallet
145
149
  } from "./chunk-BPZ2XJO2.js";
146
- import {
147
- clvWallet
148
- } from "./chunk-M3NZ6R2E.js";
149
- import "./chunk-23WIEY36.js";
150
150
  import "./chunk-DNSG5Q7V.js";
151
151
  export {
152
152
  argentWallet,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "6.14.4",
3
+ "version": "6.14.5",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -92,12 +92,12 @@
92
92
  "ua-parser-js": "^1.0.37",
93
93
  "use-debounce": "^10.0.5",
94
94
  "uuid": "^9.0.1",
95
- "@funkit/core": "2.3.50",
96
- "@funkit/api-base": "1.12.5",
97
- "@funkit/wagmi-tools": "3.0.73",
95
+ "@funkit/api-base": "1.12.6",
98
96
  "@funkit/chains": "0.4.1",
97
+ "@funkit/core": "2.3.51",
99
98
  "@funkit/fun-relay": "2.0.4",
100
- "@funkit/utils": "1.1.12"
99
+ "@funkit/utils": "1.1.12",
100
+ "@funkit/wagmi-tools": "3.0.74"
101
101
  },
102
102
  "repository": {
103
103
  "type": "git",