@coinbase/cdp-core 0.0.87 → 0.0.88

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 (295) hide show
  1. package/dist/esm/index.native10.js +1 -1
  2. package/dist/esm/index.native101.js +2 -2
  3. package/dist/esm/index.native105.js +3 -3
  4. package/dist/esm/index.native106.js +31 -2
  5. package/dist/esm/index.native107.js +28 -65
  6. package/dist/esm/index.native108.js +2 -367
  7. package/dist/esm/index.native109.js +65 -28
  8. package/dist/esm/index.native110.js +364 -28
  9. package/dist/esm/index.native122.js +5 -35
  10. package/dist/esm/index.native123.js +40 -60
  11. package/dist/esm/index.native124.js +35 -5
  12. package/dist/esm/index.native125.js +60 -40
  13. package/dist/esm/index.native197.js +37 -107
  14. package/dist/esm/index.native199.js +69 -7
  15. package/dist/esm/index.native2.js +35 -30
  16. package/dist/esm/index.native200.js +35 -2
  17. package/dist/esm/index.native201.js +17 -374
  18. package/dist/esm/index.native202.js +7 -835
  19. package/dist/esm/index.native203.js +2 -39
  20. package/dist/esm/index.native204.js +378 -2
  21. package/dist/esm/index.native205.js +835 -69
  22. package/dist/esm/index.native206.js +106 -32
  23. package/dist/esm/index.native207.js +2 -21
  24. package/dist/esm/index.native222.js +2 -2
  25. package/dist/esm/index.native223.js +2 -2
  26. package/dist/esm/index.native224.js +2 -2
  27. package/dist/esm/index.native225.js +1 -1
  28. package/dist/esm/index.native3.js +1 -1
  29. package/dist/esm/index.native67.js +97 -60
  30. package/dist/esm/index.native9.js +1 -1
  31. package/dist/esm/index.native90.js +2 -2
  32. package/dist/esm/index.web102.js +12 -12
  33. package/dist/esm/index.web106.js +3 -3
  34. package/dist/esm/index.web107.js +2 -31
  35. package/dist/esm/index.web108.js +65 -28
  36. package/dist/esm/index.web109.js +367 -2
  37. package/dist/esm/index.web110.js +28 -65
  38. package/dist/esm/index.web111.js +28 -364
  39. package/dist/esm/index.web116.js +1 -1
  40. package/dist/esm/index.web117.js +2 -2
  41. package/dist/esm/index.web123.js +1 -1
  42. package/dist/esm/index.web127.js +4 -17
  43. package/dist/esm/index.web128.js +16 -44
  44. package/dist/esm/index.web129.js +45 -13
  45. package/dist/esm/index.web130.js +13 -55
  46. package/dist/esm/index.web131.js +55 -6
  47. package/dist/esm/index.web132.js +6 -21
  48. package/dist/esm/index.web133.js +21 -3
  49. package/dist/esm/index.web134.js +3 -3
  50. package/dist/esm/index.web135.js +3 -34
  51. package/dist/esm/index.web136.js +32 -10
  52. package/dist/esm/index.web137.js +12 -4
  53. package/dist/esm/index.web138.js +4 -28
  54. package/dist/esm/index.web139.js +28 -6
  55. package/dist/esm/index.web140.js +6 -42
  56. package/dist/esm/index.web141.js +41 -54
  57. package/dist/esm/index.web142.js +54 -126
  58. package/dist/esm/index.web143.js +127 -23
  59. package/dist/esm/index.web144.js +22 -11
  60. package/dist/esm/index.web145.js +9 -101
  61. package/dist/esm/index.web146.js +104 -6
  62. package/dist/esm/index.web147.js +7 -3
  63. package/dist/esm/index.web148.js +3 -15
  64. package/dist/esm/index.web149.js +14 -34
  65. package/dist/esm/index.web150.js +31 -75
  66. package/dist/esm/index.web151.js +79 -2
  67. package/dist/esm/index.web152.js +2 -2
  68. package/dist/esm/index.web153.js +2 -38
  69. package/dist/esm/index.web154.js +36 -5
  70. package/dist/esm/index.web155.js +5 -33
  71. package/dist/esm/index.web156.js +34 -8
  72. package/dist/esm/index.web157.js +8 -10
  73. package/dist/esm/index.web158.js +10 -11
  74. package/dist/esm/index.web159.js +11 -13
  75. package/dist/esm/index.web160.js +13 -18
  76. package/dist/esm/index.web161.js +18 -5
  77. package/dist/esm/index.web162.js +6 -5
  78. package/dist/esm/index.web163.js +5 -11
  79. package/dist/esm/index.web164.js +10 -4
  80. package/dist/esm/index.web165.js +14 -103
  81. package/dist/esm/index.web166.js +27 -77
  82. package/dist/esm/index.web167.js +7 -79
  83. package/dist/esm/index.web168.js +3 -14
  84. package/dist/esm/index.web169.js +16 -16
  85. package/dist/esm/index.web170.js +8 -7
  86. package/dist/esm/index.web171.js +7 -3
  87. package/dist/esm/index.web172.js +70 -18
  88. package/dist/esm/index.web173.js +28 -8
  89. package/dist/esm/index.web174.js +3 -7
  90. package/dist/esm/index.web175.js +7 -72
  91. package/dist/esm/index.web176.js +4 -28
  92. package/dist/esm/index.web177.js +14 -3
  93. package/dist/esm/index.web178.js +19 -15
  94. package/dist/esm/index.web179.js +61 -4
  95. package/dist/esm/index.web180.js +16 -13
  96. package/dist/esm/index.web181.js +19 -15
  97. package/dist/esm/index.web182.js +8 -61
  98. package/dist/esm/index.web183.js +41 -16
  99. package/dist/esm/index.web184.js +7 -23
  100. package/dist/esm/index.web185.js +20 -8
  101. package/dist/esm/index.web186.js +102 -41
  102. package/dist/esm/index.web187.js +78 -7
  103. package/dist/esm/index.web188.js +79 -20
  104. package/dist/esm/index.web189.js +1 -1
  105. package/dist/esm/index.web190.js +3 -3
  106. package/dist/esm/index.web192.js +3 -3
  107. package/dist/esm/index.web194.js +3 -3
  108. package/dist/esm/index.web195.js +2 -8
  109. package/dist/esm/index.web196.js +109 -2
  110. package/dist/esm/index.web197.js +2 -378
  111. package/dist/esm/index.web198.js +7 -835
  112. package/dist/esm/index.web199.js +2 -39
  113. package/dist/esm/index.web2.js +34 -29
  114. package/dist/esm/index.web200.js +378 -2
  115. package/dist/esm/index.web201.js +835 -69
  116. package/dist/esm/index.web202.js +37 -33
  117. package/dist/esm/index.web203.js +2 -21
  118. package/dist/esm/index.web204.js +70 -2
  119. package/dist/esm/index.web205.js +34 -20
  120. package/dist/esm/index.web206.js +19 -18
  121. package/dist/esm/index.web207.js +2 -33
  122. package/dist/esm/index.web208.js +20 -6
  123. package/dist/esm/index.web209.js +20 -2
  124. package/dist/esm/index.web210.js +31 -107
  125. package/dist/esm/index.web211.js +7 -2
  126. package/dist/esm/index.web213.js +47 -2
  127. package/dist/esm/index.web214.js +18 -2
  128. package/dist/esm/index.web215.js +28 -2
  129. package/dist/esm/index.web216.js +8 -18
  130. package/dist/esm/index.web217.js +9 -26
  131. package/dist/esm/index.web218.js +13 -8
  132. package/dist/esm/index.web219.js +10 -11
  133. package/dist/esm/index.web220.js +15 -11
  134. package/dist/esm/index.web221.js +80 -9
  135. package/dist/esm/index.web222.js +2 -17
  136. package/dist/esm/index.web223.js +2 -81
  137. package/dist/esm/index.web224.js +2 -47
  138. package/dist/esm/index.web226.js +14 -78
  139. package/dist/esm/index.web227.js +78 -14
  140. package/dist/esm/index.web3.js +1 -1
  141. package/dist/esm/index.web66.js +97 -60
  142. package/dist/esm/index.web8.js +1 -1
  143. package/dist/esm/index.web9.js +1 -1
  144. package/dist/esm/index.web92.js +2 -2
  145. package/dist/native/index.native10.js +1 -1
  146. package/dist/native/index.native101.js +2 -2
  147. package/dist/native/index.native105.js +3 -3
  148. package/dist/native/index.native106.js +31 -2
  149. package/dist/native/index.native107.js +28 -65
  150. package/dist/native/index.native108.js +2 -367
  151. package/dist/native/index.native109.js +65 -28
  152. package/dist/native/index.native110.js +364 -28
  153. package/dist/native/index.native122.js +5 -35
  154. package/dist/native/index.native123.js +40 -60
  155. package/dist/native/index.native124.js +35 -5
  156. package/dist/native/index.native125.js +60 -40
  157. package/dist/native/index.native197.js +37 -107
  158. package/dist/native/index.native199.js +69 -7
  159. package/dist/native/index.native2.js +35 -30
  160. package/dist/native/index.native200.js +35 -2
  161. package/dist/native/index.native201.js +17 -374
  162. package/dist/native/index.native202.js +7 -835
  163. package/dist/native/index.native203.js +2 -39
  164. package/dist/native/index.native204.js +378 -2
  165. package/dist/native/index.native205.js +835 -69
  166. package/dist/native/index.native206.js +106 -32
  167. package/dist/native/index.native207.js +2 -21
  168. package/dist/native/index.native222.js +2 -2
  169. package/dist/native/index.native223.js +2 -2
  170. package/dist/native/index.native224.js +2 -2
  171. package/dist/native/index.native225.js +1 -1
  172. package/dist/native/index.native3.js +1 -1
  173. package/dist/native/index.native67.js +97 -60
  174. package/dist/native/index.native9.js +1 -1
  175. package/dist/native/index.native90.js +2 -2
  176. package/dist/native-types/auth/authManager.d.ts +1 -1
  177. package/dist/native-types/version.d.ts +1 -1
  178. package/dist/types/auth/authManager.d.ts +1 -1
  179. package/dist/types/version.d.ts +1 -1
  180. package/dist/web/index.web102.js +12 -12
  181. package/dist/web/index.web106.js +3 -3
  182. package/dist/web/index.web107.js +2 -31
  183. package/dist/web/index.web108.js +65 -28
  184. package/dist/web/index.web109.js +367 -2
  185. package/dist/web/index.web110.js +28 -65
  186. package/dist/web/index.web111.js +28 -364
  187. package/dist/web/index.web116.js +1 -1
  188. package/dist/web/index.web117.js +2 -2
  189. package/dist/web/index.web123.js +1 -1
  190. package/dist/web/index.web127.js +4 -17
  191. package/dist/web/index.web128.js +16 -44
  192. package/dist/web/index.web129.js +45 -13
  193. package/dist/web/index.web130.js +13 -55
  194. package/dist/web/index.web131.js +55 -6
  195. package/dist/web/index.web132.js +6 -21
  196. package/dist/web/index.web133.js +21 -3
  197. package/dist/web/index.web134.js +3 -3
  198. package/dist/web/index.web135.js +3 -34
  199. package/dist/web/index.web136.js +32 -10
  200. package/dist/web/index.web137.js +12 -4
  201. package/dist/web/index.web138.js +4 -28
  202. package/dist/web/index.web139.js +28 -6
  203. package/dist/web/index.web140.js +6 -42
  204. package/dist/web/index.web141.js +41 -54
  205. package/dist/web/index.web142.js +54 -126
  206. package/dist/web/index.web143.js +127 -23
  207. package/dist/web/index.web144.js +22 -11
  208. package/dist/web/index.web145.js +9 -101
  209. package/dist/web/index.web146.js +104 -6
  210. package/dist/web/index.web147.js +7 -3
  211. package/dist/web/index.web148.js +3 -15
  212. package/dist/web/index.web149.js +14 -34
  213. package/dist/web/index.web150.js +31 -75
  214. package/dist/web/index.web151.js +79 -2
  215. package/dist/web/index.web152.js +2 -2
  216. package/dist/web/index.web153.js +2 -38
  217. package/dist/web/index.web154.js +36 -5
  218. package/dist/web/index.web155.js +5 -33
  219. package/dist/web/index.web156.js +34 -8
  220. package/dist/web/index.web157.js +8 -10
  221. package/dist/web/index.web158.js +10 -11
  222. package/dist/web/index.web159.js +11 -13
  223. package/dist/web/index.web160.js +13 -18
  224. package/dist/web/index.web161.js +18 -5
  225. package/dist/web/index.web162.js +6 -5
  226. package/dist/web/index.web163.js +5 -11
  227. package/dist/web/index.web164.js +10 -4
  228. package/dist/web/index.web165.js +14 -103
  229. package/dist/web/index.web166.js +27 -77
  230. package/dist/web/index.web167.js +7 -79
  231. package/dist/web/index.web168.js +3 -14
  232. package/dist/web/index.web169.js +16 -16
  233. package/dist/web/index.web170.js +8 -7
  234. package/dist/web/index.web171.js +7 -3
  235. package/dist/web/index.web172.js +70 -18
  236. package/dist/web/index.web173.js +28 -8
  237. package/dist/web/index.web174.js +3 -7
  238. package/dist/web/index.web175.js +7 -72
  239. package/dist/web/index.web176.js +4 -28
  240. package/dist/web/index.web177.js +14 -3
  241. package/dist/web/index.web178.js +19 -15
  242. package/dist/web/index.web179.js +61 -4
  243. package/dist/web/index.web180.js +16 -13
  244. package/dist/web/index.web181.js +19 -15
  245. package/dist/web/index.web182.js +8 -61
  246. package/dist/web/index.web183.js +41 -16
  247. package/dist/web/index.web184.js +7 -23
  248. package/dist/web/index.web185.js +20 -8
  249. package/dist/web/index.web186.js +102 -41
  250. package/dist/web/index.web187.js +78 -7
  251. package/dist/web/index.web188.js +79 -20
  252. package/dist/web/index.web189.js +1 -1
  253. package/dist/web/index.web190.js +3 -3
  254. package/dist/web/index.web192.js +3 -3
  255. package/dist/web/index.web194.js +3 -3
  256. package/dist/web/index.web195.js +2 -8
  257. package/dist/web/index.web196.js +109 -2
  258. package/dist/web/index.web197.js +2 -378
  259. package/dist/web/index.web198.js +7 -835
  260. package/dist/web/index.web199.js +2 -39
  261. package/dist/web/index.web2.js +34 -29
  262. package/dist/web/index.web200.js +378 -2
  263. package/dist/web/index.web201.js +835 -69
  264. package/dist/web/index.web202.js +37 -33
  265. package/dist/web/index.web203.js +2 -21
  266. package/dist/web/index.web204.js +70 -2
  267. package/dist/web/index.web205.js +34 -20
  268. package/dist/web/index.web206.js +19 -18
  269. package/dist/web/index.web207.js +2 -33
  270. package/dist/web/index.web208.js +20 -6
  271. package/dist/web/index.web209.js +20 -2
  272. package/dist/web/index.web210.js +31 -107
  273. package/dist/web/index.web211.js +7 -2
  274. package/dist/web/index.web213.js +47 -2
  275. package/dist/web/index.web214.js +18 -2
  276. package/dist/web/index.web215.js +28 -2
  277. package/dist/web/index.web216.js +8 -18
  278. package/dist/web/index.web217.js +9 -26
  279. package/dist/web/index.web218.js +13 -8
  280. package/dist/web/index.web219.js +10 -11
  281. package/dist/web/index.web220.js +15 -11
  282. package/dist/web/index.web221.js +80 -9
  283. package/dist/web/index.web222.js +2 -17
  284. package/dist/web/index.web223.js +2 -81
  285. package/dist/web/index.web224.js +2 -47
  286. package/dist/web/index.web226.js +14 -78
  287. package/dist/web/index.web227.js +78 -14
  288. package/dist/web/index.web3.js +1 -1
  289. package/dist/web/index.web66.js +97 -60
  290. package/dist/web/index.web8.js +1 -1
  291. package/dist/web/index.web9.js +1 -1
  292. package/dist/web/index.web92.js +2 -2
  293. package/dist/web-types/auth/authManager.d.ts +1 -1
  294. package/dist/web-types/version.d.ts +1 -1
  295. package/package.json +2 -2
@@ -1,26 +1,130 @@
1
- import { SizeOverflowError as u } from "./index.web144.js";
2
- import { size as t } from "./index.web137.js";
3
- function s(n, { size: i }) {
4
- if (t(n) > i)
5
- throw new u({
6
- givenSize: t(n),
7
- maxSize: i
8
- });
9
- }
10
- function z(n, i = {}) {
11
- const { signed: o } = i;
12
- i.size && s(n, { size: i.size });
13
- const e = BigInt(n);
14
- if (!o)
15
- return e;
16
- const r = (n.length - 2) / 2, f = (1n << BigInt(r) * 8n - 1n) - 1n;
17
- return e <= f ? e : e - BigInt(`0x${"f".padStart(r * 2, "f")}`) - 1n;
18
- }
19
- function g(n, i = {}) {
20
- return Number(z(n, i));
1
+ import { NegativeOffsetError as o, PositionOutOfBoundsError as e, RecursiveReadLimitExceededError as n } from "./index.web208.js";
2
+ const h = {
3
+ bytes: new Uint8Array(),
4
+ dataView: new DataView(new ArrayBuffer(0)),
5
+ position: 0,
6
+ positionReadCount: /* @__PURE__ */ new Map(),
7
+ recursiveReadCount: 0,
8
+ recursiveReadLimit: Number.POSITIVE_INFINITY,
9
+ assertReadLimit() {
10
+ if (this.recursiveReadCount >= this.recursiveReadLimit)
11
+ throw new n({
12
+ count: this.recursiveReadCount + 1,
13
+ limit: this.recursiveReadLimit
14
+ });
15
+ },
16
+ assertPosition(t) {
17
+ if (t < 0 || t > this.bytes.length - 1)
18
+ throw new e({
19
+ length: this.bytes.length,
20
+ position: t
21
+ });
22
+ },
23
+ decrementPosition(t) {
24
+ if (t < 0)
25
+ throw new o({ offset: t });
26
+ const i = this.position - t;
27
+ this.assertPosition(i), this.position = i;
28
+ },
29
+ getReadCount(t) {
30
+ return this.positionReadCount.get(t || this.position) || 0;
31
+ },
32
+ incrementPosition(t) {
33
+ if (t < 0)
34
+ throw new o({ offset: t });
35
+ const i = this.position + t;
36
+ this.assertPosition(i), this.position = i;
37
+ },
38
+ inspectByte(t) {
39
+ const i = t ?? this.position;
40
+ return this.assertPosition(i), this.bytes[i];
41
+ },
42
+ inspectBytes(t, i) {
43
+ const s = i ?? this.position;
44
+ return this.assertPosition(s + t - 1), this.bytes.subarray(s, s + t);
45
+ },
46
+ inspectUint8(t) {
47
+ const i = t ?? this.position;
48
+ return this.assertPosition(i), this.bytes[i];
49
+ },
50
+ inspectUint16(t) {
51
+ const i = t ?? this.position;
52
+ return this.assertPosition(i + 1), this.dataView.getUint16(i);
53
+ },
54
+ inspectUint24(t) {
55
+ const i = t ?? this.position;
56
+ return this.assertPosition(i + 2), (this.dataView.getUint16(i) << 8) + this.dataView.getUint8(i + 2);
57
+ },
58
+ inspectUint32(t) {
59
+ const i = t ?? this.position;
60
+ return this.assertPosition(i + 3), this.dataView.getUint32(i);
61
+ },
62
+ pushByte(t) {
63
+ this.assertPosition(this.position), this.bytes[this.position] = t, this.position++;
64
+ },
65
+ pushBytes(t) {
66
+ this.assertPosition(this.position + t.length - 1), this.bytes.set(t, this.position), this.position += t.length;
67
+ },
68
+ pushUint8(t) {
69
+ this.assertPosition(this.position), this.bytes[this.position] = t, this.position++;
70
+ },
71
+ pushUint16(t) {
72
+ this.assertPosition(this.position + 1), this.dataView.setUint16(this.position, t), this.position += 2;
73
+ },
74
+ pushUint24(t) {
75
+ this.assertPosition(this.position + 2), this.dataView.setUint16(this.position, t >> 8), this.dataView.setUint8(this.position + 2, t & 255), this.position += 3;
76
+ },
77
+ pushUint32(t) {
78
+ this.assertPosition(this.position + 3), this.dataView.setUint32(this.position, t), this.position += 4;
79
+ },
80
+ readByte() {
81
+ this.assertReadLimit(), this._touch();
82
+ const t = this.inspectByte();
83
+ return this.position++, t;
84
+ },
85
+ readBytes(t, i) {
86
+ this.assertReadLimit(), this._touch();
87
+ const s = this.inspectBytes(t);
88
+ return this.position += i ?? t, s;
89
+ },
90
+ readUint8() {
91
+ this.assertReadLimit(), this._touch();
92
+ const t = this.inspectUint8();
93
+ return this.position += 1, t;
94
+ },
95
+ readUint16() {
96
+ this.assertReadLimit(), this._touch();
97
+ const t = this.inspectUint16();
98
+ return this.position += 2, t;
99
+ },
100
+ readUint24() {
101
+ this.assertReadLimit(), this._touch();
102
+ const t = this.inspectUint24();
103
+ return this.position += 3, t;
104
+ },
105
+ readUint32() {
106
+ this.assertReadLimit(), this._touch();
107
+ const t = this.inspectUint32();
108
+ return this.position += 4, t;
109
+ },
110
+ get remaining() {
111
+ return this.bytes.length - this.position;
112
+ },
113
+ setPosition(t) {
114
+ const i = this.position;
115
+ return this.assertPosition(t), this.position = t, () => this.position = i;
116
+ },
117
+ _touch() {
118
+ if (this.recursiveReadLimit === Number.POSITIVE_INFINITY)
119
+ return;
120
+ const t = this.getReadCount();
121
+ this.positionReadCount.set(this.position, t + 1), t > 0 && this.recursiveReadCount++;
122
+ }
123
+ };
124
+ function a(t, { recursiveReadLimit: i = 8192 } = {}) {
125
+ const s = Object.create(h);
126
+ return s.bytes = t, s.dataView = new DataView(t.buffer, t.byteOffset, t.byteLength), s.positionReadCount = /* @__PURE__ */ new Map(), s.recursiveReadLimit = i, s;
21
127
  }
22
128
  export {
23
- s as assertSize,
24
- z as hexToBigInt,
25
- g as hexToNumber
129
+ a as createCursor
26
130
  };
@@ -1,15 +1,26 @@
1
- import { BaseError as t } from "./index.web141.js";
2
- class $ extends t {
3
- constructor({ max: e, min: r, signed: s, size: n, value: a }) {
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" });
5
- }
1
+ import { SizeOverflowError as u } from "./index.web145.js";
2
+ import { size as t } from "./index.web138.js";
3
+ function s(n, { size: i }) {
4
+ if (t(n) > i)
5
+ throw new u({
6
+ givenSize: t(n),
7
+ maxSize: i
8
+ });
6
9
  }
7
- class c extends t {
8
- constructor({ givenSize: e, maxSize: r }) {
9
- super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`, { name: "SizeOverflowError" });
10
- }
10
+ function z(n, i = {}) {
11
+ const { signed: o } = i;
12
+ i.size && s(n, { size: i.size });
13
+ const e = BigInt(n);
14
+ if (!o)
15
+ return e;
16
+ const r = (n.length - 2) / 2, f = (1n << BigInt(r) * 8n - 1n) - 1n;
17
+ return e <= f ? e : e - BigInt(`0x${"f".padStart(r * 2, "f")}`) - 1n;
18
+ }
19
+ function g(n, i = {}) {
20
+ return Number(z(n, i));
11
21
  }
12
22
  export {
13
- $ as IntegerOutOfRangeError,
14
- c as SizeOverflowError
23
+ s as assertSize,
24
+ z as hexToBigInt,
25
+ g as hexToNumber
15
26
  };
@@ -1,107 +1,15 @@
1
- import { split as L, rotlSH as T, rotlSL as S, rotlBH as m, rotlBL as F } from "./index.web206.js";
2
- import { createHasher as X, Hash as E, anumber as d, u32 as U, swap32IfBE as I, aexists as x, toBytes as P, abytes as k, aoutput as M, clean as y } from "./index.web167.js";
3
- const R = BigInt(0), f = BigInt(1), j = BigInt(2), q = BigInt(7), v = BigInt(256), z = BigInt(113), _ = [], g = [], B = [];
4
- for (let n = 0, t = f, s = 1, i = 0; n < 24; n++) {
5
- [s, i] = [i, (2 * s + 3 * i) % 5], _.push(2 * (5 * i + s)), g.push((n + 1) * (n + 2) / 2 % 64);
6
- let o = R;
7
- for (let r = 0; r < 7; r++)
8
- t = (t << f ^ (t >> q) * z) % v, t & j && (o ^= f << (f << /* @__PURE__ */ BigInt(r)) - f);
9
- B.push(o);
10
- }
11
- const A = L(B, !0), C = A[0], D = A[1], O = (n, t, s) => s > 32 ? m(n, t, s) : T(n, t, s), w = (n, t, s) => s > 32 ? F(n, t, s) : S(n, t, s);
12
- function G(n, t = 24) {
13
- const s = new Uint32Array(10);
14
- for (let i = 24 - t; i < 24; i++) {
15
- for (let e = 0; e < 10; e++)
16
- s[e] = n[e] ^ n[e + 10] ^ n[e + 20] ^ n[e + 30] ^ n[e + 40];
17
- for (let e = 0; e < 10; e += 2) {
18
- const h = (e + 8) % 10, l = (e + 2) % 10, u = s[l], c = s[l + 1], b = O(u, c, 1) ^ s[h], H = w(u, c, 1) ^ s[h + 1];
19
- for (let a = 0; a < 50; a += 10)
20
- n[e + a] ^= b, n[e + a + 1] ^= H;
21
- }
22
- let o = n[2], r = n[3];
23
- for (let e = 0; e < 24; e++) {
24
- const h = g[e], l = O(o, r, h), u = w(o, r, h), c = _[e];
25
- o = n[c], r = n[c + 1], n[c] = l, n[c + 1] = u;
26
- }
27
- for (let e = 0; e < 50; e += 10) {
28
- for (let h = 0; h < 10; h++)
29
- s[h] = n[e + h];
30
- for (let h = 0; h < 10; h++)
31
- n[e + h] ^= ~s[(h + 2) % 10] & s[(h + 4) % 10];
32
- }
33
- n[0] ^= C[i], n[1] ^= D[i];
1
+ import { BaseError as t } from "./index.web142.js";
2
+ class $ extends t {
3
+ constructor({ max: e, min: r, signed: s, size: n, value: a }) {
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" });
34
5
  }
35
- y(s);
36
6
  }
37
- class p extends E {
38
- // NOTE: we accept arguments in bytes instead of bits here.
39
- constructor(t, s, i, o = !1, r = 24) {
40
- if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = t, this.suffix = s, this.outputLen = i, this.enableXOF = o, this.rounds = r, d(i), !(0 < t && t < 200))
41
- throw new Error("only keccak-f1600 function is supported");
42
- this.state = new Uint8Array(200), this.state32 = U(this.state);
43
- }
44
- clone() {
45
- return this._cloneInto();
46
- }
47
- keccak() {
48
- I(this.state32), G(this.state32, this.rounds), I(this.state32), this.posOut = 0, this.pos = 0;
49
- }
50
- update(t) {
51
- x(this), t = P(t), k(t);
52
- const { blockLen: s, state: i } = this, o = t.length;
53
- for (let r = 0; r < o; ) {
54
- const e = Math.min(s - this.pos, o - r);
55
- for (let h = 0; h < e; h++)
56
- i[this.pos++] ^= t[r++];
57
- this.pos === s && this.keccak();
58
- }
59
- return this;
60
- }
61
- finish() {
62
- if (this.finished)
63
- return;
64
- this.finished = !0;
65
- const { state: t, suffix: s, pos: i, blockLen: o } = this;
66
- t[i] ^= s, (s & 128) !== 0 && i === o - 1 && this.keccak(), t[o - 1] ^= 128, this.keccak();
67
- }
68
- writeInto(t) {
69
- x(this, !1), k(t), this.finish();
70
- const s = this.state, { blockLen: i } = this;
71
- for (let o = 0, r = t.length; o < r; ) {
72
- this.posOut >= i && this.keccak();
73
- const e = Math.min(i - this.posOut, r - o);
74
- t.set(s.subarray(this.posOut, this.posOut + e), o), this.posOut += e, o += e;
75
- }
76
- return t;
77
- }
78
- xofInto(t) {
79
- if (!this.enableXOF)
80
- throw new Error("XOF is not possible for this instance");
81
- return this.writeInto(t);
82
- }
83
- xof(t) {
84
- return d(t), this.xofInto(new Uint8Array(t));
85
- }
86
- digestInto(t) {
87
- if (M(t, this), this.finished)
88
- throw new Error("digest() was already called");
89
- return this.writeInto(t), this.destroy(), t;
90
- }
91
- digest() {
92
- return this.digestInto(new Uint8Array(this.outputLen));
93
- }
94
- destroy() {
95
- this.destroyed = !0, y(this.state);
96
- }
97
- _cloneInto(t) {
98
- const { blockLen: s, suffix: i, outputLen: o, rounds: r, enableXOF: e } = this;
99
- return t || (t = new p(s, i, o, e, r)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = r, t.suffix = i, t.outputLen = o, t.enableXOF = e, t.destroyed = this.destroyed, t;
7
+ class c extends t {
8
+ constructor({ givenSize: e, maxSize: r }) {
9
+ super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`, { name: "SizeOverflowError" });
100
10
  }
101
11
  }
102
- const J = (n, t, s) => X(() => new p(t, n, s)), Q = J(1, 136, 256 / 8);
103
12
  export {
104
- p as Keccak,
105
- G as keccakP,
106
- Q as keccak_256
13
+ $ as IntegerOutOfRangeError,
14
+ c as SizeOverflowError
107
15
  };
@@ -1,9 +1,107 @@
1
- import { sha256 as o } from "./index.web147.js";
2
- import { isHex as s } from "./index.web134.js";
3
- import { toBytes as r } from "./index.web130.js";
4
- function p(t, i) {
5
- return o(s(t, { strict: !1 }) ? r(t) : t);
1
+ import { split as L, rotlSH as T, rotlSL as S, rotlBH as m, rotlBL as F } from "./index.web209.js";
2
+ import { createHasher as X, Hash as E, anumber as d, u32 as U, swap32IfBE as I, aexists as x, toBytes as P, abytes as k, aoutput as M, clean as y } from "./index.web188.js";
3
+ const R = BigInt(0), f = BigInt(1), j = BigInt(2), q = BigInt(7), v = BigInt(256), z = BigInt(113), _ = [], g = [], B = [];
4
+ for (let n = 0, t = f, s = 1, i = 0; n < 24; n++) {
5
+ [s, i] = [i, (2 * s + 3 * i) % 5], _.push(2 * (5 * i + s)), g.push((n + 1) * (n + 2) / 2 % 64);
6
+ let o = R;
7
+ for (let r = 0; r < 7; r++)
8
+ t = (t << f ^ (t >> q) * z) % v, t & j && (o ^= f << (f << /* @__PURE__ */ BigInt(r)) - f);
9
+ B.push(o);
6
10
  }
11
+ const A = L(B, !0), C = A[0], D = A[1], O = (n, t, s) => s > 32 ? m(n, t, s) : T(n, t, s), w = (n, t, s) => s > 32 ? F(n, t, s) : S(n, t, s);
12
+ function G(n, t = 24) {
13
+ const s = new Uint32Array(10);
14
+ for (let i = 24 - t; i < 24; i++) {
15
+ for (let e = 0; e < 10; e++)
16
+ s[e] = n[e] ^ n[e + 10] ^ n[e + 20] ^ n[e + 30] ^ n[e + 40];
17
+ for (let e = 0; e < 10; e += 2) {
18
+ const h = (e + 8) % 10, l = (e + 2) % 10, u = s[l], c = s[l + 1], b = O(u, c, 1) ^ s[h], H = w(u, c, 1) ^ s[h + 1];
19
+ for (let a = 0; a < 50; a += 10)
20
+ n[e + a] ^= b, n[e + a + 1] ^= H;
21
+ }
22
+ let o = n[2], r = n[3];
23
+ for (let e = 0; e < 24; e++) {
24
+ const h = g[e], l = O(o, r, h), u = w(o, r, h), c = _[e];
25
+ o = n[c], r = n[c + 1], n[c] = l, n[c + 1] = u;
26
+ }
27
+ for (let e = 0; e < 50; e += 10) {
28
+ for (let h = 0; h < 10; h++)
29
+ s[h] = n[e + h];
30
+ for (let h = 0; h < 10; h++)
31
+ n[e + h] ^= ~s[(h + 2) % 10] & s[(h + 4) % 10];
32
+ }
33
+ n[0] ^= C[i], n[1] ^= D[i];
34
+ }
35
+ y(s);
36
+ }
37
+ class p extends E {
38
+ // NOTE: we accept arguments in bytes instead of bits here.
39
+ constructor(t, s, i, o = !1, r = 24) {
40
+ if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = t, this.suffix = s, this.outputLen = i, this.enableXOF = o, this.rounds = r, d(i), !(0 < t && t < 200))
41
+ throw new Error("only keccak-f1600 function is supported");
42
+ this.state = new Uint8Array(200), this.state32 = U(this.state);
43
+ }
44
+ clone() {
45
+ return this._cloneInto();
46
+ }
47
+ keccak() {
48
+ I(this.state32), G(this.state32, this.rounds), I(this.state32), this.posOut = 0, this.pos = 0;
49
+ }
50
+ update(t) {
51
+ x(this), t = P(t), k(t);
52
+ const { blockLen: s, state: i } = this, o = t.length;
53
+ for (let r = 0; r < o; ) {
54
+ const e = Math.min(s - this.pos, o - r);
55
+ for (let h = 0; h < e; h++)
56
+ i[this.pos++] ^= t[r++];
57
+ this.pos === s && this.keccak();
58
+ }
59
+ return this;
60
+ }
61
+ finish() {
62
+ if (this.finished)
63
+ return;
64
+ this.finished = !0;
65
+ const { state: t, suffix: s, pos: i, blockLen: o } = this;
66
+ t[i] ^= s, (s & 128) !== 0 && i === o - 1 && this.keccak(), t[o - 1] ^= 128, this.keccak();
67
+ }
68
+ writeInto(t) {
69
+ x(this, !1), k(t), this.finish();
70
+ const s = this.state, { blockLen: i } = this;
71
+ for (let o = 0, r = t.length; o < r; ) {
72
+ this.posOut >= i && this.keccak();
73
+ const e = Math.min(i - this.posOut, r - o);
74
+ t.set(s.subarray(this.posOut, this.posOut + e), o), this.posOut += e, o += e;
75
+ }
76
+ return t;
77
+ }
78
+ xofInto(t) {
79
+ if (!this.enableXOF)
80
+ throw new Error("XOF is not possible for this instance");
81
+ return this.writeInto(t);
82
+ }
83
+ xof(t) {
84
+ return d(t), this.xofInto(new Uint8Array(t));
85
+ }
86
+ digestInto(t) {
87
+ if (M(t, this), this.finished)
88
+ throw new Error("digest() was already called");
89
+ return this.writeInto(t), this.destroy(), t;
90
+ }
91
+ digest() {
92
+ return this.digestInto(new Uint8Array(this.outputLen));
93
+ }
94
+ destroy() {
95
+ this.destroyed = !0, y(this.state);
96
+ }
97
+ _cloneInto(t) {
98
+ const { blockLen: s, suffix: i, outputLen: o, rounds: r, enableXOF: e } = this;
99
+ return t || (t = new p(s, i, o, e, r)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = r, t.suffix = i, t.outputLen = o, t.enableXOF = e, t.destroyed = this.destroyed, t;
100
+ }
101
+ }
102
+ const J = (n, t, s) => X(() => new p(t, n, s)), Q = J(1, 136, 256 / 8);
7
103
  export {
8
- p as sha256
104
+ p as Keccak,
105
+ G as keccakP,
106
+ Q as keccak_256
9
107
  };
@@ -1,5 +1,9 @@
1
- import { sha256 as s } from "./index.web165.js";
2
- const o = s;
1
+ import { sha256 as o } from "./index.web148.js";
2
+ import { isHex as s } from "./index.web135.js";
3
+ import { toBytes as r } from "./index.web131.js";
4
+ function p(t, i) {
5
+ return o(s(t, { strict: !1 }) ? r(t) : t);
6
+ }
3
7
  export {
4
- o as sha256
8
+ p as sha256
5
9
  };
@@ -1,17 +1,5 @@
1
- import { InvalidSerializableTransactionError as f } from "./index.web149.js";
2
- function d(e) {
3
- if (e.type)
4
- return e.type;
5
- if (typeof e.authorizationList < "u")
6
- return "eip7702";
7
- if (typeof e.blobs < "u" || typeof e.blobVersionedHashes < "u" || typeof e.maxFeePerBlobGas < "u" || typeof e.sidecars < "u")
8
- return "eip4844";
9
- if (typeof e.maxFeePerGas < "u" || typeof e.maxPriorityFeePerGas < "u")
10
- return "eip1559";
11
- if (typeof e.gasPrice < "u")
12
- return typeof e.accessList < "u" ? "eip2930" : "legacy";
13
- throw new f({ transaction: e });
14
- }
1
+ import { sha256 as s } from "./index.web186.js";
2
+ const o = s;
15
3
  export {
16
- d as getTransactionType
4
+ o as sha256
17
5
  };
@@ -1,37 +1,17 @@
1
- import { BaseError as t } from "./index.web141.js";
2
- function o(n) {
3
- const r = Object.entries(n).map(([a, e]) => e === void 0 || e === !1 ? null : [a, e]).filter(Boolean), i = r.reduce((a, [e]) => Math.max(a, e.length), 0);
4
- return r.map(([a, e]) => ` ${`${a}:`.padEnd(i + 1)} ${e}`).join(`
5
- `);
6
- }
7
- class c extends t {
8
- constructor({ transaction: r }) {
9
- super("Cannot infer a transaction type from provided transaction.", {
10
- metaMessages: [
11
- "Provided Transaction:",
12
- "{",
13
- o(r),
14
- "}",
15
- "",
16
- "To infer the type, either provide:",
17
- "- a `type` to the Transaction, or",
18
- "- an EIP-1559 Transaction with `maxFeePerGas`, or",
19
- "- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
20
- "- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
21
- "- an EIP-7702 Transaction with `authorizationList`, or",
22
- "- a Legacy Transaction with `gasPrice`"
23
- ],
24
- name: "InvalidSerializableTransactionError"
25
- });
26
- }
27
- }
28
- class d extends t {
29
- constructor({ storageKey: r }) {
30
- super(`Size for storage key "${r}" is invalid. Expected 32 bytes. Got ${Math.floor((r.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
31
- }
1
+ import { InvalidSerializableTransactionError as f } from "./index.web150.js";
2
+ function d(e) {
3
+ if (e.type)
4
+ return e.type;
5
+ if (typeof e.authorizationList < "u")
6
+ return "eip7702";
7
+ if (typeof e.blobs < "u" || typeof e.blobVersionedHashes < "u" || typeof e.maxFeePerBlobGas < "u" || typeof e.sidecars < "u")
8
+ return "eip4844";
9
+ if (typeof e.maxFeePerGas < "u" || typeof e.maxPriorityFeePerGas < "u")
10
+ return "eip1559";
11
+ if (typeof e.gasPrice < "u")
12
+ return typeof e.accessList < "u" ? "eip2930" : "legacy";
13
+ throw new f({ transaction: e });
32
14
  }
33
15
  export {
34
- c as InvalidSerializableTransactionError,
35
- d as InvalidStorageKeySizeError,
36
- o as prettyPrint
16
+ d as getTransactionType
37
17
  };
@@ -1,81 +1,37 @@
1
- import { versionedHashVersionKzg as c } from "./index.web151.js";
2
- import { maxUint256 as m } from "./index.web152.js";
3
- import { InvalidAddressError as s } from "./index.web116.js";
4
- import { BaseError as h } from "./index.web141.js";
5
- import { EmptyBlobError as P, InvalidVersionedHashSizeError as p, InvalidVersionedHashVersionError as x } from "./index.web153.js";
6
- import { InvalidChainIdError as n } from "./index.web154.js";
7
- import { FeeCapTooHighError as w, TipAboveFeeCapError as E } from "./index.web155.js";
8
- import { isAddress as f } from "./index.web117.js";
9
- import { size as F } from "./index.web137.js";
10
- import { slice as I } from "./index.web138.js";
11
- import { hexToNumber as G } from "./index.web143.js";
12
- function C(t) {
13
- const { authorizationList: e } = t;
14
- if (e)
15
- for (const o of e) {
16
- const { chainId: r } = o, i = o.address;
17
- if (!f(i))
18
- throw new s({ address: i });
19
- if (r < 0)
20
- throw new n({ chainId: r });
21
- }
22
- d(t);
1
+ import { BaseError as t } from "./index.web142.js";
2
+ function o(n) {
3
+ const r = Object.entries(n).map(([a, e]) => e === void 0 || e === !1 ? null : [a, e]).filter(Boolean), i = r.reduce((a, [e]) => Math.max(a, e.length), 0);
4
+ return r.map(([a, e]) => ` ${`${a}:`.padEnd(i + 1)} ${e}`).join(`
5
+ `);
23
6
  }
24
- function L(t) {
25
- const { blobVersionedHashes: e } = t;
26
- if (e) {
27
- if (e.length === 0)
28
- throw new P();
29
- for (const o of e) {
30
- const r = F(o), i = G(I(o, 0, 1));
31
- if (r !== 32)
32
- throw new p({ hash: o, size: r });
33
- if (i !== c)
34
- throw new x({
35
- hash: o,
36
- version: i
37
- });
38
- }
7
+ class c extends t {
8
+ constructor({ transaction: r }) {
9
+ super("Cannot infer a transaction type from provided transaction.", {
10
+ metaMessages: [
11
+ "Provided Transaction:",
12
+ "{",
13
+ o(r),
14
+ "}",
15
+ "",
16
+ "To infer the type, either provide:",
17
+ "- a `type` to the Transaction, or",
18
+ "- an EIP-1559 Transaction with `maxFeePerGas`, or",
19
+ "- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
20
+ "- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
21
+ "- an EIP-7702 Transaction with `authorizationList`, or",
22
+ "- a Legacy Transaction with `gasPrice`"
23
+ ],
24
+ name: "InvalidSerializableTransactionError"
25
+ });
39
26
  }
40
- d(t);
41
27
  }
42
- function d(t) {
43
- const { chainId: e, maxPriorityFeePerGas: o, maxFeePerGas: r, to: i } = t;
44
- if (e <= 0)
45
- throw new n({ chainId: e });
46
- if (i && !f(i))
47
- throw new s({ address: i });
48
- if (r && r > m)
49
- throw new w({ maxFeePerGas: r });
50
- if (o && r && o > r)
51
- throw new E({ maxFeePerGas: r, maxPriorityFeePerGas: o });
52
- }
53
- function B(t) {
54
- const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
55
- if (e <= 0)
56
- throw new n({ chainId: e });
57
- if (a && !f(a))
58
- throw new s({ address: a });
59
- if (o || i)
60
- throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");
61
- if (r && r > m)
62
- throw new w({ maxFeePerGas: r });
63
- }
64
- function K(t) {
65
- const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
66
- if (a && !f(a))
67
- throw new s({ address: a });
68
- if (typeof e < "u" && e <= 0)
69
- throw new n({ chainId: e });
70
- if (o || i)
71
- throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
72
- if (r && r > m)
73
- throw new w({ maxFeePerGas: r });
28
+ class d extends t {
29
+ constructor({ storageKey: r }) {
30
+ super(`Size for storage key "${r}" is invalid. Expected 32 bytes. Got ${Math.floor((r.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
31
+ }
74
32
  }
75
33
  export {
76
- d as assertTransactionEIP1559,
77
- B as assertTransactionEIP2930,
78
- L as assertTransactionEIP4844,
79
- C as assertTransactionEIP7702,
80
- K as assertTransactionLegacy
34
+ c as InvalidSerializableTransactionError,
35
+ d as InvalidStorageKeySizeError,
36
+ o as prettyPrint
81
37
  };