@funkit/connect 13.0.1 → 13.1.1

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,50 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 13.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - c421418: Forms-of-payment requests send the active checkout ID, so hosted MoonPay orders are attributed to the checkout that opened them.
8
+ - 19cfb48: Share screen analytics names and metadata across SDKs while preserving existing web events.
9
+ - 486b8f7: Upgrade storybook to 10.6.2 to patch CVE-2026-114125 (CVSS 9.4)
10
+ - 78f8b72: Emit withdrawal submission analytics with order details for Swapped withdrawals.
11
+ - Updated dependencies [f2797f6]
12
+ - Updated dependencies [77e23f1]
13
+ - Updated dependencies [2dbf107]
14
+ - Updated dependencies [643efb7]
15
+ - Updated dependencies [f2797f6]
16
+ - Updated dependencies [1822d7e]
17
+ - Updated dependencies [f2797f6]
18
+ - Updated dependencies [c421418]
19
+ - Updated dependencies [cfe6b5a]
20
+ - Updated dependencies [19cfb48]
21
+ - Updated dependencies [351e0a9]
22
+ - Updated dependencies [072ec92]
23
+ - @funkit/connect-core@17.0.0
24
+ - @funkit/api-base@10.4.0
25
+
26
+ ## 13.1.0
27
+
28
+ ### Minor Changes
29
+
30
+ - fca33a2: Lighter Fast withdrawals pass the entered recipient and Relay's `protocol.v2` order to `signerClient.transfer` as `withdrawal`.
31
+
32
+ ### Patch Changes
33
+
34
+ - 51ecbdf: Track Swapped deposit submissions once per checkout with payment method, order identifiers, and the configured destination chain and token.
35
+ - 352ba38: Swapped quick-amount buttons now show amounts in the user's local currency instead of fixed USD values.
36
+ - Updated dependencies [36310a3]
37
+ - Updated dependencies [fca33a2]
38
+ - Updated dependencies [07ea33e]
39
+ - Updated dependencies [2573e4a]
40
+ - Updated dependencies [fca33a2]
41
+ - Updated dependencies [116e0f0]
42
+ - Updated dependencies [f2d66a8]
43
+ - Updated dependencies [352ba38]
44
+ - @funkit/api-base@10.3.0
45
+ - @funkit/connect-core@16.1.0
46
+ - @funkit/fun-relay@4.1.0
47
+
3
48
  ## 13.0.1
4
49
 
5
50
  ### Patch Changes
@@ -6,10 +6,10 @@ import "../../chunk-PZSKO3BJ.js";
6
6
  import {
7
7
  useFunkitConfig
8
8
  } from "../../chunk-AJGDTTRJ.js";
9
- import "../../chunk-LICTGZXW.js";
10
9
  import {
11
10
  useFunkitTranslation
12
11
  } from "../../chunk-ZEXIDBIZ.js";
12
+ import "../../chunk-LICTGZXW.js";
13
13
  import "../../chunk-2W2P3OS6.js";
14
14
  import "../../chunk-ZBBYOJWK.js";
15
15
  import {
@@ -20,7 +20,7 @@ import { type LighterSigner } from '@funkit/connect-core/clients/lighter';
20
20
  import type { CustomWithdrawalConfig, LighterRouteType, MultiMethodWithdrawalConfig, SourceTokenOption, WithdrawalSourceTokenBalanceParams } from '../providers/FunkitCheckoutContext/types';
21
21
  export { LIGHTER_ROUTE_TYPE } from '@funkit/connect-core/clients/lighter';
22
22
  export type { LighterRouteType } from '../providers/FunkitCheckoutContext/types';
23
- export type { LighterSigner, LighterTransaction, LighterTransferParams, } from '@funkit/connect-core/clients/lighter';
23
+ export type { LighterSigner, LighterTransaction, LighterTransferParams, WithdrawalIntent, } from '@funkit/connect-core/clients/lighter';
24
24
  export { LIGHTER_WITHDRAW_ABI, buildLighterL1WithdrawTransaction, isLighterWithdrawalRateLimitError, } from '@funkit/connect-core/clients/lighter';
25
25
  /** Lighter base units, defaulting to mainnet for existing connect integrators. */
26
26
  export declare function lighterWithdrawBaseUnits(assetIndex: number, amountTokenUnits: string, chainId?: LighterChainId): bigint;
@@ -2,11 +2,10 @@ import type { QuoteMode } from '../../../domains/quoteMode';
2
2
  import type { DirectExecutionType, FormOfPaymentType } from '@funkit/api-base';
3
3
  import type { CheckoutStatus } from '../../../domains/checkout';
4
4
  import type { PaymentMethodType } from '../../../hooks/usePaymentSources';
5
- import type { FunCheckoutStep } from '../../../modals/CheckoutModal/FunCheckoutStep';
6
5
  import type { AmountSelectionType } from '../../../modals/CheckoutModal/InputAmount/state';
7
- import type { WithdrawalModalStep } from '../../../modals/WithdrawalModal/types';
8
6
  import type { FunNotificationType } from '../../../components/FunNotification/FunNotification';
9
- import type { PaymentMethod } from '@funkit/connect-core';
7
+ import type { AnalyticsStep, PaymentMethod, StepViewedProperties as SharedStepViewedProperties } from '@funkit/connect-core';
8
+ export type { AnalyticsStep } from '@funkit/connect-core';
10
9
  /**
11
10
  * Analytics v2 — the improved, explicit Statsig event scheme that will replace
12
11
  * the `fc::`/`fw::` enums in `../CheckoutModalEvent.ts` / `../WithdrawModalEvent.ts`.
@@ -47,7 +46,6 @@ export declare enum AnalyticsEvent {
47
46
  export type ConnectionStatus = 'new' | 'existing';
48
47
  export type AnalyticsFlow = 'deposit' | 'withdraw' | 'convert';
49
48
  export type AnalyticsPaymentRail = 'swapped' | 'meld' | 'bridge';
50
- export type AnalyticsStep = Lowercase<FunCheckoutStep | WithdrawalModalStep>;
51
49
  export type ModalClosedAction = 'close' | 'new_deposit' | 'new_withdrawal';
52
50
  export type ModalCompletionState = 'completed' | 'not_completed' | 'undetected';
53
51
  /** Envelope carried by every analytics-v2 event. */
@@ -210,9 +208,18 @@ export type ExecutionTransactionSnapshotProperties = DepositAssetContextProperti
210
208
  tx_hash: string | null;
211
209
  user_id?: string;
212
210
  };
213
- export type TransactionSubmittedProperties = ExecutionTransactionSnapshotProperties & {
211
+ export type TransactionSubmittedProperties = Omit<ExecutionTransactionSnapshotProperties, 'target_chain' | 'target_asset'> & {
212
+ target_chain: string | null;
213
+ target_asset: string | null;
214
214
  est_fulfillment_time_ms: number | null;
215
215
  quote_id: string | null;
216
+ payment_rail?: AnalyticsPaymentRail | null;
217
+ order_id?: string | null;
218
+ /** Original provider order values, distinct from the executed quote amounts. */
219
+ order_amount?: string | null;
220
+ order_asset?: string | null;
221
+ order_network?: string | null;
222
+ order_timestamp?: number | null;
216
223
  };
217
224
  export type ExecutionSucceededProperties = ExecutionTransactionSnapshotProperties & {
218
225
  fulfillment_time_ms: number | null;
@@ -263,23 +270,8 @@ export type TabSwitchedProperties = {
263
270
  switch_count: number;
264
271
  tab: PaymentMethodType;
265
272
  };
266
- export type StepViewedProperties = {
273
+ export type StepViewedProperties = SharedStepViewedProperties & {
267
274
  flow: AnalyticsFlow;
268
- /**
269
- * Whether the user initiated a back navigation gesture. Note that we support
270
- * back navigation by step name, which falls back to pushing the step instead
271
- * if it's not already in history. Thus, `step_index` may still be incremented
272
- * even if `is_back_navigation` is true.
273
- */
274
- is_back_navigation: boolean;
275
- prev_step: AnalyticsStep | null;
276
- step: AnalyticsStep;
277
- /**
278
- * 1-based index of the step being entered. When navigating backward, we attempt
279
- * to preserve the original index of the step when it was first entered. When
280
- * navigating forward, it is incremented by 1.
281
- */
282
- step_index: number;
283
275
  };
284
276
  /** Payload specific to {@link AnalyticsEvent.IFRAME_STEP_VIEWED}. */
285
277
  export type IframeStepViewedProperties = {
@@ -0,0 +1 @@
1
+ export declare function readSwappedIdentifier(value: unknown): string | null;
@@ -0,0 +1,4 @@
1
+ import type { FormOfPaymentType } from '@funkit/api-base';
2
+ import type { ApiFunkitCheckoutConfig } from '@funkit/utils';
3
+ import type { TransactionSubmittedProperties } from './events';
4
+ export declare function buildSwappedIframeSubmissionProperties(data: unknown, fopType: FormOfPaymentType, checkoutId: string, config: Pick<ApiFunkitCheckoutConfig, 'targetChain' | 'targetAsset' | 'targetAssetTicker'>): TransactionSubmittedProperties;
@@ -0,0 +1,10 @@
1
+ import type { FiatWithdrawalOrder } from '../../../modals/WithdrawalModal/useFiatWithdrawal';
2
+ /** Preserve provider values without conflating them with the executed route. */
3
+ export declare function buildSwappedWithdrawalOrderProperties(order: FiatWithdrawalOrder): {
4
+ payment_rail: 'swapped';
5
+ order_id: string;
6
+ order_amount: string;
7
+ order_asset: string | null;
8
+ order_network: string | null;
9
+ order_timestamp: number | null;
10
+ };
@@ -1,6 +1,6 @@
1
1
  import type { NotificationItem } from '../../../modals/CheckoutModal/TransferToken/types';
2
2
  import { type ExecutionTransactionSubmittedArgs } from './resolveExecutionProgressContext';
3
- import { AnalyticsEvent, type ExecutionTransactionSnapshotProperties } from './events';
3
+ import { AnalyticsEvent, type ExecutionTransactionSnapshotProperties, type TransactionSubmittedProperties } from './events';
4
4
  export type TrackExecutionSucceededArgs = ExecutionTransactionSubmittedArgs & {
5
5
  fulfillmentTimeMs: number | null;
6
6
  };
@@ -28,6 +28,6 @@ export declare function useTrackExecutionProgressEvents(flow: ExecutionFlow): {
28
28
  trackExecutionFailed: (args: TrackExecutionFailedArgs, claimKey: string) => void;
29
29
  trackExecutionProgressEvents: (historyItem: NotificationItem) => void;
30
30
  trackExecutionSucceeded: (args: TrackExecutionSucceededArgs, claimKey: string) => void;
31
- trackExecutionTransactionSubmitted: (args: ExecutionTransactionSubmittedArgs, claimKey: string) => void;
31
+ trackExecutionTransactionSubmitted: (args: ExecutionTransactionSubmittedArgs, claimKey: string, providerProperties?: Pick<TransactionSubmittedProperties, "order_amount" | "order_asset" | "order_id" | "order_network" | "order_timestamp" | "payment_rail"> | undefined) => void;
32
32
  };
33
33
  export {};
@@ -2,4 +2,5 @@ import type { FormOfPaymentType } from '@funkit/api-base';
2
2
  import { type AnalyticsFlow } from './events';
3
3
  export declare function useTrackSwappedIframeEvents(flow: AnalyticsFlow): {
4
4
  trackIframeStepViewed: (step: string, fopType: FormOfPaymentType) => void;
5
+ trackIframeTransactionSubmitted: (data: unknown, fopType: FormOfPaymentType) => void;
5
6
  };
@@ -0,0 +1,8 @@
1
+ import { type SwappedPillAmounts } from '@funkit/connect-core';
2
+ /**
3
+ * The Swapped embed's quick-amount pills in the user's local currency. Both
4
+ * queries are the ones /fops already ran, so this adds no requests.
5
+ * - Undefined while the currency or rates load; the session re-sends the
6
+ * theme once they arrive.
7
+ */
8
+ export declare function useSwappedPillAmounts(): SwappedPillAmounts | undefined;