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

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 (465) hide show
  1. package/dist/index100.cjs +1 -1
  2. package/dist/index100.js +26 -123
  3. package/dist/index101.cjs +1 -1
  4. package/dist/index101.js +90 -5
  5. package/dist/index102.cjs +1 -1
  6. package/dist/index102.js +4 -22
  7. package/dist/index103.cjs +2 -1
  8. package/dist/index103.js +3 -46
  9. package/dist/index104.cjs +1 -1
  10. package/dist/index104.js +9 -39
  11. package/dist/index105.cjs +20 -1
  12. package/dist/index105.js +326 -6
  13. package/dist/index106.cjs +1 -1
  14. package/dist/index106.js +13 -90
  15. package/dist/index107.cjs +1 -1
  16. package/dist/index107.js +4 -14
  17. package/dist/index108.cjs +1 -1
  18. package/dist/index108.js +2 -4
  19. package/dist/index109.cjs +1 -1
  20. package/dist/index109.js +7 -26
  21. package/dist/index110.cjs +2 -2
  22. package/dist/index110.js +46 -16
  23. package/dist/index111.cjs +3 -1
  24. package/dist/index111.js +215 -9
  25. package/dist/index112.cjs +1 -1
  26. package/dist/index112.js +32 -9
  27. package/dist/index113.cjs +1 -1
  28. package/dist/index113.js +21 -10
  29. package/dist/index114.cjs +1 -1
  30. package/dist/index114.js +5 -11
  31. package/dist/index115.cjs +1 -1
  32. package/dist/index115.js +73 -13
  33. package/dist/index116.cjs +1 -1
  34. package/dist/index116.js +5 -21
  35. package/dist/index117.cjs +1 -1
  36. package/dist/index117.js +5 -14
  37. package/dist/index118.cjs +9 -1
  38. package/dist/index118.js +35 -4
  39. package/dist/index119.cjs +2 -1
  40. package/dist/index119.js +120 -6
  41. package/dist/index120.cjs +1 -1
  42. package/dist/index120.js +3 -19
  43. package/dist/index121.cjs +1 -1
  44. package/dist/index121.js +18 -10
  45. package/dist/index122.cjs +1 -1
  46. package/dist/index122.js +17 -55
  47. package/dist/index123.cjs +1 -1
  48. package/dist/index123.js +35 -6
  49. package/dist/index124.cjs +1 -1
  50. package/dist/index124.js +23 -13
  51. package/dist/index125.cjs +1 -1
  52. package/dist/index125.js +8 -7
  53. package/dist/index126.cjs +4 -1
  54. package/dist/index126.js +188 -132
  55. package/dist/index127.cjs +3 -1
  56. package/dist/index127.js +451 -7
  57. package/dist/index128.cjs +1 -1
  58. package/dist/index128.js +25 -19
  59. package/dist/index129.cjs +1 -1
  60. package/dist/index129.js +160 -16
  61. package/dist/index130.cjs +1 -1
  62. package/dist/index130.js +127 -43
  63. package/dist/index131.cjs +1 -1
  64. package/dist/index131.js +37 -20
  65. package/dist/index132.cjs +1 -1
  66. package/dist/index132.js +6 -80
  67. package/dist/index133.cjs +1 -1
  68. package/dist/index133.js +27 -11
  69. package/dist/index134.cjs +1 -1
  70. package/dist/index134.js +190 -12
  71. package/dist/index135.cjs +1 -1
  72. package/dist/index135.js +4 -7
  73. package/dist/index136.cjs +1 -1
  74. package/dist/index136.js +71 -39
  75. package/dist/index137.cjs +1 -1
  76. package/dist/index137.js +20 -5
  77. package/dist/index138.cjs +1 -1
  78. package/dist/index138.js +3 -34
  79. package/dist/index139.cjs +1 -1
  80. package/dist/index139.js +16 -9
  81. package/dist/index140.cjs +1 -1
  82. package/dist/index140.js +23 -60
  83. package/dist/index141.cjs +1 -1
  84. package/dist/index141.js +18 -19
  85. package/dist/index142.cjs +1 -1
  86. package/dist/index142.js +33 -105
  87. package/dist/index143.cjs +1 -1
  88. package/dist/index143.js +3 -79
  89. package/dist/index144.cjs +1 -1
  90. package/dist/index144.js +18 -9
  91. package/dist/index145.cjs +1 -1
  92. package/dist/index145.js +26 -89
  93. package/dist/index146.cjs +1 -2
  94. package/dist/index146.js +37 -3
  95. package/dist/index147.cjs +1 -1
  96. package/dist/index147.js +11 -9
  97. package/dist/index148.cjs +1 -1
  98. package/dist/index148.js +25 -13
  99. package/dist/index149.cjs +1 -1
  100. package/dist/index149.js +28 -4
  101. package/dist/index150.cjs +1 -1
  102. package/dist/index150.js +74 -11
  103. package/dist/index151.cjs +1 -1
  104. package/dist/index151.js +10 -2
  105. package/dist/index152.cjs +1 -1
  106. package/dist/index152.js +21 -31
  107. package/dist/index153.cjs +1 -1
  108. package/dist/index153.js +8 -21
  109. package/dist/index154.cjs +1 -1
  110. package/dist/index154.js +10 -5
  111. package/dist/index155.cjs +1 -1
  112. package/dist/index155.js +11 -5
  113. package/dist/index156.cjs +1 -1
  114. package/dist/index156.js +6 -5
  115. package/dist/index157.cjs +1 -9
  116. package/dist/index157.js +6 -35
  117. package/dist/index158.cjs +1 -1
  118. package/dist/index158.js +14 -3
  119. package/dist/index159.cjs +1 -1
  120. package/dist/index159.js +31 -17
  121. package/dist/index160.cjs +1 -1
  122. package/dist/index160.js +5 -21
  123. package/dist/index161.cjs +1 -1
  124. package/dist/index161.js +34 -32
  125. package/dist/index162.cjs +1 -1
  126. package/dist/index162.js +109 -6
  127. package/dist/index163.cjs +1 -4
  128. package/dist/index163.js +163 -186
  129. package/dist/index164.cjs +1 -1
  130. package/dist/index164.js +41 -19
  131. package/dist/index165.cjs +1 -1
  132. package/dist/index165.js +29 -158
  133. package/dist/index166.cjs +1 -1
  134. package/dist/index166.js +7 -127
  135. package/dist/index167.cjs +1 -1
  136. package/dist/index167.js +17 -27
  137. package/dist/index168.cjs +1 -1
  138. package/dist/index168.js +20 -55
  139. package/dist/index169.cjs +1 -1
  140. package/dist/index169.js +36 -185
  141. package/dist/index170.cjs +1 -1
  142. package/dist/index170.js +23 -4
  143. package/dist/index171.cjs +1 -1
  144. package/dist/index171.js +21 -20
  145. package/dist/index172.cjs +1 -1
  146. package/dist/index172.js +52 -3
  147. package/dist/index173.cjs +1 -1
  148. package/dist/index173.js +10 -14
  149. package/dist/index174.cjs +1 -1
  150. package/dist/index174.js +24 -11
  151. package/dist/index175.cjs +1 -1
  152. package/dist/index175.js +23 -33
  153. package/dist/index176.cjs +1 -1
  154. package/dist/index176.js +105 -3
  155. package/dist/index177.cjs +1 -1
  156. package/dist/index177.js +3 -28
  157. package/dist/index178.cjs +1 -1
  158. package/dist/index178.js +5 -8
  159. package/dist/index179.cjs +1 -1
  160. package/dist/index179.js +29 -23
  161. package/dist/index18.cjs +1 -1
  162. package/dist/index18.js +7 -7
  163. package/dist/index180.cjs +1 -1
  164. package/dist/index180.js +3 -28
  165. package/dist/index181.cjs +1 -1
  166. package/dist/index181.js +17 -3
  167. package/dist/index182.cjs +1 -1
  168. package/dist/index182.js +8 -6
  169. package/dist/index183.cjs +1 -1
  170. package/dist/index183.js +80 -6
  171. package/dist/index184.cjs +1 -1
  172. package/dist/index184.js +5 -32
  173. package/dist/index185.cjs +1 -1
  174. package/dist/index185.js +28 -5
  175. package/dist/index186.cjs +1 -1
  176. package/dist/index186.js +16 -37
  177. package/dist/index187.cjs +1 -1
  178. package/dist/index187.js +75 -46
  179. package/dist/index188.cjs +1 -1
  180. package/dist/index188.js +2 -33
  181. package/dist/index189.cjs +1 -1
  182. package/dist/index189.js +14 -17
  183. package/dist/index190.cjs +1 -1
  184. package/dist/index190.js +18 -42
  185. package/dist/index191.cjs +1 -1
  186. package/dist/index191.js +17 -104
  187. package/dist/index192.cjs +1 -1
  188. package/dist/index192.js +11 -3
  189. package/dist/index193.cjs +1 -1
  190. package/dist/index193.js +30 -5
  191. package/dist/index194.cjs +1 -1
  192. package/dist/index194.js +2 -4
  193. package/dist/index195.cjs +1 -1
  194. package/dist/index195.js +12 -16
  195. package/dist/index196.cjs +1 -1
  196. package/dist/index196.js +12 -5
  197. package/dist/index197.cjs +1 -1
  198. package/dist/index197.js +47 -8
  199. package/dist/index198.cjs +1 -1
  200. package/dist/index198.js +10 -102
  201. package/dist/index199.cjs +1 -1
  202. package/dist/index199.js +7 -5
  203. package/dist/index20.cjs +1 -1
  204. package/dist/index20.js +2 -2
  205. package/dist/index200.cjs +1 -1
  206. package/dist/index200.js +70 -6
  207. package/dist/index201.cjs +1 -1
  208. package/dist/index201.js +46 -27
  209. package/dist/index202.cjs +1 -1
  210. package/dist/index202.js +36 -33
  211. package/dist/index203.cjs +1 -1
  212. package/dist/index203.js +17 -13
  213. package/dist/index204.cjs +1 -1
  214. package/dist/index204.js +6 -78
  215. package/dist/index205.cjs +1 -1
  216. package/dist/index205.js +10 -2
  217. package/dist/index206.cjs +1 -1
  218. package/dist/index206.js +13 -18
  219. package/dist/index207.cjs +1 -1
  220. package/dist/index207.js +13 -171
  221. package/dist/index208.cjs +1 -1
  222. package/dist/index208.js +8 -17
  223. package/dist/index209.cjs +1 -1
  224. package/dist/index209.js +35 -10
  225. package/dist/index210.cjs +1 -1
  226. package/dist/index210.js +16 -25
  227. package/dist/index211.cjs +1 -1
  228. package/dist/index211.js +29 -18
  229. package/dist/index212.cjs +1 -1
  230. package/dist/index212.js +13 -14
  231. package/dist/index213.cjs +1 -1
  232. package/dist/index213.js +6 -5
  233. package/dist/index214.cjs +1 -1
  234. package/dist/index214.js +103 -13
  235. package/dist/index215.cjs +1 -1
  236. package/dist/index215.js +75 -10
  237. package/dist/index216.cjs +2 -1
  238. package/dist/index216.js +24 -16
  239. package/dist/index217.cjs +1 -1
  240. package/dist/index217.js +11 -24
  241. package/dist/index218.cjs +1 -1
  242. package/dist/index218.js +18 -45
  243. package/dist/index219.cjs +1 -1
  244. package/dist/index219.js +103 -9
  245. package/dist/index22.cjs +1 -1
  246. package/dist/index22.js +9 -9
  247. package/dist/index220.cjs +1 -2
  248. package/dist/index220.js +16 -41
  249. package/dist/index221.cjs +1 -1
  250. package/dist/index221.js +215 -2
  251. package/dist/index222.cjs +1 -1
  252. package/dist/index222.js +108 -5
  253. package/dist/index223.cjs +1 -1
  254. package/dist/index223.js +204 -8
  255. package/dist/index224.cjs +1 -1
  256. package/dist/index224.js +41 -18
  257. package/dist/index225.cjs +1 -1
  258. package/dist/index225.js +78 -8
  259. package/dist/index226.cjs +1 -1
  260. package/dist/index226.js +2 -67
  261. package/dist/index227.cjs +2 -1
  262. package/dist/index227.js +40 -64
  263. package/dist/index228.cjs +1 -1
  264. package/dist/index228.js +2 -189
  265. package/dist/index229.cjs +1 -1
  266. package/dist/index229.js +5 -28
  267. package/dist/index23.cjs +1 -1
  268. package/dist/index23.js +2 -2
  269. package/dist/index230.cjs +1 -1
  270. package/dist/index230.js +9 -75
  271. package/dist/index231.cjs +1 -1
  272. package/dist/index231.js +17 -38
  273. package/dist/index232.cjs +1 -1
  274. package/dist/index232.js +8 -16
  275. package/dist/index233.cjs +1 -1
  276. package/dist/index233.js +66 -13
  277. package/dist/index234.cjs +1 -1
  278. package/dist/index234.js +65 -11
  279. package/dist/index235.cjs +1 -1
  280. package/dist/index235.js +186 -10
  281. package/dist/index236.cjs +1 -1
  282. package/dist/index236.js +26 -17
  283. package/dist/index237.cjs +1 -1
  284. package/dist/index237.js +71 -103
  285. package/dist/index238.cjs +1 -1
  286. package/dist/index238.js +37 -100
  287. package/dist/index239.cjs +1 -1
  288. package/dist/index239.js +16 -6
  289. package/dist/index24.cjs +1 -1
  290. package/dist/index24.js +5 -5
  291. package/dist/index240.cjs +1 -1
  292. package/dist/index240.js +14 -7
  293. package/dist/index241.cjs +1 -1
  294. package/dist/index241.js +11 -26
  295. package/dist/index242.cjs +1 -1
  296. package/dist/index242.js +10 -14
  297. package/dist/index243.cjs +1 -1
  298. package/dist/index243.js +18 -213
  299. package/dist/index244.cjs +1 -1
  300. package/dist/index244.js +6 -206
  301. package/dist/index245.cjs +1 -1
  302. package/dist/index245.js +7 -43
  303. package/dist/index246.cjs +1 -1
  304. package/dist/index246.js +22 -74
  305. package/dist/index247.cjs +1 -1
  306. package/dist/index247.js +47 -2
  307. package/dist/index248.cjs +1 -1
  308. package/dist/index248.js +9 -11
  309. package/dist/index249.cjs +1 -1
  310. package/dist/index249.js +24 -19
  311. package/dist/index25.cjs +1 -1
  312. package/dist/index25.js +3 -3
  313. package/dist/index250.cjs +1 -2
  314. package/dist/index250.js +654 -88
  315. package/dist/index251.cjs +1 -1
  316. package/dist/index251.js +177 -14
  317. package/dist/index253.cjs +2 -1
  318. package/dist/index253.js +88 -654
  319. package/dist/index254.cjs +1 -1
  320. package/dist/index254.js +14 -177
  321. package/dist/index26.cjs +1 -1
  322. package/dist/index26.js +1 -1
  323. package/dist/index29.cjs +1 -1
  324. package/dist/index29.js +13 -171
  325. package/dist/index30.cjs +1 -1
  326. package/dist/index30.js +32 -109
  327. package/dist/index31.cjs +1 -1
  328. package/dist/index31.js +32 -30
  329. package/dist/index32.cjs +1 -1
  330. package/dist/index32.js +55 -3
  331. package/dist/index33.cjs +1 -1
  332. package/dist/index33.js +46 -2
  333. package/dist/index34.cjs +1 -1
  334. package/dist/index34.js +26 -4
  335. package/dist/index35.cjs +1 -2
  336. package/dist/index35.js +6 -59
  337. package/dist/index36.cjs +1 -2
  338. package/dist/index36.js +18 -54
  339. package/dist/index37.cjs +1 -3
  340. package/dist/index37.js +15 -215
  341. package/dist/index38.cjs +1 -1
  342. package/dist/index38.js +5 -23
  343. package/dist/index39.cjs +1 -1
  344. package/dist/index39.js +13 -18
  345. package/dist/index40.cjs +1 -1
  346. package/dist/index40.js +10 -10
  347. package/dist/index41.cjs +1 -1
  348. package/dist/index41.js +11 -19
  349. package/dist/index42.cjs +1 -1
  350. package/dist/index42.js +11 -45
  351. package/dist/index43.cjs +1 -1
  352. package/dist/index43.js +3 -13
  353. package/dist/index44.cjs +1 -1
  354. package/dist/index44.js +21 -12
  355. package/dist/index45.cjs +1 -1
  356. package/dist/index45.js +8 -24
  357. package/dist/index46.cjs +1 -1
  358. package/dist/index46.js +3 -28
  359. package/dist/index47.cjs +1 -1
  360. package/dist/index47.js +16 -47
  361. package/dist/index48.cjs +1 -1
  362. package/dist/index48.js +5 -16
  363. package/dist/index49.cjs +1 -1
  364. package/dist/index49.js +170 -10
  365. package/dist/index50.cjs +1 -1
  366. package/dist/index50.js +102 -30
  367. package/dist/index51.cjs +1 -1
  368. package/dist/index51.js +7 -36
  369. package/dist/index52.cjs +1 -1
  370. package/dist/index52.js +31 -7
  371. package/dist/index53.cjs +1 -1
  372. package/dist/index53.js +5 -5
  373. package/dist/index54.cjs +1 -1
  374. package/dist/index54.js +15 -21
  375. package/dist/index55.cjs +1 -1
  376. package/dist/index55.js +33 -7
  377. package/dist/index56.cjs +1 -1
  378. package/dist/index56.js +41 -67
  379. package/dist/index57.cjs +1 -1
  380. package/dist/index57.js +150 -45
  381. package/dist/index58.cjs +1 -1
  382. package/dist/index58.js +39 -21
  383. package/dist/index59.cjs +1 -1
  384. package/dist/index59.js +56 -35
  385. package/dist/index60.cjs +2 -1
  386. package/dist/index60.js +59 -17
  387. package/dist/index61.cjs +1 -1
  388. package/dist/index61.js +13 -6
  389. package/dist/index62.cjs +1 -1
  390. package/dist/index62.js +37 -9
  391. package/dist/index63.cjs +1 -1
  392. package/dist/index63.js +15 -13
  393. package/dist/index64.cjs +1 -1
  394. package/dist/index64.js +7 -163
  395. package/dist/index65.cjs +1 -1
  396. package/dist/index65.js +20 -32
  397. package/dist/index66.cjs +1 -1
  398. package/dist/index66.js +2 -78
  399. package/dist/index67.cjs +1 -1
  400. package/dist/index67.js +44 -12
  401. package/dist/index68.cjs +1 -1
  402. package/dist/index68.js +32 -50
  403. package/dist/index69.cjs +1 -1
  404. package/dist/index69.js +9 -7
  405. package/dist/index70.cjs +1 -1
  406. package/dist/index70.js +60 -7
  407. package/dist/index71.cjs +1 -1
  408. package/dist/index71.js +77 -21
  409. package/dist/index72.cjs +1 -1
  410. package/dist/index72.js +7 -8
  411. package/dist/index73.cjs +1 -1
  412. package/dist/index73.js +16 -31
  413. package/dist/index74.cjs +1 -1
  414. package/dist/index74.js +9 -15
  415. package/dist/index75.cjs +1 -1
  416. package/dist/index75.js +5 -73
  417. package/dist/index76.cjs +1 -1
  418. package/dist/index76.js +14 -35
  419. package/dist/index77.cjs +1 -1
  420. package/dist/index77.js +3 -16
  421. package/dist/index78.cjs +1 -1
  422. package/dist/index78.js +26 -75
  423. package/dist/index79.cjs +1 -1
  424. package/dist/index79.js +163 -11
  425. package/dist/index80.cjs +1 -1
  426. package/dist/index80.js +4 -29
  427. package/dist/index81.cjs +1 -2
  428. package/dist/index81.js +6 -120
  429. package/dist/index82.cjs +1 -1
  430. package/dist/index82.js +89 -13
  431. package/dist/index83.cjs +1 -1
  432. package/dist/index83.js +10 -24
  433. package/dist/index84.cjs +1 -1
  434. package/dist/index84.js +6 -33
  435. package/dist/index85.cjs +1 -1
  436. package/dist/index85.js +13 -44
  437. package/dist/index86.cjs +1 -1
  438. package/dist/index86.js +125 -6
  439. package/dist/index87.cjs +1 -1
  440. package/dist/index87.js +136 -101
  441. package/dist/index88.cjs +1 -1
  442. package/dist/index88.js +7 -37
  443. package/dist/index89.cjs +1 -1
  444. package/dist/index89.js +21 -8
  445. package/dist/index90.cjs +1 -1
  446. package/dist/index90.js +17 -20
  447. package/dist/index91.cjs +1 -1
  448. package/dist/index91.js +44 -2
  449. package/dist/index92.cjs +1 -1
  450. package/dist/index92.js +20 -74
  451. package/dist/index93.cjs +1 -1
  452. package/dist/index93.js +11 -15
  453. package/dist/index94.cjs +1 -1
  454. package/dist/index94.js +6 -151
  455. package/dist/index95.cjs +1 -20
  456. package/dist/index95.js +5 -326
  457. package/dist/index96.cjs +1 -3
  458. package/dist/index96.js +19 -451
  459. package/dist/index97.cjs +1 -1
  460. package/dist/index97.js +101 -68
  461. package/dist/index98.cjs +1 -1
  462. package/dist/index98.js +78 -16
  463. package/dist/index99.cjs +1 -1
  464. package/dist/index99.js +9 -10
  465. package/package.json +1 -1
package/dist/index37.js CHANGED
@@ -1,218 +1,18 @@
1
- import { parseAccount as $ } from "./index32.js";
2
- import { panicReasons as A } from "./index152.js";
3
- import { decodeErrorResult as C } from "./index153.js";
4
- import { formatAbiItem as v } from "./index148.js";
5
- import { formatAbiItemWithArgs as w } from "./index154.js";
6
- import { getAbiItem as P } from "./index75.js";
7
- import { formatEther as j } from "./index155.js";
8
- import { formatGwei as p } from "./index156.js";
9
- import { AbiErrorSignatureNotFoundError as x } from "./index95.js";
10
- import { BaseError as b } from "./index35.js";
11
- import { prettyStateOverride as O } from "./index157.js";
12
- import { prettyPrint as E } from "./index81.js";
13
- import { getContractAddress as F } from "./index158.js";
14
- class H extends b {
15
- constructor(e, { account: o, docsPath: c, chain: n, data: l, gas: a, gasPrice: u, maxFeePerGas: r, maxPriorityFeePerGas: t, nonce: i, to: s, value: d, stateOverride: f }) {
16
- var y;
17
- const m = o ? $(o) : void 0;
18
- let g = E({
19
- from: m == null ? void 0 : m.address,
20
- to: s,
21
- value: typeof d < "u" && `${j(d)} ${((y = n == null ? void 0 : n.nativeCurrency) == null ? void 0 : y.symbol) || "ETH"}`,
22
- data: l,
23
- gas: a,
24
- gasPrice: typeof u < "u" && `${p(u)} gwei`,
25
- maxFeePerGas: typeof r < "u" && `${p(r)} gwei`,
26
- maxPriorityFeePerGas: typeof t < "u" && `${p(t)} gwei`,
27
- nonce: i
28
- });
29
- f && (g += `
30
- ${O(f)}`), super(e.shortMessage, {
31
- cause: e,
32
- docsPath: c,
33
- metaMessages: [
34
- ...e.metaMessages ? [...e.metaMessages, " "] : [],
35
- "Raw Call Arguments:",
36
- g
37
- ].filter(Boolean),
38
- name: "CallExecutionError"
39
- }), Object.defineProperty(this, "cause", {
40
- enumerable: !0,
41
- configurable: !0,
42
- writable: !0,
43
- value: void 0
44
- }), this.cause = e;
45
- }
46
- }
47
- class U extends b {
48
- constructor(e, { abi: o, args: c, contractAddress: n, docsPath: l, functionName: a, sender: u }) {
49
- const r = P({ abi: o, args: c, name: a }), t = r ? w({
50
- abiItem: r,
51
- args: c,
52
- includeFunctionName: !1,
53
- includeName: !1
54
- }) : void 0, i = r ? v(r, { includeName: !0 }) : void 0, s = E({
55
- address: n && F(n),
56
- function: i,
57
- args: t && t !== "()" && `${[...Array((a == null ? void 0 : a.length) ?? 0).keys()].map(() => " ").join("")}${t}`,
58
- sender: u
59
- });
60
- super(e.shortMessage || `An unknown error occurred while executing the contract function "${a}".`, {
61
- cause: e,
62
- docsPath: l,
63
- metaMessages: [
64
- ...e.metaMessages ? [...e.metaMessages, " "] : [],
65
- s && "Contract Call:",
66
- s
67
- ].filter(Boolean),
68
- name: "ContractFunctionExecutionError"
69
- }), Object.defineProperty(this, "abi", {
70
- enumerable: !0,
71
- configurable: !0,
72
- writable: !0,
73
- value: void 0
74
- }), Object.defineProperty(this, "args", {
75
- enumerable: !0,
76
- configurable: !0,
77
- writable: !0,
78
- value: void 0
79
- }), Object.defineProperty(this, "cause", {
80
- enumerable: !0,
81
- configurable: !0,
82
- writable: !0,
83
- value: void 0
84
- }), Object.defineProperty(this, "contractAddress", {
85
- enumerable: !0,
86
- configurable: !0,
87
- writable: !0,
88
- value: void 0
89
- }), Object.defineProperty(this, "formattedArgs", {
90
- enumerable: !0,
91
- configurable: !0,
92
- writable: !0,
93
- value: void 0
94
- }), Object.defineProperty(this, "functionName", {
95
- enumerable: !0,
96
- configurable: !0,
97
- writable: !0,
98
- value: void 0
99
- }), Object.defineProperty(this, "sender", {
100
- enumerable: !0,
101
- configurable: !0,
102
- writable: !0,
103
- value: void 0
104
- }), this.abi = o, this.args = c, this.cause = e, this.contractAddress = n, this.functionName = a, this.sender = u;
105
- }
106
- }
107
- class Y extends b {
108
- constructor({ abi: e, data: o, functionName: c, message: n }) {
109
- let l, a, u, r;
110
- if (o && o !== "0x")
111
- try {
112
- a = C({ abi: e, data: o });
113
- const { abiItem: i, errorName: s, args: d } = a;
114
- if (s === "Error")
115
- r = d[0];
116
- else if (s === "Panic") {
117
- const [f] = d;
118
- r = A[f];
119
- } else {
120
- const f = i ? v(i, { includeName: !0 }) : void 0, m = i && d ? w({
121
- abiItem: i,
122
- args: d,
123
- includeFunctionName: !1,
124
- includeName: !1
125
- }) : void 0;
126
- u = [
127
- f ? `Error: ${f}` : "",
128
- m && m !== "()" ? ` ${[...Array((s == null ? void 0 : s.length) ?? 0).keys()].map(() => " ").join("")}${m}` : ""
129
- ];
130
- }
131
- } catch (i) {
132
- l = i;
133
- }
134
- else n && (r = n);
135
- let t;
136
- l instanceof x && (t = l.signature, u = [
137
- `Unable to decode signature "${t}" as it was not found on the provided ABI.`,
138
- "Make sure you are using the correct ABI and that the error exists on it.",
139
- `You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`
140
- ]), super(r && r !== "execution reverted" || t ? [
141
- `The contract function "${c}" reverted with the following ${t ? "signature" : "reason"}:`,
142
- r || t
143
- ].join(`
144
- `) : `The contract function "${c}" reverted.`, {
145
- cause: l,
146
- metaMessages: u,
147
- name: "ContractFunctionRevertedError"
148
- }), Object.defineProperty(this, "data", {
149
- enumerable: !0,
150
- configurable: !0,
151
- writable: !0,
152
- value: void 0
153
- }), Object.defineProperty(this, "raw", {
154
- enumerable: !0,
155
- configurable: !0,
156
- writable: !0,
157
- value: void 0
158
- }), Object.defineProperty(this, "reason", {
159
- enumerable: !0,
160
- configurable: !0,
161
- writable: !0,
162
- value: void 0
163
- }), Object.defineProperty(this, "signature", {
164
- enumerable: !0,
165
- configurable: !0,
166
- writable: !0,
167
- value: void 0
168
- }), this.data = a, this.raw = o, this.reason = r, this.signature = t;
169
- }
170
- }
171
- class J extends b {
172
- constructor({ functionName: e }) {
173
- super(`The contract function "${e}" returned no data ("0x").`, {
174
- metaMessages: [
175
- "This could be due to any of the following:",
176
- ` - The contract does not have the function "${e}",`,
177
- " - The parameters passed to the contract function may be invalid, or",
178
- " - The address is not a contract."
179
- ],
180
- name: "ContractFunctionZeroDataError"
181
- });
182
- }
183
- }
184
- class K extends b {
185
- constructor({ factory: e }) {
186
- super(`Deployment for counterfactual contract call failed${e ? ` for factory "${e}".` : ""}`, {
187
- metaMessages: [
188
- "Please ensure:",
189
- "- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).",
190
- "- The `factoryData` is a valid encoded function call for contract deployment function on the factory."
191
- ],
192
- name: "CounterfactualDeploymentFailedError"
193
- });
194
- }
195
- }
196
- class L extends b {
197
- constructor({ data: e, message: o }) {
198
- super(o || "", { name: "RawContractError" }), Object.defineProperty(this, "code", {
199
- enumerable: !0,
200
- configurable: !0,
201
- writable: !0,
202
- value: 3
203
- }), Object.defineProperty(this, "data", {
204
- enumerable: !0,
205
- configurable: !0,
206
- writable: !0,
207
- value: void 0
208
- }), this.data = e;
209
- }
1
+ import { hashAuthorization as a } from "./index47.js";
2
+ import { sign as e } from "./index36.js";
3
+ async function u(t) {
4
+ const { chainId: o, nonce: n, privateKey: c, to: i = "object" } = t, r = t.contractAddress ?? t.address, s = await e({
5
+ hash: a({ address: r, chainId: o, nonce: n }),
6
+ privateKey: c,
7
+ to: i
8
+ });
9
+ return i === "object" ? {
10
+ address: r,
11
+ chainId: o,
12
+ nonce: n,
13
+ ...s
14
+ } : s;
210
15
  }
211
16
  export {
212
- H as CallExecutionError,
213
- U as ContractFunctionExecutionError,
214
- Y as ContractFunctionRevertedError,
215
- J as ContractFunctionZeroDataError,
216
- K as CounterfactualDeploymentFailedError,
217
- L as RawContractError
17
+ u as signAuthorization
218
18
  };
package/dist/index38.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index95.cjs"),a=require("./index165.cjs"),b=require("./index75.cjs"),i="/docs/contract/decodeFunctionResult";function f(c){const{abi:r,args:d,functionName:n,data:s}=c;let e=r[0];if(n){const u=b.getAbiItem({abi:r,args:d,name:n});if(!u)throw new o.AbiFunctionNotFoundError(n,{docsPath:i});e=u}if(e.type!=="function")throw new o.AbiFunctionNotFoundError(void 0,{docsPath:i});if(!e.outputs)throw new o.AbiFunctionOutputsNotFoundError(e.name,{docsPath:i});const t=a.decodeAbiParameters(e.outputs,s);if(t&&t.length>1)return t;if(t&&t.length===1)return t[0]}exports.decodeFunctionResult=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index48.cjs"),n=require("./index36.cjs");async function t({message:e,privateKey:s}){return await n.sign({hash:a.hashMessage(e),privateKey:s,to:"hex"})}exports.signMessage=t;
package/dist/index38.js CHANGED
@@ -1,26 +1,8 @@
1
- import { AbiFunctionNotFoundError as u, AbiFunctionOutputsNotFoundError as s } from "./index95.js";
2
- import { decodeAbiParameters as a } from "./index165.js";
3
- import { getAbiItem as m } from "./index75.js";
4
- const e = "/docs/contract/decodeFunctionResult";
5
- function l(c) {
6
- const { abi: r, args: d, functionName: o, data: f } = c;
7
- let n = r[0];
8
- if (o) {
9
- const i = m({ abi: r, args: d, name: o });
10
- if (!i)
11
- throw new u(o, { docsPath: e });
12
- n = i;
13
- }
14
- if (n.type !== "function")
15
- throw new u(void 0, { docsPath: e });
16
- if (!n.outputs)
17
- throw new s(n.name, { docsPath: e });
18
- const t = a(n.outputs, f);
19
- if (t && t.length > 1)
20
- return t;
21
- if (t && t.length === 1)
22
- return t[0];
1
+ import { hashMessage as e } from "./index48.js";
2
+ import { sign as o } from "./index36.js";
3
+ async function i({ message: s, privateKey: a }) {
4
+ return await o({ hash: e(s), privateKey: a, to: "hex" });
23
5
  }
24
6
  export {
25
- l as decodeFunctionResult
7
+ i as signMessage
26
8
  };
package/dist/index39.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index95.cjs"),u=require("./index120.cjs"),d=require("./index169.cjs"),r="/docs/contract/encodeDeployData";function b(i){const{abi:a,args:o,bytecode:n}=i;if(!o||o.length===0)return n;const t=a.find(c=>"type"in c&&c.type==="constructor");if(!t)throw new e.AbiConstructorNotFoundError({docsPath:r});if(!("inputs"in t))throw new e.AbiConstructorParamsNotFoundError({docsPath:r});if(!t.inputs||t.inputs.length===0)throw new e.AbiConstructorParamsNotFoundError({docsPath:r});const s=d.encodeAbiParameters(t.inputs,o);return u.concatHex([n,s])}exports.encodeDeployData=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index45.cjs"),c=require("./index49.cjs"),o=require("./index36.cjs");async function u(i){const{privateKey:n,transaction:a,serializer:e=c.serializeTransaction}=i,r=a.type==="eip4844"?{...a,sidecars:!1}:a,t=await o.sign({hash:s.keccak256(await e(r)),privateKey:n});return await e(a,t)}exports.signTransaction=u;
package/dist/index39.js CHANGED
@@ -1,21 +1,16 @@
1
- import { AbiConstructorNotFoundError as p, AbiConstructorParamsNotFoundError as i } from "./index95.js";
2
- import { concatHex as u } from "./index120.js";
3
- import { encodeAbiParameters as d } from "./index169.js";
4
- const r = "/docs/contract/encodeDeployData";
5
- function w(c) {
6
- const { abi: s, args: o, bytecode: n } = c;
7
- if (!o || o.length === 0)
8
- return n;
9
- const t = s.find((e) => "type" in e && e.type === "constructor");
10
- if (!t)
11
- throw new p({ docsPath: r });
12
- if (!("inputs" in t))
13
- throw new i({ docsPath: r });
14
- if (!t.inputs || t.inputs.length === 0)
15
- throw new i({ docsPath: r });
16
- const a = d(t.inputs, o);
17
- return u([n, a]);
1
+ import { keccak256 as e } from "./index45.js";
2
+ import { serializeTransaction as o } from "./index49.js";
3
+ import { sign as c } from "./index36.js";
4
+ async function u(r) {
5
+ const { privateKey: t, transaction: a, serializer: i = o } = r, n = a.type === "eip4844" ? {
6
+ ...a,
7
+ sidecars: !1
8
+ } : a, s = await c({
9
+ hash: e(await i(n)),
10
+ privateKey: t
11
+ });
12
+ return await i(a, s);
18
13
  }
19
14
  export {
20
- w as encodeDeployData
15
+ u as signTransaction
21
16
  };
package/dist/index40.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index120.cjs"),s=require("./index169.cjs"),d=require("./index179.cjs");function b(n){const{args:c}=n,{abi:o,functionName:i}=(()=>{var e;return n.abi.length===1&&((e=n.functionName)!=null&&e.startsWith("0x"))?n:d.prepareEncodeFunctionData(n)})(),t=o[0],u=i,a="inputs"in t&&t.inputs?s.encodeAbiParameters(t.inputs,c??[]):void 0;return r.concatHex([u,a??"0x"])}exports.encodeFunctionData=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index50.cjs"),s=require("./index36.cjs");async function i(e){const{privateKey:t,...a}=e;return await s.sign({hash:n.hashTypedData(a),privateKey:t,to:"hex"})}exports.signTypedData=i;
package/dist/index40.js CHANGED
@@ -1,13 +1,13 @@
1
- import { concatHex as a } from "./index120.js";
2
- import { encodeAbiParameters as s } from "./index169.js";
3
- import { prepareEncodeFunctionData as f } from "./index179.js";
4
- function b(n) {
5
- const { args: i } = n, { abi: c, functionName: e } = (() => {
6
- var o;
7
- return n.abi.length === 1 && ((o = n.functionName) != null && o.startsWith("0x")) ? n : f(n);
8
- })(), t = c[0], u = e, r = "inputs" in t && t.inputs ? s(t.inputs, i ?? []) : void 0;
9
- return a([u, r ?? "0x"]);
1
+ import { hashTypedData as o } from "./index50.js";
2
+ import { sign as r } from "./index36.js";
3
+ async function p(t) {
4
+ const { privateKey: a, ...e } = t;
5
+ return await r({
6
+ hash: o(e),
7
+ privateKey: a,
8
+ to: "hex"
9
+ });
10
10
  }
11
11
  export {
12
- b as encodeFunctionData
12
+ p as signTypedData
13
13
  };
package/dist/index41.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index36.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 s=require("./index60.cjs");class r extends s.BaseError{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}exports.InvalidAddressError=r;
package/dist/index41.js CHANGED
@@ -1,23 +1,15 @@
1
- import { ChainDoesNotSupportContract as d } from "./index36.js";
2
- function n({ blockNumber: r, chain: t, contract: e }) {
3
- var c;
4
- const o = (c = t == null ? void 0 : t.contracts) == null ? void 0 : c[e];
5
- if (!o)
6
- throw new d({
7
- chain: t,
8
- contract: { name: e }
1
+ import { BaseError as r } from "./index60.js";
2
+ class d extends r {
3
+ constructor({ address: s }) {
4
+ super(`Address "${s}" is invalid.`, {
5
+ metaMessages: [
6
+ "- Address must be a hex value of 20 bytes (40 hex characters).",
7
+ "- Address must match its checksum counterpart."
8
+ ],
9
+ name: "InvalidAddressError"
9
10
  });
10
- if (r && o.blockCreated && o.blockCreated > r)
11
- throw new d({
12
- blockNumber: r,
13
- chain: t,
14
- contract: {
15
- name: e,
16
- blockCreated: o.blockCreated
17
- }
18
- });
19
- return o.address;
11
+ }
20
12
  }
21
13
  export {
22
- n as getChainContractAddress
14
+ d as InvalidAddressError
23
15
  };
package/dist/index42.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index160.cjs"),f=require("./index175.cjs"),x=require("./index65.cjs"),z=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function H(e,n={}){return typeof e=="number"||typeof e=="bigint"?d(e,n):typeof e=="string"?m(e,n):typeof e=="boolean"?b(e,n):u(e,n)}function b(e,n={}){const t=`0x${Number(e)}`;return typeof n.size=="number"?(x.assertSize(t,{size:n.size}),f.pad(t,{size:n.size})):t}function u(e,n={}){let t="";for(let i=0;i<e.length;i++)t+=z[e[i]];const r=`0x${t}`;return typeof n.size=="number"?(x.assertSize(r,{size:n.size}),f.pad(r,{dir:"right",size:n.size})):r}function d(e,n={}){const{signed:t,size:r}=n,i=BigInt(e);let o;r?t?o=(1n<<BigInt(r)*8n-1n)-1n:o=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));const c=typeof o=="bigint"&&t?-o-1n:0;if(o&&i>o||i<c){const s=typeof e=="bigint"?"n":"";throw new y.IntegerOutOfRangeError({max:o?`${o}${s}`:void 0,min:`${c}${s}`,signed:t,size:r,value:`${e}${s}`})}const g=`0x${(t&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?f.pad(g,{size:r}):g}const T=new TextEncoder;function m(e,n={}){const t=T.encode(e);return u(t,n)}exports.boolToHex=b;exports.bytesToHex=u;exports.numberToHex=d;exports.stringToHex=m;exports.toHex=H;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index152.cjs"),i=require("./index44.cjs"),o=/^0x[a-fA-F0-9]{40}$/,t=new c.LruMap(8192);function f(e,n){const{strict:s=!0}=n??{},r=`${e}.${s}`;if(t.has(r))return t.get(r);const u=o.test(e)?e.toLowerCase()===e?!0:s?i.checksumAddress(e)===e:!0:!1;return t.set(r,u),u}exports.isAddress=f;exports.isAddressCache=t;
package/dist/index42.js CHANGED
@@ -1,48 +1,14 @@
1
- import { IntegerOutOfRangeError as x } from "./index160.js";
2
- import { pad as s } from "./index175.js";
3
- import { assertSize as c } from "./index65.js";
4
- const b = /* @__PURE__ */ Array.from({ length: 256 }, (n, e) => e.toString(16).padStart(2, "0"));
5
- function B(n, e = {}) {
6
- return typeof n == "number" || typeof n == "bigint" ? y(n, e) : typeof n == "string" ? $(n, e) : typeof n == "boolean" ? z(n, e) : m(n, e);
7
- }
8
- function z(n, e = {}) {
9
- const t = `0x${Number(n)}`;
10
- return typeof e.size == "number" ? (c(t, { size: e.size }), s(t, { size: e.size })) : t;
11
- }
12
- function m(n, e = {}) {
13
- let t = "";
14
- for (let i = 0; i < n.length; i++)
15
- t += b[n[i]];
16
- const r = `0x${t}`;
17
- return typeof e.size == "number" ? (c(r, { size: e.size }), s(r, { dir: "right", size: e.size })) : r;
18
- }
19
- function y(n, e = {}) {
20
- const { signed: t, size: r } = e, i = BigInt(n);
21
- let o;
22
- r ? t ? o = (1n << BigInt(r) * 8n - 1n) - 1n : o = 2n ** (BigInt(r) * 8n) - 1n : typeof n == "number" && (o = BigInt(Number.MAX_SAFE_INTEGER));
23
- const g = typeof o == "bigint" && t ? -o - 1n : 0;
24
- if (o && i > o || i < g) {
25
- const f = typeof n == "bigint" ? "n" : "";
26
- throw new x({
27
- max: o ? `${o}${f}` : void 0,
28
- min: `${g}${f}`,
29
- signed: t,
30
- size: r,
31
- value: `${n}${f}`
32
- });
33
- }
34
- const u = `0x${(t && i < 0 ? (1n << BigInt(r * 8)) + BigInt(i) : i).toString(16)}`;
35
- return r ? s(u, { size: r }) : u;
36
- }
37
- const d = /* @__PURE__ */ new TextEncoder();
38
- function $(n, e = {}) {
39
- const t = d.encode(n);
40
- return m(t, e);
1
+ import { LruMap as u } from "./index152.js";
2
+ import { checksumAddress as c } from "./index44.js";
3
+ const i = /^0x[a-fA-F0-9]{40}$/, r = /* @__PURE__ */ new u(8192);
4
+ function h(t, s) {
5
+ const { strict: n = !0 } = s ?? {}, e = `${t}.${n}`;
6
+ if (r.has(e))
7
+ return r.get(e);
8
+ const o = i.test(t) ? t.toLowerCase() === t ? !0 : n ? c(t) === t : !0 : !1;
9
+ return r.set(e, o), o;
41
10
  }
42
11
  export {
43
- z as boolToHex,
44
- m as bytesToHex,
45
- y as numberToHex,
46
- $ as stringToHex,
47
- B as toHex
12
+ h as isAddress,
13
+ r as isAddressCache
48
14
  };
package/dist/index43.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index37.cjs"),u=require("./index163.cjs"),i=require("./index217.cjs");function l(r,{docsPath:t,...e}){const n=(()=>{const o=i.getNodeError(r,e);return o instanceof u.UnknownNodeError?r:o})();return new c.CallExecutionError(n,{docsPath:t,...e})}exports.getCallError=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}exports.parseAccount=r;
package/dist/index43.js CHANGED
@@ -1,16 +1,6 @@
1
- import { CallExecutionError as c } from "./index37.js";
2
- import { UnknownNodeError as i } from "./index163.js";
3
- import { getNodeError as u } from "./index217.js";
4
- function a(r, { docsPath: t, ...o }) {
5
- const e = (() => {
6
- const n = u(r, o);
7
- return n instanceof i ? r : n;
8
- })();
9
- return new c(e, {
10
- docsPath: t,
11
- ...o
12
- });
1
+ function e(r) {
2
+ return typeof r == "string" ? { address: r, type: "json-rpc" } : r;
13
3
  }
14
4
  export {
15
- a as getCallError
5
+ e as parseAccount
16
6
  };
package/dist/index44.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function y(c,{format:n}){if(!n)return{};const r={};function i(e){const s=Object.keys(e);for(const t of s)t in c&&(r[t]=c[t]),e[t]&&typeof e[t]=="object"&&!Array.isArray(e[t])&&i(e[t])}const o=n(c||{});return i(o),r}exports.extract=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index41.cjs"),f=require("./index32.cjs"),a=require("./index45.cjs"),l=require("./index152.cjs"),A=require("./index42.cjs"),o=new l.LruMap(8192);function u(s,t){if(o.has(`${s}.${t}`))return o.get(`${s}.${t}`);const c=s.substring(2).toLowerCase(),n=a.keccak256(f.stringToBytes(c),"bytes"),r=c.split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&r[e]&&(r[e]=r[e].toUpperCase()),(n[e>>1]&15)>=8&&r[e+1]&&(r[e+1]=r[e+1].toUpperCase());const i=`0x${r.join("")}`;return o.set(`${s}.${t}`,i),i}function g(s,t){if(!A.isAddress(s,{strict:!1}))throw new d.InvalidAddressError({address:s});return u(s,t)}exports.checksumAddress=u;exports.getAddress=g;
package/dist/index44.js CHANGED
@@ -1,15 +1,24 @@
1
- function y(t, { format: r }) {
2
- if (!r)
3
- return {};
4
- const e = {};
5
- function i(c) {
6
- const s = Object.keys(c);
7
- for (const n of s)
8
- n in t && (e[n] = t[n]), c[n] && typeof c[n] == "object" && !Array.isArray(c[n]) && i(c[n]);
9
- }
10
- const o = r(t || {});
11
- return i(o), e;
1
+ import { InvalidAddressError as c } from "./index41.js";
2
+ import { stringToBytes as m } from "./index32.js";
3
+ import { keccak256 as p } from "./index45.js";
4
+ import { LruMap as u } from "./index152.js";
5
+ import { isAddress as $ } from "./index42.js";
6
+ const s = /* @__PURE__ */ new u(8192);
7
+ function h(t, o) {
8
+ if (s.has(`${t}.${o}`))
9
+ return s.get(`${t}.${o}`);
10
+ const i = t.substring(2).toLowerCase(), n = p(m(i), "bytes"), e = i.split("");
11
+ for (let r = 0; r < 40; r += 2)
12
+ n[r >> 1] >> 4 >= 8 && e[r] && (e[r] = e[r].toUpperCase()), (n[r >> 1] & 15) >= 8 && e[r + 1] && (e[r + 1] = e[r + 1].toUpperCase());
13
+ const f = `0x${e.join("")}`;
14
+ return s.set(`${t}.${o}`, f), f;
15
+ }
16
+ function w(t, o) {
17
+ if (!$(t, { strict: !1 }))
18
+ throw new c({ address: t });
19
+ return h(t, o);
12
20
  }
13
21
  export {
14
- y as extract
22
+ h as checksumAddress,
23
+ w as getAddress
15
24
  };
package/dist/index45.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index42.cjs"),i={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function a(e,f){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=y(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(d=>o.bytesToHex(d)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=o.numberToHex(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=o.numberToHex(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=o.numberToHex(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=o.numberToHex(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=o.numberToHex(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=o.numberToHex(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=i[e.type]),typeof e.value<"u"&&(n.value=o.numberToHex(e.value)),n}function y(e){return e.map(f=>({address:f.address,r:f.r?o.numberToHex(BigInt(f.r)):f.r,s:f.s?o.numberToHex(BigInt(f.s)):f.s,chainId:o.numberToHex(f.chainId),nonce:o.numberToHex(f.nonce),...typeof f.yParity<"u"?{yParity:o.numberToHex(f.yParity)}:{},...typeof f.v<"u"&&typeof f.yParity>"u"?{v:o.numberToHex(f.v)}:{}}))}exports.formatTransactionRequest=a;exports.rpcTransactionType=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index176.cjs"),o=require("./index46.cjs"),i=require("./index32.cjs"),n=require("./index33.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/index45.js CHANGED
@@ -1,27 +1,11 @@
1
- import { bytesToHex as o, numberToHex as i } from "./index42.js";
2
- const a = {
3
- legacy: "0x0",
4
- eip2930: "0x1",
5
- eip1559: "0x2",
6
- eip4844: "0x3",
7
- eip7702: "0x4"
8
- };
9
- function c(e, n) {
10
- const f = {};
11
- return typeof e.authorizationList < "u" && (f.authorizationList = y(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((d) => o(d)) : f.blobs = e.blobs), typeof e.data < "u" && (f.data = e.data), e.account && (f.from = e.account.address), typeof e.from < "u" && (f.from = e.from), typeof e.gas < "u" && (f.gas = i(e.gas)), typeof e.gasPrice < "u" && (f.gasPrice = i(e.gasPrice)), typeof e.maxFeePerBlobGas < "u" && (f.maxFeePerBlobGas = i(e.maxFeePerBlobGas)), typeof e.maxFeePerGas < "u" && (f.maxFeePerGas = i(e.maxFeePerGas)), typeof e.maxPriorityFeePerGas < "u" && (f.maxPriorityFeePerGas = i(e.maxPriorityFeePerGas)), typeof e.nonce < "u" && (f.nonce = i(e.nonce)), typeof e.to < "u" && (f.to = e.to), typeof e.type < "u" && (f.type = a[e.type]), typeof e.value < "u" && (f.value = i(e.value)), f;
12
- }
13
- function y(e) {
14
- return e.map((n) => ({
15
- address: n.address,
16
- r: n.r ? i(BigInt(n.r)) : n.r,
17
- s: n.s ? i(BigInt(n.s)) : n.s,
18
- chainId: i(n.chainId),
19
- nonce: i(n.nonce),
20
- ...typeof n.yParity < "u" ? { yParity: i(n.yParity) } : {},
21
- ...typeof n.v < "u" && typeof n.yParity > "u" ? { v: i(n.v) } : {}
22
- }));
1
+ import { keccak_256 as c } from "./index176.js";
2
+ import { isHex as i } from "./index46.js";
3
+ import { toBytes as m } from "./index32.js";
4
+ import { toHex as s } from "./index33.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);
23
8
  }
24
9
  export {
25
- c as formatTransactionRequest,
26
- a as rpcTransactionType
10
+ x as keccak256
27
11
  };
package/dist/index46.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index89.cjs"),l=new Map;function A({fn:a,id:o,shouldSplitBatch:h,wait:y=0,sort:u}){const i=async()=>{const e=n();f();const s=e.map(({args:t})=>t);s.length!==0&&a(s).then(t=>{u&&Array.isArray(t)&&t.sort(u);for(let c=0;c<e.length;c++){const{resolve:r}=e[c];r==null||r([t[c],t])}}).catch(t=>{for(let c=0;c<e.length;c++){const{reject:r}=e[c];r==null||r(t)}})},f=()=>l.delete(o),m=()=>n().map(({args:e})=>e),n=()=>l.get(o)||[],g=e=>l.set(o,[...n(),e]);return{flush:f,async schedule(e){const{promise:s,resolve:t,reject:c}=v.withResolvers();return(h==null?void 0:h([...m(),e]))&&i(),n().length>0?(g({args:e,resolve:t,reject:c}),s):(g({args:e,resolve:t,reject:c}),setTimeout(i,y),s)}}}exports.createBatchScheduler=A;
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/index46.js CHANGED
@@ -1,31 +1,6 @@
1
- import { withResolvers as y } from "./index89.js";
2
- const l = /* @__PURE__ */ new Map();
3
- function w({ fn: m, id: o, shouldSplitBatch: h, wait: A = 0, sort: u }) {
4
- const i = async () => {
5
- const e = s();
6
- f();
7
- const r = e.map(({ args: t }) => t);
8
- r.length !== 0 && m(r).then((t) => {
9
- u && Array.isArray(t) && t.sort(u);
10
- for (let c = 0; c < e.length; c++) {
11
- const { resolve: n } = e[c];
12
- n == null || n([t[c], t]);
13
- }
14
- }).catch((t) => {
15
- for (let c = 0; c < e.length; c++) {
16
- const { reject: n } = e[c];
17
- n == null || n(t);
18
- }
19
- });
20
- }, f = () => l.delete(o), p = () => s().map(({ args: e }) => e), s = () => l.get(o) || [], g = (e) => l.set(o, [...s(), e]);
21
- return {
22
- flush: f,
23
- async schedule(e) {
24
- const { promise: r, resolve: t, reject: c } = y();
25
- return (h == null ? void 0 : h([...p(), e])) && i(), s().length > 0 ? (g({ args: e, resolve: t, reject: c }), r) : (g({ args: e, resolve: t, reject: c }), setTimeout(i, A), r);
26
- }
27
- };
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");
28
3
  }
29
4
  export {
30
- w as createBatchScheduler
5
+ e as isHex
31
6
  };
package/dist/index47.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index150.cjs"),a=require("./index159.cjs"),f=require("./index157.cjs"),S=require("./index174.cjs"),c=require("./index42.cjs");function d(r){if(!(!r||r.length===0))return r.reduce((t,{slot:e,value:n})=>{if(e.length!==66)throw new a.InvalidBytesLengthError({size:e.length,targetSize:66,type:"hex"});if(n.length!==66)throw new a.InvalidBytesLengthError({size:n.length,targetSize:66,type:"hex"});return t[e]=n,t},{})}function u(r){const{balance:t,nonce:e,state:n,stateDiff:s,code:o}=r,i={};if(o!==void 0&&(i.code=o),t!==void 0&&(i.balance=c.numberToHex(t)),e!==void 0&&(i.nonce=c.numberToHex(e)),n!==void 0&&(i.state=d(n)),s!==void 0){if(i.state)throw new f.StateAssignmentConflictError;i.stateDiff=d(s)}return i}function h(r){if(!r)return;const t={};for(const{address:e,...n}of r){if(!S.isAddress(e,{strict:!1}))throw new l.InvalidAddressError({address:e});if(t[e])throw new f.AccountStateConflictError({address:e});t[e]=u(n)}return t}exports.serializeAccountStateOverride=u;exports.serializeStateMapping=d;exports.serializeStateOverride=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index141.cjs"),u=require("./index32.cjs"),c=require("./index33.cjs"),a=require("./index169.cjs"),h=require("./index45.cjs");function d(e){const{chainId:t,nonce:o,to:r}=e,s=e.contractAddress??e.address,n=h.keccak256(i.concatHex(["0x05",a.toRlp([t?c.numberToHex(t):"0x",s,o?c.numberToHex(o):"0x"])]));return r==="bytes"?u.hexToBytes(n):n}exports.hashAuthorization=d;