@funkit/connect 9.23.2-next.0 → 9.24.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 +30 -1
- package/dist/clients/aave.d.ts +10 -1
- package/dist/clients/aave.js +4 -1
- package/dist/clients/{chunk-4HCOSF4M.js → chunk-7G3QEQFB.js} +2 -2
- package/dist/clients/{chunk-7FIVHWNC.js → chunk-7UIDHSYG.js} +47 -0
- package/dist/clients/{chunk-UUHGOBKZ.js → chunk-AHYOV7AV.js} +2 -1
- package/dist/clients/chunk-JN6WUYT2.js +1110 -0
- package/dist/clients/{chunk-S7FRYR55.js → chunk-ME4OAQIY.js} +1 -1
- package/dist/clients/{chunk-VVTNR7YH.js → chunk-MXPZTW2H.js} +212 -1126
- package/dist/clients/{chunk-KWIR3HO4.js → chunk-VJZW3MA3.js} +1 -1
- package/dist/clients/{chunk-MRBN4XCA.js → chunk-ZEXZQOAO.js} +1 -1
- package/dist/clients/fanatics.css +1 -1
- package/dist/clients/fanatics.js +4 -6
- package/dist/clients/lighter.css +2821 -1
- package/dist/clients/lighter.d.ts +19 -1
- package/dist/clients/lighter.js +51 -30
- package/dist/clients/mallard.d.ts +1 -1
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +217 -217
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.d.ts +1 -1
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +7 -8
- package/dist/clients/polymarket/createPolymarketDepositConfig.d.ts +1 -1
- package/dist/clients/polymarket/createPolymarketDepositConfig.js +3 -3
- package/dist/clients/polymarket/index.css +217 -217
- package/dist/clients/polymarket/index.js +7 -8
- package/dist/clients/polymarket/polymarket.d.ts +2 -2
- package/dist/clients/polymarket/polymarket.js +2 -2
- package/dist/clients/polymarket/usePolymarketAccountBalances.js +2 -2
- package/dist/clients/rolly.d.ts +1 -1
- package/dist/clients/rolly.js +1 -1
- package/dist/components/ApprovalMethodToggle/ApprovalMethodToggle.d.ts +1 -1
- package/dist/components/Dropdown/ChainDropdown.d.ts +1 -1
- package/dist/components/Dropdown/TokenAndChainDropdown.d.ts +1 -1
- package/dist/components/Dropdown/TokenDropdown.d.ts +1 -1
- package/dist/components/FunAsset/FunAssetItem.d.ts +1 -1
- package/dist/components/FunCheckoutHistory/AddTokenToWalletButton.d.ts +1 -1
- package/dist/components/FunCheckoutHistory/FunDirectExecutionHistoryBottomBar.d.ts +1 -1
- package/dist/components/FunCheckoutHistory/FunDirectExecutionHistoryDetail.d.ts +1 -1
- package/dist/components/FunCheckoutHistory/PendingSuccessScreen.d.ts +2 -2
- package/dist/components/FunCheckoutHistory/YouSendItem.d.ts +1 -1
- package/dist/components/FunNotificationBanner/FunNotificationBannerIcon.d.ts +1 -1
- package/dist/components/FunPayments/FunPaymentMethods.d.ts +1 -1
- package/dist/components/FunSelectBrokerage/FunSelectBrokerage.d.ts +1 -1
- package/dist/components/FunTooltip/FunTooltip.d.ts +10 -5
- package/dist/components/FunTransactionSummary/DestinationHealthFactorRow.d.ts +15 -0
- package/dist/components/FunTransactionSummary/DestinationYieldRows.d.ts +2 -1
- package/dist/components/FunTransactionSummary/PaymentAmountSummary.d.ts +3 -3
- package/dist/components/FunTransactionSummary/PaymentFeesSummary.d.ts +2 -2
- package/dist/components/FunTransactionSummary/PaymentFeesSummary.track.d.ts +2 -2
- package/dist/components/FunTransactionSummary/PaymentMethodSummary.d.ts +10 -3
- package/dist/components/FunTransactionSummary/PaymentRouteSummary.d.ts +1 -1
- package/dist/components/ModalHeightAnimationLayer/FunCheckoutModalHeightAnimationWrapper.d.ts +2 -2
- package/dist/components/NewTokenDepositAlert/NewTokenDepositAlert.d.ts +1 -1
- package/dist/components/ReceiveAmount/ReceiveAmount.d.ts +2 -2
- package/dist/components/SourcePaymentMethodItem/SourcePaymentMethodItem.d.ts +1 -1
- package/dist/components/TransactionStatus/AnimatedSpinner/AnimatedSpinner.d.ts +1 -1
- package/dist/components/TransactionStatus/StepSpinner.d.ts +1 -1
- package/dist/components/TransactionStatus/TransactionStatus.d.ts +2 -2
- package/dist/components/TransferTokenDetails/TransferTokenDetails.d.ts +1 -1
- package/dist/consts/customers.d.ts +1 -1
- package/dist/domains/aave.d.ts +15 -10
- package/dist/domains/asset.d.ts +2 -2
- package/dist/domains/checkout.d.ts +1 -1
- package/dist/domains/checkoutErrors.d.ts +2 -2
- package/dist/domains/checkoutRecipient.d.ts +1 -1
- package/dist/domains/clientMetadata.d.ts +1 -1
- package/dist/domains/dynamicRouting.d.ts +1 -1
- package/dist/domains/fees.d.ts +3 -3
- package/dist/domains/paymentMethods.d.ts +1 -1
- package/dist/domains/quote.d.ts +5 -5
- package/dist/domains/quoteMode/exactOut.d.ts +1 -1
- package/dist/domains/quoteMode/resolveQuoteMode.d.ts +1 -1
- package/dist/domains/quoteMode/types.d.ts +2 -2
- package/dist/hooks/queries/useLightningQuote.d.ts +1 -1
- package/dist/hooks/queries/useMeldDefaultCurrency.d.ts +1 -1
- package/dist/hooks/queries/useRecentCheckouts.d.ts +1 -1
- package/dist/hooks/queries/useRecentDeposits.d.ts +1 -1
- package/dist/hooks/queries/useWithdrawalQuote.d.ts +31 -31
- package/dist/hooks/track/WithdrawModalEvent.d.ts +9 -1
- package/dist/hooks/track/useTrack.d.ts +1 -1
- package/dist/hooks/useBluvo.d.ts +3 -3
- package/dist/hooks/useCheckoutDirectExecution.d.ts +3 -3
- package/dist/hooks/useCheckoutDirectExecutionHistory.d.ts +1 -1
- package/dist/hooks/useCheckoutItemDisplay.d.ts +2 -2
- package/dist/hooks/useCheckoutTimeEstimate.d.ts +2 -2
- package/dist/hooks/useCountdown.d.ts +1 -1
- package/dist/hooks/useEnabledTokenTransferChainTokens.d.ts +1 -1
- package/dist/hooks/useExchangeOptions.d.ts +1 -1
- package/dist/hooks/useFrogAccount.d.ts +1 -1
- package/dist/hooks/useIsBlacklisted.d.ts +1 -1
- package/dist/hooks/useIsDynamicRoutingEnabled.d.ts +1 -1
- package/dist/hooks/useMinDeposit.d.ts +1 -1
- package/dist/hooks/useNewTokenBanner.d.ts +1 -1
- package/dist/hooks/useOnNewNotification.d.ts +1 -1
- package/dist/hooks/usePaymentMethodTabs.d.ts +1 -1
- package/dist/hooks/usePaymentSources.d.ts +2 -2
- package/dist/hooks/useRelayBypass.d.ts +1 -1
- package/dist/hooks/useStepQueryReadiness.d.ts +3 -3
- package/dist/hooks/useTokenAndChainDropdown.d.ts +1 -1
- package/dist/hooks/useTokenTransfer.d.ts +1 -1
- package/dist/hooks/useTokenTransferConfig.d.ts +1 -1
- package/dist/hooks/useUserIpInfo.d.ts +1 -1
- package/dist/index.css +11 -11
- package/dist/index.js +4373 -3881
- package/dist/interfaces/identity.d.ts +1 -1
- package/dist/modals/ChainModal/Chain.d.ts +1 -1
- package/dist/modals/CheckoutModal/Brokerage/BrokerageSuccessModal.d.ts +1 -1
- package/dist/modals/CheckoutModal/Brokerage/BrokerageTwoFA.d.ts +2 -2
- package/dist/modals/CheckoutModal/Brokerage/ConnectExchange.d.ts +2 -2
- package/dist/modals/CheckoutModal/Brokerage/SelectBrokerage.d.ts +2 -2
- package/dist/modals/CheckoutModal/ConfirmationStep/CheckoutPrimaryInfo.d.ts +2 -2
- package/dist/modals/CheckoutModal/ConfirmationStep/ConfirmationStep.d.ts +1 -1
- package/dist/modals/CheckoutModal/ConfirmationStep/DisclaimerText.d.ts +1 -1
- package/dist/modals/CheckoutModal/ConfirmationStep/mapRetryAction.d.ts +1 -1
- package/dist/modals/CheckoutModal/ConfirmationStep/useCheckoutConfirmation.d.ts +1 -1
- package/dist/modals/CheckoutModal/ConfirmationStep/useCheckoutQuote.d.ts +2 -2
- package/dist/modals/CheckoutModal/ConfirmationStep/usePostCheckout.d.ts +2 -2
- package/dist/modals/CheckoutModal/ConfirmationStep/useQuoteRefresh.d.ts +1 -1
- package/dist/modals/CheckoutModal/ConfirmationStep/useSourceAssetConfirm.d.ts +2 -2
- package/dist/modals/CheckoutModal/InputAmount/InputAmount.d.ts +1 -1
- package/dist/modals/CheckoutModal/InputAmount/InputAmountLoaded.d.ts +2 -2
- package/dist/modals/CheckoutModal/InputAmount/state.d.ts +3 -3
- package/dist/modals/CheckoutModal/InputAmount/useAaveNativeSupply.d.ts +3 -3
- package/dist/modals/CheckoutModal/InputAmount/useAmountInput.d.ts +1 -1
- package/dist/modals/CheckoutModal/InputAmount/useAvailableBalanceForCheckout.d.ts +3 -3
- package/dist/modals/CheckoutModal/InputAmount/useCheckoutAmountLimits.d.ts +2 -2
- package/dist/modals/CheckoutModal/InputAmount/useMeld.d.ts +1 -1
- package/dist/modals/CheckoutModal/InputAmount/utils.d.ts +2 -2
- package/dist/modals/CheckoutModal/LightningInvoice/LightningInvoice.d.ts +1 -1
- package/dist/modals/CheckoutModal/LightningInvoice/LightningInvoiceQrCode.d.ts +1 -1
- package/dist/modals/CheckoutModal/MeldCurrencySelect/MeldCurrencySelect.d.ts +1 -1
- package/dist/modals/CheckoutModal/MeldQuotes/MeldQuotes.d.ts +1 -1
- package/dist/modals/CheckoutModal/MeldRedirect/MeldRedirect.d.ts +1 -1
- package/dist/modals/CheckoutModal/SelectAsset/SelectAsset.d.ts +4 -4
- package/dist/modals/CheckoutModal/SelectAsset/SelectAssetInfoSection.d.ts +2 -2
- package/dist/modals/CheckoutModal/SelectAsset/SelectAssetList.d.ts +2 -2
- package/dist/modals/CheckoutModal/SourceChange/ConnectedSource.d.ts +1 -1
- package/dist/modals/CheckoutModal/SourceChange/CryptoCashToggle.d.ts +2 -2
- package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +2 -2
- package/dist/modals/CheckoutModal/SourceChange/useSourceChangeLayout.d.ts +1 -1
- package/dist/modals/CheckoutModal/SwappedIframe/SwappedIframeController.d.ts +2 -2
- package/dist/modals/CheckoutModal/TransferToken/CheckoutNotification.d.ts +1 -1
- package/dist/modals/CheckoutModal/TransferToken/CheckoutNotifications.track.d.ts +1 -1
- package/dist/modals/CheckoutModal/TransferToken/DirectExecutionNotification.d.ts +1 -1
- package/dist/modals/CheckoutModal/TransferToken/TransferToken.d.ts +1 -1
- package/dist/modals/CheckoutModal/TransferToken/types.d.ts +1 -1
- package/dist/modals/CheckoutModal/VirtualFiatAccount/BridgeCustomer.d.ts +2 -2
- package/dist/modals/CheckoutModal/VirtualFiatAccount/BridgeKyc.d.ts +1 -1
- package/dist/modals/CheckoutModal/VirtualFiatAccount/ErrorScreen.d.ts +1 -1
- package/dist/modals/CheckoutModal/VirtualFiatAccount/FiatAccountDetail.d.ts +1 -1
- package/dist/modals/CheckoutModal/VirtualFiatAccount/KycIframe.d.ts +2 -2
- package/dist/modals/CheckoutModal/VirtualFiatAccount/VirtualFiatAccount.d.ts +2 -2
- package/dist/modals/CheckoutModal/Withdrawal/WithdrawalComplete.d.ts +2 -2
- package/dist/modals/CheckoutModal/Withdrawal/WithdrawalEnterAmount.d.ts +2 -2
- package/dist/modals/CheckoutModal/stepTransition.d.ts +5 -5
- package/dist/modals/CheckoutModal/stepTransition.track.d.ts +2 -2
- package/dist/modals/ProfileDetails/FunProfileViews/Home/HomeCheckoutDisplayRow.d.ts +2 -2
- package/dist/modals/ProfileDetails/FunProfileViews/Home/HomeTokenDisplayRow.d.ts +1 -1
- package/dist/modals/ProfileDetails/FunProfileViews/Home/ProfileTitleSection.d.ts +2 -2
- package/dist/modals/ProfileDetails/FunProfileViews/Home/index.d.ts +1 -1
- package/dist/modals/WithdrawalModal/ErrorMessage.d.ts +2 -2
- package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +29 -8
- package/dist/modals/WithdrawalModal/RecipientAddress.d.ts +1 -1
- package/dist/modals/WithdrawalModal/WithdrawAmountInput.d.ts +11 -2
- package/dist/modals/WithdrawalModal/WithdrawalCallbackSuccess.d.ts +1 -1
- package/dist/modals/WithdrawalModal/WithdrawalContent.d.ts +9 -2
- package/dist/modals/WithdrawalModal/WithdrawalModal.d.ts +1 -1
- package/dist/modals/WithdrawalModal/WithdrawalSwappedIframeController.d.ts +11 -0
- package/dist/modals/WithdrawalModal/WithdrawalTypeSelect.d.ts +1 -1
- package/dist/modals/WithdrawalModal/types.d.ts +1 -0
- package/dist/modals/WithdrawalModal/useWithdrawal.d.ts +3 -3
- package/dist/providers/FunkitBrokerageProvider.d.ts +2 -2
- package/dist/providers/FunkitCheckoutContext/index.d.ts +1 -1
- package/dist/providers/FunkitCheckoutContext/track.d.ts +4 -4
- package/dist/providers/FunkitCheckoutContext/types.d.ts +30 -0
- package/dist/providers/FunkitConfigContext.d.ts +3 -3
- package/dist/providers/FunkitHistoryContext.d.ts +2 -2
- package/dist/providers/FunkitProvider.d.ts +2 -2
- package/dist/providers/FunkitQuoteContext.track.d.ts +4 -4
- package/dist/providers/GeneralWalletProvider.d.ts +2 -2
- package/dist/providers/QuoteModeContext.d.ts +1 -1
- package/dist/providers/SwappedProvider.d.ts +1 -1
- package/dist/utils/assets.d.ts +1 -1
- package/dist/utils/bluvo.d.ts +3 -3
- package/dist/utils/checkout.d.ts +3 -3
- package/dist/utils/customer.d.ts +6 -0
- package/dist/utils/depositCutoff.d.ts +1 -1
- package/dist/utils/funkitProvider.d.ts +1 -1
- package/dist/utils/payment.d.ts +1 -1
- package/dist/utils/polygonRpcCheck.d.ts +1 -1
- package/dist/utils/purifyCheckoutHistoryItem.d.ts +1 -1
- package/dist/utils/swapped.d.ts +1 -1
- package/dist/utils/withdrawal.d.ts +1 -1
- 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 +59 -59
- 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 +4 -4
- package/dist/__generated__/default_configs.d.ts +0 -901
- package/dist/__generated__/default_feature_gates.d.ts +0 -20
- package/dist/clients/chunk-25ICASD7.js +0 -2371
- package/dist/clients/chunk-3GO74QTP.js +0 -2382
- package/dist/clients/chunk-7GWX2ZS4.js +0 -69
- package/dist/clients/chunk-7HNGV6JU.js +0 -54
- package/dist/clients/chunk-CEBG7XQ5.js +0 -2382
- package/dist/clients/chunk-ELLXM7RO.js +0 -186
- package/dist/clients/chunk-GGXTLJ7J.js +0 -290
- package/dist/clients/chunk-HRWCNZJA.js +0 -230
- package/dist/clients/chunk-JD3FIVZ7.js +0 -69
- package/dist/clients/chunk-JTGKAPID.js +0 -2382
- package/dist/clients/chunk-L7PABCF2.js +0 -54
- package/dist/clients/chunk-LII3SVUH.js +0 -230
- package/dist/clients/chunk-NCUPPJ2Z.js +0 -2382
- package/dist/clients/chunk-NUJ6ZM5F.js +0 -186
- package/dist/clients/chunk-UVWNEQMD.js +0 -186
- package/dist/clients/chunk-ZNVFASTH.js +0 -54
- package/dist/clients/nado.d.ts +0 -78
- package/dist/clients/nado.js +0 -107
- package/dist/clients/polymarket.d.ts +0 -161
- package/dist/clients/polymarket.js +0 -688
- package/dist/interfaces/logTransport.d.ts +0 -51
- package/dist/interfaces/swapped-transport.d.ts +0 -78
- package/dist/modals/CheckoutModal/SourceChange/EmptyFormOfPaymentsMessage.d.ts +0 -4
- package/dist/modals/CheckoutModal/SourceChange/useUpdateSourceAssetForCard.d.ts +0 -4
- package/dist/modals/CheckoutModal/SwappedIframe/SwappedErrorMessage.d.ts +0 -6
- package/dist/utils/flags/resolver.d.ts +0 -34
- package/dist/wallets/walletConnectors/chunk-2VP2F6EK.js +0 -70
- package/dist/wallets/walletConnectors/chunk-4T6ZSRJF.js +0 -69
- package/dist/wallets/walletConnectors/chunk-6BW3HLBG.js +0 -96
- package/dist/wallets/walletConnectors/chunk-CCQV2ZET.js +0 -218
- package/dist/wallets/walletConnectors/chunk-CPI4TD43.js +0 -99
- package/dist/wallets/walletConnectors/chunk-F5XEEVG6.js +0 -98
- package/dist/wallets/walletConnectors/chunk-HNRB7KJU.js +0 -92
- package/dist/wallets/walletConnectors/chunk-HTHAK6XB.js +0 -93
- package/dist/wallets/walletConnectors/chunk-MIQTHJ6X.js +0 -66
- package/dist/wallets/walletConnectors/chunk-RB3HR4R2.js +0 -95
- package/dist/wallets/walletConnectors/chunk-RVOY537T.js +0 -100
- package/dist/wallets/walletConnectors/chunk-STVVP43G.js +0 -94
- package/dist/wallets/walletConnectors/chunk-UK7C2JXW.js +0 -87
- package/dist/wallets/walletConnectors/chunk-VAPGUPHO.js +0 -92
- package/dist/wallets/walletConnectors/chunk-VTM6EECM.js +0 -110
- package/dist/wallets/walletConnectors/chunk-X6CGV36L.js +0 -103
- package/dist/wallets/walletConnectors/chunk-YEZM4CK4.js +0 -96
- package/dist/wallets/walletConnectors/chunk-ZNX4EMPB.js +0 -106
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* caller provides the actual on-chain implementation.
|
|
15
15
|
*/
|
|
16
16
|
import { type Address } from 'viem';
|
|
17
|
-
import type { CustomWithdrawalConfig, MultiMethodWithdrawalConfig } from '
|
|
17
|
+
import type { CustomWithdrawalConfig, MultiMethodWithdrawalConfig } from '../providers/FunkitCheckoutContext/types';
|
|
18
18
|
export type LighterTransferParams = {
|
|
19
19
|
toAccountIndex: number;
|
|
20
20
|
assetIndex: number;
|
|
@@ -60,6 +60,19 @@ export interface LighterWithdrawalConfig {
|
|
|
60
60
|
* ```
|
|
61
61
|
*/
|
|
62
62
|
getSecureMinWithdrawalAmount?: (symbol: string) => number | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Awaited hook fired after the user taps "Withdraw" but before either method
|
|
65
|
+
* (Fast or Secure) fetches a nonce, prompts the wallet, or submits the L2 tx.
|
|
66
|
+
*
|
|
67
|
+
* Lighter strategies and withdrawals share the same L2 signing account, so a
|
|
68
|
+
* strategy that's still placing/cancelling orders will bump the nonce out
|
|
69
|
+
* from under the withdrawal and the signed tx is rejected. Cancel in-flight
|
|
70
|
+
* strategies here (awaited) so the withdrawal signs against a stable nonce.
|
|
71
|
+
*
|
|
72
|
+
* Throw to abort the withdrawal — the message is shown to the user verbatim
|
|
73
|
+
* and no nonce is consumed. Applies to both Fast and Secure.
|
|
74
|
+
*/
|
|
75
|
+
onBeforeSign?: () => Promise<void> | void;
|
|
63
76
|
}
|
|
64
77
|
/**
|
|
65
78
|
* Default minimum Secure-withdrawal amounts (token units) for known Lighter
|
|
@@ -92,6 +105,11 @@ export interface LighterSecureWithdrawalConfig {
|
|
|
92
105
|
* ```
|
|
93
106
|
*/
|
|
94
107
|
getMinWithdrawalAmount?: (symbol: string) => number;
|
|
108
|
+
/**
|
|
109
|
+
* Awaited hook fired before the Secure withdrawal fetches a nonce, prompts
|
|
110
|
+
* the wallet, or submits the L2 tx. See {@link LighterWithdrawalConfig['onBeforeSign']}.
|
|
111
|
+
*/
|
|
112
|
+
onBeforeSign?: () => Promise<void> | void;
|
|
95
113
|
}
|
|
96
114
|
/**
|
|
97
115
|
* Records a Lighter Secure withdrawal in Fun's direct-execution table as
|
package/dist/clients/lighter.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
AsyncImage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7G3QEQFB.js";
|
|
5
5
|
import {
|
|
6
6
|
useFunkitConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MXPZTW2H.js";
|
|
8
8
|
import {
|
|
9
9
|
Box,
|
|
10
10
|
useFunkitTranslation
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7UIDHSYG.js";
|
|
12
12
|
import {
|
|
13
13
|
logger
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-AHYOV7AV.js";
|
|
15
15
|
|
|
16
16
|
// src/clients/lighter.tsx
|
|
17
17
|
import {
|
|
@@ -20,14 +20,14 @@ import {
|
|
|
20
20
|
createDirectExecution
|
|
21
21
|
} from "@funkit/api-base";
|
|
22
22
|
import { LIGHTER_CHAIN_ID, SOLANA_MAINNET_CHAIN_ID } from "@funkit/chains";
|
|
23
|
-
import { RELAY_LIGHTER_CHAIN_ID } from "@funkit/fun-relay";
|
|
23
|
+
import { RELAY_LIGHTER_CHAIN_ID as RELAY_LIGHTER_CHAIN_ID2 } from "@funkit/fun-relay";
|
|
24
24
|
import { retry } from "@lifeomic/attempt";
|
|
25
25
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
26
26
|
import i18next from "i18next";
|
|
27
|
-
import
|
|
27
|
+
import React3, { useMemo as useMemo2 } from "react";
|
|
28
28
|
import { v4 as uuid } from "uuid";
|
|
29
29
|
import { pad, parseUnits, toHex } from "viem";
|
|
30
|
-
import { arbitrum, base, bsc, mainnet as
|
|
30
|
+
import { arbitrum, base, bsc, mainnet as mainnet3, optimism } from "viem/chains";
|
|
31
31
|
|
|
32
32
|
// src/components/Icons/EvmWallet.tsx
|
|
33
33
|
import React from "react";
|
|
@@ -52,11 +52,18 @@ var EvmWallet = ({ size = 20 }) => /* @__PURE__ */ React.createElement(
|
|
|
52
52
|
)
|
|
53
53
|
);
|
|
54
54
|
|
|
55
|
-
// src/
|
|
56
|
-
import {
|
|
55
|
+
// src/modals/WithdrawalModal/LighterWithdrawal.tsx
|
|
56
|
+
import { RELAY_LIGHTER_CHAIN_ID } from "@funkit/fun-relay";
|
|
57
|
+
import { formatAddress, formatCryptoAndStringify } from "@funkit/utils";
|
|
58
|
+
import * as dnum from "dnum";
|
|
59
|
+
import React2, { useEffect, useMemo } from "react";
|
|
60
|
+
import { createPortal } from "react-dom";
|
|
61
|
+
import { Trans } from "react-i18next";
|
|
62
|
+
import { mainnet as mainnet2 } from "viem/chains";
|
|
57
63
|
|
|
58
64
|
// src/utils/customer.ts
|
|
59
|
-
import { useQuery } from "@tanstack/react-query";
|
|
65
|
+
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
66
|
+
import { useCallback } from "react";
|
|
60
67
|
|
|
61
68
|
// src/consts/customers.ts
|
|
62
69
|
import {
|
|
@@ -121,6 +128,9 @@ function useLighterAccounts({
|
|
|
121
128
|
};
|
|
122
129
|
}
|
|
123
130
|
|
|
131
|
+
// src/providers/provideFunkitConnectChains.ts
|
|
132
|
+
import { chainMetadataById } from "@funkit/chains";
|
|
133
|
+
|
|
124
134
|
// src/utils/timeFormat.ts
|
|
125
135
|
import { formatSecondsToReadableForm } from "@funkit/utils";
|
|
126
136
|
function formatSecondsTranslated(seconds, t, specifyUnderMinute = false, omitSeconds = false) {
|
|
@@ -133,6 +143,11 @@ function formatSecondsTranslated(seconds, t, specifyUnderMinute = false, omitSec
|
|
|
133
143
|
});
|
|
134
144
|
}
|
|
135
145
|
|
|
146
|
+
// src/modals/WithdrawalModal/LighterWithdrawal.tsx
|
|
147
|
+
var LIGHTER_FAST_METHOD_ID = "lighter-fast";
|
|
148
|
+
var LIGHTER_SECURE_METHOD_ID = "lighter-secure";
|
|
149
|
+
var LIGHTER_FAST_MAX_WITHDRAWAL_USD = 3e6;
|
|
150
|
+
|
|
136
151
|
// src/clients/lighter.tsx
|
|
137
152
|
var LIGHTER_USDC_PERPS_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
138
153
|
var MAINNET_USDC = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
|
|
@@ -278,7 +293,7 @@ function createLighterAdaptedWallet({
|
|
|
278
293
|
}
|
|
279
294
|
return {
|
|
280
295
|
vmType: "lvm",
|
|
281
|
-
getChainId: async () => Number(
|
|
296
|
+
getChainId: async () => Number(RELAY_LIGHTER_CHAIN_ID2),
|
|
282
297
|
address: async () => accountIndex.toString(),
|
|
283
298
|
handleSignMessageStep: async () => {
|
|
284
299
|
throw new Error("Message signing not implemented for Lighter");
|
|
@@ -356,7 +371,7 @@ async function trackLighterSecureWithdrawal({
|
|
|
356
371
|
recipientAddr,
|
|
357
372
|
fromChainId: LIGHTER_CHAIN_ID.toString(),
|
|
358
373
|
fromTokenAddress,
|
|
359
|
-
toChainId:
|
|
374
|
+
toChainId: mainnet3.id.toString(),
|
|
360
375
|
toTokenAddress: mainnetTokenAddress,
|
|
361
376
|
fromAmountBaseUnit: baseUnitAmount,
|
|
362
377
|
toAmountBaseUnit: baseUnitAmount,
|
|
@@ -373,7 +388,7 @@ async function trackLighterSecureWithdrawal({
|
|
|
373
388
|
initSettings: {
|
|
374
389
|
config: {
|
|
375
390
|
targetAsset: mainnetTokenAddress,
|
|
376
|
-
targetChain:
|
|
391
|
+
targetChain: mainnet3.id.toString(),
|
|
377
392
|
targetAssetTicker: symbol
|
|
378
393
|
}
|
|
379
394
|
},
|
|
@@ -457,10 +472,11 @@ function createLighterSecureWithdrawalConfig(config) {
|
|
|
457
472
|
return {
|
|
458
473
|
modalTitle: config.modalTitle ?? i18next.t("withdrawal.withdraw"),
|
|
459
474
|
disableConnectedWallet: config.disableConnectedWallet,
|
|
475
|
+
onBeforeSign: config.onBeforeSign,
|
|
460
476
|
withdrawCallback: buildSecureWithdrawalCallback({
|
|
461
477
|
exec: config.sendLighterSecureWithdrawal
|
|
462
478
|
}),
|
|
463
|
-
sourceChainId:
|
|
479
|
+
sourceChainId: mainnet3.id.toString(),
|
|
464
480
|
sourceTokenSymbol: "USDC",
|
|
465
481
|
defaultReceiveToken: "USDC",
|
|
466
482
|
sourceTokenAddress: MAINNET_USDC,
|
|
@@ -474,7 +490,8 @@ function buildLighterFastWalletWithdrawalConfig({
|
|
|
474
490
|
accountIndex,
|
|
475
491
|
modalTitle,
|
|
476
492
|
disableConnectedWallet,
|
|
477
|
-
iconSrc
|
|
493
|
+
iconSrc,
|
|
494
|
+
onBeforeSign
|
|
478
495
|
}) {
|
|
479
496
|
const adaptedWallet = createLighterAdaptedWallet({
|
|
480
497
|
signerClient,
|
|
@@ -484,7 +501,7 @@ function buildLighterFastWalletWithdrawalConfig({
|
|
|
484
501
|
_type: "lighter",
|
|
485
502
|
adaptedWallet,
|
|
486
503
|
address: () => String(accountIndex),
|
|
487
|
-
getChainId: async () => Number(
|
|
504
|
+
getChainId: async () => Number(RELAY_LIGHTER_CHAIN_ID2),
|
|
488
505
|
// biome-ignore lint/suspicious/noEmptyBlockStatements: no-op — Lighter has no EVM chain switching
|
|
489
506
|
switchChain: async () => {
|
|
490
507
|
},
|
|
@@ -498,26 +515,28 @@ function buildLighterFastWalletWithdrawalConfig({
|
|
|
498
515
|
return {
|
|
499
516
|
modalTitle: modalTitle ?? i18next.t("withdrawal.withdraw"),
|
|
500
517
|
disableConnectedWallet,
|
|
518
|
+
onBeforeSign,
|
|
501
519
|
wallet,
|
|
502
|
-
sourceChainId:
|
|
520
|
+
sourceChainId: RELAY_LIGHTER_CHAIN_ID2,
|
|
503
521
|
sourceTokenSymbol: "USDC",
|
|
504
522
|
defaultReceiveToken: "USDC",
|
|
505
523
|
sourceTokenAddress: LIGHTER_USDC_PERPS_ADDRESS,
|
|
506
524
|
iconSrc: iconSrc ?? "https://sdk-cdn.fun.xyz/images/logos/lighter.png",
|
|
507
|
-
getMinWithdrawalUSD: () => 4
|
|
525
|
+
getMinWithdrawalUSD: () => 4,
|
|
526
|
+
getMaxWithdrawalUSD: () => LIGHTER_FAST_MAX_WITHDRAWAL_USD
|
|
508
527
|
};
|
|
509
528
|
}
|
|
510
529
|
function ChainIconStack({ chainIds }) {
|
|
511
|
-
return /* @__PURE__ */
|
|
530
|
+
return /* @__PURE__ */ React3.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "flex-end" }, chainIds.map((chainId, index) => {
|
|
512
531
|
const metadata = chainMetadataById[chainId];
|
|
513
|
-
return /* @__PURE__ */
|
|
532
|
+
return /* @__PURE__ */ React3.createElement(
|
|
514
533
|
Box,
|
|
515
534
|
{
|
|
516
535
|
key: chainId,
|
|
517
536
|
position: "relative",
|
|
518
537
|
style: { right: `${(chainIds.length - index - 1) * -2}px` }
|
|
519
538
|
},
|
|
520
|
-
/* @__PURE__ */
|
|
539
|
+
/* @__PURE__ */ React3.createElement(
|
|
521
540
|
AsyncImage,
|
|
522
541
|
{
|
|
523
542
|
alt: metadata?.name ?? "",
|
|
@@ -537,7 +556,7 @@ var LIGHTER_FAST_PREVIEW_CHAIN_IDS = [
|
|
|
537
556
|
bsc.id,
|
|
538
557
|
SOLANA_MAINNET_CHAIN_ID
|
|
539
558
|
];
|
|
540
|
-
var LIGHTER_SECURE_PREVIEW_CHAIN_IDS = [
|
|
559
|
+
var LIGHTER_SECURE_PREVIEW_CHAIN_IDS = [mainnet3.id];
|
|
541
560
|
function buildLighterMultiMethodConfig({
|
|
542
561
|
config,
|
|
543
562
|
accountIndex,
|
|
@@ -549,7 +568,8 @@ function buildLighterMultiMethodConfig({
|
|
|
549
568
|
accountIndex: Number(accountIndex),
|
|
550
569
|
modalTitle: config.modalTitle,
|
|
551
570
|
disableConnectedWallet: config.disableConnectedWallet,
|
|
552
|
-
iconSrc: config.fastIconSrc
|
|
571
|
+
iconSrc: config.fastIconSrc,
|
|
572
|
+
onBeforeSign: config.onBeforeSign
|
|
553
573
|
});
|
|
554
574
|
const secureConfig = createLighterSecureWithdrawalConfig({
|
|
555
575
|
accountIndex,
|
|
@@ -557,6 +577,7 @@ function buildLighterMultiMethodConfig({
|
|
|
557
577
|
disableConnectedWallet: config.disableConnectedWallet,
|
|
558
578
|
iconSrc: config.secureIconSrc,
|
|
559
579
|
sendLighterSecureWithdrawal: config.sendLighterSecureWithdrawal,
|
|
580
|
+
onBeforeSign: config.onBeforeSign,
|
|
560
581
|
getMinWithdrawalAmount: (symbol) => {
|
|
561
582
|
const userMin = config.getSecureMinWithdrawalAmount?.(symbol);
|
|
562
583
|
if (userMin !== void 0) {
|
|
@@ -566,15 +587,15 @@ function buildLighterMultiMethodConfig({
|
|
|
566
587
|
}
|
|
567
588
|
});
|
|
568
589
|
const fast = {
|
|
569
|
-
id:
|
|
590
|
+
id: LIGHTER_FAST_METHOD_ID,
|
|
570
591
|
keyText: t("withdrawal.methodFast"),
|
|
571
592
|
subtitleText: t("withdrawal.fastDisclaimer"),
|
|
572
|
-
icon: /* @__PURE__ */
|
|
573
|
-
valueIcon: /* @__PURE__ */
|
|
593
|
+
icon: /* @__PURE__ */ React3.createElement(EvmWallet, { size: 20 }),
|
|
594
|
+
valueIcon: /* @__PURE__ */ React3.createElement(ChainIconStack, { chainIds: LIGHTER_FAST_PREVIEW_CHAIN_IDS }),
|
|
574
595
|
config: fastConfig
|
|
575
596
|
};
|
|
576
597
|
const secure = {
|
|
577
|
-
id:
|
|
598
|
+
id: LIGHTER_SECURE_METHOD_ID,
|
|
578
599
|
keyText: t("withdrawal.methodSecure"),
|
|
579
600
|
subtitleText: t("withdrawal.secureDisclaimer", {
|
|
580
601
|
// Until the live value loads, show the localized "60+ minutes"
|
|
@@ -582,8 +603,8 @@ function buildLighterMultiMethodConfig({
|
|
|
582
603
|
// so it doesn't bleed into live values, which are exact.
|
|
583
604
|
delay: secureDelayText ?? t("withdrawal.secureFallbackDelay")
|
|
584
605
|
}),
|
|
585
|
-
icon: /* @__PURE__ */
|
|
586
|
-
valueIcon: /* @__PURE__ */
|
|
606
|
+
icon: /* @__PURE__ */ React3.createElement(EvmWallet, { size: 20 }),
|
|
607
|
+
valueIcon: /* @__PURE__ */ React3.createElement(ChainIconStack, { chainIds: LIGHTER_SECURE_PREVIEW_CHAIN_IDS }),
|
|
587
608
|
config: secureConfig
|
|
588
609
|
};
|
|
589
610
|
return {
|
|
@@ -599,7 +620,7 @@ function useLighterWithdrawalConfig(config) {
|
|
|
599
620
|
});
|
|
600
621
|
const accountIndex = mainAccountIndex && /^\d+$/.test(mainAccountIndex) ? mainAccountIndex : void 0;
|
|
601
622
|
const secureDelayText = useLighterSecureDelayText();
|
|
602
|
-
return
|
|
623
|
+
return useMemo2(() => {
|
|
603
624
|
if (!config || !accountIndex) {
|
|
604
625
|
return null;
|
|
605
626
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* verified on-chain (owner = the Fun deployer).
|
|
16
16
|
*/
|
|
17
17
|
import { type Address } from 'viem';
|
|
18
|
-
import type { FunkitCheckoutActionParams } from '
|
|
18
|
+
import type { FunkitCheckoutActionParams } from '../providers/FunkitCheckoutContext/types';
|
|
19
19
|
/** Mallard deposit contract to credit a Mallard (perps) account. */
|
|
20
20
|
export declare const MALLARD_DEPOSIT_ADDRESS: `0x${string}`;
|
|
21
21
|
/** VaultDepositooor on Zorro chain. */
|