import{P as e,A as t,a}from"./p-DsIfsp4b.js";export{b as W3mPayLoadingView,c as W3mPayQuoteView,W as W3mPayView}from"./p-DsIfsp4b.js";import"./p-BxEPsDRj.js";import"./p-BId5WtRC.js";import"buffer";import"events";import"ox";import"viem";import"viem/chains";import"./p-CrMmJdZ6.js";import"./p-zNe_7rLp.js";import"./p-CG_zIdXa.js";import"./p-WZF-tHaR.js";import"./p-DntCYpai.js";import"./p-CbOrugAV.js";import"./p-QEmqEl1n.js";import"./p-4_J16YIF.js";import"./p-DJATscC5.js";import"./p-CUUFsMGb.js";import"./p-08zq6pz3.js";import"./p-wMYIvr92.js";const s=3e5;async function n(t){return e.handleOpenPay(t)}async function o(o,r=s){if(r<=0){throw new t(a.INVALID_PAYMENT_CONFIG,"Timeout must be greater than 0")}try{await n(o)}catch(e){if(e instanceof t){throw e}throw new t(a.UNABLE_TO_INITIATE_PAYMENT,e.message)}return new Promise(((s,n)=>{let o=false;const m=setTimeout((()=>{if(o){return}o=true;f();n(new t(a.GENERIC_PAYMENT_ERROR,"Payment timeout"))}),r);function c(){if(o){return}const t=e.state.currentPayment;const a=e.state.error;const n=e.state.isPaymentInProgress;if(t?.status==="SUCCESS"){o=true;f();clearTimeout(m);s({success:true,result:t.result});return}if(t?.status==="FAILED"){o=true;f();clearTimeout(m);s({success:false,error:a||"Payment failed"});return}if(a&&!n&&!t){o=true;f();clearTimeout(m);s({success:false,error:a})}}const i=d("currentPayment",c);const p=d("error",c);const l=d("isPaymentInProgress",c);const f=u([i,p,l]);c()}))}function r(){return e.getExchanges()}function m(){return e.state.currentPayment?.result}function i(){return e.state.error}function p(){return e.state.isPaymentInProgress}function d(t,a){return e.subscribeKey(t,a)}function u(e){return()=>{e.forEach((e=>{try{e()}catch{}}))}}const l={network:"eip155:8453",asset:"native",metadata:{name:"Ethereum",symbol:"ETH",decimals:18}};const f={network:"eip155:8453",asset:"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}};const C={network:"eip155:84532",asset:"native",metadata:{name:"Ethereum",symbol:"ETH",decimals:18}};const D={network:"eip155:1",asset:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}};const y={network:"eip155:10",asset:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}};const w={network:"eip155:42161",asset:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}};const S={network:"eip155:137",asset:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}};const U={network:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",asset:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}};const T={network:"eip155:1",asset:"0xdAC17F958D2ee523a2206206994597C13D831ec7",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}};const E={network:"eip155:10",asset:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}};const k={network:"eip155:42161",asset:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}};const j={network:"eip155:137",asset:"0xc2132d05d31c914a87c6611c10748aeb04b58e8f",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}};const v={network:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",asset:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}};const F={network:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",asset:"native",metadata:{name:"Solana",symbol:"SOL",decimals:9}};export{e as PayController,w as arbitrumUSDC,k as arbitrumUSDT,l as baseETH,C as baseSepoliaETH,f as baseUSDC,D as ethereumUSDC,T as ethereumUSDT,r as getExchanges,p as getIsPaymentInProgress,i as getPayError,m as getPayResult,n as openPay,y as optimismUSDC,E as optimismUSDT,o as pay,S as polygonUSDC,j as polygonUSDT,F as solanaSOL,U as solanaUSDC,v as solanaUSDT};
//# sourceMappingURL=p-5ezfAJ3z.js.map