@gardenfi/utils 2.5.3-beta.1 → 2.5.3-beta.3

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 (431) hide show
  1. package/dist/index10.cjs +1 -1
  2. package/dist/index10.js +4 -4
  3. package/dist/index101.cjs +4 -1
  4. package/dist/index101.js +190 -8
  5. package/dist/index102.cjs +3 -1
  6. package/dist/index102.js +446 -13
  7. package/dist/index104.cjs +1 -1
  8. package/dist/index104.js +161 -21
  9. package/dist/index105.cjs +1 -1
  10. package/dist/index105.js +20 -50
  11. package/dist/index106.cjs +1 -1
  12. package/dist/index106.js +127 -11
  13. package/dist/index107.cjs +1 -1
  14. package/dist/index107.js +31 -154
  15. package/dist/index108.cjs +1 -1
  16. package/dist/index108.js +6 -21
  17. package/dist/index109.cjs +1 -1
  18. package/dist/index109.js +27 -127
  19. package/dist/index110.cjs +1 -1
  20. package/dist/index110.js +51 -34
  21. package/dist/index111.cjs +1 -1
  22. package/dist/index111.js +45 -6
  23. package/dist/index112.cjs +1 -1
  24. package/dist/index112.js +191 -27
  25. package/dist/index113.cjs +1 -1
  26. package/dist/index113.js +4 -56
  27. package/dist/index114.cjs +1 -1
  28. package/dist/index114.js +61 -42
  29. package/dist/index115.cjs +1 -1
  30. package/dist/index115.js +14 -185
  31. package/dist/index116.cjs +1 -1
  32. package/dist/index116.js +3 -4
  33. package/dist/index117.cjs +1 -1
  34. package/dist/index117.js +13 -61
  35. package/dist/index118.cjs +1 -1
  36. package/dist/index118.js +24 -3
  37. package/dist/index119.cjs +1 -1
  38. package/dist/index119.js +11 -20
  39. package/dist/index120.cjs +1 -1
  40. package/dist/index120.js +18 -16
  41. package/dist/index121.cjs +1 -1
  42. package/dist/index121.js +33 -22
  43. package/dist/index122.cjs +1 -1
  44. package/dist/index122.js +3 -12
  45. package/dist/index123.cjs +1 -1
  46. package/dist/index123.js +18 -18
  47. package/dist/index124.cjs +1 -1
  48. package/dist/index124.js +26 -33
  49. package/dist/index125.cjs +1 -1
  50. package/dist/index125.js +37 -3
  51. package/dist/index126.cjs +1 -1
  52. package/dist/index126.js +8 -18
  53. package/dist/index127.cjs +1 -1
  54. package/dist/index127.js +10 -27
  55. package/dist/index128.cjs +1 -1
  56. package/dist/index128.js +24 -35
  57. package/dist/index129.cjs +1 -1
  58. package/dist/index129.js +28 -8
  59. package/dist/index130.cjs +1 -1
  60. package/dist/index130.js +3 -10
  61. package/dist/index131.cjs +1 -1
  62. package/dist/index131.js +64 -24
  63. package/dist/index132.cjs +1 -1
  64. package/dist/index132.js +9 -28
  65. package/dist/index133.cjs +1 -1
  66. package/dist/index133.js +19 -63
  67. package/dist/index134.cjs +1 -1
  68. package/dist/index134.js +8 -9
  69. package/dist/index135.cjs +1 -1
  70. package/dist/index135.js +10 -23
  71. package/dist/index136.cjs +1 -1
  72. package/dist/index136.js +11 -24
  73. package/dist/index137.cjs +1 -1
  74. package/dist/index137.js +6 -24
  75. package/dist/index138.cjs +1 -1
  76. package/dist/index138.js +6 -3
  77. package/dist/index139.cjs +1 -1
  78. package/dist/index139.js +13 -14
  79. package/dist/index140.cjs +1 -1
  80. package/dist/index140.js +30 -101
  81. package/dist/index141.cjs +1 -1
  82. package/dist/index141.js +5 -81
  83. package/dist/index142.cjs +1 -1
  84. package/dist/index142.js +37 -5
  85. package/dist/index143.cjs +1 -1
  86. package/dist/index143.js +111 -6
  87. package/dist/index144.cjs +1 -1
  88. package/dist/index144.js +169 -25
  89. package/dist/index145.cjs +1 -1
  90. package/dist/index145.js +49 -26
  91. package/dist/index146.cjs +1 -1
  92. package/dist/index146.js +32 -13
  93. package/dist/index147.cjs +1 -1
  94. package/dist/index147.js +7 -42
  95. package/dist/index148.cjs +1 -1
  96. package/dist/index148.js +8 -19
  97. package/dist/index149.cjs +1 -1
  98. package/dist/index149.js +20 -78
  99. package/dist/index150.cjs +1 -1
  100. package/dist/index150.js +24 -2
  101. package/dist/index151.cjs +1 -1
  102. package/dist/index151.js +39 -34
  103. package/dist/index152.cjs +1 -1
  104. package/dist/index152.js +22 -111
  105. package/dist/index153.cjs +1 -1
  106. package/dist/index153.js +21 -166
  107. package/dist/index154.cjs +1 -1
  108. package/dist/index154.js +50 -48
  109. package/dist/index155.cjs +1 -1
  110. package/dist/index155.js +11 -32
  111. package/dist/index156.cjs +1 -1
  112. package/dist/index156.js +24 -8
  113. package/dist/index157.cjs +1 -1
  114. package/dist/index157.js +24 -6
  115. package/dist/index158.cjs +1 -1
  116. package/dist/index158.js +104 -6
  117. package/dist/index159.cjs +1 -1
  118. package/dist/index159.js +3 -12
  119. package/dist/index160.cjs +1 -1
  120. package/dist/index160.js +5 -10
  121. package/dist/index161.cjs +1 -1
  122. package/dist/index161.js +31 -13
  123. package/dist/index162.cjs +1 -1
  124. package/dist/index162.js +3 -32
  125. package/dist/index163.cjs +1 -1
  126. package/dist/index163.js +18 -5
  127. package/dist/index164.cjs +1 -1
  128. package/dist/index164.js +5 -7
  129. package/dist/index165.cjs +1 -1
  130. package/dist/index165.js +8 -8
  131. package/dist/index166.cjs +1 -1
  132. package/dist/index166.js +102 -19
  133. package/dist/index167.cjs +1 -1
  134. package/dist/index167.js +78 -29
  135. package/dist/index168.cjs +1 -1
  136. package/dist/index168.js +5 -3
  137. package/dist/index169.cjs +1 -1
  138. package/dist/index169.js +6 -17
  139. package/dist/index17.cjs +1 -1
  140. package/dist/index17.js +2 -2
  141. package/dist/index170.cjs +1 -1
  142. package/dist/index170.js +27 -10
  143. package/dist/index171.cjs +1 -1
  144. package/dist/index171.js +33 -20
  145. package/dist/index172.cjs +1 -1
  146. package/dist/index172.js +13 -22
  147. package/dist/index173.cjs +1 -1
  148. package/dist/index173.js +19 -5
  149. package/dist/index174.cjs +1 -1
  150. package/dist/index174.js +78 -5
  151. package/dist/index175.cjs +1 -1
  152. package/dist/index175.js +2 -9
  153. package/dist/index176.cjs +1 -1
  154. package/dist/index176.js +14 -104
  155. package/dist/index177.cjs +1 -1
  156. package/dist/index177.js +19 -3
  157. package/dist/index178.cjs +1 -1
  158. package/dist/index178.js +170 -17
  159. package/dist/index179.cjs +1 -1
  160. package/dist/index179.js +16 -170
  161. package/dist/index180.cjs +1 -1
  162. package/dist/index180.js +10 -17
  163. package/dist/index181.cjs +1 -1
  164. package/dist/index181.js +2 -2
  165. package/dist/index183.cjs +1 -1
  166. package/dist/index183.js +3 -3
  167. package/dist/index185.cjs +1 -1
  168. package/dist/index185.js +5 -5
  169. package/dist/index186.cjs +1 -1
  170. package/dist/index186.js +3 -3
  171. package/dist/index188.cjs +1 -1
  172. package/dist/index188.js +51 -74
  173. package/dist/index189.cjs +1 -1
  174. package/dist/index189.js +1 -1
  175. package/dist/index190.cjs +1 -1
  176. package/dist/index190.js +2 -2
  177. package/dist/index191.cjs +1 -1
  178. package/dist/index191.js +3 -3
  179. package/dist/index193.cjs +1 -1
  180. package/dist/index193.js +2 -2
  181. package/dist/index194.cjs +1 -1
  182. package/dist/index194.js +2 -2
  183. package/dist/index195.cjs +1 -1
  184. package/dist/index195.js +8 -8
  185. package/dist/index196.cjs +1 -1
  186. package/dist/index196.js +35 -8
  187. package/dist/index197.cjs +1 -1
  188. package/dist/index197.js +15 -34
  189. package/dist/index198.cjs +1 -1
  190. package/dist/index198.js +13 -15
  191. package/dist/index199.cjs +1 -1
  192. package/dist/index199.js +5 -13
  193. package/dist/index20.cjs +1 -1
  194. package/dist/index20.js +2 -2
  195. package/dist/index200.cjs +2 -1
  196. package/dist/index200.js +24 -13
  197. package/dist/index201.cjs +1 -2
  198. package/dist/index201.js +13 -24
  199. package/dist/index202.cjs +1 -1
  200. package/dist/index202.js +25 -6
  201. package/dist/index203.cjs +1 -1
  202. package/dist/index203.js +17 -24
  203. package/dist/index204.cjs +1 -1
  204. package/dist/index204.js +15 -18
  205. package/dist/index205.cjs +1 -1
  206. package/dist/index205.js +5 -15
  207. package/dist/index206.cjs +1 -1
  208. package/dist/index206.js +13 -5
  209. package/dist/index207.cjs +1 -1
  210. package/dist/index207.js +9 -12
  211. package/dist/index208.cjs +1 -1
  212. package/dist/index208.js +16 -10
  213. package/dist/index209.cjs +2 -1
  214. package/dist/index209.js +41 -16
  215. package/dist/index21.cjs +1 -1
  216. package/dist/index21.js +17 -4
  217. package/dist/index210.cjs +1 -2
  218. package/dist/index210.js +2 -42
  219. package/dist/index211.cjs +1 -1
  220. package/dist/index211.js +6 -2
  221. package/dist/index212.cjs +1 -1
  222. package/dist/index212.js +10 -5
  223. package/dist/index213.cjs +1 -1
  224. package/dist/index213.js +18 -9
  225. package/dist/index214.cjs +1 -1
  226. package/dist/index214.js +8 -19
  227. package/dist/index215.cjs +1 -1
  228. package/dist/index215.js +66 -8
  229. package/dist/index216.cjs +1 -1
  230. package/dist/index216.js +64 -65
  231. package/dist/index217.cjs +1 -1
  232. package/dist/index217.js +183 -60
  233. package/dist/index218.cjs +1 -1
  234. package/dist/index218.js +25 -183
  235. package/dist/index219.cjs +1 -1
  236. package/dist/index219.js +61 -13
  237. package/dist/index22.cjs +1 -1
  238. package/dist/index22.js +9 -9
  239. package/dist/index220.cjs +1 -1
  240. package/dist/index220.js +18 -54
  241. package/dist/index221.cjs +1 -1
  242. package/dist/index221.js +10 -34
  243. package/dist/index222.cjs +1 -1
  244. package/dist/index222.js +7 -10
  245. package/dist/index223.cjs +1 -1
  246. package/dist/index223.js +12 -13
  247. package/dist/index224.cjs +1 -1
  248. package/dist/index224.js +11 -12
  249. package/dist/index225.cjs +1 -1
  250. package/dist/index225.js +19 -11
  251. package/dist/index226.cjs +1 -1
  252. package/dist/index226.js +106 -101
  253. package/dist/index227.cjs +1 -1
  254. package/dist/index227.js +6 -6
  255. package/dist/index228.cjs +1 -1
  256. package/dist/index228.js +7 -245
  257. package/dist/index229.cjs +1 -1
  258. package/dist/index229.js +103 -6
  259. package/dist/index23.cjs +1 -1
  260. package/dist/index23.js +12 -26
  261. package/dist/index230.cjs +1 -1
  262. package/dist/index230.js +27 -7
  263. package/dist/index231.cjs +1 -1
  264. package/dist/index231.js +16 -26
  265. package/dist/index232.cjs +1 -1
  266. package/dist/index232.js +213 -18
  267. package/dist/index233.cjs +1 -1
  268. package/dist/index233.js +43 -143
  269. package/dist/index234.cjs +1 -1
  270. package/dist/index234.js +9 -24
  271. package/dist/index235.cjs +1 -1
  272. package/dist/index235.js +24 -46
  273. package/dist/index236.cjs +1 -1
  274. package/dist/index236.js +42 -9
  275. package/dist/index237.cjs +1 -1
  276. package/dist/index237.js +66 -30
  277. package/dist/index238.cjs +1 -1
  278. package/dist/index238.js +2 -79
  279. package/dist/index239.cjs +1 -1
  280. package/dist/index239.js +12 -2
  281. package/dist/index24.cjs +1 -1
  282. package/dist/index24.js +59 -8
  283. package/dist/index240.cjs +1 -1
  284. package/dist/index240.js +19 -11
  285. package/dist/index241.cjs +1 -1
  286. package/dist/index241.js +68 -19
  287. package/dist/index242.cjs +1 -1
  288. package/dist/index242.js +657 -68
  289. package/dist/index243.cjs +1 -1
  290. package/dist/index243.js +189 -771
  291. package/dist/index244.cjs +1 -1
  292. package/dist/index244.js +164 -135
  293. package/dist/index245.cjs +2 -1
  294. package/dist/index245.js +62 -196
  295. package/dist/index246.cjs +1 -2
  296. package/dist/index246.js +14 -66
  297. package/dist/index247.cjs +1 -1
  298. package/dist/index247.js +4 -14
  299. package/dist/index248.cjs +1 -1
  300. package/dist/index248.js +2 -5
  301. package/dist/index25.cjs +16 -1
  302. package/dist/index25.js +113 -12
  303. package/dist/index26.cjs +1 -1
  304. package/dist/index26.js +30 -58
  305. package/dist/index27.cjs +1 -16
  306. package/dist/index27.js +24 -111
  307. package/dist/index28.cjs +1 -1
  308. package/dist/index28.js +7 -29
  309. package/dist/index30.cjs +1 -1
  310. package/dist/index30.js +2 -2
  311. package/dist/index31.cjs +1 -1
  312. package/dist/index31.js +2 -2
  313. package/dist/index32.cjs +1 -1
  314. package/dist/index32.js +2 -2
  315. package/dist/index33.cjs +1 -1
  316. package/dist/index33.js +4 -4
  317. package/dist/index34.cjs +1 -1
  318. package/dist/index34.js +4 -4
  319. package/dist/index35.cjs +1 -1
  320. package/dist/index35.js +7 -7
  321. package/dist/index36.cjs +1 -1
  322. package/dist/index36.js +4 -4
  323. package/dist/index37.cjs +1 -1
  324. package/dist/index37.js +34 -33
  325. package/dist/index38.cjs +1 -1
  326. package/dist/index38.js +1 -1
  327. package/dist/index41.cjs +1 -1
  328. package/dist/index41.js +10 -10
  329. package/dist/index43.cjs +1 -1
  330. package/dist/index43.js +1 -1
  331. package/dist/index45.cjs +1 -1
  332. package/dist/index45.js +5 -5
  333. package/dist/index49.cjs +1 -1
  334. package/dist/index49.js +50 -68
  335. package/dist/index50.cjs +1 -1
  336. package/dist/index50.js +7 -9
  337. package/dist/index51.cjs +1 -1
  338. package/dist/index51.js +15 -27
  339. package/dist/index52.cjs +1 -1
  340. package/dist/index52.js +10 -71
  341. package/dist/index53.cjs +1 -1
  342. package/dist/index53.js +5 -19
  343. package/dist/index54.cjs +1 -1
  344. package/dist/index54.js +14 -50
  345. package/dist/index55.cjs +1 -1
  346. package/dist/index55.js +3 -7
  347. package/dist/index56.cjs +1 -1
  348. package/dist/index56.js +26 -16
  349. package/dist/index57.cjs +1 -1
  350. package/dist/index57.js +109 -10
  351. package/dist/index58.cjs +1 -1
  352. package/dist/index58.js +4 -5
  353. package/dist/index59.cjs +1 -1
  354. package/dist/index59.js +6 -14
  355. package/dist/index60.cjs +1 -1
  356. package/dist/index60.js +88 -3
  357. package/dist/index61.cjs +1 -1
  358. package/dist/index61.js +6 -26
  359. package/dist/index62.cjs +1 -1
  360. package/dist/index62.js +121 -105
  361. package/dist/index63.cjs +1 -1
  362. package/dist/index63.js +7 -4
  363. package/dist/index64.cjs +1 -1
  364. package/dist/index64.js +21 -6
  365. package/dist/index65.cjs +1 -1
  366. package/dist/index65.js +16 -87
  367. package/dist/index66.cjs +1 -1
  368. package/dist/index66.js +39 -5
  369. package/dist/index67.cjs +1 -1
  370. package/dist/index67.js +20 -124
  371. package/dist/index68.cjs +1 -1
  372. package/dist/index68.js +10 -6
  373. package/dist/index69.cjs +1 -1
  374. package/dist/index69.js +6 -21
  375. package/dist/index70.cjs +1 -1
  376. package/dist/index70.js +19 -17
  377. package/dist/index71.cjs +1 -1
  378. package/dist/index71.js +105 -39
  379. package/dist/index72.cjs +1 -1
  380. package/dist/index72.js +67 -20
  381. package/dist/index73.cjs +1 -1
  382. package/dist/index73.js +9 -11
  383. package/dist/index74.cjs +1 -1
  384. package/dist/index74.js +28 -6
  385. package/dist/index75.cjs +1 -1
  386. package/dist/index75.js +67 -102
  387. package/dist/index76.cjs +1 -1
  388. package/dist/index76.js +4 -3
  389. package/dist/index77.cjs +2 -1
  390. package/dist/index77.js +3 -9
  391. package/dist/index78.cjs +1 -2
  392. package/dist/index78.js +9 -3
  393. package/dist/index81.cjs +1 -1
  394. package/dist/index81.js +1 -1
  395. package/dist/index82.cjs +1 -1
  396. package/dist/index82.js +13 -2
  397. package/dist/index83.cjs +1 -1
  398. package/dist/index83.js +2 -8
  399. package/dist/index84.cjs +1 -3
  400. package/dist/index84.js +6 -214
  401. package/dist/index85.cjs +2 -1
  402. package/dist/index85.js +55 -32
  403. package/dist/index86.cjs +3 -1
  404. package/dist/index86.js +214 -20
  405. package/dist/index87.cjs +1 -1
  406. package/dist/index87.js +32 -6
  407. package/dist/index88.cjs +1 -1
  408. package/dist/index88.js +21 -73
  409. package/dist/index89.cjs +1 -1
  410. package/dist/index89.js +5 -5
  411. package/dist/index90.cjs +1 -1
  412. package/dist/index90.js +73 -5
  413. package/dist/index91.cjs +1 -9
  414. package/dist/index91.js +5 -35
  415. package/dist/index92.cjs +1 -3
  416. package/dist/index92.js +5 -95
  417. package/dist/index93.cjs +9 -1
  418. package/dist/index93.js +36 -3
  419. package/dist/index94.cjs +3 -1
  420. package/dist/index94.js +87 -15
  421. package/dist/index95.cjs +1 -3
  422. package/dist/index95.js +3 -452
  423. package/dist/index96.cjs +1 -2
  424. package/dist/index96.js +10 -46
  425. package/dist/index98.cjs +1 -1
  426. package/dist/index98.js +3 -3
  427. package/dist/index99.cjs +1 -4
  428. package/dist/index99.js +16 -187
  429. package/package.json +2 -2
  430. package/dist/index249.cjs +0 -1
  431. package/dist/index249.js +0 -4
package/dist/index154.js CHANGED
@@ -1,52 +1,54 @@
1
- import { stringify as i } from "./index44.js";
2
- import { BaseError as a } from "./index38.js";
3
- import { getUrl as n } from "./index93.js";
4
- class u extends a {
5
- constructor({ callbackSelector: r, cause: e, data: f, extraData: c, sender: d, urls: o }) {
6
- var t;
7
- super(e.shortMessage || "An error occurred while fetching for an offchain result.", {
8
- cause: e,
9
- metaMessages: [
10
- ...e.metaMessages || [],
11
- (t = e.metaMessages) != null && t.length ? "" : [],
12
- "Offchain Gateway Call:",
13
- o && [
14
- " Gateway URL(s):",
15
- ...o.map((m) => ` ${n(m)}`)
16
- ],
17
- ` Sender: ${d}`,
18
- ` Data: ${f}`,
19
- ` Callback selector: ${r}`,
20
- ` Extra data: ${c}`
21
- ].flat(),
22
- name: "OffchainLookupError"
23
- });
24
- }
25
- }
26
- class g extends a {
27
- constructor({ result: r, url: e }) {
28
- super("Offchain gateway response is malformed. Response data must be a hex value.", {
29
- metaMessages: [
30
- `Gateway URL: ${n(e)}`,
31
- `Response: ${i(r)}`
32
- ],
33
- name: "OffchainLookupResponseMalformedError"
34
- });
35
- }
1
+ import { hexToNumber as i } from "./index150.js";
2
+ const r = {
3
+ "0x0": "legacy",
4
+ "0x1": "eip2930",
5
+ "0x2": "eip1559",
6
+ "0x3": "eip4844",
7
+ "0x4": "eip7702"
8
+ };
9
+ function m(e) {
10
+ const d = {
11
+ ...e,
12
+ blockHash: e.blockHash ? e.blockHash : null,
13
+ blockNumber: e.blockNumber ? BigInt(e.blockNumber) : null,
14
+ chainId: e.chainId ? i(e.chainId) : void 0,
15
+ gas: e.gas ? BigInt(e.gas) : void 0,
16
+ gasPrice: e.gasPrice ? BigInt(e.gasPrice) : void 0,
17
+ maxFeePerBlobGas: e.maxFeePerBlobGas ? BigInt(e.maxFeePerBlobGas) : void 0,
18
+ maxFeePerGas: e.maxFeePerGas ? BigInt(e.maxFeePerGas) : void 0,
19
+ maxPriorityFeePerGas: e.maxPriorityFeePerGas ? BigInt(e.maxPriorityFeePerGas) : void 0,
20
+ nonce: e.nonce ? i(e.nonce) : void 0,
21
+ to: e.to ? e.to : null,
22
+ transactionIndex: e.transactionIndex ? Number(e.transactionIndex) : null,
23
+ type: e.type ? r[e.type] : void 0,
24
+ typeHex: e.type ? e.type : void 0,
25
+ value: e.value ? BigInt(e.value) : void 0,
26
+ v: e.v ? BigInt(e.v) : void 0
27
+ };
28
+ return e.authorizationList && (d.authorizationList = u(e.authorizationList)), d.yParity = (() => {
29
+ if (e.yParity)
30
+ return Number(e.yParity);
31
+ if (typeof d.v == "bigint") {
32
+ if (d.v === 0n || d.v === 27n)
33
+ return 0;
34
+ if (d.v === 1n || d.v === 28n)
35
+ return 1;
36
+ if (d.v >= 35n)
37
+ return d.v % 2n === 0n ? 1 : 0;
38
+ }
39
+ })(), d.type === "legacy" && (delete d.accessList, delete d.maxFeePerBlobGas, delete d.maxFeePerGas, delete d.maxPriorityFeePerGas, delete d.yParity), d.type === "eip2930" && (delete d.maxFeePerBlobGas, delete d.maxFeePerGas, delete d.maxPriorityFeePerGas), d.type === "eip1559" && delete d.maxFeePerBlobGas, d;
36
40
  }
37
- class M extends a {
38
- constructor({ sender: r, to: e }) {
39
- super("Reverted sender address does not match target contract address (`to`).", {
40
- metaMessages: [
41
- `Contract address: ${e}`,
42
- `OffchainLookup sender address: ${r}`
43
- ],
44
- name: "OffchainLookupSenderMismatchError"
45
- });
46
- }
41
+ function u(e) {
42
+ return e.map((d) => ({
43
+ address: d.address,
44
+ chainId: Number(d.chainId),
45
+ nonce: Number(d.nonce),
46
+ r: d.r,
47
+ s: d.s,
48
+ yParity: Number(d.yParity)
49
+ }));
47
50
  }
48
51
  export {
49
- u as OffchainLookupError,
50
- g as OffchainLookupResponseMalformedError,
51
- M as OffchainLookupSenderMismatchError
52
+ m as formatTransaction,
53
+ r as transactionType
52
54
  };
package/dist/index155.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index21.cjs"),y=require("./index85.cjs"),h=require("./index120.cjs"),n=require("./index127.cjs"),w=require("./index132.cjs"),u="x-batch-gateway:true";async function i(t){const{data:l,ccipRequest:o}=t,{args:[d]}=h.decodeFunctionData({abi:c.batchGatewayAbi,data:l}),a=[],s=[];return await Promise.all(d.map(async(r,e)=>{try{s[e]=r.urls.includes(u)?await i({data:r.data,ccipRequest:o}):await o(r),a[e]=!1}catch(b){a[e]=!0,s[e]=g(b)}})),w.encodeFunctionResult({abi:c.batchGatewayAbi,functionName:"query",result:[a,s]})}function g(t){return t.name==="HttpRequestError"&&t.status?n.encodeErrorResult({abi:c.batchGatewayAbi,errorName:"HttpError",args:[t.status,t.shortMessage]}):n.encodeErrorResult({abi:[y.solidityError],errorName:"Error",args:["shortMessage"in t?t.shortMessage:t.message]})}exports.localBatchGatewayRequest=i;exports.localBatchGatewayUrl=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(n,{args:a,eventName:t}={}){return{...n,blockHash:n.blockHash?n.blockHash:null,blockNumber:n.blockNumber?BigInt(n.blockNumber):null,logIndex:n.logIndex?Number(n.logIndex):null,transactionHash:n.transactionHash?n.transactionHash:null,transactionIndex:n.transactionIndex?Number(n.transactionIndex):null,...t?{args:a,eventName:t}:{}}}exports.formatLog=r;
package/dist/index155.js CHANGED
@@ -1,35 +1,14 @@
1
- import { batchGatewayAbi as o } from "./index21.js";
2
- import { solidityError as l } from "./index85.js";
3
- import { decodeFunctionData as f } from "./index120.js";
4
- import { encodeErrorResult as n } from "./index127.js";
5
- import { encodeFunctionResult as p } from "./index132.js";
6
- const d = "x-batch-gateway:true";
7
- async function g(t) {
8
- const { data: i, ccipRequest: c } = t, { args: [u] } = f({ abi: o, data: i }), e = [], s = [];
9
- return await Promise.all(u.map(async (r, a) => {
10
- try {
11
- s[a] = r.urls.includes(d) ? await g({ data: r.data, ccipRequest: c }) : await c(r), e[a] = !1;
12
- } catch (m) {
13
- e[a] = !0, s[a] = h(m);
14
- }
15
- })), p({
16
- abi: o,
17
- functionName: "query",
18
- result: [e, s]
19
- });
20
- }
21
- function h(t) {
22
- return t.name === "HttpRequestError" && t.status ? n({
23
- abi: o,
24
- errorName: "HttpError",
25
- args: [t.status, t.shortMessage]
26
- }) : n({
27
- abi: [l],
28
- errorName: "Error",
29
- args: ["shortMessage" in t ? t.shortMessage : t.message]
30
- });
1
+ function r(n, { args: t, eventName: a } = {}) {
2
+ return {
3
+ ...n,
4
+ blockHash: n.blockHash ? n.blockHash : null,
5
+ blockNumber: n.blockNumber ? BigInt(n.blockNumber) : null,
6
+ logIndex: n.logIndex ? Number(n.logIndex) : null,
7
+ transactionHash: n.transactionHash ? n.transactionHash : null,
8
+ transactionIndex: n.transactionIndex ? Number(n.transactionIndex) : null,
9
+ ...a ? { args: t, eventName: a } : {}
10
+ };
31
11
  }
32
12
  export {
33
- g as localBatchGatewayRequest,
34
- d as localBatchGatewayUrl
13
+ r as formatLog
35
14
  };
package/dist/index156.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index113.cjs"),l=require("./index114.cjs");function c(o){const{kzg:s}=o,n=o.to??(typeof o.blobs[0]=="string"?"hex":"bytes"),e=typeof o.blobs[0]=="string"?o.blobs.map(t=>i.hexToBytes(t)):o.blobs,b=[];for(const t of e)b.push(Uint8Array.from(s.blobToKzgCommitment(t)));return n==="bytes"?b:b.map(t=>l.bytesToHex(t))}exports.blobsToCommitments=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index150.cjs"),d=require("./index155.cjs"),r=require("./index154.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/index156.js CHANGED
@@ -1,11 +1,27 @@
1
- import { hexToBytes as i } from "./index113.js";
2
- import { bytesToHex as f } from "./index114.js";
3
- function y(o) {
4
- const { kzg: s } = o, n = o.to ?? (typeof o.blobs[0] == "string" ? "hex" : "bytes"), m = typeof o.blobs[0] == "string" ? o.blobs.map((t) => i(t)) : o.blobs, b = [];
5
- for (const t of m)
6
- b.push(Uint8Array.from(s.blobToKzgCommitment(t)));
7
- return n === "bytes" ? b : b.map((t) => f(t));
1
+ import { hexToNumber as b } from "./index150.js";
2
+ import { formatLog as d } from "./index155.js";
3
+ import { transactionType as m } from "./index154.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;
8
23
  }
9
24
  export {
10
- y as blobsToCommitments
25
+ r as formatTransactionReceipt,
26
+ f as receiptStatuses
11
27
  };
package/dist/index157.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index114.cjs"),r=require("./index158.cjs");function c(t){const{commitment:o,version:s=1}=t,n=t.to??(typeof o=="string"?"hex":"bytes"),e=r.sha256(o);return e.set([s],0),n==="bytes"?e:i.bytesToHex(e)}exports.commitmentToVersionedHash=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index111.cjs"),o={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function d(e){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=a(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(i=>f.bytesToHex(i)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=f.numberToHex(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=f.numberToHex(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=f.numberToHex(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=f.numberToHex(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=f.numberToHex(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=f.numberToHex(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=o[e.type]),typeof e.value<"u"&&(n.value=f.numberToHex(e.value)),n}function a(e){return e.map(n=>({address:n.address,r:n.r?f.numberToHex(BigInt(n.r)):n.r,s:n.s?f.numberToHex(BigInt(n.s)):n.s,chainId:f.numberToHex(n.chainId),nonce:f.numberToHex(n.nonce),...typeof n.yParity<"u"?{yParity:f.numberToHex(n.yParity)}:{},...typeof n.v<"u"&&typeof n.yParity>"u"?{v:f.numberToHex(n.v)}:{}}))}exports.formatTransactionRequest=d;exports.rpcTransactionType=o;
package/dist/index157.js CHANGED
@@ -1,9 +1,27 @@
1
- import { bytesToHex as i } from "./index114.js";
2
- import { sha256 as m } from "./index158.js";
3
- function f(t) {
4
- const { commitment: e, version: s = 1 } = t, n = t.to ?? (typeof e == "string" ? "hex" : "bytes"), o = m(e);
5
- return o.set([s], 0), n === "bytes" ? o : i(o);
1
+ import { bytesToHex as d, numberToHex as n } from "./index111.js";
2
+ const o = {
3
+ legacy: "0x0",
4
+ eip2930: "0x1",
5
+ eip1559: "0x2",
6
+ eip4844: "0x3",
7
+ eip7702: "0x4"
8
+ };
9
+ function p(e) {
10
+ const f = {};
11
+ return typeof e.authorizationList < "u" && (f.authorizationList = a(e.authorizationList)), typeof e.accessList < "u" && (f.accessList = e.accessList), typeof e.blobVersionedHashes < "u" && (f.blobVersionedHashes = e.blobVersionedHashes), typeof e.blobs < "u" && (typeof e.blobs[0] != "string" ? f.blobs = e.blobs.map((i) => d(i)) : f.blobs = e.blobs), typeof e.data < "u" && (f.data = e.data), typeof e.from < "u" && (f.from = e.from), typeof e.gas < "u" && (f.gas = n(e.gas)), typeof e.gasPrice < "u" && (f.gasPrice = n(e.gasPrice)), typeof e.maxFeePerBlobGas < "u" && (f.maxFeePerBlobGas = n(e.maxFeePerBlobGas)), typeof e.maxFeePerGas < "u" && (f.maxFeePerGas = n(e.maxFeePerGas)), typeof e.maxPriorityFeePerGas < "u" && (f.maxPriorityFeePerGas = n(e.maxPriorityFeePerGas)), typeof e.nonce < "u" && (f.nonce = n(e.nonce)), typeof e.to < "u" && (f.to = e.to), typeof e.type < "u" && (f.type = o[e.type]), typeof e.value < "u" && (f.value = n(e.value)), f;
12
+ }
13
+ function a(e) {
14
+ return e.map((f) => ({
15
+ address: f.address,
16
+ r: f.r ? n(BigInt(f.r)) : f.r,
17
+ s: f.s ? n(BigInt(f.s)) : f.s,
18
+ chainId: n(f.chainId),
19
+ nonce: n(f.nonce),
20
+ ...typeof f.yParity < "u" ? { yParity: n(f.yParity) } : {},
21
+ ...typeof f.v < "u" && typeof f.yParity > "u" ? { v: n(f.v) } : {}
22
+ }));
6
23
  }
7
24
  export {
8
- f as commitmentToVersionedHash
25
+ p as formatTransactionRequest,
26
+ o as rpcTransactionType
9
27
  };
package/dist/index158.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index177.cjs"),s=require("./index138.cjs"),r=require("./index113.cjs");function o(t,i){return e.sha256(s.isHex(t,{strict:!1})?r.toBytes(t):t)}exports.sha256=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index225.cjs"),c=require("./index226.cjs"),A=BigInt(0),u=BigInt(1),H=BigInt(2),L=BigInt(7),S=BigInt(256),T=BigInt(113),O=[],y=[],w=[];for(let n=0,t=u,s=1,i=0;n<24;n++){[s,i]=[i,(2*s+3*i)%5],O.push(2*(5*i+s)),y.push((n+1)*(n+2)/2%64);let o=A;for(let r=0;r<7;r++)t=(t<<u^(t>>L)*T)%S,t&H&&(o^=u<<(u<<BigInt(r))-u);w.push(o)}const _=f.split(w,!0),F=_[0],X=_[1],I=(n,t,s)=>s>32?f.rotlBH(n,t,s):f.rotlSH(n,t,s),x=(n,t,s)=>s>32?f.rotlBL(n,t,s):f.rotlSL(n,t,s);function b(n,t=24){const s=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let e=0;e<10;e++)s[e]=n[e]^n[e+10]^n[e+20]^n[e+30]^n[e+40];for(let e=0;e<10;e+=2){const h=(e+8)%10,l=(e+2)%10,p=s[l],a=s[l+1],g=I(p,a,1)^s[h],B=x(p,a,1)^s[h+1];for(let d=0;d<50;d+=10)n[e+d]^=g,n[e+d+1]^=B}let o=n[2],r=n[3];for(let e=0;e<24;e++){const h=y[e],l=I(o,r,h),p=x(o,r,h),a=O[e];o=n[a],r=n[a+1],n[a]=l,n[a+1]=p}for(let e=0;e<50;e+=10){for(let h=0;h<10;h++)s[h]=n[e+h];for(let h=0;h<10;h++)n[e+h]^=~s[(h+2)%10]&s[(h+4)%10]}n[0]^=F[i],n[1]^=X[i]}c.clean(s)}class k extends c.Hash{constructor(t,s,i,o=!1,r=24){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,c.anumber(i),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=c.u32(this.state)}clone(){return this._cloneInto()}keccak(){c.swap32IfBE(this.state32),b(this.state32,this.rounds),c.swap32IfBE(this.state32),this.posOut=0,this.pos=0}update(t){c.aexists(this),t=c.toBytes(t),c.abytes(t);const{blockLen:s,state:i}=this,o=t.length;for(let r=0;r<o;){const e=Math.min(s-this.pos,o-r);for(let h=0;h<e;h++)i[this.pos++]^=t[r++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:s,pos:i,blockLen:o}=this;t[i]^=s,s&128&&i===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){c.aexists(this,!1),c.abytes(t),this.finish();const s=this.state,{blockLen:i}=this;for(let o=0,r=t.length;o<r;){this.posOut>=i&&this.keccak();const e=Math.min(i-this.posOut,r-o);t.set(s.subarray(this.posOut,this.posOut+e),o),this.posOut+=e,o+=e}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return c.anumber(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(c.aoutput(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,c.clean(this.state)}_cloneInto(t){const{blockLen:s,suffix:i,outputLen:o,rounds:r,enableXOF:e}=this;return t||(t=new k(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}}const m=(n,t,s)=>c.createHasher(()=>new k(t,n,s)),E=m(1,136,256/8);exports.Keccak=k;exports.keccakP=b;exports.keccak_256=E;
package/dist/index158.js CHANGED
@@ -1,9 +1,107 @@
1
- import { sha256 as o } from "./index177.js";
2
- import { isHex as s } from "./index138.js";
3
- import { toBytes as r } from "./index113.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 "./index225.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 "./index226.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 && 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
  };
package/dist/index159.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index157.cjs");function c(o){const{commitments:e,version:s}=o,n=o.to??(typeof e[0]=="string"?"hex":"bytes"),t=[];for(const m of e)t.push(i.commitmentToVersionedHash({commitment:m,to:n,version:s}));return t}exports.commitmentsToVersionedHashes=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index229.cjs"),s=e.sha256;exports.sha256=s;
package/dist/index159.js CHANGED
@@ -1,14 +1,5 @@
1
- import { commitmentToVersionedHash as i } from "./index157.js";
2
- function r(o) {
3
- const { commitments: t, version: n } = o, e = o.to ?? (typeof t[0] == "string" ? "hex" : "bytes"), s = [];
4
- for (const m of t)
5
- s.push(i({
6
- commitment: m,
7
- to: e,
8
- version: n
9
- }));
10
- return s;
11
- }
1
+ import { sha256 as s } from "./index229.js";
2
+ const o = s;
12
3
  export {
13
- r as commitmentsToVersionedHashes
4
+ o as sha256
14
5
  };
package/dist/index160.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index113.cjs"),y=require("./index114.cjs");function f(t){const{kzg:c}=t,e=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(o=>b.hexToBytes(o)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(o=>b.hexToBytes(o)):t.commitments,s=[];for(let o=0;o<n.length;o++){const l=n[o],m=i[o];s.push(Uint8Array.from(c.computeBlobKzgProof(l,m)))}return e==="bytes"?s:s.map(o=>y.bytesToHex(o))}exports.blobsToProofs=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index227.cjs"),r=require("./index228.cjs");function n(t){return e.hashSignature(r.toSignature(t))}exports.toSignatureHash=n;
package/dist/index160.js CHANGED
@@ -1,13 +1,8 @@
1
- import { hexToBytes as b } from "./index113.js";
2
- import { bytesToHex as y } from "./index114.js";
3
- function h(t) {
4
- const { kzg: m } = t, c = t.to ?? (typeof t.blobs[0] == "string" ? "hex" : "bytes"), s = typeof t.blobs[0] == "string" ? t.blobs.map((o) => b(o)) : t.blobs, i = typeof t.commitments[0] == "string" ? t.commitments.map((o) => b(o)) : t.commitments, n = [];
5
- for (let o = 0; o < s.length; o++) {
6
- const f = s[o], l = i[o];
7
- n.push(Uint8Array.from(m.computeBlobKzgProof(f, l)));
8
- }
9
- return c === "bytes" ? n : n.map((o) => y(o));
1
+ import { hashSignature as t } from "./index227.js";
2
+ import { toSignature as o } from "./index228.js";
3
+ function a(r) {
4
+ return t(o(r));
10
5
  }
11
6
  export {
12
- h as blobsToProofs
7
+ a as toSignatureHash
13
8
  };
package/dist/index161.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index156.cjs"),m=require("./index160.cjs"),u=require("./index162.cjs");function f(t){const{data:i,kzg:n,to:b}=t,s=t.blobs??u.toBlobs({data:i,to:b}),e=t.commitments??r.blobsToCommitments({blobs:s,kzg:n,to:b}),l=t.proofs??m.blobsToProofs({blobs:s,commitments:e,kzg:n,to:b}),c=[];for(let o=0;o<s.length;o++)c.push({blob:s[o],commitment:e[o],proof:l[o]});return c}exports.toBlobSidecars=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=new Map,i=new Map;function p(o){const a=(s,t)=>({clear:()=>t.delete(s),get:()=>t.get(s),set:n=>t.set(s,n)}),r=a(o,c),e=a(o,i);return{clear:()=>{r.clear(),e.clear()},promise:r,response:e}}async function l(o,{cacheKey:a,cacheTime:r=Number.POSITIVE_INFINITY}){const e=p(a),s=e.response.get();if(s&&r>0&&Date.now()-s.created.getTime()<r)return s.data;let t=e.promise.get();t||(t=o(),e.promise.set(t));try{const n=await t;return e.response.set({created:new Date,data:n}),n}finally{e.promise.clear()}}exports.getCache=p;exports.promiseCache=c;exports.responseCache=i;exports.withCache=l;
package/dist/index161.js CHANGED
@@ -1,16 +1,34 @@
1
- import { blobsToCommitments as f } from "./index156.js";
2
- import { blobsToProofs as l } from "./index160.js";
3
- import { toBlobs as p } from "./index162.js";
4
- function k(t) {
5
- const { data: i, kzg: n, to: m } = t, s = t.blobs ?? p({ data: i, to: m }), b = t.commitments ?? f({ blobs: s, kzg: n, to: m }), r = t.proofs ?? l({ blobs: s, commitments: b, kzg: n, to: m }), c = [];
6
- for (let o = 0; o < s.length; o++)
7
- c.push({
8
- blob: s[o],
9
- commitment: b[o],
10
- proof: r[o]
11
- });
12
- return c;
1
+ const i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
2
+ function p(o) {
3
+ const a = (s, t) => ({
4
+ clear: () => t.delete(s),
5
+ get: () => t.get(s),
6
+ set: (r) => t.set(s, r)
7
+ }), n = a(o, i), e = a(o, c);
8
+ return {
9
+ clear: () => {
10
+ n.clear(), e.clear();
11
+ },
12
+ promise: n,
13
+ response: e
14
+ };
15
+ }
16
+ async function l(o, { cacheKey: a, cacheTime: n = Number.POSITIVE_INFINITY }) {
17
+ const e = p(a), s = e.response.get();
18
+ if (s && n > 0 && Date.now() - s.created.getTime() < n)
19
+ return s.data;
20
+ let t = e.promise.get();
21
+ t || (t = o(), e.promise.set(t));
22
+ try {
23
+ const r = await t;
24
+ return e.response.set({ created: /* @__PURE__ */ new Date(), data: r }), r;
25
+ } finally {
26
+ e.promise.clear();
27
+ }
13
28
  }
14
29
  export {
15
- k as toBlobSidecars
30
+ p as getCache,
31
+ i as promiseCache,
32
+ c as responseCache,
33
+ l as withCache
16
34
  };
package/dist/index162.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index163.cjs"),y=require("./index151.cjs"),u=require("./index109.cjs"),B=require("./index81.cjs"),h=require("./index113.cjs"),d=require("./index114.cjs");function f(t){const a=t.to??(typeof t.data=="string"?"hex":"bytes"),n=typeof t.data=="string"?h.hexToBytes(t.data):t.data,s=B.size(n);if(!s)throw new y.EmptyBlobError;if(s>o.maxBytesPerTransaction)throw new y.BlobSizeTooLargeError({maxSize:o.maxBytesPerTransaction,size:s});const r=[];let b=!0,i=0;for(;b;){const e=u.createCursor(new Uint8Array(o.bytesPerBlob));let l=0;for(;l<o.fieldElementsPerBlob;){const c=n.slice(i,i+(o.bytesPerFieldElement-1));if(e.pushByte(0),e.pushBytes(c),c.length<31){e.pushByte(128),b=!1;break}l++,i+=31}r.push(e)}return a==="bytes"?r.map(e=>e.bytes):r.map(e=>d.bytesToHex(e.bytes))}exports.toBlobs=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function i(e){return new Promise(t=>setTimeout(t,e))}exports.wait=i;
package/dist/index162.js CHANGED
@@ -1,35 +1,6 @@
1
- import { maxBytesPerTransaction as y, fieldElementsPerBlob as a, bytesPerFieldElement as f, bytesPerBlob as p } from "./index163.js";
2
- import { EmptyBlobError as c, BlobSizeTooLargeError as h } from "./index151.js";
3
- import { createCursor as B } from "./index109.js";
4
- import { size as u } from "./index81.js";
5
- import { hexToBytes as x } from "./index113.js";
6
- import { bytesToHex as d } from "./index114.js";
7
- function S(e) {
8
- const m = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), i = typeof e.data == "string" ? x(e.data) : e.data, o = u(i);
9
- if (!o)
10
- throw new c();
11
- if (o > y)
12
- throw new h({
13
- maxSize: y,
14
- size: o
15
- });
16
- const s = [];
17
- let n = !0, r = 0;
18
- for (; n; ) {
19
- const t = B(new Uint8Array(p));
20
- let l = 0;
21
- for (; l < a; ) {
22
- const b = i.slice(r, r + (f - 1));
23
- if (t.pushByte(0), t.pushBytes(b), b.length < 31) {
24
- t.pushByte(128), n = !1;
25
- break;
26
- }
27
- l++, r += 31;
28
- }
29
- s.push(t);
30
- }
31
- return m === "bytes" ? s.map((t) => t.bytes) : s.map((t) => d(t.bytes));
1
+ async function n(e) {
2
+ return new Promise((t) => setTimeout(t, e));
32
3
  }
33
4
  export {
34
- S as toBlobs
5
+ n as wait
35
6
  };
package/dist/index163.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=6,s=32,e=4096,n=s*e,o=n*t-1-1*e*t;exports.bytesPerBlob=n;exports.bytesPerFieldElement=s;exports.fieldElementsPerBlob=e;exports.maxBytesPerTransaction=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function u(n,{errorInstance:r=new Error("timed out"),timeout:i,signal:a}){return new Promise((l,e)=>{(async()=>{let o;try{const t=new AbortController;i>0&&(o=setTimeout(()=>{a&&t.abort()},i)),l(await n({signal:(t==null?void 0:t.signal)||null}))}catch(t){(t==null?void 0:t.name)==="AbortError"&&e(r),e(t)}finally{clearTimeout(o)}})()})}exports.withTimeout=u;
package/dist/index163.js CHANGED
@@ -1,7 +1,20 @@
1
- const e = 32, s = 4096, t = 131072, l = 761855;
1
+ function u(r, { errorInstance: e = new Error("timed out"), timeout: i, signal: a }) {
2
+ return new Promise((l, n) => {
3
+ (async () => {
4
+ let o;
5
+ try {
6
+ const t = new AbortController();
7
+ i > 0 && (o = setTimeout(() => {
8
+ a && t.abort();
9
+ }, i)), l(await r({ signal: (t == null ? void 0 : t.signal) || null }));
10
+ } catch (t) {
11
+ (t == null ? void 0 : t.name) === "AbortError" && n(e), n(t);
12
+ } finally {
13
+ clearTimeout(o);
14
+ }
15
+ })();
16
+ });
17
+ }
2
18
  export {
3
- t as bytesPerBlob,
4
- e as bytesPerFieldElement,
5
- s as fieldElementsPerBlob,
6
- l as maxBytesPerTransaction
19
+ u as withTimeout
7
20
  };
package/dist/index164.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index96.cjs");function i({chain:r,currentChainId:t}){if(!r)throw new e.ChainNotFoundError;if(t!==r.id)throw new e.ChainMismatchError({chain:r,currentChainId:t})}exports.assertCurrentChain=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index126.cjs"),t=require("./index165.cjs");function a(e,s){return r.keccak256(t.toPrefixedMessage(e),s)}exports.hashMessage=a;
package/dist/index164.js CHANGED
@@ -1,10 +1,8 @@
1
- import { ChainNotFoundError as t, ChainMismatchError as i } from "./index96.js";
2
- function e({ chain: r, currentChainId: o }) {
3
- if (!r)
4
- throw new t();
5
- if (o !== r.id)
6
- throw new i({ chain: r, currentChainId: o });
1
+ import { keccak256 as o } from "./index126.js";
2
+ import { toPrefixedMessage as t } from "./index165.js";
3
+ function f(e, r) {
4
+ return o(t(e), r);
7
5
  }
8
6
  export {
9
- e as assertCurrentChain
7
+ f as hashMessage
10
8
  };
package/dist/index165.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}exports.defineChain=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index77.cjs"),o=require("./index120.cjs"),s=require("./index81.cjs"),r=require("./index111.cjs");function c(e){const t=typeof e=="string"?r.stringToHex(e):typeof e.raw=="string"?e.raw:r.bytesToHex(e.raw),i=r.stringToHex(`${n.presignMessagePrefix}${s.size(t)}`);return o.concat([i,t])}exports.toPrefixedMessage=c;
package/dist/index165.js CHANGED
@@ -1,11 +1,11 @@
1
- function n(e) {
2
- return {
3
- formatters: void 0,
4
- fees: void 0,
5
- serializers: void 0,
6
- ...e
7
- };
1
+ import { presignMessagePrefix as e } from "./index77.js";
2
+ import { concat as n } from "./index120.js";
3
+ import { size as f } from "./index81.js";
4
+ import { stringToHex as o, bytesToHex as p } from "./index111.js";
5
+ function u(r) {
6
+ const t = typeof r == "string" ? o(r) : typeof r.raw == "string" ? r.raw : p(r.raw), i = o(`${e}${f(t)}`);
7
+ return n([i, t]);
8
8
  }
9
9
  export {
10
- n as defineChain
10
+ u as toPrefixedMessage
11
11
  };
package/dist/index166.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index96.cjs");function a({blockNumber:r,chain:t,contract:e}){var c;const o=(c=t==null?void 0:t.contracts)==null?void 0:c[e];if(!o)throw new n.ChainDoesNotSupportContract({chain:t,contract:{name:e}});if(r&&o.blockCreated&&o.blockCreated>r)throw new n.ChainDoesNotSupportContract({blockNumber:r,chain:t,contract:{name:e,blockCreated:o.blockCreated}});return o.address}exports.getChainContractAddress=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index112.cjs"),D=require("./index120.cjs"),f=require("./index111.cjs"),s=require("./index126.cjs"),p=require("./index167.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;