@gardenfi/utils 2.1.2-beta.8 → 2.1.2-beta.9

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 (179) hide show
  1. package/dist/index100.cjs +1 -1
  2. package/dist/index100.js +5 -5
  3. package/dist/index101.cjs +1 -2
  4. package/dist/index101.js +11 -3
  5. package/dist/index102.cjs +1 -1
  6. package/dist/index102.js +6 -18
  7. package/dist/index103.cjs +1 -1
  8. package/dist/index103.js +15 -638
  9. package/dist/index104.cjs +1 -1
  10. package/dist/index104.js +5 -173
  11. package/dist/index15.cjs +1 -1
  12. package/dist/index15.js +2 -2
  13. package/dist/index18.cjs +1 -1
  14. package/dist/index18.js +2 -2
  15. package/dist/index19.cjs +1 -1
  16. package/dist/index19.js +9 -9
  17. package/dist/index20.cjs +1 -1
  18. package/dist/index20.js +17 -18
  19. package/dist/index21.cjs +1 -16
  20. package/dist/index21.js +30 -112
  21. package/dist/index22.cjs +16 -1
  22. package/dist/index22.js +113 -30
  23. package/dist/index23.cjs +1 -2
  24. package/dist/index23.js +40 -49
  25. package/dist/index24.cjs +1 -1
  26. package/dist/index24.js +45 -24
  27. package/dist/index25.cjs +1 -1
  28. package/dist/index25.js +25 -41
  29. package/dist/index26.cjs +1 -1
  30. package/dist/index26.js +6 -45
  31. package/dist/index27.cjs +1 -1
  32. package/dist/index27.js +12 -24
  33. package/dist/index28.cjs +1 -1
  34. package/dist/index28.js +15 -6
  35. package/dist/index29.cjs +1 -1
  36. package/dist/index29.js +5 -13
  37. package/dist/index30.cjs +1 -1
  38. package/dist/index30.js +12 -14
  39. package/dist/index31.cjs +1 -1
  40. package/dist/index31.js +10 -5
  41. package/dist/index32.cjs +1 -1
  42. package/dist/index32.js +12 -13
  43. package/dist/index33.cjs +1 -1
  44. package/dist/index33.js +11 -10
  45. package/dist/index34.cjs +1 -1
  46. package/dist/index34.js +13 -12
  47. package/dist/index35.cjs +1 -1
  48. package/dist/index35.js +23 -11
  49. package/dist/index36.cjs +1 -1
  50. package/dist/index36.js +55 -13
  51. package/dist/index37.cjs +1 -1
  52. package/dist/index37.js +16 -23
  53. package/dist/index38.cjs +1 -1
  54. package/dist/index38.js +5 -55
  55. package/dist/index39.cjs +1 -1
  56. package/dist/index39.js +8 -16
  57. package/dist/index40.cjs +1 -1
  58. package/dist/index40.js +171 -5
  59. package/dist/index41.cjs +1 -1
  60. package/dist/index41.js +103 -8
  61. package/dist/index42.cjs +1 -1
  62. package/dist/index42.js +20 -170
  63. package/dist/index43.cjs +2 -1
  64. package/dist/index43.js +44 -97
  65. package/dist/index44.cjs +1 -1
  66. package/dist/index44.js +24 -21
  67. package/dist/index45.cjs +1 -1
  68. package/dist/index45.js +1 -1
  69. package/dist/index46.cjs +1 -1
  70. package/dist/index46.js +1 -1
  71. package/dist/index47.cjs +1 -1
  72. package/dist/index47.js +112 -6
  73. package/dist/index48.cjs +1 -2
  74. package/dist/index48.js +15 -58
  75. package/dist/index49.cjs +1 -1
  76. package/dist/index49.js +224 -2
  77. package/dist/index50.cjs +2 -1
  78. package/dist/index50.js +58 -5
  79. package/dist/index51.cjs +1 -1
  80. package/dist/index51.js +21 -4
  81. package/dist/index52.cjs +1 -1
  82. package/dist/index52.js +104 -11
  83. package/dist/index53.cjs +1 -1
  84. package/dist/index53.js +4 -8
  85. package/dist/index54.cjs +1 -5
  86. package/dist/index54.js +16 -55
  87. package/dist/index55.cjs +1 -2
  88. package/dist/index55.js +8 -34
  89. package/dist/index56.cjs +1 -1
  90. package/dist/index56.js +10 -5
  91. package/dist/index57.cjs +1 -1
  92. package/dist/index57.js +12 -2
  93. package/dist/index58.cjs +1 -1
  94. package/dist/index58.js +13 -21
  95. package/dist/index59.cjs +1 -1
  96. package/dist/index59.js +18 -8
  97. package/dist/index60.cjs +1 -1
  98. package/dist/index60.js +6 -10
  99. package/dist/index61.cjs +1 -1
  100. package/dist/index61.js +42 -11
  101. package/dist/index62.cjs +1 -1
  102. package/dist/index62.js +78 -6
  103. package/dist/index63.cjs +1 -1
  104. package/dist/index63.js +14 -13
  105. package/dist/index64.cjs +1 -1
  106. package/dist/index64.js +17 -31
  107. package/dist/index65.cjs +1 -1
  108. package/dist/index65.js +8 -14
  109. package/dist/index66.cjs +1 -1
  110. package/dist/index66.js +186 -59
  111. package/dist/index67.cjs +1 -1
  112. package/dist/index67.js +61 -24
  113. package/dist/index68.cjs +1 -1
  114. package/dist/index68.js +5 -3
  115. package/dist/index69.cjs +1 -1
  116. package/dist/index69.js +40 -3
  117. package/dist/index70.cjs +1 -1
  118. package/dist/index70.js +34 -8
  119. package/dist/index71.cjs +1 -1
  120. package/dist/index71.js +58 -180
  121. package/dist/index72.cjs +1 -1
  122. package/dist/index72.js +65 -16
  123. package/dist/index73.cjs +1 -1
  124. package/dist/index73.js +2 -41
  125. package/dist/index74.cjs +1 -1
  126. package/dist/index74.js +229 -32
  127. package/dist/index75.cjs +1 -1
  128. package/dist/index75.js +2 -70
  129. package/dist/index76.cjs +1 -1
  130. package/dist/index76.js +5 -111
  131. package/dist/index77.cjs +1 -1
  132. package/dist/index77.js +11 -67
  133. package/dist/index78.cjs +1 -1
  134. package/dist/index78.js +8 -2
  135. package/dist/index79.cjs +5 -1
  136. package/dist/index79.js +55 -15
  137. package/dist/index80.cjs +2 -1
  138. package/dist/index80.js +31 -220
  139. package/dist/index81.cjs +1 -1
  140. package/dist/index81.js +5 -231
  141. package/dist/index82.cjs +1 -1
  142. package/dist/index82.js +2 -43
  143. package/dist/index83.cjs +1 -1
  144. package/dist/index83.js +6 -104
  145. package/dist/index84.cjs +1 -1
  146. package/dist/index84.js +31 -16
  147. package/dist/index85.cjs +1 -1
  148. package/dist/index85.js +24 -75
  149. package/dist/index86.cjs +1 -1
  150. package/dist/index86.js +3 -19
  151. package/dist/index87.cjs +1 -1
  152. package/dist/index87.js +11 -8
  153. package/dist/index88.cjs +1 -1
  154. package/dist/index88.js +19 -11
  155. package/dist/index89.cjs +1 -1
  156. package/dist/index89.js +11 -18
  157. package/dist/index9.cjs +1 -1
  158. package/dist/index9.js +2 -2
  159. package/dist/index90.cjs +1 -1
  160. package/dist/index90.js +8 -12
  161. package/dist/index91.cjs +1 -1
  162. package/dist/index91.js +638 -33
  163. package/dist/index92.cjs +1 -1
  164. package/dist/index92.js +173 -2
  165. package/dist/index93.cjs +1 -1
  166. package/dist/index93.js +19 -5
  167. package/dist/index94.cjs +1 -1
  168. package/dist/index94.js +127 -10
  169. package/dist/index95.cjs +1 -1
  170. package/dist/index95.js +2 -128
  171. package/dist/index96.cjs +1 -1
  172. package/dist/index96.js +2 -7
  173. package/dist/index97.cjs +1 -1
  174. package/dist/index97.js +38 -2
  175. package/dist/index98.cjs +1 -1
  176. package/dist/index98.js +34 -33
  177. package/dist/index99.cjs +2 -1
  178. package/dist/index99.js +3 -21
  179. package/package.json +1 -1
package/dist/index42.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./index23.cjs"),G=require("./index84.cjs"),R=require("./index59.cjs"),S=require("./index60.cjs"),B=require("./index61.cjs"),V=require("./index63.cjs"),L=require("./index72.cjs"),h=require("./index47.cjs"),t=require("./index26.cjs"),b=require("./index82.cjs"),z=require("./index85.cjs"),C=require("./index65.cjs"),v=require("./index86.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=G.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=R.blobsToCommitments({blobs:m,kzg:P});if(typeof f>"u"&&(f=B.commitmentsToVersionedHashes({commitments:p})),typeof u>"u"){const y=S.blobsToProofs({blobs:m,commitments:p,kzg:P});u=V.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index32.cjs"),f=require("./index36.cjs"),a=require("./index39.cjs"),l=require("./index51.cjs"),A=require("./index33.cjs"),o=new l.LruMap(8192);function u(s,t){if(o.has(`${s}.${t}`))return o.get(`${s}.${t}`);const c=s.substring(2).toLowerCase(),n=a.keccak256(f.stringToBytes(c),"bytes"),r=c.split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&r[e]&&(r[e]=r[e].toUpperCase()),(n[e>>1]&15)>=8&&r[e+1]&&(r[e+1]=r[e+1].toUpperCase());const i=`0x${r.join("")}`;return o.set(`${s}.${t}`,i),i}function g(s,t){if(!A.isAddress(s,{strict:!1}))throw new d.InvalidAddressError({address:s});return u(s,t)}exports.checksumAddress=u;exports.getAddress=g;
package/dist/index42.js CHANGED
@@ -1,174 +1,24 @@
1
- import { InvalidLegacyVError as H } from "./index23.js";
2
- import { serializeAuthorizationList as g } from "./index84.js";
3
- import { blobsToCommitments as B } from "./index59.js";
4
- import { blobsToProofs as V } from "./index60.js";
5
- import { commitmentsToVersionedHashes as C } from "./index61.js";
6
- import { toBlobSidecars as k } from "./index63.js";
7
- import { concatHex as h } from "./index72.js";
8
- import { trim as T } from "./index47.js";
9
- import { toHex as o, bytesToHex as w } from "./index26.js";
10
- import { toRlp as y } from "./index82.js";
11
- import { assertTransactionEIP1559 as S, assertTransactionEIP2930 as _, assertTransactionEIP4844 as R, assertTransactionEIP7702 as Y, assertTransactionLegacy as j } from "./index85.js";
12
- import { getTransactionType as q } from "./index65.js";
13
- import { serializeAccessList as v } from "./index86.js";
14
- function te(e, r) {
15
- const i = q(e);
16
- return i === "eip1559" ? K(e, r) : i === "eip2930" ? M(e, r) : i === "eip4844" ? J(e, r) : i === "eip7702" ? D(e, r) : N(e, r);
1
+ import { InvalidAddressError as c } from "./index32.js";
2
+ import { stringToBytes as m } from "./index36.js";
3
+ import { keccak256 as p } from "./index39.js";
4
+ import { LruMap as u } from "./index51.js";
5
+ import { isAddress as $ } from "./index33.js";
6
+ const s = /* @__PURE__ */ new u(8192);
7
+ function h(t, o) {
8
+ if (s.has(`${t}.${o}`))
9
+ return s.get(`${t}.${o}`);
10
+ const i = t.substring(2).toLowerCase(), n = p(m(i), "bytes"), e = i.split("");
11
+ for (let r = 0; r < 40; r += 2)
12
+ n[r >> 1] >> 4 >= 8 && e[r] && (e[r] = e[r].toUpperCase()), (n[r >> 1] & 15) >= 8 && e[r + 1] && (e[r + 1] = e[r + 1].toUpperCase());
13
+ const f = `0x${e.join("")}`;
14
+ return s.set(`${t}.${o}`, f), f;
17
15
  }
18
- function D(e, r) {
19
- const { authorizationList: i, chainId: s, gas: n, nonce: c, to: f, value: a, maxFeePerGas: x, maxPriorityFeePerGas: t, accessList: p, data: l } = e;
20
- Y(e);
21
- const d = v(p), m = g(i);
22
- return h([
23
- "0x04",
24
- y([
25
- o(s),
26
- c ? o(c) : "0x",
27
- t ? o(t) : "0x",
28
- x ? o(x) : "0x",
29
- n ? o(n) : "0x",
30
- f ?? "0x",
31
- a ? o(a) : "0x",
32
- l ?? "0x",
33
- d,
34
- m,
35
- ...I(e, r)
36
- ])
37
- ]);
38
- }
39
- function J(e, r) {
40
- const { chainId: i, gas: s, nonce: n, to: c, value: f, maxFeePerBlobGas: a, maxFeePerGas: x, maxPriorityFeePerGas: t, accessList: p, data: l } = e;
41
- R(e);
42
- let d = e.blobVersionedHashes, m = e.sidecars;
43
- if (e.blobs && (typeof d > "u" || typeof m > "u")) {
44
- const u = typeof e.blobs[0] == "string" ? e.blobs : e.blobs.map((P) => w(P)), z = e.kzg, b = B({
45
- blobs: u,
46
- kzg: z
47
- });
48
- if (typeof d > "u" && (d = C({
49
- commitments: b
50
- })), typeof m > "u") {
51
- const P = V({ blobs: u, commitments: b, kzg: z });
52
- m = k({ blobs: u, commitments: b, proofs: P });
53
- }
54
- }
55
- const L = v(p), E = [
56
- o(i),
57
- n ? o(n) : "0x",
58
- t ? o(t) : "0x",
59
- x ? o(x) : "0x",
60
- s ? o(s) : "0x",
61
- c ?? "0x",
62
- f ? o(f) : "0x",
63
- l ?? "0x",
64
- L,
65
- a ? o(a) : "0x",
66
- d ?? [],
67
- ...I(e, r)
68
- ], A = [], F = [], G = [];
69
- if (m)
70
- for (let u = 0; u < m.length; u++) {
71
- const { blob: z, commitment: b, proof: P } = m[u];
72
- A.push(z), F.push(b), G.push(P);
73
- }
74
- return h([
75
- "0x03",
76
- m ? (
77
- // If sidecars are enabled, envelope turns into a "wrapper":
78
- y([E, A, F, G])
79
- ) : (
80
- // If sidecars are disabled, standard envelope is used:
81
- y(E)
82
- )
83
- ]);
84
- }
85
- function K(e, r) {
86
- const { chainId: i, gas: s, nonce: n, to: c, value: f, maxFeePerGas: a, maxPriorityFeePerGas: x, accessList: t, data: p } = e;
87
- S(e);
88
- const l = v(t), d = [
89
- o(i),
90
- n ? o(n) : "0x",
91
- x ? o(x) : "0x",
92
- a ? o(a) : "0x",
93
- s ? o(s) : "0x",
94
- c ?? "0x",
95
- f ? o(f) : "0x",
96
- p ?? "0x",
97
- l,
98
- ...I(e, r)
99
- ];
100
- return h([
101
- "0x02",
102
- y(d)
103
- ]);
104
- }
105
- function M(e, r) {
106
- const { chainId: i, gas: s, data: n, nonce: c, to: f, value: a, accessList: x, gasPrice: t } = e;
107
- _(e);
108
- const p = v(x), l = [
109
- o(i),
110
- c ? o(c) : "0x",
111
- t ? o(t) : "0x",
112
- s ? o(s) : "0x",
113
- f ?? "0x",
114
- a ? o(a) : "0x",
115
- n ?? "0x",
116
- p,
117
- ...I(e, r)
118
- ];
119
- return h([
120
- "0x01",
121
- y(l)
122
- ]);
123
- }
124
- function N(e, r) {
125
- const { chainId: i = 0, gas: s, data: n, nonce: c, to: f, value: a, gasPrice: x } = e;
126
- j(e);
127
- let t = [
128
- c ? o(c) : "0x",
129
- x ? o(x) : "0x",
130
- s ? o(s) : "0x",
131
- f ?? "0x",
132
- a ? o(a) : "0x",
133
- n ?? "0x"
134
- ];
135
- if (r) {
136
- const p = (() => {
137
- if (r.v >= 35n)
138
- return (r.v - 35n) / 2n > 0 ? r.v : 27n + (r.v === 35n ? 0n : 1n);
139
- if (i > 0)
140
- return BigInt(i * 2) + BigInt(35n + r.v - 27n);
141
- const m = 27n + (r.v === 27n ? 0n : 1n);
142
- if (r.v !== m)
143
- throw new H({ v: r.v });
144
- return m;
145
- })(), l = T(r.r), d = T(r.s);
146
- t = [
147
- ...t,
148
- o(p),
149
- l === "0x00" ? "0x" : l,
150
- d === "0x00" ? "0x" : d
151
- ];
152
- } else i > 0 && (t = [
153
- ...t,
154
- o(i),
155
- "0x",
156
- "0x"
157
- ]);
158
- return y(t);
159
- }
160
- function I(e, r) {
161
- const i = r ?? e, { v: s, yParity: n } = i;
162
- if (typeof i.r > "u")
163
- return [];
164
- if (typeof i.s > "u")
165
- return [];
166
- if (typeof s > "u" && typeof n > "u")
167
- return [];
168
- const c = T(i.r), f = T(i.s);
169
- return [typeof n == "number" ? n ? o(1) : "0x" : s === 0n ? "0x" : s === 1n ? o(1) : s === 27n ? "0x" : o(1), c === "0x00" ? "0x" : c, f === "0x00" ? "0x" : f];
16
+ function w(t, o) {
17
+ if (!$(t, { strict: !1 }))
18
+ throw new c({ address: t });
19
+ return h(t, o);
170
20
  }
171
21
  export {
172
- te as serializeTransaction,
173
- I as toYParitySignatureArray
22
+ h as checksumAddress,
23
+ w as getAddress
174
24
  };
package/dist/index43.cjs CHANGED
@@ -1 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index71.cjs"),D=require("./index72.cjs"),f=require("./index26.cjs"),s=require("./index41.cjs"),p=require("./index66.cjs");function b(c){const{domain:t={},message:e,primaryType:n}=c,o={EIP712Domain:p.getTypesForEIP712Domain({domain:t}),...c.types};p.validateTypedData({domain:t,message:e,primaryType:n,types:o});const a=["0x1901"];return t&&a.push(y({domain:t,types:o})),n!=="EIP712Domain"&&a.push(d({data:e,primaryType:n,types:o})),s.keccak256(D.concat(a))}function y({domain:c,types:t}){return d({data:c,primaryType:"EIP712Domain",types:t})}function d({data:c,primaryType:t,types:e}){const n=h({data:c,primaryType:t,types:e});return s.keccak256(n)}function h({data:c,primaryType:t,types:e}){const n=[{type:"bytes32"}],o=[l({primaryType:t,types:e})];for(const a of e[t]){const[r,i]=T({types:e,name:a.name,type:a.type,value:c[a.name]});n.push(r),o.push(i)}return u.encodeAbiParameters(n,o)}function l({primaryType:c,types:t}){const e=f.toHex(m({primaryType:c,types:t}));return s.keccak256(e)}function m({primaryType:c,types:t}){let e="";const n=k({primaryType:c,types:t});n.delete(c);const o=[c,...Array.from(n).sort()];for(const a of o)e+=`${a}(${t[a].map(({name:r,type:i})=>`${i} ${r}`).join(",")})`;return e}function k({primaryType:c,types:t},e=new Set){const n=c.match(/^\w*/u),o=n==null?void 0:n[0];if(e.has(o)||t[o]===void 0)return e;e.add(o);for(const a of t[o])k({primaryType:a.type,types:t},e);return e}function T({types:c,name:t,type:e,value:n}){if(c[e]!==void 0)return[{type:"bytes32"},s.keccak256(h({data:n,primaryType:e,types:c}))];if(e==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},s.keccak256(n)];if(e==="string")return[{type:"bytes32"},s.keccak256(f.toHex(n))];if(e.lastIndexOf("]")===e.length-1){const o=e.slice(0,e.lastIndexOf("[")),a=n.map(r=>T({name:t,type:o,types:c,value:r}));return[{type:"bytes32"},s.keccak256(u.encodeAbiParameters(a.map(([r])=>r),a.map(([,r])=>r)))]}return[{type:e},n]}exports.encodeType=m;exports.hashDomain=y;exports.hashStruct=d;exports.hashTypedData=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index50.cjs");function o(a){const r=Object.entries(a).map(([n,e])=>e===void 0||e===!1?null:[n,e]).filter(Boolean),i=r.reduce((n,[e])=>Math.max(n,e.length),0);return r.map(([n,e])=>` ${`${n}:`.padEnd(i+1)} ${e}`).join(`
2
+ `)}class s extends t.BaseError{constructor({v:r}){super(`Invalid \`v\` value "${r}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class c extends t.BaseError{constructor({transaction:r}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",o(r),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class d extends t.BaseError{constructor({storageKey:r}){super(`Size for storage key "${r}" is invalid. Expected 32 bytes. Got ${Math.floor((r.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class l extends t.BaseError{constructor({hash:r}){super(`Transaction receipt with hash "${r}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}exports.InvalidLegacyVError=s;exports.InvalidSerializableTransactionError=c;exports.InvalidStorageKeySizeError=d;exports.TransactionReceiptNotFoundError=l;exports.prettyPrint=o;
package/dist/index43.js CHANGED
@@ -1,106 +1,53 @@
1
- import { encodeAbiParameters as p } from "./index71.js";
2
- import { concat as h } from "./index72.js";
3
- import { toHex as d } from "./index26.js";
4
- import { keccak256 as c } from "./index41.js";
5
- import { getTypesForEIP712Domain as T, validateTypedData as D } from "./index66.js";
6
- function k(o) {
7
- const { domain: t = {}, message: e, primaryType: n } = o, r = {
8
- EIP712Domain: T({ domain: t }),
9
- ...o.types
10
- };
11
- D({
12
- domain: t,
13
- message: e,
14
- primaryType: n,
15
- types: r
16
- });
17
- const a = ["0x1901"];
18
- return t && a.push(b({
19
- domain: t,
20
- types: r
21
- })), n !== "EIP712Domain" && a.push(f({
22
- data: e,
23
- primaryType: n,
24
- types: r
25
- })), c(h(a));
26
- }
27
- function b({ domain: o, types: t }) {
28
- return f({
29
- data: o,
30
- primaryType: "EIP712Domain",
31
- types: t
32
- });
33
- }
34
- function f({ data: o, primaryType: t, types: e }) {
35
- const n = m({
36
- data: o,
37
- primaryType: t,
38
- types: e
39
- });
40
- return c(n);
41
- }
42
- function m({ data: o, primaryType: t, types: e }) {
43
- const n = [{ type: "bytes32" }], r = [l({ primaryType: t, types: e })];
44
- for (const a of e[t]) {
45
- const [i, s] = y({
46
- types: e,
47
- name: a.name,
48
- type: a.type,
49
- value: o[a.name]
1
+ import { BaseError as t } from "./index50.js";
2
+ function i(a) {
3
+ const r = Object.entries(a).map(([n, e]) => e === void 0 || e === !1 ? null : [n, e]).filter(Boolean), o = r.reduce((n, [e]) => Math.max(n, e.length), 0);
4
+ return r.map(([n, e]) => ` ${`${n}:`.padEnd(o + 1)} ${e}`).join(`
5
+ `);
6
+ }
7
+ class c extends t {
8
+ constructor({ v: r }) {
9
+ super(`Invalid \`v\` value "${r}". Expected 27 or 28.`, {
10
+ name: "InvalidLegacyVError"
50
11
  });
51
- n.push(i), r.push(s);
52
12
  }
53
- return p(n, r);
54
- }
55
- function l({ primaryType: o, types: t }) {
56
- const e = d(x({ primaryType: o, types: t }));
57
- return c(e);
58
13
  }
59
- function x({ primaryType: o, types: t }) {
60
- let e = "";
61
- const n = u({ primaryType: o, types: t });
62
- n.delete(o);
63
- const r = [o, ...Array.from(n).sort()];
64
- for (const a of r)
65
- e += `${a}(${t[a].map(({ name: i, type: s }) => `${s} ${i}`).join(",")})`;
66
- return e;
14
+ class d extends t {
15
+ constructor({ transaction: r }) {
16
+ super("Cannot infer a transaction type from provided transaction.", {
17
+ metaMessages: [
18
+ "Provided Transaction:",
19
+ "{",
20
+ i(r),
21
+ "}",
22
+ "",
23
+ "To infer the type, either provide:",
24
+ "- a `type` to the Transaction, or",
25
+ "- an EIP-1559 Transaction with `maxFeePerGas`, or",
26
+ "- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
27
+ "- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
28
+ "- an EIP-7702 Transaction with `authorizationList`, or",
29
+ "- a Legacy Transaction with `gasPrice`"
30
+ ],
31
+ name: "InvalidSerializableTransactionError"
32
+ });
33
+ }
67
34
  }
68
- function u({ primaryType: o, types: t }, e = /* @__PURE__ */ new Set()) {
69
- const n = o.match(/^\w*/u), r = n == null ? void 0 : n[0];
70
- if (e.has(r) || t[r] === void 0)
71
- return e;
72
- e.add(r);
73
- for (const a of t[r])
74
- u({ primaryType: a.type, types: t }, e);
75
- return e;
35
+ class l extends t {
36
+ constructor({ storageKey: r }) {
37
+ super(`Size for storage key "${r}" is invalid. Expected 32 bytes. Got ${Math.floor((r.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
38
+ }
76
39
  }
77
- function y({ types: o, name: t, type: e, value: n }) {
78
- if (o[e] !== void 0)
79
- return [
80
- { type: "bytes32" },
81
- c(m({ data: n, primaryType: e, types: o }))
82
- ];
83
- if (e === "bytes")
84
- return n = `0x${(n.length % 2 ? "0" : "") + n.slice(2)}`, [{ type: "bytes32" }, c(n)];
85
- if (e === "string")
86
- return [{ type: "bytes32" }, c(d(n))];
87
- if (e.lastIndexOf("]") === e.length - 1) {
88
- const r = e.slice(0, e.lastIndexOf("[")), a = n.map((i) => y({
89
- name: t,
90
- type: r,
91
- types: o,
92
- value: i
93
- }));
94
- return [
95
- { type: "bytes32" },
96
- c(p(a.map(([i]) => i), a.map(([, i]) => i)))
97
- ];
40
+ class p extends t {
41
+ constructor({ hash: r }) {
42
+ super(`Transaction receipt with hash "${r}" could not be found. The Transaction may not be processed on a block yet.`, {
43
+ name: "TransactionReceiptNotFoundError"
44
+ });
98
45
  }
99
- return [{ type: e }, n];
100
46
  }
101
47
  export {
102
- x as encodeType,
103
- b as hashDomain,
104
- f as hashStruct,
105
- k as hashTypedData
48
+ c as InvalidLegacyVError,
49
+ d as InvalidSerializableTransactionError,
50
+ l as InvalidStorageKeySizeError,
51
+ p as TransactionReceiptNotFoundError,
52
+ i as prettyPrint
106
53
  };
package/dist/index44.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index34.cjs"),f=require("./index38.cjs"),a=require("./index41.cjs"),l=require("./index58.cjs"),A=require("./index35.cjs"),o=new l.LruMap(8192);function u(s,t){if(o.has(`${s}.${t}`))return o.get(`${s}.${t}`);const c=s.substring(2).toLowerCase(),n=a.keccak256(f.stringToBytes(c),"bytes"),r=c.split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&r[e]&&(r[e]=r[e].toUpperCase()),(n[e>>1]&15)>=8&&r[e+1]&&(r[e+1]=r[e+1].toUpperCase());const i=`0x${r.join("")}`;return o.set(`${s}.${t}`,i),i}function g(s,t){if(!A.isAddress(s,{strict:!1}))throw new d.InvalidAddressError({address:s});return u(s,t)}exports.checksumAddress=u;exports.getAddress=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index35.cjs"),d=require("./index77.cjs"),r=require("./index78.cjs"),u={"0x0":"reverted","0x1":"success"};function o(l){const s={...l,blockNumber:l.blockNumber?BigInt(l.blockNumber):null,contractAddress:l.contractAddress?l.contractAddress:null,cumulativeGasUsed:l.cumulativeGasUsed?BigInt(l.cumulativeGasUsed):null,effectiveGasPrice:l.effectiveGasPrice?BigInt(l.effectiveGasPrice):null,gasUsed:l.gasUsed?BigInt(l.gasUsed):null,logs:l.logs?l.logs.map(e=>d.formatLog(e)):null,to:l.to?l.to:null,transactionIndex:l.transactionIndex?b.hexToNumber(l.transactionIndex):null,status:l.status?u[l.status]:null,type:l.type?r.transactionType[l.type]||l.type:null};return l.blobGasPrice&&(s.blobGasPrice=BigInt(l.blobGasPrice)),l.blobGasUsed&&(s.blobGasUsed=BigInt(l.blobGasUsed)),s}exports.formatTransactionReceipt=o;exports.receiptStatuses=u;
package/dist/index44.js CHANGED
@@ -1,24 +1,27 @@
1
- import { InvalidAddressError as c } from "./index34.js";
2
- import { stringToBytes as m } from "./index38.js";
3
- import { keccak256 as p } from "./index41.js";
4
- import { LruMap as u } from "./index58.js";
5
- import { isAddress as $ } from "./index35.js";
6
- const s = /* @__PURE__ */ new u(8192);
7
- function h(t, o) {
8
- if (s.has(`${t}.${o}`))
9
- return s.get(`${t}.${o}`);
10
- const i = t.substring(2).toLowerCase(), n = p(m(i), "bytes"), e = i.split("");
11
- for (let r = 0; r < 40; r += 2)
12
- n[r >> 1] >> 4 >= 8 && e[r] && (e[r] = e[r].toUpperCase()), (n[r >> 1] & 15) >= 8 && e[r + 1] && (e[r + 1] = e[r + 1].toUpperCase());
13
- const f = `0x${e.join("")}`;
14
- return s.set(`${t}.${o}`, f), f;
15
- }
16
- function w(t, o) {
17
- if (!$(t, { strict: !1 }))
18
- throw new c({ address: t });
19
- return h(t, o);
1
+ import { hexToNumber as b } from "./index35.js";
2
+ import { formatLog as d } from "./index77.js";
3
+ import { transactionType as m } from "./index78.js";
4
+ const f = {
5
+ "0x0": "reverted",
6
+ "0x1": "success"
7
+ };
8
+ function r(l) {
9
+ const u = {
10
+ ...l,
11
+ blockNumber: l.blockNumber ? BigInt(l.blockNumber) : null,
12
+ contractAddress: l.contractAddress ? l.contractAddress : null,
13
+ cumulativeGasUsed: l.cumulativeGasUsed ? BigInt(l.cumulativeGasUsed) : null,
14
+ effectiveGasPrice: l.effectiveGasPrice ? BigInt(l.effectiveGasPrice) : null,
15
+ gasUsed: l.gasUsed ? BigInt(l.gasUsed) : null,
16
+ logs: l.logs ? l.logs.map((s) => d(s)) : null,
17
+ to: l.to ? l.to : null,
18
+ transactionIndex: l.transactionIndex ? b(l.transactionIndex) : null,
19
+ status: l.status ? f[l.status] : null,
20
+ type: l.type ? m[l.type] || l.type : null
21
+ };
22
+ return l.blobGasPrice && (u.blobGasPrice = BigInt(l.blobGasPrice)), l.blobGasUsed && (u.blobGasUsed = BigInt(l.blobGasUsed)), u;
20
23
  }
21
24
  export {
22
- h as checksumAddress,
23
- w as getAddress
25
+ r as formatTransactionReceipt,
26
+ f as receiptStatuses
24
27
  };
package/dist/index45.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index48.cjs");class i extends n.BaseError{constructor({max:e,min:r,signed:s,size:t,value:a}){super(`Number "${a}" is not in safe ${t?`${t*8}-bit ${s?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}}class u extends n.BaseError{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}exports.IntegerOutOfRangeError=i;exports.SizeOverflowError=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index50.cjs");class i extends n.BaseError{constructor({max:e,min:r,signed:s,size:t,value:a}){super(`Number "${a}" is not in safe ${t?`${t*8}-bit ${s?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}}class u extends n.BaseError{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}exports.IntegerOutOfRangeError=i;exports.SizeOverflowError=u;
package/dist/index45.js CHANGED
@@ -1,4 +1,4 @@
1
- import { BaseError as t } from "./index48.js";
1
+ import { BaseError as t } from "./index50.js";
2
2
  class $ extends t {
3
3
  constructor({ max: e, min: r, signed: s, size: n, value: a }) {
4
4
  super(`Number "${a}" is not in safe ${n ? `${n * 8}-bit ${s ? "signed" : "unsigned"} ` : ""}integer range ${e ? `(${r} to ${e})` : `(above ${r})`}`, { name: "IntegerOutOfRangeError" });
package/dist/index46.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index90.cjs");function p(e,{dir:n,size:t=32}={}){return typeof e=="string"?o(e,{dir:n,size:t}):l(e,{dir:n,size:t})}function o(e,{dir:n,size:t=32}={}){if(t===null)return e;const r=e.replace("0x","");if(r.length>t*2)throw new i.SizeExceedsPaddingSizeError({size:Math.ceil(r.length/2),targetSize:t,type:"hex"});return`0x${r[n==="right"?"padEnd":"padStart"](t*2,"0")}`}function l(e,{dir:n,size:t=32}={}){if(t===null)return e;if(e.length>t)throw new i.SizeExceedsPaddingSizeError({size:e.length,targetSize:t,type:"bytes"});const r=new Uint8Array(t);for(let a=0;a<t;a++){const d=n==="right";r[d?a:t-a-1]=e[d?a:e.length-a-1]}return r}exports.pad=p;exports.padBytes=l;exports.padHex=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index89.cjs");function p(e,{dir:n,size:t=32}={}){return typeof e=="string"?o(e,{dir:n,size:t}):l(e,{dir:n,size:t})}function o(e,{dir:n,size:t=32}={}){if(t===null)return e;const r=e.replace("0x","");if(r.length>t*2)throw new i.SizeExceedsPaddingSizeError({size:Math.ceil(r.length/2),targetSize:t,type:"hex"});return`0x${r[n==="right"?"padEnd":"padStart"](t*2,"0")}`}function l(e,{dir:n,size:t=32}={}){if(t===null)return e;if(e.length>t)throw new i.SizeExceedsPaddingSizeError({size:e.length,targetSize:t,type:"bytes"});const r=new Uint8Array(t);for(let a=0;a<t;a++){const d=n==="right";r[d?a:t-a-1]=e[d?a:e.length-a-1]}return r}exports.pad=p;exports.padBytes=l;exports.padHex=o;
package/dist/index46.js CHANGED
@@ -1,4 +1,4 @@
1
- import { SizeExceedsPaddingSizeError as d } from "./index90.js";
1
+ import { SizeExceedsPaddingSizeError as d } from "./index89.js";
2
2
  function f(n, { dir: r, size: t = 32 } = {}) {
3
3
  return typeof n == "string" ? p(n, { dir: r, size: t }) : i(n, { dir: r, size: t });
4
4
  }
package/dist/index47.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function g(e,{dir:i="left"}={}){let t=typeof e=="string"?e.replace("0x",""):e,n=0;for(let l=0;l<t.length-1&&t[i==="left"?l:t.length-l-1].toString()==="0";l++)n++;return t=i==="left"?t.slice(n):t.slice(0,t.length-n),typeof e=="string"?(t.length===1&&i==="right"&&(t=`${t}0`),`0x${t.length%2===1?`0${t}`:t}`):t}exports.trim=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index72.cjs"),s=require("./index71.cjs"),S=new Uint32Array([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]),b=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),f=new Uint32Array(64);class g extends H.HashMD{constructor(){super(64,32,8,!1),this.A=b[0]|0,this.B=b[1]|0,this.C=b[2]|0,this.D=b[3]|0,this.E=b[4]|0,this.F=b[5]|0,this.G=b[6]|0,this.H=b[7]|0}get(){const{A:d,B:o,C:x,D:e,E:a,F:i,G:c,H:r}=this;return[d,o,x,e,a,i,c,r]}set(d,o,x,e,a,i,c,r){this.A=d|0,this.B=o|0,this.C=x|0,this.D=e|0,this.E=a|0,this.F=i|0,this.G=c|0,this.H=r|0}process(d,o){for(let t=0;t<16;t++,o+=4)f[t]=d.getUint32(o,!1);for(let t=16;t<64;t++){const A=f[t-15],n=f[t-2],C=s.rotr(A,7)^s.rotr(A,18)^A>>>3,u=s.rotr(n,17)^s.rotr(n,19)^n>>>10;f[t]=u+f[t-7]+C+f[t-16]|0}let{A:x,B:e,C:a,D:i,E:c,F:r,G:h,H:l}=this;for(let t=0;t<64;t++){const A=s.rotr(c,6)^s.rotr(c,11)^s.rotr(c,25),n=l+A+H.Chi(c,r,h)+S[t]+f[t]|0,u=(s.rotr(x,2)^s.rotr(x,13)^s.rotr(x,22))+H.Maj(x,e,a)|0;l=h,h=r,r=c,c=i+n|0,i=a,a=e,e=x,x=n+u|0}x=x+this.A|0,e=e+this.B|0,a=a+this.C|0,i=i+this.D|0,c=c+this.E|0,r=r+this.F|0,h=h+this.G|0,l=l+this.H|0,this.set(x,e,a,i,c,r,h,l)}roundClean(){f.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const y=s.wrapConstructor(()=>new g);exports.SHA256=g;exports.sha256=y;
package/dist/index47.js CHANGED
@@ -1,9 +1,115 @@
1
- function f(e, { dir: n = "left" } = {}) {
2
- let t = typeof e == "string" ? e.replace("0x", "") : e, i = 0;
3
- for (let l = 0; l < t.length - 1 && t[n === "left" ? l : t.length - l - 1].toString() === "0"; l++)
4
- i++;
5
- return t = n === "left" ? t.slice(i) : t.slice(0, t.length - i), typeof e == "string" ? (t.length === 1 && n === "right" && (t = `${t}0`), `0x${t.length % 2 === 1 ? `0${t}` : t}`) : t;
1
+ import { HashMD as m, Chi as p, Maj as u } from "./index72.js";
2
+ import { wrapConstructor as D, rotr as i } from "./index71.js";
3
+ const g = /* @__PURE__ */ new Uint32Array([
4
+ 1116352408,
5
+ 1899447441,
6
+ 3049323471,
7
+ 3921009573,
8
+ 961987163,
9
+ 1508970993,
10
+ 2453635748,
11
+ 2870763221,
12
+ 3624381080,
13
+ 310598401,
14
+ 607225278,
15
+ 1426881987,
16
+ 1925078388,
17
+ 2162078206,
18
+ 2614888103,
19
+ 3248222580,
20
+ 3835390401,
21
+ 4022224774,
22
+ 264347078,
23
+ 604807628,
24
+ 770255983,
25
+ 1249150122,
26
+ 1555081692,
27
+ 1996064986,
28
+ 2554220882,
29
+ 2821834349,
30
+ 2952996808,
31
+ 3210313671,
32
+ 3336571891,
33
+ 3584528711,
34
+ 113926993,
35
+ 338241895,
36
+ 666307205,
37
+ 773529912,
38
+ 1294757372,
39
+ 1396182291,
40
+ 1695183700,
41
+ 1986661051,
42
+ 2177026350,
43
+ 2456956037,
44
+ 2730485921,
45
+ 2820302411,
46
+ 3259730800,
47
+ 3345764771,
48
+ 3516065817,
49
+ 3600352804,
50
+ 4094571909,
51
+ 275423344,
52
+ 430227734,
53
+ 506948616,
54
+ 659060556,
55
+ 883997877,
56
+ 958139571,
57
+ 1322822218,
58
+ 1537002063,
59
+ 1747873779,
60
+ 1955562222,
61
+ 2024104815,
62
+ 2227730452,
63
+ 2361852424,
64
+ 2428436474,
65
+ 2756734187,
66
+ 3204031479,
67
+ 3329325298
68
+ ]), b = /* @__PURE__ */ new Uint32Array([
69
+ 1779033703,
70
+ 3144134277,
71
+ 1013904242,
72
+ 2773480762,
73
+ 1359893119,
74
+ 2600822924,
75
+ 528734635,
76
+ 1541459225
77
+ ]), h = /* @__PURE__ */ new Uint32Array(64);
78
+ class w extends m {
79
+ constructor() {
80
+ super(64, 32, 8, !1), this.A = b[0] | 0, this.B = b[1] | 0, this.C = b[2] | 0, this.D = b[3] | 0, this.E = b[4] | 0, this.F = b[5] | 0, this.G = b[6] | 0, this.H = b[7] | 0;
81
+ }
82
+ get() {
83
+ const { A: d, B: o, C: t, D: s, E: a, F: f, G: c, H: e } = this;
84
+ return [d, o, t, s, a, f, c, e];
85
+ }
86
+ // prettier-ignore
87
+ set(d, o, t, s, a, f, c, e) {
88
+ this.A = d | 0, this.B = o | 0, this.C = t | 0, this.D = s | 0, this.E = a | 0, this.F = f | 0, this.G = c | 0, this.H = e | 0;
89
+ }
90
+ process(d, o) {
91
+ for (let x = 0; x < 16; x++, o += 4)
92
+ h[x] = d.getUint32(o, !1);
93
+ for (let x = 16; x < 64; x++) {
94
+ const A = h[x - 15], n = h[x - 2], C = i(A, 7) ^ i(A, 18) ^ A >>> 3, H = i(n, 17) ^ i(n, 19) ^ n >>> 10;
95
+ h[x] = H + h[x - 7] + C + h[x - 16] | 0;
96
+ }
97
+ let { A: t, B: s, C: a, D: f, E: c, F: e, G: r, H: l } = this;
98
+ for (let x = 0; x < 64; x++) {
99
+ const A = i(c, 6) ^ i(c, 11) ^ i(c, 25), n = l + A + p(c, e, r) + g[x] + h[x] | 0, H = (i(t, 2) ^ i(t, 13) ^ i(t, 22)) + u(t, s, a) | 0;
100
+ l = r, r = e, e = c, c = f + n | 0, f = a, a = s, s = t, t = n + H | 0;
101
+ }
102
+ t = t + this.A | 0, s = s + this.B | 0, a = a + this.C | 0, f = f + this.D | 0, c = c + this.E | 0, e = e + this.F | 0, r = r + this.G | 0, l = l + this.H | 0, this.set(t, s, a, f, c, e, r, l);
103
+ }
104
+ roundClean() {
105
+ h.fill(0);
106
+ }
107
+ destroy() {
108
+ this.set(0, 0, 0, 0, 0, 0, 0, 0), this.buffer.fill(0);
109
+ }
6
110
  }
111
+ const G = /* @__PURE__ */ D(() => new w());
7
112
  export {
8
- f as trim
113
+ w as SHA256,
114
+ G as sha256
9
115
  };
package/dist/index48.cjs CHANGED
@@ -1,2 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index49.cjs");let i={getDocsUrl:({docsBaseUrl:s,docsPath:t="",docsSlug:e})=>t?`${s??"https://viem.sh"}${t}${e?`#${e}`:""}`:void 0,version:`viem@${l.version}`};class u extends Error{constructor(t,e={}){var o;const r=(()=>{var c;return e.cause instanceof u?e.cause.details:(c=e.cause)!=null&&c.message?e.cause.message:e.details})(),n=e.cause instanceof u&&e.cause.docsPath||e.docsPath,a=(o=i.getDocsUrl)==null?void 0:o.call(i,{...e,docsPath:n}),b=[t||"An error occurred.","",...e.metaMessages?[...e.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...i.version?[`Version: ${i.version}`]:[]].join(`
2
- `);super(b,e.cause?{cause:e.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=n,this.metaMessages=e.metaMessages,this.name=e.name??this.name,this.shortMessage=t,this.version=l.version}walk(t){return d(this,t)}}function d(s,t){return t!=null&&t(s)?s:s&&typeof s=="object"&&"cause"in s&&s.cause!==void 0?d(s.cause,t):t?null:s}exports.BaseError=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index69.cjs"),s=require("./index71.cjs"),o=require("./index91.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function c(e){return{hash:e,hmac:(r,...t)=>a.hmac(e,r,s.concatBytes(...t)),randomBytes:s.randomBytes}}function u(e,r){const t=n=>o.weierstrass({...e,...c(n)});return{...t(r),create:t}}exports.createCurve=u;exports.getHash=c;