PageSourceSearch

https://dynamic-lebkuchen-0238db.netlify.app/static/js/9123.afe40042.chunk.js

js dynamic-lebkuchen-0238db.netlify.app collected 2026-10-03 10:40:37 UTC 12,218 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkico_react=self.webpackChunkico_react||[]).push([[9123],{31517:(e,n,t)=>{t.d(n,{E:()=>a});const a=[{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}]},65251:(e,n,t)=>{t.d(n,{g:()=>r});var a=t(5618),i=t(51659);class o extends i.C{constructor(e){let{value:n}=e;super("Number `".concat(n,"` is not a valid decimal number."),{name:"InvalidDecimalNumberError"})}}function r(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"wei";return function(e,n){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new o({value:e});let[t,a="0"]=e.split(".");const i=t.startsWith("-");if(i&&(t=t.slice(1)),a=a.replace(/(0+)$/,""),0===n)1===Math.round(Number(".".concat(a)))&&(t="".concat(BigInt(t)+1n)),a="";else if(a.length>n){const[e,i,o]=[a.slice(0,n-1),a.slice(n-1,n),a.slice(n)],r=Math.round(Number("".concat(i,".").concat(o)));a=r>9?"".concat(BigInt(e)+BigInt(1),"0").padStart(e.length+1,"0"):"".concat(e).concat(r),a.length>n&&(a=a.slice(1),t="".concat(BigInt(t)+1n)),a=a.slice(0,n)}else a=a.padEnd(n,"0");return BigInt("".concat(i?"-":"").concat(t).concat(a))}(e,a.eL[n])}},89123:(e,n,t)=>{t.r(n),t.d(n,{AwaitingExternalEthereumTransferScreen:()=>H,default:()=>H});var a=t(24107),i=t(90034),o=t(42234),r=t(57722),d=t(75581),s=t(70822),l=t(63679),c=t(54079),u=t(46755),v=t(76416),h=t(97811),g=t(65251),f=t(2559),m=t(60229),p=t(33898),y=t(93014),b=t(51781),C=t(76107),I=t(99844),T=t(51380),w=t(1991),E=t(49931),S=t(66290),x=t(44131),A=t(31517),N=t(93970),B=t(62802),F=t(67665),j=t(99788),k=t(78055),U=t(89155),M=t(31309),D=t(12663),_=t(9505);t(88404),t(2035),t(30549),t(82425),t(82595);const H={component:()=>{var e,n,t,H,L;let{rpcConfig:P,appId:q,closePrivyModal:W,createAnalyticsEvent:Q}=(0,T.u)(),{navigate:R,setModalData:J,data:O}=(0,E.a)(),$=(0,I.u)(),{wallets:V}=(0,x.u)(),[Y,z]=(0,r.useState)(!1),[G,K]=(0,r.useState)(0n),[X,Z]=(0,r.useState)(!1),[ee,ne]=(0,r.useState)(null),[te,ae]=(0,r.useState)(null),[ie,oe]=(0,r.useState)([]),[re,de]=(0,r.useState)(0),[se,le]=(0,r.useState)(!1),[ce,ue]=(0,r.useState)(!1),[ve,he]=(0,r.useState)(!1),[ge,fe]=(0,r.useState)(!1),[me,pe]=(0,r.useState)(),[ye,be]=(0,r.useState)();if(null===O||void 0===O||!O.funding||"ethereum"!==O.funding.chainType)throw Error("Invalid funding data");let{erc20ContractInfo:Ce,chain:Ie,connectedWallet:Te}=O.funding,we=O.funding.address,Ee=O.funding.erc20Address,[Se,xe]=(0,r.useState)(O.funding.amount);(0,r.useEffect)(()=>{Ee&&!Ce&&ne(Error("Unable to fetch token details"))},[]);let Ae=!!Ee&&!!Ce,Ne=Ae?BigInt(parseFloat(Se)*10**Ce.decimals):(0,g.g)(Se),Be=null!==(e="ethereum"===(null===Te||void 0===Te?void 0:Te.type)?Te:void 0)&&void 0!==e?e:V[0],Fe=(0,w.Q)((null===Be||void 0===Be?void 0:Be.walletClientType)||"unknown"),je=(null===Fe||void 0===Fe?void 0:Fe.name)||"wallet",[ke,Ue]=(0,r.useState)(null);(0,r.useEffect)(()=>{(async()=>{if(!Be)return;let e=await Be.getEthereumProvider();Ue((0,s.F)({account:Be.address,transport:(0,c.I)(e)}).extend(l.$))})().catch(console.error)},[Be]);let[Me,De]=(0,r.useState)(0n);(0,r.useEffect)(()=>{(0,d.l)({chain:Ie,transport:(0,u.L)((0,D.a)(Ie,P,q))}).getBalance({address:we}).then(De).catch(console.error)},[]);let[_e,He]=(0,r.useState)(0n);(0,r.useEffect)(()=>{Ae&&(0,M.g)({chain:Ie,address:we,appId:q,rpcConfig:P,erc20Address:Ee}).then(e=>He(e.balance)).catch(console.error)},[]);let{tokenPrice:Le}=(0,S.u)(Ie.id),[Pe,qe]=(0,r.useState)({to:we,chain:Ie,value:Ne,data:void 0});(0,r.useEffect)(()=>{(async(e,n,t,a,i,o)=>{let r,s;if(!ke||!Be||se||ve)return;le(!0);let l=(0,d.l)({chain:Pe.chain,transport:(0,u.L)((0,D.a)(Pe.chain,P,q))});if(Ae&&!Pe.data)return await l.simulateContract({address:Ee,chain:Pe.chain,abi:A.E,functionName:"transfer",args:[we,Ne],account:Be.address}).catch(e=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",e)})?(le(!1),void qe({to:Ee,chain:Pe.chain,data:(0,v.p)({abi:A.E,functionName:"transfer",args:[we,Ne]}),value:"0x0"})):(le(!1),void Z(!0));try{var c;r=await l.prepareTransactionRequest({account:Be.address,to:Pe.to,chain:Pe.chain,data:Pe.data,value:BigInt(null!==(c=Pe.value)&&void 0!==c?c:0)})}catch(r){var g;if(console.error(r),ie.length>1)ae(null!==(g=r.shortMessage)&&void 0!==g?g:"Something went wrong");
1else if(ce&&0===ie.length)return void ne(new T.a("Wallet ".concat((0,w.D)(Be.address)," does not have enough funds."),void 0,T.b.INSUFFICIENT_BALANCE))}if(!r)return le(!1),void Z(!0);le(!1),he(!0),z(!0),K(r.gas);try{await ke.switchChain({id:Pe.chain.id})}catch(r){await ke.addChain({chain:Pe.chain}),await ke.switchChain({id:Pe.chain.id})}try{s=await ke.sendTransaction(r)}catch(r){var f;if(console.error(r),"TransactionExecutionError"===r.name)if(ie.length<1){let e=r.shortMessage;(r.shortMessage.includes("rejected the request")||r.details.includes("rejected the request"))&&(e="User rejected the request."),ne(new T.a(e,void 0,T.b.TRANSACTION_FAILURE))}else ae(null!==(f=r.shortMessage)&&void 0!==f?f:"Something went wrong")}if(s)return await ke.waitForTransactionReceipt({hash:s}),he(!1),ce?(pe(s),void be("pending")):(fe(!0),J((0,k.A)(O,"completed",s,null===Be||void 0===Be?void 0:Be.walletClientType,Ae,Ce,Ie)),void Q({eventName:F.O,payload:{provider:"external",status:"success",txHash:s,address:Be.address,chainId:Pe.chain.id,chainType:"ethereum",value:Pe.value?(0,h.J)(BigInt(Pe.value),null!==(e=null===Ce||void 0===Ce?void 0:Ce.decimals)&&void 0!==e?e:18):void 0,token:null!==(n=null!==(t=null===Ce||void 0===Ce?void 0:Ce.symbol)&&void 0!==t?t:Ee)&&void 0!==n?n:"ETH",destinationAddress:we,destinationChainId:Ie.id,destinationChainType:"ethereum",destinationValue:Ne?(0,h.J)(Ne,null!==(a=null===Ce||void 0===Ce?void 0:Ce.decimals)&&void 0!==a?a:18):void 0,destinationToken:null!==(i=null!==(o=null===Ce||void 0===Ce?void 0:Ce.symbol)&&void 0!==o?o:Ee)&&void 0!==i?i:Ie.nativeCurrency.name}}));he(!1)})().catch(console.error)},[ke,Pe]),(0,r.useEffect)(()=>{(async e=>{if(!X||!ke||!Be)return;let n=(0,f.u)($.chains).filter(e=>e.id!==Ie.id&&!!e.testnet==!!Ie.testnet);Ae&&n.unshift(Ie);let t=await(0,U.g)({chains:n,address:Be.address,appId:q,rpcConfig:P,includeUsdc:null===(e=O.funding)||void 0===e?void 0:e.isUSDC}),i=Ae?t.filter(e=>e.balance>0n):t.filter(e=>e.balance>Ne),o=Ae&&t.every(e=>0n===e.balance);if(i.length<1)return void ne(new T.a("Wallet ".concat((0,w.D)(Be.address),o?" doesn't have enough funds to cover gas fees. Top up your wallet and try again.":" does not have enough funds."),void 0,T.b.INSUFFICIENT_BALANCE));i.sort((e,n)=>{var t,a;return Number(Ae?(null!==(t=n.erc20Balance)&&void 0!==t?t:0n)-(null!==(a=e.erc20Balance)&&void 0!==a?a:0n):n.balance-e.balance)});let r=i.flatMap(e=>{var n;let t=[(0,a.A)((0,a.A)({},e),{},{isErc20Quote:!1,isTestnet:!!Ie.testnet,input:(0,j.t)({appId:q,amount:Ne.toString(),user:Be.address,recipient:we,destinationChainId:Ie.id,destinationCurrency:Ee,originChainId:e.chain.id})})];return Ae&&Ee&&(null!==(n=e.erc20Balance)&&void 0!==n?n:0n)>=Ne&&t.push((0,a.A)((0,a.A)({},e),{},{isErc20Quote:!0,isTestnet:!!Ie.testnet,input:(0,j.t)({appId:q,amount:Ne.toString(),user:Be.address,recipient:we,destinationChainId:Ie.id,destinationCurrency:Ee,originChainId:e.chain.id,originCurrency:e.erc20Address})})),t}),d=(await Promise.allSettled(r.map(async e=>(0,a.A)((0,a.A)({},e),{},{quote:await(0,j.g)(e)})))).filter(e=>"fulfilled"===e.status).map(e=>e.value);if(d.length<1)return void ne(new T.a("Wallet ".concat((0,w.D)(Be.address)," does not have enough funds."),void 0,T.b.INSUFFICIENT_BALANCE));let s=d.map(e=>({bridgeTx:(0,j.c)(e.quote),balance:e.balance,chain:e.chain,erc20Balance:e.erc20Balance,isErc20Quote:e.isErc20Quote})).filter(e=>!!e.bridgeTx);if(s.length>1)return void oe(s);let l=s[0];l?(ue(!0),qe({data:l.bridgeTx.data,to:l.bridgeTx.to,value:l.bridgeTx.value,chain:l.chain})):ne(new T.a("Wallet ".concat((0,w.D)(Be.address)," does not have enough funds."),void 0,T.b.INSUFFICIENT_BALANCE))})().catch(console.error)},[X]),(0,j.u)({transactionHash:me,isTestnet:!!Ie.testnet,bridgingStatus:ye,setBridgingStatus:be,onSuccess(e){var n,t,a,i,o,r;let{transactionHash:d}=e;ue(!1),fe(!0),J((0,k.A)(O,"completed",d,null===Be||void 0===Be?void 0:Be.walletClientType,Ae,Ce,Ie)),Q({eventName:F.O,payload:{provider:"external",status:"success",txHash:d,address:null===Be||void 0===Be?void 0:Be.address,chainId:Pe.chain.id,chainType:"ethereum",value:Pe.value?(0,h.J)(BigInt(Pe.value),null!==(n=null===Ce||void 0===Ce?void 0:Ce.decimals)&&void 0!==n?n:18):void 0,token:null!==(t=null!==(a=null===Ce||void 0===Ce?void 0:Ce.symbol)&&void 0!==a?a:Ee)&&void 0!==t?t:"ETH",destinationAddress:we,destinationChainId:Ie.id,destinationChainType:"ethereum",destinationValue:Ne?(0,h.J)(Ne,null!==(i=null===Ce||void 0===Ce?void 0:Ce.decimals)&&void 0!==i?i:18):void 0,destinationToken:null!==(o=null!==(r=null===Ce||void 0===Ce?void 0:Ce.symbol)&&void 0!==r?r:Ee)&&void 0!==o?o:Ie.nativeCurrency.name}})},onFailure(e){let{error:n}=e;ue(!1),ne(n)}}),(0,r.useEffect)(()=>{ee&&(J({funding:null===O||void 0===O?void 0:O.funding,solanaFundingData:null===O||void 0===O?void 0:O.solanaFundingData,sendTransaction:null===O||void 0===O?void 0:O.sendTransaction,errorMod
1alData:{error:ee,previousScreen:"TransferFromWalletScreen"}}),R("ErrorScreen",!1))},[ee]);let We=!Ae&&Le?(0,B.c)(null!==Se&&void 0!==Se?Se:"0",Le):void 0,Qe=Ae?G:(0,B.s)([G,Ne]),Re=Qe&&Le?(0,B.a)(Qe,Le):void 0,Je=Qe?(0,B.g)(Qe,null!==O&&void 0!==O&&null!==(n=O.funding)&&void 0!==n&&n.erc20Address?(null===O||void 0===O||null===(t=O.funding)||void 0===t||null===(t=t.erc20ContractInfo)||void 0===t?void 0:t.symbol)||"ETH":(null===O||void 0===O||null===(H=O.funding)||void 0===H?void 0:H.chain.nativeCurrency.symbol)||"ETH"):void 0,Oe=G&&Le?(0,B.a)(G,Le):void 0,$e=G?(0,B.g)(G,(null===Ie||void 0===Ie||null===(L=Ie.nativeCurrency)||void 0===L?void 0:L.symbol)||"ETH"):void 0;if((0,r.useEffect)(()=>{if(!ge)return;let e=setTimeout(W,I.t);return()=>clearTimeout(e)},[ge]),ge)return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(b.t,{}),(0,i.jsx)(m.b,{}),(0,i.jsxs)(m.c,{children:[(0,i.jsx)(o.A,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,i.jsx)(y.C,{title:"Success!",description:"You\u2019ve successfully added ".concat(Se," ").concat(Ae?Ce.symbol:Ie.nativeCurrency.symbol," to your ").concat($.name," wallet. It may take a minute before the funds are available to use.")})]}),(0,i.jsx)(m.R,{}),(0,i.jsx)(p.B,{})]});let Ve=Ae?"".concat((0,N.f)({amount:_e,decimals:Ce.decimals}),"  ").concat(Ce.symbol):(0,B.g)(Me,Ie.nativeCurrency.symbol,3,!0),Ye=ie[re];return ie.length>1&&Ye?(0,i.jsx)(U.B,{displayName:je,configuredFundingChain:Ie,erc20ContractInfo:Ce,formattedBalance:Ve,fundingAmount:Se,fundingCurrency:Ae?Ce.symbol:Ie.nativeCurrency.symbol,fundingAmountInUsd:We,options:ie,selectedOption:Ye,isPreparing:se,isSubmitting:ve,addressToFund:we,fundingWalletAddress:(null===Be||void 0===Be?void 0:Be.address)||"",errorMessage:te,onSubmit:()=>{var e;(null===(e=O.funding)||void 0===e?void 0:e.amount)!==Se?async function(){if(Be&&Ye)try{let e=await(0,j.g)({isTestnet:!!Ie.testnet,input:(0,j.t)({appId:q,amount:Ne.toString(),user:Be.address,recipient:we,destinationChainId:Ie.id,destinationCurrency:Ee,originChainId:Ye.chain.id})}),n=(0,j.c)(e);if(!n)throw Error("Invalid transaction request");ue(!0),qe({data:n.data,to:n.to,value:n.value,chain:Ye.chain})}catch(e){console.error(e),ne(new T.a("Unable to fetch quotes for bridging",e,T.b.INSUFFICIENT_BALANCE))}}().catch(console.error):qe({to:Ye.bridgeTx.to,data:Ye.bridgeTx.data,value:Ye.bridgeTx.value,chain:Ye.chain})},onSelect:e=>{e!==re&&(ae(null),de(e))},onAmountChange:xe}):Y&&G&&Be&&null!==O&&void 0!==O&&O.funding?(0,i.jsx)(_.T,{walletClientType:(null===Be||void 0===Be?void 0:Be.walletClientType)||"unknown",displayName:je,addressToFund:we,isBridging:ce,isErc20Flow:Ae,totalPriceInUsd:Re,totalPriceInNativeCurrency:Je,gasPriceInUsd:Oe,gasPriceInNativeCurrency:$e,chainId:Ie.id,chainName:Ie.name}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(b.t,{}),(0,i.jsx)(C.N,{}),(0,i.jsx)("div",{style:{marginTop:"1rem"}}),(0,i.jsx)(p.B,{})]})}}}}]);
2//# sourceMappingURL=9123.afe40042.chunk.js.map

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.