@gardenfi/utils 3.0.0-beta.1 → 3.0.0-beta.2

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 (458) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +36 -35
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +4 -4
  5. package/dist/index100.cjs +1 -1
  6. package/dist/index100.js +125 -3
  7. package/dist/index101.cjs +1 -1
  8. package/dist/index101.js +5 -26
  9. package/dist/index102.cjs +1 -2
  10. package/dist/index102.js +20 -23
  11. package/dist/index103.cjs +1 -1
  12. package/dist/index103.js +45 -9
  13. package/dist/index104.cjs +1 -1
  14. package/dist/index104.js +38 -8
  15. package/dist/index105.cjs +1 -1
  16. package/dist/index105.js +6 -10
  17. package/dist/index106.cjs +1 -1
  18. package/dist/index106.js +90 -11
  19. package/dist/index107.cjs +1 -1
  20. package/dist/index107.js +14 -13
  21. package/dist/index108.cjs +1 -1
  22. package/dist/index108.js +3 -14
  23. package/dist/index109.cjs +1 -1
  24. package/dist/index109.js +26 -4
  25. package/dist/index110.cjs +2 -1
  26. package/dist/index110.js +24 -6
  27. package/dist/index111.cjs +1 -1
  28. package/dist/index111.js +9 -18
  29. package/dist/index112.cjs +1 -1
  30. package/dist/index112.js +8 -13
  31. package/dist/index113.cjs +1 -1
  32. package/dist/index113.js +10 -6
  33. package/dist/index114.cjs +1 -1
  34. package/dist/index114.js +11 -7
  35. package/dist/index115.cjs +1 -1
  36. package/dist/index115.js +13 -21
  37. package/dist/index116.cjs +1 -1
  38. package/dist/index116.js +21 -7
  39. package/dist/index117.cjs +1 -1
  40. package/dist/index117.js +14 -21
  41. package/dist/index118.cjs +1 -1
  42. package/dist/index118.js +4 -17
  43. package/dist/index119.cjs +1 -1
  44. package/dist/index119.js +5 -39
  45. package/dist/index120.cjs +1 -1
  46. package/dist/index120.js +18 -21
  47. package/dist/index121.cjs +1 -1
  48. package/dist/index121.js +10 -80
  49. package/dist/index122.cjs +1 -1
  50. package/dist/index122.js +57 -10
  51. package/dist/index123.cjs +1 -1
  52. package/dist/index123.js +6 -58
  53. package/dist/index124.cjs +1 -1
  54. package/dist/index124.js +13 -13
  55. package/dist/index125.cjs +1 -1
  56. package/dist/index125.js +7 -8
  57. package/dist/index126.cjs +1 -1
  58. package/dist/index126.js +137 -20
  59. package/dist/index127.cjs +1 -1
  60. package/dist/index127.js +7 -6
  61. package/dist/index128.cjs +1 -1
  62. package/dist/index128.js +19 -33
  63. package/dist/index129.cjs +1 -1
  64. package/dist/index129.js +17 -32
  65. package/dist/index130.cjs +1 -1
  66. package/dist/index130.js +43 -9
  67. package/dist/index131.cjs +1 -1
  68. package/dist/index131.js +20 -49
  69. package/dist/index132.cjs +1 -1
  70. package/dist/index132.js +79 -18
  71. package/dist/index133.cjs +1 -1
  72. package/dist/index133.js +10 -105
  73. package/dist/index134.cjs +1 -1
  74. package/dist/index134.js +8 -63
  75. package/dist/index135.cjs +1 -1
  76. package/dist/index135.js +6 -9
  77. package/dist/index136.cjs +1 -1
  78. package/dist/index136.js +41 -71
  79. package/dist/index137.cjs +1 -2
  80. package/dist/index137.js +6 -3
  81. package/dist/index138.cjs +1 -1
  82. package/dist/index138.js +14 -9
  83. package/dist/index139.cjs +1 -1
  84. package/dist/index139.js +34 -13
  85. package/dist/index140.cjs +1 -1
  86. package/dist/index140.js +55 -4
  87. package/dist/index141.cjs +1 -1
  88. package/dist/index141.js +24 -11
  89. package/dist/index142.cjs +1 -1
  90. package/dist/index142.js +7 -2
  91. package/dist/index143.cjs +1 -1
  92. package/dist/index143.js +19 -32
  93. package/dist/index144.cjs +1 -1
  94. package/dist/index144.js +15 -21
  95. package/dist/index145.cjs +1 -1
  96. package/dist/index145.js +5 -5
  97. package/dist/index146.cjs +1 -1
  98. package/dist/index146.js +13 -5
  99. package/dist/index147.cjs +1 -1
  100. package/dist/index147.js +10 -5
  101. package/dist/index148.cjs +1 -9
  102. package/dist/index148.js +10 -33
  103. package/dist/index149.cjs +1 -1
  104. package/dist/index149.js +12 -3
  105. package/dist/index150.cjs +1 -1
  106. package/dist/index150.js +8 -18
  107. package/dist/index151.cjs +1 -1
  108. package/dist/index151.js +3 -20
  109. package/dist/index152.cjs +1 -1
  110. package/dist/index152.js +16 -35
  111. package/dist/index153.cjs +1 -1
  112. package/dist/index153.js +5 -8
  113. package/dist/index154.cjs +1 -4
  114. package/dist/index154.js +163 -186
  115. package/dist/index155.cjs +1 -1
  116. package/dist/index155.js +98 -22
  117. package/dist/index156.cjs +1 -1
  118. package/dist/index156.js +33 -161
  119. package/dist/index157.cjs +1 -1
  120. package/dist/index157.js +8 -126
  121. package/dist/index158.cjs +1 -1
  122. package/dist/index158.js +60 -27
  123. package/dist/index159.cjs +1 -1
  124. package/dist/index159.js +19 -55
  125. package/dist/index160.cjs +1 -1
  126. package/dist/index160.js +103 -188
  127. package/dist/index161.cjs +1 -1
  128. package/dist/index161.js +79 -4
  129. package/dist/index162.cjs +1 -1
  130. package/dist/index162.js +7 -18
  131. package/dist/index163.cjs +1 -1
  132. package/dist/index163.js +72 -3
  133. package/dist/index164.cjs +2 -1
  134. package/dist/index164.js +3 -17
  135. package/dist/index165.cjs +1 -1
  136. package/dist/index165.js +9 -12
  137. package/dist/index166.cjs +1 -1
  138. package/dist/index166.js +11 -32
  139. package/dist/index167.cjs +1 -1
  140. package/dist/index167.js +5 -3
  141. package/dist/index168.cjs +1 -1
  142. package/dist/index168.js +2 -28
  143. package/dist/index169.cjs +1 -1
  144. package/dist/index169.js +32 -9
  145. package/dist/index17.cjs +1 -1
  146. package/dist/index17.js +2 -2
  147. package/dist/index170.cjs +1 -1
  148. package/dist/index170.js +18 -22
  149. package/dist/index171.cjs +1 -1
  150. package/dist/index171.js +5 -28
  151. package/dist/index172.cjs +1 -1
  152. package/dist/index172.js +5 -3
  153. package/dist/index173.cjs +1 -1
  154. package/dist/index173.js +5 -6
  155. package/dist/index174.cjs +9 -1
  156. package/dist/index174.js +35 -6
  157. package/dist/index175.cjs +1 -1
  158. package/dist/index175.js +3 -33
  159. package/dist/index176.cjs +1 -1
  160. package/dist/index176.js +19 -5
  161. package/dist/index177.cjs +1 -1
  162. package/dist/index177.js +14 -31
  163. package/dist/index178.cjs +1 -1
  164. package/dist/index178.js +32 -46
  165. package/dist/index179.cjs +1 -1
  166. package/dist/index179.js +8 -32
  167. package/dist/index18.cjs +1 -1
  168. package/dist/index18.js +5 -5
  169. package/dist/index180.cjs +4 -1
  170. package/dist/index180.js +194 -8
  171. package/dist/index181.cjs +1 -1
  172. package/dist/index181.js +25 -40
  173. package/dist/index182.cjs +1 -1
  174. package/dist/index182.js +160 -50
  175. package/dist/index183.cjs +1 -1
  176. package/dist/index183.js +125 -102
  177. package/dist/index184.cjs +1 -1
  178. package/dist/index184.js +28 -3
  179. package/dist/index185.cjs +1 -1
  180. package/dist/index185.js +191 -5
  181. package/dist/index186.cjs +1 -1
  182. package/dist/index186.js +4 -4
  183. package/dist/index187.cjs +1 -1
  184. package/dist/index187.js +20 -17
  185. package/dist/index188.cjs +1 -1
  186. package/dist/index188.js +3 -6
  187. package/dist/index189.cjs +1 -1
  188. package/dist/index189.js +16 -8
  189. package/dist/index190.cjs +1 -1
  190. package/dist/index190.js +31 -100
  191. package/dist/index191.cjs +1 -1
  192. package/dist/index191.js +3 -6
  193. package/dist/index192.cjs +1 -1
  194. package/dist/index192.js +27 -6
  195. package/dist/index193.cjs +1 -1
  196. package/dist/index193.js +25 -27
  197. package/dist/index194.cjs +1 -1
  198. package/dist/index194.js +28 -34
  199. package/dist/index195.cjs +1 -1
  200. package/dist/index195.js +6 -13
  201. package/dist/index196.cjs +1 -1
  202. package/dist/index196.js +6 -78
  203. package/dist/index197.cjs +1 -1
  204. package/dist/index197.js +33 -2
  205. package/dist/index198.cjs +1 -1
  206. package/dist/index198.js +5 -19
  207. package/dist/index199.cjs +1 -1
  208. package/dist/index199.js +32 -166
  209. package/dist/index20.cjs +1 -1
  210. package/dist/index20.js +8 -8
  211. package/dist/index200.cjs +1 -1
  212. package/dist/index200.js +48 -16
  213. package/dist/index201.cjs +1 -1
  214. package/dist/index201.js +32 -10
  215. package/dist/index202.cjs +1 -1
  216. package/dist/index202.js +15 -23
  217. package/dist/index203.cjs +1 -1
  218. package/dist/index203.js +41 -17
  219. package/dist/index204.cjs +1 -1
  220. package/dist/index204.js +104 -15
  221. package/dist/index205.cjs +1 -1
  222. package/dist/index205.js +3 -6
  223. package/dist/index206.cjs +1 -1
  224. package/dist/index206.js +5 -13
  225. package/dist/index207.cjs +1 -1
  226. package/dist/index207.js +3 -10
  227. package/dist/index208.cjs +1 -1
  228. package/dist/index208.js +17 -16
  229. package/dist/index209.cjs +1 -1
  230. package/dist/index209.js +8 -24
  231. package/dist/index210.cjs +1 -1
  232. package/dist/index210.js +5 -46
  233. package/dist/index211.cjs +1 -1
  234. package/dist/index211.js +27 -9
  235. package/dist/index212.cjs +1 -2
  236. package/dist/index212.js +77 -40
  237. package/dist/index213.cjs +1 -1
  238. package/dist/index213.js +2 -2
  239. package/dist/index214.cjs +1 -1
  240. package/dist/index214.js +18 -5
  241. package/dist/index215.cjs +1 -1
  242. package/dist/index215.js +16 -9
  243. package/dist/index216.cjs +1 -1
  244. package/dist/index216.js +10 -19
  245. package/dist/index217.cjs +1 -1
  246. package/dist/index217.js +24 -8
  247. package/dist/index218.cjs +1 -1
  248. package/dist/index218.js +46 -66
  249. package/dist/index219.cjs +1 -1
  250. package/dist/index219.js +9 -65
  251. package/dist/index22.cjs +1 -1
  252. package/dist/index22.js +8 -8
  253. package/dist/index220.cjs +1 -1
  254. package/dist/index220.js +99 -184
  255. package/dist/index221.cjs +1 -1
  256. package/dist/index221.js +15 -27
  257. package/dist/index222.cjs +1 -1
  258. package/dist/index222.js +209 -71
  259. package/dist/index223.cjs +1 -1
  260. package/dist/index223.js +105 -37
  261. package/dist/index224.cjs +1 -1
  262. package/dist/index224.js +205 -15
  263. package/dist/index225.cjs +1 -1
  264. package/dist/index225.js +41 -12
  265. package/dist/index226.cjs +1 -1
  266. package/dist/index226.js +78 -11
  267. package/dist/index227.cjs +1 -1
  268. package/dist/index227.js +2 -13
  269. package/dist/index228.cjs +2 -1
  270. package/dist/index228.js +40 -18
  271. package/dist/index229.cjs +1 -1
  272. package/dist/index229.js +2 -109
  273. package/dist/index23.cjs +1 -1
  274. package/dist/index23.js +26 -12
  275. package/dist/index230.cjs +1 -1
  276. package/dist/index230.js +5 -6
  277. package/dist/index231.cjs +1 -1
  278. package/dist/index231.js +11 -7
  279. package/dist/index232.cjs +1 -1
  280. package/dist/index232.js +17 -101
  281. package/dist/index233.cjs +1 -1
  282. package/dist/index233.js +8 -26
  283. package/dist/index234.cjs +1 -1
  284. package/dist/index234.js +66 -16
  285. package/dist/index235.cjs +1 -1
  286. package/dist/index235.js +63 -212
  287. package/dist/index236.cjs +1 -1
  288. package/dist/index236.js +185 -39
  289. package/dist/index237.cjs +1 -1
  290. package/dist/index237.js +26 -76
  291. package/dist/index238.cjs +1 -1
  292. package/dist/index238.js +77 -2
  293. package/dist/index239.cjs +1 -1
  294. package/dist/index239.js +38 -9
  295. package/dist/index24.cjs +1 -1
  296. package/dist/index24.js +8 -59
  297. package/dist/index240.cjs +1 -1
  298. package/dist/index240.js +16 -19
  299. package/dist/index241.cjs +1 -2
  300. package/dist/index241.js +8 -61
  301. package/dist/index242.cjs +1 -1
  302. package/dist/index242.js +11 -14
  303. package/dist/index243.cjs +1 -1
  304. package/dist/index243.js +11 -67
  305. package/dist/index244.cjs +1 -1
  306. package/dist/index244.js +6 -657
  307. package/dist/index245.cjs +1 -1
  308. package/dist/index245.js +6 -206
  309. package/dist/index246.cjs +1 -1
  310. package/dist/index246.js +22 -173
  311. package/dist/index247.cjs +1 -1
  312. package/dist/index247.js +19 -4
  313. package/dist/index248.cjs +1 -1
  314. package/dist/index248.js +12 -2
  315. package/dist/index249.cjs +1 -0
  316. package/dist/index249.js +22 -0
  317. package/dist/index25.cjs +1 -16
  318. package/dist/index25.js +12 -113
  319. package/dist/index250.cjs +2 -0
  320. package/dist/index250.js +94 -0
  321. package/dist/index251.cjs +1 -0
  322. package/dist/index251.js +17 -0
  323. package/dist/index252.cjs +1 -0
  324. package/dist/index252.js +660 -0
  325. package/dist/index253.cjs +1 -0
  326. package/dist/index253.js +180 -0
  327. package/dist/index254.cjs +1 -0
  328. package/dist/index254.js +71 -0
  329. package/dist/index255.cjs +1 -0
  330. package/dist/index255.js +7 -0
  331. package/dist/index256.cjs +1 -0
  332. package/dist/index256.js +4 -0
  333. package/dist/index26.cjs +1 -1
  334. package/dist/index26.js +59 -30
  335. package/dist/index27.cjs +16 -1
  336. package/dist/index27.js +111 -24
  337. package/dist/index28.cjs +1 -1
  338. package/dist/index28.js +29 -7
  339. package/dist/index29.cjs +1 -1
  340. package/dist/index29.js +35 -35
  341. package/dist/index3.cjs +1 -1
  342. package/dist/index3.js +41 -24
  343. package/dist/index30.cjs +1 -1
  344. package/dist/index30.js +9 -9
  345. package/dist/index31.cjs +1 -1
  346. package/dist/index31.js +2 -2
  347. package/dist/index35.cjs +1 -1
  348. package/dist/index35.js +1 -1
  349. package/dist/index37.cjs +1 -1
  350. package/dist/index37.js +11 -11
  351. package/dist/index38.cjs +1 -1
  352. package/dist/index38.js +3 -3
  353. package/dist/index39.cjs +1 -1
  354. package/dist/index39.js +3 -3
  355. package/dist/index40.cjs +1 -1
  356. package/dist/index40.js +3 -3
  357. package/dist/index42.cjs +1 -1
  358. package/dist/index42.js +2 -2
  359. package/dist/index43.cjs +1 -1
  360. package/dist/index43.js +2 -2
  361. package/dist/index45.cjs +1 -1
  362. package/dist/index45.js +15 -15
  363. package/dist/index46.cjs +1 -1
  364. package/dist/index46.js +1 -1
  365. package/dist/index47.cjs +1 -1
  366. package/dist/index47.js +4 -4
  367. package/dist/index48.cjs +1 -1
  368. package/dist/index48.js +14 -17
  369. package/dist/index49.cjs +1 -1
  370. package/dist/index49.js +3 -3
  371. package/dist/index51.cjs +1 -1
  372. package/dist/index51.js +8 -8
  373. package/dist/index54.cjs +1 -1
  374. package/dist/index54.js +14 -14
  375. package/dist/index56.cjs +1 -1
  376. package/dist/index56.js +60 -56
  377. package/dist/index58.cjs +1 -1
  378. package/dist/index58.js +1 -1
  379. package/dist/index60.cjs +1 -1
  380. package/dist/index60.js +8 -8
  381. package/dist/index62.cjs +1 -1
  382. package/dist/index62.js +2 -2
  383. package/dist/index63.cjs +1 -1
  384. package/dist/index63.js +3 -3
  385. package/dist/index64.cjs +1 -1
  386. package/dist/index64.js +131 -76
  387. package/dist/index65.cjs +1 -1
  388. package/dist/index65.js +2 -2
  389. package/dist/index66.cjs +1 -1
  390. package/dist/index66.js +76 -6
  391. package/dist/index67.cjs +1 -1
  392. package/dist/index67.js +13 -21
  393. package/dist/index68.cjs +1 -1
  394. package/dist/index68.js +51 -8
  395. package/dist/index69.cjs +1 -1
  396. package/dist/index69.js +7 -31
  397. package/dist/index70.cjs +1 -1
  398. package/dist/index70.js +7 -7
  399. package/dist/index71.cjs +1 -1
  400. package/dist/index71.js +21 -16
  401. package/dist/index72.cjs +1 -1
  402. package/dist/index72.js +8 -73
  403. package/dist/index73.cjs +1 -1
  404. package/dist/index73.js +31 -35
  405. package/dist/index74.cjs +1 -1
  406. package/dist/index74.js +15 -15
  407. package/dist/index75.cjs +1 -1
  408. package/dist/index75.js +69 -61
  409. package/dist/index76.cjs +1 -1
  410. package/dist/index76.js +35 -11
  411. package/dist/index77.cjs +1 -1
  412. package/dist/index77.js +15 -13
  413. package/dist/index78.cjs +1 -3
  414. package/dist/index78.js +72 -92
  415. package/dist/index79.cjs +1 -1
  416. package/dist/index79.js +11 -23
  417. package/dist/index80.cjs +1 -1
  418. package/dist/index80.js +28 -32
  419. package/dist/index81.cjs +2 -1
  420. package/dist/index81.js +118 -42
  421. package/dist/index82.cjs +1 -1
  422. package/dist/index82.js +13 -5
  423. package/dist/index83.cjs +1 -1
  424. package/dist/index83.js +24 -151
  425. package/dist/index84.cjs +1 -20
  426. package/dist/index84.js +31 -324
  427. package/dist/index85.cjs +1 -3
  428. package/dist/index85.js +42 -449
  429. package/dist/index86.cjs +1 -1
  430. package/dist/index86.js +6 -64
  431. package/dist/index87.cjs +1 -1
  432. package/dist/index87.js +101 -35
  433. package/dist/index88.cjs +1 -1
  434. package/dist/index88.js +36 -14
  435. package/dist/index89.cjs +1 -1
  436. package/dist/index89.js +9 -2
  437. package/dist/index90.cjs +1 -1
  438. package/dist/index90.js +19 -15
  439. package/dist/index91.cjs +1 -1
  440. package/dist/index91.js +2 -11
  441. package/dist/index92.cjs +1 -1
  442. package/dist/index92.js +72 -122
  443. package/dist/index93.cjs +1 -1
  444. package/dist/index93.js +15 -5
  445. package/dist/index94.cjs +1 -1
  446. package/dist/index94.js +151 -21
  447. package/dist/index95.cjs +20 -1
  448. package/dist/index95.js +326 -45
  449. package/dist/index96.cjs +3 -1
  450. package/dist/index96.js +451 -38
  451. package/dist/index97.cjs +1 -1
  452. package/dist/index97.js +64 -6
  453. package/dist/index98.cjs +1 -1
  454. package/dist/index98.js +15 -87
  455. package/dist/index99.cjs +1 -1
  456. package/dist/index99.js +10 -14
  457. package/dist/src/lib/utils.d.ts +15 -0
  458. package/package.json +3 -3
package/dist/index29.js CHANGED
@@ -3,10 +3,10 @@ import { parseAccount as U } from "./index32.js";
3
3
  import { multicall3Abi as z } from "./index21.js";
4
4
  import { aggregate3Signature as X } from "./index33.js";
5
5
  import { deploylessCallViaBytecodeBytecode as Y, deploylessCallViaFactoryBytecode as Z, multicall3Bytecode as tt } from "./index34.js";
6
- import { BaseError as R } from "./index35.js";
6
+ import { BaseError as N } from "./index35.js";
7
7
  import { ClientChainNotConfiguredError as H, ChainDoesNotSupportContract as at } from "./index36.js";
8
- import { CounterfactualDeploymentFailedError as et, RawContractError as rt } from "./index37.js";
9
- import { decodeFunctionResult as ot } from "./index38.js";
8
+ import { CounterfactualDeploymentFailedError as et, RawContractError as ot } from "./index37.js";
9
+ import { decodeFunctionResult as rt } from "./index38.js";
10
10
  import { encodeDeployData as L } from "./index39.js";
11
11
  import { encodeFunctionData as ct } from "./index40.js";
12
12
  import { getChainContractAddress as nt } from "./index41.js";
@@ -20,43 +20,43 @@ import { assertRequest as ft } from "./index48.js";
20
20
  import { parseAbi as G } from "./index49.js";
21
21
  async function zt(t, a) {
22
22
  var q, E, O, P;
23
- const { account: e = t.account, authorizationList: s, batch: i = !!((q = t.batch) != null && q.multicall), blockNumber: l, blockTag: C = t.experimental_blockTag ?? "latest", accessList: D, blobs: B, blockOverrides: b, code: h, data: c, factory: m, factoryData: u, gas: F, gasPrice: k, maxFeePerBlobGas: y, maxFeePerGas: g, maxPriorityFeePerGas: p, nonce: w, to: r, value: $, stateOverride: W, ...I } = a, x = e ? U(e) : void 0;
23
+ const { account: e = t.account, authorizationList: s, batch: i = !!((q = t.batch) != null && q.multicall), blockNumber: l, blockTag: C = t.experimental_blockTag ?? "latest", accessList: x, blobs: D, blockOverrides: b, code: h, data: c, factory: m, factoryData: u, gas: B, gasPrice: k, maxFeePerBlobGas: y, maxFeePerGas: g, maxPriorityFeePerGas: p, nonce: w, to: o, value: $, stateOverride: W, ...I } = a, R = e ? U(e) : void 0;
24
24
  if (h && (m || u))
25
- throw new R("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
26
- if (h && r)
27
- throw new R("Cannot provide both `code` & `to` as parameters.");
28
- const S = h && c, A = m && u && r && c, _ = S || A, J = S ? M({
25
+ throw new N("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
26
+ if (h && o)
27
+ throw new N("Cannot provide both `code` & `to` as parameters.");
28
+ const S = h && c, A = m && u && o && c, _ = S || A, J = S ? M({
29
29
  code: h,
30
30
  data: c
31
31
  }) : A ? bt({
32
32
  data: c,
33
33
  factory: m,
34
34
  factoryData: u,
35
- to: r
35
+ to: o
36
36
  }) : c;
37
37
  try {
38
38
  ft(a);
39
- const o = (typeof l == "bigint" ? j(l) : void 0) || C, d = b ? Q(b) : void 0, f = dt(W), T = (P = (O = (E = t.chain) == null ? void 0 : E.formatters) == null ? void 0 : O.transactionRequest) == null ? void 0 : P.format, N = (T || lt)({
39
+ const r = (typeof l == "bigint" ? j(l) : void 0) || C, d = b ? Q(b) : void 0, f = dt(W), T = (P = (O = (E = t.chain) == null ? void 0 : E.formatters) == null ? void 0 : O.transactionRequest) == null ? void 0 : P.format, v = (T || lt)({
40
40
  // Pick out extra data that might exist on the chain's transaction request type.
41
41
  ...it(I, { format: T }),
42
- from: x == null ? void 0 : x.address,
43
- accessList: D,
42
+ accessList: x,
43
+ account: R,
44
44
  authorizationList: s,
45
- blobs: B,
45
+ blobs: D,
46
46
  data: J,
47
- gas: F,
47
+ gas: B,
48
48
  gasPrice: k,
49
49
  maxFeePerBlobGas: y,
50
50
  maxFeePerGas: g,
51
51
  maxPriorityFeePerGas: p,
52
52
  nonce: w,
53
- to: _ ? void 0 : r,
53
+ to: _ ? void 0 : o,
54
54
  value: $
55
- });
56
- if (i && mt({ request: N }) && !f && !d)
55
+ }, "call");
56
+ if (i && mt({ request: v }) && !f && !d)
57
57
  try {
58
58
  return await pt(t, {
59
- ...N,
59
+ ...v,
60
60
  blockNumber: l,
61
61
  blockTag: C
62
62
  });
@@ -66,8 +66,8 @@ async function zt(t, a) {
66
66
  }
67
67
  const K = (() => {
68
68
  const n = [
69
- N,
70
- o
69
+ v,
70
+ r
71
71
  ];
72
72
  return f && d ? [...n, f, d] : f ? [...n, f] : d ? [...n, {}, d] : n;
73
73
  })(), V = await t.request({
@@ -75,13 +75,13 @@ async function zt(t, a) {
75
75
  params: K
76
76
  });
77
77
  return V === "0x" ? { data: void 0 } : { data: V };
78
- } catch (v) {
79
- const o = ht(v), { offchainLookup: d, offchainLookupSignature: f } = await import("./index30.js");
80
- if (t.ccipRead !== !1 && (o == null ? void 0 : o.slice(0, 10)) === f && r)
81
- return { data: await d(t, { data: o, to: r }) };
82
- throw _ && (o == null ? void 0 : o.slice(0, 10)) === "0x101bb98d" ? new et({ factory: m }) : st(v, {
78
+ } catch (F) {
79
+ const r = ht(F), { offchainLookup: d, offchainLookupSignature: f } = await import("./index30.js");
80
+ if (t.ccipRead !== !1 && (r == null ? void 0 : r.slice(0, 10)) === f && o)
81
+ return { data: await d(t, { data: r, to: o }) };
82
+ throw _ && (r == null ? void 0 : r.slice(0, 10)) === "0x101bb98d" ? new et({ factory: m }) : st(F, {
83
83
  ...a,
84
- account: x,
84
+ account: R,
85
85
  chain: t.chain
86
86
  });
87
87
  }
@@ -92,7 +92,7 @@ function mt({ request: t }) {
92
92
  }
93
93
  async function pt(t, a) {
94
94
  var k;
95
- const { batchSize: e = 1024, deployless: s = !1, wait: i = 0 } = typeof ((k = t.batch) == null ? void 0 : k.multicall) == "object" ? t.batch.multicall : {}, { blockNumber: l, blockTag: C = t.experimental_blockTag ?? "latest", data: D, to: B } = a, b = (() => {
95
+ const { batchSize: e = 1024, deployless: s = !1, wait: i = 0 } = typeof ((k = t.batch) == null ? void 0 : k.multicall) == "object" ? t.batch.multicall : {}, { blockNumber: l, blockTag: C = t.experimental_blockTag ?? "latest", data: x, to: D } = a, b = (() => {
96
96
  if (s)
97
97
  return null;
98
98
  if (a.multicallAddress)
@@ -111,10 +111,10 @@ async function pt(t, a) {
111
111
  return y.reduce((p, { data: w }) => p + (w.length - 2), 0) > e * 2;
112
112
  },
113
113
  fn: async (y) => {
114
- const g = y.map((r) => ({
114
+ const g = y.map((o) => ({
115
115
  allowFailure: !0,
116
- callData: r.data,
117
- target: r.to
116
+ callData: o.data,
117
+ target: o.to
118
118
  })), p = ct({
119
119
  abi: z,
120
120
  args: [g],
@@ -133,16 +133,16 @@ async function pt(t, a) {
133
133
  c
134
134
  ]
135
135
  });
136
- return ot({
136
+ return rt({
137
137
  abi: z,
138
138
  args: [g],
139
139
  functionName: "aggregate3",
140
140
  data: w || "0x"
141
141
  });
142
142
  }
143
- }), [{ returnData: u, success: F }] = await m({ data: D, to: B });
144
- if (!F)
145
- throw new rt({ data: u });
143
+ }), [{ returnData: u, success: B }] = await m({ data: x, to: D });
144
+ if (!B)
145
+ throw new ot({ data: u });
146
146
  return u === "0x" ? { data: void 0 } : { data: u };
147
147
  }
148
148
  function M(t) {
@@ -163,7 +163,7 @@ function bt(t) {
163
163
  }
164
164
  function ht(t) {
165
165
  var e;
166
- if (!(t instanceof R))
166
+ if (!(t instanceof N))
167
167
  return;
168
168
  const a = t.walk();
169
169
  return typeof (a == null ? void 0 : a.data) == "object" ? (e = a.data) == null ? void 0 : e.data : a.data;
package/dist/index3.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("jwt-decode"),u=t=>t.startsWith("0x")?t:`0x${t}`,l=t=>`Bearer ${t}`,h=t=>new Promise(e=>setTimeout(e,t)),T=t=>{try{return c.jwtDecode(t)}catch{return}};var i=(t=>(t.MAINNET="mainnet",t.TESTNET="testnet",t.LOCALNET="localnet",t))(i||{}),o=(t=>(t.MAINNET="mainnet",t.TESTNET="testnet",t.LOCALNET="localnet",t))(o||{});const x=t=>t.startsWith("0x")?t:`0x${t}`;function f(t,e="big"){if(t=t.replace("0x",""),t.length!==64)throw new Error("Invalid hash length");const r=[];for(let n=0;n<8;n++){const s=t.slice(n*8,(n+1)*8).match(/.{2}/g);e==="little"&&s.reverse();const a=s.join("");r.push(parseInt(a,16))}return r}function y(t){return t.startsWith("0x")?t.slice(2):t}const d=(t,e)=>t&&typeof t=="object"&&e.every(r=>r in t);exports.Authorization=l;exports.Environment=o;exports.Network=i;exports.add0x=x;exports.hasKeys=d;exports.hexToU32Array=f;exports.parseJwt=T;exports.sleep=h;exports.trim0x=y;exports.with0x=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("jwt-decode"),h=t=>t.startsWith("0x")?t:`0x${t}`,f=t=>`Bearer ${t}`,T=t=>new Promise(n=>setTimeout(n,t)),y=t=>{try{return l.jwtDecode(t)}catch{return}};var a=(t=>(t.MAINNET="mainnet",t.TESTNET="testnet",t.LOCALNET="localnet",t))(a||{}),u=(t=>(t.MAINNET="mainnet",t.TESTNET="testnet",t.LOCALNET="localnet",t))(u||{});const x=t=>t.startsWith("0x")?t:`0x${t}`;function p(t,n="big"){if(t=t.replace("0x",""),t.length!==64)throw new Error("Invalid hash length");const e=[];for(let o=0;o<8;o++){const s=t.slice(o*8,(o+1)*8).match(/.{2}/g);n==="little"&&s.reverse();const c=s.join("");e.push(parseInt(c,16))}const r=(o,i,s,c)=>BigInt(o)<<96n|BigInt(i)<<64n|BigInt(s)<<32n|BigInt(c);return[r(e[0],e[1],e[2],e[3]),r(e[4],e[5],e[6],e[7])]}function A(t,n="big"){if(t=t.replace("0x",""),t.length!==64)throw new Error("Invalid hash length");const e=[];for(let r=0;r<8;r++){const i=t.slice(r*8,(r+1)*8).match(/.{2}/g);n==="little"&&i.reverse();const s=i.join("");e.push(parseInt(s,16))}return e}function d(t){return t.startsWith("0x")?t.slice(2):t}const w=(t,n)=>t&&typeof t=="object"&&n.every(e=>e in t);exports.Authorization=f;exports.Environment=u;exports.Network=a;exports.add0x=x;exports.hasKeys=w;exports.hexToU128Array=p;exports.hexToU32Array=A;exports.parseJwt=y;exports.sleep=T;exports.trim0x=d;exports.with0x=h;
package/dist/index3.js CHANGED
@@ -1,38 +1,55 @@
1
- import { jwtDecode as i } from "jwt-decode";
2
- const h = (t) => t.startsWith("0x") ? t : `0x${t}`, T = (t) => `Bearer ${t}`, f = (t) => new Promise((e) => setTimeout(e, t)), x = (t) => {
1
+ import { jwtDecode as a } from "jwt-decode";
2
+ const f = (t) => t.startsWith("0x") ? t : `0x${t}`, T = (t) => `Bearer ${t}`, p = (t) => new Promise((n) => setTimeout(n, t)), I = (t) => {
3
3
  try {
4
- return i(t);
4
+ return a(t);
5
5
  } catch {
6
6
  return;
7
7
  }
8
8
  };
9
- var o = /* @__PURE__ */ ((t) => (t.MAINNET = "mainnet", t.TESTNET = "testnet", t.LOCALNET = "localnet", t))(o || {}), a = /* @__PURE__ */ ((t) => (t.MAINNET = "mainnet", t.TESTNET = "testnet", t.LOCALNET = "localnet", t))(a || {});
10
- const p = (t) => t.startsWith("0x") ? t : `0x${t}`;
11
- function E(t, e = "big") {
9
+ var u = /* @__PURE__ */ ((t) => (t.MAINNET = "mainnet", t.TESTNET = "testnet", t.LOCALNET = "localnet", t))(u || {}), l = /* @__PURE__ */ ((t) => (t.MAINNET = "mainnet", t.TESTNET = "testnet", t.LOCALNET = "localnet", t))(l || {});
10
+ const x = (t) => t.startsWith("0x") ? t : `0x${t}`;
11
+ function y(t, n = "big") {
12
12
  if (t = t.replace("0x", ""), t.length !== 64)
13
13
  throw new Error("Invalid hash length");
14
- const r = [];
15
- for (let n = 0; n < 8; n++) {
16
- const s = t.slice(n * 8, (n + 1) * 8).match(/.{2}/g);
17
- e === "little" && s.reverse();
18
- const c = s.join("");
19
- r.push(parseInt(c, 16));
14
+ const e = [];
15
+ for (let s = 0; s < 8; s++) {
16
+ const c = t.slice(s * 8, (s + 1) * 8).match(/.{2}/g);
17
+ n === "little" && c.reverse();
18
+ const i = c.join("");
19
+ e.push(parseInt(i, 16));
20
20
  }
21
- return r;
21
+ const r = (s, o, c, i) => BigInt(s) << 96n | BigInt(o) << 64n | BigInt(c) << 32n | BigInt(i);
22
+ return [
23
+ r(e[0], e[1], e[2], e[3]),
24
+ r(e[4], e[5], e[6], e[7])
25
+ ];
22
26
  }
23
- function m(t) {
27
+ function A(t, n = "big") {
28
+ if (t = t.replace("0x", ""), t.length !== 64)
29
+ throw new Error("Invalid hash length");
30
+ const e = [];
31
+ for (let r = 0; r < 8; r++) {
32
+ const o = t.slice(r * 8, (r + 1) * 8).match(/.{2}/g);
33
+ n === "little" && o.reverse();
34
+ const c = o.join("");
35
+ e.push(parseInt(c, 16));
36
+ }
37
+ return e;
38
+ }
39
+ function E(t) {
24
40
  return t.startsWith("0x") ? t.slice(2) : t;
25
41
  }
26
- const y = (t, e) => t && typeof t == "object" && e.every((r) => r in t);
42
+ const m = (t, n) => t && typeof t == "object" && n.every((e) => e in t);
27
43
  export {
28
44
  T as Authorization,
29
- a as Environment,
30
- o as Network,
31
- p as add0x,
32
- y as hasKeys,
33
- E as hexToU32Array,
34
- x as parseJwt,
35
- f as sleep,
36
- m as trim0x,
37
- h as with0x
45
+ l as Environment,
46
+ u as Network,
47
+ x as add0x,
48
+ m as hasKeys,
49
+ y as hexToU128Array,
50
+ A as hexToU32Array,
51
+ I as parseJwt,
52
+ p as sleep,
53
+ E as trim0x,
54
+ f as with0x
38
55
  };
package/dist/index30.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./index29.cjs"),p=require("./index178.cjs"),h=require("./index134.cjs"),g=require("./index144.cjs"),E=require("./index160.cjs"),L=require("./index103.cjs"),R=require("./index111.cjs"),S=require("./index172.cjs"),q=require("./index179.cjs"),O=require("./index89.cjs"),T="0x556f1830",w={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function x(c,{blockNumber:u,blockTag:l,data:a,to:n}){const{args:i}=g.decodeErrorResult({data:a,abi:[w]}),[r,o,s,d,t]=i,{ccipRead:e}=c,y=e&&typeof(e==null?void 0:e.request)=="function"?e.request:b;try{if(!L.isAddressEqual(n,r))throw new p.OffchainLookupSenderMismatchError({sender:r,to:n});const f=o.includes(q.localBatchGatewayUrl)?await q.localBatchGatewayRequest({data:s,ccipRequest:y}):await y({data:s,sender:r,urls:o}),{data:m}=await k.call(c,{blockNumber:u,blockTag:l,data:R.concat([d,E.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[f,t])]),to:n});return m}catch(f){throw new p.OffchainLookupError({callbackSelector:d,cause:f,data:a,extraData:t,sender:r,urls:o})}}async function b({data:c,sender:u,urls:l}){var n;let a=new Error("An unknown error occurred.");for(let i=0;i<l.length;i++){const r=l[i],o=r.includes("{data}")?"GET":"POST",s=o==="POST"?{data:c,sender:u}:void 0,d=o==="POST"?{"Content-Type":"application/json"}:{};try{const t=await fetch(r.replace("{sender}",u.toLowerCase()).replace("{data}",c),{body:JSON.stringify(s),headers:d,method:o});let e;if((n=t.headers.get("Content-Type"))!=null&&n.startsWith("application/json")?e=(await t.json()).data:e=await t.text(),!t.ok){a=new h.HttpRequestError({body:s,details:e!=null&&e.error?O.stringify(e.error):t.statusText,headers:t.headers,status:t.status,url:r});continue}if(!S.isHex(e)){a=new p.OffchainLookupResponseMalformedError({result:e,url:r});continue}return e}catch(t){a=new h.HttpRequestError({body:s,details:t.message,url:r})}}throw a}exports.ccipRequest=b;exports.offchainLookup=x;exports.offchainLookupAbiItem=w;exports.offchainLookupSignature=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./index29.cjs"),p=require("./index200.cjs"),h=require("./index161.cjs"),g=require("./index170.cjs"),E=require("./index185.cjs"),L=require("./index111.cjs"),R=require("./index120.cjs"),S=require("./index151.cjs"),q=require("./index201.cjs"),O=require("./index91.cjs"),T="0x556f1830",w={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function x(c,{blockNumber:u,blockTag:l,data:a,to:n}){const{args:i}=g.decodeErrorResult({data:a,abi:[w]}),[r,o,s,d,t]=i,{ccipRead:e}=c,y=e&&typeof(e==null?void 0:e.request)=="function"?e.request:b;try{if(!L.isAddressEqual(n,r))throw new p.OffchainLookupSenderMismatchError({sender:r,to:n});const f=o.includes(q.localBatchGatewayUrl)?await q.localBatchGatewayRequest({data:s,ccipRequest:y}):await y({data:s,sender:r,urls:o}),{data:m}=await k.call(c,{blockNumber:u,blockTag:l,data:R.concat([d,E.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[f,t])]),to:n});return m}catch(f){throw new p.OffchainLookupError({callbackSelector:d,cause:f,data:a,extraData:t,sender:r,urls:o})}}async function b({data:c,sender:u,urls:l}){var n;let a=new Error("An unknown error occurred.");for(let i=0;i<l.length;i++){const r=l[i],o=r.includes("{data}")?"GET":"POST",s=o==="POST"?{data:c,sender:u}:void 0,d=o==="POST"?{"Content-Type":"application/json"}:{};try{const t=await fetch(r.replace("{sender}",u.toLowerCase()).replace("{data}",c),{body:JSON.stringify(s),headers:d,method:o});let e;if((n=t.headers.get("Content-Type"))!=null&&n.startsWith("application/json")?e=(await t.json()).data:e=await t.text(),!t.ok){a=new h.HttpRequestError({body:s,details:e!=null&&e.error?O.stringify(e.error):t.statusText,headers:t.headers,status:t.status,url:r});continue}if(!S.isHex(e)){a=new p.OffchainLookupResponseMalformedError({result:e,url:r});continue}return e}catch(t){a=new h.HttpRequestError({body:s,details:t.message,url:r})}}throw a}exports.ccipRequest=b;exports.offchainLookup=x;exports.offchainLookupAbiItem=w;exports.offchainLookupSignature=T;
package/dist/index30.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { call as h } from "./index29.js";
2
- import { OffchainLookupSenderMismatchError as w, OffchainLookupError as b, OffchainLookupResponseMalformedError as k } from "./index178.js";
3
- import { HttpRequestError as d } from "./index134.js";
4
- import { decodeErrorResult as g } from "./index144.js";
5
- import { encodeAbiParameters as q } from "./index160.js";
6
- import { isAddressEqual as E } from "./index103.js";
7
- import { concat as L } from "./index111.js";
8
- import { isHex as O } from "./index172.js";
9
- import { localBatchGatewayUrl as x, localBatchGatewayRequest as S } from "./index179.js";
10
- import { stringify as T } from "./index89.js";
2
+ import { OffchainLookupSenderMismatchError as w, OffchainLookupError as b, OffchainLookupResponseMalformedError as k } from "./index200.js";
3
+ import { HttpRequestError as d } from "./index161.js";
4
+ import { decodeErrorResult as g } from "./index170.js";
5
+ import { encodeAbiParameters as q } from "./index185.js";
6
+ import { isAddressEqual as E } from "./index111.js";
7
+ import { concat as L } from "./index120.js";
8
+ import { isHex as O } from "./index151.js";
9
+ import { localBatchGatewayUrl as x, localBatchGatewayRequest as S } from "./index201.js";
10
+ import { stringify as T } from "./index91.js";
11
11
  const I = "0x556f1830", R = {
12
12
  name: "OffchainLookup",
13
13
  type: "error",
package/dist/index31.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index210.cjs"),a=require("./index211.cjs");function i(t){return{...typeof t.baseFeePerGas=="bigint"&&{baseFeePerGas:e.fromNumber(t.baseFeePerGas)},...typeof t.blobBaseFee=="bigint"&&{blobBaseFee:e.fromNumber(t.blobBaseFee)},...typeof t.feeRecipient=="string"&&{feeRecipient:t.feeRecipient},...typeof t.gasLimit=="bigint"&&{gasLimit:e.fromNumber(t.gasLimit)},...typeof t.number=="bigint"&&{number:e.fromNumber(t.number)},...typeof t.prevRandao=="bigint"&&{prevRandao:e.fromNumber(t.prevRandao)},...typeof t.time=="bigint"&&{time:e.fromNumber(t.time)},...t.withdrawals&&{withdrawals:t.withdrawals.map(a.toRpc)}}}exports.toRpc=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index218.cjs"),a=require("./index219.cjs");function i(t){return{...typeof t.baseFeePerGas=="bigint"&&{baseFeePerGas:e.fromNumber(t.baseFeePerGas)},...typeof t.blobBaseFee=="bigint"&&{blobBaseFee:e.fromNumber(t.blobBaseFee)},...typeof t.feeRecipient=="string"&&{feeRecipient:t.feeRecipient},...typeof t.gasLimit=="bigint"&&{gasLimit:e.fromNumber(t.gasLimit)},...typeof t.number=="bigint"&&{number:e.fromNumber(t.number)},...typeof t.prevRandao=="bigint"&&{prevRandao:e.fromNumber(t.prevRandao)},...typeof t.time=="bigint"&&{time:e.fromNumber(t.time)},...t.withdrawals&&{withdrawals:t.withdrawals.map(a.toRpc)}}}exports.toRpc=i;
package/dist/index31.js CHANGED
@@ -1,5 +1,5 @@
1
- import { fromNumber as a } from "./index210.js";
2
- import { toRpc as e } from "./index211.js";
1
+ import { fromNumber as a } from "./index218.js";
2
+ import { toRpc as e } from "./index219.js";
3
3
  function n(t) {
4
4
  return {
5
5
  ...typeof t.baseFeePerGas == "bigint" && {
package/dist/index35.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index142.cjs");let i={getDocsUrl:({docsBaseUrl:s,docsPath:t="",docsSlug:e})=>t?`${s??"https://viem.sh"}${t}${e?`#${e}`:""}`:void 0,version:`viem@${l.version}`};class u extends Error{constructor(t,e={}){var o;const r=(()=>{var c;return e.cause instanceof u?e.cause.details:(c=e.cause)!=null&&c.message?e.cause.message:e.details})(),n=e.cause instanceof u&&e.cause.docsPath||e.docsPath,a=(o=i.getDocsUrl)==null?void 0:o.call(i,{...e,docsPath:n}),b=[t||"An error occurred.","",...e.metaMessages?[...e.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...i.version?[`Version: ${i.version}`]:[]].join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index168.cjs");let i={getDocsUrl:({docsBaseUrl:s,docsPath:t="",docsSlug:e})=>t?`${s??"https://viem.sh"}${t}${e?`#${e}`:""}`:void 0,version:`viem@${l.version}`};class u extends Error{constructor(t,e={}){var o;const r=(()=>{var c;return e.cause instanceof u?e.cause.details:(c=e.cause)!=null&&c.message?e.cause.message:e.details})(),n=e.cause instanceof u&&e.cause.docsPath||e.docsPath,a=(o=i.getDocsUrl)==null?void 0:o.call(i,{...e,docsPath:n}),b=[t||"An error occurred.","",...e.metaMessages?[...e.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...i.version?[`Version: ${i.version}`]:[]].join(`
2
2
  `);super(b,e.cause?{cause:e.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=n,this.metaMessages=e.metaMessages,this.name=e.name??this.name,this.shortMessage=t,this.version=l.version}walk(t){return d(this,t)}}function d(s,t){return t!=null&&t(s)?s:s&&typeof s=="object"&&"cause"in s&&s.cause!==void 0?d(s.cause,t):t?null:s}exports.BaseError=u;
package/dist/index35.js CHANGED
@@ -1,4 +1,4 @@
1
- import { version as l } from "./index142.js";
1
+ import { version as l } from "./index168.js";
2
2
  let i = {
3
3
  getDocsUrl: ({ docsBaseUrl: s, docsPath: t = "", docsSlug: e }) => t ? `${s ?? "https://viem.sh"}${t}${e ? `#${e}` : ""}` : void 0,
4
4
  version: `viem@${l}`
package/dist/index37.cjs CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./index32.cjs"),C=require("./index143.cjs"),P=require("./index144.cjs"),v=require("./index139.cjs"),E=require("./index145.cjs"),$=require("./index72.cjs"),j=require("./index146.cjs"),h=require("./index147.cjs"),x=require("./index84.cjs"),m=require("./index35.cjs"),F=require("./index148.cjs"),w=require("./index78.cjs"),O=require("./index149.cjs");class q extends m.BaseError{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}){var p;const b=o?A.parseAccount(o):void 0;let y=w.prettyPrint({from:b==null?void 0:b.address,to:s,value:typeof d<"u"&&`${j.formatEther(d)} ${((p=n==null?void 0:n.nativeCurrency)==null?void 0:p.symbol)||"ETH"}`,data:l,gas:a,gasPrice:typeof u<"u"&&`${h.formatGwei(u)} gwei`,maxFeePerGas:typeof r<"u"&&`${h.formatGwei(r)} gwei`,maxPriorityFeePerGas:typeof t<"u"&&`${h.formatGwei(t)} gwei`,nonce:i});f&&(y+=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./index32.cjs"),C=require("./index169.cjs"),P=require("./index170.cjs"),v=require("./index166.cjs"),E=require("./index171.cjs"),$=require("./index75.cjs"),j=require("./index172.cjs"),h=require("./index173.cjs"),x=require("./index95.cjs"),m=require("./index35.cjs"),F=require("./index174.cjs"),w=require("./index81.cjs"),O=require("./index175.cjs");class q extends m.BaseError{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}){var p;const b=o?A.parseAccount(o):void 0;let y=w.prettyPrint({from:b==null?void 0:b.address,to:s,value:typeof d<"u"&&`${j.formatEther(d)} ${((p=n==null?void 0:n.nativeCurrency)==null?void 0:p.symbol)||"ETH"}`,data:l,gas:a,gasPrice:typeof u<"u"&&`${h.formatGwei(u)} gwei`,maxFeePerGas:typeof r<"u"&&`${h.formatGwei(r)} gwei`,maxPriorityFeePerGas:typeof t<"u"&&`${h.formatGwei(t)} gwei`,nonce:i});f&&(y+=`
2
2
  ${F.prettyStateOverride(f)}`),super(e.shortMessage,{cause:e,docsPath:c,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",y].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class M extends m.BaseError{constructor(e,{abi:o,args:c,contractAddress:n,docsPath:l,functionName:a,sender:u}){const r=$.getAbiItem({abi:o,args:c,name:a}),t=r?E.formatAbiItemWithArgs({abiItem:r,args:c,includeFunctionName:!1,includeName:!1}):void 0,i=r?v.formatAbiItem(r,{includeName:!0}):void 0,s=w.prettyPrint({address:n&&O.getContractAddress(n),function:i,args:t&&t!=="()"&&`${[...Array((a==null?void 0:a.length)??0).keys()].map(()=>" ").join("")}${t}`,sender:u});super(e.shortMessage||`An unknown error occurred while executing the contract function "${a}".`,{cause:e,docsPath:l,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],s&&"Contract Call:",s].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=o,this.args=c,this.cause=e,this.contractAddress=n,this.functionName=a,this.sender=u}}class I extends m.BaseError{constructor({abi:e,data:o,functionName:c,message:n}){let l,a,u,r;if(o&&o!=="0x")try{a=P.decodeErrorResult({abi:e,data:o});const{abiItem:i,errorName:s,args:d}=a;if(s==="Error")r=d[0];else if(s==="Panic"){const[f]=d;r=C.panicReasons[f]}else{const f=i?v.formatAbiItem(i,{includeName:!0}):void 0,b=i&&d?E.formatAbiItemWithArgs({abiItem:i,args:d,includeFunctionName:!1,includeName:!1}):void 0;u=[f?`Error: ${f}`:"",b&&b!=="()"?` ${[...Array((s==null?void 0:s.length)??0).keys()].map(()=>" ").join("")}${b}`:""]}}catch(i){l=i}else n&&(r=n);let t;l instanceof x.AbiErrorSignatureNotFoundError&&(t=l.signature,u=[`Unable to decode signature "${t}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`]),super(r&&r!=="execution reverted"||t?[`The contract function "${c}" reverted with the following ${t?"signature":"reason"}:`,r||t].join(`
3
3
  `):`The contract function "${c}" reverted.`,{cause:l,metaMessages:u,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=a,this.raw=o,this.reason=r,this.signature=t}}class R extends m.BaseError{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class T extends m.BaseError{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class B extends m.BaseError{constructor({data:e,message:o}){super(o||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}exports.CallExecutionError=q;exports.ContractFunctionExecutionError=M;exports.ContractFunctionRevertedError=I;exports.ContractFunctionZeroDataError=R;exports.CounterfactualDeploymentFailedError=T;exports.RawContractError=B;
package/dist/index37.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import { parseAccount as $ } from "./index32.js";
2
- import { panicReasons as A } from "./index143.js";
3
- import { decodeErrorResult as C } from "./index144.js";
4
- import { formatAbiItem as v } from "./index139.js";
5
- import { formatAbiItemWithArgs as w } from "./index145.js";
6
- import { getAbiItem as P } from "./index72.js";
7
- import { formatEther as j } from "./index146.js";
8
- import { formatGwei as p } from "./index147.js";
9
- import { AbiErrorSignatureNotFoundError as x } from "./index84.js";
2
+ import { panicReasons as A } from "./index169.js";
3
+ import { decodeErrorResult as C } from "./index170.js";
4
+ import { formatAbiItem as v } from "./index166.js";
5
+ import { formatAbiItemWithArgs as w } from "./index171.js";
6
+ import { getAbiItem as P } from "./index75.js";
7
+ import { formatEther as j } from "./index172.js";
8
+ import { formatGwei as p } from "./index173.js";
9
+ import { AbiErrorSignatureNotFoundError as x } from "./index95.js";
10
10
  import { BaseError as b } from "./index35.js";
11
- import { prettyStateOverride as O } from "./index148.js";
12
- import { prettyPrint as E } from "./index78.js";
13
- import { getContractAddress as F } from "./index149.js";
11
+ import { prettyStateOverride as O } from "./index174.js";
12
+ import { prettyPrint as E } from "./index81.js";
13
+ import { getContractAddress as F } from "./index175.js";
14
14
  class H extends b {
15
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
16
  var y;
package/dist/index38.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index84.cjs"),a=require("./index156.cjs"),b=require("./index72.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 o=require("./index95.cjs"),a=require("./index182.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;
package/dist/index38.js CHANGED
@@ -1,6 +1,6 @@
1
- import { AbiFunctionNotFoundError as u, AbiFunctionOutputsNotFoundError as s } from "./index84.js";
2
- import { decodeAbiParameters as a } from "./index156.js";
3
- import { getAbiItem as m } from "./index72.js";
1
+ import { AbiFunctionNotFoundError as u, AbiFunctionOutputsNotFoundError as s } from "./index95.js";
2
+ import { decodeAbiParameters as a } from "./index182.js";
3
+ import { getAbiItem as m } from "./index75.js";
4
4
  const e = "/docs/contract/decodeFunctionResult";
5
5
  function l(c) {
6
6
  const { abi: r, args: d, functionName: o, data: f } = c;
package/dist/index39.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index84.cjs"),u=require("./index111.cjs"),d=require("./index160.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 e=require("./index95.cjs"),u=require("./index120.cjs"),d=require("./index185.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;
package/dist/index39.js CHANGED
@@ -1,6 +1,6 @@
1
- import { AbiConstructorNotFoundError as p, AbiConstructorParamsNotFoundError as i } from "./index84.js";
2
- import { concatHex as u } from "./index111.js";
3
- import { encodeAbiParameters as d } from "./index160.js";
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 "./index185.js";
4
4
  const r = "/docs/contract/encodeDeployData";
5
5
  function w(c) {
6
6
  const { abi: s, args: o, bytecode: n } = c;
package/dist/index40.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index111.cjs"),s=require("./index160.cjs"),d=require("./index170.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 r=require("./index120.cjs"),s=require("./index185.cjs"),d=require("./index193.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;
package/dist/index40.js CHANGED
@@ -1,6 +1,6 @@
1
- import { concatHex as a } from "./index111.js";
2
- import { encodeAbiParameters as s } from "./index160.js";
3
- import { prepareEncodeFunctionData as f } from "./index170.js";
1
+ import { concatHex as a } from "./index120.js";
2
+ import { encodeAbiParameters as s } from "./index185.js";
3
+ import { prepareEncodeFunctionData as f } from "./index193.js";
4
4
  function b(n) {
5
5
  const { args: i } = n, { abi: c, functionName: e } = (() => {
6
6
  var o;
package/dist/index42.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index151.cjs"),f=require("./index166.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 y=require("./index177.cjs"),f=require("./index190.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;
package/dist/index42.js CHANGED
@@ -1,5 +1,5 @@
1
- import { IntegerOutOfRangeError as x } from "./index151.js";
2
- import { pad as s } from "./index166.js";
1
+ import { IntegerOutOfRangeError as x } from "./index177.js";
2
+ import { pad as s } from "./index190.js";
3
3
  import { assertSize as c } from "./index65.js";
4
4
  const b = /* @__PURE__ */ Array.from({ length: 256 }, (n, e) => e.toString(16).padStart(2, "0"));
5
5
  function B(n, e = {}) {
package/dist/index43.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index37.cjs"),u=require("./index154.cjs"),i=require("./index209.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"});const c=require("./index37.cjs"),u=require("./index180.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;
package/dist/index43.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CallExecutionError as c } from "./index37.js";
2
- import { UnknownNodeError as i } from "./index154.js";
3
- import { getNodeError as u } from "./index209.js";
2
+ import { UnknownNodeError as i } from "./index180.js";
3
+ import { getNodeError as u } from "./index217.js";
4
4
  function a(r, { docsPath: t, ...o }) {
5
5
  const e = (() => {
6
6
  const n = u(r, o);
package/dist/index45.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index42.cjs"),o={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function d(e){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=a(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(i=>f.bytesToHex(i)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=f.numberToHex(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=f.numberToHex(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=f.numberToHex(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=f.numberToHex(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=f.numberToHex(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=f.numberToHex(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=o[e.type]),typeof e.value<"u"&&(n.value=f.numberToHex(e.value)),n}function a(e){return e.map(n=>({address:n.address,r:n.r?f.numberToHex(BigInt(n.r)):n.r,s:n.s?f.numberToHex(BigInt(n.s)):n.s,chainId:f.numberToHex(n.chainId),nonce:f.numberToHex(n.nonce),...typeof n.yParity<"u"?{yParity:f.numberToHex(n.yParity)}:{},...typeof n.v<"u"&&typeof n.yParity>"u"?{v:f.numberToHex(n.v)}:{}}))}exports.formatTransactionRequest=d;exports.rpcTransactionType=o;
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;
package/dist/index45.js CHANGED
@@ -1,27 +1,27 @@
1
- import { bytesToHex as d, numberToHex as n } from "./index42.js";
2
- const o = {
1
+ import { bytesToHex as o, numberToHex as i } from "./index42.js";
2
+ const a = {
3
3
  legacy: "0x0",
4
4
  eip2930: "0x1",
5
5
  eip1559: "0x2",
6
6
  eip4844: "0x3",
7
7
  eip7702: "0x4"
8
8
  };
9
- function p(e) {
9
+ function c(e, n) {
10
10
  const f = {};
11
- return typeof e.authorizationList < "u" && (f.authorizationList = a(e.authorizationList)), typeof e.accessList < "u" && (f.accessList = e.accessList), typeof e.blobVersionedHashes < "u" && (f.blobVersionedHashes = e.blobVersionedHashes), typeof e.blobs < "u" && (typeof e.blobs[0] != "string" ? f.blobs = e.blobs.map((i) => d(i)) : f.blobs = e.blobs), typeof e.data < "u" && (f.data = e.data), typeof e.from < "u" && (f.from = e.from), typeof e.gas < "u" && (f.gas = n(e.gas)), typeof e.gasPrice < "u" && (f.gasPrice = n(e.gasPrice)), typeof e.maxFeePerBlobGas < "u" && (f.maxFeePerBlobGas = n(e.maxFeePerBlobGas)), typeof e.maxFeePerGas < "u" && (f.maxFeePerGas = n(e.maxFeePerGas)), typeof e.maxPriorityFeePerGas < "u" && (f.maxPriorityFeePerGas = n(e.maxPriorityFeePerGas)), typeof e.nonce < "u" && (f.nonce = n(e.nonce)), typeof e.to < "u" && (f.to = e.to), typeof e.type < "u" && (f.type = o[e.type]), typeof e.value < "u" && (f.value = n(e.value)), f;
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
12
  }
13
- function a(e) {
14
- return e.map((f) => ({
15
- address: f.address,
16
- r: f.r ? n(BigInt(f.r)) : f.r,
17
- s: f.s ? n(BigInt(f.s)) : f.s,
18
- chainId: n(f.chainId),
19
- nonce: n(f.nonce),
20
- ...typeof f.yParity < "u" ? { yParity: n(f.yParity) } : {},
21
- ...typeof f.v < "u" && typeof f.yParity > "u" ? { v: n(f.v) } : {}
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
22
  }));
23
23
  }
24
24
  export {
25
- p as formatTransactionRequest,
26
- o as rpcTransactionType
25
+ c as formatTransactionRequest,
26
+ a as rpcTransactionType
27
27
  };
package/dist/index46.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index125.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"});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;
package/dist/index46.js CHANGED
@@ -1,4 +1,4 @@
1
- import { withResolvers as y } from "./index125.js";
1
+ import { withResolvers as y } from "./index89.js";
2
2
  const l = /* @__PURE__ */ new Map();
3
3
  function w({ fn: m, id: o, shouldSplitBatch: h, wait: A = 0, sort: u }) {
4
4
  const i = async () => {
package/dist/index47.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index141.cjs"),a=require("./index150.cjs"),f=require("./index148.cjs"),S=require("./index165.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 l=require("./index148.cjs"),a=require("./index176.cjs"),f=require("./index174.cjs"),S=require("./index149.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;
package/dist/index47.js CHANGED
@@ -1,7 +1,7 @@
1
- import { InvalidAddressError as a } from "./index141.js";
2
- import { InvalidBytesLengthError as d } from "./index150.js";
3
- import { AccountStateConflictError as u, StateAssignmentConflictError as h } from "./index148.js";
4
- import { isAddress as l } from "./index165.js";
1
+ import { InvalidAddressError as a } from "./index148.js";
2
+ import { InvalidBytesLengthError as d } from "./index176.js";
3
+ import { AccountStateConflictError as u, StateAssignmentConflictError as h } from "./index174.js";
4
+ import { isAddress as l } from "./index149.js";
5
5
  import { numberToHex as c } from "./index42.js";
6
6
  function s(r) {
7
7
  if (!(!r || r.length === 0))
package/dist/index48.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index32.cjs"),f=require("./index19.cjs"),t=require("./index141.cjs"),d=require("./index154.cjs"),w=require("./index78.cjs"),i=require("./index165.cjs");function p(a){const{account:n,gasPrice:c,maxFeePerGas:e,maxPriorityFeePerGas:r,to:s}=a,o=n?u.parseAccount(n):void 0;if(o&&!i.isAddress(o.address))throw new t.InvalidAddressError({address:o.address});if(s&&!i.isAddress(s))throw new t.InvalidAddressError({address:s});if(typeof c<"u"&&(typeof e<"u"||typeof r<"u"))throw new w.FeeConflictError;if(e&&e>f.maxUint256)throw new d.FeeCapTooHighError({maxFeePerGas:e});if(r&&e&&r>e)throw new d.TipAboveFeeCapError({maxFeePerGas:e,maxPriorityFeePerGas:r})}exports.assertRequest=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index32.cjs"),u=require("./index19.cjs"),d=require("./index148.cjs"),n=require("./index180.cjs"),i=require("./index149.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;