@funkit/connect 11.7.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.
- package/CHANGELOG.md +40 -0
- package/dist/{chunk-67BKQQNG.js → chunk-2RND3WWH.js} +1 -1
- package/dist/{chunk-L67HP4HQ.js → chunk-53FF4ZHH.js} +1 -1
- package/dist/{chunk-4YEAUICE.js → chunk-DH3DS4FX.js} +1 -0
- package/dist/clients/chunk-27VBRE7W.js +4907 -0
- package/dist/clients/{chunk-44USAVWK.js → chunk-37Q6DUR7.js} +2 -2
- package/dist/clients/chunk-3DHSLLCU.js +331 -0
- package/dist/clients/{chunk-I4B5AKZC.js → chunk-3J2GOB5X.js} +1 -1
- package/dist/clients/{chunk-OASVWVSV.js → chunk-A5JW3UI6.js} +1 -1
- package/dist/clients/chunk-BCNE3ZKM.js +190 -0
- package/dist/clients/chunk-BWJC2WD7.js +4899 -0
- package/dist/clients/{chunk-FGUMPXTO.js → chunk-DYV3LRSE.js} +1 -1
- package/dist/clients/{chunk-Y7WLUPTX.js → chunk-EQA5U4V6.js} +8 -8
- package/dist/clients/chunk-EYMFEWQL.js +30 -0
- package/dist/clients/chunk-FPOGADLJ.js +4899 -0
- package/dist/clients/chunk-HB7S3NDI.js +15 -0
- package/dist/clients/chunk-HDFCM5UL.js +15 -0
- package/dist/clients/{chunk-IYCZWLAF.js → chunk-IAIRECDV.js} +8 -37
- package/dist/clients/chunk-JVR4CX6N.js +296 -0
- package/dist/clients/chunk-NEKHTWTT.js +331 -0
- package/dist/clients/chunk-PA7WW6VC.js +296 -0
- package/dist/clients/chunk-R6UAC2TB.js +190 -0
- package/dist/clients/chunk-RHOSJED2.js +335 -0
- package/dist/clients/chunk-SKDFSMAO.js +30 -0
- package/dist/clients/chunk-TI2NG2Z6.js +30 -0
- package/dist/clients/chunk-TZFXFVDW.js +296 -0
- package/dist/clients/chunk-VE6QD5IM.js +149 -0
- package/dist/clients/chunk-VXX2XK5J.js +190 -0
- package/dist/clients/{chunk-SG4ZS447.js → chunk-WXSFLUPZ.js} +63 -15
- package/dist/clients/chunk-XSRAZSYG.js +15 -0
- package/dist/clients/fanatics.css +4686 -4659
- package/dist/clients/fanatics.js +7 -9
- package/dist/clients/internal/nado/withdrawalCallback.js +3 -3
- package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
- package/dist/clients/internal/nado/withdrawalForm.css +4712 -4682
- package/dist/clients/internal/nado/withdrawalForm.js +37 -13
- package/dist/clients/internal/nado/withdrawalStatus.js +3 -3
- package/dist/clients/lighter.css +4712 -4682
- package/dist/clients/lighter.js +50 -30
- package/dist/clients/mallard.js +4 -4
- package/dist/clients/nado.js +3 -3
- package/dist/clients/polymarket/createPolymarketDepositConfig.d.ts +28 -19
- package/dist/clients/polymarket/createPolymarketDepositConfig.js +5 -4
- package/dist/clients/polymarket/index.d.ts +0 -1
- package/dist/clients/polymarket/index.js +4 -17
- package/dist/clients/polymarket/polymarket.d.ts +12 -27
- package/dist/clients/polymarket/polymarket.js +1 -1
- package/dist/components/AsyncImage/useAsyncImage.d.ts +2 -0
- package/dist/components/Box/Box.d.ts +15 -15
- package/dist/components/Dialog/Dialog.d.ts +8 -1
- package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +3 -1
- package/dist/components/FunTransactionSummary/PaymentFeesSummary.track.d.ts +10 -0
- package/dist/components/ModalHeaderTabs/ModalHeaderTabs.d.ts +23 -0
- package/dist/consts/polymarket.d.ts +14 -0
- package/dist/css/sprinkles.css.d.ts +17 -15
- package/dist/domains/polymarketPerps.d.ts +14 -0
- package/dist/hooks/queries/useFops.d.ts +3 -1
- package/dist/hooks/track/CheckoutModalEvent.d.ts +1 -0
- package/dist/hooks/track/analytics/events.d.ts +18 -0
- package/dist/hooks/track/analytics/quote.d.ts +3 -1
- package/dist/hooks/track/analytics/useWithdrawalAnalytics.d.ts +12 -1
- package/dist/hooks/useCheckoutTransferInit.d.ts +3 -1
- package/dist/hooks/useFittedText.d.ts +19 -0
- package/dist/hooks/usePolymarketAccountBalances.d.ts +13 -25
- package/dist/hooks/useUpdateActiveFunkitCheckout.d.ts +10 -0
- package/dist/index.css +4712 -4682
- package/dist/index.js +3271 -2247
- package/dist/modals/CheckoutModal/CheckoutModalPrefetchedHooks.d.ts +2 -1
- package/dist/modals/CheckoutModal/InputAmount/useAmountInput.d.ts +1 -0
- package/dist/modals/CheckoutModal/SourceChange/CryptoCashToggle.d.ts +6 -1
- package/dist/modals/PolymarketPerpsTransfer/DirectionSwapButton.d.ts +1 -11
- package/dist/modals/PolymarketPerpsTransfer/PerpsHeaderTabs.d.ts +29 -0
- package/dist/modals/PolymarketPerpsTransfer/PerpsTransferAmountInput.css.d.ts +9 -0
- package/dist/modals/PolymarketPerpsTransfer/PerpsTransferAmountInput.d.ts +15 -0
- package/dist/modals/PolymarketPerpsTransfer/PerpsTransferBody.d.ts +12 -0
- package/dist/modals/PolymarketPerpsTransfer/PolymarketPerpsPrefetch.d.ts +7 -0
- package/dist/modals/PolymarketPerpsTransfer/PolymarketPerpsTransferScreen.d.ts +16 -2
- package/dist/modals/PolymarketPerpsTransfer/TransferAccountsCard.d.ts +12 -0
- package/dist/modals/PolymarketPerpsTransfer/TransferActionButton.d.ts +8 -1
- package/dist/modals/PolymarketPerpsTransfer/TransferPercentOptions.d.ts +13 -0
- package/dist/modals/PolymarketPerpsTransfer/usePerpsHeaderTabsState.d.ts +28 -0
- package/dist/modals/PolymarketPerpsTransfer/usePerpsTransferForm.d.ts +31 -5
- package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +6 -0
- package/dist/modals/WithdrawalModal/RecipientAddress.d.ts +0 -5
- package/dist/modals/WithdrawalModal/useWithdrawalChainPreference.d.ts +17 -0
- package/dist/modals/WithdrawalModal/withdrawalHooks.d.ts +2 -1
- package/dist/providers/FunkitCheckoutContext/index.d.ts +13 -1
- package/dist/providers/FunkitCheckoutContext/types.d.ts +30 -3
- package/dist/providers/FunkitThemeProvider.d.ts +3 -0
- package/dist/shadow-css.js +1 -1
- package/dist/themes/baseTheme.js +1 -1
- package/dist/themes/darkTheme.js +2 -2
- package/dist/themes/lightTheme.js +2 -2
- package/dist/wallets/walletConnectors/chunk-2VP2F6EK.js +70 -0
- package/dist/wallets/walletConnectors/chunk-4T6ZSRJF.js +69 -0
- package/dist/wallets/walletConnectors/chunk-6BW3HLBG.js +96 -0
- package/dist/wallets/walletConnectors/chunk-CCQV2ZET.js +218 -0
- package/dist/wallets/walletConnectors/chunk-CPI4TD43.js +99 -0
- package/dist/wallets/walletConnectors/chunk-F5XEEVG6.js +98 -0
- package/dist/wallets/walletConnectors/chunk-HNRB7KJU.js +92 -0
- package/dist/wallets/walletConnectors/chunk-HTHAK6XB.js +93 -0
- package/dist/wallets/walletConnectors/chunk-MIQTHJ6X.js +66 -0
- package/dist/wallets/walletConnectors/chunk-RB3HR4R2.js +95 -0
- package/dist/wallets/walletConnectors/chunk-RVOY537T.js +100 -0
- package/dist/wallets/walletConnectors/chunk-STVVP43G.js +94 -0
- package/dist/wallets/walletConnectors/chunk-UK7C2JXW.js +87 -0
- package/dist/wallets/walletConnectors/chunk-VAPGUPHO.js +92 -0
- package/dist/wallets/walletConnectors/chunk-VTM6EECM.js +110 -0
- package/dist/wallets/walletConnectors/chunk-X6CGV36L.js +103 -0
- package/dist/wallets/walletConnectors/chunk-YEZM4CK4.js +96 -0
- package/dist/wallets/walletConnectors/chunk-ZNX4EMPB.js +106 -0
- package/dist/wallets/walletConnectors/index.js +37 -37
- package/package.json +5 -5
- package/dist/clients/chunk-AXLGZ5XX.js +0 -1325
- package/dist/clients/chunk-DSZHYQPX.js +0 -31
- package/dist/clients/chunk-HZP4DXIZ.js +0 -231
- package/dist/clients/chunk-LUHEVXPD.js +0 -109
- package/dist/clients/chunk-NM2NAKI3.js +0 -1195
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +0 -17545
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.d.ts +0 -30
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +0 -20
- package/dist/clients/polymarket/index.css +0 -17545
- package/dist/modals/PolymarketPerpsTransfer/PerpsTransferRows.d.ts +0 -10
- package/dist/modals/PolymarketPerpsTransfer/TransferAmountRow.css.d.ts +0 -13
- 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",
|
|
@@ -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
|
}
|
|
@@ -142,6 +147,11 @@ export type VisibleQuoteFeeProperties = {
|
|
|
142
147
|
swap_impact_pct: number | null;
|
|
143
148
|
wallet_gas_cost_usd: number | null;
|
|
144
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
|
+
};
|
|
145
155
|
/** Route fields shared by quote-bearing and later lifecycle events. */
|
|
146
156
|
export type DepositRouteContextProperties = DepositAssetContextProperties & {
|
|
147
157
|
destination_address: string | null;
|
|
@@ -240,6 +250,11 @@ export type DepositTransferInteractedProperties = {
|
|
|
240
250
|
target_asset_ticker: string | null;
|
|
241
251
|
target_chain: string;
|
|
242
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
|
+
};
|
|
243
258
|
export type WithdrawalTransferInteractionAction = 'address_autofilled' | 'address_changed' | 'amount_changed' | 'chain_changed' | 'max_button_clicked' | 'token_changed';
|
|
244
259
|
/** Payload specific to {@link AnalyticsEvent.WITHDRAWAL_TRANSFER_INTERACTED}. */
|
|
245
260
|
export type WithdrawalTransferInteractedProperties = PaymentMethodProperties & {
|
|
@@ -273,12 +288,15 @@ export type AnalyticsEventProperties = {
|
|
|
273
288
|
[AnalyticsEvent.DEPOSIT_QUOTE_CONFIRMED]: DepositQuoteConfirmedProperties;
|
|
274
289
|
[AnalyticsEvent.DEPOSIT_SUCCEEDED]: ExecutionSucceededProperties;
|
|
275
290
|
[AnalyticsEvent.DEPOSIT_TRANSFER_INTERACTED]: DepositTransferInteractedProperties;
|
|
291
|
+
[AnalyticsEvent.DEPOSIT_TRANSACTION_BREAKDOWN_CLICKED]: TransactionBreakdownClickedProperties;
|
|
276
292
|
[AnalyticsEvent.DEPOSIT_TRANSACTION_SUBMITTED]: TransactionSubmittedProperties;
|
|
277
293
|
[AnalyticsEvent.MODAL_OPENED]: ModalOpenedProperties;
|
|
278
294
|
[AnalyticsEvent.TAB_SWITCHED]: TabSwitchedProperties;
|
|
279
295
|
[AnalyticsEvent.WITHDRAWAL_AMOUNT_CONFIRMED]: WithdrawalAmountConfirmedProperties;
|
|
280
296
|
[AnalyticsEvent.WITHDRAWAL_FAILED]: ExecutionFailedProperties;
|
|
297
|
+
[AnalyticsEvent.WITHDRAWAL_METHOD_SELECTED]: WithdrawalMethodSelectedProperties;
|
|
281
298
|
[AnalyticsEvent.WITHDRAWAL_SUCCEEDED]: ExecutionSucceededProperties;
|
|
299
|
+
[AnalyticsEvent.WITHDRAWAL_TRANSACTION_BREAKDOWN_CLICKED]: TransactionBreakdownClickedProperties;
|
|
282
300
|
[AnalyticsEvent.WITHDRAWAL_TRANSFER_INTERACTED]: WithdrawalTransferInteractedProperties;
|
|
283
301
|
[AnalyticsEvent.WITHDRAWAL_TRANSACTION_SUBMITTED]: TransactionSubmittedProperties;
|
|
284
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
|
|
12
|
+
export declare function resolveVisibleQuoteFeeProperties(latestQuote: ApiFunkitCheckoutQuoteResult | FunkitCheckoutQuoteResult | null, { extraSourceChainGasUsd }?: {
|
|
13
|
+
extraSourceChainGasUsd?: number;
|
|
14
|
+
}): VisibleQuoteFeeProperties;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
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
|
|
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
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* never
|
|
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
|
|
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}.
|
|
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.
|
|
56
|
-
*
|
|
57
|
-
*
|
|
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;
|
|
@@ -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
|
};
|