PageSourceSearch

https://smtm.ai/_next/static/chunks/2629.86f80412e84f32ca.js

js smtm.ai collected 2026-10-05 15:07:54 UTC 5,948 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2629],{62629:function(e,n,t){t.r(n),t.d(n,{AwaitingSolToEvmBridgingScreen:function(){return T},default:function(){return T}});var a=t(27573),r=t(35864),s=t(7653),i=t(75863),o=t(90937),d=t(47179),l=t(75593),c=t(71844),u=t(82888),f=t(29981),g=t(31796),h=t(88089),m=t(50800),p=t(36170),v=t(66664),w=t(60220),S=t(63002),b=t(31793),I=t(73599);t(69021),t(26996),t(97347);let T={component:function(){let e=(0,g.u)(),{closePrivyModal:n,createAnalyticsEvent:t,connectors:T}=(0,h.u)(),{navigate:C,setModalData:N,data:y}=(0,p.a)(),E=(0,g.u)(),x=(0,s.useRef)(!1),A=(0,S.c)(),[F,$]=(0,s.useState)(!1),[U,j]=(0,s.useState)(!1),[B,R]=(0,s.useState)(null),[k,W]=(0,s.useState)(),[_,D]=(0,s.useState)();if(!y?.funding||"ethereum"!==y.funding.chainType)throw Error("Invalid funding data");let{amount:L,connectedWallet:M,chain:O,solanaChain:P,isUSDC:q}=y.funding,H=y.funding.address,Q=y.funding.erc20Address,z=y.funding.isUSDC?"USDC":O.nativeCurrency.symbol,G=(0,s.useMemo)(()=>"solana"===M?.type?M.provider:function({connectors:e,connectedWalletAddress:n}){let t=e.find(e=>"solana"===e.chainType&&e.wallets.some(e=>e.address===n)),a=t?.wallet.accounts.find(e=>e.address===n);if(!t||!a)throw new h.a("Unable to find source wallet connector");return new o.O({wallet:t.wallet,account:a})}({connectors:T,connectedWalletAddress:M?.address||""}),[M,T]),V=(0,s.useMemo)(()=>{let n=A(S.S);if(!n)throw new h.a("Unable to load solana plugin");let t=e.solanaRpcs["solana:mainnet"];if(!t)throw new h.a("Unable to load mainnet RPC");return n.getSolanaRpcClient({rpc:t.rpc,rpcSubscriptions:t.rpcSubscriptions,chain:"solana:mainnet",blockExplorerUrl:t.blockExplorerUrl??"https://explorer.solana.com"})},[]),Y=(0,m.Q)((0,I.t)(G?.standardWallet.name||"unknown")),Z=Y?.name||"wallet";return(0,s.useEffect)(()=>{(async function(){if(!G||!O||x.current)return;let e=A(S.S);if(!e)return void R(new h.a("Unable to solana plugin"));x.current=!0,O?.testnet&&console.warn("Solana testnets are not supported for bridging");let n=q?1e6*parseFloat(L):(0,i.f)(L),t=await (0,w.g)({isTestnet:!!O.testnet,input:(0,w.t)({appId:E.id,amount:n.toString(),user:G.address,recipient:H,destinationChainId:O.id,originChainId:w.b,originCurrency:q?w.d:w.a,destinationCurrency:q?Q:void 0})}).catch(console.error);if(!t)return void R(new h.a(`Unable to fetch quotes for bridging. Wallet ${(0,m.a6)(G.address)} does not have enough funds.`,void 0,h.b.INSUFFICIENT_BALANCE));let a=await e.createTransactionFromRelayQuote({quote:t,source:G.address,solanaClient:V});if(a)try{$(!0);let n=await e.simulateTransaction({solanaClient:V,tx:a});if(n.hasError)return n.hasFunds?(console.error("Transaction failed:",n.error),void R(new h.a("Something went wrong",void 0,h.b.TRANSACTION_FAILURE))):void R(new h.a(`Wallet ${(0,m.a6)(G?.address)} does not have enough funds. ${t.details.currencyIn.amountFormatted} ${z} are needed to complete the transaction.`,void 0,h.b.INSUFFICIENT_BALANCE));let{signature:r}=await G.signAndSendTransaction({chain:"solana:mainnet",transaction:a}),s=e.getAddressFromBuffer(r);W(s),D("pending")}catch(e){if(console.error(e),/user rejected the request/gi.test(e.message||""))return void R(new h.a("Transaction was rejected by the user",void 0,h.b.TRANSACTION_FAILURE));R(new h.a("Something went wrong",void 0,h.b.TRANSACTION_FAILURE))}else R(new h.a(`Unable to select bridge option from quotes. Wallet ${(0,m.a6)(G.address)} does not have enough funds.`,void 0,h.b.INSUFFICIENT_BALANCE))})().catch(console.error)},[]),(0,w.u)({transactionHash:k,isTestnet:!1,bridgingStatus:_,setBridgingStatus:D,onSuccess({transactionHash:e}){$(!1),j(!0),t({eventName:v.O,payload:{provider:"external",status:"success",txHash:e,address:G.address,chainType:"solana",clusterName:P,token:"SOL",destinationAddress:H,destinationChainId:O.id,destinationChainType:"ethereum",destinationValue:L,destinationToken:q?"USDC":"ETH"}})},onFailure({error:e}){$(!1),R(e)}}),(0,s.useEffect)(()=>{if(!U)return;let e=setTimeout(n,g.t);return()=>clearTimeout(e)},[U]),(0,s.useEffect)(()=>{B&&(N({funding:y?.funding,solanaFundingData:y?.solanaFundingData,sendTransaction:y?.sendTransaction,errorMod
1alData:{error:B,previousScreen:"TransferFromWalletScreen"}}),C("ErrorScreen",!1))},[B]),U?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.t,{}),(0,a.jsx)(d.b,{}),(0,a.jsxs)(d.c,{children:[(0,a.jsx)(r.Z,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,a.jsx)(c.C,{title:"Success!",description:`You’ve successfully added ${L} ${z} to your ${E.name} wallet. It may take a minute before the funds are available to use.`})]}),(0,a.jsx)(d.R,{}),(0,a.jsx)(l.B,{})]}):F&&G?(0,a.jsx)(b.T,{walletClientType:(0,I.t)(G?.standardWallet.name||"unknown"),displayName:Z,addressToFund:H,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)(f.N,{}),(0,a.jsx)("div",{style:{marginTop:"1rem"}}),(0,a.jsx)(l.B,{})]})}}},75863:function(e,n,t){t.d(n,{f:function(){return s}});var a=t(7734),r=t(89369);function s(e,n="wei"){return(0,r.v)(e,a.ez[n])}},89369:function(e,n,t){t.d(n,{v:function(){return s}});var a=t(18635);class r extends a.G{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function s(e,n){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new r({value:e});let[t,a="0"]=e.split("."),s=t.startsWith("-");if(s&&(t=t.slice(1)),a=a.replace(/(0+)$/,""),0===n)1===Math.round(Number(`.${a}`))&&(t=`${BigInt(t)+1n}`),a="";else if(a.length>n){let[e,r,s]=[a.slice(0,n-1),a.slice(n-1,n),a.slice(n)],i=Math.round(Number(`${r}.${s}`));(a=i>9?`${BigInt(e)+BigInt(1)}0`.padStart(e.length+1,"0"):`${e}${i}`).length>n&&(a=a.slice(1),t=`${BigInt(t)+1n}`),a=a.slice(0,n)}else a=a.padEnd(n,"0");return BigInt(`${s?"-":""}${t}${a}`)}}}]);

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.