@gardenfi/utils 3.1.1-beta.1 → 3.1.1-beta.10

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 (451) hide show
  1. package/dist/index10.cjs +1 -1
  2. package/dist/index10.js +4 -4
  3. package/dist/index100.cjs +1 -2
  4. package/dist/index100.js +27 -119
  5. package/dist/index101.cjs +1 -1
  6. package/dist/index101.js +90 -14
  7. package/dist/index102.cjs +1 -1
  8. package/dist/index102.js +4 -25
  9. package/dist/index103.cjs +2 -1
  10. package/dist/index103.js +3 -34
  11. package/dist/index104.cjs +1 -1
  12. package/dist/index104.js +9 -45
  13. package/dist/index105.cjs +20 -1
  14. package/dist/index105.js +326 -6
  15. package/dist/index106.cjs +1 -1
  16. package/dist/index106.js +13 -103
  17. package/dist/index107.cjs +1 -1
  18. package/dist/index107.js +4 -37
  19. package/dist/index108.cjs +1 -1
  20. package/dist/index108.js +2 -9
  21. package/dist/index109.cjs +1 -1
  22. package/dist/index109.js +7 -20
  23. package/dist/index110.cjs +2 -1
  24. package/dist/index110.js +55 -2
  25. package/dist/index111.cjs +3 -1
  26. package/dist/index111.js +211 -71
  27. package/dist/index112.cjs +1 -1
  28. package/dist/index112.js +32 -16
  29. package/dist/index113.cjs +1 -1
  30. package/dist/index113.js +20 -150
  31. package/dist/index114.cjs +1 -20
  32. package/dist/index114.js +5 -326
  33. package/dist/index115.cjs +1 -3
  34. package/dist/index115.js +72 -450
  35. package/dist/index116.cjs +1 -1
  36. package/dist/index116.js +5 -73
  37. package/dist/index117.cjs +1 -1
  38. package/dist/index117.js +5 -16
  39. package/dist/index118.cjs +9 -1
  40. package/dist/index118.js +35 -10
  41. package/dist/index119.cjs +2 -1
  42. package/dist/index119.js +114 -119
  43. package/dist/index120.cjs +1 -1
  44. package/dist/index120.js +3 -6
  45. package/dist/index121.cjs +1 -1
  46. package/dist/index121.js +17 -44
  47. package/dist/index122.cjs +1 -1
  48. package/dist/index122.js +17 -35
  49. package/dist/index123.cjs +1 -1
  50. package/dist/index123.js +35 -6
  51. package/dist/index124.cjs +1 -1
  52. package/dist/index124.js +21 -88
  53. package/dist/index125.cjs +1 -1
  54. package/dist/index125.js +7 -13
  55. package/dist/index126.cjs +4 -1
  56. package/dist/index126.js +194 -3
  57. package/dist/index127.cjs +3 -1
  58. package/dist/index127.js +451 -26
  59. package/dist/index128.cjs +1 -2
  60. package/dist/index128.js +22 -19
  61. package/dist/index129.cjs +1 -1
  62. package/dist/index129.js +161 -9
  63. package/dist/index130.cjs +1 -1
  64. package/dist/index130.js +127 -8
  65. package/dist/index131.cjs +1 -1
  66. package/dist/index131.js +38 -10
  67. package/dist/index132.cjs +1 -1
  68. package/dist/index132.js +6 -11
  69. package/dist/index133.cjs +1 -1
  70. package/dist/index133.js +27 -13
  71. package/dist/index134.cjs +1 -1
  72. package/dist/index134.js +189 -19
  73. package/dist/index135.cjs +1 -1
  74. package/dist/index135.js +4 -15
  75. package/dist/index136.cjs +1 -1
  76. package/dist/index136.js +73 -4
  77. package/dist/index137.cjs +1 -1
  78. package/dist/index137.js +20 -6
  79. package/dist/index138.cjs +1 -1
  80. package/dist/index138.js +3 -19
  81. package/dist/index139.cjs +1 -1
  82. package/dist/index139.js +16 -10
  83. package/dist/index140.cjs +1 -1
  84. package/dist/index140.js +22 -57
  85. package/dist/index141.cjs +1 -1
  86. package/dist/index141.js +18 -6
  87. package/dist/index142.cjs +1 -1
  88. package/dist/index142.js +34 -13
  89. package/dist/index143.cjs +1 -1
  90. package/dist/index143.js +3 -8
  91. package/dist/index144.cjs +1 -1
  92. package/dist/index144.js +18 -138
  93. package/dist/index145.cjs +1 -1
  94. package/dist/index145.js +27 -7
  95. package/dist/index146.cjs +1 -1
  96. package/dist/index146.js +36 -21
  97. package/dist/index147.cjs +1 -1
  98. package/dist/index147.js +10 -17
  99. package/dist/index148.cjs +1 -1
  100. package/dist/index148.js +24 -42
  101. package/dist/index149.cjs +1 -1
  102. package/dist/index149.js +28 -21
  103. package/dist/index150.cjs +1 -1
  104. package/dist/index150.js +70 -75
  105. package/dist/index151.cjs +1 -1
  106. package/dist/index151.js +9 -11
  107. package/dist/index152.cjs +1 -1
  108. package/dist/index152.js +15 -7
  109. package/dist/index153.cjs +1 -1
  110. package/dist/index153.js +8 -6
  111. package/dist/index154.cjs +1 -1
  112. package/dist/index154.js +10 -41
  113. package/dist/index155.cjs +1 -1
  114. package/dist/index155.js +11 -5
  115. package/dist/index156.cjs +1 -1
  116. package/dist/index156.js +6 -33
  117. package/dist/index157.cjs +1 -1
  118. package/dist/index157.js +6 -9
  119. package/dist/index158.cjs +1 -1
  120. package/dist/index158.js +13 -60
  121. package/dist/index159.cjs +1 -1
  122. package/dist/index159.js +32 -19
  123. package/dist/index160.cjs +1 -1
  124. package/dist/index160.js +5 -107
  125. package/dist/index161.cjs +1 -1
  126. package/dist/index161.js +32 -73
  127. package/dist/index162.cjs +1 -1
  128. package/dist/index162.js +109 -7
  129. package/dist/index163.cjs +1 -1
  130. package/dist/index163.js +166 -85
  131. package/dist/index164.cjs +1 -2
  132. package/dist/index164.js +50 -3
  133. package/dist/index165.cjs +1 -1
  134. package/dist/index165.js +33 -9
  135. package/dist/index166.cjs +1 -1
  136. package/dist/index166.js +7 -13
  137. package/dist/index167.cjs +1 -1
  138. package/dist/index167.js +17 -4
  139. package/dist/index168.cjs +1 -1
  140. package/dist/index168.js +21 -2
  141. package/dist/index169.cjs +1 -1
  142. package/dist/index169.js +41 -30
  143. package/dist/index17.cjs +1 -1
  144. package/dist/index17.js +26 -16
  145. package/dist/index170.cjs +1 -1
  146. package/dist/index170.js +22 -21
  147. package/dist/index171.cjs +1 -1
  148. package/dist/index171.js +21 -5
  149. package/dist/index172.cjs +1 -1
  150. package/dist/index172.js +51 -5
  151. package/dist/index173.cjs +1 -1
  152. package/dist/index173.js +12 -5
  153. package/dist/index174.cjs +1 -9
  154. package/dist/index174.js +24 -35
  155. package/dist/index175.cjs +1 -1
  156. package/dist/index175.js +25 -3
  157. package/dist/index176.cjs +1 -1
  158. package/dist/index176.js +100 -14
  159. package/dist/index177.cjs +1 -1
  160. package/dist/index177.js +3 -21
  161. package/dist/index178.cjs +1 -1
  162. package/dist/index178.js +5 -35
  163. package/dist/index179.cjs +1 -1
  164. package/dist/index179.js +30 -7
  165. package/dist/index18.cjs +1 -1
  166. package/dist/index18.js +8 -8
  167. package/dist/index180.cjs +1 -4
  168. package/dist/index180.js +3 -194
  169. package/dist/index181.cjs +1 -1
  170. package/dist/index181.js +17 -27
  171. package/dist/index182.cjs +1 -1
  172. package/dist/index182.js +8 -161
  173. package/dist/index183.cjs +1 -1
  174. package/dist/index183.js +79 -126
  175. package/dist/index184.cjs +1 -1
  176. package/dist/index184.js +5 -27
  177. package/dist/index185.cjs +1 -1
  178. package/dist/index185.js +26 -190
  179. package/dist/index186.cjs +1 -1
  180. package/dist/index186.js +17 -4
  181. package/dist/index187.cjs +1 -1
  182. package/dist/index187.js +75 -17
  183. package/dist/index188.cjs +1 -1
  184. package/dist/index188.js +2 -3
  185. package/dist/index189.cjs +1 -1
  186. package/dist/index189.js +14 -16
  187. package/dist/index190.cjs +1 -1
  188. package/dist/index190.js +17 -33
  189. package/dist/index191.cjs +1 -1
  190. package/dist/index191.js +18 -3
  191. package/dist/index192.cjs +1 -1
  192. package/dist/index192.js +10 -27
  193. package/dist/index193.cjs +1 -1
  194. package/dist/index193.js +28 -23
  195. package/dist/index194.cjs +1 -1
  196. package/dist/index194.js +2 -29
  197. package/dist/index195.cjs +1 -1
  198. package/dist/index195.js +13 -6
  199. package/dist/index196.cjs +1 -1
  200. package/dist/index196.js +12 -6
  201. package/dist/index197.cjs +1 -1
  202. package/dist/index197.js +46 -31
  203. package/dist/index198.cjs +1 -1
  204. package/dist/index198.js +12 -5
  205. package/dist/index199.cjs +1 -1
  206. package/dist/index199.js +7 -37
  207. package/dist/index20.cjs +1 -1
  208. package/dist/index20.js +2 -2
  209. package/dist/index200.cjs +1 -1
  210. package/dist/index200.js +68 -47
  211. package/dist/index201.cjs +1 -1
  212. package/dist/index201.js +46 -32
  213. package/dist/index202.cjs +1 -1
  214. package/dist/index202.js +36 -16
  215. package/dist/index203.cjs +1 -1
  216. package/dist/index203.js +17 -42
  217. package/dist/index204.cjs +1 -1
  218. package/dist/index204.js +6 -104
  219. package/dist/index205.cjs +1 -1
  220. package/dist/index205.js +10 -3
  221. package/dist/index206.cjs +1 -1
  222. package/dist/index206.js +13 -5
  223. package/dist/index207.cjs +1 -1
  224. package/dist/index207.js +13 -3
  225. package/dist/index208.cjs +1 -1
  226. package/dist/index208.js +8 -17
  227. package/dist/index209.cjs +1 -1
  228. package/dist/index209.js +35 -8
  229. package/dist/index210.cjs +1 -1
  230. package/dist/index210.js +16 -5
  231. package/dist/index211.cjs +1 -1
  232. package/dist/index211.js +29 -27
  233. package/dist/index212.cjs +1 -1
  234. package/dist/index212.js +14 -78
  235. package/dist/index213.cjs +1 -1
  236. package/dist/index213.js +7 -2
  237. package/dist/index214.cjs +1 -1
  238. package/dist/index214.js +103 -18
  239. package/dist/index215.cjs +1 -1
  240. package/dist/index215.js +74 -16
  241. package/dist/index216.cjs +2 -1
  242. package/dist/index216.js +24 -10
  243. package/dist/index217.cjs +1 -1
  244. package/dist/index217.js +101 -212
  245. package/dist/index218.cjs +1 -1
  246. package/dist/index218.js +16 -108
  247. package/dist/index219.cjs +1 -1
  248. package/dist/index219.js +206 -198
  249. package/dist/index220.cjs +1 -1
  250. package/dist/index220.js +106 -101
  251. package/dist/index221.cjs +1 -1
  252. package/dist/index221.js +203 -13
  253. package/dist/index222.cjs +1 -1
  254. package/dist/index222.js +1 -1
  255. package/dist/index223.cjs +1 -1
  256. package/dist/index223.js +1 -1
  257. package/dist/index225.cjs +2 -1
  258. package/dist/index225.js +41 -24
  259. package/dist/index226.cjs +1 -1
  260. package/dist/index226.js +2 -47
  261. package/dist/index227.cjs +1 -1
  262. package/dist/index227.js +5 -9
  263. package/dist/index228.cjs +1 -2
  264. package/dist/index228.js +9 -40
  265. package/dist/index229.cjs +1 -1
  266. package/dist/index229.js +20 -2
  267. package/dist/index23.cjs +1 -1
  268. package/dist/index23.js +12 -26
  269. package/dist/index230.cjs +1 -1
  270. package/dist/index230.js +8 -5
  271. package/dist/index231.cjs +1 -1
  272. package/dist/index231.js +65 -9
  273. package/dist/index232.cjs +1 -1
  274. package/dist/index232.js +63 -17
  275. package/dist/index233.cjs +1 -1
  276. package/dist/index233.js +188 -8
  277. package/dist/index234.cjs +1 -1
  278. package/dist/index234.js +28 -66
  279. package/dist/index235.cjs +1 -1
  280. package/dist/index235.js +72 -61
  281. package/dist/index236.cjs +1 -1
  282. package/dist/index236.js +35 -183
  283. package/dist/index237.cjs +1 -1
  284. package/dist/index237.js +9 -21
  285. package/dist/index238.cjs +1 -1
  286. package/dist/index238.js +7 -70
  287. package/dist/index239.cjs +1 -1
  288. package/dist/index239.js +11 -40
  289. package/dist/index24.cjs +1 -1
  290. package/dist/index24.js +59 -8
  291. package/dist/index240.cjs +1 -1
  292. package/dist/index240.js +12 -16
  293. package/dist/index241.cjs +1 -1
  294. package/dist/index241.js +18 -12
  295. package/dist/index242.cjs +1 -1
  296. package/dist/index242.js +6 -11
  297. package/dist/index243.cjs +1 -1
  298. package/dist/index243.js +7 -13
  299. package/dist/index244.cjs +1 -1
  300. package/dist/index244.js +25 -18
  301. package/dist/index245.cjs +1 -1
  302. package/dist/index245.js +24 -6
  303. package/dist/index246.cjs +1 -1
  304. package/dist/index246.js +47 -7
  305. package/dist/index247.cjs +1 -1
  306. package/dist/index247.js +9 -26
  307. package/dist/index248.cjs +1 -1
  308. package/dist/index248.js +1 -1
  309. package/dist/index25.cjs +16 -1
  310. package/dist/index25.js +113 -12
  311. package/dist/index250.cjs +1 -1
  312. package/dist/index250.js +2 -2
  313. package/dist/index251.cjs +1 -1
  314. package/dist/index251.js +2 -2
  315. package/dist/index252.cjs +1 -2
  316. package/dist/index252.js +68 -91
  317. package/dist/index253.cjs +2 -1
  318. package/dist/index253.js +91 -14
  319. package/dist/index254.cjs +1 -1
  320. package/dist/index254.js +14 -68
  321. package/dist/index26.cjs +1 -1
  322. package/dist/index26.js +30 -59
  323. package/dist/index27.cjs +1 -16
  324. package/dist/index27.js +27 -111
  325. package/dist/index28.cjs +1 -1
  326. package/dist/index28.js +7 -29
  327. package/dist/index30.cjs +1 -1
  328. package/dist/index30.js +3 -3
  329. package/dist/index31.cjs +1 -1
  330. package/dist/index31.js +2 -2
  331. package/dist/index32.cjs +1 -1
  332. package/dist/index32.js +2 -2
  333. package/dist/index33.cjs +1 -1
  334. package/dist/index33.js +2 -2
  335. package/dist/index41.cjs +1 -1
  336. package/dist/index41.js +1 -1
  337. package/dist/index42.cjs +1 -1
  338. package/dist/index42.js +1 -1
  339. package/dist/index44.cjs +1 -1
  340. package/dist/index44.js +1 -1
  341. package/dist/index45.cjs +1 -1
  342. package/dist/index45.js +1 -1
  343. package/dist/index47.cjs +1 -1
  344. package/dist/index47.js +2 -2
  345. package/dist/index48.cjs +1 -1
  346. package/dist/index48.js +1 -1
  347. package/dist/index49.cjs +1 -1
  348. package/dist/index49.js +12 -12
  349. package/dist/index50.cjs +1 -1
  350. package/dist/index50.js +3 -3
  351. package/dist/index51.cjs +1 -1
  352. package/dist/index51.js +7 -171
  353. package/dist/index52.cjs +1 -1
  354. package/dist/index52.js +30 -110
  355. package/dist/index53.cjs +1 -1
  356. package/dist/index53.js +29 -30
  357. package/dist/index54.cjs +1 -1
  358. package/dist/index54.js +17 -2
  359. package/dist/index55.cjs +1 -1
  360. package/dist/index55.js +34 -4
  361. package/dist/index56.cjs +1 -2
  362. package/dist/index56.js +43 -58
  363. package/dist/index57.cjs +1 -2
  364. package/dist/index57.js +150 -53
  365. package/dist/index58.cjs +1 -3
  366. package/dist/index58.js +39 -213
  367. package/dist/index59.cjs +1 -1
  368. package/dist/index59.js +57 -22
  369. package/dist/index60.cjs +2 -1
  370. package/dist/index60.js +59 -18
  371. package/dist/index61.cjs +1 -1
  372. package/dist/index61.js +13 -10
  373. package/dist/index62.cjs +1 -1
  374. package/dist/index62.js +37 -20
  375. package/dist/index63.cjs +1 -1
  376. package/dist/index63.js +15 -13
  377. package/dist/index64.cjs +1 -1
  378. package/dist/index64.js +8 -12
  379. package/dist/index65.cjs +1 -1
  380. package/dist/index65.js +20 -24
  381. package/dist/index66.cjs +1 -1
  382. package/dist/index66.js +2 -29
  383. package/dist/index67.cjs +1 -1
  384. package/dist/index67.js +44 -46
  385. package/dist/index68.cjs +1 -1
  386. package/dist/index68.js +33 -16
  387. package/dist/index69.cjs +1 -1
  388. package/dist/index69.js +8 -10
  389. package/dist/index70.cjs +1 -1
  390. package/dist/index70.js +58 -29
  391. package/dist/index71.cjs +1 -1
  392. package/dist/index71.js +76 -35
  393. package/dist/index72.cjs +1 -1
  394. package/dist/index72.js +7 -7
  395. package/dist/index73.cjs +1 -1
  396. package/dist/index73.js +16 -29
  397. package/dist/index74.cjs +1 -1
  398. package/dist/index74.js +9 -21
  399. package/dist/index75.cjs +1 -1
  400. package/dist/index75.js +5 -7
  401. package/dist/index76.cjs +1 -1
  402. package/dist/index76.js +13 -69
  403. package/dist/index77.cjs +1 -1
  404. package/dist/index77.js +3 -46
  405. package/dist/index78.cjs +1 -1
  406. package/dist/index78.js +25 -22
  407. package/dist/index79.cjs +1 -1
  408. package/dist/index79.js +161 -34
  409. package/dist/index80.cjs +1 -1
  410. package/dist/index80.js +4 -17
  411. package/dist/index81.cjs +1 -1
  412. package/dist/index81.js +6 -6
  413. package/dist/index82.cjs +1 -1
  414. package/dist/index82.js +89 -8
  415. package/dist/index83.cjs +1 -1
  416. package/dist/index83.js +9 -12
  417. package/dist/index84.cjs +1 -1
  418. package/dist/index84.js +6 -164
  419. package/dist/index85.cjs +1 -1
  420. package/dist/index85.js +13 -77
  421. package/dist/index86.cjs +1 -1
  422. package/dist/index86.js +125 -13
  423. package/dist/index87.cjs +1 -1
  424. package/dist/index87.js +137 -50
  425. package/dist/index88.cjs +1 -1
  426. package/dist/index88.js +7 -7
  427. package/dist/index89.cjs +1 -1
  428. package/dist/index89.js +21 -7
  429. package/dist/index90.cjs +1 -1
  430. package/dist/index90.js +17 -21
  431. package/dist/index91.cjs +1 -1
  432. package/dist/index91.js +43 -8
  433. package/dist/index92.cjs +1 -1
  434. package/dist/index92.js +20 -30
  435. package/dist/index93.cjs +1 -1
  436. package/dist/index93.js +11 -16
  437. package/dist/index94.cjs +1 -1
  438. package/dist/index94.js +6 -73
  439. package/dist/index95.cjs +1 -1
  440. package/dist/index95.js +5 -35
  441. package/dist/index96.cjs +1 -1
  442. package/dist/index96.js +19 -16
  443. package/dist/index97.cjs +1 -1
  444. package/dist/index97.js +103 -72
  445. package/dist/index98.cjs +1 -1
  446. package/dist/index98.js +78 -12
  447. package/dist/index99.cjs +1 -1
  448. package/dist/index99.js +8 -28
  449. package/dist/src/lib/fetcher/fetcher.d.ts +1 -0
  450. package/dist/src/lib/retry.d.ts +3 -1
  451. package/package.json +1 -1
package/dist/index26.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("./index161.cjs"),E=require("./index162.cjs"),H=require("./index66.cjs"),U=require("./index163.cjs"),_=require("./index159.cjs");function k(v,r={}){const{batch:o,fetchFn:l,fetchOptions:u,key:h="http",methods:q,name:d="HTTP JSON-RPC",onFetchRequest:y,onFetchResponse:f,retryDelay:R,raw:w}=r;return({chain:n,retryCount:S,timeout:m})=>{const{batchSize:C=1e3,wait:b=0}=typeof o=="object"?o:{},T=r.retryCount??S,c=m??r.timeout??1e4,e=n==null?void 0:n.rpcUrls.default.http[0];if(!e)throw new E.UrlRequiredError;const a=U.getHttpRpcClient(e,{fetchFn:l,fetchOptions:u,onRequest:y,onResponse:f,timeout:c});return _.createTransport({key:h,methods:q,name:d,async request({method:B,params:F}){const i={method:B,params:F},{schedule:O}=H.createBatchScheduler({id:e,wait:b,shouldSplitBatch(t){return t.length>C},fn:t=>a.request({body:t}),sort:(t,g)=>t.id-g.id}),P=async t=>o?O(t):[await a.request({body:t})],[{error:s,result:p}]=await P(i);if(w)return{error:s,result:p};if(s)throw new j.RpcRequestError({body:i,error:s,url:e});return p},retryCount:T,retryDelay:R,timeout:c,type:"http"},{fetchOptions:u,url:e})}}exports.http=k;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index167.cjs"),t=e.defineChain({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}});exports.mainnet=t;
package/dist/index26.js CHANGED
@@ -1,61 +1,32 @@
1
- import { RpcRequestError as P } from "./index161.js";
2
- import { UrlRequiredError as U } from "./index162.js";
3
- import { createBatchScheduler as _ } from "./index66.js";
4
- import { getHttpRpcClient as j } from "./index163.js";
5
- import { createTransport as k } from "./index159.js";
6
- function v(x, r = {}) {
7
- const { batch: o, fetchFn: h, fetchOptions: u, key: m = "http", methods: a, name: f = "HTTP JSON-RPC", onFetchRequest: y, onFetchResponse: d, retryDelay: R, raw: w } = r;
8
- return ({ chain: n, retryCount: q, timeout: C }) => {
9
- const { batchSize: S = 1e3, wait: b = 0 } = typeof o == "object" ? o : {}, F = r.retryCount ?? q, c = C ?? r.timeout ?? 1e4, e = n == null ? void 0 : n.rpcUrls.default.http[0];
10
- if (!e)
11
- throw new U();
12
- const p = j(e, {
13
- fetchFn: h,
14
- fetchOptions: u,
15
- onRequest: y,
16
- onResponse: d,
17
- timeout: c
18
- });
19
- return k({
20
- key: m,
21
- methods: a,
22
- name: f,
23
- async request({ method: T, params: B }) {
24
- const i = { method: T, params: B }, { schedule: E } = _({
25
- id: e,
26
- wait: b,
27
- shouldSplitBatch(t) {
28
- return t.length > S;
29
- },
30
- fn: (t) => p.request({
31
- body: t
32
- }),
33
- sort: (t, O) => t.id - O.id
34
- }), H = async (t) => o ? E(t) : [
35
- await p.request({
36
- body: t
37
- })
38
- ], [{ error: s, result: l }] = await H(i);
39
- if (w)
40
- return { error: s, result: l };
41
- if (s)
42
- throw new P({
43
- body: i,
44
- error: s,
45
- url: e
46
- });
47
- return l;
48
- },
49
- retryCount: F,
50
- retryDelay: R,
51
- timeout: c,
52
- type: "http"
53
- }, {
54
- fetchOptions: u,
55
- url: e
56
- });
57
- };
58
- }
1
+ import { defineChain as e } from "./index167.js";
2
+ const t = /* @__PURE__ */ e({
3
+ id: 1,
4
+ name: "Ethereum",
5
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
6
+ blockTime: 12e3,
7
+ rpcUrls: {
8
+ default: {
9
+ http: ["https://eth.merkle.io"]
10
+ }
11
+ },
12
+ blockExplorers: {
13
+ default: {
14
+ name: "Etherscan",
15
+ url: "https://etherscan.io",
16
+ apiUrl: "https://api.etherscan.io/api"
17
+ }
18
+ },
19
+ contracts: {
20
+ ensUniversalResolver: {
21
+ address: "0xeeeeeeee14d718c2b47d9923deab1335e144eeee",
22
+ blockCreated: 23085558
23
+ },
24
+ multicall3: {
25
+ address: "0xca11bde05977b3631167028862be2a173976ca11",
26
+ blockCreated: 14353601
27
+ }
28
+ }
29
+ });
59
30
  export {
60
- v as http
31
+ t as mainnet
61
32
  };
package/dist/index27.cjs CHANGED
@@ -1,16 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index248.cjs"),M=require("./index44.cjs"),h=require("./index249.cjs");function R(r){const{chainId:o,domain:s,expirationTime:l,issuedAt:m=new Date,nonce:a,notBefore:f,requestId:w,resources:g,scheme:i,uri:c,version:d}=r;{if(o!==Math.floor(o))throw new e.SiweInvalidMessageFieldError({field:"chainId",metaMessages:["- Chain ID must be a EIP-155 chain ID.","- See https://eips.ethereum.org/EIPS/eip-155","",`Provided value: ${o}`]});if(!(E.test(s)||F.test(s)||b.test(s)))throw new e.SiweInvalidMessageFieldError({field:"domain",metaMessages:["- Domain must be an RFC 3986 authority.","- See https://www.rfc-editor.org/rfc/rfc3986","",`Provided value: ${s}`]});if(!A.test(a))throw new e.SiweInvalidMessageFieldError({field:"nonce",metaMessages:["- Nonce must be at least 8 characters.","- Nonce must be alphanumeric.","",`Provided value: ${a}`]});if(!h.isUri(c))throw new e.SiweInvalidMessageFieldError({field:"uri",metaMessages:["- URI must be a RFC 3986 URI referring to the resource that is the subject of the signing.","- See https://www.rfc-editor.org/rfc/rfc3986","",`Provided value: ${c}`]});if(d!=="1")throw new e.SiweInvalidMessageFieldError({field:"version",metaMessages:["- Version must be '1'.","",`Provided value: ${d}`]});if(i&&!P.test(i))throw new e.SiweInvalidMessageFieldError({field:"scheme",metaMessages:["- Scheme must be an RFC 3986 URI scheme.","- See https://www.rfc-editor.org/rfc/rfc3986#section-3.1","",`Provided value: ${i}`]});const t=r.statement;if(t!=null&&t.includes(`
2
- `))throw new e.SiweInvalidMessageFieldError({field:"statement",metaMessages:["- Statement must not include '\\n'.","",`Provided value: ${t}`]})}const $=M.getAddress(r.address),v=i?`${i}://${s}`:s,I=r.statement?`${r.statement}
3
- `:"",S=`${v} wants you to sign in with your Ethereum account:
4
- ${$}
5
-
6
- ${I}`;let n=`URI: ${c}
7
- Version: ${d}
8
- Chain ID: ${o}
9
- Nonce: ${a}
10
- Issued At: ${m.toISOString()}`;if(l&&(n+=`
11
- Expiration Time: ${l.toISOString()}`),f&&(n+=`
12
- Not Before: ${f.toISOString()}`),w&&(n+=`
13
- Request ID: ${w}`),g){let t=`
14
- Resources:`;for(const u of g){if(!h.isUri(u))throw new e.SiweInvalidMessageFieldError({field:"resources",metaMessages:["- Every resource must be a RFC 3986 URI.","- See https://www.rfc-editor.org/rfc/rfc3986","",`Provided value: ${u}`]});t+=`
15
- - ${u}`}n+=t}return`${S}
16
- ${n}`}const E=/^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(:[0-9]{1,5})?$/,F=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:[0-9]{1,5})?$/,b=/^localhost(:[0-9]{1,5})?$/,A=/^[a-zA-Z0-9]{8,}$/,P=/^([a-zA-Z][a-zA-Z0-9+-.]*)$/;exports.createSiweMessage=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index3.cjs");class a{constructor(r,t,e){this.maxRetries=Math.max(r,0),this.delay=t,this.onRetry=e}async retry(r){let t=0,e;for(;t<this.maxRetries+1;)try{return await r()}catch(i){if(this.onRetry&&!this.onRetry(i))throw i;t++,e=i,await s.sleep(this.delay*t)}throw e}}exports.Retry=a;
package/dist/index27.js CHANGED
@@ -1,116 +1,32 @@
1
- import { SiweInvalidMessageFieldError as e } from "./index248.js";
2
- import { getAddress as S } from "./index44.js";
3
- import { isUri as $ } from "./index249.js";
4
- function C(n) {
5
- const { chainId: i, domain: s, expirationTime: u, issuedAt: g = /* @__PURE__ */ new Date(), nonce: a, notBefore: m, requestId: h, resources: w, scheme: o, uri: c, version: f } = n;
6
- {
7
- if (i !== Math.floor(i))
8
- throw new e({
9
- field: "chainId",
10
- metaMessages: [
11
- "- Chain ID must be a EIP-155 chain ID.",
12
- "- See https://eips.ethereum.org/EIPS/eip-155",
13
- "",
14
- `Provided value: ${i}`
15
- ]
16
- });
17
- if (!(p.test(s) || M.test(s) || x.test(s)))
18
- throw new e({
19
- field: "domain",
20
- metaMessages: [
21
- "- Domain must be an RFC 3986 authority.",
22
- "- See https://www.rfc-editor.org/rfc/rfc3986",
23
- "",
24
- `Provided value: ${s}`
25
- ]
26
- });
27
- if (!A.test(a))
28
- throw new e({
29
- field: "nonce",
30
- metaMessages: [
31
- "- Nonce must be at least 8 characters.",
32
- "- Nonce must be alphanumeric.",
33
- "",
34
- `Provided value: ${a}`
35
- ]
36
- });
37
- if (!$(c))
38
- throw new e({
39
- field: "uri",
40
- metaMessages: [
41
- "- URI must be a RFC 3986 URI referring to the resource that is the subject of the signing.",
42
- "- See https://www.rfc-editor.org/rfc/rfc3986",
43
- "",
44
- `Provided value: ${c}`
45
- ]
46
- });
47
- if (f !== "1")
48
- throw new e({
49
- field: "version",
50
- metaMessages: [
51
- "- Version must be '1'.",
52
- "",
53
- `Provided value: ${f}`
54
- ]
55
- });
56
- if (o && !P.test(o))
57
- throw new e({
58
- field: "scheme",
59
- metaMessages: [
60
- "- Scheme must be an RFC 3986 URI scheme.",
61
- "- See https://www.rfc-editor.org/rfc/rfc3986#section-3.1",
62
- "",
63
- `Provided value: ${o}`
64
- ]
65
- });
66
- const t = n.statement;
67
- if (t != null && t.includes(`
68
- `))
69
- throw new e({
70
- field: "statement",
71
- metaMessages: [
72
- "- Statement must not include '\\n'.",
73
- "",
74
- `Provided value: ${t}`
75
- ]
76
- });
1
+ import { sleep as s } from "./index3.js";
2
+ class o {
3
+ /**
4
+ * @param {number} maxRetries - The maximum number of retries, if less < 0 then it is set to 0
5
+ * @param {number} delay - The delay between retries
6
+ * @param {(error: any) => boolean} [onRetry] - A callback that receives the error. If it returns false, retries are aborted.
7
+ */
8
+ constructor(e, t, r) {
9
+ this.maxRetries = Math.max(e, 0), this.delay = t, this.onRetry = r;
77
10
  }
78
- const l = S(n.address), v = o ? `${o}://${s}` : s, I = n.statement ? `${n.statement}
79
- ` : "", R = `${v} wants you to sign in with your Ethereum account:
80
- ${l}
81
-
82
- ${I}`;
83
- let r = `URI: ${c}
84
- Version: ${f}
85
- Chain ID: ${i}
86
- Nonce: ${a}
87
- Issued At: ${g.toISOString()}`;
88
- if (u && (r += `
89
- Expiration Time: ${u.toISOString()}`), m && (r += `
90
- Not Before: ${m.toISOString()}`), h && (r += `
91
- Request ID: ${h}`), w) {
92
- let t = `
93
- Resources:`;
94
- for (const d of w) {
95
- if (!$(d))
96
- throw new e({
97
- field: "resources",
98
- metaMessages: [
99
- "- Every resource must be a RFC 3986 URI.",
100
- "- See https://www.rfc-editor.org/rfc/rfc3986",
101
- "",
102
- `Provided value: ${d}`
103
- ]
104
- });
105
- t += `
106
- - ${d}`;
107
- }
108
- r += t;
11
+ /**
12
+ * Retries a function until it succeeds or the max number of retries is reached
13
+ *
14
+ * @param {() => Promise<T>} fn - The function to retry
15
+ * @return {Promise<T>} a Promise that resolves to the result of the function
16
+ */
17
+ async retry(e) {
18
+ let t = 0, r;
19
+ for (; t < this.maxRetries + 1; )
20
+ try {
21
+ return await e();
22
+ } catch (i) {
23
+ if (this.onRetry && !this.onRetry(i))
24
+ throw i;
25
+ t++, r = i, await s(this.delay * t);
26
+ }
27
+ throw r;
109
28
  }
110
- return `${R}
111
- ${r}`;
112
29
  }
113
- const p = /^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(:[0-9]{1,5})?$/, M = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:[0-9]{1,5})?$/, x = /^localhost(:[0-9]{1,5})?$/, A = /^[a-zA-Z0-9]{8,}$/, P = /^([a-zA-Z][a-zA-Z0-9+-.]*)$/;
114
30
  export {
115
- C as createSiweMessage
31
+ o as Retry
116
32
  };
package/dist/index28.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index202.cjs"),t=e.defineChain({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}});exports.mainnet=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=e=>{try{return JSON.parse(e)}catch{return e}};exports.safeParseJson=r;
package/dist/index28.js CHANGED
@@ -1,32 +1,10 @@
1
- import { defineChain as e } from "./index202.js";
2
- const t = /* @__PURE__ */ e({
3
- id: 1,
4
- name: "Ethereum",
5
- nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
6
- blockTime: 12e3,
7
- rpcUrls: {
8
- default: {
9
- http: ["https://eth.merkle.io"]
10
- }
11
- },
12
- blockExplorers: {
13
- default: {
14
- name: "Etherscan",
15
- url: "https://etherscan.io",
16
- apiUrl: "https://api.etherscan.io/api"
17
- }
18
- },
19
- contracts: {
20
- ensUniversalResolver: {
21
- address: "0xeeeeeeee14d718c2b47d9923deab1335e144eeee",
22
- blockCreated: 23085558
23
- },
24
- multicall3: {
25
- address: "0xca11bde05977b3631167028862be2a173976ca11",
26
- blockCreated: 14353601
27
- }
1
+ const t = (r) => {
2
+ try {
3
+ return JSON.parse(r);
4
+ } catch {
5
+ return r;
28
6
  }
29
- });
7
+ };
30
8
  export {
31
- t as mainnet
9
+ t as safeParseJson
32
10
  };
package/dist/index30.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./index220.cjs"),C=require("./index221.cjs"),n=require("./index217.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const k=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),x=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),G=BigInt(0),M=BigInt(1),w=BigInt(2),h=(t,f)=>(t+f/w)/f;function N(t){const f=k,e=BigInt(3),r=BigInt(6),p=BigInt(11),a=BigInt(22),s=BigInt(23),i=BigInt(44),d=BigInt(88),o=t*t*t%f,c=o*o*t%f,g=n.pow2(c,e,f)*c%f,b=n.pow2(g,e,f)*c%f,l=n.pow2(b,w,f)*o%f,B=n.pow2(l,p,f)*l%f,I=n.pow2(B,a,f)*B%f,_=n.pow2(I,i,f)*I%f,m=n.pow2(_,d,f)*_%f,S=n.pow2(m,i,f)*I%f,P=n.pow2(S,e,f)*c%f,v=n.pow2(P,s,f)*B%f,E=n.pow2(v,r,f)*o%f,q=n.pow2(E,w,f);if(!u.eql(u.sqr(q),t))throw new Error("Cannot find square root");return q}const u=n.Field(k,void 0,void 0,{sqrt:N}),O=C.createCurve({a:G,b:BigInt(7),Fp:u,n:x,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const f=x,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-M*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),p=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=e,s=BigInt("0x100000000000000000000000000000000"),i=h(a*t,f),d=h(-r*t,f);let o=n.mod(t-i*e-d*p,f),c=n.mod(-i*r-d*a,f);const g=o>s,b=c>s;if(g&&(o=f-o),b&&(c=f-c),o>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:g,k1:o,k2neg:b,k2:c}}}},F.sha256);exports.secp256k1=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./index217.cjs"),C=require("./index218.cjs"),n=require("./index219.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const k=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),x=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),G=BigInt(0),M=BigInt(1),w=BigInt(2),h=(t,f)=>(t+f/w)/f;function N(t){const f=k,e=BigInt(3),r=BigInt(6),p=BigInt(11),a=BigInt(22),s=BigInt(23),i=BigInt(44),d=BigInt(88),o=t*t*t%f,c=o*o*t%f,g=n.pow2(c,e,f)*c%f,b=n.pow2(g,e,f)*c%f,l=n.pow2(b,w,f)*o%f,B=n.pow2(l,p,f)*l%f,I=n.pow2(B,a,f)*B%f,_=n.pow2(I,i,f)*I%f,m=n.pow2(_,d,f)*_%f,S=n.pow2(m,i,f)*I%f,P=n.pow2(S,e,f)*c%f,v=n.pow2(P,s,f)*B%f,E=n.pow2(v,r,f)*o%f,q=n.pow2(E,w,f);if(!u.eql(u.sqr(q),t))throw new Error("Cannot find square root");return q}const u=n.Field(k,void 0,void 0,{sqrt:N}),O=C.createCurve({a:G,b:BigInt(7),Fp:u,n:x,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const f=x,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-M*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),p=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=e,s=BigInt("0x100000000000000000000000000000000"),i=h(a*t,f),d=h(-r*t,f);let o=n.mod(t-i*e-d*p,f),c=n.mod(-i*r-d*a,f);const g=o>s,b=c>s;if(g&&(o=f-o),b&&(c=f-c),o>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:g,k1:o,k2neg:b,k2:c}}}},F.sha256);exports.secp256k1=O;
package/dist/index30.js CHANGED
@@ -1,6 +1,6 @@
1
- import { sha256 as C } from "./index220.js";
2
- import { createCurve as G } from "./index221.js";
3
- import { Field as N, mod as k, pow2 as t } from "./index217.js";
1
+ import { sha256 as C } from "./index217.js";
2
+ import { createCurve as G } from "./index218.js";
3
+ import { Field as N, mod as k, pow2 as t } from "./index219.js";
4
4
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
5
5
  const q = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"), w = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"), M = BigInt(0), O = BigInt(1), _ = BigInt(2), h = (n, f) => (n + f / _) / f;
6
6
  function W(n) {
package/dist/index31.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index177.cjs"),u=require("./index167.cjs");function o(n,{size:e}){if(u.size(n)>e)throw new s.SizeOverflowError({givenSize:u.size(n),maxSize:e})}function g(n,e={}){const{signed:r}=e;e.size&&o(n,{size:e.size});const i=BigInt(n);if(!r)return i;const t=(n.length-2)/2,a=(1n<<BigInt(t)*8n-1n)-1n;return i<=a?i:i-BigInt(`0x${"f".padStart(t*2,"f")}`)-1n}function c(n,e={}){const r=g(n,e),i=Number(r);if(!Number.isSafeInteger(i))throw new s.IntegerOutOfRangeError({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:e.signed,size:e.size,value:`${r}n`});return i}exports.assertSize=o;exports.hexToBigInt=g;exports.hexToNumber=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index122.cjs"),u=require("./index107.cjs");function o(n,{size:e}){if(u.size(n)>e)throw new s.SizeOverflowError({givenSize:u.size(n),maxSize:e})}function g(n,e={}){const{signed:r}=e;e.size&&o(n,{size:e.size});const i=BigInt(n);if(!r)return i;const t=(n.length-2)/2,a=(1n<<BigInt(t)*8n-1n)-1n;return i<=a?i:i-BigInt(`0x${"f".padStart(t*2,"f")}`)-1n}function c(n,e={}){const r=g(n,e),i=Number(r);if(!Number.isSafeInteger(i))throw new s.IntegerOutOfRangeError({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:e.signed,size:e.size,value:`${r}n`});return i}exports.assertSize=o;exports.hexToBigInt=g;exports.hexToNumber=c;
package/dist/index31.js CHANGED
@@ -1,5 +1,5 @@
1
- import { IntegerOutOfRangeError as f, SizeOverflowError as m } from "./index177.js";
2
- import { size as o } from "./index167.js";
1
+ import { IntegerOutOfRangeError as f, SizeOverflowError as m } from "./index122.js";
2
+ import { size as o } from "./index107.js";
3
3
  function s(n, { size: e }) {
4
4
  if (o(n) > e)
5
5
  throw new m({
package/dist/index32.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index56.cjs"),l=require("./index46.cjs"),u=require("./index190.cjs"),f=require("./index31.cjs"),m=require("./index33.cjs"),h=new TextEncoder;function A(e,n={}){return typeof e=="number"||typeof e=="bigint"?B(e,n):typeof e=="boolean"?x(e,n):l.isHex(e)?c(e,n):T(e,n)}function x(e,n={}){const t=new Uint8Array(1);return t[0]=Number(e),typeof n.size=="number"?(f.assertSize(t,{size:n.size}),u.pad(t,{size:n.size})):t}const i={zero:48,nine:57,A:65,F:70,a:97,f:102};function g(e){if(e>=i.zero&&e<=i.nine)return e-i.zero;if(e>=i.A&&e<=i.F)return e-(i.A-10);if(e>=i.a&&e<=i.f)return e-(i.a-10)}function c(e,n={}){let t=e;n.size&&(f.assertSize(t,{size:n.size}),t=u.pad(t,{dir:"right",size:n.size}));let r=t.slice(2);r.length%2&&(r=`0${r}`);const d=r.length/2,y=new Uint8Array(d);for(let s=0,o=0;s<d;s++){const b=g(r.charCodeAt(o++)),z=g(r.charCodeAt(o++));if(b===void 0||z===void 0)throw new a.BaseError(`Invalid byte sequence ("${r[o-2]}${r[o-1]}" in "${r}").`);y[s]=b*16+z}return y}function B(e,n){const t=m.numberToHex(e,n);return c(t)}function T(e,n={}){const t=h.encode(e);return typeof n.size=="number"?(f.assertSize(t,{size:n.size}),u.pad(t,{dir:"right",size:n.size})):t}exports.boolToBytes=x;exports.hexToBytes=c;exports.numberToBytes=B;exports.stringToBytes=T;exports.toBytes=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index60.cjs"),l=require("./index46.cjs"),u=require("./index142.cjs"),f=require("./index31.cjs"),m=require("./index33.cjs"),h=new TextEncoder;function A(e,n={}){return typeof e=="number"||typeof e=="bigint"?B(e,n):typeof e=="boolean"?x(e,n):l.isHex(e)?c(e,n):T(e,n)}function x(e,n={}){const t=new Uint8Array(1);return t[0]=Number(e),typeof n.size=="number"?(f.assertSize(t,{size:n.size}),u.pad(t,{size:n.size})):t}const i={zero:48,nine:57,A:65,F:70,a:97,f:102};function g(e){if(e>=i.zero&&e<=i.nine)return e-i.zero;if(e>=i.A&&e<=i.F)return e-(i.A-10);if(e>=i.a&&e<=i.f)return e-(i.a-10)}function c(e,n={}){let t=e;n.size&&(f.assertSize(t,{size:n.size}),t=u.pad(t,{dir:"right",size:n.size}));let r=t.slice(2);r.length%2&&(r=`0${r}`);const d=r.length/2,y=new Uint8Array(d);for(let s=0,o=0;s<d;s++){const b=g(r.charCodeAt(o++)),z=g(r.charCodeAt(o++));if(b===void 0||z===void 0)throw new a.BaseError(`Invalid byte sequence ("${r[o-2]}${r[o-1]}" in "${r}").`);y[s]=b*16+z}return y}function B(e,n){const t=m.numberToHex(e,n);return c(t)}function T(e,n={}){const t=h.encode(e);return typeof n.size=="number"?(f.assertSize(t,{size:n.size}),u.pad(t,{dir:"right",size:n.size})):t}exports.boolToBytes=x;exports.hexToBytes=c;exports.numberToBytes=B;exports.stringToBytes=T;exports.toBytes=A;
package/dist/index32.js CHANGED
@@ -1,6 +1,6 @@
1
- import { BaseError as g } from "./index56.js";
1
+ import { BaseError as g } from "./index60.js";
2
2
  import { isHex as x } from "./index46.js";
3
- import { pad as s } from "./index190.js";
3
+ import { pad as s } from "./index142.js";
4
4
  import { assertSize as u } from "./index31.js";
5
5
  import { numberToHex as h } from "./index33.js";
6
6
  const A = /* @__PURE__ */ new TextEncoder();
package/dist/index33.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index177.cjs"),f=require("./index190.cjs"),x=require("./index31.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("./index122.cjs"),f=require("./index142.cjs"),x=require("./index31.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/index33.js CHANGED
@@ -1,5 +1,5 @@
1
- import { IntegerOutOfRangeError as x } from "./index177.js";
2
- import { pad as s } from "./index190.js";
1
+ import { IntegerOutOfRangeError as x } from "./index122.js";
2
+ import { pad as s } from "./index142.js";
3
3
  import { assertSize as c } from "./index31.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/index41.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index56.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;
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,4 +1,4 @@
1
- import { BaseError as r } from "./index56.js";
1
+ import { BaseError as r } from "./index60.js";
2
2
  class d extends r {
3
3
  constructor({ address: s }) {
4
4
  super(`Address "${s}" is invalid.`, {
package/dist/index42.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index134.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;
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,4 +1,4 @@
1
- import { LruMap as u } from "./index134.js";
1
+ import { LruMap as u } from "./index152.js";
2
2
  import { checksumAddress as c } from "./index44.js";
3
3
  const i = /^0x[a-fA-F0-9]{40}$/, r = /* @__PURE__ */ new u(8192);
4
4
  function h(t, s) {
package/dist/index44.cjs CHANGED
@@ -1 +1 @@
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("./index134.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;
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,7 +1,7 @@
1
1
  import { InvalidAddressError as c } from "./index41.js";
2
2
  import { stringToBytes as m } from "./index32.js";
3
3
  import { keccak256 as p } from "./index45.js";
4
- import { LruMap as u } from "./index134.js";
4
+ import { LruMap as u } from "./index152.js";
5
5
  import { isAddress as $ } from "./index42.js";
6
6
  const s = /* @__PURE__ */ new u(8192);
7
7
  function h(t, o) {
package/dist/index45.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index204.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;
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,4 +1,4 @@
1
- import { keccak_256 as c } from "./index204.js";
1
+ import { keccak_256 as c } from "./index176.js";
2
2
  import { isHex as i } from "./index46.js";
3
3
  import { toBytes as m } from "./index32.js";
4
4
  import { toHex as s } from "./index33.js";
package/dist/index47.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index138.cjs"),u=require("./index32.cjs"),c=require("./index33.cjs"),a=require("./index203.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;
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;
package/dist/index47.js CHANGED
@@ -1,7 +1,7 @@
1
- import { concatHex as i } from "./index138.js";
1
+ import { concatHex as i } from "./index141.js";
2
2
  import { hexToBytes as m } from "./index32.js";
3
3
  import { numberToHex as c } from "./index33.js";
4
- import { toRlp as d } from "./index203.js";
4
+ import { toRlp as d } from "./index169.js";
5
5
  import { keccak256 as f } from "./index45.js";
6
6
  function b(o) {
7
7
  const { chainId: t, nonce: r, to: s } = o, e = o.contractAddress ?? o.address, n = f(i([
package/dist/index48.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index45.cjs"),t=require("./index209.cjs");function a(e,s){return r.keccak256(t.toPrefixedMessage(e),s)}exports.hashMessage=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index45.cjs"),t=require("./index182.cjs");function a(e,s){return r.keccak256(t.toPrefixedMessage(e),s)}exports.hashMessage=a;
package/dist/index48.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { keccak256 as o } from "./index45.js";
2
- import { toPrefixedMessage as t } from "./index209.js";
2
+ import { toPrefixedMessage as t } from "./index182.js";
3
3
  function f(e, r) {
4
4
  return o(t(e), r);
5
5
  }
package/dist/index49.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./index100.cjs"),G=require("./index215.cjs"),R=require("./index130.cjs"),S=require("./index131.cjs"),B=require("./index132.cjs"),V=require("./index133.cjs"),L=require("./index138.cjs"),h=require("./index123.cjs"),r=require("./index33.cjs"),d=require("./index203.cjs"),y=require("./index212.cjs"),C=require("./index135.cjs"),v=require("./index214.cjs");function k(e,o){const n=C.getTransactionType(e);return n==="eip1559"?_(e,o):n==="eip2930"?j(e,o):n==="eip4844"?Y(e,o):n==="eip7702"?w(e,o):M(e,o)}function w(e,o){const{authorizationList:n,chainId:s,gas:i,nonce:c,to:a,value:x,maxFeePerGas:u,maxPriorityFeePerGas:t,accessList:l,data:T}=e;y.assertTransactionEIP7702(e);const b=v.serializeAccessList(l),m=G.serializeAuthorizationList(n);return L.concatHex(["0x04",d.toRlp([r.numberToHex(s),c?r.numberToHex(c):"0x",t?r.numberToHex(t):"0x",u?r.numberToHex(u):"0x",i?r.numberToHex(i):"0x",a??"0x",x?r.numberToHex(x):"0x",T??"0x",b,m,...z(e,o)])])}function Y(e,o){const{chainId:n,gas:s,nonce:i,to:c,value:a,maxFeePerBlobGas:x,maxFeePerGas:u,maxPriorityFeePerGas:t,accessList:l,data:T}=e;y.assertTransactionEIP4844(e);let b=e.blobVersionedHashes,m=e.sidecars;if(e.blobs&&(typeof b>"u"||typeof m>"u")){const f=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(p=>r.bytesToHex(p)),P=e.kzg,H=R.blobsToCommitments({blobs:f,kzg:P});if(typeof b>"u"&&(b=B.commitmentsToVersionedHashes({commitments:H})),typeof m>"u"){const p=S.blobsToProofs({blobs:f,commitments:H,kzg:P});m=V.toBlobSidecars({blobs:f,commitments:H,proofs:p})}}const I=v.serializeAccessList(l),A=[r.numberToHex(n),i?r.numberToHex(i):"0x",t?r.numberToHex(t):"0x",u?r.numberToHex(u):"0x",s?r.numberToHex(s):"0x",c??"0x",a?r.numberToHex(a):"0x",T??"0x",I,x?r.numberToHex(x):"0x",b??[],...z(e,o)],q=[],g=[],E=[];if(m)for(let f=0;f<m.length;f++){const{blob:P,commitment:H,proof:p}=m[f];q.push(P),g.push(H),E.push(p)}return L.concatHex(["0x03",m?d.toRlp([A,q,g,E]):d.toRlp(A)])}function _(e,o){const{chainId:n,gas:s,nonce:i,to:c,value:a,maxFeePerGas:x,maxPriorityFeePerGas:u,accessList:t,data:l}=e;y.assertTransactionEIP1559(e);const T=v.serializeAccessList(t),b=[r.numberToHex(n),i?r.numberToHex(i):"0x",u?r.numberToHex(u):"0x",x?r.numberToHex(x):"0x",s?r.numberToHex(s):"0x",c??"0x",a?r.numberToHex(a):"0x",l??"0x",T,...z(e,o)];return L.concatHex(["0x02",d.toRlp(b)])}function j(e,o){const{chainId:n,gas:s,data:i,nonce:c,to:a,value:x,accessList:u,gasPrice:t}=e;y.assertTransactionEIP2930(e);const l=v.serializeAccessList(u),T=[r.numberToHex(n),c?r.numberToHex(c):"0x",t?r.numberToHex(t):"0x",s?r.numberToHex(s):"0x",a??"0x",x?r.numberToHex(x):"0x",i??"0x",l,...z(e,o)];return L.concatHex(["0x01",d.toRlp(T)])}function M(e,o){const{chainId:n=0,gas:s,data:i,nonce:c,to:a,value:x,gasPrice:u}=e;y.assertTransactionLegacy(e);let t=[c?r.numberToHex(c):"0x",u?r.numberToHex(u):"0x",s?r.numberToHex(s):"0x",a??"0x",x?r.numberToHex(x):"0x",i??"0x"];if(o){const l=(()=>{if(o.v>=35n)return(o.v-35n)/2n>0?o.v:27n+(o.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+o.v-27n);const m=27n+(o.v===27n?0n:1n);if(o.v!==m)throw new F.InvalidLegacyVError({v:o.v});return m})(),T=h.trim(o.r),b=h.trim(o.s);t=[...t,r.numberToHex(l),T==="0x00"?"0x":T,b==="0x00"?"0x":b]}else n>0&&(t=[...t,r.numberToHex(n),"0x","0x"]);return d.toRlp(t)}function z(e,o){const n=o??e,{v:s,yParity:i}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof s>"u"&&typeof i>"u")return[];const c=h.trim(n.r),a=h.trim(n.s);return[typeof i=="number"?i?r.numberToHex(1):"0x":s===0n?"0x":s===1n?r.numberToHex(1):s===27n?"0x":r.numberToHex(1),c==="0x00"?"0x":c,a==="0x00"?"0x":a]}exports.serializeTransaction=k;exports.toYParitySignatureArray=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./index119.cjs"),G=require("./index191.cjs"),R=require("./index153.cjs"),S=require("./index154.cjs"),B=require("./index155.cjs"),V=require("./index158.cjs"),L=require("./index141.cjs"),h=require("./index132.cjs"),r=require("./index33.cjs"),d=require("./index169.cjs"),y=require("./index187.cjs"),C=require("./index189.cjs"),v=require("./index190.cjs");function k(e,o){const n=C.getTransactionType(e);return n==="eip1559"?_(e,o):n==="eip2930"?j(e,o):n==="eip4844"?Y(e,o):n==="eip7702"?w(e,o):M(e,o)}function w(e,o){const{authorizationList:n,chainId:s,gas:i,nonce:c,to:a,value:x,maxFeePerGas:u,maxPriorityFeePerGas:t,accessList:l,data:T}=e;y.assertTransactionEIP7702(e);const b=v.serializeAccessList(l),m=G.serializeAuthorizationList(n);return L.concatHex(["0x04",d.toRlp([r.numberToHex(s),c?r.numberToHex(c):"0x",t?r.numberToHex(t):"0x",u?r.numberToHex(u):"0x",i?r.numberToHex(i):"0x",a??"0x",x?r.numberToHex(x):"0x",T??"0x",b,m,...z(e,o)])])}function Y(e,o){const{chainId:n,gas:s,nonce:i,to:c,value:a,maxFeePerBlobGas:x,maxFeePerGas:u,maxPriorityFeePerGas:t,accessList:l,data:T}=e;y.assertTransactionEIP4844(e);let b=e.blobVersionedHashes,m=e.sidecars;if(e.blobs&&(typeof b>"u"||typeof m>"u")){const f=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(p=>r.bytesToHex(p)),P=e.kzg,H=R.blobsToCommitments({blobs:f,kzg:P});if(typeof b>"u"&&(b=B.commitmentsToVersionedHashes({commitments:H})),typeof m>"u"){const p=S.blobsToProofs({blobs:f,commitments:H,kzg:P});m=V.toBlobSidecars({blobs:f,commitments:H,proofs:p})}}const I=v.serializeAccessList(l),A=[r.numberToHex(n),i?r.numberToHex(i):"0x",t?r.numberToHex(t):"0x",u?r.numberToHex(u):"0x",s?r.numberToHex(s):"0x",c??"0x",a?r.numberToHex(a):"0x",T??"0x",I,x?r.numberToHex(x):"0x",b??[],...z(e,o)],q=[],g=[],E=[];if(m)for(let f=0;f<m.length;f++){const{blob:P,commitment:H,proof:p}=m[f];q.push(P),g.push(H),E.push(p)}return L.concatHex(["0x03",m?d.toRlp([A,q,g,E]):d.toRlp(A)])}function _(e,o){const{chainId:n,gas:s,nonce:i,to:c,value:a,maxFeePerGas:x,maxPriorityFeePerGas:u,accessList:t,data:l}=e;y.assertTransactionEIP1559(e);const T=v.serializeAccessList(t),b=[r.numberToHex(n),i?r.numberToHex(i):"0x",u?r.numberToHex(u):"0x",x?r.numberToHex(x):"0x",s?r.numberToHex(s):"0x",c??"0x",a?r.numberToHex(a):"0x",l??"0x",T,...z(e,o)];return L.concatHex(["0x02",d.toRlp(b)])}function j(e,o){const{chainId:n,gas:s,data:i,nonce:c,to:a,value:x,accessList:u,gasPrice:t}=e;y.assertTransactionEIP2930(e);const l=v.serializeAccessList(u),T=[r.numberToHex(n),c?r.numberToHex(c):"0x",t?r.numberToHex(t):"0x",s?r.numberToHex(s):"0x",a??"0x",x?r.numberToHex(x):"0x",i??"0x",l,...z(e,o)];return L.concatHex(["0x01",d.toRlp(T)])}function M(e,o){const{chainId:n=0,gas:s,data:i,nonce:c,to:a,value:x,gasPrice:u}=e;y.assertTransactionLegacy(e);let t=[c?r.numberToHex(c):"0x",u?r.numberToHex(u):"0x",s?r.numberToHex(s):"0x",a??"0x",x?r.numberToHex(x):"0x",i??"0x"];if(o){const l=(()=>{if(o.v>=35n)return(o.v-35n)/2n>0?o.v:27n+(o.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+o.v-27n);const m=27n+(o.v===27n?0n:1n);if(o.v!==m)throw new F.InvalidLegacyVError({v:o.v});return m})(),T=h.trim(o.r),b=h.trim(o.s);t=[...t,r.numberToHex(l),T==="0x00"?"0x":T,b==="0x00"?"0x":b]}else n>0&&(t=[...t,r.numberToHex(n),"0x","0x"]);return d.toRlp(t)}function z(e,o){const n=o??e,{v:s,yParity:i}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof s>"u"&&typeof i>"u")return[];const c=h.trim(n.r),a=h.trim(n.s);return[typeof i=="number"?i?r.numberToHex(1):"0x":s===0n?"0x":s===1n?r.numberToHex(1):s===27n?"0x":r.numberToHex(1),c==="0x00"?"0x":c,a==="0x00"?"0x":a]}exports.serializeTransaction=k;exports.toYParitySignatureArray=z;
package/dist/index49.js CHANGED
@@ -1,16 +1,16 @@
1
- import { InvalidLegacyVError as H } from "./index100.js";
2
- import { serializeAuthorizationList as g } from "./index215.js";
3
- import { blobsToCommitments as B } from "./index130.js";
4
- import { blobsToProofs as V } from "./index131.js";
5
- import { commitmentsToVersionedHashes as C } from "./index132.js";
6
- import { toBlobSidecars as k } from "./index133.js";
7
- import { concatHex as h } from "./index138.js";
8
- import { trim as T } from "./index123.js";
1
+ import { InvalidLegacyVError as H } from "./index119.js";
2
+ import { serializeAuthorizationList as g } from "./index191.js";
3
+ import { blobsToCommitments as B } from "./index153.js";
4
+ import { blobsToProofs as V } from "./index154.js";
5
+ import { commitmentsToVersionedHashes as C } from "./index155.js";
6
+ import { toBlobSidecars as k } from "./index158.js";
7
+ import { concatHex as h } from "./index141.js";
8
+ import { trim as T } from "./index132.js";
9
9
  import { numberToHex as o, bytesToHex as w } from "./index33.js";
10
- import { toRlp as b } from "./index203.js";
11
- import { assertTransactionEIP1559 as S, assertTransactionEIP2930 as _, assertTransactionEIP4844 as R, assertTransactionEIP7702 as Y, assertTransactionLegacy as j } from "./index212.js";
12
- import { getTransactionType as q } from "./index135.js";
13
- import { serializeAccessList as v } from "./index214.js";
10
+ import { toRlp as b } from "./index169.js";
11
+ import { assertTransactionEIP1559 as S, assertTransactionEIP2930 as _, assertTransactionEIP4844 as R, assertTransactionEIP7702 as Y, assertTransactionLegacy as j } from "./index187.js";
12
+ import { getTransactionType as q } from "./index189.js";
13
+ import { serializeAccessList as v } from "./index190.js";
14
14
  function te(e, r) {
15
15
  const i = q(e);
16
16
  return i === "eip1559" ? K(e, r) : i === "eip2930" ? M(e, r) : i === "eip4844" ? J(e, r) : i === "eip7702" ? D(e, r) : N(e, r);
package/dist/index50.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index185.cjs"),D=require("./index138.cjs"),y=require("./index33.cjs"),s=require("./index45.cjs"),u=require("./index150.cjs");function b(a){const{domain:n={},message:e,primaryType:t}=a,o={EIP712Domain:u.getTypesForEIP712Domain({domain:n}),...a.types};u.validateTypedData({domain:n,message:e,primaryType:t,types:o});const c=["0x1901"];return n&&c.push(f({domain:n,types:o})),t!=="EIP712Domain"&&c.push(d({data:e,primaryType:t,types:o})),s.keccak256(D.concat(c))}function f({domain:a,types:n}){return d({data:a,primaryType:"EIP712Domain",types:n})}function d({data:a,primaryType:n,types:e}){const t=m({data:a,primaryType:n,types:e});return s.keccak256(t)}function m({data:a,primaryType:n,types:e}){const t=[{type:"bytes32"}],o=[l({primaryType:n,types:e})];for(const c of e[n]){const[r,i]=T({types:e,name:c.name,type:c.type,value:a[c.name]});t.push(r),o.push(i)}return p.encodeAbiParameters(t,o)}function l({primaryType:a,types:n}){const e=y.toHex(h({primaryType:a,types:n}));return s.keccak256(e)}function h({primaryType:a,types:n}){let e="";const t=k({primaryType:a,types:n});t.delete(a);const o=[a,...Array.from(t).sort()];for(const c of o)e+=`${c}(${n[c].map(({name:r,type:i})=>`${i} ${r}`).join(",")})`;return e}function k({primaryType:a,types:n},e=new Set){const t=a.match(/^\w*/u),o=t==null?void 0:t[0];if(e.has(o)||n[o]===void 0)return e;e.add(o);for(const c of n[o])k({primaryType:c.type,types:n},e);return e}function T({types:a,name:n,type:e,value:t}){if(a[e]!==void 0)return[{type:"bytes32"},s.keccak256(m({data:t,primaryType:e,types:a}))];if(e==="bytes")return[{type:"bytes32"},s.keccak256(t)];if(e==="string")return[{type:"bytes32"},s.keccak256(y.toHex(t))];if(e.lastIndexOf("]")===e.length-1){const o=e.slice(0,e.lastIndexOf("[")),c=t.map(r=>T({name:n,type:o,types:a,value:r}));return[{type:"bytes32"},s.keccak256(p.encodeAbiParameters(c.map(([r])=>r),c.map(([,r])=>r)))]}return[{type:e},t]}exports.encodeType=h;exports.hashDomain=f;exports.hashStruct=d;exports.hashTypedData=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index134.cjs"),D=require("./index141.cjs"),y=require("./index33.cjs"),s=require("./index45.cjs"),u=require("./index183.cjs");function b(a){const{domain:n={},message:e,primaryType:t}=a,o={EIP712Domain:u.getTypesForEIP712Domain({domain:n}),...a.types};u.validateTypedData({domain:n,message:e,primaryType:t,types:o});const c=["0x1901"];return n&&c.push(f({domain:n,types:o})),t!=="EIP712Domain"&&c.push(d({data:e,primaryType:t,types:o})),s.keccak256(D.concat(c))}function f({domain:a,types:n}){return d({data:a,primaryType:"EIP712Domain",types:n})}function d({data:a,primaryType:n,types:e}){const t=m({data:a,primaryType:n,types:e});return s.keccak256(t)}function m({data:a,primaryType:n,types:e}){const t=[{type:"bytes32"}],o=[l({primaryType:n,types:e})];for(const c of e[n]){const[r,i]=T({types:e,name:c.name,type:c.type,value:a[c.name]});t.push(r),o.push(i)}return p.encodeAbiParameters(t,o)}function l({primaryType:a,types:n}){const e=y.toHex(h({primaryType:a,types:n}));return s.keccak256(e)}function h({primaryType:a,types:n}){let e="";const t=k({primaryType:a,types:n});t.delete(a);const o=[a,...Array.from(t).sort()];for(const c of o)e+=`${c}(${n[c].map(({name:r,type:i})=>`${i} ${r}`).join(",")})`;return e}function k({primaryType:a,types:n},e=new Set){const t=a.match(/^\w*/u),o=t==null?void 0:t[0];if(e.has(o)||n[o]===void 0)return e;e.add(o);for(const c of n[o])k({primaryType:c.type,types:n},e);return e}function T({types:a,name:n,type:e,value:t}){if(a[e]!==void 0)return[{type:"bytes32"},s.keccak256(m({data:t,primaryType:e,types:a}))];if(e==="bytes")return[{type:"bytes32"},s.keccak256(t)];if(e==="string")return[{type:"bytes32"},s.keccak256(y.toHex(t))];if(e.lastIndexOf("]")===e.length-1){const o=e.slice(0,e.lastIndexOf("[")),c=t.map(r=>T({name:n,type:o,types:a,value:r}));return[{type:"bytes32"},s.keccak256(p.encodeAbiParameters(c.map(([r])=>r),c.map(([,r])=>r)))]}return[{type:e},t]}exports.encodeType=h;exports.hashDomain=f;exports.hashStruct=d;exports.hashTypedData=b;
package/dist/index50.js CHANGED
@@ -1,8 +1,8 @@
1
- import { encodeAbiParameters as d } from "./index185.js";
2
- import { concat as h } from "./index138.js";
1
+ import { encodeAbiParameters as d } from "./index134.js";
2
+ import { concat as h } from "./index141.js";
3
3
  import { toHex as p } from "./index33.js";
4
4
  import { keccak256 as s } from "./index45.js";
5
- import { getTypesForEIP712Domain as T, validateTypedData as D } from "./index150.js";
5
+ import { getTypesForEIP712Domain as T, validateTypedData as D } from "./index183.js";
6
6
  function k(o) {
7
7
  const { domain: n = {}, message: e, primaryType: t } = o, r = {
8
8
  EIP712Domain: T({ domain: n }),
package/dist/index51.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("./index53.cjs"),Z=require("./index43.cjs"),j=require("./index21.cjs"),ee=require("./index54.cjs"),R=require("./index55.cjs"),F=require("./index56.cjs"),A=require("./index57.cjs"),L=require("./index58.cjs"),te=require("./index59.cjs"),$=require("./index60.cjs"),ae=require("./index61.cjs"),re=require("./index62.cjs"),G=require("./index33.cjs"),oe=require("./index63.cjs"),ce=require("./index64.cjs"),ne=require("./index65.cjs"),se=require("./index66.cjs"),ie=require("./index67.cjs"),le=require("./index68.cjs"),M=require("./index69.cjs");async function ue(e,t){var P,T,H,_;const{account:a=e.account,authorizationList:s,batch:i=!!((P=e.batch)!=null&&P.multicall),blockNumber:l,blockTag:C=e.experimental_blockTag??"latest",accessList:D,blobs:k,blockOverrides:y,code:m,data:c,factory:b,factoryData:u,gas:x,gasPrice:w,maxFeePerBlobGas:p,maxFeePerGas:g,maxPriorityFeePerGas:h,nonce:q,to:r,value:J,stateOverride:K,...Q}=t,E=a?Z.parseAccount(a):void 0;if(m&&(b||u))throw new F.BaseError("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(m&&r)throw new F.BaseError("Cannot provide both `code` & `to` as parameters.");const N=m&&c,S=b&&u&&r&&c,O=N||S,U=N?W({code:m,data:c}):S?be({data:c,factory:b,factoryData:u,to:r}):c;try{le.assertRequest(t);const o=(typeof l=="bigint"?G.numberToHex(l):void 0)||C,d=y?Y.toRpc(y):void 0,f=ie.serializeStateOverride(K),V=(_=(H=(T=e.chain)==null?void 0:T.formatters)==null?void 0:H.transactionRequest)==null?void 0:_.format,B=(V||ne.formatTransactionRequest)({...ce.extract(Q,{format:V}),accessList:D,account:E,authorizationList:s,blobs:k,data:U,gas:x,gasPrice:w,maxFeePerBlobGas:p,maxFeePerGas:g,maxPriorityFeePerGas:h,nonce:q,to:O?void 0:r,value:J},"call");if(i&&de({request:B})&&!f&&!d)try{return await fe(e,{...B,blockNumber:l,blockTag:C})}catch(n){if(!(n instanceof A.ClientChainNotConfiguredError)&&!(n instanceof A.ChainDoesNotSupportContract))throw n}const X=(()=>{const n=[B,o];return f&&d?[...n,f,d]:f?[...n,f]:d?[...n,{},d]:n})(),z=await e.request({method:"eth_call",params:X});return z==="0x"?{data:void 0}:{data:z}}catch(v){const o=I(v),{offchainLookup:d,offchainLookupSignature:f}=await Promise.resolve().then(()=>require("./index52.cjs"));if(e.ccipRead!==!1&&(o==null?void 0:o.slice(0,10))===f&&r)return{data:await d(e,{data:o,to:r})};throw O&&(o==null?void 0:o.slice(0,10))==="0x101bb98d"?new L.CounterfactualDeploymentFailedError({factory:b}):oe.getCallError(v,{...t,account:E,chain:e.chain})}}function de({request:e}){const{data:t,to:a,...s}=e;return!(!t||t.startsWith(ee.aggregate3Signature)||!a||Object.values(s).filter(i=>typeof i<"u").length>0)}async function fe(e,t){var w;const{batchSize:a=1024,deployless:s=!1,wait:i=0}=typeof((w=e.batch)==null?void 0:w.multicall)=="object"?e.batch.multicall:{},{blockNumber:l,blockTag:C=e.experimental_blockTag??"latest",data:D,to:k}=t,y=(()=>{if(s)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return re.getChainContractAddress({blockNumber:l,chain:e.chain,contract:"multicall3"});throw new A.ClientChainNotConfiguredError})(),c=(typeof l=="bigint"?G.numberToHex(l):void 0)||C,{schedule:b}=se.createBatchScheduler({id:`${e.uid}.${c}`,wait:i,shouldSplitBatch(p){return p.reduce((h,{data:q})=>h+(q.length-2),0)>a*2},fn:async p=>{const g=p.map(r=>({allowFailure:!0,callData:r.data,target:r.to})),h=ae.encodeFunctionData({abi:j.multicall3Abi,args:[g],functionName:"aggregate3"}),q=await e.request({method:"eth_call",params:[{...y===null?{data:W({code:R.multicall3Bytecode,data:h})}:{to:y,data:h}},c]});return te.decodeFunctionResult({abi:j.multicall3Abi,args:[g],functionName:"aggregate3",data:q||"0x"})}}),[{returnData:u,success:x}]=await b({data:D,to:k});if(!x)throw new L.RawContractError({data:u});return u==="0x"?{data:void 0}:{data:u}}function W(e){const{code:t,data:a}=e;return $.encodeDeployData({abi:M.parseAbi(["constructor(bytes, bytes)"]),bytecode:R.deploylessCallViaBytecodeBytecode,args:[t,a]})}function be(e){const{data:t,factory:a,factoryData:s,to:i}=e;return $.encodeDeployData({abi:M.parseAbi(["constructor(address, bytes, address, bytes)"]),bytecode:R.deploylessCallViaFactoryBytecode,args:[i,t,a,s]})}function I(e){var a;if(!(e instanceof F.BaseError))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(a=t.data)==null?void 0:a.data:t.data}exports.call=ue;exports.getRevertErrorData=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(t,e,o){const i=t[e.name];if(typeof i=="function")return i;const n=t[o];return typeof n=="function"?n:c=>e(t,c)}exports.getAction=r;