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

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