@babylonlabs-io/ts-sdk 0.33.1 → 0.33.2

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 (36) hide show
  1. package/dist/{PeginManager-LeGYbRN2.js → PeginManager-BtXhdqkm.js} +4 -4
  2. package/dist/{PeginManager-LeGYbRN2.js.map → PeginManager-BtXhdqkm.js.map} +1 -1
  3. package/dist/{PeginManager-D2pBM0E-.cjs → PeginManager-ztgWQqza.cjs} +2 -2
  4. package/dist/{PeginManager-D2pBM0E-.cjs.map → PeginManager-ztgWQqza.cjs.map} +1 -1
  5. package/dist/{buildAndBroadcastRefund-CK8MbGQh.js → buildAndBroadcastRefund-Ci_pVTNu.js} +2 -2
  6. package/dist/{buildAndBroadcastRefund-CK8MbGQh.js.map → buildAndBroadcastRefund-Ci_pVTNu.js.map} +1 -1
  7. package/dist/{buildAndBroadcastRefund-BXjYAqdb.cjs → buildAndBroadcastRefund-DKr9hbDn.cjs} +2 -2
  8. package/dist/{buildAndBroadcastRefund-BXjYAqdb.cjs.map → buildAndBroadcastRefund-DKr9hbDn.cjs.map} +1 -1
  9. package/dist/index.cjs +1 -1
  10. package/dist/index.js +4 -4
  11. package/dist/tbv/core/clients/index.cjs +1 -1
  12. package/dist/tbv/core/clients/index.js +2 -2
  13. package/dist/tbv/core/clients/vault-provider/api.d.ts +2 -0
  14. package/dist/tbv/core/clients/vault-provider/api.d.ts.map +1 -1
  15. package/dist/tbv/core/clients/vault-provider/json-rpc-client.d.ts +9 -0
  16. package/dist/tbv/core/clients/vault-provider/json-rpc-client.d.ts.map +1 -1
  17. package/dist/tbv/core/index.cjs +1 -1
  18. package/dist/tbv/core/index.js +4 -4
  19. package/dist/tbv/core/services/index.cjs +1 -1
  20. package/dist/tbv/core/services/index.js +1 -1
  21. package/dist/tbv/index.cjs +1 -1
  22. package/dist/tbv/index.js +4 -4
  23. package/dist/types-PthVHz5q.cjs +2 -0
  24. package/dist/types-PthVHz5q.cjs.map +1 -0
  25. package/dist/{types-D1o_3Q__.js → types-SYvSQWnc.js} +128 -87
  26. package/dist/types-SYvSQWnc.js.map +1 -0
  27. package/dist/{vault-registry-reader-DdUgC5IF.cjs → vault-registry-reader-CmDdymw4.cjs} +2 -2
  28. package/dist/vault-registry-reader-CmDdymw4.cjs.map +1 -0
  29. package/dist/{vault-registry-reader-BeIEh62N.js → vault-registry-reader-eiBfG4uQ.js} +117 -116
  30. package/dist/vault-registry-reader-eiBfG4uQ.js.map +1 -0
  31. package/package.json +1 -1
  32. package/dist/types-C2IUB0Jd.cjs +0 -2
  33. package/dist/types-C2IUB0Jd.cjs.map +0 -1
  34. package/dist/types-D1o_3Q__.js.map +0 -1
  35. package/dist/vault-registry-reader-BeIEh62N.js.map +0 -1
  36. package/dist/vault-registry-reader-DdUgC5IF.cjs.map +0 -1
@@ -2,8 +2,8 @@ var oe = Object.defineProperty;
2
2
  var ce = (n, e, t) => e in n ? oe(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var l = (n, e, t) => ce(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { B as le, H as f, K as ue, T as pe } from "./validation-CxqROCno.js";
5
- import { D as de, J as G, B as b } from "./types-D1o_3Q__.js";
6
- import { X as v, C as O, s as _, S as he, h as me } from "./bitcoin-0_T6KJON.js";
5
+ import { D as de, J as G, B as b } from "./types-SYvSQWnc.js";
6
+ import { X as v, C as F, s as _, S as he, h as me } from "./bitcoin-0_T6KJON.js";
7
7
  import * as $ from "@bitcoin-js/tiny-secp256k1-asmjs";
8
8
  import { payments as ye, Transaction as I } from "bitcoinjs-lib";
9
9
  import { Buffer as y } from "buffer";
@@ -13,13 +13,13 @@ async function k(n, e) {
13
13
  const t = new AbortController(), r = setTimeout(
14
14
  () => t.abort(),
15
15
  U
16
- ), i = [t.signal, e == null ? void 0 : e.signal].filter(
16
+ ), a = [t.signal, e == null ? void 0 : e.signal].filter(
17
17
  Boolean
18
18
  );
19
19
  try {
20
20
  return await fetch(n, {
21
21
  ...e,
22
- signal: AbortSignal.any(i)
22
+ signal: AbortSignal.any(a)
23
23
  });
24
24
  } catch (s) {
25
25
  throw clearTimeout(r), s != null && typeof s == "object" && "name" in s && s.name === "AbortError" ? new Error(
@@ -66,9 +66,9 @@ async function T(n, e) {
66
66
  try {
67
67
  const t = await k(n, e);
68
68
  if (!t.ok) {
69
- const i = await t.text();
69
+ const a = await t.text();
70
70
  throw new Error(
71
- `Mempool API error (${t.status}): ${i || t.statusText}`
71
+ `Mempool API error (${t.status}): ${a || t.statusText}`
72
72
  );
73
73
  }
74
74
  const r = t.headers.get("content-type");
@@ -87,12 +87,12 @@ async function Ze(n, e) {
87
87
  }
88
88
  });
89
89
  if (!t.ok) {
90
- const i = await t.text();
90
+ const a = await t.text();
91
91
  let s;
92
92
  try {
93
- s = JSON.parse(i).message;
93
+ s = JSON.parse(a).message;
94
94
  } catch {
95
- s = i;
95
+ s = a;
96
96
  }
97
97
  throw new Error(
98
98
  s || `Failed to broadcast transaction: ${t.statusText}`
@@ -128,14 +128,14 @@ async function tt(n, e, t) {
128
128
  throw new Error(
129
129
  `Invalid vout ${e} for transaction ${n} (has ${r.vout.length} outputs)`
130
130
  );
131
- const i = r.vout[e];
132
- if (!J(i.value))
133
- throw new Error(`Invalid UTXO value ${i.value} for ${n}:${e}`);
134
- return Q(i.scriptpubkey, `${n}:${e}`), {
131
+ const a = r.vout[e];
132
+ if (!J(a.value))
133
+ throw new Error(`Invalid UTXO value ${a.value} for ${n}:${e}`);
134
+ return Q(a.scriptpubkey, `${n}:${e}`), {
135
135
  txid: n,
136
136
  vout: e,
137
- value: i.value,
138
- scriptPubKey: i.scriptpubkey
137
+ value: a.value,
138
+ scriptPubKey: a.scriptpubkey
139
139
  };
140
140
  }
141
141
  async function nt(n, e) {
@@ -176,7 +176,7 @@ function rt(n) {
176
176
  async function st(n, e) {
177
177
  return Y(n), T(`${e}/address/${n}/txs`);
178
178
  }
179
- async function it(n) {
179
+ async function at(n) {
180
180
  const e = await k(`${n}/v1/fees/recommended`);
181
181
  if (!e.ok)
182
182
  throw new Error(
@@ -189,10 +189,10 @@ async function it(n) {
189
189
  "economyFee",
190
190
  "minimumFee"
191
191
  ];
192
- for (const i of r)
193
- if (!ge(t[i]))
192
+ for (const a of r)
193
+ if (!ge(t[a]))
194
194
  throw new Error(
195
- `Invalid fee rate ${i}=${t[i]} from mempool API: expected a positive number ≤ ${W}`
195
+ `Invalid fee rate ${a}=${t[a]} from mempool API: expected a positive number ≤ ${W}`
196
196
  );
197
197
  if (t.minimumFee > t.economyFee || t.economyFee > t.hourFee || t.hourFee > t.halfHourFee || t.halfHourFee > t.fastestFee)
198
198
  throw new Error(
@@ -582,7 +582,7 @@ function o(n) {
582
582
  return ((e = JSON.stringify(n)) == null ? void 0 : e.slice(0, _e)) ?? "undefined";
583
583
  }
584
584
  const Pe = "The vault provider returned an unexpected response. Please try again or contact support.";
585
- class a extends Error {
585
+ class i extends Error {
586
586
  constructor(t) {
587
587
  super(Pe);
588
588
  l(this, "detail");
@@ -598,88 +598,88 @@ function Z(n) {
598
598
  }
599
599
  function ee(n, e) {
600
600
  if (!g(n))
601
- throw new a(
601
+ throw new i(
602
602
  `VP response validation failed: "${e}" must be a non-empty hex string, got ${o(n)}`
603
603
  );
604
604
  }
605
605
  function w(n, e) {
606
606
  if (!Z(n))
607
- throw new a(
607
+ throw new i(
608
608
  `VP response validation failed: "${e}" must be a non-empty string, got ${o(n)}`
609
609
  );
610
610
  }
611
611
  function te(n, e) {
612
- if (!g(n) || n.length !== v && n.length !== O)
613
- throw new a(
614
- `VP response validation failed: "${e}" must be a ${v} or ${O}-char hex string (BTC pubkey), got ${o(n)}`
612
+ if (!g(n) || n.length !== v && n.length !== F)
613
+ throw new i(
614
+ `VP response validation failed: "${e}" must be a ${v} or ${F}-char hex string (BTC pubkey), got ${o(n)}`
615
615
  );
616
616
  }
617
617
  function ve(n) {
618
618
  const e = n.presigning;
619
619
  if (e == null) return;
620
620
  if (typeof e != "object" || Array.isArray(e))
621
- throw new a(
621
+ throw new i(
622
622
  'VP response validation failed: "progress.presigning" must be an object if present'
623
623
  );
624
624
  const t = e;
625
625
  if (t.depositor_graph_created !== void 0 && typeof t.depositor_graph_created != "boolean")
626
- throw new a(
626
+ throw new i(
627
627
  `VP response validation failed: "progress.presigning.depositor_graph_created" must be a boolean if present, got ${o(t.depositor_graph_created)}`
628
628
  );
629
629
  if (t.vk_challenger_presigning_completed !== void 0 && typeof t.vk_challenger_presigning_completed != "number")
630
- throw new a(
630
+ throw new i(
631
631
  `VP response validation failed: "progress.presigning.vk_challenger_presigning_completed" must be a number if present, got ${o(t.vk_challenger_presigning_completed)}`
632
632
  );
633
633
  if (t.vk_challenger_presigning_total !== void 0 && typeof t.vk_challenger_presigning_total != "number")
634
- throw new a(
634
+ throw new i(
635
635
  `VP response validation failed: "progress.presigning.vk_challenger_presigning_total" must be a number if present, got ${o(t.vk_challenger_presigning_total)}`
636
636
  );
637
637
  }
638
638
  function Te(n) {
639
639
  if (n === null || typeof n != "object")
640
- throw new a(
640
+ throw new i(
641
641
  "VP response validation failed: getPeginStatus response is not an object"
642
642
  );
643
643
  const e = n;
644
644
  if (!g(e.pegin_txid) || e.pegin_txid.length !== x)
645
- throw new a(
645
+ throw new i(
646
646
  `VP response validation failed: "pegin_txid" must be a ${x}-char hex string (txid), got ${o(e.pegin_txid)}`
647
647
  );
648
648
  if (typeof e.status != "string")
649
- throw new a(
649
+ throw new i(
650
650
  'VP response validation failed: "status" must be a string'
651
651
  );
652
652
  if (!D.has(e.status))
653
- throw new a(
653
+ throw new i(
654
654
  `VP response validation failed: unrecognized status "${e.status}". Expected one of: ${[...D].join(", ")}`
655
655
  );
656
656
  if (e.progress === null || typeof e.progress != "object" || Array.isArray(e.progress))
657
- throw new a(
657
+ throw new i(
658
658
  'VP response validation failed: "progress" must be an object'
659
659
  );
660
660
  if (ve(e.progress), typeof e.health_info != "string")
661
- throw new a(
661
+ throw new i(
662
662
  'VP response validation failed: "health_info" must be a string'
663
663
  );
664
664
  if (e.last_error !== void 0 && typeof e.last_error != "string")
665
- throw new a(
665
+ throw new i(
666
666
  `VP response validation failed: "last_error" must be a string if present, got ${o(e.last_error)}`
667
667
  );
668
668
  }
669
669
  function xe(n) {
670
670
  if (n === null || typeof n != "object")
671
- throw new a(
671
+ throw new i(
672
672
  "VP response validation failed: requestDepositorPresignTransactions response is not an object"
673
673
  );
674
674
  const e = n;
675
675
  if (!Array.isArray(e.txs))
676
- throw new a(
676
+ throw new i(
677
677
  'VP response validation failed: "txs" must be an array'
678
678
  );
679
679
  for (let t = 0; t < e.txs.length; t++)
680
680
  Ae(e.txs[t], `txs[${t}]`);
681
681
  if (e.depositor_graph === null || typeof e.depositor_graph != "object")
682
- throw new a(
682
+ throw new i(
683
683
  'VP response validation failed: "depositor_graph" must be an object'
684
684
  );
685
685
  Se(
@@ -688,14 +688,14 @@ function xe(n) {
688
688
  }
689
689
  function m(n, e) {
690
690
  if (n === null || typeof n != "object")
691
- throw new a(
691
+ throw new i(
692
692
  `VP response validation failed: "${e}" must be an object`
693
693
  );
694
694
  ee(n.tx_hex, `${e}.tx_hex`);
695
695
  }
696
696
  function Ae(n, e) {
697
697
  if (n === null || typeof n != "object")
698
- throw new a(
698
+ throw new i(
699
699
  `VP response validation failed: "${e}" must be an object`
700
700
  );
701
701
  const t = n;
@@ -703,7 +703,7 @@ function Ae(n, e) {
703
703
  }
704
704
  function Ve(n, e) {
705
705
  if (n === null || typeof n != "object")
706
- throw new a(
706
+ throw new i(
707
707
  `VP response validation failed: "${e}" must be an object`
708
708
  );
709
709
  const t = n;
@@ -711,7 +711,7 @@ function Ve(n, e) {
711
711
  }
712
712
  function $e(n, e) {
713
713
  if (n === null || typeof n != "object")
714
- throw new a(
714
+ throw new i(
715
715
  `VP response validation failed: "${e}" must be an object`
716
716
  );
717
717
  const t = n;
@@ -722,7 +722,7 @@ function $e(n, e) {
722
722
  t.challenge_assert_y_tx,
723
723
  `${e}.challenge_assert_y_tx`
724
724
  ), m(t.nopayout_tx, `${e}.nopayout_tx`), w(t.nopayout_psbt, `${e}.nopayout_psbt`), !Array.isArray(t.challenge_assert_connectors))
725
- throw new a(
725
+ throw new i(
726
726
  `VP response validation failed: "${e}.challenge_assert_connectors" must be an array`
727
727
  );
728
728
  for (let r = 0; r < t.challenge_assert_connectors.length; r++)
@@ -731,7 +731,7 @@ function $e(n, e) {
731
731
  `${e}.challenge_assert_connectors[${r}]`
732
732
  );
733
733
  if (!Array.isArray(t.output_label_hashes))
734
- throw new a(
734
+ throw new i(
735
735
  `VP response validation failed: "${e}.output_label_hashes" must be an array`
736
736
  );
737
737
  for (let r = 0; r < t.output_label_hashes.length; r++)
@@ -742,80 +742,80 @@ function $e(n, e) {
742
742
  }
743
743
  function ke(n) {
744
744
  if (n === null || typeof n != "object")
745
- throw new a(
745
+ throw new i(
746
746
  "VP response validation failed: requestDepositorClaimerArtifacts response is not an object"
747
747
  );
748
748
  const e = n;
749
749
  if (!Z(e.tx_graph_json))
750
- throw new a(
750
+ throw new i(
751
751
  `VP response validation failed: "tx_graph_json" must be a non-empty string, got ${o(e.tx_graph_json)}`
752
752
  );
753
753
  if (!g(e.verifying_key_hex))
754
- throw new a(
754
+ throw new i(
755
755
  `VP response validation failed: "verifying_key_hex" must be a non-empty hex string, got ${o(e.verifying_key_hex)}`
756
756
  );
757
757
  if (e.babe_sessions === null || typeof e.babe_sessions != "object")
758
- throw new a(
758
+ throw new i(
759
759
  'VP response validation failed: "babe_sessions" must be an object'
760
760
  );
761
761
  for (const [t, r] of Object.entries(
762
762
  e.babe_sessions
763
763
  )) {
764
764
  if (r === null || typeof r != "object")
765
- throw new a(
765
+ throw new i(
766
766
  `VP response validation failed: "babe_sessions.${t}" must be an object`
767
767
  );
768
- const i = r;
769
- if (!g(i.decryptor_artifacts_hex))
770
- throw new a(
771
- `VP response validation failed: "babe_sessions.${t}.decryptor_artifacts_hex" must be a non-empty hex string, got ${o(i.decryptor_artifacts_hex)}`
768
+ const a = r;
769
+ if (!g(a.decryptor_artifacts_hex))
770
+ throw new i(
771
+ `VP response validation failed: "babe_sessions.${t}.decryptor_artifacts_hex" must be a non-empty hex string, got ${o(a.decryptor_artifacts_hex)}`
772
772
  );
773
773
  }
774
774
  }
775
775
  function Ce(n) {
776
776
  if (n === null || typeof n != "object")
777
- throw new a(
777
+ throw new i(
778
778
  "VP response validation failed: getPegoutStatus response is not an object"
779
779
  );
780
780
  const e = n;
781
781
  if (!g(e.pegin_txid) || e.pegin_txid.length !== x)
782
- throw new a(
782
+ throw new i(
783
783
  `VP response validation failed: "pegin_txid" must be a ${x}-char hex string (txid), got ${o(e.pegin_txid)}`
784
784
  );
785
785
  if (typeof e.found != "boolean")
786
- throw new a(
786
+ throw new i(
787
787
  `VP response validation failed: "found" must be a boolean, got ${o(e.found)}`
788
788
  );
789
789
  if (e.claimer !== void 0) {
790
790
  if (e.claimer === null || typeof e.claimer != "object")
791
- throw new a(
791
+ throw new i(
792
792
  'VP response validation failed: "claimer" must be an object if present'
793
793
  );
794
794
  const t = e.claimer;
795
795
  if (typeof t.status != "string")
796
- throw new a(
796
+ throw new i(
797
797
  `VP response validation failed: "claimer.status" must be a string, got ${o(t.status)}`
798
798
  );
799
799
  if (typeof t.failed != "boolean")
800
- throw new a(
800
+ throw new i(
801
801
  `VP response validation failed: "claimer.failed" must be a boolean, got ${o(t.failed)}`
802
802
  );
803
803
  }
804
804
  if (e.challenger !== void 0) {
805
805
  if (e.challenger === null || typeof e.challenger != "object")
806
- throw new a(
806
+ throw new i(
807
807
  'VP response validation failed: "challenger" must be an object if present'
808
808
  );
809
809
  const t = e.challenger;
810
810
  if (typeof t.status != "string")
811
- throw new a(
811
+ throw new i(
812
812
  `VP response validation failed: "challenger.status" must be a string, got ${o(t.status)}`
813
813
  );
814
814
  }
815
815
  }
816
816
  function Se(n) {
817
817
  if (m(n.claim_tx, "depositor_graph.claim_tx"), m(n.assert_tx, "depositor_graph.assert_tx"), m(n.payout_tx, "depositor_graph.payout_tx"), w(n.payout_psbt, "depositor_graph.payout_psbt"), !Array.isArray(n.challenger_presign_data))
818
- throw new a(
818
+ throw new i(
819
819
  'VP response validation failed: "depositor_graph.challenger_presign_data" must be an array'
820
820
  );
821
821
  for (let e = 0; e < n.challenger_presign_data.length; e++)
@@ -824,7 +824,7 @@ function Se(n) {
824
824
  `depositor_graph.challenger_presign_data[${e}]`
825
825
  );
826
826
  if (typeof n.offchain_params_version != "number")
827
- throw new a(
827
+ throw new i(
828
828
  'VP response validation failed: "depositor_graph.offchain_params_version" must be a number'
829
829
  );
830
830
  }
@@ -839,7 +839,8 @@ class Ie {
839
839
  retryDelay: t == null ? void 0 : t.retryDelay,
840
840
  retryableFor: t == null ? void 0 : t.retryableFor,
841
841
  headers: t == null ? void 0 : t.headers,
842
- tokenProvider: t == null ? void 0 : t.tokenProvider
842
+ tokenProvider: t == null ? void 0 : t.tokenProvider,
843
+ maxResponseBytes: t == null ? void 0 : t.maxResponseBytes
843
844
  };
844
845
  this.client = new G(r);
845
846
  }
@@ -901,24 +902,24 @@ class Ie {
901
902
  return Ce(r), r;
902
903
  }
903
904
  }
904
- const Be = "BIP0322-signed-message", Fe = "TapTweak", ne = 32, Oe = 64;
905
+ const Be = "BIP0322-signed-message", Re = "TapTweak", ne = 32, Fe = 64;
905
906
  function re(n, e) {
906
- const t = new TextEncoder().encode(n), r = K(t), i = new Uint8Array(r.length * 2 + e.length);
907
- return i.set(r, 0), i.set(r, r.length), i.set(e, r.length * 2), K(i);
907
+ const t = new TextEncoder().encode(n), r = K(t), a = new Uint8Array(r.length * 2 + e.length);
908
+ return a.set(r, 0), a.set(r, r.length), a.set(e, r.length * 2), K(a);
908
909
  }
909
- function Re(n) {
910
+ function Oe(n) {
910
911
  if (n.length !== ne) return null;
911
- const e = re(Fe, n), t = $.xOnlyPointAddTweak(n, e);
912
+ const e = re(Re, n), t = $.xOnlyPointAddTweak(n, e);
912
913
  return t ? t.xOnlyPubkey : null;
913
914
  }
914
915
  function Ne(n, e, t) {
915
- if (e.length !== ne || t.length !== Oe) return !1;
916
+ if (e.length !== ne || t.length !== Fe) return !1;
916
917
  try {
917
- const r = re(Be, n), i = ye.p2tr({
918
+ const r = re(Be, n), a = ye.p2tr({
918
919
  internalPubkey: y.from(e)
919
920
  });
920
- if (!i.output) return !1;
921
- const s = i.output, c = 0, d = new I();
921
+ if (!a.output) return !1;
922
+ const s = a.output, c = 0, d = new I();
922
923
  d.version = 0, d.locktime = 0;
923
924
  const S = y.concat([
924
925
  y.from([0, 32]),
@@ -942,7 +943,7 @@ function Ne(n, e, t) {
942
943
  [s],
943
944
  [c],
944
945
  I.SIGHASH_DEFAULT
945
- ), H = Re(e);
946
+ ), H = Oe(e);
946
947
  return H ? $.verifySchnorr(N, H, t) : !1;
947
948
  } catch {
948
949
  return !1;
@@ -967,17 +968,17 @@ function A(n, e) {
967
968
  s & 255
968
969
  ]);
969
970
  }
970
- const i = new Uint8Array(9);
971
- i[0] = t | 27;
971
+ const a = new Uint8Array(9);
972
+ a[0] = t | 27;
972
973
  for (let s = 7; s >= 0; s--)
973
- i[1 + s] = Number(r >> BigInt((7 - s) * 8)) & 255;
974
- return i;
974
+ a[1 + s] = Number(r >> BigInt((7 - s) * 8)) & 255;
975
+ return a;
975
976
  }
976
977
  function se(...n) {
977
- const e = n.reduce((i, s) => i + s.length, 0), t = new Uint8Array(e);
978
+ const e = n.reduce((a, s) => a + s.length, 0), t = new Uint8Array(e);
978
979
  let r = 0;
979
- for (const i of n)
980
- t.set(i, r), r += i.length;
980
+ for (const a of n)
981
+ t.set(a, r), r += a.length;
981
982
  return t;
982
983
  }
983
984
  function j(n) {
@@ -991,8 +992,8 @@ function He(n, e, t) {
991
992
  throw new Error(
992
993
  `encodeServerIdentityPayload: expires_at must be a non-negative safe integer, got ${t}`
993
994
  );
994
- const r = A(4, 3), i = j(n), s = j(e), c = A(0, t);
995
- return se(r, i, s, c);
995
+ const r = A(4, 3), a = j(n), s = j(e), c = A(0, t);
996
+ return se(r, a, s, c);
996
997
  }
997
998
  const Ke = new TextEncoder().encode(
998
999
  "btc-auth.server-identity.v1"
@@ -1009,10 +1010,10 @@ function P(n) {
1009
1010
  return e;
1010
1011
  }
1011
1012
  function Ue(n) {
1012
- const { proof: e, pinnedServerPubkey: t, now: r } = n, i = _(t).toLowerCase();
1013
- if (i.length !== v || !f.test(i))
1013
+ const { proof: e, pinnedServerPubkey: t, now: r } = n, a = _(t).toLowerCase();
1014
+ if (a.length !== v || !f.test(a))
1014
1015
  throw new u(
1015
- `pinnedServerPubkey must be 32-byte hex; got ${i.length} chars`,
1016
+ `pinnedServerPubkey must be 32-byte hex; got ${a.length} chars`,
1016
1017
  "invalid_pubkey_encoding"
1017
1018
  );
1018
1019
  const s = _(e.server_pubkey).toLowerCase();
@@ -1021,9 +1022,9 @@ function Ue(n) {
1021
1022
  `server_pubkey must be 32-byte hex; got ${s.length} chars`,
1022
1023
  "invalid_pubkey_encoding"
1023
1024
  );
1024
- if (s !== i)
1025
+ if (s !== a)
1025
1026
  throw new u(
1026
- `server_pubkey does not match pinned value: expected ${i}, got ${s}`,
1027
+ `server_pubkey does not match pinned value: expected ${a}, got ${s}`,
1027
1028
  "pinned_pubkey_mismatch"
1028
1029
  );
1029
1030
  if (!Number.isSafeInteger(e.expires_at))
@@ -1042,7 +1043,7 @@ function Ue(n) {
1042
1043
  "expired"
1043
1044
  );
1044
1045
  const c = _(e.ephemeral_pubkey).toLowerCase();
1045
- if (c.length !== O || !f.test(c))
1046
+ if (c.length !== F || !f.test(c))
1046
1047
  throw new u(
1047
1048
  `ephemeral_pubkey must be 33-byte compressed hex; got ${c.length} chars`,
1048
1049
  "invalid_ephemeral_pubkey"
@@ -1080,13 +1081,13 @@ const De = /* @__PURE__ */ new Set([
1080
1081
  "vaultProvider_submitDepositorWotsKey",
1081
1082
  "vaultProvider_submitDepositorPresignatures",
1082
1083
  "vaultProvider_requestDepositorPresignTransactions"
1083
- ]), je = 6e4, R = "auth_createDepositorToken";
1084
- function ie(n, e) {
1084
+ ]), je = 6e4, O = "auth_createDepositorToken";
1085
+ function ae(n, e) {
1085
1086
  return new G({
1086
1087
  baseUrl: n,
1087
1088
  timeout: je,
1088
1089
  headers: e,
1089
- retryableFor: (t) => t === R
1090
+ retryableFor: (t) => t === O
1090
1091
  });
1091
1092
  }
1092
1093
  const M = 4102444800, Me = 30;
@@ -1120,7 +1121,7 @@ class Le {
1120
1121
  * guard. Returning `null` here breaks that recursion deterministically.
1121
1122
  */
1122
1123
  async getToken(e) {
1123
- if (e === R || !this.authGatedMethods.has(e)) return null;
1124
+ if (e === O || !this.authGatedMethods.has(e)) return null;
1124
1125
  const t = this.cached;
1125
1126
  return t && this.now() + this.refreshSkewSecs < t.expiresAt ? t.token : (await this.acquireSingleFlight()).token;
1126
1127
  }
@@ -1147,7 +1148,7 @@ class Le {
1147
1148
  if (e) return e;
1148
1149
  const t = (async () => {
1149
1150
  try {
1150
- const r = await this.client.call(R, {
1151
+ const r = await this.client.call(O, {
1151
1152
  pegin_txid: this.peginTxid,
1152
1153
  auth_anchor: this.authAnchorHex
1153
1154
  });
@@ -1159,10 +1160,10 @@ class Le {
1159
1160
  throw new Error(
1160
1161
  `VpTokenProvider: invalid token in acquire response (expected non-empty string, got ${typeof r.token})`
1161
1162
  );
1162
- const i = this.now();
1163
- if (!Number.isSafeInteger(r.expires_at) || r.expires_at <= i || r.expires_at > M)
1163
+ const a = this.now();
1164
+ if (!Number.isSafeInteger(r.expires_at) || r.expires_at <= a || r.expires_at > M)
1164
1165
  throw new Error(
1165
- `VpTokenProvider: invalid expires_at in acquire response (got ${JSON.stringify(r.expires_at)}; must be a safe integer in (${i}, ${M}])`
1166
+ `VpTokenProvider: invalid expires_at in acquire response (got ${JSON.stringify(r.expires_at)}; must be a safe integer in (${a}, ${M}])`
1166
1167
  );
1167
1168
  const s = {
1168
1169
  token: r.token,
@@ -1239,13 +1240,13 @@ class Xe {
1239
1240
  return this.entries.size;
1240
1241
  }
1241
1242
  }
1242
- const ae = new Xe();
1243
- function at(n) {
1243
+ const ie = new Xe();
1244
+ function it(n) {
1244
1245
  var r;
1245
- const e = ie(
1246
+ const e = ae(
1246
1247
  n.baseUrl,
1247
1248
  (r = n.options) == null ? void 0 : r.headers
1248
- ), t = ae.getOrCreate({
1249
+ ), t = ie.getOrCreate({
1249
1250
  client: e,
1250
1251
  peginTxid: n.peginTxid,
1251
1252
  authAnchorHex: n.authAnchorHex,
@@ -1257,8 +1258,8 @@ function at(n) {
1257
1258
  });
1258
1259
  }
1259
1260
  function ot(n) {
1260
- ae.getOrCreate({
1261
- client: ie(n.baseUrl, n.headers),
1261
+ ie.getOrCreate({
1262
+ client: ae(n.baseUrl, n.headers),
1262
1263
  peginTxid: n.peginTxid,
1263
1264
  authAnchorHex: n.authAnchorHex,
1264
1265
  pinnedServerPubkey: n.pinnedServerPubkey
@@ -1286,7 +1287,7 @@ async function ct(n, e) {
1286
1287
  };
1287
1288
  }
1288
1289
  const L = 65535;
1289
- function F(n) {
1290
+ function R(n) {
1290
1291
  return {
1291
1292
  timelockAssert: n.timelockAssert,
1292
1293
  timelockChallengeAssert: n.timelockChallengeAssert,
@@ -1337,7 +1338,7 @@ class lt {
1337
1338
  abi: h,
1338
1339
  functionName: "getLatestOffchainParams"
1339
1340
  });
1340
- return F(e);
1341
+ return R(e);
1341
1342
  }
1342
1343
  async getOffchainParamsByVersion(e) {
1343
1344
  const t = await this.publicClient.readContract({
@@ -1346,7 +1347,7 @@ class lt {
1346
1347
  functionName: "getOffchainParamsByVersion",
1347
1348
  args: [e]
1348
1349
  });
1349
- return F(t);
1350
+ return R(t);
1350
1351
  }
1351
1352
  async getLatestOffchainParamsVersion() {
1352
1353
  return await this.publicClient.readContract({
@@ -1378,7 +1379,7 @@ class lt {
1378
1379
  }
1379
1380
  ],
1380
1381
  allowFailure: !1
1381
- }), t = X(e[0]), r = F(e[1]);
1382
+ }), t = X(e[0]), r = R(e[1]);
1382
1383
  return {
1383
1384
  minimumPegInAmount: t.minimumPegInAmount,
1384
1385
  maxPegInAmount: t.maxPegInAmount,
@@ -1479,12 +1480,12 @@ class dt {
1479
1480
  throw new Error(
1480
1481
  `getVaultProviderBTCKey returned an unexpected value (vp=${e}, length ${r.length}, prefix "${r.slice(0, 2)}")`
1481
1482
  );
1482
- const i = r.slice(2);
1483
- if (!$.isXOnlyPoint(me(i)))
1483
+ const a = r.slice(2);
1484
+ if (!$.isXOnlyPoint(me(a)))
1484
1485
  throw new Error(
1485
1486
  `getVaultProviderBTCKey returned a value that is not on the secp256k1 curve (vp=${e})`
1486
1487
  );
1487
- return i;
1488
+ return a;
1488
1489
  }
1489
1490
  async getVaultBasicInfo(e) {
1490
1491
  const t = await this.publicClient.readContract({
@@ -1544,16 +1545,16 @@ export {
1544
1545
  Ie as V,
1545
1546
  nt as a,
1546
1547
  rt as b,
1547
- it as c,
1548
+ at as c,
1548
1549
  et as d,
1549
1550
  we as e,
1550
1551
  tt as f,
1551
1552
  st as g,
1552
- a as h,
1553
+ i as h,
1553
1554
  Ue as i,
1554
1555
  Xe as j,
1555
- ae as k,
1556
- at as l,
1556
+ ie as k,
1557
+ it as l,
1557
1558
  ot as m,
1558
1559
  lt as n,
1559
1560
  pt as o,
@@ -1563,4 +1564,4 @@ export {
1563
1564
  dt as s,
1564
1565
  ke as v
1565
1566
  };
1566
- //# sourceMappingURL=vault-registry-reader-BeIEh62N.js.map
1567
+ //# sourceMappingURL=vault-registry-reader-eiBfG4uQ.js.map