@gardenfi/utils 3.1.1-beta.14 → 3.1.1-beta.16

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 (471) hide show
  1. package/dist/index10.cjs +1 -1
  2. package/dist/index10.js +4 -4
  3. package/dist/index100.cjs +1 -1
  4. package/dist/index100.js +123 -26
  5. package/dist/index101.cjs +1 -1
  6. package/dist/index101.js +5 -90
  7. package/dist/index102.cjs +1 -1
  8. package/dist/index102.js +22 -4
  9. package/dist/index103.cjs +1 -2
  10. package/dist/index103.js +46 -3
  11. package/dist/index104.cjs +1 -1
  12. package/dist/index104.js +39 -9
  13. package/dist/index105.cjs +1 -20
  14. package/dist/index105.js +6 -326
  15. package/dist/index106.cjs +1 -1
  16. package/dist/index106.js +90 -13
  17. package/dist/index107.cjs +1 -1
  18. package/dist/index107.js +14 -4
  19. package/dist/index108.cjs +1 -1
  20. package/dist/index108.js +4 -2
  21. package/dist/index109.cjs +1 -1
  22. package/dist/index109.js +26 -7
  23. package/dist/index110.cjs +2 -2
  24. package/dist/index110.js +16 -46
  25. package/dist/index111.cjs +1 -3
  26. package/dist/index111.js +9 -215
  27. package/dist/index112.cjs +1 -1
  28. package/dist/index112.js +9 -32
  29. package/dist/index113.cjs +1 -1
  30. package/dist/index113.js +10 -21
  31. package/dist/index114.cjs +1 -1
  32. package/dist/index114.js +11 -5
  33. package/dist/index115.cjs +1 -1
  34. package/dist/index115.js +13 -73
  35. package/dist/index116.cjs +1 -1
  36. package/dist/index116.js +21 -5
  37. package/dist/index117.cjs +1 -1
  38. package/dist/index117.js +14 -5
  39. package/dist/index118.cjs +1 -9
  40. package/dist/index118.js +4 -35
  41. package/dist/index119.cjs +1 -2
  42. package/dist/index119.js +6 -120
  43. package/dist/index120.cjs +1 -1
  44. package/dist/index120.js +19 -3
  45. package/dist/index121.cjs +1 -1
  46. package/dist/index121.js +10 -18
  47. package/dist/index122.cjs +1 -1
  48. package/dist/index122.js +55 -17
  49. package/dist/index123.cjs +1 -1
  50. package/dist/index123.js +6 -35
  51. package/dist/index124.cjs +1 -1
  52. package/dist/index124.js +13 -23
  53. package/dist/index125.cjs +1 -1
  54. package/dist/index125.js +7 -8
  55. package/dist/index126.cjs +1 -4
  56. package/dist/index126.js +132 -188
  57. package/dist/index127.cjs +1 -3
  58. package/dist/index127.js +7 -451
  59. package/dist/index128.cjs +1 -1
  60. package/dist/index128.js +19 -25
  61. package/dist/index129.cjs +1 -1
  62. package/dist/index129.js +16 -160
  63. package/dist/index130.cjs +1 -1
  64. package/dist/index130.js +43 -127
  65. package/dist/index131.cjs +1 -1
  66. package/dist/index131.js +20 -37
  67. package/dist/index132.cjs +1 -1
  68. package/dist/index132.js +80 -6
  69. package/dist/index133.cjs +1 -1
  70. package/dist/index133.js +11 -27
  71. package/dist/index134.cjs +1 -1
  72. package/dist/index134.js +12 -190
  73. package/dist/index135.cjs +1 -1
  74. package/dist/index135.js +7 -4
  75. package/dist/index136.cjs +1 -1
  76. package/dist/index136.js +39 -71
  77. package/dist/index137.cjs +1 -1
  78. package/dist/index137.js +5 -20
  79. package/dist/index138.cjs +1 -1
  80. package/dist/index138.js +34 -3
  81. package/dist/index139.cjs +1 -1
  82. package/dist/index139.js +9 -16
  83. package/dist/index140.cjs +1 -1
  84. package/dist/index140.js +60 -23
  85. package/dist/index141.cjs +1 -1
  86. package/dist/index141.js +19 -18
  87. package/dist/index142.cjs +1 -1
  88. package/dist/index142.js +105 -33
  89. package/dist/index143.cjs +1 -1
  90. package/dist/index143.js +79 -3
  91. package/dist/index144.cjs +1 -1
  92. package/dist/index144.js +9 -18
  93. package/dist/index145.cjs +1 -1
  94. package/dist/index145.js +89 -26
  95. package/dist/index146.cjs +2 -1
  96. package/dist/index146.js +3 -37
  97. package/dist/index147.cjs +1 -1
  98. package/dist/index147.js +9 -11
  99. package/dist/index148.cjs +1 -1
  100. package/dist/index148.js +13 -25
  101. package/dist/index149.cjs +1 -1
  102. package/dist/index149.js +4 -28
  103. package/dist/index150.cjs +1 -1
  104. package/dist/index150.js +11 -74
  105. package/dist/index151.cjs +1 -1
  106. package/dist/index151.js +2 -10
  107. package/dist/index152.cjs +1 -1
  108. package/dist/index152.js +31 -21
  109. package/dist/index153.cjs +1 -1
  110. package/dist/index153.js +21 -8
  111. package/dist/index154.cjs +1 -1
  112. package/dist/index154.js +5 -10
  113. package/dist/index155.cjs +1 -1
  114. package/dist/index155.js +5 -11
  115. package/dist/index156.cjs +1 -1
  116. package/dist/index156.js +5 -6
  117. package/dist/index157.cjs +9 -1
  118. package/dist/index157.js +35 -6
  119. package/dist/index158.cjs +1 -1
  120. package/dist/index158.js +3 -14
  121. package/dist/index159.cjs +1 -1
  122. package/dist/index159.js +17 -31
  123. package/dist/index160.cjs +1 -1
  124. package/dist/index160.js +21 -5
  125. package/dist/index161.cjs +1 -1
  126. package/dist/index161.js +32 -34
  127. package/dist/index162.cjs +1 -1
  128. package/dist/index162.js +6 -109
  129. package/dist/index163.cjs +4 -1
  130. package/dist/index163.js +186 -163
  131. package/dist/index164.cjs +1 -1
  132. package/dist/index164.js +19 -41
  133. package/dist/index165.cjs +1 -1
  134. package/dist/index165.js +158 -29
  135. package/dist/index166.cjs +1 -1
  136. package/dist/index166.js +127 -7
  137. package/dist/index167.cjs +1 -1
  138. package/dist/index167.js +27 -17
  139. package/dist/index168.cjs +1 -1
  140. package/dist/index168.js +55 -20
  141. package/dist/index169.cjs +1 -1
  142. package/dist/index169.js +185 -36
  143. package/dist/index17.cjs +1 -1
  144. package/dist/index17.js +2 -2
  145. package/dist/index170.cjs +1 -1
  146. package/dist/index170.js +4 -23
  147. package/dist/index171.cjs +1 -1
  148. package/dist/index171.js +20 -21
  149. package/dist/index172.cjs +1 -1
  150. package/dist/index172.js +3 -52
  151. package/dist/index173.cjs +1 -1
  152. package/dist/index173.js +14 -10
  153. package/dist/index174.cjs +1 -1
  154. package/dist/index174.js +11 -24
  155. package/dist/index175.cjs +1 -1
  156. package/dist/index175.js +33 -23
  157. package/dist/index176.cjs +1 -1
  158. package/dist/index176.js +3 -105
  159. package/dist/index177.cjs +1 -1
  160. package/dist/index177.js +28 -3
  161. package/dist/index178.cjs +1 -1
  162. package/dist/index178.js +8 -5
  163. package/dist/index179.cjs +1 -1
  164. package/dist/index179.js +23 -29
  165. package/dist/index18.cjs +1 -1
  166. package/dist/index18.js +7 -7
  167. package/dist/index180.cjs +1 -1
  168. package/dist/index180.js +28 -3
  169. package/dist/index181.cjs +1 -1
  170. package/dist/index181.js +3 -17
  171. package/dist/index182.cjs +1 -1
  172. package/dist/index182.js +6 -8
  173. package/dist/index183.cjs +1 -1
  174. package/dist/index183.js +6 -80
  175. package/dist/index184.cjs +1 -1
  176. package/dist/index184.js +32 -5
  177. package/dist/index185.cjs +1 -1
  178. package/dist/index185.js +5 -28
  179. package/dist/index186.cjs +1 -1
  180. package/dist/index186.js +37 -16
  181. package/dist/index187.cjs +1 -1
  182. package/dist/index187.js +46 -75
  183. package/dist/index188.cjs +1 -1
  184. package/dist/index188.js +33 -2
  185. package/dist/index189.cjs +1 -1
  186. package/dist/index189.js +17 -14
  187. package/dist/index190.cjs +1 -1
  188. package/dist/index190.js +42 -18
  189. package/dist/index191.cjs +1 -1
  190. package/dist/index191.js +104 -17
  191. package/dist/index192.cjs +1 -1
  192. package/dist/index192.js +3 -11
  193. package/dist/index193.cjs +1 -1
  194. package/dist/index193.js +5 -30
  195. package/dist/index194.cjs +1 -1
  196. package/dist/index194.js +4 -2
  197. package/dist/index195.cjs +1 -1
  198. package/dist/index195.js +16 -12
  199. package/dist/index196.cjs +1 -1
  200. package/dist/index196.js +5 -12
  201. package/dist/index197.cjs +1 -1
  202. package/dist/index197.js +8 -47
  203. package/dist/index198.cjs +1 -1
  204. package/dist/index198.js +102 -10
  205. package/dist/index199.cjs +1 -1
  206. package/dist/index199.js +5 -7
  207. package/dist/index20.cjs +1 -1
  208. package/dist/index20.js +2 -2
  209. package/dist/index200.cjs +1 -1
  210. package/dist/index200.js +6 -70
  211. package/dist/index201.cjs +1 -1
  212. package/dist/index201.js +27 -46
  213. package/dist/index202.cjs +1 -1
  214. package/dist/index202.js +33 -36
  215. package/dist/index203.cjs +1 -1
  216. package/dist/index203.js +13 -17
  217. package/dist/index204.cjs +1 -1
  218. package/dist/index204.js +78 -6
  219. package/dist/index205.cjs +1 -1
  220. package/dist/index205.js +2 -10
  221. package/dist/index206.cjs +1 -1
  222. package/dist/index206.js +18 -13
  223. package/dist/index207.cjs +1 -1
  224. package/dist/index207.js +171 -13
  225. package/dist/index208.cjs +1 -1
  226. package/dist/index208.js +17 -8
  227. package/dist/index209.cjs +1 -1
  228. package/dist/index209.js +10 -35
  229. package/dist/index210.cjs +1 -1
  230. package/dist/index210.js +25 -16
  231. package/dist/index211.cjs +1 -1
  232. package/dist/index211.js +18 -29
  233. package/dist/index212.cjs +1 -1
  234. package/dist/index212.js +14 -13
  235. package/dist/index213.cjs +1 -1
  236. package/dist/index213.js +5 -6
  237. package/dist/index214.cjs +1 -1
  238. package/dist/index214.js +13 -103
  239. package/dist/index215.cjs +1 -1
  240. package/dist/index215.js +10 -75
  241. package/dist/index216.cjs +1 -2
  242. package/dist/index216.js +16 -24
  243. package/dist/index217.cjs +1 -1
  244. package/dist/index217.js +24 -103
  245. package/dist/index218.cjs +1 -1
  246. package/dist/index218.js +45 -15
  247. package/dist/index219.cjs +1 -1
  248. package/dist/index219.js +8 -213
  249. package/dist/index22.cjs +1 -1
  250. package/dist/index22.js +9 -9
  251. package/dist/index220.cjs +2 -1
  252. package/dist/index220.js +40 -107
  253. package/dist/index221.cjs +1 -1
  254. package/dist/index221.js +2 -207
  255. package/dist/index222.cjs +1 -1
  256. package/dist/index222.js +5 -42
  257. package/dist/index223.cjs +1 -1
  258. package/dist/index223.js +9 -77
  259. package/dist/index224.cjs +1 -1
  260. package/dist/index224.js +20 -2
  261. package/dist/index225.cjs +1 -2
  262. package/dist/index225.js +8 -41
  263. package/dist/index226.cjs +1 -1
  264. package/dist/index226.js +67 -2
  265. package/dist/index227.cjs +1 -1
  266. package/dist/index227.js +65 -5
  267. package/dist/index228.cjs +1 -1
  268. package/dist/index228.js +187 -9
  269. package/dist/index229.cjs +1 -1
  270. package/dist/index229.js +26 -17
  271. package/dist/index23.cjs +1 -1
  272. package/dist/index23.js +12 -29
  273. package/dist/index230.cjs +1 -1
  274. package/dist/index230.js +76 -8
  275. package/dist/index231.cjs +1 -1
  276. package/dist/index231.js +40 -66
  277. package/dist/index232.cjs +1 -1
  278. package/dist/index232.js +15 -64
  279. package/dist/index233.cjs +1 -1
  280. package/dist/index233.js +12 -187
  281. package/dist/index234.cjs +1 -1
  282. package/dist/index234.js +11 -28
  283. package/dist/index235.cjs +1 -1
  284. package/dist/index235.js +13 -77
  285. package/dist/index236.cjs +1 -1
  286. package/dist/index236.js +17 -38
  287. package/dist/index237.cjs +1 -1
  288. package/dist/index237.js +107 -15
  289. package/dist/index238.cjs +1 -1
  290. package/dist/index238.js +102 -12
  291. package/dist/index239.cjs +1 -1
  292. package/dist/index239.js +6 -11
  293. package/dist/index24.cjs +1 -1
  294. package/dist/index24.js +59 -8
  295. package/dist/index240.cjs +1 -1
  296. package/dist/index240.js +7 -13
  297. package/dist/index241.cjs +1 -1
  298. package/dist/index241.js +25 -18
  299. package/dist/index242.cjs +1 -1
  300. package/dist/index242.js +16 -6
  301. package/dist/index243.cjs +1 -1
  302. package/dist/index243.js +215 -7
  303. package/dist/index244.cjs +1 -1
  304. package/dist/index244.js +203 -23
  305. package/dist/index245.cjs +1 -1
  306. package/dist/index245.js +42 -24
  307. package/dist/index246.cjs +1 -1
  308. package/dist/index246.js +74 -42
  309. package/dist/index247.cjs +1 -1
  310. package/dist/index247.js +2 -10
  311. package/dist/index248.cjs +1 -1
  312. package/dist/index248.js +1 -1
  313. package/dist/index25.cjs +16 -1
  314. package/dist/index25.js +113 -12
  315. package/dist/index250.cjs +2 -1
  316. package/dist/index250.js +88 -654
  317. package/dist/index251.cjs +1 -1
  318. package/dist/index251.js +14 -177
  319. package/dist/index253.cjs +1 -2
  320. package/dist/index253.js +654 -88
  321. package/dist/index254.cjs +1 -1
  322. package/dist/index254.js +177 -14
  323. package/dist/index26.cjs +1 -1
  324. package/dist/index26.js +30 -59
  325. package/dist/index27.cjs +1 -16
  326. package/dist/index27.js +27 -111
  327. package/dist/index28.cjs +1 -1
  328. package/dist/index28.js +7 -29
  329. package/dist/index29.cjs +1 -1
  330. package/dist/index29.js +171 -13
  331. package/dist/index30.cjs +1 -1
  332. package/dist/index30.js +109 -32
  333. package/dist/index31.cjs +1 -1
  334. package/dist/index31.js +30 -32
  335. package/dist/index32.cjs +1 -1
  336. package/dist/index32.js +3 -55
  337. package/dist/index33.cjs +1 -1
  338. package/dist/index33.js +2 -46
  339. package/dist/index34.cjs +1 -1
  340. package/dist/index34.js +4 -26
  341. package/dist/index35.cjs +2 -1
  342. package/dist/index35.js +59 -6
  343. package/dist/index36.cjs +2 -1
  344. package/dist/index36.js +54 -18
  345. package/dist/index37.cjs +3 -1
  346. package/dist/index37.js +215 -15
  347. package/dist/index38.cjs +1 -1
  348. package/dist/index38.js +23 -5
  349. package/dist/index39.cjs +1 -1
  350. package/dist/index39.js +18 -13
  351. package/dist/index40.cjs +1 -1
  352. package/dist/index40.js +10 -10
  353. package/dist/index41.cjs +1 -1
  354. package/dist/index41.js +19 -11
  355. package/dist/index42.cjs +1 -1
  356. package/dist/index42.js +45 -11
  357. package/dist/index43.cjs +1 -1
  358. package/dist/index43.js +13 -3
  359. package/dist/index44.cjs +1 -1
  360. package/dist/index44.js +12 -21
  361. package/dist/index45.cjs +1 -1
  362. package/dist/index45.js +24 -8
  363. package/dist/index46.cjs +1 -1
  364. package/dist/index46.js +28 -3
  365. package/dist/index47.cjs +1 -1
  366. package/dist/index47.js +47 -16
  367. package/dist/index48.cjs +1 -1
  368. package/dist/index48.js +16 -5
  369. package/dist/index49.cjs +1 -1
  370. package/dist/index49.js +10 -170
  371. package/dist/index50.cjs +1 -1
  372. package/dist/index50.js +30 -102
  373. package/dist/index51.cjs +1 -1
  374. package/dist/index51.js +36 -7
  375. package/dist/index52.cjs +1 -1
  376. package/dist/index52.js +7 -31
  377. package/dist/index53.cjs +1 -1
  378. package/dist/index53.js +5 -5
  379. package/dist/index54.cjs +1 -1
  380. package/dist/index54.js +21 -15
  381. package/dist/index55.cjs +1 -1
  382. package/dist/index55.js +7 -33
  383. package/dist/index56.cjs +1 -1
  384. package/dist/index56.js +67 -41
  385. package/dist/index57.cjs +1 -1
  386. package/dist/index57.js +45 -150
  387. package/dist/index58.cjs +1 -1
  388. package/dist/index58.js +21 -39
  389. package/dist/index59.cjs +1 -1
  390. package/dist/index59.js +35 -56
  391. package/dist/index60.cjs +1 -2
  392. package/dist/index60.js +17 -59
  393. package/dist/index61.cjs +1 -1
  394. package/dist/index61.js +6 -13
  395. package/dist/index62.cjs +1 -1
  396. package/dist/index62.js +9 -37
  397. package/dist/index63.cjs +1 -1
  398. package/dist/index63.js +13 -15
  399. package/dist/index64.cjs +1 -1
  400. package/dist/index64.js +163 -7
  401. package/dist/index65.cjs +1 -1
  402. package/dist/index65.js +32 -20
  403. package/dist/index66.cjs +1 -1
  404. package/dist/index66.js +78 -2
  405. package/dist/index67.cjs +1 -1
  406. package/dist/index67.js +12 -44
  407. package/dist/index68.cjs +1 -1
  408. package/dist/index68.js +50 -32
  409. package/dist/index69.cjs +1 -1
  410. package/dist/index69.js +7 -9
  411. package/dist/index70.cjs +1 -1
  412. package/dist/index70.js +7 -60
  413. package/dist/index71.cjs +1 -1
  414. package/dist/index71.js +21 -77
  415. package/dist/index72.cjs +1 -1
  416. package/dist/index72.js +8 -7
  417. package/dist/index73.cjs +1 -1
  418. package/dist/index73.js +31 -16
  419. package/dist/index74.cjs +1 -1
  420. package/dist/index74.js +15 -9
  421. package/dist/index75.cjs +1 -1
  422. package/dist/index75.js +73 -5
  423. package/dist/index76.cjs +1 -1
  424. package/dist/index76.js +35 -14
  425. package/dist/index77.cjs +1 -1
  426. package/dist/index77.js +16 -3
  427. package/dist/index78.cjs +1 -1
  428. package/dist/index78.js +75 -26
  429. package/dist/index79.cjs +1 -1
  430. package/dist/index79.js +11 -163
  431. package/dist/index80.cjs +1 -1
  432. package/dist/index80.js +29 -4
  433. package/dist/index81.cjs +2 -1
  434. package/dist/index81.js +120 -6
  435. package/dist/index82.cjs +1 -1
  436. package/dist/index82.js +13 -89
  437. package/dist/index83.cjs +1 -1
  438. package/dist/index83.js +24 -10
  439. package/dist/index84.cjs +1 -1
  440. package/dist/index84.js +33 -6
  441. package/dist/index85.cjs +1 -1
  442. package/dist/index85.js +44 -13
  443. package/dist/index86.cjs +1 -1
  444. package/dist/index86.js +6 -125
  445. package/dist/index87.cjs +1 -1
  446. package/dist/index87.js +101 -136
  447. package/dist/index88.cjs +1 -1
  448. package/dist/index88.js +37 -7
  449. package/dist/index89.cjs +1 -1
  450. package/dist/index89.js +8 -21
  451. package/dist/index90.cjs +1 -1
  452. package/dist/index90.js +20 -17
  453. package/dist/index91.cjs +1 -1
  454. package/dist/index91.js +2 -44
  455. package/dist/index92.cjs +1 -1
  456. package/dist/index92.js +74 -20
  457. package/dist/index93.cjs +1 -1
  458. package/dist/index93.js +15 -11
  459. package/dist/index94.cjs +1 -1
  460. package/dist/index94.js +151 -6
  461. package/dist/index95.cjs +20 -1
  462. package/dist/index95.js +326 -5
  463. package/dist/index96.cjs +3 -1
  464. package/dist/index96.js +451 -19
  465. package/dist/index97.cjs +1 -1
  466. package/dist/index97.js +68 -101
  467. package/dist/index98.cjs +1 -1
  468. package/dist/index98.js +16 -78
  469. package/dist/index99.cjs +1 -1
  470. package/dist/index99.js +10 -9
  471. package/package.json +1 -1
package/dist/index176.js CHANGED
@@ -1,107 +1,5 @@
1
- import { split as L, rotlSH as T, rotlSL as S, rotlBH as m, rotlBL as F } from "./index241.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 "./index220.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];
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);
1
+ const e = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, t = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
103
2
  export {
104
- p as Keccak,
105
- G as keccakP,
106
- Q as keccak_256
3
+ e as bytesRegex,
4
+ t as integerRegex
107
5
  };
package/dist/index177.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index217.cjs"),s=e.sha256;exports.sha256=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index95.cjs"),d=require("./index120.cjs"),m=require("./index170.cjs"),f=require("./index169.cjs"),l=require("./index148.cjs"),A=require("./index75.cjs"),n="/docs/contract/encodeErrorResult";function E(a){const{abi:i,errorName:t,args:r}=a;let e=i[0];if(t){const s=A.getAbiItem({abi:i,args:r,name:t});if(!s)throw new o.AbiErrorNotFoundError(t,{docsPath:n});e=s}if(e.type!=="error")throw new o.AbiErrorNotFoundError(void 0,{docsPath:n});const u=l.formatAbiItem(e),b=m.toFunctionSelector(u);let c="0x";if(r&&r.length>0){if(!e.inputs)throw new o.AbiErrorInputsNotFoundError(e.name,{docsPath:n});c=f.encodeAbiParameters(e.inputs,r)}return d.concatHex([b,c])}exports.encodeErrorResult=E;
package/dist/index177.js CHANGED
@@ -1,5 +1,30 @@
1
- import { sha256 as s } from "./index217.js";
2
- const o = s;
1
+ import { AbiErrorNotFoundError as c, AbiErrorInputsNotFoundError as u } from "./index95.js";
2
+ import { concatHex as d } from "./index120.js";
3
+ import { toFunctionSelector as p } from "./index170.js";
4
+ import { encodeAbiParameters as b } from "./index169.js";
5
+ import { formatAbiItem as l } from "./index148.js";
6
+ import { getAbiItem as w } from "./index75.js";
7
+ const e = "/docs/contract/encodeErrorResult";
8
+ function F(a) {
9
+ const { abi: n, errorName: t, args: o } = a;
10
+ let r = n[0];
11
+ if (t) {
12
+ const m = w({ abi: n, args: o, name: t });
13
+ if (!m)
14
+ throw new c(t, { docsPath: e });
15
+ r = m;
16
+ }
17
+ if (r.type !== "error")
18
+ throw new c(void 0, { docsPath: e });
19
+ const f = l(r), s = p(f);
20
+ let i = "0x";
21
+ if (o && o.length > 0) {
22
+ if (!r.inputs)
23
+ throw new u(r.name, { docsPath: e });
24
+ i = b(r.inputs, o);
25
+ }
26
+ return d([s, i]);
27
+ }
3
28
  export {
4
- o as sha256
29
+ F as encodeErrorResult
5
30
  };
package/dist/index178.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index242.cjs"),r=require("./index243.cjs");function n(t){return e.hashSignature(r.toSignature(t))}exports.toSignatureHash=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index191.cjs"),o=require("./index181.cjs"),i=require("./index168.cjs"),n=require("./index42.cjs");function u(e,r){const s=r||"hex",t=c.keccak_256(o.isHex(e,{strict:!1})?i.toBytes(e):e);return s==="bytes"?t:n.toHex(t)}exports.keccak256=u;
package/dist/index178.js CHANGED
@@ -1,8 +1,11 @@
1
- import { hashSignature as t } from "./index242.js";
2
- import { toSignature as o } from "./index243.js";
3
- function a(r) {
4
- return t(o(r));
1
+ import { keccak_256 as c } from "./index191.js";
2
+ import { isHex as i } from "./index181.js";
3
+ import { toBytes as m } from "./index168.js";
4
+ import { toHex as s } from "./index42.js";
5
+ function x(t, r) {
6
+ const e = r || "hex", o = c(i(t, { strict: !1 }) ? m(t) : t);
7
+ return e === "bytes" ? o : s(o);
5
8
  }
6
9
  export {
7
- a as toSignatureHash
10
+ x as keccak256
8
11
  };
package/dist/index179.cjs CHANGED
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index95.cjs"),u=require("./index170.cjs"),b=require("./index148.cjs"),m=require("./index75.cjs"),r="/docs/contract/encodeFunctionData";function s(c){const{abi:n,args:a,functionName:e}=c;let t=n[0];if(e){const o=m.getAbiItem({abi:n,args:a,name:e});if(!o)throw new i.AbiFunctionNotFoundError(e,{docsPath:r});t=o}if(t.type!=="function")throw new i.AbiFunctionNotFoundError(void 0,{docsPath:r});return{abi:[t],functionName:u.toFunctionSelector(b.formatAbiItem(t))}}exports.prepareEncodeFunctionData=s;
package/dist/index179.js CHANGED
@@ -1,34 +1,28 @@
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);
1
+ import { AbiFunctionNotFoundError as i } from "./index95.js";
2
+ import { toFunctionSelector as a } from "./index170.js";
3
+ import { formatAbiItem as f } from "./index148.js";
4
+ import { getAbiItem as u } from "./index75.js";
5
+ const r = "/docs/contract/encodeFunctionData";
6
+ function F(c) {
7
+ const { abi: n, args: m, functionName: o } = c;
8
+ let t = n[0];
9
+ if (o) {
10
+ const e = u({
11
+ abi: n,
12
+ args: m,
13
+ name: o
14
+ });
15
+ if (!e)
16
+ throw new i(o, { docsPath: r });
17
+ t = e;
18
+ }
19
+ if (t.type !== "function")
20
+ throw new i(void 0, { docsPath: r });
8
21
  return {
9
- clear: () => {
10
- n.clear(), e.clear();
11
- },
12
- promise: n,
13
- response: e
22
+ abi: [t],
23
+ functionName: a(f(t))
14
24
  };
15
25
  }
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
- }
28
- }
29
26
  export {
30
- p as getCache,
31
- i as promiseCache,
32
- c as responseCache,
33
- l as withCache
27
+ F as prepareEncodeFunctionData
34
28
  };
package/dist/index18.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index51.cjs"),P=require("./index52.cjs"),v=require("./index53.cjs"),q=require("./index54.cjs"),F=require("./index55.cjs"),_=require("./index56.cjs"),x=require("./index57.cjs"),b=require("./index58.cjs");function G({abi:t,address:o,client:l}){const n=l,[s,f]=n?"public"in n&&"wallet"in n?[n.public,n.wallet]:"public"in n?[n.public,void 0]:"wallet"in n?[void 0,n.wallet]:[n,n]:[void 0,void 0],h=s!=null,A=f!=null,u={};let m=!1,w=!1,d=!1;for(const a of t)if(a.type==="function"?a.stateMutability==="view"||a.stateMutability==="pure"?m=!0:w=!0:a.type==="event"&&(d=!0),m&&w&&d)break;return h&&(m&&(u.read=new Proxy({},{get(a,e){return(...i)=>{const{args:c,options:r}=y(i);return p.getAction(s,F.readContract,"readContract")({abi:t,address:o,functionName:e,args:c,...r})}}})),w&&(u.simulate=new Proxy({},{get(a,e){return(...i)=>{const{args:c,options:r}=y(i);return p.getAction(s,_.simulateContract,"simulateContract")({abi:t,address:o,functionName:e,args:c,...r})}}})),d&&(u.createEventFilter=new Proxy({},{get(a,e){return(...i)=>{const c=t.find(g=>g.type==="event"&&g.name===e),{args:r,options:C}=E(i,c);return p.getAction(s,P.createContractEventFilter,"createContractEventFilter")({abi:t,address:o,eventName:e,args:r,...C})}}}),u.getEvents=new Proxy({},{get(a,e){return(...i)=>{const c=t.find(g=>g.type==="event"&&g.name===e),{args:r,options:C}=E(i,c);return p.getAction(s,q.getContractEvents,"getContractEvents")({abi:t,address:o,eventName:e,args:r,...C})}}}),u.watchEvent=new Proxy({},{get(a,e){return(...i)=>{const c=t.find(g=>g.type==="event"&&g.name===e),{args:r,options:C}=E(i,c);return p.getAction(s,x.watchContractEvent,"watchContractEvent")({abi:t,address:o,eventName:e,args:r,...C})}}}))),A&&w&&(u.write=new Proxy({},{get(a,e){return(...i)=>{const{args:c,options:r}=y(i);return p.getAction(f,b.writeContract,"writeContract")({abi:t,address:o,functionName:e,args:c,...r})}}})),(h||A)&&w&&(u.estimateGas=new Proxy({},{get(a,e){return(...i)=>{const{args:c,options:r}=y(i),C=s??f;return p.getAction(C,v.estimateContractGas,"estimateContractGas")({abi:t,address:o,functionName:e,args:c,...r,account:r.account??f.account})}}})),u.address=o,u.abi=t,u}function y(t){const o=t.length&&Array.isArray(t[0]),l=o?t[0]:[],n=(o?t[1]:t[0])??{};return{args:l,options:n}}function E(t,o){let l=!1;Array.isArray(t[0])?l=!0:t.length===1?l=o.inputs.some(f=>f.indexed):t.length===2&&(l=!0);const n=l?t[0]:void 0,s=(l?t[1]:t[0])??{};return{args:n,options:s}}exports.getContract=G;exports.getEventParameters=E;exports.getFunctionParameters=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index55.cjs"),P=require("./index50.cjs"),v=require("./index53.cjs"),q=require("./index74.cjs"),F=require("./index84.cjs"),_=require("./index85.cjs"),x=require("./index94.cjs"),b=require("./index136.cjs");function G({abi:t,address:o,client:l}){const n=l,[s,f]=n?"public"in n&&"wallet"in n?[n.public,n.wallet]:"public"in n?[n.public,void 0]:"wallet"in n?[void 0,n.wallet]:[n,n]:[void 0,void 0],h=s!=null,A=f!=null,u={};let m=!1,w=!1,d=!1;for(const a of t)if(a.type==="function"?a.stateMutability==="view"||a.stateMutability==="pure"?m=!0:w=!0:a.type==="event"&&(d=!0),m&&w&&d)break;return h&&(m&&(u.read=new Proxy({},{get(a,e){return(...i)=>{const{args:c,options:r}=y(i);return p.getAction(s,F.readContract,"readContract")({abi:t,address:o,functionName:e,args:c,...r})}}})),w&&(u.simulate=new Proxy({},{get(a,e){return(...i)=>{const{args:c,options:r}=y(i);return p.getAction(s,_.simulateContract,"simulateContract")({abi:t,address:o,functionName:e,args:c,...r})}}})),d&&(u.createEventFilter=new Proxy({},{get(a,e){return(...i)=>{const c=t.find(g=>g.type==="event"&&g.name===e),{args:r,options:C}=E(i,c);return p.getAction(s,P.createContractEventFilter,"createContractEventFilter")({abi:t,address:o,eventName:e,args:r,...C})}}}),u.getEvents=new Proxy({},{get(a,e){return(...i)=>{const c=t.find(g=>g.type==="event"&&g.name===e),{args:r,options:C}=E(i,c);return p.getAction(s,q.getContractEvents,"getContractEvents")({abi:t,address:o,eventName:e,args:r,...C})}}}),u.watchEvent=new Proxy({},{get(a,e){return(...i)=>{const c=t.find(g=>g.type==="event"&&g.name===e),{args:r,options:C}=E(i,c);return p.getAction(s,x.watchContractEvent,"watchContractEvent")({abi:t,address:o,eventName:e,args:r,...C})}}}))),A&&w&&(u.write=new Proxy({},{get(a,e){return(...i)=>{const{args:c,options:r}=y(i);return p.getAction(f,b.writeContract,"writeContract")({abi:t,address:o,functionName:e,args:c,...r})}}})),(h||A)&&w&&(u.estimateGas=new Proxy({},{get(a,e){return(...i)=>{const{args:c,options:r}=y(i),C=s??f;return p.getAction(C,v.estimateContractGas,"estimateContractGas")({abi:t,address:o,functionName:e,args:c,...r,account:r.account??f.account})}}})),u.address=o,u.abi=t,u}function y(t){const o=t.length&&Array.isArray(t[0]),l=o?t[0]:[],n=(o?t[1]:t[0])??{};return{args:l,options:n}}function E(t,o){let l=!1;Array.isArray(t[0])?l=!0:t.length===1?l=o.inputs.some(f=>f.indexed):t.length===2&&(l=!0);const n=l?t[0]:void 0,s=(l?t[1]:t[0])??{};return{args:n,options:s}}exports.getContract=G;exports.getEventParameters=E;exports.getFunctionParameters=y;
package/dist/index18.js CHANGED
@@ -1,11 +1,11 @@
1
- import { getAction as g } from "./index51.js";
2
- import { createContractEventFilter as v } from "./index52.js";
1
+ import { getAction as g } from "./index55.js";
2
+ import { createContractEventFilter as v } from "./index50.js";
3
3
  import { estimateContractGas as A } from "./index53.js";
4
- import { getContractEvents as _ } from "./index54.js";
5
- import { readContract as x } from "./index55.js";
6
- import { simulateContract as F } from "./index56.js";
7
- import { watchContractEvent as G } from "./index57.js";
8
- import { writeContract as b } from "./index58.js";
4
+ import { getContractEvents as _ } from "./index74.js";
5
+ import { readContract as x } from "./index84.js";
6
+ import { simulateContract as F } from "./index85.js";
7
+ import { watchContractEvent as G } from "./index94.js";
8
+ import { writeContract as b } from "./index136.js";
9
9
  function D({ abi: t, address: o, client: f }) {
10
10
  const e = f, [a, p] = e ? "public" in e && "wallet" in e ? [e.public, e.wallet] : "public" in e ? [e.public, void 0] : "wallet" in e ? [void 0, e.wallet] : [e, e] : [void 0, void 0], d = a != null, P = p != null, u = {};
11
11
  let y = !1, w = !1, E = !1;
package/dist/index180.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function i(e){return new Promise(t=>setTimeout(t,e))}exports.wait=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index95.cjs"),a=require("./index169.cjs"),d=require("./index75.cjs"),r="/docs/contract/encodeFunctionResult";function b(c){const{abi:i,functionName:o,result:e}=c;let t=i[0];if(o){const u=d.getAbiItem({abi:i,name:o});if(!u)throw new n.AbiFunctionNotFoundError(o,{docsPath:r});t=u}if(t.type!=="function")throw new n.AbiFunctionNotFoundError(void 0,{docsPath:r});if(!t.outputs)throw new n.AbiFunctionOutputsNotFoundError(t.name,{docsPath:r});const s=(()=>{if(t.outputs.length===0)return[];if(t.outputs.length===1)return[e];if(Array.isArray(e))return e;throw new n.InvalidArrayError(e)})();return a.encodeAbiParameters(t.outputs,s)}exports.encodeFunctionResult=b;
package/dist/index180.js CHANGED
@@ -1,6 +1,31 @@
1
- async function n(e) {
2
- return new Promise((t) => setTimeout(t, e));
1
+ import { AbiFunctionNotFoundError as i, AbiFunctionOutputsNotFoundError as a, InvalidArrayError as f } from "./index95.js";
2
+ import { encodeAbiParameters as m } from "./index169.js";
3
+ import { getAbiItem as d } from "./index75.js";
4
+ const r = "/docs/contract/encodeFunctionResult";
5
+ function h(c) {
6
+ const { abi: e, functionName: o, result: n } = c;
7
+ let t = e[0];
8
+ if (o) {
9
+ const u = d({ abi: e, name: o });
10
+ if (!u)
11
+ throw new i(o, { docsPath: r });
12
+ t = u;
13
+ }
14
+ if (t.type !== "function")
15
+ throw new i(void 0, { docsPath: r });
16
+ if (!t.outputs)
17
+ throw new a(t.name, { docsPath: r });
18
+ const s = (() => {
19
+ if (t.outputs.length === 0)
20
+ return [];
21
+ if (t.outputs.length === 1)
22
+ return [n];
23
+ if (Array.isArray(n))
24
+ return n;
25
+ throw new f(n);
26
+ })();
27
+ return m(t.outputs, s);
3
28
  }
4
29
  export {
5
- n as wait
30
+ h as encodeFunctionResult
6
31
  };
package/dist/index181.cjs CHANGED
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}exports.isHex=r;
package/dist/index181.js CHANGED
@@ -1,20 +1,6 @@
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
- });
1
+ function e(t, { strict: r = !0 } = {}) {
2
+ return !t || typeof t != "string" ? !1 : r ? /^0x[0-9a-fA-F]*$/.test(t) : t.startsWith("0x");
17
3
  }
18
4
  export {
19
- u as withTimeout
5
+ e as isHex
20
6
  };
package/dist/index182.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index103.cjs"),o=require("./index141.cjs"),s=require("./index107.cjs"),r=require("./index33.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index42.cjs"),r=require("./index183.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;
package/dist/index182.js CHANGED
@@ -1,11 +1,9 @@
1
- import { presignMessagePrefix as e } from "./index103.js";
2
- import { concat as n } from "./index141.js";
3
- import { size as f } from "./index107.js";
4
- import { stringToHex as o, bytesToHex as p } from "./index33.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]);
1
+ import { bytesToHex as i } from "./index42.js";
2
+ import { sha256 as m } from "./index183.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);
8
6
  }
9
7
  export {
10
- u as toPrefixedMessage
8
+ f as commitmentToVersionedHash
11
9
  };
package/dist/index183.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index105.cjs"),E=require("./index41.cjs"),b=require("./index128.cjs"),z=require("./index42.cjs"),d=require("./index107.cjs"),T=require("./index33.cjs"),h=require("./index143.cjs"),w=require("./index66.cjs");function P(e){const{domain:i,message:y,primaryType:n,types:t}=e,a=(g,l)=>{const s={...l};for(const r of g){const{name:o,type:f}=r;f==="address"&&(s[o]=s[o].toLowerCase())}return s},u=t.EIP712Domain?i?a(t.EIP712Domain,i):{}:{},p=(()=>{if(n!=="EIP712Domain")return a(t[n],y)})();return w.stringify({domain:u,message:p,primaryType:n,types:t})}function q(e){const{domain:i,message:y,primaryType:n,types:t}=e,a=(u,p)=>{for(const g of u){const{name:l,type:s}=g,r=p[l],o=s.match(h.integerRegex);if(o&&(typeof r=="number"||typeof r=="bigint")){const[D,c,v]=o;T.numberToHex(r,{signed:c==="int",size:Number.parseInt(v,10)/8})}if(s==="address"&&typeof r=="string"&&!z.isAddress(r))throw new E.InvalidAddressError({address:r});const f=s.match(h.bytesRegex);if(f){const[D,c]=f;if(c&&d.size(r)!==Number.parseInt(c,10))throw new m.BytesSizeMismatchError({expectedSize:Number.parseInt(c,10),givenSize:d.size(r)})}const I=t[s];I&&(S(s),a(I,r))}};if(t.EIP712Domain&&i){if(typeof i!="object")throw new b.InvalidDomainError({domain:i});a(t.EIP712Domain,i)}if(n!=="EIP712Domain")if(t[n])a(t[n],y);else throw new b.InvalidPrimaryTypeError({primaryType:n,types:t})}function x({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function S(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new b.InvalidStructTypeError({type:e})}exports.getTypesForEIP712Domain=x;exports.serializeTypedData=P;exports.validateTypedData=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index192.cjs"),s=require("./index181.cjs"),r=require("./index168.cjs");function o(t,i){return e.sha256(s.isHex(t,{strict:!1})?r.toBytes(t):t)}exports.sha256=o;
package/dist/index183.js CHANGED
@@ -1,83 +1,9 @@
1
- import { BytesSizeMismatchError as v } from "./index105.js";
2
- import { InvalidAddressError as D } from "./index41.js";
3
- import { InvalidDomainError as E, InvalidPrimaryTypeError as w, InvalidStructTypeError as z } from "./index128.js";
4
- import { isAddress as P } from "./index42.js";
5
- import { size as h } from "./index107.js";
6
- import { numberToHex as T } from "./index33.js";
7
- import { integerRegex as d, bytesRegex as _ } from "./index143.js";
8
- import { stringify as x } from "./index66.js";
9
- function F(e) {
10
- const { domain: i, message: p, primaryType: n, types: t } = e, o = (u, g) => {
11
- const s = { ...g };
12
- for (const r of u) {
13
- const { name: a, type: c } = r;
14
- c === "address" && (s[a] = s[a].toLowerCase());
15
- }
16
- return s;
17
- }, y = t.EIP712Domain ? i ? o(t.EIP712Domain, i) : {} : {}, m = (() => {
18
- if (n !== "EIP712Domain")
19
- return o(t[n], p);
20
- })();
21
- return x({ domain: y, message: m, primaryType: n, types: t });
22
- }
23
- function H(e) {
24
- const { domain: i, message: p, primaryType: n, types: t } = e, o = (y, m) => {
25
- for (const u of y) {
26
- const { name: g, type: s } = u, r = m[g], a = s.match(d);
27
- if (a && (typeof r == "number" || typeof r == "bigint")) {
28
- const [l, f, b] = a;
29
- T(r, {
30
- signed: f === "int",
31
- size: Number.parseInt(b, 10) / 8
32
- });
33
- }
34
- if (s === "address" && typeof r == "string" && !P(r))
35
- throw new D({ address: r });
36
- const c = s.match(_);
37
- if (c) {
38
- const [l, f] = c;
39
- if (f && h(r) !== Number.parseInt(f, 10))
40
- throw new v({
41
- expectedSize: Number.parseInt(f, 10),
42
- givenSize: h(r)
43
- });
44
- }
45
- const I = t[s];
46
- I && (S(s), o(I, r));
47
- }
48
- };
49
- if (t.EIP712Domain && i) {
50
- if (typeof i != "object")
51
- throw new E({ domain: i });
52
- o(t.EIP712Domain, i);
53
- }
54
- if (n !== "EIP712Domain")
55
- if (t[n])
56
- o(t[n], p);
57
- else
58
- throw new w({ primaryType: n, types: t });
59
- }
60
- function L({ domain: e }) {
61
- return [
62
- typeof (e == null ? void 0 : e.name) == "string" && { name: "name", type: "string" },
63
- (e == null ? void 0 : e.version) && { name: "version", type: "string" },
64
- (typeof (e == null ? void 0 : e.chainId) == "number" || typeof (e == null ? void 0 : e.chainId) == "bigint") && {
65
- name: "chainId",
66
- type: "uint256"
67
- },
68
- (e == null ? void 0 : e.verifyingContract) && {
69
- name: "verifyingContract",
70
- type: "address"
71
- },
72
- (e == null ? void 0 : e.salt) && { name: "salt", type: "bytes32" }
73
- ].filter(Boolean);
74
- }
75
- function S(e) {
76
- if (e === "address" || e === "bool" || e === "string" || e.startsWith("bytes") || e.startsWith("uint") || e.startsWith("int"))
77
- throw new z({ type: e });
1
+ import { sha256 as o } from "./index192.js";
2
+ import { isHex as s } from "./index181.js";
3
+ import { toBytes as r } from "./index168.js";
4
+ function p(t, i) {
5
+ return o(s(t, { strict: !1 }) ? r(t) : t);
78
6
  }
79
7
  export {
80
- L as getTypesForEIP712Domain,
81
- F as serializeTypedData,
82
- H as validateTypedData
8
+ p as sha256
83
9
  };
package/dist/index184.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index35.cjs"),o=require("./index185.cjs");async function s({hash:e,signature:r}){return c.publicKeyToAddress(await o.recoverPublicKey({hash:e,signature:r}))}exports.recoverAddress=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index185.cjs"),y=require("./index186.cjs"),u=require("./index166.cjs"),B=require("./index149.cjs"),h=require("./index168.cjs"),d=require("./index42.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;
package/dist/index184.js CHANGED
@@ -1,8 +1,35 @@
1
- import { publicKeyToAddress as o } from "./index35.js";
2
- import { recoverPublicKey as c } from "./index185.js";
3
- async function s({ hash: r, signature: e }) {
4
- return o(await c({ hash: r, signature: e }));
1
+ import { maxBytesPerTransaction as y, fieldElementsPerBlob as a, bytesPerFieldElement as f, bytesPerBlob as p } from "./index185.js";
2
+ import { EmptyBlobError as c, BlobSizeTooLargeError as h } from "./index186.js";
3
+ import { createCursor as B } from "./index166.js";
4
+ import { size as u } from "./index149.js";
5
+ import { hexToBytes as x } from "./index168.js";
6
+ import { bytesToHex as d } from "./index42.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));
5
32
  }
6
33
  export {
7
- s as recoverAddress
34
+ S as toBlobs
8
35
  };
package/dist/index185.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index46.cjs"),d=require("./index107.cjs"),o=require("./index31.cjs"),c=require("./index33.cjs");async function g({hash:e,signature:r}){const u=n.isHex(e)?e:c.toHex(e),{secp256k1:i}=await Promise.resolve().then(()=>require("./index30.cjs"));return`0x${(()=>{if(typeof r=="object"&&"r"in r&&"s"in r){const{r:v,s:y,v:b,yParity:f}=r,a=Number(f??b),H=s(a);return new i.Signature(o.hexToBigInt(v),o.hexToBigInt(y)).addRecoveryBit(H)}const t=n.isHex(r)?r:c.toHex(r);if(d.size(t)!==65)throw new Error("invalid signature length");const l=o.hexToNumber(`0x${t.slice(130)}`),x=s(l);return i.Signature.fromCompact(t.substring(2,130)).addRecoveryBit(x)})().recoverPublicKey(u.substring(2)).toHex(!1)}`}function s(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}exports.recoverPublicKey=g;
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;
package/dist/index185.js CHANGED
@@ -1,30 +1,7 @@
1
- import { isHex as i } from "./index46.js";
2
- import { size as b } from "./index107.js";
3
- import { hexToBigInt as n, hexToNumber as d } from "./index31.js";
4
- import { toHex as c } from "./index33.js";
5
- async function R({ hash: r, signature: e }) {
6
- const u = i(r) ? r : c(r), { secp256k1: t } = await import("./index30.js");
7
- return `0x${(() => {
8
- if (typeof e == "object" && "r" in e && "s" in e) {
9
- const { r: p, s: v, v: y, yParity: l } = e, x = Number(l ?? y), a = s(x);
10
- return new t.Signature(n(p), n(v)).addRecoveryBit(a);
11
- }
12
- const o = i(e) ? e : c(e);
13
- if (b(o) !== 65)
14
- throw new Error("invalid signature length");
15
- const f = d(`0x${o.slice(130)}`), m = s(f);
16
- return t.Signature.fromCompact(o.substring(2, 130)).addRecoveryBit(m);
17
- })().recoverPublicKey(u.substring(2)).toHex(!1)}`;
18
- }
19
- function s(r) {
20
- if (r === 0 || r === 1)
21
- return r;
22
- if (r === 27)
23
- return 0;
24
- if (r === 28)
25
- return 1;
26
- throw new Error("Invalid yParityOrV value");
27
- }
1
+ const e = 32, s = 4096, t = 131072, l = 761855;
28
2
  export {
29
- R as recoverPublicKey
3
+ t as bytesPerBlob,
4
+ e as bytesPerFieldElement,
5
+ s as fieldElementsPerBlob,
6
+ l as maxBytesPerTransaction
30
7
  };
package/dist/index186.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index43.cjs"),u=require("./index19.cjs"),d=require("./index41.cjs"),n=require("./index126.cjs"),i=require("./index42.cjs");function w(a){const{account:t,maxFeePerGas:e,maxPriorityFeePerGas:r,to:s}=a,o=t?c.parseAccount(t):void 0;if(o&&!i.isAddress(o.address))throw new d.InvalidAddressError({address:o.address});if(s&&!i.isAddress(s))throw new d.InvalidAddressError({address:s});if(e&&e>u.maxUint256)throw new n.FeeCapTooHighError({maxFeePerGas:e});if(r&&e&&r>e)throw new n.TipAboveFeeCapError({maxFeePerGas:e,maxPriorityFeePerGas:r})}exports.assertRequest=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index205.cjs"),s=require("./index35.cjs");class i extends s.BaseError{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class n extends s.BaseError{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class t extends s.BaseError{constructor({hash:e,size:r}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}}class d extends s.BaseError{constructor({hash:e,version:r}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${a.versionedHashVersionKzg}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}exports.BlobSizeTooLargeError=i;exports.EmptyBlobError=n;exports.InvalidVersionedHashSizeError=t;exports.InvalidVersionedHashVersionError=d;
package/dist/index186.js CHANGED
@@ -1,19 +1,40 @@
1
- import { parseAccount as d } from "./index43.js";
2
- import { maxUint256 as m } from "./index19.js";
3
- import { InvalidAddressError as i } from "./index41.js";
4
- import { FeeCapTooHighError as c, TipAboveFeeCapError as f } from "./index126.js";
5
- import { isAddress as a } from "./index42.js";
6
- function A(n) {
7
- const { account: s, maxFeePerGas: r, maxPriorityFeePerGas: o, to: e } = n, t = s ? d(s) : void 0;
8
- if (t && !a(t.address))
9
- throw new i({ address: t.address });
10
- if (e && !a(e))
11
- throw new i({ address: e });
12
- if (r && r > m)
13
- throw new c({ maxFeePerGas: r });
14
- if (o && r && o > r)
15
- throw new f({ maxFeePerGas: r, maxPriorityFeePerGas: o });
1
+ import { versionedHashVersionKzg as a } from "./index205.js";
2
+ import { BaseError as s } from "./index35.js";
3
+ class t extends s {
4
+ constructor({ maxSize: e, size: r }) {
5
+ super("Blob size is too large.", {
6
+ metaMessages: [`Max: ${e} bytes`, `Given: ${r} bytes`],
7
+ name: "BlobSizeTooLargeError"
8
+ });
9
+ }
10
+ }
11
+ class d extends s {
12
+ constructor() {
13
+ super("Blob data must not be empty.", { name: "EmptyBlobError" });
14
+ }
15
+ }
16
+ class l extends s {
17
+ constructor({ hash: e, size: r }) {
18
+ super(`Versioned hash "${e}" size is invalid.`, {
19
+ metaMessages: ["Expected: 32", `Received: ${r}`],
20
+ name: "InvalidVersionedHashSizeError"
21
+ });
22
+ }
23
+ }
24
+ class c extends s {
25
+ constructor({ hash: e, version: r }) {
26
+ super(`Versioned hash "${e}" version is invalid.`, {
27
+ metaMessages: [
28
+ `Expected: ${a}`,
29
+ `Received: ${r}`
30
+ ],
31
+ name: "InvalidVersionedHashVersionError"
32
+ });
33
+ }
16
34
  }
17
35
  export {
18
- A as assertRequest
36
+ t as BlobSizeTooLargeError,
37
+ d as EmptyBlobError,
38
+ l as InvalidVersionedHashSizeError,
39
+ c as InvalidVersionedHashVersionError
19
40
  };