@gardenfi/core 2.5.3-beta.13 → 2.5.3-beta.15

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.
@@ -5,8 +5,8 @@ var Sp = (t) => {
5
5
  var y6 = (t, e, r) => e in t ? p6(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
6
6
  var Ap = (t, e, r) => y6(t, typeof e != "symbol" ? e + "" : e, r), xp = (t, e, r) => e.has(t) || Sp("Cannot " + r);
7
7
  var Oe = (t, e, r) => (xp(t, e, "read from private field"), r ? r.call(t) : e.get(t)), vs = (t, e, r) => e.has(t) ? Sp("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), Es = (t, e, r, n) => (xp(t, e, "write to private field"), n ? n.call(t, r) : e.set(t, r), r);
8
- import { ChainAsset as Ct, Assets as m6, BlockchainType as Ze, isOrder as b6, isBitcoin as ki, ArbitrumLocalnet as g6, EthereumLocalnet as w6, isEvmOrderResponse as Um, isEVM as v6, isEvmNativeToken as E6, isStarknetOrderResponse as Mm, isSolanaOrderResponse as Fm, isSolanaNativeToken as S6, isSuiOrderResponse as jm, OrderStatus as di, isCompleted as A6, parseAction as x6, OrderAction as lt, getBlockchainType as k6, OrderLifecycle as _6, Orderbook as T6 } from "@gardenfi/orderbook";
9
- import { Network as et, Environment as kp, Ok as ne, Err as C, Fetcher as Fe, trim0x as at, Url as Or, EventBroker as Lm, with0x as Ye, checkAllowanceAndApprove as P6, waitForTransactionReceipt as Fu, sleep as ju, hexToU32Array as Tc, DigestKey as I6, ApiKey as O6, hasKeys as B6 } from "@gardenfi/utils";
8
+ import { ChainAsset as Ct, Assets as m6, BlockchainType as Ye, isOrder as b6, isBitcoin as ki, ArbitrumLocalnet as g6, EthereumLocalnet as w6, isEvmOrderResponse as Um, isEVM as v6, isEvmNativeToken as E6, isStarknetOrderResponse as Mm, isSolanaOrderResponse as Fm, isSolanaNativeToken as S6, isSuiOrderResponse as jm, OrderStatus as di, isCompleted as A6, parseAction as x6, OrderAction as lt, getBlockchainType as k6, OrderLifecycle as _6, Orderbook as T6 } from "@gardenfi/orderbook";
9
+ import { Network as et, Environment as kp, Ok as ne, Err as C, Fetcher as Fe, trim0x as at, Url as Or, EventBroker as Lm, with0x as Le, checkAllowanceAndApprove as P6, waitForTransactionReceipt as Fu, sleep as ju, hexToU32Array as Tc, DigestKey as I6, ApiKey as O6, hasKeys as B6 } from "@gardenfi/utils";
10
10
  import * as Se from "bitcoinjs-lib";
11
11
  import { crypto as C6, Transaction as Wr, script as $s, payments as Jr, address as Po, networks as Lu, Psbt as _p, initEccLib as $6 } from "bitcoinjs-lib";
12
12
  import * as hr from "tiny-secp256k1";
@@ -624,7 +624,7 @@ function Ov(t, { includeName: e }) {
624
624
  function sn(t, { strict: e = !0 } = {}) {
625
625
  return !t || typeof t != "string" ? !1 : e ? /^0x[0-9a-fA-F]*$/.test(t) : t.startsWith("0x");
626
626
  }
627
- function De(t) {
627
+ function He(t) {
628
628
  return sn(t, { strict: !1 }) ? Math.ceil((t.length - 2) / 2) : t.length;
629
629
  }
630
630
  const rb = "2.37.8";
@@ -755,7 +755,7 @@ class Cv extends D {
755
755
  }
756
756
  class $v extends D {
757
757
  constructor({ expectedSize: e, value: r }) {
758
- super(`Size of bytes "${r}" (bytes${De(r)}) does not match expected size (bytes${e}).`, { name: "AbiEncodingBytesSizeMismatchError" });
758
+ super(`Size of bytes "${r}" (bytes${He(r)}) does not match expected size (bytes${e}).`, { name: "AbiEncodingBytesSizeMismatchError" });
759
759
  }
760
760
  }
761
761
  class Rv extends D {
@@ -1065,9 +1065,9 @@ function pr(t, { dir: e = "left" } = {}) {
1065
1065
  return r = e === "left" ? r.slice(n) : r.slice(0, r.length - n), typeof t == "string" ? (r.length === 1 && e === "right" && (r = `${r}0`), `0x${r.length % 2 === 1 ? `0${r}` : r}`) : r;
1066
1066
  }
1067
1067
  function Nr(t, { size: e }) {
1068
- if (De(t) > e)
1068
+ if (He(t) > e)
1069
1069
  throw new Wv({
1070
- givenSize: De(t),
1070
+ givenSize: He(t),
1071
1071
  maxSize: e
1072
1072
  });
1073
1073
  }
@@ -1509,19 +1509,19 @@ function Hs(t, e, r, { strict: n } = {}) {
1509
1509
  });
1510
1510
  }
1511
1511
  function Tb(t, e) {
1512
- if (typeof e == "number" && e > 0 && e > De(t) - 1)
1512
+ if (typeof e == "number" && e > 0 && e > He(t) - 1)
1513
1513
  throw new ub({
1514
1514
  offset: e,
1515
1515
  position: "start",
1516
- size: De(t)
1516
+ size: He(t)
1517
1517
  });
1518
1518
  }
1519
1519
  function Pb(t, e, r) {
1520
- if (typeof e == "number" && typeof r == "number" && De(t) !== r - e)
1520
+ if (typeof e == "number" && typeof r == "number" && He(t) !== r - e)
1521
1521
  throw new ub({
1522
1522
  offset: r,
1523
1523
  position: "end",
1524
- size: De(t)
1524
+ size: He(t)
1525
1525
  });
1526
1526
  }
1527
1527
  function Ib(t, e, r, { strict: n } = {}) {
@@ -1586,13 +1586,13 @@ function Qd(t) {
1586
1586
  let e = 0;
1587
1587
  for (let i = 0; i < t.length; i++) {
1588
1588
  const { dynamic: o, encoded: a } = t[i];
1589
- o ? e += 32 : e += De(a);
1589
+ o ? e += 32 : e += He(a);
1590
1590
  }
1591
1591
  const r = [], n = [];
1592
1592
  let s = 0;
1593
1593
  for (let i = 0; i < t.length; i++) {
1594
1594
  const { dynamic: o, encoded: a } = t[i];
1595
- o ? (r.push(Z(e + s, { size: 32 })), n.push(a), s += De(a)) : r.push(a);
1595
+ o ? (r.push(Z(e + s, { size: 32 })), n.push(a), s += He(a)) : r.push(a);
1596
1596
  }
1597
1597
  return mr([...r, ...n]);
1598
1598
  }
@@ -1635,7 +1635,7 @@ function R5(t, { length: e, param: r }) {
1635
1635
  };
1636
1636
  }
1637
1637
  function N5(t, { param: e }) {
1638
- const [, r] = e.type.split("bytes"), n = De(t);
1638
+ const [, r] = e.type.split("bytes"), n = He(t);
1639
1639
  if (!r) {
1640
1640
  let s = t;
1641
1641
  return n % 32 !== 0 && (s = us(s, {
@@ -1679,7 +1679,7 @@ function M5(t, { signed: e, size: r = 256 }) {
1679
1679
  };
1680
1680
  }
1681
1681
  function F5(t) {
1682
- const e = Di(t), r = Math.ceil(De(e) / 32), n = [];
1682
+ const e = Di(t), r = Math.ceil(He(e) / 32), n = [];
1683
1683
  for (let s = 0; s < r; s++)
1684
1684
  n.push(us(Hs(e, s * 32, (s + 1) * 32), {
1685
1685
  dir: "right"
@@ -1687,7 +1687,7 @@ function F5(t) {
1687
1687
  return {
1688
1688
  dynamic: !0,
1689
1689
  encoded: mr([
1690
- us(Z(De(e), { size: 32 })),
1690
+ us(Z(He(e), { size: 32 })),
1691
1691
  ...n
1692
1692
  ])
1693
1693
  };
@@ -2067,13 +2067,13 @@ function W5(t, e = {}) {
2067
2067
  }
2068
2068
  function ka(t, e) {
2069
2069
  const r = typeof e == "string" ? on(e) : e, n = rh(r);
2070
- if (De(r) === 0 && t.length > 0)
2070
+ if (He(r) === 0 && t.length > 0)
2071
2071
  throw new Ea();
2072
- if (De(e) && De(e) < 32)
2072
+ if (He(e) && He(e) < 32)
2073
2073
  throw new sb({
2074
2074
  data: typeof e == "string" ? e : tt(e),
2075
2075
  params: t,
2076
- size: De(e)
2076
+ size: He(e)
2077
2077
  });
2078
2078
  let s = 0;
2079
2079
  const i = [];
@@ -3101,7 +3101,7 @@ async function vE({ hash: t, signature: e }) {
3101
3101
  return new n.Signature(ht(u), ht(f)).addRecoveryBit(m);
3102
3102
  }
3103
3103
  const o = sn(e) ? e : Ut(e);
3104
- if (De(o) !== 65)
3104
+ if (He(o) !== 65)
3105
3105
  throw new Error("invalid signature length");
3106
3106
  const a = yr(`0x${o.slice(130)}`), c = Wp(a);
3107
3107
  return n.Signature.fromCompact(o.substring(2, 130)).addRecoveryBit(c);
@@ -3989,7 +3989,7 @@ class KE extends D {
3989
3989
  }
3990
3990
  }
3991
3991
  function ZE(t) {
3992
- const e = t.to ?? (typeof t.data == "string" ? "hex" : "bytes"), r = typeof t.data == "string" ? on(t.data) : t.data, n = De(r);
3992
+ const e = t.to ?? (typeof t.data == "string" ? "hex" : "bytes"), r = typeof t.data == "string" ? on(t.data) : t.data, n = He(r);
3993
3993
  if (!n)
3994
3994
  throw new eg();
3995
3995
  if (n > Yp)
@@ -4262,7 +4262,7 @@ function gh(t) {
4262
4262
  abiItem: c,
4263
4263
  data: r,
4264
4264
  params: m,
4265
- size: De(r)
4265
+ size: He(r)
4266
4266
  }) : b;
4267
4267
  }
4268
4268
  else if (i)
@@ -5370,7 +5370,7 @@ async function iu(t, e) {
5370
5370
  });
5371
5371
  return re === "0x" ? { data: void 0 } : { data: re };
5372
5372
  } catch (te) {
5373
- const G = N8(te), { offchainLookup: P, offchainLookupSignature: j } = await import("./ccip-axunsS2b.js");
5373
+ const G = N8(te), { offchainLookup: P, offchainLookupSignature: j } = await import("./ccip-BBhYP8_k.js");
5374
5374
  if (t.ccipRead !== !1 && (G == null ? void 0 : G.slice(0, 10)) === j && g)
5375
5375
  return { data: await P(t, { data: G, to: g }) };
5376
5376
  throw M && (G == null ? void 0 : G.slice(0, 10)) === "0x101bb98d" ? new yE({ factory: p }) : Sg(te, {
@@ -7033,7 +7033,7 @@ function _S(t) {
7033
7033
  if (e.length === 0)
7034
7034
  throw new eg();
7035
7035
  for (const r of e) {
7036
- const n = De(r), s = yr(Hs(r, 0, 1));
7036
+ const n = He(r), s = yr(Hs(r, 0, 1));
7037
7037
  if (n !== 32)
7038
7038
  throw new WE({ hash: r, size: n });
7039
7039
  if (s !== Qb)
@@ -7566,7 +7566,7 @@ function XS(t, e = {}) {
7566
7566
  const QS = `Ethereum Signed Message:
7567
7567
  `;
7568
7568
  function eA(t) {
7569
- const e = typeof t == "string" ? Di(t) : typeof t.raw == "string" ? t.raw : tt(t.raw), r = Di(`${QS}${De(e)}`);
7569
+ const e = typeof t == "string" ? Di(t) : typeof t.raw == "string" ? t.raw : tt(t.raw), r = Di(`${QS}${He(e)}`);
7570
7570
  return mr([r, e]);
7571
7571
  }
7572
7572
  function Yg(t, e) {
@@ -7625,10 +7625,10 @@ function Jg(t) {
7625
7625
  const d = f.match(B5);
7626
7626
  if (d) {
7627
7627
  const [b, v] = d;
7628
- if (v && De(l) !== Number.parseInt(v, 10))
7628
+ if (v && He(l) !== Number.parseInt(v, 10))
7629
7629
  throw new jv({
7630
7630
  expectedSize: Number.parseInt(v, 10),
7631
- givenSize: De(l)
7631
+ givenSize: He(l)
7632
7632
  });
7633
7633
  }
7634
7634
  const m = s[f];
@@ -12423,7 +12423,7 @@ function Ak(t, e) {
12423
12423
  }
12424
12424
  return [t, e];
12425
12425
  }
12426
- const Ve = (t) => t.length === 64 ? t : t.slice(2), xk = (t) => {
12426
+ const Ge = (t) => t.length === 64 ? t : t.slice(2), xk = (t) => {
12427
12427
  if (!t) return !1;
12428
12428
  try {
12429
12429
  const e = Buffer.from(t, "hex");
@@ -12528,16 +12528,16 @@ const Ya = async (t, e) => {
12528
12528
  asset: e.asset ?? gk.asset
12529
12529
  })), Ok = async (t, e) => {
12530
12530
  const r = {
12531
- [Ze.evm]: { htlc: e.evm, name: "EVM" },
12532
- [Ze.solana]: { htlc: e.solana, name: "Solana" },
12533
- [Ze.starknet]: {
12531
+ [Ye.evm]: { htlc: e.evm, name: "EVM" },
12532
+ [Ye.solana]: { htlc: e.solana, name: "Solana" },
12533
+ [Ye.starknet]: {
12534
12534
  htlc: e.starknet,
12535
12535
  name: "Starknet"
12536
12536
  },
12537
- [Ze.sui]: { htlc: e.sui, name: "Sui" },
12538
- [Ze.bitcoin]: { htlc: e.bitcoin, name: "Bitcoin" }
12537
+ [Ye.sui]: { htlc: e.sui, name: "Sui" },
12538
+ [Ye.bitcoin]: { htlc: e.bitcoin, name: "Bitcoin" }
12539
12539
  };
12540
- if (t === Ze.bitcoin)
12540
+ if (t === Ye.bitcoin)
12541
12541
  return ne(void 0);
12542
12542
  const n = r[t];
12543
12543
  return n ? n.htlc ? ne(void 0) : C(
@@ -12985,10 +12985,10 @@ Gh.write = function(t, e, r, n, s, i) {
12985
12985
  return 1;
12986
12986
  if (y >>>= 0, A >>>= 0, B >>>= 0, U >>>= 0, this === h) return 0;
12987
12987
  let H = U - B, be = A - y;
12988
- const He = Math.min(H, be), Ne = this.slice(B, U), ze = h.slice(y, A);
12989
- for (let ke = 0; ke < He; ++ke)
12990
- if (Ne[ke] !== ze[ke]) {
12991
- H = Ne[ke], be = ze[ke];
12988
+ const ze = Math.min(H, be), Ne = this.slice(B, U), Ve = h.slice(y, A);
12989
+ for (let ke = 0; ke < ze; ++ke)
12990
+ if (Ne[ke] !== Ve[ke]) {
12991
+ H = Ne[ke], be = Ve[ke];
12992
12992
  break;
12993
12993
  }
12994
12994
  return H < be ? -1 : be < H ? 1 : 0;
@@ -13014,26 +13014,26 @@ Gh.write = function(t, e, r, n, s, i) {
13014
13014
  return -1;
13015
13015
  U = 2, H /= 2, be /= 2, y /= 2;
13016
13016
  }
13017
- function He(ze, ke) {
13018
- return U === 1 ? ze[ke] : ze.readUInt16BE(ke * U);
13017
+ function ze(Ve, ke) {
13018
+ return U === 1 ? Ve[ke] : Ve.readUInt16BE(ke * U);
13019
13019
  }
13020
13020
  let Ne;
13021
13021
  if (B) {
13022
- let ze = -1;
13022
+ let Ve = -1;
13023
13023
  for (Ne = y; Ne < H; Ne++)
13024
- if (He(w, Ne) === He(h, ze === -1 ? 0 : Ne - ze)) {
13025
- if (ze === -1 && (ze = Ne), Ne - ze + 1 === be) return ze * U;
13024
+ if (ze(w, Ne) === ze(h, Ve === -1 ? 0 : Ne - Ve)) {
13025
+ if (Ve === -1 && (Ve = Ne), Ne - Ve + 1 === be) return Ve * U;
13026
13026
  } else
13027
- ze !== -1 && (Ne -= Ne - ze), ze = -1;
13027
+ Ve !== -1 && (Ne -= Ne - Ve), Ve = -1;
13028
13028
  } else
13029
13029
  for (y + be > H && (y = H - be), Ne = y; Ne >= 0; Ne--) {
13030
- let ze = !0;
13030
+ let Ve = !0;
13031
13031
  for (let ke = 0; ke < be; ke++)
13032
- if (He(w, Ne + ke) !== He(h, ke)) {
13033
- ze = !1;
13032
+ if (ze(w, Ne + ke) !== ze(h, ke)) {
13033
+ Ve = !1;
13034
13034
  break;
13035
13035
  }
13036
- if (ze) return Ne;
13036
+ if (Ve) return Ne;
13037
13037
  }
13038
13038
  return -1;
13039
13039
  }
@@ -13125,19 +13125,19 @@ Gh.write = function(t, e, r, n, s, i) {
13125
13125
  const U = w[B];
13126
13126
  let H = null, be = U > 239 ? 4 : U > 223 ? 3 : U > 191 ? 2 : 1;
13127
13127
  if (B + be <= y) {
13128
- let He, Ne, ze, ke;
13128
+ let ze, Ne, Ve, ke;
13129
13129
  switch (be) {
13130
13130
  case 1:
13131
13131
  U < 128 && (H = U);
13132
13132
  break;
13133
13133
  case 2:
13134
- He = w[B + 1], (He & 192) === 128 && (ke = (U & 31) << 6 | He & 63, ke > 127 && (H = ke));
13134
+ ze = w[B + 1], (ze & 192) === 128 && (ke = (U & 31) << 6 | ze & 63, ke > 127 && (H = ke));
13135
13135
  break;
13136
13136
  case 3:
13137
- He = w[B + 1], Ne = w[B + 2], (He & 192) === 128 && (Ne & 192) === 128 && (ke = (U & 15) << 12 | (He & 63) << 6 | Ne & 63, ke > 2047 && (ke < 55296 || ke > 57343) && (H = ke));
13137
+ ze = w[B + 1], Ne = w[B + 2], (ze & 192) === 128 && (Ne & 192) === 128 && (ke = (U & 15) << 12 | (ze & 63) << 6 | Ne & 63, ke > 2047 && (ke < 55296 || ke > 57343) && (H = ke));
13138
13138
  break;
13139
13139
  case 4:
13140
- He = w[B + 1], Ne = w[B + 2], ze = w[B + 3], (He & 192) === 128 && (Ne & 192) === 128 && (ze & 192) === 128 && (ke = (U & 15) << 18 | (He & 63) << 12 | (Ne & 63) << 6 | ze & 63, ke > 65535 && ke < 1114112 && (H = ke));
13140
+ ze = w[B + 1], Ne = w[B + 2], Ve = w[B + 3], (ze & 192) === 128 && (Ne & 192) === 128 && (Ve & 192) === 128 && (ke = (U & 15) << 18 | (ze & 63) << 12 | (Ne & 63) << 6 | Ve & 63, ke > 65535 && ke < 1114112 && (H = ke));
13141
13141
  }
13142
13142
  }
13143
13143
  H === null ? (H = 65533, be = 1) : H > 65535 && (H -= 65536, A.push(H >>> 10 & 1023 | 55296), H = 56320 | H & 1023), A.push(H), B += be;
@@ -13332,8 +13332,8 @@ Gh.write = function(t, e, r, n, s, i) {
13332
13332
  return F(this, h, y, BigInt(0), BigInt("0xffffffffffffffff"));
13333
13333
  }), a.prototype.writeIntLE = function(h, y, A, B) {
13334
13334
  if (h = +h, y = y >>> 0, !B) {
13335
- const He = Math.pow(2, 8 * A - 1);
13336
- I(this, h, y, A, He - 1, -He);
13335
+ const ze = Math.pow(2, 8 * A - 1);
13336
+ I(this, h, y, A, ze - 1, -ze);
13337
13337
  }
13338
13338
  let U = 0, H = 1, be = 0;
13339
13339
  for (this[y] = h & 255; ++U < A && (H *= 256); )
@@ -13341,8 +13341,8 @@ Gh.write = function(t, e, r, n, s, i) {
13341
13341
  return y + A;
13342
13342
  }, a.prototype.writeIntBE = function(h, y, A, B) {
13343
13343
  if (h = +h, y = y >>> 0, !B) {
13344
- const He = Math.pow(2, 8 * A - 1);
13345
- I(this, h, y, A, He - 1, -He);
13344
+ const ze = Math.pow(2, 8 * A - 1);
13345
+ I(this, h, y, A, ze - 1, -ze);
13346
13346
  }
13347
13347
  let U = A - 1, H = 1, be = 0;
13348
13348
  for (this[y + U] = h & 255; --U >= 0 && (H *= 256); )
@@ -16070,7 +16070,7 @@ gu.p2data = I_;
16070
16070
  var wu = {};
16071
16071
  Object.defineProperty(wu, "__esModule", { value: !0 });
16072
16072
  wu.p2ms = void 0;
16073
- const O_ = xt, wi = nr(), We = kt, Wn = Qt, vi = wi.OPS, Qa = vi.OP_RESERVED;
16073
+ const O_ = xt, wi = nr(), Ke = kt, Wn = Qt, vi = wi.OPS, Qa = vi.OP_RESERVED;
16074
16074
  function B_(t, e) {
16075
16075
  if (!t.input && !t.output && !(t.pubkeys && t.m !== void 0) && !t.signatures)
16076
16076
  throw new TypeError("Not enough data");
@@ -16078,19 +16078,19 @@ function B_(t, e) {
16078
16078
  function r(c) {
16079
16079
  return wi.isCanonicalScriptSignature(c) || (e.allowIncomplete && c === vi.OP_0) !== void 0;
16080
16080
  }
16081
- (0, We.typeforce)(
16081
+ (0, Ke.typeforce)(
16082
16082
  {
16083
- network: We.typeforce.maybe(We.typeforce.Object),
16084
- m: We.typeforce.maybe(We.typeforce.Number),
16085
- n: We.typeforce.maybe(We.typeforce.Number),
16086
- output: We.typeforce.maybe(We.typeforce.Buffer),
16087
- pubkeys: We.typeforce.maybe(
16088
- We.typeforce.arrayOf(We.isPoint)
16083
+ network: Ke.typeforce.maybe(Ke.typeforce.Object),
16084
+ m: Ke.typeforce.maybe(Ke.typeforce.Number),
16085
+ n: Ke.typeforce.maybe(Ke.typeforce.Number),
16086
+ output: Ke.typeforce.maybe(Ke.typeforce.Buffer),
16087
+ pubkeys: Ke.typeforce.maybe(
16088
+ Ke.typeforce.arrayOf(Ke.isPoint)
16089
16089
  ),
16090
- signatures: We.typeforce.maybe(
16091
- We.typeforce.arrayOf(r)
16090
+ signatures: Ke.typeforce.maybe(
16091
+ Ke.typeforce.arrayOf(r)
16092
16092
  ),
16093
- input: We.typeforce.maybe(We.typeforce.Buffer)
16093
+ input: Ke.typeforce.maybe(Ke.typeforce.Buffer)
16094
16094
  },
16095
16095
  t
16096
16096
  );
@@ -16132,19 +16132,19 @@ function B_(t, e) {
16132
16132
  return `p2ms(${s.m} of ${s.n})`;
16133
16133
  }), e.validate) {
16134
16134
  if (t.output) {
16135
- if (a(t.output), !We.typeforce.Number(i[0]))
16135
+ if (a(t.output), !Ke.typeforce.Number(i[0]))
16136
16136
  throw new TypeError("Output is invalid");
16137
- if (!We.typeforce.Number(i[i.length - 2]))
16137
+ if (!Ke.typeforce.Number(i[i.length - 2]))
16138
16138
  throw new TypeError("Output is invalid");
16139
16139
  if (i[i.length - 1] !== vi.OP_CHECKMULTISIG)
16140
16140
  throw new TypeError("Output is invalid");
16141
16141
  if (s.m <= 0 || s.n > 16 || s.m > s.n || s.n !== i.length - 3)
16142
16142
  throw new TypeError("Output is invalid");
16143
- if (!s.pubkeys.every((c) => (0, We.isPoint)(c)))
16143
+ if (!s.pubkeys.every((c) => (0, Ke.isPoint)(c)))
16144
16144
  throw new TypeError("Output is invalid");
16145
16145
  if (t.m !== void 0 && t.m !== s.m) throw new TypeError("m mismatch");
16146
16146
  if (t.n !== void 0 && t.n !== s.n) throw new TypeError("n mismatch");
16147
- if (t.pubkeys && !(0, We.stacksEqual)(t.pubkeys, s.pubkeys))
16147
+ if (t.pubkeys && !(0, Ke.stacksEqual)(t.pubkeys, s.pubkeys))
16148
16148
  throw new TypeError("Pubkeys mismatch");
16149
16149
  }
16150
16150
  if (t.pubkeys) {
@@ -16162,7 +16162,7 @@ function B_(t, e) {
16162
16162
  if (t.input[0] !== vi.OP_0) throw new TypeError("Input is invalid");
16163
16163
  if (s.signatures.length === 0 || !s.signatures.every(r))
16164
16164
  throw new TypeError("Input has invalid signature(s)");
16165
- if (t.signatures && !(0, We.stacksEqual)(t.signatures, s.signatures))
16165
+ if (t.signatures && !(0, Ke.stacksEqual)(t.signatures, s.signatures))
16166
16166
  throw new TypeError("Signature mismatch");
16167
16167
  if (t.m !== void 0 && t.m !== t.signatures.length)
16168
16168
  throw new TypeError("Signature count mismatch");
@@ -17892,7 +17892,7 @@ let cy = class {
17892
17892
  Buffer.from(r, "hex"),
17893
17893
  this.redeemLeaf(
17894
17894
  at(e.destination_swap.secret_hash),
17895
- Ve(e.destination_swap.delegate)
17895
+ Ge(e.destination_swap.delegate)
17896
17896
  ),
17897
17897
  await this.generateControlBlockFor(1, e)
17898
17898
  ]);
@@ -17936,8 +17936,8 @@ let cy = class {
17936
17936
  // this is then modified by the redeemer to include their signature
17937
17937
  xo(d, a),
17938
17938
  this.instantRefundLeaf(
17939
- Ve(e.source_swap.initiator),
17940
- Ve(e.destination_swap.delegate)
17939
+ Ge(e.source_swap.initiator),
17940
+ Ge(e.destination_swap.delegate)
17941
17941
  ),
17942
17942
  await this.generateControlBlockFor(2, e)
17943
17943
  ]);
@@ -17981,7 +17981,7 @@ let cy = class {
17981
17981
  );
17982
17982
  if (!hr.verifySchnorr(
17983
17983
  d,
17984
- Buffer.from(Ve(e.destination_swap.delegate), "hex"),
17984
+ Buffer.from(Ge(e.destination_swap.delegate), "hex"),
17985
17985
  Buffer.from(r[p].sig, "hex")
17986
17986
  ))
17987
17987
  throw new Error(
@@ -17994,8 +17994,8 @@ let cy = class {
17994
17994
  Buffer.from(v.sig, "hex"),
17995
17995
  m,
17996
17996
  this.instantRefundLeaf(
17997
- Ve(e.source_swap.initiator),
17998
- Ve(e.destination_swap.delegate)
17997
+ Ge(e.source_swap.initiator),
17998
+ Ge(e.destination_swap.delegate)
17999
17999
  ),
18000
18000
  await this.generateControlBlockFor(2, e)
18001
18001
  ]);
@@ -18040,7 +18040,7 @@ let cy = class {
18040
18040
  Buffer.from(r, "hex"),
18041
18041
  this.redeemLeaf(
18042
18042
  at(e.destination_swap.secret_hash),
18043
- Ve(e.destination_swap.delegate)
18043
+ Ge(e.destination_swap.delegate)
18044
18044
  ),
18045
18045
  await this.generateControlBlockFor(1, e)
18046
18046
  ]);
@@ -18067,7 +18067,7 @@ let cy = class {
18067
18067
  Buffer.from(r, "hex"),
18068
18068
  this.redeemLeaf(
18069
18069
  at(e.destination_swap.secret_hash),
18070
- Ve(e.destination_swap.delegate)
18070
+ Ge(e.destination_swap.delegate)
18071
18071
  ),
18072
18072
  await this.generateControlBlockFor(1, e)
18073
18073
  ]);
@@ -18103,7 +18103,7 @@ let cy = class {
18103
18103
  b,
18104
18104
  this.refundLeaf(
18105
18105
  e.source_swap.timelock,
18106
- Ve(e.source_swap.initiator)
18106
+ Ge(e.source_swap.initiator)
18107
18107
  ),
18108
18108
  await this.generateControlBlockFor(0, e)
18109
18109
  ]);
@@ -18132,19 +18132,19 @@ let cy = class {
18132
18132
  case 1:
18133
18133
  n = this.redeemLeaf(
18134
18134
  at(r.destination_swap.secret_hash),
18135
- Ve(r.destination_swap.delegate)
18135
+ Ge(r.destination_swap.delegate)
18136
18136
  ), s = this.generateLeaves(r, "redeem");
18137
18137
  break;
18138
18138
  case 0:
18139
18139
  n = this.refundLeaf(
18140
18140
  r.source_swap.timelock,
18141
- Ve(r.source_swap.initiator)
18141
+ Ge(r.source_swap.initiator)
18142
18142
  ), s = this.generateLeaves(r, "refund");
18143
18143
  break;
18144
18144
  case 2:
18145
18145
  n = this.instantRefundLeaf(
18146
- Ve(r.source_swap.initiator),
18147
- Ve(r.destination_swap.delegate)
18146
+ Ge(r.source_swap.initiator),
18147
+ Ge(r.destination_swap.delegate)
18148
18148
  ), s = this.generateLeaves(r, "instantRefund");
18149
18149
  break;
18150
18150
  default:
@@ -18174,19 +18174,19 @@ let cy = class {
18174
18174
  case 1:
18175
18175
  n = this.redeemLeaf(
18176
18176
  at(r.destination_swap.secret_hash),
18177
- Ve(r.destination_swap.delegate)
18177
+ Ge(r.destination_swap.delegate)
18178
18178
  );
18179
18179
  break;
18180
18180
  case 0:
18181
18181
  n = this.refundLeaf(
18182
18182
  r.source_swap.timelock,
18183
- Ve(r.source_swap.initiator)
18183
+ Ge(r.source_swap.initiator)
18184
18184
  );
18185
18185
  break;
18186
18186
  case 2:
18187
18187
  n = this.instantRefundLeaf(
18188
- Ve(r.source_swap.initiator),
18189
- Ve(r.destination_swap.redeemer)
18188
+ Ge(r.source_swap.initiator),
18189
+ Ge(r.destination_swap.redeemer)
18190
18190
  );
18191
18191
  break;
18192
18192
  default:
@@ -18254,18 +18254,18 @@ let cy = class {
18254
18254
  return [
18255
18255
  {
18256
18256
  version: sc,
18257
- output: this.redeemLeaf(n.secret_hash, Ve(s))
18257
+ output: this.redeemLeaf(n.secret_hash, Ge(s))
18258
18258
  },
18259
18259
  [
18260
18260
  {
18261
18261
  version: sc,
18262
- output: this.refundLeaf(n.timelock, Ve(n.initiator))
18262
+ output: this.refundLeaf(n.timelock, Ge(n.initiator))
18263
18263
  },
18264
18264
  {
18265
18265
  version: sc,
18266
18266
  output: this.instantRefundLeaf(
18267
- Ve(n.initiator),
18268
- Ve(i)
18267
+ Ge(n.initiator),
18268
+ Ge(i)
18269
18269
  )
18270
18270
  }
18271
18271
  ]
@@ -18433,7 +18433,7 @@ class la extends Lm {
18433
18433
  async generateSecret(e) {
18434
18434
  const r = await this.signMessage(e);
18435
18435
  if (!r.ok) return C(r.error);
18436
- const n = Eo(Ye(r.val)), s = Eo(n);
18436
+ const n = Eo(Le(r.val)), s = Eo(n);
18437
18437
  return ne({ secret: n, secretHash: s });
18438
18438
  }
18439
18439
  async signMessage(e) {
@@ -19505,6 +19505,8 @@ const WT = /* @__PURE__ */ wt({
19505
19505
  const a = lf({
19506
19506
  account: e.account,
19507
19507
  chain: r,
19508
+ key: e.key,
19509
+ name: e.name,
19508
19510
  transport: O0(e.transport)
19509
19511
  });
19510
19512
  return ne({
@@ -19519,6 +19521,8 @@ const WT = /* @__PURE__ */ wt({
19519
19521
  const c = lf({
19520
19522
  account: e.account,
19521
19523
  chain: r,
19524
+ key: e.key,
19525
+ name: e.name,
19522
19526
  transport: O0(e.transport)
19523
19527
  });
19524
19528
  return ne({
@@ -19532,6 +19536,8 @@ const WT = /* @__PURE__ */ wt({
19532
19536
  const c = lf({
19533
19537
  account: e.account,
19534
19538
  chain: r,
19539
+ key: e.key,
19540
+ name: e.name,
19535
19541
  transport: Y1()
19536
19542
  });
19537
19543
  return ne({
@@ -19965,7 +19971,7 @@ class hP {
19965
19971
  const { source_swap: s } = e;
19966
19972
  if (!s.amount || !s.redeemer || !s.timelock || !s.secret_hash)
19967
19973
  return C("Invalid order");
19968
- const i = Ye(s.secret_hash), o = BigInt(s.timelock), a = Ye(s.redeemer), c = BigInt(s.amount), u = await Vh(
19974
+ const i = Le(s.secret_hash), o = BigInt(s.timelock), a = Le(s.redeemer), c = BigInt(s.amount), u = await Vh(
19969
19975
  e.source_swap.asset,
19970
19976
  this.url
19971
19977
  );
@@ -19991,7 +19997,7 @@ class hP {
19991
19997
  if (!this.wallet.account) return C("No account found");
19992
19998
  try {
19993
19999
  const a = await o0({
19994
- address: Ye(i),
20000
+ address: Le(i),
19995
20001
  abi: dP,
19996
20002
  client: this.wallet
19997
20003
  }).write.initiate(
@@ -20013,7 +20019,7 @@ class hP {
20013
20019
  const c = await this.auth.getAuthHeaders();
20014
20020
  if (!c.ok) return C(c.error);
20015
20021
  const u = o0({
20016
- address: Ye(i),
20022
+ address: Le(i),
20017
20023
  abi: MT,
20018
20024
  client: this.wallet
20019
20025
  }), f = await P6(
@@ -20083,9 +20089,9 @@ class hP {
20083
20089
  return C("No initiate_transaction found for native initiate");
20084
20090
  const f = await this.wallet.sendTransaction({
20085
20091
  account: this.wallet.account,
20086
- to: Ye(u.to),
20092
+ to: Le(u.to),
20087
20093
  value: BigInt(u.value),
20088
- data: Ye(u.data),
20094
+ data: Le(u.data),
20089
20095
  gas: BigInt(u.gas_limit),
20090
20096
  chain: this.wallet.chain
20091
20097
  }), l = await Fu(this.wallet, f);
@@ -20097,6 +20103,17 @@ class hP {
20097
20103
  return C(`Approval failed: ${u.error}`);
20098
20104
  console.log("Approval transaction completed:", u.val);
20099
20105
  }
20106
+ if (this.wallet.key === "emailWallet") {
20107
+ const u = e.initiate_transaction, f = await this.wallet.sendTransaction({
20108
+ account: this.wallet.account,
20109
+ to: Le(u.to),
20110
+ value: BigInt(u.value),
20111
+ data: Le(u.data),
20112
+ gas: BigInt(u.gas_limit),
20113
+ chain: this.wallet.chain
20114
+ });
20115
+ return ne(f);
20116
+ }
20100
20117
  const { typed_data: i } = e, o = await this.wallet.signTypedData({
20101
20118
  account: this.wallet.account,
20102
20119
  domain: i.domain,
@@ -20127,9 +20144,9 @@ class hP {
20127
20144
  try {
20128
20145
  const r = e.approval_transaction, n = await this.wallet.sendTransaction({
20129
20146
  account: this.wallet.account,
20130
- to: Ye(r.to),
20147
+ to: Le(r.to),
20131
20148
  value: BigInt(r.value),
20132
- data: Ye(r.data),
20149
+ data: Le(r.data),
20133
20150
  gas: BigInt(r.gas_limit),
20134
20151
  chain: this.wallet.chain
20135
20152
  }), s = await Fu(this.wallet, n);
@@ -21310,9 +21327,9 @@ const Iw = [
21310
21327
  return ne("Allowance already approved");
21311
21328
  const a = Io.uint256(BigInt(n)), c = await t.execute([
21312
21329
  {
21313
- contractAddress: Ye(e),
21330
+ contractAddress: Le(e),
21314
21331
  entrypoint: "approve",
21315
- calldata: [Ye(r), a.low, a.high]
21332
+ calldata: [Le(r), a.low, a.high]
21316
21333
  }
21317
21334
  ]);
21318
21335
  await s.waitForTransaction(
@@ -21358,11 +21375,11 @@ const Iw = [
21358
21375
  try {
21359
21376
  const i = await new Kd(
21360
21377
  Iw,
21361
- Ye(e),
21378
+ Le(e),
21362
21379
  n
21363
21380
  ).call("allowance", [
21364
- Ye(t),
21365
- Ye(r)
21381
+ Le(t),
21382
+ Le(r)
21366
21383
  ]);
21367
21384
  return ne(BigInt((i == null ? void 0 : i.toString()) || "0"));
21368
21385
  } catch (s) {
@@ -21683,11 +21700,11 @@ class bP {
21683
21700
  const { source_swap: n } = r, { redeemer: s, amount: i } = n, { secret_hash: o, timelock: a } = n, c = n.asset;
21684
21701
  try {
21685
21702
  const u = Io.uint256(BigInt(i)), f = {
21686
- contractAddress: Ye(e),
21703
+ contractAddress: Le(e),
21687
21704
  entrypoint: "approve",
21688
21705
  calldata: [c, u.low, u.high]
21689
21706
  }, l = Io.uint256(i), p = {
21690
- contractAddress: Ye(c),
21707
+ contractAddress: Le(c),
21691
21708
  entrypoint: "initiate",
21692
21709
  calldata: [
21693
21710
  s,
@@ -21709,7 +21726,7 @@ class bP {
21709
21726
  const { source_swap: r } = e, { redeemer: n, amount: s } = r;
21710
21727
  if (!r.secret_hash)
21711
21728
  return C("Invalid order: secret_hash is undefined");
21712
- const i = Ye(r.secret_hash), a = {
21729
+ const i = Le(r.secret_hash), a = {
21713
21730
  domain: {
21714
21731
  name: "HTLC",
21715
21732
  version: U6.encodeShortString("1"),
@@ -21777,8 +21794,8 @@ class bP {
21777
21794
  try {
21778
21795
  const r = e.approval_transaction, n = await this.account.execute([
21779
21796
  {
21780
- contractAddress: Ye(r.to),
21781
- entrypoint: Ye(r.selector),
21797
+ contractAddress: Le(r.to),
21798
+ entrypoint: Le(r.selector),
21782
21799
  calldata: r.calldata
21783
21800
  }
21784
21801
  ]);
@@ -21804,8 +21821,8 @@ class bP {
21804
21821
  if (!c) return C("No initiate_transaction found for native initiate");
21805
21822
  const u = await this.account.execute([
21806
21823
  {
21807
- contractAddress: Ye(c.to),
21808
- entrypoint: Ye(c.selector),
21824
+ contractAddress: Le(c.to),
21825
+ entrypoint: Le(c.selector),
21809
21826
  calldata: c.calldata
21810
21827
  }
21811
21828
  ]);
@@ -27284,11 +27301,11 @@ function La(t, e) {
27284
27301
  }
27285
27302
  };
27286
27303
  }
27287
- function qe(t) {
27304
+ function We(t) {
27288
27305
  return {
27289
27306
  kind: "validation",
27290
27307
  type: "integer",
27291
- reference: qe,
27308
+ reference: We,
27292
27309
  async: !1,
27293
27310
  expects: null,
27294
27311
  requirement: Number.isInteger,
@@ -27450,11 +27467,11 @@ function Zi(t, ...e) {
27450
27467
  };
27451
27468
  return 0 in e && (r.default = e[0]), r;
27452
27469
  }
27453
- function Le(t) {
27470
+ function De(t) {
27454
27471
  return {
27455
27472
  kind: "schema",
27456
27473
  type: "number",
27457
- reference: Le,
27474
+ reference: De,
27458
27475
  expects: "number",
27459
27476
  async: !1,
27460
27477
  message: t,
@@ -27705,7 +27722,7 @@ function ei() {
27705
27722
  }
27706
27723
  };
27707
27724
  }
27708
- function Ge(t, e, r) {
27725
+ function qe(t, e, r) {
27709
27726
  const n = t._run(
27710
27727
  { typed: !1, value: e },
27711
27728
  t4(r)
@@ -27745,7 +27762,7 @@ const oo = Pe(
27745
27762
  Uu((t) => Ae(t)),
27746
27763
  La(xr)
27747
27764
  ), Jt = oo, ti = pe(), Gt = Pe(
27748
- vt([pe(), Pe(Le(), qe())]),
27765
+ vt([pe(), Pe(De(), We())]),
27749
27766
  La((t) => {
27750
27767
  try {
27751
27768
  return BigInt(t), BigInt(t) >= 0 && BigInt(t) <= 18446744073709551615n;
@@ -27760,10 +27777,10 @@ const oo = Pe(
27760
27777
  }), Me = Pe(
27761
27778
  vt([
27762
27779
  Q({ GasCoin: de(!0) }),
27763
- Q({ Input: Pe(Le(), qe()), type: ct(de("pure")) }),
27764
- Q({ Input: Pe(Le(), qe()), type: ct(de("object")) }),
27765
- Q({ Result: Pe(Le(), qe()) }),
27766
- Q({ NestedResult: mp([Pe(Le(), qe()), Pe(Le(), qe())]) })
27780
+ Q({ Input: Pe(De(), We()), type: ct(de("pure")) }),
27781
+ Q({ Input: Pe(De(), We()), type: ct(de("object")) }),
27782
+ Q({ Result: Pe(De(), We()) }),
27783
+ Q({ NestedResult: mp([Pe(De(), We()), Pe(De(), We())]) })
27767
27784
  ]),
27768
27785
  Uu((t) => ({
27769
27786
  ...t,
@@ -27793,7 +27810,7 @@ const oo = Pe(
27793
27810
  typeParameters: fe(pa(() => Fd))
27794
27811
  })
27795
27812
  }),
27796
- Q({ typeParameter: Pe(Le(), qe()) })
27813
+ Q({ typeParameter: Pe(De(), We()) })
27797
27814
  ]), c4 = Q({
27798
27815
  ref: Ee(vt([de("&"), de("&mut")])),
27799
27816
  body: Fd
@@ -27895,8 +27912,8 @@ const oo = Pe(
27895
27912
  return {
27896
27913
  $kind: "TransferObjects",
27897
27914
  TransferObjects: {
27898
- objects: t.map((r) => Ge(Me, r)),
27899
- address: Ge(Me, e)
27915
+ objects: t.map((r) => qe(Me, r)),
27916
+ address: qe(Me, e)
27900
27917
  }
27901
27918
  };
27902
27919
  },
@@ -27904,8 +27921,8 @@ const oo = Pe(
27904
27921
  return {
27905
27922
  $kind: "SplitCoins",
27906
27923
  SplitCoins: {
27907
- coin: Ge(Me, t),
27908
- amounts: e.map((r) => Ge(Me, r))
27924
+ coin: qe(Me, t),
27925
+ amounts: e.map((r) => qe(Me, r))
27909
27926
  }
27910
27927
  };
27911
27928
  },
@@ -27913,8 +27930,8 @@ const oo = Pe(
27913
27930
  return {
27914
27931
  $kind: "MergeCoins",
27915
27932
  MergeCoins: {
27916
- destination: Ge(Me, t),
27917
- sources: e.map((r) => Ge(Me, r))
27933
+ destination: qe(Me, t),
27934
+ sources: e.map((r) => qe(Me, r))
27918
27935
  }
27919
27936
  };
27920
27937
  },
@@ -27946,7 +27963,7 @@ const oo = Pe(
27946
27963
  ),
27947
27964
  dependencies: e.map((s) => Tn(s)),
27948
27965
  package: r,
27949
- ticket: Ge(Me, n)
27966
+ ticket: qe(Me, n)
27950
27967
  }
27951
27968
  };
27952
27969
  },
@@ -27958,7 +27975,7 @@ const oo = Pe(
27958
27975
  $kind: "MakeMoveVec",
27959
27976
  MakeMoveVec: {
27960
27977
  type: t ?? null,
27961
- elements: e.map((r) => Ge(Me, r))
27978
+ elements: e.map((r) => qe(Me, r))
27962
27979
  }
27963
27980
  };
27964
27981
  },
@@ -27974,7 +27991,7 @@ const oo = Pe(
27974
27991
  inputs: Object.fromEntries(
27975
27992
  Object.entries(e).map(([n, s]) => [
27976
27993
  n,
27977
- Array.isArray(s) ? s.map((i) => Ge(Me, i)) : Ge(Me, s)
27994
+ Array.isArray(s) ? s.map((i) => qe(Me, i)) : qe(Me, s)
27978
27995
  ])
27979
27996
  ),
27980
27997
  data: r
@@ -27984,7 +28001,7 @@ const oo = Pe(
27984
28001
  }, jd = Q({
27985
28002
  digest: pe(),
27986
28003
  objectId: pe(),
27987
- version: vt([Pe(Le(), qe()), pe(), yp()])
28004
+ version: vt([Pe(De(), We()), pe(), yp()])
27988
28005
  }), h4 = fi({
27989
28006
  ImmOrOwned: jd,
27990
28007
  Shared: Q({
@@ -27995,25 +28012,25 @@ const oo = Pe(
27995
28012
  Receiving: jd
27996
28013
  }), Em = fi({
27997
28014
  Object: h4,
27998
- Pure: fe(Pe(Le(), qe()))
28015
+ Pure: fe(Pe(De(), We()))
27999
28016
  }), q2 = vt([
28000
28017
  Q({
28001
28018
  kind: de("Input"),
28002
- index: Pe(Le(), qe()),
28019
+ index: Pe(De(), We()),
28003
28020
  value: ei(),
28004
28021
  type: ct(de("object"))
28005
28022
  }),
28006
28023
  Q({
28007
28024
  kind: de("Input"),
28008
- index: Pe(Le(), qe()),
28025
+ index: Pe(De(), We()),
28009
28026
  value: ei(),
28010
28027
  type: de("pure")
28011
28028
  })
28012
28029
  ]), p4 = vt([
28013
- Q({ Epoch: Pe(Le(), qe()) }),
28030
+ Q({ Epoch: Pe(De(), We()) }),
28014
28031
  Q({ None: Ee(de(!0)) })
28015
28032
  ]), Sm = Pe(
28016
- vt([Le(), pe(), yp()]),
28033
+ vt([De(), pe(), yp()]),
28017
28034
  La((t) => {
28018
28035
  if (!["string", "number", "bigint"].includes(typeof t)) return !1;
28019
28036
  try {
@@ -28047,11 +28064,11 @@ const oo = Pe(
28047
28064
  }), b4 = [
28048
28065
  q2,
28049
28066
  Q({ kind: de("GasCoin") }),
28050
- Q({ kind: de("Result"), index: Pe(Le(), qe()) }),
28067
+ Q({ kind: de("Result"), index: Pe(De(), We()) }),
28051
28068
  Q({
28052
28069
  kind: de("NestedResult"),
28053
- index: Pe(Le(), qe()),
28054
- resultIndex: Pe(Le(), qe())
28070
+ index: Pe(De(), We()),
28071
+ resultIndex: Pe(De(), We())
28055
28072
  })
28056
28073
  ], Mn = vt([...b4]), g4 = Q({
28057
28074
  kind: de("MoveCall"),
@@ -28079,11 +28096,11 @@ const oo = Pe(
28079
28096
  objects: fe(Mn)
28080
28097
  }), A4 = Q({
28081
28098
  kind: de("Publish"),
28082
- modules: fe(fe(Pe(Le(), qe()))),
28099
+ modules: fe(fe(Pe(De(), We()))),
28083
28100
  dependencies: fe(pe())
28084
28101
  }), x4 = Q({
28085
28102
  kind: de("Upgrade"),
28086
- modules: fe(fe(Pe(Le(), qe()))),
28103
+ modules: fe(fe(Pe(De(), We()))),
28087
28104
  dependencies: fe(pe()),
28088
28105
  packageId: pe(),
28089
28106
  ticket: Mn
@@ -28237,7 +28254,7 @@ function bn(t, e) {
28237
28254
  }
28238
28255
  function T4(t) {
28239
28256
  var e, r, n;
28240
- return Ge(Sc, {
28257
+ return qe(Sc, {
28241
28258
  version: 2,
28242
28259
  sender: t.sender ?? null,
28243
28260
  expiration: t.expiration ? "Epoch" in t.expiration ? { Epoch: t.expiration.Epoch } : { None: !0 } : null,
@@ -28254,7 +28271,7 @@ function T4(t) {
28254
28271
  inputs: t.inputs.map((s) => {
28255
28272
  if (s.kind === "Input") {
28256
28273
  if (Md(Em, s.value)) {
28257
- const i = Ge(Em, s.value);
28274
+ const i = qe(Em, s.value);
28258
28275
  if (i.Object) {
28259
28276
  if (i.Object.ImmOrOwned)
28260
28277
  return {
@@ -28388,9 +28405,9 @@ function Da(t) {
28388
28405
  }
28389
28406
  const Er = Da({
28390
28407
  GasCoin: de(!0),
28391
- Input: Pe(Le(), qe()),
28392
- Result: Pe(Le(), qe()),
28393
- NestedResult: mp([Pe(Le(), qe()), Pe(Le(), qe())])
28408
+ Input: Pe(De(), We()),
28409
+ Result: Pe(De(), We()),
28410
+ NestedResult: mp([Pe(De(), We()), Pe(De(), We())])
28394
28411
  }), P4 = Q({
28395
28412
  budget: Ee(Gt),
28396
28413
  price: Ee(Gt),
@@ -29067,7 +29084,7 @@ async function aB(t, e) {
29067
29084
  if (!n.length)
29068
29085
  throw new Error("No valid gas coins found for the transaction.");
29069
29086
  t.gasConfig.payment = n.map(
29070
- (s) => Ge(bs, s)
29087
+ (s) => qe(bs, s)
29071
29088
  );
29072
29089
  }
29073
29090
  }
@@ -29375,7 +29392,7 @@ class Dt {
29375
29392
  });
29376
29393
  }
29377
29394
  static restore(e) {
29378
- return e.version === 2 ? new Dt(Ge(Sc, e)) : new Dt(Ge(Sc, T4(e)));
29395
+ return e.version === 2 ? new Dt(qe(Sc, e)) : new Dt(qe(Sc, T4(e)));
29379
29396
  }
29380
29397
  /**
29381
29398
  * Generate transaction digest.
@@ -29517,7 +29534,7 @@ class Dt {
29517
29534
  return Dt.getDigestFromBytes(e);
29518
29535
  }
29519
29536
  snapshot() {
29520
- return Ge(Sc, this);
29537
+ return qe(Sc, this);
29521
29538
  }
29522
29539
  shallowClone() {
29523
29540
  return new Dt({
@@ -29828,7 +29845,7 @@ function _B(t) {
29828
29845
  }
29829
29846
  var t6 = (t) => {
29830
29847
  throw TypeError(t);
29831
- }, vp = (t, e, r) => e.has(t) || t6("Cannot " + r), Y = (t, e, r) => (vp(t, e, "read from private field"), r ? r.call(t) : e.get(t)), qr = (t, e, r) => e.has(t) ? t6("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), Ce = (t, e, r, n) => (vp(t, e, "write to private field"), e.set(t, r), r), it = (t, e, r) => (vp(t, e, "access private method"), r), Cs, js, An, nn, lr, dr, Tr, ns, ce, Ke, r6, Ac, xc, kc, Hc, Gd, Ep, n6, s6;
29848
+ }, vp = (t, e, r) => e.has(t) || t6("Cannot " + r), Y = (t, e, r) => (vp(t, e, "read from private field"), r ? r.call(t) : e.get(t)), qr = (t, e, r) => e.has(t) ? t6("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), Ce = (t, e, r, n) => (vp(t, e, "write to private field"), e.set(t, r), r), it = (t, e, r) => (vp(t, e, "access private method"), r), Cs, js, An, nn, lr, dr, Tr, ns, ce, Ze, r6, Ac, xc, kc, Hc, Gd, Ep, n6, s6;
29832
29849
  function Nl(t, e = 1 / 0) {
29833
29850
  const r = {
29834
29851
  $kind: "Result",
@@ -29884,7 +29901,7 @@ function wo() {
29884
29901
  }
29885
29902
  const a6 = class qd {
29886
29903
  constructor() {
29887
- qr(this, Ke), qr(this, Cs), qr(this, js), qr(this, An, /* @__PURE__ */ new Map()), qr(this, nn, []), qr(this, lr, []), qr(this, dr, /* @__PURE__ */ new Set()), qr(this, Tr, /* @__PURE__ */ new Set()), qr(this, ns, /* @__PURE__ */ new Map()), qr(this, ce), this.object = mB(
29904
+ qr(this, Ze), qr(this, Cs), qr(this, js), qr(this, An, /* @__PURE__ */ new Map()), qr(this, nn, []), qr(this, lr, []), qr(this, dr, /* @__PURE__ */ new Set()), qr(this, Tr, /* @__PURE__ */ new Set()), qr(this, ns, /* @__PURE__ */ new Map()), qr(this, ce), this.object = mB(
29888
29905
  (r) => {
29889
29906
  var i, o;
29890
29907
  if (typeof r == "function")
@@ -29892,7 +29909,7 @@ const a6 = class qd {
29892
29909
  if (typeof r == "object" && Md(Me, r))
29893
29910
  return r;
29894
29911
  const n = Tm(r), s = Y(this, ce).inputs.find((a) => n === Tm(a));
29895
- return (i = s == null ? void 0 : s.Object) != null && i.SharedObject && typeof r == "object" && ((o = r.Object) != null && o.SharedObject) && (s.Object.SharedObject.mutable = s.Object.SharedObject.mutable || r.Object.SharedObject.mutable), s ? { $kind: "Input", Input: Y(this, ce).inputs.indexOf(s), type: "object" } : it(this, Ke, xc).call(this, "object", typeof r == "string" ? {
29912
+ return (i = s == null ? void 0 : s.Object) != null && i.SharedObject && typeof r == "object" && ((o = r.Object) != null && o.SharedObject) && (s.Object.SharedObject.mutable = s.Object.SharedObject.mutable || r.Object.SharedObject.mutable), s ? { $kind: "Input", Input: Y(this, ce).inputs.indexOf(s), type: "object" } : it(this, Ze, xc).call(this, "object", typeof r == "string" ? {
29896
29913
  $kind: "UnresolvedObject",
29897
29914
  UnresolvedObject: { objectId: Ae(r) }
29898
29915
  } : r);
@@ -29963,7 +29980,7 @@ const a6 = class qd {
29963
29980
  Y(this, ce).sender || (Y(this, ce).sender = e);
29964
29981
  }
29965
29982
  setExpiration(e) {
29966
- Y(this, ce).expiration = e ? Ge(G2, e) : null;
29983
+ Y(this, ce).expiration = e ? qe(G2, e) : null;
29967
29984
  }
29968
29985
  setGasPrice(e) {
29969
29986
  Y(this, ce).gasConfig.price = String(e);
@@ -29978,7 +29995,7 @@ const a6 = class qd {
29978
29995
  Y(this, ce).gasConfig.owner = e;
29979
29996
  }
29980
29997
  setGasPayment(e) {
29981
- Y(this, ce).gasConfig.payment = e.map((r) => Ge(bs, r));
29998
+ Y(this, ce).gasConfig.payment = e.map((r) => qe(bs, r));
29982
29999
  }
29983
30000
  /** @deprecated Use `getData()` instead. */
29984
30001
  get blockData() {
@@ -29997,12 +30014,12 @@ const a6 = class qd {
29997
30014
  get pure() {
29998
30015
  return Object.defineProperty(this, "pure", {
29999
30016
  enumerable: !1,
30000
- value: bB((e) => fp(e) ? it(this, Ke, xc).call(this, "pure", {
30017
+ value: bB((e) => fp(e) ? it(this, Ze, xc).call(this, "pure", {
30001
30018
  $kind: "Pure",
30002
30019
  Pure: {
30003
30020
  bytes: e.toBase64()
30004
30021
  }
30005
- }) : it(this, Ke, xc).call(this, "pure", Md(vm, e) ? Ge(vm, e) : e instanceof Uint8Array ? Ir.Pure(e) : { $kind: "UnresolvedPure", UnresolvedPure: { value: e } }))
30022
+ }) : it(this, Ze, xc).call(this, "pure", Md(vm, e) ? qe(vm, e) : e instanceof Uint8Array ? Ir.Pure(e) : { $kind: "UnresolvedPure", UnresolvedPure: { value: e } }))
30006
30023
  }), this.pure;
30007
30024
  }
30008
30025
  /** Returns an argument for the gas coin, to be used in a transaction. */
@@ -30034,10 +30051,10 @@ const a6 = class qd {
30034
30051
  if (typeof e == "function") {
30035
30052
  if (Y(this, ns).has(e))
30036
30053
  return Y(this, ns).get(e);
30037
- const r = it(this, Ke, r6).call(this), n = e(r);
30054
+ const r = it(this, Ze, r6).call(this), n = e(r);
30038
30055
  if (!(n && typeof n == "object" && "then" in n))
30039
30056
  return Ce(this, dr, Y(r, dr)), Y(this, ns).set(e, n), n;
30040
- const s = it(this, Ke, Ac).call(this, {
30057
+ const s = it(this, Ze, Ac).call(this, {
30041
30058
  $kind: "$Intent",
30042
30059
  $Intent: {
30043
30060
  name: "AsyncTransactionThunk",
@@ -30056,18 +30073,18 @@ const a6 = class qd {
30056
30073
  const i = Nl(() => s.$Intent.data.resultIndex);
30057
30074
  return Y(this, ns).set(e, i), i;
30058
30075
  } else
30059
- it(this, Ke, Ac).call(this, e);
30076
+ it(this, Ze, Ac).call(this, e);
30060
30077
  return Nl(Y(this, ce).commands.length - 1);
30061
30078
  }
30062
30079
  // Method shorthands:
30063
30080
  splitCoins(e, r) {
30064
30081
  const n = xs.SplitCoins(
30065
- typeof e == "string" ? this.object(e) : it(this, Ke, Hc).call(this, e),
30082
+ typeof e == "string" ? this.object(e) : it(this, Ze, Hc).call(this, e),
30066
30083
  r.map(
30067
- (s) => typeof s == "number" || typeof s == "bigint" || typeof s == "string" ? this.pure.u64(s) : it(this, Ke, kc).call(this, s)
30084
+ (s) => typeof s == "number" || typeof s == "bigint" || typeof s == "string" ? this.pure.u64(s) : it(this, Ze, kc).call(this, s)
30068
30085
  )
30069
30086
  );
30070
- return it(this, Ke, Ac).call(this, n), Nl(Y(this, ce).commands.length - 1, r.length);
30087
+ return it(this, Ze, Ac).call(this, n), Nl(Y(this, ce).commands.length - 1, r.length);
30071
30088
  }
30072
30089
  mergeCoins(e, r) {
30073
30090
  return this.add(
@@ -30107,7 +30124,7 @@ const a6 = class qd {
30107
30124
  return this.add(
30108
30125
  xs.MoveCall({
30109
30126
  ...r,
30110
- arguments: e == null ? void 0 : e.map((n) => it(this, Ke, kc).call(this, n))
30127
+ arguments: e == null ? void 0 : e.map((n) => it(this, Ze, kc).call(this, n))
30111
30128
  })
30112
30129
  );
30113
30130
  }
@@ -30115,7 +30132,7 @@ const a6 = class qd {
30115
30132
  return this.add(
30116
30133
  xs.TransferObjects(
30117
30134
  e.map((n) => this.object(n)),
30118
- typeof r == "string" ? this.pure.address(r) : it(this, Ke, kc).call(this, r)
30135
+ typeof r == "string" ? this.pure.address(r) : it(this, Ze, kc).call(this, r)
30119
30136
  )
30120
30137
  );
30121
30138
  }
@@ -30141,7 +30158,7 @@ const a6 = class qd {
30141
30158
  await this.prepareForSerialization(e);
30142
30159
  const r = this.isFullyResolved();
30143
30160
  return JSON.stringify(
30144
- Ge(
30161
+ qe(
30145
30162
  N4,
30146
30163
  r ? {
30147
30164
  ...Y(this, ce).snapshot(),
@@ -30173,17 +30190,17 @@ const a6 = class qd {
30173
30190
  }
30174
30191
  /** Build the transaction to BCS bytes. */
30175
30192
  async build(e = {}) {
30176
- return await this.prepareForSerialization(e), await it(this, Ke, Gd).call(this, e), Y(this, ce).build({
30193
+ return await this.prepareForSerialization(e), await it(this, Ze, Gd).call(this, e), Y(this, ce).build({
30177
30194
  onlyTransactionKind: e.onlyTransactionKind
30178
30195
  });
30179
30196
  }
30180
30197
  /** Derive transaction digest */
30181
30198
  async getDigest(e = {}) {
30182
- return await this.prepareForSerialization(e), await it(this, Ke, Gd).call(this, e), Y(this, ce).getDigest();
30199
+ return await this.prepareForSerialization(e), await it(this, Ze, Gd).call(this, e), Y(this, ce).getDigest();
30183
30200
  }
30184
30201
  async prepareForSerialization(e) {
30185
30202
  var s;
30186
- await it(this, Ke, n6).call(this), it(this, Ke, s6).call(this);
30203
+ await it(this, Ze, n6).call(this), it(this, Ze, s6).call(this);
30187
30204
  const r = /* @__PURE__ */ new Set();
30188
30205
  for (const i of Y(this, ce).commands)
30189
30206
  i.$Intent && r.add(i.$Intent.name);
@@ -30194,7 +30211,7 @@ const a6 = class qd {
30194
30211
  throw new Error(`Missing intent resolver for ${i}`);
30195
30212
  n.push(Y(this, An).get(i));
30196
30213
  }
30197
- n.push(kB()), await it(this, Ke, Ep).call(this, n, e);
30214
+ n.push(kB()), await it(this, Ze, Ep).call(this, n, e);
30198
30215
  }
30199
30216
  };
30200
30217
  Cs = /* @__PURE__ */ new WeakMap();
@@ -30206,7 +30223,7 @@ dr = /* @__PURE__ */ new WeakMap();
30206
30223
  Tr = /* @__PURE__ */ new WeakMap();
30207
30224
  ns = /* @__PURE__ */ new WeakMap();
30208
30225
  ce = /* @__PURE__ */ new WeakMap();
30209
- Ke = /* @__PURE__ */ new WeakSet();
30226
+ Ze = /* @__PURE__ */ new WeakSet();
30210
30227
  r6 = function() {
30211
30228
  const t = new a6();
30212
30229
  return Ce(t, ce, Y(this, ce)), Ce(t, Cs, Y(this, Cs)), Ce(t, js, Y(this, js)), Ce(t, An, Y(this, An)), Ce(t, Tr, Y(this, Tr)), Ce(t, dr, new Set(Y(this, dr))), Ce(t, ns, Y(this, ns)), Y(this, nn).push(Y(t, nn)), Y(this, lr).push(Y(t, lr)), t;
@@ -30233,19 +30250,19 @@ xc = function(t, e) {
30233
30250
  return Y(this, nn).push(e), Y(this, ce).addInput(t, e);
30234
30251
  };
30235
30252
  kc = function(t) {
30236
- return fp(t) ? this.pure(t) : it(this, Ke, Hc).call(this, t);
30253
+ return fp(t) ? this.pure(t) : it(this, Ze, Hc).call(this, t);
30237
30254
  };
30238
30255
  Hc = function(t) {
30239
30256
  if (typeof t == "function") {
30240
30257
  const e = this.add(t);
30241
- return typeof e == "function" ? it(this, Ke, Hc).call(this, e) : Ge(Me, e);
30258
+ return typeof e == "function" ? it(this, Ze, Hc).call(this, e) : qe(Me, e);
30242
30259
  }
30243
- return Ge(Me, t);
30260
+ return qe(Me, t);
30244
30261
  };
30245
30262
  Gd = async function(t) {
30246
30263
  if (!t.onlyTransactionKind && !Y(this, ce).sender)
30247
30264
  throw new Error("Missing transaction sender");
30248
- await it(this, Ke, Ep).call(this, [...Y(this, js), hB], t);
30265
+ await it(this, Ze, Ep).call(this, [...Y(this, js), hB], t);
30249
30266
  };
30250
30267
  Ep = async function(t, e) {
30251
30268
  try {
@@ -31985,11 +32002,11 @@ class VB {
31985
32002
  return;
31986
32003
  }
31987
32004
  const i = r.val.secret, o = k6(e.destination_swap.chain), c = {
31988
- [Ze.evm]: () => this.evmRedeem(e, i),
31989
- [Ze.bitcoin]: () => this.btcRedeem(e, i),
31990
- [Ze.starknet]: () => this.starknetRedeem(e, i),
31991
- [Ze.solana]: () => this.solRedeem(e, i),
31992
- [Ze.sui]: () => this.suiRedeem(e, i)
32005
+ [Ye.evm]: () => this.evmRedeem(e, i),
32006
+ [Ye.bitcoin]: () => this.btcRedeem(e, i),
32007
+ [Ye.starknet]: () => this.starknetRedeem(e, i),
32008
+ [Ye.solana]: () => this.solRedeem(e, i),
32009
+ [Ye.sui]: () => this.suiRedeem(e, i)
31993
32010
  }[o];
31994
32011
  c ? await c() : this.events.emit(
31995
32012
  "error",
@@ -33274,7 +33291,7 @@ class d6 extends T6 {
33274
33291
  if (!s.ok) return C(s.error);
33275
33292
  const i = s.val;
33276
33293
  switch (r) {
33277
- case Ze.evm:
33294
+ case Ye.evm:
33278
33295
  if (!this._htlcs.evm || !Um(i))
33279
33296
  return C("Order type does not match EVM blockchain type");
33280
33297
  {
@@ -33285,7 +33302,7 @@ class d6 extends T6 {
33285
33302
  return C(`EVM HTLC initiation failed: ${o.error}`);
33286
33303
  }
33287
33304
  break;
33288
- case Ze.solana:
33305
+ case Ye.solana:
33289
33306
  if (!this._htlcs.solana || !Fm(i))
33290
33307
  return C("Order type does not match Solana blockchain type");
33291
33308
  {
@@ -33296,7 +33313,7 @@ class d6 extends T6 {
33296
33313
  return C(`Solana HTLC initiation failed: ${o.error}`);
33297
33314
  }
33298
33315
  break;
33299
- case Ze.starknet:
33316
+ case Ye.starknet:
33300
33317
  if (!this._htlcs.starknet || !Mm(i))
33301
33318
  return C("Order type does not match Starknet blockchain type");
33302
33319
  {
@@ -33309,7 +33326,7 @@ class d6 extends T6 {
33309
33326
  );
33310
33327
  }
33311
33328
  break;
33312
- case Ze.sui:
33329
+ case Ye.sui:
33313
33330
  if (!this._htlcs.sui || !jm(i))
33314
33331
  return C("Order type does not match Sui blockchain type");
33315
33332
  {
@@ -33320,7 +33337,7 @@ class d6 extends T6 {
33320
33337
  return C(`Sui HTLC initiation failed: ${o.error}`);
33321
33338
  }
33322
33339
  break;
33323
- case Ze.bitcoin:
33340
+ case Ye.bitcoin:
33324
33341
  return ne(i);
33325
33342
  default:
33326
33343
  return C("Unsupported blockchain type for swap initiation");
@@ -33407,25 +33424,25 @@ class d6 extends T6 {
33407
33424
  if (this._redeemServiceEnabled && r && r[e])
33408
33425
  return ne(r[e]);
33409
33426
  switch (e) {
33410
- case Ze.evm:
33427
+ case Ye.evm:
33411
33428
  return this._htlcs.evm ? ne(this._htlcs.evm.htlcActorAddress) : C(
33412
33429
  "Please provide evmHTLC when initializing garden or pass EVM address in SwapParams"
33413
33430
  );
33414
- case Ze.bitcoin: {
33431
+ case Ye.bitcoin: {
33415
33432
  const s = (n = this._htlcs.bitcoin) == null ? void 0 : n.getPublicKey;
33416
33433
  return !s || !xk(s) ? C(
33417
33434
  "Invalid btc public key or pass Bitcoin address in SwapParams"
33418
- ) : ne(Ve(s));
33435
+ ) : ne(Ge(s));
33419
33436
  }
33420
- case Ze.solana:
33437
+ case Ye.solana:
33421
33438
  return this._htlcs.solana ? ne(this._htlcs.solana.htlcActorAddress) : C(
33422
33439
  "Please provide solanaHTLC when initializing garden or pass Solana address in SwapParams"
33423
33440
  );
33424
- case Ze.starknet:
33441
+ case Ye.starknet:
33425
33442
  return this._htlcs.starknet ? ne(this._htlcs.starknet.htlcActorAddress) : C(
33426
33443
  "Please provide starknetHTLC when initializing garden or pass Starknet address in SwapParams"
33427
33444
  );
33428
- case Ze.sui:
33445
+ case Ye.sui:
33429
33446
  return this._htlcs.sui ? ne(this._htlcs.sui.htlcActorAddress) : C(
33430
33447
  "Please provide suiHTLC when initializing garden or pass Sui address in SwapParams"
33431
33448
  );
@@ -33692,7 +33709,7 @@ export {
33692
33709
  kk as q,
33693
33710
  $0 as r,
33694
33711
  ut as s,
33695
- Ve as t,
33712
+ Ge as t,
33696
33713
  oP as u,
33697
33714
  W9 as v,
33698
33715
  np as w,