@funkit/connect 6.15.3 → 6.15.4

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.
@@ -0,0 +1,4 @@
1
+ import i18n from 'i18next';
2
+ import type { Locale } from './index';
3
+ export declare const localeMapping: Record<Locale, string>;
4
+ export default i18n;
@@ -1 +1,2 @@
1
- export type Locale = 'ar' | 'ar-AR' | 'en' | 'en-US' | 'es' | 'es-419' | 'fr' | 'fr-FR' | 'hi' | 'hi-IN' | 'id' | 'id-ID' | 'ja' | 'ja-JP' | 'ko' | 'ko-KR' | 'pt' | 'pt-BR' | 'ru' | 'ru-RU' | 'th' | 'th-TH' | 'tr' | 'tr-TR' | 'ua' | 'uk-UA' | 'zh' | 'zh-CN';
1
+ export type Locale = 'en' | 'zh' | 'ko' | 'ja' | 'tr' | 'es' | 'ru';
2
+ export { default as i18n, localeMapping } from './i18n';
@@ -17,6 +17,5 @@ export type ConfirmationStepNext = {
17
17
  redirectBackToSourceChange?: boolean;
18
18
  };
19
19
  export declare const ConfirmationStepInfo: ModalStepInfo<FunCheckoutStep.CONFIRMATION>;
20
- export declare const DEFAULT_CONTINUE_TEXT = "Confirm Order";
21
20
  export declare function ConfirmationStep({ modalState, onNext, setModalState, }: ModalStepComponentProps<FunCheckoutStep.CONFIRMATION>): React.JSX.Element;
22
21
  export {};
@@ -1,3 +1,4 @@
1
+ import type { TFunction } from 'i18next';
1
2
  import type { Address } from 'viem';
2
3
  import type { ErrorNotification } from '~/components/FunNotification/FunNotification';
3
4
  export interface CheckoutConfirmationError extends ErrorNotification {
@@ -22,6 +23,6 @@ interface UseCheckoutConfirmationResult {
22
23
  handleCheckoutConfirmation(): Promise<void>;
23
24
  isConfirming: boolean;
24
25
  }
25
- export declare function toCheckoutConfirmationError(error: unknown): CheckoutConfirmationError;
26
+ export declare function toCheckoutConfirmationError(t: TFunction, error: unknown): CheckoutConfirmationError;
26
27
  export declare function useCheckoutConfirmation({ onError, onSuccess, }: UseCheckoutConfirmationOptions): UseCheckoutConfirmationResult;
27
28
  export {};
@@ -24,6 +24,5 @@ interface UsePostCheckoutResult {
24
24
  postCheckoutError: PostCheckoutError | null;
25
25
  postCheckoutStepMessage: string | null;
26
26
  }
27
- export declare function toPostCheckoutError(error: unknown): PostCheckoutError;
28
27
  export declare function usePostCheckout({ onSuccess, }: UsePostCheckoutOptions): UsePostCheckoutResult;
29
28
  export {};
@@ -1,5 +1,7 @@
1
1
  import type { ErrorNotification } from '~/components/FunNotification/FunNotification';
2
+ import type { useFunkitTranslation } from '~/hooks/useFunkitTranslation';
2
3
  import type { AmountInputError } from './state';
4
+ type TFunction = ReturnType<typeof useFunkitTranslation>['t'];
3
5
  export declare const ASSET_DECIMALS = 5;
4
6
  export declare const USD_DECIMALS = 2;
5
7
  export declare const USD_INITIAL_AMOUNT = 100;
@@ -15,8 +17,8 @@ export interface InputAmountSuggestion {
15
17
  * Get suggested amount from error
16
18
  * Allow recovery actions to user in the CTA Continue button
17
19
  */
18
- export declare const getInputAmountSuggestion: (error: AmountInputError | null) => InputAmountSuggestion | undefined;
19
- export declare const getInputErrorNotification: (error: AmountInputError | null) => ErrorNotification | undefined;
20
+ export declare const getInputAmountSuggestion: (error: AmountInputError | null, t: TFunction) => InputAmountSuggestion | undefined;
21
+ export declare const getInputErrorNotification: (error: AmountInputError | null, t: TFunction) => ErrorNotification | undefined;
20
22
  export type NumberSeparators = {
21
23
  decimalSeparator: string;
22
24
  groupSeparator: RegExp;
@@ -44,3 +46,4 @@ export declare function formatCurrencyAmountWithLocale(value: number, options: {
44
46
  export declare function replaceStringRange(original: string, replacement: string, start: number, end: number): string;
45
47
  export declare function reformatDecimalPart(decimalPart: string, decimals: number): string;
46
48
  export declare function reformatIntegerPart(integerPart: string, locale: Intl.LocalesArgument, preserveLeadingZeroes: boolean): string;
49
+ export {};
@@ -8,7 +8,7 @@ import type { ReactNode } from 'react';
8
8
  * - Query errors are discarded while the input amount is not equal to its debounced value.
9
9
  * - In that case, `isOutdated` is also set to `true`.
10
10
  */
11
- export declare const useMeldQuotes: (sourceAmount: number | undefined, fiatCurrency: string | undefined) => {
11
+ export declare const useMeldQuotes: (sourceAmount: number | undefined, fiatCurrency: string | undefined, meldEnabled?: boolean) => {
12
12
  countdown: ReactNode;
13
13
  query: UseQueryResult<MeldQuote[]> & {
14
14
  isOutdated: boolean;
@@ -0,0 +1,12 @@
1
+ import React, { type ReactNode } from 'react';
2
+ import { type Locale } from '~/locales';
3
+ interface FunkitI18nProviderProps {
4
+ children: ReactNode;
5
+ locale?: Locale;
6
+ }
7
+ /**
8
+ * Provider for internationalization using react-i18next
9
+ * Wraps the application with I18nextProvider and manages locale changes
10
+ */
11
+ export declare function FunkitI18nProvider({ children, locale, }: FunkitI18nProviderProps): React.JSX.Element;
12
+ export {};
@@ -16,7 +16,6 @@ interface FunkitProviderInnerProps {
16
16
  children: ReactNode;
17
17
  theme?: Theme;
18
18
  avatar?: AvatarComponent;
19
- /** @deprecated This currently has no effect, localization is not yet supported */
20
19
  locale?: Locale;
21
20
  funkitConfig: FunkitConfig;
22
21
  debug?: boolean | undefined;
@@ -308,6 +308,7 @@ export declare const flagConfig: {
308
308
  readonly type: "string";
309
309
  readonly default_value: string;
310
310
  };
311
+ /** @deprecated Use frog quoteConfig */
311
312
  readonly permit2_tokens: {
312
313
  readonly type: "string";
313
314
  readonly default_value: string;
@@ -0,0 +1,16 @@
1
+ import type { TFunction } from 'i18next';
2
+ /**
3
+ * Formats seconds to mins and seconds string with i18n support
4
+ * This is a translatable wrapper around the formatSecondsToReadableForm function
5
+ *
6
+ * @param seconds - Number of seconds to format
7
+ * @param t - Translation function from i18next
8
+ * @param specifyUnderMinute - If true, shows "< 1 min" for values under 60 seconds
9
+ * @param omitSeconds - If true, rounds up to nearest minute
10
+ * @returns Formatted and translated time string
11
+ *
12
+ * @example
13
+ * formatSecondsTranslated(20, t, true) // "< 1分钟" in Chinese or "< 1 min" in English
14
+ * formatSecondsTranslated(90, t) // "1分钟30秒" in Chinese or "1 min 30 s" in English
15
+ */
16
+ export declare function formatSecondsTranslated(seconds: number, t: TFunction, specifyUnderMinute?: boolean, omitSeconds?: boolean): string;
@@ -56,12 +56,12 @@ import {
56
56
  import {
57
57
  safepalWallet
58
58
  } from "./chunk-NT2HYJKW.js";
59
- import {
60
- ledgerWallet
61
- } from "./chunk-BRBKM4PW.js";
62
59
  import {
63
60
  metaMaskWallet
64
61
  } from "./chunk-2HYNUNAS.js";
62
+ import {
63
+ ledgerWallet
64
+ } from "./chunk-BRBKM4PW.js";
65
65
  import {
66
66
  mewWallet
67
67
  } from "./chunk-OL5ZO7E4.js";
@@ -125,12 +125,12 @@ import {
125
125
  import {
126
126
  enkryptWallet
127
127
  } from "./chunk-OLOIXTYS.js";
128
- import {
129
- bifrostWallet
130
- } from "./chunk-A5N6B5UW.js";
131
128
  import {
132
129
  argentWallet
133
130
  } from "./chunk-WSQ2YJO2.js";
131
+ import {
132
+ bifrostWallet
133
+ } from "./chunk-A5N6B5UW.js";
134
134
  import {
135
135
  bitgetWallet
136
136
  } from "./chunk-TDAVGY5F.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "6.15.3",
3
+ "version": "6.15.4",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -44,6 +44,7 @@
44
44
  "wagmi": "2.x"
45
45
  },
46
46
  "devDependencies": {
47
+ "i18next-cli": "1.24.14",
47
48
  "@aws-sdk/client-cloudfront": "3.858.0",
48
49
  "@aws-sdk/client-s3": "3.840.0",
49
50
  "@chromatic-com/storybook": "^4.1.1",
@@ -91,19 +92,21 @@
91
92
  "@vanilla-extract/sprinkles": "1.6.1",
92
93
  "@wagmi/core": "2.21.1",
93
94
  "clsx": "2.1.1",
95
+ "i18next": "25.6.2",
94
96
  "motion": "^12.0.11",
95
97
  "qrcode": "1.5.3",
98
+ "react-i18next": "16.3.3",
96
99
  "react-remove-scroll": "2.5.7",
97
100
  "react-virtuoso": "4.10.1",
98
101
  "ua-parser-js": "^1.0.37",
99
102
  "use-debounce": "^10.0.5",
100
103
  "uuid": "^9.0.1",
101
- "@funkit/api-base": "1.12.16",
102
- "@funkit/chains": "0.4.5",
103
- "@funkit/core": "2.3.61",
104
- "@funkit/fun-relay": "2.1.12",
105
- "@funkit/utils": "1.1.17",
106
- "@funkit/wagmi-tools": "3.0.84"
104
+ "@funkit/api-base": "1.12.17",
105
+ "@funkit/chains": "0.4.6",
106
+ "@funkit/core": "2.3.62",
107
+ "@funkit/fun-relay": "2.1.13",
108
+ "@funkit/utils": "1.1.18",
109
+ "@funkit/wagmi-tools": "3.0.85"
107
110
  },
108
111
  "repository": {
109
112
  "type": "git",