@funkit/connect 11.2.0 → 11.3.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 +66 -0
- package/dist/clients/{chunk-SU3YSNMB.js → chunk-46L2KJJ4.js} +4 -10
- package/dist/clients/chunk-6EU6CXNH.js +20 -0
- package/dist/clients/internal/nado/withdrawalCallback.js +2 -2
- package/dist/clients/internal/nado/withdrawalForm.js +4 -4
- package/dist/clients/lighter.d.ts +4 -30
- package/dist/clients/lighter.js +70 -254
- package/dist/clients/nado.js +5 -5
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +5 -5
- package/dist/clients/polymarket/createPolymarketDepositConfig.d.ts +6 -0
- package/dist/clients/polymarket/index.js +9 -9
- package/dist/components/FunCheckoutHistory/FunCheckoutHistoryContent.d.ts +3 -1
- package/dist/components/FunCheckoutHistory/PendingSuccessScreen.d.ts +3 -1
- package/dist/domains/checkout.d.ts +2 -1
- package/dist/hooks/track/analytics/claimAnalyticsEvent.d.ts +5 -0
- package/dist/hooks/track/analytics/events.d.ts +171 -3
- package/dist/hooks/track/analytics/mappers.d.ts +15 -0
- package/dist/hooks/track/analytics/quote.d.ts +12 -0
- package/dist/hooks/track/analytics/resolveExecutionProgressContext.d.ts +40 -0
- package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +71 -3
- package/dist/hooks/track/analytics/useTrackExecutionProgressEvents.d.ts +48 -0
- package/dist/hooks/track/analytics/useWithdrawalAnalytics.d.ts +18 -0
- package/dist/hooks/useIsBlacklistedWithdrawalAddress.d.ts +4 -1
- package/dist/index.js +2245 -965
- package/dist/modals/CheckoutModal/ConfirmationStep/useCheckoutConfirmation.d.ts +2 -1
- package/dist/modals/CheckoutModal/ConfirmationStep/useQuoteRefresh.d.ts +5 -1
- package/dist/modals/CheckoutModal/ConfirmationStep/useTrackDepositQuoteEvents.d.ts +20 -0
- package/dist/modals/CheckoutModal/MeldQuotes/useMeldQuotes.d.ts +1 -1
- package/dist/modals/CheckoutModal/SourceChange/useTrackSourceChangeEvents.d.ts +10 -0
- package/dist/modals/CheckoutModal/TransferToken/useTrackDepositNotificationEvents.d.ts +6 -0
- package/dist/modals/CheckoutModal/TransferToken/useTransferTokenTracking.d.ts +9 -3
- package/dist/modals/PolymarketPerpsTransfer/recordPerpsTransfer.d.ts +40 -0
- package/dist/modals/PolymarketPerpsTransfer/useRecordPerpsTransfer.d.ts +24 -0
- package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +14 -92
- package/dist/modals/WithdrawalModal/WithdrawAmountInput.d.ts +3 -1
- package/dist/modals/WithdrawalModal/useTrackWithdrawalEvents.d.ts +1 -0
- package/dist/providers/FunkitCheckoutContext/index.d.ts +10 -2
- package/dist/providers/FunkitCheckoutContext/types.d.ts +17 -2
- package/dist/utils/customer.d.ts +24 -276
- package/dist/utils/lighter.d.ts +1 -83
- package/dist/utils/signature.d.ts +1 -2
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +47 -47
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +3 -4
- package/dist/clients/chunk-6QCAWEAT.js +0 -53
- package/dist/clients/{chunk-XJTRLB7W.js → chunk-L2XMI4EX.js} +8 -8
- package/dist/wallets/walletConnectors/{chunk-RB3HR4R2.js → chunk-4NV5BYRP.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-YEZM4CK4.js → chunk-AVDUNQUW.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-MIQTHJ6X.js → chunk-GUQM4QSL.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-4T6ZSRJF.js → chunk-IULPZP2Q.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-HNRB7KJU.js → chunk-JPN6TWIT.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-ZNX4EMPB.js → chunk-KCRO2AGO.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-STVVP43G.js → chunk-KI5Y2BBF.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-X6CGV36L.js → chunk-NR2OGDHQ.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-UK7C2JXW.js → chunk-OEEGYENV.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-F5XEEVG6.js → chunk-OX37G4YT.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-RVOY537T.js → chunk-SWFF3TWJ.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-CPI4TD43.js → chunk-TKB2OY6G.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-2VP2F6EK.js → chunk-W2LCLDPX.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-6BW3HLBG.js → chunk-WAHGI5L7.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-HTHAK6XB.js → chunk-WKNQMP4A.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-VTM6EECM.js → chunk-XCNHV3HS.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-CCQV2ZET.js → chunk-YO2K4MBH.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-VAPGUPHO.js → chunk-YQFGVZGR.js} +3 -3
package/dist/utils/customer.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { DynamicTargetAssetCandidate } from '@funkit/connect-core';
|
|
1
|
+
import type { DynamicTargetAssetCandidate, LighterAccountLookup } from '@funkit/connect-core';
|
|
3
2
|
import type { Address } from 'viem';
|
|
4
|
-
export { LIGHTER_TRADING_MODE, getLighterAccountsByL1Address, useLighterAccountsQuery, } from '@funkit/connect-core';
|
|
5
|
-
export type { LighterAccountsByL1AddressResponse, LighterSubAccount, } from '@funkit/connect-core';
|
|
3
|
+
export { LIGHTER_TRADING_MODE, getLighterAccount, getLighterAccountsByL1Address, useInvalidateLighterAccount, useLighterAccountQuery, useLighterAccountsQuery, } from '@funkit/connect-core';
|
|
4
|
+
export type { LighterAccount, LighterAccountLookup, LighterAccountResponse, LighterAccountsByL1AddressResponse, LighterAsset, LighterPoolInfo, LighterShare, LighterSubAccount, } from '@funkit/connect-core';
|
|
6
5
|
/**
|
|
7
6
|
* Strips the ` (Perps)` variant suffix off a Lighter ticker (e.g.
|
|
8
7
|
* `USDC (Perps)` → `USDC`). Non-perps tickers pass through unchanged.
|
|
@@ -16,256 +15,11 @@ export declare function stripLighterPerpsSuffix(symbol: string | undefined): str
|
|
|
16
15
|
* routes (`LIGHTER_USDC_PERPS*`), only the presentation differs.
|
|
17
16
|
*/
|
|
18
17
|
export declare function adaptLighterTargetAssetsForUnifiedAccount(candidates: DynamicTargetAssetCandidate[]): DynamicTargetAssetCandidate[];
|
|
19
|
-
export type LighterAsset = {
|
|
20
|
-
symbol: string;
|
|
21
|
-
asset_id: number;
|
|
22
|
-
balance: string;
|
|
23
|
-
locked_balance: string;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* A user's stake in a Lighter public pool, identified by matching
|
|
27
|
-
* `public_pool_index` against the known pool index.
|
|
28
|
-
*
|
|
29
|
-
* Carries only *entry* state — there is no current-value field:
|
|
30
|
-
* - `principal_amount` — deposited at entry, in the pool's own asset (Lighter's
|
|
31
|
-
* UI shows this as "Your Deposits"). Never grows with accrued yield.
|
|
32
|
-
* - `shares_amount` — pool shares held. Current value ("Your Stake") is this
|
|
33
|
-
* times the pool's share price, so it needs the pool account too.
|
|
34
|
-
*/
|
|
35
|
-
export type LighterShare = {
|
|
36
|
-
public_pool_index: number;
|
|
37
|
-
shares_amount: number;
|
|
38
|
-
entry_usdc: string;
|
|
39
|
-
principal_amount: string;
|
|
40
|
-
entry_timestamp: number;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Public-pool accounting, present only on pool accounts (`account_type: 4`).
|
|
44
|
-
* Share price is `<pool asset balance> / total_shares`.
|
|
45
|
-
*/
|
|
46
|
-
export type LighterPoolInfo = {
|
|
47
|
-
total_shares: number;
|
|
48
|
-
operator_shares: number;
|
|
49
|
-
};
|
|
50
|
-
export type LighterAccount = {
|
|
51
|
-
code: number;
|
|
52
|
-
account_type: number;
|
|
53
|
-
index: number;
|
|
54
|
-
l1_address: Address;
|
|
55
|
-
cancel_all_time: number;
|
|
56
|
-
total_order_count: number;
|
|
57
|
-
total_isolated_order_count: number;
|
|
58
|
-
pending_order_count: number;
|
|
59
|
-
available_balance: string;
|
|
60
|
-
status: number;
|
|
61
|
-
collateral: string;
|
|
62
|
-
transaction_time: number;
|
|
63
|
-
account_trading_mode: number;
|
|
64
|
-
account_index: number;
|
|
65
|
-
name: string;
|
|
66
|
-
description: string;
|
|
67
|
-
can_invite: boolean;
|
|
68
|
-
referral_points_percentage: string;
|
|
69
|
-
can_rfq: boolean;
|
|
70
|
-
created_at: number;
|
|
71
|
-
positions: unknown[];
|
|
72
|
-
assets: LighterAsset[];
|
|
73
|
-
total_asset_value: string;
|
|
74
|
-
cross_asset_value: string;
|
|
75
|
-
shares: LighterShare[];
|
|
76
|
-
pending_unlocks: unknown[];
|
|
77
|
-
/** Pool accounts only — absent on user accounts. */
|
|
78
|
-
pool_info?: LighterPoolInfo;
|
|
79
|
-
};
|
|
80
|
-
export type LighterAccountResponse = {
|
|
81
|
-
code: number;
|
|
82
|
-
total: number;
|
|
83
|
-
accounts: LighterAccount[];
|
|
84
|
-
};
|
|
85
|
-
export type LighterAccountLookup = {
|
|
86
|
-
by: 'index';
|
|
87
|
-
value: LighterAccountIndex;
|
|
88
|
-
} | {
|
|
89
|
-
by: 'l1_address';
|
|
90
|
-
value: Address;
|
|
91
|
-
};
|
|
92
|
-
export declare function getLighterAccount(lookup: LighterAccountLookup, activeOnly?: boolean): Promise<LighterAccountResponse>;
|
|
93
18
|
export declare function useLighterAccount(lookup: LighterAccountLookup | null, options?: {
|
|
94
19
|
activeOnly?: boolean;
|
|
95
20
|
}): {
|
|
96
|
-
account: LighterAccount | undefined;
|
|
97
|
-
data: LighterAccountResponse;
|
|
98
|
-
error: Error;
|
|
99
|
-
isError: true;
|
|
100
|
-
isPending: false;
|
|
101
|
-
isLoading: false;
|
|
102
|
-
isLoadingError: false;
|
|
103
|
-
isRefetchError: true;
|
|
104
|
-
isSuccess: false;
|
|
105
|
-
isPlaceholderData: false;
|
|
106
|
-
status: "error";
|
|
107
|
-
dataUpdatedAt: number;
|
|
108
|
-
errorUpdatedAt: number;
|
|
109
|
-
failureCount: number;
|
|
110
|
-
failureReason: Error | null;
|
|
111
|
-
errorUpdateCount: number;
|
|
112
|
-
isFetched: boolean;
|
|
113
|
-
isFetchedAfterMount: boolean;
|
|
114
|
-
isFetching: boolean;
|
|
115
|
-
isInitialLoading: boolean;
|
|
116
|
-
isPaused: boolean;
|
|
117
|
-
isRefetching: boolean;
|
|
118
|
-
isStale: boolean;
|
|
119
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
|
|
120
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
121
|
-
promise: Promise<LighterAccountResponse>;
|
|
122
|
-
} | {
|
|
123
|
-
account: LighterAccount | undefined;
|
|
124
|
-
data: LighterAccountResponse;
|
|
125
|
-
error: null;
|
|
126
|
-
isError: false;
|
|
127
|
-
isPending: false;
|
|
128
|
-
isLoading: false;
|
|
129
|
-
isLoadingError: false;
|
|
130
|
-
isRefetchError: false;
|
|
131
|
-
isSuccess: true;
|
|
132
|
-
isPlaceholderData: false;
|
|
133
|
-
status: "success";
|
|
134
|
-
dataUpdatedAt: number;
|
|
135
|
-
errorUpdatedAt: number;
|
|
136
|
-
failureCount: number;
|
|
137
|
-
failureReason: Error | null;
|
|
138
|
-
errorUpdateCount: number;
|
|
139
|
-
isFetched: boolean;
|
|
140
|
-
isFetchedAfterMount: boolean;
|
|
141
|
-
isFetching: boolean;
|
|
142
|
-
isInitialLoading: boolean;
|
|
143
|
-
isPaused: boolean;
|
|
144
|
-
isRefetching: boolean;
|
|
145
|
-
isStale: boolean;
|
|
146
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
|
|
147
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
148
|
-
promise: Promise<LighterAccountResponse>;
|
|
149
|
-
} | {
|
|
150
|
-
account: LighterAccount | undefined;
|
|
151
|
-
data: undefined;
|
|
152
|
-
error: Error;
|
|
153
|
-
isError: true;
|
|
154
|
-
isPending: false;
|
|
155
|
-
isLoading: false;
|
|
156
|
-
isLoadingError: true;
|
|
157
|
-
isRefetchError: false;
|
|
158
|
-
isSuccess: false;
|
|
159
|
-
isPlaceholderData: false;
|
|
160
|
-
status: "error";
|
|
161
|
-
dataUpdatedAt: number;
|
|
162
|
-
errorUpdatedAt: number;
|
|
163
|
-
failureCount: number;
|
|
164
|
-
failureReason: Error | null;
|
|
165
|
-
errorUpdateCount: number;
|
|
166
|
-
isFetched: boolean;
|
|
167
|
-
isFetchedAfterMount: boolean;
|
|
168
|
-
isFetching: boolean;
|
|
169
|
-
isInitialLoading: boolean;
|
|
170
|
-
isPaused: boolean;
|
|
171
|
-
isRefetching: boolean;
|
|
172
|
-
isStale: boolean;
|
|
173
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
|
|
174
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
175
|
-
promise: Promise<LighterAccountResponse>;
|
|
176
|
-
} | {
|
|
177
|
-
account: LighterAccount | undefined;
|
|
178
|
-
data: undefined;
|
|
179
|
-
error: null;
|
|
180
|
-
isError: false;
|
|
181
|
-
isPending: true;
|
|
182
|
-
isLoading: true;
|
|
183
|
-
isLoadingError: false;
|
|
184
|
-
isRefetchError: false;
|
|
185
|
-
isSuccess: false;
|
|
186
|
-
isPlaceholderData: false;
|
|
187
|
-
status: "pending";
|
|
188
|
-
dataUpdatedAt: number;
|
|
189
|
-
errorUpdatedAt: number;
|
|
190
|
-
failureCount: number;
|
|
191
|
-
failureReason: Error | null;
|
|
192
|
-
errorUpdateCount: number;
|
|
193
|
-
isFetched: boolean;
|
|
194
|
-
isFetchedAfterMount: boolean;
|
|
195
|
-
isFetching: boolean;
|
|
196
|
-
isInitialLoading: boolean;
|
|
197
|
-
isPaused: boolean;
|
|
198
|
-
isRefetching: boolean;
|
|
199
|
-
isStale: boolean;
|
|
200
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
|
|
201
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
202
|
-
promise: Promise<LighterAccountResponse>;
|
|
203
|
-
} | {
|
|
204
|
-
account: LighterAccount | undefined;
|
|
205
|
-
data: undefined;
|
|
206
|
-
error: null;
|
|
207
|
-
isError: false;
|
|
208
|
-
isPending: true;
|
|
209
|
-
isLoadingError: false;
|
|
210
|
-
isRefetchError: false;
|
|
211
|
-
isSuccess: false;
|
|
212
|
-
isPlaceholderData: false;
|
|
213
|
-
status: "pending";
|
|
214
|
-
dataUpdatedAt: number;
|
|
215
|
-
errorUpdatedAt: number;
|
|
216
|
-
failureCount: number;
|
|
217
|
-
failureReason: Error | null;
|
|
218
|
-
errorUpdateCount: number;
|
|
219
|
-
isFetched: boolean;
|
|
220
|
-
isFetchedAfterMount: boolean;
|
|
221
|
-
isFetching: boolean;
|
|
222
|
-
isLoading: boolean;
|
|
223
|
-
isInitialLoading: boolean;
|
|
224
|
-
isPaused: boolean;
|
|
225
|
-
isRefetching: boolean;
|
|
226
|
-
isStale: boolean;
|
|
227
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
|
|
228
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
229
|
-
promise: Promise<LighterAccountResponse>;
|
|
230
|
-
} | {
|
|
231
|
-
account: LighterAccount | undefined;
|
|
232
|
-
data: LighterAccountResponse;
|
|
233
|
-
isError: false;
|
|
234
|
-
error: null;
|
|
235
|
-
isPending: false;
|
|
236
|
-
isLoading: false;
|
|
237
|
-
isLoadingError: false;
|
|
238
|
-
isRefetchError: false;
|
|
239
|
-
isSuccess: true;
|
|
240
|
-
isPlaceholderData: true;
|
|
241
|
-
status: "success";
|
|
242
|
-
dataUpdatedAt: number;
|
|
243
|
-
errorUpdatedAt: number;
|
|
244
|
-
failureCount: number;
|
|
245
|
-
failureReason: Error | null;
|
|
246
|
-
errorUpdateCount: number;
|
|
247
|
-
isFetched: boolean;
|
|
248
|
-
isFetchedAfterMount: boolean;
|
|
249
|
-
isFetching: boolean;
|
|
250
|
-
isInitialLoading: boolean;
|
|
251
|
-
isPaused: boolean;
|
|
252
|
-
isRefetching: boolean;
|
|
253
|
-
isStale: boolean;
|
|
254
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
|
|
255
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
256
|
-
promise: Promise<LighterAccountResponse>;
|
|
257
|
-
};
|
|
258
|
-
/**
|
|
259
|
-
* Ungated {@link useLighterAccount}. For callers whose module is Lighter-specific
|
|
260
|
-
* by construction — `clients/lighter` is a separate bundle entry with its own copy
|
|
261
|
-
* of the config context, so `useFunkitConfig()` there yields no api key and a
|
|
262
|
-
* customer check would disable the query forever.
|
|
263
|
-
*/
|
|
264
|
-
export declare function useLighterAccountQuery(lookup: LighterAccountLookup | null, options?: {
|
|
265
|
-
activeOnly?: boolean;
|
|
266
|
-
}): {
|
|
267
|
-
account: LighterAccount | undefined;
|
|
268
|
-
data: LighterAccountResponse;
|
|
21
|
+
account: import("@funkit/connect-core").LighterAccount | undefined;
|
|
22
|
+
data: import("@funkit/connect-core").LighterAccountResponse;
|
|
269
23
|
error: Error;
|
|
270
24
|
isError: true;
|
|
271
25
|
isPending: false;
|
|
@@ -287,12 +41,12 @@ export declare function useLighterAccountQuery(lookup: LighterAccountLookup | nu
|
|
|
287
41
|
isPaused: boolean;
|
|
288
42
|
isRefetching: boolean;
|
|
289
43
|
isStale: boolean;
|
|
290
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
|
|
44
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@funkit/connect-core").LighterAccountResponse, Error>>;
|
|
291
45
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
292
|
-
promise: Promise<LighterAccountResponse>;
|
|
46
|
+
promise: Promise<import("@funkit/connect-core").LighterAccountResponse>;
|
|
293
47
|
} | {
|
|
294
|
-
account: LighterAccount | undefined;
|
|
295
|
-
data: LighterAccountResponse;
|
|
48
|
+
account: import("@funkit/connect-core").LighterAccount | undefined;
|
|
49
|
+
data: import("@funkit/connect-core").LighterAccountResponse;
|
|
296
50
|
error: null;
|
|
297
51
|
isError: false;
|
|
298
52
|
isPending: false;
|
|
@@ -314,11 +68,11 @@ export declare function useLighterAccountQuery(lookup: LighterAccountLookup | nu
|
|
|
314
68
|
isPaused: boolean;
|
|
315
69
|
isRefetching: boolean;
|
|
316
70
|
isStale: boolean;
|
|
317
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
|
|
71
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@funkit/connect-core").LighterAccountResponse, Error>>;
|
|
318
72
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
319
|
-
promise: Promise<LighterAccountResponse>;
|
|
73
|
+
promise: Promise<import("@funkit/connect-core").LighterAccountResponse>;
|
|
320
74
|
} | {
|
|
321
|
-
account: LighterAccount | undefined;
|
|
75
|
+
account: import("@funkit/connect-core").LighterAccount | undefined;
|
|
322
76
|
data: undefined;
|
|
323
77
|
error: Error;
|
|
324
78
|
isError: true;
|
|
@@ -341,11 +95,11 @@ export declare function useLighterAccountQuery(lookup: LighterAccountLookup | nu
|
|
|
341
95
|
isPaused: boolean;
|
|
342
96
|
isRefetching: boolean;
|
|
343
97
|
isStale: boolean;
|
|
344
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
|
|
98
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@funkit/connect-core").LighterAccountResponse, Error>>;
|
|
345
99
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
346
|
-
promise: Promise<LighterAccountResponse>;
|
|
100
|
+
promise: Promise<import("@funkit/connect-core").LighterAccountResponse>;
|
|
347
101
|
} | {
|
|
348
|
-
account: LighterAccount | undefined;
|
|
102
|
+
account: import("@funkit/connect-core").LighterAccount | undefined;
|
|
349
103
|
data: undefined;
|
|
350
104
|
error: null;
|
|
351
105
|
isError: false;
|
|
@@ -368,11 +122,11 @@ export declare function useLighterAccountQuery(lookup: LighterAccountLookup | nu
|
|
|
368
122
|
isPaused: boolean;
|
|
369
123
|
isRefetching: boolean;
|
|
370
124
|
isStale: boolean;
|
|
371
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
|
|
125
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@funkit/connect-core").LighterAccountResponse, Error>>;
|
|
372
126
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
373
|
-
promise: Promise<LighterAccountResponse>;
|
|
127
|
+
promise: Promise<import("@funkit/connect-core").LighterAccountResponse>;
|
|
374
128
|
} | {
|
|
375
|
-
account: LighterAccount | undefined;
|
|
129
|
+
account: import("@funkit/connect-core").LighterAccount | undefined;
|
|
376
130
|
data: undefined;
|
|
377
131
|
error: null;
|
|
378
132
|
isError: false;
|
|
@@ -395,12 +149,12 @@ export declare function useLighterAccountQuery(lookup: LighterAccountLookup | nu
|
|
|
395
149
|
isPaused: boolean;
|
|
396
150
|
isRefetching: boolean;
|
|
397
151
|
isStale: boolean;
|
|
398
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
|
|
152
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@funkit/connect-core").LighterAccountResponse, Error>>;
|
|
399
153
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
400
|
-
promise: Promise<LighterAccountResponse>;
|
|
154
|
+
promise: Promise<import("@funkit/connect-core").LighterAccountResponse>;
|
|
401
155
|
} | {
|
|
402
|
-
account: LighterAccount | undefined;
|
|
403
|
-
data: LighterAccountResponse;
|
|
156
|
+
account: import("@funkit/connect-core").LighterAccount | undefined;
|
|
157
|
+
data: import("@funkit/connect-core").LighterAccountResponse;
|
|
404
158
|
isError: false;
|
|
405
159
|
error: null;
|
|
406
160
|
isPending: false;
|
|
@@ -422,9 +176,9 @@ export declare function useLighterAccountQuery(lookup: LighterAccountLookup | nu
|
|
|
422
176
|
isPaused: boolean;
|
|
423
177
|
isRefetching: boolean;
|
|
424
178
|
isStale: boolean;
|
|
425
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<LighterAccountResponse, Error>>;
|
|
179
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@funkit/connect-core").LighterAccountResponse, Error>>;
|
|
426
180
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
427
|
-
promise: Promise<LighterAccountResponse>;
|
|
181
|
+
promise: Promise<import("@funkit/connect-core").LighterAccountResponse>;
|
|
428
182
|
};
|
|
429
183
|
export declare function useLighterAccounts({ address, }: {
|
|
430
184
|
address: Address | '' | undefined;
|
|
@@ -603,9 +357,3 @@ export declare function useLighterAccounts({ address, }: {
|
|
|
603
357
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
604
358
|
promise: Promise<import("@funkit/connect-core").LighterAccountsByL1AddressResponse>;
|
|
605
359
|
};
|
|
606
|
-
/**
|
|
607
|
-
* Returns a callback that invalidates the cached Lighter account queries so the
|
|
608
|
-
* balance refetches eagerly (e.g. right after a withdrawal). No-op for
|
|
609
|
-
* non-Lighter customers.
|
|
610
|
-
*/
|
|
611
|
-
export declare function useInvalidateLighterAccount(): () => void;
|
package/dist/utils/lighter.d.ts
CHANGED
|
@@ -1,83 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const LIGHTER_DEPOSIT_ADDRESS: Address;
|
|
3
|
-
export declare const LIGHTER_SLOW_DEPOSIT_TIME_ESTIMATE_SECONDS: number;
|
|
4
|
-
export declare const LIGHTER_DELAYED_AUTO_TRIGGER_CUTOFF: number;
|
|
5
|
-
/**
|
|
6
|
-
* zkLighter L1 `withdraw` ABI — selector `0xd20191bd`, non-payable, on the same
|
|
7
|
-
* contract as deposits. `amount` is in Lighter base units (see
|
|
8
|
-
* {@link lighterWithdrawBaseUnits}).
|
|
9
|
-
*/
|
|
10
|
-
export declare const LIGHTER_WITHDRAW_ABI: readonly [{
|
|
11
|
-
readonly type: "function";
|
|
12
|
-
readonly name: "withdraw";
|
|
13
|
-
readonly stateMutability: "nonpayable";
|
|
14
|
-
readonly inputs: readonly [{
|
|
15
|
-
readonly name: "accountIndex";
|
|
16
|
-
readonly type: "uint48";
|
|
17
|
-
}, {
|
|
18
|
-
readonly name: "assetIndex";
|
|
19
|
-
readonly type: "uint16";
|
|
20
|
-
}, {
|
|
21
|
-
readonly name: "routeType";
|
|
22
|
-
readonly type: "uint8";
|
|
23
|
-
}, {
|
|
24
|
-
readonly name: "amount";
|
|
25
|
-
readonly type: "uint64";
|
|
26
|
-
}];
|
|
27
|
-
readonly outputs: readonly [];
|
|
28
|
-
}];
|
|
29
|
-
/** Strips fractional digits beyond `decimals` (string-based, no float math). */
|
|
30
|
-
export declare function truncateToDecimals(amount: string, decimals: number): string;
|
|
31
|
-
/**
|
|
32
|
-
* Converts a token-unit amount to Lighter L1 `withdraw` base units.
|
|
33
|
-
*
|
|
34
|
-
* Uses the L2 convention — USDC (asset index 3) = 6 decimals, all other assets
|
|
35
|
-
* = 8 — NOT the mainnet ERC-20 decimals (LIT/ETH would be 18). Confirmed on
|
|
36
|
-
* chain: 1 USDC → `1_000_000`, 1 LIT → `100_000_000`.
|
|
37
|
-
*/
|
|
38
|
-
export declare function lighterWithdrawBaseUnits(assetIndex: number, amountTokenUnits: string): bigint;
|
|
39
|
-
/**
|
|
40
|
-
* Builds the on-chain `withdraw` transaction for the L1 fallback. `value` is 0
|
|
41
|
-
* (no protocol fee — the user pays gas only).
|
|
42
|
-
*/
|
|
43
|
-
export declare function buildLighterL1WithdrawTransaction(params: {
|
|
44
|
-
accountIndex: number;
|
|
45
|
-
assetIndex: number;
|
|
46
|
-
routeType: number;
|
|
47
|
-
amountBaseUnit: bigint;
|
|
48
|
-
}): {
|
|
49
|
-
to: Address;
|
|
50
|
-
data: Hex;
|
|
51
|
-
value: bigint;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Explorer link for a Lighter Secure withdrawal tx. The L1 on-chain fallback
|
|
55
|
-
* produces a canonical 32-byte mainnet tx hash → Etherscan; L2 Secure hashes
|
|
56
|
-
* are Lighter's own (non-EVM) format → Lighter explorer. Detecting the EVM hash
|
|
57
|
-
* keeps L1-vs-L2 routing self-contained (no extra state threaded through the
|
|
58
|
-
* modal step machine).
|
|
59
|
-
*/
|
|
60
|
-
export declare function resolveLighterWithdrawalExplorerUrl(txHash: string): string;
|
|
61
|
-
/**
|
|
62
|
-
* True when an error is Lighter's **L2 (Secure) withdrawal** rate limit —
|
|
63
|
-
* codes 23004 / 23005, e.g. "Too Many L2 Withdrawal Requests!: L2 withdrawal
|
|
64
|
-
* rate limit exceeded. Only 3 withdrawals allowed per 2 hours". Used to offer
|
|
65
|
-
* the on-chain L1 fallback (Secure withdrawals only).
|
|
66
|
-
*
|
|
67
|
-
* The L2 SDK usually surfaces this as a plain string (the numeric code isn't
|
|
68
|
-
* always preserved), so we match message content — plus the structured `code`
|
|
69
|
-
* field when the error carries one.
|
|
70
|
-
*/
|
|
71
|
-
export declare function isLighterWithdrawalRateLimitError(error: unknown): boolean;
|
|
72
|
-
export declare const LIGHTER_DYNAMIC_ROUTING_ID: {
|
|
73
|
-
ETH_SPOT: string;
|
|
74
|
-
USDC_PERPS: string;
|
|
75
|
-
ETH_SPOT_NEW_USER: string;
|
|
76
|
-
USDC_PERPS_NEW_USER: string;
|
|
77
|
-
LINK_SPOT_NEW_USER: string;
|
|
78
|
-
UNI_SPOT_NEW_USER: string;
|
|
79
|
-
AAVE_SPOT_NEW_USER: string;
|
|
80
|
-
SKY_SPOT_NEW_USER: string;
|
|
81
|
-
LDO_SPOT_NEW_USER: string;
|
|
82
|
-
LIT_SPOT_NEW_USER: string;
|
|
83
|
-
};
|
|
1
|
+
export { LIGHTER_DELAYED_AUTO_TRIGGER_CUTOFF, LIGHTER_DEPOSIT_ADDRESS, LIGHTER_DYNAMIC_ROUTING_ID, LIGHTER_SLOW_DEPOSIT_TIME_ESTIMATE_SECONDS, LIGHTER_WITHDRAW_ABI, buildLighterL1WithdrawTransaction, isLighterWithdrawalRateLimitError, lighterWithdrawBaseUnits, resolveLighterWithdrawalExplorerUrl, truncateToDecimals, } from '@funkit/connect-core/clients/lighter';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare function isSwitchChainError(error: unknown): boolean;
|
|
1
|
+
export { isSwitchChainError, isUserRejectedError } from '@funkit/connect-core';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bifrostWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-OLZ7626J.js";
|
|
4
|
+
} from "../chunk-IULPZP2Q.js";
|
|
6
5
|
import "../chunk-N4IJLYFY.js";
|
|
6
|
+
import "../chunk-OLZ7626J.js";
|
|
7
7
|
import "../chunk-IGKXZBTA.js";
|
|
8
8
|
export {
|
|
9
9
|
bifrostWallet
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bitgetWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-OLZ7626J.js";
|
|
4
|
+
} from "../chunk-TKB2OY6G.js";
|
|
6
5
|
import "../chunk-N4IJLYFY.js";
|
|
6
|
+
import "../chunk-OLZ7626J.js";
|
|
7
7
|
import "../chunk-IGKXZBTA.js";
|
|
8
8
|
export {
|
|
9
9
|
bitgetWallet
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
bybitWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-OLZ7626J.js";
|
|
4
|
+
} from "../chunk-OX37G4YT.js";
|
|
6
5
|
import "../chunk-N4IJLYFY.js";
|
|
6
|
+
import "../chunk-OLZ7626J.js";
|
|
7
7
|
import "../chunk-IGKXZBTA.js";
|
|
8
8
|
export {
|
|
9
9
|
bybitWallet
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
coin98Wallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-OLZ7626J.js";
|
|
4
|
+
} from "../chunk-WAHGI5L7.js";
|
|
6
5
|
import "../chunk-N4IJLYFY.js";
|
|
6
|
+
import "../chunk-OLZ7626J.js";
|
|
7
7
|
import "../chunk-IGKXZBTA.js";
|
|
8
8
|
export {
|
|
9
9
|
coin98Wallet
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
frontierWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-OLZ7626J.js";
|
|
4
|
+
} from "../chunk-AVDUNQUW.js";
|
|
6
5
|
import "../chunk-N4IJLYFY.js";
|
|
6
|
+
import "../chunk-OLZ7626J.js";
|
|
7
7
|
import "../chunk-IGKXZBTA.js";
|
|
8
8
|
export {
|
|
9
9
|
frontierWallet
|