@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
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useFunkitTranslation
|
|
4
|
-
} from "./chunk-7GWX2ZS4.js";
|
|
5
|
-
|
|
6
|
-
// src/providers/FunkitConfigContext.tsx
|
|
7
|
-
import {
|
|
8
|
-
createContext,
|
|
9
|
-
useContext,
|
|
10
|
-
useMemo
|
|
11
|
-
} from "react";
|
|
12
|
-
var DEFAULT_TEXT_CUSTOMIZATIONS = {
|
|
13
|
-
virtualFiat: "Deposit with SEPA",
|
|
14
|
-
brokerageOrExchange: "Connect Exchange",
|
|
15
|
-
debitOrCredit: "Deposit with Card",
|
|
16
|
-
accountBalance: "Wallet",
|
|
17
|
-
selectAccount: "Select an exchange",
|
|
18
|
-
perpsTransferTitle: "Transfer",
|
|
19
|
-
sourceMethodTitle: "Your source",
|
|
20
|
-
tokensListTitle: "Your tokens",
|
|
21
|
-
transferTokens: "Transfer Crypto",
|
|
22
|
-
bitcoinLightning: "Bitcoin on Cash App",
|
|
23
|
-
receiveDropdownTitle: "",
|
|
24
|
-
// Default to empty
|
|
25
|
-
receiveDropdownLabel: "Asset to Receive",
|
|
26
|
-
confirmationScreen: {
|
|
27
|
-
payAmountLabel: "You send",
|
|
28
|
-
receiveAmountLabel: "You receive"
|
|
29
|
-
},
|
|
30
|
-
paymentMethodSubtitles: {}
|
|
31
|
-
};
|
|
32
|
-
var DEFAULT_UI_CUSTOMIZATIONS = {
|
|
33
|
-
alignTitle: "center",
|
|
34
|
-
alwaysShowTopDivider: false,
|
|
35
|
-
showModalTitle: true,
|
|
36
|
-
callToActionsUppercase: false,
|
|
37
|
-
enableCompactList: false,
|
|
38
|
-
checkoutHistory: {
|
|
39
|
-
showGetHelpAsAlert: true,
|
|
40
|
-
simplifiedUi: false
|
|
41
|
-
},
|
|
42
|
-
confirmationScreen: {
|
|
43
|
-
preferDestinationWhenSame: false,
|
|
44
|
-
showAmountSummaryAbovePaymentMethod: false,
|
|
45
|
-
showDisclaimerAsAlert: true,
|
|
46
|
-
showInstantTimeEstimate: false,
|
|
47
|
-
showLeftAlignedDollarValueWithLabel: false,
|
|
48
|
-
showPaymentAmountUsd: false,
|
|
49
|
-
showReceiveAmountUsd: false,
|
|
50
|
-
showSelectedRoute: false,
|
|
51
|
-
stepIndicatorType: "spinner",
|
|
52
|
-
showTokenAmount: true,
|
|
53
|
-
showTransactionDigest: "none"
|
|
54
|
-
},
|
|
55
|
-
sourceChangeScreen: {
|
|
56
|
-
bottomBarCloseButton: {
|
|
57
|
-
enabled: false,
|
|
58
|
-
labelKey: "common.close"
|
|
59
|
-
},
|
|
60
|
-
showTargetAssetSelection: false,
|
|
61
|
-
showWalletOnInsufficientBalance: false,
|
|
62
|
-
showWalletConnect: true,
|
|
63
|
-
showCustomTopComponentDivider: false,
|
|
64
|
-
paymentMethodIcons: {}
|
|
65
|
-
},
|
|
66
|
-
inputAmountScreen: {
|
|
67
|
-
allowTokenAmountInput: true
|
|
68
|
-
},
|
|
69
|
-
selectAssetScreen: {
|
|
70
|
-
isSecondaryTokenSymbolVisible: true,
|
|
71
|
-
navigateOnAssetClick: false
|
|
72
|
-
},
|
|
73
|
-
transferCryptoScreen: {
|
|
74
|
-
showYouSendYouReceive: false
|
|
75
|
-
},
|
|
76
|
-
withdrawalScreen: {},
|
|
77
|
-
selectBrokerageScreen: {},
|
|
78
|
-
connectExchangeScreen: {},
|
|
79
|
-
customIcons: {},
|
|
80
|
-
customFontFamily: {
|
|
81
|
-
primary: "",
|
|
82
|
-
secondary: "",
|
|
83
|
-
tertiary: ""
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
var DEFAULT_FUNKIT_CONFIG = {
|
|
87
|
-
apiKey: "",
|
|
88
|
-
appName: "",
|
|
89
|
-
textCustomizations: DEFAULT_TEXT_CUSTOMIZATIONS,
|
|
90
|
-
uiCustomizations: DEFAULT_UI_CUSTOMIZATIONS
|
|
91
|
-
};
|
|
92
|
-
var FunkitConfigContext = createContext(
|
|
93
|
-
DEFAULT_FUNKIT_CONFIG
|
|
94
|
-
);
|
|
95
|
-
function useFunkitConfig() {
|
|
96
|
-
const originalFunkitConfig = useContext(FunkitConfigContext);
|
|
97
|
-
const { t } = useFunkitTranslation();
|
|
98
|
-
const translatedDefaults = useMemo(() => {
|
|
99
|
-
return {
|
|
100
|
-
virtualFiat: t("textCustomizations.virtualFiat"),
|
|
101
|
-
brokerageOrExchange: t("textCustomizations.brokerageOrExchange"),
|
|
102
|
-
debitOrCredit: t("textCustomizations.debitOrCredit"),
|
|
103
|
-
accountBalance: t("textCustomizations.accountBalance"),
|
|
104
|
-
selectAccount: t("textCustomizations.selectAccount"),
|
|
105
|
-
perpsTransferTitle: t("perpsTransfer.title"),
|
|
106
|
-
sourceMethodTitle: t("textCustomizations.sourceMethodTitle"),
|
|
107
|
-
tokensListTitle: t("textCustomizations.tokensListTitle"),
|
|
108
|
-
transferTokens: t("textCustomizations.transferTokens"),
|
|
109
|
-
bitcoinLightning: t("textCustomizations.bitcoinLightning"),
|
|
110
|
-
receiveDropdownTitle: t("textCustomizations.receiveDropdownTitle"),
|
|
111
|
-
receiveDropdownLabel: t("textCustomizations.receiveDropdownLabel"),
|
|
112
|
-
confirmationScreen: {
|
|
113
|
-
payAmountLabel: t("textCustomizations.payAmountLabel"),
|
|
114
|
-
receiveAmountLabel: t("textCustomizations.receiveAmountLabel")
|
|
115
|
-
},
|
|
116
|
-
paymentMethodSubtitles: {}
|
|
117
|
-
};
|
|
118
|
-
}, [t]);
|
|
119
|
-
const finalFunkitConfig = useMemo(() => {
|
|
120
|
-
return {
|
|
121
|
-
...DEFAULT_FUNKIT_CONFIG,
|
|
122
|
-
...originalFunkitConfig,
|
|
123
|
-
textCustomizations: {
|
|
124
|
-
...translatedDefaults,
|
|
125
|
-
...originalFunkitConfig.textCustomizations,
|
|
126
|
-
confirmationScreen: {
|
|
127
|
-
...translatedDefaults.confirmationScreen,
|
|
128
|
-
...originalFunkitConfig.textCustomizations?.confirmationScreen
|
|
129
|
-
},
|
|
130
|
-
paymentMethodSubtitles: {
|
|
131
|
-
...translatedDefaults.paymentMethodSubtitles,
|
|
132
|
-
...originalFunkitConfig.textCustomizations?.paymentMethodSubtitles
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
uiCustomizations: {
|
|
136
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations,
|
|
137
|
-
...originalFunkitConfig.uiCustomizations,
|
|
138
|
-
checkoutHistory: {
|
|
139
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.checkoutHistory,
|
|
140
|
-
...originalFunkitConfig.uiCustomizations?.checkoutHistory
|
|
141
|
-
},
|
|
142
|
-
confirmationScreen: {
|
|
143
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.confirmationScreen,
|
|
144
|
-
...originalFunkitConfig.uiCustomizations?.confirmationScreen
|
|
145
|
-
},
|
|
146
|
-
connectExchangeScreen: {
|
|
147
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.connectExchangeScreen,
|
|
148
|
-
...originalFunkitConfig.uiCustomizations?.connectExchangeScreen
|
|
149
|
-
},
|
|
150
|
-
inputAmountScreen: {
|
|
151
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.inputAmountScreen,
|
|
152
|
-
...originalFunkitConfig.uiCustomizations?.inputAmountScreen
|
|
153
|
-
},
|
|
154
|
-
selectAssetScreen: {
|
|
155
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.selectAssetScreen,
|
|
156
|
-
...originalFunkitConfig.uiCustomizations?.selectAssetScreen
|
|
157
|
-
},
|
|
158
|
-
selectBrokerageScreen: {
|
|
159
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.selectBrokerageScreen,
|
|
160
|
-
...originalFunkitConfig.uiCustomizations?.selectBrokerageScreen
|
|
161
|
-
},
|
|
162
|
-
sourceChangeScreen: {
|
|
163
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.sourceChangeScreen,
|
|
164
|
-
...originalFunkitConfig.uiCustomizations?.sourceChangeScreen,
|
|
165
|
-
bottomBarCloseButton: {
|
|
166
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.sourceChangeScreen.bottomBarCloseButton,
|
|
167
|
-
...originalFunkitConfig.uiCustomizations?.sourceChangeScreen?.bottomBarCloseButton
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
transferCryptoScreen: {
|
|
171
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.transferCryptoScreen,
|
|
172
|
-
...originalFunkitConfig.uiCustomizations?.transferCryptoScreen
|
|
173
|
-
},
|
|
174
|
-
withdrawalScreen: {
|
|
175
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.withdrawalScreen,
|
|
176
|
-
...originalFunkitConfig.uiCustomizations?.withdrawalScreen
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
}, [originalFunkitConfig, translatedDefaults]);
|
|
181
|
-
return finalFunkitConfig;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export {
|
|
185
|
-
useFunkitConfig
|
|
186
|
-
};
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useFunkitTranslation
|
|
4
|
-
} from "./chunk-JD3FIVZ7.js";
|
|
5
|
-
|
|
6
|
-
// src/providers/FunkitConfigContext.tsx
|
|
7
|
-
import {
|
|
8
|
-
createContext,
|
|
9
|
-
useContext,
|
|
10
|
-
useMemo
|
|
11
|
-
} from "react";
|
|
12
|
-
var DEFAULT_TEXT_CUSTOMIZATIONS = {
|
|
13
|
-
virtualFiat: "Deposit with SEPA",
|
|
14
|
-
brokerageOrExchange: "Connect Exchange",
|
|
15
|
-
debitOrCredit: "Deposit with Card",
|
|
16
|
-
accountBalance: "Wallet",
|
|
17
|
-
selectAccount: "Select an exchange",
|
|
18
|
-
perpsTransferTitle: "Transfer",
|
|
19
|
-
sourceMethodTitle: "Your source",
|
|
20
|
-
tokensListTitle: "Your tokens",
|
|
21
|
-
transferTokens: "Transfer Crypto",
|
|
22
|
-
bitcoinLightning: "Bitcoin on Cash App",
|
|
23
|
-
receiveDropdownTitle: "",
|
|
24
|
-
// Default to empty
|
|
25
|
-
receiveDropdownLabel: "Asset to Receive",
|
|
26
|
-
confirmationScreen: {
|
|
27
|
-
payAmountLabel: "You send",
|
|
28
|
-
receiveAmountLabel: "You receive"
|
|
29
|
-
},
|
|
30
|
-
paymentMethodSubtitles: {}
|
|
31
|
-
};
|
|
32
|
-
var DEFAULT_UI_CUSTOMIZATIONS = {
|
|
33
|
-
alignTitle: "center",
|
|
34
|
-
alwaysShowTopDivider: false,
|
|
35
|
-
showModalTitle: true,
|
|
36
|
-
callToActionsUppercase: false,
|
|
37
|
-
enableCompactList: false,
|
|
38
|
-
checkoutHistory: {
|
|
39
|
-
showGetHelpAsAlert: true,
|
|
40
|
-
simplifiedUi: false
|
|
41
|
-
},
|
|
42
|
-
confirmationScreen: {
|
|
43
|
-
preferDestinationWhenSame: false,
|
|
44
|
-
showAmountSummaryAbovePaymentMethod: false,
|
|
45
|
-
showDisclaimerAsAlert: true,
|
|
46
|
-
showInstantTimeEstimate: false,
|
|
47
|
-
showLeftAlignedDollarValueWithLabel: false,
|
|
48
|
-
showPaymentAmountUsd: false,
|
|
49
|
-
showReceiveAmountUsd: false,
|
|
50
|
-
showSelectedRoute: false,
|
|
51
|
-
stepIndicatorType: "spinner",
|
|
52
|
-
showTokenAmount: true,
|
|
53
|
-
showTransactionDigest: "none"
|
|
54
|
-
},
|
|
55
|
-
sourceChangeScreen: {
|
|
56
|
-
bottomBarCloseButton: {
|
|
57
|
-
enabled: false,
|
|
58
|
-
labelKey: "common.close"
|
|
59
|
-
},
|
|
60
|
-
showTargetAssetSelection: false,
|
|
61
|
-
showWalletOnInsufficientBalance: false,
|
|
62
|
-
showWalletConnect: true,
|
|
63
|
-
showCustomTopComponentDivider: false,
|
|
64
|
-
paymentMethodIcons: {}
|
|
65
|
-
},
|
|
66
|
-
inputAmountScreen: {
|
|
67
|
-
allowTokenAmountInput: true
|
|
68
|
-
},
|
|
69
|
-
selectAssetScreen: {
|
|
70
|
-
isSecondaryTokenSymbolVisible: true,
|
|
71
|
-
navigateOnAssetClick: false
|
|
72
|
-
},
|
|
73
|
-
transferCryptoScreen: {
|
|
74
|
-
showYouSendYouReceive: false
|
|
75
|
-
},
|
|
76
|
-
withdrawalScreen: {},
|
|
77
|
-
selectBrokerageScreen: {},
|
|
78
|
-
connectExchangeScreen: {},
|
|
79
|
-
customIcons: {},
|
|
80
|
-
customFontFamily: {
|
|
81
|
-
primary: "",
|
|
82
|
-
secondary: "",
|
|
83
|
-
tertiary: ""
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
var DEFAULT_FUNKIT_CONFIG = {
|
|
87
|
-
apiKey: "",
|
|
88
|
-
appName: "",
|
|
89
|
-
textCustomizations: DEFAULT_TEXT_CUSTOMIZATIONS,
|
|
90
|
-
uiCustomizations: DEFAULT_UI_CUSTOMIZATIONS
|
|
91
|
-
};
|
|
92
|
-
var FunkitConfigContext = createContext(
|
|
93
|
-
DEFAULT_FUNKIT_CONFIG
|
|
94
|
-
);
|
|
95
|
-
function useFunkitConfig() {
|
|
96
|
-
const originalFunkitConfig = useContext(FunkitConfigContext);
|
|
97
|
-
const { t } = useFunkitTranslation();
|
|
98
|
-
const translatedDefaults = useMemo(() => {
|
|
99
|
-
return {
|
|
100
|
-
virtualFiat: t("textCustomizations.virtualFiat"),
|
|
101
|
-
brokerageOrExchange: t("textCustomizations.brokerageOrExchange"),
|
|
102
|
-
debitOrCredit: t("textCustomizations.debitOrCredit"),
|
|
103
|
-
accountBalance: t("textCustomizations.accountBalance"),
|
|
104
|
-
selectAccount: t("textCustomizations.selectAccount"),
|
|
105
|
-
perpsTransferTitle: t("perpsTransfer.title"),
|
|
106
|
-
sourceMethodTitle: t("textCustomizations.sourceMethodTitle"),
|
|
107
|
-
tokensListTitle: t("textCustomizations.tokensListTitle"),
|
|
108
|
-
transferTokens: t("textCustomizations.transferTokens"),
|
|
109
|
-
bitcoinLightning: t("textCustomizations.bitcoinLightning"),
|
|
110
|
-
receiveDropdownTitle: t("textCustomizations.receiveDropdownTitle"),
|
|
111
|
-
receiveDropdownLabel: t("textCustomizations.receiveDropdownLabel"),
|
|
112
|
-
confirmationScreen: {
|
|
113
|
-
payAmountLabel: t("textCustomizations.payAmountLabel"),
|
|
114
|
-
receiveAmountLabel: t("textCustomizations.receiveAmountLabel")
|
|
115
|
-
},
|
|
116
|
-
paymentMethodSubtitles: {}
|
|
117
|
-
};
|
|
118
|
-
}, [t]);
|
|
119
|
-
const finalFunkitConfig = useMemo(() => {
|
|
120
|
-
return {
|
|
121
|
-
...DEFAULT_FUNKIT_CONFIG,
|
|
122
|
-
...originalFunkitConfig,
|
|
123
|
-
textCustomizations: {
|
|
124
|
-
...translatedDefaults,
|
|
125
|
-
...originalFunkitConfig.textCustomizations,
|
|
126
|
-
confirmationScreen: {
|
|
127
|
-
...translatedDefaults.confirmationScreen,
|
|
128
|
-
...originalFunkitConfig.textCustomizations?.confirmationScreen
|
|
129
|
-
},
|
|
130
|
-
paymentMethodSubtitles: {
|
|
131
|
-
...translatedDefaults.paymentMethodSubtitles,
|
|
132
|
-
...originalFunkitConfig.textCustomizations?.paymentMethodSubtitles
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
uiCustomizations: {
|
|
136
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations,
|
|
137
|
-
...originalFunkitConfig.uiCustomizations,
|
|
138
|
-
checkoutHistory: {
|
|
139
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.checkoutHistory,
|
|
140
|
-
...originalFunkitConfig.uiCustomizations?.checkoutHistory
|
|
141
|
-
},
|
|
142
|
-
confirmationScreen: {
|
|
143
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.confirmationScreen,
|
|
144
|
-
...originalFunkitConfig.uiCustomizations?.confirmationScreen
|
|
145
|
-
},
|
|
146
|
-
connectExchangeScreen: {
|
|
147
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.connectExchangeScreen,
|
|
148
|
-
...originalFunkitConfig.uiCustomizations?.connectExchangeScreen
|
|
149
|
-
},
|
|
150
|
-
inputAmountScreen: {
|
|
151
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.inputAmountScreen,
|
|
152
|
-
...originalFunkitConfig.uiCustomizations?.inputAmountScreen
|
|
153
|
-
},
|
|
154
|
-
selectAssetScreen: {
|
|
155
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.selectAssetScreen,
|
|
156
|
-
...originalFunkitConfig.uiCustomizations?.selectAssetScreen
|
|
157
|
-
},
|
|
158
|
-
selectBrokerageScreen: {
|
|
159
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.selectBrokerageScreen,
|
|
160
|
-
...originalFunkitConfig.uiCustomizations?.selectBrokerageScreen
|
|
161
|
-
},
|
|
162
|
-
sourceChangeScreen: {
|
|
163
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.sourceChangeScreen,
|
|
164
|
-
...originalFunkitConfig.uiCustomizations?.sourceChangeScreen,
|
|
165
|
-
bottomBarCloseButton: {
|
|
166
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.sourceChangeScreen.bottomBarCloseButton,
|
|
167
|
-
...originalFunkitConfig.uiCustomizations?.sourceChangeScreen?.bottomBarCloseButton
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
transferCryptoScreen: {
|
|
171
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.transferCryptoScreen,
|
|
172
|
-
...originalFunkitConfig.uiCustomizations?.transferCryptoScreen
|
|
173
|
-
},
|
|
174
|
-
withdrawalScreen: {
|
|
175
|
-
...DEFAULT_FUNKIT_CONFIG.uiCustomizations.withdrawalScreen,
|
|
176
|
-
...originalFunkitConfig.uiCustomizations?.withdrawalScreen
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
}, [originalFunkitConfig, translatedDefaults]);
|
|
181
|
-
return finalFunkitConfig;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export {
|
|
185
|
-
useFunkitConfig
|
|
186
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
Box
|
|
4
|
-
} from "./chunk-7FIVHWNC.js";
|
|
5
|
-
|
|
6
|
-
// src/components/Text/Text.tsx
|
|
7
|
-
import React from "react";
|
|
8
|
-
var Text = React.forwardRef(
|
|
9
|
-
({
|
|
10
|
-
as = "div",
|
|
11
|
-
children,
|
|
12
|
-
className,
|
|
13
|
-
color = "primaryText",
|
|
14
|
-
display,
|
|
15
|
-
font = "body",
|
|
16
|
-
id,
|
|
17
|
-
size = "16",
|
|
18
|
-
style,
|
|
19
|
-
tabIndex,
|
|
20
|
-
title,
|
|
21
|
-
textAlign = "inherit",
|
|
22
|
-
textTransform = "none",
|
|
23
|
-
weight = "regular",
|
|
24
|
-
testId
|
|
25
|
-
}, ref) => {
|
|
26
|
-
return /* @__PURE__ */ React.createElement(
|
|
27
|
-
Box,
|
|
28
|
-
{
|
|
29
|
-
as,
|
|
30
|
-
className,
|
|
31
|
-
color: color === "inherit" ? void 0 : color,
|
|
32
|
-
display,
|
|
33
|
-
fontFamily: font,
|
|
34
|
-
fontSize: size,
|
|
35
|
-
fontWeight: weight,
|
|
36
|
-
id,
|
|
37
|
-
title,
|
|
38
|
-
ref,
|
|
39
|
-
style,
|
|
40
|
-
tabIndex,
|
|
41
|
-
textAlign,
|
|
42
|
-
textTransform,
|
|
43
|
-
testId,
|
|
44
|
-
background: { selection: "textSelection" }
|
|
45
|
-
},
|
|
46
|
-
children
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
Text.displayName = "Text";
|
|
51
|
-
|
|
52
|
-
export {
|
|
53
|
-
Text
|
|
54
|
-
};
|
package/dist/clients/nado.d.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Nado deposit routed through the Ink VaultDepositooor.
|
|
3
|
-
*
|
|
4
|
-
* Each deposit is a 2-action batch:
|
|
5
|
-
* 1. approve(collateralToken, VAULT_DEPOSITOR, maxUint256) — covers the live balance pull
|
|
6
|
-
* 2. VAULT_DEPOSITOR.deposit(collateralToken, NADO_ENDPOINT, calldata, 0)
|
|
7
|
-
*
|
|
8
|
-
* No zero-first approve reset: USDT0 on Ink (TetherTokenOFTExtension) inherits
|
|
9
|
-
* OpenZeppelin's plain approve — verified on the Ink explorer, no legacy
|
|
10
|
-
* non-zero->non-zero revert — and the other collaterals are standard OZ tokens.
|
|
11
|
-
*
|
|
12
|
-
* The Endpoint calldata carries AMOUNT_PLACEHOLDER where the uint128 amount
|
|
13
|
-
* goes; the VaultDepositooor injects its caller's LIVE collateral balance over
|
|
14
|
-
* the placeholder before calling the Endpoint. That makes the deposit robust
|
|
15
|
-
* to bridge fee drift: whatever actually arrived is what gets deposited, with
|
|
16
|
-
* no under-funded revert and no dust stranded on the EOA. The selector is the
|
|
17
|
-
* canonical uint128 one (0x221f0939, registered for the Endpoint on the Ink
|
|
18
|
-
* VaultDepositooor) while the head encodes the amount slot as uint256 so the
|
|
19
|
-
* 32-byte placeholder word fits — uint128 and uint256 head-encode identically.
|
|
20
|
-
*
|
|
21
|
-
* `subaccount` packs the recipient address (high 20 bytes) with the
|
|
22
|
-
* subaccount name "default" (right-padded to the remaining 12 bytes) into a
|
|
23
|
-
* single bytes32 word. `productId` is per-collateral and is looked up by the
|
|
24
|
-
* integrator from the Nado SpotEngine allowlist.
|
|
25
|
-
*
|
|
26
|
-
* Spec: https://www.notion.so/the-fun-group/37bfc3b2a002816bac41c920902e03c2
|
|
27
|
-
*/
|
|
28
|
-
import { type Address, type Hex } from 'viem';
|
|
29
|
-
import type { FunkitCheckoutActionParams } from '../providers/FunkitCheckoutContext/types';
|
|
30
|
-
/** Nado Endpoint on Ink mainnet (chain 57073). */
|
|
31
|
-
export declare const NADO_ENDPOINT_ADDRESS: `0x${string}`;
|
|
32
|
-
/** VaultDepositooor on Ink — fresh CREATE3 deploy (differs from the canonical
|
|
33
|
-
* address on other chains). The Nado Endpoint is registered on it with
|
|
34
|
-
* selector 0x221f0939 and no decimal conversion. Mirrors
|
|
35
|
-
* VAULT_DEPOSITOR_ADDRESSES[INK] in fun-backend's packages/types. */
|
|
36
|
-
export declare const INK_VAULT_DEPOSITOR_ADDRESS: `0x${string}`;
|
|
37
|
-
/** Sentinel value Nado treats as "no referral". */
|
|
38
|
-
export declare const NADO_NO_REFERRAL_CODE = "-1";
|
|
39
|
-
/** Default subaccount name used by the Nado UI/SDK. */
|
|
40
|
-
export declare const NADO_DEFAULT_SUBACCOUNT_NAME = "default";
|
|
41
|
-
/**
|
|
42
|
-
* Build a Nado `bytes32` subaccount from an owner address and subaccount
|
|
43
|
-
* name. Layout: `[owner (20 bytes)] [name (right-padded to 12 bytes)]`.
|
|
44
|
-
*
|
|
45
|
-
* Throws if `name` encodes to more than 12 bytes — without this, `pad()`
|
|
46
|
-
* surfaces viem's opaque `SizeExceedsPaddingSizeError`.
|
|
47
|
-
*/
|
|
48
|
-
export declare function buildNadoSubaccount(owner: Address, name?: string): Hex;
|
|
49
|
-
export interface NadoDepositActionsConfig {
|
|
50
|
-
/** Address credited on Nado (typically the connected wallet). */
|
|
51
|
-
recipientAddress: Address | undefined;
|
|
52
|
-
/** Collateral ERC20 on Ink being deposited (USDT0, kBTC, WETH, USDC, ...). */
|
|
53
|
-
collateralTokenAddress: Address;
|
|
54
|
-
/** Nado SpotEngine productId for the collateral token. */
|
|
55
|
-
productId: number;
|
|
56
|
-
/** Optional subaccount name. Defaults to "default". */
|
|
57
|
-
subaccountName?: string;
|
|
58
|
-
/** Optional referral code. Defaults to the no-referral sentinel "-1". */
|
|
59
|
-
referralCode?: string;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Builds the 2-action batch (approve + deposit) for a Nado collateral
|
|
63
|
-
* deposit routed through the Endpoint.
|
|
64
|
-
*
|
|
65
|
-
* Usage:
|
|
66
|
-
* ```ts
|
|
67
|
-
* const checkoutConfig: FunkitCheckoutConfig = {
|
|
68
|
-
* // ...
|
|
69
|
-
* generateActionsParams: () => async (amount, output) =>
|
|
70
|
-
* createNadoDepositActions({
|
|
71
|
-
* recipientAddress: walletAddress,
|
|
72
|
-
* collateralTokenAddress: output.targetAsset,
|
|
73
|
-
* productId: NADO_PRODUCT_ID_BY_TOKEN[output.targetAsset],
|
|
74
|
-
* }),
|
|
75
|
-
* }
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
export declare function createNadoDepositActions(config: NadoDepositActionsConfig): FunkitCheckoutActionParams[];
|
package/dist/clients/nado.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/clients/nado.tsx
|
|
4
|
-
import {
|
|
5
|
-
concat,
|
|
6
|
-
encodeAbiParameters,
|
|
7
|
-
erc20Abi,
|
|
8
|
-
getAddress,
|
|
9
|
-
maxUint256,
|
|
10
|
-
pad,
|
|
11
|
-
stringToHex,
|
|
12
|
-
toFunctionSelector
|
|
13
|
-
} from "viem";
|
|
14
|
-
var NADO_ENDPOINT_ADDRESS = getAddress(
|
|
15
|
-
"0x05ec92d78ed421f3d3ada77ffde167106565974e"
|
|
16
|
-
);
|
|
17
|
-
var INK_VAULT_DEPOSITOR_ADDRESS = getAddress(
|
|
18
|
-
"0xDB9d579B0DCbf566E372C73A2e374c44B161E1Ee"
|
|
19
|
-
);
|
|
20
|
-
var AMOUNT_PLACEHOLDER = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffdeadbeefn;
|
|
21
|
-
var VAULT_DEPOSITOR_ABI = [
|
|
22
|
-
{
|
|
23
|
-
name: "deposit",
|
|
24
|
-
type: "function",
|
|
25
|
-
stateMutability: "nonpayable",
|
|
26
|
-
inputs: [
|
|
27
|
-
{ name: "token", type: "address" },
|
|
28
|
-
{ name: "vault", type: "address" },
|
|
29
|
-
{ name: "callData", type: "bytes" },
|
|
30
|
-
{ name: "minAmountOut", type: "uint256" }
|
|
31
|
-
],
|
|
32
|
-
outputs: []
|
|
33
|
-
}
|
|
34
|
-
];
|
|
35
|
-
var NADO_NO_REFERRAL_CODE = "-1";
|
|
36
|
-
var NADO_DEFAULT_SUBACCOUNT_NAME = "default";
|
|
37
|
-
var NADO_SUBACCOUNT_NAME_MAX_BYTES = 12;
|
|
38
|
-
function buildNadoSubaccount(owner, name = NADO_DEFAULT_SUBACCOUNT_NAME) {
|
|
39
|
-
const nameHex = stringToHex(name);
|
|
40
|
-
const nameByteLength = (nameHex.length - 2) / 2;
|
|
41
|
-
if (nameByteLength > NADO_SUBACCOUNT_NAME_MAX_BYTES) {
|
|
42
|
-
throw new Error(
|
|
43
|
-
`Nado subaccount name must encode to \u2264 ${NADO_SUBACCOUNT_NAME_MAX_BYTES} bytes (got ${nameByteLength}: "${name}")`
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
return concat([
|
|
47
|
-
owner,
|
|
48
|
-
pad(nameHex, { dir: "right", size: NADO_SUBACCOUNT_NAME_MAX_BYTES })
|
|
49
|
-
]);
|
|
50
|
-
}
|
|
51
|
-
function createNadoDepositActions(config) {
|
|
52
|
-
const {
|
|
53
|
-
recipientAddress,
|
|
54
|
-
collateralTokenAddress,
|
|
55
|
-
productId,
|
|
56
|
-
subaccountName,
|
|
57
|
-
referralCode = NADO_NO_REFERRAL_CODE
|
|
58
|
-
} = config;
|
|
59
|
-
if (!recipientAddress) {
|
|
60
|
-
throw new Error("Please connect your wallet before starting a Nado deposit");
|
|
61
|
-
}
|
|
62
|
-
const collateral = getAddress(collateralTokenAddress);
|
|
63
|
-
const subaccount = buildNadoSubaccount(recipientAddress, subaccountName);
|
|
64
|
-
const depositCalldata = concat([
|
|
65
|
-
toFunctionSelector(
|
|
66
|
-
"depositCollateralWithReferral(bytes32,uint32,uint128,string)"
|
|
67
|
-
),
|
|
68
|
-
encodeAbiParameters(
|
|
69
|
-
[
|
|
70
|
-
{ type: "bytes32" },
|
|
71
|
-
{ type: "uint32" },
|
|
72
|
-
{ type: "uint256" },
|
|
73
|
-
{ type: "string" }
|
|
74
|
-
],
|
|
75
|
-
[subaccount, productId, AMOUNT_PLACEHOLDER, referralCode]
|
|
76
|
-
)
|
|
77
|
-
]);
|
|
78
|
-
return [
|
|
79
|
-
// MAX approve so the pull covers whatever balance actually arrived (the
|
|
80
|
-
// amount is only known at execution); the spender is Fun's own audited
|
|
81
|
-
// VaultDepositooor. No zero-first reset needed: Ink USDT0 uses plain OZ
|
|
82
|
-
// approve (verified), unlike legacy mainnet USDT.
|
|
83
|
-
{
|
|
84
|
-
contractAbi: erc20Abi,
|
|
85
|
-
contractAddress: collateral,
|
|
86
|
-
functionName: "approve",
|
|
87
|
-
functionArgs: [INK_VAULT_DEPOSITOR_ADDRESS, maxUint256]
|
|
88
|
-
},
|
|
89
|
-
// VaultDepositooor pulls the live balance, injects it over the
|
|
90
|
-
// placeholder, and calls the Endpoint. minAmountOut is 0 because the
|
|
91
|
-
// collateral passes through 1:1 (no vault rate to bound).
|
|
92
|
-
{
|
|
93
|
-
contractAbi: VAULT_DEPOSITOR_ABI,
|
|
94
|
-
contractAddress: INK_VAULT_DEPOSITOR_ADDRESS,
|
|
95
|
-
functionName: "deposit",
|
|
96
|
-
functionArgs: [collateral, NADO_ENDPOINT_ADDRESS, depositCalldata, 0n]
|
|
97
|
-
}
|
|
98
|
-
];
|
|
99
|
-
}
|
|
100
|
-
export {
|
|
101
|
-
INK_VAULT_DEPOSITOR_ADDRESS,
|
|
102
|
-
NADO_DEFAULT_SUBACCOUNT_NAME,
|
|
103
|
-
NADO_ENDPOINT_ADDRESS,
|
|
104
|
-
NADO_NO_REFERRAL_CODE,
|
|
105
|
-
buildNadoSubaccount,
|
|
106
|
-
createNadoDepositActions
|
|
107
|
-
};
|