@wheelx/widget 0.0.1
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/LICENSE +21 -0
- package/README.md +531 -0
- package/dist/WheelxBridgeSwapWidget.d.ts +6 -0
- package/dist/WheelxBridgeSwapWidget.d.ts.map +1 -0
- package/dist/WheelxBridgeSwapWidget.js +13 -0
- package/dist/WheelxBridgeSwapWidget.js.map +1 -0
- package/dist/WheelxWidgetProvider.d.ts +3 -0
- package/dist/WheelxWidgetProvider.d.ts.map +1 -0
- package/dist/WheelxWidgetProvider.js +9 -0
- package/dist/WheelxWidgetProvider.js.map +1 -0
- package/dist/config.d.ts +120 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +120 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/SelectTokenModal/AllChainsIcon.d.ts +2 -0
- package/dist/internal/SelectTokenModal/AllChainsIcon.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/AllChainsIcon.js +11 -0
- package/dist/internal/SelectTokenModal/AllChainsIcon.js.map +1 -0
- package/dist/internal/SelectTokenModal/DesktopContent.d.ts +33 -0
- package/dist/internal/SelectTokenModal/DesktopContent.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/DesktopContent.js +99 -0
- package/dist/internal/SelectTokenModal/DesktopContent.js.map +1 -0
- package/dist/internal/SelectTokenModal/FavoriteButton.d.ts +7 -0
- package/dist/internal/SelectTokenModal/FavoriteButton.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/FavoriteButton.js +25 -0
- package/dist/internal/SelectTokenModal/FavoriteButton.js.map +1 -0
- package/dist/internal/SelectTokenModal/FavoritesContext.d.ts +22 -0
- package/dist/internal/SelectTokenModal/FavoritesContext.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/FavoritesContext.js +125 -0
- package/dist/internal/SelectTokenModal/FavoritesContext.js.map +1 -0
- package/dist/internal/SelectTokenModal/MobileContent.d.ts +35 -0
- package/dist/internal/SelectTokenModal/MobileContent.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/MobileContent.js +150 -0
- package/dist/internal/SelectTokenModal/MobileContent.js.map +1 -0
- package/dist/internal/SelectTokenModal/Network.d.ts +13 -0
- package/dist/internal/SelectTokenModal/Network.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/Network.js +112 -0
- package/dist/internal/SelectTokenModal/Network.js.map +1 -0
- package/dist/internal/SelectTokenModal/SearchHistoryContext.d.ts +30 -0
- package/dist/internal/SelectTokenModal/SearchHistoryContext.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/SearchHistoryContext.js +144 -0
- package/dist/internal/SelectTokenModal/SearchHistoryContext.js.map +1 -0
- package/dist/internal/SelectTokenModal/SearchInput.d.ts +8 -0
- package/dist/internal/SelectTokenModal/SearchInput.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/SearchInput.js +34 -0
- package/dist/internal/SelectTokenModal/SearchInput.js.map +1 -0
- package/dist/internal/SelectTokenModal/TokenAndAddress.d.ts +11 -0
- package/dist/internal/SelectTokenModal/TokenAndAddress.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/TokenAndAddress.js +138 -0
- package/dist/internal/SelectTokenModal/TokenAndAddress.js.map +1 -0
- package/dist/internal/SelectTokenModal/TokenFavoriteButton.d.ts +7 -0
- package/dist/internal/SelectTokenModal/TokenFavoriteButton.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/TokenFavoriteButton.js +27 -0
- package/dist/internal/SelectTokenModal/TokenFavoriteButton.js.map +1 -0
- package/dist/internal/SelectTokenModal/TokenFavoritesContext.d.ts +30 -0
- package/dist/internal/SelectTokenModal/TokenFavoritesContext.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/TokenFavoritesContext.js +144 -0
- package/dist/internal/SelectTokenModal/TokenFavoritesContext.js.map +1 -0
- package/dist/internal/SelectTokenModal/TokenList.d.ts +16 -0
- package/dist/internal/SelectTokenModal/TokenList.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/TokenList.js +258 -0
- package/dist/internal/SelectTokenModal/TokenList.js.map +1 -0
- package/dist/internal/SelectTokenModal/hooks/index.d.ts +4 -0
- package/dist/internal/SelectTokenModal/hooks/index.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/hooks/index.js +4 -0
- package/dist/internal/SelectTokenModal/hooks/index.js.map +1 -0
- package/dist/internal/SelectTokenModal/hooks/useChainsAndTokensForSelect.d.ts +22 -0
- package/dist/internal/SelectTokenModal/hooks/useChainsAndTokensForSelect.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/hooks/useChainsAndTokensForSelect.js +180 -0
- package/dist/internal/SelectTokenModal/hooks/useChainsAndTokensForSelect.js.map +1 -0
- package/dist/internal/SelectTokenModal/hooks/useSearchTokens.d.ts +12 -0
- package/dist/internal/SelectTokenModal/hooks/useSearchTokens.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/hooks/useSearchTokens.js +71 -0
- package/dist/internal/SelectTokenModal/hooks/useSearchTokens.js.map +1 -0
- package/dist/internal/SelectTokenModal/hooks/useUserHasSelectedFromNetwork.d.ts +7 -0
- package/dist/internal/SelectTokenModal/hooks/useUserHasSelectedFromNetwork.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/hooks/useUserHasSelectedFromNetwork.js +6 -0
- package/dist/internal/SelectTokenModal/hooks/useUserHasSelectedFromNetwork.js.map +1 -0
- package/dist/internal/SelectTokenModal/index.d.ts +10 -0
- package/dist/internal/SelectTokenModal/index.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/index.js +274 -0
- package/dist/internal/SelectTokenModal/index.js.map +1 -0
- package/dist/internal/SelectTokenModal/storageUtils.d.ts +55 -0
- package/dist/internal/SelectTokenModal/storageUtils.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/storageUtils.js +216 -0
- package/dist/internal/SelectTokenModal/storageUtils.js.map +1 -0
- package/dist/internal/SelectTokenModal/utils.d.ts +16 -0
- package/dist/internal/SelectTokenModal/utils.d.ts.map +1 -0
- package/dist/internal/SelectTokenModal/utils.js +399 -0
- package/dist/internal/SelectTokenModal/utils.js.map +1 -0
- package/dist/internal/SwapAndBridge/DifferentAddressDialog.d.ts +13 -0
- package/dist/internal/SwapAndBridge/DifferentAddressDialog.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/DifferentAddressDialog.js +127 -0
- package/dist/internal/SwapAndBridge/DifferentAddressDialog.js.map +1 -0
- package/dist/internal/SwapAndBridge/FormBody.d.ts +10 -0
- package/dist/internal/SwapAndBridge/FormBody.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/FormBody.js +471 -0
- package/dist/internal/SwapAndBridge/FormBody.js.map +1 -0
- package/dist/internal/SwapAndBridge/FormButton.d.ts +19 -0
- package/dist/internal/SwapAndBridge/FormButton.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/FormButton.js +373 -0
- package/dist/internal/SwapAndBridge/FormButton.js.map +1 -0
- package/dist/internal/SwapAndBridge/FormTop.d.ts +11 -0
- package/dist/internal/SwapAndBridge/FormTop.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/FormTop.js +35 -0
- package/dist/internal/SwapAndBridge/FormTop.js.map +1 -0
- package/dist/internal/SwapAndBridge/MainForm.d.ts +26 -0
- package/dist/internal/SwapAndBridge/MainForm.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/MainForm.js +445 -0
- package/dist/internal/SwapAndBridge/MainForm.js.map +1 -0
- package/dist/internal/SwapAndBridge/SlippageSettings.d.ts +3 -0
- package/dist/internal/SwapAndBridge/SlippageSettings.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/SlippageSettings.js +121 -0
- package/dist/internal/SwapAndBridge/SlippageSettings.js.map +1 -0
- package/dist/internal/SwapAndBridge/Timer.d.ts +8 -0
- package/dist/internal/SwapAndBridge/Timer.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/Timer.js +53 -0
- package/dist/internal/SwapAndBridge/Timer.js.map +1 -0
- package/dist/internal/SwapAndBridge/TipsContent.d.ts +18 -0
- package/dist/internal/SwapAndBridge/TipsContent.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/TipsContent.js +217 -0
- package/dist/internal/SwapAndBridge/TipsContent.js.map +1 -0
- package/dist/internal/SwapAndBridge/TokenInfoCom.d.ts +7 -0
- package/dist/internal/SwapAndBridge/TokenInfoCom.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/TokenInfoCom.js +28 -0
- package/dist/internal/SwapAndBridge/TokenInfoCom.js.map +1 -0
- package/dist/internal/SwapAndBridge/TokenSelectAndInput.d.ts +18 -0
- package/dist/internal/SwapAndBridge/TokenSelectAndInput.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/TokenSelectAndInput.js +257 -0
- package/dist/internal/SwapAndBridge/TokenSelectAndInput.js.map +1 -0
- package/dist/internal/SwapAndBridge/TxInfo.d.ts +25 -0
- package/dist/internal/SwapAndBridge/TxInfo.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/TxInfo.js +101 -0
- package/dist/internal/SwapAndBridge/TxInfo.js.map +1 -0
- package/dist/internal/SwapAndBridge/TxState.d.ts +8 -0
- package/dist/internal/SwapAndBridge/TxState.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/TxState.js +371 -0
- package/dist/internal/SwapAndBridge/TxState.js.map +1 -0
- package/dist/internal/SwapAndBridge/animations/Failure.d.ts +3 -0
- package/dist/internal/SwapAndBridge/animations/Failure.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/animations/Failure.js +12 -0
- package/dist/internal/SwapAndBridge/animations/Failure.js.map +1 -0
- package/dist/internal/SwapAndBridge/animations/Success.d.ts +3 -0
- package/dist/internal/SwapAndBridge/animations/Success.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/animations/Success.js +12 -0
- package/dist/internal/SwapAndBridge/animations/Success.js.map +1 -0
- package/dist/internal/SwapAndBridge/animations/Wheel.d.ts +3 -0
- package/dist/internal/SwapAndBridge/animations/Wheel.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/animations/Wheel.js +12 -0
- package/dist/internal/SwapAndBridge/animations/Wheel.js.map +1 -0
- package/dist/internal/SwapAndBridge/animations/index.d.ts +4 -0
- package/dist/internal/SwapAndBridge/animations/index.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/animations/index.js +4 -0
- package/dist/internal/SwapAndBridge/animations/index.js.map +1 -0
- package/dist/internal/SwapAndBridge/hooks/index.d.ts +5 -0
- package/dist/internal/SwapAndBridge/hooks/index.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/hooks/index.js +5 -0
- package/dist/internal/SwapAndBridge/hooks/index.js.map +1 -0
- package/dist/internal/SwapAndBridge/hooks/useGuardChain.d.ts +5 -0
- package/dist/internal/SwapAndBridge/hooks/useGuardChain.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/hooks/useGuardChain.js +48 -0
- package/dist/internal/SwapAndBridge/hooks/useGuardChain.js.map +1 -0
- package/dist/internal/SwapAndBridge/hooks/useRefreshLoading.d.ts +5 -0
- package/dist/internal/SwapAndBridge/hooks/useRefreshLoading.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/hooks/useRefreshLoading.js +41 -0
- package/dist/internal/SwapAndBridge/hooks/useRefreshLoading.js.map +1 -0
- package/dist/internal/SwapAndBridge/hooks/useRetryAbleTransactionReceipt.d.ts +818 -0
- package/dist/internal/SwapAndBridge/hooks/useRetryAbleTransactionReceipt.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/hooks/useRetryAbleTransactionReceipt.js +69 -0
- package/dist/internal/SwapAndBridge/hooks/useRetryAbleTransactionReceipt.js.map +1 -0
- package/dist/internal/SwapAndBridge/hooks/useSwapAndBridgeContextStore.d.ts +52 -0
- package/dist/internal/SwapAndBridge/hooks/useSwapAndBridgeContextStore.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/hooks/useSwapAndBridgeContextStore.js +454 -0
- package/dist/internal/SwapAndBridge/hooks/useSwapAndBridgeContextStore.js.map +1 -0
- package/dist/internal/SwapAndBridge/hooks/useTokenBalance.d.ts +13 -0
- package/dist/internal/SwapAndBridge/hooks/useTokenBalance.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/hooks/useTokenBalance.js +11 -0
- package/dist/internal/SwapAndBridge/hooks/useTokenBalance.js.map +1 -0
- package/dist/internal/SwapAndBridge/hooks/useTxStateContextStore.d.ts +18 -0
- package/dist/internal/SwapAndBridge/hooks/useTxStateContextStore.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/hooks/useTxStateContextStore.js +22 -0
- package/dist/internal/SwapAndBridge/hooks/useTxStateContextStore.js.map +1 -0
- package/dist/internal/SwapAndBridge/utils/consts.d.ts +4 -0
- package/dist/internal/SwapAndBridge/utils/consts.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/utils/consts.js +4 -0
- package/dist/internal/SwapAndBridge/utils/consts.js.map +1 -0
- package/dist/internal/SwapAndBridge/utils/debounce.d.ts +2 -0
- package/dist/internal/SwapAndBridge/utils/debounce.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/utils/debounce.js +14 -0
- package/dist/internal/SwapAndBridge/utils/debounce.js.map +1 -0
- package/dist/internal/SwapAndBridge/utils/defaultData.d.ts +9 -0
- package/dist/internal/SwapAndBridge/utils/defaultData.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/utils/defaultData.js +71 -0
- package/dist/internal/SwapAndBridge/utils/defaultData.js.map +1 -0
- package/dist/internal/SwapAndBridge/utils/getErc20Approval.d.ts +17 -0
- package/dist/internal/SwapAndBridge/utils/getErc20Approval.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/utils/getErc20Approval.js +57 -0
- package/dist/internal/SwapAndBridge/utils/getErc20Approval.js.map +1 -0
- package/dist/internal/SwapAndBridge/utils/index.d.ts +16 -0
- package/dist/internal/SwapAndBridge/utils/index.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/utils/index.js +140 -0
- package/dist/internal/SwapAndBridge/utils/index.js.map +1 -0
- package/dist/internal/SwapAndBridge/utils/retry.d.ts +2 -0
- package/dist/internal/SwapAndBridge/utils/retry.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/utils/retry.js +33 -0
- package/dist/internal/SwapAndBridge/utils/retry.js.map +1 -0
- package/dist/internal/SwapAndBridge/utils/slippage.d.ts +3 -0
- package/dist/internal/SwapAndBridge/utils/slippage.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/utils/slippage.js +14 -0
- package/dist/internal/SwapAndBridge/utils/slippage.js.map +1 -0
- package/dist/internal/SwapAndBridge/utils/twoApprove.d.ts +47 -0
- package/dist/internal/SwapAndBridge/utils/twoApprove.d.ts.map +1 -0
- package/dist/internal/SwapAndBridge/utils/twoApprove.js +131 -0
- package/dist/internal/SwapAndBridge/utils/twoApprove.js.map +1 -0
- package/dist/internal/WidgetDataBootstrap.d.ts +3 -0
- package/dist/internal/WidgetDataBootstrap.d.ts.map +1 -0
- package/dist/internal/WidgetDataBootstrap.js +42 -0
- package/dist/internal/WidgetDataBootstrap.js.map +1 -0
- package/dist/internal/api/consts.d.ts +2 -0
- package/dist/internal/api/consts.d.ts.map +1 -0
- package/dist/internal/api/consts.js +8 -0
- package/dist/internal/api/consts.js.map +1 -0
- package/dist/internal/api/index.d.ts +8 -0
- package/dist/internal/api/index.d.ts.map +1 -0
- package/dist/internal/api/index.js +8 -0
- package/dist/internal/api/index.js.map +1 -0
- package/dist/internal/api/normalizeAssetUrl.d.ts +2 -0
- package/dist/internal/api/normalizeAssetUrl.d.ts.map +1 -0
- package/dist/internal/api/normalizeAssetUrl.js +15 -0
- package/dist/internal/api/normalizeAssetUrl.js.map +1 -0
- package/dist/internal/api/useChainsAndTokens.d.ts +61 -0
- package/dist/internal/api/useChainsAndTokens.d.ts.map +1 -0
- package/dist/internal/api/useChainsAndTokens.js +117 -0
- package/dist/internal/api/useChainsAndTokens.js.map +1 -0
- package/dist/internal/api/useGetQuote.d.ts +50 -0
- package/dist/internal/api/useGetQuote.d.ts.map +1 -0
- package/dist/internal/api/useGetQuote.js +41 -0
- package/dist/internal/api/useGetQuote.js.map +1 -0
- package/dist/internal/api/useHyperliquid.d.ts +8 -0
- package/dist/internal/api/useHyperliquid.d.ts.map +1 -0
- package/dist/internal/api/useHyperliquid.js +40 -0
- package/dist/internal/api/useHyperliquid.js.map +1 -0
- package/dist/internal/api/useIntervalGetOrderDetail.d.ts +602 -0
- package/dist/internal/api/useIntervalGetOrderDetail.d.ts.map +1 -0
- package/dist/internal/api/useIntervalGetOrderDetail.js +70 -0
- package/dist/internal/api/useIntervalGetOrderDetail.js.map +1 -0
- package/dist/internal/api/useTokenBalance.d.ts +55 -0
- package/dist/internal/api/useTokenBalance.d.ts.map +1 -0
- package/dist/internal/api/useTokenBalance.js +29 -0
- package/dist/internal/api/useTokenBalance.js.map +1 -0
- package/dist/internal/api/useTokenInfo.d.ts +53 -0
- package/dist/internal/api/useTokenInfo.d.ts.map +1 -0
- package/dist/internal/api/useTokenInfo.js +38 -0
- package/dist/internal/api/useTokenInfo.js.map +1 -0
- package/dist/internal/api/useUsdPrice.d.ts +13 -0
- package/dist/internal/api/useUsdPrice.d.ts.map +1 -0
- package/dist/internal/api/useUsdPrice.js +18 -0
- package/dist/internal/api/useUsdPrice.js.map +1 -0
- package/dist/internal/assets/icons/ai.svg +7 -0
- package/dist/internal/assets/icons/all2.svg +6 -0
- package/dist/internal/assets/icons/arrow-down.svg +4 -0
- package/dist/internal/assets/icons/arrow-fill-right.svg +5 -0
- package/dist/internal/assets/icons/arrow-right.svg +6 -0
- package/dist/internal/assets/icons/back.svg +5 -0
- package/dist/internal/assets/icons/close.svg +9 -0
- package/dist/internal/assets/icons/date.svg +9 -0
- package/dist/internal/assets/icons/ding.svg +1 -0
- package/dist/internal/assets/icons/info.svg +7 -0
- package/dist/internal/assets/icons/liked.svg +6 -0
- package/dist/internal/assets/icons/link.svg +8 -0
- package/dist/internal/assets/icons/metamask.svg +36 -0
- package/dist/internal/assets/icons/money.svg +14 -0
- package/dist/internal/assets/icons/plus.svg +5 -0
- package/dist/internal/assets/icons/router.svg +10 -0
- package/dist/internal/assets/icons/search-history.svg +6 -0
- package/dist/internal/assets/icons/search.svg +6 -0
- package/dist/internal/assets/icons/settings.svg +7 -0
- package/dist/internal/assets/icons/stab.svg +6 -0
- package/dist/internal/assets/icons/stock.svg +12 -0
- package/dist/internal/assets/icons/switch.svg +6 -0
- package/dist/internal/assets/icons/time.svg +12 -0
- package/dist/internal/assets/icons/wallet.svg +8 -0
- package/dist/internal/assets/images/ai_bot.gif +0 -0
- package/dist/internal/assets/images/default-token-icon.png +0 -0
- package/dist/internal/assets/images/error.png +0 -0
- package/dist/internal/assets/images/gas.png +0 -0
- package/dist/internal/assets/images/jth.png +0 -0
- package/dist/internal/assets/images/loader.png +0 -0
- package/dist/internal/assets/images/nabox.svg +1 -0
- package/dist/internal/assets/images/networks/1.png +0 -0
- package/dist/internal/assets/images/networks/42161.png +0 -0
- package/dist/internal/assets/images/networks/56.png +0 -0
- package/dist/internal/assets/images/networks/8453.png +0 -0
- package/dist/internal/assets/images/no_data.png +0 -0
- package/dist/internal/assets/images/success-sprites.png +0 -0
- package/dist/internal/assets/images/switch.png +0 -0
- package/dist/internal/assets/images/tokens/eth.png +0 -0
- package/dist/internal/assets/images/verified.png +0 -0
- package/dist/internal/assets/images/wheel-sprites.png +0 -0
- package/dist/internal/commons/TokenAmountHeading.d.ts +11 -0
- package/dist/internal/commons/TokenAmountHeading.d.ts.map +1 -0
- package/dist/internal/commons/TokenAmountHeading.js +20 -0
- package/dist/internal/commons/TokenAmountHeading.js.map +1 -0
- package/dist/internal/commons/TokenAmountText.d.ts +11 -0
- package/dist/internal/commons/TokenAmountText.d.ts.map +1 -0
- package/dist/internal/commons/TokenAmountText.js +20 -0
- package/dist/internal/commons/TokenAmountText.js.map +1 -0
- package/dist/internal/commons/TokenIconWithNetworkLogo.d.ts +15 -0
- package/dist/internal/commons/TokenIconWithNetworkLogo.d.ts.map +1 -0
- package/dist/internal/commons/TokenIconWithNetworkLogo.js +28 -0
- package/dist/internal/commons/TokenIconWithNetworkLogo.js.map +1 -0
- package/dist/internal/commons/index.d.ts +4 -0
- package/dist/internal/commons/index.d.ts.map +1 -0
- package/dist/internal/commons/index.js +4 -0
- package/dist/internal/commons/index.js.map +1 -0
- package/dist/internal/commons/utils.d.ts +29 -0
- package/dist/internal/commons/utils.d.ts.map +1 -0
- package/dist/internal/commons/utils.js +100 -0
- package/dist/internal/commons/utils.js.map +1 -0
- package/dist/internal/consts/chainsCatalog.d.ts +8 -0
- package/dist/internal/consts/chainsCatalog.d.ts.map +1 -0
- package/dist/internal/consts/chainsCatalog.js +116 -0
- package/dist/internal/consts/chainsCatalog.js.map +1 -0
- package/dist/internal/consts/chainsInfo.d.ts +2 -0
- package/dist/internal/consts/chainsInfo.d.ts.map +1 -0
- package/dist/internal/consts/chainsInfo.js +3 -0
- package/dist/internal/consts/chainsInfo.js.map +1 -0
- package/dist/internal/consts/giwa.d.ts +46 -0
- package/dist/internal/consts/giwa.d.ts.map +1 -0
- package/dist/internal/consts/giwa.js +30 -0
- package/dist/internal/consts/giwa.js.map +1 -0
- package/dist/internal/consts/hyperevm.d.ts +46 -0
- package/dist/internal/consts/hyperevm.d.ts.map +1 -0
- package/dist/internal/consts/hyperevm.js +30 -0
- package/dist/internal/consts/hyperevm.js.map +1 -0
- package/dist/internal/consts/index.d.ts +2 -0
- package/dist/internal/consts/index.d.ts.map +1 -0
- package/dist/internal/consts/index.js +2 -0
- package/dist/internal/consts/index.js.map +1 -0
- package/dist/internal/consts/katana.d.ts +46 -0
- package/dist/internal/consts/katana.d.ts.map +1 -0
- package/dist/internal/consts/katana.js +30 -0
- package/dist/internal/consts/katana.js.map +1 -0
- package/dist/internal/consts/mainnet.d.ts +50 -0
- package/dist/internal/consts/mainnet.d.ts.map +1 -0
- package/dist/internal/consts/mainnet.js +39 -0
- package/dist/internal/consts/mainnet.js.map +1 -0
- package/dist/internal/consts/megaeth.d.ts +46 -0
- package/dist/internal/consts/megaeth.d.ts.map +1 -0
- package/dist/internal/consts/megaeth.js +30 -0
- package/dist/internal/consts/megaeth.js.map +1 -0
- package/dist/internal/consts/metis.d.ts +47 -0
- package/dist/internal/consts/metis.d.ts.map +1 -0
- package/dist/internal/consts/metis.js +43 -0
- package/dist/internal/consts/metis.js.map +1 -0
- package/dist/internal/consts/monad.d.ts +51 -0
- package/dist/internal/consts/monad.d.ts.map +1 -0
- package/dist/internal/consts/monad.js +36 -0
- package/dist/internal/consts/monad.js.map +1 -0
- package/dist/internal/consts/plasma.d.ts +46 -0
- package/dist/internal/consts/plasma.d.ts.map +1 -0
- package/dist/internal/consts/plasma.js +30 -0
- package/dist/internal/consts/plasma.js.map +1 -0
- package/dist/internal/consts/polygonZkEvm.d.ts +46 -0
- package/dist/internal/consts/polygonZkEvm.d.ts.map +1 -0
- package/dist/internal/consts/polygonZkEvm.js +25 -0
- package/dist/internal/consts/polygonZkEvm.js.map +1 -0
- package/dist/internal/consts/rari.d.ts +46 -0
- package/dist/internal/consts/rari.d.ts.map +1 -0
- package/dist/internal/consts/rari.js +30 -0
- package/dist/internal/consts/rari.js.map +1 -0
- package/dist/internal/consts/stable.d.ts +46 -0
- package/dist/internal/consts/stable.d.ts.map +1 -0
- package/dist/internal/consts/stable.js +30 -0
- package/dist/internal/consts/stable.js.map +1 -0
- package/dist/internal/consts/stabletestnet.d.ts +46 -0
- package/dist/internal/consts/stabletestnet.d.ts.map +1 -0
- package/dist/internal/consts/stabletestnet.js +30 -0
- package/dist/internal/consts/stabletestnet.js.map +1 -0
- package/dist/internal/consts/tempo.d.ts +41 -0
- package/dist/internal/consts/tempo.d.ts.map +1 -0
- package/dist/internal/consts/tempo.js +30 -0
- package/dist/internal/consts/tempo.js.map +1 -0
- package/dist/internal/providers/ClientProviders.d.ts +4 -0
- package/dist/internal/providers/ClientProviders.d.ts.map +1 -0
- package/dist/internal/providers/ClientProviders.js +25 -0
- package/dist/internal/providers/ClientProviders.js.map +1 -0
- package/dist/internal/providers/nabox.d.ts +6 -0
- package/dist/internal/providers/nabox.d.ts.map +1 -0
- package/dist/internal/providers/nabox.js +59 -0
- package/dist/internal/providers/nabox.js.map +1 -0
- package/dist/internal/providers/wagmi.d.ts +3 -0
- package/dist/internal/providers/wagmi.d.ts.map +1 -0
- package/dist/internal/providers/wagmi.js +89 -0
- package/dist/internal/providers/wagmi.js.map +1 -0
- package/dist/internal/stores/index.d.ts +3 -0
- package/dist/internal/stores/index.d.ts.map +1 -0
- package/dist/internal/stores/index.js +3 -0
- package/dist/internal/stores/index.js.map +1 -0
- package/dist/internal/stores/useChainsStore.d.ts +15 -0
- package/dist/internal/stores/useChainsStore.d.ts.map +1 -0
- package/dist/internal/stores/useChainsStore.js +12 -0
- package/dist/internal/stores/useChainsStore.js.map +1 -0
- package/dist/internal/stores/useDifferentAddressStore.d.ts +9 -0
- package/dist/internal/stores/useDifferentAddressStore.d.ts.map +1 -0
- package/dist/internal/stores/useDifferentAddressStore.js +8 -0
- package/dist/internal/stores/useDifferentAddressStore.js.map +1 -0
- package/dist/internal/ui/BoxWithBg.d.ts +4 -0
- package/dist/internal/ui/BoxWithBg.d.ts.map +1 -0
- package/dist/internal/ui/BoxWithBg.js +6 -0
- package/dist/internal/ui/BoxWithBg.js.map +1 -0
- package/dist/internal/ui/WidgetAnimationsGlobalStyle.d.ts +2 -0
- package/dist/internal/ui/WidgetAnimationsGlobalStyle.d.ts.map +1 -0
- package/dist/internal/ui/WidgetAnimationsGlobalStyle.js +312 -0
- package/dist/internal/ui/WidgetAnimationsGlobalStyle.js.map +1 -0
- package/dist/internal/ui/color-mode.d.ts +22 -0
- package/dist/internal/ui/color-mode.d.ts.map +1 -0
- package/dist/internal/ui/color-mode.js +44 -0
- package/dist/internal/ui/color-mode.js.map +1 -0
- package/dist/internal/ui/componentRecipes/button.d.ts +123 -0
- package/dist/internal/ui/componentRecipes/button.d.ts.map +1 -0
- package/dist/internal/ui/componentRecipes/button.js +101 -0
- package/dist/internal/ui/componentRecipes/button.js.map +1 -0
- package/dist/internal/ui/componentRecipes/heading.d.ts +53 -0
- package/dist/internal/ui/componentRecipes/heading.d.ts.map +1 -0
- package/dist/internal/ui/componentRecipes/heading.js +54 -0
- package/dist/internal/ui/componentRecipes/heading.js.map +1 -0
- package/dist/internal/ui/componentRecipes/index.d.ts +4 -0
- package/dist/internal/ui/componentRecipes/index.d.ts.map +1 -0
- package/dist/internal/ui/componentRecipes/index.js +4 -0
- package/dist/internal/ui/componentRecipes/index.js.map +1 -0
- package/dist/internal/ui/componentRecipes/text.d.ts +4 -0
- package/dist/internal/ui/componentRecipes/text.d.ts.map +1 -0
- package/dist/internal/ui/componentRecipes/text.js +59 -0
- package/dist/internal/ui/componentRecipes/text.js.map +1 -0
- package/dist/internal/ui/index.d.ts +2 -0
- package/dist/internal/ui/index.d.ts.map +1 -0
- package/dist/internal/ui/index.js +2 -0
- package/dist/internal/ui/index.js.map +1 -0
- package/dist/internal/ui/provider.d.ts +5 -0
- package/dist/internal/ui/provider.d.ts.map +1 -0
- package/dist/internal/ui/provider.js +9 -0
- package/dist/internal/ui/provider.js.map +1 -0
- package/dist/internal/ui/theme.d.ts +2 -0
- package/dist/internal/ui/theme.d.ts.map +1 -0
- package/dist/internal/ui/theme.js +53 -0
- package/dist/internal/ui/theme.js.map +1 -0
- package/dist/internal/ui/toaster.d.ts +8 -0
- package/dist/internal/ui/toaster.d.ts.map +1 -0
- package/dist/internal/ui/toaster.js +19 -0
- package/dist/internal/ui/toaster.js.map +1 -0
- package/dist/internal/ui/tooltip.d.ts +17 -0
- package/dist/internal/ui/tooltip.d.ts.map +1 -0
- package/dist/internal/ui/tooltip.js +17 -0
- package/dist/internal/ui/tooltip.js.map +1 -0
- package/dist/internal/utils/address.d.ts +2 -0
- package/dist/internal/utils/address.d.ts.map +1 -0
- package/dist/internal/utils/address.js +9 -0
- package/dist/internal/utils/address.js.map +1 -0
- package/dist/internal/utils/consts.d.ts +2 -0
- package/dist/internal/utils/consts.d.ts.map +1 -0
- package/dist/internal/utils/consts.js +2 -0
- package/dist/internal/utils/consts.js.map +1 -0
- package/dist/internal/utils/format.d.ts +12 -0
- package/dist/internal/utils/format.d.ts.map +1 -0
- package/dist/internal/utils/format.js +72 -0
- package/dist/internal/utils/format.js.map +1 -0
- package/dist/internal/utils/getAssetSrc.d.ts +6 -0
- package/dist/internal/utils/getAssetSrc.d.ts.map +1 -0
- package/dist/internal/utils/getAssetSrc.js +4 -0
- package/dist/internal/utils/getAssetSrc.js.map +1 -0
- package/dist/internal/utils/getTxLink.d.ts +4 -0
- package/dist/internal/utils/getTxLink.d.ts.map +1 -0
- package/dist/internal/utils/getTxLink.js +17 -0
- package/dist/internal/utils/getTxLink.js.map +1 -0
- package/dist/internal/utils/index.d.ts +16 -0
- package/dist/internal/utils/index.d.ts.map +1 -0
- package/dist/internal/utils/index.js +33 -0
- package/dist/internal/utils/index.js.map +1 -0
- package/dist/internal/utils/localstorage.d.ts +14 -0
- package/dist/internal/utils/localstorage.d.ts.map +1 -0
- package/dist/internal/utils/localstorage.js +54 -0
- package/dist/internal/utils/localstorage.js.map +1 -0
- package/dist/internal/utils/logger.d.ts +8 -0
- package/dist/internal/utils/logger.d.ts.map +1 -0
- package/dist/internal/utils/logger.js +34 -0
- package/dist/internal/utils/logger.js.map +1 -0
- package/dist/internal/utils/shortLinkRegex.d.ts +8 -0
- package/dist/internal/utils/shortLinkRegex.d.ts.map +1 -0
- package/dist/internal/utils/shortLinkRegex.js +18 -0
- package/dist/internal/utils/shortLinkRegex.js.map +1 -0
- package/package.json +81 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 WheelX
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
# `@wheelx/widget`
|
|
2
|
+
|
|
3
|
+
WheelX swap / bridge widget extracted as a reusable package.
|
|
4
|
+
|
|
5
|
+
This package currently lives at the root of the `wheelx-kit-ui` repository.
|
|
6
|
+
|
|
7
|
+
This package is designed for host applications that want to embed WheelX's
|
|
8
|
+
bridge and swap experience with minimal setup while still keeping control over:
|
|
9
|
+
|
|
10
|
+
- allowed source and destination networks
|
|
11
|
+
- default selected tokens
|
|
12
|
+
- token restrictions per chain
|
|
13
|
+
- visual styles and typography
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
This package is currently consumed from a local path during development.
|
|
18
|
+
|
|
19
|
+
If you are using it from another local project:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm add @wheelx/widget@file:/absolute/path/to/wheelx-kit-ui
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Example:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm add @wheelx/widget@file:/path/to/wheelx-kit-ui
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Build the package locally when needed:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pnpm build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Local Demo
|
|
38
|
+
|
|
39
|
+
This repository includes a standalone Next.js demo in `demo/`.
|
|
40
|
+
|
|
41
|
+
Install dependencies for the package and the demo from the repository root:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pnpm install
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Run the demo:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pnpm demo:dev
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Build the demo:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pnpm demo:build
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Environment
|
|
60
|
+
|
|
61
|
+
The package defaults to production endpoints:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
NEXT_PUBLIC_API_URL=https://api.wheelx.fi
|
|
65
|
+
NEXT_PUBLIC_APP_DOMAIN=https://wheelx.fi
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
If you want to override them locally, create:
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
.env.local
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
You can start from:
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
.env.example
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Requirements
|
|
81
|
+
|
|
82
|
+
- `Next.js >= 15`
|
|
83
|
+
- `React 19`
|
|
84
|
+
- `react-dom 19`
|
|
85
|
+
|
|
86
|
+
The widget currently depends on Next.js runtime APIs, so the host application
|
|
87
|
+
should be Next.js-based.
|
|
88
|
+
|
|
89
|
+
If your host app does not already include RainbowKit styles, add this once in
|
|
90
|
+
your root layout or global entry:
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
import '@rainbow-me/rainbowkit/styles.css'
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`WheelxWidgetProvider` already includes the wallet-related providers required by
|
|
97
|
+
the widget. If your host application wants a wallet connect button, render your
|
|
98
|
+
own UI in the host app, for example with RainbowKit's `ConnectButton`.
|
|
99
|
+
|
|
100
|
+
## Quick Start
|
|
101
|
+
|
|
102
|
+
The smallest working integration is:
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
'use client'
|
|
106
|
+
|
|
107
|
+
import {
|
|
108
|
+
WheelxBridgeSwapWidget,
|
|
109
|
+
WheelxWidgetProvider
|
|
110
|
+
} from '@wheelx/widget'
|
|
111
|
+
|
|
112
|
+
export default function Page() {
|
|
113
|
+
return (
|
|
114
|
+
<WheelxWidgetProvider>
|
|
115
|
+
<WheelxBridgeSwapWidget />
|
|
116
|
+
</WheelxWidgetProvider>
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Basic Usage With Config
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
'use client'
|
|
125
|
+
|
|
126
|
+
import {
|
|
127
|
+
WheelxBridgeSwapWidget,
|
|
128
|
+
WheelxWidgetProvider,
|
|
129
|
+
type WheelxWidgetConfig
|
|
130
|
+
} from '@wheelx/widget'
|
|
131
|
+
|
|
132
|
+
const config: WheelxWidgetConfig = {
|
|
133
|
+
mode: 'bridge-and-swap',
|
|
134
|
+
networks: {
|
|
135
|
+
from: [1, 8453, 10],
|
|
136
|
+
to: [8453, 10, 137]
|
|
137
|
+
},
|
|
138
|
+
defaultTokens: {
|
|
139
|
+
from: {
|
|
140
|
+
chainId: 8453,
|
|
141
|
+
address: '0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2',
|
|
142
|
+
symbol: 'USDT'
|
|
143
|
+
},
|
|
144
|
+
to: {
|
|
145
|
+
chainId: 8453,
|
|
146
|
+
address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
|
|
147
|
+
symbol: 'USDC'
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export default function Page() {
|
|
153
|
+
return (
|
|
154
|
+
<WheelxWidgetProvider>
|
|
155
|
+
<WheelxBridgeSwapWidget config={config} />
|
|
156
|
+
</WheelxWidgetProvider>
|
|
157
|
+
)
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## What The Widget Supports
|
|
162
|
+
|
|
163
|
+
### 1. Bridge + Swap Mode
|
|
164
|
+
|
|
165
|
+
Default mode:
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
mode: 'bridge-and-swap'
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
This allows:
|
|
172
|
+
|
|
173
|
+
- same-chain swap
|
|
174
|
+
- cross-chain bridge
|
|
175
|
+
- cross-chain swap
|
|
176
|
+
|
|
177
|
+
### 2. Swap-Only Mode
|
|
178
|
+
|
|
179
|
+
```ts
|
|
180
|
+
mode: 'swap'
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Behavior:
|
|
184
|
+
|
|
185
|
+
- the widget enforces same-chain selection
|
|
186
|
+
- the token modal hides the left chain list
|
|
187
|
+
- clicking `From` or `To` only shows tokens for the currently selected chain
|
|
188
|
+
|
|
189
|
+
### 3. Network Restriction
|
|
190
|
+
|
|
191
|
+
You can allow all networks, a single network, or a subset per side.
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
networks: {
|
|
195
|
+
from: 'all',
|
|
196
|
+
to: [8453, 10]
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Accepted formats:
|
|
201
|
+
|
|
202
|
+
- `'all'`
|
|
203
|
+
- `number`
|
|
204
|
+
- `number[]`
|
|
205
|
+
|
|
206
|
+
### 4. Default Token Selection
|
|
207
|
+
|
|
208
|
+
You can define the initial `from` and `to` token:
|
|
209
|
+
|
|
210
|
+
```ts
|
|
211
|
+
defaultTokens: {
|
|
212
|
+
from: {
|
|
213
|
+
chainId: 8453,
|
|
214
|
+
address: '0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2',
|
|
215
|
+
symbol: 'USDT'
|
|
216
|
+
},
|
|
217
|
+
to: {
|
|
218
|
+
chainId: 8453,
|
|
219
|
+
address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
|
|
220
|
+
symbol: 'USDC'
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Notes:
|
|
226
|
+
|
|
227
|
+
- defaults are applied once during widget initialization
|
|
228
|
+
- URL presets take precedence over `defaultTokens`
|
|
229
|
+
- in swap-only mode, same-chain behavior is still enforced after defaults apply
|
|
230
|
+
- if a default token falls outside `networks` or `allowedTokens`, the widget will
|
|
231
|
+
fall back to the nearest valid option
|
|
232
|
+
|
|
233
|
+
### 5. Token Restriction Per Chain
|
|
234
|
+
|
|
235
|
+
You can restrict selectable tokens by chain.
|
|
236
|
+
|
|
237
|
+
The widget will use the intersection of:
|
|
238
|
+
|
|
239
|
+
- tokens returned by the backend API
|
|
240
|
+
- tokens declared in `allowedTokens`
|
|
241
|
+
|
|
242
|
+
If you configure a token address that does not exist in the API response, it is
|
|
243
|
+
silently ignored.
|
|
244
|
+
|
|
245
|
+
```ts
|
|
246
|
+
allowedTokens: {
|
|
247
|
+
from: [
|
|
248
|
+
{
|
|
249
|
+
chainId: 8453,
|
|
250
|
+
tokens: [
|
|
251
|
+
'0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2',
|
|
252
|
+
'0x0000000000000000000000000000000000000000'
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
to: [
|
|
257
|
+
{
|
|
258
|
+
chainId: 8453,
|
|
259
|
+
tokens: ['0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913']
|
|
260
|
+
}
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Important behavior:
|
|
266
|
+
|
|
267
|
+
- restrictions are chain-scoped
|
|
268
|
+
- if you only configure chain `8453`, other allowed chains remain unrestricted
|
|
269
|
+
- address comparison is case-insensitive
|
|
270
|
+
|
|
271
|
+
### 6. Built-In Branding
|
|
272
|
+
|
|
273
|
+
The widget includes a fixed `Powered by WheelX.fi` footer link inside the card.
|
|
274
|
+
|
|
275
|
+
This branding is built into the widget and is not exposed as a configuration
|
|
276
|
+
option.
|
|
277
|
+
|
|
278
|
+
## Customization
|
|
279
|
+
|
|
280
|
+
The widget does not currently support render overrides for internal components.
|
|
281
|
+
Customization is done through the `styles` field using Chakra-style props.
|
|
282
|
+
|
|
283
|
+
```tsx
|
|
284
|
+
const config: WheelxWidgetConfig = {
|
|
285
|
+
styles: {
|
|
286
|
+
formContainer: {
|
|
287
|
+
bg: '#FFFFFF',
|
|
288
|
+
borderRadius: '24px',
|
|
289
|
+
boxShadow: '0 12px 36px rgba(0, 0, 0, 0.12)'
|
|
290
|
+
},
|
|
291
|
+
primaryButton: {
|
|
292
|
+
borderRadius: '999px'
|
|
293
|
+
},
|
|
294
|
+
formTitleText: {
|
|
295
|
+
color: '#7C2D12',
|
|
296
|
+
fontFamily: 'Georgia, serif',
|
|
297
|
+
fontWeight: 900
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
## Style Slots
|
|
304
|
+
|
|
305
|
+
### Container Slots
|
|
306
|
+
|
|
307
|
+
- `formContainer`
|
|
308
|
+
- `sectionContainer`
|
|
309
|
+
- `tokenSelector`
|
|
310
|
+
- `amountInputContainer`
|
|
311
|
+
- `tokenModalContent`
|
|
312
|
+
- `tokenModalChainPanel`
|
|
313
|
+
- `tokenModalTokenPanel`
|
|
314
|
+
- `quoteInfoContainer`
|
|
315
|
+
- `quoteInfoCard`
|
|
316
|
+
- `txStateCard`
|
|
317
|
+
- `txStateRouteContainer`
|
|
318
|
+
- `txStateSummaryContainer`
|
|
319
|
+
- `txStateTokenCard`
|
|
320
|
+
|
|
321
|
+
### Typography Slots
|
|
322
|
+
|
|
323
|
+
- `formTitleText`
|
|
324
|
+
- `sectionLabelText`
|
|
325
|
+
- `tokenPrimaryText`
|
|
326
|
+
- `tokenSecondaryText`
|
|
327
|
+
- `balanceText`
|
|
328
|
+
- `amountInputText`
|
|
329
|
+
- `amountUsdText`
|
|
330
|
+
- `primaryButtonText`
|
|
331
|
+
- `tokenModalTitleText`
|
|
332
|
+
- `tokenModalSectionLabelText`
|
|
333
|
+
- `tokenModalChainText`
|
|
334
|
+
- `tokenModalTokenPrimaryText`
|
|
335
|
+
- `tokenModalTokenSecondaryText`
|
|
336
|
+
- `tokenModalCategoryTabText`
|
|
337
|
+
- `slippageTitleText`
|
|
338
|
+
- `slippageDescriptionText`
|
|
339
|
+
- `slippageButtonText`
|
|
340
|
+
- `quoteInfoLabel`
|
|
341
|
+
- `quoteInfoValue`
|
|
342
|
+
- `txStateLabel`
|
|
343
|
+
- `txStateValue`
|
|
344
|
+
|
|
345
|
+
### Button / State Slots
|
|
346
|
+
|
|
347
|
+
- `primaryButton`
|
|
348
|
+
- `primaryButtonLoading`
|
|
349
|
+
- `primaryButtonWarning`
|
|
350
|
+
- `quickHalfButton`
|
|
351
|
+
- `quickMaxButton`
|
|
352
|
+
- `slippageSettingsTrigger`
|
|
353
|
+
- `slippageAutoButton`
|
|
354
|
+
- `slippageCustomInput`
|
|
355
|
+
- `txStatePrimaryButton`
|
|
356
|
+
- `quoteInfoFreeBadge`
|
|
357
|
+
|
|
358
|
+
### Token Modal Slots
|
|
359
|
+
|
|
360
|
+
- `tokenModalSearchInput`
|
|
361
|
+
- `tokenModalChainRow`
|
|
362
|
+
- `tokenModalChainRowHover`
|
|
363
|
+
- `tokenModalChainRowActive`
|
|
364
|
+
- `tokenModalChainsWithAssetsRow`
|
|
365
|
+
- `tokenModalChainsWithAssetsRowActive`
|
|
366
|
+
- `tokenModalTokenRow`
|
|
367
|
+
- `tokenModalTokenRowHover`
|
|
368
|
+
- `tokenModalCategoryTab`
|
|
369
|
+
- `tokenModalCategoryTabActive`
|
|
370
|
+
|
|
371
|
+
### Status Slots
|
|
372
|
+
|
|
373
|
+
- `txStateStatusLink`
|
|
374
|
+
- `txStateStatusError`
|
|
375
|
+
- `txStateStatusWarning`
|
|
376
|
+
- `txStateStatusProgress`
|
|
377
|
+
|
|
378
|
+
## Common Integration Examples
|
|
379
|
+
|
|
380
|
+
### Swap Only On Base
|
|
381
|
+
|
|
382
|
+
```ts
|
|
383
|
+
const config: WheelxWidgetConfig = {
|
|
384
|
+
mode: 'swap',
|
|
385
|
+
networks: {
|
|
386
|
+
from: 8453,
|
|
387
|
+
to: 8453
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### Restrict From/To To Different Network Sets
|
|
393
|
+
|
|
394
|
+
```ts
|
|
395
|
+
const config: WheelxWidgetConfig = {
|
|
396
|
+
networks: {
|
|
397
|
+
from: [1, 8453],
|
|
398
|
+
to: [10, 137, 8453]
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### Restrict Only One Chain's Tokens
|
|
404
|
+
|
|
405
|
+
```ts
|
|
406
|
+
const config: WheelxWidgetConfig = {
|
|
407
|
+
networks: {
|
|
408
|
+
from: [1, 8453],
|
|
409
|
+
to: [1, 8453]
|
|
410
|
+
},
|
|
411
|
+
allowedTokens: {
|
|
412
|
+
from: [
|
|
413
|
+
{
|
|
414
|
+
chainId: 8453,
|
|
415
|
+
tokens: [
|
|
416
|
+
'0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2'
|
|
417
|
+
]
|
|
418
|
+
}
|
|
419
|
+
]
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
Behavior:
|
|
425
|
+
|
|
426
|
+
- Base `from` tokens are restricted to the configured list
|
|
427
|
+
- Ethereum `from` tokens remain available
|
|
428
|
+
|
|
429
|
+
### Visual Theming
|
|
430
|
+
|
|
431
|
+
```ts
|
|
432
|
+
const config: WheelxWidgetConfig = {
|
|
433
|
+
styles: {
|
|
434
|
+
formContainer: {
|
|
435
|
+
bg: '#FFF7ED',
|
|
436
|
+
border: '3px solid',
|
|
437
|
+
borderColor: '#EA580C'
|
|
438
|
+
},
|
|
439
|
+
tokenSelector: {
|
|
440
|
+
bg: '#DCFCE7',
|
|
441
|
+
border: '2px solid',
|
|
442
|
+
borderColor: '#16A34A'
|
|
443
|
+
},
|
|
444
|
+
primaryButton: {
|
|
445
|
+
bg: 'linear-gradient(90deg, #111827 0%, #1E3A8A 100%)',
|
|
446
|
+
color: '#FFFFFF'
|
|
447
|
+
},
|
|
448
|
+
tokenModalTokenRowHover: {
|
|
449
|
+
bg: '#DBEAFE'
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
## API Reference
|
|
456
|
+
|
|
457
|
+
### `WheelxWidgetProvider`
|
|
458
|
+
|
|
459
|
+
Wrap the widget with this provider once at the host app integration point.
|
|
460
|
+
|
|
461
|
+
```tsx
|
|
462
|
+
<WheelxWidgetProvider>
|
|
463
|
+
<WheelxBridgeSwapWidget />
|
|
464
|
+
</WheelxWidgetProvider>
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
### `WheelxBridgeSwapWidget`
|
|
468
|
+
|
|
469
|
+
Props:
|
|
470
|
+
|
|
471
|
+
```ts
|
|
472
|
+
interface WheelxBridgeSwapWidgetProps {
|
|
473
|
+
config?: WheelxWidgetConfig
|
|
474
|
+
}
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
### `WheelxWidgetConfig`
|
|
478
|
+
|
|
479
|
+
```ts
|
|
480
|
+
interface WheelxWidgetConfig {
|
|
481
|
+
mode?: 'bridge-and-swap' | 'swap'
|
|
482
|
+
networks?: {
|
|
483
|
+
from?: 'all' | number | number[]
|
|
484
|
+
to?: 'all' | number | number[]
|
|
485
|
+
}
|
|
486
|
+
defaultTokens?: {
|
|
487
|
+
from?: {
|
|
488
|
+
chainId: number
|
|
489
|
+
address: string
|
|
490
|
+
symbol?: string
|
|
491
|
+
}
|
|
492
|
+
to?: {
|
|
493
|
+
chainId: number
|
|
494
|
+
address: string
|
|
495
|
+
symbol?: string
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
allowedTokens?: {
|
|
499
|
+
from?: Array<{
|
|
500
|
+
chainId: number
|
|
501
|
+
tokens: string[]
|
|
502
|
+
}>
|
|
503
|
+
to?: Array<{
|
|
504
|
+
chainId: number
|
|
505
|
+
tokens: string[]
|
|
506
|
+
}>
|
|
507
|
+
}
|
|
508
|
+
styles?: WidgetStyleOverrides
|
|
509
|
+
}
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
## Demo
|
|
513
|
+
|
|
514
|
+
This repository includes a local Next.js demo in:
|
|
515
|
+
|
|
516
|
+
```text
|
|
517
|
+
demo/
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
Install and run it with:
|
|
521
|
+
|
|
522
|
+
```bash
|
|
523
|
+
pnpm --dir demo install
|
|
524
|
+
pnpm --dir demo dev
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
The demo uses the package through:
|
|
528
|
+
|
|
529
|
+
```text
|
|
530
|
+
@wheelx/widget -> file:..
|
|
531
|
+
```
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { WheelxWidgetConfig } from './config';
|
|
2
|
+
export interface WheelxBridgeSwapWidgetProps {
|
|
3
|
+
config?: WheelxWidgetConfig;
|
|
4
|
+
}
|
|
5
|
+
export declare function WheelxBridgeSwapWidget({ config }: WheelxBridgeSwapWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=WheelxBridgeSwapWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WheelxBridgeSwapWidget.d.ts","sourceRoot":"","sources":["../src/WheelxBridgeSwapWidget.tsx"],"names":[],"mappings":"AAQA,OAAO,EACL,kBAAkB,EAEnB,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,2BAA2B;IAC1C,MAAM,CAAC,EAAE,kBAAkB,CAAA;CAC5B;AAED,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACP,EAAE,2BAA2B,2CAgB7B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { VStack } from '@chakra-ui/react';
|
|
4
|
+
import { MainForm } from './internal/SwapAndBridge/MainForm';
|
|
5
|
+
import { FavoritesProvider } from './internal/SelectTokenModal/FavoritesContext';
|
|
6
|
+
import { TokenFavoritesProvider } from './internal/SelectTokenModal/TokenFavoritesContext';
|
|
7
|
+
import { TokenSearchHistoryProvider } from './internal/SelectTokenModal/SearchHistoryContext';
|
|
8
|
+
import { WidgetDataBootstrap } from './internal/WidgetDataBootstrap';
|
|
9
|
+
import { WheelxWidgetConfigProvider } from './config';
|
|
10
|
+
export function WheelxBridgeSwapWidget({ config }) {
|
|
11
|
+
return (_jsx(WheelxWidgetConfigProvider, { config: config, children: _jsx(WidgetDataBootstrap, { children: _jsx(FavoritesProvider, { children: _jsx(TokenFavoritesProvider, { children: _jsx(TokenSearchHistoryProvider, { children: _jsx(VStack, { gap: 0, children: _jsx(MainForm, {}) }) }) }) }) }) }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=WheelxBridgeSwapWidget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WheelxBridgeSwapWidget.js","sourceRoot":"","sources":["../src/WheelxBridgeSwapWidget.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAA;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kDAAkD,CAAA;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAEL,0BAA0B,EAC3B,MAAM,UAAU,CAAA;AAMjB,MAAM,UAAU,sBAAsB,CAAC,EACrC,MAAM,EACsB;IAC5B,OAAO,CACL,KAAC,0BAA0B,IAAC,MAAM,EAAE,MAAM,YACxC,KAAC,mBAAmB,cAClB,KAAC,iBAAiB,cAChB,KAAC,sBAAsB,cACrB,KAAC,0BAA0B,cACzB,KAAC,MAAM,IAAC,GAAG,EAAE,CAAC,YACZ,KAAC,QAAQ,KAAG,GACL,GACkB,GACN,GACP,GACA,GACK,CAC9B,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WheelxWidgetProvider.d.ts","sourceRoot":"","sources":["../src/WheelxWidgetProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAMzC,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAOnE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Provider } from './internal/ui/provider';
|
|
4
|
+
import { ClientProviders } from './internal/providers/ClientProviders';
|
|
5
|
+
import { WidgetAnimationsGlobalStyle } from './internal/ui/WidgetAnimationsGlobalStyle';
|
|
6
|
+
export function WheelxWidgetProvider({ children }) {
|
|
7
|
+
return (_jsxs(Provider, { children: [_jsx(WidgetAnimationsGlobalStyle, {}), _jsx(ClientProviders, { children: children })] }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=WheelxWidgetProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WheelxWidgetProvider.js","sourceRoot":"","sources":["../src/WheelxWidgetProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAIZ,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAA;AAEvF,MAAM,UAAU,oBAAoB,CAAC,EAAE,QAAQ,EAAqB;IAClE,OAAO,CACL,MAAC,QAAQ,eACP,KAAC,2BAA2B,KAAG,EAC/B,KAAC,eAAe,cAAE,QAAQ,GAAmB,IACpC,CACZ,CAAA;AACH,CAAC"}
|