@babylonlabs-io/ts-sdk 3.3.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/dist/{BTCVaultRegistry.abi-BzNTa_EU.js → BTCVaultRegistry.abi-DnP4UkB5.js} +9 -140
  2. package/dist/BTCVaultRegistry.abi-DnP4UkB5.js.map +1 -0
  3. package/dist/{BTCVaultRegistry.abi-BH2-LHxN.cjs → BTCVaultRegistry.abi-DzbfZ9_s.cjs} +2 -2
  4. package/dist/BTCVaultRegistry.abi-DzbfZ9_s.cjs.map +1 -0
  5. package/dist/{PayoutManager-xEGvTbhL.js → PayoutManager-BUWP-H-q.js} +3 -3
  6. package/dist/PayoutManager-BUWP-H-q.js.map +1 -0
  7. package/dist/{PayoutManager-B1Ev0r7o.cjs → PayoutManager-Dopxq_Jv.cjs} +2 -2
  8. package/dist/PayoutManager-Dopxq_Jv.cjs.map +1 -0
  9. package/dist/PeginManager-CMbRRTnr.cjs +2 -0
  10. package/dist/{PeginManager-Co43rW_x.cjs.map → PeginManager-CMbRRTnr.cjs.map} +1 -1
  11. package/dist/{PeginManager-BJnUgW8C.js → PeginManager-Cas6_j7t.js} +118 -107
  12. package/dist/{PeginManager-BJnUgW8C.js.map → PeginManager-Cas6_j7t.js.map} +1 -1
  13. package/dist/{ProtocolParams.abi-Cv77fsUe.js → ProtocolParams.abi-CuDl7AuC.js} +3 -3
  14. package/dist/{ProtocolParams.abi-Cv77fsUe.js.map → ProtocolParams.abi-CuDl7AuC.js.map} +1 -1
  15. package/dist/{ProtocolParams.abi-BgEZaQ2I.cjs → ProtocolParams.abi-DWfIh6VH.cjs} +2 -2
  16. package/dist/{ProtocolParams.abi-BgEZaQ2I.cjs.map → ProtocolParams.abi-DWfIh6VH.cjs.map} +1 -1
  17. package/dist/VaultErrors.abi-Dc3UnB_h.js +5 -0
  18. package/dist/{VaultErrors.abi-Boz4w97c.js.map → VaultErrors.abi-Dc3UnB_h.js.map} +1 -1
  19. package/dist/VaultErrors.abi-Hjn1CdLs.cjs +2 -0
  20. package/dist/{VaultErrors.abi-DQ18kM0L.cjs.map → VaultErrors.abi-Hjn1CdLs.cjs.map} +1 -1
  21. package/dist/buildAndBroadcastReclaim-CVmG3ldA.cjs +2 -0
  22. package/dist/buildAndBroadcastReclaim-CVmG3ldA.cjs.map +1 -0
  23. package/dist/{buildAndBroadcastReclaim-CQANDXVJ.js → buildAndBroadcastReclaim-XRWuJWVL.js} +48 -50
  24. package/dist/buildAndBroadcastReclaim-XRWuJWVL.js.map +1 -0
  25. package/dist/{challengeAssert-C3eMcM5Y.cjs → challengeAssert-BE6Wm4x1.cjs} +2 -2
  26. package/dist/challengeAssert-BE6Wm4x1.cjs.map +1 -0
  27. package/dist/{challengeAssert-B2otuf7y.js → challengeAssert-DUKSjirl.js} +3 -3
  28. package/dist/challengeAssert-DUKSjirl.js.map +1 -0
  29. package/dist/constants-BCg6O0PX.cjs +2 -0
  30. package/dist/constants-BCg6O0PX.cjs.map +1 -0
  31. package/dist/constants-CmDDuM3L.js +50 -0
  32. package/dist/constants-CmDDuM3L.js.map +1 -0
  33. package/dist/{index-BRsWXDlv.js → index-B-9aXMxk.js} +6 -6
  34. package/dist/{index-BRsWXDlv.js.map → index-B-9aXMxk.js.map} +1 -1
  35. package/dist/{index-C6avwx1s.cjs → index-Dn7RlsKK.cjs} +2 -2
  36. package/dist/{index-C6avwx1s.cjs.map → index-Dn7RlsKK.cjs.map} +1 -1
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.js +16 -16
  39. package/dist/pegin-registration-client-DLlaZbsZ.cjs +2 -0
  40. package/dist/pegin-registration-client-DLlaZbsZ.cjs.map +1 -0
  41. package/dist/{pegin-registration-client-Cvjk4ILq.js → pegin-registration-client-ZI0k10_3.js} +90 -96
  42. package/dist/pegin-registration-client-ZI0k10_3.js.map +1 -0
  43. package/dist/{primeVpAuth-D4UWXQ76.js → primeVpAuth-C-ET0XF4.js} +2 -2
  44. package/dist/{primeVpAuth-D4UWXQ76.js.map → primeVpAuth-C-ET0XF4.js.map} +1 -1
  45. package/dist/{primeVpAuth-CXNXYKrh.cjs → primeVpAuth-Ch-ig2My.cjs} +2 -2
  46. package/dist/{primeVpAuth-CXNXYKrh.cjs.map → primeVpAuth-Ch-ig2My.cjs.map} +1 -1
  47. package/dist/registration-records-CKc0OVuK.cjs +2 -0
  48. package/dist/registration-records-CKc0OVuK.cjs.map +1 -0
  49. package/dist/{registration-records-DJJC2NiO.js → registration-records-D39ApuHS.js} +141 -141
  50. package/dist/registration-records-D39ApuHS.js.map +1 -0
  51. package/dist/shared/index.cjs.map +1 -1
  52. package/dist/shared/index.js.map +1 -1
  53. package/dist/shared/wallets/interfaces/BitcoinWallet.d.ts +5 -0
  54. package/dist/shared/wallets/interfaces/BitcoinWallet.d.ts.map +1 -1
  55. package/dist/{signer-set-reader-GrFe_rsW.cjs → signer-set-reader-CJfV-GDz.cjs} +2 -2
  56. package/dist/{signer-set-reader-GrFe_rsW.cjs.map → signer-set-reader-CJfV-GDz.cjs.map} +1 -1
  57. package/dist/{signer-set-reader-CSUe92zE.js → signer-set-reader-DiwLeqik.js} +3 -3
  58. package/dist/{signer-set-reader-CSUe92zE.js.map → signer-set-reader-DiwLeqik.js.map} +1 -1
  59. package/dist/tbv/core/clients/eth/index.cjs +1 -1
  60. package/dist/tbv/core/clients/eth/index.js +4 -4
  61. package/dist/tbv/core/clients/eth/protocol-params-validation.d.ts.map +1 -1
  62. package/dist/tbv/core/clients/eth/registration-logs-error.d.ts +6 -6
  63. package/dist/tbv/core/clients/eth/registration-records.d.ts +1 -1
  64. package/dist/tbv/core/clients/eth/types.d.ts +12 -13
  65. package/dist/tbv/core/clients/eth/types.d.ts.map +1 -1
  66. package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts +1 -1
  67. package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts.map +1 -1
  68. package/dist/tbv/core/clients/index.cjs +1 -1
  69. package/dist/tbv/core/clients/index.js +6 -6
  70. package/dist/tbv/core/clients/vault-provider/status/index.cjs +1 -1
  71. package/dist/tbv/core/clients/vault-provider/status/index.js +1 -1
  72. package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts +5 -111
  73. package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts.map +1 -1
  74. package/dist/tbv/core/contracts/abis/ProtocolParams.abi.d.ts +2 -2
  75. package/dist/tbv/core/contracts/abis/vaultErrors.abi.json.d.ts +1 -1
  76. package/dist/tbv/core/contracts/index.cjs +1 -1
  77. package/dist/tbv/core/contracts/index.js +3 -3
  78. package/dist/tbv/core/deposit-terms/__tests__/rebuildDepositTermsCore.test.d.ts +1 -1
  79. package/dist/tbv/core/deposit-terms/commissionCeiling.d.ts +1 -1
  80. package/dist/tbv/core/deposit-terms/depositTerms.d.ts +5 -5
  81. package/dist/tbv/core/deposit-terms/rebuildDepositTermsCore.d.ts.map +1 -1
  82. package/dist/tbv/core/index.cjs +1 -1
  83. package/dist/tbv/core/index.js +16 -16
  84. package/dist/tbv/core/managers/PeginManager.d.ts +2 -1
  85. package/dist/tbv/core/managers/PeginManager.d.ts.map +1 -1
  86. package/dist/tbv/core/managers/index.cjs +1 -1
  87. package/dist/tbv/core/managers/index.js +2 -2
  88. package/dist/tbv/core/primitives/__tests__/vaultCoreVersion.test.d.ts +1 -1
  89. package/dist/tbv/core/primitives/index.cjs +1 -1
  90. package/dist/tbv/core/primitives/index.js +3 -3
  91. package/dist/tbv/core/primitives/psbt/__tests__/deriveExpectedPeginPayoutScriptPubKey.test.d.ts +1 -1
  92. package/dist/tbv/core/primitives/psbt/assertWasmPeginSizing.d.ts.map +1 -1
  93. package/dist/tbv/core/primitives/psbt/constants.d.ts +38 -13
  94. package/dist/tbv/core/primitives/psbt/constants.d.ts.map +1 -1
  95. package/dist/tbv/core/primitives/psbt/depositorClaim.d.ts +3 -6
  96. package/dist/tbv/core/primitives/psbt/depositorClaim.d.ts.map +1 -1
  97. package/dist/tbv/core/primitives/psbt/pegin.d.ts +3 -5
  98. package/dist/tbv/core/primitives/psbt/pegin.d.ts.map +1 -1
  99. package/dist/tbv/core/recovery/peginParamsCandidates.d.ts +1 -1
  100. package/dist/tbv/core/recovery/reconstructPeginParams.d.ts.map +1 -1
  101. package/dist/tbv/core/services/delegated-claim/__tests__/realWasmWatchtowerArtifacts.test.d.ts +2 -2
  102. package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts +2 -1
  103. package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts.map +1 -1
  104. package/dist/tbv/core/services/delegated-claim/deriveClaimerWotsKeypair.d.ts +1 -1
  105. package/dist/tbv/core/services/delegated-claim/deriveClaimerWotsKeypair.d.ts.map +1 -1
  106. package/dist/tbv/core/services/delegated-claim/planDelegatedClaimSigning.d.ts +2 -1
  107. package/dist/tbv/core/services/delegated-claim/planDelegatedClaimSigning.d.ts.map +1 -1
  108. package/dist/tbv/core/services/delegated-claim/readDelegatedClaimVaultContext.d.ts +1 -1
  109. package/dist/tbv/core/services/delegated-claim/readDelegatedClaimVaultContext.d.ts.map +1 -1
  110. package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts +3 -3
  111. package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts.map +1 -1
  112. package/dist/tbv/core/services/delegated-claim/types.d.ts +5 -6
  113. package/dist/tbv/core/services/delegated-claim/types.d.ts.map +1 -1
  114. package/dist/tbv/core/services/deposit/__tests__/signDepositorGraph.realGraph.test.d.ts +3 -3
  115. package/dist/tbv/core/services/deposit/signDepositorGraph.d.ts.map +1 -1
  116. package/dist/tbv/core/services/index.cjs +1 -1
  117. package/dist/tbv/core/services/index.js +2 -2
  118. package/dist/tbv/core/wasm/index.cjs.map +1 -1
  119. package/dist/tbv/core/wasm/index.d.ts +8 -11
  120. package/dist/tbv/core/wasm/index.d.ts.map +1 -1
  121. package/dist/tbv/core/wasm/index.js.map +1 -1
  122. package/dist/tbv/index.cjs +1 -1
  123. package/dist/tbv/index.js +16 -16
  124. package/dist/toRefundInputs-BSQjDOK9.cjs +2 -0
  125. package/dist/toRefundInputs-BSQjDOK9.cjs.map +1 -0
  126. package/dist/{toRefundInputs-Dzw1cteD.js → toRefundInputs-BbbvPb2A.js} +175 -173
  127. package/dist/toRefundInputs-BbbvPb2A.js.map +1 -0
  128. package/dist/{types-BC2TGzcp.cjs → types-BnZIbDHb.cjs} +2 -2
  129. package/dist/types-BnZIbDHb.cjs.map +1 -0
  130. package/dist/{types-24A9Qoxb.js → types-K_aM5GZO.js} +39 -39
  131. package/dist/types-K_aM5GZO.js.map +1 -0
  132. package/dist/{verifyKeyPathSchnorrSignature-IIj3Z2se.js → verifyKeyPathSchnorrSignature-DPXOFOol.js} +2 -2
  133. package/dist/{verifyKeyPathSchnorrSignature-IIj3Z2se.js.map → verifyKeyPathSchnorrSignature-DPXOFOol.js.map} +1 -1
  134. package/dist/{verifyKeyPathSchnorrSignature-BRTpEH9X.cjs → verifyKeyPathSchnorrSignature-DcxCojp0.cjs} +2 -2
  135. package/dist/{verifyKeyPathSchnorrSignature-BRTpEH9X.cjs.map → verifyKeyPathSchnorrSignature-DcxCojp0.cjs.map} +1 -1
  136. package/dist/verifyScriptPathSchnorrSignature-CgDa9Rcg.cjs +2 -0
  137. package/dist/verifyScriptPathSchnorrSignature-CgDa9Rcg.cjs.map +1 -0
  138. package/dist/{verifyScriptPathSchnorrSignature-owu3BfyT.js → verifyScriptPathSchnorrSignature-D-fdi-sG.js} +462 -459
  139. package/dist/verifyScriptPathSchnorrSignature-D-fdi-sG.js.map +1 -0
  140. package/package.json +3 -3
  141. package/dist/BTCVaultRegistry.abi-BH2-LHxN.cjs.map +0 -1
  142. package/dist/BTCVaultRegistry.abi-BzNTa_EU.js.map +0 -1
  143. package/dist/PayoutManager-B1Ev0r7o.cjs.map +0 -1
  144. package/dist/PayoutManager-xEGvTbhL.js.map +0 -1
  145. package/dist/PeginManager-Co43rW_x.cjs +0 -2
  146. package/dist/VaultErrors.abi-Boz4w97c.js +0 -5
  147. package/dist/VaultErrors.abi-DQ18kM0L.cjs +0 -2
  148. package/dist/buildAndBroadcastReclaim-CQANDXVJ.js.map +0 -1
  149. package/dist/buildAndBroadcastReclaim-DPk36Uhp.cjs +0 -2
  150. package/dist/buildAndBroadcastReclaim-DPk36Uhp.cjs.map +0 -1
  151. package/dist/challengeAssert-B2otuf7y.js.map +0 -1
  152. package/dist/challengeAssert-C3eMcM5Y.cjs.map +0 -1
  153. package/dist/constants-CAm10Qwp.cjs +0 -2
  154. package/dist/constants-CAm10Qwp.cjs.map +0 -1
  155. package/dist/constants-CvQZuxKv.js +0 -48
  156. package/dist/constants-CvQZuxKv.js.map +0 -1
  157. package/dist/pegin-registration-client-CdRyXP3j.cjs +0 -2
  158. package/dist/pegin-registration-client-CdRyXP3j.cjs.map +0 -1
  159. package/dist/pegin-registration-client-Cvjk4ILq.js.map +0 -1
  160. package/dist/registration-records-DJJC2NiO.js.map +0 -1
  161. package/dist/registration-records-XQMIKjGV.cjs +0 -2
  162. package/dist/registration-records-XQMIKjGV.cjs.map +0 -1
  163. package/dist/toRefundInputs-DTuWi--u.cjs +0 -2
  164. package/dist/toRefundInputs-DTuWi--u.cjs.map +0 -1
  165. package/dist/toRefundInputs-Dzw1cteD.js.map +0 -1
  166. package/dist/types-24A9Qoxb.js.map +0 -1
  167. package/dist/types-BC2TGzcp.cjs.map +0 -1
  168. package/dist/verifyScriptPathSchnorrSignature-CahYx5Td.cjs +0 -2
  169. package/dist/verifyScriptPathSchnorrSignature-CahYx5Td.cjs.map +0 -1
  170. package/dist/verifyScriptPathSchnorrSignature-owu3BfyT.js.map +0 -1
@@ -1,11 +1,11 @@
1
- var J = Object.defineProperty;
2
- var Z = (t, e, n) => e in t ? J(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var b = (t, e, n) => Z(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { s as $, b as N, a as tt } from "./secp256k1-BuxBFUHm.js";
5
- import { c as et, H as nt, r as x, a as R, h as F, b as B, s as A } from "./sha2-YqVHJiFj.js";
6
- import { j as E } from "./constants-CvQZuxKv.js";
7
- import { isAddress as ot, keccak256 as it, encodeAbiParameters as st } from "viem";
8
- const rt = /* @__PURE__ */ Uint8Array.from([
1
+ var Z = Object.defineProperty;
2
+ var tt = (t, e, n) => e in t ? Z(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var b = (t, e, n) => tt(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { s as x, b as F, a as et } from "./secp256k1-BuxBFUHm.js";
5
+ import { c as nt, H as ot, r as $, a as R, h as U, b as B, s as A } from "./sha2-YqVHJiFj.js";
6
+ import { j as E, k as _, M as S } from "./constants-CmDDuM3L.js";
7
+ import { isAddress as it, keccak256 as st, encodeAbiParameters as rt } from "viem";
8
+ const ut = /* @__PURE__ */ Uint8Array.from([
9
9
  7,
10
10
  4,
11
11
  13,
@@ -22,36 +22,36 @@ const rt = /* @__PURE__ */ Uint8Array.from([
22
22
  14,
23
23
  11,
24
24
  8
25
- ]), U = Uint8Array.from(new Array(16).fill(0).map((t, e) => e)), ut = U.map((t) => (9 * t + 5) % 16), L = /* @__PURE__ */ (() => {
26
- const n = [[U], [ut]];
25
+ ]), O = Uint8Array.from(new Array(16).fill(0).map((t, e) => e)), ct = O.map((t) => (9 * t + 5) % 16), L = /* @__PURE__ */ (() => {
26
+ const n = [[O], [ct]];
27
27
  for (let o = 0; o < 4; o++)
28
28
  for (let i of n)
29
- i.push(i[o].map((u) => rt[u]));
29
+ i.push(i[o].map((u) => ut[u]));
30
30
  return n;
31
- })(), O = L[0], H = L[1], K = /* @__PURE__ */ [
31
+ })(), M = L[0], H = L[1], K = /* @__PURE__ */ [
32
32
  [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],
33
33
  [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],
34
34
  [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],
35
35
  [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],
36
36
  [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5]
37
- ].map((t) => Uint8Array.from(t)), ct = /* @__PURE__ */ O.map((t, e) => t.map((n) => K[e][n])), ft = /* @__PURE__ */ H.map((t, e) => t.map((n) => K[e][n])), at = /* @__PURE__ */ Uint32Array.from([
37
+ ].map((t) => Uint8Array.from(t)), at = /* @__PURE__ */ M.map((t, e) => t.map((n) => K[e][n])), ft = /* @__PURE__ */ H.map((t, e) => t.map((n) => K[e][n])), lt = /* @__PURE__ */ Uint32Array.from([
38
38
  0,
39
39
  1518500249,
40
40
  1859775393,
41
41
  2400959708,
42
42
  2840853838
43
- ]), lt = /* @__PURE__ */ Uint32Array.from([
43
+ ]), ht = /* @__PURE__ */ Uint32Array.from([
44
44
  1352829926,
45
45
  1548603684,
46
46
  1836072691,
47
47
  2053994217,
48
48
  0
49
49
  ]);
50
- function _(t, e, n, o) {
50
+ function V(t, e, n, o) {
51
51
  return t === 0 ? e ^ n ^ o : t === 1 ? e & n | ~e & o : t === 2 ? (e | ~n) ^ o : t === 3 ? e & o | n & ~o : e ^ (n | ~o);
52
52
  }
53
53
  const I = /* @__PURE__ */ new Uint32Array(16);
54
- class ht extends nt {
54
+ class dt extends ot {
55
55
  constructor() {
56
56
  super(64, 20, 8, !0);
57
57
  b(this, "h0", 1732584193);
@@ -61,28 +61,28 @@ class ht extends nt {
61
61
  b(this, "h4", -1009589776);
62
62
  }
63
63
  get() {
64
- const { h0: n, h1: o, h2: i, h3: u, h4: a } = this;
65
- return [n, o, i, u, a];
64
+ const { h0: n, h1: o, h2: i, h3: u, h4: f } = this;
65
+ return [n, o, i, u, f];
66
66
  }
67
- set(n, o, i, u, a) {
68
- this.h0 = n | 0, this.h1 = o | 0, this.h2 = i | 0, this.h3 = u | 0, this.h4 = a | 0;
67
+ set(n, o, i, u, f) {
68
+ this.h0 = n | 0, this.h1 = o | 0, this.h2 = i | 0, this.h3 = u | 0, this.h4 = f | 0;
69
69
  }
70
70
  process(n, o) {
71
71
  for (let r = 0; r < 16; r++, o += 4)
72
72
  I[r] = n.getUint32(o, !0);
73
- let i = this.h0 | 0, u = i, a = this.h1 | 0, h = a, d = this.h2 | 0, p = d, m = this.h3 | 0, P = m, s = this.h4 | 0, c = s;
73
+ let i = this.h0 | 0, u = i, f = this.h1 | 0, h = f, d = this.h2 | 0, p = d, m = this.h3 | 0, y = m, s = this.h4 | 0, c = s;
74
74
  for (let r = 0; r < 5; r++) {
75
- const f = 4 - r, g = at[r], z = lt[r], Y = O[r], G = H[r], Q = ct[r], q = ft[r];
75
+ const a = 4 - r, g = lt[r], Y = ht[r], G = M[r], Q = H[r], q = at[r], J = ft[r];
76
76
  for (let l = 0; l < 16; l++) {
77
- const C = x(i + _(r, a, d, m) + I[Y[l]] + g, Q[l]) + s | 0;
78
- i = s, s = m, m = x(d, 10) | 0, d = a, a = C;
77
+ const v = $(i + V(r, f, d, m) + I[G[l]] + g, q[l]) + s | 0;
78
+ i = s, s = m, m = $(d, 10) | 0, d = f, f = v;
79
79
  }
80
80
  for (let l = 0; l < 16; l++) {
81
- const C = x(u + _(f, h, p, P) + I[G[l]] + z, q[l]) + c | 0;
82
- u = c, c = P, P = x(p, 10) | 0, p = h, h = C;
81
+ const v = $(u + V(a, h, p, y) + I[Q[l]] + Y, J[l]) + c | 0;
82
+ u = c, c = y, y = $(p, 10) | 0, p = h, h = v;
83
83
  }
84
84
  }
85
- this.set(this.h1 + d + P | 0, this.h2 + m + c | 0, this.h3 + s + u | 0, this.h4 + i + h | 0, this.h0 + a + p | 0);
85
+ this.set(this.h1 + d + y | 0, this.h2 + m + c | 0, this.h3 + s + u | 0, this.h4 + i + h | 0, this.h0 + f + p | 0);
86
86
  }
87
87
  roundClean() {
88
88
  R(I);
@@ -91,80 +91,80 @@ class ht extends nt {
91
91
  this.destroyed = !0, R(this.buffer), this.set(0, 0, 0, 0, 0);
92
92
  }
93
93
  }
94
- const dt = /* @__PURE__ */ et(() => new ht()), y = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn, mt = 7n;
95
- function pt(t, e, n) {
94
+ const mt = /* @__PURE__ */ nt(() => new dt()), P = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn, pt = 7n;
95
+ function gt(t, e, n) {
96
96
  let o = 1n, i = t % n, u = e;
97
97
  for (; u > 0n; )
98
98
  (u & 1n) === 1n && (o = o * i % n), i = i * i % n, u >>= 1n;
99
99
  return o;
100
100
  }
101
- function gt(t) {
101
+ function bt(t) {
102
102
  const e = BigInt(`0x${t}`);
103
- if (e >= y) return !1;
104
- const o = (e * e % y * e % y + mt) % y, i = pt(
103
+ if (e >= P) return !1;
104
+ const o = (e * e % P * e % P + pt) % P, i = gt(
105
105
  o,
106
- y + 1n >> 2n,
107
- y
106
+ P + 1n >> 2n,
107
+ P
108
108
  );
109
- return i * i % y === o;
109
+ return i * i % P === o;
110
110
  }
111
- function D(t, e) {
111
+ function X(t, e) {
112
112
  const n = t.toLowerCase();
113
113
  if (!/^0x[0-9a-f]{64}$/.test(n))
114
114
  throw new Error(
115
115
  `${e} returned an unexpected value (length ${n.length}, prefix "${n.slice(0, 2)}")`
116
116
  );
117
117
  const o = n.slice(2);
118
- if (!gt(o))
118
+ if (!bt(o))
119
119
  throw new Error(
120
120
  `${e} returned a value that is not on the secp256k1 curve`
121
121
  );
122
122
  return o;
123
123
  }
124
- const bt = "5120", T = "0014", yt = 20, S = 33, Pt = 65, $t = 2, xt = 3, It = 4;
125
- function M(t, e) {
124
+ const Pt = "5120", T = "0014", yt = 20, N = 33, xt = 65, $t = 2, It = 3, wt = 4;
125
+ function D(t, e) {
126
126
  const n = t.startsWith("0x") || t.startsWith("0X") ? t.slice(2) : t;
127
127
  if (!/^(?:[0-9a-fA-F]{2})+$/.test(n))
128
128
  throw new Error(`${e} must be non-empty, even-length hex`);
129
129
  return `0x${n.toLowerCase()}`;
130
130
  }
131
- function wt(t) {
132
- const e = F(t), n = $.utils.lift_x(BigInt(`0x${t}`)), o = $.utils.bytesToNumberBE(
133
- $.utils.taggedHash("TapTweak", e)
131
+ function Et(t) {
132
+ const e = U(t), n = x.utils.lift_x(BigInt(`0x${t}`)), o = x.utils.bytesToNumberBE(
133
+ x.utils.taggedHash("TapTweak", e)
134
134
  );
135
- if (o >= N.CURVE.n)
135
+ if (o >= F.CURVE.n)
136
136
  throw new Error("Proof of possession BTC pubkey has an invalid TapTweak");
137
- const i = o === 0n ? n : n.add($.Point.BASE.multiply(o));
138
- return `0x${bt}${B(
139
- $.utils.pointToBytes(i)
137
+ const i = o === 0n ? n : n.add(x.Point.BASE.multiply(o));
138
+ return `0x${Pt}${B(
139
+ x.utils.pointToBytes(i)
140
140
  )}`;
141
141
  }
142
- function Et(t) {
143
- const e = M(t, "depositorBtcPubkeyRaw"), n = F(e.slice(2));
142
+ function Ct(t) {
143
+ const e = D(t, "depositorBtcPubkeyRaw"), n = U(e.slice(2));
144
144
  if (n.length === 32)
145
145
  return {
146
- xOnlyPubkey: D(e, "Payout BTC pubkey")
146
+ xOnlyPubkey: X(e, "Payout BTC pubkey")
147
147
  };
148
- const o = n.length === S && (n[0] === $t || n[0] === xt), i = n.length === Pt && n[0] === It;
148
+ const o = n.length === N && (n[0] === $t || n[0] === It), i = n.length === xt && n[0] === wt;
149
149
  if (!o && !i)
150
150
  throw new Error(
151
151
  "depositorBtcPubkeyRaw must be x-only, compressed, or uncompressed"
152
152
  );
153
153
  try {
154
- N.Point.fromBytes(n);
154
+ F.Point.fromBytes(n);
155
155
  } catch {
156
156
  throw new Error("depositorBtcPubkeyRaw is not a valid BTC pubkey");
157
157
  }
158
158
  return {
159
- xOnlyPubkey: B(n.subarray(1, S)),
159
+ xOnlyPubkey: B(n.subarray(1, N)),
160
160
  compressedPubkey: o ? n : void 0
161
161
  };
162
162
  }
163
163
  function vt(t) {
164
- return `0x${T}${B(dt(A(t)))}`;
164
+ return `0x${T}${B(mt(A(t)))}`;
165
165
  }
166
166
  function Ht(t, e, n) {
167
- const o = M(
167
+ const o = D(
168
168
  t,
169
169
  "depositorPayoutScriptPubKey"
170
170
  );
@@ -172,27 +172,27 @@ function Ht(t, e, n) {
172
172
  throw new Error(
173
173
  `depositorPayoutScriptPubKey exceeds ${E} bytes`
174
174
  );
175
- const i = e.startsWith("0x") || e.startsWith("0X") ? e.slice(2) : e, u = D(
175
+ const i = e.startsWith("0x") || e.startsWith("0X") ? e.slice(2) : e, u = X(
176
176
  `0x${i}`,
177
177
  "Proof of possession BTC pubkey"
178
- ), a = Et(n);
179
- if (a.xOnlyPubkey !== u)
178
+ ), f = Ct(n);
179
+ if (f.xOnlyPubkey !== u)
180
180
  throw new Error(
181
181
  "depositorBtcPubkeyRaw does not match the proof of possession BTC pubkey"
182
182
  );
183
- if (o === wt(u))
183
+ if (o === Et(u))
184
184
  return o;
185
185
  if (o.startsWith(`0x${T}`) && o.length === 2 + T.length + yt * 2) {
186
- if (!a.compressedPubkey)
186
+ if (!f.compressedPubkey)
187
187
  throw new Error("A P2WPKH payout requires a compressed BTC pubkey");
188
- if (o === vt(a.compressedPubkey))
188
+ if (o === vt(f.compressedPubkey))
189
189
  return o;
190
190
  }
191
191
  throw new Error(
192
192
  "depositorPayoutScriptPubKey does not match the proof of possession BTC pubkey"
193
193
  );
194
194
  }
195
- function Ct(t, e) {
195
+ function kt(t, e) {
196
196
  const n = t.startsWith("0x") ? t.slice(2) : t;
197
197
  if (n.length === 0 || n.length % 2 !== 0)
198
198
  throw new Error(`${e} must be non-empty, even-length hex`);
@@ -203,12 +203,12 @@ function Ct(t, e) {
203
203
  o[i] = Number.parseInt(n.slice(i * 2, i * 2 + 2), 16);
204
204
  return o;
205
205
  }
206
- function kt(t) {
206
+ function At(t) {
207
207
  return Array.from(t, (e) => e.toString(16).padStart(2, "0")).join(
208
208
  ""
209
209
  );
210
210
  }
211
- function At(t) {
211
+ function Tt(t) {
212
212
  const e = new Uint8Array(
213
213
  t.reduce((o, i) => o + i.length, 0)
214
214
  );
@@ -217,7 +217,7 @@ function At(t) {
217
217
  e.set(o, n), n += o.length;
218
218
  return e;
219
219
  }
220
- function Tt(t) {
220
+ function Bt(t) {
221
221
  let e = 0;
222
222
  const n = (s, c) => {
223
223
  if (!Number.isSafeInteger(s) || s < 0)
@@ -228,28 +228,28 @@ function Tt(t) {
228
228
  return e += s, r;
229
229
  }, o = (s, c) => {
230
230
  const r = n(s, c);
231
- let f = 0n;
231
+ let a = 0n;
232
232
  for (let g = r.length - 1; g >= 0; g--)
233
- f = f << 8n | BigInt(r[g]);
234
- return f;
233
+ a = a << 8n | BigInt(r[g]);
234
+ return a;
235
235
  }, i = (s) => {
236
236
  const c = e, r = n(1, s)[0];
237
- let f;
237
+ let a;
238
238
  if (r < 253)
239
- f = BigInt(r);
239
+ a = BigInt(r);
240
240
  else if (r === 253) {
241
- if (f = o(2, s), f < 0xfdn) throw new Error(`Non-canonical ${s}`);
241
+ if (a = o(2, s), a < 0xfdn) throw new Error(`Non-canonical ${s}`);
242
242
  } else if (r === 254) {
243
- if (f = o(4, s), f <= 0xffffn) throw new Error(`Non-canonical ${s}`);
244
- } else if (f = o(8, s), f <= 0xffffffffn) throw new Error(`Non-canonical ${s}`);
245
- if (f > BigInt(Number.MAX_SAFE_INTEGER))
243
+ if (a = o(4, s), a <= 0xffffn) throw new Error(`Non-canonical ${s}`);
244
+ } else if (a = o(8, s), a <= 0xffffffffn) throw new Error(`Non-canonical ${s}`);
245
+ if (a > BigInt(Number.MAX_SAFE_INTEGER))
246
246
  throw new Error(`${s} exceeds JavaScript's safe integer range`);
247
247
  return {
248
248
  encoded: t.slice(c, e),
249
- value: Number(f)
249
+ value: Number(a)
250
250
  };
251
- }, u = n(4, "version"), a = t[e] === 0 && t[e + 1] === 1;
252
- a && (e += 2);
251
+ }, u = n(4, "version"), f = t[e] === 0 && t[e + 1] === 1;
252
+ f && (e += 2);
253
253
  const h = i("input count"), d = [];
254
254
  for (let s = 0; s < h.value; s++) {
255
255
  const c = e;
@@ -264,75 +264,75 @@ function Tt(t) {
264
264
  const r = i(`output ${s} script length`);
265
265
  n(r.value, `output ${s} script`), m.push(t.slice(c, e));
266
266
  }
267
- if (a) {
267
+ if (f) {
268
268
  let s = !1;
269
269
  for (let c = 0; c < h.value; c++) {
270
270
  const r = i(`input ${c} witness item count`);
271
271
  s || (s = r.value > 0);
272
- for (let f = 0; f < r.value; f++) {
272
+ for (let a = 0; a < r.value; a++) {
273
273
  const g = i(
274
- `input ${c} witness item ${f} length`
274
+ `input ${c} witness item ${a} length`
275
275
  );
276
- n(g.value, `input ${c} witness item ${f}`);
276
+ n(g.value, `input ${c} witness item ${a}`);
277
277
  }
278
278
  }
279
279
  if (!s)
280
280
  throw new Error("Bitcoin transaction has superfluous witness marker");
281
281
  }
282
- const P = n(4, "locktime");
282
+ const y = n(4, "locktime");
283
283
  if (e !== t.length)
284
284
  throw new Error(
285
285
  `Bitcoin transaction has ${t.length - e} trailing byte(s)`
286
286
  );
287
- return At([
287
+ return Tt([
288
288
  u,
289
289
  h.encoded,
290
290
  ...d,
291
291
  p.encoded,
292
292
  ...m,
293
- P
293
+ y
294
294
  ]);
295
295
  }
296
- function Bt(t) {
297
- const e = Tt(
298
- Ct(t, "transactionHex")
296
+ function Rt(t) {
297
+ const e = Bt(
298
+ kt(t, "transactionHex")
299
299
  ), n = A(A(e));
300
- return n.reverse(), `0x${kt(n)}`;
300
+ return n.reverse(), `0x${At(n)}`;
301
301
  }
302
302
  function Kt(t, e) {
303
303
  const n = t.startsWith("0x") ? t : `0x${t}`;
304
304
  if (!/^0x[0-9a-fA-F]{64}$/.test(n))
305
305
  throw new Error("peginTxHash must be a 32-byte hex value");
306
306
  const o = e.startsWith("0x") ? e : `0x${e}`;
307
- if (!ot(o, { strict: !0 }))
307
+ if (!it(o, { strict: !0 }))
308
308
  throw new Error(`Invalid depositor Ethereum address: ${e}`);
309
- return it(
310
- st(
309
+ return st(
310
+ rt(
311
311
  [{ type: "bytes32" }, { type: "address" }],
312
312
  [n, o]
313
313
  )
314
314
  ).slice(2);
315
315
  }
316
- const X = "VaultClaimableByNotFoundError";
317
- class Rt extends Error {
318
- constructor(e, n, o, i, u = "the vault has not been redeemed for this key, or the node did not serve the block. Redeem first, or try again.", a) {
316
+ const W = "VaultClaimableByNotFoundError";
317
+ class _t extends Error {
318
+ constructor(e, n, o, i, u = "the vault has not been redeemed for this key, or the node did not serve the block. Redeem first, or try again.", f) {
319
319
  super(
320
320
  `No VaultClaimableBy log for vault ${e} and claimer ${n} in blocks ${o}..${i}: ${u}`,
321
- a
322
- ), this.vaultId = e, this.claimerPk = n, this.fromBlock = o, this.toBlock = i, this.name = X;
321
+ f
322
+ ), this.vaultId = e, this.claimerPk = n, this.fromBlock = o, this.toBlock = i, this.name = W;
323
323
  }
324
324
  }
325
- function Dt(t) {
326
- return t instanceof Rt ? !0 : typeof t != "object" || t === null ? !1 : t.name === X;
325
+ function Xt(t) {
326
+ return t instanceof _t ? !0 : typeof t != "object" || t === null ? !1 : t.name === W;
327
327
  }
328
- const k = 65535, V = 1e4, v = 4294967295, w = 255;
329
- function Mt(t) {
330
- if (!Number.isInteger(t) || t < 0 || t > v)
328
+ const k = 65535, C = 4294967295, w = 255;
329
+ function Dt(t) {
330
+ if (!Number.isInteger(t) || t < 0 || t > C)
331
331
  throw new Error(
332
332
  `Invalid offchainParamsVersion from contract: must be a uint32, got ${t}`
333
333
  );
334
334
  }
335
- function _t(t) {
335
+ function St(t) {
336
336
  const e = [];
337
337
  if (t.timelockAssert <= 0n && e.push(
338
338
  `timelockAssert must be positive, got ${t.timelockAssert}`
@@ -346,22 +346,22 @@ function _t(t) {
346
346
  `minPeginFeeRate must be positive, got ${t.minPeginFeeRate}`
347
347
  ), (!Number.isInteger(t.proverCircuitVersion) || t.proverCircuitVersion < 0 || t.proverCircuitVersion > k) && e.push(
348
348
  `proverCircuitVersion must be a uint16, got ${t.proverCircuitVersion}`
349
- ), (!Number.isInteger(t.minPrepeginDepth) || t.minPrepeginDepth <= 0 || t.minPrepeginDepth > v) && e.push(
350
- `minPrepeginDepth must be a uint32 in [1, ${v}], got ${t.minPrepeginDepth}`
349
+ ), (!Number.isInteger(t.minPrepeginDepth) || t.minPrepeginDepth <= 0 || t.minPrepeginDepth > C) && e.push(
350
+ `minPrepeginDepth must be a uint32 in [1, ${C}], got ${t.minPrepeginDepth}`
351
351
  ), t.babeTotalInstances <= 0 && e.push(
352
352
  `babeTotalInstances must be positive, got ${t.babeTotalInstances}`
353
353
  ), t.babeInstancesToFinalize <= 0 && e.push(
354
354
  `babeInstancesToFinalize must be positive, got ${t.babeInstancesToFinalize}`
355
355
  ), t.babeInstancesToFinalize > t.babeTotalInstances && e.push(
356
356
  `babeInstancesToFinalize (${t.babeInstancesToFinalize}) exceeds babeTotalInstances (${t.babeTotalInstances})`
357
- ), (t.minVpCommissionBps < 0 || t.minVpCommissionBps > V) && e.push(
358
- `minVpCommissionBps must be in [0, ${V}], got ${t.minVpCommissionBps}`
357
+ ), (t.maxVpCommissionBps < _ || t.maxVpCommissionBps >= S) && e.push(
358
+ `maxVpCommissionBps must be in [${_}, ${S}), got ${t.maxVpCommissionBps}`
359
359
  ), e.length > 0)
360
360
  throw new Error(
361
361
  `Invalid offchain protocol parameters: ${e.join("; ")}`
362
362
  );
363
363
  }
364
- function St(t) {
364
+ function Vt(t) {
365
365
  const e = [];
366
366
  if (t.minimumPegInAmount <= 0n && e.push(
367
367
  `minimumPegInAmount must be positive, got ${t.minimumPegInAmount}`
@@ -380,70 +380,70 @@ function St(t) {
380
380
  ), e.length > 0)
381
381
  throw new Error(`Invalid TBV protocol parameters: ${e.join("; ")}`);
382
382
  }
383
- function Xt(t) {
384
- if (St(t), _t(t.offchainParams), !Number.isInteger(t.offchainParamsVersion) || t.offchainParamsVersion < 0 || t.offchainParamsVersion > v)
383
+ function Wt(t) {
384
+ if (Vt(t), St(t.offchainParams), !Number.isInteger(t.offchainParamsVersion) || t.offchainParamsVersion < 0 || t.offchainParamsVersion > C)
385
385
  throw new Error(
386
386
  `Invalid peg-in configuration: offchainParamsVersion must be a uint32, got ${t.offchainParamsVersion}`
387
387
  );
388
- tt(
388
+ et(
389
389
  t.activeVaultCoreVersion,
390
390
  "ProtocolParams.activeVaultCoreVersion()"
391
391
  );
392
392
  }
393
- const W = "RegistrationLogsUnavailableError";
394
- class j extends Error {
393
+ const j = "RegistrationLogsUnavailableError";
394
+ class z extends Error {
395
395
  /**
396
- * `message` replaces the empty-answer wording for the partial-answer shapes
397
- * that are not "no logs at all"; the caller names which logs it did get.
396
+ * `message` replaces the empty-answer wording when the block's logs arrived
397
+ * but none is for the vault asked for; the caller names that vault.
398
398
  */
399
399
  constructor(n, o) {
400
400
  super(
401
401
  o ?? `The Ethereum node returned no registration logs for block ${n}, which holds a vault registration; the node may not have indexed that block yet. Try again.`
402
402
  );
403
403
  b(this, "blockNumber");
404
- this.name = W, this.blockNumber = n;
404
+ this.name = j, this.blockNumber = n;
405
405
  }
406
406
  }
407
- function Wt(t) {
408
- return t instanceof j ? !0 : typeof t != "object" || t === null ? !1 : t.name === W;
407
+ function jt(t) {
408
+ return t instanceof z ? !0 : typeof t != "object" || t === null ? !1 : t.name === j;
409
409
  }
410
- const Vt = 2;
411
- function jt(t, e, n) {
410
+ const Nt = 2;
411
+ function zt(t, e, n) {
412
412
  const o = e.toLowerCase(), i = t.find((u) => u.vaultId === o);
413
413
  if (i === void 0)
414
- throw new j(
414
+ throw new z(
415
415
  n,
416
- `Vault ${e} has no PegInSubmittedV2 registration log at its on-chain registration block ${n}: either the node served a partial answer for block ${n} (retry, preferably another node) or the vault was not registered in this block`
416
+ `Vault ${e} has no PegInSubmitted registration log at its on-chain registration block ${n}: either the node served a partial answer for block ${n} (retry, preferably another node) or the vault was not registered in this block`
417
417
  );
418
418
  return i;
419
419
  }
420
- function zt(t) {
421
- return Bt(t.unsignedPrePeginTx);
422
- }
423
420
  function Yt(t) {
424
- const e = (t.depositorPayoutScriptPubKey.length - Vt) / 2;
421
+ return Rt(t.unsignedPrePeginTx);
422
+ }
423
+ function Gt(t) {
424
+ const e = (t.depositorPayoutScriptPubKey.length - Nt) / 2;
425
425
  if (e === 0 || e > E)
426
426
  throw new Error(
427
- `PegInSubmittedV2 log for vault ${t.vaultId} carries a ${e}-byte depositorPayoutBtcAddress; expected 1..${E} bytes`
427
+ `PegInSubmitted log for vault ${t.vaultId} carries a ${e}-byte depositorPayoutBtcAddress; expected 1..${E} bytes`
428
428
  );
429
429
  }
430
430
  export {
431
- j as R,
432
- Rt as V,
433
- D as a,
434
- Xt as b,
435
- St as c,
431
+ z as R,
432
+ _t as V,
433
+ X as a,
434
+ Wt as b,
435
+ Vt as c,
436
436
  Kt as d,
437
- Wt as e,
438
- Yt as f,
439
- jt as g,
440
- Bt as h,
441
- Dt as i,
442
- Mt as j,
437
+ jt as e,
438
+ Gt as f,
439
+ zt as g,
440
+ Rt as h,
441
+ Xt as i,
442
+ Dt as j,
443
443
  Ht as k,
444
- dt as l,
445
- wt as m,
446
- zt as r,
447
- _t as v
444
+ mt as l,
445
+ Et as m,
446
+ Yt as r,
447
+ St as v
448
448
  };
449
- //# sourceMappingURL=registration-records-DJJC2NiO.js.map
449
+ //# sourceMappingURL=registration-records-D39ApuHS.js.map