@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,105 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 11.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - bbb0301: Lighter Native Bridge withdrawals record the same attribution row on every platform.
8
+
9
+ Move `trackLighterSecureWithdrawal` export from `connect` to `connect-core`
10
+
11
+ - 3e31f1c: Allow Nado withdrawals to start with the borrow toggle preselected.
12
+ - 3d95b7f: Risk assessment now screens on the transaction's chain: `getRiskAssessmentForAddress` accepts an optional `chainId`, and checkout and withdrawal screens send it.
13
+
14
+ ### Patch Changes
15
+
16
+ - 480d658: Consolidate common event properties.
17
+ - 76dafe1: Withdrawal flat-fee deduction now comes from `@funkit/connect-core`, so web and React Native price the same amount.
18
+ - 993ac35: React Native token pricing now falls back to Relay when the funkit price API can't price a token, so configured USD withdrawal limits stay enforced.
19
+ - db08b0d: fix(connect): reject non-decimal withdrawal source balance values
20
+ - e1354ad: Update fiat default pill amounts
21
+ - Updated dependencies [fade45e]
22
+ - Updated dependencies [759b3f4]
23
+ - Updated dependencies [c667b94]
24
+ - Updated dependencies [c667b94]
25
+ - Updated dependencies [53d7f38]
26
+ - Updated dependencies [76dafe1]
27
+ - Updated dependencies [bbb0301]
28
+ - Updated dependencies [07a4ae6]
29
+ - Updated dependencies [3d95b7f]
30
+ - Updated dependencies [993ac35]
31
+ - Updated dependencies [db08b0d]
32
+ - Updated dependencies [e1354ad]
33
+ - @funkit/api-base@7.1.0
34
+ - @funkit/connect-core@3.1.0
35
+ - @funkit/fun-relay@2.12.0
36
+
37
+ ## 11.3.0
38
+
39
+ ### Minor Changes
40
+
41
+ - 86b10f0: Polymarket perps ⇄ predictions transfers are now recorded, so transfer volume appears alongside deposits and withdrawals.
42
+ - 25ed52b: Polymarket transfer handles may now return the rail's identifier, which is then used to key the transfer record.
43
+
44
+ ### Patch Changes
45
+
46
+ - e5d96c1: Centralize submitted execution analytics in a shared progress tracker.
47
+ - 34dced8: Improves checkout confirmation handling for wallet-balance transactions.
48
+ - 2863fb5: Prepares analytics to avoid duplicate progress and settlement events.
49
+ - e2c119b: Add `trackDepositMethodSelected` to the internal deposit analytics hook (not yet wired to any component).
50
+ - 3192b6c: Report brokerage selections consistently across connected and new exchange flows.
51
+ - 7f67517: Report payment-method selections consistently across checkout funding flows.
52
+ - 47f4452: Records wallet-balance deposit transaction submissions in analytics.
53
+ - f0b7d38: Records analytics when a deposit transaction is submitted.
54
+ - 9f4c677: Adds analytics when a displayed deposit quote is confirmed.
55
+ - 93bf78c: Adds analytics when a deposit quote is displayed.
56
+ - 057e064: Preserve deposit quote amounts and fee details in checkout analytics events.
57
+ - 37958f8: Model submitted executions with persisted analytics snapshots.
58
+ - b361db0: Export the Lighter account-by-index query and unstaked-fee helpers from `@funkit/connect-core`.
59
+ - 332d186: Support Lighter withdrawals from the new `@funkit/connect-core/clients/lighter` entry on both web and React Native.
60
+ - aafdbba: Lighter constants and helpers move to the `@funkit/connect-core/clients/lighter` entry.
61
+ - c68c3d6: Share Lighter withdrawal support from `@funkit/connect-core`.
62
+ - d2336bb: Lighter's bridge delay is now a shared `useLighterWithdrawalDelaySeconds` hook, and a main-account index that isn't numeric resolves as unset.
63
+ - faec499: Fire `fc_deposit_method_selected` when entering the Bitcoin Lightning deposit flow, and `fc_deposit_asset_selected` when it's entered by selecting BTC-on-Lightning from the Transfer Crypto chain dropdown.
64
+ - a5c5bed: feat(connect-core): share one Chainalysis address screen across web and React Native — withdrawals now proceed when screening returns no risk level
65
+ - 1b5c4b0: Keep payment-method metadata consistent across deposit analytics events.
66
+ - f0ae438: Persist deposit/withdrawal analytics event dedup across browser sessions instead of resetting each session.
67
+ - bfcfd1e: Resolve submitted execution analytics from persisted checkout history.
68
+ - fb189e7: Route confirmed wallet submissions through shared execution progress tracking.
69
+ - d21e54e: Keep withdrawal recipient screening consistent across web and React Native
70
+ - a6cc332: Renamed `toWithdrawalExecutionErrorCode` to `toWalletExecutionErrorCode` and its `WithdrawalExecutionErrorCode` type to `WalletExecutionErrorCode`.
71
+
72
+ Migration: rename the import — the codes (`insufficient-gas`, `switch-chain`, `generic`) and behavior are unchanged.
73
+
74
+ - 8ac640d: Tracks displayed deposit quotes during checkout.
75
+ - c13b6a7: Prepare nullable quote-fee analytics for polling and notification events wired in follow-up changes.
76
+ - f39b525: Track when deposit notifications are displayed, dismissed, or expanded.
77
+ - 7363b9a: Track Transfer Crypto token, chain, and address-copy interactions.
78
+ - ed08150: Track failed executions from persisted progress updates.
79
+ - 5796c54: Track the best available Meld quote across deposit amount and provider screens.
80
+ - 3e83583: Add `fc_modal_opened` analytics tracking.
81
+ - a38347e: Track submitted executions from checkout history polling.
82
+ - 6ab0890: Track submitted executions from displayed checkout notifications.
83
+ - d6caeb8: Track successful executions from persisted progress updates.
84
+ - 2ae5b72: Add `fc_tab_switched` analytics tracking.
85
+ - b1941d4: Track submitted, successful, and failed withdrawals from progress updates.
86
+ - 225add6: Track amount selection when users confirm a withdrawal.
87
+ - bfb445d: Track when users confirm a withdrawal amount.
88
+ - bd76c6c: Track when users open the withdrawal modal.
89
+ - Updated dependencies [856057c]
90
+ - Updated dependencies [b361db0]
91
+ - Updated dependencies [332d186]
92
+ - Updated dependencies [aafdbba]
93
+ - Updated dependencies [c68c3d6]
94
+ - Updated dependencies [d2336bb]
95
+ - Updated dependencies [35b64db]
96
+ - Updated dependencies [a5c5bed]
97
+ - Updated dependencies [86b10f0]
98
+ - Updated dependencies [a6cc332]
99
+ - Updated dependencies [3a6351a]
100
+ - @funkit/fun-relay@2.11.0
101
+ - @funkit/connect-core@3.0.0
102
+
3
103
  ## 11.2.0
4
104
 
5
105
  ### Minor Changes
@@ -10,9 +10,8 @@ import {
10
10
  safeBigInt
11
11
  } from "./chunk-63XTVHO3.js";
12
12
  import {
13
- deductFlatFee,
14
13
  toWithdrawalAmountBaseUnit
15
- } from "./chunk-DGBIV3ZS.js";
14
+ } from "./chunk-B7UU2ETA.js";
16
15
  import {
17
16
  x18ToRawBaseUnit
18
17
  } from "./chunk-6T6URLBM.js";
@@ -49,16 +48,11 @@ import {
49
48
  NADO_API_KEY,
50
49
  initializeCheckoutTokenTransferAddress
51
50
  } from "@funkit/api-base";
51
+ import { deductFlatFee } from "@funkit/connect-core";
52
52
  import { isEVMAddressEquivalent } from "@funkit/utils";
53
53
 
54
54
  // src/utils/signature.ts
55
- function isUserRejectedError(error) {
56
- if (!(error instanceof Error)) {
57
- return false;
58
- }
59
- const regex = /user\s?rejected/gi;
60
- return regex.test(error.name) || regex.test(error.message);
61
- }
55
+ import { isSwitchChainError, isUserRejectedError } from "@funkit/connect-core";
62
56
 
63
57
  // src/clients/internal/nado/withdrawalCallback.ts
64
58
  var NadoWithdrawalInputError = class extends Error {
@@ -0,0 +1,20 @@
1
+ "use client";
2
+
3
+ // src/utils/customer.ts
4
+ import {
5
+ useLighterAccountQuery,
6
+ useLighterAccountsQuery
7
+ } from "@funkit/connect-core";
8
+ import {
9
+ LIGHTER_TRADING_MODE,
10
+ getLighterAccount,
11
+ getLighterAccountsByL1Address,
12
+ useInvalidateLighterAccount,
13
+ useLighterAccountQuery as useLighterAccountQuery2,
14
+ useLighterAccountsQuery as useLighterAccountsQuery2
15
+ } from "@funkit/connect-core";
16
+
17
+ export {
18
+ useLighterAccountQuery2 as useLighterAccountQuery,
19
+ useLighterAccountsQuery2 as useLighterAccountsQuery
20
+ };
@@ -3,19 +3,7 @@
3
3
  // src/utils/withdrawal.ts
4
4
  import { chainMetadataById } from "@funkit/chains";
5
5
  import { isEVMAddressEquivalent, isTokenEquivalent } from "@funkit/utils";
6
- import * as dnum from "dnum";
7
6
  import { parseUnits } from "viem";
8
- function deductFlatFee(inputAmount, feeTokens) {
9
- if (!feeTokens || feeTokens <= 0) {
10
- return inputAmount;
11
- }
12
- try {
13
- const net = dnum.subtract(inputAmount || "0", feeTokens);
14
- return dnum.greaterThan(net, 0) ? dnum.toString(net) : "0";
15
- } catch {
16
- return "0";
17
- }
18
- }
19
7
  function isCustomWithdrawalConfig(config) {
20
8
  return "withdrawCallback" in config;
21
9
  }
@@ -30,7 +18,6 @@ function toWithdrawalAmountBaseUnit(amount, decimals) {
30
18
  }
31
19
 
32
20
  export {
33
- deductFlatFee,
34
21
  isCustomWithdrawalConfig,
35
22
  toWithdrawalAmountBaseUnit
36
23
  };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  isCustomWithdrawalConfig
4
- } from "./chunk-DGBIV3ZS.js";
4
+ } from "./chunk-B7UU2ETA.js";
5
5
  import {
6
6
  buildNadoSubaccountId
7
7
  } from "./chunk-6T6URLBM.js";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  createNadoWithdrawalCallback
4
- } from "../../chunk-SU3YSNMB.js";
4
+ } from "../../chunk-3Y5EIONT.js";
5
5
  import "../../chunk-2576N7PQ.js";
6
6
  import "../../chunk-VIAEAD75.js";
7
7
  import "../../chunk-63XTVHO3.js";
8
- import "../../chunk-DGBIV3ZS.js";
8
+ import "../../chunk-B7UU2ETA.js";
9
9
  import "../../chunk-6T6URLBM.js";
10
10
  import "../../chunk-TZGKB6WY.js";
11
11
  import "../../chunk-3P2C436B.js";
@@ -9,6 +9,8 @@ import type { CustomWithdrawalConfig, FunkitWithdrawalConfig } from '../../../pr
9
9
  import type { NadoWithdrawalCustomerConfig } from './withdrawalTypes';
10
10
  export interface NadoWithdrawalConfig extends CustomWithdrawalConfig {
11
11
  customerConfig: NadoWithdrawalCustomerConfig;
12
+ /** Initial state of the borrow (spot leverage) toggle; the user may still flip it. */
13
+ defaultSpotLeverage?: boolean;
12
14
  }
13
15
  export declare function isNadoWithdrawalConfig(config: FunkitWithdrawalConfig | null | undefined): config is NadoWithdrawalConfig;
14
16
  /** Packed subaccount id, or undefined when one can't be built — the caller
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  isNadoWithdrawalConfig,
4
4
  resolveNadoSubaccount
5
- } from "../../chunk-QQEGNLGD.js";
6
- import "../../chunk-DGBIV3ZS.js";
5
+ } from "../../chunk-EQFVPSR2.js";
6
+ import "../../chunk-B7UU2ETA.js";
7
7
  import "../../chunk-6T6URLBM.js";
8
8
  import "../../chunk-AHYOV7AV.js";
9
9
  export {
@@ -4,13 +4,13 @@ import {
4
4
  useNadoMaxWithdrawable
5
5
  } from "../../chunk-FM7SFGAV.js";
6
6
  import "../../chunk-JFDRLSYM.js";
7
- import {
8
- isNadoWithdrawalConfig
9
- } from "../../chunk-QQEGNLGD.js";
10
7
  import {
11
8
  safeBigInt
12
9
  } from "../../chunk-63XTVHO3.js";
13
- import "../../chunk-DGBIV3ZS.js";
10
+ import {
11
+ isNadoWithdrawalConfig
12
+ } from "../../chunk-EQFVPSR2.js";
13
+ import "../../chunk-B7UU2ETA.js";
14
14
  import {
15
15
  x18ToRawBaseUnit,
16
16
  x18ToTokenUnits
@@ -23,7 +23,7 @@ import {
23
23
  useGeneralWallet
24
24
  } from "../../chunk-BPDLF2R6.js";
25
25
  import "../../chunk-5MY7WMEJ.js";
26
- import "../../chunk-6QCAWEAT.js";
26
+ import "../../chunk-6EU6CXNH.js";
27
27
  import {
28
28
  useFunkitConfig
29
29
  } from "../../chunk-UK64SY6N.js";
@@ -41,13 +41,7 @@ import { useEffect, useMemo, useState } from "react";
41
41
  import { formatUnits } from "viem";
42
42
 
43
43
  // src/hooks/useAssetPrice.ts
44
- import {
45
- getAssetPriceInfo
46
- } from "@funkit/api-base";
47
- import {
48
- convertFunToRelayTokenAddress,
49
- getRelayAssetPriceInfo
50
- } from "@funkit/fun-relay";
44
+ import { getAssetPriceInfoWithFallback } from "@funkit/connect-core";
51
45
  import { skipToken, useQuery } from "@tanstack/react-query";
52
46
 
53
47
  // src/hooks/useIsStablecoin.ts
@@ -87,48 +81,6 @@ var useIsStablecoin = () => {
87
81
  };
88
82
 
89
83
  // src/hooks/useAssetPrice.ts
90
- async function getFormattedRelayAssetPriceInfo({
91
- chainId,
92
- assetTokenAddress
93
- }) {
94
- try {
95
- const relayResponse = await getRelayAssetPriceInfo({
96
- chainId,
97
- address: convertFunToRelayTokenAddress(
98
- assetTokenAddress,
99
- Number(chainId)
100
- )
101
- });
102
- return {
103
- unitPrice: relayResponse.price,
104
- amount: 1,
105
- total: 1
106
- };
107
- } catch (error) {
108
- logger.error("Unable to fetch token price from Relay", error);
109
- throw error;
110
- }
111
- }
112
- async function getAssetPriceInfoWithFallback({
113
- apiKey,
114
- chainId,
115
- assetTokenAddress
116
- }) {
117
- try {
118
- return await getAssetPriceInfo({
119
- apiKey,
120
- assetTokenAddress,
121
- chainId,
122
- logger
123
- });
124
- } catch (primaryError) {
125
- logger.warn(
126
- "Unable to fetch token price from Primary provider, trying fallback",
127
- { primaryError }
128
- );
129
- return await getFormattedRelayAssetPriceInfo({ chainId, assetTokenAddress });
130
- }
131
- }
132
84
  function useAssetAddressPrice({
133
85
  chainId,
134
86
  assetTokenAddress,
@@ -144,7 +96,8 @@ function useAssetAddressPrice({
144
96
  queryFn: enabled && chainId && assetTokenAddress ? () => getAssetPriceInfoWithFallback({
145
97
  apiKey,
146
98
  chainId,
147
- assetTokenAddress
99
+ assetTokenAddress,
100
+ logger
148
101
  }) : skipToken,
149
102
  refetchInterval
150
103
  });
@@ -190,11 +143,13 @@ function useNadoWithdrawalForm(config, selectedSourceToken) {
190
143
  const isNado = !!nadoConfig;
191
144
  const subaccount = nadoConfig?.customerConfig.subaccount;
192
145
  const { t } = useFunkitTranslation();
193
- const [spotLeverage, setSpotLeverage] = useState(false);
146
+ const [spotLeverage, setSpotLeverage] = useState(
147
+ () => nadoConfig?.defaultSpotLeverage ?? false
148
+ );
194
149
  const { data: feeRates } = useNadoFeeRates(subaccount);
195
150
  useEffect(() => {
196
- setSpotLeverage(false);
197
- }, [subaccount]);
151
+ setSpotLeverage(nadoConfig?.defaultSpotLeverage ?? false);
152
+ }, [subaccount, nadoConfig?.defaultSpotLeverage]);
198
153
  const amountToggle = {
199
154
  label: t("withdrawal.enableBorrowing"),
200
155
  tooltip: t("withdrawal.enableBorrowingTooltip"),
@@ -14,32 +14,12 @@
14
14
  * caller provides the actual on-chain implementation.
15
15
  */
16
16
  import { type Address } from 'viem';
17
+ import { type LighterSigner } from '@funkit/connect-core/clients/lighter';
17
18
  import type { CustomWithdrawalConfig, LighterRouteType, MultiMethodWithdrawalConfig, SourceTokenOption, WithdrawalSourceTokenBalanceParams } from '../providers/FunkitCheckoutContext/types';
18
- export { LIGHTER_ROUTE_TYPE } from '../modals/WithdrawalModal/LighterWithdrawal';
19
+ export { LIGHTER_ROUTE_TYPE } from '@funkit/connect-core/clients/lighter';
19
20
  export type { LighterRouteType } from '../providers/FunkitCheckoutContext/types';
20
- export { LIGHTER_WITHDRAW_ABI, buildLighterL1WithdrawTransaction, isLighterWithdrawalRateLimitError, lighterWithdrawBaseUnits, } from '../utils/lighter';
21
- export type LighterTransferParams = {
22
- toAccountIndex: number;
23
- assetIndex: number;
24
- fromRouteType: number;
25
- toRouteType: number;
26
- amount: number;
27
- usdcFee: number;
28
- memo: string;
29
- ethSigner?: {
30
- signMessage: (message: string) => Promise<string>;
31
- };
32
- nonce?: number;
33
- };
34
- export type LighterTransaction = {
35
- hash: string;
36
- status: number | 'pending' | 'confirmed' | 'failed';
37
- block_height?: number;
38
- message?: string;
39
- };
40
- export type LighterSigner = {
41
- transfer: (params: LighterTransferParams) => Promise<[unknown, string, string | null]>;
42
- };
21
+ export type { LighterSigner, LighterTransaction, LighterTransferParams, } from '@funkit/connect-core/clients/lighter';
22
+ export { LIGHTER_WITHDRAW_ABI, buildLighterL1WithdrawTransaction, isLighterWithdrawalRateLimitError, lighterWithdrawBaseUnits, } from '@funkit/connect-core/clients/lighter';
43
23
  export interface LighterWithdrawalConfig {
44
24
  /**
45
25
  * The connected user's L1 address. The hook resolves the Lighter account
@@ -85,12 +65,6 @@ export interface LighterWithdrawalConfig {
85
65
  */
86
66
  onBeforeSign?: () => Promise<void> | void;
87
67
  }
88
- /**
89
- * Default minimum Secure-withdrawal amounts (token units) for known Lighter
90
- * assets. Used as a fallback when `LighterWithdrawalConfig.getSecureMinWithdrawalAmount`
91
- * is omitted or returns `undefined` for a symbol.
92
- */
93
- export declare const LIGHTER_DEFAULT_SECURE_MIN_WITHDRAWAL_AMOUNTS: Record<string, number>;
94
68
  export interface LighterSecureWithdrawalCallbackParams {
95
69
  /** Withdrawal amount in token units (e.g. "1.5" for 1.5 ETH). */
96
70
  amountTokenUnits: string;
@@ -132,37 +106,6 @@ export interface LighterSecureWithdrawalConfig {
132
106
  */
133
107
  onBeforeSign?: () => Promise<void> | void;
134
108
  }
135
- /**
136
- * Records a Lighter Secure withdrawal in Fun's direct-execution table as
137
- * `EXTERNALLY_FULFILLED` — tracking-only, since Fun is not in the execution
138
- * path. The row is keyed off the L2 tx hash and exists purely for attribution
139
- * and support tooling; the backend writes a one-time terminal `listenerInfo`
140
- * and never polls for L1 settlement (see EXTERNALLY_FULFILLED design doc).
141
- *
142
- * Fire-and-forget: callers should not await this, and any failure here must
143
- * not block the withdrawal success UI. Failures log at warn/error and return.
144
- */
145
- export declare function trackLighterSecureWithdrawal({ apiKey, userId, txHash, recipientAddr, assetIndex, mainnetTokenAddress, amountTokenUnits, withdrawalUSD, }: {
146
- apiKey: string;
147
- userId: string;
148
- txHash: string;
149
- recipientAddr: Address;
150
- /**
151
- * Lighter L2 asset index. Used as `fromTokenAddress`
152
- * (`pad(toHex(assetIndex))`) and to resolve symbol + mainnet decimals from
153
- * {@link LIGHTER_SECURE_ASSETS_BY_INDEX}.
154
- */
155
- assetIndex: number;
156
- /** Mainnet ERC-20 address the L2 asset bridges to (resolved by the modal). */
157
- mainnetTokenAddress: Address;
158
- /** User-input amount in token units (e.g. "1.5" for 1.5 ETH). */
159
- amountTokenUnits: string;
160
- /**
161
- * USD value of the withdrawal as computed by the modal (token amount × live
162
- * spot price). Avoids a separate spot-price round-trip from this helper.
163
- */
164
- withdrawalUSD: string;
165
- }): Promise<void>;
166
109
  /** Single-method config for Lighter's Secure withdrawal (bridge to Ethereum). */
167
110
  export declare function createLighterSecureWithdrawalConfig(config: LighterSecureWithdrawalConfig): CustomWithdrawalConfig;
168
111
  /**