@gardenfi/core 0.2.0-beta.72 → 0.2.0-beta.74

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 (276) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +15 -14
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +55 -41
  5. package/dist/index100.cjs +1 -0
  6. package/dist/index100.js +37 -0
  7. package/dist/index101.cjs +1 -0
  8. package/dist/index101.js +369 -0
  9. package/dist/index102.cjs +1 -0
  10. package/dist/index102.js +23 -0
  11. package/dist/index103.cjs +1 -0
  12. package/dist/index103.js +58 -0
  13. package/dist/index104.cjs +1 -0
  14. package/dist/index104.js +5 -0
  15. package/dist/index105.cjs +1 -0
  16. package/dist/index105.js +51 -0
  17. package/dist/index106.cjs +1 -0
  18. package/dist/index106.js +28 -0
  19. package/dist/index107.cjs +1 -0
  20. package/dist/index107.js +4 -0
  21. package/dist/index108.cjs +1 -0
  22. package/dist/index108.js +4 -0
  23. package/dist/index109.cjs +1 -0
  24. package/dist/index109.js +64 -0
  25. package/dist/index11.cjs +1 -1
  26. package/dist/index11.js +2 -2
  27. package/dist/index110.cjs +1 -0
  28. package/dist/index110.js +37 -0
  29. package/dist/index111.cjs +1 -0
  30. package/dist/index111.js +7 -0
  31. package/dist/index112.cjs +1 -0
  32. package/dist/index112.js +4 -0
  33. package/dist/index113.cjs +1 -0
  34. package/dist/index113.js +60 -0
  35. package/dist/index114.cjs +1 -0
  36. package/dist/index114.js +4 -0
  37. package/dist/index115.cjs +1 -0
  38. package/dist/index115.js +42 -0
  39. package/dist/index116.cjs +1 -0
  40. package/dist/index116.js +45 -0
  41. package/dist/index117.cjs +1 -0
  42. package/dist/index117.js +20 -0
  43. package/dist/index118.cjs +1 -0
  44. package/dist/index118.js +111 -0
  45. package/dist/index119.cjs +1 -0
  46. package/dist/index119.js +23 -0
  47. package/dist/index120.cjs +1 -0
  48. package/dist/index120.js +228 -0
  49. package/dist/index121.cjs +1 -0
  50. package/dist/index121.js +6 -0
  51. package/dist/index122.cjs +1 -0
  52. package/dist/index122.js +160 -0
  53. package/dist/index123.cjs +1 -0
  54. package/dist/index123.js +4 -0
  55. package/dist/index124.cjs +1 -0
  56. package/dist/index124.js +75 -0
  57. package/dist/index125.cjs +1 -0
  58. package/dist/index125.js +107 -0
  59. package/dist/index126.cjs +1 -0
  60. package/dist/index126.js +15 -0
  61. package/dist/index127.cjs +1 -0
  62. package/dist/index127.js +35 -0
  63. package/dist/index128.cjs +1 -0
  64. package/dist/index128.js +4 -0
  65. package/dist/index129.cjs +1 -0
  66. package/dist/index129.js +32 -0
  67. package/dist/index130.cjs +1 -0
  68. package/dist/index130.js +21 -0
  69. package/dist/index131.cjs +1 -0
  70. package/dist/index131.js +4 -0
  71. package/dist/index132.cjs +1 -0
  72. package/dist/index132.js +358 -0
  73. package/dist/index133.cjs +1 -0
  74. package/dist/index133.js +241 -0
  75. package/dist/index134.cjs +1 -0
  76. package/dist/index134.js +70 -0
  77. package/dist/index135.cjs +1 -0
  78. package/dist/index135.js +64 -0
  79. package/dist/index136.cjs +1 -0
  80. package/dist/index136.js +14 -0
  81. package/dist/index137.cjs +1 -0
  82. package/dist/index137.js +47 -0
  83. package/dist/index138.cjs +1 -0
  84. package/dist/index138.js +65 -0
  85. package/dist/index139.cjs +1 -0
  86. package/dist/index139.js +228 -0
  87. package/dist/index14.cjs +1 -1
  88. package/dist/index14.js +2 -2
  89. package/dist/index140.cjs +1 -0
  90. package/dist/index140.js +5 -0
  91. package/dist/index141.cjs +1 -0
  92. package/dist/index141.js +171 -0
  93. package/dist/index142.cjs +1 -0
  94. package/dist/index142.js +30 -0
  95. package/dist/index143.cjs +1 -0
  96. package/dist/index143.js +23 -0
  97. package/dist/index144.cjs +1 -0
  98. package/dist/index144.js +72 -0
  99. package/dist/index145.cjs +1 -0
  100. package/dist/index145.js +130 -0
  101. package/dist/index146.cjs +1 -0
  102. package/dist/index146.js +9 -0
  103. package/dist/index147.cjs +1 -0
  104. package/dist/index147.js +4 -0
  105. package/dist/index148.cjs +1 -0
  106. package/dist/index148.js +28 -0
  107. package/dist/index149.cjs +1 -0
  108. package/dist/index149.js +4 -0
  109. package/dist/index16.cjs +1 -1
  110. package/dist/index16.js +30 -136
  111. package/dist/index17.cjs +1 -1
  112. package/dist/index17.js +25 -2
  113. package/dist/index18.cjs +1 -3
  114. package/dist/index18.js +29 -26
  115. package/dist/index19.cjs +1 -1
  116. package/dist/index19.js +32 -17
  117. package/dist/index20.cjs +1 -2
  118. package/dist/index20.js +53 -25
  119. package/dist/index21.cjs +1 -1
  120. package/dist/index21.js +6 -38
  121. package/dist/index22.cjs +1 -1
  122. package/dist/index22.js +9 -199
  123. package/dist/index23.cjs +1 -1
  124. package/dist/index23.js +138 -2
  125. package/dist/index24.js +2 -2
  126. package/dist/index25.cjs +1 -1
  127. package/dist/index25.js +13 -2
  128. package/dist/index26.cjs +1 -1
  129. package/dist/index26.js +36 -27
  130. package/dist/index27.cjs +1 -1
  131. package/dist/index27.js +41 -14
  132. package/dist/index28.cjs +1 -1
  133. package/dist/index28.js +26 -173
  134. package/dist/index29.cjs +1 -1
  135. package/dist/index29.js +15 -22
  136. package/dist/index30.cjs +1 -1
  137. package/dist/index30.js +24 -2
  138. package/dist/index31.cjs +1 -1
  139. package/dist/index31.js +25 -34
  140. package/dist/index32.cjs +1 -1
  141. package/dist/index32.js +54 -8
  142. package/dist/index33.cjs +1 -1
  143. package/dist/index33.js +28 -2
  144. package/dist/index34.cjs +3 -6
  145. package/dist/index34.js +30 -949
  146. package/dist/index35.cjs +1 -1
  147. package/dist/index35.js +17 -4
  148. package/dist/index36.cjs +2 -1
  149. package/dist/index36.js +23 -18
  150. package/dist/index37.cjs +1 -1
  151. package/dist/index37.js +38 -29
  152. package/dist/index38.cjs +1 -1
  153. package/dist/index38.js +197 -60
  154. package/dist/index39.cjs +1 -1
  155. package/dist/index39.js +2 -33
  156. package/dist/index40.cjs +1 -1
  157. package/dist/index40.js +2 -87
  158. package/dist/index41.cjs +1 -1
  159. package/dist/index41.js +2 -49
  160. package/dist/index42.cjs +1 -1
  161. package/dist/index42.js +12 -25
  162. package/dist/index43.cjs +1 -1
  163. package/dist/index43.js +12 -2
  164. package/dist/index44.cjs +1 -1
  165. package/dist/index44.js +4 -2
  166. package/dist/index45.cjs +1 -1
  167. package/dist/index45.js +45 -19
  168. package/dist/index46.cjs +1 -1
  169. package/dist/index46.js +38 -30
  170. package/dist/index47.cjs +1 -1
  171. package/dist/index47.js +165 -360
  172. package/dist/index48.cjs +1 -1
  173. package/dist/index48.js +13 -21
  174. package/dist/index49.cjs +1 -1
  175. package/dist/index49.js +3 -54
  176. package/dist/index50.cjs +1 -1
  177. package/dist/index50.js +17 -3
  178. package/dist/index51.cjs +1 -1
  179. package/dist/index51.js +9 -70
  180. package/dist/index52.cjs +1 -1
  181. package/dist/index52.js +175 -2
  182. package/dist/index53.cjs +1 -1
  183. package/dist/index53.js +21 -57
  184. package/dist/index54.js +2 -2
  185. package/dist/index55.cjs +1 -1
  186. package/dist/index55.js +34 -39
  187. package/dist/index56.cjs +1 -1
  188. package/dist/index56.js +9 -43
  189. package/dist/index57.cjs +1 -1
  190. package/dist/index57.js +34 -17
  191. package/dist/index58.cjs +1 -1
  192. package/dist/index58.js +50 -103
  193. package/dist/index59.cjs +2 -1
  194. package/dist/index59.js +58 -19
  195. package/dist/index60.cjs +1 -1
  196. package/dist/index60.js +3 -225
  197. package/dist/index61.cjs +1 -1
  198. package/dist/index61.js +128 -4
  199. package/dist/index62.cjs +2 -1
  200. package/dist/index62.js +37 -152
  201. package/dist/index63.cjs +1 -1
  202. package/dist/index63.js +9 -2
  203. package/dist/index64.cjs +1 -1
  204. package/dist/index64.js +11 -13
  205. package/dist/index65.cjs +1 -1
  206. package/dist/index65.js +12 -2
  207. package/dist/index66.cjs +1 -1
  208. package/dist/index66.js +13 -32
  209. package/dist/index67.cjs +1 -1
  210. package/dist/index67.js +7 -2
  211. package/dist/index68.cjs +1 -1
  212. package/dist/index68.js +17 -355
  213. package/dist/index69.cjs +1 -1
  214. package/dist/index69.js +75 -235
  215. package/dist/index70.cjs +1 -1
  216. package/dist/index70.js +14 -67
  217. package/dist/index71.cjs +1 -1
  218. package/dist/index71.js +17 -60
  219. package/dist/index72.cjs +1 -1
  220. package/dist/index72.js +6 -11
  221. package/dist/index73.cjs +1 -1
  222. package/dist/index73.js +20 -43
  223. package/dist/index74.cjs +1 -1
  224. package/dist/index74.js +13 -62
  225. package/dist/index75.cjs +1 -1
  226. package/dist/index75.js +2 -226
  227. package/dist/index76.cjs +1 -1
  228. package/dist/index76.js +2 -3
  229. package/dist/index77.cjs +2 -1
  230. package/dist/index77.js +32 -166
  231. package/dist/index78.cjs +1 -1
  232. package/dist/index78.js +5 -27
  233. package/dist/index79.cjs +1 -1
  234. package/dist/index79.js +18 -19
  235. package/dist/index80.cjs +1 -1
  236. package/dist/index80.js +30 -68
  237. package/dist/index81.cjs +1 -1
  238. package/dist/index81.js +2 -128
  239. package/dist/index82.cjs +6 -1
  240. package/dist/index82.js +949 -9
  241. package/dist/index83.cjs +1 -1
  242. package/dist/index84.cjs +1 -1
  243. package/dist/index84.js +61 -25
  244. package/dist/index85.cjs +1 -1
  245. package/dist/index85.js +33 -2
  246. package/dist/index86.cjs +1 -0
  247. package/dist/index86.js +89 -0
  248. package/dist/index87.cjs +1 -0
  249. package/dist/index87.js +15 -0
  250. package/dist/index88.cjs +1 -0
  251. package/dist/index88.js +9 -0
  252. package/dist/index89.cjs +1 -0
  253. package/dist/index89.js +115 -0
  254. package/dist/index90.cjs +1 -0
  255. package/dist/index90.js +9 -0
  256. package/dist/index91.cjs +1 -0
  257. package/dist/index91.js +35 -0
  258. package/dist/index92.cjs +1 -0
  259. package/dist/index92.js +4 -0
  260. package/dist/index93.cjs +1 -0
  261. package/dist/index93.js +40 -0
  262. package/dist/index94.cjs +1 -0
  263. package/dist/index94.js +31 -0
  264. package/dist/index95.cjs +1 -0
  265. package/dist/index95.js +23 -0
  266. package/dist/index96.cjs +1 -0
  267. package/dist/index96.js +9 -0
  268. package/dist/index97.cjs +1 -0
  269. package/dist/index97.js +7 -0
  270. package/dist/index98.cjs +1 -0
  271. package/dist/index98.js +13 -0
  272. package/dist/index99.cjs +1 -0
  273. package/dist/index99.js +22 -0
  274. package/dist/src/index.d.ts +1 -1
  275. package/dist/src/lib/utils.d.ts +3 -1
  276. package/package.json +2 -2
package/dist/index21.js CHANGED
@@ -1,43 +1,11 @@
1
- import { b as i } from "./index32.js";
2
- var t = i;
3
- function d(e, n) {
4
- if (n !== void 0 && e[0] !== n) throw new Error("Invalid network version");
5
- if (e.length === 33)
6
- return {
7
- version: e[0],
8
- privateKey: e.slice(1, 33),
9
- compressed: !1
10
- };
11
- if (e.length !== 34) throw new Error("Invalid WIF length");
12
- if (e[33] !== 1) throw new Error("Invalid compression flag");
1
+ function n(e) {
13
2
  return {
14
- version: e[0],
15
- privateKey: e.slice(1, 33),
16
- compressed: !0
3
+ formatters: void 0,
4
+ fees: void 0,
5
+ serializers: void 0,
6
+ ...e
17
7
  };
18
8
  }
19
- function c(e, n, r) {
20
- var o = new Buffer(r ? 34 : 33);
21
- return o.writeUInt8(e, 0), n.copy(o, 1), r && (o[33] = 1), o;
22
- }
23
- function a(e, n) {
24
- return d(t.decode(e), n);
25
- }
26
- function w(e, n, r) {
27
- return typeof e == "number" ? t.encode(c(e, n, r)) : t.encode(
28
- c(
29
- e.version,
30
- e.privateKey,
31
- e.compressed
32
- )
33
- );
34
- }
35
- var l = {
36
- decode: a,
37
- decodeRaw: d,
38
- encode: w,
39
- encodeRaw: c
40
- };
41
9
  export {
42
- l as w
10
+ n as defineChain
43
11
  };
package/dist/index22.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const d=require("./index25.cjs");Object.defineProperty(d.__exports,"__esModule",{value:!0});d.__exports.testEcc=void 0;const f=b=>Buffer.from(b,"hex");function c(b){a(b.isPoint(f("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),a(!b.isPoint(f("030000000000000000000000000000000000000000000000000000000000000005"))),a(b.isPrivate(f("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),a(b.isPrivate(f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),a(!b.isPrivate(f("0000000000000000000000000000000000000000000000000000000000000000"))),a(!b.isPrivate(f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"))),a(!b.isPrivate(f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142"))),a(Buffer.from(b.privateAdd(f("0000000000000000000000000000000000000000000000000000000000000001"),f("0000000000000000000000000000000000000000000000000000000000000000"))).equals(f("0000000000000000000000000000000000000000000000000000000000000001"))),a(b.privateAdd(f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"),f("0000000000000000000000000000000000000000000000000000000000000003"))===null),a(Buffer.from(b.privateAdd(f("e211078564db65c3ce7704f08262b1f38f1ef412ad15b5ac2d76657a63b2c500"),f("b51fbb69051255d1becbd683de5848242a89c229348dd72896a87ada94ae8665"))).equals(f("9730c2ee69edbb958d42db7460bafa18fef9d955325aec99044c81c8282b0a24"))),a(Buffer.from(b.privateNegate(f("0000000000000000000000000000000000000000000000000000000000000001"))).equals(f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),a(Buffer.from(b.privateNegate(f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"))).equals(f("0000000000000000000000000000000000000000000000000000000000000003"))),a(Buffer.from(b.privateNegate(f("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(f("4eede1bf775995d70a494f0a7bb6bc11e0b8cccd41cce8009ab1132c8b0a3792"))),a(Buffer.from(b.pointCompress(f("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"),!0)).equals(f("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),a(Buffer.from(b.pointCompress(f("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"),!1)).equals(f("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"))),a(Buffer.from(b.pointCompress(f("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),!0)).equals(f("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),a(Buffer.from(b.pointCompress(f("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),!1)).equals(f("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"))),a(Buffer.from(b.pointFromScalar(f("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(f("02b07ba9dca9523b7ef4bd97703d43d20399eb698e194704791a25ce77a400df99"))),a(b.xOnlyPointAddTweak(f("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))===null);let e=b.xOnlyPointAddTweak(f("1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b"),f("a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac"));a(Buffer.from(e.xOnlyPubkey).equals(f("e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf"))&&e.parity===1),e=b.xOnlyPointAddTweak(f("2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991"),f("823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47")),a(Buffer.from(e.xOnlyPubkey).equals(f("9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c"))&&e.parity===0),a(Buffer.from(b.sign(f("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))).equals(f("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),a(b.verify(f("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),f("0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),f("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),b.signSchnorr&&a(Buffer.from(b.signSchnorr(f("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),f("c90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b14e5c9"),f("c87aa53824b4d7ae2eb035a2b5bbbccc080e76cdc6d1692c4b0b62d798e6d906"))).equals(f("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7"))),b.verifySchnorr&&a(b.verifySchnorr(f("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),f("dd308afec5777e13121fa72b9cc1b7cc0139715309b086c960e18fd969774eb8"),f("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7")))}d.__exports.testEcc=c;function a(b){if(!b)throw new Error("ecc library invalid")}module.exports=d.__exports;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index25.cjs"),e=require("./index26.cjs"),t=require("./index27.cjs"),s={contracts:r.contracts,formatters:e.formatters,serializers:t.serializers};exports.chainConfig=s;
package/dist/index22.js CHANGED
@@ -1,201 +1,11 @@
1
- import { __exports as d } from "./index25.js";
2
- Object.defineProperty(d, "__esModule", { value: !0 });
3
- d.testEcc = void 0;
4
- const f = (b) => Buffer.from(b, "hex");
5
- function c(b) {
6
- a(
7
- b.isPoint(
8
- f("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798")
9
- )
10
- ), a(
11
- !b.isPoint(
12
- f("030000000000000000000000000000000000000000000000000000000000000005")
13
- )
14
- ), a(
15
- b.isPrivate(
16
- f("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798")
17
- )
18
- ), a(
19
- b.isPrivate(
20
- f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140")
21
- )
22
- ), a(
23
- !b.isPrivate(
24
- f("0000000000000000000000000000000000000000000000000000000000000000")
25
- )
26
- ), a(
27
- !b.isPrivate(
28
- f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141")
29
- )
30
- ), a(
31
- !b.isPrivate(
32
- f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142")
33
- )
34
- ), a(
35
- Buffer.from(
36
- b.privateAdd(
37
- f("0000000000000000000000000000000000000000000000000000000000000001"),
38
- f("0000000000000000000000000000000000000000000000000000000000000000")
39
- )
40
- ).equals(
41
- f("0000000000000000000000000000000000000000000000000000000000000001")
42
- )
43
- ), a(
44
- b.privateAdd(
45
- f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"),
46
- f("0000000000000000000000000000000000000000000000000000000000000003")
47
- ) === null
48
- ), a(
49
- Buffer.from(
50
- b.privateAdd(
51
- f("e211078564db65c3ce7704f08262b1f38f1ef412ad15b5ac2d76657a63b2c500"),
52
- f("b51fbb69051255d1becbd683de5848242a89c229348dd72896a87ada94ae8665")
53
- )
54
- ).equals(
55
- f("9730c2ee69edbb958d42db7460bafa18fef9d955325aec99044c81c8282b0a24")
56
- )
57
- ), a(
58
- Buffer.from(
59
- b.privateNegate(
60
- f("0000000000000000000000000000000000000000000000000000000000000001")
61
- )
62
- ).equals(
63
- f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140")
64
- )
65
- ), a(
66
- Buffer.from(
67
- b.privateNegate(
68
- f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e")
69
- )
70
- ).equals(
71
- f("0000000000000000000000000000000000000000000000000000000000000003")
72
- )
73
- ), a(
74
- Buffer.from(
75
- b.privateNegate(
76
- f("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af")
77
- )
78
- ).equals(
79
- f("4eede1bf775995d70a494f0a7bb6bc11e0b8cccd41cce8009ab1132c8b0a3792")
80
- )
81
- ), a(
82
- Buffer.from(
83
- b.pointCompress(
84
- f(
85
- "0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
86
- ),
87
- !0
88
- )
89
- ).equals(
90
- f("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798")
91
- )
92
- ), a(
93
- Buffer.from(
94
- b.pointCompress(
95
- f(
96
- "0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
97
- ),
98
- !1
99
- )
100
- ).equals(
101
- f(
102
- "0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
103
- )
104
- )
105
- ), a(
106
- Buffer.from(
107
- b.pointCompress(
108
- f("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),
109
- !0
110
- )
111
- ).equals(
112
- f("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798")
113
- )
114
- ), a(
115
- Buffer.from(
116
- b.pointCompress(
117
- f("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),
118
- !1
119
- )
120
- ).equals(
121
- f(
122
- "0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
123
- )
124
- )
125
- ), a(
126
- Buffer.from(
127
- b.pointFromScalar(
128
- f("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af")
129
- )
130
- ).equals(
131
- f("02b07ba9dca9523b7ef4bd97703d43d20399eb698e194704791a25ce77a400df99")
132
- )
133
- ), a(
134
- b.xOnlyPointAddTweak(
135
- f("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),
136
- f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140")
137
- ) === null
138
- );
139
- let e = b.xOnlyPointAddTweak(
140
- f("1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b"),
141
- f("a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac")
142
- );
143
- a(
144
- Buffer.from(e.xOnlyPubkey).equals(
145
- f("e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf")
146
- ) && e.parity === 1
147
- ), e = b.xOnlyPointAddTweak(
148
- f("2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991"),
149
- f("823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47")
150
- ), a(
151
- Buffer.from(e.xOnlyPubkey).equals(
152
- f("9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c")
153
- ) && e.parity === 0
154
- ), a(
155
- Buffer.from(
156
- b.sign(
157
- f("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),
158
- f("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140")
159
- )
160
- ).equals(
161
- f(
162
- "54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"
163
- )
164
- )
165
- ), a(
166
- b.verify(
167
- f("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),
168
- f("0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),
169
- f(
170
- "54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"
171
- )
172
- )
173
- ), b.signSchnorr && a(
174
- Buffer.from(
175
- b.signSchnorr(
176
- f("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),
177
- f("c90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b14e5c9"),
178
- f("c87aa53824b4d7ae2eb035a2b5bbbccc080e76cdc6d1692c4b0b62d798e6d906")
179
- )
180
- ).equals(
181
- f(
182
- "5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7"
183
- )
184
- )
185
- ), b.verifySchnorr && a(
186
- b.verifySchnorr(
187
- f("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),
188
- f("dd308afec5777e13121fa72b9cc1b7cc0139715309b086c960e18fd969774eb8"),
189
- f(
190
- "5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7"
191
- )
192
- )
193
- );
194
- }
195
- d.testEcc = c;
196
- function a(b) {
197
- if (!b) throw new Error("ecc library invalid");
198
- }
1
+ import { contracts as r } from "./index25.js";
2
+ import { formatters as o } from "./index26.js";
3
+ import { serializers as t } from "./index27.js";
4
+ const s = {
5
+ contracts: r,
6
+ formatters: o,
7
+ serializers: t
8
+ };
199
9
  export {
200
- d as default
10
+ s as chainConfig
201
11
  };
package/dist/index23.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
1
+ "use strict";var v=Object.defineProperty;var k=(r,o,f)=>o in r?v(r,o,{enumerable:!0,configurable:!0,writable:!0,value:f}):r[o]=f;var a=(r,o,f)=>k(r,typeof o!="symbol"?o+"":o,f);const c=require("./index24.cjs");require("./index34.cjs");require("./index35.cjs");const b=require("./index36.cjs"),P=require("./index37.cjs");require("./index38.cjs");const K=require("./index39.cjs"),x=require("./index40.cjs"),g=require("./index41.cjs");Object.defineProperty(c.__exports,"__esModule",{value:!0});c.__exports.ECPairFactory=c.__exports.networks=void 0;const p=K.__exports;c.__exports.networks=p;const n=x.__exports,E=b.browserExports,_=P.wif,B=g.__exports,y=n.typeforce.maybe(n.typeforce.compile({compressed:n.maybe(n.Boolean),network:n.maybe(n.Network)})),D=r=>r.length===32?r:r.slice(1,33);function F(r){(0,B.testEcc)(r);function o(s){return r.isPoint(s)}function f(s,e){if(n.typeforce(n.Buffer256bit,s),!r.isPrivate(s))throw new TypeError("Private key not in range [1, n)");return n.typeforce(y,e),new d(s,void 0,e)}function h(s,e){return n.typeforce(r.isPoint,s),n.typeforce(y,e),new d(void 0,s,e)}function l(s,e){const t=_.decode(s),i=t.version;if(n.Array(e)){if(e=e.filter(u=>i===u.wif).pop(),!e)throw new Error("Unknown network version")}else if(e=e||p.bitcoin,i!==e.wif)throw new Error("Invalid network version");return f(t.privateKey,{compressed:t.compressed,network:e})}function m(s){n.typeforce(y,s),s===void 0&&(s={});const e=s.rng||E;let t;do t=e(32),n.typeforce(n.Buffer256bit,t);while(!r.isPrivate(t));return f(t,s)}class d{constructor(e,t,i){a(this,"__D");a(this,"__Q");a(this,"compressed");a(this,"network");a(this,"lowR");this.__D=e,this.__Q=t,this.lowR=!1,i===void 0&&(i={}),this.compressed=i.compressed===void 0?!0:i.compressed,this.network=i.network||p.bitcoin,t!==void 0&&(this.__Q=Buffer.from(r.pointCompress(t,this.compressed)))}get privateKey(){return this.__D}get publicKey(){if(!this.__Q){const e=r.pointFromScalar(this.__D,this.compressed);this.__Q=Buffer.from(e)}return this.__Q}toWIF(){if(!this.__D)throw new Error("Missing private key");return _.encode(this.network.wif,this.__D,this.compressed)}tweak(e){return this.privateKey?this.tweakFromPrivateKey(e):this.tweakFromPublicKey(e)}sign(e,t){if(!this.__D)throw new Error("Missing private key");if(t===void 0&&(t=this.lowR),t===!1)return Buffer.from(r.sign(e,this.__D));{let i=r.sign(e,this.__D);const u=Buffer.alloc(32,0);let w=0;for(;i[0]>127;)w++,u.writeUIntLE(w,0,6),i=r.sign(e,this.__D,u);return Buffer.from(i)}}signSchnorr(e){if(!this.privateKey)throw new Error("Missing private key");if(!r.signSchnorr)throw new Error("signSchnorr not supported by ecc library");return Buffer.from(r.signSchnorr(e,this.privateKey))}verify(e,t){return r.verify(e,this.publicKey,t)}verifySchnorr(e,t){if(!r.verifySchnorr)throw new Error("verifySchnorr not supported by ecc library");return r.verifySchnorr(e,this.publicKey.subarray(1,33),t)}tweakFromPublicKey(e){const t=D(this.publicKey),i=r.xOnlyPointAddTweak(t,e);if(!i||i.xOnlyPubkey===null)throw new Error("Cannot tweak public key!");const u=Buffer.from([i.parity===0?2:3]);return h(Buffer.concat([u,i.xOnlyPubkey]),{network:this.network,compressed:this.compressed})}tweakFromPrivateKey(e){const i=this.publicKey[0]===3||this.publicKey[0]===4&&(this.publicKey[64]&1)===1?r.privateNegate(this.privateKey):this.privateKey,u=r.privateAdd(i,e);if(!u)throw new Error("Invalid tweaked private key!");return f(Buffer.from(u),{network:this.network,compressed:this.compressed})}}return{isPoint:o,fromPrivateKey:f,fromPublicKey:h,fromWIF:l,makeRandom:m}}c.__exports.ECPairFactory=F;module.exports=c.__exports;
package/dist/index23.js CHANGED
@@ -1,4 +1,140 @@
1
- var r = {};
1
+ var v = Object.defineProperty;
2
+ var k = (e, n, f) => n in e ? v(e, n, { enumerable: !0, configurable: !0, writable: !0, value: f }) : e[n] = f;
3
+ var y = (e, n, f) => k(e, typeof n != "symbol" ? n + "" : n, f);
4
+ import { __exports as p } from "./index24.js";
5
+ import "./index34.js";
6
+ import "./index35.js";
7
+ import { b } from "./index36.js";
8
+ import { w as P } from "./index37.js";
9
+ import "./index38.js";
10
+ import { __exports as K } from "./index39.js";
11
+ import { __exports as g } from "./index40.js";
12
+ import { __exports as E } from "./index41.js";
13
+ Object.defineProperty(p, "__esModule", { value: !0 });
14
+ p.ECPairFactory = p.networks = void 0;
15
+ const c = K;
16
+ p.networks = c;
17
+ const s = g, x = b, m = P, B = E, u = s.typeforce.maybe(
18
+ s.typeforce.compile({
19
+ compressed: s.maybe(s.Boolean),
20
+ network: s.maybe(s.Network)
21
+ })
22
+ ), D = (e) => e.length === 32 ? e : e.slice(1, 33);
23
+ function F(e) {
24
+ (0, B.testEcc)(e);
25
+ function n(o) {
26
+ return e.isPoint(o);
27
+ }
28
+ function f(o, r) {
29
+ if (s.typeforce(s.Buffer256bit, o), !e.isPrivate(o))
30
+ throw new TypeError("Private key not in range [1, n)");
31
+ return s.typeforce(u, r), new d(o, void 0, r);
32
+ }
33
+ function h(o, r) {
34
+ return s.typeforce(e.isPoint, o), s.typeforce(u, r), new d(void 0, o, r);
35
+ }
36
+ function l(o, r) {
37
+ const t = m.decode(o), i = t.version;
38
+ if (s.Array(r)) {
39
+ if (r = r.filter((a) => i === a.wif).pop(), !r) throw new Error("Unknown network version");
40
+ } else if (r = r || c.bitcoin, i !== r.wif) throw new Error("Invalid network version");
41
+ return f(t.privateKey, {
42
+ compressed: t.compressed,
43
+ network: r
44
+ });
45
+ }
46
+ function _(o) {
47
+ s.typeforce(u, o), o === void 0 && (o = {});
48
+ const r = o.rng || x;
49
+ let t;
50
+ do
51
+ t = r(32), s.typeforce(s.Buffer256bit, t);
52
+ while (!e.isPrivate(t));
53
+ return f(t, o);
54
+ }
55
+ class d {
56
+ constructor(r, t, i) {
57
+ y(this, "__D");
58
+ y(this, "__Q");
59
+ y(this, "compressed");
60
+ y(this, "network");
61
+ y(this, "lowR");
62
+ this.__D = r, this.__Q = t, this.lowR = !1, i === void 0 && (i = {}), this.compressed = i.compressed === void 0 ? !0 : i.compressed, this.network = i.network || c.bitcoin, t !== void 0 && (this.__Q = Buffer.from(e.pointCompress(t, this.compressed)));
63
+ }
64
+ get privateKey() {
65
+ return this.__D;
66
+ }
67
+ get publicKey() {
68
+ if (!this.__Q) {
69
+ const r = e.pointFromScalar(this.__D, this.compressed);
70
+ this.__Q = Buffer.from(r);
71
+ }
72
+ return this.__Q;
73
+ }
74
+ toWIF() {
75
+ if (!this.__D) throw new Error("Missing private key");
76
+ return m.encode(this.network.wif, this.__D, this.compressed);
77
+ }
78
+ tweak(r) {
79
+ return this.privateKey ? this.tweakFromPrivateKey(r) : this.tweakFromPublicKey(r);
80
+ }
81
+ sign(r, t) {
82
+ if (!this.__D) throw new Error("Missing private key");
83
+ if (t === void 0 && (t = this.lowR), t === !1)
84
+ return Buffer.from(e.sign(r, this.__D));
85
+ {
86
+ let i = e.sign(r, this.__D);
87
+ const a = Buffer.alloc(32, 0);
88
+ let w = 0;
89
+ for (; i[0] > 127; )
90
+ w++, a.writeUIntLE(w, 0, 6), i = e.sign(r, this.__D, a);
91
+ return Buffer.from(i);
92
+ }
93
+ }
94
+ signSchnorr(r) {
95
+ if (!this.privateKey) throw new Error("Missing private key");
96
+ if (!e.signSchnorr)
97
+ throw new Error("signSchnorr not supported by ecc library");
98
+ return Buffer.from(e.signSchnorr(r, this.privateKey));
99
+ }
100
+ verify(r, t) {
101
+ return e.verify(r, this.publicKey, t);
102
+ }
103
+ verifySchnorr(r, t) {
104
+ if (!e.verifySchnorr)
105
+ throw new Error("verifySchnorr not supported by ecc library");
106
+ return e.verifySchnorr(r, this.publicKey.subarray(1, 33), t);
107
+ }
108
+ tweakFromPublicKey(r) {
109
+ const t = D(this.publicKey), i = e.xOnlyPointAddTweak(t, r);
110
+ if (!i || i.xOnlyPubkey === null)
111
+ throw new Error("Cannot tweak public key!");
112
+ const a = Buffer.from([
113
+ i.parity === 0 ? 2 : 3
114
+ ]);
115
+ return h(
116
+ Buffer.concat([a, i.xOnlyPubkey]),
117
+ { network: this.network, compressed: this.compressed }
118
+ );
119
+ }
120
+ tweakFromPrivateKey(r) {
121
+ const i = this.publicKey[0] === 3 || this.publicKey[0] === 4 && (this.publicKey[64] & 1) === 1 ? e.privateNegate(this.privateKey) : this.privateKey, a = e.privateAdd(i, r);
122
+ if (!a) throw new Error("Invalid tweaked private key!");
123
+ return f(Buffer.from(a), {
124
+ network: this.network,
125
+ compressed: this.compressed
126
+ });
127
+ }
128
+ }
129
+ return {
130
+ isPoint: n,
131
+ fromPrivateKey: f,
132
+ fromPublicKey: h,
133
+ fromWIF: l,
134
+ makeRandom: _
135
+ };
136
+ }
137
+ p.ECPairFactory = F;
2
138
  export {
3
- r as __exports
139
+ p as default
4
140
  };
package/dist/index24.js CHANGED
@@ -1,4 +1,4 @@
1
- var e = {};
1
+ var r = {};
2
2
  export {
3
- e as __exports
3
+ r as __exports
4
4
  };
package/dist/index25.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}};exports.contracts=s;
package/dist/index25.js CHANGED
@@ -1,4 +1,15 @@
1
- var e = {};
1
+ const s = {
2
+ gasPriceOracle: { address: "0x420000000000000000000000000000000000000F" },
3
+ l1Block: { address: "0x4200000000000000000000000000000000000015" },
4
+ l2CrossDomainMessenger: {
5
+ address: "0x4200000000000000000000000000000000000007"
6
+ },
7
+ l2Erc721Bridge: { address: "0x4200000000000000000000000000000000000014" },
8
+ l2StandardBridge: { address: "0x4200000000000000000000000000000000000010" },
9
+ l2ToL1MessagePasser: {
10
+ address: "0x4200000000000000000000000000000000000016"
11
+ }
12
+ };
2
13
  export {
3
- e as __exports
14
+ s as contracts
4
15
  };
package/dist/index26.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("bitcoinjs-lib"),c=require("tiny-secp256k1"),u=require("./index10.cjs");function b(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const a=b(c),i=Buffer.from("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","hex"),l=Buffer.from("483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8","hex"),d=Buffer.concat([i,l]),s=Buffer.from("0250929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0","hex"),f={failedToCreateInternalPubkey:"failed to create internal pubkey",failedToTweakPubkey:"failed to tweak pubkey"};function y(){const e=o.crypto.sha256(Buffer.from("GardenHTLC","utf-8")),r=a.pointMultiply(Buffer.concat([Buffer.from("04","hex"),d]),e);if(!r)throw new Error(f.failedToCreateInternalPubkey);const t=a.pointAdd(s,r);if(!t)throw new Error(f.failedToCreateInternalPubkey);return u.xOnlyPubkey(Buffer.from(t))}exports.generateInternalkey=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index30.cjs"),c=require("./index31.cjs"),r=require("./index32.cjs"),l=require("./index33.cjs"),a={block:c.defineBlock({format(e){var s;return{transactions:(s=e.transactions)==null?void 0:s.map(t=>{if(typeof t=="string")return t;const i=r.formatTransaction(t);return i.typeHex==="0x7e"&&(i.isSystemTx=t.isSystemTx,i.mint=t.mint?o.hexToBigInt(t.mint):void 0,i.sourceHash=t.sourceHash,i.type="deposit"),i}),stateRoot:e.stateRoot}}}),transaction:r.defineTransaction({format(e){const n={};return e.type==="0x7e"&&(n.isSystemTx=e.isSystemTx,n.mint=e.mint?o.hexToBigInt(e.mint):void 0,n.sourceHash=e.sourceHash,n.type="deposit"),n}}),transactionReceipt:l.defineTransactionReceipt({format(e){return{l1GasPrice:e.l1GasPrice?o.hexToBigInt(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?o.hexToBigInt(e.l1GasUsed):null,l1Fee:e.l1Fee?o.hexToBigInt(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};exports.formatters=a;
package/dist/index26.js CHANGED
@@ -1,30 +1,39 @@
1
- import { crypto as t } from "bitcoinjs-lib";
2
- import * as f from "tiny-secp256k1";
3
- import { xOnlyPubkey as n } from "./index10.js";
4
- const c = Buffer.from(
5
- "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
6
- "hex"
7
- ), b = Buffer.from(
8
- "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",
9
- "hex"
10
- ), u = Buffer.concat([c, b]), d = Buffer.from(
11
- "0250929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0",
12
- "hex"
13
- ), a = {
14
- failedToCreateInternalPubkey: "failed to create internal pubkey",
15
- failedToTweakPubkey: "failed to tweak pubkey"
1
+ import { hexToBigInt as n } from "./index30.js";
2
+ import { defineBlock as s } from "./index31.js";
3
+ import { formatTransaction as m, defineTransaction as l } from "./index32.js";
4
+ import { defineTransactionReceipt as c } from "./index33.js";
5
+ const d = {
6
+ block: /* @__PURE__ */ s({
7
+ format(e) {
8
+ var r;
9
+ return {
10
+ transactions: (r = e.transactions) == null ? void 0 : r.map((t) => {
11
+ if (typeof t == "string")
12
+ return t;
13
+ const i = m(t);
14
+ return i.typeHex === "0x7e" && (i.isSystemTx = t.isSystemTx, i.mint = t.mint ? n(t.mint) : void 0, i.sourceHash = t.sourceHash, i.type = "deposit"), i;
15
+ }),
16
+ stateRoot: e.stateRoot
17
+ };
18
+ }
19
+ }),
20
+ transaction: /* @__PURE__ */ l({
21
+ format(e) {
22
+ const o = {};
23
+ return e.type === "0x7e" && (o.isSystemTx = e.isSystemTx, o.mint = e.mint ? n(e.mint) : void 0, o.sourceHash = e.sourceHash, o.type = "deposit"), o;
24
+ }
25
+ }),
26
+ transactionReceipt: /* @__PURE__ */ c({
27
+ format(e) {
28
+ return {
29
+ l1GasPrice: e.l1GasPrice ? n(e.l1GasPrice) : null,
30
+ l1GasUsed: e.l1GasUsed ? n(e.l1GasUsed) : null,
31
+ l1Fee: e.l1Fee ? n(e.l1Fee) : null,
32
+ l1FeeScalar: e.l1FeeScalar ? Number(e.l1FeeScalar) : null
33
+ };
34
+ }
35
+ })
16
36
  };
17
- function m() {
18
- const o = t.sha256(Buffer.from("GardenHTLC", "utf-8")), e = f.pointMultiply(
19
- Buffer.concat([Buffer.from("04", "hex"), u]),
20
- o
21
- );
22
- if (!e)
23
- throw new Error(a.failedToCreateInternalPubkey);
24
- const r = f.pointAdd(d, e);
25
- if (!r) throw new Error(a.failedToCreateInternalPubkey);
26
- return n(Buffer.from(r));
27
- }
28
37
  export {
29
- m as generateInternalkey
38
+ d as formatters
30
39
  };
package/dist/index27.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={secretMismatch:"invalid secret",secretHashLenMismatch:"secret hash should be 32 bytes",pubkeyLenMismatch:"pubkey should be 32 bytes",zeroOrNegativeExpiry:"expiry should be greater than 0",htlcAddressGenerationFailed:"failed to generate htlc address",notFunded:"address not funded",noCounterpartySigs:"counterparty signatures are required",counterPartySigNotFound:e=>"counterparty signature not found for utxo "+e,invalidCounterpartySigForUTXO:e=>"invalid counterparty signature for utxo "+e,htlcNotExpired:e=>`HTLC not expired, need more ${e} blocks`,controlBlockGenerationFailed:"failed to generate control block",invalidLeaf:"invalid leaf"};exports.htlcErrors=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index42.cjs"),c=require("./index43.cjs"),T=require("./index44.cjs"),t=require("./index45.cjs"),z=require("./index46.cjs"),H=require("./index47.cjs");function d(e,r){return y(e)?m(e):H.serializeTransaction(e,r)}const q={transaction:d};function m(e){u(e);const{sourceHash:r,data:s,from:l,gas:i,isSystemTx:f,mint:o,to:x,value:n}=e,p=[r,l,x??"0x",o?t.toHex(o):"0x",n?t.toHex(n):"0x",i?t.toHex(i):"0x",f?"0x1":"0x",s??"0x"];return T.concatHex(["0x7e",z.toRlp(p)])}function y(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function u(e){const{from:r,to:s}=e;if(r&&!c.isAddress(r))throw new a.InvalidAddressError({address:r});if(s&&!c.isAddress(s))throw new a.InvalidAddressError({address:s})}exports.assertTransactionDeposit=u;exports.serializeTransaction=d;exports.serializers=q;
package/dist/index27.js CHANGED
@@ -1,17 +1,44 @@
1
- const t = {
2
- secretMismatch: "invalid secret",
3
- secretHashLenMismatch: "secret hash should be 32 bytes",
4
- pubkeyLenMismatch: "pubkey should be 32 bytes",
5
- zeroOrNegativeExpiry: "expiry should be greater than 0",
6
- htlcAddressGenerationFailed: "failed to generate htlc address",
7
- notFunded: "address not funded",
8
- noCounterpartySigs: "counterparty signatures are required",
9
- counterPartySigNotFound: (e) => "counterparty signature not found for utxo " + e,
10
- invalidCounterpartySigForUTXO: (e) => "invalid counterparty signature for utxo " + e,
11
- htlcNotExpired: (e) => `HTLC not expired, need more ${e} blocks`,
12
- controlBlockGenerationFailed: "failed to generate control block",
13
- invalidLeaf: "invalid leaf"
1
+ import { InvalidAddressError as a } from "./index42.js";
2
+ import { isAddress as f } from "./index43.js";
3
+ import { concatHex as p } from "./index44.js";
4
+ import { toHex as i } from "./index45.js";
5
+ import { toRlp as x } from "./index46.js";
6
+ import { serializeTransaction as l } from "./index47.js";
7
+ function T(r, e) {
8
+ return h(r) ? z(r) : l(r, e);
9
+ }
10
+ const E = {
11
+ transaction: T
14
12
  };
13
+ function z(r) {
14
+ w(r);
15
+ const { sourceHash: e, data: o, from: m, gas: t, isSystemTx: u, mint: s, to: c, value: n } = r, d = [
16
+ e,
17
+ m,
18
+ c ?? "0x",
19
+ s ? i(s) : "0x",
20
+ n ? i(n) : "0x",
21
+ t ? i(t) : "0x",
22
+ u ? "0x1" : "0x",
23
+ o ?? "0x"
24
+ ];
25
+ return p([
26
+ "0x7e",
27
+ x(d)
28
+ ]);
29
+ }
30
+ function h(r) {
31
+ return r.type === "deposit" || typeof r.sourceHash < "u";
32
+ }
33
+ function w(r) {
34
+ const { from: e, to: o } = r;
35
+ if (e && !f(e))
36
+ throw new a({ address: e });
37
+ if (o && !f(o))
38
+ throw new a({ address: o });
39
+ }
15
40
  export {
16
- t as htlcErrors
41
+ w as assertTransactionDeposit,
42
+ T as serializeTransaction,
43
+ E as serializers
17
44
  };
package/dist/index28.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./index38.cjs"),J=require("./index39.cjs"),j=require("./index40.cjs");var d=_.errors,u=J.native,h=d.tfJSON,S=d.TfTypeError,b=d.TfPropertyTypeError,v=d.tfSubError,w=d.getValueTypeName,g={arrayOf:function(n,r){n=l(n),r=r||{};function t(f,i){return!u.Array(f)||u.Nil(f)||r.minLength!==void 0&&f.length<r.minLength||r.maxLength!==void 0&&f.length>r.maxLength||r.length!==void 0&&f.length!==r.length?!1:f.every(function(a,o){try{return c(n,a,i)}catch(m){throw v(m,o)}})}return t.toJSON=function(){var f="["+h(n)+"]";return r.length!==void 0?f+="{"+r.length+"}":(r.minLength!==void 0||r.maxLength!==void 0)&&(f+="{"+(r.minLength===void 0?0:r.minLength)+","+(r.maxLength===void 0?1/0:r.maxLength)+"}"),f},t},maybe:function e(n){n=l(n);function r(t,f){return u.Nil(t)||n(t,f,e)}return r.toJSON=function(){return"?"+h(n)},r},map:function(n,r){n=l(n),r&&(r=l(r));function t(f,i){if(!u.Object(f)||u.Nil(f))return!1;for(var a in f){try{r&&c(r,a,i)}catch(m){throw v(m,a,"key")}try{var o=f[a];c(n,o,i)}catch(m){throw v(m,a)}}return!0}return r?t.toJSON=function(){return"{"+h(r)+": "+h(n)+"}"}:t.toJSON=function(){return"{"+h(n)+"}"},t},object:function(n){var r={};for(var t in n)r[t]=l(n[t]);function f(i,a){if(!u.Object(i)||u.Nil(i))return!1;var o;try{for(o in r){var m=r[o],E=i[o];c(m,E,a)}}catch(L){throw v(L,o)}if(a){for(o in i)if(!r[o])throw new b(void 0,o)}return!0}return f.toJSON=function(){return h(r)},f},anyOf:function(){var n=[].slice.call(arguments).map(l);function r(t,f){return n.some(function(i){try{return c(i,t,f)}catch{return!1}})}return r.toJSON=function(){return n.map(h).join("|")},r},allOf:function(){var n=[].slice.call(arguments).map(l);function r(t,f){return n.every(function(i){try{return c(i,t,f)}catch{return!1}})}return r.toJSON=function(){return n.map(h).join(" & ")},r},quacksLike:function(n){function r(t){return n===w(t)}return r.toJSON=function(){return n},r},tuple:function(){var n=[].slice.call(arguments).map(l);function r(t,f){return u.Nil(t)||u.Nil(t.length)||f&&t.length!==n.length?!1:n.every(function(i,a){try{return c(i,t[a],f)}catch(o){throw v(o,a)}})}return r.toJSON=function(){return"("+n.map(h).join(", ")+")"},r},value:function(n){function r(t){return t===n}return r.toJSON=function(){return n},r}};g.oneOf=g.anyOf;function l(e){if(u.String(e))return e[0]==="?"?g.maybe(e.slice(1)):u[e]||g.quacksLike(e);if(e&&u.Object(e)){if(u.Array(e)){if(e.length!==1)throw new TypeError("Expected compile() parameter of type Array of length 1");return g.arrayOf(e[0])}return g.object(e)}else if(u.Function(e))return e;return g.value(e)}function c(e,n,r,t){if(u.Function(e)){if(e(n,r))return!0;throw new S(t||e,n)}return c(l(e),n,r)}for(var O in u)c[O]=u[O];for(O in g)c[O]=g[O];var s=j.__require();for(O in s)c[O]=s[O];c.compile=l;c.TfTypeError=S;c.TfPropertyTypeError=b;var N=c;exports.typeforce_1=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("bitcoinjs-lib"),c=require("tiny-secp256k1"),u=require("./index10.cjs");function b(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const a=b(c),i=Buffer.from("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","hex"),l=Buffer.from("483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8","hex"),d=Buffer.concat([i,l]),s=Buffer.from("0250929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0","hex"),f={failedToCreateInternalPubkey:"failed to create internal pubkey",failedToTweakPubkey:"failed to tweak pubkey"};function y(){const e=o.crypto.sha256(Buffer.from("GardenHTLC","utf-8")),r=a.pointMultiply(Buffer.concat([Buffer.from("04","hex"),d]),e);if(!r)throw new Error(f.failedToCreateInternalPubkey);const t=a.pointAdd(s,r);if(!t)throw new Error(f.failedToCreateInternalPubkey);return u.xOnlyPubkey(Buffer.from(t))}exports.generateInternalkey=y;