@funkit/connect 11.2.0 → 11.4.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/dist/clients/{chunk-SU3YSNMB.js → chunk-3Y5EIONT.js} +3 -9
  3. package/dist/clients/chunk-6EU6CXNH.js +20 -0
  4. package/dist/clients/{chunk-DGBIV3ZS.js → chunk-B7UU2ETA.js} +0 -13
  5. package/dist/clients/{chunk-QQEGNLGD.js → chunk-EQFVPSR2.js} +1 -1
  6. package/dist/clients/internal/nado/withdrawalCallback.js +2 -2
  7. package/dist/clients/internal/nado/withdrawalConfig.d.ts +2 -0
  8. package/dist/clients/internal/nado/withdrawalConfig.js +2 -2
  9. package/dist/clients/internal/nado/withdrawalForm.js +13 -58
  10. package/dist/clients/lighter.d.ts +4 -61
  11. package/dist/clients/lighter.js +66 -338
  12. package/dist/clients/nado.d.ts +2 -0
  13. package/dist/clients/nado.js +7 -6
  14. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +1 -1
  15. package/dist/clients/polymarket/createPolymarketDepositConfig.d.ts +6 -0
  16. package/dist/clients/polymarket/index.js +1 -1
  17. package/dist/components/FunCheckoutHistory/FunCheckoutHistoryContent.d.ts +3 -1
  18. package/dist/components/FunCheckoutHistory/PendingSuccessScreen.d.ts +3 -1
  19. package/dist/domains/checkout.d.ts +8 -2
  20. package/dist/hooks/track/analytics/claimAnalyticsEvent.d.ts +5 -0
  21. package/dist/hooks/track/analytics/events.d.ts +176 -9
  22. package/dist/hooks/track/analytics/mappers.d.ts +15 -0
  23. package/dist/hooks/track/analytics/quote.d.ts +12 -0
  24. package/dist/hooks/track/analytics/resolveExecutionProgressContext.d.ts +40 -0
  25. package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +71 -3
  26. package/dist/hooks/track/analytics/useTrackExecutionProgressEvents.d.ts +17 -0
  27. package/dist/hooks/track/analytics/useWithdrawalAnalytics.d.ts +18 -0
  28. package/dist/hooks/track/useTrackV2.d.ts +2 -0
  29. package/dist/hooks/useAssetPrice.d.ts +1 -6
  30. package/dist/hooks/useIsBlacklistedWithdrawalAddress.d.ts +4 -1
  31. package/dist/index.js +2214 -1094
  32. package/dist/modals/CheckoutModal/ConfirmationStep/useCheckoutConfirmation.d.ts +2 -1
  33. package/dist/modals/CheckoutModal/ConfirmationStep/useQuoteRefresh.d.ts +5 -1
  34. package/dist/modals/CheckoutModal/ConfirmationStep/useTrackDepositQuoteEvents.d.ts +20 -0
  35. package/dist/modals/CheckoutModal/MeldQuotes/useMeldQuotes.d.ts +1 -1
  36. package/dist/modals/CheckoutModal/SourceChange/useTrackSourceChangeEvents.d.ts +10 -0
  37. package/dist/modals/CheckoutModal/TransferToken/useTrackDepositNotificationEvents.d.ts +6 -0
  38. package/dist/modals/CheckoutModal/TransferToken/useTransferTokenTracking.d.ts +9 -3
  39. package/dist/modals/PolymarketPerpsTransfer/recordPerpsTransfer.d.ts +40 -0
  40. package/dist/modals/PolymarketPerpsTransfer/useRecordPerpsTransfer.d.ts +24 -0
  41. package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +14 -92
  42. package/dist/modals/WithdrawalModal/WithdrawAmountInput.d.ts +3 -1
  43. package/dist/modals/WithdrawalModal/useTrackWithdrawalEvents.d.ts +1 -0
  44. package/dist/providers/FunkitCheckoutContext/index.d.ts +10 -2
  45. package/dist/providers/FunkitCheckoutContext/types.d.ts +17 -2
  46. package/dist/providers/FunkitStatsigProvider.d.ts +1 -1
  47. package/dist/utils/customer.d.ts +24 -276
  48. package/dist/utils/lighter.d.ts +1 -83
  49. package/dist/utils/signature.d.ts +1 -2
  50. package/dist/utils/withdrawal.d.ts +1 -21
  51. package/dist/wallets/walletConnectors/index.js +10 -10
  52. package/package.json +4 -5
  53. package/dist/clients/chunk-6QCAWEAT.js +0 -53
@@ -1,4 +1,7 @@
1
1
  import type { QuoteMode } from '../../../domains/quoteMode';
2
+ import type { DirectExecutionType } from '@funkit/api-base';
3
+ import type { CheckoutStatus } from '../../../domains/checkout';
4
+ import type { PaymentMethodType } from '../../../hooks/usePaymentSources';
2
5
  import type { AmountSelectionType } from '../../../modals/CheckoutModal/InputAmount/state';
3
6
  /**
4
7
  * Analytics v2 — the improved, explicit Statsig event scheme that will replace
@@ -7,9 +10,26 @@ import type { AmountSelectionType } from '../../../modals/CheckoutModal/InputAmo
7
10
  */
8
11
  export declare enum AnalyticsEvent {
9
12
  DEPOSIT_ASSET_SELECTED = "fc_deposit_asset_selected",
10
- DEPOSIT_AMOUNT_CONFIRMED = "fc_deposit_amount_confirmed"
13
+ DEPOSIT_AMOUNT_CONFIRMED = "fc_deposit_amount_confirmed",
14
+ DEPOSIT_FAILED = "fc_deposit_failed",
15
+ DEPOSIT_METHOD_SELECTED = "fc_deposit_method_selected",
16
+ DEPOSIT_NOTIFICATION_DISPLAYED = "fc_deposit_notification_displayed",
17
+ DEPOSIT_NOTIFICATION_INTERACTED = "fc_deposit_notification_interacted",
18
+ DEPOSIT_QUOTE_DISPLAYED = "fc_deposit_quote_displayed",
19
+ DEPOSIT_QUOTE_CONFIRMED = "fc_deposit_quote_confirmed",
20
+ DEPOSIT_SUCCEEDED = "fc_deposit_succeeded",
21
+ DEPOSIT_TRANSFER_INTERACTED = "fc_deposit_transfer_interacted",
22
+ DEPOSIT_TRANSACTION_SUBMITTED = "fc_deposit_transaction_submitted",
23
+ MODAL_OPENED = "fc_modal_opened",
24
+ TAB_SWITCHED = "fc_tab_switched",
25
+ WITHDRAWAL_AMOUNT_CONFIRMED = "fc_withdrawal_amount_confirmed",
26
+ WITHDRAWAL_FAILED = "fc_withdrawal_failed",
27
+ WITHDRAWAL_SUCCEEDED = "fc_withdrawal_succeeded",
28
+ WITHDRAWAL_TRANSACTION_SUBMITTED = "fc_withdrawal_transaction_submitted"
11
29
  }
30
+ export type ConnectionStatus = 'new' | 'existing';
12
31
  export type AnalyticsFlow = 'deposit' | 'withdraw';
32
+ export type AnalyticsPaymentRail = 'bluvo' | 'swapped' | 'meld' | 'bridge';
13
33
  /** Envelope carried by every analytics-v2 event. */
14
34
  export type CommonProperties = {
15
35
  /**
@@ -54,14 +74,13 @@ export type DepositAssetSelectedProperties = DepositAssetContextProperties & {
54
74
  };
55
75
  /** Payload specific to {@link AnalyticsEvent.DEPOSIT_AMOUNT_CONFIRMED}. */
56
76
  export type DepositAmountConfirmedProperties = DepositAssetContextProperties & {
57
- select_type: AmountSelectionType;
58
77
  /**
59
78
  * The quick option / recovery amount the user picked, formatted exactly as
60
79
  * shown on its button (e.g. `"25%"`, `"$100"`). `null` when `select_type`
61
80
  * is not `'preset'`.
62
81
  */
63
82
  preset_amount: string | null;
64
- trade_type: QuoteMode;
83
+ select_type: AmountSelectionType;
65
84
  /**
66
85
  * Source token amount the user pays — exact in EXACT_IN, estimated in
67
86
  * EXACT_OUT. `null` when the estimate's unit price is unavailable.
@@ -72,14 +91,162 @@ export type DepositAmountConfirmedProperties = DepositAssetContextProperties & {
72
91
  * `null` when the estimate's unit price is unavailable.
73
92
  */
74
93
  target_amount: string | null;
94
+ trade_type: QuoteMode;
95
+ };
96
+ export type WithdrawalAmountSelectionType = 'manual' | 'max';
97
+ /** Payload specific to {@link AnalyticsEvent.WITHDRAWAL_AMOUNT_CONFIRMED}. */
98
+ export type WithdrawalAmountConfirmedProperties = PaymentMethodProperties & {
99
+ select_type: WithdrawalAmountSelectionType;
100
+ source_amount: string | null;
101
+ source_chain: string;
102
+ source_asset: string;
103
+ source_asset_ticker: string | null;
104
+ target_amount: string | null;
105
+ target_chain: string;
106
+ target_asset: string;
107
+ target_asset_ticker: string | null;
108
+ trade_type: QuoteMode.EXACT_IN;
109
+ };
110
+ /** Payload specific to {@link AnalyticsEvent.DEPOSIT_METHOD_SELECTED}. */
111
+ export type DepositMethodSelectedProperties = DepositAssetContextProperties & {
112
+ connection_status: ConnectionStatus | null;
113
+ payment_rail: AnalyticsPaymentRail | null;
114
+ tab: PaymentMethodType | null;
115
+ };
116
+ /** Fee rows rendered by PaymentFeesSummary for a displayed quote. */
117
+ export type VisibleQuoteFeeProperties = {
118
+ app_fee_pct: number | null;
119
+ destination_chain_gas_usd: number | null;
120
+ card_processing_fee_usd: number | null;
121
+ exchange_processing_fee_usd: number | null;
122
+ liquidity_provider_cost_usd: number | null;
123
+ market_maker_gas_cost_usd: number | null;
124
+ max_slippage_pct: number | null;
125
+ moonpay_cost_usd: number | null;
126
+ network_cost_usd: number | null;
127
+ price_impact_pct: number | null;
128
+ source_chain_gas_usd: number | null;
129
+ swap_impact_pct: number | null;
130
+ wallet_gas_cost_usd: number | null;
131
+ };
132
+ /** Route fields shared by quote-bearing and later lifecycle events. */
133
+ export type DepositRouteContextProperties = DepositAssetContextProperties & {
134
+ destination_address: string | null;
135
+ execution_type: DirectExecutionType | null;
136
+ sender_address: string | null;
137
+ trade_type: QuoteMode;
138
+ };
139
+ /** Quote fields shared across quote-lifecycle and submission events. */
140
+ export type DepositQuoteSnapshotProperties = DepositRouteContextProperties & VisibleQuoteFeeProperties & {
141
+ /** Estimated fulfillment time in milliseconds. */
142
+ est_fulfillment_time_ms: number | null;
143
+ source_amount: string;
144
+ target_amount: string | null;
145
+ };
146
+ /** Quote snapshot plus quote-lifecycle metadata. */
147
+ export type DepositQuoteContextProperties = DepositQuoteSnapshotProperties & {
148
+ num_quote_refreshes: number;
149
+ };
150
+ /** Payload specific to {@link AnalyticsEvent.DEPOSIT_QUOTE_DISPLAYED}. */
151
+ export type DepositQuoteDisplayedProperties = DepositQuoteContextProperties;
152
+ /** Payload specific to {@link AnalyticsEvent.DEPOSIT_QUOTE_CONFIRMED}. */
153
+ export type DepositQuoteConfirmedProperties = DepositQuoteContextProperties;
154
+ /**
155
+ * Submitted execution snapshot with values preserved at their historical
156
+ * authority. Persisted records cannot always recover a trade direction,
157
+ * quote, source asset, or broadcast hash.
158
+ */
159
+ export type ExecutionTransactionSnapshotProperties = DepositAssetContextProperties & VisibleQuoteFeeProperties & {
160
+ checkout_id: string;
161
+ destination_address: string | null;
162
+ execution_type: DirectExecutionType | null;
163
+ sender_address: string | null;
164
+ source_amount: string | null;
165
+ target_amount: string | null;
166
+ trade_type: QuoteMode | null;
167
+ tx_hash: string | null;
168
+ user_id?: string;
169
+ };
170
+ export type TransactionSubmittedProperties = ExecutionTransactionSnapshotProperties & {
171
+ est_fulfillment_time_ms: number | null;
172
+ };
173
+ export type ExecutionSucceededProperties = ExecutionTransactionSnapshotProperties & {
174
+ fulfillment_time_ms: number | null;
175
+ };
176
+ export type ExecutionFailedProperties = ExecutionTransactionSnapshotProperties & {
177
+ error_code: string | null;
178
+ };
179
+ export type DepositNotificationStatus = CheckoutStatus | 'delayed';
180
+ export type DepositNotificationProperties = ExecutionTransactionSnapshotProperties & {
181
+ status: DepositNotificationStatus;
182
+ };
183
+ export type DepositNotificationInteractedProperties = DepositNotificationProperties & {
184
+ action: 'dismissed' | 'expanded';
185
+ ms_since_displayed: number;
186
+ };
187
+ /**
188
+ * Payload specific to {@link AnalyticsEvent.MODAL_OPENED}. Captures the
189
+ * payment sources and checkout configuration available when the modal opens.
190
+ */
191
+ export type ModalOpenedProperties = {
192
+ custom_recipient: string | null;
193
+ dynamic_routing_id: string | null;
194
+ exchange_count: number;
195
+ flow: AnalyticsFlow;
196
+ primary_exchange: string | null;
197
+ primary_wallet: string | null;
198
+ source_asset: string | null;
199
+ source_asset_ticker: string | null;
200
+ source_chain: string | null;
201
+ tab: PaymentMethodType;
202
+ target_asset: string | null;
203
+ target_asset_ticker: string | null;
204
+ target_chain: string | null;
205
+ wallet_count: number;
206
+ };
207
+ /** Payload specific to {@link AnalyticsEvent.TAB_SWITCHED}. */
208
+ export type TabSwitchedProperties = {
209
+ flow: AnalyticsFlow;
210
+ from_tab: PaymentMethodType;
211
+ /** 1-based switch ordinal for the current SourceChange visit. */
212
+ switch_count: number;
213
+ tab: PaymentMethodType;
214
+ };
215
+ export type DepositTransferInteractionAction = 'address_copied' | 'chain_changed' | 'token_changed';
216
+ export type DepositTransferInteractedProperties = {
217
+ action: DepositTransferInteractionAction;
218
+ deposit_address: string;
219
+ est_price_impact: number | null;
220
+ interaction_count: number;
221
+ min_amount_usd: number;
222
+ payment_method: 'transfer_crypto';
223
+ prev_source_asset: string | null;
224
+ prev_source_asset_ticker: string | null;
225
+ prev_source_chain: string | null;
226
+ source_asset: string;
227
+ source_asset_ticker: string;
228
+ source_chain: string;
229
+ target_asset: string;
230
+ target_asset_ticker: string | null;
231
+ target_chain: string;
75
232
  };
76
233
  export type AnalyticsEventProperties = {
77
234
  [AnalyticsEvent.DEPOSIT_ASSET_SELECTED]: DepositAssetSelectedProperties;
78
235
  [AnalyticsEvent.DEPOSIT_AMOUNT_CONFIRMED]: DepositAmountConfirmedProperties;
236
+ [AnalyticsEvent.DEPOSIT_FAILED]: ExecutionFailedProperties;
237
+ [AnalyticsEvent.DEPOSIT_METHOD_SELECTED]: DepositMethodSelectedProperties;
238
+ [AnalyticsEvent.DEPOSIT_NOTIFICATION_DISPLAYED]: DepositNotificationProperties;
239
+ [AnalyticsEvent.DEPOSIT_NOTIFICATION_INTERACTED]: DepositNotificationInteractedProperties;
240
+ [AnalyticsEvent.DEPOSIT_QUOTE_DISPLAYED]: DepositQuoteDisplayedProperties;
241
+ [AnalyticsEvent.DEPOSIT_QUOTE_CONFIRMED]: DepositQuoteConfirmedProperties;
242
+ [AnalyticsEvent.DEPOSIT_SUCCEEDED]: ExecutionSucceededProperties;
243
+ [AnalyticsEvent.DEPOSIT_TRANSFER_INTERACTED]: DepositTransferInteractedProperties;
244
+ [AnalyticsEvent.DEPOSIT_TRANSACTION_SUBMITTED]: TransactionSubmittedProperties;
245
+ [AnalyticsEvent.MODAL_OPENED]: ModalOpenedProperties;
246
+ [AnalyticsEvent.TAB_SWITCHED]: TabSwitchedProperties;
247
+ [AnalyticsEvent.WITHDRAWAL_AMOUNT_CONFIRMED]: WithdrawalAmountConfirmedProperties;
248
+ [AnalyticsEvent.WITHDRAWAL_FAILED]: ExecutionFailedProperties;
249
+ [AnalyticsEvent.WITHDRAWAL_SUCCEEDED]: ExecutionSucceededProperties;
250
+ [AnalyticsEvent.WITHDRAWAL_TRANSACTION_SUBMITTED]: TransactionSubmittedProperties;
79
251
  };
80
- type AnalyticsPropertyValue = string | number | boolean | null | undefined;
81
- type AnalyticsEventShape<T extends AnalyticsEvent> = CommonProperties & AnalyticsEventProperties[T];
82
- export type AnalyticsEventPayload<T extends AnalyticsEvent> = {
83
- [K in keyof AnalyticsEventShape<T>]: AnalyticsEventShape<T>[K] extends AnalyticsPropertyValue ? AnalyticsEventShape<T>[K] : never;
84
- };
85
- export {};
252
+ export type AnalyticsEventPayload<T extends AnalyticsEvent> = CommonProperties & AnalyticsEventProperties[T];
@@ -1,5 +1,20 @@
1
+ import { FormOfPaymentType, type MeldServiceProvider } from '@funkit/api-base';
2
+ import { PaymentMethod, type PaymentMethodInfo } from '../../../domains/paymentMethods';
3
+ import type { PaymentMethodProperties } from './events';
1
4
  /** Round analytics amounts before Statsig stringifies event metadata. */
2
5
  export declare function formatAnalyticsAmount(amount: number | null): string | null;
6
+ export declare function getHistoricalSourceAddress(sourceOfFund: string | null | undefined): string | null;
7
+ /** Selected checkout provider, such as a Bluvo exchange or wallet connector. */
8
+ export declare function resolveProvider(args: {
9
+ paymentMethodInfo: PaymentMethodInfo;
10
+ serviceProvider?: MeldServiceProvider;
11
+ }, connectorId: string | undefined): string | null;
12
+ /** Payment-method-derived fields shared by deposit analytics payloads. */
13
+ export declare function resolvePaymentMethodProperties(args: {
14
+ paymentMethodInfo: PaymentMethodInfo;
15
+ serviceProvider?: MeldServiceProvider;
16
+ }, connectorId: string | undefined): PaymentMethodProperties;
17
+ export declare function mapSwappedFopTypeToPaymentMethod(fopType: FormOfPaymentType): PaymentMethod | null;
3
18
  /**
4
19
  * Explicit, non-recursive stringify for a flat analytics payload. Statsig
5
20
  * event metadata must be Record<string, string>; values are stringified and
@@ -0,0 +1,12 @@
1
+ import type { FunkitCheckoutQuoteResult } from '../../../domains/quote';
2
+ import type { VisibleQuoteFeeProperties } from './events';
3
+ import type { ApiFunkitCheckoutQuoteResult } from '@funkit/utils';
4
+ /** All-null fee row, for events firing without a compatible live quote. */
5
+ export declare const NULL_VISIBLE_QUOTE_FEE_PROPERTIES: VisibleQuoteFeeProperties;
6
+ /**
7
+ * Maps a quote's fee breakdown to the fee rows PaymentFeesSummary renders.
8
+ * Relay (direct-execution) quotes carry `feeBreakdown` metadata and report
9
+ * network/impact rows; other rails report their own cost row from
10
+ * `finalFeesBreakdown` and leave the Relay-specific rows null.
11
+ */
12
+ export declare function resolveVisibleQuoteFeeProperties(latestQuote: ApiFunkitCheckoutQuoteResult | FunkitCheckoutQuoteResult | null): VisibleQuoteFeeProperties;
@@ -0,0 +1,40 @@
1
+ import { type DirectExecutionType } from '@funkit/api-base';
2
+ import type { ApiFunkitCheckoutQuoteResult } from '@funkit/utils';
3
+ import type { PaymentMethodInfo } from '../../../domains/paymentMethods';
4
+ import type { QuoteMode } from '../../../domains/quoteMode';
5
+ import type { AnalyticsFlow } from './events';
6
+ import type { NotificationItem } from '../../../modals/CheckoutModal/TransferToken/types';
7
+ type AssetDescriptor = {
8
+ chainId: string;
9
+ tokenAddress: string;
10
+ ticker: string | null;
11
+ };
12
+ export type ExecutionTransactionSubmittedArgs = {
13
+ destinationAddress: string | null;
14
+ executionType: DirectExecutionType | null;
15
+ historicalCheckoutId: string;
16
+ historicalUserId: string | null;
17
+ paymentMethodInfo: PaymentMethodInfo;
18
+ quote: ApiFunkitCheckoutQuoteResult | null;
19
+ source: AssetDescriptor | null;
20
+ sourceAddress: string | null;
21
+ sourceAssetAmount: string | null;
22
+ target: AssetDescriptor;
23
+ targetAssetAmount: string | null;
24
+ tradeType: QuoteMode | null;
25
+ txHash: string | null;
26
+ };
27
+ export type ExecutionProgressContext = ExecutionTransactionSubmittedArgs & {
28
+ claimKey: string;
29
+ errorCode: string | null;
30
+ fulfillmentTimeMs: number | null;
31
+ isCompleted: boolean;
32
+ isFailed: boolean;
33
+ isSubmitted: boolean;
34
+ };
35
+ /**
36
+ * Resolves the historical source, target, and payment context shared by
37
+ * progress-screen and notification deposit events.
38
+ */
39
+ export declare function resolveExecutionProgressContext(historyItem: NotificationItem, flow: AnalyticsFlow): ExecutionProgressContext | null;
40
+ export {};
@@ -1,7 +1,11 @@
1
- import type { MeldServiceProvider } from '@funkit/api-base';
2
- import { type PaymentMethodInfo } from '../../../domains/paymentMethods';
3
- import type { QuoteMode } from '../../../domains/quoteMode';
1
+ import type { DirectExecutionType, FormOfPaymentType, MeldQuote, MeldServiceProvider } from '@funkit/api-base';
2
+ import type { ApiFunkitCheckoutQuoteResult } from '@funkit/utils';
3
+ import { PaymentMethod, type PaymentMethodInfo } from '../../../domains/paymentMethods';
4
+ import { QuoteMode } from '../../../domains/quoteMode';
5
+ import type { FunkitCheckoutQuoteResult } from '../../../domains/quote';
4
6
  import type { AmountSelectionType } from '../../../modals/CheckoutModal/InputAmount/state';
7
+ import { type AnalyticsPaymentRail, type ConnectionStatus, type DepositTransferInteractionAction } from './events';
8
+ import type { PaymentMethodType } from '../../../hooks/usePaymentSources';
5
9
  type AssetDescriptorArgs = {
6
10
  chainId: string;
7
11
  tokenAddress: string;
@@ -27,11 +31,75 @@ export type TrackDepositAmountConfirmedArgs = {
27
31
  sourceAmount: number | null;
28
32
  targetAmount: number | null;
29
33
  };
34
+ export type TrackDepositMethodSelectedArgs = {
35
+ connectionStatus?: ConnectionStatus;
36
+ /** Some Swapped methods can't be mapped to PaymentMethod and are forwarded as-is. */
37
+ paymentMethod: PaymentMethod | FormOfPaymentType;
38
+ paymentRail?: AnalyticsPaymentRail;
39
+ /** Selected checkout provider, such as a Bluvo exchange. */
40
+ provider?: string;
41
+ /** Explicit source override (e.g. the native fast-path row) */
42
+ source?: AssetDescriptorArgs;
43
+ tab: PaymentMethodType | null;
44
+ };
45
+ export type TrackDepositTransferInteractedArgs = {
46
+ action: DepositTransferInteractionAction;
47
+ depositAddress: string;
48
+ estPriceImpact: number | null;
49
+ interactionCount: number;
50
+ minAmountUsd: number;
51
+ previousSource: {
52
+ chainId: string | null;
53
+ ticker: string | null;
54
+ tokenAddress: string | null;
55
+ } | null;
56
+ source: AssetDescriptorArgs & {
57
+ ticker: string;
58
+ };
59
+ target: AssetDescriptorArgs;
60
+ };
61
+ export type TrackDepositQuoteSnapshotArgs = {
62
+ destinationAddress: string | null;
63
+ executionType: DirectExecutionType | null;
64
+ numQuoteRefreshes: number;
65
+ paymentMethodInfo: PaymentMethodInfo;
66
+ quote: FunkitCheckoutQuoteResult;
67
+ source: AssetDescriptorArgs;
68
+ sourceAddress: string | null;
69
+ sourceAssetAmount: string;
70
+ target: AssetDescriptorArgs;
71
+ targetAssetAmount: string | null;
72
+ tradeType: QuoteMode;
73
+ };
74
+ export type ExecutionTransactionSubmittedArgs = {
75
+ destinationAddress: string | null;
76
+ executionType: DirectExecutionType | null;
77
+ historicalCheckoutId: string;
78
+ historicalUserId: string | null;
79
+ paymentMethodInfo: PaymentMethodInfo;
80
+ quote: ApiFunkitCheckoutQuoteResult | null;
81
+ source: AssetDescriptorArgs | null;
82
+ sourceAddress: string | null;
83
+ sourceAssetAmount: string | null;
84
+ target: AssetDescriptorArgs;
85
+ targetAssetAmount: string | null;
86
+ tradeType: QuoteMode | null;
87
+ txHash: string | null;
88
+ };
89
+ export type TrackDepositMeldQuoteDisplayedArgs = {
90
+ numQuoteRefreshes: number;
91
+ quote: MeldQuote;
92
+ };
30
93
  /**
31
94
  * Gathers provider context and emits deposit-family analytics events.
32
95
  */
33
96
  export declare function useDepositAnalytics(): {
34
97
  trackDepositAssetSelected: (args: TrackDepositAssetSelectedArgs) => void;
35
98
  trackDepositAmountConfirmed: (args: TrackDepositAmountConfirmedArgs) => void;
99
+ trackDepositMethodSelected: (args: TrackDepositMethodSelectedArgs) => void;
100
+ trackDepositMeldQuoteDisplayed: ({ quote, numQuoteRefreshes }: TrackDepositMeldQuoteDisplayedArgs) => void;
101
+ trackDepositQuoteDisplayed: (args: TrackDepositQuoteSnapshotArgs) => void;
102
+ trackDepositQuoteConfirmed: (args: TrackDepositQuoteSnapshotArgs) => void;
103
+ trackDepositTransferInteracted: (args: TrackDepositTransferInteractedArgs) => void;
36
104
  };
37
105
  export {};
@@ -0,0 +1,17 @@
1
+ import type { NotificationItem } from '../../../modals/CheckoutModal/TransferToken/types';
2
+ import { type ExecutionTransactionSubmittedArgs } from './resolveExecutionProgressContext';
3
+ import { type AnalyticsFlow, type ExecutionTransactionSnapshotProperties } from './events';
4
+ export type TrackExecutionSucceededArgs = ExecutionTransactionSubmittedArgs & {
5
+ fulfillmentTimeMs: number | null;
6
+ };
7
+ export type TrackExecutionFailedArgs = ExecutionTransactionSubmittedArgs & {
8
+ errorCode: string | null;
9
+ };
10
+ export declare function buildExecutionTransactionSnapshotProperties(args: ExecutionTransactionSubmittedArgs, connectorId: string | undefined): ExecutionTransactionSnapshotProperties;
11
+ /** Builds and emits execution lifecycle events without owning any polling. */
12
+ export declare function useTrackExecutionProgressEvents(flow: AnalyticsFlow): {
13
+ trackExecutionFailed: (args: TrackExecutionFailedArgs, claimKey: string) => void;
14
+ trackExecutionProgressEvents: (historyItem: NotificationItem) => void;
15
+ trackExecutionSucceeded: (args: TrackExecutionSucceededArgs, claimKey: string) => void;
16
+ trackExecutionTransactionSubmitted: (args: ExecutionTransactionSubmittedArgs, claimKey: string) => void;
17
+ };
@@ -0,0 +1,18 @@
1
+ import { type WithdrawalAmountSelectionType } from './events';
2
+ type AssetDescriptorArgs = {
3
+ chainId: string;
4
+ tokenAddress: string;
5
+ ticker: string | null;
6
+ };
7
+ export type TrackWithdrawalAmountConfirmedArgs = {
8
+ selectType: WithdrawalAmountSelectionType;
9
+ source: AssetDescriptorArgs;
10
+ sourceAmount: number;
11
+ target: AssetDescriptorArgs;
12
+ targetAmount: number | null;
13
+ };
14
+ /** Gathers withdrawal context and emits withdrawal-family analytics events. */
15
+ export declare function useWithdrawalAnalytics(): {
16
+ trackWithdrawalAmountConfirmed: (args: TrackWithdrawalAmountConfirmedArgs) => void;
17
+ };
18
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { AnalyticsEvent, AnalyticsEventProperties, CommonProperties } from './analytics/events';
2
+ export declare function useTrackV2(): <T extends AnalyticsEvent>(event: T, buildMetadata: () => AnalyticsEventProperties[T] & Partial<CommonProperties>) => void;
@@ -1,10 +1,5 @@
1
- import { type Erc20AssetInfo, type GetAssetPriceInfoResponse } from '@funkit/api-base';
1
+ import type { Erc20AssetInfo } from '@funkit/api-base';
2
2
  import type { Address } from 'viem';
3
- export declare function getAssetPriceInfoWithFallback({ apiKey, chainId, assetTokenAddress, }: {
4
- apiKey: string;
5
- chainId: string;
6
- assetTokenAddress: Address;
7
- }): Promise<GetAssetPriceInfoResponse>;
8
3
  interface UseAssetAddressPriceParams {
9
4
  chainId: string | undefined;
10
5
  assetTokenAddress: Address | undefined;
@@ -1,4 +1,7 @@
1
1
  /**
2
- * Attempt to safeguard user from irrecoverable losses
2
+ * Attempt to safeguard user from irrecoverable losses.
3
+ *
4
+ * The verdict itself lives in connect-core so web and React Native block the
5
+ * same recipients; this hook only resolves the Statsig configs it reads from.
3
6
  */
4
7
  export declare function useIsBlacklistedWithdrawalAddress(address: string): boolean;