@gardenfi/utils 3.0.0-beta.7 → 3.0.0-beta.8

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 (469) hide show
  1. package/dist/index100.cjs +1 -2
  2. package/dist/index100.js +3 -121
  3. package/dist/index101.cjs +1 -1
  4. package/dist/index101.js +18 -14
  5. package/dist/index102.cjs +1 -1
  6. package/dist/index102.js +20 -24
  7. package/dist/index103.cjs +1 -1
  8. package/dist/index103.js +33 -31
  9. package/dist/index104.cjs +1 -1
  10. package/dist/index104.js +21 -42
  11. package/dist/index105.cjs +1 -1
  12. package/dist/index105.js +8 -6
  13. package/dist/index106.cjs +4 -1
  14. package/dist/index106.js +193 -102
  15. package/dist/index107.cjs +3 -1
  16. package/dist/index107.js +451 -37
  17. package/dist/index108.cjs +1 -1
  18. package/dist/index108.js +27 -8
  19. package/dist/index109.cjs +1 -1
  20. package/dist/index109.js +160 -19
  21. package/dist/index110.cjs +1 -1
  22. package/dist/index110.js +22 -2
  23. package/dist/index111.cjs +1 -1
  24. package/dist/index111.js +127 -75
  25. package/dist/index112.cjs +1 -1
  26. package/dist/index112.js +38 -15
  27. package/dist/index113.cjs +1 -1
  28. package/dist/index113.js +6 -151
  29. package/dist/index114.cjs +1 -20
  30. package/dist/index114.js +27 -326
  31. package/dist/index115.cjs +1 -3
  32. package/dist/index115.js +55 -451
  33. package/dist/index116.cjs +1 -1
  34. package/dist/index116.js +42 -70
  35. package/dist/index117.cjs +1 -1
  36. package/dist/index117.js +191 -16
  37. package/dist/index118.cjs +1 -1
  38. package/dist/index118.js +4 -11
  39. package/dist/index119.cjs +1 -1
  40. package/dist/index119.js +68 -120
  41. package/dist/index120.cjs +1 -1
  42. package/dist/index120.js +20 -5
  43. package/dist/index121.cjs +1 -1
  44. package/dist/index121.js +3 -46
  45. package/dist/index122.cjs +1 -1
  46. package/dist/index122.js +15 -37
  47. package/dist/index123.cjs +1 -1
  48. package/dist/index123.js +23 -6
  49. package/dist/index124.cjs +1 -1
  50. package/dist/index124.js +11 -90
  51. package/dist/index125.cjs +1 -1
  52. package/dist/index125.js +18 -14
  53. package/dist/index126.cjs +1 -1
  54. package/dist/index126.js +34 -3
  55. package/dist/index127.cjs +1 -1
  56. package/dist/index127.js +3 -27
  57. package/dist/index128.cjs +1 -2
  58. package/dist/index128.js +18 -24
  59. package/dist/index129.cjs +1 -1
  60. package/dist/index129.js +27 -9
  61. package/dist/index130.cjs +1 -1
  62. package/dist/index130.js +36 -8
  63. package/dist/index131.cjs +1 -1
  64. package/dist/index131.js +8 -10
  65. package/dist/index132.cjs +1 -1
  66. package/dist/index132.js +10 -11
  67. package/dist/index133.cjs +1 -1
  68. package/dist/index133.js +24 -12
  69. package/dist/index134.cjs +1 -1
  70. package/dist/index134.js +27 -20
  71. package/dist/index135.cjs +1 -1
  72. package/dist/index135.js +3 -14
  73. package/dist/index136.cjs +1 -1
  74. package/dist/index136.js +75 -4
  75. package/dist/index137.cjs +1 -1
  76. package/dist/index137.js +9 -6
  77. package/dist/index138.cjs +1 -1
  78. package/dist/index138.js +21 -18
  79. package/dist/index139.cjs +1 -1
  80. package/dist/index139.js +8 -10
  81. package/dist/index140.cjs +1 -1
  82. package/dist/index140.js +9 -57
  83. package/dist/index141.cjs +1 -1
  84. package/dist/index141.js +11 -6
  85. package/dist/index142.cjs +1 -1
  86. package/dist/index142.js +6 -13
  87. package/dist/index143.cjs +1 -1
  88. package/dist/index143.js +6 -7
  89. package/dist/index144.cjs +1 -1
  90. package/dist/index144.js +12 -137
  91. package/dist/index145.cjs +1 -1
  92. package/dist/index145.js +32 -7
  93. package/dist/index146.cjs +1 -1
  94. package/dist/index146.js +5 -22
  95. package/dist/index147.cjs +1 -1
  96. package/dist/index147.js +36 -16
  97. package/dist/index148.cjs +1 -1
  98. package/dist/index148.js +109 -41
  99. package/dist/index149.cjs +1 -1
  100. package/dist/index149.js +170 -20
  101. package/dist/index150.cjs +1 -1
  102. package/dist/index150.js +46 -77
  103. package/dist/index151.cjs +1 -1
  104. package/dist/index151.js +32 -11
  105. package/dist/index152.cjs +1 -1
  106. package/dist/index152.js +7 -13
  107. package/dist/index153.cjs +1 -1
  108. package/dist/index153.js +17 -6
  109. package/dist/index154.cjs +1 -1
  110. package/dist/index154.js +20 -41
  111. package/dist/index155.cjs +1 -1
  112. package/dist/index155.js +32 -5
  113. package/dist/index156.cjs +1 -1
  114. package/dist/index156.js +41 -32
  115. package/dist/index157.cjs +1 -1
  116. package/dist/index157.js +22 -9
  117. package/dist/index158.cjs +1 -1
  118. package/dist/index158.js +19 -58
  119. package/dist/index159.cjs +1 -1
  120. package/dist/index159.js +50 -18
  121. package/dist/index160.cjs +1 -1
  122. package/dist/index160.js +11 -105
  123. package/dist/index161.cjs +1 -1
  124. package/dist/index161.js +24 -78
  125. package/dist/index162.cjs +1 -1
  126. package/dist/index162.js +24 -9
  127. package/dist/index163.cjs +1 -1
  128. package/dist/index163.js +101 -87
  129. package/dist/index164.cjs +1 -2
  130. package/dist/index164.js +3 -3
  131. package/dist/index165.cjs +1 -1
  132. package/dist/index165.js +6 -9
  133. package/dist/index166.cjs +1 -1
  134. package/dist/index166.js +30 -12
  135. package/dist/index167.cjs +1 -1
  136. package/dist/index167.js +3 -4
  137. package/dist/index168.cjs +1 -1
  138. package/dist/index168.js +18 -2
  139. package/dist/index169.cjs +1 -1
  140. package/dist/index169.js +6 -32
  141. package/dist/index170.cjs +1 -1
  142. package/dist/index170.js +8 -21
  143. package/dist/index171.cjs +1 -1
  144. package/dist/index171.js +103 -5
  145. package/dist/index172.cjs +1 -1
  146. package/dist/index172.js +80 -5
  147. package/dist/index173.cjs +1 -1
  148. package/dist/index173.js +5 -5
  149. package/dist/index174.cjs +1 -9
  150. package/dist/index174.js +6 -35
  151. package/dist/index175.cjs +1 -1
  152. package/dist/index175.js +28 -3
  153. package/dist/index176.cjs +1 -1
  154. package/dist/index176.js +33 -17
  155. package/dist/index177.cjs +1 -1
  156. package/dist/index177.js +13 -20
  157. package/dist/index178.cjs +1 -1
  158. package/dist/index178.js +16 -35
  159. package/dist/index179.cjs +1 -1
  160. package/dist/index179.js +77 -7
  161. package/dist/index18.cjs +1 -1
  162. package/dist/index18.js +8 -8
  163. package/dist/index180.cjs +1 -4
  164. package/dist/index180.js +2 -195
  165. package/dist/index181.cjs +1 -1
  166. package/dist/index181.js +14 -27
  167. package/dist/index182.cjs +1 -1
  168. package/dist/index182.js +18 -161
  169. package/dist/index183.cjs +1 -1
  170. package/dist/index183.js +170 -126
  171. package/dist/index184.cjs +1 -1
  172. package/dist/index184.js +17 -27
  173. package/dist/index185.cjs +1 -1
  174. package/dist/index185.js +10 -191
  175. package/dist/index186.cjs +1 -1
  176. package/dist/index186.js +31 -4
  177. package/dist/index187.cjs +1 -1
  178. package/dist/index187.js +2 -21
  179. package/dist/index188.cjs +1 -1
  180. package/dist/index188.js +14 -3
  181. package/dist/index189.cjs +1 -1
  182. package/dist/index189.js +12 -16
  183. package/dist/index190.cjs +1 -1
  184. package/dist/index190.js +44 -31
  185. package/dist/index191.cjs +1 -1
  186. package/dist/index191.js +12 -3
  187. package/dist/index192.cjs +1 -1
  188. package/dist/index192.js +7 -27
  189. package/dist/index193.cjs +1 -1
  190. package/dist/index193.js +68 -23
  191. package/dist/index194.cjs +1 -1
  192. package/dist/index194.js +45 -27
  193. package/dist/index195.cjs +1 -1
  194. package/dist/index195.js +37 -6
  195. package/dist/index196.cjs +1 -1
  196. package/dist/index196.js +17 -6
  197. package/dist/index197.cjs +1 -1
  198. package/dist/index197.js +6 -32
  199. package/dist/index198.cjs +1 -1
  200. package/dist/index198.js +10 -5
  201. package/dist/index199.cjs +1 -1
  202. package/dist/index199.js +13 -37
  203. package/dist/index20.cjs +1 -1
  204. package/dist/index20.js +2 -2
  205. package/dist/index200.cjs +1 -1
  206. package/dist/index200.js +13 -49
  207. package/dist/index201.cjs +1 -1
  208. package/dist/index201.js +8 -32
  209. package/dist/index202.cjs +1 -1
  210. package/dist/index202.js +34 -16
  211. package/dist/index203.cjs +1 -1
  212. package/dist/index203.js +16 -42
  213. package/dist/index204.cjs +1 -1
  214. package/dist/index204.js +29 -104
  215. package/dist/index205.cjs +1 -1
  216. package/dist/index205.js +15 -3
  217. package/dist/index206.cjs +1 -1
  218. package/dist/index206.js +6 -5
  219. package/dist/index207.cjs +1 -1
  220. package/dist/index207.js +103 -3
  221. package/dist/index208.cjs +1 -1
  222. package/dist/index208.js +73 -15
  223. package/dist/index209.cjs +2 -1
  224. package/dist/index209.js +24 -8
  225. package/dist/index210.cjs +1 -1
  226. package/dist/index210.js +25 -5
  227. package/dist/index211.cjs +1 -1
  228. package/dist/index211.js +18 -27
  229. package/dist/index212.cjs +1 -1
  230. package/dist/index212.js +15 -78
  231. package/dist/index213.cjs +1 -1
  232. package/dist/index213.js +6 -2
  233. package/dist/index214.cjs +1 -1
  234. package/dist/index214.js +13 -18
  235. package/dist/index215.cjs +1 -1
  236. package/dist/index215.js +10 -17
  237. package/dist/index216.cjs +1 -1
  238. package/dist/index216.js +16 -10
  239. package/dist/index217.cjs +2 -1
  240. package/dist/index217.js +40 -102
  241. package/dist/index218.cjs +1 -1
  242. package/dist/index218.js +2 -17
  243. package/dist/index219.cjs +1 -1
  244. package/dist/index219.js +5 -214
  245. package/dist/index22.cjs +1 -1
  246. package/dist/index22.js +9 -9
  247. package/dist/index220.cjs +1 -1
  248. package/dist/index220.js +10 -42
  249. package/dist/index221.cjs +1 -1
  250. package/dist/index221.js +18 -107
  251. package/dist/index222.cjs +1 -1
  252. package/dist/index222.js +8 -78
  253. package/dist/index223.cjs +1 -1
  254. package/dist/index223.js +67 -2
  255. package/dist/index224.cjs +1 -1
  256. package/dist/index224.js +65 -24
  257. package/dist/index225.cjs +1 -1
  258. package/dist/index225.js +184 -42
  259. package/dist/index226.cjs +1 -1
  260. package/dist/index226.js +28 -9
  261. package/dist/index227.cjs +1 -2
  262. package/dist/index227.js +59 -24
  263. package/dist/index228.cjs +1 -1
  264. package/dist/index228.js +41 -2
  265. package/dist/index229.cjs +1 -1
  266. package/dist/index229.js +16 -5
  267. package/dist/index230.cjs +1 -1
  268. package/dist/index230.js +12 -9
  269. package/dist/index231.cjs +1 -1
  270. package/dist/index231.js +11 -19
  271. package/dist/index232.cjs +1 -1
  272. package/dist/index232.js +12 -8
  273. package/dist/index233.cjs +1 -1
  274. package/dist/index233.js +20 -67
  275. package/dist/index234.cjs +1 -1
  276. package/dist/index234.js +106 -63
  277. package/dist/index235.cjs +1 -1
  278. package/dist/index235.js +99 -184
  279. package/dist/index236.cjs +1 -1
  280. package/dist/index236.js +6 -28
  281. package/dist/index237.cjs +1 -1
  282. package/dist/index237.js +7 -77
  283. package/dist/index238.cjs +1 -1
  284. package/dist/index238.js +25 -39
  285. package/dist/index239.cjs +1 -1
  286. package/dist/index239.js +16 -16
  287. package/dist/index240.cjs +1 -1
  288. package/dist/index240.js +213 -12
  289. package/dist/index241.cjs +1 -1
  290. package/dist/index241.js +24 -11
  291. package/dist/index242.cjs +1 -1
  292. package/dist/index242.js +47 -13
  293. package/dist/index243.cjs +1 -1
  294. package/dist/index243.js +9 -19
  295. package/dist/index244.cjs +1 -1
  296. package/dist/index244.js +206 -6
  297. package/dist/index245.cjs +1 -1
  298. package/dist/index245.js +43 -7
  299. package/dist/index246.cjs +1 -1
  300. package/dist/index246.js +74 -22
  301. package/dist/index247.cjs +1 -1
  302. package/dist/index247.js +2 -12
  303. package/dist/index248.cjs +1 -1
  304. package/dist/index248.js +11 -19
  305. package/dist/index249.cjs +1 -1
  306. package/dist/index249.js +18 -656
  307. package/dist/index25.cjs +1 -1
  308. package/dist/index25.js +2 -2
  309. package/dist/index250.cjs +1 -1
  310. package/dist/index250.js +68 -206
  311. package/dist/index251.cjs +2 -1
  312. package/dist/index251.js +88 -174
  313. package/dist/index252.cjs +1 -2
  314. package/dist/index252.js +14 -91
  315. package/dist/index253.cjs +1 -1
  316. package/dist/index253.js +657 -14
  317. package/dist/index254.cjs +1 -1
  318. package/dist/index254.js +176 -67
  319. package/dist/index26.cjs +1 -1
  320. package/dist/index26.js +5 -5
  321. package/dist/index27.cjs +1 -1
  322. package/dist/index27.js +3 -3
  323. package/dist/index28.cjs +1 -1
  324. package/dist/index28.js +1 -1
  325. package/dist/index29.cjs +1 -1
  326. package/dist/index29.js +7 -13
  327. package/dist/index30.cjs +1 -1
  328. package/dist/index30.js +31 -34
  329. package/dist/index31.cjs +1 -1
  330. package/dist/index31.js +27 -30
  331. package/dist/index32.cjs +1 -1
  332. package/dist/index32.js +16 -55
  333. package/dist/index33.cjs +1 -1
  334. package/dist/index33.js +31 -43
  335. package/dist/index34.cjs +1 -1
  336. package/dist/index34.js +41 -22
  337. package/dist/index35.cjs +1 -1
  338. package/dist/index35.js +151 -6
  339. package/dist/index36.cjs +1 -1
  340. package/dist/index36.js +41 -18
  341. package/dist/index37.cjs +1 -1
  342. package/dist/index37.js +57 -14
  343. package/dist/index38.cjs +2 -1
  344. package/dist/index38.js +59 -5
  345. package/dist/index39.cjs +1 -1
  346. package/dist/index39.js +13 -13
  347. package/dist/index40.cjs +1 -1
  348. package/dist/index40.js +37 -10
  349. package/dist/index41.cjs +1 -1
  350. package/dist/index41.js +15 -12
  351. package/dist/index42.cjs +1 -1
  352. package/dist/index42.js +8 -11
  353. package/dist/index43.cjs +1 -1
  354. package/dist/index43.js +20 -3
  355. package/dist/index44.cjs +1 -1
  356. package/dist/index44.js +2 -22
  357. package/dist/index45.cjs +1 -1
  358. package/dist/index45.js +45 -8
  359. package/dist/index46.cjs +1 -1
  360. package/dist/index46.js +33 -3
  361. package/dist/index47.cjs +1 -1
  362. package/dist/index47.js +3 -16
  363. package/dist/index48.cjs +1 -1
  364. package/dist/index48.js +9 -5
  365. package/dist/index49.cjs +1 -1
  366. package/dist/index49.js +60 -171
  367. package/dist/index50.cjs +1 -1
  368. package/dist/index50.js +75 -101
  369. package/dist/index51.cjs +1 -1
  370. package/dist/index51.js +7 -171
  371. package/dist/index52.cjs +1 -1
  372. package/dist/index52.js +15 -110
  373. package/dist/index53.cjs +1 -1
  374. package/dist/index53.js +10 -30
  375. package/dist/index54.cjs +1 -1
  376. package/dist/index54.js +6 -2
  377. package/dist/index55.cjs +1 -1
  378. package/dist/index55.js +15 -4
  379. package/dist/index56.cjs +1 -2
  380. package/dist/index56.js +3 -59
  381. package/dist/index57.cjs +1 -2
  382. package/dist/index57.js +25 -53
  383. package/dist/index58.cjs +1 -3
  384. package/dist/index58.js +159 -210
  385. package/dist/index59.cjs +1 -1
  386. package/dist/index59.js +4 -23
  387. package/dist/index60.cjs +1 -1
  388. package/dist/index60.js +6 -18
  389. package/dist/index61.cjs +1 -1
  390. package/dist/index61.js +90 -10
  391. package/dist/index62.cjs +1 -1
  392. package/dist/index62.js +10 -20
  393. package/dist/index63.cjs +1 -1
  394. package/dist/index63.js +6 -13
  395. package/dist/index64.cjs +1 -1
  396. package/dist/index64.js +13 -12
  397. package/dist/index65.cjs +1 -1
  398. package/dist/index65.js +125 -24
  399. package/dist/index66.cjs +1 -1
  400. package/dist/index66.js +136 -26
  401. package/dist/index67.cjs +1 -1
  402. package/dist/index67.js +7 -47
  403. package/dist/index68.cjs +1 -1
  404. package/dist/index68.js +21 -16
  405. package/dist/index69.cjs +1 -1
  406. package/dist/index69.js +17 -11
  407. package/dist/index70.cjs +1 -1
  408. package/dist/index70.js +39 -27
  409. package/dist/index71.cjs +1 -1
  410. package/dist/index71.js +21 -36
  411. package/dist/index72.cjs +1 -1
  412. package/dist/index72.js +11 -7
  413. package/dist/index73.cjs +1 -1
  414. package/dist/index73.js +6 -29
  415. package/dist/index74.cjs +1 -1
  416. package/dist/index74.js +5 -22
  417. package/dist/index75.cjs +1 -1
  418. package/dist/index75.js +19 -7
  419. package/dist/index76.cjs +1 -1
  420. package/dist/index76.js +106 -70
  421. package/dist/index77.cjs +1 -1
  422. package/dist/index77.js +76 -44
  423. package/dist/index78.cjs +1 -1
  424. package/dist/index78.js +6 -20
  425. package/dist/index79.cjs +1 -1
  426. package/dist/index79.js +27 -36
  427. package/dist/index8.cjs +1 -1
  428. package/dist/index8.js +13 -9
  429. package/dist/index80.cjs +1 -1
  430. package/dist/index80.js +90 -17
  431. package/dist/index81.cjs +1 -1
  432. package/dist/index81.js +4 -7
  433. package/dist/index82.cjs +2 -1
  434. package/dist/index82.js +3 -10
  435. package/dist/index83.cjs +1 -1
  436. package/dist/index83.js +9 -14
  437. package/dist/index84.cjs +20 -1
  438. package/dist/index84.js +324 -162
  439. package/dist/index85.cjs +1 -1
  440. package/dist/index85.js +13 -77
  441. package/dist/index86.cjs +1 -1
  442. package/dist/index86.js +4 -13
  443. package/dist/index87.cjs +1 -1
  444. package/dist/index87.js +12 -51
  445. package/dist/index88.cjs +1 -1
  446. package/dist/index88.js +2 -8
  447. package/dist/index89.cjs +1 -1
  448. package/dist/index89.js +1 -1
  449. package/dist/index90.cjs +2 -1
  450. package/dist/index90.js +54 -21
  451. package/dist/index91.cjs +3 -1
  452. package/dist/index91.js +215 -8
  453. package/dist/index92.cjs +1 -1
  454. package/dist/index92.js +32 -32
  455. package/dist/index93.cjs +1 -1
  456. package/dist/index93.js +21 -16
  457. package/dist/index94.cjs +1 -1
  458. package/dist/index94.js +5 -73
  459. package/dist/index95.cjs +1 -1
  460. package/dist/index95.js +72 -34
  461. package/dist/index96.cjs +1 -1
  462. package/dist/index96.js +5 -16
  463. package/dist/index97.cjs +1 -1
  464. package/dist/index97.js +5 -75
  465. package/dist/index98.cjs +9 -1
  466. package/dist/index98.js +35 -12
  467. package/dist/index99.cjs +2 -1
  468. package/dist/index99.js +119 -28
  469. package/package.json +1 -1
package/dist/index160.js CHANGED
@@ -1,109 +1,15 @@
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 });
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 } : {}
101
11
  };
102
12
  }
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
- }
106
13
  export {
107
- te as buildRequest,
108
- G as shouldRetry
14
+ c as formatLog
109
15
  };
package/dist/index161.cjs CHANGED
@@ -1 +1 @@
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;
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;
package/dist/index161.js CHANGED
@@ -1,81 +1,27 @@
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
- }
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;
76
23
  }
77
24
  export {
78
- m as HttpRequestError,
79
- f as RpcRequestError,
80
- h as TimeoutError
25
+ I as formatTransactionReceipt,
26
+ f as receiptStatuses
81
27
  };
package/dist/index162.cjs CHANGED
@@ -1 +1 @@
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;
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;
package/dist/index162.js CHANGED
@@ -1,12 +1,27 @@
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
- }
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
+ }));
9
23
  }
10
24
  export {
11
- t as UrlRequiredError
25
+ c as formatTransactionRequest,
26
+ a as rpcTransactionType
12
27
  };
package/dist/index163.cjs CHANGED
@@ -1 +1 @@
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;
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;
package/dist/index163.js CHANGED
@@ -1,93 +1,107 @@
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
- }
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];
71
32
  }
72
- };
33
+ n[0] ^= C[i], n[1] ^= D[i];
34
+ }
35
+ y(s);
73
36
  }
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 };
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;
88
100
  }
89
101
  }
102
+ const J = (n, t, s) => X(() => new p(t, n, s)), Q = J(1, 136, 256 / 8);
90
103
  export {
91
- E as getHttpRpcClient,
92
- U as parseUrl
104
+ p as Keccak,
105
+ G as keccakP,
106
+ Q as keccak_256
93
107
  };
package/dist/index164.cjs CHANGED
@@ -1,2 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=`Ethereum Signed Message:
2
- `;exports.presignMessagePrefix=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index235.cjs"),s=e.sha256;exports.sha256=s;
package/dist/index164.js CHANGED
@@ -1,5 +1,5 @@
1
- const e = `Ethereum Signed Message:
2
- `;
1
+ import { sha256 as s } from "./index235.js";
2
+ const o = s;
3
3
  export {
4
- e as presignMessagePrefix
4
+ o as sha256
5
5
  };
package/dist/index165.cjs CHANGED
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index236.cjs"),r=require("./index237.cjs");function n(t){return e.hashSignature(r.toSignature(t))}exports.toSignatureHash=n;
package/dist/index165.js CHANGED
@@ -1,11 +1,8 @@
1
- const e = {
2
- gwei: 9,
3
- wei: 18
4
- }, t = {
5
- ether: -9,
6
- wei: 9
7
- };
1
+ import { hashSignature as t } from "./index236.js";
2
+ import { toSignature as o } from "./index237.js";
3
+ function a(r) {
4
+ return t(o(r));
5
+ }
8
6
  export {
9
- e as etherUnits,
10
- t as gweiUnits
7
+ a as toSignatureHash
11
8
  };
package/dist/index166.cjs CHANGED
@@ -1 +1 @@
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;
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;
package/dist/index166.js CHANGED
@@ -1,16 +1,34 @@
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 })})`;
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
+ };
6
15
  }
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}` : "");
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
+ }
12
28
  }
13
29
  export {
14
- u as formatAbiItem,
15
- e as formatAbiParams
30
+ p as getCache,
31
+ i as promiseCache,
32
+ c as responseCache,
33
+ l as withCache
16
34
  };
package/dist/index167.cjs CHANGED
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function i(e){return new Promise(t=>setTimeout(t,e))}exports.wait=i;
package/dist/index167.js CHANGED
@@ -1,7 +1,6 @@
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;
1
+ async function n(e) {
2
+ return new Promise((t) => setTimeout(t, e));
4
3
  }
5
4
  export {
6
- i as size
5
+ n as wait
7
6
  };
package/dist/index168.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="2.44.4";exports.version=e;
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;