From 733036629ee764dea72e27682109b0b1f3bd5449 Mon Sep 17 00:00:00 2001 From: corbanbrook Date: Tue, 17 Dec 2024 17:20:29 +0000 Subject: [PATCH] Build: (7fe369c) Wallet fee options (#217) * WIP * Check for collection logo image * Make collection detail view image loader match container width * Disable back button in conformation screen * Add missing border radius for collection detail list item * Update fee option hook to allow last registered handler to be triggered * Show txn pending state in confirmation view * Fix zeroAddress and null case for native token fee option * Remove unnecessary id * Remove logs * Update transaction confirmation and fee option UIs --- ...owser-external_commonjs-proxy-DCQ1jgJw.js} | 2 +- ...rowser-C6tFLLwW.js => browser-BsrK5m4C.js} | 2 +- assets/{ccip-0UZ9SbL0.js => ccip-BMO0LA0d.js} | 2 +- .../{index-IIZ_s-is.js => index-BjN8zAHE.js} | 6 +- .../{index-IZV5kIPU.js => index-C1SjSLmA.js} | 408 +++++++++++++----- .../{index-DEv_Qz7e.js => index-DF20gIsG.js} | 2 +- .../{index-CeftjqzJ.js => index-DiRSBp0V.js} | 4 +- .../{index-BJPxxmWB.js => index-Dlx0r4Hc.js} | 6 +- ...ex.es-CpB3hItG.js => index.es-oHTfwTsx.js} | 8 +- ...k-Cdu3ocn7.js => metamask-sdk-CrAgzNC4.js} | 4 +- index.html | 2 +- 11 files changed, 326 insertions(+), 120 deletions(-) rename assets/{___vite-browser-external_commonjs-proxy-xBtFqy5O.js => ___vite-browser-external_commonjs-proxy-DCQ1jgJw.js} (99%) rename assets/{browser-C6tFLLwW.js => browser-BsrK5m4C.js} (99%) rename assets/{ccip-0UZ9SbL0.js => ccip-BMO0LA0d.js} (99%) rename assets/{index-IIZ_s-is.js => index-BjN8zAHE.js} (99%) rename assets/{index-IZV5kIPU.js => index-C1SjSLmA.js} (99%) rename assets/{index-DEv_Qz7e.js => index-DF20gIsG.js} (99%) rename assets/{index-CeftjqzJ.js => index-DiRSBp0V.js} (99%) rename assets/{index-BJPxxmWB.js => index-Dlx0r4Hc.js} (99%) rename assets/{index.es-CpB3hItG.js => index.es-oHTfwTsx.js} (99%) rename assets/{metamask-sdk-Cdu3ocn7.js => metamask-sdk-CrAgzNC4.js} (99%) diff --git a/assets/___vite-browser-external_commonjs-proxy-xBtFqy5O.js b/assets/___vite-browser-external_commonjs-proxy-DCQ1jgJw.js similarity index 99% rename from assets/___vite-browser-external_commonjs-proxy-xBtFqy5O.js rename to assets/___vite-browser-external_commonjs-proxy-DCQ1jgJw.js index a1f2a0bb..cf4b5f9c 100644 --- a/assets/___vite-browser-external_commonjs-proxy-xBtFqy5O.js +++ b/assets/___vite-browser-external_commonjs-proxy-DCQ1jgJw.js @@ -1,4 +1,4 @@ -import { a as getAugmentedNamespace, h as dist, g as getDefaultExportFromCjs } from "./index-IZV5kIPU.js"; +import { a as getAugmentedNamespace, h as dist, g as getDefaultExportFromCjs } from "./index-C1SjSLmA.js"; const require$$0$1 = /* @__PURE__ */ getAugmentedNamespace(dist); var inherits_browser = { exports: {} }; if (typeof Object.create === "function") { diff --git a/assets/browser-C6tFLLwW.js b/assets/browser-BsrK5m4C.js similarity index 99% rename from assets/browser-C6tFLLwW.js rename to assets/browser-BsrK5m4C.js index 3ef3b46d..47b9e208 100644 --- a/assets/browser-C6tFLLwW.js +++ b/assets/browser-BsrK5m4C.js @@ -1,4 +1,4 @@ -import { p as process$1, g as getDefaultExportFromCjs } from "./index-IZV5kIPU.js"; +import { p as process$1, g as getDefaultExportFromCjs } from "./index-C1SjSLmA.js"; var browser = { exports: {} }; var ms; var hasRequiredMs; diff --git a/assets/ccip-0UZ9SbL0.js b/assets/ccip-BMO0LA0d.js similarity index 99% rename from assets/ccip-0UZ9SbL0.js rename to assets/ccip-BMO0LA0d.js index 45fb16ad..05b81e59 100644 --- a/assets/ccip-0UZ9SbL0.js +++ b/assets/ccip-BMO0LA0d.js @@ -1,4 +1,4 @@ -import { i as BaseError, j as getUrl, k as stringify, l as decodeErrorResult, m as isAddressEqual, o as call, q as concat, r as encodeAbiParameters, H as HttpRequestError, u as isHex } from "./index-IZV5kIPU.js"; +import { i as BaseError, j as getUrl, k as stringify, l as decodeErrorResult, m as isAddressEqual, o as call, q as concat, r as encodeAbiParameters, H as HttpRequestError, u as isHex } from "./index-C1SjSLmA.js"; class OffchainLookupError extends BaseError { constructor({ callbackSelector, cause, data, extraData, sender, urls }) { var _a; diff --git a/assets/index-IIZ_s-is.js b/assets/index-BjN8zAHE.js similarity index 99% rename from assets/index-IIZ_s-is.js rename to assets/index-BjN8zAHE.js index 9b4addc3..6e34ef50 100644 --- a/assets/index-IIZ_s-is.js +++ b/assets/index-BjN8zAHE.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CeftjqzJ.js","./index-IZV5kIPU.js","./index-g_cLYwVj.css"])))=>i.map(i=>d[i]); -import { B as Buffer, _ as __vitePreload } from "./index-IZV5kIPU.js"; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DiRSBp0V.js","./index-C1SjSLmA.js","./index-g_cLYwVj.css"])))=>i.map(i=>d[i]); +import { B as Buffer, _ as __vitePreload } from "./index-C1SjSLmA.js"; const t = Symbol(); const s = Object.getPrototypeOf, c = /* @__PURE__ */ new WeakMap(), l = (e) => e && (c.has(e) ? c.get(e) : s(e) === Object.prototype || s(e) === Array.prototype), y = (e) => l(e) && e[t] || null, h = (e, t2 = true) => { c.set(e, t2); @@ -789,7 +789,7 @@ class WalletConnectModal { } async initUi() { if (typeof window !== "undefined") { - await __vitePreload(() => import("./index-CeftjqzJ.js"), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url); + await __vitePreload(() => import("./index-DiRSBp0V.js"), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url); const modal = document.createElement("wcm-modal"); document.body.insertAdjacentElement("beforeend", modal); OptionsCtrl.setIsUiLoaded(true); diff --git a/assets/index-IZV5kIPU.js b/assets/index-C1SjSLmA.js similarity index 99% rename from assets/index-IZV5kIPU.js rename to assets/index-C1SjSLmA.js index b6840358..5480f035 100644 --- a/assets/index-IZV5kIPU.js +++ b/assets/index-C1SjSLmA.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DEv_Qz7e.js","./hooks.module-C1UUl86a.js","./index-BJPxxmWB.js","./___vite-browser-external_commonjs-proxy-xBtFqy5O.js","./browser-C6tFLLwW.js","./metamask-sdk-Cdu3ocn7.js","./index.es-CpB3hItG.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DF20gIsG.js","./hooks.module-C1UUl86a.js","./index-Dlx0r4Hc.js","./___vite-browser-external_commonjs-proxy-DCQ1jgJw.js","./browser-BsrK5m4C.js","./metamask-sdk-CrAgzNC4.js","./index.es-oHTfwTsx.js"])))=>i.map(i=>d[i]); var __defProp = Object.defineProperty; var __typeError = (msg) => { throw TypeError(msg); @@ -32949,7 +32949,7 @@ async function call(client2, args) { } catch (err2) { const data2 = getRevertErrorData(err2); const { offchainLookup, offchainLookupSignature } = await __vitePreload(async () => { - const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import("./ccip-0UZ9SbL0.js"); + const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import("./ccip-BMO0LA0d.js"); return { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 }; }, true ? [] : void 0, import.meta.url); if (client2.ccipRead !== false && (data2 == null ? void 0 : data2.slice(0, 10)) === offchainLookupSignature && to) @@ -97684,7 +97684,12 @@ class SequenceWaasProvider extends AbstractProvider { if (id2 !== confirmation.id) { throw new UserRejectedRequestError(new Error("User confirmation ids do not match")); } - selectedFeeOption = feeOptions2.find((feeOption) => feeOption.token.contractAddress === confirmation.feeTokenAddress); + selectedFeeOption = feeOptions2.find((feeOption) => { + if (confirmation.feeTokenAddress === zeroAddress && feeOption.token.contractAddress === null) { + return true; + } + return feeOption.token.contractAddress === confirmation.feeTokenAddress; + }); } if (this.requestConfirmationHandler && this.showConfirmation) { const id2 = v4(); @@ -100200,7 +100205,7 @@ function version4(parameters) { }; })(); const { createCoinbaseWalletSDK } = await __vitePreload(async () => { - const { createCoinbaseWalletSDK: createCoinbaseWalletSDK2 } = await import("./index-DEv_Qz7e.js"); + const { createCoinbaseWalletSDK: createCoinbaseWalletSDK2 } = await import("./index-DF20gIsG.js"); return { createCoinbaseWalletSDK: createCoinbaseWalletSDK2 }; }, true ? __vite__mapDeps([0,1]) : void 0, import.meta.url); const sdk = createCoinbaseWalletSDK({ @@ -100375,7 +100380,7 @@ function version3(parameters) { if (!walletProvider) { const CoinbaseWalletSDK = await (async () => { const { default: SDK } = await __vitePreload(async () => { - const { default: SDK2 } = await import("./index-BJPxxmWB.js").then((n2) => n2.i); + const { default: SDK2 } = await import("./index-Dlx0r4Hc.js").then((n2) => n2.i); return { default: SDK2 }; }, true ? __vite__mapDeps([2,3,1,4]) : void 0, import.meta.url); if (typeof SDK !== "function" && typeof SDK.default === "function") @@ -100615,7 +100620,7 @@ function metaMask$1(parameters = {}) { var _a2; const MetaMaskSDK = await (async () => { const { default: SDK } = await __vitePreload(async () => { - const { default: SDK2 } = await import("./metamask-sdk-Cdu3ocn7.js"); + const { default: SDK2 } = await import("./metamask-sdk-CrAgzNC4.js"); return { default: SDK2 }; }, true ? __vite__mapDeps([5,4]) : void 0, import.meta.url); if (typeof SDK !== "function" && typeof SDK.default === "function") @@ -100973,7 +100978,7 @@ function walletConnect$1(parameters) { if (!optionalChains.length) return; const { EthereumProvider } = await __vitePreload(async () => { - const { EthereumProvider: EthereumProvider2 } = await import("./index.es-CpB3hItG.js"); + const { EthereumProvider: EthereumProvider2 } = await import("./index.es-oHTfwTsx.js"); return { EthereumProvider: EthereumProvider2 }; }, true ? __vite__mapDeps([6,3]) : void 0, import.meta.url); return await EthereumProvider.init({ @@ -101769,44 +101774,64 @@ const useWalletSettings = () => { setDisplayedAssets }; }; -let _pendingFeeConfirmation; function useWaasFeeOptions() { var _a2; const connections = useConnections(); const waasConnector = (_a2 = connections.find((c2) => c2.connector.id.includes("waas"))) == null ? void 0 : _a2.connector; const [pendingFeeOptionConfirmation, setPendingFeeOptionConfirmation] = reactExports.useState(); + const pendingConfirmationRef = reactExports.useRef(); function confirmPendingFeeOption(id2, feeTokenAddress) { - _pendingFeeConfirmation == null ? void 0 : _pendingFeeConfirmation.resolve({ id: id2, feeTokenAddress, confirmed: true }); - setPendingFeeOptionConfirmation(void 0); - _pendingFeeConfirmation = void 0; + if (pendingConfirmationRef.current) { + pendingConfirmationRef.current.resolve({ id: id2, feeTokenAddress, confirmed: true }); + setPendingFeeOptionConfirmation(void 0); + pendingConfirmationRef.current = void 0; + } } function rejectPendingFeeOption(id2) { - _pendingFeeConfirmation == null ? void 0 : _pendingFeeConfirmation.resolve({ id: id2, feeTokenAddress: void 0, confirmed: false }); - setPendingFeeOptionConfirmation(void 0); - _pendingFeeConfirmation = void 0; + if (pendingConfirmationRef.current) { + pendingConfirmationRef.current.resolve({ id: id2, feeTokenAddress: void 0, confirmed: false }); + setPendingFeeOptionConfirmation(void 0); + pendingConfirmationRef.current = void 0; + } } reactExports.useEffect(() => { - async function setup() { - if (!waasConnector) { - return; - } - const waasProvider = waasConnector.sequenceWaasProvider; - if (!waasProvider) { - return; - } - waasProvider.feeConfirmationHandler = { - confirmFeeOption(id2, options, txs, chainId) { - const pending = new Deferred(); - setPendingFeeOptionConfirmation({ id: id2, options, chainId }); - _pendingFeeConfirmation = pending; - return pending.promise; - } - }; + if (!waasConnector) { + return; } - setup(); - }); + const waasProvider = waasConnector.sequenceWaasProvider; + if (!waasProvider) { + return; + } + const originalHandler = waasProvider.feeConfirmationHandler; + waasProvider.feeConfirmationHandler = { + confirmFeeOption(id2, options, txs, chainId) { + const pending = new Deferred(); + pendingConfirmationRef.current = pending; + setPendingFeeOptionConfirmation({ id: id2, options, chainId }); + return pending.promise; + } + }; + return () => { + waasProvider.feeConfirmationHandler = originalHandler; + }; + }, [waasConnector]); return [pendingFeeOptionConfirmation, confirmPendingFeeOption, rejectPendingFeeOption]; } +function useCheckWaasFeeOptions() { + var _a2; + const connections = useConnections(); + const waasConnector = (_a2 = connections.find((c2) => c2.connector.id.includes("waas"))) == null ? void 0 : _a2.connector; + return async ({ transactions: transactions2, chainId }) => { + if (!waasConnector) { + throw new Error("WaaS connector not found"); + } + const waasProvider = waasConnector.sequenceWaasProvider; + if (!waasProvider) { + throw new Error("WaaS provider not found"); + } + return waasProvider.checkTransactionFeeOptions({ transactions: transactions2, chainId }); + }; +} const createGenericContext$1 = () => { const genericContext = reactExports.createContext(void 0); const useGenericContext = () => { @@ -110112,9 +110137,99 @@ const SendItemInfo = ({ imageUrl, name: name2, decimals, balance, symbol, fiatVa const balanceDisplayed = formatDisplay(formattedBalance); return jsxRuntimeExports$1.jsxs(Box, { alignItems: "flex-end", justifyContent: "space-between", children: [jsxRuntimeExports$1.jsxs(Box, { justifyContent: "space-between", alignItems: "center", gap: "2", children: [showSquareImage ? jsxRuntimeExports$1.jsx(Box, { style: { width: "40px" }, children: jsxRuntimeExports$1.jsx(CollectibleTileImage, { imageUrl }) }) : jsxRuntimeExports$1.jsx(TokenImage, { src: imageUrl, size: "lg" }), jsxRuntimeExports$1.jsxs(Box, { flexDirection: "column", alignItems: "flex-start", children: [jsxRuntimeExports$1.jsxs(Box, { flexDirection: "row", alignItems: "center", gap: "1", children: [jsxRuntimeExports$1.jsx(Text, { variant: "medium", color: "text100", children: name2 }), jsxRuntimeExports$1.jsx(NetworkImage, { chainId, size: "xs" })] }), jsxRuntimeExports$1.jsxs(Text, { color: "text50", variant: "normal", children: [" ", `${balanceDisplayed} ${symbol} available`] })] })] }), jsxRuntimeExports$1.jsx(Box, { flexDirection: "column", alignItems: "flex-end", justifyContent: "flex-end", children: fiatValue && jsxRuntimeExports$1.jsx(Text, { variant: "normal", color: "text100", children: `${fiatCurrency.sign}${fiatValue}` }) })] }); }; +const Alert$1 = ({ title, description: description2, secondaryDescription, variant, buttonProps, children }) => { + return jsxRuntimeExports$1.jsx(Box, { borderRadius: "md", background: variant, children: jsxRuntimeExports$1.jsxs(Box, { background: "backgroundOverlay", borderRadius: "md", paddingX: { sm: "4", md: "5" }, paddingY: "4", width: "full", flexDirection: "column", gap: "3", children: [jsxRuntimeExports$1.jsxs(Box, { width: "full", flexDirection: { sm: "column", md: "row" }, gap: "2", justifyContent: "space-between", children: [jsxRuntimeExports$1.jsxs(Box, { flexDirection: "column", gap: "1", children: [jsxRuntimeExports$1.jsx(Text, { variant: "normal", color: "text100", fontWeight: "medium", children: title }), jsxRuntimeExports$1.jsx(Text, { variant: "normal", color: "text50", fontWeight: "medium", children: description2 }), secondaryDescription && jsxRuntimeExports$1.jsx(Text, { variant: "normal", color: "text80", fontWeight: "medium", children: secondaryDescription })] }), buttonProps ? jsxRuntimeExports$1.jsx(Box, { background: variant, borderRadius: "sm", width: "min", height: "min", children: jsxRuntimeExports$1.jsx(Button, { variant: "emphasis", shape: "square", flexShrink: "0", ...buttonProps }) }) : null] }), children] }) }); +}; +const isBalanceSufficient = (balance, fee, decimals) => { + const balanceBN = parseUnits$2(balance, decimals); + const feeBN = parseUnits$2(fee, decimals); + return balanceBN >= feeBN; +}; +const FeeOptionSelector = ({ txnFeeOptions, feeOptionBalances, selectedFeeOptionAddress, setSelectedFeeOptionAddress }) => { + const [feeOptionAlert, setFeeOptionAlert] = React.useState(); + const sortedOptions = [...txnFeeOptions].sort((a2, b2) => { + const balanceA = feeOptionBalances.find((balance) => balance.tokenName === a2.token.name); + const balanceB = feeOptionBalances.find((balance) => balance.tokenName === b2.token.name); + const isSufficientA = balanceA ? isBalanceSufficient(balanceA.balance, a2.value, a2.token.decimals || 0) : false; + const isSufficientB = balanceB ? isBalanceSufficient(balanceB.balance, b2.value, b2.token.decimals || 0) : false; + return isSufficientA === isSufficientB ? 0 : isSufficientA ? -1 : 1; + }); + return jsxRuntimeExports$1.jsxs(Box, { marginTop: "3", width: "full", children: [jsxRuntimeExports$1.jsx(Text, { variant: "normal", color: "text100", fontWeight: "bold", children: "Select a fee option" }), jsxRuntimeExports$1.jsx(Box, { flexDirection: "column", marginTop: "2", gap: "2", children: sortedOptions.map((option, index2) => { + const isSelected = selectedFeeOptionAddress === (option.token.contractAddress ?? ZeroAddress); + const balance = feeOptionBalances.find((b2) => b2.tokenName === option.token.name); + const isSufficient = isBalanceSufficient((balance == null ? void 0 : balance.balance) || "0", option.value, option.token.decimals || 0); + return jsxRuntimeExports$1.jsx(Box, { paddingX: "3", paddingY: "2", borderRadius: "md", borderColor: isSelected ? "borderFocus" : "transparent", borderWidth: "thick", borderStyle: "solid", background: "backgroundRaised", onClick: () => { + if (isSufficient) { + setSelectedFeeOptionAddress(option.token.contractAddress ?? ZeroAddress); + setFeeOptionAlert(void 0); + } else { + setFeeOptionAlert({ + title: `Insufficient ${option.token.name} balance`, + description: `Please select another fee option or add funds to your wallet.`, + variant: "warning" + }); + } + }, cursor: isSufficient ? "pointer" : "default", opacity: isSufficient ? "100" : "50", children: jsxRuntimeExports$1.jsxs(Box, { flexDirection: "row", justifyContent: "space-between", alignItems: "center", children: [jsxRuntimeExports$1.jsxs(Box, { flexDirection: "row", alignItems: "center", gap: "2", children: [jsxRuntimeExports$1.jsx(TokenImage, { src: option.token.logoURL, symbol: option.token.name }), jsxRuntimeExports$1.jsxs(Box, { flexDirection: "column", children: [jsxRuntimeExports$1.jsx(Text, { variant: "small", color: "text100", fontWeight: "bold", children: option.token.name }), jsxRuntimeExports$1.jsxs(Text, { variant: "xsmall", color: "text80", children: ["Fee:", " ", parseFloat(formatUnits$1(BigInt(option.value), option.token.decimals || 0)).toLocaleString(void 0, { + maximumFractionDigits: 6 + })] })] })] }), jsxRuntimeExports$1.jsxs(Box, { flexDirection: "column", alignItems: "flex-end", children: [jsxRuntimeExports$1.jsx(Text, { variant: "xsmall", color: "text80", children: "Balance:" }), jsxRuntimeExports$1.jsx(Text, { variant: "xsmall", color: "text100", children: parseFloat(formatUnits$1(BigInt((balance == null ? void 0 : balance.balance) || "0"), option.token.decimals || 0)).toLocaleString(void 0, { maximumFractionDigits: 6 }) })] })] }) }, index2); + }) }), jsxRuntimeExports$1.jsx(Box, { marginTop: "3", alignItems: "flex-end", justifyContent: "center", flexDirection: "column", children: feeOptionAlert && jsxRuntimeExports$1.jsx(Box, { marginTop: "3", children: jsxRuntimeExports$1.jsx(Alert$1, { title: feeOptionAlert.title, description: feeOptionAlert.description, secondaryDescription: feeOptionAlert.secondaryDescription, variant: feeOptionAlert.variant }) }) })] }); +}; +const useFeeOptionBalances = (feeOptions2, chainId) => { + var _a2; + const { address: accountAddress } = useAccount(); + const indexerClient = useIndexerClient(chainId); + return useQuery$1({ + queryKey: ["feeOptionBalances", chainId, accountAddress, (_a2 = feeOptions2 == null ? void 0 : feeOptions2.options) == null ? void 0 : _a2.length], + queryFn: async () => { + if (!(feeOptions2 == null ? void 0 : feeOptions2.options) || !accountAddress || !indexerClient) + return []; + const nativeTokenBalance = await indexerClient.getEtherBalance({ + accountAddress + }); + const tokenBalances = await indexerClient.getTokenBalances({ + accountAddress + }); + return feeOptions2.options.map((option) => { + var _a3; + if (option.token.contractAddress === null) { + return { + tokenName: option.token.name, + decimals: option.token.decimals || 0, + balance: nativeTokenBalance.balance.balanceWei + }; + } else { + return { + tokenName: option.token.name, + decimals: option.token.decimals || 0, + balance: ((_a3 = tokenBalances.balances.find((b2) => { + var _a4; + return b2.contractAddress.toLowerCase() === ((_a4 = option.token.contractAddress) == null ? void 0 : _a4.toLowerCase()); + })) == null ? void 0 : _a3.balance) || "0" + }; + } + }); + }, + enabled: Boolean((feeOptions2 == null ? void 0 : feeOptions2.options) && accountAddress && indexerClient), + refetchInterval: 1e4, + staleTime: 1e4 + }); +}; +const TransactionConfirmation = ({ name: name2, symbol, imageUrl, amount, toAddress, showSquareImage, fiatValue, chainId, balance, decimals, feeOptions: feeOptions2, onSelectFeeOption, isLoading, onConfirm, onCancel }) => { + var _a2; + const [selectedFeeOptionAddress, setSelectedFeeOptionAddress] = reactExports.useState(); + const { data: feeOptionBalances = [] } = useFeeOptionBalances(feeOptions2, chainId); + const handleFeeOptionSelect = (address) => { + setSelectedFeeOptionAddress(address); + onSelectFeeOption == null ? void 0 : onSelectFeeOption(address); + }; + const isFeeSelectionRequired = Boolean((_a2 = feeOptions2 == null ? void 0 : feeOptions2.options) == null ? void 0 : _a2.length); + const isConfirmDisabled = isFeeSelectionRequired && !selectedFeeOptionAddress; + return jsxRuntimeExports$1.jsx(Box, { width: "full", height: "full", display: "flex", alignItems: "center", justifyContent: "center", background: "backgroundPrimary", children: jsxRuntimeExports$1.jsxs(Box, { gap: "2", flexDirection: "column", background: "backgroundPrimary", width: "full", children: [jsxRuntimeExports$1.jsxs(Box, { background: "backgroundSecondary", borderRadius: "md", padding: "4", paddingBottom: "3", gap: "2", flexDirection: "column", children: [jsxRuntimeExports$1.jsx(SendItemInfo, { imageUrl, showSquareImage, name: name2, symbol, chainId, balance, decimals }), jsxRuntimeExports$1.jsxs(Box, { marginTop: "2", gap: "1", flexDirection: "column", children: [jsxRuntimeExports$1.jsx(Text, { variant: "small", color: "text50", children: "Amount" }), jsxRuntimeExports$1.jsxs(Box, { flexDirection: "row", alignItems: "center", gap: "2", children: [jsxRuntimeExports$1.jsxs(Text, { variant: "normal", color: "text100", children: [amount, " ", symbol] }), fiatValue && jsxRuntimeExports$1.jsxs(Text, { variant: "small", color: "text50", children: ["~$", fiatValue] })] })] }), jsxRuntimeExports$1.jsxs(Box, { marginTop: "2", gap: "1", flexDirection: "column", children: [jsxRuntimeExports$1.jsx(Text, { variant: "small", color: "text50", children: "To" }), jsxRuntimeExports$1.jsx(Card, { width: "full", flexDirection: "row", alignItems: "center", style: { height: "52px" }, children: jsxRuntimeExports$1.jsxs(Box, { flexDirection: "row", justifyContent: "center", alignItems: "center", gap: "2", children: [jsxRuntimeExports$1.jsx(GradientAvatar, { address: toAddress, style: { width: "20px" } }), jsxRuntimeExports$1.jsx(Text, { color: "text100", variant: "normal", children: `0x${truncateAtMiddle(toAddress.substring(2), 10)}` })] }) })] }), isFeeSelectionRequired && (feeOptions2 == null ? void 0 : feeOptions2.options) && jsxRuntimeExports$1.jsx(FeeOptionSelector, { txnFeeOptions: feeOptions2.options, feeOptionBalances, selectedFeeOptionAddress, setSelectedFeeOptionAddress: handleFeeOptionSelect })] }), jsxRuntimeExports$1.jsx(Box, { marginTop: "3", gap: "2", children: isLoading ? jsxRuntimeExports$1.jsx(Box, { width: "full", style: { height: "52px" }, alignItems: "center", justifyContent: "center", children: jsxRuntimeExports$1.jsx(Spinner, {}) }) : jsxRuntimeExports$1.jsxs(jsxRuntimeExports$1.Fragment, { children: [jsxRuntimeExports$1.jsx(Button, { width: "full", variant: "primary", onClick: onConfirm, label: "Confirm", rightIcon: SvgChevronRightIcon, disabled: isConfirmDisabled, style: { height: "52px", borderRadius: vars.radii.md } }), jsxRuntimeExports$1.jsx(Button, { variant: "glass", width: "full", onClick: onCancel, label: "Cancel", style: { height: "52px", borderRadius: vars.radii.md } })] }) })] }) }); +}; const SendCoin = ({ chainId, contractAddress }) => { var _a2, _b2, _c2, _d2, _e2; const { setNavigation } = useNavigation(); + const { setIsBackButtonEnabled } = useNavigationContext(); const { analytics } = useAnalyticsContext(); const { chains: chains2 } = useConfig(); const connectedChainId = useChainId(); @@ -110129,6 +110244,12 @@ const SendCoin = ({ chainId, contractAddress }) => { const [toAddress, setToAddress] = reactExports.useState(""); const { sendTransaction: sendTransaction2 } = useSendTransaction(); const [isSendTxnPending, setIsSendTxnPending] = reactExports.useState(false); + const [showConfirmation, setShowConfirmation] = reactExports.useState(false); + const [feeOptions2, setFeeOptions] = reactExports.useState(); + const [isCheckingFeeOptions, setIsCheckingFeeOptions] = reactExports.useState(false); + const [selectedFeeTokenAddress, setSelectedFeeTokenAddress] = reactExports.useState(null); + const checkFeeOptions = useCheckWaasFeeOptions(); + const [pendingFeeOption, confirmFeeOption, rejectFeeOption] = useWaasFeeOptions(); const { data: balances = [], isPending: isPendingBalances } = useBalances({ chainIds: [chainId], accountAddress, @@ -110144,6 +110265,14 @@ const SendCoin = ({ chainId, contractAddress }) => { ]); const { data: conversionRate = 1, isPending: isPendingConversionRate } = useExchangeRate(fiatCurrency.symbol); const isPending = isPendingBalances || isPendingCoinPrices || isPendingConversionRate; + reactExports.useEffect(() => { + if (pendingFeeOption && selectedFeeTokenAddress !== null) { + confirmFeeOption(pendingFeeOption.id, selectedFeeTokenAddress); + } + }, [pendingFeeOption, selectedFeeTokenAddress]); + reactExports.useEffect(() => { + setIsBackButtonEnabled(!showConfirmation); + }, [showConfirmation, setIsBackButtonEnabled]); if (isPending) { return null; } @@ -110183,45 +110312,68 @@ const SendCoin = ({ chainId, contractAddress }) => { const handleToAddressClear = () => { setToAddress(""); }; - const executeTransaction = async (e2) => { - var _a3, _b3; + const handleSendClick = async (e2) => { + e2.preventDefault(); + setIsCheckingFeeOptions(true); + const sendAmount = parseUnits$2(amountToSendFormatted, decimals); + let transaction2; + if (isNativeCoin) { + transaction2 = { + to: toAddress, + value: BigInt(sendAmount.toString()) + }; + } else { + transaction2 = { + to: tokenBalance == null ? void 0 : tokenBalance.contractAddress, + data: new Interface(ERC_20_ABI).encodeFunctionData("transfer", [ + toAddress, + toQuantity(sendAmount) + ]) + }; + } + const feeOptionsResult = await checkFeeOptions({ + transactions: [transaction2], + chainId + }); + setFeeOptions((feeOptionsResult == null ? void 0 : feeOptionsResult.feeOptions) ? { + options: feeOptionsResult.feeOptions, + chainId + } : void 0); + setShowConfirmation(true); + setIsCheckingFeeOptions(false); + }; + const executeTransaction = async () => { + var _a3; if (!isCorrectChainId && isConnectorSequenceBased) { await switchChainAsync({ chainId }); } - e2.preventDefault(); + analytics == null ? void 0 : analytics.track({ + event: "SEND_TRANSACTION_REQUEST", + props: { + walletClient: ((_a3 = connector == null ? void 0 : connector._wallet) == null ? void 0 : _a3.id) || "unknown", + source: "sequence-kit/wallet" + } + }); + setIsSendTxnPending(true); const sendAmount = parseUnits$2(amountToSendFormatted, decimals); - if (isNativeCoin) { - analytics == null ? void 0 : analytics.track({ - event: "SEND_TRANSACTION_REQUEST", - props: { - walletClient: ((_a3 = connector == null ? void 0 : connector._wallet) == null ? void 0 : _a3.id) || "unknown", - source: "sequence-kit/wallet" + const txOptions = { + onSettled: (result) => { + setIsBackButtonEnabled(true); + if (result) { + setNavigation({ + location: "home" + }); } - }); - setIsSendTxnPending(true); + setIsSendTxnPending(false); + } + }; + if (isNativeCoin) { sendTransaction2({ to: toAddress, value: BigInt(sendAmount.toString()), gas: null - }, { - onSettled: (result) => { - if (result) { - setNavigation({ - location: "home" - }); - } - setIsSendTxnPending(false); - } - }); + }, txOptions); } else { - analytics == null ? void 0 : analytics.track({ - event: "SEND_TRANSACTION_REQUEST", - props: { - walletClient: ((_b3 = connector == null ? void 0 : connector._wallet) == null ? void 0 : _b3.id) || "unknown", - source: "sequence-kit/wallet" - } - }); - setIsSendTxnPending(true); sendTransaction2({ to: tokenBalance == null ? void 0 : tokenBalance.contractAddress, data: new Interface(ERC_20_ABI).encodeFunctionData("transfer", [ @@ -110229,30 +110381,28 @@ const SendCoin = ({ chainId, contractAddress }) => { toQuantity(sendAmount) ]), gas: null - }, { - onSettled: (result) => { - if (result) { - setNavigation({ - location: "home" - }); - } - setIsSendTxnPending(false); - } - }); + }, txOptions); } }; return jsxRuntimeExports$1.jsxs(Box, { padding: "5", paddingTop: "3", style: { marginTop: HEADER_HEIGHT - }, gap: "2", flexDirection: "column", as: "form", onSubmit: executeTransaction, pointerEvents: isSendTxnPending ? "none" : "auto", children: [jsxRuntimeExports$1.jsxs(Box, { background: "backgroundSecondary", borderRadius: "md", padding: "4", gap: "2", flexDirection: "column", children: [jsxRuntimeExports$1.jsx(SendItemInfo, { imageUrl, decimals, name: name2, symbol, balance: (tokenBalance == null ? void 0 : tokenBalance.balance) || "0", fiatValue: computeBalanceFiat({ + }, gap: "2", flexDirection: "column", as: "form", onSubmit: handleSendClick, pointerEvents: isSendTxnPending ? "none" : "auto", children: [!showConfirmation && jsxRuntimeExports$1.jsxs(jsxRuntimeExports$1.Fragment, { children: [jsxRuntimeExports$1.jsxs(Box, { background: "backgroundSecondary", borderRadius: "md", padding: "4", gap: "2", flexDirection: "column", children: [jsxRuntimeExports$1.jsx(SendItemInfo, { imageUrl, decimals, name: name2, symbol, balance: (tokenBalance == null ? void 0 : tokenBalance.balance) || "0", fiatValue: computeBalanceFiat({ balance: tokenBalance, prices: coinPrices, conversionRate, decimals - }), chainId }), jsxRuntimeExports$1.jsx(NumericInput, { ref: amountInputRef, style: { fontSize: vars.fontSizes.xlarge, fontWeight: vars.fontWeights.bold }, name: "amount", value: amount, onChange: handleChangeAmount, controls: jsxRuntimeExports$1.jsxs(jsxRuntimeExports$1.Fragment, { children: [jsxRuntimeExports$1.jsx(Text, { variant: "small", color: "text50", whiteSpace: "nowrap", children: `~${fiatCurrency.sign}${amountToSendFiat}` }), jsxRuntimeExports$1.jsx(Button, { size: "xs", shape: "square", label: "Max", onClick: handleMax, "data-id": "maxCoin", flexShrink: "0" }), jsxRuntimeExports$1.jsx(Text, { variant: "xlarge", fontWeight: "bold", color: "text100", children: symbol })] }) }), insufficientFunds && jsxRuntimeExports$1.jsx(Text, { as: "div", variant: "normal", color: "negative", marginTop: "2", children: "Insufficient Funds" })] }), jsxRuntimeExports$1.jsxs(Box, { background: "backgroundSecondary", borderRadius: "md", padding: "4", gap: "2", flexDirection: "column", children: [jsxRuntimeExports$1.jsx(Text, { variant: "normal", color: "text50", children: "To" }), isEthAddress(toAddress) ? jsxRuntimeExports$1.jsxs(Card, { clickable: true, width: "full", flexDirection: "row", justifyContent: "space-between", alignItems: "center", onClick: handleToAddressClear, style: { height: "52px" }, children: [jsxRuntimeExports$1.jsxs(Box, { flexDirection: "row", justifyContent: "center", alignItems: "center", gap: "2", children: [jsxRuntimeExports$1.jsx(GradientAvatar, { address: toAddress, style: { width: "20px" } }), jsxRuntimeExports$1.jsx(Text, { color: "text100", children: `0x${truncateAtMiddle(toAddress.substring(2), 8)}` })] }), jsxRuntimeExports$1.jsx(SvgCloseIcon, { size: "xs" })] }) : jsxRuntimeExports$1.jsx(TextInput, { value: toAddress, onChange: (ev) => setToAddress(ev.target.value), placeholder: `${nativeTokenInfo.name} Address (0x...)`, name: "to-address", "data-1p-ignore": true, controls: jsxRuntimeExports$1.jsx(Button, { size: "xs", shape: "square", label: "Paste", onClick: handlePaste, "data-id": "to-address", flexShrink: "0", leftIcon: SvgCopyIcon }) })] }), showSwitchNetwork && jsxRuntimeExports$1.jsxs(Box, { marginTop: "3", children: [jsxRuntimeExports$1.jsx(Text, { variant: "small", color: "negative", marginBottom: "2", children: "The wallet is connected to the wrong network. Please switch network before proceeding" }), jsxRuntimeExports$1.jsx(Button, { marginTop: "2", width: "full", variant: "primary", type: "button", label: "Switch Network", onClick: async () => await switchChainAsync({ chainId }), disabled: isCorrectChainId, style: { height: "52px", borderRadius: vars.radii.md } })] }), jsxRuntimeExports$1.jsx(Box, { style: { height: "52px" }, alignItems: "center", justifyContent: "center", children: isSendTxnPending ? jsxRuntimeExports$1.jsx(Spinner, {}) : jsxRuntimeExports$1.jsx(Button, { color: "text100", marginTop: "3", width: "full", variant: "primary", type: "submit", disabled: !isNonZeroAmount || !isEthAddress(toAddress) || insufficientFunds || !isCorrectChainId && !isConnectorSequenceBased, label: "Send", rightIcon: SvgChevronRightIcon, style: { height: "52px", borderRadius: vars.radii.md } }) })] }); + }), chainId }), jsxRuntimeExports$1.jsx(NumericInput, { ref: amountInputRef, style: { fontSize: vars.fontSizes.xlarge, fontWeight: vars.fontWeights.bold }, name: "amount", value: amount, onChange: handleChangeAmount, controls: jsxRuntimeExports$1.jsxs(jsxRuntimeExports$1.Fragment, { children: [jsxRuntimeExports$1.jsx(Text, { variant: "small", color: "text50", whiteSpace: "nowrap", children: `~${fiatCurrency.sign}${amountToSendFiat}` }), jsxRuntimeExports$1.jsx(Button, { size: "xs", shape: "square", label: "Max", onClick: handleMax, "data-id": "maxCoin", flexShrink: "0" }), jsxRuntimeExports$1.jsx(Text, { variant: "xlarge", fontWeight: "bold", color: "text100", children: symbol })] }) }), insufficientFunds && jsxRuntimeExports$1.jsx(Text, { as: "div", variant: "normal", color: "negative", marginTop: "2", children: "Insufficient Funds" })] }), jsxRuntimeExports$1.jsxs(Box, { background: "backgroundSecondary", borderRadius: "md", padding: "4", gap: "2", flexDirection: "column", children: [jsxRuntimeExports$1.jsx(Text, { variant: "normal", color: "text50", children: "To" }), isEthAddress(toAddress) ? jsxRuntimeExports$1.jsxs(Card, { clickable: true, width: "full", flexDirection: "row", justifyContent: "space-between", alignItems: "center", onClick: handleToAddressClear, style: { height: "52px" }, children: [jsxRuntimeExports$1.jsxs(Box, { flexDirection: "row", justifyContent: "center", alignItems: "center", gap: "2", children: [jsxRuntimeExports$1.jsx(GradientAvatar, { address: toAddress, style: { width: "20px" } }), jsxRuntimeExports$1.jsx(Text, { color: "text100", variant: "normal", children: `0x${truncateAtMiddle(toAddress.substring(2), 10)}` })] }), jsxRuntimeExports$1.jsx(SvgCloseIcon, { size: "sm", color: "white" })] }) : jsxRuntimeExports$1.jsx(TextInput, { value: toAddress, onChange: (ev) => setToAddress(ev.target.value), placeholder: `${nativeTokenInfo.name} Address (0x...)`, name: "to-address", "data-1p-ignore": true, controls: jsxRuntimeExports$1.jsx(Button, { size: "xs", shape: "square", label: "Paste", onClick: handlePaste, "data-id": "to-address", flexShrink: "0", leftIcon: SvgCopyIcon }) })] }), showSwitchNetwork && jsxRuntimeExports$1.jsxs(Box, { marginTop: "3", children: [jsxRuntimeExports$1.jsx(Text, { variant: "small", color: "negative", marginBottom: "2", children: "The wallet is connected to the wrong network. Please switch network before proceeding" }), jsxRuntimeExports$1.jsx(Button, { marginTop: "2", width: "full", variant: "primary", type: "button", label: "Switch Network", onClick: async () => await switchChainAsync({ chainId }), disabled: isCorrectChainId, style: { height: "52px", borderRadius: vars.radii.md } })] }), jsxRuntimeExports$1.jsx(Box, { style: { height: "52px" }, alignItems: "center", justifyContent: "center", children: isCheckingFeeOptions ? jsxRuntimeExports$1.jsx(Spinner, {}) : jsxRuntimeExports$1.jsx(Button, { color: "text100", marginTop: "3", width: "full", variant: "primary", type: "submit", disabled: !isNonZeroAmount || !isEthAddress(toAddress) || insufficientFunds || !isCorrectChainId && !isConnectorSequenceBased, label: "Send", rightIcon: SvgChevronRightIcon, style: { height: "52px", borderRadius: vars.radii.md } }) })] }), showConfirmation && jsxRuntimeExports$1.jsx(TransactionConfirmation, { name: name2, symbol, imageUrl, amount: amountToSendFormatted, toAddress, chainId, balance: (tokenBalance == null ? void 0 : tokenBalance.balance) || "0", decimals, fiatValue: amountToSendFiat, feeOptions: feeOptions2, onSelectFeeOption: (feeTokenAddress) => { + setSelectedFeeTokenAddress(feeTokenAddress); + }, isLoading: isSendTxnPending, onConfirm: () => { + executeTransaction(); + }, onCancel: () => { + setShowConfirmation(false); + } })] }); }; const SendCollectible = ({ chainId, contractAddress, tokenId }) => { var _a2, _b2, _c2, _d2, _e2; const { setNavigation } = useNavigation(); + const { setIsBackButtonEnabled } = useNavigationContext(); const { analytics } = useAnalyticsContext(); const { chains: chains2 } = useConfig(); const connectedChainId = useChainId(); @@ -110267,6 +110417,12 @@ const SendCollectible = ({ chainId, contractAddress, tokenId }) => { const [showAmountControls, setShowAmountControls] = reactExports.useState(false); const { sendTransaction: sendTransaction2 } = useSendTransaction(); const [isSendTxnPending, setIsSendTxnPending] = reactExports.useState(false); + const [showConfirmation, setShowConfirmation] = reactExports.useState(false); + const [feeOptions2, setFeeOptions] = reactExports.useState(); + const [isCheckingFeeOptions, setIsCheckingFeeOptions] = reactExports.useState(false); + const [selectedFeeTokenAddress, setSelectedFeeTokenAddress] = reactExports.useState(null); + const checkFeeOptions = useCheckWaasFeeOptions(); + const [pendingFeeOption, confirmFeeOption, rejectFeeOption] = useWaasFeeOptions(); const { data: tokenBalance, isPending: isPendingBalances } = useCollectibleBalance({ accountAddress, chainId, @@ -110288,6 +110444,14 @@ const SendCollectible = ({ chainId, contractAddress, tokenId }) => { } } }, [tokenBalance]); + reactExports.useEffect(() => { + if (pendingFeeOption && selectedFeeTokenAddress !== null) { + confirmFeeOption(pendingFeeOption.id, selectedFeeTokenAddress); + } + }, [pendingFeeOption, selectedFeeTokenAddress]); + reactExports.useEffect(() => { + setIsBackButtonEnabled(!showConfirmation); + }, [showConfirmation, setIsBackButtonEnabled]); const nativeTokenInfo = getNativeTokenInfoByChainId(chainId, chains2); const isPending = isPendingBalances; if (isPending) { @@ -110333,13 +110497,63 @@ const SendCollectible = ({ chainId, contractAddress, tokenId }) => { const handleToAddressClear = () => { setToAddress(""); }; - const executeTransaction = async (e2) => { - var _a3, _b3; + const handleSendClick = async (e2) => { e2.preventDefault(); + setIsCheckingFeeOptions(true); + const sendAmount = parseUnits$2(amountToSendFormatted, decimals); + let transaction2; + switch (contractType) { + case "ERC721": + transaction2 = { + to: tokenBalance.contractAddress, + data: new Interface(ERC_721_ABI).encodeFunctionData("safeTransferFrom", [ + accountAddress, + toAddress, + tokenId + ]) + }; + break; + case "ERC1155": + default: + transaction2 = { + to: tokenBalance.contractAddress, + data: new Interface(ERC_1155_ABI).encodeFunctionData("safeBatchTransferFrom", [ + accountAddress, + toAddress, + [tokenId], + [toQuantity(sendAmount)], + new Uint8Array() + ]) + }; + } + const feeOptionsResult = await checkFeeOptions({ + transactions: [transaction2], + chainId + }); + setFeeOptions((feeOptionsResult == null ? void 0 : feeOptionsResult.feeOptions) ? { + options: feeOptionsResult.feeOptions, + chainId + } : void 0); + setShowConfirmation(true); + setIsCheckingFeeOptions(false); + }; + const executeTransaction = async () => { + var _a3, _b3; if (!isCorrectChainId && isConnectorSequenceBased) { switchChain2({ chainId }); } const sendAmount = parseUnits$2(amountToSendFormatted, decimals); + const txOptions = { + onSettled: (result) => { + setIsBackButtonEnabled(true); + if (result) { + setNavigation({ + location: "home" + }); + } + setIsSendTxnPending(false); + } + }; switch (contractType) { case "ERC721": analytics == null ? void 0 : analytics.track({ @@ -110358,16 +110572,7 @@ const SendCollectible = ({ chainId, contractAddress, tokenId }) => { tokenId ]), gas: null - }, { - onSettled: (result) => { - if (result) { - setNavigation({ - location: "home" - }); - } - setIsSendTxnPending(false); - } - }); + }, txOptions); break; case "ERC1155": default: @@ -110389,16 +110594,7 @@ const SendCollectible = ({ chainId, contractAddress, tokenId }) => { new Uint8Array() ]), gas: null - }, { - onSettled: (result) => { - if (result) { - setNavigation({ - location: "home" - }); - } - setIsSendTxnPending(false); - } - }); + }, txOptions); } }; const maxAmount = formatUnits$1((tokenBalance == null ? void 0 : tokenBalance.balance) || 0, decimals).toString(); @@ -110406,7 +110602,13 @@ const SendCollectible = ({ chainId, contractAddress, tokenId }) => { const isMaximum = Number(amount) >= Number(maxAmount); return jsxRuntimeExports$1.jsxs(Box, { padding: "5", paddingTop: "3", style: { marginTop: HEADER_HEIGHT - }, gap: "2", flexDirection: "column", as: "form", onSubmit: executeTransaction, pointerEvents: isSendTxnPending ? "none" : "auto", children: [jsxRuntimeExports$1.jsxs(Box, { background: "backgroundSecondary", borderRadius: "md", padding: "4", gap: "2", flexDirection: "column", children: [jsxRuntimeExports$1.jsx(SendItemInfo, { imageUrl, showSquareImage: true, decimals, name: name2, symbol: "", balance: (tokenBalance == null ? void 0 : tokenBalance.balance) || "0", chainId }), jsxRuntimeExports$1.jsx(NumericInput, { ref: amountInputRef, style: { fontSize: vars.fontSizes.xlarge, fontWeight: vars.fontWeights.bold }, name: "amount", value: amount, onChange: handleChangeAmount, disabled: !showAmountControls, controls: jsxRuntimeExports$1.jsx(jsxRuntimeExports$1.Fragment, { children: showAmountControls && jsxRuntimeExports$1.jsxs(Box, { gap: "2", children: [jsxRuntimeExports$1.jsx(Button, { disabled: isMinimum, size: "xs", onClick: handleSubtractOne, leftIcon: SvgSubtractIcon }), jsxRuntimeExports$1.jsx(Button, { disabled: isMaximum, size: "xs", onClick: handleAddOne, leftIcon: SvgAddIcon }), jsxRuntimeExports$1.jsx(Button, { size: "xs", shape: "square", label: "Max", onClick: handleMax, "data-id": "maxCoin", flexShrink: "0" })] }) }) }), insufficientFunds && jsxRuntimeExports$1.jsx(Text, { as: "div", variant: "normal", color: "negative", marginTop: "2", children: "Insufficient Balance" })] }), jsxRuntimeExports$1.jsxs(Box, { background: "backgroundSecondary", borderRadius: "md", padding: "4", gap: "2", flexDirection: "column", children: [jsxRuntimeExports$1.jsx(Text, { variant: "normal", color: "text50", children: "To" }), isEthAddress(toAddress) ? jsxRuntimeExports$1.jsxs(Card, { clickable: true, width: "full", flexDirection: "row", justifyContent: "space-between", alignItems: "center", onClick: handleToAddressClear, style: { height: "52px" }, children: [jsxRuntimeExports$1.jsxs(Box, { flexDirection: "row", justifyContent: "center", alignItems: "center", gap: "2", children: [jsxRuntimeExports$1.jsx(GradientAvatar, { address: toAddress, style: { width: "20px" } }), jsxRuntimeExports$1.jsx(Text, { color: "text100", children: `0x${truncateAtMiddle(toAddress.substring(2), 8)}` })] }), jsxRuntimeExports$1.jsx(SvgCloseIcon, { size: "xs" })] }) : jsxRuntimeExports$1.jsx(TextInput, { value: toAddress, onChange: (ev) => setToAddress(ev.target.value), placeholder: `${nativeTokenInfo.name} Address (0x...)`, name: "to-address", "data-1p-ignore": true, controls: jsxRuntimeExports$1.jsx(Button, { size: "xs", shape: "square", label: "Paste", onClick: handlePaste, "data-id": "to-address", flexShrink: "0", leftIcon: SvgCopyIcon }) })] }), showSwitchNetwork && jsxRuntimeExports$1.jsxs(Box, { marginTop: "3", children: [jsxRuntimeExports$1.jsx(Text, { variant: "small", color: "negative", marginBottom: "2", children: "The wallet is connected to the wrong network. Please switch network before proceeding" }), jsxRuntimeExports$1.jsx(Button, { marginTop: "2", width: "full", variant: "primary", type: "button", label: "Switch Network", onClick: () => switchChain2({ chainId }), disabled: isCorrectChainId, style: { height: "52px", borderRadius: vars.radii.md } })] }), jsxRuntimeExports$1.jsx(Box, { style: { height: "52px" }, alignItems: "center", justifyContent: "center", children: isSendTxnPending ? jsxRuntimeExports$1.jsx(Spinner, {}) : jsxRuntimeExports$1.jsx(Button, { color: "text100", marginTop: "3", width: "full", variant: "primary", type: "submit", disabled: !isNonZeroAmount || !isEthAddress(toAddress) || insufficientFunds || !isCorrectChainId && !isConnectorSequenceBased, label: "Send", rightIcon: SvgChevronRightIcon, style: { height: "52px", borderRadius: vars.radii.md } }) })] }); + }, gap: "2", flexDirection: "column", as: "form", onSubmit: handleSendClick, pointerEvents: isSendTxnPending ? "none" : "auto", children: [!showConfirmation && jsxRuntimeExports$1.jsxs(jsxRuntimeExports$1.Fragment, { children: [jsxRuntimeExports$1.jsxs(Box, { background: "backgroundSecondary", borderRadius: "md", padding: "4", gap: "2", flexDirection: "column", children: [jsxRuntimeExports$1.jsx(SendItemInfo, { imageUrl, showSquareImage: true, decimals, name: name2, symbol: "", balance: (tokenBalance == null ? void 0 : tokenBalance.balance) || "0", chainId }), jsxRuntimeExports$1.jsx(NumericInput, { ref: amountInputRef, style: { fontSize: vars.fontSizes.xlarge, fontWeight: vars.fontWeights.bold }, name: "amount", value: amount, onChange: handleChangeAmount, disabled: !showAmountControls, controls: jsxRuntimeExports$1.jsx(jsxRuntimeExports$1.Fragment, { children: showAmountControls && jsxRuntimeExports$1.jsxs(Box, { gap: "2", children: [jsxRuntimeExports$1.jsx(Button, { disabled: isMinimum, size: "xs", onClick: handleSubtractOne, leftIcon: SvgSubtractIcon }), jsxRuntimeExports$1.jsx(Button, { disabled: isMaximum, size: "xs", onClick: handleAddOne, leftIcon: SvgAddIcon }), jsxRuntimeExports$1.jsx(Button, { size: "xs", shape: "square", label: "Max", onClick: handleMax, "data-id": "maxCoin", flexShrink: "0" })] }) }) }), insufficientFunds && jsxRuntimeExports$1.jsx(Text, { as: "div", variant: "normal", color: "negative", marginTop: "2", children: "Insufficient Balance" })] }), jsxRuntimeExports$1.jsxs(Box, { background: "backgroundSecondary", borderRadius: "md", padding: "4", gap: "2", flexDirection: "column", children: [jsxRuntimeExports$1.jsx(Text, { variant: "normal", color: "text50", children: "To" }), isEthAddress(toAddress) ? jsxRuntimeExports$1.jsxs(Card, { clickable: true, width: "full", flexDirection: "row", justifyContent: "space-between", alignItems: "center", onClick: handleToAddressClear, style: { height: "52px" }, children: [jsxRuntimeExports$1.jsxs(Box, { flexDirection: "row", justifyContent: "center", alignItems: "center", gap: "2", children: [jsxRuntimeExports$1.jsx(GradientAvatar, { address: toAddress, style: { width: "20px" } }), jsxRuntimeExports$1.jsx(Text, { color: "text100", variant: "normal", children: `0x${truncateAtMiddle(toAddress.substring(2), 10)}` })] }), jsxRuntimeExports$1.jsx(SvgCloseIcon, { size: "sm", color: "white" })] }) : jsxRuntimeExports$1.jsx(TextInput, { value: toAddress, onChange: (ev) => setToAddress(ev.target.value), placeholder: `${nativeTokenInfo.name} Address (0x...)`, name: "to-address", "data-1p-ignore": true, controls: jsxRuntimeExports$1.jsx(Button, { size: "xs", shape: "square", label: "Paste", onClick: handlePaste, "data-id": "to-address", flexShrink: "0", leftIcon: SvgCopyIcon }) })] }), showSwitchNetwork && jsxRuntimeExports$1.jsxs(Box, { marginTop: "3", children: [jsxRuntimeExports$1.jsx(Text, { variant: "small", color: "negative", marginBottom: "2", children: "The wallet is connected to the wrong network. Please switch network before proceeding" }), jsxRuntimeExports$1.jsx(Button, { marginTop: "2", width: "full", variant: "primary", type: "button", label: "Switch Network", onClick: () => switchChain2({ chainId }), disabled: isCorrectChainId, style: { height: "52px", borderRadius: vars.radii.md } })] }), jsxRuntimeExports$1.jsx(Box, { style: { height: "52px" }, alignItems: "center", justifyContent: "center", children: isCheckingFeeOptions ? jsxRuntimeExports$1.jsx(Spinner, {}) : jsxRuntimeExports$1.jsx(Button, { color: "text100", marginTop: "3", width: "full", variant: "primary", type: "submit", disabled: !isNonZeroAmount || !isEthAddress(toAddress) || insufficientFunds || !isCorrectChainId && !isConnectorSequenceBased, label: "Send", rightIcon: SvgChevronRightIcon, style: { height: "52px", borderRadius: vars.radii.md } }) })] }), showConfirmation && jsxRuntimeExports$1.jsx(TransactionConfirmation, { name: name2, symbol: "", imageUrl, amount: amountToSendFormatted, toAddress, showSquareImage: true, chainId, balance: (tokenBalance == null ? void 0 : tokenBalance.balance) || "0", decimals, feeOptions: feeOptions2, onSelectFeeOption: (feeTokenAddress) => { + setSelectedFeeTokenAddress(feeTokenAddress); + }, isLoading: isSendTxnPending, onConfirm: () => { + executeTransaction(); + }, onCancel: () => { + setShowConfirmation(false); + } })] }); }; var dayjs_min = { exports: {} }; (function(module2, exports) { @@ -112630,13 +112832,13 @@ const CollectionDetails = ({ chainId, contractAddress }) => { const unformattedBalance = balance.balance; const decimals = ((_a3 = balance == null ? void 0 : balance.tokenMetadata) == null ? void 0 : _a3.decimals) || 0; const formattedBalance = formatDisplay(formatUnits$1(unformattedBalance, decimals)); - return jsxRuntimeExports$1.jsxs(Box, { onClick: () => onClickItem(balance), userSelect: "none", cursor: "pointer", opacity: { hover: "80" }, children: [jsxRuntimeExports$1.jsx(Box, { background: "backgroundSecondary", aspectRatio: "1/1", width: "full", borderRadius: "md", justifyContent: "center", alignItems: "center", marginBottom: "2", children: jsxRuntimeExports$1.jsx(Image$1, { style: { height: "100%" }, src: (_b2 = balance.tokenMetadata) == null ? void 0 : _b2.image }) }), jsxRuntimeExports$1.jsx(Box, { children: jsxRuntimeExports$1.jsx(Text, { variant: "normal", fontWeight: "bold", color: "text100", children: `${(_c2 = balance.tokenMetadata) == null ? void 0 : _c2.name}` }) }), jsxRuntimeExports$1.jsx(Box, { children: jsxRuntimeExports$1.jsxs(Text, { variant: "normal", marginTop: "1", fontWeight: "medium", color: "text50", children: [formattedBalance, " Owned"] }) })] }, index2); + return jsxRuntimeExports$1.jsxs(Box, { onClick: () => onClickItem(balance), userSelect: "none", cursor: "pointer", opacity: { hover: "80" }, children: [jsxRuntimeExports$1.jsx(Box, { background: "backgroundSecondary", aspectRatio: "1/1", width: "full", borderRadius: "md", justifyContent: "center", alignItems: "center", marginBottom: "2", children: jsxRuntimeExports$1.jsx(Image$1, { style: { height: "100%" }, borderRadius: "sm", src: (_b2 = balance.tokenMetadata) == null ? void 0 : _b2.image }) }), jsxRuntimeExports$1.jsx(Box, { children: jsxRuntimeExports$1.jsx(Text, { variant: "normal", fontWeight: "bold", color: "text100", children: `${(_c2 = balance.tokenMetadata) == null ? void 0 : _c2.name}` }) }), jsxRuntimeExports$1.jsx(Box, { children: jsxRuntimeExports$1.jsxs(Text, { variant: "normal", marginTop: "1", fontWeight: "medium", color: "text50", children: [formattedBalance, " Owned"] }) })] }, index2); }) })] })] }); }; const CollectibleDetailsSkeleton = () => { return jsxRuntimeExports$1.jsx(Box, { style: { paddingTop: HEADER_HEIGHT }, children: jsxRuntimeExports$1.jsxs(Box, { flexDirection: "column", gap: "10", paddingBottom: "5", paddingX: "4", paddingTop: "0", style: { marginTop: "-20px" - }, children: [jsxRuntimeExports$1.jsxs(Box, { gap: "3", alignItems: "center", justifyContent: "center", flexDirection: "column", children: [jsxRuntimeExports$1.jsx(Skeleton, { style: { width: "120px", height: "30px" } }), jsxRuntimeExports$1.jsx(Skeleton, { style: { width: "140px", height: "40px" } })] }), jsxRuntimeExports$1.jsx(Box, { children: jsxRuntimeExports$1.jsx(Skeleton, { style: { width: "347px", height: "347px" } }) }), jsxRuntimeExports$1.jsxs(Box, { children: [jsxRuntimeExports$1.jsxs(Box, { children: [jsxRuntimeExports$1.jsx(Text, { variant: "normal", fontWeight: "medium", color: "text50", children: "Balance" }), jsxRuntimeExports$1.jsxs(Box, { flexDirection: "row", alignItems: "flex-end", justifyContent: "space-between", children: [jsxRuntimeExports$1.jsx(Skeleton, { style: { width: "44px", height: "36px" } }), jsxRuntimeExports$1.jsx(Skeleton, { style: { width: "34px", height: "17px" } })] })] }), jsxRuntimeExports$1.jsx(Button, { color: "text100", marginTop: "4", width: "full", variant: "primary", leftIcon: SvgSendIcon, label: "Send", onClick: () => { + }, children: [jsxRuntimeExports$1.jsxs(Box, { gap: "3", alignItems: "center", justifyContent: "center", flexDirection: "column", children: [jsxRuntimeExports$1.jsx(Skeleton, { style: { width: "120px", height: "30px" } }), jsxRuntimeExports$1.jsx(Skeleton, { style: { width: "140px", height: "40px" } })] }), jsxRuntimeExports$1.jsx(Box, { children: jsxRuntimeExports$1.jsx(Skeleton, { style: { width: "100%", aspectRatio: "1/1" } }) }), jsxRuntimeExports$1.jsxs(Box, { children: [jsxRuntimeExports$1.jsxs(Box, { children: [jsxRuntimeExports$1.jsx(Text, { variant: "normal", fontWeight: "medium", color: "text50", children: "Balance" }), jsxRuntimeExports$1.jsxs(Box, { flexDirection: "row", alignItems: "flex-end", justifyContent: "space-between", children: [jsxRuntimeExports$1.jsx(Skeleton, { style: { width: "44px", height: "36px" } }), jsxRuntimeExports$1.jsx(Skeleton, { style: { width: "34px", height: "17px" } })] })] }), jsxRuntimeExports$1.jsx(Button, { color: "text100", marginTop: "4", width: "full", variant: "primary", leftIcon: SvgSendIcon, label: "Send", onClick: () => { } })] }), jsxRuntimeExports$1.jsxs(Box, { children: [jsxRuntimeExports$1.jsx(Text, { variant: "normal", color: "text50", fontWeight: "medium", children: "This week" }), jsxRuntimeExports$1.jsx(TransactionHistorySkeleton, {})] })] }) }); }; const CollectibleDetails = ({ contractAddress, chainId, tokenId }) => { @@ -112694,7 +112896,7 @@ const CollectibleDetails = ({ contractAddress, chainId, tokenId }) => { }) : "0"; return jsxRuntimeExports$1.jsx(Box, { style: { paddingTop: HEADER_HEIGHT }, children: jsxRuntimeExports$1.jsxs(Box, { flexDirection: "column", gap: "10", paddingBottom: "5", paddingX: "4", paddingTop: "0", style: { marginTop: "-20px" - }, children: [jsxRuntimeExports$1.jsxs(Box, { gap: "3", alignItems: "center", justifyContent: "center", flexDirection: "column", children: [jsxRuntimeExports$1.jsxs(Box, { flexDirection: "row", gap: "2", justifyContent: "center", alignItems: "center", children: [jsxRuntimeExports$1.jsx(Image$1, { borderRadius: "circle", width: "8", src: collectionLogo, alt: "collection logo", style: { + }, children: [jsxRuntimeExports$1.jsxs(Box, { gap: "3", alignItems: "center", justifyContent: "center", flexDirection: "column", children: [jsxRuntimeExports$1.jsxs(Box, { flexDirection: "row", gap: "2", justifyContent: "center", alignItems: "center", children: [collectionLogo && jsxRuntimeExports$1.jsx(Image$1, { borderRadius: "circle", width: "8", src: collectionLogo, alt: "collection logo", style: { objectFit: "cover" } }), jsxRuntimeExports$1.jsxs(Box, { gap: "1", flexDirection: "row", justifyContent: "center", alignItems: "center", children: [jsxRuntimeExports$1.jsx(Text, { variant: "small", fontWeight: "bold", color: "text100", children: collectionName }), jsxRuntimeExports$1.jsx(NetworkImage, { chainId, size: "xs" })] })] }), jsxRuntimeExports$1.jsxs(Box, { flexDirection: "column", justifyContent: "center", alignItems: "center", children: [jsxRuntimeExports$1.jsx(Text, { variant: "large", color: "text100", fontWeight: "bold", children: ((_d2 = dataCollectibleBalance == null ? void 0 : dataCollectibleBalance.tokenMetadata) == null ? void 0 : _d2.name) || "Unknown Collectible" }), jsxRuntimeExports$1.jsx(Text, { variant: "small", color: "text50", fontWeight: "medium", children: `#${tokenId}` })] })] }), jsxRuntimeExports$1.jsx(Box, { children: jsxRuntimeExports$1.jsx(CollectibleTileImage, { imageUrl: (_e2 = dataCollectibleBalance == null ? void 0 : dataCollectibleBalance.tokenMetadata) == null ? void 0 : _e2.image }) }), jsxRuntimeExports$1.jsxs(Box, { children: [jsxRuntimeExports$1.jsxs(Box, { children: [jsxRuntimeExports$1.jsx(Text, { variant: "normal", fontWeight: "medium", color: "text50", children: "Balance" }), jsxRuntimeExports$1.jsxs(Box, { flexDirection: "row", alignItems: "flex-end", justifyContent: "space-between", children: [jsxRuntimeExports$1.jsx(Text, { variant: "xlarge", fontWeight: "bold", color: "text100", children: formattedBalance }), dataCollectiblePrices && ((_f2 = dataCollectiblePrices[0].price) == null ? void 0 : _f2.value) && jsxRuntimeExports$1.jsx(Text, { variant: "normal", fontWeight: "medium", color: "text50", children: `${fiatCurrency.symbol} ${valueFiat}` })] })] }), jsxRuntimeExports$1.jsx(Button, { color: "text100", marginTop: "4", width: "full", variant: "primary", leftIcon: SvgSendIcon, label: "Send", onClick: onClickSend })] }), jsxRuntimeExports$1.jsx(Box, { children: jsxRuntimeExports$1.jsx(InfiniteScroll, { onLoad: () => fetchNextPage(), hasMore: hasNextPage2, children: jsxRuntimeExports$1.jsx(TransactionHistoryList, { transactions: transactionHistory, isPending: isPendingTransactionHistory, isFetchingNextPage }) }) })] }) }); }; @@ -112791,13 +112993,16 @@ const TransactionDetails = ({ transaction: transaction2 }) => { }; const NavigationHeader = ({ secondaryText, primaryText }) => { const { goBack, history } = useNavigation(); + const { isBackButtonEnabled } = useNavigationContext(); const onClickBack = () => { + if (!isBackButtonEnabled) + return; goBack(); }; return jsxRuntimeExports$1.jsxs(Box, { background: "backgroundPrimary", zIndex: "20", position: "fixed", width: "full", flexDirection: "row", alignItems: "center", justifyContent: "space-between", paddingX: "4", style: { height: HEADER_HEIGHT, paddingTop: "6px" - }, children: [history.length > 0 ? jsxRuntimeExports$1.jsx(IconButton, { onClick: onClickBack, icon: SvgChevronLeftIcon, size: "xs" }) : jsxRuntimeExports$1.jsx(Box, {}), jsxRuntimeExports$1.jsxs(Box, { children: [jsxRuntimeExports$1.jsx(Text, { fontWeight: "medium", variant: "small", color: "text50", children: secondaryText }), jsxRuntimeExports$1.jsx(index$2$1.Title, { asChild: true, children: jsxRuntimeExports$1.jsx(Text, { fontWeight: "medium", variant: "small", color: "text100", children: primaryText }) })] }), jsxRuntimeExports$1.jsx(Box, { style: { + }, children: [history.length > 0 ? jsxRuntimeExports$1.jsx(IconButton, { onClick: onClickBack, icon: SvgChevronLeftIcon, size: "xs", disabled: !isBackButtonEnabled, style: { opacity: isBackButtonEnabled ? 1 : 0.5 } }) : jsxRuntimeExports$1.jsx(Box, {}), jsxRuntimeExports$1.jsxs(Box, { children: [jsxRuntimeExports$1.jsx(Text, { fontWeight: "medium", variant: "small", color: "text50", children: secondaryText }), jsxRuntimeExports$1.jsx(index$2$1.Title, { asChild: true, children: jsxRuntimeExports$1.jsx(Text, { fontWeight: "medium", variant: "small", color: "text100", children: primaryText }) })] }), jsxRuntimeExports$1.jsx(Box, { style: { width: "44px" } })] }); }; @@ -116948,6 +117153,7 @@ const KitWalletContent = ({ children }) => { const { theme, position } = useTheme(); const [openWalletModal, setOpenWalletModal] = reactExports.useState(false); const [history, setHistory] = reactExports.useState([]); + const [isBackButtonEnabled, setIsBackButtonEnabled] = reactExports.useState(true); const navigation = history.length > 0 ? history[history.length - 1] : DEFAULT_LOCATION; const displayScrollbar = navigation.location === "home" || navigation.location === "collection-details" || navigation.location === "collectible-details" || navigation.location === "coin-details" || navigation.location === "history" || navigation.location === "search" || navigation.location === "search-view-all" || navigation.location === "settings-currency"; reactExports.useEffect(() => { @@ -116955,7 +117161,7 @@ const KitWalletContent = ({ children }) => { setHistory([]); } }, [openWalletModal]); - return jsxRuntimeExports$1.jsx(WalletModalContextProvider, { value: { setOpenWalletModal, openWalletModalState: openWalletModal }, children: jsxRuntimeExports$1.jsxs(NavigationContextProvider, { value: { setHistory, history }, children: [jsxRuntimeExports$1.jsx("div", { id: "kit-wallet", children: jsxRuntimeExports$1.jsx(ThemeProvider, { root: "#kit-wallet", scope: "kit", theme, children: jsxRuntimeExports$1.jsx(AnimatePresence, { children: openWalletModal && jsxRuntimeExports$1.jsx(Modal, { contentProps: { + return jsxRuntimeExports$1.jsx(WalletModalContextProvider, { value: { setOpenWalletModal, openWalletModalState: openWalletModal }, children: jsxRuntimeExports$1.jsxs(NavigationContextProvider, { value: { setHistory, history, isBackButtonEnabled, setIsBackButtonEnabled }, children: [jsxRuntimeExports$1.jsx("div", { id: "kit-wallet", children: jsxRuntimeExports$1.jsx(ThemeProvider, { root: "#kit-wallet", scope: "kit", theme, children: jsxRuntimeExports$1.jsx(AnimatePresence, { children: openWalletModal && jsxRuntimeExports$1.jsx(Modal, { contentProps: { style: { maxWidth: "400px", height: "fit-content", diff --git a/assets/index-DEv_Qz7e.js b/assets/index-DF20gIsG.js similarity index 99% rename from assets/index-DEv_Qz7e.js rename to assets/index-DF20gIsG.js index e16b2e44..75db2a29 100644 --- a/assets/index-DEv_Qz7e.js +++ b/assets/index-DF20gIsG.js @@ -1,4 +1,4 @@ -import { B as Buffer, g as getDefaultExportFromCjs, b as bytesToHex, s as sha256, E as EventEmitter } from "./index-IZV5kIPU.js"; +import { B as Buffer, g as getDefaultExportFromCjs, b as bytesToHex, s as sha256, E as EventEmitter } from "./index-C1SjSLmA.js"; import { D, g, c as clsx, h, y } from "./hooks.module-C1UUl86a.js"; class ScopedLocalStorage { constructor(scope, module) { diff --git a/assets/index-CeftjqzJ.js b/assets/index-DiRSBp0V.js similarity index 99% rename from assets/index-CeftjqzJ.js rename to assets/index-DiRSBp0V.js index 76b6b4f5..47b3419e 100644 --- a/assets/index-CeftjqzJ.js +++ b/assets/index-DiRSBp0V.js @@ -1,5 +1,5 @@ -import { T as ThemeCtrl, M as ModalCtrl, R as RouterCtrl, E as ExplorerCtrl, C as CoreUtil, a as ToastCtrl, b as EventsCtrl, O as OptionsCtrl, c as ConfigCtrl } from "./index-IIZ_s-is.js"; -import "./index-IZV5kIPU.js"; +import { T as ThemeCtrl, M as ModalCtrl, R as RouterCtrl, E as ExplorerCtrl, C as CoreUtil, a as ToastCtrl, b as EventsCtrl, O as OptionsCtrl, c as ConfigCtrl } from "./index-BjN8zAHE.js"; +import "./index-C1SjSLmA.js"; function addUniqueItem(array, item) { array.indexOf(item) === -1 && array.push(item); } diff --git a/assets/index-BJPxxmWB.js b/assets/index-Dlx0r4Hc.js similarity index 99% rename from assets/index-BJPxxmWB.js rename to assets/index-Dlx0r4Hc.js index 659f257c..f09e307e 100644 --- a/assets/index-BJPxxmWB.js +++ b/assets/index-Dlx0r4Hc.js @@ -1,7 +1,7 @@ -import { c as commonjsGlobal, B as Buffer$7, a as getAugmentedNamespace, p as process$1, t as tslib_es6, e as eventemitter3Exports, g as getDefaultExportFromCjs } from "./index-IZV5kIPU.js"; -import { r as require$$0$2, i as inherits_browserExports, e as eventsExports, a as require$$0$3 } from "./___vite-browser-external_commonjs-proxy-xBtFqy5O.js"; +import { c as commonjsGlobal, B as Buffer$7, a as getAugmentedNamespace, p as process$1, t as tslib_es6, e as eventemitter3Exports, g as getDefaultExportFromCjs } from "./index-C1SjSLmA.js"; +import { r as require$$0$2, i as inherits_browserExports, e as eventsExports, a as require$$0$3 } from "./___vite-browser-external_commonjs-proxy-DCQ1jgJw.js"; import { p as preact_module, a as clsx_m, b as hooks_module } from "./hooks.module-C1UUl86a.js"; -import { b as browserExports } from "./browser-C6tFLLwW.js"; +import { b as browserExports } from "./browser-BsrK5m4C.js"; var dist$5 = {}; var CoinbaseWalletSDK$1 = {}; var walletLogo$1 = {}; diff --git a/assets/index.es-CpB3hItG.js b/assets/index.es-oHTfwTsx.js similarity index 99% rename from assets/index.es-CpB3hItG.js rename to assets/index.es-oHTfwTsx.js index 9bcc8044..bf358378 100644 --- a/assets/index.es-CpB3hItG.js +++ b/assets/index.es-oHTfwTsx.js @@ -1,6 +1,6 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-IIZ_s-is.js","./index-IZV5kIPU.js","./index-g_cLYwVj.css"])))=>i.map(i=>d[i]); -import { p as process$1, a as getAugmentedNamespace, c as commonjsGlobal, d as global, B as Buffer, g as getDefaultExportFromCjs, _ as __vitePreload } from "./index-IZV5kIPU.js"; -import { a as require$$0$2, r as require$$0$3, i as inherits_browserExports, e as eventsExports, J as Jg } from "./___vite-browser-external_commonjs-proxy-xBtFqy5O.js"; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BjN8zAHE.js","./index-C1SjSLmA.js","./index-g_cLYwVj.css"])))=>i.map(i=>d[i]); +import { p as process$1, a as getAugmentedNamespace, c as commonjsGlobal, d as global, B as Buffer, g as getDefaultExportFromCjs, _ as __vitePreload } from "./index-C1SjSLmA.js"; +import { a as require$$0$2, r as require$$0$3, i as inherits_browserExports, e as eventsExports, J as Jg } from "./___vite-browser-external_commonjs-proxy-DCQ1jgJw.js"; var __spreadArray = function(to2, from2, pack) { if (pack || arguments.length === 2) for (var i3 = 0, l2 = from2.length, ar2; i3 < l2; i3++) { if (ar2 || !(i3 in from2)) { @@ -27477,7 +27477,7 @@ class C2 { if (this.rpc = this.getRpcConfig(t), this.chainId = this.rpc.chains.length ? m2(this.rpc.chains) : m2(this.rpc.optionalChains), this.signer = await Ev.init({ projectId: this.rpc.projectId, metadata: this.rpc.metadata, disableProviderPing: t.disableProviderPing, relayUrl: t.relayUrl, storageOptions: t.storageOptions, customStoragePrefix: t.customStoragePrefix, telemetryEnabled: t.telemetryEnabled }), this.registerEventListeners(), await this.loadPersistedSession(), this.rpc.showQrModal) { let s2; try { - const { WalletConnectModal: i3 } = await __vitePreload(() => import("./index-IIZ_s-is.js").then((n4) => n4.i), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url); + const { WalletConnectModal: i3 } = await __vitePreload(() => import("./index-BjN8zAHE.js").then((n4) => n4.i), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url); s2 = i3; } catch { throw new Error("To use QR modal, please install @walletconnect/modal package"); diff --git a/assets/metamask-sdk-Cdu3ocn7.js b/assets/metamask-sdk-CrAgzNC4.js similarity index 99% rename from assets/metamask-sdk-Cdu3ocn7.js rename to assets/metamask-sdk-CrAgzNC4.js index fbd682ca..415776d0 100644 --- a/assets/metamask-sdk-Cdu3ocn7.js +++ b/assets/metamask-sdk-CrAgzNC4.js @@ -1,5 +1,5 @@ -import { c as commonjsGlobal, g as getDefaultExportFromCjs, n, d as global, f as eventemitter2Exports, _ as __vitePreload } from "./index-IZV5kIPU.js"; -import { t } from "./browser-C6tFLLwW.js"; +import { c as commonjsGlobal, g as getDefaultExportFromCjs, n, d as global, f as eventemitter2Exports, _ as __vitePreload } from "./index-C1SjSLmA.js"; +import { t } from "./browser-BsrK5m4C.js"; var browserPonyfill = { exports: {} }; (function(module, exports) { var __global__ = typeof globalThis !== "undefined" && globalThis || typeof self !== "undefined" && self || typeof commonjsGlobal !== "undefined" && commonjsGlobal; diff --git a/index.html b/index.html index 9ca2846e..0c1522b3 100644 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@ Learn how to configure a non-root public URL by running `npm run build`. --> Sequence Kit Demo - +