@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/index42.js CHANGED
@@ -1,28 +1,15 @@
1
- import { __exports as v } from "./index44.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;
1
+ import { BaseError as r } from "./index59.js";
2
+ class d extends r {
3
+ constructor({ address: s }) {
4
+ super(`Address "${s}" is invalid.`, {
5
+ metaMessages: [
6
+ "- Address must be a hex value of 20 bytes (40 hex characters).",
7
+ "- Address must match its checksum counterpart."
8
+ ],
9
+ name: "InvalidAddressError"
10
+ });
15
11
  }
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
- };
12
+ }
26
13
  export {
27
- v as default
14
+ d as InvalidAddressError
28
15
  };
package/dist/index43.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 c=require("./index73.cjs"),i=require("./index74.cjs"),o=/^0x[a-fA-F0-9]{40}$/,t=new c.LruMap(8192);function f(e,n){const{strict:s=!0}=n??{},r=`${e}.${s}`;if(t.has(r))return t.get(r);const u=o.test(e)?e.toLowerCase()===e?!0:s?i.checksumAddress(e)===e:!0:!1;return t.set(r,u),u}exports.isAddress=f;exports.isAddressCache=t;
package/dist/index43.js CHANGED
@@ -1,4 +1,14 @@
1
- var s = {};
1
+ import { LruMap as u } from "./index73.js";
2
+ import { checksumAddress as c } from "./index74.js";
3
+ const i = /^0x[a-fA-F0-9]{40}$/, r = /* @__PURE__ */ new u(8192);
4
+ function h(t, s) {
5
+ const { strict: n = !0 } = s ?? {}, e = `${t}.${n}`;
6
+ if (r.has(e))
7
+ return r.get(e);
8
+ const o = i.test(t) ? t.toLowerCase() === t ? !0 : n ? c(t) === t : !0 : !1;
9
+ return r.set(e, o), o;
10
+ }
2
11
  export {
3
- s as __exports
12
+ h as isAddress,
13
+ r as isAddressCache
4
14
  };
package/dist/index44.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"});function r(e){return`0x${e.reduce((t,c)=>t+c.replace("0x",""),"")}`}exports.concatHex=r;
package/dist/index44.js CHANGED
@@ -1,4 +1,6 @@
1
- var e = {};
1
+ function n(e) {
2
+ return `0x${e.reduce((c, r) => c + r.replace("0x", ""), "")}`;
3
+ }
2
4
  export {
3
- e as __exports
5
+ n as concatHex
4
6
  };
package/dist/index45.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index52.cjs");typeof Object.create=="function"?r.__module.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:r.__module.exports=function(e,t){if(t){e.super_=t;var o=function(){};o.prototype=t.prototype,e.prototype=new o,e.prototype.constructor=e}};var n=r.__module.exports;exports.inherits_browserExports=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index48.cjs"),f=require("./index57.cjs"),x=require("./index30.cjs"),z=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function H(e,n={}){return typeof e=="number"||typeof e=="bigint"?d(e,n):typeof e=="string"?m(e,n):typeof e=="boolean"?b(e,n):u(e,n)}function b(e,n={}){const t=`0x${Number(e)}`;return typeof n.size=="number"?(x.assertSize(t,{size:n.size}),f.pad(t,{size:n.size})):t}function u(e,n={}){let t="";for(let i=0;i<e.length;i++)t+=z[e[i]];const r=`0x${t}`;return typeof n.size=="number"?(x.assertSize(r,{size:n.size}),f.pad(r,{dir:"right",size:n.size})):r}function d(e,n={}){const{signed:t,size:r}=n,i=BigInt(e);let o;r?t?o=(1n<<BigInt(r)*8n-1n)-1n:o=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));const c=typeof o=="bigint"&&t?-o-1n:0;if(o&&i>o||i<c){const s=typeof e=="bigint"?"n":"";throw new y.IntegerOutOfRangeError({max:o?`${o}${s}`:void 0,min:`${c}${s}`,signed:t,size:r,value:`${e}${s}`})}const g=`0x${(t&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?f.pad(g,{size:r}):g}const T=new TextEncoder;function m(e,n={}){const t=T.encode(e);return u(t,n)}exports.boolToHex=b;exports.bytesToHex=u;exports.numberToHex=d;exports.stringToHex=m;exports.toHex=H;
package/dist/index45.js CHANGED
@@ -1,22 +1,48 @@
1
- import { __module as o } from "./index52.js";
2
- typeof Object.create == "function" ? o.exports = function(e, t) {
3
- t && (e.super_ = t, e.prototype = Object.create(t.prototype, {
4
- constructor: {
5
- value: e,
6
- enumerable: !1,
7
- writable: !0,
8
- configurable: !0
9
- }
10
- }));
11
- } : o.exports = function(e, t) {
12
- if (t) {
13
- e.super_ = t;
14
- var r = function() {
15
- };
16
- r.prototype = t.prototype, e.prototype = new r(), e.prototype.constructor = e;
1
+ import { IntegerOutOfRangeError as x } from "./index48.js";
2
+ import { pad as s } from "./index57.js";
3
+ import { assertSize as c } from "./index30.js";
4
+ const b = /* @__PURE__ */ Array.from({ length: 256 }, (n, e) => e.toString(16).padStart(2, "0"));
5
+ function B(n, e = {}) {
6
+ return typeof n == "number" || typeof n == "bigint" ? y(n, e) : typeof n == "string" ? $(n, e) : typeof n == "boolean" ? z(n, e) : m(n, e);
7
+ }
8
+ function z(n, e = {}) {
9
+ const t = `0x${Number(n)}`;
10
+ return typeof e.size == "number" ? (c(t, { size: e.size }), s(t, { size: e.size })) : t;
11
+ }
12
+ function m(n, e = {}) {
13
+ let t = "";
14
+ for (let i = 0; i < n.length; i++)
15
+ t += b[n[i]];
16
+ const r = `0x${t}`;
17
+ return typeof e.size == "number" ? (c(r, { size: e.size }), s(r, { dir: "right", size: e.size })) : r;
18
+ }
19
+ function y(n, e = {}) {
20
+ const { signed: t, size: r } = e, i = BigInt(n);
21
+ let o;
22
+ r ? t ? o = (1n << BigInt(r) * 8n - 1n) - 1n : o = 2n ** (BigInt(r) * 8n) - 1n : typeof n == "number" && (o = BigInt(Number.MAX_SAFE_INTEGER));
23
+ const g = typeof o == "bigint" && t ? -o - 1n : 0;
24
+ if (o && i > o || i < g) {
25
+ const f = typeof n == "bigint" ? "n" : "";
26
+ throw new x({
27
+ max: o ? `${o}${f}` : void 0,
28
+ min: `${g}${f}`,
29
+ signed: t,
30
+ size: r,
31
+ value: `${n}${f}`
32
+ });
17
33
  }
18
- };
19
- var p = o.exports;
34
+ const u = `0x${(t && i < 0 ? (1n << BigInt(r * 8)) + BigInt(i) : i).toString(16)}`;
35
+ return r ? s(u, { size: r }) : u;
36
+ }
37
+ const d = /* @__PURE__ */ new TextEncoder();
38
+ function $(n, e = {}) {
39
+ const t = d.encode(n);
40
+ return m(t, e);
41
+ }
20
42
  export {
21
- p as i
43
+ z as boolToHex,
44
+ m as bytesToHex,
45
+ y as numberToHex,
46
+ $ as stringToHex,
47
+ B as toHex
22
48
  };
package/dist/index46.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index45.cjs"),u=require("./index53.cjs"),l=require("./index31.cjs");var v=o.inherits_browserExports,_=u.hashBase,k=l.safeBufferExports.Buffer,p=new Array(16);function n(){_.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}v(n,_);n.prototype._update=function(){for(var a=p,i=0;i<16;++i)a[i]=this._block.readInt32LE(i*4);var e=this._a,t=this._b,f=this._c,x=this._d;e=s(e,t,f,x,a[0],3614090360,7),x=s(x,e,t,f,a[1],3905402710,12),f=s(f,x,e,t,a[2],606105819,17),t=s(t,f,x,e,a[3],3250441966,22),e=s(e,t,f,x,a[4],4118548399,7),x=s(x,e,t,f,a[5],1200080426,12),f=s(f,x,e,t,a[6],2821735955,17),t=s(t,f,x,e,a[7],4249261313,22),e=s(e,t,f,x,a[8],1770035416,7),x=s(x,e,t,f,a[9],2336552879,12),f=s(f,x,e,t,a[10],4294925233,17),t=s(t,f,x,e,a[11],2304563134,22),e=s(e,t,f,x,a[12],1804603682,7),x=s(x,e,t,f,a[13],4254626195,12),f=s(f,x,e,t,a[14],2792965006,17),t=s(t,f,x,e,a[15],1236535329,22),e=c(e,t,f,x,a[1],4129170786,5),x=c(x,e,t,f,a[6],3225465664,9),f=c(f,x,e,t,a[11],643717713,14),t=c(t,f,x,e,a[0],3921069994,20),e=c(e,t,f,x,a[5],3593408605,5),x=c(x,e,t,f,a[10],38016083,9),f=c(f,x,e,t,a[15],3634488961,14),t=c(t,f,x,e,a[4],3889429448,20),e=c(e,t,f,x,a[9],568446438,5),x=c(x,e,t,f,a[14],3275163606,9),f=c(f,x,e,t,a[3],4107603335,14),t=c(t,f,x,e,a[8],1163531501,20),e=c(e,t,f,x,a[13],2850285829,5),x=c(x,e,t,f,a[2],4243563512,9),f=c(f,x,e,t,a[7],1735328473,14),t=c(t,f,x,e,a[12],2368359562,20),e=r(e,t,f,x,a[5],4294588738,4),x=r(x,e,t,f,a[8],2272392833,11),f=r(f,x,e,t,a[11],1839030562,16),t=r(t,f,x,e,a[14],4259657740,23),e=r(e,t,f,x,a[1],2763975236,4),x=r(x,e,t,f,a[4],1272893353,11),f=r(f,x,e,t,a[7],4139469664,16),t=r(t,f,x,e,a[10],3200236656,23),e=r(e,t,f,x,a[13],681279174,4),x=r(x,e,t,f,a[0],3936430074,11),f=r(f,x,e,t,a[3],3572445317,16),t=r(t,f,x,e,a[6],76029189,23),e=r(e,t,f,x,a[9],3654602809,4),x=r(x,e,t,f,a[12],3873151461,11),f=r(f,x,e,t,a[15],530742520,16),t=r(t,f,x,e,a[2],3299628645,23),e=d(e,t,f,x,a[0],4096336452,6),x=d(x,e,t,f,a[7],1126891415,10),f=d(f,x,e,t,a[14],2878612391,15),t=d(t,f,x,e,a[5],4237533241,21),e=d(e,t,f,x,a[12],1700485571,6),x=d(x,e,t,f,a[3],2399980690,10),f=d(f,x,e,t,a[10],4293915773,15),t=d(t,f,x,e,a[1],2240044497,21),e=d(e,t,f,x,a[8],1873313359,6),x=d(x,e,t,f,a[15],4264355552,10),f=d(f,x,e,t,a[6],2734768916,15),t=d(t,f,x,e,a[13],1309151649,21),e=d(e,t,f,x,a[4],4149444226,6),x=d(x,e,t,f,a[11],3174756917,10),f=d(f,x,e,t,a[2],718787259,15),t=d(t,f,x,e,a[9],3951481745,21),this._a=this._a+e|0,this._b=this._b+t|0,this._c=this._c+f|0,this._d=this._d+x|0};n.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var a=k.allocUnsafe(16);return a.writeInt32LE(this._a,0),a.writeInt32LE(this._b,4),a.writeInt32LE(this._c,8),a.writeInt32LE(this._d,12),a};function h(a,i){return a<<i|a>>>32-i}function s(a,i,e,t,f,x,b){return h(a+(i&e|~i&t)+f+x|0,b)+i|0}function c(a,i,e,t,f,x,b){return h(a+(i&t|e&~t)+f+x|0,b)+i|0}function r(a,i,e,t,f,x,b){return h(a+(i^e^t)+f+x|0,b)+i|0}function d(a,i,e,t,f,x,b){return h(a+(e^(i|~t))+f+x|0,b)+i|0}var w=n;exports.md5_js=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index59.cjs"),u=require("./index61.cjs"),f=require("./index58.cjs"),g=require("./index45.cjs");function c(n,e="hex"){const i=o(n),s=u.createCursor(new Uint8Array(i.length));return i.encode(s),e==="hex"?g.bytesToHex(s.bytes):s.bytes}function o(n){return Array.isArray(n)?p(n.map(e=>o(e))):y(n)}function p(n){const e=n.reduce((t,h)=>t+h.length,0),i=l(e);return{length:e<=55?1+e:1+i+e,encode(t){e<=55?t.pushByte(192+e):(t.pushByte(247+i),i===1?t.pushUint8(e):i===2?t.pushUint16(e):i===3?t.pushUint24(e):t.pushUint32(e));for(const{encode:h}of n)h(t)}}}function y(n){const e=typeof n=="string"?f.hexToBytes(n):n,i=l(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+i+e.length,encode(t){e.length===1&&e[0]<128?t.pushBytes(e):e.length<=55?(t.pushByte(128+e.length),t.pushBytes(e)):(t.pushByte(183+i),i===1?t.pushUint8(e.length):i===2?t.pushUint16(e.length):i===3?t.pushUint24(e.length):t.pushUint32(e.length),t.pushBytes(e))}}}function l(n){if(n<2**8)return 1;if(n<2**16)return 2;if(n<2**24)return 3;if(n<2**32)return 4;throw new r.BaseError("Length is too large.")}exports.toRlp=c;
package/dist/index46.js CHANGED
@@ -1,37 +1,45 @@
1
- import { i as o } from "./index45.js";
2
- import { h as l } from "./index53.js";
3
- import { s as u } from "./index31.js";
4
- var p = o, n = l, v = u.Buffer, k = new Array(16);
5
- function h() {
6
- n.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878;
1
+ import { BaseError as l } from "./index59.js";
2
+ import { createCursor as r } from "./index61.js";
3
+ import { hexToBytes as g } from "./index58.js";
4
+ import { bytesToHex as u } from "./index45.js";
5
+ function m(n, e = "hex") {
6
+ const i = s(n), h = r(new Uint8Array(i.length));
7
+ return i.encode(h), e === "hex" ? u(h.bytes) : h.bytes;
7
8
  }
8
- p(h, n);
9
- h.prototype._update = function() {
10
- for (var x = k, i = 0; i < 16; ++i) x[i] = this._block.readInt32LE(i * 4);
11
- var f = this._a, t = this._b, e = this._c, a = this._d;
12
- f = s(f, t, e, a, x[0], 3614090360, 7), a = s(a, f, t, e, x[1], 3905402710, 12), e = s(e, a, f, t, x[2], 606105819, 17), t = s(t, e, a, f, x[3], 3250441966, 22), f = s(f, t, e, a, x[4], 4118548399, 7), a = s(a, f, t, e, x[5], 1200080426, 12), e = s(e, a, f, t, x[6], 2821735955, 17), t = s(t, e, a, f, x[7], 4249261313, 22), f = s(f, t, e, a, x[8], 1770035416, 7), a = s(a, f, t, e, x[9], 2336552879, 12), e = s(e, a, f, t, x[10], 4294925233, 17), t = s(t, e, a, f, x[11], 2304563134, 22), f = s(f, t, e, a, x[12], 1804603682, 7), a = s(a, f, t, e, x[13], 4254626195, 12), e = s(e, a, f, t, x[14], 2792965006, 17), t = s(t, e, a, f, x[15], 1236535329, 22), f = c(f, t, e, a, x[1], 4129170786, 5), a = c(a, f, t, e, x[6], 3225465664, 9), e = c(e, a, f, t, x[11], 643717713, 14), t = c(t, e, a, f, x[0], 3921069994, 20), f = c(f, t, e, a, x[5], 3593408605, 5), a = c(a, f, t, e, x[10], 38016083, 9), e = c(e, a, f, t, x[15], 3634488961, 14), t = c(t, e, a, f, x[4], 3889429448, 20), f = c(f, t, e, a, x[9], 568446438, 5), a = c(a, f, t, e, x[14], 3275163606, 9), e = c(e, a, f, t, x[3], 4107603335, 14), t = c(t, e, a, f, x[8], 1163531501, 20), f = c(f, t, e, a, x[13], 2850285829, 5), a = c(a, f, t, e, x[2], 4243563512, 9), e = c(e, a, f, t, x[7], 1735328473, 14), t = c(t, e, a, f, x[12], 2368359562, 20), f = r(f, t, e, a, x[5], 4294588738, 4), a = r(a, f, t, e, x[8], 2272392833, 11), e = r(e, a, f, t, x[11], 1839030562, 16), t = r(t, e, a, f, x[14], 4259657740, 23), f = r(f, t, e, a, x[1], 2763975236, 4), a = r(a, f, t, e, x[4], 1272893353, 11), e = r(e, a, f, t, x[7], 4139469664, 16), t = r(t, e, a, f, x[10], 3200236656, 23), f = r(f, t, e, a, x[13], 681279174, 4), a = r(a, f, t, e, x[0], 3936430074, 11), e = r(e, a, f, t, x[3], 3572445317, 16), t = r(t, e, a, f, x[6], 76029189, 23), f = r(f, t, e, a, x[9], 3654602809, 4), a = r(a, f, t, e, x[12], 3873151461, 11), e = r(e, a, f, t, x[15], 530742520, 16), t = r(t, e, a, f, x[2], 3299628645, 23), f = d(f, t, e, a, x[0], 4096336452, 6), a = d(a, f, t, e, x[7], 1126891415, 10), e = d(e, a, f, t, x[14], 2878612391, 15), t = d(t, e, a, f, x[5], 4237533241, 21), f = d(f, t, e, a, x[12], 1700485571, 6), a = d(a, f, t, e, x[3], 2399980690, 10), e = d(e, a, f, t, x[10], 4293915773, 15), t = d(t, e, a, f, x[1], 2240044497, 21), f = d(f, t, e, a, x[8], 1873313359, 6), a = d(a, f, t, e, x[15], 4264355552, 10), e = d(e, a, f, t, x[6], 2734768916, 15), t = d(t, e, a, f, x[13], 1309151649, 21), f = d(f, t, e, a, x[4], 4149444226, 6), a = d(a, f, t, e, x[11], 3174756917, 10), e = d(e, a, f, t, x[2], 718787259, 15), t = d(t, e, a, f, x[9], 3951481745, 21), this._a = this._a + f | 0, this._b = this._b + t | 0, this._c = this._c + e | 0, this._d = this._d + a | 0;
13
- };
14
- h.prototype._digest = function() {
15
- this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();
16
- var x = v.allocUnsafe(16);
17
- return x.writeInt32LE(this._a, 0), x.writeInt32LE(this._b, 4), x.writeInt32LE(this._c, 8), x.writeInt32LE(this._d, 12), x;
18
- };
19
- function _(x, i) {
20
- return x << i | x >>> 32 - i;
21
- }
22
- function s(x, i, f, t, e, a, b) {
23
- return _(x + (i & f | ~i & t) + e + a | 0, b) + i | 0;
9
+ function s(n) {
10
+ return Array.isArray(n) ? p(n.map((e) => s(e))) : y(n);
24
11
  }
25
- function c(x, i, f, t, e, a, b) {
26
- return _(x + (i & t | f & ~t) + e + a | 0, b) + i | 0;
12
+ function p(n) {
13
+ const e = n.reduce((t, f) => t + f.length, 0), i = o(e);
14
+ return {
15
+ length: e <= 55 ? 1 + e : 1 + i + e,
16
+ encode(t) {
17
+ e <= 55 ? t.pushByte(192 + e) : (t.pushByte(247 + i), i === 1 ? t.pushUint8(e) : i === 2 ? t.pushUint16(e) : i === 3 ? t.pushUint24(e) : t.pushUint32(e));
18
+ for (const { encode: f } of n)
19
+ f(t);
20
+ }
21
+ };
27
22
  }
28
- function r(x, i, f, t, e, a, b) {
29
- return _(x + (i ^ f ^ t) + e + a | 0, b) + i | 0;
23
+ function y(n) {
24
+ const e = typeof n == "string" ? g(n) : n, i = o(e.length);
25
+ return {
26
+ length: e.length === 1 && e[0] < 128 ? 1 : e.length <= 55 ? 1 + e.length : 1 + i + e.length,
27
+ encode(t) {
28
+ e.length === 1 && e[0] < 128 ? t.pushBytes(e) : e.length <= 55 ? (t.pushByte(128 + e.length), t.pushBytes(e)) : (t.pushByte(183 + i), i === 1 ? t.pushUint8(e.length) : i === 2 ? t.pushUint16(e.length) : i === 3 ? t.pushUint24(e.length) : t.pushUint32(e.length), t.pushBytes(e));
29
+ }
30
+ };
30
31
  }
31
- function d(x, i, f, t, e, a, b) {
32
- return _(x + (f ^ (i | ~t)) + e + a | 0, b) + i | 0;
32
+ function o(n) {
33
+ if (n < 2 ** 8)
34
+ return 1;
35
+ if (n < 2 ** 16)
36
+ return 2;
37
+ if (n < 2 ** 24)
38
+ return 3;
39
+ if (n < 2 ** 32)
40
+ return 4;
41
+ throw new l("Length is too large.");
33
42
  }
34
- var I = h;
35
43
  export {
36
- I as m
44
+ m as toRlp
37
45
  };
package/dist/index47.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index34.cjs");const R=require("./index45.cjs"),z=require("./index53.cjs"),M=require("./index35.cjs");var L=M.__exports.Buffer,P=R.inherits_browserExports,m=z.hashBase,S=new Array(16),v=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],x=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],p=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],w=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],k=[0,1518500249,1859775393,2400959708,2840853838],E=[1352829926,1548603684,1836072691,2053994217,0];function I(){m.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}P(I,m);I.prototype._update=function(){for(var t=S,s=0;s<16;++s)t[s]=this._block.readInt32LE(s*4);for(var n=this._a|0,e=this._b|0,i=this._c|0,a=this._d|0,h=this._e|0,_=this._a|0,f=this._b|0,c=this._c|0,o=this._d|0,l=this._e|0,r=0;r<80;r+=1){var d,u;r<16?(d=O(n,e,i,a,h,t[v[r]],k[0],p[r]),u=B(_,f,c,o,l,t[x[r]],E[0],w[r])):r<32?(d=g(n,e,i,a,h,t[v[r]],k[1],p[r]),u=q(_,f,c,o,l,t[x[r]],E[1],w[r])):r<48?(d=y(n,e,i,a,h,t[v[r]],k[2],p[r]),u=y(_,f,c,o,l,t[x[r]],E[2],w[r])):r<64?(d=q(n,e,i,a,h,t[v[r]],k[3],p[r]),u=g(_,f,c,o,l,t[x[r]],E[3],w[r])):(d=B(n,e,i,a,h,t[v[r]],k[4],p[r]),u=O(_,f,c,o,l,t[x[r]],E[4],w[r])),n=h,h=a,a=b(i,10),i=e,e=d,_=l,l=o,o=b(c,10),c=f,f=u}var A=this._b+i+o|0;this._b=this._c+a+l|0,this._c=this._d+h+_|0,this._d=this._e+n+f|0,this._e=this._a+e+c|0,this._a=A};I.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=L.alloc?L.alloc(20):new L(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t};function b(t,s){return t<<s|t>>>32-s}function O(t,s,n,e,i,a,h,_){return b(t+(s^n^e)+a+h|0,_)+i|0}function g(t,s,n,e,i,a,h,_){return b(t+(s&n|~s&e)+a+h|0,_)+i|0}function y(t,s,n,e,i,a,h,_){return b(t+((s|~n)^e)+a+h|0,_)+i|0}function q(t,s,n,e,i,a,h,_){return b(t+(s&e|n&~e)+a+h|0,_)+i|0}function B(t,s,n,e,i,a,h,_){return b(t+(s^(n|~e))+a+h|0,_)+i|0}var U=I;exports.ripemd160=U;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./index62.cjs"),G=require("./index63.cjs"),R=require("./index64.cjs"),S=require("./index65.cjs"),B=require("./index66.cjs"),L=require("./index44.cjs"),h=require("./index67.cjs"),t=require("./index45.cjs"),b=require("./index46.cjs"),V=require("./index68.cjs"),z=require("./index69.cjs"),C=require("./index70.cjs"),v=require("./index71.cjs");function k(e,o){const s=C.getTransactionType(e);return s==="eip1559"?_(e,o):s==="eip2930"?j(e,o):s==="eip4844"?Y(e,o):s==="eip7702"?w(e,o):M(e,o)}function w(e,o){const{authorizationList:s,chainId:i,gas:r,nonce:c,to:a,value:x,maxFeePerGas:l,maxPriorityFeePerGas:n,accessList:H,data:d}=e;z.assertTransactionEIP7702(e);const f=v.serializeAccessList(H),u=V.serializeAuthorizationList(s);return L.concatHex(["0x04",b.toRlp([t.toHex(i),c?t.toHex(c):"0x",n?t.toHex(n):"0x",l?t.toHex(l):"0x",r?t.toHex(r):"0x",a??"0x",x?t.toHex(x):"0x",d??"0x",f,u,...T(e,o)])])}function Y(e,o){const{chainId:s,gas:i,nonce:r,to:c,value:a,maxFeePerBlobGas:x,maxFeePerGas:l,maxPriorityFeePerGas:n,accessList:H,data:d}=e;z.assertTransactionEIP4844(e);let f=e.blobVersionedHashes,u=e.sidecars;if(e.blobs&&(typeof f>"u"||typeof u>"u")){const m=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(y=>t.bytesToHex(y)),P=e.kzg,p=G.blobsToCommitments({blobs:m,kzg:P});if(typeof f>"u"&&(f=S.commitmentsToVersionedHashes({commitments:p})),typeof u>"u"){const y=R.blobsToProofs({blobs:m,commitments:p,kzg:P});u=B.toBlobSidecars({blobs:m,commitments:p,proofs:y})}}const I=v.serializeAccessList(H),A=[t.toHex(s),r?t.toHex(r):"0x",n?t.toHex(n):"0x",l?t.toHex(l):"0x",i?t.toHex(i):"0x",c??"0x",a?t.toHex(a):"0x",d??"0x",I,x?t.toHex(x):"0x",f??[],...T(e,o)],q=[],g=[],E=[];if(u)for(let m=0;m<u.length;m++){const{blob:P,commitment:p,proof:y}=u[m];q.push(P),g.push(p),E.push(y)}return L.concatHex(["0x03",u?b.toRlp([A,q,g,E]):b.toRlp(A)])}function _(e,o){const{chainId:s,gas:i,nonce:r,to:c,value:a,maxFeePerGas:x,maxPriorityFeePerGas:l,accessList:n,data:H}=e;z.assertTransactionEIP1559(e);const d=v.serializeAccessList(n),f=[t.toHex(s),r?t.toHex(r):"0x",l?t.toHex(l):"0x",x?t.toHex(x):"0x",i?t.toHex(i):"0x",c??"0x",a?t.toHex(a):"0x",H??"0x",d,...T(e,o)];return L.concatHex(["0x02",b.toRlp(f)])}function j(e,o){const{chainId:s,gas:i,data:r,nonce:c,to:a,value:x,accessList:l,gasPrice:n}=e;z.assertTransactionEIP2930(e);const H=v.serializeAccessList(l),d=[t.toHex(s),c?t.toHex(c):"0x",n?t.toHex(n):"0x",i?t.toHex(i):"0x",a??"0x",x?t.toHex(x):"0x",r??"0x",H,...T(e,o)];return L.concatHex(["0x01",b.toRlp(d)])}function M(e,o){const{chainId:s=0,gas:i,data:r,nonce:c,to:a,value:x,gasPrice:l}=e;z.assertTransactionLegacy(e);let n=[c?t.toHex(c):"0x",l?t.toHex(l):"0x",i?t.toHex(i):"0x",a??"0x",x?t.toHex(x):"0x",r??"0x"];if(o){const H=(()=>{if(o.v>=35n)return(o.v-35n)/2n>0?o.v:27n+(o.v===35n?0n:1n);if(s>0)return BigInt(s*2)+BigInt(35n+o.v-27n);const u=27n+(o.v===27n?0n:1n);if(o.v!==u)throw new F.InvalidLegacyVError({v:o.v});return u})(),d=h.trim(o.r),f=h.trim(o.s);n=[...n,t.toHex(H),d==="0x00"?"0x":d,f==="0x00"?"0x":f]}else s>0&&(n=[...n,t.toHex(s),"0x","0x"]);return b.toRlp(n)}function T(e,o){const s=o??e,{v:i,yParity:r}=s;if(typeof s.r>"u")return[];if(typeof s.s>"u")return[];if(typeof i>"u"&&typeof r>"u")return[];const c=h.trim(s.r),a=h.trim(s.s);return[typeof r=="number"?r?t.toHex(1):"0x":i===0n?"0x":i===1n?t.toHex(1):i===27n?"0x":t.toHex(1),c==="0x00"?"0x":c,a==="0x00"?"0x":a]}exports.serializeTransaction=k;exports.toYParitySignatureArray=T;