1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4027],{91329:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/reverse",function(){return n(48901)}])},88605:function(e,t,n){"use strict";n.a(e,async function(e,s){try{var a=n(85893),r=n(67294),c=n(77330),l=n(23411),i=n(55143),o=e([c]);c=(o.then?(await o)():o)[0];let d=()=>{let[e,t]=(0,r.useState)({btcAmount:null,wbtcAmount:null}),n=(e,t)=>{"WBTC"===e&&s(t)},s=e=>{let n={wbtcAmount:e,btcAmount:null};if(Number(e)>0){let t=.997*Number(e);n.btcAmount=t.toFixed(8).toString()}t(n)};return(0,a.jsxs)("div",{className:"swap-component text-white border border-white rounded-lg p-4",children:[(0,a.jsx)(u,{}),(0,a.jsx)("hr",{className:"border-white my-4"}),(0,a.jsx)(h,{amount:e,changeAmount:n}),(0,a.jsx)("hr",{className:"border-white my-4"}),(0,a.jsx)(p,{amount:e,changeAmount:n})]})},u=()=>{let{connectMetaMask:e,metaMaskIsConnected:t}=(0,c.g5)(),{switchChain:n}=(0,i.o)(),s=async()=>{await n({chainId:11155111}),e()};return(0,a.jsxs)("div",{className:"swap-component-top-section",children:[(0,a.jsx)("span",{className:"swap-title text-white",children:"Swap"}),(0,a.jsx)(m,{isConnected:t,onClick:s})]})},m=e=>{let{isConnected:t,onClick:n}=e;return(0,a.jsx)("button",{className:"ml-2 mr-2 mb-2 bg-[#00a3ff] text-white connect-metamask button-".concat("transparent p-2"),onClick:n,children:t?"Connected":"Connect to MetaMask"})},h=e=>{let{amount:t,changeAmount:n}=e,{wbtcAmount:s,btcAmount:r}=t;return(0,a.jsxs)("div",{className:"swap-component-middle-section",children:[(0,a.jsx)(x,{id:"wbtc",label:"Send WBTC",value:s,onChange:e=>n("WBTC",e)}),(0,a.jsx)(x,{id:"btc",label:"Receive BTC",value:r,readOnly:!0})]})},x=e=>{let{id:t,label:n,value:s,readOnly:r,onChange:c}=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:t,className:"text-white",children:n}),(0,a.jsxs)("div",{className:"input-component",children:[(0,a.jsx)("input",{id:t,placeholder:"0",value:s||"",type:"number",readOnly:r,onChange:e=>c&&c(e.target.value),className:"text-white bg-transparent border rounded"}),(0,a.jsx)("button",{className:"text-white",children:t.toUpperCase()})]})]})},p=e=>{let{amount:t,changeAmount:n}=e,{garden:s,bitcoin:i,ethereum:o}=(0,c.vS)(),[d,u]=(0,r.useState)(),[m,h]=(0,r.useState)(),{metaMaskIsConnected:x}=(0,c.g5)(),{wbtcAmount:p,btcAmount:b}=t,{isSigned:f}=(0,c.Ys)();(0,r.useEffect)(()=>{if(!i)return;let e=async()=>{if(f){let e=await i.getAddress();u(e)}};e()},[i,f]),(0,r.useEffect)(()=>{if(!o)return;let e=async()=>{if(f){let e=await o.getAddress();h(e)}};e()},[o,f]);let w=async()=>{if(!s||"number"!=typeof Number(p)||"number"!=typeof Number(b))return;let e=1e8*Number(p),t=1e8*Number(b);n("WBTC",""),await s.swap(l.de.ethereum_sepolia.WBTC,l.de.bitcoin_testnet.BTC,e,t)};return(0,a.jsxs)("div",{className:"swap-component-bottom-section",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"receive-address",className:"text-white",children:"Sender ETH Address"}),(0,a.jsx)("div",{className:"input-component",children:(0,a.jsx)("input",{id:"receive-address",placeholder:"Enter ETH Address",value:m||"",onChange:e=>h(e.target.value),className:"text-white bg-transparent border rounded"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"receive-address",className:"text-white",children:"Recipient BTC Address"}),(0,a.jsx)("div",{className:"input-component",children:(0,a.jsx)("input",{id:"receive-address",placeholder:"Enter BTC Address",value:d||"",onChange:e=>u(e.target.value),className:"text-white bg-transparent border rounded"})})]}),(0,a.jsx)("button",{className:"bg-[#00a3ff] hover:bg-[#0082cc] text-white font-bold py-2 px-4 rounded focus:outline-none focus:ring-2 focus:ring-[#00a3ff] focus:ring-opacity-50 ".concat(x?"opacity-100":"opacity-50 cursor-not-allowed"),onClick:w,disabled:!x,children:"Swap"})]})};t.Z=d,s()}catch(e){s(e)}})},63261:function(e,t,n){"use strict";n.a(e,async function(e,s){try{var a=n(85893);n(67294);var r=n(149),c=n(8424),l=n(77330),i=n(88605),o=e([r,c,l,i]);[r,c,l,i]=o.then?(await o)():o;let d=()=>((0,l._M)(),(0,a.jsxs)("div",{className:"flex min-h-full flex-1 flex-col justify-center items-center py-12 lg:px-8",children:[(0,a.jsxs)("div",{className:"lg:w-full sm:mx-auto sm:w-full sm:max-w-sm p-4 rounded-lg",children:[(0,a.jsx)("h2",{className:"mt-4 text-center text-2xl font-bold leading-tight tracking-tight text-white",children:"Swap your wBTC to BTC via Ethereum Sepolia"}),(0,a.jsx)("hr",{className:"my-4 border-gray-600"}),(0,a.jsx)("h2",{className:"text-center text-md leading-snug tracking-normal text-gray-300",children:"Account Balances"})]}),(0,a.jsx)(c.Z,{}),(0,a.jsxs)("div",{id:"container",children:[(0,a.jsx)(i.Z,{}),(0,a.jsx)(r.Z,{})]})]}));t.Z=d,s()}catch(e){s(e)}})},88606:function(e,t,n){"use strict";n.a(e,async function(e,s){try{n.d(t,{l:function(){return a.Z}});var a=n(63261),r=e([a]);a=(r.then?(await r)():r)[0],s()}catch(e){s(e)}})},48901:function(e,t,n){"use strict";n.a(e,async function(e,s){try{n.r(t);var a=n(85893);n(67294);var r=n(22307),c=n(88606),l=e([c]);c=(l.then?(await l)():l)[0];let i=()=>(0,a.jsxs)("div",{class:"template-color-1 nft-body-connect",children:[(0,a.jsx)(r.h4,{}),(0,a.jsx)(c.l,{}),(0,a.jsx)(r.$_,{}),(0,a.jsx)(r.wZ,{})]});t.default=i,s()}catch(e){s(e)}})}},function(e){e.O(0,[4976,4867,1664,6629,1416,4328,2307,5141,9774,2888,179],function(){return e(e.s=91329)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.