@funkit/connect 9.22.0 → 9.23.0

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,24 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 9.23.0
4
+
5
+ ### Minor Changes
6
+
7
+ - bbdcd22: feat: add `funkitConfig.prefillFiatEmail` to prefill the Swapped fiat onramp/offramp iframe with an integrator-supplied email. Surfaced via `IdentityProvider`, validated with the shared `@funkit/utils` validator (invalid emails are dropped, never block checkout), captured once at provider init, and forwarded into the `/fops` request for both ramps.
8
+
9
+ ### Patch Changes
10
+
11
+ - cc14c1b: feat(connect): cashier - add Withdraw tab
12
+ - ad3cea3: Lighter withdrawals improvements
13
+ - 98c8e0d: Extract the params-shaped recent-deposits/recent-checkouts query hooks and the customer-agnostic checkout-history helpers into `@funkit/connect-core` so React Native can reuse them; `@funkit/connect`'s hooks are now thin context adapters — no web behavior change.
14
+
15
+ **BREAKING (`@funkit/connect-core`):** adds `@tanstack/react-query` (`>=5.0.0`) as a required peer dependency — consumers must install it and provide a `QueryClientProvider`. (`@funkit/connect` already ships it.)
16
+
17
+ - b9c7946: Extract the `SwappedProvider` state machine into a shared `useSwappedSession` hook in `@funkit/connect-core` so React Native can reuse it over a WebView transport. `@funkit/connect`'s `SwappedProvider` is now a thin wrapper — no web API or behavior change.
18
+ - Updated dependencies [98c8e0d]
19
+ - Updated dependencies [b9c7946]
20
+ - @funkit/connect-core@1.0.0
21
+
3
22
  ## 9.22.0
4
23
 
5
24
  ### Minor Changes
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const ArrowCircleUpRightIcon: ({ size }: {
3
+ size?: number;
4
+ }) => React.JSX.Element;
@@ -1,4 +1,13 @@
1
- import { type GetFopsResponse } from '@funkit/api-base';
1
+ import { type GetFopsResponse, type ThirdPartyPaymentConfigs } from '@funkit/api-base';
2
+ /**
3
+ * Build the Swapped `thirdPartyPaymentConfigs` for a /fops request, shared by
4
+ * `useFops` and `useWithdrawFops`.
5
+ *
6
+ * `prefillFiatEmail` is normalized + validated here, but the backend is the
7
+ * authoritative validator: invalid emails are dropped (never block checkout)
8
+ * and the email value is never logged (PII).
9
+ */
10
+ export declare function buildSwappedThirdPartyPaymentConfigs(prefillFiatEmail: string | undefined, themeConfig: Record<string, string>, logTag: 'useFops' | 'useWithdrawFops'): ThirdPartyPaymentConfigs;
2
11
  export { FOPS_STALE_TIME, getFopsLimit, roundFopsLimit, sortFops, } from '@funkit/connect-core';
3
12
  /**
4
13
  * Validates FOPs by checking icon URL, embedded flow URL, and payment group.
@@ -1,4 +1,3 @@
1
- import { type CheckoutHistoryItem } from '@funkit/api-base';
2
1
  import { PaymentMethod } from '../../domains/paymentMethods';
3
2
  interface RecentCheckoutsQuery {
4
3
  isVisible: boolean;
@@ -6,6 +5,9 @@ interface RecentCheckoutsQuery {
6
5
  }
7
6
  /**
8
7
  * @returns recent checkouts tied to a recipient address used in the token transfer flow
8
+ *
9
+ * Thin web adapter over `@funkit/connect-core`'s params-shaped query: pulls
10
+ * identity + refresh interval from context and supplies the web logger.
9
11
  */
10
- export declare const useRecentCheckouts: ({ paymentMethod, isVisible, }: RecentCheckoutsQuery) => import("@tanstack/react-query").UseQueryResult<CheckoutHistoryItem[], Error>;
12
+ export declare const useRecentCheckouts: ({ paymentMethod, isVisible, }: RecentCheckoutsQuery) => import("@tanstack/react-query").UseQueryResult<import("@funkit/api-base").CheckoutHistoryItem[]>;
11
13
  export {};
@@ -1,13 +1,8 @@
1
- import { type DirectExecution } from '@funkit/api-base';
2
- import { type UseQueryResult } from '@tanstack/react-query';
1
+ import type { DirectExecution } from '@funkit/api-base';
2
+ import { type RecentDepositsApiQueryParams } from '@funkit/connect-core';
3
+ import type { UseQueryResult } from '@tanstack/react-query';
3
4
  import { type PurifiedCheckoutHistoryItem } from '../../utils/purifyCheckoutHistoryItem';
4
- interface RecentDepositsApiQuery {
5
- isVisible: boolean;
6
- fetchSize?: number;
7
- apiKey: string;
8
- userId: string;
9
- refreshIntervalMs: number;
10
- }
5
+ type RecentDepositsApiQuery = Omit<RecentDepositsApiQueryParams, 'isFasterNotificationsEnabled' | 'logger'>;
11
6
  type DefaultDEQueryKey = 'apiKey' | 'userId' | 'refreshIntervalMs';
12
7
  export type RecentDEQuerySimplified = {
13
8
  isVisible: boolean;
@@ -35,6 +35,7 @@ export declare enum CheckoutModalEvent {
35
35
  READY_SWAPPED_IFRAME = "fc::ready::swapped_iframe",
36
36
  SOURCE_CHANGE_CRYPTO_TAB = "fc::source_change::crypto_tab",
37
37
  SOURCE_CHANGE_CASH_TAB = "fc::source_change::cash_tab",
38
+ SOURCE_CHANGE_WITHDRAW_TAB = "fc::source_change::withdraw_tab",
38
39
  QUERY_FROG_SUB_ACCOUNTS = "fc::query::frog_sub_accounts",
39
40
  QUERY_UDA_ADDRESS = "fc::query::uda_address",
40
41
  QUERY_WALLET_ASSETS = "fc::query::wallet_assets",
@@ -1,3 +1 @@
1
- type Fn = (...a: any[]) => unknown;
2
- export declare function useEffectEvent<F extends Fn>(fn: F): F;
3
- export {};
1
+ export { useEffectEvent } from '@funkit/connect-core';
@@ -0,0 +1,5 @@
1
+ import { type PaymentMethodType } from '../hooks/usePaymentSources';
2
+ export declare function usePaymentMethodTabs(): {
3
+ defaultTab: PaymentMethodType;
4
+ tabOrder: PaymentMethodType[];
5
+ };
@@ -7,7 +7,7 @@ export declare function usePaymentMethodEnablement(): {
7
7
  isBrokerageEnabled: boolean;
8
8
  isLightningEnabled: boolean;
9
9
  };
10
- export type PaymentMethodType = 'crypto' | 'fiat';
10
+ export type PaymentMethodType = 'crypto' | 'fiat' | 'withdraw';
11
11
  export type UnavailablePaymentSource = {
12
12
  method: PaymentMethod;
13
13
  reason: 'geoblocked' | 'comingSoon';