@funkit/connect 11.6.0 → 12.0.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 (133) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/dist/{chunk-67BKQQNG.js → chunk-2RND3WWH.js} +1 -1
  3. package/dist/{chunk-L67HP4HQ.js → chunk-53FF4ZHH.js} +1 -1
  4. package/dist/{chunk-4YEAUICE.js → chunk-DH3DS4FX.js} +1 -0
  5. package/dist/clients/chunk-27VBRE7W.js +4907 -0
  6. package/dist/clients/{chunk-UPB4JKJG.js → chunk-37Q6DUR7.js} +12 -7
  7. package/dist/clients/chunk-3DHSLLCU.js +331 -0
  8. package/dist/clients/{chunk-DUBZPIDN.js → chunk-3J2GOB5X.js} +1 -1
  9. package/dist/clients/{chunk-LYZLETOM.js → chunk-A5JW3UI6.js} +1 -1
  10. package/dist/clients/chunk-BCNE3ZKM.js +190 -0
  11. package/dist/clients/chunk-BWJC2WD7.js +4899 -0
  12. package/dist/clients/{chunk-ZQZDPRWC.js → chunk-DYV3LRSE.js} +1 -1
  13. package/dist/clients/{chunk-Y7WLUPTX.js → chunk-EQA5U4V6.js} +8 -8
  14. package/dist/clients/chunk-EYMFEWQL.js +30 -0
  15. package/dist/clients/chunk-FPOGADLJ.js +4899 -0
  16. package/dist/clients/chunk-HB7S3NDI.js +15 -0
  17. package/dist/clients/chunk-HDFCM5UL.js +15 -0
  18. package/dist/clients/{chunk-IYCZWLAF.js → chunk-IAIRECDV.js} +8 -37
  19. package/dist/clients/chunk-JVR4CX6N.js +296 -0
  20. package/dist/clients/chunk-NEKHTWTT.js +331 -0
  21. package/dist/clients/chunk-PA7WW6VC.js +296 -0
  22. package/dist/clients/chunk-R6UAC2TB.js +190 -0
  23. package/dist/clients/chunk-RHOSJED2.js +335 -0
  24. package/dist/clients/chunk-SKDFSMAO.js +30 -0
  25. package/dist/clients/chunk-TI2NG2Z6.js +30 -0
  26. package/dist/clients/chunk-TZFXFVDW.js +296 -0
  27. package/dist/clients/chunk-VE6QD5IM.js +149 -0
  28. package/dist/clients/chunk-VXX2XK5J.js +190 -0
  29. package/dist/clients/{chunk-WNZ6QV5Q.js → chunk-WXSFLUPZ.js} +79 -15
  30. package/dist/clients/chunk-XSRAZSYG.js +15 -0
  31. package/dist/clients/fanatics.css +4686 -4659
  32. package/dist/clients/fanatics.js +7 -9
  33. package/dist/clients/internal/nado/withdrawalCallback.js +3 -3
  34. package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
  35. package/dist/clients/internal/nado/withdrawalForm.css +4712 -4682
  36. package/dist/clients/internal/nado/withdrawalForm.js +37 -13
  37. package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
  38. package/dist/clients/lighter.css +4712 -4682
  39. package/dist/clients/lighter.js +50 -30
  40. package/dist/clients/mallard.js +4 -4
  41. package/dist/clients/nado.js +3 -3
  42. package/dist/clients/polymarket/createPolymarketDepositConfig.d.ts +28 -19
  43. package/dist/clients/polymarket/createPolymarketDepositConfig.js +5 -4
  44. package/dist/clients/polymarket/index.d.ts +0 -1
  45. package/dist/clients/polymarket/index.js +4 -17
  46. package/dist/clients/polymarket/polymarket.d.ts +12 -27
  47. package/dist/clients/polymarket/polymarket.js +1 -1
  48. package/dist/components/AsyncImage/useAsyncImage.d.ts +2 -0
  49. package/dist/components/Box/Box.d.ts +15 -15
  50. package/dist/components/Dialog/Dialog.d.ts +8 -1
  51. package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +3 -1
  52. package/dist/components/FunTransactionSummary/PaymentFeesSummary.track.d.ts +10 -0
  53. package/dist/components/ModalHeaderTabs/ModalHeaderTabs.d.ts +23 -0
  54. package/dist/consts/polymarket.d.ts +14 -0
  55. package/dist/css/sprinkles.css.d.ts +17 -15
  56. package/dist/domains/polymarketPerps.d.ts +14 -0
  57. package/dist/hooks/queries/useFops.d.ts +3 -1
  58. package/dist/hooks/track/CheckoutModalEvent.d.ts +1 -0
  59. package/dist/hooks/track/analytics/checkout.d.ts +10 -0
  60. package/dist/hooks/track/analytics/events.d.ts +20 -1
  61. package/dist/hooks/track/analytics/quote.d.ts +3 -1
  62. package/dist/hooks/track/analytics/resolveExecutionProgressContext.d.ts +2 -1
  63. package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +0 -16
  64. package/dist/hooks/track/analytics/useWithdrawalAnalytics.d.ts +12 -1
  65. package/dist/hooks/useCheckoutTransferInit.d.ts +3 -1
  66. package/dist/hooks/useFittedText.d.ts +19 -0
  67. package/dist/hooks/usePolymarketAccountBalances.d.ts +13 -25
  68. package/dist/hooks/useTextMeasurer.d.ts +1 -1
  69. package/dist/hooks/useUpdateActiveFunkitCheckout.d.ts +10 -0
  70. package/dist/index.css +4712 -4682
  71. package/dist/index.js +5121 -3752
  72. package/dist/modals/CheckoutModal/CheckoutModalPrefetchedHooks.d.ts +2 -1
  73. package/dist/modals/CheckoutModal/InputAmount/useAmountInput.d.ts +1 -0
  74. package/dist/modals/CheckoutModal/SourceChange/CryptoCashToggle.d.ts +6 -1
  75. package/dist/modals/PolymarketPerpsTransfer/DirectionSwapButton.d.ts +1 -11
  76. package/dist/modals/PolymarketPerpsTransfer/PerpsHeaderTabs.d.ts +29 -0
  77. package/dist/modals/PolymarketPerpsTransfer/PerpsTransferAmountInput.css.d.ts +9 -0
  78. package/dist/modals/PolymarketPerpsTransfer/PerpsTransferAmountInput.d.ts +15 -0
  79. package/dist/modals/PolymarketPerpsTransfer/PerpsTransferBody.d.ts +12 -0
  80. package/dist/modals/PolymarketPerpsTransfer/PolymarketPerpsPrefetch.d.ts +7 -0
  81. package/dist/modals/PolymarketPerpsTransfer/PolymarketPerpsTransferScreen.d.ts +16 -2
  82. package/dist/modals/PolymarketPerpsTransfer/TransferAccountsCard.d.ts +12 -0
  83. package/dist/modals/PolymarketPerpsTransfer/TransferActionButton.d.ts +8 -1
  84. package/dist/modals/PolymarketPerpsTransfer/TransferPercentOptions.d.ts +13 -0
  85. package/dist/modals/PolymarketPerpsTransfer/usePerpsHeaderTabsState.d.ts +28 -0
  86. package/dist/modals/PolymarketPerpsTransfer/usePerpsTransferForm.d.ts +31 -5
  87. package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +6 -0
  88. package/dist/modals/WithdrawalModal/useWithdrawalChainPreference.d.ts +17 -0
  89. package/dist/modals/WithdrawalModal/withdrawalHooks.d.ts +2 -1
  90. package/dist/providers/FunkitCheckoutContext/index.d.ts +13 -1
  91. package/dist/providers/FunkitCheckoutContext/types.d.ts +44 -20
  92. package/dist/providers/FunkitShadowHostProvider.d.ts +31 -0
  93. package/dist/providers/FunkitThemeProvider.d.ts +3 -0
  94. package/dist/providers/FunkitThemeStyle.d.ts +12 -0
  95. package/dist/shadow/loadShadowCss.d.ts +9 -0
  96. package/dist/shadow/useMountShadowHost.d.ts +18 -0
  97. package/dist/shadow/useShadowCss.d.ts +6 -0
  98. package/dist/shadow-css.js +1 -1
  99. package/dist/themes/baseTheme.js +1 -1
  100. package/dist/themes/darkTheme.js +2 -2
  101. package/dist/themes/lightTheme.js +2 -2
  102. package/dist/wallets/walletConnectors/chunk-2VP2F6EK.js +70 -0
  103. package/dist/wallets/walletConnectors/chunk-4T6ZSRJF.js +69 -0
  104. package/dist/wallets/walletConnectors/chunk-6BW3HLBG.js +96 -0
  105. package/dist/wallets/walletConnectors/chunk-CCQV2ZET.js +218 -0
  106. package/dist/wallets/walletConnectors/chunk-CPI4TD43.js +99 -0
  107. package/dist/wallets/walletConnectors/chunk-F5XEEVG6.js +98 -0
  108. package/dist/wallets/walletConnectors/chunk-HNRB7KJU.js +92 -0
  109. package/dist/wallets/walletConnectors/chunk-HTHAK6XB.js +93 -0
  110. package/dist/wallets/walletConnectors/chunk-MIQTHJ6X.js +66 -0
  111. package/dist/wallets/walletConnectors/chunk-RB3HR4R2.js +95 -0
  112. package/dist/wallets/walletConnectors/chunk-RVOY537T.js +100 -0
  113. package/dist/wallets/walletConnectors/chunk-STVVP43G.js +94 -0
  114. package/dist/wallets/walletConnectors/chunk-UK7C2JXW.js +87 -0
  115. package/dist/wallets/walletConnectors/chunk-VAPGUPHO.js +92 -0
  116. package/dist/wallets/walletConnectors/chunk-VTM6EECM.js +110 -0
  117. package/dist/wallets/walletConnectors/chunk-X6CGV36L.js +103 -0
  118. package/dist/wallets/walletConnectors/chunk-YEZM4CK4.js +96 -0
  119. package/dist/wallets/walletConnectors/chunk-ZNX4EMPB.js +106 -0
  120. package/dist/wallets/walletConnectors/index.js +33 -33
  121. package/package.json +5 -5
  122. package/dist/clients/chunk-DSZHYQPX.js +0 -31
  123. package/dist/clients/chunk-FNB7OPJI.js +0 -1316
  124. package/dist/clients/chunk-HZP4DXIZ.js +0 -231
  125. package/dist/clients/chunk-LUHEVXPD.js +0 -109
  126. package/dist/clients/chunk-SX3CX34W.js +0 -1177
  127. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +0 -17545
  128. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.d.ts +0 -30
  129. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +0 -20
  130. package/dist/clients/polymarket/index.css +0 -17545
  131. package/dist/modals/PolymarketPerpsTransfer/PerpsTransferRows.d.ts +0 -10
  132. package/dist/modals/PolymarketPerpsTransfer/TransferAmountRow.css.d.ts +0 -13
  133. package/dist/modals/PolymarketPerpsTransfer/TransferAmountRow.d.ts +0 -27
@@ -47,6 +47,7 @@ export declare enum CheckoutModalEvent {
47
47
  TOKEN_TRANSFER_SUCCESS = "fc::success::token_transfer",
48
48
  BLUVO_WITHDRAWAL_COMPLETED = "fc::success::bluvo_withdrawal_completed",
49
49
  QUICK_OPTION_SELECTED = "fc::input_amount::quick_option_selected",
50
+ PERPS_TRANSFER_PERCENT_OPTION_SELECTED = "fc::perps_transfer::percent_option_selected",
50
51
  SWAPPED_IFRAME_NAVIGATION = "fc::swapped_iframe::navigation",
51
52
  SWAPPED_IFRAME_NAVIGATION_INITIAL = "fc::swapped_iframe::navigation::initial",
52
53
  SWAPPED_IFRAME_NAVIGATION_LOGIN = "fc::swapped_iframe::navigation::login",
@@ -0,0 +1,10 @@
1
+ import type { CommonProperties } from './events';
2
+ export type CheckoutAnalyticsSource = {
3
+ id: string;
4
+ initSettings: {
5
+ config: {
6
+ dynamicRoutingId?: string | null;
7
+ };
8
+ };
9
+ };
10
+ export declare function getCheckoutAnalyticsProperties(checkout: CheckoutAnalyticsSource): Pick<CommonProperties, 'checkout_id' | 'dynamic_routing_id'>;
@@ -2,7 +2,9 @@ import type { QuoteMode } from '../../../domains/quoteMode';
2
2
  import type { DirectExecutionType } 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';
5
6
  import type { AmountSelectionType } from '../../../modals/CheckoutModal/InputAmount/state';
7
+ import type { WithdrawalModalStep } from '../../../modals/WithdrawalModal/types';
6
8
  /**
7
9
  * Analytics v2 — the improved, explicit Statsig event scheme that will replace
8
10
  * the `fc::`/`fw::` enums in `../CheckoutModalEvent.ts` / `../WithdrawModalEvent.ts`.
@@ -22,12 +24,15 @@ export declare enum AnalyticsEvent {
22
24
  DEPOSIT_QUOTE_CONFIRMED = "fc_deposit_quote_confirmed",
23
25
  DEPOSIT_SUCCEEDED = "fc_deposit_succeeded",
24
26
  DEPOSIT_TRANSFER_INTERACTED = "fc_deposit_transfer_interacted",
27
+ DEPOSIT_TRANSACTION_BREAKDOWN_CLICKED = "fc_deposit_transaction_breakdown_clicked",
25
28
  DEPOSIT_TRANSACTION_SUBMITTED = "fc_deposit_transaction_submitted",
26
29
  MODAL_OPENED = "fc_modal_opened",
27
30
  TAB_SWITCHED = "fc_tab_switched",
28
31
  WITHDRAWAL_AMOUNT_CONFIRMED = "fc_withdrawal_amount_confirmed",
29
32
  WITHDRAWAL_FAILED = "fc_withdrawal_failed",
33
+ WITHDRAWAL_METHOD_SELECTED = "fc_withdrawal_method_selected",
30
34
  WITHDRAWAL_SUCCEEDED = "fc_withdrawal_succeeded",
35
+ WITHDRAWAL_TRANSACTION_BREAKDOWN_CLICKED = "fc_withdrawal_transaction_breakdown_clicked",
31
36
  WITHDRAWAL_TRANSFER_INTERACTED = "fc_withdrawal_transfer_interacted",
32
37
  WITHDRAWAL_TRANSACTION_SUBMITTED = "fc_withdrawal_transaction_submitted"
33
38
  }
@@ -49,6 +54,8 @@ export type CommonProperties = {
49
54
  * currently active checkout.
50
55
  */
51
56
  checkout_id: string;
57
+ /** Raw routing identity selected for this checkout, when available. */
58
+ dynamic_routing_id: string | null;
52
59
  /** Human-readable connector name for the authenticated session wallet. */
53
60
  connector_name: string | null;
54
61
  flow: AnalyticsFlow;
@@ -140,6 +147,11 @@ export type VisibleQuoteFeeProperties = {
140
147
  swap_impact_pct: number | null;
141
148
  wallet_gas_cost_usd: number | null;
142
149
  };
150
+ export type TransactionBreakdownStep = FunCheckoutStep | WithdrawalModalStep;
151
+ /** Payload emitted when the user manually expands a transaction breakdown. */
152
+ export type TransactionBreakdownClickedProperties = PaymentMethodProperties & VisibleQuoteFeeProperties & {
153
+ step: Lowercase<TransactionBreakdownStep>;
154
+ };
143
155
  /** Route fields shared by quote-bearing and later lifecycle events. */
144
156
  export type DepositRouteContextProperties = DepositAssetContextProperties & {
145
157
  destination_address: string | null;
@@ -199,7 +211,6 @@ export type DepositNotificationInteractedProperties = DepositNotificationPropert
199
211
  */
200
212
  export type ModalOpenedProperties = {
201
213
  custom_recipient: string | null;
202
- dynamic_routing_id: string | null;
203
214
  exchange_count: number;
204
215
  flow: AnalyticsFlow;
205
216
  primary_exchange: string | null;
@@ -239,6 +250,11 @@ export type DepositTransferInteractedProperties = {
239
250
  target_asset_ticker: string | null;
240
251
  target_chain: string;
241
252
  };
253
+ /** Payload specific to {@link AnalyticsEvent.WITHDRAWAL_METHOD_SELECTED}. */
254
+ export type WithdrawalMethodSelectedProperties = PaymentMethodProperties & {
255
+ connection_status: ConnectionStatus | null;
256
+ payment_rail: AnalyticsPaymentRail | null;
257
+ };
242
258
  export type WithdrawalTransferInteractionAction = 'address_autofilled' | 'address_changed' | 'amount_changed' | 'chain_changed' | 'max_button_clicked' | 'token_changed';
243
259
  /** Payload specific to {@link AnalyticsEvent.WITHDRAWAL_TRANSFER_INTERACTED}. */
244
260
  export type WithdrawalTransferInteractedProperties = PaymentMethodProperties & {
@@ -272,12 +288,15 @@ export type AnalyticsEventProperties = {
272
288
  [AnalyticsEvent.DEPOSIT_QUOTE_CONFIRMED]: DepositQuoteConfirmedProperties;
273
289
  [AnalyticsEvent.DEPOSIT_SUCCEEDED]: ExecutionSucceededProperties;
274
290
  [AnalyticsEvent.DEPOSIT_TRANSFER_INTERACTED]: DepositTransferInteractedProperties;
291
+ [AnalyticsEvent.DEPOSIT_TRANSACTION_BREAKDOWN_CLICKED]: TransactionBreakdownClickedProperties;
275
292
  [AnalyticsEvent.DEPOSIT_TRANSACTION_SUBMITTED]: TransactionSubmittedProperties;
276
293
  [AnalyticsEvent.MODAL_OPENED]: ModalOpenedProperties;
277
294
  [AnalyticsEvent.TAB_SWITCHED]: TabSwitchedProperties;
278
295
  [AnalyticsEvent.WITHDRAWAL_AMOUNT_CONFIRMED]: WithdrawalAmountConfirmedProperties;
279
296
  [AnalyticsEvent.WITHDRAWAL_FAILED]: ExecutionFailedProperties;
297
+ [AnalyticsEvent.WITHDRAWAL_METHOD_SELECTED]: WithdrawalMethodSelectedProperties;
280
298
  [AnalyticsEvent.WITHDRAWAL_SUCCEEDED]: ExecutionSucceededProperties;
299
+ [AnalyticsEvent.WITHDRAWAL_TRANSACTION_BREAKDOWN_CLICKED]: TransactionBreakdownClickedProperties;
281
300
  [AnalyticsEvent.WITHDRAWAL_TRANSFER_INTERACTED]: WithdrawalTransferInteractedProperties;
282
301
  [AnalyticsEvent.WITHDRAWAL_TRANSACTION_SUBMITTED]: TransactionSubmittedProperties;
283
302
  };
@@ -9,4 +9,6 @@ export declare const NULL_VISIBLE_QUOTE_FEE_PROPERTIES: VisibleQuoteFeePropertie
9
9
  * network/impact rows; other rails report their own cost row from
10
10
  * `finalFeesBreakdown` and leave the Relay-specific rows null.
11
11
  */
12
- export declare function resolveVisibleQuoteFeeProperties(latestQuote: ApiFunkitCheckoutQuoteResult | FunkitCheckoutQuoteResult | null): VisibleQuoteFeeProperties;
12
+ export declare function resolveVisibleQuoteFeeProperties(latestQuote: ApiFunkitCheckoutQuoteResult | FunkitCheckoutQuoteResult | null, { extraSourceChainGasUsd }?: {
13
+ extraSourceChainGasUsd?: number;
14
+ }): VisibleQuoteFeeProperties;
@@ -3,6 +3,7 @@ import type { ApiFunkitCheckoutQuoteResult } from '@funkit/utils';
3
3
  import type { PaymentMethodInfo } from '../../../domains/paymentMethods';
4
4
  import type { QuoteMode } from '../../../domains/quoteMode';
5
5
  import type { AnalyticsFlow } from './events';
6
+ import type { CheckoutAnalyticsSource } from './checkout';
6
7
  import type { NotificationItem } from '../../../modals/CheckoutModal/TransferToken/types';
7
8
  type AssetDescriptor = {
8
9
  chainId: string;
@@ -10,9 +11,9 @@ type AssetDescriptor = {
10
11
  ticker: string | null;
11
12
  };
12
13
  export type ExecutionTransactionSubmittedArgs = {
14
+ checkout: CheckoutAnalyticsSource;
13
15
  destinationAddress: string | null;
14
16
  executionType: DirectExecutionType | null;
15
- historicalCheckoutId: string;
16
17
  historicalUserId: string | null;
17
18
  paymentMethodInfo: PaymentMethodInfo;
18
19
  quote: ApiFunkitCheckoutQuoteResult | null;
@@ -1,5 +1,4 @@
1
1
  import type { DirectExecutionType, FormOfPaymentType, MeldQuote, MeldServiceProvider } from '@funkit/api-base';
2
- import type { ApiFunkitCheckoutQuoteResult } from '@funkit/utils';
3
2
  import { PaymentMethod, type PaymentMethodInfo } from '../../../domains/paymentMethods';
4
3
  import { QuoteMode } from '../../../domains/quoteMode';
5
4
  import type { FunkitCheckoutQuoteResult } from '../../../domains/quote';
@@ -76,21 +75,6 @@ export type TrackDepositQuoteSnapshotArgs = {
76
75
  targetAssetAmount: string | null;
77
76
  tradeType: QuoteMode;
78
77
  };
79
- export type ExecutionTransactionSubmittedArgs = {
80
- destinationAddress: string | null;
81
- executionType: DirectExecutionType | null;
82
- historicalCheckoutId: string;
83
- historicalUserId: string | null;
84
- paymentMethodInfo: PaymentMethodInfo;
85
- quote: ApiFunkitCheckoutQuoteResult | null;
86
- source: AssetDescriptorArgs | null;
87
- sourceAddress: string | null;
88
- sourceAssetAmount: string | null;
89
- target: AssetDescriptorArgs;
90
- targetAssetAmount: string | null;
91
- tradeType: QuoteMode | null;
92
- txHash: string | null;
93
- };
94
78
  export type TrackDepositMeldQuoteDisplayedArgs = {
95
79
  numQuoteRefreshes: number;
96
80
  quote: MeldQuote;
@@ -1,4 +1,6 @@
1
- import { type WithdrawalAmountSelectionType, type WithdrawalTransferInteractionAction } from './events';
1
+ import type { FormOfPaymentType } from '@funkit/api-base';
2
+ import { PaymentMethod } from '../../../domains/paymentMethods';
3
+ import { type AnalyticsPaymentRail, type ConnectionStatus, type WithdrawalAmountSelectionType, type WithdrawalTransferInteractionAction } from './events';
2
4
  type AssetDescriptorArgs = {
3
5
  chainId: string;
4
6
  tokenAddress: string;
@@ -11,6 +13,14 @@ export type TrackWithdrawalAmountConfirmedArgs = {
11
13
  target: AssetDescriptorArgs;
12
14
  targetAmount: number | null;
13
15
  };
16
+ export type TrackWithdrawalMethodSelectedArgs = {
17
+ connectionStatus?: ConnectionStatus;
18
+ /** Some Swapped methods can't be mapped to PaymentMethod and are forwarded as-is. */
19
+ paymentMethod: PaymentMethod | FormOfPaymentType;
20
+ paymentRail?: AnalyticsPaymentRail;
21
+ /** Selected checkout provider, such as a Bluvo exchange or a Lighter method id. */
22
+ provider?: string;
23
+ };
14
24
  export type TrackWithdrawalTransferInteractedArgs = {
15
25
  action: WithdrawalTransferInteractionAction;
16
26
  balanceAmount: string | null;
@@ -36,6 +46,7 @@ export type TrackWithdrawalTransferInteractedArgs = {
36
46
  /** Gathers withdrawal context and emits withdrawal-family analytics events. */
37
47
  export declare function useWithdrawalAnalytics(): {
38
48
  trackWithdrawalAmountConfirmed: (args: TrackWithdrawalAmountConfirmedArgs) => void;
49
+ trackWithdrawalMethodSelected: (args: TrackWithdrawalMethodSelectedArgs) => void;
39
50
  trackWithdrawalTransferInteracted: (args: TrackWithdrawalTransferInteractedArgs) => void;
40
51
  };
41
52
  export {};
@@ -17,4 +17,6 @@ export declare function useIsQRCodeTransferEnabled(): {
17
17
  /**
18
18
  * creates QR code transfer EOA
19
19
  */
20
- export declare const useCheckoutTransferInit: (enabled?: boolean) => UseCheckoutTransferInitResponse;
20
+ export declare const useCheckoutTransferInit: (enabled?: boolean, { trackStepReadiness }?: {
21
+ trackStepReadiness?: boolean;
22
+ }) => UseCheckoutTransferInitResponse;
@@ -0,0 +1,19 @@
1
+ export declare function getFittedTextFontSize({ availableWidth, textWidthAtMaxFontSize, maxFontSize, minFontSize, }: {
2
+ availableWidth: number;
3
+ textWidthAtMaxFontSize: number;
4
+ maxFontSize: number;
5
+ minFontSize: number;
6
+ }): number;
7
+ export declare function useFittedText(options: {
8
+ availableWidthRef?: React.RefObject<HTMLElement | null>;
9
+ enabled?: boolean;
10
+ maxAvailableWidth?: number;
11
+ maxFontSize?: number;
12
+ minFontSize: number;
13
+ remeasureKey?: unknown;
14
+ text: string;
15
+ textRef: React.RefObject<HTMLInputElement | HTMLTextAreaElement | null>;
16
+ }): {
17
+ fontSize: number | undefined;
18
+ textWidth: number | undefined;
19
+ };
@@ -9,26 +9,14 @@ import type { Address } from 'viem';
9
9
  */
10
10
  export declare const polymarketAccountBalanceQueryKey: (address: Address | undefined) => readonly ["polymarket", "accountBalanceUsd", `0x${string}` | null];
11
11
  /**
12
- * Optimistically moves a transfer's amount between the two accounts' displayed
13
- * balances — call right after the integrator accepts the transfer. `amountUsd`
14
- * is the exact string the user entered (validated numeric, ≤6 decimals), the
15
- * same string handed to `transfer` — the math runs in 6-decimal fixed point,
16
- * never through a float round-trip.
17
- *
18
- * This is the standard TanStack optimistic-update sequence: cancel in-flight
19
- * fetches, write the new values with `setQueryData` so every reader (deposit
20
- * picker, transfer step) updates immediately, and let the server win again
21
- * later. "Later" is a settlement window rather than the next poll because the
22
- * integrator's backend is eventually consistent — it keeps reporting the
23
- * pre-transfer balances for a few seconds after accepting the transfer, so
24
- * polls inside the window keep the displayed value instead of flashing back.
12
+ * Refetches the given accounts' balances right away — call once the
13
+ * integrator's `transfer` resolves so the displayed numbers move without
14
+ * waiting out the poll interval. Nothing is adjusted client-side: the values
15
+ * shown before, during and after a transfer are always what the integrator's
16
+ * `getBalanceUsd` reports, so the modal can never disagree with the
17
+ * integrator's own balance display.
25
18
  */
26
- export declare function applyOptimisticTransferBalances(queryClient: QueryClient, transfer: {
27
- fromAddress: Address;
28
- toAddress: Address;
29
- /** Exact entered amount (validated numeric string, ≤6 decimals). */
30
- amountUsd: string;
31
- }): void;
19
+ export declare function refetchPolymarketAccountBalances(queryClient: QueryClient, addresses: readonly Address[]): Promise<void>;
32
20
  /** The fields a balance reader needs from a Polymarket account. */
33
21
  export interface PolymarketBalanceAccount {
34
22
  address: Address;
@@ -38,12 +26,13 @@ export interface PolymarketBalanceAccount {
38
26
  export interface PolymarketAccountBalance {
39
27
  /** Latest polled balance, or `undefined` until the first fetch resolves. */
40
28
  balanceUsd: number | undefined;
29
+ /** Whether the last balance is being retained while its query reloads. */
30
+ isRefreshing: boolean;
41
31
  }
42
32
  export interface UsePolymarketAccountBalancesOptions {
43
33
  /**
44
34
  * How often (ms) to poll each account's balance. Defaults to
45
- * {@link DEFAULT_BALANCE_REFETCH_MS}. A short interval reconciles the
46
- * displayed balance with the server soon after a transfer settles.
35
+ * {@link DEFAULT_BALANCE_REFETCH_MS}.
47
36
  */
48
37
  refetchIntervalMs?: number;
49
38
  }
@@ -52,10 +41,9 @@ export interface UsePolymarketAccountBalancesOptions {
52
41
  * by a single TanStack Query cache keyed by account address. Both the "Deposit
53
42
  * to" dropdown and the in-modal transfer step read through this hook, so they
54
43
  * share one store: whichever screen loads first populates the balance, and the
55
- * other reads it instantly on navigation. After a transfer,
56
- * {@link applyOptimisticTransferBalances} shifts the cached values immediately
57
- * and the short poll reconciles them with the server once the settlement
58
- * window closes.
44
+ * other reads it instantly on navigation. The values are the integrator's
45
+ * own, unmodified; a completed transfer refetches them via
46
+ * {@link refetchPolymarketAccountBalances}.
59
47
  */
60
48
  export declare function usePolymarketAccountBalances(accounts: {
61
49
  predictions: PolymarketBalanceAccount | undefined;
@@ -1,3 +1,3 @@
1
- export declare function useTextMeasurer(inputRef: React.RefObject<HTMLInputElement | null>): {
1
+ export declare function useTextMeasurer(inputRef: React.RefObject<HTMLInputElement | HTMLTextAreaElement | null>): {
2
2
  measureText: (text: string, fontSize?: number) => number | undefined;
3
3
  };
@@ -2,7 +2,17 @@
2
2
  * @external
3
3
  * Allows clients to update the active funkit checkout item's displayable fields.
4
4
  * DANGER: Sensitive fields like asset and amounts should not be updateable by clients
5
+ *
6
+ * - `updateModalTitleMeta` — the subtitle under the modal title.
7
+ * - `updatePolymarketPerpsTransferPending` — whether a perps deposit and/or
8
+ * withdrawal is in flight on the integrator's side. While either is pending
9
+ * the perps transfer step disables Transfer and shows a pending state.
10
+ * Pass the same flags as `createPolymarketDepositConfig`'s
11
+ * `pendingTransfers` for the initial state; call this whenever they change.
12
+ *
13
+ * When this hook is read with no active checkout, it returns no-op callbacks.
5
14
  */
6
15
  export declare const useUpdateActiveFunkitCheckout: () => {
7
16
  updateModalTitleMeta: (newMeta: string) => void;
17
+ updatePolymarketPerpsTransferPending: (pending: import("../providers/FunkitCheckoutContext").PolymarketPerpsTransferPending) => void;
8
18
  };