PageSourceSearch

https://dynamic-lebkuchen-0238db.netlify.app/static/js/6781.e317989c.chunk.js

js dynamic-lebkuchen-0238db.netlify.app collected 2026-10-03 10:40:41 UTC 6,473 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkico_react=self.webpackChunkico_react||[]).push([[6781],{6781:(e,n,t)=>{t.r(n),t.d(n,{AwaitingSolToEvmBridgingScreen:()=>C,default:()=>C});var a=t(90034),o=t(42234),i=t(57722),r=t(65251),s=t(43537),l=t(60229),c=t(33898),d=t(93014),u=t(51781),v=t(76107),g=t(99844),h=t(51380),f=t(1991),m=t(49931),p=t(67665),w=t(99788),S=t(66252),b=t(9505),I=t(49080);t(88404),t(2035),t(30549);const C={component:function(){let e=(0,g.u)(),{closePrivyModal:n,createAnalyticsEvent:t,connectors:C}=(0,h.u)(),{navigate:T,setModalData:y,data:N}=(0,m.a)(),A=(0,g.u)(),x=(0,i.useRef)(!1),E=(0,S.a)(),[F,U]=(0,i.useState)(!1),[j,B]=(0,i.useState)(!1),[R,k]=(0,i.useState)(null),[W,D]=(0,i.useState)(),[L,_]=(0,i.useState)();if(null===N||void 0===N||!N.funding||"ethereum"!==N.funding.chainType)throw Error("Invalid funding data");let{amount:M,connectedWallet:P,chain:O,solanaChain:q,isUSDC:H}=N.funding,Q=N.funding.address,$=N.funding.erc20Address,V=N.funding.isUSDC?"USDC":O.nativeCurrency.symbol,Y=(0,i.useMemo)(()=>"solana"===(null===P||void 0===P?void 0:P.type)?P.provider:function(e){let{connectors:n,connectedWalletAddress:t}=e,a=n.find(e=>"solana"===e.chainType&&e.wallets.some(e=>e.address===t)),o=null===a||void 0===a?void 0:a.wallet.accounts.find(e=>e.address===t);if(!a||!o)throw new h.a("Unable to find source wallet connector");return new s.W({wallet:a.wallet,account:o})}({connectors:C,connectedWalletAddress:(null===P||void 0===P?void 0:P.address)||""}),[P,C]),z=(0,i.useMemo)(()=>{var n;let t=E(S.S);if(!t)throw new h.a("Unable to load solana plugin");let a=e.solanaRpcs["solana:mainnet"];if(!a)throw new h.a("Unable to load mainnet RPC");return t.getSolanaRpcClient({rpc:a.rpc,rpcSubscriptions:a.rpcSubscriptions,chain:"solana:mainnet",blockExplorerUrl:null!==(n=a.blockExplorerUrl)&&void 0!==n?n:"https://explorer.solana.com"})},[]),G=(0,f.Q)((0,I.t)((null===Y||void 0===Y?void 0:Y.standardWallet.name)||"unknown")),J=(null===G||void 0===G?void 0:G.name)||"wallet";return(0,i.useEffect)(()=>{(async function(){if(!Y||!O||x.current)return;let e=E(S.S);if(!e)return void k(new h.a("Unable to solana plugin"));x.current=!0,(null===O||void 0===O?void 0:O.testnet)&&console.warn("Solana testnets are not supported for bridging");let n=H?1e6*parseFloat(M):(0,r.g)(M),t=await(0,w.g)({isTestnet:!!O.testnet,input:(0,w.t)({appId:A.id,amount:n.toString(),user:Y.address,recipient:Q,destinationChainId:O.id,originChainId:w.b,originCurrency:H?w.d:w.a,destinationCurrency:H?$:void 0})}).catch(console.error);if(!t)return void k(new h.a("Unable to fetch quotes for bridging. Wallet ".concat((0,f.a6)(Y.address)," does not have enough funds."),void 0,h.b.INSUFFICIENT_BALANCE));let a=await e.createTransactionFromRelayQuote({quote:t,source:Y.address,solanaClient:z});if(a)try{U(!0);let n=await e.simulateTransaction({solanaClient:z,tx:a});if(n.hasError)return n.hasFunds?(console.error("Transaction failed:",n.error),void k(new h.a("Something went wrong",void 0,h.b.TRANSACTION_FAILURE))):void k(new h.a("Wallet ".concat((0,f.a6)(null===Y||void 0===Y?void 0:Y.address)," does not have enough funds. ").concat(t.details.currencyIn.amountFormatted," ").concat(V," are needed to complete the transaction."),void 0,h.b.INSUFFICIENT_BALANCE));let{signature:o}=await Y.signAndSendTransaction({chain:"solana:mainnet",transaction:a}),i=e.getAddressFromBuffer(o);D(i),_("pending")}catch(e){if(console.error(e),/user rejected the request/gi.test(e.message||""))return void k(new h.a("Transaction was rejected by the user",void 0,h.b.TRANSACTION_FAILURE));k(new h.a("Something went wrong",void 0,h.b.TRANSACTION_FAILURE))}else k(new h.a("Unable to select bridge option from quotes. Wallet ".concat((0,f.a6)(Y.address)," does not have enough funds."),void 0,h.b.INSUFFICIENT_BALANCE))})().catch(console.error)},[]),(0,w.u)({transactionHash:W,isTestnet:!1,bridgingStatus:L,setBridgingStatus:_,onSuccess(e){let{transactionHash:n}=e;U(!1),B(!0),t({eventName:p.O,payload:{provider:"external",status:"success",txHash:n,address:Y.address,chainType:"solana",clusterName:q,token:"SOL",destinationAddress:Q,destinationChainId:O.id,destinationChainType:"ethereum",destinationValue:M,destinationToken:H?"USDC":"ETH"}})},onFailure(e){let{error:n}=e;U(!1),k(n)}}),(0,i.useEffect)(()=>
1{if(!j)return;let e=setTimeout(n,g.t);return()=>clearTimeout(e)},[j]),(0,i.useEffect)(()=>{R&&(y({funding:null===N||void 0===N?void 0:N.funding,solanaFundingData:null===N||void 0===N?void 0:N.solanaFundingData,sendTransaction:null===N||void 0===N?void 0:N.sendTransaction,errorModalData:{error:R,previousScreen:"TransferFromWalletScreen"}}),T("ErrorScreen",!1))},[R]),j?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.t,{}),(0,a.jsx)(l.b,{}),(0,a.jsxs)(l.c,{children:[(0,a.jsx)(o.A,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,a.jsx)(d.C,{title:"Success!",description:"You\u2019ve successfully added ".concat(M," ").concat(V," to your ").concat(A.name," wallet. It may take a minute before the funds are available to use.")})]}),(0,a.jsx)(l.R,{}),(0,a.jsx)(c.B,{})]}):F&&Y?(0,a.jsx)(b.T,{walletClientType:(0,I.t)((null===Y||void 0===Y?void 0:Y.standardWallet.name)||"unknown"),displayName:J,addressToFund:Q,isBridging:F,isErc20Flow:!1,chainId:O.id,chainName:O.name,totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.t,{}),(0,a.jsx)(v.N,{}),(0,a.jsx)("div",{style:{marginTop:"1rem"}}),(0,a.jsx)(c.B,{})]})}}},65251:(e,n,t)=>{t.d(n,{g:()=>r});var a=t(5618),o=t(51659);class i extends o.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 i({value:e});let[t,a="0"]=e.split(".");const o=t.startsWith("-");if(o&&(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,o,i]=[a.slice(0,n-1),a.slice(n-1,n),a.slice(n)],r=Math.round(Number("".concat(o,".").concat(i)));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(o?"-":"").concat(t).concat(a))}(e,a.eL[n])}}}]);
2//# sourceMappingURL=6781.e317989c.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.