@latticexyz/entrykit 2.2.22-a3645c819959efe97ff2e50f6f5b88ebe77fa980 → 2.2.22-a3918e051d892b946148bb88b25de1f64bdd302e
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.
|
@@ -22,7 +22,7 @@ import { forwardRef, useEffect, useRef, useState } from "react";
|
|
|
22
22
|
import ReactDOM from "react-dom";
|
|
23
23
|
|
|
24
24
|
// ../../node_modules/.pnpm/tailwindcss@3.4.13/node_modules/tailwindcss/tailwind.css?inline
|
|
25
|
-
var tailwind_default = '*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}/*\n! tailwindcss v3.4.13 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: \'\';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user\'s configured `sans` font-family by default.\n5. Use the user\'s configured `sans` font-feature-settings by default.\n6. Use the user\'s configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */ /* 3 */\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user\'s configured `mono` font-family by default.\n2. Use the user\'s configured `mono` font-feature-settings by default.\n3. Use the user\'s configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type=\'button\']),\ninput:where([type=\'reset\']),\ninput:where([type=\'submit\']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type=\'search\'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user\'s configured gray 400 color.\n*/\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role="button"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don\'t get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden] {\n display: none;\n}\n\n.container {\n width: 100%;\n}\n\n@media (min-width: 640px) {\n\n .container {\n max-width: 640px;\n }\n}\n\n@media (min-width: 768px) {\n\n .container {\n max-width: 768px;\n }\n}\n\n@media (min-width: 1024px) {\n\n .container {\n max-width: 1024px;\n }\n}\n\n@media (min-width: 1280px) {\n\n .container {\n max-width: 1280px;\n }\n}\n\n@media (min-width: 1536px) {\n\n .container {\n max-width: 1536px;\n }\n}\n\n.grid-cols-2.divide-y > :not([hidden]) ~ :not([hidden]):nth-child(-n + 2) {\n border-top-width: 0;\n border-bottom-width: 0;\n}\n\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.pointer-events-none {\n pointer-events: none;\n}\n\n.pointer-events-auto {\n pointer-events: auto;\n}\n\n.fixed {\n position: fixed;\n}\n\n.absolute {\n position: absolute;\n}\n\n.relative {\n position: relative;\n}\n\n.sticky {\n position: sticky;\n}\n\n.inset-0 {\n inset: 0px;\n}\n\n.bottom-0 {\n bottom: 0px;\n}\n\n.left-0 {\n left: 0px;\n}\n\n.right-0 {\n right: 0px;\n}\n\n.top-0 {\n top: 0px;\n}\n\n.col-start-1 {\n grid-column-start: 1;\n}\n\n.row-start-1 {\n grid-row-start: 1;\n}\n\n.m-0 {\n margin: 0px;\n}\n\n.m-2 {\n margin: 0.5rem;\n}\n\n.-mx-0\\.5 {\n margin-left: -0.125rem;\n margin-right: -0.125rem;\n}\n\n.-my-1 {\n margin-top: -0.25rem;\n margin-bottom: -0.25rem;\n}\n\n.-my-\\[0\\.125em\\] {\n margin-top: -0.125em;\n margin-bottom: -0.125em;\n}\n\n.mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n\n.-ml-3 {\n margin-left: -0.75rem;\n}\n\n.-mt-2 {\n margin-top: -0.5rem;\n}\n\n.block {\n display: block;\n}\n\n.flex {\n display: flex;\n}\n\n.inline-flex {\n display: inline-flex;\n}\n\n.table {\n display: table;\n}\n\n.grid {\n display: grid;\n}\n\n.inline-grid {\n display: inline-grid;\n}\n\n.contents {\n display: contents;\n}\n\n.hidden {\n display: none;\n}\n\n.h-12 {\n height: 3rem;\n}\n\n.h-16 {\n height: 4rem;\n}\n\n.h-4 {\n height: 1rem;\n}\n\n.h-6 {\n height: 1.5rem;\n}\n\n.h-64 {\n height: 16rem;\n}\n\n.h-\\[1\\.25em\\] {\n height: 1.25em;\n}\n\n.h-\\[1em\\] {\n height: 1em;\n}\n\n.h-full {\n height: 100%;\n}\n\n.max-h-full {\n max-height: 100%;\n}\n\n.min-h-\\[22rem\\] {\n min-height: 22rem;\n}\n\n.min-h-\\[26rem\\] {\n min-height: 26rem;\n}\n\n.w-16 {\n width: 4rem;\n}\n\n.w-24 {\n width: 6rem;\n}\n\n.w-28 {\n width: 7rem;\n}\n\n.w-4 {\n width: 1rem;\n}\n\n.w-48 {\n width: 12rem;\n}\n\n.w-6 {\n width: 1.5rem;\n}\n\n.w-60 {\n width: 15rem;\n}\n\n.w-\\[0\\.6em\\] {\n width: 0.6em;\n}\n\n.w-\\[1\\.25em\\] {\n width: 1.25em;\n}\n\n.w-full {\n width: 100%;\n}\n\n.max-w-\\[26rem\\] {\n max-width: 26rem;\n}\n\n.flex-shrink-0 {\n flex-shrink: 0;\n}\n\n.flex-grow {\n flex-grow: 1;\n}\n\n.-translate-y-2 {\n --tw-translate-y: -0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.-translate-y-4 {\n --tw-translate-y: -1rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-x-2 {\n --tw-translate-x: 0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-y-0 {\n --tw-translate-y: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-50 {\n --tw-scale-x: .5;\n --tw-scale-y: .5;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n@keyframes spin {\n\n to {\n transform: rotate(360deg);\n }\n}\n\n.animate-spin {\n animation: spin 1s linear infinite;\n}\n\n.cursor-pointer {\n cursor: pointer;\n}\n\n.grid-cols-\\[1fr_auto_1fr\\] {\n grid-template-columns: 1fr auto 1fr;\n}\n\n.flex-col {\n flex-direction: column;\n}\n\n.place-items-center {\n place-items: center;\n}\n\n.items-end {\n align-items: flex-end;\n}\n\n.items-center {\n align-items: center;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.justify-center {\n justify-content: center;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.gap-1 {\n gap: 0.25rem;\n}\n\n.gap-2 {\n gap: 0.5rem;\n}\n\n.gap-2\\.5 {\n gap: 0.625rem;\n}\n\n.gap-4 {\n gap: 1rem;\n}\n\n.gap-6 {\n gap: 1.5rem;\n}\n\n.space-y-6 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));\n}\n\n.divide-y > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-y-reverse: 0;\n border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));\n border-bottom-width: calc(1px * var(--tw-divide-y-reverse));\n}\n\n.divide-neutral-800 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(38 38 38 / var(--tw-divide-opacity));\n}\n\n.self-auto {\n align-self: auto;\n}\n\n.self-center {\n align-self: center;\n}\n\n.overflow-auto {\n overflow: auto;\n}\n\n.overflow-clip {\n overflow: clip;\n}\n\n.whitespace-pre-wrap {\n white-space: pre-wrap;\n}\n\n.rounded-full {\n border-radius: 9999px;\n}\n\n.border {\n border-width: 1px;\n}\n\n.border-4 {\n border-width: 4px;\n}\n\n.border-neutral-300 {\n --tw-border-opacity: 1;\n border-color: rgb(212 212 212 / var(--tw-border-opacity));\n}\n\n.border-transparent {\n border-color: transparent;\n}\n\n.bg-black\\/10 {\n background-color: rgb(0 0 0 / 0.1);\n}\n\n.bg-blue-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(29 78 216 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700\\/60 {\n background-color: rgb(29 78 216 / 0.6);\n}\n\n.bg-neutral-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(245 245 245 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800 {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800\\/85 {\n background-color: rgb(38 38 38 / 0.85);\n}\n\n.bg-neutral-900 {\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / var(--tw-bg-opacity));\n}\n\n.bg-orange-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(249 115 22 / var(--tw-bg-opacity));\n}\n\n.bg-orange-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.bg-gradient-to-b {\n background-image: linear-gradient(to bottom, var(--tw-gradient-stops));\n}\n\n.from-transparent {\n --tw-gradient-from: transparent var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n\n.to-blue-700 {\n --tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position);\n}\n\n.bg-cover {\n background-size: cover;\n}\n\n.bg-center {\n background-position: center;\n}\n\n.bg-no-repeat {\n background-repeat: no-repeat;\n}\n\n.object-cover {\n object-fit: cover;\n}\n\n.p-1 {\n padding: 0.25rem;\n}\n\n.p-2 {\n padding: 0.5rem;\n}\n\n.p-3 {\n padding: 0.75rem;\n}\n\n.p-4 {\n padding: 1rem;\n}\n\n.p-6 {\n padding: 1.5rem;\n}\n\n.p-\\[\\.75em\\] {\n padding: .75em;\n}\n\n.px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n}\n\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n\n.py-8 {\n padding-top: 2rem;\n padding-bottom: 2rem;\n}\n\n.pb-8 {\n padding-bottom: 2rem;\n}\n\n.pt-8 {\n padding-top: 2rem;\n}\n\n.text-left {\n text-align: left;\n}\n\n.text-center {\n text-align: center;\n}\n\n.font-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;\n}\n\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n\n.text-\\[\\.75em\\] {\n font-size: .75em;\n}\n\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.font-bold {\n font-weight: 700;\n}\n\n.font-medium {\n font-weight: 500;\n}\n\n.leading-none {\n line-height: 1;\n}\n\n.tracking-\\[-1ch\\] {\n letter-spacing: -1ch;\n}\n\n.text-black {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity));\n}\n\n.text-neutral-400 {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity));\n}\n\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity));\n}\n\n.text-transparent {\n color: transparent;\n}\n\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.text-white\\/20 {\n color: rgb(255 255 255 / 0.2);\n}\n\n.text-white\\/80 {\n color: rgb(255 255 255 / 0.8);\n}\n\n.opacity-0 {\n opacity: 0;\n}\n\n.opacity-100 {\n opacity: 1;\n}\n\n.opacity-25 {\n opacity: 0.25;\n}\n\n.opacity-30 {\n opacity: 0.3;\n}\n\n.opacity-75 {\n opacity: 0.75;\n}\n\n.outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n.ring-1 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.ring-neutral-700\\/50 {\n --tw-ring-color: rgb(64 64 64 / 0.5);\n}\n\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.duration-100 {\n transition-duration: 100ms;\n}\n\n.duration-300 {\n transition-duration: 300ms;\n}\n\n@keyframes enter {\n\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n\n@keyframes exit {\n\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n\n.animate-in {\n animation-name: enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n}\n\n.fade-in {\n --tw-enter-opacity: 0;\n}\n\n.slide-in-from-bottom-16 {\n --tw-enter-translate-y: 4rem;\n}\n\n.slide-in-from-bottom-8 {\n --tw-enter-translate-y: 2rem;\n}\n\n.animate-duration-300 {\n animation-duration: 300ms;\n}\n\n@property --tw-border-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@property --tw-conic-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@keyframes border-gradient {\n\n to {\n --tw-border-gradient-angle: 360deg;\n }\n}\n\n.after\\:select-none::after {\n content: var(--tw-content);\n -webkit-user-select: none;\n user-select: none;\n}\n\n.after\\:content-\\[\\\'\\2026\\\'\\]::after {\n --tw-content: \'\u2026\';\n content: var(--tw-content);\n}\n\n.hover\\:bg-blue-500:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-neutral-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-orange-400:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(251 146 60 / var(--tw-bg-opacity));\n}\n\n.hover\\:text-white:hover {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.hover\\:text-white\\/40:hover {\n color: rgb(255 255 255 / 0.4);\n}\n\n.hover\\:brightness-125:hover {\n --tw-brightness: brightness(1.25);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.focus\\:border-orange-500:focus {\n --tw-border-opacity: 1;\n border-color: rgb(249 115 22 / var(--tw-border-opacity));\n}\n\n.focus\\:border-yellow-400:focus {\n --tw-border-opacity: 1;\n border-color: rgb(250 204 21 / var(--tw-border-opacity));\n}\n\n.active\\:bg-orange-600:active {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.active\\:brightness-150:active {\n --tw-brightness: brightness(1.5);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.group:hover .group-hover\\:rotate-90 {\n --tw-rotate: 90deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.aria-busy\\:pointer-events-none[aria-busy="true"] {\n pointer-events: none;\n}\n\n.aria-busy\\:bg-blue-500[aria-busy="true"] {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.aria-disabled\\:pointer-events-none[aria-disabled="true"] {\n pointer-events: none;\n}\n\n.aria-disabled\\:opacity-50[aria-disabled="true"] {\n opacity: 0.5;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:inline {\n display: inline;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:hidden {\n display: none;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:translate-x-0 {\n --tw-translate-x: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-125 {\n --tw-scale-x: 1.25;\n --tw-scale-y: 1.25;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:opacity-100 {\n opacity: 1;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-0 {\n opacity: 0;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-100 {\n opacity: 1;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:duration-300 {\n transition-duration: 300ms;\n}\n\n.data-\\[highlighted\\]\\:bg-neutral-200[data-highlighted] {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.links\\:font-medium a[href]:not(.links-unset) {\n font-weight: 500;\n}\n\n.links\\:text-white a[href]:not(.links-unset) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.links\\:underline a[href]:not(.links-unset) {\n text-decoration-line: underline;\n}\n\n.links\\:decoration-neutral-500 a[href]:not(.links-unset) {\n text-decoration-color: #737373;\n}\n\n.links\\:underline-offset-4 a[href]:not(.links-unset) {\n text-underline-offset: 4px;\n}\n\n.hover\\:links\\:decoration-orange-500 a[href]:not(.links-unset):hover {\n text-decoration-color: #f97316;\n}\n\n@media (min-width: 640px) {\n\n .sm\\:items-center {\n align-items: center;\n }\n}\n\n.dark\\:border-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-border-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-border-opacity));\n}\n\n.dark\\:bg-neutral-800:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.dark\\:bg-white\\/10:where([data-theme="dark"], [data-theme="dark"] *) {\n background-color: rgb(255 255 255 / 0.1);\n}\n\n.dark\\:text-white:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.dark\\:hover\\:bg-neutral-700:hover:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n';
|
|
25
|
+
var tailwind_default = '*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}/*\n! tailwindcss v3.4.13 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: \'\';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user\'s configured `sans` font-family by default.\n5. Use the user\'s configured `sans` font-feature-settings by default.\n6. Use the user\'s configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */ /* 3 */\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user\'s configured `mono` font-family by default.\n2. Use the user\'s configured `mono` font-feature-settings by default.\n3. Use the user\'s configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type=\'button\']),\ninput:where([type=\'reset\']),\ninput:where([type=\'submit\']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type=\'search\'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user\'s configured gray 400 color.\n*/\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role="button"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don\'t get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden] {\n display: none;\n}\n\n.container {\n width: 100%;\n}\n\n@media (min-width: 640px) {\n\n .container {\n max-width: 640px;\n }\n}\n\n@media (min-width: 768px) {\n\n .container {\n max-width: 768px;\n }\n}\n\n@media (min-width: 1024px) {\n\n .container {\n max-width: 1024px;\n }\n}\n\n@media (min-width: 1280px) {\n\n .container {\n max-width: 1280px;\n }\n}\n\n@media (min-width: 1536px) {\n\n .container {\n max-width: 1536px;\n }\n}\n\n.grid-cols-2.divide-y > :not([hidden]) ~ :not([hidden]):nth-child(-n + 2) {\n border-top-width: 0;\n border-bottom-width: 0;\n}\n\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.pointer-events-none {\n pointer-events: none;\n}\n\n.pointer-events-auto {\n pointer-events: auto;\n}\n\n.fixed {\n position: fixed;\n}\n\n.absolute {\n position: absolute;\n}\n\n.relative {\n position: relative;\n}\n\n.sticky {\n position: sticky;\n}\n\n.inset-0 {\n inset: 0px;\n}\n\n.bottom-0 {\n bottom: 0px;\n}\n\n.left-0 {\n left: 0px;\n}\n\n.right-0 {\n right: 0px;\n}\n\n.top-0 {\n top: 0px;\n}\n\n.col-start-1 {\n grid-column-start: 1;\n}\n\n.row-start-1 {\n grid-row-start: 1;\n}\n\n.m-0 {\n margin: 0px;\n}\n\n.m-2 {\n margin: 0.5rem;\n}\n\n.-mx-0\\.5 {\n margin-left: -0.125rem;\n margin-right: -0.125rem;\n}\n\n.-my-1 {\n margin-top: -0.25rem;\n margin-bottom: -0.25rem;\n}\n\n.-my-\\[0\\.125em\\] {\n margin-top: -0.125em;\n margin-bottom: -0.125em;\n}\n\n.mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n\n.-ml-3 {\n margin-left: -0.75rem;\n}\n\n.-mr-1 {\n margin-right: -0.25rem;\n}\n\n.-mt-2 {\n margin-top: -0.5rem;\n}\n\n.mt-1 {\n margin-top: 0.25rem;\n}\n\n.mt-4 {\n margin-top: 1rem;\n}\n\n.block {\n display: block;\n}\n\n.inline-block {\n display: inline-block;\n}\n\n.flex {\n display: flex;\n}\n\n.inline-flex {\n display: inline-flex;\n}\n\n.table {\n display: table;\n}\n\n.grid {\n display: grid;\n}\n\n.inline-grid {\n display: inline-grid;\n}\n\n.contents {\n display: contents;\n}\n\n.hidden {\n display: none;\n}\n\n.aspect-square {\n aspect-ratio: 1 / 1;\n}\n\n.h-10 {\n height: 2.5rem;\n}\n\n.h-12 {\n height: 3rem;\n}\n\n.h-16 {\n height: 4rem;\n}\n\n.h-3 {\n height: 0.75rem;\n}\n\n.h-3\\.5 {\n height: 0.875rem;\n}\n\n.h-4 {\n height: 1rem;\n}\n\n.h-6 {\n height: 1.5rem;\n}\n\n.h-64 {\n height: 16rem;\n}\n\n.h-\\[1\\.25em\\] {\n height: 1.25em;\n}\n\n.h-\\[1em\\] {\n height: 1em;\n}\n\n.h-\\[2px\\] {\n height: 2px;\n}\n\n.h-full {\n height: 100%;\n}\n\n.max-h-\\[230px\\] {\n max-height: 230px;\n}\n\n.max-h-full {\n max-height: 100%;\n}\n\n.w-10 {\n width: 2.5rem;\n}\n\n.w-16 {\n width: 4rem;\n}\n\n.w-24 {\n width: 6rem;\n}\n\n.w-28 {\n width: 7rem;\n}\n\n.w-3 {\n width: 0.75rem;\n}\n\n.w-3\\.5 {\n width: 0.875rem;\n}\n\n.w-4 {\n width: 1rem;\n}\n\n.w-48 {\n width: 12rem;\n}\n\n.w-6 {\n width: 1.5rem;\n}\n\n.w-60 {\n width: 15rem;\n}\n\n.w-8 {\n width: 2rem;\n}\n\n.w-\\[0\\.6em\\] {\n width: 0.6em;\n}\n\n.w-\\[1\\.25em\\] {\n width: 1.25em;\n}\n\n.w-\\[352px\\] {\n width: 352px;\n}\n\n.w-full {\n width: 100%;\n}\n\n.max-w-\\[26rem\\] {\n max-width: 26rem;\n}\n\n.flex-shrink-0 {\n flex-shrink: 0;\n}\n\n.flex-grow {\n flex-grow: 1;\n}\n\n.-translate-y-2 {\n --tw-translate-y: -0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.-translate-y-4 {\n --tw-translate-y: -1rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-x-2 {\n --tw-translate-x: 0.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-y-0 {\n --tw-translate-y: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-50 {\n --tw-scale-x: .5;\n --tw-scale-y: .5;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n@keyframes spin {\n\n to {\n transform: rotate(360deg);\n }\n}\n\n.animate-spin {\n animation: spin 1s linear infinite;\n}\n\n.cursor-pointer {\n cursor: pointer;\n}\n\n.cursor-text {\n cursor: text;\n}\n\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n\n.grid-cols-\\[1fr_auto_1fr\\] {\n grid-template-columns: 1fr auto 1fr;\n}\n\n.flex-col {\n flex-direction: column;\n}\n\n.place-items-center {\n place-items: center;\n}\n\n.items-end {\n align-items: flex-end;\n}\n\n.items-center {\n align-items: center;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.justify-center {\n justify-content: center;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.gap-1 {\n gap: 0.25rem;\n}\n\n.gap-2 {\n gap: 0.5rem;\n}\n\n.gap-2\\.5 {\n gap: 0.625rem;\n}\n\n.gap-4 {\n gap: 1rem;\n}\n\n.gap-5 {\n gap: 1.25rem;\n}\n\n.gap-6 {\n gap: 1.5rem;\n}\n\n.space-y-6 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));\n}\n\n.divide-y > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-y-reverse: 0;\n border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));\n border-bottom-width: calc(1px * var(--tw-divide-y-reverse));\n}\n\n.divide-neutral-700 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-divide-opacity));\n}\n\n.divide-neutral-800 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(38 38 38 / var(--tw-divide-opacity));\n}\n\n.self-auto {\n align-self: auto;\n}\n\n.self-center {\n align-self: center;\n}\n\n.overflow-auto {\n overflow: auto;\n}\n\n.overflow-clip {\n overflow: clip;\n}\n\n.overflow-y-auto {\n overflow-y: auto;\n}\n\n.whitespace-nowrap {\n white-space: nowrap;\n}\n\n.whitespace-pre-wrap {\n white-space: pre-wrap;\n}\n\n.rounded-full {\n border-radius: 9999px;\n}\n\n.border {\n border-width: 1px;\n}\n\n.border-2 {\n border-width: 2px;\n}\n\n.border-4 {\n border-width: 4px;\n}\n\n.border-dashed {\n border-style: dashed;\n}\n\n.border-neutral-300 {\n --tw-border-opacity: 1;\n border-color: rgb(212 212 212 / var(--tw-border-opacity));\n}\n\n.border-neutral-700 {\n --tw-border-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-border-opacity));\n}\n\n.border-transparent {\n border-color: transparent;\n}\n\n.border-white\\/50 {\n border-color: rgb(255 255 255 / 0.5);\n}\n\n.bg-black\\/10 {\n background-color: rgb(0 0 0 / 0.1);\n}\n\n.bg-blue-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(29 78 216 / var(--tw-bg-opacity));\n}\n\n.bg-blue-700\\/60 {\n background-color: rgb(29 78 216 / 0.6);\n}\n\n.bg-green-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(22 163 74 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(245 245 245 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-700 {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800 {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.bg-neutral-800\\/85 {\n background-color: rgb(38 38 38 / 0.85);\n}\n\n.bg-neutral-900 {\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / var(--tw-bg-opacity));\n}\n\n.bg-orange-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(249 115 22 / var(--tw-bg-opacity));\n}\n\n.bg-orange-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.bg-red-600 {\n --tw-bg-opacity: 1;\n background-color: rgb(220 38 38 / var(--tw-bg-opacity));\n}\n\n.bg-transparent {\n background-color: transparent;\n}\n\n.bg-gradient-to-b {\n background-image: linear-gradient(to bottom, var(--tw-gradient-stops));\n}\n\n.from-transparent {\n --tw-gradient-from: transparent var(--tw-gradient-from-position);\n --tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n}\n\n.to-blue-700 {\n --tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position);\n}\n\n.bg-cover {\n background-size: cover;\n}\n\n.bg-center {\n background-position: center;\n}\n\n.bg-no-repeat {\n background-repeat: no-repeat;\n}\n\n.object-cover {\n object-fit: cover;\n}\n\n.p-1 {\n padding: 0.25rem;\n}\n\n.p-2 {\n padding: 0.5rem;\n}\n\n.p-2\\.5 {\n padding: 0.625rem;\n}\n\n.p-3 {\n padding: 0.75rem;\n}\n\n.p-4 {\n padding: 1rem;\n}\n\n.p-6 {\n padding: 1.5rem;\n}\n\n.p-\\[\\.75em\\] {\n padding: .75em;\n}\n\n.px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n}\n\n.py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n\n.py-8 {\n padding-top: 2rem;\n padding-bottom: 2rem;\n}\n\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n\n.pb-8 {\n padding-bottom: 2rem;\n}\n\n.pt-10 {\n padding-top: 2.5rem;\n}\n\n.pt-8 {\n padding-top: 2rem;\n}\n\n.text-left {\n text-align: left;\n}\n\n.text-center {\n text-align: center;\n}\n\n.font-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;\n}\n\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n\n.text-\\[\\.75em\\] {\n font-size: .75em;\n}\n\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.font-bold {\n font-weight: 700;\n}\n\n.font-medium {\n font-weight: 500;\n}\n\n.leading-loose {\n line-height: 2;\n}\n\n.leading-none {\n line-height: 1;\n}\n\n.tracking-\\[-1ch\\] {\n letter-spacing: -1ch;\n}\n\n.text-amber-500 {\n --tw-text-opacity: 1;\n color: rgb(245 158 11 / var(--tw-text-opacity));\n}\n\n.text-black {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity));\n}\n\n.text-gray-400 {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity));\n}\n\n.text-green-600 {\n --tw-text-opacity: 1;\n color: rgb(22 163 74 / var(--tw-text-opacity));\n}\n\n.text-neutral-300 {\n --tw-text-opacity: 1;\n color: rgb(212 212 212 / var(--tw-text-opacity));\n}\n\n.text-neutral-400 {\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity));\n}\n\n.text-neutral-500 {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity));\n}\n\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity));\n}\n\n.text-transparent {\n color: transparent;\n}\n\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.text-white\\/20 {\n color: rgb(255 255 255 / 0.2);\n}\n\n.text-white\\/50 {\n color: rgb(255 255 255 / 0.5);\n}\n\n.text-white\\/80 {\n color: rgb(255 255 255 / 0.8);\n}\n\n.underline {\n text-decoration-line: underline;\n}\n\n.decoration-neutral-500 {\n text-decoration-color: #737373;\n}\n\n.underline-offset-4 {\n text-underline-offset: 4px;\n}\n\n.opacity-0 {\n opacity: 0;\n}\n\n.opacity-100 {\n opacity: 1;\n}\n\n.opacity-25 {\n opacity: 0.25;\n}\n\n.opacity-30 {\n opacity: 0.3;\n}\n\n.opacity-50 {\n opacity: 0.5;\n}\n\n.opacity-75 {\n opacity: 0.75;\n}\n\n.outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n.ring-1 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.ring-2 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.ring-neutral-700\\/50 {\n --tw-ring-color: rgb(64 64 64 / 0.5);\n}\n\n.ring-transparent {\n --tw-ring-color: transparent;\n}\n\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.transition-colors {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.duration-100 {\n transition-duration: 100ms;\n}\n\n.duration-300 {\n transition-duration: 300ms;\n}\n\n.ease-linear {\n transition-timing-function: linear;\n}\n\n@keyframes enter {\n\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n\n@keyframes exit {\n\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n\n.animate-in {\n animation-name: enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n}\n\n.animate-out {\n animation-name: exit;\n animation-duration: 150ms;\n --tw-exit-opacity: initial;\n --tw-exit-scale: initial;\n --tw-exit-rotate: initial;\n --tw-exit-translate-x: initial;\n --tw-exit-translate-y: initial;\n}\n\n.fade-in {\n --tw-enter-opacity: 0;\n}\n\n.fade-out {\n --tw-exit-opacity: 0;\n}\n\n.slide-in-from-bottom-16 {\n --tw-enter-translate-y: 4rem;\n}\n\n.slide-in-from-bottom-2 {\n --tw-enter-translate-y: 0.5rem;\n}\n\n.slide-in-from-bottom-8 {\n --tw-enter-translate-y: 2rem;\n}\n\n.slide-in-from-top-2 {\n --tw-enter-translate-y: -0.5rem;\n}\n\n.animate-duration-300 {\n animation-duration: 300ms;\n}\n\n.ease-linear {\n animation-timing-function: linear;\n}\n\n@property --tw-border-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@property --tw-conic-gradient-angle {\n syntax: \'<angle>\';\n inherits: true;\n initial-value: 0deg;\n}\n\n@keyframes border-gradient {\n\n to {\n --tw-border-gradient-angle: 360deg;\n }\n}\n\n.placeholder\\:text-neutral-500::placeholder {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity));\n}\n\n.after\\:select-none::after {\n content: var(--tw-content);\n -webkit-user-select: none;\n user-select: none;\n}\n\n.after\\:content-\\[\\\'\\2026\\\'\\]::after {\n --tw-content: \'\u2026\';\n content: var(--tw-content);\n}\n\n.focus-within\\:border-transparent:focus-within {\n border-color: transparent;\n}\n\n.focus-within\\:ring-orange-500:focus-within {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(249 115 22 / var(--tw-ring-opacity));\n}\n\n.hover\\:bg-blue-500:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-neutral-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.hover\\:bg-orange-400:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(251 146 60 / var(--tw-bg-opacity));\n}\n\n.hover\\:text-white:hover {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.hover\\:text-white\\/40:hover {\n color: rgb(255 255 255 / 0.4);\n}\n\n.hover\\:text-white\\/80:hover {\n color: rgb(255 255 255 / 0.8);\n}\n\n.hover\\:decoration-orange-500:hover {\n text-decoration-color: #f97316;\n}\n\n.hover\\:brightness-125:hover {\n --tw-brightness: brightness(1.25);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.focus\\:border-orange-500:focus {\n --tw-border-opacity: 1;\n border-color: rgb(249 115 22 / var(--tw-border-opacity));\n}\n\n.focus\\:border-yellow-400:focus {\n --tw-border-opacity: 1;\n border-color: rgb(250 204 21 / var(--tw-border-opacity));\n}\n\n.focus\\:bg-neutral-700:focus {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.active\\:bg-orange-600:active {\n --tw-bg-opacity: 1;\n background-color: rgb(234 88 12 / var(--tw-bg-opacity));\n}\n\n.active\\:brightness-150:active {\n --tw-brightness: brightness(1.5);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.group:hover .group-hover\\:pointer-events-none {\n pointer-events: none;\n}\n\n.group:hover .group-hover\\:pointer-events-auto {\n pointer-events: auto;\n}\n\n.group:hover .group-hover\\:inline-block {\n display: inline-block;\n}\n\n.group:hover .group-hover\\:hidden {\n display: none;\n}\n\n.group:hover .group-hover\\:rotate-90 {\n --tw-rotate: 90deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group:hover .group-hover\\:opacity-0 {\n opacity: 0;\n}\n\n.group:hover .group-hover\\:opacity-100 {\n opacity: 1;\n}\n\n.peer:placeholder-shown ~ .peer-placeholder-shown\\:text-neutral-500 {\n --tw-text-opacity: 1;\n color: rgb(115 115 115 / var(--tw-text-opacity));\n}\n\n.aria-busy\\:pointer-events-none[aria-busy="true"] {\n pointer-events: none;\n}\n\n.aria-busy\\:bg-blue-500[aria-busy="true"] {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n\n.aria-disabled\\:pointer-events-none[aria-disabled="true"] {\n pointer-events: none;\n}\n\n.aria-disabled\\:opacity-50[aria-disabled="true"] {\n opacity: 0.5;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:inline {\n display: inline;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:hidden {\n display: none;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:translate-x-0 {\n --tw-translate-x: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:scale-125 {\n --tw-scale-x: 1.25;\n --tw-scale-y: 1.25;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:opacity-100 {\n opacity: 1;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-0 {\n opacity: 0;\n}\n\n.group[aria-busy="true"] .group-aria-busy\\:opacity-100 {\n opacity: 1;\n}\n\n.group\\/button[aria-busy="true"] .group-aria-busy\\/button\\:duration-300 {\n transition-duration: 300ms;\n}\n\n.group[aria-expanded="true"] .group-aria-expanded\\:inline {\n display: inline;\n}\n\n.group[aria-expanded="true"] .group-aria-expanded\\:hidden {\n display: none;\n}\n\n.data-\\[highlighted\\]\\:bg-neutral-200[data-highlighted] {\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n\n.data-\\[state\\=checked\\]\\:bg-neutral-900[data-state="checked"] {\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / var(--tw-bg-opacity));\n}\n\n.links\\:font-medium a[href]:not(.links-unset) {\n font-weight: 500;\n}\n\n.links\\:text-white a[href]:not(.links-unset) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.links\\:underline a[href]:not(.links-unset) {\n text-decoration-line: underline;\n}\n\n.links\\:decoration-neutral-500 a[href]:not(.links-unset) {\n text-decoration-color: #737373;\n}\n\n.links\\:underline-offset-4 a[href]:not(.links-unset) {\n text-underline-offset: 4px;\n}\n\n.hover\\:links\\:decoration-orange-500 a[href]:not(.links-unset):hover {\n text-decoration-color: #f97316;\n}\n\n@media (min-width: 640px) {\n\n .sm\\:items-center {\n align-items: center;\n }\n}\n\n.dark\\:border-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-border-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-border-opacity));\n}\n\n.dark\\:bg-neutral-800:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.dark\\:bg-white\\/10:where([data-theme="dark"], [data-theme="dark"] *) {\n background-color: rgb(255 255 255 / 0.1);\n}\n\n.dark\\:text-white:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.dark\\:hover\\:bg-neutral-700:hover:where([data-theme="dark"], [data-theme="dark"] *) {\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.\\[\\&_\\>_\\:is\\(dt\\2c dd\\)\\]\\:px-1 > :is(dt,dd) {\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n}\n\n.\\[\\&_\\>_dd\\]\\:text-right > dd {\n text-align: right;\n}\n';
|
|
26
26
|
|
|
27
27
|
// src/ui/Shadow.tsx
|
|
28
28
|
import { useResizeObserver } from "usehooks-ts";
|
|
@@ -37,14 +37,17 @@ function FrameProvider({ frame, children }) {
|
|
|
37
37
|
if (value) throw new Error("`FrameProvider` can only be used once.");
|
|
38
38
|
return /* @__PURE__ */ jsx(Context.Provider, { value: { frame }, children });
|
|
39
39
|
}
|
|
40
|
+
function useFrame() {
|
|
41
|
+
const value = useContext(Context);
|
|
42
|
+
if (!value) throw new Error("`useFrame` can only be used within a `FrameProvider`.");
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
40
45
|
|
|
41
46
|
// src/useTheme.ts
|
|
42
47
|
import { useMediaQuery } from "usehooks-ts";
|
|
43
48
|
|
|
44
49
|
// src/EntryKitConfigProvider.tsx
|
|
45
|
-
import "@rainbow-me/rainbowkit/styles.css";
|
|
46
50
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
47
|
-
import { RainbowKitProvider, midnightTheme } from "@rainbow-me/rainbowkit";
|
|
48
51
|
import { useChains } from "wagmi";
|
|
49
52
|
|
|
50
53
|
// src/getBundlerTransport.ts
|
|
@@ -136,8 +139,11 @@ var debug2 = debug.extend("quarry");
|
|
|
136
139
|
|
|
137
140
|
// src/quarry/transports/userOpExecutor.ts
|
|
138
141
|
import { setBalance } from "viem/actions";
|
|
139
|
-
function userOpExecutor({
|
|
140
|
-
|
|
142
|
+
function userOpExecutor({
|
|
143
|
+
executor,
|
|
144
|
+
fallbackDefaultTransport
|
|
145
|
+
}) {
|
|
146
|
+
return (opts) => {
|
|
141
147
|
debug2("using a local user op executor", executor.account.address);
|
|
142
148
|
if (executor.chain.id === 31337) {
|
|
143
149
|
debug2("setting executor balance");
|
|
@@ -172,7 +178,9 @@ function userOpExecutor({ executor }) {
|
|
|
172
178
|
if (method === "eth_estimateUserOperationGas") {
|
|
173
179
|
return await estimateUserOperationGas(params);
|
|
174
180
|
}
|
|
175
|
-
|
|
181
|
+
debug2(`userOpExecutor: method "${method}" not overridden, falling back to fallback transport`);
|
|
182
|
+
const { request: fallbackRequest } = fallbackDefaultTransport(opts);
|
|
183
|
+
return fallbackRequest({ method, params });
|
|
176
184
|
};
|
|
177
185
|
return createTransport({
|
|
178
186
|
key: "userOpExecutor",
|
|
@@ -184,23 +192,31 @@ function userOpExecutor({ executor }) {
|
|
|
184
192
|
}
|
|
185
193
|
|
|
186
194
|
// src/getBundlerTransport.ts
|
|
195
|
+
import { wiresaw } from "@latticexyz/common/internal";
|
|
187
196
|
function getBundlerTransport(chain) {
|
|
197
|
+
if ("wiresaw" in chain.rpcUrls) {
|
|
198
|
+
return wiresaw();
|
|
199
|
+
}
|
|
188
200
|
const bundlerHttpUrl = chain.rpcUrls.bundler?.http[0];
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
201
|
+
if (bundlerHttpUrl) {
|
|
202
|
+
return http(bundlerHttpUrl);
|
|
203
|
+
}
|
|
204
|
+
if (chain.id === 31337) {
|
|
205
|
+
return userOpExecutor({
|
|
206
|
+
executor: createClient({
|
|
207
|
+
chain,
|
|
208
|
+
transport: fallback([webSocket(), http()]),
|
|
209
|
+
account: privateKeyToAccount(keccak256(stringToHex("local user op executor"))),
|
|
210
|
+
pollingInterval: 10
|
|
211
|
+
}).extend(transactionQueue()),
|
|
212
|
+
fallbackDefaultTransport: http()
|
|
213
|
+
});
|
|
199
214
|
}
|
|
200
|
-
|
|
215
|
+
throw new Error(`Chain ${chain.id} config did not include a bundler RPC URL.`);
|
|
201
216
|
}
|
|
202
217
|
|
|
203
218
|
// src/EntryKitConfigProvider.tsx
|
|
219
|
+
import { ConnectKitProvider } from "connectkit";
|
|
204
220
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
205
221
|
var Context2 = createContext2(null);
|
|
206
222
|
function EntryKitConfigProvider({ config, children }) {
|
|
@@ -211,14 +227,14 @@ function EntryKitConfigProvider({ config, children }) {
|
|
|
211
227
|
if (!chain) throw new Error(`Could not find configured chain for chain ID ${config.chainId}.`);
|
|
212
228
|
getBundlerTransport(chain);
|
|
213
229
|
return /* @__PURE__ */ jsx2(
|
|
214
|
-
|
|
230
|
+
ConnectKitProvider,
|
|
215
231
|
{
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
//
|
|
232
|
+
theme: "midnight",
|
|
233
|
+
options: {
|
|
234
|
+
// Prevent Wagmi trying to switch chains after connection
|
|
235
|
+
// https://github.com/wevm/wagmi/blob/f5b717ccf8a5b283263cadc984ba00b354bcefae/packages/core/src/connectors/injected.ts#L174-L182
|
|
236
|
+
initialChainId: 0
|
|
220
237
|
},
|
|
221
|
-
theme: midnightTheme({ borderRadius: "none" }),
|
|
222
238
|
children: /* @__PURE__ */ jsx2(Context2.Provider, { value: { ...config, chain }, children })
|
|
223
239
|
}
|
|
224
240
|
);
|
|
@@ -269,7 +285,9 @@ var Shadow = forwardRef(function Shadow2({ mode, children }, forwardedRef) {
|
|
|
269
285
|
inset: "0",
|
|
270
286
|
width: "100%",
|
|
271
287
|
height: "100%",
|
|
272
|
-
|
|
288
|
+
// one less than ConnectKit's modal z-index
|
|
289
|
+
// so that ConnectKit can overlap properly
|
|
290
|
+
zIndex: "2147483645"
|
|
273
291
|
} : frameSize.width && frameSize.height ? {
|
|
274
292
|
all: "unset",
|
|
275
293
|
display: "inline-grid",
|
|
@@ -368,13 +386,10 @@ function useAccountModal() {
|
|
|
368
386
|
}
|
|
369
387
|
|
|
370
388
|
// src/AccountModal.tsx
|
|
371
|
-
import { twMerge as
|
|
389
|
+
import { twMerge as twMerge20 } from "tailwind-merge";
|
|
372
390
|
|
|
373
391
|
// src/AccountModalContent.tsx
|
|
374
|
-
import { useAccount as
|
|
375
|
-
|
|
376
|
-
// src/ConnectWallet.tsx
|
|
377
|
-
import { useAccount } from "wagmi";
|
|
392
|
+
import { useAccount as useAccount8, useConnectorClient } from "wagmi";
|
|
378
393
|
|
|
379
394
|
// src/ui/Button.tsx
|
|
380
395
|
import { twMerge as twMerge3 } from "tailwind-merge";
|
|
@@ -441,7 +456,7 @@ var Button = ({ pending, variant, type, className, children, disabled, ...props
|
|
|
441
456
|
};
|
|
442
457
|
|
|
443
458
|
// src/ConnectWallet.tsx
|
|
444
|
-
import {
|
|
459
|
+
import { useModal } from "connectkit";
|
|
445
460
|
|
|
446
461
|
// src/icons/Logo.tsx
|
|
447
462
|
import { twMerge as twMerge4 } from "tailwind-merge";
|
|
@@ -501,7 +516,7 @@ function AppInfo() {
|
|
|
501
516
|
return /* @__PURE__ */ jsxs6("div", { className: "flex-grow flex flex-col items-center justify-center gap-2", children: [
|
|
502
517
|
/* @__PURE__ */ jsx8("div", { className: "w-16 h-16 m-2", children: !appIconLoading ? hasAppIcon ? /* @__PURE__ */ jsx8("img", { src: appIcon, className: "w-full h-full object-cover" }) : (
|
|
503
518
|
// TODO: swap with favicon
|
|
504
|
-
/* @__PURE__ */ jsx8(Logo, { className: "w-full h-full text-orange-500
|
|
519
|
+
/* @__PURE__ */ jsx8(Logo, { className: "w-full h-full text-orange-500 bg-neutral-800" })
|
|
505
520
|
) : null }),
|
|
506
521
|
/* @__PURE__ */ jsx8("div", { className: "text-2xl text-white text-center", children: appName })
|
|
507
522
|
] });
|
|
@@ -509,18 +524,17 @@ function AppInfo() {
|
|
|
509
524
|
|
|
510
525
|
// src/ConnectWallet.tsx
|
|
511
526
|
import { twMerge as twMerge5 } from "tailwind-merge";
|
|
512
|
-
import { useEffect as useEffect3,
|
|
527
|
+
import { useEffect as useEffect3, useRef as useRef2 } from "react";
|
|
513
528
|
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
514
529
|
function ConnectWallet() {
|
|
515
|
-
const
|
|
516
|
-
const
|
|
517
|
-
const [hasAutoOpened, setHasAutoOpened] = useState2(false);
|
|
530
|
+
const { open, setOpen } = useModal();
|
|
531
|
+
const hasAutoOpenedRef = useRef2(false);
|
|
518
532
|
useEffect3(() => {
|
|
519
|
-
if (!
|
|
520
|
-
|
|
521
|
-
|
|
533
|
+
if (!open && !hasAutoOpenedRef.current) {
|
|
534
|
+
setOpen(true);
|
|
535
|
+
hasAutoOpenedRef.current = true;
|
|
522
536
|
}
|
|
523
|
-
}, [
|
|
537
|
+
}, [open, setOpen]);
|
|
524
538
|
return /* @__PURE__ */ jsxs7(
|
|
525
539
|
"div",
|
|
526
540
|
{
|
|
@@ -532,8 +546,7 @@ function ConnectWallet() {
|
|
|
532
546
|
{
|
|
533
547
|
variant: "secondary",
|
|
534
548
|
className: "self-auto flex justify-center",
|
|
535
|
-
|
|
536
|
-
onClick: openConnectModal,
|
|
549
|
+
onClick: () => setOpen(true),
|
|
537
550
|
autoFocus: true,
|
|
538
551
|
children: "Connect wallet"
|
|
539
552
|
},
|
|
@@ -545,16 +558,39 @@ function ConnectWallet() {
|
|
|
545
558
|
}
|
|
546
559
|
|
|
547
560
|
// src/onboarding/ConnectedSteps.tsx
|
|
548
|
-
import { useEffect as
|
|
549
|
-
import { twMerge as
|
|
561
|
+
import { useEffect as useEffect15, useMemo as useMemo4, useRef as useRef5, useState as useState5 } from "react";
|
|
562
|
+
import { twMerge as twMerge18 } from "tailwind-merge";
|
|
550
563
|
|
|
551
|
-
// src/onboarding/
|
|
552
|
-
import {
|
|
553
|
-
|
|
564
|
+
// src/onboarding/usePrerequisites.ts
|
|
565
|
+
import { useClient as useClient6, useConfig } from "wagmi";
|
|
566
|
+
import { getBalanceQueryOptions as getBalanceQueryOptions2 } from "wagmi/query";
|
|
567
|
+
import { queryOptions as queryOptions6, skipToken as skipToken6, useQuery as useQuery7, useQueryClient } from "@tanstack/react-query";
|
|
568
|
+
|
|
569
|
+
// src/getPaymaster.ts
|
|
570
|
+
function getPaymaster(chain) {
|
|
571
|
+
const contracts = chain.contracts ?? {};
|
|
572
|
+
if ("quarryPaymaster" in contracts && contracts.quarryPaymaster != null) {
|
|
573
|
+
if ("address" in contracts.quarryPaymaster) {
|
|
574
|
+
return {
|
|
575
|
+
type: "quarry",
|
|
576
|
+
address: contracts.quarryPaymaster.address,
|
|
577
|
+
isGasPass: !!chain.rpcUrls.quarryPassIssuer?.http?.[0]
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
if ("paymaster" in contracts && contracts.paymaster != null) {
|
|
582
|
+
if ("address" in contracts.paymaster) {
|
|
583
|
+
return {
|
|
584
|
+
type: "simple",
|
|
585
|
+
address: contracts.paymaster.address
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
554
590
|
|
|
555
591
|
// src/onboarding/quarry/useAllowance.ts
|
|
556
592
|
import { useClient } from "wagmi";
|
|
557
|
-
import { queryOptions, useQuery as useQuery2 } from "@tanstack/react-query";
|
|
593
|
+
import { queryOptions, skipToken, useQuery as useQuery2 } from "@tanstack/react-query";
|
|
558
594
|
|
|
559
595
|
// src/quarry/getAllowance.ts
|
|
560
596
|
import { numberToHex as numberToHex2 } from "viem";
|
|
@@ -565,7 +601,11 @@ import { parseAbi } from "viem";
|
|
|
565
601
|
var paymasterAbi = parseAbi([
|
|
566
602
|
"error SpenderSystem_AlreadyRegistered(address spender, address user)",
|
|
567
603
|
"error SpenderSystem_HasOwnBalance(address spender)",
|
|
568
|
-
"
|
|
604
|
+
"error BalanceSystem_BalanceTooHigh(address user, uint256 balance, uint256 max)",
|
|
605
|
+
"error BalanceSystem_InsufficientBalance(address user, uint256 amount, uint256 balance)",
|
|
606
|
+
"function registerSpender(address spender)",
|
|
607
|
+
"function depositTo(address to) payable",
|
|
608
|
+
"function withdrawTo(address to, uint256 amount)"
|
|
569
609
|
]);
|
|
570
610
|
var paymasterConfig = defineStore({
|
|
571
611
|
namespaces: {
|
|
@@ -579,6 +619,13 @@ var paymasterConfig = defineStore({
|
|
|
579
619
|
},
|
|
580
620
|
key: ["user"]
|
|
581
621
|
},
|
|
622
|
+
Balance: {
|
|
623
|
+
schema: {
|
|
624
|
+
user: "address",
|
|
625
|
+
balance: "uint256"
|
|
626
|
+
},
|
|
627
|
+
key: ["user"]
|
|
628
|
+
},
|
|
582
629
|
Grantor: {
|
|
583
630
|
schema: {
|
|
584
631
|
grantor: "address",
|
|
@@ -628,29 +675,6 @@ var paymasterTables = paymasterConfig.namespaces.root.tables;
|
|
|
628
675
|
import { getRecord, getStaticDataLocation } from "@latticexyz/store/internal";
|
|
629
676
|
import { getKeyTuple } from "@latticexyz/protocol-parser/internal";
|
|
630
677
|
import { setStorageAt } from "viem/actions";
|
|
631
|
-
|
|
632
|
-
// src/getPaymaster.ts
|
|
633
|
-
function getPaymaster(chain) {
|
|
634
|
-
const contracts = chain.contracts ?? {};
|
|
635
|
-
if ("quarryPaymaster" in contracts && contracts.quarryPaymaster != null) {
|
|
636
|
-
if ("address" in contracts.quarryPaymaster) {
|
|
637
|
-
return {
|
|
638
|
-
type: "quarry",
|
|
639
|
-
address: contracts.quarryPaymaster.address
|
|
640
|
-
};
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
if ("paymaster" in contracts && contracts.paymaster != null) {
|
|
644
|
-
if ("address" in contracts.paymaster) {
|
|
645
|
-
return {
|
|
646
|
-
type: "simple",
|
|
647
|
-
address: contracts.paymaster.address
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
// src/quarry/getAllowance.ts
|
|
654
678
|
async function getAllowance({ client, userAddress }) {
|
|
655
679
|
const paymaster = getPaymaster(client.chain);
|
|
656
680
|
if (paymaster?.type !== "quarry") return null;
|
|
@@ -684,13 +708,10 @@ function getAllowanceQueryOptions({
|
|
|
684
708
|
client,
|
|
685
709
|
userAddress
|
|
686
710
|
}) {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
client && userAddress ? {
|
|
690
|
-
|
|
691
|
-
queryFn: () => getAllowance({ client, userAddress })
|
|
692
|
-
} : { queryKey, enabled: false }
|
|
693
|
-
);
|
|
711
|
+
return queryOptions({
|
|
712
|
+
queryKey: ["getAllowance", client?.uid, userAddress],
|
|
713
|
+
queryFn: client && userAddress ? () => getAllowance({ client, userAddress }) : skipToken
|
|
714
|
+
});
|
|
694
715
|
}
|
|
695
716
|
function useAllowance(userAddress) {
|
|
696
717
|
const { chainId } = useEntryKitConfig();
|
|
@@ -700,7 +721,7 @@ function useAllowance(userAddress) {
|
|
|
700
721
|
|
|
701
722
|
// src/onboarding/quarry/useSpender.ts
|
|
702
723
|
import { useClient as useClient2 } from "wagmi";
|
|
703
|
-
import { queryOptions as queryOptions2, useQuery as useQuery3 } from "@tanstack/react-query";
|
|
724
|
+
import { queryOptions as queryOptions2, skipToken as skipToken2, useQuery as useQuery3 } from "@tanstack/react-query";
|
|
704
725
|
|
|
705
726
|
// src/onboarding/quarry/getSpender.ts
|
|
706
727
|
import { getRecord as getRecord2 } from "@latticexyz/store/internal";
|
|
@@ -722,18 +743,15 @@ function getSpenderQueryOptions({
|
|
|
722
743
|
userAddress,
|
|
723
744
|
sessionAddress
|
|
724
745
|
}) {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
client && userAddress && sessionAddress ? {
|
|
728
|
-
|
|
729
|
-
queryFn: () => getSpender({ client, userAddress, sessionAddress })
|
|
730
|
-
} : { queryKey, enabled: false }
|
|
731
|
-
);
|
|
746
|
+
return queryOptions2({
|
|
747
|
+
queryKey: ["getSpender", client?.uid, userAddress, sessionAddress],
|
|
748
|
+
queryFn: client && userAddress && sessionAddress ? () => getSpender({ client, userAddress, sessionAddress }) : skipToken2
|
|
749
|
+
});
|
|
732
750
|
}
|
|
733
751
|
|
|
734
752
|
// src/onboarding/useDelegation.ts
|
|
735
753
|
import { useClient as useClient3 } from "wagmi";
|
|
736
|
-
import { queryOptions as queryOptions3, useQuery as useQuery4 } from "@tanstack/react-query";
|
|
754
|
+
import { queryOptions as queryOptions3, skipToken as skipToken3, useQuery as useQuery4 } from "@tanstack/react-query";
|
|
737
755
|
|
|
738
756
|
// src/onboarding/getDelegation.ts
|
|
739
757
|
import { getRecord as getRecord3 } from "@latticexyz/store/internal";
|
|
@@ -776,22 +794,15 @@ function getDelegationQueryOptions({
|
|
|
776
794
|
userAddress,
|
|
777
795
|
sessionAddress
|
|
778
796
|
}) {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
client && userAddress && sessionAddress ? {
|
|
782
|
-
|
|
783
|
-
queryFn: () => getDelegation({ client, worldAddress, userAddress, sessionAddress })
|
|
784
|
-
} : { queryKey, enabled: false }
|
|
785
|
-
);
|
|
797
|
+
return queryOptions3({
|
|
798
|
+
queryKey: ["getDelegation", client?.uid, worldAddress, userAddress, sessionAddress],
|
|
799
|
+
queryFn: client && userAddress && sessionAddress ? () => getDelegation({ client, worldAddress, userAddress, sessionAddress }) : skipToken3
|
|
800
|
+
});
|
|
786
801
|
}
|
|
787
802
|
|
|
788
|
-
// src/onboarding/usePrerequisites.ts
|
|
789
|
-
import { queryOptions as queryOptions5, useQuery as useQuery6, useQueryClient } from "@tanstack/react-query";
|
|
790
|
-
import { useClient as useClient5, useConfig } from "wagmi";
|
|
791
|
-
|
|
792
803
|
// src/useSessionAccount.ts
|
|
793
804
|
import { useClient as useClient4 } from "wagmi";
|
|
794
|
-
import { queryOptions as queryOptions4, useQuery as useQuery5 } from "@tanstack/react-query";
|
|
805
|
+
import { queryOptions as queryOptions4, skipToken as skipToken4, useQuery as useQuery5 } from "@tanstack/react-query";
|
|
795
806
|
|
|
796
807
|
// src/getSessionAccount.ts
|
|
797
808
|
import { toSimpleSmartAccount } from "permissionless/accounts";
|
|
@@ -855,20 +866,50 @@ function getSessionAccountQueryOptions({
|
|
|
855
866
|
client,
|
|
856
867
|
userAddress
|
|
857
868
|
}) {
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
client && userAddress ? {
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
869
|
+
return queryOptions4({
|
|
870
|
+
queryKey: ["getSessionAccount", client?.uid, userAddress],
|
|
871
|
+
queryFn: client && userAddress ? () => getSessionAccount({ client, userAddress }) : skipToken4,
|
|
872
|
+
staleTime: Infinity,
|
|
873
|
+
// TODO: replace with function to retry only connection errors
|
|
874
|
+
retry: false
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
// src/onboarding/quarry/useBalance.ts
|
|
879
|
+
import { useClient as useClient5 } from "wagmi";
|
|
880
|
+
import { queryOptions as queryOptions5, skipToken as skipToken5, useQuery as useQuery6 } from "@tanstack/react-query";
|
|
881
|
+
|
|
882
|
+
// src/quarry/getBalance.ts
|
|
883
|
+
import { getRecord as getRecord4 } from "@latticexyz/store/internal";
|
|
884
|
+
async function getBalance({ client, userAddress }) {
|
|
885
|
+
const paymaster = getPaymaster(client.chain);
|
|
886
|
+
if (paymaster?.type !== "quarry") return null;
|
|
887
|
+
const record = await getRecord4(client, {
|
|
888
|
+
address: paymaster.address,
|
|
889
|
+
table: paymasterTables.Balance,
|
|
890
|
+
key: { user: userAddress },
|
|
891
|
+
blockTag: "pending"
|
|
892
|
+
});
|
|
893
|
+
return record.balance;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
// src/onboarding/quarry/useBalance.ts
|
|
897
|
+
function getBalanceQueryOptions({
|
|
898
|
+
client,
|
|
899
|
+
userAddress
|
|
900
|
+
}) {
|
|
901
|
+
return queryOptions5({
|
|
902
|
+
queryKey: ["getBalance", client?.uid, userAddress],
|
|
903
|
+
queryFn: client && userAddress ? () => getBalance({ client, userAddress }) : skipToken5
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
function useBalance(userAddress) {
|
|
907
|
+
const { chainId } = useEntryKitConfig();
|
|
908
|
+
const client = useClient5({ chainId });
|
|
909
|
+
return useQuery6(getBalanceQueryOptions({ client, userAddress }));
|
|
868
910
|
}
|
|
869
911
|
|
|
870
912
|
// src/onboarding/usePrerequisites.ts
|
|
871
|
-
import { getBalanceQueryOptions } from "wagmi/query";
|
|
872
913
|
function getPrequisitesQueryOptions({
|
|
873
914
|
queryClient,
|
|
874
915
|
config,
|
|
@@ -876,46 +917,46 @@ function getPrequisitesQueryOptions({
|
|
|
876
917
|
userAddress,
|
|
877
918
|
worldAddress
|
|
878
919
|
}) {
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
client && userAddress ? {
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
);
|
|
920
|
+
return queryOptions6({
|
|
921
|
+
queryKey: ["getPrerequisites", client?.uid, userAddress],
|
|
922
|
+
queryFn: client && userAddress ? async () => {
|
|
923
|
+
const paymaster = getPaymaster(client.chain);
|
|
924
|
+
const {
|
|
925
|
+
account: { address: sessionAddress }
|
|
926
|
+
} = await queryClient.fetchQuery(getSessionAccountQueryOptions({ client, userAddress }));
|
|
927
|
+
const [sessionBalance, allowance, spender, quarryBalance, hasDelegation] = await Promise.all([
|
|
928
|
+
!paymaster ? queryClient.fetchQuery(
|
|
929
|
+
getBalanceQueryOptions2(config, { chainId: client.chain.id, address: sessionAddress })
|
|
930
|
+
) : null,
|
|
931
|
+
paymaster?.type === "quarry" ? queryClient.fetchQuery(getAllowanceQueryOptions({ client, userAddress })) : null,
|
|
932
|
+
paymaster?.type === "quarry" ? queryClient.fetchQuery(getSpenderQueryOptions({ client, userAddress, sessionAddress })) : null,
|
|
933
|
+
paymaster?.type === "quarry" ? queryClient.fetchQuery(getBalanceQueryOptions({ client, userAddress })) : null,
|
|
934
|
+
queryClient.fetchQuery(getDelegationQueryOptions({ client, worldAddress, userAddress, sessionAddress }))
|
|
935
|
+
]);
|
|
936
|
+
const hasAllowance = allowance == null || allowance > 0n;
|
|
937
|
+
const isSpender = spender == null ? true : spender;
|
|
938
|
+
const hasGasBalance = sessionBalance == null || sessionBalance.value > 0n;
|
|
939
|
+
const hasQuarryGasBalance = quarryBalance == null || quarryBalance > 0n;
|
|
940
|
+
return {
|
|
941
|
+
sessionAddress,
|
|
942
|
+
hasAllowance,
|
|
943
|
+
isSpender,
|
|
944
|
+
hasGasBalance,
|
|
945
|
+
hasQuarryGasBalance,
|
|
946
|
+
hasDelegation,
|
|
947
|
+
// we intentionally don't enforce an allowance/gas balance here
|
|
948
|
+
complete: isSpender && hasDelegation
|
|
949
|
+
};
|
|
950
|
+
} : skipToken6,
|
|
951
|
+
retry: false
|
|
952
|
+
});
|
|
912
953
|
}
|
|
913
954
|
function usePrerequisites(userAddress) {
|
|
914
955
|
const queryClient = useQueryClient();
|
|
915
956
|
const config = useConfig();
|
|
916
957
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
917
|
-
const client =
|
|
918
|
-
const prereqs =
|
|
958
|
+
const client = useClient6({ chainId });
|
|
959
|
+
const prereqs = useQuery7(
|
|
919
960
|
getPrequisitesQueryOptions({
|
|
920
961
|
queryClient,
|
|
921
962
|
config,
|
|
@@ -932,10 +973,10 @@ function usePrerequisites(userAddress) {
|
|
|
932
973
|
import { useDisconnect } from "wagmi";
|
|
933
974
|
|
|
934
975
|
// src/useENS.ts
|
|
935
|
-
import { useQuery as
|
|
976
|
+
import { useQuery as useQuery8 } from "@tanstack/react-query";
|
|
936
977
|
function useENS(address) {
|
|
937
978
|
const normalizedAddress = address?.toLowerCase();
|
|
938
|
-
return
|
|
979
|
+
return useQuery8({
|
|
939
980
|
enabled: !!normalizedAddress,
|
|
940
981
|
queryKey: ["ens", normalizedAddress],
|
|
941
982
|
queryFn: async () => {
|
|
@@ -1054,8 +1095,11 @@ function Wallet({ isActive, isExpanded, userAddress }) {
|
|
|
1054
1095
|
] });
|
|
1055
1096
|
}
|
|
1056
1097
|
|
|
1057
|
-
// src/onboarding/quarry/
|
|
1098
|
+
// src/onboarding/quarry/Allowance.tsx
|
|
1058
1099
|
import { parseEther as parseEther3 } from "viem";
|
|
1100
|
+
|
|
1101
|
+
// src/onboarding/quarry/useClaimGasPass.ts
|
|
1102
|
+
import { parseEther as parseEther2 } from "viem";
|
|
1059
1103
|
import { useMutation, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
1060
1104
|
|
|
1061
1105
|
// src/quarry/transports/quarryPassIssuer.ts
|
|
@@ -1085,11 +1129,11 @@ async function claimGasPass({ chain, userAddress }) {
|
|
|
1085
1129
|
}
|
|
1086
1130
|
|
|
1087
1131
|
// src/onboarding/quarry/useClaimGasPass.ts
|
|
1088
|
-
import { useClient as
|
|
1132
|
+
import { useClient as useClient7 } from "wagmi";
|
|
1089
1133
|
function useClaimGasPass() {
|
|
1090
1134
|
const queryClient = useQueryClient2();
|
|
1091
1135
|
const { chain } = useEntryKitConfig();
|
|
1092
|
-
const client =
|
|
1136
|
+
const client = useClient7({ chainId: chain.id });
|
|
1093
1137
|
const mutationKey = ["claimGasPass", chain.id];
|
|
1094
1138
|
return useMutation({
|
|
1095
1139
|
retry: 0,
|
|
@@ -1097,7 +1141,7 @@ function useClaimGasPass() {
|
|
|
1097
1141
|
mutationFn: async (userAddress) => {
|
|
1098
1142
|
if (chain.id === 31337) {
|
|
1099
1143
|
if (!client) throw new Error("No client?");
|
|
1100
|
-
await setAllowanceSlot({ client, userAddress, allowance:
|
|
1144
|
+
await setAllowanceSlot({ client, userAddress, allowance: parseEther2("1") });
|
|
1101
1145
|
} else {
|
|
1102
1146
|
await claimGasPass({ chain, userAddress });
|
|
1103
1147
|
}
|
|
@@ -1135,8 +1179,12 @@ function EthIcon({ className, ...props }) {
|
|
|
1135
1179
|
import { formatEther } from "viem";
|
|
1136
1180
|
function formatBalance(wei) {
|
|
1137
1181
|
const formatted = formatEther(wei);
|
|
1138
|
-
const
|
|
1139
|
-
|
|
1182
|
+
const parsed = parseFloat(formatted);
|
|
1183
|
+
if (parsed > 0 && parsed < 1e-5) {
|
|
1184
|
+
return "<0.00001";
|
|
1185
|
+
}
|
|
1186
|
+
const magnitude = Math.floor(parsed).toString().length;
|
|
1187
|
+
return parsed.toLocaleString("en-US", { maximumFractionDigits: Math.max(0, 6 - magnitude) });
|
|
1140
1188
|
}
|
|
1141
1189
|
|
|
1142
1190
|
// src/ui/Balance.tsx
|
|
@@ -1172,7 +1220,7 @@ function Allowance({ isActive, isExpanded, userAddress }) {
|
|
|
1172
1220
|
const claimGasPass2 = useShowMutationError(useClaimGasPass());
|
|
1173
1221
|
useEffect6(() => {
|
|
1174
1222
|
const timer = setTimeout(() => {
|
|
1175
|
-
if (isActive && claimGasPass2.status === "idle" && allowance.isSuccess && allowance.data != null && allowance.data <
|
|
1223
|
+
if (isActive && claimGasPass2.status === "idle" && allowance.isSuccess && allowance.data != null && allowance.data < parseEther3("0.01")) {
|
|
1176
1224
|
claimGasPass2.mutate(userAddress);
|
|
1177
1225
|
}
|
|
1178
1226
|
});
|
|
@@ -1200,6 +1248,9 @@ function Allowance({ isActive, isExpanded, userAddress }) {
|
|
|
1200
1248
|
] });
|
|
1201
1249
|
}
|
|
1202
1250
|
|
|
1251
|
+
// src/onboarding/Session.tsx
|
|
1252
|
+
import { useEffect as useEffect7 } from "react";
|
|
1253
|
+
|
|
1203
1254
|
// src/onboarding/useSetupSession.ts
|
|
1204
1255
|
import { encodeFunctionData } from "viem";
|
|
1205
1256
|
import { useMutation as useMutation2, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
|
|
@@ -1213,11 +1264,12 @@ function defineCall(call) {
|
|
|
1213
1264
|
}
|
|
1214
1265
|
|
|
1215
1266
|
// src/onboarding/useSetupSession.ts
|
|
1216
|
-
import { useClient as
|
|
1267
|
+
import { useClient as useClient8 } from "wagmi";
|
|
1217
1268
|
import { resourceToHex as resourceToHex2 } from "@latticexyz/common";
|
|
1218
1269
|
import IBaseWorldAbi from "@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.abi.json";
|
|
1219
1270
|
|
|
1220
1271
|
// src/utils/callWithSignature.ts
|
|
1272
|
+
import { parseErc6492Signature } from "viem";
|
|
1221
1273
|
import { writeContract as viem_writeContract } from "viem/actions";
|
|
1222
1274
|
import { getAction as getAction3 } from "viem/utils";
|
|
1223
1275
|
|
|
@@ -1225,7 +1277,7 @@ import { getAction as getAction3 } from "viem/utils";
|
|
|
1225
1277
|
import { toHex } from "viem";
|
|
1226
1278
|
import { signTypedData } from "viem/actions";
|
|
1227
1279
|
import { callWithSignatureTypes } from "@latticexyz/world-module-callwithsignature/internal";
|
|
1228
|
-
import { getRecord as
|
|
1280
|
+
import { getRecord as getRecord5 } from "@latticexyz/store/internal";
|
|
1229
1281
|
import moduleConfig from "@latticexyz/world-module-callwithsignature/mud.config";
|
|
1230
1282
|
import { hexToResource } from "@latticexyz/common";
|
|
1231
1283
|
import { getAction as getAction2 } from "viem/utils";
|
|
@@ -1237,7 +1289,7 @@ async function signCall({
|
|
|
1237
1289
|
nonce: initialNonce,
|
|
1238
1290
|
client
|
|
1239
1291
|
}) {
|
|
1240
|
-
const nonce = initialNonce ?? (client ? (await
|
|
1292
|
+
const nonce = initialNonce ?? (client ? (await getRecord5(client, {
|
|
1241
1293
|
address: worldAddress,
|
|
1242
1294
|
table: moduleConfig.tables.CallWithSignatureNonces,
|
|
1243
1295
|
key: { signer: userClient.account.address },
|
|
@@ -1272,7 +1324,13 @@ async function callWithSignature({
|
|
|
1272
1324
|
sessionClient,
|
|
1273
1325
|
...opts
|
|
1274
1326
|
}) {
|
|
1275
|
-
const
|
|
1327
|
+
const rawSignature = await signCall(opts);
|
|
1328
|
+
const { address, signature } = parseErc6492Signature(rawSignature);
|
|
1329
|
+
if (address != null) {
|
|
1330
|
+
throw new Error(
|
|
1331
|
+
"ERC-6492 signatures, like from Coinbase Smart Wallet, are not yet supported. Try using a different wallet?"
|
|
1332
|
+
);
|
|
1333
|
+
}
|
|
1276
1334
|
return getAction3(
|
|
1277
1335
|
sessionClient,
|
|
1278
1336
|
viem_writeContract,
|
|
@@ -1290,7 +1348,7 @@ import { systemsConfig as worldSystemsConfig } from "@latticexyz/world/mud.confi
|
|
|
1290
1348
|
function useSetupSession({ userClient }) {
|
|
1291
1349
|
const queryClient = useQueryClient3();
|
|
1292
1350
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
1293
|
-
const client =
|
|
1351
|
+
const client = useClient8({ chainId });
|
|
1294
1352
|
const mutationKey = ["setupSession", client?.chain.id, userClient.account.address];
|
|
1295
1353
|
return useMutation2({
|
|
1296
1354
|
retry: 0,
|
|
@@ -1396,20 +1454,18 @@ function useSetupSession({ userClient }) {
|
|
|
1396
1454
|
});
|
|
1397
1455
|
}
|
|
1398
1456
|
|
|
1399
|
-
// src/onboarding/Session.tsx
|
|
1400
|
-
import { useEffect as useEffect7 } from "react";
|
|
1401
|
-
|
|
1402
1457
|
// src/useSessionClient.ts
|
|
1403
|
-
import { useClient as
|
|
1458
|
+
import { useClient as useClient9 } from "wagmi";
|
|
1404
1459
|
import {
|
|
1405
|
-
queryOptions as
|
|
1406
|
-
|
|
1460
|
+
queryOptions as queryOptions7,
|
|
1461
|
+
skipToken as skipToken7,
|
|
1462
|
+
useQuery as useQuery9,
|
|
1407
1463
|
useQueryClient as useQueryClient4
|
|
1408
1464
|
} from "@tanstack/react-query";
|
|
1409
1465
|
|
|
1410
1466
|
// src/getSessionClient.ts
|
|
1411
1467
|
import { smartAccountActions } from "permissionless";
|
|
1412
|
-
import { callFrom } from "@latticexyz/world/internal";
|
|
1468
|
+
import { callFrom, sendUserOperationFrom } from "@latticexyz/world/internal";
|
|
1413
1469
|
|
|
1414
1470
|
// src/createBundlerClient.ts
|
|
1415
1471
|
import {
|
|
@@ -1468,6 +1524,12 @@ async function getSessionClient({
|
|
|
1468
1524
|
delegatorAddress: userAddress,
|
|
1469
1525
|
publicClient: client
|
|
1470
1526
|
})
|
|
1527
|
+
).extend(
|
|
1528
|
+
sendUserOperationFrom({
|
|
1529
|
+
worldAddress,
|
|
1530
|
+
delegatorAddress: userAddress,
|
|
1531
|
+
publicClient: client
|
|
1532
|
+
})
|
|
1471
1533
|
).extend(() => ({ userAddress, worldAddress, internal_signer: sessionSigner }));
|
|
1472
1534
|
return sessionClient;
|
|
1473
1535
|
}
|
|
@@ -1482,32 +1544,29 @@ function getSessionClientQueryOptions({
|
|
|
1482
1544
|
userAddress,
|
|
1483
1545
|
worldAddress
|
|
1484
1546
|
}) {
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
userAddress ? {
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
retry: false
|
|
1503
|
-
} : { queryKey, enabled: false }
|
|
1504
|
-
);
|
|
1547
|
+
return queryOptions7({
|
|
1548
|
+
queryKey: ["getSessionClient", client?.uid, userAddress, worldAddress],
|
|
1549
|
+
queryFn: userAddress ? async () => {
|
|
1550
|
+
const { account: sessionAccount, signer: sessionSigner } = await queryClient.fetchQuery(
|
|
1551
|
+
getSessionAccountQueryOptions({ client, userAddress })
|
|
1552
|
+
);
|
|
1553
|
+
return await getSessionClient({
|
|
1554
|
+
sessionAccount,
|
|
1555
|
+
sessionSigner,
|
|
1556
|
+
userAddress,
|
|
1557
|
+
worldAddress
|
|
1558
|
+
});
|
|
1559
|
+
} : skipToken7,
|
|
1560
|
+
staleTime: Infinity,
|
|
1561
|
+
// TODO: replace with function to retry only connection errors
|
|
1562
|
+
retry: false
|
|
1563
|
+
});
|
|
1505
1564
|
}
|
|
1506
1565
|
function useSessionClient(userAddress) {
|
|
1507
1566
|
const queryClient = useQueryClient4();
|
|
1508
1567
|
const { chainId, worldAddress } = useEntryKitConfig();
|
|
1509
|
-
const client =
|
|
1510
|
-
return
|
|
1568
|
+
const client = useClient9({ chainId });
|
|
1569
|
+
return useQuery9(
|
|
1511
1570
|
getSessionClientQueryOptions({
|
|
1512
1571
|
queryClient,
|
|
1513
1572
|
client,
|
|
@@ -1523,9 +1582,11 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
|
|
|
1523
1582
|
const sessionClient = useShowQueryError(useSessionClient(userClient.account.address));
|
|
1524
1583
|
const setup = useShowMutationError(useSetupSession({ userClient }));
|
|
1525
1584
|
const hasSession = !registerDelegation && !registerDelegation;
|
|
1585
|
+
const { data: prerequisites } = usePrerequisites(userClient.account.address);
|
|
1586
|
+
const { hasAllowance, hasGasBalance, hasQuarryGasBalance } = prerequisites ?? {};
|
|
1526
1587
|
useEffect7(() => {
|
|
1527
1588
|
const timer = setTimeout(() => {
|
|
1528
|
-
if (isActive && setup.status === "idle" && sessionClient.data && !hasSession) {
|
|
1589
|
+
if (isActive && setup.status === "idle" && sessionClient.data && !hasSession && (hasAllowance || hasGasBalance || hasQuarryGasBalance)) {
|
|
1529
1590
|
setup.mutate({
|
|
1530
1591
|
sessionClient: sessionClient.data,
|
|
1531
1592
|
registerSpender,
|
|
@@ -1534,7 +1595,17 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
|
|
|
1534
1595
|
}
|
|
1535
1596
|
});
|
|
1536
1597
|
return () => clearTimeout(timer);
|
|
1537
|
-
}, [
|
|
1598
|
+
}, [
|
|
1599
|
+
hasSession,
|
|
1600
|
+
isActive,
|
|
1601
|
+
registerDelegation,
|
|
1602
|
+
registerSpender,
|
|
1603
|
+
sessionClient,
|
|
1604
|
+
setup,
|
|
1605
|
+
hasAllowance,
|
|
1606
|
+
hasGasBalance,
|
|
1607
|
+
hasQuarryGasBalance
|
|
1608
|
+
]);
|
|
1538
1609
|
return /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-4", children: [
|
|
1539
1610
|
/* @__PURE__ */ jsxs13("div", { className: "flex justify-between gap-4", children: [
|
|
1540
1611
|
/* @__PURE__ */ jsxs13("div", { children: [
|
|
@@ -1562,7 +1633,10 @@ function Session({ isActive, isExpanded, userClient, registerSpender, registerDe
|
|
|
1562
1633
|
}
|
|
1563
1634
|
|
|
1564
1635
|
// src/onboarding/GasBalance.tsx
|
|
1565
|
-
import {
|
|
1636
|
+
import { useEffect as useEffect9, useState as useState2 } from "react";
|
|
1637
|
+
import { parseEther as parseEther4 } from "viem";
|
|
1638
|
+
import { useQueryClient as useQueryClient6 } from "@tanstack/react-query";
|
|
1639
|
+
import { useBalance as useBalance2, useWatchBlockNumber } from "wagmi";
|
|
1566
1640
|
|
|
1567
1641
|
// src/data/relayChains.json
|
|
1568
1642
|
var relayChains_default = {
|
|
@@ -1847,11 +1921,11 @@ var relayChains_default = {
|
|
|
1847
1921
|
// src/onboarding/useSetBalance.ts
|
|
1848
1922
|
import { useQueryClient as useQueryClient5, useMutation as useMutation3 } from "@tanstack/react-query";
|
|
1849
1923
|
import { setBalance as setBalance2 } from "viem/actions";
|
|
1850
|
-
import { useClient as
|
|
1924
|
+
import { useClient as useClient10 } from "wagmi";
|
|
1851
1925
|
function useSetBalance() {
|
|
1852
1926
|
const queryClient = useQueryClient5();
|
|
1853
1927
|
const { chainId } = useEntryKitConfig();
|
|
1854
|
-
const client =
|
|
1928
|
+
const client = useClient10({ chainId });
|
|
1855
1929
|
return useMutation3({
|
|
1856
1930
|
retry: 0,
|
|
1857
1931
|
mutationKey: ["setBalance", chainId],
|
|
@@ -1867,21 +1941,93 @@ function useSetBalance() {
|
|
|
1867
1941
|
});
|
|
1868
1942
|
}
|
|
1869
1943
|
|
|
1944
|
+
// src/errors/usePrevious.ts
|
|
1945
|
+
import { useEffect as useEffect8, useRef as useRef3 } from "react";
|
|
1946
|
+
function usePrevious(value, initialValue) {
|
|
1947
|
+
const ref = useRef3();
|
|
1948
|
+
useEffect8(() => {
|
|
1949
|
+
ref.current = { value };
|
|
1950
|
+
}, [value]);
|
|
1951
|
+
return ref.current ? ref.current.value : initialValue;
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
// src/icons/IconSVG.tsx
|
|
1955
|
+
import { twMerge as twMerge7 } from "tailwind-merge";
|
|
1956
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1957
|
+
function IconSVG({ className, children, ...props }) {
|
|
1958
|
+
return /* @__PURE__ */ jsx16(
|
|
1959
|
+
"svg",
|
|
1960
|
+
{
|
|
1961
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1962
|
+
viewBox: "0 0 24 24",
|
|
1963
|
+
fill: "currentColor",
|
|
1964
|
+
className: twMerge7("-my-[0.125em] h-[1.25em] w-[1.25em]", className),
|
|
1965
|
+
...props,
|
|
1966
|
+
children
|
|
1967
|
+
}
|
|
1968
|
+
);
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
// src/icons/CopyIcon.tsx
|
|
1972
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1973
|
+
function CopyIcon(props) {
|
|
1974
|
+
return /* @__PURE__ */ jsx17(IconSVG, { ...props, children: /* @__PURE__ */ jsx17(
|
|
1975
|
+
"path",
|
|
1976
|
+
{
|
|
1977
|
+
d: "M8 5H6C4.89543 5 4 5.89543 4 7V19C4 20.1046 4.89543 21 6 21H16C17.1046 21 18 20.1046 18 19V18M8 5C8 6.10457 8.89543 7 10 7H12C13.1046 7 14 6.10457 14 5M8 5C8 3.89543 8.89543 3 10 3H12C13.1046 3 14 3.89543 14 5M14 5H16C17.1046 5 18 5.89543 18 7V10M20 14H10M10 14L13 11M10 14L13 17",
|
|
1978
|
+
fill: "none",
|
|
1979
|
+
stroke: "currentColor",
|
|
1980
|
+
strokeWidth: "2",
|
|
1981
|
+
strokeLinecap: "round",
|
|
1982
|
+
strokeLinejoin: "round"
|
|
1983
|
+
}
|
|
1984
|
+
) });
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
// src/icons/CheckIcon.tsx
|
|
1988
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1989
|
+
function CheckIcon(props) {
|
|
1990
|
+
return /* @__PURE__ */ jsx18(IconSVG, { ...props, children: /* @__PURE__ */ jsx18(
|
|
1991
|
+
"path",
|
|
1992
|
+
{
|
|
1993
|
+
d: "M5 13L9 17L19 7",
|
|
1994
|
+
fill: "none",
|
|
1995
|
+
stroke: "currentColor",
|
|
1996
|
+
strokeWidth: "2",
|
|
1997
|
+
strokeLinecap: "round",
|
|
1998
|
+
strokeLinejoin: "round"
|
|
1999
|
+
}
|
|
2000
|
+
) });
|
|
2001
|
+
}
|
|
2002
|
+
|
|
1870
2003
|
// src/onboarding/GasBalance.tsx
|
|
1871
|
-
import { Fragment, jsx as
|
|
2004
|
+
import { Fragment, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1872
2005
|
function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
2006
|
+
const queryClient = useQueryClient6();
|
|
1873
2007
|
const { chain } = useEntryKitConfig();
|
|
1874
|
-
const
|
|
2008
|
+
const [copied, setCopied] = useState2(false);
|
|
2009
|
+
const balance = useShowQueryError(useBalance2({ chainId: chain.id, address: sessionAddress }));
|
|
2010
|
+
const prevBalance = usePrevious(balance.data);
|
|
1875
2011
|
useWatchBlockNumber({ onBlockNumber: () => balance.refetch() });
|
|
1876
2012
|
const setBalance3 = useShowMutationError(useSetBalance());
|
|
1877
2013
|
const relayChain = relayChains_default[chain.id];
|
|
2014
|
+
const handleCopy = () => {
|
|
2015
|
+
navigator.clipboard.writeText(sessionAddress);
|
|
2016
|
+
setCopied(true);
|
|
2017
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
2018
|
+
};
|
|
2019
|
+
useEffect9(() => {
|
|
2020
|
+
if (balance.data != null && prevBalance?.value === 0n && balance.data.value > 0n) {
|
|
2021
|
+
queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] });
|
|
2022
|
+
}
|
|
2023
|
+
}, [balance.data, prevBalance, setBalance3, sessionAddress, queryClient]);
|
|
1878
2024
|
return /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-4", children: [
|
|
1879
2025
|
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between gap-4", children: [
|
|
1880
2026
|
/* @__PURE__ */ jsxs14("div", { children: [
|
|
1881
|
-
/* @__PURE__ */
|
|
1882
|
-
/* @__PURE__ */
|
|
2027
|
+
/* @__PURE__ */ jsx19("div", { children: "Gas balance" }),
|
|
2028
|
+
/* @__PURE__ */ jsx19("div", { className: "font-mono text-white", children: balance.data != null ? /* @__PURE__ */ jsx19(Balance, { wei: balance.data.value }) : /* @__PURE__ */ jsx19(PendingIcon, { className: "text-sm" }) })
|
|
1883
2029
|
] }),
|
|
1884
|
-
chain.id === 31337 ? /* @__PURE__ */
|
|
2030
|
+
chain.id === 31337 ? /* @__PURE__ */ jsx19(
|
|
1885
2031
|
Button,
|
|
1886
2032
|
{
|
|
1887
2033
|
variant: isActive ? "primary" : "tertiary",
|
|
@@ -1890,19 +2036,19 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
1890
2036
|
pending: balance.status === "pending" || setBalance3.status === "pending",
|
|
1891
2037
|
onClick: () => setBalance3.mutate({
|
|
1892
2038
|
address: sessionAddress,
|
|
1893
|
-
value:
|
|
2039
|
+
value: parseEther4("0.01") + (balance.data?.value ?? 0n)
|
|
1894
2040
|
}),
|
|
1895
2041
|
children: "Top up"
|
|
1896
2042
|
}
|
|
1897
2043
|
) : relayChain != null ? (
|
|
1898
2044
|
// TODO: convert this to a <ButtonLink>
|
|
1899
|
-
/* @__PURE__ */
|
|
2045
|
+
/* @__PURE__ */ jsx19(
|
|
1900
2046
|
"a",
|
|
1901
2047
|
{
|
|
1902
|
-
href: `${relayChain.bridgeUrl}?${new URLSearchParams({ toAddress: sessionAddress })}`,
|
|
2048
|
+
href: `${relayChain.bridgeUrl}?${new URLSearchParams({ toAddress: sessionAddress, amount: "0.01" })}`,
|
|
1903
2049
|
target: "_blank",
|
|
1904
2050
|
rel: "noopener noreferrer",
|
|
1905
|
-
children: /* @__PURE__ */
|
|
2051
|
+
children: /* @__PURE__ */ jsx19(
|
|
1906
2052
|
Button,
|
|
1907
2053
|
{
|
|
1908
2054
|
variant: isActive ? "primary" : "tertiary",
|
|
@@ -1917,11 +2063,23 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
1917
2063
|
) : null
|
|
1918
2064
|
] }),
|
|
1919
2065
|
isExpanded ? /* @__PURE__ */ jsxs14(Fragment, { children: [
|
|
1920
|
-
/* @__PURE__ */
|
|
2066
|
+
/* @__PURE__ */ jsx19("p", { className: "text-sm", children: "Your session's gas balance is used to pay for onchain computation." }),
|
|
1921
2067
|
/* @__PURE__ */ jsxs14("p", { className: "text-sm", children: [
|
|
1922
2068
|
"Send funds to",
|
|
1923
2069
|
" ",
|
|
1924
|
-
/* @__PURE__ */
|
|
2070
|
+
/* @__PURE__ */ jsxs14(
|
|
2071
|
+
"span",
|
|
2072
|
+
{
|
|
2073
|
+
className: "inline-flex items-center gap-1 font-mono text-white cursor-pointer hover:text-white/80 transition-colors",
|
|
2074
|
+
onClick: handleCopy,
|
|
2075
|
+
title: "Click to copy",
|
|
2076
|
+
children: [
|
|
2077
|
+
/* @__PURE__ */ jsx19(TruncatedHex, { hex: sessionAddress }),
|
|
2078
|
+
" ",
|
|
2079
|
+
copied ? /* @__PURE__ */ jsx19(CheckIcon, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsx19(CopyIcon, { className: "w-3.5 h-3.5" })
|
|
2080
|
+
]
|
|
2081
|
+
}
|
|
2082
|
+
),
|
|
1925
2083
|
" ",
|
|
1926
2084
|
"on ",
|
|
1927
2085
|
chain.name,
|
|
@@ -1931,191 +2089,1343 @@ function GasBalance({ isActive, isExpanded, sessionAddress }) {
|
|
|
1931
2089
|
] });
|
|
1932
2090
|
}
|
|
1933
2091
|
|
|
1934
|
-
// src/onboarding/
|
|
1935
|
-
import {
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
2092
|
+
// src/onboarding/quarry/GasBalance.tsx
|
|
2093
|
+
import { useEffect as useEffect14 } from "react";
|
|
2094
|
+
import { useQueryClient as useQueryClient9 } from "@tanstack/react-query";
|
|
2095
|
+
|
|
2096
|
+
// src/onboarding/deposit/DepositFormContainer.tsx
|
|
2097
|
+
import { useState as useState4 } from "react";
|
|
2098
|
+
import { useChains as useChains4, useChainId } from "wagmi";
|
|
2099
|
+
|
|
2100
|
+
// src/onboarding/deposit/DepositViaTransferForm.tsx
|
|
2101
|
+
import { useAccount as useAccount4, useWriteContract, usePrepareTransactionRequest, usePublicClient } from "wagmi";
|
|
2102
|
+
import { encodeFunctionData as encodeFunctionData2 } from "viem";
|
|
2103
|
+
import { useMutation as useMutation4, useQuery as useQuery12 } from "@tanstack/react-query";
|
|
2104
|
+
|
|
2105
|
+
// src/onboarding/deposit/DepositForm.tsx
|
|
2106
|
+
import { useEffect as useEffect11, useRef as useRef4 } from "react";
|
|
2107
|
+
import { useAccount as useAccount3, useBalance as useBalance4, useWatchBlockNumber as useWatchBlockNumber2 } from "wagmi";
|
|
2108
|
+
import { useIsMounted } from "usehooks-ts";
|
|
2109
|
+
import { twMerge as twMerge15 } from "tailwind-merge";
|
|
2110
|
+
|
|
2111
|
+
// src/onboarding/deposit/ChainSelect.tsx
|
|
2112
|
+
import { useEffect as useEffect10, useMemo as useMemo2 } from "react";
|
|
2113
|
+
import { useSwitchChain } from "wagmi";
|
|
2114
|
+
import { twMerge as twMerge12 } from "tailwind-merge";
|
|
2115
|
+
import * as Select from "@radix-ui/react-select";
|
|
2116
|
+
|
|
2117
|
+
// src/icons/ChevronUpIcon.tsx
|
|
2118
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2119
|
+
function ChevronUpIcon(props) {
|
|
2120
|
+
return /* @__PURE__ */ jsx20(IconSVG, { viewBox: "0 0 20 20", ...props, children: /* @__PURE__ */ jsx20(
|
|
2121
|
+
"path",
|
|
2122
|
+
{
|
|
2123
|
+
d: "M14.7071 12.7071C14.3166 13.0976 13.6834 13.0976 13.2929 12.7071L10 9.41421L6.70711 12.7071C6.31658 13.0976 5.68342 13.0976 5.29289 12.7071C4.90237 12.3166 4.90237 11.6834 5.29289 11.2929L9.29289 7.29289C9.68342 6.90237 10.3166 6.90237 10.7071 7.29289L14.7071 11.2929C15.0976 11.6834 15.0976 12.3166 14.7071 12.7071Z",
|
|
2124
|
+
fillRule: "evenodd",
|
|
2125
|
+
clipRule: "evenodd"
|
|
1953
2126
|
}
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
2127
|
+
) });
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2130
|
+
// src/icons/ChevronDownIcon.tsx
|
|
2131
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2132
|
+
function ChevronDownIcon(props) {
|
|
2133
|
+
return /* @__PURE__ */ jsx21(IconSVG, { viewBox: "0 0 20 20", ...props, children: /* @__PURE__ */ jsx21(
|
|
2134
|
+
"path",
|
|
2135
|
+
{
|
|
2136
|
+
d: "M5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289L10 10.5858L13.2929 7.29289C13.6834 6.90237 14.3166 6.90237 14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L10.7071 12.7071C10.3166 13.0976 9.68342 13.0976 9.29289 12.7071L5.29289 8.70711C4.90237 8.31658 4.90237 7.68342 5.29289 7.29289Z",
|
|
2137
|
+
fillRule: "evenodd",
|
|
2138
|
+
clipRule: "evenodd"
|
|
1958
2139
|
}
|
|
1959
|
-
}
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
2140
|
+
) });
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
// src/ui/Slot.tsx
|
|
2144
|
+
import { isValidElement, cloneElement, Children } from "react";
|
|
2145
|
+
import { twMerge as twMerge8 } from "tailwind-merge";
|
|
2146
|
+
function Slot({
|
|
2147
|
+
children,
|
|
2148
|
+
...props
|
|
2149
|
+
}) {
|
|
2150
|
+
if (isValidElement(children)) {
|
|
2151
|
+
return cloneElement(children, {
|
|
2152
|
+
...props,
|
|
2153
|
+
...children.props,
|
|
2154
|
+
style: {
|
|
2155
|
+
...props.style,
|
|
2156
|
+
...children.props.style
|
|
2157
|
+
},
|
|
2158
|
+
className: twMerge8(props.className, children.props.className)
|
|
2159
|
+
});
|
|
2160
|
+
}
|
|
2161
|
+
if (Children.count(children) > 1) {
|
|
2162
|
+
Children.only(null);
|
|
2163
|
+
}
|
|
2164
|
+
return null;
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
// src/ui/Input.tsx
|
|
2168
|
+
import { twMerge as twMerge9 } from "tailwind-merge";
|
|
2169
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2170
|
+
function Input({ asChild, className, ...props }) {
|
|
2171
|
+
const Child = asChild ? Slot : "input";
|
|
2172
|
+
return /* @__PURE__ */ jsx22(
|
|
2173
|
+
Child,
|
|
2174
|
+
{
|
|
2175
|
+
className: twMerge9(
|
|
2176
|
+
"p-2.5 gap-1 border text-lg font-medium transition",
|
|
2177
|
+
"outline-none ring-2 ring-transparent focus-within:ring-orange-500 focus-within:border-transparent",
|
|
2178
|
+
"bg-neutral-900 border-neutral-700 text-white placeholder:text-neutral-500",
|
|
2179
|
+
className
|
|
2180
|
+
),
|
|
2181
|
+
...props
|
|
1970
2182
|
}
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
2183
|
+
);
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2186
|
+
// src/onboarding/deposit/ChainIcon.tsx
|
|
2187
|
+
import { twMerge as twMerge11 } from "tailwind-merge";
|
|
2188
|
+
|
|
2189
|
+
// src/onboarding/deposit/PreloadedImage.tsx
|
|
2190
|
+
import { twMerge as twMerge10 } from "tailwind-merge";
|
|
2191
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
2192
|
+
function PreloadedImage({ url, fallback: fallback2, className }) {
|
|
2193
|
+
const { isSuccess, isLoading } = usePreloadImage(url);
|
|
2194
|
+
return /* @__PURE__ */ jsx23("span", { className: twMerge10("inline-flex w-full h-full items-center justify-center overflow-clip", className), children: !isLoading ? isSuccess ? /* @__PURE__ */ jsx23("img", { src: url, className: "w-full h-full object-cover" }) : fallback2 : null });
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
// src/onboarding/deposit/ChainIcon.tsx
|
|
2198
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
2199
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2200
|
+
var ChainIcon = forwardRef2(function ChainIcon2({ name, url, className }, forwardedRef) {
|
|
2201
|
+
return /* @__PURE__ */ jsx24(
|
|
2202
|
+
"span",
|
|
2203
|
+
{
|
|
2204
|
+
ref: forwardedRef,
|
|
2205
|
+
className: twMerge11("flex-shrink-0 inline-flex w-6 aspect-square rounded-full overflow-clip", className),
|
|
2206
|
+
children: url ? /* @__PURE__ */ jsx24(PreloadedImage, { url }) : (
|
|
2207
|
+
// TODO: better placeholder
|
|
2208
|
+
/* @__PURE__ */ jsx24(
|
|
2209
|
+
"span",
|
|
2210
|
+
{
|
|
2211
|
+
className: twMerge11(
|
|
2212
|
+
"inline-flex items-center justify-center w-full h-full rounded-full",
|
|
2213
|
+
"border-2 border-dashed border-white/50 opacity-50"
|
|
2214
|
+
),
|
|
2215
|
+
children: name?.slice(0, 1)
|
|
2216
|
+
}
|
|
2217
|
+
)
|
|
2218
|
+
)
|
|
2219
|
+
}
|
|
2220
|
+
);
|
|
2221
|
+
});
|
|
2222
|
+
|
|
2223
|
+
// src/onboarding/deposit/useRelay.ts
|
|
2224
|
+
import {
|
|
2225
|
+
MAINNET_RELAY_API,
|
|
2226
|
+
TESTNET_RELAY_API,
|
|
2227
|
+
fetchChainConfigs,
|
|
2228
|
+
createClient as createClient2,
|
|
2229
|
+
LogLevel
|
|
2230
|
+
} from "@reservoir0x/relay-sdk";
|
|
2231
|
+
import { useQuery as useQuery10 } from "@tanstack/react-query";
|
|
2232
|
+
function useRelay() {
|
|
2233
|
+
const { chain } = useEntryKitConfig();
|
|
2234
|
+
const appOrigin = location.host;
|
|
2235
|
+
const baseApiUrl = chain.testnet ? TESTNET_RELAY_API : MAINNET_RELAY_API;
|
|
2236
|
+
return useQuery10({
|
|
2237
|
+
queryKey: ["relayChains", baseApiUrl, appOrigin],
|
|
2238
|
+
queryFn: async () => {
|
|
2239
|
+
debug("fetching relay chains from", baseApiUrl);
|
|
2240
|
+
const chains = await fetchChainConfigs(baseApiUrl);
|
|
2241
|
+
debug("got relay chains", chains);
|
|
2242
|
+
const client = createClient2({
|
|
2243
|
+
baseApiUrl,
|
|
2244
|
+
source: appOrigin,
|
|
2245
|
+
chains,
|
|
2246
|
+
logLevel: LogLevel.Verbose
|
|
2247
|
+
});
|
|
2248
|
+
return { client, chains };
|
|
2249
|
+
},
|
|
2250
|
+
refetchOnMount: false,
|
|
2251
|
+
refetchOnReconnect: false,
|
|
2252
|
+
refetchOnWindowFocus: false,
|
|
2253
|
+
staleTime: Infinity
|
|
2254
|
+
});
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
// src/onboarding/deposit/useChainBalances.ts
|
|
2258
|
+
import { useAccount, useConfig as useWagmiConfig } from "wagmi";
|
|
2259
|
+
import { getBalance as getBalance2 } from "wagmi/actions";
|
|
2260
|
+
import { useQuery as useQuery11, skipToken as skipToken8 } from "@tanstack/react-query";
|
|
2261
|
+
import { isNotNull } from "@latticexyz/common/utils";
|
|
2262
|
+
function useChainBalances({ chains }) {
|
|
2263
|
+
const { address: userAddress } = useAccount();
|
|
2264
|
+
const wagmiConfig = useWagmiConfig();
|
|
2265
|
+
const chainIds = chains.map((chain) => chain.id);
|
|
2266
|
+
return useQuery11({
|
|
2267
|
+
queryKey: ["chainBalances", chainIds, userAddress],
|
|
2268
|
+
queryFn: userAddress ? async () => {
|
|
2269
|
+
const chainBalances = await Promise.allSettled(
|
|
2270
|
+
chains.map(async (chain) => {
|
|
2271
|
+
const balance = await getBalance2(wagmiConfig, { chainId: chain.id, address: userAddress });
|
|
2272
|
+
return { chain, balance };
|
|
2273
|
+
})
|
|
2274
|
+
);
|
|
2275
|
+
return chainBalances.map((result) => result.status === "fulfilled" ? result.value : null).filter(isNotNull);
|
|
2276
|
+
} : skipToken8,
|
|
2277
|
+
refetchInterval: 1e3 * 60,
|
|
2278
|
+
retry: 1
|
|
2279
|
+
});
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
// src/onboarding/deposit/ChainSelect.tsx
|
|
2283
|
+
import { Fragment as Fragment2, jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2284
|
+
function ChainSelect({ value, onChange }) {
|
|
2285
|
+
const theme = useTheme();
|
|
2286
|
+
const { frame } = useFrame();
|
|
2287
|
+
const { chains, switchChain } = useSwitchChain();
|
|
2288
|
+
const relay = useRelay();
|
|
2289
|
+
const relayChains = relay.data?.chains;
|
|
2290
|
+
const sourceChains = useMemo2(() => {
|
|
2291
|
+
return chains.map((sourceChain) => {
|
|
2292
|
+
const relayChain = relayChains?.find((c) => c.id === sourceChain.id);
|
|
2293
|
+
return {
|
|
2294
|
+
...sourceChain,
|
|
2295
|
+
relayChain
|
|
2296
|
+
};
|
|
2297
|
+
}).filter((c) => c.relayChain);
|
|
2298
|
+
}, [chains, relayChains]);
|
|
2299
|
+
const selectedChain = sourceChains.find((c) => c.id === value);
|
|
2300
|
+
const { data: chainsBalances, isLoading } = useShowQueryError(useChainBalances({ chains: sourceChains }));
|
|
2301
|
+
const renderedChains = useMemo2(() => {
|
|
2302
|
+
if (!chainsBalances) return [];
|
|
2303
|
+
const chainsWithBalance = chainsBalances.filter(({ balance }) => balance.value > 0n).map(({ chain, balance }) => ({ chain, balance: balance.value }));
|
|
2304
|
+
return chainsWithBalance.length > 0 ? chainsWithBalance : sourceChains.map((chain) => ({ chain, balance: 0n }));
|
|
2305
|
+
}, [chainsBalances, sourceChains]);
|
|
2306
|
+
useEffect10(() => {
|
|
2307
|
+
if (renderedChains.length > 0 && (!selectedChain || !renderedChains.find((c) => c.chain.id === selectedChain?.id))) {
|
|
2308
|
+
const defaultChain = renderedChains[0].chain;
|
|
2309
|
+
onChange(defaultChain.id);
|
|
2310
|
+
switchChain({ chainId: defaultChain.id });
|
|
2311
|
+
}
|
|
2312
|
+
}, [value, selectedChain, renderedChains, onChange, switchChain]);
|
|
2313
|
+
return /* @__PURE__ */ jsxs15(
|
|
2314
|
+
Select.Root,
|
|
2315
|
+
{
|
|
2316
|
+
value: value.toString(),
|
|
2317
|
+
onValueChange: (value2) => {
|
|
2318
|
+
if (value2) {
|
|
2319
|
+
const chain = renderedChains.find((item) => item.chain.id.toString() === value2)?.chain;
|
|
2320
|
+
if (!chain) throw new Error(`Unknown chain selected: ${value2}`);
|
|
2321
|
+
onChange(chain.id);
|
|
2322
|
+
}
|
|
2323
|
+
},
|
|
2324
|
+
children: [
|
|
2325
|
+
/* @__PURE__ */ jsx25(Input, { asChild: true, children: /* @__PURE__ */ jsxs15(Select.Trigger, { className: "group inline-flex items-center justify-center", children: [
|
|
2326
|
+
/* @__PURE__ */ jsx25(Select.Value, { asChild: true, children: /* @__PURE__ */ jsx25(
|
|
2327
|
+
ChainIcon,
|
|
2328
|
+
{
|
|
2329
|
+
id: selectedChain?.id,
|
|
2330
|
+
name: selectedChain?.name,
|
|
2331
|
+
url: selectedChain?.relayChain?.icon?.[theme],
|
|
2332
|
+
className: "w-8"
|
|
2333
|
+
}
|
|
2334
|
+
) }),
|
|
2335
|
+
/* @__PURE__ */ jsx25(Select.Icon, { asChild: true, children: /* @__PURE__ */ jsxs15(Fragment2, { children: [
|
|
2336
|
+
/* @__PURE__ */ jsx25(ChevronDownIcon, { className: "text-sm -mr-1 group-aria-expanded:hidden" }),
|
|
2337
|
+
/* @__PURE__ */ jsx25(ChevronUpIcon, { className: "text-sm -mr-1 hidden group-aria-expanded:inline" })
|
|
2338
|
+
] }) })
|
|
2339
|
+
] }) }),
|
|
2340
|
+
frame.contentDocument ? /* @__PURE__ */ jsx25(Select.Portal, { container: frame.contentDocument.body, children: /* @__PURE__ */ jsx25(
|
|
2341
|
+
Select.Content,
|
|
2342
|
+
{
|
|
2343
|
+
position: "popper",
|
|
2344
|
+
className: "w-[352px] max-h-[230px] overflow-y-auto mt-1 animate-in fade-in slide-in-from-top-2",
|
|
2345
|
+
children: /* @__PURE__ */ jsx25(Select.Viewport, { children: /* @__PURE__ */ jsx25(
|
|
2346
|
+
Select.Group,
|
|
2347
|
+
{
|
|
2348
|
+
className: twMerge12(
|
|
2349
|
+
"flex flex-col border divide-y",
|
|
2350
|
+
"bg-neutral-800 text-neutral-300 border-neutral-700 divide-neutral-700"
|
|
2351
|
+
),
|
|
2352
|
+
children: isLoading ? /* @__PURE__ */ jsx25("div", { className: "flex items-center justify-center p-4", children: /* @__PURE__ */ jsx25(PendingIcon, { className: "h-6 w-6 animate-spin text-gray-400" }) }) : renderedChains.map(({ chain, balance }) => {
|
|
2353
|
+
return /* @__PURE__ */ jsxs15(
|
|
2354
|
+
Select.Item,
|
|
2355
|
+
{
|
|
2356
|
+
value: chain.id.toString(),
|
|
2357
|
+
className: twMerge12(
|
|
2358
|
+
"group flex p-2.5 gap-2.5 items-center cursor-pointer outline-none",
|
|
2359
|
+
"text-white focus:bg-neutral-700 data-[state=checked]:bg-neutral-900"
|
|
2360
|
+
),
|
|
2361
|
+
children: [
|
|
2362
|
+
/* @__PURE__ */ jsx25(ChainIcon, { id: chain.id, name: chain.name, url: chain.relayChain?.icon?.[theme] }),
|
|
2363
|
+
/* @__PURE__ */ jsx25("span", { className: "flex-grow flex-shrink-0", children: chain.name }),
|
|
2364
|
+
/* @__PURE__ */ jsx25("span", { className: "flex-shrink-0 font-mono text-sm text-neutral-400", children: /* @__PURE__ */ jsx25(Balance, { wei: balance }) })
|
|
2365
|
+
]
|
|
2366
|
+
},
|
|
2367
|
+
chain.id
|
|
2368
|
+
);
|
|
2369
|
+
})
|
|
2370
|
+
}
|
|
2371
|
+
) })
|
|
2372
|
+
}
|
|
2373
|
+
) }) : null
|
|
2374
|
+
]
|
|
2375
|
+
}
|
|
2376
|
+
);
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
// src/onboarding/deposit/AmountInput.tsx
|
|
2380
|
+
import { formatEther as formatEther3, parseEther as parseEther5 } from "viem";
|
|
2381
|
+
import { twMerge as twMerge13 } from "tailwind-merge";
|
|
2382
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
2383
|
+
import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2384
|
+
var AmountInput = forwardRef3(function AmountInput2({ initialAmount, onChange }, forwardedRef) {
|
|
2385
|
+
return /* @__PURE__ */ jsx26(Input, { asChild: true, className: "w-full cursor-text flex items-center", children: /* @__PURE__ */ jsxs16("label", { children: [
|
|
2386
|
+
/* @__PURE__ */ jsx26(
|
|
2387
|
+
"input",
|
|
2388
|
+
{
|
|
2389
|
+
ref: forwardedRef,
|
|
2390
|
+
className: twMerge13("peer flex-grow outline-none bg-transparent", "placeholder:text-neutral-500"),
|
|
2391
|
+
placeholder: "0.005",
|
|
2392
|
+
required: true,
|
|
2393
|
+
autoFocus: true,
|
|
2394
|
+
defaultValue: initialAmount == null ? "" : formatEther3(initialAmount),
|
|
2395
|
+
onChange: (event) => {
|
|
2396
|
+
const input = event.currentTarget;
|
|
2397
|
+
if (input.value.trim() === "") {
|
|
2398
|
+
input.setCustomValidity("");
|
|
2399
|
+
onChange(void 0);
|
|
2400
|
+
return;
|
|
2401
|
+
}
|
|
2402
|
+
const value = input.value.trim().replace(/\.$/, ".0");
|
|
2403
|
+
if (!/^\d*(\.\d+)?$/.test(value)) {
|
|
2404
|
+
return input.setCustomValidity("Invalid amount.");
|
|
2405
|
+
}
|
|
2406
|
+
input.setCustomValidity("");
|
|
2407
|
+
onChange(parseEther5(value));
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
),
|
|
2411
|
+
/* @__PURE__ */ jsx26("span", { className: twMerge13("flex-shrink-0 text-2xl", "peer-placeholder-shown:text-neutral-500"), children: /* @__PURE__ */ jsx26(EthIcon, {}) })
|
|
2412
|
+
] }) });
|
|
2413
|
+
});
|
|
2414
|
+
|
|
2415
|
+
// src/onboarding/deposit/SubmitButton.tsx
|
|
2416
|
+
import { useAccount as useAccount2, useBalance as useBalance3, useSwitchChain as useSwitchChain2 } from "wagmi";
|
|
2417
|
+
import { twMerge as twMerge14 } from "tailwind-merge";
|
|
2418
|
+
import { parseEther as parseEther6 } from "viem";
|
|
2419
|
+
import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2420
|
+
var MAX_DEPOSIT_AMOUNT = "0.1";
|
|
2421
|
+
function SubmitButton({ amount, chainId, className, ...buttonProps }) {
|
|
2422
|
+
const { chainId: userChainId, address: userAddress } = useAccount2();
|
|
2423
|
+
const { data: userBalance } = useBalance3({ address: userAddress });
|
|
2424
|
+
const shouldSwitchChain = chainId != null && chainId !== userChainId;
|
|
2425
|
+
const switchChain = useSwitchChain2();
|
|
2426
|
+
if (shouldSwitchChain) {
|
|
2427
|
+
return /* @__PURE__ */ jsx27(
|
|
2428
|
+
Button,
|
|
2429
|
+
{
|
|
2430
|
+
type: "button",
|
|
2431
|
+
variant: "primary",
|
|
2432
|
+
className: twMerge14("w-full", className),
|
|
2433
|
+
pending: switchChain.isPending,
|
|
2434
|
+
onClick: () => switchChain.switchChain({ chainId }),
|
|
2435
|
+
children: "Switch chain"
|
|
2436
|
+
}
|
|
2437
|
+
);
|
|
2438
|
+
} else if (amount) {
|
|
2439
|
+
if (amount > parseEther6(MAX_DEPOSIT_AMOUNT)) {
|
|
2440
|
+
return /* @__PURE__ */ jsxs17(Button, { type: "button", className: twMerge14("w-full", className), disabled: true, children: [
|
|
2441
|
+
"Max amount is ",
|
|
2442
|
+
MAX_DEPOSIT_AMOUNT,
|
|
2443
|
+
" ETH"
|
|
2444
|
+
] });
|
|
2445
|
+
} else if (amount > (userBalance?.value ?? 0n)) {
|
|
2446
|
+
return /* @__PURE__ */ jsx27(Button, { type: "button", className: twMerge14("w-full", className), disabled: true, children: "Insufficient balance" });
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
return /* @__PURE__ */ jsx27(Button, { type: "submit", className: twMerge14("w-full", className), ...buttonProps });
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
// src/icons/WarningIcon.tsx
|
|
2453
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2454
|
+
function WarningIcon(props) {
|
|
2455
|
+
return /* @__PURE__ */ jsx28(IconSVG, { fill: "none", ...props, children: /* @__PURE__ */ jsx28(
|
|
2456
|
+
"path",
|
|
2457
|
+
{
|
|
2458
|
+
d: "M12 9V11M12 15H12.01M5.07183 19H18.9282C20.4678 19 21.4301 17.3333 20.6603 16L13.7321 4C12.9623 2.66667 11.0378 2.66667 10.268 4L3.33978 16C2.56998 17.3333 3.53223 19 5.07183 19Z",
|
|
2459
|
+
stroke: "currentColor",
|
|
2460
|
+
strokeWidth: "2",
|
|
2461
|
+
strokeLinecap: "round",
|
|
2462
|
+
strokeLinejoin: "round"
|
|
2463
|
+
}
|
|
2464
|
+
) });
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
// src/formatGas.ts
|
|
2468
|
+
import { formatGwei } from "viem";
|
|
2469
|
+
function formatGas(wei) {
|
|
2470
|
+
const formatted = formatGwei(wei);
|
|
2471
|
+
const magnitude = Math.floor(parseFloat(formatted)).toString().length;
|
|
2472
|
+
return parseFloat(formatted).toLocaleString("en-US", { maximumFractionDigits: Math.max(0, 6 - magnitude) });
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
// src/onboarding/deposit/DepositForm.tsx
|
|
2476
|
+
import { Fragment as Fragment3, jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2477
|
+
function DepositForm({
|
|
2478
|
+
sourceChain,
|
|
2479
|
+
setSourceChainId,
|
|
2480
|
+
amount,
|
|
2481
|
+
setAmount,
|
|
2482
|
+
estimatedFee,
|
|
2483
|
+
estimatedTime,
|
|
2484
|
+
onSubmit,
|
|
2485
|
+
submitButton
|
|
2486
|
+
}) {
|
|
2487
|
+
const amountInputRef = useRef4(null);
|
|
2488
|
+
const isMounted = useIsMounted();
|
|
2489
|
+
const { address: userAddress, chainId: userChainId } = useAccount3();
|
|
2490
|
+
const balance = useShowQueryError(useBalance4({ chainId: sourceChain.id, address: userAddress }));
|
|
2491
|
+
const quarryBalance = useShowQueryError(useBalance(userAddress));
|
|
2492
|
+
useWatchBlockNumber2({
|
|
2493
|
+
onBlockNumber: () => {
|
|
2494
|
+
balance.refetch();
|
|
2495
|
+
quarryBalance.refetch();
|
|
2496
|
+
}
|
|
2497
|
+
});
|
|
2498
|
+
const minimumBalance = amount != null ? amount + (estimatedFee?.fee ?? 0n) : void 0;
|
|
2499
|
+
const hasMinimumBalance = balance.data != null ? balance.data.value > (minimumBalance ?? 0n) : void 0;
|
|
2500
|
+
useEffect11(() => {
|
|
2501
|
+
amountInputRef.current?.focus();
|
|
2502
|
+
}, [userChainId]);
|
|
2503
|
+
return /* @__PURE__ */ jsxs18(
|
|
2504
|
+
"form",
|
|
2505
|
+
{
|
|
2506
|
+
className: "flex flex-col gap-5",
|
|
2507
|
+
onSubmit: async (event) => {
|
|
2508
|
+
event.preventDefault();
|
|
2509
|
+
try {
|
|
2510
|
+
await onSubmit();
|
|
2511
|
+
if (isMounted()) {
|
|
2512
|
+
setAmount(void 0);
|
|
2513
|
+
if (amountInputRef.current) {
|
|
2514
|
+
amountInputRef.current.value = "";
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2517
|
+
} catch (error2) {
|
|
2518
|
+
console.error("Error during deposit", error2);
|
|
2519
|
+
} finally {
|
|
2520
|
+
amountInputRef.current?.focus();
|
|
2521
|
+
}
|
|
2522
|
+
},
|
|
2523
|
+
children: [
|
|
2524
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex gap-2", children: [
|
|
2525
|
+
/* @__PURE__ */ jsx29(ChainSelect, { value: sourceChain.id, onChange: setSourceChainId }),
|
|
2526
|
+
/* @__PURE__ */ jsx29(AmountInput, { ref: amountInputRef, initialAmount: amount, onChange: setAmount })
|
|
2527
|
+
] }),
|
|
2528
|
+
/* @__PURE__ */ jsxs18(
|
|
2529
|
+
"dl",
|
|
2530
|
+
{
|
|
2531
|
+
className: twMerge15(
|
|
2532
|
+
"grid grid-cols-2 divide-y text-sm leading-loose [&_>_:is(dt,dd)]:px-1 [&_>_dd]:text-right",
|
|
2533
|
+
"divide-neutral-700 text-neutral-400"
|
|
2534
|
+
),
|
|
2535
|
+
children: [
|
|
2536
|
+
/* @__PURE__ */ jsx29("dt", { children: "Available to deposit" }),
|
|
2537
|
+
/* @__PURE__ */ jsx29("dd", { children: balance.isSuccess ? /* @__PURE__ */ jsx29(Balance, { wei: balance.data.value }) : balance.isError ? /* @__PURE__ */ jsx29("span", { title: String(balance.error), children: /* @__PURE__ */ jsx29(WarningIcon, { className: "inline-block text-amber-500" }) }) : balance.isLoading ? /* @__PURE__ */ jsx29(PendingIcon, { className: "inline-block text-xs" }) : null }),
|
|
2538
|
+
/* @__PURE__ */ jsx29("dt", { children: "Gas balance after deposit" }),
|
|
2539
|
+
/* @__PURE__ */ jsx29("dd", { children: /* @__PURE__ */ jsx29(Balance, { wei: (quarryBalance.data ?? 0n) + (amount ?? 0n) }) }),
|
|
2540
|
+
/* @__PURE__ */ jsx29("dt", { children: "Estimated fee" }),
|
|
2541
|
+
/* @__PURE__ */ jsx29("dd", { children: estimatedFee.fee ? /* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
2542
|
+
formatGas(estimatedFee.fee),
|
|
2543
|
+
" gwei"
|
|
2544
|
+
] }) : estimatedFee.error ? /* @__PURE__ */ jsx29("span", { title: String(estimatedFee.error), children: /* @__PURE__ */ jsx29(WarningIcon, { className: "inline-block text-amber-500" }) }) : estimatedFee.isLoading ? /* @__PURE__ */ jsx29(PendingIcon, { className: "inline-block text-xs" }) : null }),
|
|
2545
|
+
/* @__PURE__ */ jsx29("dt", { children: "Time to deposit" }),
|
|
2546
|
+
/* @__PURE__ */ jsx29("dd", { children: estimatedTime })
|
|
2547
|
+
]
|
|
2548
|
+
}
|
|
2549
|
+
),
|
|
2550
|
+
hasMinimumBalance ? submitButton : /* @__PURE__ */ jsx29(SubmitButton, { disabled: true, children: "Not enough funds" })
|
|
2551
|
+
]
|
|
2552
|
+
}
|
|
2553
|
+
);
|
|
2554
|
+
}
|
|
2555
|
+
|
|
2556
|
+
// src/onboarding/deposit/useDeposits.ts
|
|
2557
|
+
import { createStore as createStore4 } from "zustand/vanilla";
|
|
2558
|
+
import { useStore as useStore2 } from "zustand";
|
|
2559
|
+
import { useCallback as useCallback2, useMemo as useMemo3 } from "react";
|
|
2560
|
+
var store4 = createStore4(() => ({
|
|
2561
|
+
count: 0,
|
|
2562
|
+
deposits: []
|
|
2563
|
+
}));
|
|
2564
|
+
function useDeposits() {
|
|
2565
|
+
const deposits = useStore2(store4, (state) => state.deposits);
|
|
2566
|
+
const addDeposit = useCallback2((transaction) => {
|
|
2567
|
+
store4.setState((state) => {
|
|
2568
|
+
if (transaction.type === "relay") {
|
|
2569
|
+
const existingDeposit = state.deposits.find(
|
|
2570
|
+
(deposit) => deposit.type === "relay" && deposit.requestId === transaction.requestId
|
|
2571
|
+
);
|
|
2572
|
+
if (existingDeposit) {
|
|
2573
|
+
return state;
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
return {
|
|
2577
|
+
count: state.count + 1,
|
|
2578
|
+
deposits: [
|
|
2579
|
+
...state.deposits,
|
|
2580
|
+
{
|
|
2581
|
+
...transaction,
|
|
2582
|
+
uid: `deposit-${state.count}`
|
|
2583
|
+
}
|
|
2584
|
+
]
|
|
2585
|
+
};
|
|
2586
|
+
});
|
|
2587
|
+
}, []);
|
|
2588
|
+
const removeDeposit = useCallback2((uid) => {
|
|
2589
|
+
store4.setState((state) => ({
|
|
2590
|
+
deposits: state.deposits.filter((deposit) => deposit.uid !== uid)
|
|
2591
|
+
}));
|
|
2592
|
+
}, []);
|
|
2593
|
+
return useMemo3(
|
|
2594
|
+
() => ({
|
|
2595
|
+
deposits,
|
|
2596
|
+
addDeposit,
|
|
2597
|
+
removeDeposit
|
|
2598
|
+
}),
|
|
2599
|
+
[addDeposit, deposits, removeDeposit]
|
|
2600
|
+
);
|
|
2601
|
+
}
|
|
2602
|
+
|
|
2603
|
+
// src/onboarding/deposit/DepositViaTransferForm.tsx
|
|
2604
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2605
|
+
function DepositViaTransferForm({ amount, setAmount, sourceChain, setSourceChainId }) {
|
|
2606
|
+
const { chain } = useEntryKitConfig();
|
|
2607
|
+
const paymaster = getPaymaster(chain);
|
|
2608
|
+
const publicClient = usePublicClient();
|
|
2609
|
+
const { address: userAddress } = useAccount4();
|
|
2610
|
+
const { writeContractAsync } = useWriteContract();
|
|
2611
|
+
const { addDeposit } = useDeposits();
|
|
2612
|
+
if (!userAddress) {
|
|
2613
|
+
throw new Error("User address not found");
|
|
2614
|
+
}
|
|
2615
|
+
const { data: gasPrice } = useQuery12({
|
|
2616
|
+
queryKey: ["gasPrice", sourceChain.id],
|
|
2617
|
+
queryFn: async () => {
|
|
2618
|
+
if (!publicClient) throw new Error("Public client not available");
|
|
2619
|
+
return publicClient.getGasPrice();
|
|
2620
|
+
},
|
|
2621
|
+
refetchInterval: 15e3,
|
|
2622
|
+
enabled: !!publicClient
|
|
2623
|
+
});
|
|
2624
|
+
const { data: prepareData, error: prepareError } = usePrepareTransactionRequest({
|
|
2625
|
+
to: paymaster?.address,
|
|
2626
|
+
data: encodeFunctionData2({
|
|
2627
|
+
abi: paymasterAbi,
|
|
2628
|
+
functionName: "depositTo",
|
|
2629
|
+
args: [userAddress]
|
|
2630
|
+
}),
|
|
2631
|
+
value: amount
|
|
2632
|
+
});
|
|
2633
|
+
const deposit = useMutation4({
|
|
2634
|
+
mutationKey: ["depositViaTransfer", amount?.toString()],
|
|
2635
|
+
mutationFn: async () => {
|
|
2636
|
+
if (!paymaster) throw new Error("Paymaster not found");
|
|
2637
|
+
if (!publicClient) throw new Error("Public client not found");
|
|
2638
|
+
if (!amount) throw new Error("Amount cannot be 0");
|
|
2639
|
+
try {
|
|
2640
|
+
const hash = await writeContractAsync({
|
|
2641
|
+
address: paymaster.address,
|
|
2642
|
+
abi: paymasterAbi,
|
|
2643
|
+
functionName: "depositTo",
|
|
2644
|
+
args: [userAddress],
|
|
2645
|
+
value: amount
|
|
2646
|
+
});
|
|
2647
|
+
const receipt = publicClient.waitForTransactionReceipt({ hash }).then((receipt2) => {
|
|
2648
|
+
if (receipt2.status === "reverted") {
|
|
2649
|
+
throw new Error("Transfer transaction reverted.");
|
|
2650
|
+
}
|
|
2651
|
+
return receipt2;
|
|
2652
|
+
});
|
|
2653
|
+
const pendingDeposit = {
|
|
2654
|
+
type: "transfer",
|
|
2655
|
+
amount,
|
|
2656
|
+
chainL1Id: sourceChain.id,
|
|
2657
|
+
chainL2Id: chain.id,
|
|
2658
|
+
hash,
|
|
2659
|
+
receipt,
|
|
2660
|
+
start: /* @__PURE__ */ new Date(),
|
|
2661
|
+
estimatedTime: 1e3 * 12,
|
|
2662
|
+
isComplete: receipt.then(() => void 0)
|
|
2663
|
+
};
|
|
2664
|
+
addDeposit(pendingDeposit);
|
|
2665
|
+
} catch (error2) {
|
|
2666
|
+
console.error("Error while depositing via bridge", error2);
|
|
2667
|
+
throw error2;
|
|
2668
|
+
}
|
|
2669
|
+
}
|
|
2670
|
+
});
|
|
2671
|
+
const estimatedFee = prepareData?.gas && gasPrice ? prepareData.gas * gasPrice : void 0;
|
|
2672
|
+
return /* @__PURE__ */ jsx30(
|
|
2673
|
+
DepositForm,
|
|
2674
|
+
{
|
|
2675
|
+
sourceChain,
|
|
2676
|
+
setSourceChainId,
|
|
2677
|
+
amount,
|
|
2678
|
+
setAmount,
|
|
2679
|
+
estimatedFee: {
|
|
2680
|
+
fee: estimatedFee,
|
|
2681
|
+
isLoading: !prepareData && !prepareError || !gasPrice,
|
|
2682
|
+
error: prepareError instanceof Error ? prepareError : void 0
|
|
2683
|
+
},
|
|
2684
|
+
estimatedTime: "A few seconds",
|
|
2685
|
+
onSubmit: async () => {
|
|
2686
|
+
await deposit.mutateAsync();
|
|
2687
|
+
},
|
|
2688
|
+
submitButton: /* @__PURE__ */ jsx30(
|
|
2689
|
+
SubmitButton,
|
|
2690
|
+
{
|
|
2691
|
+
variant: "primary",
|
|
2692
|
+
amount,
|
|
2693
|
+
chainId: sourceChain.id,
|
|
2694
|
+
disabled: !!prepareError || !amount || !userAddress,
|
|
2695
|
+
pending: deposit.isPending,
|
|
2696
|
+
children: "Deposit"
|
|
2697
|
+
}
|
|
2698
|
+
)
|
|
2699
|
+
}
|
|
2700
|
+
);
|
|
2701
|
+
}
|
|
2702
|
+
|
|
2703
|
+
// src/onboarding/deposit/DepositViaRelayForm.tsx
|
|
2704
|
+
import { encodeFunctionData as encodeFunctionData3 } from "viem";
|
|
2705
|
+
import { useAccount as useAccount5, useWalletClient } from "wagmi";
|
|
2706
|
+
import { useMutation as useMutation5, useQuery as useQuery13 } from "@tanstack/react-query";
|
|
2707
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2708
|
+
var ETH_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
2709
|
+
function DepositViaRelayForm({ amount, setAmount, sourceChain, setSourceChainId }) {
|
|
2710
|
+
const { chain, chainId: destinationChainId } = useEntryKitConfig();
|
|
2711
|
+
const paymaster = getPaymaster(chain);
|
|
2712
|
+
const { data: wallet } = useWalletClient();
|
|
2713
|
+
const { address: userAddress } = useAccount5();
|
|
2714
|
+
const { addDeposit } = useDeposits();
|
|
2715
|
+
const { data: relay } = useRelay();
|
|
2716
|
+
const relayClient = relay?.client;
|
|
2717
|
+
const quote = useQuery13({
|
|
2718
|
+
queryKey: ["relayBridgeQuote", sourceChain.id, amount?.toString()],
|
|
2719
|
+
queryFn: async () => {
|
|
2720
|
+
if (!relayClient) throw new Error("No Relay client found.");
|
|
2721
|
+
if (!userAddress) throw new Error("No user address found.");
|
|
2722
|
+
const result = await relayClient.actions.getQuote({
|
|
2723
|
+
chainId: sourceChain.id,
|
|
2724
|
+
toChainId: destinationChainId,
|
|
2725
|
+
currency: ETH_ADDRESS,
|
|
2726
|
+
toCurrency: ETH_ADDRESS,
|
|
2727
|
+
amount: amount?.toString(),
|
|
2728
|
+
tradeType: "EXACT_OUTPUT",
|
|
2729
|
+
recipient: paymaster?.address,
|
|
2730
|
+
wallet,
|
|
2731
|
+
txs: [
|
|
2732
|
+
{
|
|
2733
|
+
to: paymaster?.address,
|
|
2734
|
+
data: encodeFunctionData3({
|
|
2735
|
+
abi: paymasterAbi,
|
|
2736
|
+
functionName: "depositTo",
|
|
2737
|
+
args: [userAddress]
|
|
2738
|
+
}),
|
|
2739
|
+
value: amount?.toString()
|
|
2740
|
+
}
|
|
2741
|
+
]
|
|
2742
|
+
});
|
|
2743
|
+
if (!result) {
|
|
2744
|
+
throw new Error("Failed to get relay quote");
|
|
2745
|
+
}
|
|
2746
|
+
return result;
|
|
2747
|
+
},
|
|
2748
|
+
retry: 1,
|
|
2749
|
+
refetchInterval: 15e3,
|
|
2750
|
+
enabled: !!amount && !!userAddress && !!relayClient
|
|
2751
|
+
});
|
|
2752
|
+
const deposit = useMutation5({
|
|
2753
|
+
mutationKey: ["depositViaRelay", sourceChain.id, amount?.toString()],
|
|
2754
|
+
mutationFn: async ({ quote: quote2, amount: amount2 }) => {
|
|
2755
|
+
if (!relayClient) throw new Error("No Relay client found.");
|
|
2756
|
+
if (!wallet) throw new Error("No wallet found.");
|
|
2757
|
+
try {
|
|
2758
|
+
return new Promise((resolve) => {
|
|
2759
|
+
const pendingDeposit = relayClient.actions.execute({
|
|
2760
|
+
quote: quote2,
|
|
2761
|
+
wallet,
|
|
2762
|
+
onProgress(progress) {
|
|
2763
|
+
const currentStep = progress.currentStep;
|
|
2764
|
+
const requestId = currentStep?.requestId;
|
|
2765
|
+
const currentState = currentStep?.items[0]?.progressState;
|
|
2766
|
+
if (requestId && currentState === "validating") {
|
|
2767
|
+
addDeposit({
|
|
2768
|
+
type: "relay",
|
|
2769
|
+
requestId,
|
|
2770
|
+
amount: amount2,
|
|
2771
|
+
chainL1Id: sourceChain.id,
|
|
2772
|
+
chainL2Id: destinationChainId,
|
|
2773
|
+
start: /* @__PURE__ */ new Date(),
|
|
2774
|
+
estimatedTime: 1e3 * 30,
|
|
2775
|
+
depositPromise: pendingDeposit,
|
|
2776
|
+
isComplete: pendingDeposit.then(() => void 0)
|
|
2777
|
+
});
|
|
2778
|
+
resolve(void 0);
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
});
|
|
2782
|
+
});
|
|
2783
|
+
} catch (error2) {
|
|
2784
|
+
console.error("Error while depositing via Relay", error2);
|
|
2785
|
+
throw error2;
|
|
2786
|
+
}
|
|
2787
|
+
}
|
|
2788
|
+
});
|
|
2789
|
+
const fees = quote.data?.fees;
|
|
2790
|
+
const gasFee = BigInt(fees?.gas?.amount ?? 0);
|
|
2791
|
+
const relayerFee = BigInt(fees?.relayer?.amount ?? 0);
|
|
2792
|
+
const fee = gasFee + relayerFee;
|
|
2793
|
+
return /* @__PURE__ */ jsx31(
|
|
2794
|
+
DepositForm,
|
|
2795
|
+
{
|
|
2796
|
+
sourceChain,
|
|
2797
|
+
setSourceChainId,
|
|
2798
|
+
amount,
|
|
2799
|
+
setAmount,
|
|
2800
|
+
estimatedFee: {
|
|
2801
|
+
fee: fee != null ? BigInt(fee) : void 0,
|
|
2802
|
+
isLoading: quote.isLoading,
|
|
2803
|
+
error: quote.error instanceof Error ? quote.error : void 0
|
|
2804
|
+
},
|
|
2805
|
+
estimatedTime: "A few seconds",
|
|
2806
|
+
onSubmit: async () => {
|
|
2807
|
+
if (!quote.data || !amount) return;
|
|
2808
|
+
await deposit.mutateAsync({ quote: quote.data, amount });
|
|
2809
|
+
},
|
|
2810
|
+
submitButton: /* @__PURE__ */ jsx31(
|
|
2811
|
+
SubmitButton,
|
|
2812
|
+
{
|
|
2813
|
+
variant: "primary",
|
|
2814
|
+
amount,
|
|
2815
|
+
chainId: sourceChain.id,
|
|
2816
|
+
disabled: quote.isError || !amount,
|
|
2817
|
+
pending: deposit.isPending,
|
|
2818
|
+
children: "Deposit"
|
|
2819
|
+
}
|
|
2820
|
+
)
|
|
2821
|
+
}
|
|
2822
|
+
);
|
|
2823
|
+
}
|
|
2824
|
+
|
|
2825
|
+
// src/onboarding/deposit/Deposits.tsx
|
|
2826
|
+
import { useEffect as useEffect13 } from "react";
|
|
2827
|
+
import { useQuery as useQuery16, useQueryClient as useQueryClient7 } from "@tanstack/react-query";
|
|
2828
|
+
|
|
2829
|
+
// src/onboarding/deposit/TransferDepositStatus.tsx
|
|
2830
|
+
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
|
2831
|
+
|
|
2832
|
+
// src/onboarding/deposit/DepositStatus.tsx
|
|
2833
|
+
import { useEffect as useEffect12, useState as useState3 } from "react";
|
|
2834
|
+
import { twMerge as twMerge16 } from "tailwind-merge";
|
|
2835
|
+
|
|
2836
|
+
// src/icons/CloseIcon.tsx
|
|
2837
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2838
|
+
function CloseIcon(props) {
|
|
2839
|
+
return /* @__PURE__ */ jsx32(IconSVG, { strokeWidth: "2", stroke: "currentColor", ...props, children: /* @__PURE__ */ jsx32(
|
|
2840
|
+
"path",
|
|
2841
|
+
{
|
|
2842
|
+
d: "M6 18L18 6M6 6L18 18",
|
|
2843
|
+
fill: "none",
|
|
2844
|
+
stroke: "currentColor",
|
|
2845
|
+
strokeWidth: "2",
|
|
2846
|
+
strokeLinecap: "round",
|
|
2847
|
+
strokeLinejoin: "round"
|
|
2848
|
+
}
|
|
2849
|
+
) });
|
|
2850
|
+
}
|
|
2851
|
+
|
|
2852
|
+
// src/onboarding/deposit/DepositStatus.tsx
|
|
2853
|
+
import { jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2854
|
+
function DepositStatus({ status, progress, children, onDismiss }) {
|
|
2855
|
+
const [appear, setAppear] = useState3(false);
|
|
2856
|
+
useEffect12(() => {
|
|
2857
|
+
setAppear(true);
|
|
2858
|
+
}, []);
|
|
2859
|
+
return /* @__PURE__ */ jsxs19("div", { className: "group bg-neutral-900 flex flex-col animate-in fade-in slide-in-from-bottom-2 animate-out fade-out", children: [
|
|
2860
|
+
/* @__PURE__ */ jsxs19("div", { className: "py-1 text-sm flex items-center gap-2", children: [
|
|
2861
|
+
/* @__PURE__ */ jsx33("div", { className: "flex-grow", children }),
|
|
2862
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex-shrink-0 grid", children: [
|
|
2863
|
+
/* @__PURE__ */ jsx33("span", { className: "col-start-1 row-start-1 transition opacity-100 group-hover:opacity-0 group-hover:pointer-events-none", children: status === "success" ? /* @__PURE__ */ jsx33(CheckIcon, { className: "text-green-600" }) : status === "error" ? /* @__PURE__ */ jsx33(WarningIcon, { className: "text-amber-500" }) : /* @__PURE__ */ jsx33(PendingIcon, { className: "text-neutral-500 transition" }) }),
|
|
2864
|
+
/* @__PURE__ */ jsx33(
|
|
2865
|
+
"button",
|
|
2866
|
+
{
|
|
2867
|
+
type: "button",
|
|
2868
|
+
className: twMerge16(
|
|
2869
|
+
"col-start-1 row-start-1 flex items-center justify-center transition",
|
|
2870
|
+
"opacity-0 pointer-events-none",
|
|
2871
|
+
"group-hover:opacity-100 group-hover:pointer-events-auto",
|
|
2872
|
+
"text-neutral-500 hover:text-white"
|
|
2873
|
+
),
|
|
2874
|
+
title: "Dismiss",
|
|
2875
|
+
onClick: onDismiss,
|
|
2876
|
+
children: /* @__PURE__ */ jsx33(CloseIcon, {})
|
|
2877
|
+
}
|
|
2878
|
+
)
|
|
2879
|
+
] })
|
|
2880
|
+
] }),
|
|
2881
|
+
/* @__PURE__ */ jsx33("div", { className: "w-full h-[2px] -mt-full overflow-clip", children: /* @__PURE__ */ jsx33(
|
|
2882
|
+
"div",
|
|
2883
|
+
{
|
|
2884
|
+
className: twMerge16(
|
|
2885
|
+
"w-full h-full transition ease-linear",
|
|
2886
|
+
status === "success" ? "bg-green-600" : status === "error" ? "bg-red-600" : "bg-blue-600",
|
|
2887
|
+
status === "pending" ? "opacity-100" : "opacity-0"
|
|
2888
|
+
),
|
|
2889
|
+
style: status === "pending" ? {
|
|
2890
|
+
transform: appear ? `translateX(0)` : "translate(-100%)",
|
|
2891
|
+
transitionDuration: `${progress.duration}ms`,
|
|
2892
|
+
transitionDelay: `-${Math.min(progress.duration, progress.elapsed)}ms`
|
|
2893
|
+
} : void 0
|
|
2894
|
+
}
|
|
2895
|
+
) })
|
|
2896
|
+
] });
|
|
2897
|
+
}
|
|
2898
|
+
|
|
2899
|
+
// src/onboarding/deposit/TransferDepositStatus.tsx
|
|
2900
|
+
import { useChains as useChains2 } from "wagmi";
|
|
2901
|
+
import { Fragment as Fragment4, jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2902
|
+
function TransferDepositStatus({
|
|
2903
|
+
amount,
|
|
2904
|
+
chainL1Id,
|
|
2905
|
+
hash,
|
|
2906
|
+
receipt: receiptPromise,
|
|
2907
|
+
start,
|
|
2908
|
+
estimatedTime,
|
|
2909
|
+
onDismiss
|
|
2910
|
+
}) {
|
|
2911
|
+
const chains = useChains2();
|
|
2912
|
+
const chain = chains.find((chain2) => chain2.id === chainL1Id);
|
|
2913
|
+
const receipt = useQuery14({
|
|
2914
|
+
queryKey: ["transferDepositStatus", hash],
|
|
2915
|
+
queryFn: () => receiptPromise
|
|
2916
|
+
});
|
|
2917
|
+
return /* @__PURE__ */ jsx34(
|
|
2918
|
+
DepositStatus,
|
|
2919
|
+
{
|
|
2920
|
+
status: receipt.status,
|
|
2921
|
+
progress: {
|
|
2922
|
+
duration: estimatedTime,
|
|
2923
|
+
elapsed: Math.min(estimatedTime, Date.now() - start.getTime())
|
|
2924
|
+
},
|
|
2925
|
+
onDismiss,
|
|
2926
|
+
children: (() => {
|
|
2927
|
+
const blockExplorer = chain.blockExplorers?.default.url;
|
|
2928
|
+
if (receipt.status === "pending") {
|
|
2929
|
+
return /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
2930
|
+
"Confirming deposit on",
|
|
2931
|
+
" ",
|
|
2932
|
+
/* @__PURE__ */ jsx34(
|
|
2933
|
+
"a",
|
|
2934
|
+
{
|
|
2935
|
+
href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
|
|
2936
|
+
target: "_blank",
|
|
2937
|
+
rel: "noreferrer noopener",
|
|
2938
|
+
children: chain.name
|
|
2939
|
+
}
|
|
2940
|
+
),
|
|
2941
|
+
"\u2026"
|
|
2942
|
+
] });
|
|
2943
|
+
}
|
|
2944
|
+
if (receipt.status === "error") {
|
|
2945
|
+
return /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
2946
|
+
"Could not find deposit on",
|
|
2947
|
+
" ",
|
|
2948
|
+
/* @__PURE__ */ jsx34(
|
|
2949
|
+
"a",
|
|
2950
|
+
{
|
|
2951
|
+
href: blockExplorer ? `${blockExplorer}/tx/${hash}` : void 0,
|
|
2952
|
+
target: "_blank",
|
|
2953
|
+
rel: "noreferrer noopener",
|
|
2954
|
+
children: chain.name
|
|
2955
|
+
}
|
|
2956
|
+
),
|
|
2957
|
+
"."
|
|
2958
|
+
] });
|
|
2959
|
+
}
|
|
2960
|
+
return /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
2961
|
+
"Successfully",
|
|
2962
|
+
" ",
|
|
2963
|
+
/* @__PURE__ */ jsx34(
|
|
2964
|
+
"a",
|
|
2965
|
+
{
|
|
2966
|
+
href: blockExplorer ? `${blockExplorer}/tx/${receipt.data.transactionHash}` : void 0,
|
|
2967
|
+
target: "_blank",
|
|
2968
|
+
rel: "noreferrer noopener",
|
|
2969
|
+
children: "deposited"
|
|
2970
|
+
}
|
|
2971
|
+
),
|
|
2972
|
+
" ",
|
|
2973
|
+
/* @__PURE__ */ jsx34(Balance, { wei: amount })
|
|
2974
|
+
] });
|
|
2975
|
+
})()
|
|
2976
|
+
}
|
|
2977
|
+
);
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2980
|
+
// src/onboarding/deposit/RelayDepositStatus.tsx
|
|
2981
|
+
import { useQuery as useQuery15 } from "@tanstack/react-query";
|
|
2982
|
+
import { useChains as useChains3 } from "wagmi";
|
|
2983
|
+
import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2984
|
+
function RelayDepositStatus({
|
|
2985
|
+
amount,
|
|
2986
|
+
chainL1Id,
|
|
2987
|
+
chainL2Id,
|
|
2988
|
+
start,
|
|
2989
|
+
estimatedTime,
|
|
2990
|
+
depositPromise,
|
|
2991
|
+
onDismiss
|
|
2992
|
+
}) {
|
|
2993
|
+
const chains = useChains3();
|
|
2994
|
+
const chainL1 = chains.find((chain) => chain.id === chainL1Id);
|
|
2995
|
+
const chainL2 = chains.find((chain) => chain.id === chainL2Id);
|
|
2996
|
+
const deposit = useQuery15({
|
|
2997
|
+
queryKey: ["relayDepositPromise", chainL1Id, chainL2Id, amount.toString(), start.toISOString()],
|
|
2998
|
+
queryFn: () => depositPromise
|
|
2999
|
+
});
|
|
3000
|
+
return /* @__PURE__ */ jsx35(
|
|
3001
|
+
DepositStatus,
|
|
3002
|
+
{
|
|
3003
|
+
status: deposit.status,
|
|
3004
|
+
progress: {
|
|
3005
|
+
duration: estimatedTime,
|
|
3006
|
+
elapsed: Math.min(estimatedTime, Date.now() - start.getTime())
|
|
3007
|
+
},
|
|
3008
|
+
onDismiss,
|
|
3009
|
+
children: (() => {
|
|
3010
|
+
if (deposit.status === "pending") {
|
|
3011
|
+
return /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
3012
|
+
"Relay bridge deposit pending on ",
|
|
3013
|
+
chainL1.name,
|
|
3014
|
+
"\u2026"
|
|
3015
|
+
] });
|
|
3016
|
+
}
|
|
3017
|
+
if (deposit.status === "error") {
|
|
3018
|
+
return /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
3019
|
+
"Relay bridge deposit to ",
|
|
3020
|
+
chainL2.name,
|
|
3021
|
+
" failed."
|
|
3022
|
+
] });
|
|
3023
|
+
}
|
|
3024
|
+
return /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
3025
|
+
"Successfully bridged ",
|
|
3026
|
+
/* @__PURE__ */ jsx35(Balance, { wei: amount }),
|
|
3027
|
+
" to ",
|
|
3028
|
+
chainL2.name,
|
|
3029
|
+
"!"
|
|
3030
|
+
] });
|
|
3031
|
+
})()
|
|
3032
|
+
}
|
|
3033
|
+
);
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3036
|
+
// src/onboarding/deposit/Deposits.tsx
|
|
3037
|
+
import { useAccount as useAccount6, useClient as useClient11 } from "wagmi";
|
|
3038
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3039
|
+
function Deposits() {
|
|
3040
|
+
const queryClient = useQueryClient7();
|
|
3041
|
+
const { chainId } = useEntryKitConfig();
|
|
3042
|
+
const client = useClient11({ chainId });
|
|
3043
|
+
const { address: userAddress } = useAccount6();
|
|
3044
|
+
const { deposits, removeDeposit } = useDeposits();
|
|
3045
|
+
const { data: isComplete } = useQuery16({
|
|
3046
|
+
queryKey: ["depositsComplete", deposits.map((deposit) => deposit.uid)],
|
|
3047
|
+
queryFn: async () => {
|
|
3048
|
+
if (!deposits.length) return false;
|
|
3049
|
+
await Promise.all(deposits.map((deposit) => deposit.isComplete));
|
|
3050
|
+
return true;
|
|
3051
|
+
}
|
|
3052
|
+
});
|
|
3053
|
+
useEffect13(() => {
|
|
3054
|
+
if (isComplete) {
|
|
3055
|
+
queryClient.invalidateQueries({ queryKey: ["balance"] });
|
|
3056
|
+
queryClient.invalidateQueries({ queryKey: ["getBalance", client?.uid, userAddress] });
|
|
3057
|
+
}
|
|
3058
|
+
}, [client?.uid, isComplete, queryClient, userAddress]);
|
|
3059
|
+
if (!deposits.length) return null;
|
|
3060
|
+
return /* @__PURE__ */ jsx36("div", { className: "flex flex-col gap-1 mt-4", children: deposits.map((deposit) => {
|
|
3061
|
+
if (deposit.type === "transfer") {
|
|
3062
|
+
return /* @__PURE__ */ jsx36(TransferDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
|
|
3063
|
+
} else if (deposit.type === "relay") {
|
|
3064
|
+
return /* @__PURE__ */ jsx36(RelayDepositStatus, { ...deposit, onDismiss: () => removeDeposit(deposit.uid) }, deposit.uid);
|
|
3065
|
+
}
|
|
3066
|
+
}) });
|
|
3067
|
+
}
|
|
3068
|
+
|
|
3069
|
+
// src/onboarding/deposit/DepositFormContainer.tsx
|
|
3070
|
+
import { jsx as jsx37, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3071
|
+
function DepositFormContainer() {
|
|
3072
|
+
const { chainId: destinationChainId } = useEntryKitConfig();
|
|
3073
|
+
const chainId = useChainId();
|
|
3074
|
+
const chains = useChains4();
|
|
3075
|
+
const [amount, setAmount] = useState4(void 0);
|
|
3076
|
+
const [sourceChainId, setSourceChainId] = useState4(chainId);
|
|
3077
|
+
const sourceChain = chains.find(({ id }) => id === sourceChainId);
|
|
3078
|
+
return /* @__PURE__ */ jsxs22("div", { className: "pt-10 pb-2", children: [
|
|
3079
|
+
destinationChainId === sourceChainId ? /* @__PURE__ */ jsx37(
|
|
3080
|
+
DepositViaTransferForm,
|
|
3081
|
+
{
|
|
3082
|
+
amount,
|
|
3083
|
+
setAmount,
|
|
3084
|
+
sourceChain,
|
|
3085
|
+
setSourceChainId
|
|
3086
|
+
}
|
|
3087
|
+
) : /* @__PURE__ */ jsx37(
|
|
3088
|
+
DepositViaRelayForm,
|
|
3089
|
+
{
|
|
3090
|
+
amount,
|
|
3091
|
+
setAmount,
|
|
3092
|
+
sourceChain,
|
|
3093
|
+
setSourceChainId
|
|
3094
|
+
}
|
|
3095
|
+
),
|
|
3096
|
+
/* @__PURE__ */ jsx37(Deposits, {})
|
|
3097
|
+
] });
|
|
3098
|
+
}
|
|
3099
|
+
|
|
3100
|
+
// src/icons/ArrowLeftIcon.tsx
|
|
3101
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3102
|
+
function ArrowLeftIcon(props) {
|
|
3103
|
+
return /* @__PURE__ */ jsx38(IconSVG, { ...props, children: /* @__PURE__ */ jsx38(
|
|
3104
|
+
"path",
|
|
3105
|
+
{
|
|
3106
|
+
d: "M19 12H5M12 19l-7-7 7-7",
|
|
3107
|
+
fill: "none",
|
|
3108
|
+
stroke: "currentColor",
|
|
3109
|
+
strokeWidth: "2",
|
|
3110
|
+
strokeLinecap: "round",
|
|
3111
|
+
strokeLinejoin: "round"
|
|
3112
|
+
}
|
|
3113
|
+
) });
|
|
3114
|
+
}
|
|
3115
|
+
|
|
3116
|
+
// src/onboarding/quarry/WithdrawGasBalanceButton.tsx
|
|
3117
|
+
import { getAction as getAction6 } from "viem/utils";
|
|
3118
|
+
import { waitForTransactionReceipt as waitForTransactionReceipt3 } from "viem/actions";
|
|
3119
|
+
import { useAccount as useAccount7, useClient as useClient12, useSwitchChain as useSwitchChain3, useWriteContract as useWriteContract2 } from "wagmi";
|
|
3120
|
+
import { twMerge as twMerge17 } from "tailwind-merge";
|
|
3121
|
+
import { useMutation as useMutation6 } from "@tanstack/react-query";
|
|
3122
|
+
import { useQueryClient as useQueryClient8 } from "@tanstack/react-query";
|
|
3123
|
+
import { jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3124
|
+
function WithdrawGasBalanceButton({ userAddress }) {
|
|
3125
|
+
const { writeContractAsync } = useWriteContract2();
|
|
3126
|
+
const { switchChain } = useSwitchChain3();
|
|
3127
|
+
const { chain, chainId } = useEntryKitConfig();
|
|
3128
|
+
const { chainId: userChainId } = useAccount7();
|
|
3129
|
+
const queryClient = useQueryClient8();
|
|
3130
|
+
const client = useClient12({ chainId });
|
|
3131
|
+
const paymaster = getPaymaster(chain);
|
|
3132
|
+
const balance = useShowQueryError(useBalance(userAddress));
|
|
3133
|
+
const shouldSwitchChain = chainId != null && chainId !== userChainId;
|
|
3134
|
+
const withdraw = useMutation6({
|
|
3135
|
+
mutationKey: ["withdraw", userAddress],
|
|
3136
|
+
mutationFn: async () => {
|
|
3137
|
+
if (!client) throw new Error("Client not ready.");
|
|
3138
|
+
if (!paymaster) throw new Error("Paymaster not found");
|
|
3139
|
+
if (!balance.data) throw new Error("No gas balance to withdraw.");
|
|
3140
|
+
try {
|
|
3141
|
+
const hash = await writeContractAsync({
|
|
3142
|
+
address: paymaster.address,
|
|
3143
|
+
abi: paymasterAbi,
|
|
3144
|
+
functionName: "withdrawTo",
|
|
3145
|
+
args: [userAddress, balance.data],
|
|
3146
|
+
chainId
|
|
3147
|
+
});
|
|
3148
|
+
await getAction6(client, waitForTransactionReceipt3, "waitForTransactionReceipt")({ hash });
|
|
3149
|
+
await Promise.all([
|
|
3150
|
+
queryClient.invalidateQueries({ queryKey: ["balance"] }),
|
|
3151
|
+
queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] })
|
|
3152
|
+
]);
|
|
3153
|
+
} catch (error2) {
|
|
3154
|
+
console.error("Error while withdrawing", error2);
|
|
3155
|
+
throw error2;
|
|
3156
|
+
}
|
|
3157
|
+
}
|
|
3158
|
+
});
|
|
3159
|
+
if (balance.data == null || balance.data === 0n) {
|
|
3160
|
+
return null;
|
|
3161
|
+
}
|
|
3162
|
+
return /* @__PURE__ */ jsx39(
|
|
3163
|
+
"button",
|
|
3164
|
+
{
|
|
3165
|
+
onClick: () => {
|
|
3166
|
+
if (shouldSwitchChain) {
|
|
3167
|
+
return switchChain({ chainId });
|
|
3168
|
+
}
|
|
3169
|
+
withdraw.mutate();
|
|
3170
|
+
},
|
|
3171
|
+
className: twMerge17(
|
|
3172
|
+
"text-sm font-medium text-white/50 group whitespace-nowrap",
|
|
3173
|
+
withdraw.isPending ? "opacity-50 pointer-events-none" : "cursor-pointer hover:text-white"
|
|
3174
|
+
),
|
|
3175
|
+
disabled: withdraw.isPending,
|
|
3176
|
+
children: /* @__PURE__ */ jsxs23("span", { className: "inline-block", children: [
|
|
3177
|
+
/* @__PURE__ */ jsxs23(
|
|
3178
|
+
"span",
|
|
3179
|
+
{
|
|
3180
|
+
className: twMerge17(
|
|
3181
|
+
"inline-flex items-center gap-1 underline decoration-neutral-500 underline-offset-4",
|
|
3182
|
+
!withdraw.isPending && "hover:decoration-orange-500",
|
|
3183
|
+
shouldSwitchChain && "group-hover:hidden"
|
|
3184
|
+
),
|
|
3185
|
+
children: [
|
|
3186
|
+
withdraw.isPending && /* @__PURE__ */ jsx39(PendingIcon, { className: "w-3 h-3" }),
|
|
3187
|
+
"Withdraw"
|
|
3188
|
+
]
|
|
3189
|
+
}
|
|
3190
|
+
),
|
|
3191
|
+
shouldSwitchChain && /* @__PURE__ */ jsx39("span", { className: "hidden group-hover:inline-block underline decoration-neutral-500 underline-offset-4 hover:decoration-orange-500", children: "Switch chain" })
|
|
3192
|
+
] })
|
|
3193
|
+
}
|
|
3194
|
+
);
|
|
3195
|
+
}
|
|
3196
|
+
|
|
3197
|
+
// src/onboarding/quarry/GasBalance.tsx
|
|
3198
|
+
import { jsx as jsx40, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3199
|
+
function GasBalance2({ isActive, isExpanded, isFocused, setFocused, userAddress }) {
|
|
3200
|
+
const queryClient = useQueryClient9();
|
|
3201
|
+
const balance = useShowQueryError(useBalance(userAddress));
|
|
3202
|
+
const prevBalance = usePrevious(balance.data || 0n);
|
|
3203
|
+
useEffect14(() => {
|
|
3204
|
+
if (balance.data != null && prevBalance === 0n && balance.data > 0n) {
|
|
3205
|
+
queryClient.invalidateQueries({ queryKey: ["getPrerequisites"] });
|
|
3206
|
+
setFocused(false);
|
|
3207
|
+
}
|
|
3208
|
+
}, [balance.data, prevBalance, setFocused, queryClient, userAddress]);
|
|
3209
|
+
if (isFocused) {
|
|
3210
|
+
return /* @__PURE__ */ jsxs24("div", { children: [
|
|
3211
|
+
isFocused && /* @__PURE__ */ jsx40("div", { className: "absolute top-0 left-0", children: /* @__PURE__ */ jsx40(
|
|
3212
|
+
"div",
|
|
3213
|
+
{
|
|
3214
|
+
className: "flex items-center justify-center w-10 h-10 text-white/20 hover:text-white/40 cursor-pointer",
|
|
3215
|
+
onClick: () => setFocused(false),
|
|
3216
|
+
children: /* @__PURE__ */ jsx40(ArrowLeftIcon, { className: "m-0" })
|
|
3217
|
+
}
|
|
3218
|
+
) }),
|
|
3219
|
+
/* @__PURE__ */ jsx40(DepositFormContainer, {})
|
|
3220
|
+
] });
|
|
3221
|
+
}
|
|
3222
|
+
return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-4", children: [
|
|
3223
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex justify-between gap-4", children: [
|
|
3224
|
+
/* @__PURE__ */ jsxs24("div", { children: [
|
|
3225
|
+
/* @__PURE__ */ jsx40("div", { children: "Gas balance" }),
|
|
3226
|
+
/* @__PURE__ */ jsx40("div", { className: "font-mono text-white", children: balance.data != null ? /* @__PURE__ */ jsx40(Balance, { wei: balance.data }) : /* @__PURE__ */ jsx40(PendingIcon, { className: "text-sm" }) })
|
|
3227
|
+
] }),
|
|
3228
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-1 justify-center items-center", children: [
|
|
3229
|
+
/* @__PURE__ */ jsx40(
|
|
3230
|
+
Button,
|
|
3231
|
+
{
|
|
3232
|
+
variant: isActive ? "primary" : "tertiary",
|
|
3233
|
+
className: "flex-shrink-0 text-sm p-1 w-28",
|
|
3234
|
+
autoFocus: isActive || isExpanded,
|
|
3235
|
+
pending: balance.status === "pending",
|
|
3236
|
+
onClick: () => setFocused(true),
|
|
3237
|
+
children: "Top up"
|
|
3238
|
+
}
|
|
3239
|
+
),
|
|
3240
|
+
/* @__PURE__ */ jsx40(WithdrawGasBalanceButton, { userAddress })
|
|
3241
|
+
] })
|
|
3242
|
+
] }),
|
|
3243
|
+
isExpanded ? /* @__PURE__ */ jsx40("p", { className: "text-sm", children: "Your gas balance is used to pay for onchain computation." }) : null
|
|
3244
|
+
] });
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
// src/onboarding/ConnectedSteps.tsx
|
|
3248
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3249
|
+
function ConnectedSteps({ userClient, initialUserAddress }) {
|
|
3250
|
+
const { chain } = useEntryKitConfig();
|
|
3251
|
+
const paymaster = getPaymaster(chain);
|
|
3252
|
+
const [focusedId, setFocusedId] = useState5(null);
|
|
3253
|
+
const userAddress = userClient.account.address;
|
|
3254
|
+
const { data: prerequisites, error: prerequisitesError } = usePrerequisites(userAddress);
|
|
3255
|
+
useEffect15(() => {
|
|
3256
|
+
if (prerequisitesError) {
|
|
3257
|
+
console.error("Could not get prerequisites", prerequisitesError);
|
|
3258
|
+
}
|
|
3259
|
+
}, [prerequisitesError]);
|
|
3260
|
+
const { closeAccountModal } = useAccountModal();
|
|
3261
|
+
const isNewConnection = userAddress !== initialUserAddress;
|
|
3262
|
+
const initialPrerequisites = useRef5(prerequisites);
|
|
3263
|
+
useEffect15(() => {
|
|
3264
|
+
if (prerequisites == null) return;
|
|
3265
|
+
if (initialPrerequisites.current == null) {
|
|
3266
|
+
initialPrerequisites.current = prerequisites;
|
|
3267
|
+
}
|
|
3268
|
+
if (prerequisites.complete) {
|
|
3269
|
+
if (isNewConnection || !initialPrerequisites.current.complete) {
|
|
3270
|
+
closeAccountModal();
|
|
3271
|
+
}
|
|
3272
|
+
}
|
|
3273
|
+
}, [closeAccountModal, isNewConnection, prerequisites]);
|
|
3274
|
+
const { sessionAddress, hasAllowance, isSpender, hasDelegation, hasGasBalance, hasQuarryGasBalance } = prerequisites ?? {};
|
|
3275
|
+
const steps = useMemo4(() => {
|
|
3276
|
+
if (!userAddress) {
|
|
3277
|
+
return [
|
|
3278
|
+
{
|
|
3279
|
+
id: "wallet",
|
|
3280
|
+
isComplete: false,
|
|
3281
|
+
content: () => null
|
|
3282
|
+
}
|
|
3283
|
+
];
|
|
3284
|
+
}
|
|
3285
|
+
const steps2 = [
|
|
3286
|
+
{
|
|
3287
|
+
id: "wallet",
|
|
3288
|
+
isComplete: true,
|
|
3289
|
+
content: (props) => /* @__PURE__ */ jsx41(Wallet, { ...props, userAddress })
|
|
3290
|
+
}
|
|
3291
|
+
];
|
|
3292
|
+
if (!paymaster) {
|
|
1979
3293
|
if (sessionAddress != null) {
|
|
1980
3294
|
steps2.push({
|
|
1981
3295
|
id: "gasBalance",
|
|
1982
3296
|
isComplete: !!hasGasBalance,
|
|
1983
|
-
content: (props) => /* @__PURE__ */
|
|
3297
|
+
content: (props) => /* @__PURE__ */ jsx41(GasBalance, { ...props, sessionAddress })
|
|
1984
3298
|
});
|
|
1985
3299
|
}
|
|
1986
3300
|
} else if (paymaster.type === "quarry") {
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
3301
|
+
if (paymaster.isGasPass) {
|
|
3302
|
+
steps2.push({
|
|
3303
|
+
id: "allowance",
|
|
3304
|
+
isComplete: !!hasAllowance,
|
|
3305
|
+
content: (props) => /* @__PURE__ */ jsx41(Allowance, { ...props, userAddress })
|
|
3306
|
+
});
|
|
3307
|
+
} else {
|
|
3308
|
+
steps2.push({
|
|
3309
|
+
id: "gasBalanceQuarry",
|
|
3310
|
+
isComplete: !!hasQuarryGasBalance,
|
|
3311
|
+
content: (props) => /* @__PURE__ */ jsx41(GasBalance2, { ...props, userAddress })
|
|
3312
|
+
});
|
|
3313
|
+
}
|
|
1992
3314
|
}
|
|
1993
3315
|
steps2.push({
|
|
1994
3316
|
id: "session",
|
|
1995
3317
|
isComplete: !!isSpender && !!hasDelegation,
|
|
1996
|
-
content: (props) => /* @__PURE__ */
|
|
3318
|
+
content: (props) => /* @__PURE__ */ jsx41(Session, { ...props, userClient, registerSpender: !isSpender, registerDelegation: !hasDelegation })
|
|
1997
3319
|
});
|
|
1998
3320
|
return steps2;
|
|
1999
|
-
}, [
|
|
2000
|
-
|
|
3321
|
+
}, [
|
|
3322
|
+
hasAllowance,
|
|
3323
|
+
hasDelegation,
|
|
3324
|
+
hasGasBalance,
|
|
3325
|
+
hasQuarryGasBalance,
|
|
3326
|
+
isSpender,
|
|
3327
|
+
paymaster,
|
|
3328
|
+
sessionAddress,
|
|
3329
|
+
userAddress,
|
|
3330
|
+
userClient
|
|
3331
|
+
]);
|
|
3332
|
+
const [selectedStepId] = useState5(null);
|
|
2001
3333
|
const nextStep = steps.find((step) => step.content != null && !step.isComplete);
|
|
2002
3334
|
const completedSteps = steps.filter((step) => step.isComplete);
|
|
2003
3335
|
const activeStep = (selectedStepId != null ? steps.find((step) => step.id === selectedStepId) : null) ?? nextStep ?? (completedSteps.length < steps.length ? completedSteps.at(-1) : null);
|
|
2004
3336
|
const activeStepIndex = activeStep ? steps.indexOf(activeStep) : -1;
|
|
2005
|
-
return /* @__PURE__ */
|
|
3337
|
+
return /* @__PURE__ */ jsx41(
|
|
2006
3338
|
"div",
|
|
2007
3339
|
{
|
|
2008
|
-
className:
|
|
2009
|
-
|
|
2010
|
-
"
|
|
3340
|
+
className: twMerge18(
|
|
3341
|
+
"px-8 flex flex-col",
|
|
3342
|
+
"divide-y divide-neutral-800",
|
|
2011
3343
|
"animate-in animate-duration-300 fade-in slide-in-from-bottom-8"
|
|
2012
3344
|
),
|
|
2013
3345
|
children: steps.map((step, i) => {
|
|
2014
3346
|
const isActive = step === activeStep;
|
|
2015
3347
|
const isExpanded = isActive || completedSteps.length === steps.length;
|
|
2016
3348
|
const isDisabled = !step.isComplete && activeStepIndex !== -1 && i > activeStepIndex;
|
|
2017
|
-
|
|
3349
|
+
const isFocused = focusedId === step.id;
|
|
3350
|
+
const content = step.content({
|
|
3351
|
+
isActive,
|
|
3352
|
+
isExpanded,
|
|
3353
|
+
isFocused,
|
|
3354
|
+
setFocused: (focused) => setFocusedId(focused ? step.id : null)
|
|
3355
|
+
});
|
|
3356
|
+
if (focusedId) {
|
|
3357
|
+
if (step.id === focusedId) {
|
|
3358
|
+
return content;
|
|
3359
|
+
}
|
|
3360
|
+
return null;
|
|
3361
|
+
}
|
|
3362
|
+
return /* @__PURE__ */ jsx41("div", { className: twMerge18("py-8 flex flex-col justify-center", isActive ? "flex-grow" : null), children: /* @__PURE__ */ jsx41("div", { className: twMerge18("flex flex-col", isDisabled ? "opacity-30 pointer-events-none" : null), children: content }) }, step.id);
|
|
2018
3363
|
})
|
|
2019
3364
|
}
|
|
2020
3365
|
);
|
|
2021
3366
|
}
|
|
2022
3367
|
|
|
2023
3368
|
// src/AccountModalContent.tsx
|
|
2024
|
-
import { useRef as
|
|
2025
|
-
import { jsx as
|
|
3369
|
+
import { useRef as useRef6 } from "react";
|
|
3370
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
2026
3371
|
function AccountModalContent() {
|
|
2027
3372
|
const { chainId } = useEntryKitConfig();
|
|
2028
3373
|
const userClient = useConnectorClient({ chainId });
|
|
2029
|
-
const { address: userAddress } =
|
|
2030
|
-
const initialUserAddress =
|
|
3374
|
+
const { address: userAddress } = useAccount8();
|
|
3375
|
+
const initialUserAddress = useRef6(userAddress);
|
|
2031
3376
|
if (userClient.status !== "success") {
|
|
2032
|
-
return /* @__PURE__ */
|
|
3377
|
+
return /* @__PURE__ */ jsx42(ConnectWallet, {});
|
|
2033
3378
|
}
|
|
2034
|
-
return /* @__PURE__ */
|
|
3379
|
+
return /* @__PURE__ */ jsx42(ConnectedSteps, { userClient: userClient.data, initialUserAddress: initialUserAddress.current });
|
|
2035
3380
|
}
|
|
2036
3381
|
|
|
2037
3382
|
// src/AccountModal.tsx
|
|
2038
3383
|
import { DialogClose } from "@radix-ui/react-dialog";
|
|
2039
|
-
|
|
2040
|
-
// src/icons/IconSVG.tsx
|
|
2041
|
-
import { twMerge as twMerge8 } from "tailwind-merge";
|
|
2042
|
-
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2043
|
-
function IconSVG({ className, children, ...props }) {
|
|
2044
|
-
return /* @__PURE__ */ jsx19(
|
|
2045
|
-
"svg",
|
|
2046
|
-
{
|
|
2047
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2048
|
-
viewBox: "0 0 24 24",
|
|
2049
|
-
fill: "currentColor",
|
|
2050
|
-
className: twMerge8("-my-[0.125em] h-[1.25em] w-[1.25em]", className),
|
|
2051
|
-
...props,
|
|
2052
|
-
children
|
|
2053
|
-
}
|
|
2054
|
-
);
|
|
2055
|
-
}
|
|
2056
|
-
|
|
2057
|
-
// src/icons/CloseIcon.tsx
|
|
2058
|
-
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2059
|
-
function CloseIcon(props) {
|
|
2060
|
-
return /* @__PURE__ */ jsx20(IconSVG, { strokeWidth: "2", stroke: "currentColor", ...props, children: /* @__PURE__ */ jsx20(
|
|
2061
|
-
"path",
|
|
2062
|
-
{
|
|
2063
|
-
d: "M6 18L18 6M6 6L18 18",
|
|
2064
|
-
fill: "none",
|
|
2065
|
-
stroke: "currentColor",
|
|
2066
|
-
strokeWidth: "2",
|
|
2067
|
-
strokeLinecap: "round",
|
|
2068
|
-
strokeLinejoin: "round"
|
|
2069
|
-
}
|
|
2070
|
-
) });
|
|
2071
|
-
}
|
|
2072
|
-
|
|
2073
|
-
// src/AccountModal.tsx
|
|
2074
3384
|
import { ErrorBoundary } from "react-error-boundary";
|
|
2075
3385
|
|
|
2076
3386
|
// src/errors/ErrorOverlay.tsx
|
|
2077
3387
|
import { wait } from "@latticexyz/common/utils";
|
|
2078
|
-
import { useEffect as
|
|
2079
|
-
import { twMerge as
|
|
2080
|
-
import { Fragment as
|
|
3388
|
+
import { useEffect as useEffect16 } from "react";
|
|
3389
|
+
import { twMerge as twMerge19 } from "tailwind-merge";
|
|
3390
|
+
import { Fragment as Fragment6, jsx as jsx43, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2081
3391
|
function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
2082
|
-
|
|
3392
|
+
useEffect16(() => {
|
|
2083
3393
|
if (error2) {
|
|
2084
3394
|
console.error(error2);
|
|
2085
3395
|
}
|
|
2086
3396
|
}, [error2]);
|
|
2087
|
-
return /* @__PURE__ */
|
|
2088
|
-
/* @__PURE__ */
|
|
3397
|
+
return /* @__PURE__ */ jsxs25("div", { className: "pointer-events-none absolute inset-0 overflow-clip", children: [
|
|
3398
|
+
/* @__PURE__ */ jsx43(
|
|
2089
3399
|
"div",
|
|
2090
3400
|
{
|
|
2091
|
-
className:
|
|
3401
|
+
className: twMerge19(
|
|
2092
3402
|
"absolute inset-0 bg-blue-700/60",
|
|
2093
3403
|
"transition duration-300",
|
|
2094
3404
|
error2 ? "opacity-100 pointer-events-auto" : "opacity-0"
|
|
2095
3405
|
)
|
|
2096
3406
|
}
|
|
2097
3407
|
),
|
|
2098
|
-
/* @__PURE__ */
|
|
3408
|
+
/* @__PURE__ */ jsx43(
|
|
2099
3409
|
"div",
|
|
2100
3410
|
{
|
|
2101
|
-
className:
|
|
3411
|
+
className: twMerge19(
|
|
2102
3412
|
"absolute inset-0 pb-8",
|
|
2103
3413
|
"transition duration-300",
|
|
2104
3414
|
error2 ? "translate-y-0 opacity-100 pointer-events-auto" : "-translate-y-4 opacity-0"
|
|
2105
3415
|
),
|
|
2106
|
-
children: error2 ? /* @__PURE__ */
|
|
2107
|
-
/* @__PURE__ */
|
|
2108
|
-
/* @__PURE__ */
|
|
2109
|
-
/* @__PURE__ */
|
|
2110
|
-
/* @__PURE__ */
|
|
3416
|
+
children: error2 ? /* @__PURE__ */ jsx43(Fragment6, { children: /* @__PURE__ */ jsxs25("div", { className: "w-full max-h-full bg-blue-700 text-white/80 overflow-auto", children: [
|
|
3417
|
+
/* @__PURE__ */ jsxs25("div", { className: "space-y-6 px-8 pt-8", children: [
|
|
3418
|
+
/* @__PURE__ */ jsx43("div", { className: "text-white text-lg font-bold", children: "Oops! It broke :(" }),
|
|
3419
|
+
/* @__PURE__ */ jsx43("div", { className: "font-mono text-xs whitespace-pre-wrap", children: error2.message.trim() }),
|
|
3420
|
+
/* @__PURE__ */ jsx43("div", { className: "text-sm", children: "See the console for more info." })
|
|
2111
3421
|
] }),
|
|
2112
|
-
/* @__PURE__ */
|
|
2113
|
-
/* @__PURE__ */
|
|
2114
|
-
retry ? /* @__PURE__ */
|
|
3422
|
+
/* @__PURE__ */ jsxs25("div", { className: "pointer-events-none sticky bottom-0 left-0 -mt-2", children: [
|
|
3423
|
+
/* @__PURE__ */ jsx43("div", { className: "w-full h-12 bg-gradient-to-b from-transparent to-blue-700" }),
|
|
3424
|
+
retry ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsxs25(
|
|
2115
3425
|
"button",
|
|
2116
3426
|
{
|
|
2117
3427
|
type: "button",
|
|
2118
|
-
className:
|
|
3428
|
+
className: twMerge19(
|
|
2119
3429
|
"pointer-events-auto group w-24 p-1 -translate-y-2 transition",
|
|
2120
3430
|
"bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
|
|
2121
3431
|
"text-white text-sm font-medium",
|
|
@@ -2130,15 +3440,15 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
|
2130
3440
|
}
|
|
2131
3441
|
},
|
|
2132
3442
|
children: [
|
|
2133
|
-
/* @__PURE__ */
|
|
2134
|
-
/* @__PURE__ */
|
|
3443
|
+
/* @__PURE__ */ jsx43("span", { className: "group-aria-busy:hidden", children: "Retry" }),
|
|
3444
|
+
/* @__PURE__ */ jsx43("span", { className: "hidden group-aria-busy:inline", children: "Retrying\u2026" })
|
|
2135
3445
|
]
|
|
2136
3446
|
}
|
|
2137
|
-
) }) : dismiss ? /* @__PURE__ */
|
|
3447
|
+
) }) : dismiss ? /* @__PURE__ */ jsx43("div", { className: "bg-blue-700 text-center", children: /* @__PURE__ */ jsx43(
|
|
2138
3448
|
"button",
|
|
2139
3449
|
{
|
|
2140
3450
|
type: "button",
|
|
2141
|
-
className:
|
|
3451
|
+
className: twMerge19(
|
|
2142
3452
|
"pointer-events-auto group w-24 p-1 -translate-y-2 transition",
|
|
2143
3453
|
"bg-blue-600 hover:bg-blue-500 aria-busy:bg-blue-500",
|
|
2144
3454
|
"text-white text-sm font-medium",
|
|
@@ -2156,27 +3466,27 @@ function ErrorOverlay({ error: error2, retry, dismiss }) {
|
|
|
2156
3466
|
}
|
|
2157
3467
|
|
|
2158
3468
|
// src/errors/ErrorFallback.tsx
|
|
2159
|
-
import { jsx as
|
|
3469
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2160
3470
|
function ErrorFallback({ error: error2, resetErrorBoundary }) {
|
|
2161
|
-
return /* @__PURE__ */
|
|
3471
|
+
return /* @__PURE__ */ jsx44("div", { className: "h-64", children: /* @__PURE__ */ jsx44(ErrorOverlay, { error: error2, retry: resetErrorBoundary }) });
|
|
2162
3472
|
}
|
|
2163
3473
|
|
|
2164
3474
|
// src/errors/ErrorsOverlay.tsx
|
|
2165
|
-
import { useStore as
|
|
2166
|
-
import { jsx as
|
|
3475
|
+
import { useStore as useStore3 } from "zustand";
|
|
3476
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2167
3477
|
function ErrorsOverlay() {
|
|
2168
|
-
const error2 =
|
|
2169
|
-
return /* @__PURE__ */
|
|
3478
|
+
const error2 = useStore3(store3, (state) => state.errors.at(0));
|
|
3479
|
+
return /* @__PURE__ */ jsx45(ErrorOverlay, { error: error2?.error, retry: error2?.retry, dismiss: error2?.dismiss });
|
|
2170
3480
|
}
|
|
2171
3481
|
|
|
2172
3482
|
// src/AccountModal.tsx
|
|
2173
|
-
import { jsx as
|
|
3483
|
+
import { jsx as jsx46, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2174
3484
|
function AccountModal() {
|
|
2175
3485
|
const { accountModalOpen, toggleAccountModal } = useAccountModal();
|
|
2176
|
-
return /* @__PURE__ */
|
|
3486
|
+
return /* @__PURE__ */ jsx46(Modal, { open: accountModalOpen, onOpenChange: toggleAccountModal, children: accountModalOpen ? /* @__PURE__ */ jsxs26(
|
|
2177
3487
|
"div",
|
|
2178
3488
|
{
|
|
2179
|
-
className:
|
|
3489
|
+
className: twMerge20(
|
|
2180
3490
|
"relative py-2 ring-1",
|
|
2181
3491
|
"bg-neutral-900 text-neutral-400 ring-neutral-700/50",
|
|
2182
3492
|
"links:font-medium links:underline links:underline-offset-4",
|
|
@@ -2184,11 +3494,11 @@ function AccountModal() {
|
|
|
2184
3494
|
"links:decoration-neutral-500 hover:links:decoration-orange-500"
|
|
2185
3495
|
),
|
|
2186
3496
|
children: [
|
|
2187
|
-
/* @__PURE__ */
|
|
2188
|
-
/* @__PURE__ */
|
|
2189
|
-
/* @__PURE__ */
|
|
3497
|
+
/* @__PURE__ */ jsxs26(ErrorBoundary, { FallbackComponent: ErrorFallback, children: [
|
|
3498
|
+
/* @__PURE__ */ jsx46(AccountModalContent, {}),
|
|
3499
|
+
/* @__PURE__ */ jsx46(ErrorsOverlay, {})
|
|
2190
3500
|
] }),
|
|
2191
|
-
/* @__PURE__ */
|
|
3501
|
+
/* @__PURE__ */ jsxs26(
|
|
2192
3502
|
"a",
|
|
2193
3503
|
{
|
|
2194
3504
|
href: "https://mud.dev",
|
|
@@ -2196,20 +3506,20 @@ function AccountModal() {
|
|
|
2196
3506
|
rel: "noreferrer noopener",
|
|
2197
3507
|
className: "group self-center p-3 flex items-center justify-center gap-2 links-unset text-sm font-mono transition text-neutral-400 hover:text-white",
|
|
2198
3508
|
children: [
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
/* @__PURE__ */
|
|
3509
|
+
/* @__PURE__ */ jsx46("span", { className: "block w-4 h-4", children: /* @__PURE__ */ jsx46(Logo, { className: "w-full h-full text-orange-500 group-hover:rotate-90 transition duration-300" }) }),
|
|
3510
|
+
/* @__PURE__ */ jsx46("span", { children: "Powered by MUD" })
|
|
2201
3511
|
]
|
|
2202
3512
|
}
|
|
2203
3513
|
),
|
|
2204
|
-
/* @__PURE__ */
|
|
3514
|
+
/* @__PURE__ */ jsx46("div", { className: "absolute top-0 right-0", children: /* @__PURE__ */ jsx46(
|
|
2205
3515
|
DialogClose,
|
|
2206
3516
|
{
|
|
2207
|
-
className:
|
|
3517
|
+
className: twMerge20(
|
|
2208
3518
|
"pointer-events-auto leading-none p-2 transition",
|
|
2209
3519
|
"text-white/20 hover:text-white/40"
|
|
2210
3520
|
),
|
|
2211
3521
|
title: "Close",
|
|
2212
|
-
children: /* @__PURE__ */
|
|
3522
|
+
children: /* @__PURE__ */ jsx46(CloseIcon, { className: "m-0" })
|
|
2213
3523
|
}
|
|
2214
3524
|
) })
|
|
2215
3525
|
]
|
|
@@ -2218,31 +3528,31 @@ function AccountModal() {
|
|
|
2218
3528
|
}
|
|
2219
3529
|
|
|
2220
3530
|
// src/EntryKitProvider.tsx
|
|
2221
|
-
import { jsx as
|
|
3531
|
+
import { jsx as jsx47, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2222
3532
|
function EntryKitProvider({ config, children }) {
|
|
2223
|
-
return /* @__PURE__ */
|
|
3533
|
+
return /* @__PURE__ */ jsxs27(EntryKitConfigProvider, { config, children: [
|
|
2224
3534
|
children,
|
|
2225
|
-
/* @__PURE__ */
|
|
3535
|
+
/* @__PURE__ */ jsx47(AccountModal, {})
|
|
2226
3536
|
] });
|
|
2227
3537
|
}
|
|
2228
3538
|
|
|
2229
3539
|
// src/AccountButton.tsx
|
|
2230
|
-
import { useAccount as
|
|
2231
|
-
import { twMerge as
|
|
3540
|
+
import { useAccount as useAccount9 } from "wagmi";
|
|
3541
|
+
import { twMerge as twMerge22 } from "tailwind-merge";
|
|
2232
3542
|
|
|
2233
3543
|
// src/AccountName.tsx
|
|
2234
|
-
import { twMerge as
|
|
2235
|
-
import { Fragment as
|
|
3544
|
+
import { twMerge as twMerge21 } from "tailwind-merge";
|
|
3545
|
+
import { Fragment as Fragment7, jsx as jsx48, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2236
3546
|
function AccountName({ address }) {
|
|
2237
3547
|
const { data: ens } = useENS(address);
|
|
2238
3548
|
const avatar = usePreloadImage(ens?.avatar);
|
|
2239
|
-
return /* @__PURE__ */
|
|
2240
|
-
/* @__PURE__ */
|
|
2241
|
-
/* @__PURE__ */
|
|
3549
|
+
return /* @__PURE__ */ jsxs28(Fragment7, { children: [
|
|
3550
|
+
/* @__PURE__ */ jsxs28("span", { className: "flex-shrink-0 w-6 h-6 -my-1 -mx-0.5 grid place-items-center", children: [
|
|
3551
|
+
/* @__PURE__ */ jsx48(
|
|
2242
3552
|
"img",
|
|
2243
3553
|
{
|
|
2244
3554
|
src: ens?.avatar && avatar.isSuccess ? ens.avatar : void 0,
|
|
2245
|
-
className:
|
|
3555
|
+
className: twMerge21(
|
|
2246
3556
|
"col-start-1 row-start-1",
|
|
2247
3557
|
"inline-flex w-full h-full rounded-full bg-black/10 dark:bg-white/10 bg-cover bg-no-repeat bg-center",
|
|
2248
3558
|
"transtion duration-300",
|
|
@@ -2250,10 +3560,10 @@ function AccountName({ address }) {
|
|
|
2250
3560
|
)
|
|
2251
3561
|
}
|
|
2252
3562
|
),
|
|
2253
|
-
/* @__PURE__ */
|
|
3563
|
+
/* @__PURE__ */ jsx48(
|
|
2254
3564
|
Logo,
|
|
2255
3565
|
{
|
|
2256
|
-
className:
|
|
3566
|
+
className: twMerge21(
|
|
2257
3567
|
"col-start-1 row-start-1 text-orange-500",
|
|
2258
3568
|
"transition duration-300",
|
|
2259
3569
|
ens && (!ens.avatar || avatar.isError) ? "opacity-100" : "opacity-0"
|
|
@@ -2261,29 +3571,29 @@ function AccountName({ address }) {
|
|
|
2261
3571
|
}
|
|
2262
3572
|
)
|
|
2263
3573
|
] }),
|
|
2264
|
-
/* @__PURE__ */
|
|
3574
|
+
/* @__PURE__ */ jsx48("span", { className: "flex-grow", children: ens?.name ?? /* @__PURE__ */ jsx48(TruncatedHex, { hex: address }) })
|
|
2265
3575
|
] });
|
|
2266
3576
|
}
|
|
2267
3577
|
|
|
2268
3578
|
// src/AccountButton.tsx
|
|
2269
|
-
import { useRef as
|
|
2270
|
-
import { jsx as
|
|
2271
|
-
var containerClassNames =
|
|
3579
|
+
import { useRef as useRef7 } from "react";
|
|
3580
|
+
import { jsx as jsx49, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3581
|
+
var containerClassNames = twMerge22(
|
|
2272
3582
|
"w-48 p-3 inline-flex outline-none transition",
|
|
2273
3583
|
"border border-transparent",
|
|
2274
3584
|
"text-base leading-none"
|
|
2275
3585
|
);
|
|
2276
|
-
var secondaryClassNames =
|
|
3586
|
+
var secondaryClassNames = twMerge22(
|
|
2277
3587
|
"bg-neutral-100 border-neutral-300 text-black",
|
|
2278
3588
|
"dark:bg-neutral-800 dark:border-neutral-700 dark:text-white"
|
|
2279
3589
|
);
|
|
2280
|
-
var secondaryInteractiveClassNames =
|
|
3590
|
+
var secondaryInteractiveClassNames = twMerge22(
|
|
2281
3591
|
"cursor-pointer outline-none hover:bg-neutral-200 data-[highlighted]:bg-neutral-200 dark:hover:bg-neutral-700"
|
|
2282
3592
|
);
|
|
2283
3593
|
function AccountButton() {
|
|
2284
3594
|
const { openAccountModal, accountModalOpen } = useAccountModal();
|
|
2285
|
-
const { status, address: userAddress } =
|
|
2286
|
-
const initialUserAddress =
|
|
3595
|
+
const { status, address: userAddress } = useAccount9();
|
|
3596
|
+
const initialUserAddress = useRef7(userAddress);
|
|
2287
3597
|
const prereqs = usePrerequisites(userAddress);
|
|
2288
3598
|
const isConnected = status === "connected" || status === "reconnecting" && userAddress;
|
|
2289
3599
|
const isNewConnection = userAddress !== initialUserAddress.current;
|
|
@@ -2295,20 +3605,20 @@ function AccountButton() {
|
|
|
2295
3605
|
}
|
|
2296
3606
|
return "Sign in";
|
|
2297
3607
|
})();
|
|
2298
|
-
return /* @__PURE__ */
|
|
3608
|
+
return /* @__PURE__ */ jsx49(Shadow, { mode: "child", children: isSignedIn ? /* @__PURE__ */ jsx49(
|
|
2299
3609
|
"button",
|
|
2300
3610
|
{
|
|
2301
3611
|
type: "button",
|
|
2302
|
-
className:
|
|
3612
|
+
className: twMerge22(containerClassNames, secondaryClassNames, secondaryInteractiveClassNames),
|
|
2303
3613
|
onClick: openAccountModal,
|
|
2304
|
-
children: /* @__PURE__ */
|
|
3614
|
+
children: /* @__PURE__ */ jsx49("span", { className: "flex-grow inline-flex gap-2.5 items-center text-left font-medium", children: userAddress ? /* @__PURE__ */ jsx49(AccountName, { address: userAddress }) : null })
|
|
2305
3615
|
},
|
|
2306
3616
|
"connected"
|
|
2307
|
-
) : /* @__PURE__ */
|
|
3617
|
+
) : /* @__PURE__ */ jsxs29(
|
|
2308
3618
|
"button",
|
|
2309
3619
|
{
|
|
2310
3620
|
type: "button",
|
|
2311
|
-
className:
|
|
3621
|
+
className: twMerge22(
|
|
2312
3622
|
containerClassNames,
|
|
2313
3623
|
"group",
|
|
2314
3624
|
"items-center justify-center gap-2.5",
|
|
@@ -2319,32 +3629,32 @@ function AccountButton() {
|
|
|
2319
3629
|
"aria-busy": accountModalOpen,
|
|
2320
3630
|
onClick: openAccountModal,
|
|
2321
3631
|
children: [
|
|
2322
|
-
/* @__PURE__ */
|
|
2323
|
-
/* @__PURE__ */
|
|
3632
|
+
/* @__PURE__ */ jsxs29("span", { className: "pointer-events-none inline-grid place-items-center -ml-3", children: [
|
|
3633
|
+
/* @__PURE__ */ jsx49(
|
|
2324
3634
|
"span",
|
|
2325
3635
|
{
|
|
2326
|
-
className:
|
|
3636
|
+
className: twMerge22(
|
|
2327
3637
|
"col-start-1 row-start-1 leading-none",
|
|
2328
3638
|
"scale-100 opacity-100 transition duration-300",
|
|
2329
3639
|
"group-aria-busy:scale-125 group-aria-busy:opacity-0"
|
|
2330
3640
|
),
|
|
2331
|
-
children: /* @__PURE__ */
|
|
3641
|
+
children: /* @__PURE__ */ jsx49(Logo, {})
|
|
2332
3642
|
}
|
|
2333
3643
|
),
|
|
2334
|
-
/* @__PURE__ */
|
|
3644
|
+
/* @__PURE__ */ jsx49(
|
|
2335
3645
|
"span",
|
|
2336
3646
|
{
|
|
2337
3647
|
"aria-hidden": true,
|
|
2338
|
-
className:
|
|
3648
|
+
className: twMerge22(
|
|
2339
3649
|
"col-start-1 row-start-1",
|
|
2340
3650
|
"scale-50 opacity-0 transition duration-300 delay-50",
|
|
2341
3651
|
"group-aria-busy:scale-100 group-aria-busy:opacity-100"
|
|
2342
3652
|
),
|
|
2343
|
-
children: /* @__PURE__ */
|
|
3653
|
+
children: /* @__PURE__ */ jsx49(PendingIcon, {})
|
|
2344
3654
|
}
|
|
2345
3655
|
)
|
|
2346
3656
|
] }),
|
|
2347
|
-
/* @__PURE__ */
|
|
3657
|
+
/* @__PURE__ */ jsx49("span", { className: "font-medium", children: buttonLabel })
|
|
2348
3658
|
]
|
|
2349
3659
|
},
|
|
2350
3660
|
"sign in"
|
|
@@ -2366,44 +3676,379 @@ function useSessionClientReady() {
|
|
|
2366
3676
|
}
|
|
2367
3677
|
|
|
2368
3678
|
// src/createWagmiConfig.ts
|
|
2369
|
-
import { connectorsForWallets } from "@rainbow-me/rainbowkit";
|
|
2370
3679
|
import { createConfig } from "wagmi";
|
|
3680
|
+
import { getDefaultConfig } from "connectkit";
|
|
3681
|
+
import { injected, coinbaseWallet, safe } from "wagmi/connectors";
|
|
2371
3682
|
|
|
2372
|
-
// src/
|
|
2373
|
-
import {
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
3683
|
+
// src/connectors/walletConnect.ts
|
|
3684
|
+
import { ChainNotConfiguredError, ProviderNotFoundError, createConnector } from "wagmi";
|
|
3685
|
+
import {
|
|
3686
|
+
SwitchChainError,
|
|
3687
|
+
UserRejectedRequestError,
|
|
3688
|
+
getAddress,
|
|
3689
|
+
numberToHex as numberToHex3
|
|
3690
|
+
} from "viem";
|
|
3691
|
+
walletConnect.type = "walletConnect";
|
|
3692
|
+
function walletConnect(parameters) {
|
|
3693
|
+
const isNewChainsStale = parameters.isNewChainsStale ?? true;
|
|
3694
|
+
let provider_;
|
|
3695
|
+
let providerPromise;
|
|
3696
|
+
const NAMESPACE = "eip155";
|
|
3697
|
+
let accountsChanged;
|
|
3698
|
+
let chainChanged;
|
|
3699
|
+
let connect;
|
|
3700
|
+
let displayUri;
|
|
3701
|
+
let sessionDelete;
|
|
3702
|
+
let disconnect;
|
|
3703
|
+
return createConnector((config) => ({
|
|
3704
|
+
id: "walletConnect",
|
|
3705
|
+
name: "WalletConnect",
|
|
3706
|
+
type: walletConnect.type,
|
|
3707
|
+
async setup() {
|
|
3708
|
+
const provider = await this.getProvider().catch(() => null);
|
|
3709
|
+
if (!provider) return;
|
|
3710
|
+
if (!connect) {
|
|
3711
|
+
connect = this.onConnect.bind(this);
|
|
3712
|
+
provider.on("connect", connect);
|
|
3713
|
+
}
|
|
3714
|
+
if (!sessionDelete) {
|
|
3715
|
+
sessionDelete = this.onSessionDelete.bind(this);
|
|
3716
|
+
provider.on("session_delete", sessionDelete);
|
|
3717
|
+
}
|
|
3718
|
+
},
|
|
3719
|
+
async connect({ chainId, ...rest } = {}) {
|
|
3720
|
+
try {
|
|
3721
|
+
const provider = await this.getProvider();
|
|
3722
|
+
if (!provider) throw new ProviderNotFoundError();
|
|
3723
|
+
if (!displayUri) {
|
|
3724
|
+
displayUri = this.onDisplayUri;
|
|
3725
|
+
provider.on("display_uri", displayUri);
|
|
3726
|
+
}
|
|
3727
|
+
let targetChainId = chainId;
|
|
3728
|
+
if (!targetChainId) {
|
|
3729
|
+
const state = await config.storage?.getItem("state") ?? {};
|
|
3730
|
+
const isChainSupported = config.chains.some((x) => x.id === state.chainId);
|
|
3731
|
+
if (isChainSupported) targetChainId = state.chainId;
|
|
3732
|
+
else targetChainId = config.chains[0]?.id;
|
|
3733
|
+
}
|
|
3734
|
+
if (!targetChainId) throw new Error("No chains found on connector.");
|
|
3735
|
+
const isChainsStale = await this.isChainsStale();
|
|
3736
|
+
if (provider.session && isChainsStale) await provider.disconnect();
|
|
3737
|
+
if (!provider.session || isChainsStale) {
|
|
3738
|
+
const optionalChains = config.chains.filter((chain) => chain.id !== targetChainId).map((optionalChain) => optionalChain.id);
|
|
3739
|
+
await provider.connect({
|
|
3740
|
+
optionalChains: [targetChainId, ...optionalChains],
|
|
3741
|
+
..."pairingTopic" in rest ? { pairingTopic: rest.pairingTopic } : {}
|
|
3742
|
+
});
|
|
3743
|
+
this.setRequestedChainsIds(config.chains.map((x) => x.id));
|
|
3744
|
+
}
|
|
3745
|
+
const accounts = (await provider.enable()).map((x) => getAddress(x));
|
|
3746
|
+
let currentChainId = await this.getChainId();
|
|
3747
|
+
if (chainId && currentChainId !== chainId) {
|
|
3748
|
+
const chain = await this.switchChain({ chainId }).catch((error2) => {
|
|
3749
|
+
if (error2.code === UserRejectedRequestError.code) throw error2;
|
|
3750
|
+
return { id: currentChainId };
|
|
3751
|
+
});
|
|
3752
|
+
currentChainId = chain?.id ?? currentChainId;
|
|
3753
|
+
}
|
|
3754
|
+
if (displayUri) {
|
|
3755
|
+
provider.removeListener("display_uri", displayUri);
|
|
3756
|
+
displayUri = void 0;
|
|
3757
|
+
}
|
|
3758
|
+
if (connect) {
|
|
3759
|
+
provider.removeListener("connect", connect);
|
|
3760
|
+
connect = void 0;
|
|
3761
|
+
}
|
|
3762
|
+
if (!accountsChanged) {
|
|
3763
|
+
accountsChanged = this.onAccountsChanged.bind(this);
|
|
3764
|
+
provider.on("accountsChanged", accountsChanged);
|
|
3765
|
+
}
|
|
3766
|
+
if (!chainChanged) {
|
|
3767
|
+
chainChanged = this.onChainChanged.bind(this);
|
|
3768
|
+
provider.on("chainChanged", chainChanged);
|
|
3769
|
+
}
|
|
3770
|
+
if (!disconnect) {
|
|
3771
|
+
disconnect = this.onDisconnect.bind(this);
|
|
3772
|
+
provider.on("disconnect", disconnect);
|
|
3773
|
+
}
|
|
3774
|
+
if (!sessionDelete) {
|
|
3775
|
+
sessionDelete = this.onSessionDelete.bind(this);
|
|
3776
|
+
provider.on("session_delete", sessionDelete);
|
|
3777
|
+
}
|
|
3778
|
+
return { accounts, chainId: currentChainId };
|
|
3779
|
+
} catch (error2) {
|
|
3780
|
+
if (/(user rejected|connection request reset)/i.test(error2?.message)) {
|
|
3781
|
+
throw new UserRejectedRequestError(error2);
|
|
3782
|
+
}
|
|
3783
|
+
throw error2;
|
|
3784
|
+
}
|
|
3785
|
+
},
|
|
3786
|
+
async disconnect() {
|
|
3787
|
+
const provider = await this.getProvider();
|
|
3788
|
+
try {
|
|
3789
|
+
await provider?.disconnect();
|
|
3790
|
+
} catch (error2) {
|
|
3791
|
+
if (!/No matching key/i.test(error2.message)) throw error2;
|
|
3792
|
+
} finally {
|
|
3793
|
+
if (chainChanged) {
|
|
3794
|
+
provider?.removeListener("chainChanged", chainChanged);
|
|
3795
|
+
chainChanged = void 0;
|
|
3796
|
+
}
|
|
3797
|
+
if (disconnect) {
|
|
3798
|
+
provider?.removeListener("disconnect", disconnect);
|
|
3799
|
+
disconnect = void 0;
|
|
3800
|
+
}
|
|
3801
|
+
if (!connect) {
|
|
3802
|
+
connect = this.onConnect.bind(this);
|
|
3803
|
+
provider?.on("connect", connect);
|
|
3804
|
+
}
|
|
3805
|
+
if (accountsChanged) {
|
|
3806
|
+
provider?.removeListener("accountsChanged", accountsChanged);
|
|
3807
|
+
accountsChanged = void 0;
|
|
3808
|
+
}
|
|
3809
|
+
if (sessionDelete) {
|
|
3810
|
+
provider?.removeListener("session_delete", sessionDelete);
|
|
3811
|
+
sessionDelete = void 0;
|
|
3812
|
+
}
|
|
3813
|
+
this.setRequestedChainsIds([]);
|
|
3814
|
+
}
|
|
3815
|
+
},
|
|
3816
|
+
async getAccounts() {
|
|
3817
|
+
const provider = await this.getProvider();
|
|
3818
|
+
return provider.accounts.map((x) => getAddress(x));
|
|
3819
|
+
},
|
|
3820
|
+
async getProvider() {
|
|
3821
|
+
async function initProvider() {
|
|
3822
|
+
const optionalChains = config.chains.map((x) => x.id);
|
|
3823
|
+
if (!optionalChains.length) return;
|
|
3824
|
+
const { EthereumProvider } = await import("@walletconnect/ethereum-provider");
|
|
3825
|
+
return await EthereumProvider.init({
|
|
3826
|
+
...parameters,
|
|
3827
|
+
disableProviderPing: true,
|
|
3828
|
+
optionalChains,
|
|
3829
|
+
projectId: parameters.projectId,
|
|
3830
|
+
rpcMap: Object.fromEntries(
|
|
3831
|
+
config.chains.map((chain) => {
|
|
3832
|
+
const [url] = extractRpcUrls({
|
|
3833
|
+
chain,
|
|
3834
|
+
transports: config.transports
|
|
3835
|
+
});
|
|
3836
|
+
return [chain.id, url];
|
|
3837
|
+
})
|
|
3838
|
+
),
|
|
3839
|
+
showQrModal: parameters.showQrModal ?? true
|
|
3840
|
+
});
|
|
3841
|
+
}
|
|
3842
|
+
if (!provider_) {
|
|
3843
|
+
if (!providerPromise) providerPromise = initProvider();
|
|
3844
|
+
provider_ = await providerPromise;
|
|
3845
|
+
provider_?.events.setMaxListeners(Number.POSITIVE_INFINITY);
|
|
3846
|
+
}
|
|
3847
|
+
return provider_;
|
|
3848
|
+
},
|
|
3849
|
+
async getChainId() {
|
|
3850
|
+
const provider = await this.getProvider();
|
|
3851
|
+
return provider.chainId;
|
|
3852
|
+
},
|
|
3853
|
+
async isAuthorized() {
|
|
3854
|
+
try {
|
|
3855
|
+
const [accounts, provider] = await Promise.all([this.getAccounts(), this.getProvider()]);
|
|
3856
|
+
if (!accounts.length) return false;
|
|
3857
|
+
const isChainsStale = await this.isChainsStale();
|
|
3858
|
+
if (isChainsStale && provider.session) {
|
|
3859
|
+
await provider.disconnect().catch(() => {
|
|
3860
|
+
});
|
|
3861
|
+
return false;
|
|
3862
|
+
}
|
|
3863
|
+
return true;
|
|
3864
|
+
} catch {
|
|
3865
|
+
return false;
|
|
3866
|
+
}
|
|
3867
|
+
},
|
|
3868
|
+
async switchChain({ addEthereumChainParameter, chainId }) {
|
|
3869
|
+
const provider = await this.getProvider();
|
|
3870
|
+
if (!provider) throw new ProviderNotFoundError();
|
|
3871
|
+
const chain = config.chains.find((x) => x.id === chainId);
|
|
3872
|
+
if (!chain) throw new SwitchChainError(new ChainNotConfiguredError());
|
|
3873
|
+
try {
|
|
3874
|
+
await Promise.all([
|
|
3875
|
+
new Promise((resolve) => {
|
|
3876
|
+
const listener2 = ({ chainId: currentChainId }) => {
|
|
3877
|
+
if (currentChainId === chainId) {
|
|
3878
|
+
config.emitter.off("change", listener2);
|
|
3879
|
+
resolve();
|
|
3880
|
+
}
|
|
3881
|
+
};
|
|
3882
|
+
config.emitter.on("change", listener2);
|
|
3883
|
+
}),
|
|
3884
|
+
provider.request({
|
|
3885
|
+
method: "wallet_switchEthereumChain",
|
|
3886
|
+
params: [{ chainId: numberToHex3(chainId) }]
|
|
3887
|
+
})
|
|
3888
|
+
]);
|
|
3889
|
+
const requestedChains = await this.getRequestedChainsIds();
|
|
3890
|
+
this.setRequestedChainsIds([...requestedChains, chainId]);
|
|
3891
|
+
return chain;
|
|
3892
|
+
} catch (err) {
|
|
3893
|
+
const error2 = err;
|
|
3894
|
+
if (/(user rejected)/i.test(error2.message)) throw new UserRejectedRequestError(error2);
|
|
3895
|
+
try {
|
|
3896
|
+
let blockExplorerUrls;
|
|
3897
|
+
if (addEthereumChainParameter?.blockExplorerUrls)
|
|
3898
|
+
blockExplorerUrls = addEthereumChainParameter.blockExplorerUrls;
|
|
3899
|
+
else blockExplorerUrls = chain.blockExplorers?.default.url ? [chain.blockExplorers?.default.url] : [];
|
|
3900
|
+
let rpcUrls;
|
|
3901
|
+
if (addEthereumChainParameter?.rpcUrls?.length) rpcUrls = addEthereumChainParameter.rpcUrls;
|
|
3902
|
+
else rpcUrls = [...chain.rpcUrls.default.http];
|
|
3903
|
+
const addEthereumChain = {
|
|
3904
|
+
blockExplorerUrls,
|
|
3905
|
+
chainId: numberToHex3(chainId),
|
|
3906
|
+
chainName: addEthereumChainParameter?.chainName ?? chain.name,
|
|
3907
|
+
iconUrls: addEthereumChainParameter?.iconUrls,
|
|
3908
|
+
nativeCurrency: addEthereumChainParameter?.nativeCurrency ?? chain.nativeCurrency,
|
|
3909
|
+
rpcUrls
|
|
3910
|
+
};
|
|
3911
|
+
await provider.request({
|
|
3912
|
+
method: "wallet_addEthereumChain",
|
|
3913
|
+
params: [addEthereumChain]
|
|
3914
|
+
});
|
|
3915
|
+
const requestedChains = await this.getRequestedChainsIds();
|
|
3916
|
+
this.setRequestedChainsIds([...requestedChains, chainId]);
|
|
3917
|
+
return chain;
|
|
3918
|
+
} catch (error3) {
|
|
3919
|
+
throw new UserRejectedRequestError(error3);
|
|
3920
|
+
}
|
|
3921
|
+
}
|
|
3922
|
+
},
|
|
3923
|
+
onAccountsChanged(accounts) {
|
|
3924
|
+
if (accounts.length === 0) this.onDisconnect();
|
|
3925
|
+
else
|
|
3926
|
+
config.emitter.emit("change", {
|
|
3927
|
+
accounts: accounts.map((x) => getAddress(x))
|
|
3928
|
+
});
|
|
3929
|
+
},
|
|
3930
|
+
onChainChanged(chain) {
|
|
3931
|
+
const chainId = Number(chain);
|
|
3932
|
+
config.emitter.emit("change", { chainId });
|
|
3933
|
+
},
|
|
3934
|
+
async onConnect(connectInfo) {
|
|
3935
|
+
const chainId = Number(connectInfo.chainId);
|
|
3936
|
+
const accounts = await this.getAccounts();
|
|
3937
|
+
config.emitter.emit("connect", { accounts, chainId });
|
|
3938
|
+
},
|
|
3939
|
+
async onDisconnect(_error) {
|
|
3940
|
+
this.setRequestedChainsIds([]);
|
|
3941
|
+
config.emitter.emit("disconnect");
|
|
3942
|
+
const provider = await this.getProvider();
|
|
3943
|
+
if (accountsChanged) {
|
|
3944
|
+
provider.removeListener("accountsChanged", accountsChanged);
|
|
3945
|
+
accountsChanged = void 0;
|
|
3946
|
+
}
|
|
3947
|
+
if (chainChanged) {
|
|
3948
|
+
provider.removeListener("chainChanged", chainChanged);
|
|
3949
|
+
chainChanged = void 0;
|
|
3950
|
+
}
|
|
3951
|
+
if (disconnect) {
|
|
3952
|
+
provider.removeListener("disconnect", disconnect);
|
|
3953
|
+
disconnect = void 0;
|
|
3954
|
+
}
|
|
3955
|
+
if (sessionDelete) {
|
|
3956
|
+
provider.removeListener("session_delete", sessionDelete);
|
|
3957
|
+
sessionDelete = void 0;
|
|
3958
|
+
}
|
|
3959
|
+
if (!connect) {
|
|
3960
|
+
connect = this.onConnect.bind(this);
|
|
3961
|
+
provider.on("connect", connect);
|
|
3962
|
+
}
|
|
3963
|
+
},
|
|
3964
|
+
onDisplayUri(uri) {
|
|
3965
|
+
config.emitter.emit("message", { type: "display_uri", data: uri });
|
|
3966
|
+
},
|
|
3967
|
+
onSessionDelete() {
|
|
3968
|
+
this.onDisconnect();
|
|
3969
|
+
},
|
|
3970
|
+
getNamespaceChainsIds() {
|
|
3971
|
+
if (!provider_) return [];
|
|
3972
|
+
const chainIds = provider_.session?.namespaces[NAMESPACE]?.accounts?.map(
|
|
3973
|
+
(account) => Number.parseInt(account.split(":")[1] || "")
|
|
3974
|
+
);
|
|
3975
|
+
return chainIds ?? [];
|
|
3976
|
+
},
|
|
3977
|
+
async getRequestedChainsIds() {
|
|
3978
|
+
return await config.storage?.getItem(this.requestedChainsStorageKey) ?? [];
|
|
3979
|
+
},
|
|
3980
|
+
/**
|
|
3981
|
+
* Checks if the target chains match the chains that were
|
|
3982
|
+
* initially requested by the connector for the WalletConnect session.
|
|
3983
|
+
* If there is a mismatch, this means that the chains on the connector
|
|
3984
|
+
* are considered stale, and need to be revalidated at a later point (via
|
|
3985
|
+
* connection).
|
|
3986
|
+
*
|
|
3987
|
+
* There may be a scenario where a dapp adds a chain to the
|
|
3988
|
+
* connector later on, however, this chain will not have been approved or rejected
|
|
3989
|
+
* by the wallet. In this case, the chain is considered stale.
|
|
3990
|
+
*/
|
|
3991
|
+
async isChainsStale() {
|
|
3992
|
+
if (!isNewChainsStale) return false;
|
|
3993
|
+
const connectorChains = config.chains.map((x) => x.id);
|
|
3994
|
+
const namespaceChains = this.getNamespaceChainsIds();
|
|
3995
|
+
if (namespaceChains.length && !namespaceChains.some((id) => connectorChains.includes(id))) return false;
|
|
3996
|
+
const requestedChains = await this.getRequestedChainsIds();
|
|
3997
|
+
return !connectorChains.every((id) => requestedChains.includes(id));
|
|
3998
|
+
},
|
|
3999
|
+
async setRequestedChainsIds(chains) {
|
|
4000
|
+
await config.storage?.setItem(this.requestedChainsStorageKey, chains);
|
|
4001
|
+
},
|
|
4002
|
+
get requestedChainsStorageKey() {
|
|
4003
|
+
return `${this.id}.requestedChains`;
|
|
4004
|
+
}
|
|
4005
|
+
}));
|
|
4006
|
+
}
|
|
4007
|
+
function extractRpcUrls(parameters) {
|
|
4008
|
+
const { chain } = parameters;
|
|
4009
|
+
const fallbackUrl = chain.rpcUrls.default.http[0];
|
|
4010
|
+
if (!parameters.transports) return [fallbackUrl];
|
|
4011
|
+
const transport = parameters.transports?.[chain.id]?.({ chain });
|
|
4012
|
+
const transports = transport?.value?.transports || [transport];
|
|
4013
|
+
return transports.map(({ value }) => value?.url || fallbackUrl);
|
|
2380
4014
|
}
|
|
2381
4015
|
|
|
2382
4016
|
// src/createWagmiConfig.ts
|
|
2383
4017
|
function createWagmiConfig(config) {
|
|
2384
|
-
const
|
|
2385
|
-
const
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
4018
|
+
const connectors = [];
|
|
4019
|
+
const shouldUseSafeConnector = !(typeof window === "undefined") && window?.parent !== window;
|
|
4020
|
+
if (shouldUseSafeConnector) {
|
|
4021
|
+
connectors.push(
|
|
4022
|
+
safe({
|
|
4023
|
+
allowedDomains: [/gnosis-safe.io$/, /app.safe.global$/]
|
|
4024
|
+
})
|
|
4025
|
+
);
|
|
4026
|
+
}
|
|
4027
|
+
connectors.push(
|
|
4028
|
+
injected({ target: "metaMask" }),
|
|
4029
|
+
coinbaseWallet({
|
|
4030
|
+
appName: config.appName,
|
|
4031
|
+
overrideIsMetaMask: false
|
|
4032
|
+
})
|
|
4033
|
+
);
|
|
4034
|
+
if (config.walletConnectProjectId) {
|
|
4035
|
+
connectors.push(
|
|
4036
|
+
walletConnect({
|
|
4037
|
+
showQrModal: false,
|
|
4038
|
+
projectId: config.walletConnectProjectId
|
|
4039
|
+
})
|
|
4040
|
+
);
|
|
4041
|
+
}
|
|
4042
|
+
const configParams = getDefaultConfig({
|
|
2391
4043
|
chains: config.chains,
|
|
2392
4044
|
transports: config.transports,
|
|
2393
|
-
pollingInterval: config.pollingInterval
|
|
2394
|
-
});
|
|
2395
|
-
}
|
|
2396
|
-
|
|
2397
|
-
// src/getConnectors.ts
|
|
2398
|
-
import { connectorsForWallets as connectorsForWallets2 } from "@rainbow-me/rainbowkit";
|
|
2399
|
-
function getConnectors({
|
|
2400
|
-
wallets,
|
|
2401
|
-
...config
|
|
2402
|
-
}) {
|
|
2403
|
-
return connectorsForWallets2(wallets ?? getWallets(config), {
|
|
4045
|
+
pollingInterval: config.pollingInterval,
|
|
2404
4046
|
appName: config.appName,
|
|
2405
|
-
|
|
4047
|
+
walletConnectProjectId: config.walletConnectProjectId,
|
|
4048
|
+
enableFamily: false,
|
|
4049
|
+
connectors
|
|
2406
4050
|
});
|
|
4051
|
+
return createConfig(configParams);
|
|
2407
4052
|
}
|
|
2408
4053
|
|
|
2409
4054
|
// src/validateSigner.ts
|
|
@@ -2454,8 +4099,6 @@ export {
|
|
|
2454
4099
|
EntryKitProvider,
|
|
2455
4100
|
createWagmiConfig,
|
|
2456
4101
|
defineConfig,
|
|
2457
|
-
getConnectors,
|
|
2458
|
-
getWallets,
|
|
2459
4102
|
internal_validateSigner,
|
|
2460
4103
|
useAccountModal,
|
|
2461
4104
|
useEntryKitConfig,
|