@wormhole-foundation/wormhole-connect 2.1.0-beta.3-development → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/main.js +2 -2
  2. package/lib/{aptos-UPRxA7V-.mjs → aptos-BqK7cMly.mjs} +2 -2
  3. package/lib/{aptos-D3_AGWR7.js → aptos-C7pCAbUg.js} +2 -2
  4. package/lib/{aptos-BzXZvGaH.js → aptos-DYNyya4r.js} +1 -1
  5. package/lib/{aptos-BzWhIYlr.mjs → aptos-hNRlQB2L.mjs} +5 -5
  6. package/lib/{base64-DVjW5Kcf.mjs → base64-BVPj2zYr.mjs} +1 -1
  7. package/lib/{base64-DRH1vfG7.js → base64-KSl9zI2U.js} +1 -1
  8. package/lib/{ccip-wLlfyIvk.mjs → ccip-B6vHFB5O.mjs} +1 -1
  9. package/lib/{ccip-BB23_sIM.js → ccip-zobR3MWX.js} +1 -1
  10. package/lib/{chunk-IMTC3J2M-CBauIJwr.js → chunk-IMTC3J2M-Clcv-kNR.js} +1 -1
  11. package/lib/{chunk-IMTC3J2M-DNVBjBib.mjs → chunk-IMTC3J2M-D7LWAYQa.mjs} +3 -3
  12. package/lib/{events-IHlp1dj4.mjs → events-FSoXRy3T.mjs} +1 -1
  13. package/lib/{events-CKwRCNdA.js → events-bGzCAvB8.js} +1 -1
  14. package/lib/{evm-BabY832Q.mjs → evm-BLO6Qv4a.mjs} +5 -5
  15. package/lib/{evm-C2f5n9qH.js → evm-CG-xuonQ.js} +3 -3
  16. package/lib/{evm-CogaB9FQ.mjs → evm-CN1iRHbr.mjs} +5 -5
  17. package/lib/{evm-CyaMnZnL.js → evm-DYzdDx7h.js} +1 -1
  18. package/lib/{index-Bk1zihOK.js → index--GEXYLpJ.js} +1 -1
  19. package/lib/{index-qAojYF7t.mjs → index-0sRAi_-E.mjs} +14 -13
  20. package/lib/{index-DUGSEVtX.mjs → index-B4iVrVli.mjs} +2 -2
  21. package/lib/{index-5VUxPYxW.js → index-B5H5W-MP.js} +3 -3
  22. package/lib/{index-DiEuvJoC.js → index-BDTERphb.js} +1 -1
  23. package/lib/{index-B60oaJsI.mjs → index-BK9yAEqb.mjs} +2 -2
  24. package/lib/{index-y5-IYFyD.mjs → index-Ba7hi5Nv.mjs} +2 -2
  25. package/lib/{index-zfWv19dx.js → index-Bb1cX9pM.js} +1 -1
  26. package/lib/{index-BQ9dR-yJ.mjs → index-BdpPXZHn.mjs} +2 -2
  27. package/lib/{index-DIVxdT0X.js → index-BnZRt2Rd.js} +1 -1
  28. package/lib/{index-D6VdydhT.js → index-Bu6Mzk1B.js} +1 -1
  29. package/lib/{index-BtaC2yLu.js → index-BwcOlw60.js} +1 -1
  30. package/lib/{index-C1sV2FAp.mjs → index-BxEy7t5U.mjs} +2 -2
  31. package/lib/{index-CNvVpBBa.mjs → index-BztaZVVL.mjs} +2 -2
  32. package/lib/{index-BM78yUJC.js → index-C-Fyx20B.js} +1 -1
  33. package/lib/{index-C407bW0H.js → index-CEyJtiJA.js} +1 -1
  34. package/lib/{index-CBlNoKKQ.js → index-CIr2v4IG.js} +1 -1
  35. package/lib/{index-ItME4Ygf.js → index-CtaGVEFZ.js} +1 -1
  36. package/lib/{index-BxevXfo4.mjs → index-D1_1z7Wk.mjs} +1 -1
  37. package/lib/{index-Dfo6fMQc.js → index-D27hH8sY.js} +1 -1
  38. package/lib/{index-ImA899Nn.js → index-D75bWNLu.js} +1 -1
  39. package/lib/{index-Bket7LZZ.js → index-D8RCiuJ0.js} +1 -1
  40. package/lib/{index-CV8YMcz4.js → index-DGrbzOIm.js} +1 -1
  41. package/lib/{index-CTm08KJA.mjs → index-DI6kRBN0.mjs} +5 -5
  42. package/lib/{index-BhivGLAi.mjs → index-DJMHyNjD.mjs} +2 -2
  43. package/lib/{index-DrO4MMc6.mjs → index-DK3F1NhB.mjs} +4 -4
  44. package/lib/{index-Cs0blatJ.mjs → index-DVHcJTqD.mjs} +1 -1
  45. package/lib/{index-BZETHtjN.js → index-D_LeK8MJ.js} +1 -1
  46. package/lib/{index-BG8PXjVw.mjs → index-DcrVBUpc.mjs} +1 -1
  47. package/lib/{index-B2wyWEm0.mjs → index-DdL20a7t.mjs} +2 -2
  48. package/lib/{index-DhpLGCAx.js → index-DqmfSmiO.js} +1 -1
  49. package/lib/{index-M6UZ-4MJ.js → index-IzqkKy3R.js} +1 -1
  50. package/lib/{index-D19sSkOu.mjs → index-O6PU89nP.mjs} +2 -2
  51. package/lib/{index-Bn72ykZ2.mjs → index-QgCTXUa6.mjs} +3 -3
  52. package/lib/{index-DqlsWTi0.js → index-QtOAv51B.js} +1 -1
  53. package/lib/{index-DT-Qo8X9.js → index-gn107iCo.js} +1 -1
  54. package/lib/{index-B9LgOPw7.mjs → index-grCrWNvp.mjs} +1 -1
  55. package/lib/{index-BvuTcXfv.js → index-iaMEYhF5.js} +1 -1
  56. package/lib/{index-or7CYt4J.mjs → index-nCiFssoC.mjs} +1 -1
  57. package/lib/{index-FVwpVvZ7.mjs → index-xTX46Yw9.mjs} +1 -1
  58. package/lib/{index-CzwViHJ0.mjs → index-yt4URWzh.mjs} +1 -1
  59. package/lib/{index-B5jfHVNH.mjs → index-zb82e-lE.mjs} +3 -3
  60. package/lib/{index.es-C3FF2T3n.js → index.es-DCYCSMuK.js} +2 -2
  61. package/lib/{index.es-dld457ym.mjs → index.es-ffyJdlAz.mjs} +6 -6
  62. package/lib/index.js +1 -1
  63. package/lib/index.mjs +1 -1
  64. package/lib/{signer-BBccJJ2M.mjs → signer-BBbBI9Ch.mjs} +1 -1
  65. package/lib/{signer-BpeTLqjx.js → signer-C8bS-IbV.js} +1 -1
  66. package/lib/{solana-Ds-NCQtw.mjs → solana-7uRxf9WX.mjs} +5 -5
  67. package/lib/{solana-BIaWIfzq.js → solana-BVyz5H3z.js} +1 -1
  68. package/lib/{solana-zqUypMcM.mjs → solana-BfVL9dAW.mjs} +4 -4
  69. package/lib/solana-DPZR_Eze.js +1 -0
  70. package/lib/{solanaEmbed.esm-DRkknJ2o.mjs → solanaEmbed.esm-BXeUQQ1f.mjs} +2 -2
  71. package/lib/{solanaEmbed.esm-BxikN_Mz.js → solanaEmbed.esm-BylLsCAU.js} +1 -1
  72. package/lib/{sui-710wCQpP.js → sui-BcGOZHgb.js} +1 -1
  73. package/lib/{sui-5OP1jpsj.mjs → sui-CBeaWzBm.mjs} +1 -1
  74. package/lib/{sui-n-MTTZiA.mjs → sui-NQaMhA2C.mjs} +5 -5
  75. package/lib/{sui-8bnax2uU.js → sui-fKD7sV9G.js} +2 -2
  76. package/package.json +17 -17
  77. package/lib/solana-4RJ4XeTx.js +0 -1
@@ -3,8 +3,8 @@ var wa = (e) => {
3
3
  };
4
4
  var Aa = (e, t, n) => t.has(e) || wa("Cannot " + n);
5
5
  var Tr = (e, t, n) => (Aa(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Ia = (e, t, n) => t.has(e) ? wa("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Na = (e, t, n, r) => (Aa(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);
6
- import { T as Xo, U as Ea, V as Wr, X as qo, Y as $o, Z as ec, $ as xa, a0 as tc, a1 as $e, a2 as nc, a3 as Kn, a4 as rc, a5 as sc, a6 as ac, a7 as ic, a8 as oc, a9 as cc, aa as lc, ab as uc, ac as tn, ad as hc } from "./index-qAojYF7t.mjs";
7
- import "./index-or7CYt4J.mjs";
6
+ import { T as Xo, U as Ea, V as Wr, X as qo, Y as $o, Z as ec, $ as xa, a0 as tc, a1 as $e, a2 as nc, a3 as Kn, a4 as rc, a5 as sc, a6 as ac, a7 as ic, a8 as oc, a9 as cc, aa as lc, ab as uc, ac as tn, ad as hc } from "./index-0sRAi_-E.mjs";
7
+ import "./index-nCiFssoC.mjs";
8
8
  import "react";
9
9
  var kt;
10
10
  class dc extends Xo {
@@ -4316,7 +4316,7 @@ async function gr(e, t) {
4316
4316
  });
4317
4317
  return C === "0x" ? { data: void 0 } : { data: C };
4318
4318
  } catch (N) {
4319
- const I = Hu(N), { offchainLookup: l, offchainLookupSignature: b } = await import("./ccip-wLlfyIvk.mjs");
4319
+ const I = Hu(N), { offchainLookup: l, offchainLookupSignature: b } = await import("./ccip-B6vHFB5O.mjs");
4320
4320
  if ((I == null ? void 0 : I.slice(0, 10)) === b && f)
4321
4321
  return { data: await l(e, { data: I, to: f }) };
4322
4322
  throw Yu(N, {
@@ -13979,7 +13979,7 @@ var xd = Object.defineProperty, Dd = function(e, t, n) {
13979
13979
  case 0:
13980
13980
  return !Jt(i, Vt) || a || o ? (h = !((c = i.options) === null || c === void 0) && c.infuraId ? {} : i.chains.reduce(function(f, m) {
13981
13981
  return ti(Yn({}, f), vo({}, m.id, m.rpcUrls.default.http[0]));
13982
- }, {}), [4, import("./index-DrO4MMc6.mjs")]) : [3, 2];
13982
+ }, {}), [4, import("./index-DK3F1NhB.mjs")]) : [3, 2];
13983
13983
  case 1:
13984
13984
  d = p.sent().default, Yr(i, Vt, new d(ti(Yn({}, i.options), { chainId: a, rpc: Yn({}, h, (u = i.options) === null || u === void 0 ? void 0 : u.rpc) }))), p.label = 2;
13985
13985
  case 2:
@@ -15579,7 +15579,7 @@ Es = async function() {
15579
15579
  };
15580
15580
  fa = /* @__PURE__ */ new WeakSet();
15581
15581
  Vo = async function() {
15582
- const { EthereumProvider: e } = await import("./index.es-dld457ym.mjs"), t = this.chains.map(({ id: n }) => n);
15582
+ const { EthereumProvider: e } = await import("./index.es-ffyJdlAz.mjs"), t = this.chains.map(({ id: n }) => n);
15583
15583
  if (t.length) {
15584
15584
  const {
15585
15585
  projectId: n,
@@ -1 +1 @@
1
- "use strict";var D=Object.defineProperty;var G=s=>{throw TypeError(s)};var O=(s,t,e)=>t in s?D(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var f=(s,t,e)=>O(s,typeof t!="symbol"?t+"":t,e),A=(s,t,e)=>t.has(s)||G("Cannot "+e);var l=(s,t,e)=>(A(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?G("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),c=(s,t,e,i)=>(A(s,t,"write to private field"),i?i.call(s,e):t.set(s,e),e);var F=(s,t,e,i)=>({set _(a){c(s,t,a,e)},get _(){return l(s,t,i)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-5VUxPYxW.js");var o,g;const v=class v extends r.AbstractSigner{constructor(e){super(e.provider);f(this,"signer");p(this,o);p(this,g);r.defineProperties(this,{signer:e}),c(this,o,null),c(this,g,0)}async getAddress(){return this.signer.getAddress()}connect(e){return new v(this.signer.connect(e))}async getNonce(e){if(e==="pending"){l(this,o)==null&&c(this,o,super.getNonce("pending"));const i=l(this,g);return await l(this,o)+i}return super.getNonce(e)}increment(){F(this,g)._++}reset(){c(this,g,0),c(this,o,null)}async sendTransaction(e){const i=this.getNonce("pending");return this.increment(),e=await this.signer.populateTransaction(e),e.nonce=await i,await this.signer.sendTransaction(e)}signTransaction(e){return this.signer.signTransaction(e)}signMessage(e){return this.signer.signMessage(e)}signTypedData(e,i,a){return this.signer.signTypedData(e,i,a)}};o=new WeakMap,g=new WeakMap;let P=v;async function b(s,t,e){const i=typeof t=="string"?new r.Wallet(t,s):t,a=(e==null?void 0:e.chain)??(await r.EvmPlatform.chainFromRpc(s))[1],n=new P(i);if(n.provider===null)try{n.connect(s)}catch(d){console.error("Cannot connect to network for signer",d)}return new B(a,await i.getAddress(),n,e)}class B extends r.PlatformNativeSigner{constructor(e,i,a,n){super(e,i,a);f(this,"opts");this.opts=n}chain(){return this._chain}address(){return this._address}async sign(e){var w,y,x,C,S,T,E;const i=this.chain(),a=[];let n=500000n,d=100000000000n,m=1500000000n,u=100000000n;if(((w=this.opts)==null?void 0:w.overrides)===void 0&&i!=="Celo"){const h=await this._signer.provider.getFeeData();d=h.gasPrice??d,m=h.maxFeePerGas??m,u=h.maxPriorityFeePerGas??u}((y=this.opts)==null?void 0:y.gasLimit)!==void 0&&(n=this.opts.gasLimit),((x=this.opts)==null?void 0:x.maxGasLimit)!==void 0&&(n=n>((C=this.opts)==null?void 0:C.maxGasLimit)?(S=this.opts)==null?void 0:S.maxGasLimit:n);const L=i==="Oasis"?{gasLimit:n,gasPrice:d,type:0}:{gasLimit:n,maxFeePerGas:m,maxPriorityFeePerGas:u};for(const h of e){const{transaction:N,description:q}=h;(T=this.opts)!=null&&T.debug&&console.log(`Signing: ${q} for ${this.address()}`);const _={...N,...L,from:this.address(),nonce:await this._signer.getNonce(),...(E=this.opts)==null?void 0:E.overrides};a.push(await this._signer.signTransaction(_))}return a}}const $={Address:r.EvmAddress,Platform:r.EvmPlatform,getSigner:b,protocols:{WormholeCore:()=>Promise.resolve().then(()=>require("./index-5VUxPYxW.js")).then(s=>s.index$1),TokenBridge:()=>Promise.resolve().then(()=>require("./index-D6VdydhT.js")),PorticoBridge:()=>Promise.resolve().then(()=>require("./index-Bk1zihOK.js")),CircleBridge:()=>Promise.resolve().then(()=>require("./index-DqlsWTi0.js"))},getChain:(s,t,e)=>new r.EvmChain(t,new r.EvmPlatform(s,r.applyChainsConfigConfigOverrides(s,r._platform,{[t]:e})))};exports.default=$;
1
+ "use strict";var D=Object.defineProperty;var G=s=>{throw TypeError(s)};var O=(s,t,e)=>t in s?D(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var f=(s,t,e)=>O(s,typeof t!="symbol"?t+"":t,e),A=(s,t,e)=>t.has(s)||G("Cannot "+e);var l=(s,t,e)=>(A(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?G("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),c=(s,t,e,i)=>(A(s,t,"write to private field"),i?i.call(s,e):t.set(s,e),e);var F=(s,t,e,i)=>({set _(a){c(s,t,a,e)},get _(){return l(s,t,i)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-B5H5W-MP.js");var o,g;const v=class v extends r.AbstractSigner{constructor(e){super(e.provider);f(this,"signer");p(this,o);p(this,g);r.defineProperties(this,{signer:e}),c(this,o,null),c(this,g,0)}async getAddress(){return this.signer.getAddress()}connect(e){return new v(this.signer.connect(e))}async getNonce(e){if(e==="pending"){l(this,o)==null&&c(this,o,super.getNonce("pending"));const i=l(this,g);return await l(this,o)+i}return super.getNonce(e)}increment(){F(this,g)._++}reset(){c(this,g,0),c(this,o,null)}async sendTransaction(e){const i=this.getNonce("pending");return this.increment(),e=await this.signer.populateTransaction(e),e.nonce=await i,await this.signer.sendTransaction(e)}signTransaction(e){return this.signer.signTransaction(e)}signMessage(e){return this.signer.signMessage(e)}signTypedData(e,i,a){return this.signer.signTypedData(e,i,a)}};o=new WeakMap,g=new WeakMap;let P=v;async function b(s,t,e){const i=typeof t=="string"?new r.Wallet(t,s):t,a=(e==null?void 0:e.chain)??(await r.EvmPlatform.chainFromRpc(s))[1],n=new P(i);if(n.provider===null)try{n.connect(s)}catch(d){console.error("Cannot connect to network for signer",d)}return new B(a,await i.getAddress(),n,e)}class B extends r.PlatformNativeSigner{constructor(e,i,a,n){super(e,i,a);f(this,"opts");this.opts=n}chain(){return this._chain}address(){return this._address}async sign(e){var w,y,x,C,S,T,E;const i=this.chain(),a=[];let n=500000n,d=100000000000n,m=1500000000n,u=100000000n;if(((w=this.opts)==null?void 0:w.overrides)===void 0&&i!=="Celo"){const h=await this._signer.provider.getFeeData();d=h.gasPrice??d,m=h.maxFeePerGas??m,u=h.maxPriorityFeePerGas??u}((y=this.opts)==null?void 0:y.gasLimit)!==void 0&&(n=this.opts.gasLimit),((x=this.opts)==null?void 0:x.maxGasLimit)!==void 0&&(n=n>((C=this.opts)==null?void 0:C.maxGasLimit)?(S=this.opts)==null?void 0:S.maxGasLimit:n);const L=i==="Oasis"?{gasLimit:n,gasPrice:d,type:0}:{gasLimit:n,maxFeePerGas:m,maxPriorityFeePerGas:u};for(const h of e){const{transaction:N,description:q}=h;(T=this.opts)!=null&&T.debug&&console.log(`Signing: ${q} for ${this.address()}`);const _={...N,...L,from:this.address(),nonce:await this._signer.getNonce(),...(E=this.opts)==null?void 0:E.overrides};a.push(await this._signer.signTransaction(_))}return a}}const $={Address:r.EvmAddress,Platform:r.EvmPlatform,getSigner:b,protocols:{WormholeCore:()=>Promise.resolve().then(()=>require("./index-B5H5W-MP.js")).then(s=>s.index$1),TokenBridge:()=>Promise.resolve().then(()=>require("./index-Bu6Mzk1B.js")),PorticoBridge:()=>Promise.resolve().then(()=>require("./index--GEXYLpJ.js")),CircleBridge:()=>Promise.resolve().then(()=>require("./index-QtOAv51B.js"))},getChain:(s,t,e)=>new r.EvmChain(t,new r.EvmPlatform(s,r.applyChainsConfigConfigOverrides(s,r._platform,{[t]:e})))};exports.default=$;
@@ -1 +1 @@
1
- "use strict";var S=Object.defineProperty;var P=(l,o,t)=>o in l?S(l,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[o]=t;var h=(l,o,t)=>P(l,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-5VUxPYxW.js"),U=require("./index-D6VdydhT.js"),A=new e.Interface(["function start((bytes32,address,address,address,address,address,uint256,uint256,uint256,uint256)) returns (address,uint16,uint64)","function receiveMessageAndSwap(bytes)"]),q=new e.Interface(["function quoteExactInputSingle((address,address,uint256,uint24,uint160)) public view returns (uint256,uint160,uint32,uint256)"]),N="https://gfx.relayers.xlabs.xyz/api/v1/swap/quote";class R{static async quoteRelayer(o,t,r){var a;if(e.isNative(t)||e.isNative(r))throw new Error("how did you get here tho?");const n=e.hex.encode(t.toUniversalAddress().toUint8Array(),!1),s=e.hex.encode(r.toUniversalAddress().toUint8Array(),!1),i={targetChain:e.toChainId(o),sourceToken:n,targetToken:s};try{const c=await e.axios.post(N,i);return BigInt(c.data.fee)}catch(c){throw e.axios.isAxiosError(c)?new Error(`Error getting relayer fee: ${(a=c.response)==null?void 0:a.statusText}`):c}}}const m=100,E={ETH:[e.Wormhole.tokenId("Arbitrum","native"),e.Wormhole.tokenId("Base","native"),e.Wormhole.tokenId("Ethereum","native"),e.Wormhole.tokenId("Optimism","native")],WETH:[e.Wormhole.tokenId("Arbitrum","0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),e.Wormhole.tokenId("Avalanche","0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB"),e.Wormhole.tokenId("Base","0x4200000000000000000000000000000000000006"),e.Wormhole.tokenId("Bsc","0x2170Ed0880ac9A755fd29B2688956BD959F933F8"),e.Wormhole.tokenId("Ethereum","0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),e.Wormhole.tokenId("Optimism","0x4200000000000000000000000000000000000006"),e.Wormhole.tokenId("Polygon","0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619")],wstETH:[e.Wormhole.tokenId("Arbitrum","0x5979D7b546E38E414F7E9822514be443A4800529"),e.Wormhole.tokenId("Base","0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452"),e.Wormhole.tokenId("Ethereum","0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"),e.Wormhole.tokenId("Optimism","0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb"),e.Wormhole.tokenId("Polygon","0x03b54A6e9a984069379fae1a4fC4dBAE93B3bCCD")],USDT:[e.Wormhole.tokenId("Arbitrum","0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"),e.Wormhole.tokenId("Avalanche","0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7"),e.Wormhole.tokenId("Base","0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2"),e.Wormhole.tokenId("Bsc","0x55d398326f99059fF775485246999027B3197955"),e.Wormhole.tokenId("Ethereum","0xdAC17F958D2ee523a2206206994597C13D831ec7"),e.Wormhole.tokenId("Optimism","0x94b008aA00579c1307B0EF2c499aD98a8ce58e58"),e.Wormhole.tokenId("Polygon","0xc2132D05D31c914a87C6611C10748AEb04B58e8F"),e.Wormhole.tokenId("Celo","0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e")]};class p{constructor(o,t,r,n){h(this,"network");h(this,"chain");h(this,"provider");h(this,"contracts");h(this,"chainId");h(this,"core");h(this,"tokenBridge");if(this.network=o,this.chain=t,this.provider=r,this.contracts=n,!n.portico)throw new Error("Unsupported chain, no contract addresses for: "+t);this.core=new e.EvmWormholeCore(o,t,r,n),this.tokenBridge=new U.EvmTokenBridge(o,t,r,n),this.chainId=e.networkChainToNativeChainId.get(o,t)}static async fromRpc(o,t){const[r,n]=await e.EvmPlatform.chainFromRpc(o),s=t[n];if(s.network!==r)throw new Error(`Network mismatch: ${s.network} != ${r}`);return new p(r,n,o,s.contracts)}async*transfer(o,t,r,n,s,d,i){const{minAmountStart:a,minAmountFinish:c}=i.swapAmounts;if(a===0n)throw new Error("Invalid min swap amount");if(c===0n)throw new Error("Invalid min swap amount");const f=new e.EvmAddress(o).toString(),[u,g]=e.resolveWrappedToken(this.network,this.chain,r),[T,C]=e.resolveWrappedToken(this.network,t.chain,s),k=e.canonicalAddress(g),I=e.canonicalAddress(await this.getTransferrableToken(k)),b=e.canonicalAddress(t),v=e.canonicalAddress(C),F=new Date().valueOf()%2**4,B=e.PorticoBridge.serializeFlagSet({flags:{shouldWrapNative:u,shouldUnwrapNative:T},recipientChain:e.toChainId(t.chain),bridgeNonce:F,feeTierStart:m,feeTierFinish:m,padding:new Uint8Array(19)}),y=A.encodeFunctionData("start",[[B,k.toLowerCase(),I,v.toLowerCase(),b,d,n.toString(),a.toString(),c.toString(),i.relayerFee.toString()]]),x=this.getTokenGroup(g.address.toString()),w=this.getPorticoAddress(x);u||(yield*this.approve(k,f,n,w));const W=await this.core.getMessageFee(),D={to:w,data:y,value:W+(u?n:0n)};yield this.createUnsignedTransaction(e.addFrom(D,f),"PorticoBridge.Transfer")}async*redeem(o,t){const r=e.toChain(t.payload.payload.flagSet.recipientChain),n=t.payload.payload.finalTokenAddress.toNative(r).toString(),s=this.getTokenGroup(n),d=this.getPorticoAddress(s),a=await new e.Contract(d,A.fragments,this.provider).getFunction("receiveMessageAndSwap").populateTransaction(e.serialize(t)),c=new e.EvmAddress(o).toString();yield this.createUnsignedTransaction(e.addFrom(a,c),"PorticoBridge.Redeem")}async isTransferCompleted(o){return await this.tokenBridge.tokenBridge.isTransferCompleted(e.keccak256(o.hash))}async quoteSwap(o,t,r,n){const[,s]=e.resolveWrappedToken(this.network,this.chain,o),[,d]=e.resolveWrappedToken(this.network,this.chain,t),i=e.canonicalAddress(s),a=e.canonicalAddress(d);if(e.isEqualCaseInsensitive(i,a))return n;const c=this.getQuoterAddress(r);return(await new e.Contract(c,q.fragments,this.provider).getFunction("quoteExactInputSingle").staticCall([i,a,n,m,0]))[0]}async quoteRelay(o,t){return await R.quoteRelayer(this.chain,o,t)}async getTransferrableToken(o){const t=e.Wormhole.tokenId(this.chain,o),[,r]=e.resolveWrappedToken(this.network,this.chain,t);if(this.chain==="Ethereum")return r;const n=Object.values(E).find(i=>i.find(a=>a.chain===this.chain&&e.canonicalAddress(a)===e.canonicalAddress(r)));if(!n)throw new Error(`No token group found for ${o} on ${this.chain}`);const s=n.find(i=>i.chain==="Ethereum");if(!s)throw new Error(`No Ethereum origin token found for ${o} on ${this.chain}`);const d=await this.tokenBridge.getWrappedAsset(s);return e.Wormhole.tokenId(this.chain,d.toString())}supportedTokens(){const o=[];for(const[t,r]of Object.entries(E))for(const n of r)n.chain===this.chain&&o.push({group:t,token:n});return o}getTokenGroup(o){const r=this.supportedTokens().find(n=>e.canonicalAddress(n.token)===o);if(!r)throw new Error("Token not found");return r.group}async*approve(o,t,r,n){const s=e.EvmPlatform.getTokenImplementation(this.provider,o);if(await s.allowance(t,n)<r){const i=await s.approve.populateTransaction(n,r);yield this.createUnsignedTransaction(e.addFrom(i,t),"PorticoBridge.Approve")}}createUnsignedTransaction(o,t){return new e.EvmUnsignedTransaction(e.addChainId(o,this.chainId),this.network,this.chain,t,!1)}getPorticoAddress(o){const t=this.contracts.portico;return o==="USDT"&&t.porticoPancakeSwap||t.porticoUniswap}getQuoterAddress(o){const t=this.contracts.portico;return o==="USDT"&&t.pancakeSwapQuoterV2||t.uniswapQuoterV2}}e.registerProtocol(e._platform,"PorticoBridge",p);exports.EvmPorticoBridge=p;
1
+ "use strict";var S=Object.defineProperty;var P=(l,o,t)=>o in l?S(l,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[o]=t;var h=(l,o,t)=>P(l,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-B5H5W-MP.js"),U=require("./index-Bu6Mzk1B.js"),A=new e.Interface(["function start((bytes32,address,address,address,address,address,uint256,uint256,uint256,uint256)) returns (address,uint16,uint64)","function receiveMessageAndSwap(bytes)"]),q=new e.Interface(["function quoteExactInputSingle((address,address,uint256,uint24,uint160)) public view returns (uint256,uint160,uint32,uint256)"]),N="https://gfx.relayers.xlabs.xyz/api/v1/swap/quote";class R{static async quoteRelayer(o,t,r){var a;if(e.isNative(t)||e.isNative(r))throw new Error("how did you get here tho?");const n=e.hex.encode(t.toUniversalAddress().toUint8Array(),!1),s=e.hex.encode(r.toUniversalAddress().toUint8Array(),!1),i={targetChain:e.toChainId(o),sourceToken:n,targetToken:s};try{const c=await e.axios.post(N,i);return BigInt(c.data.fee)}catch(c){throw e.axios.isAxiosError(c)?new Error(`Error getting relayer fee: ${(a=c.response)==null?void 0:a.statusText}`):c}}}const m=100,E={ETH:[e.Wormhole.tokenId("Arbitrum","native"),e.Wormhole.tokenId("Base","native"),e.Wormhole.tokenId("Ethereum","native"),e.Wormhole.tokenId("Optimism","native")],WETH:[e.Wormhole.tokenId("Arbitrum","0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),e.Wormhole.tokenId("Avalanche","0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB"),e.Wormhole.tokenId("Base","0x4200000000000000000000000000000000000006"),e.Wormhole.tokenId("Bsc","0x2170Ed0880ac9A755fd29B2688956BD959F933F8"),e.Wormhole.tokenId("Ethereum","0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),e.Wormhole.tokenId("Optimism","0x4200000000000000000000000000000000000006"),e.Wormhole.tokenId("Polygon","0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619")],wstETH:[e.Wormhole.tokenId("Arbitrum","0x5979D7b546E38E414F7E9822514be443A4800529"),e.Wormhole.tokenId("Base","0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452"),e.Wormhole.tokenId("Ethereum","0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"),e.Wormhole.tokenId("Optimism","0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb"),e.Wormhole.tokenId("Polygon","0x03b54A6e9a984069379fae1a4fC4dBAE93B3bCCD")],USDT:[e.Wormhole.tokenId("Arbitrum","0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"),e.Wormhole.tokenId("Avalanche","0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7"),e.Wormhole.tokenId("Base","0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2"),e.Wormhole.tokenId("Bsc","0x55d398326f99059fF775485246999027B3197955"),e.Wormhole.tokenId("Ethereum","0xdAC17F958D2ee523a2206206994597C13D831ec7"),e.Wormhole.tokenId("Optimism","0x94b008aA00579c1307B0EF2c499aD98a8ce58e58"),e.Wormhole.tokenId("Polygon","0xc2132D05D31c914a87C6611C10748AEb04B58e8F"),e.Wormhole.tokenId("Celo","0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e")]};class p{constructor(o,t,r,n){h(this,"network");h(this,"chain");h(this,"provider");h(this,"contracts");h(this,"chainId");h(this,"core");h(this,"tokenBridge");if(this.network=o,this.chain=t,this.provider=r,this.contracts=n,!n.portico)throw new Error("Unsupported chain, no contract addresses for: "+t);this.core=new e.EvmWormholeCore(o,t,r,n),this.tokenBridge=new U.EvmTokenBridge(o,t,r,n),this.chainId=e.networkChainToNativeChainId.get(o,t)}static async fromRpc(o,t){const[r,n]=await e.EvmPlatform.chainFromRpc(o),s=t[n];if(s.network!==r)throw new Error(`Network mismatch: ${s.network} != ${r}`);return new p(r,n,o,s.contracts)}async*transfer(o,t,r,n,s,d,i){const{minAmountStart:a,minAmountFinish:c}=i.swapAmounts;if(a===0n)throw new Error("Invalid min swap amount");if(c===0n)throw new Error("Invalid min swap amount");const f=new e.EvmAddress(o).toString(),[u,g]=e.resolveWrappedToken(this.network,this.chain,r),[T,C]=e.resolveWrappedToken(this.network,t.chain,s),k=e.canonicalAddress(g),I=e.canonicalAddress(await this.getTransferrableToken(k)),b=e.canonicalAddress(t),v=e.canonicalAddress(C),F=new Date().valueOf()%2**4,B=e.PorticoBridge.serializeFlagSet({flags:{shouldWrapNative:u,shouldUnwrapNative:T},recipientChain:e.toChainId(t.chain),bridgeNonce:F,feeTierStart:m,feeTierFinish:m,padding:new Uint8Array(19)}),y=A.encodeFunctionData("start",[[B,k.toLowerCase(),I,v.toLowerCase(),b,d,n.toString(),a.toString(),c.toString(),i.relayerFee.toString()]]),x=this.getTokenGroup(g.address.toString()),w=this.getPorticoAddress(x);u||(yield*this.approve(k,f,n,w));const W=await this.core.getMessageFee(),D={to:w,data:y,value:W+(u?n:0n)};yield this.createUnsignedTransaction(e.addFrom(D,f),"PorticoBridge.Transfer")}async*redeem(o,t){const r=e.toChain(t.payload.payload.flagSet.recipientChain),n=t.payload.payload.finalTokenAddress.toNative(r).toString(),s=this.getTokenGroup(n),d=this.getPorticoAddress(s),a=await new e.Contract(d,A.fragments,this.provider).getFunction("receiveMessageAndSwap").populateTransaction(e.serialize(t)),c=new e.EvmAddress(o).toString();yield this.createUnsignedTransaction(e.addFrom(a,c),"PorticoBridge.Redeem")}async isTransferCompleted(o){return await this.tokenBridge.tokenBridge.isTransferCompleted(e.keccak256(o.hash))}async quoteSwap(o,t,r,n){const[,s]=e.resolveWrappedToken(this.network,this.chain,o),[,d]=e.resolveWrappedToken(this.network,this.chain,t),i=e.canonicalAddress(s),a=e.canonicalAddress(d);if(e.isEqualCaseInsensitive(i,a))return n;const c=this.getQuoterAddress(r);return(await new e.Contract(c,q.fragments,this.provider).getFunction("quoteExactInputSingle").staticCall([i,a,n,m,0]))[0]}async quoteRelay(o,t){return await R.quoteRelayer(this.chain,o,t)}async getTransferrableToken(o){const t=e.Wormhole.tokenId(this.chain,o),[,r]=e.resolveWrappedToken(this.network,this.chain,t);if(this.chain==="Ethereum")return r;const n=Object.values(E).find(i=>i.find(a=>a.chain===this.chain&&e.canonicalAddress(a)===e.canonicalAddress(r)));if(!n)throw new Error(`No token group found for ${o} on ${this.chain}`);const s=n.find(i=>i.chain==="Ethereum");if(!s)throw new Error(`No Ethereum origin token found for ${o} on ${this.chain}`);const d=await this.tokenBridge.getWrappedAsset(s);return e.Wormhole.tokenId(this.chain,d.toString())}supportedTokens(){const o=[];for(const[t,r]of Object.entries(E))for(const n of r)n.chain===this.chain&&o.push({group:t,token:n});return o}getTokenGroup(o){const r=this.supportedTokens().find(n=>e.canonicalAddress(n.token)===o);if(!r)throw new Error("Token not found");return r.group}async*approve(o,t,r,n){const s=e.EvmPlatform.getTokenImplementation(this.provider,o);if(await s.allowance(t,n)<r){const i=await s.approve.populateTransaction(n,r);yield this.createUnsignedTransaction(e.addFrom(i,t),"PorticoBridge.Approve")}}createUnsignedTransaction(o,t){return new e.EvmUnsignedTransaction(e.addChainId(o,this.chainId),this.network,this.chain,t,!1)}getPorticoAddress(o){const t=this.contracts.portico;return o==="USDT"&&t.porticoPancakeSwap||t.porticoUniswap}getQuoterAddress(o){const t=this.contracts.portico;return o==="USDT"&&t.pancakeSwapQuoterV2||t.uniswapQuoterV2}}e.registerProtocol(e._platform,"PorticoBridge",p);exports.EvmPorticoBridge=p;
@@ -24971,7 +24971,8 @@ const finalityThresholds = [
24971
24971
  ["Celestia", 5e3],
24972
24972
  ["Neutron", 5e3],
24973
24973
  ["Stargaze", 5e3],
24974
- ["Seda", 7500]
24974
+ ["Seda", 7500],
24975
+ ["Berachain", 2e3]
24975
24976
  ], blockTime = constMap(blockTimeMilliseconds);
24976
24977
  function estimateFinalityTime(t) {
24977
24978
  const e = finalityThreshold.get(t);
@@ -74804,7 +74805,7 @@ const MAINNET_TOKENS = [
74804
74805
  index: 0,
74805
74806
  keys: ["0x13947Bd48b18E53fdAeEe77F3473391aC727C638"]
74806
74807
  }
74807
- }, WORMSCAN = "https://wormholescan.io/#/", CONNECT_VERSION = "2.1.0-beta.3-development", CONNECT_GIT_HASH = "f59f6576d11531213cc4e0336963e4120d15b2db", CHAIN_ORDER = [
74808
+ }, WORMSCAN = "https://wormholescan.io/#/", CONNECT_VERSION = "2.1.0", CONNECT_GIT_HASH = "fc339e32130cb1bda84dbcaa6f8716d8e7216b68", CHAIN_ORDER = [
74808
74809
  "Ethereum",
74809
74810
  "Solana",
74810
74811
  "Arbitrum",
@@ -74843,7 +74844,7 @@ function wrapEventHandler(t) {
74843
74844
  }
74844
74845
  };
74845
74846
  }
74846
- const evm = async () => (await import("./evm-BabY832Q.mjs")).default, solana$1 = async () => (await import("./solana-Ds-NCQtw.mjs")).default, aptos$1 = async () => (await import("./aptos-BzWhIYlr.mjs").then((t) => t.a)).default, sui = async () => (await import("./sui-n-MTTZiA.mjs").then((t) => t.s)).default, COINGECKO_URL = "https://api.coingecko.com", COINGECKO_URL_PRO = "https://pro-api.coingecko.com", NATIVE_TOKEN_IDS = {
74847
+ const evm = async () => (await import("./evm-BLO6Qv4a.mjs")).default, solana$1 = async () => (await import("./solana-7uRxf9WX.mjs")).default, aptos$1 = async () => (await import("./aptos-hNRlQB2L.mjs").then((t) => t.a)).default, sui = async () => (await import("./sui-NQaMhA2C.mjs").then((t) => t.s)).default, COINGECKO_URL = "https://api.coingecko.com", COINGECKO_URL_PRO = "https://pro-api.coingecko.com", NATIVE_TOKEN_IDS = {
74847
74848
  Solana: "solana",
74848
74849
  Ethereum: "ethereum",
74849
74850
  Arbitrum: "ethereum",
@@ -183510,7 +183511,7 @@ const walletConnection = {
183510
183511
  if (s.getNetworkInfo().chainId !== t) {
183511
183512
  if (l.context === Context.ETH)
183512
183513
  try {
183513
- await (await import("./evm-CogaB9FQ.mjs").then((p) => p.k)).switchChain(s, t);
183514
+ await (await import("./evm-CN1iRHbr.mjs").then((p) => p.k)).switchChain(s, t);
183514
183515
  } catch (u) {
183515
183516
  if (u instanceof NotSupported) return;
183516
183517
  throw u;
@@ -183525,25 +183526,25 @@ const walletConnection = {
183525
183526
  if (!u)
183526
183527
  throw new Error("wallet is undefined");
183527
183528
  if (d.context === Context.ETH)
183528
- return await (await import("./evm-CogaB9FQ.mjs").then((y) => y.k)).signAndSendTransaction(
183529
+ return await (await import("./evm-CN1iRHbr.mjs").then((y) => y.k)).signAndSendTransaction(
183529
183530
  e,
183530
183531
  u,
183531
183532
  t,
183532
183533
  l
183533
183534
  );
183534
183535
  if (d.context === Context.SOLANA)
183535
- return await (await import("./solana-zqUypMcM.mjs")).signAndSendTransaction(
183536
+ return await (await import("./solana-BfVL9dAW.mjs")).signAndSendTransaction(
183536
183537
  e,
183537
183538
  u,
183538
183539
  l
183539
183540
  );
183540
183541
  if (d.context === Context.SUI)
183541
- return (await (await import("./sui-5OP1jpsj.mjs")).signAndSendTransaction(
183542
+ return (await (await import("./sui-CBeaWzBm.mjs")).signAndSendTransaction(
183542
183543
  e,
183543
183544
  u
183544
183545
  )).id;
183545
183546
  if (d.context === Context.APTOS)
183546
- return (await (await import("./aptos-UPRxA7V-.mjs")).signAndSendTransaction(
183547
+ return (await (await import("./aptos-BqK7cMly.mjs")).signAndSendTransaction(
183547
183548
  e,
183548
183549
  u
183549
183550
  )).id;
@@ -183563,16 +183564,16 @@ const walletConnection = {
183563
183564
  if (t === void 0)
183564
183565
  return [];
183565
183566
  if (t.context === Context.ETH) {
183566
- const e = await import("./evm-CogaB9FQ.mjs").then((s) => s.k);
183567
+ const e = await import("./evm-CN1iRHbr.mjs").then((s) => s.k);
183567
183568
  return Object.values(mapWallets(e.wallets, Context.ETH));
183568
183569
  } else if (t.context === Context.SOLANA) {
183569
- const s = (await import("./solana-zqUypMcM.mjs")).fetchOptions();
183570
+ const s = (await import("./solana-BfVL9dAW.mjs")).fetchOptions();
183570
183571
  return Object.values(mapWallets(s, Context.SOLANA));
183571
183572
  } else if (t.context === Context.SUI) {
183572
- const s = await (await import("./sui-5OP1jpsj.mjs")).fetchOptions();
183573
+ const s = await (await import("./sui-CBeaWzBm.mjs")).fetchOptions();
183573
183574
  return Object.values(mapWallets(s, Context.SUI));
183574
183575
  } else if (t.context === Context.APTOS) {
183575
- const s = (await import("./aptos-UPRxA7V-.mjs")).fetchOptions();
183576
+ const s = (await import("./aptos-BqK7cMly.mjs")).fetchOptions();
183576
183577
  return Object.values(mapWallets(s, Context.APTOS));
183577
183578
  }
183578
183579
  return [];
@@ -196014,7 +196015,7 @@ function scale(t, e, s) {
196014
196015
  registerProtocol(_platform$1, "Ntt", EvmNtt);
196015
196016
  class SolanaChain extends ChainContext {
196016
196017
  async getTokenAccount(e, s) {
196017
- const { getAssociatedTokenAddress: l } = await import("./index-DUGSEVtX.mjs"), d = new SolanaAddress(s).unwrap(), u = new SolanaAddress(e).unwrap(), p = await l(d, u);
196018
+ const { getAssociatedTokenAddress: l } = await import("./index-B4iVrVli.mjs"), d = new SolanaAddress(s).unwrap(), u = new SolanaAddress(e).unwrap(), p = await l(d, u);
196018
196019
  return {
196019
196020
  chain: this.chain,
196020
196021
  address: new SolanaAddress(p.toString())
@@ -1,5 +1,5 @@
1
- import { aY as f, aZ as c, ae as s, a_ as O, a$ as t, b0 as o, b1 as d, b2 as A, b3 as p } from "./index-qAojYF7t.mjs";
2
- import { b4 as h } from "./index-qAojYF7t.mjs";
1
+ import { aY as f, aZ as c, ae as s, a_ as O, a$ as t, b0 as o, b1 as d, b2 as A, b3 as p } from "./index-0sRAi_-E.mjs";
2
+ import { b4 as h } from "./index-0sRAi_-E.mjs";
3
3
  class l extends Error {
4
4
  constructor(r) {
5
5
  super(r);