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

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 +1 -1
@@ -0,0 +1,58 @@
1
+ import { s as a } from "./index55.js";
2
+ import f from "./index121.js";
3
+ import "./index122.js";
4
+ import { i as p } from "./index99.js";
5
+ import { __exports as u } from "./index123.js";
6
+ var s = a.Buffer, n = f.Transform, _ = u.StringDecoder, c = p;
7
+ function i(t) {
8
+ n.call(this), this.hashMode = typeof t == "string", this.hashMode ? this[t] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null;
9
+ }
10
+ c(i, n);
11
+ i.prototype.update = function(t, r, o) {
12
+ typeof t == "string" && (t = s.from(t, r));
13
+ var e = this._update(t);
14
+ return this.hashMode ? this : (o && (e = this._toString(e, o)), e);
15
+ };
16
+ i.prototype.setAutoPadding = function() {
17
+ };
18
+ i.prototype.getAuthTag = function() {
19
+ throw new Error("trying to get auth tag in unsupported state");
20
+ };
21
+ i.prototype.setAuthTag = function() {
22
+ throw new Error("trying to set auth tag in unsupported state");
23
+ };
24
+ i.prototype.setAAD = function() {
25
+ throw new Error("trying to set aad in unsupported state");
26
+ };
27
+ i.prototype._transform = function(t, r, o) {
28
+ var e;
29
+ try {
30
+ this.hashMode ? this._update(t) : this.push(this._update(t));
31
+ } catch (h) {
32
+ e = h;
33
+ } finally {
34
+ o(e);
35
+ }
36
+ };
37
+ i.prototype._flush = function(t) {
38
+ var r;
39
+ try {
40
+ this.push(this.__final());
41
+ } catch (o) {
42
+ r = o;
43
+ }
44
+ t(r);
45
+ };
46
+ i.prototype._finalOrDigest = function(t) {
47
+ var r = this.__final() || s.alloc(0);
48
+ return t && (r = this._toString(r, t, !0)), r;
49
+ };
50
+ i.prototype._toString = function(t, r, o) {
51
+ if (this._decoder || (this._decoder = new _(r), this._encoding = r), this._encoding !== r) throw new Error("can't switch encodings");
52
+ var e = this._decoder.write(t);
53
+ return o && (e += this._decoder.end()), e;
54
+ };
55
+ var w = i;
56
+ export {
57
+ w as c
58
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index124.cjs");var r=e.src,s="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",t=r(s);exports.bs58=t;
@@ -0,0 +1,5 @@
1
+ import { s as r } from "./index124.js";
2
+ var a = r, s = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", o = a(s);
3
+ export {
4
+ o as b
5
+ };
@@ -0,0 +1 @@
1
+ "use strict";const f=require("./index107.cjs");f.__exports.byteLength=l;f.__exports.toByteArray=C;f.__exports.fromByteArray=g;var x=[],c=[],u=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var F=0,A=s.length;F<A;++F)x[F]=s[F],c[s.charCodeAt(F)]=F;c[45]=62;c[95]=63;function p(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var o=t===e?0:4-t%4;return[t,o]}function l(r){var e=p(r),t=e[0],o=e[1];return(t+o)*3/4-o}function y(r,e,t){return(e+t)*3/4-t}function C(r){var e,t=p(r),o=t[0],n=t[1],a=new u(y(r,o,n)),v=0,d=n>0?o-4:o,h;for(h=0;h<d;h+=4)e=c[r.charCodeAt(h)]<<18|c[r.charCodeAt(h+1)]<<12|c[r.charCodeAt(h+2)]<<6|c[r.charCodeAt(h+3)],a[v++]=e>>16&255,a[v++]=e>>8&255,a[v++]=e&255;return n===2&&(e=c[r.charCodeAt(h)]<<2|c[r.charCodeAt(h+1)]>>4,a[v++]=e&255),n===1&&(e=c[r.charCodeAt(h)]<<10|c[r.charCodeAt(h+1)]<<4|c[r.charCodeAt(h+2)]>>2,a[v++]=e>>8&255,a[v++]=e&255),a}function L(r){return x[r>>18&63]+x[r>>12&63]+x[r>>6&63]+x[r&63]}function i(r,e,t){for(var o,n=[],a=e;a<t;a+=3)o=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(r[a+2]&255),n.push(L(o));return n.join("")}function g(r){for(var e,t=r.length,o=t%3,n=[],a=16383,v=0,d=t-o;v<d;v+=a)n.push(i(r,v,v+a>d?d:v+a));return o===1?(e=r[t-1],n.push(x[e>>2]+x[e<<4&63]+"==")):o===2&&(e=(r[t-2]<<8)+r[t-1],n.push(x[e>>10]+x[e>>4&63]+x[e<<2&63]+"=")),n.join("")}module.exports=f.__exports;
@@ -0,0 +1,51 @@
1
+ import { __exports as l } from "./index107.js";
2
+ l.byteLength = p;
3
+ l.toByteArray = C;
4
+ l.fromByteArray = i;
5
+ var F = [], f = [], u = typeof Uint8Array < "u" ? Uint8Array : Array, x = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
6
+ for (var c = 0, A = x.length; c < A; ++c)
7
+ F[c] = x[c], f[x.charCodeAt(c)] = c;
8
+ f[45] = 62;
9
+ f[95] = 63;
10
+ function s(r) {
11
+ var e = r.length;
12
+ if (e % 4 > 0)
13
+ throw new Error("Invalid string. Length must be a multiple of 4");
14
+ var a = r.indexOf("=");
15
+ a === -1 && (a = e);
16
+ var o = a === e ? 0 : 4 - a % 4;
17
+ return [a, o];
18
+ }
19
+ function p(r) {
20
+ var e = s(r), a = e[0], o = e[1];
21
+ return (a + o) * 3 / 4 - o;
22
+ }
23
+ function y(r, e, a) {
24
+ return (e + a) * 3 / 4 - a;
25
+ }
26
+ function C(r) {
27
+ var e, a = s(r), o = a[0], n = a[1], t = new u(y(r, o, n)), v = 0, d = n > 0 ? o - 4 : o, h;
28
+ for (h = 0; h < d; h += 4)
29
+ e = f[r.charCodeAt(h)] << 18 | f[r.charCodeAt(h + 1)] << 12 | f[r.charCodeAt(h + 2)] << 6 | f[r.charCodeAt(h + 3)], t[v++] = e >> 16 & 255, t[v++] = e >> 8 & 255, t[v++] = e & 255;
30
+ return n === 2 && (e = f[r.charCodeAt(h)] << 2 | f[r.charCodeAt(h + 1)] >> 4, t[v++] = e & 255), n === 1 && (e = f[r.charCodeAt(h)] << 10 | f[r.charCodeAt(h + 1)] << 4 | f[r.charCodeAt(h + 2)] >> 2, t[v++] = e >> 8 & 255, t[v++] = e & 255), t;
31
+ }
32
+ function L(r) {
33
+ return F[r >> 18 & 63] + F[r >> 12 & 63] + F[r >> 6 & 63] + F[r & 63];
34
+ }
35
+ function g(r, e, a) {
36
+ for (var o, n = [], t = e; t < a; t += 3)
37
+ o = (r[t] << 16 & 16711680) + (r[t + 1] << 8 & 65280) + (r[t + 2] & 255), n.push(L(o));
38
+ return n.join("");
39
+ }
40
+ function i(r) {
41
+ for (var e, a = r.length, o = a % 3, n = [], t = 16383, v = 0, d = a - o; v < d; v += t)
42
+ n.push(g(r, v, v + t > d ? d : v + t));
43
+ return o === 1 ? (e = r[a - 1], n.push(
44
+ F[e >> 2] + F[e << 4 & 63] + "=="
45
+ )) : o === 2 && (e = (r[a - 2] << 8) + r[a - 1], n.push(
46
+ F[e >> 10] + F[e >> 4 & 63] + F[e << 2 & 63] + "="
47
+ )), n.join("");
48
+ }
49
+ export {
50
+ l as default
51
+ };
@@ -0,0 +1 @@
1
+ "use strict";const d=require("./index108.cjs");/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */d.__exports.read=function(w,a,_,x,M){var t,r,h=M*8-x-1,s=(1<<h)-1,N=s>>1,i=-7,o=_?M-1:0,c=_?-1:1,p=w[a+o];for(o+=c,t=p&(1<<-i)-1,p>>=-i,i+=h;i>0;t=t*256+w[a+o],o+=c,i-=8);for(r=t&(1<<-i)-1,t>>=-i,i+=x;i>0;r=r*256+w[a+o],o+=c,i-=8);if(t===0)t=1-N;else{if(t===s)return r?NaN:(p?-1:1)*(1/0);r=r+Math.pow(2,x),t=t-N}return(p?-1:1)*r*Math.pow(2,t-x)};d.__exports.write=function(w,a,_,x,M,t){var r,h,s,N=t*8-M-1,i=(1<<N)-1,o=i>>1,c=M===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=x?0:t-1,f=x?1:-1,n=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(h=isNaN(a)?1:0,r=i):(r=Math.floor(Math.log(a)/Math.LN2),a*(s=Math.pow(2,-r))<1&&(r--,s*=2),r+o>=1?a+=c/s:a+=c*Math.pow(2,1-o),a*s>=2&&(r++,s/=2),r+o>=i?(h=0,r=i):r+o>=1?(h=(a*s-1)*Math.pow(2,M),r=r+o):(h=a*Math.pow(2,o-1)*Math.pow(2,M),r=0));M>=8;w[_+p]=h&255,p+=f,h/=256,M-=8);for(r=r<<M|h,N+=M;N>0;w[_+p]=r&255,p+=f,r/=256,N-=8);w[_+p-f]|=n*128};module.exports=d.__exports;
@@ -0,0 +1,28 @@
1
+ import { __exports as v } from "./index108.js";
2
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
3
+ v.read = function(s, a, x, f, M) {
4
+ var t, r, h = M * 8 - f - 1, w = (1 << h) - 1, N = w >> 1, i = -7, o = x ? M - 1 : 0, d = x ? -1 : 1, p = s[a + o];
5
+ for (o += d, t = p & (1 << -i) - 1, p >>= -i, i += h; i > 0; t = t * 256 + s[a + o], o += d, i -= 8)
6
+ ;
7
+ for (r = t & (1 << -i) - 1, t >>= -i, i += f; i > 0; r = r * 256 + s[a + o], o += d, i -= 8)
8
+ ;
9
+ if (t === 0)
10
+ t = 1 - N;
11
+ else {
12
+ if (t === w)
13
+ return r ? NaN : (p ? -1 : 1) * (1 / 0);
14
+ r = r + Math.pow(2, f), t = t - N;
15
+ }
16
+ return (p ? -1 : 1) * r * Math.pow(2, t - f);
17
+ };
18
+ v.write = function(s, a, x, f, M, t) {
19
+ var r, h, w, N = t * 8 - M - 1, i = (1 << N) - 1, o = i >> 1, d = M === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = f ? 0 : t - 1, c = f ? 1 : -1, I = a < 0 || a === 0 && 1 / a < 0 ? 1 : 0;
20
+ for (a = Math.abs(a), isNaN(a) || a === 1 / 0 ? (h = isNaN(a) ? 1 : 0, r = i) : (r = Math.floor(Math.log(a) / Math.LN2), a * (w = Math.pow(2, -r)) < 1 && (r--, w *= 2), r + o >= 1 ? a += d / w : a += d * Math.pow(2, 1 - o), a * w >= 2 && (r++, w /= 2), r + o >= i ? (h = 0, r = i) : r + o >= 1 ? (h = (a * w - 1) * Math.pow(2, M), r = r + o) : (h = a * Math.pow(2, o - 1) * Math.pow(2, M), r = 0)); M >= 8; s[x + p] = h & 255, p += c, h /= 256, M -= 8)
21
+ ;
22
+ for (r = r << M | h, N += M; N > 0; s[x + p] = r & 255, p += c, r /= 256, N -= 8)
23
+ ;
24
+ s[x + p - c] |= I * 128;
25
+ };
26
+ export {
27
+ v as default
28
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
@@ -0,0 +1,4 @@
1
+ var s = {};
2
+ export {
3
+ s as __exports
4
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
@@ -0,0 +1,4 @@
1
+ var e = {};
2
+ export {
3
+ e as __exports
4
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index129.cjs"),u=require("./index110.cjs");function a(o,t,s,i){if(typeof o.setBigUint64=="function")return o.setBigUint64(t,s,i);const n=BigInt(32),h=BigInt(4294967295),e=Number(s>>n&h),r=Number(s&h),c=i?4:0,l=i?0:4;o.setUint32(t+c,e,i),o.setUint32(t+l,r,i)}const d=(o,t,s)=>o&t^~o&s,b=(o,t,s)=>o&t^o&s^t&s;class w extends u.Hash{constructor(t,s,i,n){super(),this.blockLen=t,this.outputLen=s,this.padOffset=i,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=u.createView(this.buffer)}update(t){p.exists(this);const{view:s,buffer:i,blockLen:n}=this;t=u.toBytes(t);const h=t.length;for(let e=0;e<h;){const r=Math.min(n-this.pos,h-e);if(r===n){const c=u.createView(t);for(;n<=h-e;e+=n)this.process(c,e);continue}i.set(t.subarray(e,e+r),this.pos),this.pos+=r,e+=r,this.pos===n&&(this.process(s,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){p.exists(this),p.output(t,this),this.finished=!0;const{buffer:s,view:i,blockLen:n,isLE:h}=this;let{pos:e}=this;s[e++]=128,this.buffer.subarray(e).fill(0),this.padOffset>n-e&&(this.process(i,0),e=0);for(let f=e;f<n;f++)s[f]=0;a(i,n-8,BigInt(this.length*8),h),this.process(i,0);const r=u.createView(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,g=this.get();if(l>g.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<l;f++)r.setUint32(4*f,g[f],h)}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const i=t.slice(0,s);return this.destroy(),i}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:s,buffer:i,length:n,finished:h,destroyed:e,pos:r}=this;return t.length=n,t.pos=r,t.finished=h,t.destroyed=e,n%s&&t.buffer.set(i),t}}exports.Chi=d;exports.HashMD=w;exports.Maj=b;
@@ -0,0 +1,64 @@
1
+ import { exists as g, output as d } from "./index129.js";
2
+ import { Hash as b, createView as p, toBytes as a } from "./index110.js";
3
+ function w(o, t, s, i) {
4
+ if (typeof o.setBigUint64 == "function")
5
+ return o.setBigUint64(t, s, i);
6
+ const n = BigInt(32), h = BigInt(4294967295), e = Number(s >> n & h), r = Number(s & h), c = i ? 4 : 0, u = i ? 0 : 4;
7
+ o.setUint32(t + c, e, i), o.setUint32(t + u, r, i);
8
+ }
9
+ const B = (o, t, s) => o & t ^ ~o & s, L = (o, t, s) => o & t ^ o & s ^ t & s;
10
+ class U extends b {
11
+ constructor(t, s, i, n) {
12
+ super(), this.blockLen = t, this.outputLen = s, this.padOffset = i, this.isLE = n, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(t), this.view = p(this.buffer);
13
+ }
14
+ update(t) {
15
+ g(this);
16
+ const { view: s, buffer: i, blockLen: n } = this;
17
+ t = a(t);
18
+ const h = t.length;
19
+ for (let e = 0; e < h; ) {
20
+ const r = Math.min(n - this.pos, h - e);
21
+ if (r === n) {
22
+ const c = p(t);
23
+ for (; n <= h - e; e += n)
24
+ this.process(c, e);
25
+ continue;
26
+ }
27
+ i.set(t.subarray(e, e + r), this.pos), this.pos += r, e += r, this.pos === n && (this.process(s, 0), this.pos = 0);
28
+ }
29
+ return this.length += t.length, this.roundClean(), this;
30
+ }
31
+ digestInto(t) {
32
+ g(this), d(t, this), this.finished = !0;
33
+ const { buffer: s, view: i, blockLen: n, isLE: h } = this;
34
+ let { pos: e } = this;
35
+ s[e++] = 128, this.buffer.subarray(e).fill(0), this.padOffset > n - e && (this.process(i, 0), e = 0);
36
+ for (let f = e; f < n; f++)
37
+ s[f] = 0;
38
+ w(i, n - 8, BigInt(this.length * 8), h), this.process(i, 0);
39
+ const r = p(t), c = this.outputLen;
40
+ if (c % 4)
41
+ throw new Error("_sha2: outputLen should be aligned to 32bit");
42
+ const u = c / 4, l = this.get();
43
+ if (u > l.length)
44
+ throw new Error("_sha2: outputLen bigger than state");
45
+ for (let f = 0; f < u; f++)
46
+ r.setUint32(4 * f, l[f], h);
47
+ }
48
+ digest() {
49
+ const { buffer: t, outputLen: s } = this;
50
+ this.digestInto(t);
51
+ const i = t.slice(0, s);
52
+ return this.destroy(), i;
53
+ }
54
+ _cloneInto(t) {
55
+ t || (t = new this.constructor()), t.set(...this.get());
56
+ const { blockLen: s, buffer: i, length: n, finished: h, destroyed: e, pos: r } = this;
57
+ return t.length = n, t.pos = r, t.finished = h, t.destroyed = e, n % s && t.buffer.set(i), t;
58
+ }
59
+ }
60
+ export {
61
+ B as Chi,
62
+ U as HashMD,
63
+ L as Maj
64
+ };
package/dist/index11.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("@catalogfi/wallets"),H=require("bitcoinjs-lib"),O=require("tiny-secp256k1"),P=require("./index26.cjs"),f=require("./index10.cjs"),u=require("./index27.cjs");function S(p){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const r in p)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(p,r);Object.defineProperty(e,r,t.get?t:{enumerable:!0,get:()=>p[r]})}}return e.default=p,Object.freeze(e)}const h=S(H),k=S(O),m=192;h.initEccLib(k);class v{constructor(e,r,t,s,i,a,d,o){this.secretHash=t,this.redeemerPubkey=s,this.initiatorPubkey=i,this.expiry=a,this.signer=e,this.network=d,this.internalPubkey=P.generateInternalkey(),this.initiateAmount=r,this.utxoHashes=o}static async from(e,r,t,s,i,a,d){t=t.startsWith("0x")?t.slice(2):t,f.assert(t.length===64,u.htlcErrors.secretHashLenMismatch),f.assert(s.length===64||s.length===66,`initiator ${u.htlcErrors.pubkeyLenMismatch}`),f.assert(i.length===64||i.length===66,`redeemer ${u.htlcErrors.pubkeyLenMismatch}`),f.assert(a>0,u.htlcErrors.zeroOrNegativeExpiry);const o=await e.getNetwork();return new v(e,r,t,f.xOnlyPubkey(i).toString("hex"),f.xOnlyPubkey(s).toString("hex"),a,o,d)}address(){const{address:e}=h.payments.p2tr({internalPubkey:this.internalPubkey,network:this.network,scriptTree:this.leaves()});if(!e)throw new Error(u.htlcErrors.htlcAddressGenerationFailed);return e}id(){return this.address()}async _buildRawTx(e,r){const t=new h.Transaction;t.version=2;const s=this.address(),i=await this.signer.getProvider();let a=[];if(this.utxoHashes&&this.utxoHashes.length>0)for(const o of this.utxoHashes){const l=await i.getTransaction(o);for(let g=0;g<l.vout.length;g++){const n=l.vout[g];n.scriptpubkey_address===s&&a.push({txid:l.txid,vout:g,value:n.value,status:{confirmed:!1}})}}else a=await i.getUTXOs(s);const d=a.reduce((o,l)=>o+l.value,0);if(d===0)throw new Error(`${s} ${u.htlcErrors.notFunded}`);for(let o=0;o<a.length;o++)t.addInput(Buffer.from(a[o].txid,"hex").reverse(),a[o].vout);return r??(r=await i.suggestFee(s,d,b.Urgency.MEDIUM)),t.addOutput(h.address.toOutputScript(e,this.network),d-r),{tx:t,usedUtxos:a}}async buildRawTx(e){return await this._buildRawTx(await this.signer.getAddress(),e)}getOutputScript(){return h.address.toOutputScript(this.address(),this.network)}async init(e){return e??(e=await(await this.signer.getProvider()).suggestFee(await this.signer.getAddress(),this.initiateAmount,b.Urgency.MEDIUM)),await this.signer.send(this.address(),this.initiateAmount,e)}async instantRefund(e,r){f.assert(e.length>0,u.htlcErrors.noCounterpartySigs);const{tx:t,usedUtxos:s}=await this.buildRawTx(r);for(const n of s)if(!e.find(c=>c.utxo===n.txid))throw new Error(u.htlcErrors.counterPartySigNotFound(n.txid));const i=this.getOutputScript(),a=h.Transaction.SIGHASH_DEFAULT,d=this.leafHash(2),o=s.map(n=>n.value),l=y(i,s.length);for(let n=0;n<t.ins.length;n++){const c=t.hashForWitnessV1(n,l,o,a,d);if(!k.verifySchnorr(c,Buffer.from(this.redeemerPubkey,"hex"),Buffer.from(e[n].sig,"hex")))throw new Error(u.htlcErrors.invalidCounterpartySigForUTXO(e[n].utxo));const w=await this.signer.signSchnorr(c),x=Buffer.from(t.ins[n].hash).reverse().toString("hex"),E=e.find(L=>L.utxo===x);if(!E)throw new Error(u.htlcErrors.counterPartySigNotFound(x));t.setWitness(n,[Buffer.from(E.sig,"hex"),w,this.instantRefundLeaf(),this.generateControlBlockFor(2)])}return await(await this.signer.getProvider()).broadcast(t.toHex())}async redeem(e,r,t){f.assert(h.crypto.sha256(Buffer.from(e,"hex")).toString("hex")===this.secretHash,u.htlcErrors.secretMismatch);const{tx:s,usedUtxos:i}=await this._buildRawTx(r??await this.signer.getAddress(),t),a=this.leafHash(1),d=i.map(n=>n.value),o=y(this.getOutputScript(),i.length),l=h.Transaction.SIGHASH_DEFAULT;for(let n=0;n<s.ins.length;n++){const c=s.hashForWitnessV1(n,o,d,l,a),w=await this.signer.signSchnorr(c);s.setWitness(n,[w,Buffer.from(e,"hex"),this.redeemLeaf(),this.generateControlBlockFor(1)])}return await(await this.signer.getProvider()).broadcast(s.toHex())}async refund(e,r){const{tx:t,usedUtxos:s}=await this._buildRawTx(e??await this.signer.getAddress(),r),[i,a]=await this.canRefund(s);if(!i)throw new Error(u.htlcErrors.htlcNotExpired(a));const d=this.leafHash(0),o=s.map(c=>c.value),l=y(this.getOutputScript(),s.length),g=h.Transaction.SIGHASH_DEFAULT;for(let c=0;c<t.ins.length;c++){t.ins[c].sequence=this.expiry;const w=t.hashForWitnessV1(c,l,o,g,d),x=await this.signer.signSchnorr(w);t.setWitness(c,[x,this.refundLeaf(),this.generateControlBlockFor(0)])}return await(await this.signer.getProvider()).broadcast(t.toHex())}async canRefund(e){const t=await(await this.signer.getProvider()).getLatestTip();for(const s of e){let i=0;if(s.status.confirmed&&s.status.block_height+this.expiry>t?i=s.status.block_height+this.expiry-t+1:s.status.confirmed||(i=this.expiry+1),i>0)return[!1,i]}return[!0,0]}generateControlBlockFor(e){let r;switch(e){case 1:r=this.redeemLeaf();break;case 0:r=this.refundLeaf();break;case 2:r=this.instantRefundLeaf();break;default:throw new Error(u.htlcErrors.invalidLeaf)}const t=h.payments.p2tr({internalPubkey:this.internalPubkey,network:this.network,scriptTree:this.leaves(),redeem:{output:r,redeemVersion:m}});if(!t.witness)throw new Error(u.htlcErrors.controlBlockGenerationFailed);return t.witness[t.witness.length-1]}leafHash(e){let r=this.redeemLeaf();return e===0&&(r=this.refundLeaf()),e===2&&(r=this.instantRefundLeaf()),h.crypto.taggedHash("TapLeaf",f.serializeScript(r))}refundLeaf(){return h.script.fromASM(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("@catalogfi/wallets"),H=require("bitcoinjs-lib"),O=require("tiny-secp256k1"),P=require("./index28.cjs"),f=require("./index10.cjs"),u=require("./index29.cjs");function S(p){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const r in p)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(p,r);Object.defineProperty(e,r,t.get?t:{enumerable:!0,get:()=>p[r]})}}return e.default=p,Object.freeze(e)}const h=S(H),k=S(O),m=192;h.initEccLib(k);class v{constructor(e,r,t,s,i,a,d,o){this.secretHash=t,this.redeemerPubkey=s,this.initiatorPubkey=i,this.expiry=a,this.signer=e,this.network=d,this.internalPubkey=P.generateInternalkey(),this.initiateAmount=r,this.utxoHashes=o}static async from(e,r,t,s,i,a,d){t=t.startsWith("0x")?t.slice(2):t,f.assert(t.length===64,u.htlcErrors.secretHashLenMismatch),f.assert(s.length===64||s.length===66,`initiator ${u.htlcErrors.pubkeyLenMismatch}`),f.assert(i.length===64||i.length===66,`redeemer ${u.htlcErrors.pubkeyLenMismatch}`),f.assert(a>0,u.htlcErrors.zeroOrNegativeExpiry);const o=await e.getNetwork();return new v(e,r,t,f.xOnlyPubkey(i).toString("hex"),f.xOnlyPubkey(s).toString("hex"),a,o,d)}address(){const{address:e}=h.payments.p2tr({internalPubkey:this.internalPubkey,network:this.network,scriptTree:this.leaves()});if(!e)throw new Error(u.htlcErrors.htlcAddressGenerationFailed);return e}id(){return this.address()}async _buildRawTx(e,r){const t=new h.Transaction;t.version=2;const s=this.address(),i=await this.signer.getProvider();let a=[];if(this.utxoHashes&&this.utxoHashes.length>0)for(const o of this.utxoHashes){const l=await i.getTransaction(o);for(let g=0;g<l.vout.length;g++){const n=l.vout[g];n.scriptpubkey_address===s&&a.push({txid:l.txid,vout:g,value:n.value,status:{confirmed:!1}})}}else a=await i.getUTXOs(s);const d=a.reduce((o,l)=>o+l.value,0);if(d===0)throw new Error(`${s} ${u.htlcErrors.notFunded}`);for(let o=0;o<a.length;o++)t.addInput(Buffer.from(a[o].txid,"hex").reverse(),a[o].vout);return r??(r=await i.suggestFee(s,d,b.Urgency.MEDIUM)),t.addOutput(h.address.toOutputScript(e,this.network),d-r),{tx:t,usedUtxos:a}}async buildRawTx(e){return await this._buildRawTx(await this.signer.getAddress(),e)}getOutputScript(){return h.address.toOutputScript(this.address(),this.network)}async init(e){return e??(e=await(await this.signer.getProvider()).suggestFee(await this.signer.getAddress(),this.initiateAmount,b.Urgency.MEDIUM)),await this.signer.send(this.address(),this.initiateAmount,e)}async instantRefund(e,r){f.assert(e.length>0,u.htlcErrors.noCounterpartySigs);const{tx:t,usedUtxos:s}=await this.buildRawTx(r);for(const n of s)if(!e.find(c=>c.utxo===n.txid))throw new Error(u.htlcErrors.counterPartySigNotFound(n.txid));const i=this.getOutputScript(),a=h.Transaction.SIGHASH_DEFAULT,d=this.leafHash(2),o=s.map(n=>n.value),l=y(i,s.length);for(let n=0;n<t.ins.length;n++){const c=t.hashForWitnessV1(n,l,o,a,d);if(!k.verifySchnorr(c,Buffer.from(this.redeemerPubkey,"hex"),Buffer.from(e[n].sig,"hex")))throw new Error(u.htlcErrors.invalidCounterpartySigForUTXO(e[n].utxo));const w=await this.signer.signSchnorr(c),x=Buffer.from(t.ins[n].hash).reverse().toString("hex"),E=e.find(L=>L.utxo===x);if(!E)throw new Error(u.htlcErrors.counterPartySigNotFound(x));t.setWitness(n,[Buffer.from(E.sig,"hex"),w,this.instantRefundLeaf(),this.generateControlBlockFor(2)])}return await(await this.signer.getProvider()).broadcast(t.toHex())}async redeem(e,r,t){f.assert(h.crypto.sha256(Buffer.from(e,"hex")).toString("hex")===this.secretHash,u.htlcErrors.secretMismatch);const{tx:s,usedUtxos:i}=await this._buildRawTx(r??await this.signer.getAddress(),t),a=this.leafHash(1),d=i.map(n=>n.value),o=y(this.getOutputScript(),i.length),l=h.Transaction.SIGHASH_DEFAULT;for(let n=0;n<s.ins.length;n++){const c=s.hashForWitnessV1(n,o,d,l,a),w=await this.signer.signSchnorr(c);s.setWitness(n,[w,Buffer.from(e,"hex"),this.redeemLeaf(),this.generateControlBlockFor(1)])}return await(await this.signer.getProvider()).broadcast(s.toHex())}async refund(e,r){const{tx:t,usedUtxos:s}=await this._buildRawTx(e??await this.signer.getAddress(),r),[i,a]=await this.canRefund(s);if(!i)throw new Error(u.htlcErrors.htlcNotExpired(a));const d=this.leafHash(0),o=s.map(c=>c.value),l=y(this.getOutputScript(),s.length),g=h.Transaction.SIGHASH_DEFAULT;for(let c=0;c<t.ins.length;c++){t.ins[c].sequence=this.expiry;const w=t.hashForWitnessV1(c,l,o,g,d),x=await this.signer.signSchnorr(w);t.setWitness(c,[x,this.refundLeaf(),this.generateControlBlockFor(0)])}return await(await this.signer.getProvider()).broadcast(t.toHex())}async canRefund(e){const t=await(await this.signer.getProvider()).getLatestTip();for(const s of e){let i=0;if(s.status.confirmed&&s.status.block_height+this.expiry>t?i=s.status.block_height+this.expiry-t+1:s.status.confirmed||(i=this.expiry+1),i>0)return[!1,i]}return[!0,0]}generateControlBlockFor(e){let r;switch(e){case 1:r=this.redeemLeaf();break;case 0:r=this.refundLeaf();break;case 2:r=this.instantRefundLeaf();break;default:throw new Error(u.htlcErrors.invalidLeaf)}const t=h.payments.p2tr({internalPubkey:this.internalPubkey,network:this.network,scriptTree:this.leaves(),redeem:{output:r,redeemVersion:m}});if(!t.witness)throw new Error(u.htlcErrors.controlBlockGenerationFailed);return t.witness[t.witness.length-1]}leafHash(e){let r=this.redeemLeaf();return e===0&&(r=this.refundLeaf()),e===2&&(r=this.instantRefundLeaf()),h.crypto.taggedHash("TapLeaf",f.serializeScript(r))}refundLeaf(){return h.script.fromASM(`
2
2
  ${h.script.number.encode(this.expiry).toString("hex")}
3
3
  OP_CHECKSEQUENCEVERIFY
4
4
  OP_DROP
package/dist/index11.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { Urgency as y } from "@catalogfi/wallets";
2
2
  import * as h from "bitcoinjs-lib";
3
3
  import * as k from "tiny-secp256k1";
4
- import { generateInternalkey as b } from "./index26.js";
4
+ import { generateInternalkey as b } from "./index28.js";
5
5
  import { assert as g, xOnlyPubkey as L, serializeScript as P, sortLeaves as O } from "./index10.js";
6
- import { htlcErrors as u } from "./index27.js";
6
+ import { htlcErrors as u } from "./index29.js";
7
7
  const m = 192;
8
8
  h.initEccLib(k);
9
9
  class H {
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index129.cjs");/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),i=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),y=(t,e)=>t<<32-e|t>>>e,b=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,o=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function p(t){for(let e=0;e<t.length;e++)t[e]=o(t[e])}function f(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function r(t){return typeof t=="string"&&(t=f(t)),s.bytes(t),t}class w{clone(){return this._cloneInto()}}function l(t){const e=c=>t().update(r(c)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}exports.Hash=w;exports.byteSwap=o;exports.byteSwap32=p;exports.createView=i;exports.isLE=b;exports.rotr=y;exports.toBytes=r;exports.u32=u;exports.utf8ToBytes=f;exports.wrapConstructor=l;
@@ -0,0 +1,37 @@
1
+ import { bytes as f } from "./index129.js";
2
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
+ const s = (t) => new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4)), y = (t) => new DataView(t.buffer, t.byteOffset, t.byteLength), p = (t, e) => t << 32 - e | t >>> e, b = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68, c = (t) => t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
4
+ function w(t) {
5
+ for (let e = 0; e < t.length; e++)
6
+ t[e] = c(t[e]);
7
+ }
8
+ function r(t) {
9
+ if (typeof t != "string")
10
+ throw new Error(`utf8ToBytes expected string, got ${typeof t}`);
11
+ return new Uint8Array(new TextEncoder().encode(t));
12
+ }
13
+ function u(t) {
14
+ return typeof t == "string" && (t = r(t)), f(t), t;
15
+ }
16
+ class x {
17
+ // Safe version that clones internal state
18
+ clone() {
19
+ return this._cloneInto();
20
+ }
21
+ }
22
+ function g(t) {
23
+ const e = (o) => t().update(u(o)).digest(), n = t();
24
+ return e.outputLen = n.outputLen, e.blockLen = n.blockLen, e.create = () => t(), e;
25
+ }
26
+ export {
27
+ x as Hash,
28
+ c as byteSwap,
29
+ w as byteSwap32,
30
+ y as createView,
31
+ b as isLE,
32
+ p as rotr,
33
+ u as toBytes,
34
+ s as u32,
35
+ r as utf8ToBytes,
36
+ g as wrapConstructor
37
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=6,s=32,e=4096,n=s*e,o=n*t-1-1*e*t;exports.bytesPerBlob=n;exports.bytesPerFieldElement=s;exports.fieldElementsPerBlob=e;exports.maxBytesPerTransaction=o;
@@ -0,0 +1,7 @@
1
+ const e = 32, s = 4096, t = 131072, l = 761855;
2
+ export {
3
+ t as bytesPerBlob,
4
+ e as bytesPerFieldElement,
5
+ s as fieldElementsPerBlob,
6
+ l as maxBytesPerTransaction
7
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
@@ -0,0 +1,4 @@
1
+ var r = { exports: {} };
2
+ export {
3
+ r as __module
4
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index55.cjs"),a=require("./index126.cjs"),_=require("./index99.cjs");var h=u.safeBufferExports.Buffer,l=a.readableBrowserExports.Transform,c=_.inherits_browserExports;function p(t,e){if(!h.isBuffer(t)&&typeof t!="string")throw new TypeError(e+" must be a string or a buffer")}function i(t){l.call(this),this._block=h.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}c(i,l);i.prototype._transform=function(t,e,r){var s=null;try{this.update(t,e)}catch(f){s=f}r(s)};i.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(r){e=r}t(e)};i.prototype.update=function(t,e){if(p(t,"Data"),this._finalized)throw new Error("Digest already called");h.isBuffer(t)||(t=h.from(t,e));for(var r=this._block,s=0;this._blockOffset+t.length-s>=this._blockSize;){for(var f=this._blockOffset;f<this._blockSize;)r[f++]=t[s++];this._update(),this._blockOffset=0}for(;s<t.length;)r[this._blockOffset++]=t[s++];for(var n=0,o=t.length*8;o>0;++n)this._length[n]+=o,o=this._length[n]/4294967296|0,o>0&&(this._length[n]-=4294967296*o);return this};i.prototype._update=function(){throw new Error("_update is not implemented")};i.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();t!==void 0&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e};i.prototype._digest=function(){throw new Error("_digest is not implemented")};var g=i;exports.hashBase=g;
@@ -0,0 +1,60 @@
1
+ import { s as a } from "./index55.js";
2
+ import { r as _ } from "./index126.js";
3
+ import { i as p } from "./index99.js";
4
+ var n = a.Buffer, l = _.Transform, u = p;
5
+ function c(t, r) {
6
+ if (!n.isBuffer(t) && typeof t != "string")
7
+ throw new TypeError(r + " must be a string or a buffer");
8
+ }
9
+ function i(t) {
10
+ l.call(this), this._block = n.allocUnsafe(t), this._blockSize = t, this._blockOffset = 0, this._length = [0, 0, 0, 0], this._finalized = !1;
11
+ }
12
+ u(i, l);
13
+ i.prototype._transform = function(t, r, e) {
14
+ var s = null;
15
+ try {
16
+ this.update(t, r);
17
+ } catch (f) {
18
+ s = f;
19
+ }
20
+ e(s);
21
+ };
22
+ i.prototype._flush = function(t) {
23
+ var r = null;
24
+ try {
25
+ this.push(this.digest());
26
+ } catch (e) {
27
+ r = e;
28
+ }
29
+ t(r);
30
+ };
31
+ i.prototype.update = function(t, r) {
32
+ if (c(t, "Data"), this._finalized) throw new Error("Digest already called");
33
+ n.isBuffer(t) || (t = n.from(t, r));
34
+ for (var e = this._block, s = 0; this._blockOffset + t.length - s >= this._blockSize; ) {
35
+ for (var f = this._blockOffset; f < this._blockSize; ) e[f++] = t[s++];
36
+ this._update(), this._blockOffset = 0;
37
+ }
38
+ for (; s < t.length; ) e[this._blockOffset++] = t[s++];
39
+ for (var h = 0, o = t.length * 8; o > 0; ++h)
40
+ this._length[h] += o, o = this._length[h] / 4294967296 | 0, o > 0 && (this._length[h] -= 4294967296 * o);
41
+ return this;
42
+ };
43
+ i.prototype._update = function() {
44
+ throw new Error("_update is not implemented");
45
+ };
46
+ i.prototype.digest = function(t) {
47
+ if (this._finalized) throw new Error("Digest already called");
48
+ this._finalized = !0;
49
+ var r = this._digest();
50
+ t !== void 0 && (r = r.toString(t)), this._block.fill(0), this._blockOffset = 0;
51
+ for (var e = 0; e < 4; ++e) this._length[e] = 0;
52
+ return r;
53
+ };
54
+ i.prototype._digest = function() {
55
+ throw new Error("_digest is not implemented");
56
+ };
57
+ var m = i;
58
+ export {
59
+ m as h
60
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
@@ -0,0 +1,4 @@
1
+ var s = { exports: {} };
2
+ export {
3
+ s as __module
4
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index99.cjs"),d=require("./index127.cjs"),x=require("./index55.cjs");var b=v.inherits_browserExports,c=d.hash,p=x.safeBufferExports.Buffer,w=[1518500249,1859775393,-1894007588,-899497514],l=new Array(80);function a(){this.init(),this._w=l,c.call(this,64,56)}b(a,c);a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function B(t){return t<<5|t>>>27}function E(t){return t<<30|t>>>2}function y(t,r,i,s){return t===0?r&i|~r&s:t===2?r&i|r&s|i&s:r^i^s}a.prototype._update=function(t){for(var r=this._w,i=this._a|0,s=this._b|0,h=this._c|0,n=this._d|0,o=this._e|0,e=0;e<16;++e)r[e]=t.readInt32BE(e*4);for(;e<80;++e)r[e]=r[e-3]^r[e-8]^r[e-14]^r[e-16];for(var _=0;_<80;++_){var f=~~(_/20),u=B(i)+y(f,s,h,n)+o+r[_]+w[f]|0;o=n,n=h,h=E(s),s=i,i=u}this._a=i+this._a|0,this._b=s+this._b|0,this._c=h+this._c|0,this._d=n+this._d|0,this._e=o+this._e|0};a.prototype._hash=function(){var t=p.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var I=a;exports.sha=I;
@@ -0,0 +1,42 @@
1
+ import { i as u } from "./index99.js";
2
+ import { h as p } from "./index127.js";
3
+ import { s as x } from "./index55.js";
4
+ var d = u, c = p, w = x.Buffer, B = [
5
+ 1518500249,
6
+ 1859775393,
7
+ -1894007588,
8
+ -899497514
9
+ ], b = new Array(80);
10
+ function h() {
11
+ this.init(), this._w = b, c.call(this, 64, 56);
12
+ }
13
+ d(h, c);
14
+ h.prototype.init = function() {
15
+ return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
16
+ };
17
+ function E(t) {
18
+ return t << 5 | t >>> 27;
19
+ }
20
+ function l(t) {
21
+ return t << 30 | t >>> 2;
22
+ }
23
+ function I(t, r, s, a) {
24
+ return t === 0 ? r & s | ~r & a : t === 2 ? r & s | r & a | s & a : r ^ s ^ a;
25
+ }
26
+ h.prototype._update = function(t) {
27
+ for (var r = this._w, s = this._a | 0, a = this._b | 0, e = this._c | 0, n = this._d | 0, o = this._e | 0, i = 0; i < 16; ++i) r[i] = t.readInt32BE(i * 4);
28
+ for (; i < 80; ++i) r[i] = r[i - 3] ^ r[i - 8] ^ r[i - 14] ^ r[i - 16];
29
+ for (var _ = 0; _ < 80; ++_) {
30
+ var f = ~~(_ / 20), v = E(s) + I(f, a, e, n) + o + r[_] + B[f] | 0;
31
+ o = n, n = e, e = l(a), a = s, s = v;
32
+ }
33
+ this._a = s + this._a | 0, this._b = a + this._b | 0, this._c = e + this._c | 0, this._d = n + this._d | 0, this._e = o + this._e | 0;
34
+ };
35
+ h.prototype._hash = function() {
36
+ var t = w.allocUnsafe(20);
37
+ return t.writeInt32BE(this._a | 0, 0), t.writeInt32BE(this._b | 0, 4), t.writeInt32BE(this._c | 0, 8), t.writeInt32BE(this._d | 0, 12), t.writeInt32BE(this._e | 0, 16), t;
38
+ };
39
+ var W = h;
40
+ export {
41
+ W as s
42
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index99.cjs"),d=require("./index127.cjs"),x=require("./index55.cjs");var b=v.inherits_browserExports,c=d.hash,l=x.safeBufferExports.Buffer,p=[1518500249,1859775393,-1894007588,-899497514],w=new Array(80);function a(){this.init(),this._w=w,c.call(this,64,56)}b(a,c);a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function B(t){return t<<1|t>>>31}function E(t){return t<<5|t>>>27}function y(t){return t<<30|t>>>2}function I(t,r,i,s){return t===0?r&i|~r&s:t===2?r&i|r&s|i&s:r^i^s}a.prototype._update=function(t){for(var r=this._w,i=this._a|0,s=this._b|0,h=this._c|0,n=this._d|0,_=this._e|0,e=0;e<16;++e)r[e]=t.readInt32BE(e*4);for(;e<80;++e)r[e]=B(r[e-3]^r[e-8]^r[e-14]^r[e-16]);for(var o=0;o<80;++o){var f=~~(o/20),u=E(i)+I(f,s,h,n)+_+r[o]+p[f]|0;_=n,n=h,h=y(s),s=i,i=u}this._a=i+this._a|0,this._b=s+this._b|0,this._c=h+this._c|0,this._d=n+this._d|0,this._e=_+this._e|0};a.prototype._hash=function(){var t=l.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var q=a;exports.sha1=q;
@@ -0,0 +1,45 @@
1
+ import { i as v } from "./index99.js";
2
+ import { h as p } from "./index127.js";
3
+ import { s as x } from "./index55.js";
4
+ var d = v, c = p, w = x.Buffer, B = [
5
+ 1518500249,
6
+ 1859775393,
7
+ -1894007588,
8
+ -899497514
9
+ ], b = new Array(80);
10
+ function h() {
11
+ this.init(), this._w = b, c.call(this, 64, 56);
12
+ }
13
+ d(h, c);
14
+ h.prototype.init = function() {
15
+ return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
16
+ };
17
+ function E(t) {
18
+ return t << 1 | t >>> 31;
19
+ }
20
+ function l(t) {
21
+ return t << 5 | t >>> 27;
22
+ }
23
+ function I(t) {
24
+ return t << 30 | t >>> 2;
25
+ }
26
+ function y(t, r, s, a) {
27
+ return t === 0 ? r & s | ~r & a : t === 2 ? r & s | r & a | s & a : r ^ s ^ a;
28
+ }
29
+ h.prototype._update = function(t) {
30
+ for (var r = this._w, s = this._a | 0, a = this._b | 0, e = this._c | 0, n = this._d | 0, _ = this._e | 0, i = 0; i < 16; ++i) r[i] = t.readInt32BE(i * 4);
31
+ for (; i < 80; ++i) r[i] = E(r[i - 3] ^ r[i - 8] ^ r[i - 14] ^ r[i - 16]);
32
+ for (var o = 0; o < 80; ++o) {
33
+ var f = ~~(o / 20), u = l(s) + y(f, a, e, n) + _ + r[o] + B[f] | 0;
34
+ _ = n, n = e, e = I(a), a = s, s = u;
35
+ }
36
+ this._a = s + this._a | 0, this._b = a + this._b | 0, this._c = e + this._c | 0, this._d = n + this._d | 0, this._e = _ + this._e | 0;
37
+ };
38
+ h.prototype._hash = function() {
39
+ var t = w.allocUnsafe(20);
40
+ return t.writeInt32BE(this._a | 0, 0), t.writeInt32BE(this._b | 0, 4), t.writeInt32BE(this._c | 0, 8), t.writeInt32BE(this._d | 0, 12), t.writeInt32BE(this._e | 0, 16), t;
41
+ };
42
+ var A = h;
43
+ export {
44
+ A as s
45
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index99.cjs"),e=require("./index118.cjs"),s=require("./index127.cjs"),h=require("./index55.cjs");var a=r.inherits_browserExports,n=e.sha256,f=s.hash,o=h.safeBufferExports.Buffer,_=new Array(64);function i(){this.init(),this._w=_,f.call(this,64,56)}a(i,n);i.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};i.prototype._hash=function(){var t=o.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var c=i;exports.sha224=c;
@@ -0,0 +1,20 @@
1
+ import { i as r } from "./index99.js";
2
+ import { s } from "./index118.js";
3
+ import { h } from "./index127.js";
4
+ import { s as a } from "./index55.js";
5
+ var e = r, f = s, n = h, o = a.Buffer, _ = new Array(64);
6
+ function i() {
7
+ this.init(), this._w = _, n.call(this, 64, 56);
8
+ }
9
+ e(i, f);
10
+ i.prototype.init = function() {
11
+ return this._a = 3238371032, this._b = 914150663, this._c = 812702999, this._d = 4144912697, this._e = 4290775857, this._f = 1750603025, this._g = 1694076839, this._h = 3204075428, this;
12
+ };
13
+ i.prototype._hash = function() {
14
+ var t = o.allocUnsafe(28);
15
+ return t.writeInt32BE(this._a, 0), t.writeInt32BE(this._b, 4), t.writeInt32BE(this._c, 8), t.writeInt32BE(this._d, 12), t.writeInt32BE(this._e, 16), t.writeInt32BE(this._f, 20), t.writeInt32BE(this._g, 24), t;
16
+ };
17
+ var B = i;
18
+ export {
19
+ B as s
20
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./index99.cjs"),u=require("./index127.cjs"),c=require("./index55.cjs");var v=F.inherits_browserExports,f=u.hash,D=c.safeBufferExports.Buffer,b=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],d=new Array(64);function e(){this.init(),this._w=d,f.call(this,64,56)}v(e,f);e.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function w(t,r,s){return s^t&(r^s)}function g(t,r,s){return t&r|s&(t|r)}function p(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function I(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function m(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function l(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}e.prototype._update=function(t){for(var r=this._w,s=this._a|0,x=this._b|0,a=this._c|0,C=this._d|0,h=this._e|0,n=this._f|0,B=this._g|0,A=this._h|0,i=0;i<16;++i)r[i]=t.readInt32BE(i*4);for(;i<64;++i)r[i]=l(r[i-2])+r[i-7]+m(r[i-15])+r[i-16]|0;for(var _=0;_<64;++_){var E=A+I(h)+w(h,n,B)+b[_]+r[_]|0,o=p(s)+g(s,x,a)|0;A=B,B=n,n=h,h=C+E|0,C=a,a=x,x=s,s=E+o|0}this._a=s+this._a|0,this._b=x+this._b|0,this._c=a+this._c|0,this._d=C+this._d|0,this._e=h+this._e|0,this._f=n+this._f|0,this._g=B+this._g|0,this._h=A+this._h|0};e.prototype._hash=function(){var t=D.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var y=e;exports.sha256=y;