@wormhole-foundation/wormhole-connect 3.0.0-beta.1-development → 3.0.0-beta.3-development

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 (41) hide show
  1. package/dist/main.js +30 -30
  2. package/dist/src/config/ui.d.ts +1 -0
  3. package/dist/src/config/ui.d.ts.map +1 -1
  4. package/dist/src/hooks/useFetchQuotes.d.ts.map +1 -1
  5. package/dist/src/hooks/useFetchSupportedRoutes.d.ts.map +1 -1
  6. package/lib/{aptos-Da6iqpC-.js → aptos-BvHeL_GY.js} +1 -1
  7. package/lib/{aptos-Dz4Js3_d.mjs → aptos-CWlICqrN.mjs} +1 -1
  8. package/lib/{ccip-Ceg_B70t.mjs → ccip-BWwNh7Cy.mjs} +1 -1
  9. package/lib/{ccip-Bb-IPrNA.js → ccip-lZx1JcXV.js} +1 -1
  10. package/lib/{constants-Ba9GwEM1.mjs → constants-B7vln_3S.mjs} +3 -3
  11. package/lib/constants-CYn5EZsI.js +1 -0
  12. package/lib/{evm-DarNu22s.mjs → evm-8QrZ2Hru.mjs} +4 -4
  13. package/lib/{evm-1T5rGzcO.js → evm-NSPNbX19.js} +3 -3
  14. package/lib/hosted.js +1 -1
  15. package/lib/hosted.mjs +1 -1
  16. package/lib/{index-BHMN5Px3.mjs → index-7TXHMJ1V.mjs} +1 -1
  17. package/lib/{index-Cda4HnP1.mjs → index-BAHgvqy3.mjs} +1 -1
  18. package/lib/{index-Bn1o04G7.js → index-Bn2HXKJ4.js} +4 -4
  19. package/lib/{index-BTNmmLkb.js → index-C1_un59H.js} +1 -1
  20. package/lib/{index-VhcNuaP6.js → index-CIh7tJsi.js} +1 -1
  21. package/lib/{index-DvxmZnxH.mjs → index-Cf_Tpbyo.mjs} +1 -1
  22. package/lib/{index-B40ktVOy.js → index-CffzHeMT.js} +1 -1
  23. package/lib/{index-pNqQSm4p.mjs → index-DiulRNyF.mjs} +103 -85
  24. package/lib/{index.es-rEir51oG.mjs → index.es-C8hHvcxp.mjs} +2 -2
  25. package/lib/{index.es-_N4sKEIC.js → index.es-DWXvLB7p.js} +1 -1
  26. package/lib/index.js +1 -1
  27. package/lib/index.mjs +1 -1
  28. package/lib/{solana-SQhnN3yB.mjs → solana-8Asmn6g_.mjs} +3 -3
  29. package/lib/{solana-CrjSp_Zk.js → solana-BVfhsFxw.js} +1 -1
  30. package/lib/{solanaEmbed.esm-B7IRXgnI.js → solanaEmbed.esm-BSBPPQdh.js} +1 -1
  31. package/lib/{solanaEmbed.esm-Din0Z51P.mjs → solanaEmbed.esm-Bv-y4R2t.mjs} +2 -2
  32. package/lib/src/config/ui.d.ts +1 -0
  33. package/lib/src/config/ui.d.ts.map +1 -1
  34. package/lib/src/hooks/useFetchQuotes.d.ts.map +1 -1
  35. package/lib/src/hooks/useFetchSupportedRoutes.d.ts.map +1 -1
  36. package/lib/{sui-C7KPm3kD.js → sui-ByGBX_7Z.js} +1 -1
  37. package/lib/{sui-BePFnRSc.mjs → sui-CI_Sn1M4.mjs} +1 -1
  38. package/lib/{tokens-CChVRIuE.js → tokens-BcWAlkcp.js} +1 -1
  39. package/lib/{tokens-CyKAZUN-.mjs → tokens-D9jV-Q5b.mjs} +2 -2
  40. package/package.json +1 -1
  41. package/lib/constants-BqqwmYZc.js +0 -1
@@ -5,7 +5,7 @@ import _n, { jsx as S, jsxs as se, Fragment as Xt } from "react/jsx-runtime";
5
5
  import * as oe from "react";
6
6
  import wr, { useEffect as Ht, useRef as cn, useMemo as Ve, createContext as T8, useContext as Ba, forwardRef as E8, createElement as Ky, isValidElement as nc, cloneElement as ic, Children as e7, useCallback as $t, useState as yt, memo as $1, Component as t7 } from "react";
7
7
  import { d as re, g as Qi, a as pi, p as Jc, f as zr, b as R2, T as Sr, i as Ac, c as ks, e as so, h as Bs, j as r7, A as Kc, t as P2, k as Ln, l as dn, u as er, m as ci, s as Tc, n as I8, W as ir, M as el, o as L8, q as U2, r as rf, v as ro, w as n7, x as D8, y as S8, z as la, B as j8, C as O8, D as Ec, E as li, F as yn, G as ai, H as i7, I as o7, J as yi, K as a7, L as s7, N as c7, O as l7, P as f7, R as u7, Q as d7, S as h7, U as Zt, V as Rt, X as Vr, Y as G1, Z as _8, _ as So, $ as nf, a0 as of, a1 as $o, a2 as ys, a3 as tl, a4 as p7, a5 as Uo, a6 as co, a7 as z8, a8 as Ma, a9 as g7, aa as M7, ab as k8, ac as Zr, ad as q1, ae as fa, af as m7, ag as B8, ah as y7, ai as v7, aj as af, ak as sf, al as Io } from "./address-Drr_9OcK.mjs";
8
- import { C as b7, a as x7, b as Y2, W as F8 } from "./constants-Ba9GwEM1.mjs";
8
+ import { C as b7, a as x7, b as Y2, W as F8 } from "./constants-B7vln_3S.mjs";
9
9
  import "./address-Cj96wodd.mjs";
10
10
  import { M as X1, R as J1, U as C7, i as w7, a as N7, b as A7 } from "./address-B9anhmbU.mjs";
11
11
  import { CacheProvider as T7, Global as E7, ThemeContext as K1, css as lo, keyframes as gi, __unsafe_useEmotionCache as I7 } from "@emotion/react";
@@ -30648,7 +30648,7 @@ class Pc extends Rc {
30648
30648
  const n = await In(), o = n.getChain(t.chain), c = await o.getDecimals(t.address), i = await bL(t);
30649
30649
  let f = ((C = i == null ? void 0 : i.symbol) == null ? void 0 : C.toUpperCase()) || "", u = (i == null ? void 0 : i.name) || "", p = ((A = i == null ? void 0 : i.image) == null ? void 0 : A.large) || null;
30650
30650
  if (!f) {
30651
- const { getTokenMetadataFromRpc: E } = await import("./tokens-CyKAZUN-.mjs"), T = await E(t);
30651
+ const { getTokenMetadataFromRpc: E } = await import("./tokens-D9jV-Q5b.mjs"), T = await E(t);
30652
30652
  T && (console.info("Got metadata from RPC", T), f = T.symbol, u = T.name, p = T.icon);
30653
30653
  }
30654
30654
  let h;
@@ -31107,24 +31107,24 @@ const Oo = {
31107
31107
  if (!i)
31108
31108
  throw new Error("wallet is undefined");
31109
31109
  if (c.context === At.ETH)
31110
- return await (await import("./evm-DarNu22s.mjs").then((p) => p.k)).signAndSendTransaction(
31110
+ return await (await import("./evm-8QrZ2Hru.mjs").then((p) => p.k)).signAndSendTransaction(
31111
31111
  t,
31112
31112
  i,
31113
31113
  e
31114
31114
  );
31115
31115
  if (c.context === At.SOLANA)
31116
- return await (await import("./solana-SQhnN3yB.mjs")).signAndSendTransaction(
31116
+ return await (await import("./solana-8Asmn6g_.mjs")).signAndSendTransaction(
31117
31117
  t,
31118
31118
  i,
31119
31119
  o
31120
31120
  );
31121
31121
  if (c.context === At.SUI)
31122
- return (await (await import("./sui-BePFnRSc.mjs")).signAndSendTransaction(
31122
+ return (await (await import("./sui-CI_Sn1M4.mjs")).signAndSendTransaction(
31123
31123
  t,
31124
31124
  i
31125
31125
  )).id;
31126
31126
  if (c.context === At.APTOS)
31127
- return (await (await import("./aptos-Dz4Js3_d.mjs")).signAndSendTransaction(
31127
+ return (await (await import("./aptos-CWlICqrN.mjs")).signAndSendTransaction(
31128
31128
  t,
31129
31129
  i
31130
31130
  )).id;
@@ -31144,16 +31144,16 @@ const Oo = {
31144
31144
  if (e === void 0)
31145
31145
  return [];
31146
31146
  if (e.context === At.ETH) {
31147
- const t = await import("./evm-DarNu22s.mjs").then((n) => n.k);
31147
+ const t = await import("./evm-8QrZ2Hru.mjs").then((n) => n.k);
31148
31148
  return Object.values(U0(t.getWallets(), At.ETH));
31149
31149
  } else if (e.context === At.SOLANA) {
31150
- const n = (await import("./solana-SQhnN3yB.mjs")).fetchOptions();
31150
+ const n = (await import("./solana-8Asmn6g_.mjs")).fetchOptions();
31151
31151
  return Object.values(U0(n, At.SOLANA));
31152
31152
  } else if (e.context === At.SUI) {
31153
- const n = await (await import("./sui-BePFnRSc.mjs")).fetchOptions();
31153
+ const n = await (await import("./sui-CI_Sn1M4.mjs")).fetchOptions();
31154
31154
  return Object.values(U0(n, At.SUI));
31155
31155
  } else if (e.context === At.APTOS) {
31156
- const n = (await import("./aptos-Dz4Js3_d.mjs")).fetchOptions();
31156
+ const n = (await import("./aptos-CWlICqrN.mjs")).fetchOptions();
31157
31157
  return Object.values(U0(n, At.APTOS));
31158
31158
  }
31159
31159
  return [];
@@ -51579,7 +51579,6 @@ const Cy = T8(
51579
51579
  }, tP = {
51580
51580
  SHUTTLE: 1e4
51581
51581
  }, rP = (e, t) => {
51582
- var E;
51583
51582
  const [n, o] = yt((/* @__PURE__ */ new Date()).valueOf()), c = cn(
51584
51583
  void 0
51585
51584
  ), [i, f] = yt(!1), [u, p] = yt({}), [h, g] = yt(!0);
@@ -51598,7 +51597,7 @@ const Cy = T8(
51598
51597
  t.amount,
51599
51598
  t.sourceToken
51600
51599
  );
51601
- Ht(() => {
51600
+ return Ht(() => {
51602
51601
  if (e.length === 0) return;
51603
51602
  let T = 0;
51604
51603
  if (Object.keys(u).length > 0) {
@@ -51630,7 +51629,9 @@ const Cy = T8(
51630
51629
  return p({}), f(!1), D;
51631
51630
  if (C || !h)
51632
51631
  return D;
51633
- const I = t, L = Object.values(u).filter((j) => j.success);
51632
+ const I = t, L = Object.values(u).filter(
51633
+ (j) => j.success
51634
+ );
51634
51635
  if (L.length > 0) {
51635
51636
  const { sourceToken: j, destinationToken: O } = L[0];
51636
51637
  (!yn(j.token, I.sourceToken) || !yn(O.token, I.destToken)) && p({});
@@ -51645,62 +51646,98 @@ const Cy = T8(
51645
51646
  t.nativeGas,
51646
51647
  t.recipient,
51647
51648
  h
51648
- ]);
51649
- for (const T in u) {
51650
- const D = u[T];
51651
- if (D !== void 0 && D.success) {
51652
- const I = _o(
51653
- x,
51654
- D.destinationToken.amount,
51655
- t.destToken
51656
- );
51657
- if (A && I) {
51658
- const L = I / A;
51659
- A >= 1e3 && L <= 0.9 && delete u[T];
51660
- }
51661
- }
51662
- }
51663
- for (const T in u)
51664
- if (T.startsWith("MayanSwap")) {
51665
- const D = u[T];
51666
- if (D !== void 0 && D.success) {
51667
- const I = tP[(E = D.details) == null ? void 0 : E.type.toUpperCase()];
51668
- if (I && A !== void 0 && A > I)
51669
- u[T] = {
51670
- success: !1,
51671
- error: new Error(`Amount exceeds limit of $${I} USD`)
51672
- };
51673
- else {
51674
- const L = _o(
51675
- x,
51676
- t.amount,
51677
- t.sourceToken
51678
- ), j = _o(
51649
+ ]), {
51650
+ quotes: Ve(() => {
51651
+ var D;
51652
+ let T = Object.assign({}, u);
51653
+ for (const I in T) {
51654
+ const L = T[I];
51655
+ if (L !== void 0 && L.success) {
51656
+ const j = _o(
51679
51657
  x,
51680
- D.destinationToken.amount,
51658
+ L.destinationToken.amount,
51681
51659
  t.destToken
51682
51660
  );
51683
- if (L && j) {
51684
- const O = L - j;
51685
- !isNaN(O) && O > 0 && (u[T].relayFee = {
51686
- token: {
51687
- chain: "Solana",
51688
- address: ir.parseAddress(
51689
- "Solana",
51690
- li.get("Mainnet", "Solana")
51691
- )
51692
- },
51693
- amount: Jc(
51694
- y7(O, 6),
51695
- 6
51696
- )
51697
- });
51661
+ if (A && j) {
51662
+ const O = j / A;
51663
+ A >= 1e3 && O <= 0.9 && delete T[I];
51698
51664
  }
51699
51665
  }
51700
51666
  }
51701
- }
51702
- return {
51703
- quotes: u,
51667
+ for (const I in T)
51668
+ if (I.startsWith("MayanSwap")) {
51669
+ const L = T[I];
51670
+ if (L !== void 0 && L.success) {
51671
+ const j = tP[(D = L.details) == null ? void 0 : D.type.toUpperCase()];
51672
+ if (j && A !== void 0 && A > j)
51673
+ delete T[I], console.warn(
51674
+ `Filtering out ${I} quote which exceeds $${j} USD`
51675
+ );
51676
+ else {
51677
+ const O = _o(
51678
+ x,
51679
+ t.amount,
51680
+ t.sourceToken
51681
+ ), k = _o(
51682
+ x,
51683
+ L.destinationToken.amount,
51684
+ t.destToken
51685
+ );
51686
+ if (O && k) {
51687
+ const B = O - k;
51688
+ !isNaN(B) && B > 0 && (T[I].relayFee = {
51689
+ token: {
51690
+ chain: "Solana",
51691
+ address: ir.parseAddress(
51692
+ "Solana",
51693
+ li.get("Mainnet", "Solana")
51694
+ )
51695
+ },
51696
+ amount: Jc(
51697
+ y7(B, 6),
51698
+ 6
51699
+ )
51700
+ });
51701
+ }
51702
+ }
51703
+ }
51704
+ }
51705
+ if (ge.ui.onlyOfferManualRoutesAsFallback) {
51706
+ let I = !1;
51707
+ const L = {};
51708
+ for (const j in T) {
51709
+ const O = T[j];
51710
+ ge.routes.get(j).AUTOMATIC_DEPOSIT && (I = !0, L[j] = O);
51711
+ }
51712
+ I && (T = L);
51713
+ }
51714
+ if (typeof ge.filterRoutes == "function") {
51715
+ const I = Object.keys(T);
51716
+ try {
51717
+ const L = ge.filterRoutes([...I]);
51718
+ if (Array.isArray(L) && L.every(
51719
+ (j) => typeof j == "string" && I.includes(j)
51720
+ ))
51721
+ for (const j in T)
51722
+ L.includes(j) || delete T[j];
51723
+ else
51724
+ console.warn(
51725
+ "config.filterRoutes returned one or more invalid route names",
51726
+ L,
51727
+ "Falling back to all supported routes",
51728
+ I
51729
+ );
51730
+ } catch (L) {
51731
+ console.warn(
51732
+ "Error when filtering routes",
51733
+ L,
51734
+ "Falling back to all supported routes",
51735
+ I
51736
+ );
51737
+ }
51738
+ }
51739
+ return T;
51740
+ }, [u]),
51704
51741
  isFetchingInitialQuotes: i
51705
51742
  };
51706
51743
  };
@@ -51742,7 +51779,7 @@ const nP = ({
51742
51779
  return (async () => {
51743
51780
  h(!0);
51744
51781
  let C = [];
51745
- if (await ge.routes.forEach(async (A, E) => {
51782
+ await ge.routes.forEach(async (A, E) => {
51746
51783
  if (!E.AUTOMATIC_DEPOSIT && (i == null ? void 0 : i.name) === Da.NAME)
51747
51784
  return;
51748
51785
  let T = !1;
@@ -51768,26 +51805,7 @@ const nP = ({
51768
51805
  E.rc.name.includes("Mayan") && E.rc.name !== "MayanRouteSHUTTLE" && (T = !0), T && C.push(A);
51769
51806
  }), C.includes("ManualTBTC") && (C = C.filter(
51770
51807
  (A) => !["ManualTokenBridge", "AutomaticTokenBridge"].includes(A)
51771
- )), typeof ge.filterRoutes == "function")
51772
- try {
51773
- const A = ge.filterRoutes(C);
51774
- Array.isArray(A) && A.every(
51775
- (E) => typeof E == "string" && C.includes(E)
51776
- ) ? C = A : console.warn(
51777
- "config.filterRoutes returned one or more invalid route names",
51778
- A,
51779
- "Falling back to all supported routes",
51780
- C
51781
- );
51782
- } catch (A) {
51783
- console.warn(
51784
- "Error when filtering routes",
51785
- A,
51786
- "Falling back to all supported routes",
51787
- C
51788
- );
51789
- }
51790
- g && (h(!1), u(C));
51808
+ )), g && (h(!1), u(C));
51791
51809
  })(), () => {
51792
51810
  g = !1;
51793
51811
  };
@@ -56948,7 +56966,7 @@ const aY = Gt()((e) => ({
56948
56966
  return j && yn(j, L) ? 2 : L.isTokenBridgeWrappedToken ? 0 : 1;
56949
56967
  }, C = Ve(() => {
56950
56968
  if (!e.tokenList) return [];
56951
- let L = e.tokenList;
56969
+ const L = e.tokenList;
56952
56970
  if (u) {
56953
56971
  let k = [];
56954
56972
  const B = ge.tokens.get(
@@ -1,6 +1,6 @@
1
- import { q as ot, y as xo } from "./index-pNqQSm4p.mjs";
1
+ import { q as ot, y as xo } from "./index-DiulRNyF.mjs";
2
2
  import { a as Do, d as Z, g as Ow } from "./address-Drr_9OcK.mjs";
3
- import { s as Fo, x as Lh, r as kh, H as Rw, c as zh, q as Ss } from "./evm-DarNu22s.mjs";
3
+ import { s as Fo, x as Lh, r as kh, H as Rw, c as zh, q as Ss } from "./evm-8QrZ2Hru.mjs";
4
4
  import { c as F } from "./index-B1XGfrNH.mjs";
5
5
  import { I as ur, f as gt, t as nt, c as $u, C as $w, d as Cw, r as Nw, a as xr, g as Hh, i as bt, b as Cs, e as Cu, h as Tw, j as Aw, k as Ns, p as Vh, T as Ts, l as As, E as ke, m as xw, y as Qe, P as Nu, Q as Dw, n as Fw, o as qo, q as xs, s as Bt, _ as qw, u as jw, v as Tu } from "./index-DSSOE7Me.mjs";
6
6
  import { o as Au } from "./browser-ponyfill-oWZrCgRw.mjs";
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Fe=require("./index-Bn1o04G7.js"),Y=require("./address-RcMobNYE.js"),He=require("./evm-1T5rGzcO.js"),j=require("./index-Bogu114a.js"),E=require("./index-BL4H4RbP.js"),pu=require("./browser-ponyfill-BAEAyXvw.js");var ne={};Object.defineProperty(ne,"__esModule",{value:!0});ne.getLocalStorage=ne.getLocalStorageOrThrow=ne.getCrypto=ne.getCryptoOrThrow=ne.getLocation=ne.getLocationOrThrow=ne.getNavigator=ne.getNavigatorOrThrow=ne.getDocument=ne.getDocumentOrThrow=ne.getFromWindowOrThrow=ne.getFromWindow=void 0;function nr(a){let t;return typeof window<"u"&&typeof window[a]<"u"&&(t=window[a]),t}ne.getFromWindow=nr;function $r(a){const t=nr(a);if(!t)throw new Error(`${a} is not defined in Window`);return t}ne.getFromWindowOrThrow=$r;function iw(){return $r("document")}ne.getDocumentOrThrow=iw;function sw(){return nr("document")}ne.getDocument=sw;function nw(){return $r("navigator")}ne.getNavigatorOrThrow=nw;function ow(){return nr("navigator")}ne.getNavigator=ow;function aw(){return $r("location")}ne.getLocationOrThrow=aw;function cw(){return nr("location")}ne.getLocation=cw;function uw(){return $r("crypto")}ne.getCryptoOrThrow=uw;function hw(){return nr("crypto")}ne.getCrypto=hw;function lw(){return $r("localStorage")}ne.getLocalStorageOrThrow=lw;function pw(){return nr("localStorage")}ne.getLocalStorage=pw;var Eo={};Object.defineProperty(Eo,"__esModule",{value:!0});Eo.getWindowMetadata=void 0;const fu=ne;function fw(){let a,t;try{a=fu.getDocumentOrThrow(),t=fu.getLocationOrThrow()}catch{return null}function r(){const O=a.getElementsByTagName("link"),N=[];for(let q=0;q<O.length;q++){const x=O[q],K=x.getAttribute("rel");if(K&&K.toLowerCase().indexOf("icon")>-1){const D=x.getAttribute("href");if(D)if(D.toLowerCase().indexOf("https:")===-1&&D.toLowerCase().indexOf("http:")===-1&&D.indexOf("//")!==0){let G=t.protocol+"//"+t.host;if(D.indexOf("/")===0)G+=D;else{const fe=t.pathname.split("/");fe.pop();const Z=fe.join("/");G+=Z+"/"+D}N.push(G)}else if(D.indexOf("//")===0){const G=t.protocol+D;N.push(G)}else N.push(D)}}return N}function s(...O){const N=a.getElementsByTagName("meta");for(let q=0;q<N.length;q++){const x=N[q],K=["itemprop","property","name"].map(D=>x.getAttribute(D)).filter(D=>D?O.includes(D):!1);if(K.length&&K){const D=x.getAttribute("content");if(D)return D}}return""}function o(){let O=s("name","og:site_name","og:title","twitter:title");return O||(O=a.title),O}function u(){return s("description","og:description","twitter:description","keywords")}const l=o(),g=u(),w=t.origin,b=r();return{description:g,url:w,icons:b,name:l}}Eo.getWindowMetadata=fw;function dw(a,t=[]){const r=[];return Object.keys(a).forEach(s=>{if(t.length&&!t.includes(s))return;const o=a[s];r.push(...o.accounts)}),r}const gw={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}};function yw(a,t){const{message:r,code:s}=gw[a];return{message:r,code:s}}function uo(a,t){return!!Array.isArray(a)}var Tr={};/*! *****************************************************************************
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Fe=require("./index-Bn2HXKJ4.js"),Y=require("./address-RcMobNYE.js"),He=require("./evm-NSPNbX19.js"),j=require("./index-Bogu114a.js"),E=require("./index-BL4H4RbP.js"),pu=require("./browser-ponyfill-BAEAyXvw.js");var ne={};Object.defineProperty(ne,"__esModule",{value:!0});ne.getLocalStorage=ne.getLocalStorageOrThrow=ne.getCrypto=ne.getCryptoOrThrow=ne.getLocation=ne.getLocationOrThrow=ne.getNavigator=ne.getNavigatorOrThrow=ne.getDocument=ne.getDocumentOrThrow=ne.getFromWindowOrThrow=ne.getFromWindow=void 0;function nr(a){let t;return typeof window<"u"&&typeof window[a]<"u"&&(t=window[a]),t}ne.getFromWindow=nr;function $r(a){const t=nr(a);if(!t)throw new Error(`${a} is not defined in Window`);return t}ne.getFromWindowOrThrow=$r;function iw(){return $r("document")}ne.getDocumentOrThrow=iw;function sw(){return nr("document")}ne.getDocument=sw;function nw(){return $r("navigator")}ne.getNavigatorOrThrow=nw;function ow(){return nr("navigator")}ne.getNavigator=ow;function aw(){return $r("location")}ne.getLocationOrThrow=aw;function cw(){return nr("location")}ne.getLocation=cw;function uw(){return $r("crypto")}ne.getCryptoOrThrow=uw;function hw(){return nr("crypto")}ne.getCrypto=hw;function lw(){return $r("localStorage")}ne.getLocalStorageOrThrow=lw;function pw(){return nr("localStorage")}ne.getLocalStorage=pw;var Eo={};Object.defineProperty(Eo,"__esModule",{value:!0});Eo.getWindowMetadata=void 0;const fu=ne;function fw(){let a,t;try{a=fu.getDocumentOrThrow(),t=fu.getLocationOrThrow()}catch{return null}function r(){const O=a.getElementsByTagName("link"),N=[];for(let q=0;q<O.length;q++){const x=O[q],K=x.getAttribute("rel");if(K&&K.toLowerCase().indexOf("icon")>-1){const D=x.getAttribute("href");if(D)if(D.toLowerCase().indexOf("https:")===-1&&D.toLowerCase().indexOf("http:")===-1&&D.indexOf("//")!==0){let G=t.protocol+"//"+t.host;if(D.indexOf("/")===0)G+=D;else{const fe=t.pathname.split("/");fe.pop();const Z=fe.join("/");G+=Z+"/"+D}N.push(G)}else if(D.indexOf("//")===0){const G=t.protocol+D;N.push(G)}else N.push(D)}}return N}function s(...O){const N=a.getElementsByTagName("meta");for(let q=0;q<N.length;q++){const x=N[q],K=["itemprop","property","name"].map(D=>x.getAttribute(D)).filter(D=>D?O.includes(D):!1);if(K.length&&K){const D=x.getAttribute("content");if(D)return D}}return""}function o(){let O=s("name","og:site_name","og:title","twitter:title");return O||(O=a.title),O}function u(){return s("description","og:description","twitter:description","keywords")}const l=o(),g=u(),w=t.origin,b=r();return{description:g,url:w,icons:b,name:l}}Eo.getWindowMetadata=fw;function dw(a,t=[]){const r=[];return Object.keys(a).forEach(s=>{if(t.length&&!t.includes(s))return;const o=a[s];r.push(...o.accounts)}),r}const gw={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}};function yw(a,t){const{message:r,code:s}=gw[a];return{message:r,code:s}}function uo(a,t){return!!Array.isArray(a)}var Tr={};/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const R=require("./index-Bn1o04G7.js");exports.AutomaticCCTPRoute=R.AutomaticCCTPRoute;exports.AutomaticPorticoRoute=R.AutomaticPorticoRoute;exports.AutomaticTokenBridgeRoute=R.AutomaticTokenBridgeRoute;exports.CCTPRoute=R.CCTPRoute;exports.DEFAULT_ROUTES=R.DEFAULT_ROUTES;exports.ERR_AMOUNT_TOO_LARGE=R.ERR_AMOUNT_TOO_LARGE;exports.ERR_AMOUNT_TOO_SMALL=R.ERR_AMOUNT_TOO_SMALL;exports.ERR_DESTINATION_CONTRACT_PAUSED=R.ERR_DESTINATION_CONTRACT_PAUSED;exports.ERR_INSUFFICIENT_ALLOWANCE=R.ERR_INSUFFICIENT_ALLOWANCE;exports.ERR_INSUFFICIENT_GAS=R.ERR_INSUFFICIENT_GAS;exports.ERR_NOT_ENOUGH_CAPACITY=R.ERR_NOT_ENOUGH_CAPACITY;exports.ERR_RELAY_FAILED=R.ERR_RELAY_FAILED;exports.ERR_SOURCE_CONTRACT_PAUSED=R.ERR_SOURCE_CONTRACT_PAUSED;exports.ERR_TIMEOUT=R.ERR_TIMEOUT;exports.ERR_UNKNOWN=R.ERR_UNKNOWN;exports.ERR_UNSUPPORTED_ABI_VERSION=R.ERR_UNSUPPORTED_ABI_VERSION;exports.ERR_USER_REJECTED=R.ERR_USER_REJECTED;exports.MAINNET=R.MAINNET;exports.TESTNET=R.TESTNET;exports.Token=R.Token;exports.TokenBridgeRoute=R.TokenBridgeRoute;exports.buildConfig=R.buildConfig;exports.config=R.types;exports.default=R.WormholeConnect;exports.getTokenDetails=R.getTokenDetails;exports.getTransferDetails=R.getTransferDetails;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const R=require("./index-Bn2HXKJ4.js");exports.AutomaticCCTPRoute=R.AutomaticCCTPRoute;exports.AutomaticPorticoRoute=R.AutomaticPorticoRoute;exports.AutomaticTokenBridgeRoute=R.AutomaticTokenBridgeRoute;exports.CCTPRoute=R.CCTPRoute;exports.DEFAULT_ROUTES=R.DEFAULT_ROUTES;exports.ERR_AMOUNT_TOO_LARGE=R.ERR_AMOUNT_TOO_LARGE;exports.ERR_AMOUNT_TOO_SMALL=R.ERR_AMOUNT_TOO_SMALL;exports.ERR_DESTINATION_CONTRACT_PAUSED=R.ERR_DESTINATION_CONTRACT_PAUSED;exports.ERR_INSUFFICIENT_ALLOWANCE=R.ERR_INSUFFICIENT_ALLOWANCE;exports.ERR_INSUFFICIENT_GAS=R.ERR_INSUFFICIENT_GAS;exports.ERR_NOT_ENOUGH_CAPACITY=R.ERR_NOT_ENOUGH_CAPACITY;exports.ERR_RELAY_FAILED=R.ERR_RELAY_FAILED;exports.ERR_SOURCE_CONTRACT_PAUSED=R.ERR_SOURCE_CONTRACT_PAUSED;exports.ERR_TIMEOUT=R.ERR_TIMEOUT;exports.ERR_UNKNOWN=R.ERR_UNKNOWN;exports.ERR_UNSUPPORTED_ABI_VERSION=R.ERR_UNSUPPORTED_ABI_VERSION;exports.ERR_USER_REJECTED=R.ERR_USER_REJECTED;exports.MAINNET=R.MAINNET;exports.TESTNET=R.TESTNET;exports.Token=R.Token;exports.TokenBridgeRoute=R.TokenBridgeRoute;exports.buildConfig=R.buildConfig;exports.config=R.types;exports.default=R.WormholeConnect;exports.getTokenDetails=R.getTokenDetails;exports.getTransferDetails=R.getTransferDetails;
package/lib/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { K as E, O as T, I as _, L as s, H as A, $ as N, a0 as O, Y as e, U as o, _ as t, V as C, a4 as U, X as I, a2 as S, a3 as i, Z as u, a1 as D, M as L, T as P, G as n, J as r, F, P as g, E as M, Q as c, R as f } from "./index-pNqQSm4p.mjs";
1
+ import { K as E, O as T, I as _, L as s, H as A, $ as N, a0 as O, Y as e, U as o, _ as t, V as C, a4 as U, X as I, a2 as S, a3 as i, Z as u, a1 as D, M as L, T as P, G as n, J as r, F, P as g, E as M, Q as c, R as f } from "./index-DiulRNyF.mjs";
2
2
  export {
3
3
  E as AutomaticCCTPRoute,
4
4
  T as AutomaticPorticoRoute,
@@ -1,5 +1,5 @@
1
1
  import { g as Zt, ae as O, bR as st, aC as It, b2 as ht, aZ as Yt, am as Nt, b0 as Qt, ad as St, bS as Ut } from "./address-Drr_9OcK.mjs";
2
- import { W as kt, f as wt, c as dt, B as $, s as Dt, e as Z, h as Wt } from "./index-pNqQSm4p.mjs";
2
+ import { W as kt, f as wt, c as dt, B as $, s as Dt, e as Z, h as Wt } from "./index-DiulRNyF.mjs";
3
3
  import { a as Gt } from "./util--bw7gFPs.mjs";
4
4
  import { g as _t } from "./wallets-B2tqS5lZ.mjs";
5
5
  import { i as ct } from "./unsignedTransaction-fSrwDjHx.mjs";
@@ -771,7 +771,7 @@ class oe extends q {
771
771
  this._connecting = !0;
772
772
  let e;
773
773
  try {
774
- e = (await import("./solanaEmbed.esm-Din0Z51P.mjs")).default;
774
+ e = (await import("./solanaEmbed.esm-Bv-y4R2t.mjs")).default;
775
775
  } catch (a) {
776
776
  throw new Et(a == null ? void 0 : a.message, a);
777
777
  }
@@ -927,7 +927,7 @@ class ge extends gt {
927
927
  this._connecting = !0;
928
928
  let e, t;
929
929
  try {
930
- ({ WalletConnectWallet: e, WalletConnectChainID: t } = await import("./index-Cda4HnP1.mjs"));
930
+ ({ WalletConnectWallet: e, WalletConnectChainID: t } = await import("./index-BAHgvqy3.mjs"));
931
931
  } catch (a) {
932
932
  throw new Et(a == null ? void 0 : a.message, a);
933
933
  }