const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["main.js","main.css","assets/index-QLnl5sO1.js","assets/index-CZHHMApS.js","assets/index-C1mpuWJz.js"])))=>i.map(i=>d[i]);
var R=Object.defineProperty;var x=s=>{throw TypeError(s)};var I=(s,t,e)=>t in s?R(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var f=(s,t,e)=>I(s,typeof t!="symbol"?t+"":t,e),D=(s,t,e)=>t.has(s)||x("Cannot "+e);var h=(s,t,e)=>(D(s,t,"read from private field"),e?e.call(s):t.get(s)),l=(s,t,e)=>t.has(s)?x("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),o=(s,t,e,n)=>(D(s,t,"write to private field"),n?n.call(s,e):t.set(s,e),e);var G=(s,t,e,n)=>({set _(r){o(s,t,r,e)},get _(){return h(s,t,n)}});import{U as V,d as B,X as $,Y as _,Z as W,$ as b,_ as u,a0 as M,a1 as U,a2 as X}from"../main.js";var a,c;const v=class v extends V{constructor(e){super(e.provider);f(this,"signer");l(this,a);l(this,c);B(this,{signer:e}),o(this,a,null),o(this,c,0)}async getAddress(){return this.signer.getAddress()}connect(e){return new v(this.signer.connect(e))}async getNonce(e){if(e==="pending"){h(this,a)==null&&o(this,a,super.getNonce("pending"));const n=h(this,c);return await h(this,a)+n}return super.getNonce(e)}increment(){G(this,c)._++}reset(){o(this,c,0),o(this,a,null)}async sendTransaction(e){const n=this.getNonce("pending");return this.increment(),e=await this.signer.populateTransaction(e),e.nonce=await n,await this.signer.sendTransaction(e)}signTransaction(e){return this.signer.signTransaction(e)}signMessage(e){return this.signer.signMessage(e)}signTypedData(e,n,r){return this.signer.signTypedData(e,n,r)}};a=new WeakMap,c=new WeakMap;let P=v;async function Y(s,t,e){const n=typeof t=="string"?new $(t,s):t,r=(e==null?void 0:e.chain)??(await _.chainFromRpc(s))[1],i=new P(n);if(i.provider===null)try{i.connect(s)}catch(d){console.error("Cannot connect to network for signer",d)}return new Z(r,await n.getAddress(),i,e)}class Z extends W{constructor(e,n,r,i){super(e,n,r);f(this,"opts");this.opts=i}chain(){return this._chain}address(){return this._address}async sign(e){var w,E,T,y,A,L,C;const n=this.chain(),r=[];let i=500000n,d=100000000000n,m=1500000000n,p=100000000n;if(((w=this.opts)==null?void 0:w.overrides)===void 0&&n!=="Celo"){const g=await this._signer.provider.getFeeData();d=g.gasPrice??d,m=g.maxFeePerGas??m,p=g.maxPriorityFeePerGas??p}((E=this.opts)==null?void 0:E.gasLimit)!==void 0&&(i=this.opts.gasLimit),((T=this.opts)==null?void 0:T.maxGasLimit)!==void 0&&(i=i>((y=this.opts)==null?void 0:y.maxGasLimit)?(A=this.opts)==null?void 0:A.maxGasLimit:i);const N=n==="Oasis"?{gasLimit:i,gasPrice:d,type:0}:{gasLimit:i,maxFeePerGas:m,maxPriorityFeePerGas:p};for(const g of e){const{transaction:O,description:S}=g;(L=this.opts)!=null&&L.debug&&console.log(`Signing: ${S} for ${this.address()}`);const F={...O,...N,from:this.address(),nonce:await this._signer.getNonce(),...(C=this.opts)==null?void 0:C.overrides};r.push(await this._signer.signTransaction(F))}return r}}const z={Address:b,Platform:_,getSigner:Y,protocols:{WormholeCore:()=>u(()=>import("../main.js").then(s=>s.cN),__vite__mapDeps([0,1])),TokenBridge:()=>u(()=>import("./index-QLnl5sO1.js"),__vite__mapDeps([2,0,1])),PorticoBridge:()=>u(()=>import("./index-CZHHMApS.js"),__vite__mapDeps([3,0,1,2])),CircleBridge:()=>u(()=>import("./index-C1mpuWJz.js"),__vite__mapDeps([4,0,1,2]))},getChain:(s,t,e)=>new M(t,new _(s,U(s,X,{[t]:e})))};export{z as default};
