1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9117],{76242:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/transfer",function(){return n(49266)}])},49266:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return u}});var r=n(85893),s=n(67294),c=n(59917),o=n(44718),a=n(54306),l=n(35615);function u(){let[e,t]=(0,s.useState)(0),[n,u]=(0,s.useState)(""),{connection:i}=(0,o.R)(),{publicKey:x,sendTransaction:d}=(0,a.O)(),f=(0,s.useCallback)(()=>{i&&i.getBalance(x).then(e=>{t(e/c.LAMPORTS_PER_SOL)})},[i,x,t]);(0,s.useEffect)(()=>{f&&f()},[f]);let[p,h]=(0,s.useState)(""),[m,S]=(0,s.useState)(!1),[E,b]=(0,s.useState)(""),[j,N]=(0,s.useState)(0);async function g(){try{if(!x)throw new l.oS;if(!p){b("Please enter an address"),S(!1);return}S(!0);let e=new c.PublicKey(p);i.getAccountInfo(e).then(e=>{e&&u(e.lamports?(e.lamports/c.LAMPORTS_PER_SOL).toString():"")});let t=new c.Transaction().add(c.SystemProgram.transfer({fromPubkey:x,toPubkey:e,lamports:j})),n=await d(t,i);await i.confirmTransaction(n,"processed"),console.log("\uD83D\uDCB8 Finished! Sent ".concat(j," to the address ").concat(e,". ")),console.log("Transaction signature is ".concat(n,"!")),f(),S(!1),i.getAccountInfo(e).then(e=>{e&&u(e.lamports?(e.lamports/c.LAMPORTS_PER_SOL).toString():"")})}catch(e){b("Invalid wallet address"),S(!1),console.error("Error fetching balance:",e)}}return(0,r.jsx)("main",{className:"flex items-center justify-center ",children:(0,r.jsxs)("div",{className:" flex justify-center items-center flex-col h-[100vh] ",children:[(0,r.jsx)("h1",{className:"text-[54px] font-bold",children:"Transfer SOL"}),(0,r.jsxs)("div",{className:"text-white text-[20px] font-semibold mt-[20px]",children:["From balance: ",e,":SOL"]}),(0,r.jsxs)("div",{className:"text-white text-[20px] font-semibold my-[20px]",children:["To balance: ",n,":SOL"]}),(0,r.jsxs)("div",{className:"flex flex-col px-[10px]",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("h1",{className:"text-[20px] font-bold",children:["Amount"," ",(0,r.jsx)("span",{className:"text-[12px] text-white/50",children:"(1SOL=1000000000)"})]}),(0,r.jsx)("input",{type:"number",className:" border border-[#111111] px-[12px] my-[20px] w-[440px] h-[50px] rounded-[10px] ",value:j,onChange:e=>{N(parseFloat(e.target.value)),b("")}}),E&&(0,r.jsx)("p",{style:{color:"red"},children:E})]}),(0,r.jsxs)("h1",{className:"text-[20px] font-bold",children:["To"," ",(0,r.jsx)("span",{className:"text-[12px] text-white/50",children:"(address)"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("input",{type:"text",className:" border border-[#111111] px-[12px] my-[20px] w-[440px] h-[50px] rounded-[10px] ",value:p,onChange:e=>{h(e.target.value),b("")}}),E&&(0,r.jsx)("p",{style:{color:"red"},children:E})]}),(0,r.jsx)("div",{className:"flex flex-col gap-8",children:(0,r.jsxs)("button",{onClick:g,className:" bg-[#111111] cursor-pointer text-[#ffff] px-[20px] py-[15px] rounded-[10px] hover:opacity-[0.85] w-full h-[50px] text-[14px]",children:[" ",m?(0,r.jsx)("div",{className:" inset-0 flex items-center justify-center text-[#ffffff]",children:"Loading..."}):"Transfer SOL"]})})]})]})})}},46601:function(){},35615:function(e,t,n){"use strict";n.d(t,{$w:function(){return a},IW:function(){return f},Nx:function(){return x},OZ:function(){return s},PY:function(){return p},UG:function(){return u},W8:function(){return c},at:function(){return l},bD:function(){return m},cO:function(){return i},fk:function(){return h},lj:function(){return r},oS:function(){return d},p6:function(){return o}});class r extends Error{constructor(e,t){super(e),this.error=t}}class s extends r{constructor(){super(...arguments),this.name="WalletNotReadyError"}}class c extends r{constructor(){super(...arguments),this.name="WalletLoadError"}}class o extends r{constructor(){super(...arguments),this.name="WalletConfigError"}}class a extends r{constructor(){super(...arguments),this.name="WalletConnectionError"}}class l extends r{constructor(){super(...arguments),this.name="WalletDisconnectedError"}}class u extends r{constructor(){super(...arguments),this.name="WalletDisconnectionError"}}class i extends r{constructor(){super(...arguments),this.name="WalletAccountError"}}class x extends r{constructor(){super(...arguments),this.name="WalletPublicKeyError"}}class d extends r{constructor(){super(...arguments),this.name="WalletNotConnectedError"}}class f extends r{constructor(){super(...arguments),this.name="WalletSendTransactionError"}}class p extends r{constructor(){super(...arguments),this.name="WalletSignTransactionError"}}class h extends r{constructor(){super(...arguments),this.name="WalletSignMessageError"}}class m extends r{constructor(){super(...arguments),this.name="WalletSignInError"}}},44718:function(e,t,n){"use strict";n.d(t,{R:function(){return c},h:function(){return s}});var r=n(67294);let s=(0,r.createContext)({});function c(){return(0,r.useContext)(s)}}},function(e){e.O(0,[8766,2260,2918,9774,2888,179],function(){return e(e.s=76242)}),_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.