@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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 6.15.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 1d3c43c: refactor: lighter chain configs
8
+ - 6256f11: feat(connect): added i18n support for katana bridge alert
9
+ - 0e331de: fix: receive token icon url on transfer crypto
10
+ - ecb6423: fix ghost meld quote calls
11
+ - 1851c89: hyperdash theme updates
12
+ - b967fc0: chore(connect): deprecate Permit2Tokens flag
13
+ - b5d2d2f: support external logged-in users for fiat account management
14
+ - Updated dependencies [1d3c43c]
15
+ - Updated dependencies [b353a64]
16
+ - Updated dependencies [b967fc0]
17
+ - Updated dependencies [b967fc0]
18
+ - Updated dependencies [b5d2d2f]
19
+ - @funkit/chains@0.4.6
20
+ - @funkit/fun-relay@2.1.13
21
+ - @funkit/api-base@1.12.17
22
+ - @funkit/utils@1.1.18
23
+ - @funkit/core@2.3.62
24
+ - @funkit/wagmi-tools@3.0.85
25
+
3
26
  ## 6.15.3
4
27
 
5
28
  ### Patch Changes
@@ -14,7 +14,7 @@ declare const _default: {
14
14
  readonly showinfobanner: {
15
15
  readonly value: {
16
16
  readonly message: "";
17
- readonly expireAtMs: 0;
17
+ readonly expireAtMs: 1;
18
18
  readonly type: "announcement";
19
19
  };
20
20
  };
@@ -3,5 +3,8 @@ interface CopyInputDisplayedAddressProps {
3
3
  address: string;
4
4
  truncateAddress?: boolean;
5
5
  }
6
- export declare function CopyInputDisplayedAddress({ address, truncateAddress, }: CopyInputDisplayedAddressProps): React.JSX.Element;
6
+ /**
7
+ * Main exported component that conditionally renders English or i18n version
8
+ */
9
+ export declare function CopyInputDisplayedAddress(props: CopyInputDisplayedAddressProps): React.JSX.Element;
7
10
  export {};
@@ -1,3 +1,4 @@
1
+ import type { TFunction } from 'i18next';
1
2
  import React, { type ReactNode } from 'react';
2
3
  import type { CheckoutProgressStep } from '~/providers/FunkitCheckoutContext';
3
4
  interface TransactionStatusProps {
@@ -15,14 +16,14 @@ export type TextConfig = {
15
16
  title: string;
16
17
  };
17
18
  export type TextConfigContext = {
18
- durationUnits: 'minutes' | 'seconds';
19
+ durationUnits: string;
19
20
  isWithdrawal: boolean;
20
- finalizeVerb: 'credit' | 'finalize';
21
+ finalizeVerb: string;
21
22
  };
22
23
  export type TextConfigStatus = Record<Exclude<TransactionStatusProps['status'], 'progress'> | 'progress_delayed', TextConfig | ((context: TextConfigContext) => TextConfig)>;
23
- export declare const DEFAULT_TEXT_CONFIG_STATUS: TextConfigStatus;
24
+ export declare const getDefaultTextConfigStatus: (t: TFunction) => TextConfigStatus;
24
25
  export type TextConfigSteps = Record<CheckoutProgressStep, TextConfig | ((context: TextConfigContext) => TextConfig)>;
25
- export declare const DEFAULT_TEXT_CONFIG_STEPS: TextConfigSteps;
26
+ export declare const getDefaultTextConfigSteps: (t: TFunction) => TextConfigSteps;
26
27
  export declare function TransactionStatusLoading({ expectedStatus, }: {
27
28
  expectedStatus: TransactionStatusProps['status'];
28
29
  }): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import type { TFunction } from 'i18next';
1
2
  export declare enum CheckoutInitStepMessage {
2
3
  CONFIRMING = 0,
3
4
  PREPARING_DATA = 1,
@@ -5,7 +6,7 @@ export declare enum CheckoutInitStepMessage {
5
6
  WAITING_FOR_SIGNATURE = 3,
6
7
  WAITING_FOR_CONFIRMATION = 4
7
8
  }
8
- export declare const CHECKOUT_STEP_MESSAGE: {
9
+ export declare const getCheckoutStepMessage: (t: TFunction) => {
9
10
  1: string;
10
11
  0: string;
11
12
  2: string;
@@ -17,7 +18,7 @@ export declare enum Web3AccountBalanceMessage {
17
18
  SWITCH_CHAIN = 1,
18
19
  APPROVE_TRANSFER = 2
19
20
  }
20
- export declare const WEB3_ACCOUNT_BALANCE_MESSAGE: {
21
+ export declare const getWeb3AccountBalanceMessage: (t: TFunction) => {
21
22
  0: string;
22
23
  1: string;
23
24
  2: (tokenSymbol: string) => string;
@@ -1,25 +1,68 @@
1
+ import type { TFunction } from 'i18next';
1
2
  export declare enum PendingQuoteMessage {
2
3
  PREPARING = 0,
3
4
  VERIFYING_PROVIDER = 1,
4
5
  ESTIMATING_GAS = 2,
5
6
  FINALIZING = 3
6
7
  }
7
- export declare const PENDING_QUOTE_MESSAGE_GENERATOR: {
8
+ export declare const getPendingQuoteMessageGenerator: (t: TFunction) => {
8
9
  0: () => string;
9
10
  1: (provider: string) => string;
10
11
  2: () => string;
11
12
  3: () => string;
12
13
  };
14
+ export declare const getQuoteApiErrorStringInfo: (t: TFunction) => {
15
+ 0: {
16
+ check: string;
17
+ display: string;
18
+ };
19
+ 1: {
20
+ check: string;
21
+ display: string;
22
+ };
23
+ 6: {
24
+ check: string;
25
+ display: string;
26
+ };
27
+ 2: {
28
+ check: string;
29
+ display: string;
30
+ };
31
+ 3: {
32
+ check: string;
33
+ display: string;
34
+ };
35
+ 4: {
36
+ check: string;
37
+ display: string;
38
+ };
39
+ 5: {
40
+ check: string;
41
+ display: string;
42
+ };
43
+ };
13
44
  export declare enum QuoteCustomErrorType {
14
45
  INSUFFICIENT_BALANCE_PRE_CHECK = 0,
15
46
  INSUFFICIENT_TOKEN_BALANCE_PRE_CHECK = 1,
16
47
  INSUFFICIENT_BALANCE_POST_CHECK = 2,
17
48
  INSUFFICIENT_AMOUNT_POST_CHECK = 3
18
49
  }
19
- export declare const QUOTE_CUSTOM_ERROR_STRING_INFO: {
20
- [type in QuoteCustomErrorType]: {
50
+ export declare const getQuoteCustomErrorStringInfo: (t: TFunction) => {
51
+ 0: {
52
+ check: string;
53
+ display: string;
54
+ };
55
+ 1: {
56
+ check: string;
57
+ display: string;
58
+ };
59
+ 2: {
60
+ check: string;
61
+ display: string;
62
+ };
63
+ 3: {
21
64
  check: string;
22
65
  display: string;
23
66
  };
24
67
  };
25
- export declare function generateQuoteApiErrorForDisplay(err: Error): string;
68
+ export declare function generateQuoteApiErrorForDisplay(err: Error, t: TFunction): string;
@@ -1,3 +1,4 @@
1
+ import type { TFunction } from 'i18next';
1
2
  import type { Address } from 'viem';
2
3
  import type { FunkitCheckoutConfig } from '~/providers/FunkitCheckoutContext';
3
4
  import { LoginType } from '~/providers/GeneralWalletProvider';
@@ -20,8 +21,9 @@ interface AssetUsableToPayParms {
20
21
  loginType: LoginType;
21
22
  isAllowedForCheckout: boolean;
22
23
  minUsdRequired?: number;
24
+ t: TFunction;
23
25
  }
24
- export declare const isAssetUsableToPayForCheckout: ({ config, payerAddress, paymentMethod, targetChainId, targetTokenAddress, assetChainId, assetTokenAddress, assetUsdAmount, loginType, isAllowedForCheckout, minUsdRequired, }: AssetUsableToPayParms) => {
26
+ export declare const isAssetUsableToPayForCheckout: ({ config, payerAddress, paymentMethod, targetChainId, targetTokenAddress, assetChainId, assetTokenAddress, assetUsdAmount, loginType, isAllowedForCheckout, minUsdRequired, t, }: AssetUsableToPayParms) => {
25
27
  isUsable: boolean;
26
28
  reason: string;
27
29
  };
@@ -7,14 +7,13 @@
7
7
  * https://docs.google.com/document/d/1A0GVWMIe1aLHtblMYJZfFP3C-DybMo47l4vvoxcbpcs/edit?tab=t.0
8
8
  */
9
9
  import { type BaseApiRequest, type BridgeCustomer, BridgeCustomerStatus, BridgeKycStatus, type BridgeSubAccount, type BridgeVirtualBankAccount, type CreateBridgeBankAccountRequest, type FunAddress } from '@funkit/api-base';
10
- import type { Address } from 'viem';
11
10
  /** Bridge only supports a handful of chains so we need to normalize other chains to the supported chain*/
12
11
  export declare const findBridgeSupportedChain: (chainId: string) => CreateBridgeBankAccountRequest["chainName"];
13
12
  export interface AllFiatAccounts {
14
13
  bridgeCustomer?: BridgeCustomer;
15
14
  bankAccounts?: BridgeVirtualBankAccount[];
16
15
  }
17
- export declare function fetchFrogAccounts(walletAddress: Address, params: BaseApiRequest): Promise<import("@funkit/api-base").SubAccount[] | null>;
16
+ export declare function fetchFrogAccounts(walletAddress: string, params: BaseApiRequest): Promise<import("@funkit/api-base").SubAccount[] | null>;
18
17
  export declare function fetchAllFiatAccounts(bridgeSubAccount: BridgeSubAccount | undefined, params: BaseApiRequest): Promise<AllFiatAccounts>;
19
18
  export declare function getMatchingBankAccount(accounts: AllFiatAccounts, targetChain: string, targetAddress: FunAddress): BridgeVirtualBankAccount | undefined;
20
19
  export declare const getFiatAccountLabel: (defaultLabel: string, account?: BridgeVirtualBankAccount) => string;
@@ -1,6 +1,6 @@
1
1
  import { DirectExecutionType } from '@funkit/api-base';
2
2
  import type { RelayTxHash, RelayVmType } from '@funkit/fun-relay';
3
- import { type CheckoutQuoteResponse } from '@funkit/utils';
3
+ import type { CheckoutQuoteResponse } from '@funkit/utils';
4
4
  import type { Address, Hex } from 'viem';
5
5
  import type { FunkitCheckoutQuoteResult } from '~/domains/quote';
6
6
  import type { FunkitActiveCheckoutItem, FunkitCheckoutActionParams } from '~/providers/FunkitCheckoutContext';
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Custom hook for accessing translations in Funkit components
3
+ * Wrapper around react-i18next's useTranslation hook
4
+ *
5
+ * @example
6
+ * ```tsx
7
+ * function MyComponent() {
8
+ * const { t } = useFunkitTranslation()
9
+ * return <button>{t('common.confirm')}</button>
10
+ * }
11
+ * ```
12
+ *
13
+ * @example With interpolation
14
+ * ```tsx
15
+ * function MyComponent() {
16
+ * const { t } = useFunkitTranslation()
17
+ * return <div>{t('checkout.minAmount', { amount: '10 USDC' })}</div>
18
+ * }
19
+ * ```
20
+ */
21
+ export declare function useFunkitTranslation(): import("react-i18next").UseTranslationResponse<"translation", undefined>;
package/dist/index.d.ts CHANGED
@@ -12,8 +12,10 @@ export { PaymentMethod } from './domains/paymentMethods';
12
12
  export { useConnectionStatus } from './hooks/useConnectionStatus';
13
13
  export type { ConnectionStatus } from './hooks/useConnectionStatus';
14
14
  export { useFunkitMaxCheckoutUsdInfo } from './hooks/useFunkitMaxCheckoutUsdInfo';
15
+ export { useFunkitTranslation } from './hooks/useFunkitTranslation';
15
16
  export { useUpdateActiveFunkitCheckout } from './hooks/useUpdateActiveFunkitCheckout';
16
17
  export type { Locale } from './locales/';
18
+ export { i18n, localeMapping } from './locales/';
17
19
  export type { AuthenticationConfig, AuthenticationStatus, } from './providers/AuthenticationContext';
18
20
  export { createAuthenticationAdapter, FunkitConnectAuthenticationProvider, } from './providers/AuthenticationContext';
19
21
  export type { AuthenticationAdapter, FunkitConnectAuthenticationProviderProps, } from './providers/AuthenticationContext';