@gardenfi/utils 3.0.0-beta.4 → 3.0.0-beta.6

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 (478) hide show
  1. package/dist/index10.cjs +1 -1
  2. package/dist/index10.js +4 -4
  3. package/dist/index100.cjs +2 -1
  4. package/dist/index100.js +121 -3
  5. package/dist/index101.cjs +1 -1
  6. package/dist/index101.js +14 -18
  7. package/dist/index102.cjs +1 -1
  8. package/dist/index102.js +24 -20
  9. package/dist/index103.cjs +1 -1
  10. package/dist/index103.js +31 -33
  11. package/dist/index104.cjs +1 -1
  12. package/dist/index104.js +42 -21
  13. package/dist/index105.cjs +1 -1
  14. package/dist/index105.js +6 -8
  15. package/dist/index106.cjs +1 -4
  16. package/dist/index106.js +102 -193
  17. package/dist/index107.cjs +1 -3
  18. package/dist/index107.js +37 -451
  19. package/dist/index108.cjs +1 -1
  20. package/dist/index108.js +8 -27
  21. package/dist/index109.cjs +1 -1
  22. package/dist/index109.js +19 -160
  23. package/dist/index110.cjs +1 -1
  24. package/dist/index110.js +2 -22
  25. package/dist/index111.cjs +1 -1
  26. package/dist/index111.js +75 -127
  27. package/dist/index112.cjs +1 -1
  28. package/dist/index112.js +15 -38
  29. package/dist/index113.cjs +1 -1
  30. package/dist/index113.js +151 -6
  31. package/dist/index114.cjs +20 -1
  32. package/dist/index114.js +326 -27
  33. package/dist/index115.cjs +3 -1
  34. package/dist/index115.js +451 -55
  35. package/dist/index116.cjs +1 -1
  36. package/dist/index116.js +70 -42
  37. package/dist/index117.cjs +1 -1
  38. package/dist/index117.js +16 -191
  39. package/dist/index118.cjs +1 -1
  40. package/dist/index118.js +11 -4
  41. package/dist/index119.cjs +1 -1
  42. package/dist/index119.js +120 -59
  43. package/dist/index120.cjs +1 -1
  44. package/dist/index120.js +5 -20
  45. package/dist/index121.cjs +1 -1
  46. package/dist/index121.js +46 -3
  47. package/dist/index122.cjs +1 -1
  48. package/dist/index122.js +37 -15
  49. package/dist/index123.cjs +1 -1
  50. package/dist/index123.js +6 -23
  51. package/dist/index124.cjs +1 -1
  52. package/dist/index124.js +90 -11
  53. package/dist/index125.cjs +1 -1
  54. package/dist/index125.js +14 -18
  55. package/dist/index126.cjs +1 -1
  56. package/dist/index126.js +3 -34
  57. package/dist/index127.cjs +1 -1
  58. package/dist/index127.js +27 -3
  59. package/dist/index128.cjs +2 -1
  60. package/dist/index128.js +24 -18
  61. package/dist/index129.cjs +1 -1
  62. package/dist/index129.js +9 -27
  63. package/dist/index130.cjs +1 -1
  64. package/dist/index130.js +8 -36
  65. package/dist/index131.cjs +1 -1
  66. package/dist/index131.js +10 -8
  67. package/dist/index132.cjs +1 -1
  68. package/dist/index132.js +11 -10
  69. package/dist/index133.cjs +1 -1
  70. package/dist/index133.js +12 -24
  71. package/dist/index134.cjs +1 -1
  72. package/dist/index134.js +20 -27
  73. package/dist/index135.cjs +1 -1
  74. package/dist/index135.js +14 -3
  75. package/dist/index136.cjs +1 -1
  76. package/dist/index136.js +4 -75
  77. package/dist/index137.cjs +1 -1
  78. package/dist/index137.js +6 -9
  79. package/dist/index138.cjs +1 -1
  80. package/dist/index138.js +18 -21
  81. package/dist/index139.cjs +1 -1
  82. package/dist/index139.js +10 -8
  83. package/dist/index140.cjs +1 -1
  84. package/dist/index140.js +57 -9
  85. package/dist/index141.cjs +1 -1
  86. package/dist/index141.js +6 -11
  87. package/dist/index142.cjs +1 -1
  88. package/dist/index142.js +13 -6
  89. package/dist/index143.cjs +1 -1
  90. package/dist/index143.js +7 -6
  91. package/dist/index144.cjs +1 -1
  92. package/dist/index144.js +137 -12
  93. package/dist/index145.cjs +1 -1
  94. package/dist/index145.js +7 -32
  95. package/dist/index146.cjs +1 -1
  96. package/dist/index146.js +22 -5
  97. package/dist/index147.cjs +1 -1
  98. package/dist/index147.js +16 -36
  99. package/dist/index148.cjs +1 -1
  100. package/dist/index148.js +41 -109
  101. package/dist/index149.cjs +1 -1
  102. package/dist/index149.js +20 -170
  103. package/dist/index15.cjs +1 -1
  104. package/dist/index15.js +2 -2
  105. package/dist/index150.cjs +1 -1
  106. package/dist/index150.js +77 -46
  107. package/dist/index151.cjs +1 -1
  108. package/dist/index151.js +11 -32
  109. package/dist/index152.cjs +1 -1
  110. package/dist/index152.js +13 -7
  111. package/dist/index153.cjs +1 -1
  112. package/dist/index153.js +6 -17
  113. package/dist/index154.cjs +1 -1
  114. package/dist/index154.js +41 -20
  115. package/dist/index155.cjs +1 -1
  116. package/dist/index155.js +5 -23
  117. package/dist/index156.cjs +1 -1
  118. package/dist/index156.js +32 -41
  119. package/dist/index157.cjs +1 -1
  120. package/dist/index157.js +9 -22
  121. package/dist/index158.cjs +1 -1
  122. package/dist/index158.js +58 -19
  123. package/dist/index159.cjs +1 -1
  124. package/dist/index159.js +18 -50
  125. package/dist/index160.cjs +1 -1
  126. package/dist/index160.js +105 -11
  127. package/dist/index161.cjs +1 -1
  128. package/dist/index161.js +78 -24
  129. package/dist/index162.cjs +1 -1
  130. package/dist/index162.js +9 -24
  131. package/dist/index163.cjs +1 -1
  132. package/dist/index163.js +87 -101
  133. package/dist/index164.cjs +2 -1
  134. package/dist/index164.js +3 -3
  135. package/dist/index165.cjs +1 -1
  136. package/dist/index165.js +9 -6
  137. package/dist/index166.cjs +1 -1
  138. package/dist/index166.js +12 -30
  139. package/dist/index167.cjs +1 -1
  140. package/dist/index167.js +4 -3
  141. package/dist/index168.cjs +1 -1
  142. package/dist/index168.js +2 -18
  143. package/dist/index169.cjs +1 -1
  144. package/dist/index169.js +32 -6
  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 +21 -8
  149. package/dist/index171.cjs +1 -1
  150. package/dist/index171.js +5 -103
  151. package/dist/index172.cjs +1 -1
  152. package/dist/index172.js +5 -80
  153. package/dist/index173.cjs +1 -1
  154. package/dist/index173.js +5 -5
  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 -28
  159. package/dist/index176.cjs +1 -1
  160. package/dist/index176.js +17 -33
  161. package/dist/index177.cjs +1 -1
  162. package/dist/index177.js +20 -13
  163. package/dist/index178.cjs +1 -1
  164. package/dist/index178.js +35 -16
  165. package/dist/index179.cjs +1 -1
  166. package/dist/index179.js +7 -77
  167. package/dist/index18.cjs +1 -1
  168. package/dist/index18.js +8 -8
  169. package/dist/index180.cjs +4 -1
  170. package/dist/index180.js +195 -2
  171. package/dist/index181.cjs +1 -1
  172. package/dist/index181.js +27 -14
  173. package/dist/index182.cjs +1 -1
  174. package/dist/index182.js +161 -18
  175. package/dist/index183.cjs +1 -1
  176. package/dist/index183.js +126 -170
  177. package/dist/index184.cjs +1 -1
  178. package/dist/index184.js +27 -17
  179. package/dist/index185.cjs +1 -1
  180. package/dist/index185.js +191 -10
  181. package/dist/index186.cjs +1 -1
  182. package/dist/index186.js +4 -26
  183. package/dist/index187.cjs +1 -1
  184. package/dist/index187.js +20 -18
  185. package/dist/index188.cjs +1 -1
  186. package/dist/index188.js +3 -16
  187. package/dist/index189.cjs +1 -1
  188. package/dist/index189.js +16 -5
  189. package/dist/index190.cjs +1 -1
  190. package/dist/index190.js +34 -13
  191. package/dist/index191.cjs +1 -1
  192. package/dist/index191.js +3 -11
  193. package/dist/index192.cjs +1 -1
  194. package/dist/index192.js +27 -16
  195. package/dist/index193.cjs +1 -1
  196. package/dist/index193.js +23 -28
  197. package/dist/index194.cjs +1 -1
  198. package/dist/index194.js +29 -2
  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 -12
  203. package/dist/index197.cjs +1 -1
  204. package/dist/index197.js +31 -46
  205. package/dist/index198.cjs +1 -1
  206. package/dist/index198.js +5 -12
  207. package/dist/index199.cjs +1 -1
  208. package/dist/index199.js +37 -7
  209. package/dist/index20.cjs +1 -1
  210. package/dist/index20.js +2 -2
  211. package/dist/index200.cjs +1 -1
  212. package/dist/index200.js +47 -68
  213. package/dist/index201.cjs +1 -1
  214. package/dist/index201.js +32 -46
  215. package/dist/index202.cjs +1 -1
  216. package/dist/index202.js +16 -36
  217. package/dist/index203.cjs +1 -1
  218. package/dist/index203.js +42 -17
  219. package/dist/index204.cjs +1 -1
  220. package/dist/index204.js +104 -6
  221. package/dist/index205.cjs +1 -1
  222. package/dist/index205.js +3 -10
  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 -13
  227. package/dist/index208.cjs +1 -1
  228. package/dist/index208.js +17 -8
  229. package/dist/index209.cjs +1 -1
  230. package/dist/index209.js +8 -35
  231. package/dist/index210.cjs +1 -1
  232. package/dist/index210.js +5 -16
  233. package/dist/index211.cjs +1 -1
  234. package/dist/index211.js +27 -29
  235. package/dist/index212.cjs +1 -1
  236. package/dist/index212.js +78 -14
  237. package/dist/index213.cjs +1 -1
  238. package/dist/index213.js +2 -7
  239. package/dist/index214.cjs +1 -1
  240. package/dist/index214.js +18 -103
  241. package/dist/index215.cjs +1 -1
  242. package/dist/index215.js +16 -74
  243. package/dist/index216.cjs +1 -2
  244. package/dist/index216.js +10 -24
  245. package/dist/index217.cjs +1 -2
  246. package/dist/index217.js +102 -40
  247. package/dist/index218.cjs +1 -1
  248. package/dist/index218.js +17 -2
  249. package/dist/index219.cjs +1 -1
  250. package/dist/index219.js +214 -5
  251. package/dist/index22.cjs +1 -1
  252. package/dist/index22.js +9 -9
  253. package/dist/index220.cjs +1 -1
  254. package/dist/index220.js +42 -10
  255. package/dist/index221.cjs +1 -1
  256. package/dist/index221.js +107 -18
  257. package/dist/index222.cjs +1 -1
  258. package/dist/index222.js +78 -8
  259. package/dist/index223.cjs +1 -1
  260. package/dist/index223.js +2 -67
  261. package/dist/index224.cjs +1 -1
  262. package/dist/index224.js +42 -61
  263. package/dist/index225.cjs +1 -1
  264. package/dist/index225.js +7 -186
  265. package/dist/index226.cjs +1 -1
  266. package/dist/index226.js +24 -28
  267. package/dist/index227.cjs +2 -1
  268. package/dist/index227.js +24 -59
  269. package/dist/index228.cjs +1 -1
  270. package/dist/index228.js +2 -41
  271. package/dist/index229.cjs +1 -1
  272. package/dist/index229.js +5 -16
  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 +9 -12
  277. package/dist/index231.cjs +1 -1
  278. package/dist/index231.js +19 -11
  279. package/dist/index232.cjs +1 -1
  280. package/dist/index232.js +8 -12
  281. package/dist/index233.cjs +1 -1
  282. package/dist/index233.js +67 -20
  283. package/dist/index234.cjs +1 -1
  284. package/dist/index234.js +63 -106
  285. package/dist/index235.cjs +1 -1
  286. package/dist/index235.js +188 -6
  287. package/dist/index236.cjs +1 -1
  288. package/dist/index236.js +29 -7
  289. package/dist/index237.cjs +1 -1
  290. package/dist/index237.js +75 -25
  291. package/dist/index238.cjs +1 -1
  292. package/dist/index238.js +37 -100
  293. package/dist/index239.cjs +1 -1
  294. package/dist/index239.js +16 -16
  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 +12 -213
  299. package/dist/index241.cjs +1 -1
  300. package/dist/index241.js +11 -206
  301. package/dist/index242.cjs +1 -1
  302. package/dist/index242.js +12 -42
  303. package/dist/index243.cjs +1 -1
  304. package/dist/index243.js +6 -78
  305. package/dist/index244.cjs +1 -1
  306. package/dist/index244.js +7 -2
  307. package/dist/index245.cjs +1 -1
  308. package/dist/index245.js +19 -24
  309. package/dist/index246.cjs +1 -1
  310. package/dist/index246.js +25 -45
  311. package/dist/index247.cjs +1 -1
  312. package/dist/index247.js +11 -9
  313. package/dist/index248.cjs +1 -1
  314. package/dist/index248.js +19 -11
  315. package/dist/index249.cjs +1 -1
  316. package/dist/index249.js +656 -18
  317. package/dist/index25.cjs +1 -16
  318. package/dist/index25.js +12 -113
  319. package/dist/index250.cjs +1 -1
  320. package/dist/index250.js +206 -68
  321. package/dist/index251.cjs +1 -1
  322. package/dist/index251.js +154 -634
  323. package/dist/index252.cjs +2 -1
  324. package/dist/index252.js +88 -174
  325. package/dist/index253.cjs +1 -2
  326. package/dist/index253.js +14 -91
  327. package/dist/index254.cjs +1 -1
  328. package/dist/index254.js +68 -14
  329. package/dist/index26.cjs +1 -1
  330. package/dist/index26.js +59 -30
  331. package/dist/index27.cjs +16 -1
  332. package/dist/index27.js +111 -24
  333. package/dist/index28.cjs +1 -1
  334. package/dist/index28.js +29 -7
  335. package/dist/index29.cjs +1 -1
  336. package/dist/index29.js +13 -7
  337. package/dist/index30.cjs +1 -1
  338. package/dist/index30.js +34 -31
  339. package/dist/index31.cjs +1 -1
  340. package/dist/index31.js +30 -27
  341. package/dist/index32.cjs +1 -1
  342. package/dist/index32.js +55 -16
  343. package/dist/index33.cjs +1 -1
  344. package/dist/index33.js +43 -31
  345. package/dist/index34.cjs +1 -1
  346. package/dist/index34.js +22 -41
  347. package/dist/index35.cjs +1 -1
  348. package/dist/index35.js +6 -151
  349. package/dist/index36.cjs +1 -1
  350. package/dist/index36.js +18 -41
  351. package/dist/index37.cjs +1 -1
  352. package/dist/index37.js +14 -57
  353. package/dist/index38.cjs +1 -2
  354. package/dist/index38.js +5 -59
  355. package/dist/index39.cjs +1 -1
  356. package/dist/index39.js +13 -13
  357. package/dist/index40.cjs +1 -1
  358. package/dist/index40.js +10 -37
  359. package/dist/index41.cjs +1 -1
  360. package/dist/index41.js +12 -15
  361. package/dist/index42.cjs +1 -1
  362. package/dist/index42.js +11 -8
  363. package/dist/index43.cjs +1 -1
  364. package/dist/index43.js +3 -20
  365. package/dist/index44.cjs +1 -1
  366. package/dist/index44.js +22 -2
  367. package/dist/index45.cjs +1 -1
  368. package/dist/index45.js +8 -45
  369. package/dist/index46.cjs +1 -1
  370. package/dist/index46.js +3 -33
  371. package/dist/index47.cjs +1 -1
  372. package/dist/index47.js +16 -3
  373. package/dist/index48.cjs +1 -1
  374. package/dist/index48.js +5 -9
  375. package/dist/index49.cjs +1 -1
  376. package/dist/index49.js +171 -60
  377. package/dist/index50.cjs +1 -1
  378. package/dist/index50.js +101 -75
  379. package/dist/index51.cjs +1 -1
  380. package/dist/index51.js +171 -7
  381. package/dist/index52.cjs +1 -1
  382. package/dist/index52.js +110 -15
  383. package/dist/index53.cjs +1 -1
  384. package/dist/index53.js +30 -10
  385. package/dist/index54.cjs +1 -1
  386. package/dist/index54.js +2 -6
  387. package/dist/index55.cjs +1 -1
  388. package/dist/index55.js +4 -15
  389. package/dist/index56.cjs +2 -1
  390. package/dist/index56.js +59 -3
  391. package/dist/index57.cjs +2 -1
  392. package/dist/index57.js +53 -25
  393. package/dist/index58.cjs +3 -1
  394. package/dist/index58.js +210 -159
  395. package/dist/index59.cjs +1 -1
  396. package/dist/index59.js +23 -4
  397. package/dist/index60.cjs +1 -1
  398. package/dist/index60.js +18 -6
  399. package/dist/index61.cjs +1 -1
  400. package/dist/index61.js +10 -90
  401. package/dist/index62.cjs +1 -1
  402. package/dist/index62.js +20 -10
  403. package/dist/index63.cjs +1 -1
  404. package/dist/index63.js +13 -6
  405. package/dist/index64.cjs +1 -1
  406. package/dist/index64.js +12 -13
  407. package/dist/index65.cjs +1 -1
  408. package/dist/index65.js +24 -125
  409. package/dist/index66.cjs +1 -1
  410. package/dist/index66.js +26 -135
  411. package/dist/index67.cjs +1 -1
  412. package/dist/index67.js +47 -7
  413. package/dist/index68.cjs +1 -1
  414. package/dist/index68.js +16 -21
  415. package/dist/index69.cjs +1 -1
  416. package/dist/index69.js +11 -17
  417. package/dist/index70.cjs +1 -1
  418. package/dist/index70.js +27 -39
  419. package/dist/index71.cjs +1 -1
  420. package/dist/index71.js +36 -21
  421. package/dist/index72.cjs +1 -1
  422. package/dist/index72.js +7 -11
  423. package/dist/index73.cjs +1 -1
  424. package/dist/index73.js +29 -6
  425. package/dist/index74.cjs +1 -1
  426. package/dist/index74.js +22 -5
  427. package/dist/index75.cjs +1 -1
  428. package/dist/index75.js +7 -19
  429. package/dist/index76.cjs +1 -1
  430. package/dist/index76.js +70 -106
  431. package/dist/index77.cjs +1 -1
  432. package/dist/index77.js +44 -76
  433. package/dist/index78.cjs +1 -1
  434. package/dist/index78.js +20 -6
  435. package/dist/index79.cjs +1 -1
  436. package/dist/index79.js +36 -27
  437. package/dist/index80.cjs +1 -1
  438. package/dist/index80.js +17 -71
  439. package/dist/index81.cjs +1 -1
  440. package/dist/index81.js +7 -4
  441. package/dist/index82.cjs +1 -2
  442. package/dist/index82.js +10 -3
  443. package/dist/index83.cjs +1 -1
  444. package/dist/index83.js +14 -9
  445. package/dist/index84.cjs +1 -20
  446. package/dist/index84.js +162 -324
  447. package/dist/index85.cjs +1 -1
  448. package/dist/index85.js +77 -13
  449. package/dist/index86.cjs +1 -1
  450. package/dist/index86.js +13 -4
  451. package/dist/index87.cjs +1 -1
  452. package/dist/index87.js +51 -12
  453. package/dist/index88.cjs +1 -1
  454. package/dist/index88.js +8 -2
  455. package/dist/index89.cjs +1 -1
  456. package/dist/index89.js +1 -1
  457. package/dist/index90.cjs +1 -2
  458. package/dist/index90.js +21 -54
  459. package/dist/index91.cjs +1 -3
  460. package/dist/index91.js +8 -215
  461. package/dist/index92.cjs +1 -1
  462. package/dist/index92.js +32 -32
  463. package/dist/index93.cjs +1 -1
  464. package/dist/index93.js +16 -21
  465. package/dist/index94.cjs +1 -1
  466. package/dist/index94.js +73 -5
  467. package/dist/index95.cjs +1 -1
  468. package/dist/index95.js +34 -72
  469. package/dist/index96.cjs +1 -1
  470. package/dist/index96.js +16 -5
  471. package/dist/index97.cjs +1 -1
  472. package/dist/index97.js +75 -5
  473. package/dist/index98.cjs +1 -9
  474. package/dist/index98.js +12 -35
  475. package/dist/index99.cjs +1 -2
  476. package/dist/index99.js +28 -119
  477. package/dist/src/lib/store/store.interface.d.ts +2 -1
  478. package/package.json +1 -1
package/dist/index160.js CHANGED
@@ -1,15 +1,109 @@
1
- function c(n, { args: t, eventName: a } = {}) {
2
- return {
3
- ...n,
4
- blockHash: n.blockHash ? n.blockHash : null,
5
- blockNumber: n.blockNumber ? BigInt(n.blockNumber) : null,
6
- blockTimestamp: n.blockTimestamp ? BigInt(n.blockTimestamp) : n.blockTimestamp === null ? null : void 0,
7
- logIndex: n.logIndex ? Number(n.logIndex) : null,
8
- transactionHash: n.transactionHash ? n.transactionHash : null,
9
- transactionIndex: n.transactionIndex ? Number(n.transactionIndex) : null,
10
- ...a ? { args: t, eventName: a } : {}
1
+ import { BaseError as z } from "./index56.js";
2
+ import { HttpRequestError as k } from "./index161.js";
3
+ import { MethodNotSupportedRpcError as s, UnknownRpcError as J, UserRejectedRequestError as u, AtomicityNotSupportedError as f, AtomicReadyWalletRejectedUpgradeError as E, BundleTooLargeError as l, UnknownBundleIdError as R, DuplicateIdError as m, UnsupportedChainIdError as y, UnsupportedNonOptionalCapabilityError as I, SwitchChainError as U, ChainDisconnectedError as v, ProviderDisconnectedError as b, UnsupportedProviderMethodError as N, UnauthorizedProviderError as q, JsonRpcVersionUnsupportedError as C, LimitExceededRpcError as a, TransactionRejectedRpcError as D, ResourceUnavailableRpcError as P, ResourceNotFoundRpcError as x, InvalidInputRpcError as j, InternalRpcError as i, InvalidParamsRpcError as B, MethodNotFoundRpcError as M, InvalidRequestRpcError as S, ParseRpcError as T } from "./index115.js";
4
+ import { stringToHex as O } from "./index33.js";
5
+ import { withDedupe as V } from "./index241.js";
6
+ import { withRetry as W } from "./index109.js";
7
+ import { stringify as _ } from "./index110.js";
8
+ function te(r, A = {}) {
9
+ return async (n, F = {}) => {
10
+ var h;
11
+ const { dedupe: w = !1, methods: t, retryDelay: H = 150, retryCount: L = 3, uid: $ } = {
12
+ ...A,
13
+ ...F
14
+ }, { method: c } = n;
15
+ if ((h = t == null ? void 0 : t.exclude) != null && h.includes(c))
16
+ throw new s(new Error("method not supported"), {
17
+ method: c
18
+ });
19
+ if (t != null && t.include && !t.include.includes(c))
20
+ throw new s(new Error("method not supported"), {
21
+ method: c
22
+ });
23
+ const g = w ? O(`${$}.${_(n)}`) : void 0;
24
+ return V(() => W(async () => {
25
+ try {
26
+ return await r(n);
27
+ } catch (o) {
28
+ const e = o;
29
+ switch (e.code) {
30
+ case T.code:
31
+ throw new T(e);
32
+ case S.code:
33
+ throw new S(e);
34
+ case M.code:
35
+ throw new M(e, { method: n.method });
36
+ case B.code:
37
+ throw new B(e);
38
+ case i.code:
39
+ throw new i(e);
40
+ case j.code:
41
+ throw new j(e);
42
+ case x.code:
43
+ throw new x(e);
44
+ case P.code:
45
+ throw new P(e);
46
+ case D.code:
47
+ throw new D(e);
48
+ case s.code:
49
+ throw new s(e, {
50
+ method: n.method
51
+ });
52
+ case a.code:
53
+ throw new a(e);
54
+ case C.code:
55
+ throw new C(e);
56
+ case u.code:
57
+ throw new u(e);
58
+ case q.code:
59
+ throw new q(e);
60
+ case N.code:
61
+ throw new N(e);
62
+ case b.code:
63
+ throw new b(e);
64
+ case v.code:
65
+ throw new v(e);
66
+ case U.code:
67
+ throw new U(e);
68
+ case I.code:
69
+ throw new I(e);
70
+ case y.code:
71
+ throw new y(e);
72
+ case m.code:
73
+ throw new m(e);
74
+ case R.code:
75
+ throw new R(e);
76
+ case l.code:
77
+ throw new l(e);
78
+ case E.code:
79
+ throw new E(e);
80
+ case f.code:
81
+ throw new f(e);
82
+ case 5e3:
83
+ throw new u(e);
84
+ default:
85
+ throw o instanceof z ? o : new J(e);
86
+ }
87
+ }
88
+ }, {
89
+ delay: ({ count: o, error: e }) => {
90
+ var p;
91
+ if (e && e instanceof k) {
92
+ const d = (p = e == null ? void 0 : e.headers) == null ? void 0 : p.get("Retry-After");
93
+ if (d != null && d.match(/\d/))
94
+ return Number.parseInt(d, 10) * 1e3;
95
+ }
96
+ return ~~(1 << o) * H;
97
+ },
98
+ retryCount: L,
99
+ shouldRetry: ({ error: o }) => G(o)
100
+ }), { enabled: w, id: g });
11
101
  };
12
102
  }
103
+ function G(r) {
104
+ return "code" in r && typeof r.code == "number" ? r.code === -1 || r.code === a.code || r.code === i.code : r instanceof k && r.status ? r.status === 403 || r.status === 408 || r.status === 413 || r.status === 429 || r.status === 500 || r.status === 502 || r.status === 503 || r.status === 504 : !0;
105
+ }
13
106
  export {
14
- c as formatLog
107
+ te as buildRequest,
108
+ G as shouldRetry
15
109
  };
package/dist/index161.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index155.cjs"),d=require("./index160.cjs"),r=require("./index159.cjs"),u={"0x0":"reverted","0x1":"success"};function o(l,g){const s={...l,blockNumber:l.blockNumber?BigInt(l.blockNumber):null,contractAddress:l.contractAddress?l.contractAddress:null,cumulativeGasUsed:l.cumulativeGasUsed?BigInt(l.cumulativeGasUsed):null,effectiveGasPrice:l.effectiveGasPrice?BigInt(l.effectiveGasPrice):null,gasUsed:l.gasUsed?BigInt(l.gasUsed):null,logs:l.logs?l.logs.map(e=>d.formatLog(e)):null,to:l.to?l.to:null,transactionIndex:l.transactionIndex?b.hexToNumber(l.transactionIndex):null,status:l.status?u[l.status]:null,type:l.type?r.transactionType[l.type]||l.type:null};return l.blobGasPrice&&(s.blobGasPrice=BigInt(l.blobGasPrice)),l.blobGasUsed&&(s.blobGasUsed=BigInt(l.blobGasUsed)),s}exports.formatTransactionReceipt=o;exports.receiptStatuses=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index110.cjs"),i=require("./index56.cjs"),a=require("./index175.cjs");class b extends i.BaseError{constructor({body:t,cause:e,details:r,headers:n,status:u,url:l}){super("HTTP request failed.",{cause:e,details:r,metaMessages:[u&&`Status: ${u}`,`URL: ${a.getUrl(l)}`,t&&`Request body: ${s.stringify(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=n,this.status=u,this.url=l}}class d extends i.BaseError{constructor({body:t,error:e,url:r}){super("RPC Request failed.",{cause:e,details:e.message,metaMessages:[`URL: ${a.getUrl(r)}`,`Request body: ${s.stringify(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e.code,this.data=e.data,this.url=r}}class c extends i.BaseError{constructor({body:t,url:e}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${a.getUrl(e)}`,`Request body: ${s.stringify(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e}}exports.HttpRequestError=b;exports.RpcRequestError=d;exports.TimeoutError=c;
package/dist/index161.js CHANGED
@@ -1,27 +1,81 @@
1
- import { hexToNumber as b } from "./index155.js";
2
- import { formatLog as d } from "./index160.js";
3
- import { transactionType as m } from "./index159.js";
4
- const f = {
5
- "0x0": "reverted",
6
- "0x1": "success"
7
- };
8
- function I(l, g) {
9
- const u = {
10
- ...l,
11
- blockNumber: l.blockNumber ? BigInt(l.blockNumber) : null,
12
- contractAddress: l.contractAddress ? l.contractAddress : null,
13
- cumulativeGasUsed: l.cumulativeGasUsed ? BigInt(l.cumulativeGasUsed) : null,
14
- effectiveGasPrice: l.effectiveGasPrice ? BigInt(l.effectiveGasPrice) : null,
15
- gasUsed: l.gasUsed ? BigInt(l.gasUsed) : null,
16
- logs: l.logs ? l.logs.map((s) => d(s)) : null,
17
- to: l.to ? l.to : null,
18
- transactionIndex: l.transactionIndex ? b(l.transactionIndex) : null,
19
- status: l.status ? f[l.status] : null,
20
- type: l.type ? m[l.type] || l.type : null
21
- };
22
- return l.blobGasPrice && (u.blobGasPrice = BigInt(l.blobGasPrice)), l.blobGasUsed && (u.blobGasUsed = BigInt(l.blobGasUsed)), u;
1
+ import { stringify as s } from "./index110.js";
2
+ import { BaseError as a } from "./index56.js";
3
+ import { getUrl as i } from "./index175.js";
4
+ class m extends a {
5
+ constructor({ body: t, cause: e, details: r, headers: n, status: u, url: l }) {
6
+ super("HTTP request failed.", {
7
+ cause: e,
8
+ details: r,
9
+ metaMessages: [
10
+ u && `Status: ${u}`,
11
+ `URL: ${i(l)}`,
12
+ t && `Request body: ${s(t)}`
13
+ ].filter(Boolean),
14
+ name: "HttpRequestError"
15
+ }), Object.defineProperty(this, "body", {
16
+ enumerable: !0,
17
+ configurable: !0,
18
+ writable: !0,
19
+ value: void 0
20
+ }), Object.defineProperty(this, "headers", {
21
+ enumerable: !0,
22
+ configurable: !0,
23
+ writable: !0,
24
+ value: void 0
25
+ }), Object.defineProperty(this, "status", {
26
+ enumerable: !0,
27
+ configurable: !0,
28
+ writable: !0,
29
+ value: void 0
30
+ }), Object.defineProperty(this, "url", {
31
+ enumerable: !0,
32
+ configurable: !0,
33
+ writable: !0,
34
+ value: void 0
35
+ }), this.body = t, this.headers = n, this.status = u, this.url = l;
36
+ }
37
+ }
38
+ class f extends a {
39
+ constructor({ body: t, error: e, url: r }) {
40
+ super("RPC Request failed.", {
41
+ cause: e,
42
+ details: e.message,
43
+ metaMessages: [`URL: ${i(r)}`, `Request body: ${s(t)}`],
44
+ name: "RpcRequestError"
45
+ }), Object.defineProperty(this, "code", {
46
+ enumerable: !0,
47
+ configurable: !0,
48
+ writable: !0,
49
+ value: void 0
50
+ }), Object.defineProperty(this, "data", {
51
+ enumerable: !0,
52
+ configurable: !0,
53
+ writable: !0,
54
+ value: void 0
55
+ }), Object.defineProperty(this, "url", {
56
+ enumerable: !0,
57
+ configurable: !0,
58
+ writable: !0,
59
+ value: void 0
60
+ }), this.code = e.code, this.data = e.data, this.url = r;
61
+ }
62
+ }
63
+ class h extends a {
64
+ constructor({ body: t, url: e }) {
65
+ super("The request took too long to respond.", {
66
+ details: "The request timed out.",
67
+ metaMessages: [`URL: ${i(e)}`, `Request body: ${s(t)}`],
68
+ name: "TimeoutError"
69
+ }), Object.defineProperty(this, "url", {
70
+ enumerable: !0,
71
+ configurable: !0,
72
+ writable: !0,
73
+ value: void 0
74
+ }), this.url = e;
75
+ }
23
76
  }
24
77
  export {
25
- I as formatTransactionReceipt,
26
- f as receiptStatuses
78
+ m as HttpRequestError,
79
+ f as RpcRequestError,
80
+ h as TimeoutError
27
81
  };
package/dist/index162.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index116.cjs"),i={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function a(e,f){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=y(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(d=>o.bytesToHex(d)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=o.numberToHex(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=o.numberToHex(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=o.numberToHex(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=o.numberToHex(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=o.numberToHex(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=o.numberToHex(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=i[e.type]),typeof e.value<"u"&&(n.value=o.numberToHex(e.value)),n}function y(e){return e.map(f=>({address:f.address,r:f.r?o.numberToHex(BigInt(f.r)):f.r,s:f.s?o.numberToHex(BigInt(f.s)):f.s,chainId:o.numberToHex(f.chainId),nonce:o.numberToHex(f.nonce),...typeof f.yParity<"u"?{yParity:o.numberToHex(f.yParity)}:{},...typeof f.v<"u"&&typeof f.yParity>"u"?{v:o.numberToHex(f.v)}:{}}))}exports.formatTransactionRequest=a;exports.rpcTransactionType=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index56.cjs");class e extends r.BaseError{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}exports.UrlRequiredError=e;
package/dist/index162.js CHANGED
@@ -1,27 +1,12 @@
1
- import { bytesToHex as o, numberToHex as i } from "./index116.js";
2
- const a = {
3
- legacy: "0x0",
4
- eip2930: "0x1",
5
- eip1559: "0x2",
6
- eip4844: "0x3",
7
- eip7702: "0x4"
8
- };
9
- function c(e, n) {
10
- const f = {};
11
- return typeof e.authorizationList < "u" && (f.authorizationList = y(e.authorizationList)), typeof e.accessList < "u" && (f.accessList = e.accessList), typeof e.blobVersionedHashes < "u" && (f.blobVersionedHashes = e.blobVersionedHashes), typeof e.blobs < "u" && (typeof e.blobs[0] != "string" ? f.blobs = e.blobs.map((d) => o(d)) : f.blobs = e.blobs), typeof e.data < "u" && (f.data = e.data), e.account && (f.from = e.account.address), typeof e.from < "u" && (f.from = e.from), typeof e.gas < "u" && (f.gas = i(e.gas)), typeof e.gasPrice < "u" && (f.gasPrice = i(e.gasPrice)), typeof e.maxFeePerBlobGas < "u" && (f.maxFeePerBlobGas = i(e.maxFeePerBlobGas)), typeof e.maxFeePerGas < "u" && (f.maxFeePerGas = i(e.maxFeePerGas)), typeof e.maxPriorityFeePerGas < "u" && (f.maxPriorityFeePerGas = i(e.maxPriorityFeePerGas)), typeof e.nonce < "u" && (f.nonce = i(e.nonce)), typeof e.to < "u" && (f.to = e.to), typeof e.type < "u" && (f.type = a[e.type]), typeof e.value < "u" && (f.value = i(e.value)), f;
12
- }
13
- function y(e) {
14
- return e.map((n) => ({
15
- address: n.address,
16
- r: n.r ? i(BigInt(n.r)) : n.r,
17
- s: n.s ? i(BigInt(n.s)) : n.s,
18
- chainId: i(n.chainId),
19
- nonce: i(n.nonce),
20
- ...typeof n.yParity < "u" ? { yParity: i(n.yParity) } : {},
21
- ...typeof n.v < "u" && typeof n.yParity > "u" ? { v: i(n.v) } : {}
22
- }));
1
+ import { BaseError as r } from "./index56.js";
2
+ class t extends r {
3
+ constructor() {
4
+ super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.", {
5
+ docsPath: "/docs/clients/intro",
6
+ name: "UrlRequiredError"
7
+ });
8
+ }
23
9
  }
24
10
  export {
25
- c as formatTransactionRequest,
26
- a as rpcTransactionType
11
+ t as UrlRequiredError
27
12
  };
package/dist/index163.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index233.cjs"),c=require("./index234.cjs"),A=BigInt(0),u=BigInt(1),H=BigInt(2),L=BigInt(7),S=BigInt(256),T=BigInt(113),O=[],y=[],w=[];for(let n=0,t=u,s=1,i=0;n<24;n++){[s,i]=[i,(2*s+3*i)%5],O.push(2*(5*i+s)),y.push((n+1)*(n+2)/2%64);let o=A;for(let r=0;r<7;r++)t=(t<<u^(t>>L)*T)%S,t&H&&(o^=u<<(u<<BigInt(r))-u);w.push(o)}const _=f.split(w,!0),F=_[0],X=_[1],I=(n,t,s)=>s>32?f.rotlBH(n,t,s):f.rotlSH(n,t,s),x=(n,t,s)=>s>32?f.rotlBL(n,t,s):f.rotlSL(n,t,s);function b(n,t=24){const s=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let e=0;e<10;e++)s[e]=n[e]^n[e+10]^n[e+20]^n[e+30]^n[e+40];for(let e=0;e<10;e+=2){const h=(e+8)%10,l=(e+2)%10,p=s[l],a=s[l+1],g=I(p,a,1)^s[h],B=x(p,a,1)^s[h+1];for(let d=0;d<50;d+=10)n[e+d]^=g,n[e+d+1]^=B}let o=n[2],r=n[3];for(let e=0;e<24;e++){const h=y[e],l=I(o,r,h),p=x(o,r,h),a=O[e];o=n[a],r=n[a+1],n[a]=l,n[a+1]=p}for(let e=0;e<50;e+=10){for(let h=0;h<10;h++)s[h]=n[e+h];for(let h=0;h<10;h++)n[e+h]^=~s[(h+2)%10]&s[(h+4)%10]}n[0]^=F[i],n[1]^=X[i]}c.clean(s)}class k extends c.Hash{constructor(t,s,i,o=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=s,this.outputLen=i,this.enableXOF=o,this.rounds=r,c.anumber(i),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=c.u32(this.state)}clone(){return this._cloneInto()}keccak(){c.swap32IfBE(this.state32),b(this.state32,this.rounds),c.swap32IfBE(this.state32),this.posOut=0,this.pos=0}update(t){c.aexists(this),t=c.toBytes(t),c.abytes(t);const{blockLen:s,state:i}=this,o=t.length;for(let r=0;r<o;){const e=Math.min(s-this.pos,o-r);for(let h=0;h<e;h++)i[this.pos++]^=t[r++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:s,pos:i,blockLen:o}=this;t[i]^=s,s&128&&i===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){c.aexists(this,!1),c.abytes(t),this.finish();const s=this.state,{blockLen:i}=this;for(let o=0,r=t.length;o<r;){this.posOut>=i&&this.keccak();const e=Math.min(i-this.posOut,r-o);t.set(s.subarray(this.posOut,this.posOut+e),o),this.posOut+=e,o+=e}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return c.anumber(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(c.aoutput(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,c.clean(this.state)}_cloneInto(t){const{blockLen:s,suffix:i,outputLen:o,rounds:r,enableXOF:e}=this;return t||(t=new k(s,i,o,e,r)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=r,t.suffix=i,t.outputLen=o,t.enableXOF=e,t.destroyed=this.destroyed,t}}const m=(n,t,s)=>c.createHasher(()=>new k(t,n,s)),E=m(1,136,256/8);exports.Keccak=k;exports.keccakP=b;exports.keccak_256=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index161.cjs"),E=require("./index208.cjs"),d=require("./index110.cjs"),q=require("./index242.cjs");function H(i,e={}){const{url:r,headers:a}=R(i);return{async request(p){var g;const{body:n,fetchFn:T=e.fetchFn??fetch,onRequest:c=e.onRequest,onResponse:l=e.onResponse,timeout:f=e.timeout??1e4}=p,w={...e.fetchOptions??{},...p.fetchOptions??{}},{headers:C,method:j,signal:O}=w;try{const t=await E.withTimeout(async({signal:u})=>{const h={...w,body:Array.isArray(n)?d.stringify(n.map(m=>({jsonrpc:"2.0",id:m.id??q.idCache.take(),...m}))):d.stringify({jsonrpc:"2.0",id:n.id??q.idCache.take(),...n}),headers:{...a,"Content-Type":"application/json",...C},method:j||"POST",signal:O||(f>0?u:null)},S=new Request(r,h),y=await(c==null?void 0:c(S,h))??{...h,url:r};return await T(y.url??r,y)},{errorInstance:new o.TimeoutError({body:n,url:r}),timeout:f,signal:!0});l&&await l(t);let s;if((g=t.headers.get("Content-Type"))!=null&&g.startsWith("application/json"))s=await t.json();else{s=await t.text();try{s=JSON.parse(s||"{}")}catch(u){if(t.ok)throw u;s={error:s}}}if(!t.ok)throw new o.HttpRequestError({body:n,details:d.stringify(s.error)||t.statusText,headers:t.headers,status:t.status,url:r});return s}catch(t){throw t instanceof o.HttpRequestError||t instanceof o.TimeoutError?t:new o.HttpRequestError({body:n,cause:t,url:r})}}}}function R(i){try{const e=new URL(i),r=(()=>{if(e.username){const a=`${decodeURIComponent(e.username)}:${decodeURIComponent(e.password)}`;return e.username="",e.password="",{url:e.toString(),headers:{Authorization:`Basic ${btoa(a)}`}}}})();return{url:e.toString(),...r}}catch{return{url:i}}}exports.getHttpRpcClient=H;exports.parseUrl=R;
package/dist/index163.js CHANGED
@@ -1,107 +1,93 @@
1
- import { split as L, rotlSH as T, rotlSL as S, rotlBH as m, rotlBL as F } from "./index233.js";
2
- import { createHasher as X, Hash as E, anumber as d, u32 as U, swap32IfBE as I, aexists as x, toBytes as P, abytes as k, aoutput as M, clean as y } from "./index234.js";
3
- const R = BigInt(0), f = BigInt(1), j = BigInt(2), q = BigInt(7), v = BigInt(256), z = BigInt(113), _ = [], g = [], B = [];
4
- for (let n = 0, t = f, s = 1, i = 0; n < 24; n++) {
5
- [s, i] = [i, (2 * s + 3 * i) % 5], _.push(2 * (5 * i + s)), g.push((n + 1) * (n + 2) / 2 % 64);
6
- let o = R;
7
- for (let r = 0; r < 7; r++)
8
- t = (t << f ^ (t >> q) * z) % v, t & j && (o ^= f << (f << /* @__PURE__ */ BigInt(r)) - f);
9
- B.push(o);
10
- }
11
- const A = L(B, !0), C = A[0], D = A[1], O = (n, t, s) => s > 32 ? m(n, t, s) : T(n, t, s), w = (n, t, s) => s > 32 ? F(n, t, s) : S(n, t, s);
12
- function G(n, t = 24) {
13
- const s = new Uint32Array(10);
14
- for (let i = 24 - t; i < 24; i++) {
15
- for (let e = 0; e < 10; e++)
16
- s[e] = n[e] ^ n[e + 10] ^ n[e + 20] ^ n[e + 30] ^ n[e + 40];
17
- for (let e = 0; e < 10; e += 2) {
18
- const h = (e + 8) % 10, l = (e + 2) % 10, u = s[l], c = s[l + 1], b = O(u, c, 1) ^ s[h], H = w(u, c, 1) ^ s[h + 1];
19
- for (let a = 0; a < 50; a += 10)
20
- n[e + a] ^= b, n[e + a + 1] ^= H;
21
- }
22
- let o = n[2], r = n[3];
23
- for (let e = 0; e < 24; e++) {
24
- const h = g[e], l = O(o, r, h), u = w(o, r, h), c = _[e];
25
- o = n[c], r = n[c + 1], n[c] = l, n[c + 1] = u;
26
- }
27
- for (let e = 0; e < 50; e += 10) {
28
- for (let h = 0; h < 10; h++)
29
- s[h] = n[e + h];
30
- for (let h = 0; h < 10; h++)
31
- n[e + h] ^= ~s[(h + 2) % 10] & s[(h + 4) % 10];
1
+ import { TimeoutError as R, HttpRequestError as h } from "./index161.js";
2
+ import { withTimeout as S } from "./index208.js";
3
+ import { stringify as p } from "./index110.js";
4
+ import { idCache as C } from "./index242.js";
5
+ function E(o, e = {}) {
6
+ const { url: r, headers: a } = U(o);
7
+ return {
8
+ async request(d) {
9
+ var w;
10
+ const { body: s, fetchFn: T = e.fetchFn ?? fetch, onRequest: i = e.onRequest, onResponse: f = e.onResponse, timeout: l = e.timeout ?? 1e4 } = d, m = {
11
+ ...e.fetchOptions ?? {},
12
+ ...d.fetchOptions ?? {}
13
+ }, { headers: j, method: O, signal: k } = m;
14
+ try {
15
+ const t = await S(async ({ signal: c }) => {
16
+ const u = {
17
+ ...m,
18
+ body: Array.isArray(s) ? p(s.map((g) => ({
19
+ jsonrpc: "2.0",
20
+ id: g.id ?? C.take(),
21
+ ...g
22
+ }))) : p({
23
+ jsonrpc: "2.0",
24
+ id: s.id ?? C.take(),
25
+ ...s
26
+ }),
27
+ headers: {
28
+ ...a,
29
+ "Content-Type": "application/json",
30
+ ...j
31
+ },
32
+ method: O || "POST",
33
+ signal: k || (l > 0 ? c : null)
34
+ }, q = new Request(r, u), y = await (i == null ? void 0 : i(q, u)) ?? { ...u, url: r };
35
+ return await T(y.url ?? r, y);
36
+ }, {
37
+ errorInstance: new R({ body: s, url: r }),
38
+ timeout: l,
39
+ signal: !0
40
+ });
41
+ f && await f(t);
42
+ let n;
43
+ if ((w = t.headers.get("Content-Type")) != null && w.startsWith("application/json"))
44
+ n = await t.json();
45
+ else {
46
+ n = await t.text();
47
+ try {
48
+ n = JSON.parse(n || "{}");
49
+ } catch (c) {
50
+ if (t.ok)
51
+ throw c;
52
+ n = { error: n };
53
+ }
54
+ }
55
+ if (!t.ok)
56
+ throw new h({
57
+ body: s,
58
+ details: p(n.error) || t.statusText,
59
+ headers: t.headers,
60
+ status: t.status,
61
+ url: r
62
+ });
63
+ return n;
64
+ } catch (t) {
65
+ throw t instanceof h || t instanceof R ? t : new h({
66
+ body: s,
67
+ cause: t,
68
+ url: r
69
+ });
70
+ }
32
71
  }
33
- n[0] ^= C[i], n[1] ^= D[i];
34
- }
35
- y(s);
72
+ };
36
73
  }
37
- class p extends E {
38
- // NOTE: we accept arguments in bytes instead of bits here.
39
- constructor(t, s, i, o = !1, r = 24) {
40
- if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = t, this.suffix = s, this.outputLen = i, this.enableXOF = o, this.rounds = r, d(i), !(0 < t && t < 200))
41
- throw new Error("only keccak-f1600 function is supported");
42
- this.state = new Uint8Array(200), this.state32 = U(this.state);
43
- }
44
- clone() {
45
- return this._cloneInto();
46
- }
47
- keccak() {
48
- I(this.state32), G(this.state32, this.rounds), I(this.state32), this.posOut = 0, this.pos = 0;
49
- }
50
- update(t) {
51
- x(this), t = P(t), k(t);
52
- const { blockLen: s, state: i } = this, o = t.length;
53
- for (let r = 0; r < o; ) {
54
- const e = Math.min(s - this.pos, o - r);
55
- for (let h = 0; h < e; h++)
56
- i[this.pos++] ^= t[r++];
57
- this.pos === s && this.keccak();
58
- }
59
- return this;
60
- }
61
- finish() {
62
- if (this.finished)
63
- return;
64
- this.finished = !0;
65
- const { state: t, suffix: s, pos: i, blockLen: o } = this;
66
- t[i] ^= s, s & 128 && i === o - 1 && this.keccak(), t[o - 1] ^= 128, this.keccak();
67
- }
68
- writeInto(t) {
69
- x(this, !1), k(t), this.finish();
70
- const s = this.state, { blockLen: i } = this;
71
- for (let o = 0, r = t.length; o < r; ) {
72
- this.posOut >= i && this.keccak();
73
- const e = Math.min(i - this.posOut, r - o);
74
- t.set(s.subarray(this.posOut, this.posOut + e), o), this.posOut += e, o += e;
75
- }
76
- return t;
77
- }
78
- xofInto(t) {
79
- if (!this.enableXOF)
80
- throw new Error("XOF is not possible for this instance");
81
- return this.writeInto(t);
82
- }
83
- xof(t) {
84
- return d(t), this.xofInto(new Uint8Array(t));
85
- }
86
- digestInto(t) {
87
- if (M(t, this), this.finished)
88
- throw new Error("digest() was already called");
89
- return this.writeInto(t), this.destroy(), t;
90
- }
91
- digest() {
92
- return this.digestInto(new Uint8Array(this.outputLen));
93
- }
94
- destroy() {
95
- this.destroyed = !0, y(this.state);
96
- }
97
- _cloneInto(t) {
98
- const { blockLen: s, suffix: i, outputLen: o, rounds: r, enableXOF: e } = this;
99
- return t || (t = new p(s, i, o, e, r)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = r, t.suffix = i, t.outputLen = o, t.enableXOF = e, t.destroyed = this.destroyed, t;
74
+ function U(o) {
75
+ try {
76
+ const e = new URL(o), r = (() => {
77
+ if (e.username) {
78
+ const a = `${decodeURIComponent(e.username)}:${decodeURIComponent(e.password)}`;
79
+ return e.username = "", e.password = "", {
80
+ url: e.toString(),
81
+ headers: { Authorization: `Basic ${btoa(a)}` }
82
+ };
83
+ }
84
+ })();
85
+ return { url: e.toString(), ...r };
86
+ } catch {
87
+ return { url: o };
100
88
  }
101
89
  }
102
- const J = (n, t, s) => X(() => new p(t, n, s)), Q = J(1, 136, 256 / 8);
103
90
  export {
104
- p as Keccak,
105
- G as keccakP,
106
- Q as keccak_256
91
+ E as getHttpRpcClient,
92
+ U as parseUrl
107
93
  };
package/dist/index164.cjs CHANGED
@@ -1 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index238.cjs"),s=e.sha256;exports.sha256=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=`Ethereum Signed Message:
2
+ `;exports.presignMessagePrefix=e;
package/dist/index164.js CHANGED
@@ -1,5 +1,5 @@
1
- import { sha256 as s } from "./index238.js";
2
- const o = s;
1
+ const e = `Ethereum Signed Message:
2
+ `;
3
3
  export {
4
- o as sha256
4
+ e as presignMessagePrefix
5
5
  };
package/dist/index165.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index235.cjs"),r=require("./index236.cjs");function n(t){return e.hashSignature(r.toSignature(t))}exports.toSignatureHash=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={gwei:9,wei:18},t={ether:-9,wei:9};exports.etherUnits=e;exports.gweiUnits=t;
package/dist/index165.js CHANGED
@@ -1,8 +1,11 @@
1
- import { hashSignature as t } from "./index235.js";
2
- import { toSignature as o } from "./index236.js";
3
- function a(r) {
4
- return t(o(r));
5
- }
1
+ const e = {
2
+ gwei: 9,
3
+ wei: 18
4
+ }, t = {
5
+ ether: -9,
6
+ wei: 9
7
+ };
6
8
  export {
7
- a as toSignatureHash
9
+ e as etherUnits,
10
+ t as gweiUnits
8
11
  };
package/dist/index166.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=new Map,i=new Map;function p(o){const a=(s,t)=>({clear:()=>t.delete(s),get:()=>t.get(s),set:n=>t.set(s,n)}),r=a(o,c),e=a(o,i);return{clear:()=>{r.clear(),e.clear()},promise:r,response:e}}async function l(o,{cacheKey:a,cacheTime:r=Number.POSITIVE_INFINITY}){const e=p(a),s=e.response.get();if(s&&r>0&&Date.now()-s.created.getTime()<r)return s.data;let t=e.promise.get();t||(t=o(),e.promise.set(t));try{const n=await t;return e.response.set({created:new Date,data:n}),n}finally{e.promise.clear()}}exports.getCache=p;exports.promiseCache=c;exports.responseCache=i;exports.withCache=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index114.cjs");function i(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new o.InvalidDefinitionTypeError(t.type);return`${t.name}(${n(t.inputs,{includeName:e})})`}function n(t,{includeName:e=!1}={}){return t?t.map(r=>f(r,{includeName:e})).join(e?", ":","):""}function f(t,{includeName:e}){return t.type.startsWith("tuple")?`(${n(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}exports.formatAbiItem=i;exports.formatAbiParams=n;
package/dist/index166.js CHANGED
@@ -1,34 +1,16 @@
1
- const i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
2
- function p(o) {
3
- const a = (s, t) => ({
4
- clear: () => t.delete(s),
5
- get: () => t.get(s),
6
- set: (r) => t.set(s, r)
7
- }), n = a(o, i), e = a(o, c);
8
- return {
9
- clear: () => {
10
- n.clear(), e.clear();
11
- },
12
- promise: n,
13
- response: e
14
- };
1
+ import { InvalidDefinitionTypeError as o } from "./index114.js";
2
+ function u(t, { includeName: n = !1 } = {}) {
3
+ if (t.type !== "function" && t.type !== "event" && t.type !== "error")
4
+ throw new o(t.type);
5
+ return `${t.name}(${e(t.inputs, { includeName: n })})`;
15
6
  }
16
- async function l(o, { cacheKey: a, cacheTime: n = Number.POSITIVE_INFINITY }) {
17
- const e = p(a), s = e.response.get();
18
- if (s && n > 0 && Date.now() - s.created.getTime() < n)
19
- return s.data;
20
- let t = e.promise.get();
21
- t || (t = o(), e.promise.set(t));
22
- try {
23
- const r = await t;
24
- return e.response.set({ created: /* @__PURE__ */ new Date(), data: r }), r;
25
- } finally {
26
- e.promise.clear();
27
- }
7
+ function e(t, { includeName: n = !1 } = {}) {
8
+ return t ? t.map((r) => f(r, { includeName: n })).join(n ? ", " : ",") : "";
9
+ }
10
+ function f(t, { includeName: n }) {
11
+ return t.type.startsWith("tuple") ? `(${e(t.components, { includeName: n })})${t.type.slice(5)}` : t.type + (n && t.name ? ` ${t.name}` : "");
28
12
  }
29
13
  export {
30
- p as getCache,
31
- i as promiseCache,
32
- c as responseCache,
33
- l as withCache
14
+ u as formatAbiItem,
15
+ e as formatAbiParams
34
16
  };
package/dist/index167.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function i(e){return new Promise(t=>setTimeout(t,e))}exports.wait=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index46.cjs");function i(e){return t.isHex(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}exports.size=i;
package/dist/index167.js CHANGED
@@ -1,6 +1,7 @@
1
- async function n(e) {
2
- return new Promise((t) => setTimeout(t, e));
1
+ import { isHex as r } from "./index46.js";
2
+ function i(t) {
3
+ return r(t, { strict: !1 }) ? Math.ceil((t.length - 2) / 2) : t.length;
3
4
  }
4
5
  export {
5
- n as wait
6
+ i as size
6
7
  };
package/dist/index168.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function u(n,{errorInstance:r=new Error("timed out"),timeout:i,signal:a}){return new Promise((l,e)=>{(async()=>{let o;try{const t=new AbortController;i>0&&(o=setTimeout(()=>{a&&t.abort()},i)),l(await n({signal:(t==null?void 0:t.signal)||null}))}catch(t){(t==null?void 0:t.name)==="AbortError"&&e(r),e(t)}finally{clearTimeout(o)}})()})}exports.withTimeout=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="2.44.4";exports.version=e;