@initia/interwovenkit-react 2.11.0 → 2.11.1

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.
package/dist/index.js CHANGED
@@ -678,7 +678,7 @@ function Yi() {
678
678
  let { routerApiUrl: e } = H();
679
679
  return I(() => P.create({
680
680
  prefixUrl: e,
681
- headers: { "InterwovenKit-Version": "2.11.0" }
681
+ headers: { "InterwovenKit-Version": "2.11.1" }
682
682
  }), [e]);
683
683
  }
684
684
  //#endregion
@@ -1763,6 +1763,7 @@ function ys(e, t, n, r, i, a, o) {
1763
1763
  return new ms(e, t, n, r, i, a, o);
1764
1764
  }
1765
1765
  async function bs(e, t, n) {
1766
+ if (e instanceof ms) return e;
1766
1767
  if (!t.metadata?.is_l1 && t.metadata?.minitia?.type !== "minimove") return await Ir(e);
1767
1768
  let r = _s(e.message);
1768
1769
  if (!r) return await Ir(e);
@@ -1941,6 +1942,7 @@ async function Vs({ address: e, chainId: t, messages: n, memo: r, fee: i, prefer
1941
1942
  client: e
1942
1943
  });
1943
1944
  } catch (e) {
1945
+ if (e instanceof Error && _s(e.message)) throw await l.formatError(t, e);
1944
1946
  return d("fee_computation_failed", e), u();
1945
1947
  }
1946
1948
  try {
@@ -1950,28 +1952,28 @@ async function Vs({ address: e, chainId: t, messages: n, memo: r, fee: i, prefer
1950
1952
  }
1951
1953
  }
1952
1954
  function Hs() {
1953
- let e = K(), { autoSignFeePolicy: t } = H(), n = Gr(), r = Ho(), i = Uo(), a = jo(), o = ns(), { getWallet: s, deriveWallet: c, getWalletPrivateKey: l } = lo(), u = Fo(), d = Ta(), f = (e) => {
1955
+ let e = K(), { autoSignFeePolicy: t, registryUrl: n } = H(), r = Gr(), i = Ho(), a = Uo(), o = jo(), s = ns(), { getWallet: c, deriveWallet: l, getWalletPrivateKey: u } = lo(), d = Fo(), f = Ta(), p = (e) => {
1954
1956
  let n = t?.[e];
1955
1957
  return {
1956
1958
  gasMultiplier: n?.gasMultiplier ?? Ns,
1957
1959
  maxGasMultiplierFromSim: n?.maxGasMultiplierFromSim ?? Ps,
1958
1960
  allowedFeeDenoms: n?.allowedFeeDenoms
1959
1961
  };
1960
- }, p = async ({ chainId: e, messages: t, memo: i, derivedWallet: o, preferredFeeDenom: s, fallbackFeeDenom: c, client: l }) => {
1961
- let u = await Ds(n(e)), d = Ls({
1962
- derivedAddress: o.address,
1962
+ }, m = async ({ chainId: e, messages: t, memo: n, derivedWallet: a, preferredFeeDenom: s, fallbackFeeDenom: c, client: l }) => {
1963
+ let u = await Ds(r(e)), d = Ls({
1964
+ derivedAddress: a.address,
1963
1965
  messages: t,
1964
- encoder: a
1965
- }).messages.map((e) => a.encodeAsAny(e)), p = Oa(ka(o.publicKey)), { sequence: m } = await Lo({
1966
+ encoder: o
1967
+ }).messages.map((e) => o.encodeAsAny(e)), f = Oa(ka(a.publicKey)), { sequence: m } = await Lo({
1966
1968
  getSequence: (e) => l.getSequence(e),
1967
- signerAddress: o.address,
1969
+ signerAddress: a.address,
1968
1970
  incrementSequence: 0,
1969
1971
  allowMissingAccount: !0
1970
- }), h = await r(e), { gasInfo: g } = await zs({
1972
+ }), h = await i(e), { gasInfo: g } = await zs({
1971
1973
  queryClient: Dt.withExtensions(h, Mt),
1972
1974
  messages: d,
1973
- memo: i,
1974
- pubkey: p,
1975
+ memo: n,
1976
+ pubkey: f,
1975
1977
  sequence: m
1976
1978
  });
1977
1979
  return Is({
@@ -1979,12 +1981,12 @@ function Hs() {
1979
1981
  gasPrices: u,
1980
1982
  preferredFeeDenom: s,
1981
1983
  fallbackFeeDenom: c,
1982
- policy: f(e)
1984
+ policy: p(e)
1983
1985
  });
1984
- }, m = async (e, t, n, r, i, o) => {
1985
- let d = o ?? s(e);
1986
- d ||= await c(e);
1987
- let f = l(e);
1986
+ }, h = async (e, t, n, r, i, a) => {
1987
+ let s = a ?? c(e);
1988
+ s ||= await l(e);
1989
+ let f = u(e);
1988
1990
  if (!f) throw Error("Derived wallet key not initialized");
1989
1991
  return await fo({
1990
1992
  chainId: e,
@@ -1992,25 +1994,26 @@ function Hs() {
1992
1994
  messages: n,
1993
1995
  fee: r,
1994
1996
  memo: i,
1995
- derivedWallet: d,
1997
+ derivedWallet: s,
1996
1998
  privateKey: f,
1997
- encoder: a,
1998
- signWithEthSecp256k1: u
1999
+ encoder: o,
2000
+ signWithEthSecp256k1: d
1999
2001
  });
2000
2002
  };
2001
2003
  return (t) => Vs({
2002
2004
  ...t,
2003
2005
  address: e
2004
2006
  }, {
2005
- validateAutoSign: o,
2006
- getWallet: s,
2007
- deriveWallet: c,
2008
- getSigningClient: i,
2009
- computeAutoSignFee: p,
2010
- signWithDerivedWallet: m,
2011
- signWithEthSecp256k1: u,
2007
+ validateAutoSign: s,
2008
+ getWallet: c,
2009
+ deriveWallet: l,
2010
+ getSigningClient: a,
2011
+ computeAutoSignFee: m,
2012
+ signWithDerivedWallet: h,
2013
+ signWithEthSecp256k1: d,
2014
+ formatError: (e, t) => bs(t, r(e), n),
2012
2015
  onAutoSignFallback: ({ chainId: e, reason: t, errorMessage: n }) => {
2013
- d("AutoSign Fallback", {
2016
+ f("AutoSign Fallback", {
2014
2017
  chainId: e,
2015
2018
  reason: t,
2016
2019
  errorMessage: n
@@ -4138,9 +4141,9 @@ var Nu = {
4138
4141
  }, Pu = Re(0), Fu = 1e3, Iu = 0;
4139
4142
  function Lu() {
4140
4143
  let e = Ve(Pu);
4141
- F(() => {
4142
- let t = Date.now();
4143
- t - Iu >= Fu && (Iu = t, e((e) => e + 1));
4144
+ return we((t) => {
4145
+ let n = Date.now();
4146
+ (t?.force || n - Iu >= Fu) && (Iu = n, e((e) => e + 1));
4144
4147
  }, [e]);
4145
4148
  }
4146
4149
  function Ru() {
@@ -4470,17 +4473,19 @@ var gd = { link: "_link_j1lkz_1" }, _d = ({ chainId: e, txHash: t, accountAddres
4470
4473
  children: f
4471
4474
  });
4472
4475
  }, vd = xe(null), yd = () => Te(vd), bd = () => {
4473
- let [e, t] = ze(Ms), { showNotification: n, updateNotification: r, hideNotification: i } = yd();
4476
+ let [e, t] = ze(Ms), { showNotification: n, updateNotification: r, hideNotification: i } = yd(), a = g(), o = Lu();
4474
4477
  return F(() => {
4475
4478
  if (!e) return;
4476
- let { status: a, chainId: o, txHash: s, error: c } = e, l = c ? c.message : s ? /* @__PURE__ */ z(_d, {
4477
- txHash: s,
4478
- chainId: o,
4479
+ let { status: s, chainId: c, txHash: l, error: u } = e, d = u ? u.message : l ? /* @__PURE__ */ z(_d, {
4480
+ txHash: l,
4481
+ chainId: c,
4479
4482
  onClick: i,
4480
4483
  showIcon: !0,
4481
4484
  children: "View on Initia Scan"
4482
- }) : null;
4483
- switch (a) {
4485
+ }) : null, f = () => {
4486
+ a.invalidateQueries({ queryKey: Ei.balances._def }), o({ force: !0 }), t(null);
4487
+ };
4488
+ switch (s) {
4484
4489
  case "loading":
4485
4490
  n({
4486
4491
  type: "loading",
@@ -4491,16 +4496,16 @@ var gd = { link: "_link_j1lkz_1" }, _d = ({ chainId: e, txHash: t, accountAddres
4491
4496
  r({
4492
4497
  type: "error",
4493
4498
  title: "Transaction failed",
4494
- description: l
4495
- }), t(null);
4499
+ description: d
4500
+ }), f();
4496
4501
  break;
4497
4502
  case "success":
4498
4503
  r({
4499
4504
  type: "success",
4500
4505
  title: "Transaction is successful!",
4501
- description: l,
4506
+ description: d,
4502
4507
  autoHide: !0
4503
- }), t(null);
4508
+ }), f();
4504
4509
  break;
4505
4510
  }
4506
4511
  }, [
@@ -4508,7 +4513,9 @@ var gd = { link: "_link_j1lkz_1" }, _d = ({ chainId: e, txHash: t, accountAddres
4508
4513
  t,
4509
4514
  n,
4510
4515
  r,
4511
- i
4516
+ i,
4517
+ a,
4518
+ o
4512
4519
  ]), null;
4513
4520
  }, xd = ({ value: e, children: t }) => {
4514
4521
  let [n, r] = L(!1);
@@ -4672,6 +4679,7 @@ var wd = {
4672
4679
  })
4673
4680
  }), /* @__PURE__ */ z(xn.Popup, {
4674
4681
  className: Ed.content,
4682
+ "aria-label": "Initia wallet",
4675
4683
  children: /* @__PURE__ */ B("div", {
4676
4684
  className: V(Ed.inner, "body"),
4677
4685
  ref: i,
@@ -4716,6 +4724,7 @@ var wd = {
4716
4724
  }), /* @__PURE__ */ B(xn.Popup, {
4717
4725
  className: Od.modal,
4718
4726
  ref: i,
4727
+ "aria-label": "Initia wallet",
4719
4728
  children: [/* @__PURE__ */ z("button", {
4720
4729
  className: Od.closeButton,
4721
4730
  onClick: n,
@@ -6254,7 +6263,8 @@ var yp = {
6254
6263
  decimals: t
6255
6264
  }) ? "Insufficient balance" : !0;
6256
6265
  }
6257
- }
6266
+ },
6267
+ "aria-label": "Amount"
6258
6268
  });
6259
6269
  };
6260
6270
  xp.ReadOnly = bp;
@@ -7109,7 +7119,8 @@ var lm = {
7109
7119
  dp: 2,
7110
7120
  onFocus: d,
7111
7121
  placeholder: "",
7112
- className: V(lm.preset, lm.active)
7122
+ className: V(lm.preset, lm.active),
7123
+ "aria-label": "Slippage percent"
7113
7124
  }), /* @__PURE__ */ z("span", {
7114
7125
  className: lm.percent,
7115
7126
  children: "%"
@@ -8566,6 +8577,7 @@ var Th = {
8566
8577
  label: n,
8567
8578
  children: /* @__PURE__ */ z("button", {
8568
8579
  className: Th.type,
8580
+ "aria-label": n,
8569
8581
  children: /* @__PURE__ */ z(Cn, { size: 12 })
8570
8582
  })
8571
8583
  }) : /* @__PURE__ */ z("span", {
@@ -8761,19 +8773,25 @@ var Ah = ({ addressList: e }) => {
8761
8773
  }, Mh = ({ children: e }) => {
8762
8774
  let { route: t, values: n } = Km(), { required_chain_addresses: r } = t, { srcChainId: i, dstChainId: a, sender: o, recipient: s } = n, { initiaAddress: c, hexAddress: l } = vc(), u = Ro(), d = Uf(), f = Bf(), p = f(d(i)), m = r.slice(0, -1).some((e) => f(d(e)) === "cosmos") && p !== "cosmos", [h, g] = L(void 0), [_, v] = L(!1), [y, x] = L(null);
8763
8775
  return F(() => {
8764
- (async () => {
8776
+ let e = !1;
8777
+ return (async () => {
8765
8778
  try {
8766
- if (!m) return;
8779
+ if (g(void 0), x(null), !m) return;
8767
8780
  if (!u) throw Error("Wallet not connected");
8768
- v(!0), x(null);
8769
- let [{ pubkey: e }] = await u.getAccounts();
8770
- g(e);
8771
- } catch (e) {
8772
- x(await Ir(e));
8781
+ v(!0);
8782
+ let [{ pubkey: t }] = await u.getAccounts();
8783
+ if (e) return;
8784
+ g(t);
8785
+ } catch (t) {
8786
+ let n = await Ir(t);
8787
+ if (e) return;
8788
+ x(n);
8773
8789
  } finally {
8774
- v(!1);
8790
+ e || v(!1);
8775
8791
  }
8776
- })();
8792
+ })(), () => {
8793
+ e = !0;
8794
+ };
8777
8795
  }, [m, u]), y ? /* @__PURE__ */ z(jh, { error: y }) : _ ? /* @__PURE__ */ z(Qu, { children: /* @__PURE__ */ z(q.White, { loading: _ && "Generating intermediary addresses..." }) }) : !m || h ? e(r.map((e, t) => {
8778
8796
  if (t === r.length - 1) return f(d(a)) === "initia" ? b(s).bech32 : s;
8779
8797
  let n = d(e), u = f(n), p = f(d(i));
@@ -9005,8 +9023,9 @@ var Wh = ({ addressList: e, signedOpHook: t, children: n }) => {
9005
9023
  let [s] = o;
9006
9024
  c(s);
9007
9025
  } catch (e) {
9026
+ let t = await Ir(e);
9008
9027
  if (n) return;
9009
- f(await Ir(e));
9028
+ f(t);
9010
9029
  } finally {
9011
9030
  n || u(!1);
9012
9031
  }
@@ -13389,7 +13408,7 @@ var nx = { countdown: "_countdown_vfms8_1" }, rx = ({ expiration: e }) => {
13389
13408
  });
13390
13409
  }, lx = { version: "_version_1sf5y_1" }, ux = () => /* @__PURE__ */ B("aside", {
13391
13410
  className: lx.version,
13392
- children: ["v", "2.11.0"]
13411
+ children: ["v", "2.11.1"]
13393
13412
  }), dx = {
13394
13413
  link: "_link_se23z_1",
13395
13414
  title: "_title_se23z_17",
@@ -15729,12 +15748,16 @@ var AS = ({ position: e }) => {
15729
15748
  children: Y(n)
15730
15749
  });
15731
15750
  }, rC = () => {
15732
- dp(), Lu();
15733
- let e = ku(), t = Hi(), n = zi(), r = ke(null);
15751
+ dp();
15752
+ let e = Lu();
15753
+ F(() => {
15754
+ e();
15755
+ }, [e]);
15756
+ let t = ku(), n = Hi(), r = zi(), i = ke(null);
15734
15757
  return /* @__PURE__ */ z(Zx.Provider, {
15735
- value: r,
15758
+ value: i,
15736
15759
  children: /* @__PURE__ */ B(ed, {
15737
- ref: r,
15760
+ ref: i,
15738
15761
  children: [
15739
15762
  /* @__PURE__ */ B("div", {
15740
15763
  className: eC.totalValue,
@@ -15749,7 +15772,7 @@ var AS = ({ position: e }) => {
15749
15772
  width: 120
15750
15773
  })
15751
15774
  }),
15752
- children: z(e ? tC : nC, {})
15775
+ children: z(t ? tC : nC, {})
15753
15776
  })]
15754
15777
  }),
15755
15778
  /* @__PURE__ */ B("nav", {
@@ -15774,8 +15797,8 @@ var AS = ({ position: e }) => {
15774
15797
  ]
15775
15798
  }),
15776
15799
  /* @__PURE__ */ B(yr.Root, {
15777
- value: n,
15778
- onValueChange: t,
15800
+ value: r,
15801
+ onValueChange: n,
15779
15802
  children: [
15780
15803
  /* @__PURE__ */ B(yr.List, {
15781
15804
  className: eC.tabs,
@@ -15783,7 +15806,7 @@ var AS = ({ position: e }) => {
15783
15806
  /* @__PURE__ */ z(yr.Tab, {
15784
15807
  className: eC.tab,
15785
15808
  value: "/",
15786
- children: e ? "Assets" : "Portfolio"
15809
+ children: t ? "Assets" : "Portfolio"
15787
15810
  }),
15788
15811
  /* @__PURE__ */ z(yr.Tab, {
15789
15812
  className: eC.tab,
@@ -15799,7 +15822,7 @@ var AS = ({ position: e }) => {
15799
15822
  }),
15800
15823
  /* @__PURE__ */ z(yr.Panel, {
15801
15824
  value: "/",
15802
- children: z(e ? lS : $S, {})
15825
+ children: z(t ? lS : $S, {})
15803
15826
  }),
15804
15827
  /* @__PURE__ */ z(yr.Panel, {
15805
15828
  value: "/nfts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@initia/interwovenkit-react",
3
- "version": "2.11.0",
3
+ "version": "2.11.1",
4
4
  "description": "Connect dApps to Initia and Interwoven Rollups",
5
5
  "author": "Initia (https://initia.xyz)",
6
6
  "repository": {