@gardenfi/utils 3.0.0 → 3.1.0

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 (481) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +36 -35
  3. package/dist/index100.cjs +2 -1
  4. package/dist/index100.js +118 -6
  5. package/dist/index101.cjs +1 -4
  6. package/dist/index101.js +14 -194
  7. package/dist/index102.cjs +1 -3
  8. package/dist/index102.js +24 -451
  9. package/dist/index103.cjs +1 -1
  10. package/dist/index103.js +29 -23
  11. package/dist/index104.cjs +1 -1
  12. package/dist/index104.js +42 -159
  13. package/dist/index105.cjs +1 -1
  14. package/dist/index105.js +6 -21
  15. package/dist/index106.cjs +1 -1
  16. package/dist/index106.js +102 -126
  17. package/dist/index107.cjs +1 -1
  18. package/dist/index107.js +37 -38
  19. package/dist/index108.cjs +1 -1
  20. package/dist/index108.js +8 -6
  21. package/dist/index109.cjs +1 -1
  22. package/dist/index109.js +20 -27
  23. package/dist/index110.cjs +1 -1
  24. package/dist/index110.js +2 -56
  25. package/dist/index111.cjs +1 -1
  26. package/dist/index111.js +74 -44
  27. package/dist/index112.cjs +1 -1
  28. package/dist/index112.js +14 -190
  29. package/dist/index113.cjs +1 -1
  30. package/dist/index113.js +152 -4
  31. package/dist/index114.cjs +20 -1
  32. package/dist/index114.js +324 -62
  33. package/dist/index115.cjs +3 -1
  34. package/dist/index115.js +445 -14
  35. package/dist/index116.cjs +1 -1
  36. package/dist/index116.js +74 -3
  37. package/dist/index117.cjs +1 -1
  38. package/dist/index117.js +16 -16
  39. package/dist/index118.cjs +1 -1
  40. package/dist/index118.js +10 -23
  41. package/dist/index119.cjs +1 -1
  42. package/dist/index119.js +125 -11
  43. package/dist/index120.cjs +1 -1
  44. package/dist/index120.js +5 -18
  45. package/dist/index121.cjs +1 -1
  46. package/dist/index121.js +43 -32
  47. package/dist/index122.cjs +1 -1
  48. package/dist/index122.js +39 -3
  49. package/dist/index123.cjs +1 -1
  50. package/dist/index123.js +6 -18
  51. package/dist/index124.cjs +1 -1
  52. package/dist/index124.js +89 -26
  53. package/dist/index125.cjs +1 -1
  54. package/dist/index125.js +13 -35
  55. package/dist/index126.cjs +1 -1
  56. package/dist/index126.js +3 -8
  57. package/dist/index127.cjs +1 -1
  58. package/dist/index127.js +26 -10
  59. package/dist/index128.cjs +2 -1
  60. package/dist/index128.js +22 -23
  61. package/dist/index129.cjs +1 -1
  62. package/dist/index129.js +9 -28
  63. package/dist/index130.cjs +1 -1
  64. package/dist/index130.js +8 -3
  65. package/dist/index131.cjs +1 -1
  66. package/dist/index131.js +9 -64
  67. package/dist/index132.cjs +1 -1
  68. package/dist/index132.js +11 -9
  69. package/dist/index133.cjs +1 -1
  70. package/dist/index133.js +13 -21
  71. package/dist/index134.cjs +1 -1
  72. package/dist/index134.js +21 -8
  73. package/dist/index135.cjs +1 -1
  74. package/dist/index135.js +14 -10
  75. package/dist/index136.cjs +1 -1
  76. package/dist/index136.js +4 -11
  77. package/dist/index137.cjs +1 -1
  78. package/dist/index137.js +6 -6
  79. package/dist/index138.cjs +1 -1
  80. package/dist/index138.js +18 -6
  81. package/dist/index139.cjs +1 -1
  82. package/dist/index139.js +10 -13
  83. package/dist/index140.cjs +1 -1
  84. package/dist/index140.js +56 -30
  85. package/dist/index141.cjs +1 -1
  86. package/dist/index141.js +7 -5
  87. package/dist/index142.cjs +1 -1
  88. package/dist/index142.js +13 -37
  89. package/dist/index143.cjs +1 -1
  90. package/dist/index143.js +7 -111
  91. package/dist/index144.cjs +1 -1
  92. package/dist/index144.js +131 -164
  93. package/dist/index145.cjs +1 -1
  94. package/dist/index145.js +7 -49
  95. package/dist/index146.cjs +1 -1
  96. package/dist/index146.js +21 -32
  97. package/dist/index147.cjs +1 -1
  98. package/dist/index147.js +17 -7
  99. package/dist/index148.cjs +1 -1
  100. package/dist/index148.js +43 -8
  101. package/dist/index149.cjs +1 -1
  102. package/dist/index149.js +19 -18
  103. package/dist/index15.cjs +1 -1
  104. package/dist/index15.js +2 -2
  105. package/dist/index150.cjs +1 -1
  106. package/dist/index150.js +78 -21
  107. package/dist/index151.cjs +1 -1
  108. package/dist/index151.js +11 -42
  109. package/dist/index152.cjs +1 -1
  110. package/dist/index152.js +13 -22
  111. package/dist/index153.cjs +1 -1
  112. package/dist/index153.js +6 -21
  113. package/dist/index154.cjs +1 -1
  114. package/dist/index154.js +41 -51
  115. package/dist/index155.cjs +1 -1
  116. package/dist/index155.js +5 -11
  117. package/dist/index156.cjs +1 -1
  118. package/dist/index156.js +32 -23
  119. package/dist/index157.cjs +1 -1
  120. package/dist/index157.js +9 -24
  121. package/dist/index158.cjs +1 -1
  122. package/dist/index158.js +60 -104
  123. package/dist/index159.cjs +1 -1
  124. package/dist/index159.js +20 -3
  125. package/dist/index160.cjs +1 -1
  126. package/dist/index160.js +106 -5
  127. package/dist/index161.cjs +1 -1
  128. package/dist/index161.js +76 -29
  129. package/dist/index162.cjs +1 -1
  130. package/dist/index162.js +9 -3
  131. package/dist/index163.cjs +1 -1
  132. package/dist/index163.js +86 -13
  133. package/dist/index164.cjs +2 -1
  134. package/dist/index164.js +3 -6
  135. package/dist/index165.cjs +1 -1
  136. package/dist/index165.js +9 -9
  137. package/dist/index166.cjs +1 -1
  138. package/dist/index166.js +11 -101
  139. package/dist/index167.cjs +1 -1
  140. package/dist/index167.js +4 -80
  141. package/dist/index168.cjs +1 -1
  142. package/dist/index168.js +2 -6
  143. package/dist/index169.cjs +1 -1
  144. package/dist/index169.js +32 -7
  145. package/dist/index170.cjs +1 -1
  146. package/dist/index170.js +21 -27
  147. package/dist/index171.cjs +1 -1
  148. package/dist/index171.js +5 -34
  149. package/dist/index172.cjs +1 -1
  150. package/dist/index172.js +5 -13
  151. package/dist/index173.cjs +1 -1
  152. package/dist/index173.js +5 -19
  153. package/dist/index174.cjs +9 -1
  154. package/dist/index174.js +31 -74
  155. package/dist/index175.cjs +1 -1
  156. package/dist/index175.js +3 -2
  157. package/dist/index176.cjs +1 -1
  158. package/dist/index176.js +18 -14
  159. package/dist/index177.cjs +1 -1
  160. package/dist/index177.js +19 -17
  161. package/dist/index178.cjs +1 -1
  162. package/dist/index178.js +33 -169
  163. package/dist/index179.cjs +1 -1
  164. package/dist/index179.js +7 -16
  165. package/dist/index18.cjs +1 -1
  166. package/dist/index18.js +8 -8
  167. package/dist/index180.cjs +4 -1
  168. package/dist/index180.js +194 -10
  169. package/dist/index181.cjs +1 -1
  170. package/dist/index181.js +27 -30
  171. package/dist/index182.cjs +1 -1
  172. package/dist/index182.js +162 -2
  173. package/dist/index183.cjs +1 -1
  174. package/dist/index183.js +127 -13
  175. package/dist/index184.cjs +1 -1
  176. package/dist/index184.js +27 -12
  177. package/dist/index185.cjs +1 -1
  178. package/dist/index185.js +191 -47
  179. package/dist/index186.cjs +1 -1
  180. package/dist/index186.js +4 -12
  181. package/dist/index187.cjs +1 -1
  182. package/dist/index187.js +20 -7
  183. package/dist/index188.cjs +1 -1
  184. package/dist/index188.js +3 -67
  185. package/dist/index189.cjs +1 -1
  186. package/dist/index189.js +13 -43
  187. package/dist/index190.cjs +1 -1
  188. package/dist/index190.js +32 -35
  189. package/dist/index191.cjs +1 -1
  190. package/dist/index191.js +3 -18
  191. package/dist/index192.cjs +1 -1
  192. package/dist/index192.js +27 -6
  193. package/dist/index193.cjs +1 -1
  194. package/dist/index193.js +25 -9
  195. package/dist/index194.cjs +1 -1
  196. package/dist/index194.js +27 -12
  197. package/dist/index195.cjs +1 -1
  198. package/dist/index195.js +6 -8
  199. package/dist/index196.cjs +1 -1
  200. package/dist/index196.js +6 -35
  201. package/dist/index197.cjs +1 -1
  202. package/dist/index197.js +32 -16
  203. package/dist/index198.cjs +1 -1
  204. package/dist/index198.js +5 -15
  205. package/dist/index199.cjs +1 -1
  206. package/dist/index199.js +37 -6
  207. package/dist/index20.cjs +1 -1
  208. package/dist/index20.js +8 -8
  209. package/dist/index200.cjs +1 -2
  210. package/dist/index200.js +44 -19
  211. package/dist/index201.cjs +1 -1
  212. package/dist/index201.js +31 -12
  213. package/dist/index202.cjs +1 -1
  214. package/dist/index202.js +15 -23
  215. package/dist/index203.cjs +1 -1
  216. package/dist/index203.js +41 -17
  217. package/dist/index204.cjs +1 -1
  218. package/dist/index204.js +104 -15
  219. package/dist/index205.cjs +1 -1
  220. package/dist/index205.js +3 -6
  221. package/dist/index206.cjs +1 -1
  222. package/dist/index206.js +5 -13
  223. package/dist/index207.cjs +1 -1
  224. package/dist/index207.js +3 -10
  225. package/dist/index208.cjs +1 -1
  226. package/dist/index208.js +17 -16
  227. package/dist/index209.cjs +1 -2
  228. package/dist/index209.js +8 -41
  229. package/dist/index210.cjs +1 -1
  230. package/dist/index210.js +6 -2
  231. package/dist/index211.cjs +1 -1
  232. package/dist/index211.js +27 -5
  233. package/dist/index212.cjs +1 -1
  234. package/dist/index212.js +77 -9
  235. package/dist/index213.cjs +1 -1
  236. package/dist/index213.js +2 -20
  237. package/dist/index214.cjs +1 -1
  238. package/dist/index214.js +18 -8
  239. package/dist/index215.cjs +1 -1
  240. package/dist/index215.js +17 -66
  241. package/dist/index216.cjs +1 -1
  242. package/dist/index216.js +10 -65
  243. package/dist/index217.cjs +1 -1
  244. package/dist/index217.js +99 -184
  245. package/dist/index218.cjs +1 -1
  246. package/dist/index218.js +15 -27
  247. package/dist/index219.cjs +1 -1
  248. package/dist/index219.js +209 -71
  249. package/dist/index22.cjs +1 -1
  250. package/dist/index22.js +9 -9
  251. package/dist/index220.cjs +1 -1
  252. package/dist/index220.js +105 -37
  253. package/dist/index221.cjs +1 -1
  254. package/dist/index221.js +205 -15
  255. package/dist/index222.cjs +1 -1
  256. package/dist/index222.js +41 -12
  257. package/dist/index223.cjs +1 -1
  258. package/dist/index223.js +78 -11
  259. package/dist/index224.cjs +1 -1
  260. package/dist/index224.js +2 -13
  261. package/dist/index225.cjs +1 -1
  262. package/dist/index225.js +24 -19
  263. package/dist/index226.cjs +1 -1
  264. package/dist/index226.js +43 -105
  265. package/dist/index227.cjs +1 -1
  266. package/dist/index227.js +9 -103
  267. package/dist/index228.cjs +2 -1
  268. package/dist/index228.js +41 -6
  269. package/dist/index229.cjs +1 -1
  270. package/dist/index229.js +2 -7
  271. package/dist/index23.cjs +1 -1
  272. package/dist/index23.js +2 -2
  273. package/dist/index230.cjs +1 -1
  274. package/dist/index230.js +5 -26
  275. package/dist/index231.cjs +1 -1
  276. package/dist/index231.js +10 -16
  277. package/dist/index232.cjs +1 -1
  278. package/dist/index232.js +18 -213
  279. package/dist/index233.cjs +1 -1
  280. package/dist/index233.js +8 -24
  281. package/dist/index234.cjs +1 -1
  282. package/dist/index234.js +66 -46
  283. package/dist/index235.cjs +1 -1
  284. package/dist/index235.js +65 -9
  285. package/dist/index236.cjs +1 -1
  286. package/dist/index236.js +185 -39
  287. package/dist/index237.cjs +1 -1
  288. package/dist/index237.js +26 -76
  289. package/dist/index238.cjs +1 -1
  290. package/dist/index238.js +77 -2
  291. package/dist/index239.cjs +1 -1
  292. package/dist/index239.js +38 -9
  293. package/dist/index24.cjs +1 -1
  294. package/dist/index24.js +5 -5
  295. package/dist/index240.cjs +1 -1
  296. package/dist/index240.js +16 -19
  297. package/dist/index241.cjs +1 -1
  298. package/dist/index241.js +13 -68
  299. package/dist/index242.cjs +1 -1
  300. package/dist/index242.js +11 -657
  301. package/dist/index243.cjs +1 -1
  302. package/dist/index243.js +10 -204
  303. package/dist/index244.cjs +1 -1
  304. package/dist/index244.js +6 -177
  305. package/dist/index245.cjs +1 -2
  306. package/dist/index245.js +7 -67
  307. package/dist/index246.cjs +1 -1
  308. package/dist/index246.js +19 -14
  309. package/dist/index247.cjs +1 -1
  310. package/dist/index247.js +26 -4
  311. package/dist/index248.cjs +1 -1
  312. package/dist/index248.js +12 -2
  313. package/dist/index249.cjs +1 -0
  314. package/dist/index249.js +22 -0
  315. package/dist/index25.cjs +1 -1
  316. package/dist/index25.js +3 -3
  317. package/dist/index250.cjs +1 -0
  318. package/dist/index250.js +660 -0
  319. package/dist/index251.cjs +1 -0
  320. package/dist/index251.js +180 -0
  321. package/dist/index252.cjs +2 -0
  322. package/dist/index252.js +94 -0
  323. package/dist/index253.cjs +1 -0
  324. package/dist/index253.js +17 -0
  325. package/dist/index254.cjs +1 -0
  326. package/dist/index254.js +71 -0
  327. package/dist/index255.cjs +1 -0
  328. package/dist/index255.js +7 -0
  329. package/dist/index256.cjs +1 -0
  330. package/dist/index256.js +4 -0
  331. package/dist/index26.cjs +1 -1
  332. package/dist/index26.js +1 -1
  333. package/dist/index29.cjs +1 -1
  334. package/dist/index29.js +13 -7
  335. package/dist/index3.cjs +1 -1
  336. package/dist/index3.js +41 -24
  337. package/dist/index30.cjs +1 -1
  338. package/dist/index30.js +34 -31
  339. package/dist/index31.cjs +1 -1
  340. package/dist/index31.js +30 -27
  341. package/dist/index32.cjs +1 -1
  342. package/dist/index32.js +55 -16
  343. package/dist/index33.cjs +1 -1
  344. package/dist/index33.js +43 -31
  345. package/dist/index34.cjs +1 -1
  346. package/dist/index34.js +22 -41
  347. package/dist/index35.cjs +1 -1
  348. package/dist/index35.js +6 -151
  349. package/dist/index36.cjs +1 -1
  350. package/dist/index36.js +18 -35
  351. package/dist/index37.cjs +1 -1
  352. package/dist/index37.js +14 -57
  353. package/dist/index38.cjs +1 -2
  354. package/dist/index38.js +5 -59
  355. package/dist/index39.cjs +1 -1
  356. package/dist/index39.js +13 -13
  357. package/dist/index40.cjs +1 -1
  358. package/dist/index40.js +10 -37
  359. package/dist/index41.cjs +1 -1
  360. package/dist/index41.js +12 -15
  361. package/dist/index42.cjs +1 -1
  362. package/dist/index42.js +11 -8
  363. package/dist/index43.cjs +1 -1
  364. package/dist/index43.js +3 -20
  365. package/dist/index44.cjs +1 -1
  366. package/dist/index44.js +22 -2
  367. package/dist/index45.cjs +1 -1
  368. package/dist/index45.js +8 -45
  369. package/dist/index46.cjs +1 -1
  370. package/dist/index46.js +3 -32
  371. package/dist/index47.cjs +1 -1
  372. package/dist/index47.js +16 -3
  373. package/dist/index48.cjs +1 -1
  374. package/dist/index48.js +5 -9
  375. package/dist/index49.cjs +1 -1
  376. package/dist/index49.js +171 -50
  377. package/dist/index50.cjs +1 -1
  378. package/dist/index50.js +103 -7
  379. package/dist/index51.cjs +1 -1
  380. package/dist/index51.js +170 -15
  381. package/dist/index52.cjs +1 -1
  382. package/dist/index52.js +111 -10
  383. package/dist/index53.cjs +1 -1
  384. package/dist/index53.js +30 -5
  385. package/dist/index54.cjs +1 -1
  386. package/dist/index54.js +2 -15
  387. package/dist/index55.cjs +1 -1
  388. package/dist/index55.js +4 -4
  389. package/dist/index56.cjs +2 -1
  390. package/dist/index56.js +59 -26
  391. package/dist/index57.cjs +2 -1
  392. package/dist/index57.js +51 -106
  393. package/dist/index58.cjs +3 -1
  394. package/dist/index58.js +215 -4
  395. package/dist/index59.cjs +1 -1
  396. package/dist/index59.js +23 -6
  397. package/dist/index60.cjs +1 -1
  398. package/dist/index60.js +18 -88
  399. package/dist/index61.cjs +1 -1
  400. package/dist/index61.js +10 -6
  401. package/dist/index62.cjs +1 -1
  402. package/dist/index62.js +17 -122
  403. package/dist/index63.cjs +1 -1
  404. package/dist/index63.js +12 -6
  405. package/dist/index64.cjs +1 -1
  406. package/dist/index64.js +12 -21
  407. package/dist/index65.cjs +1 -1
  408. package/dist/index65.js +24 -17
  409. package/dist/index66.cjs +1 -1
  410. package/dist/index66.js +27 -39
  411. package/dist/index67.cjs +1 -1
  412. package/dist/index67.js +47 -21
  413. package/dist/index68.cjs +1 -1
  414. package/dist/index68.js +16 -11
  415. package/dist/index69.cjs +1 -1
  416. package/dist/index69.js +11 -6
  417. package/dist/index70.cjs +1 -1
  418. package/dist/index70.js +29 -17
  419. package/dist/index71.cjs +1 -1
  420. package/dist/index71.js +35 -105
  421. package/dist/index72.cjs +1 -1
  422. package/dist/index72.js +7 -68
  423. package/dist/index73.cjs +1 -1
  424. package/dist/index73.js +27 -7
  425. package/dist/index74.cjs +1 -1
  426. package/dist/index74.js +22 -28
  427. package/dist/index75.cjs +1 -1
  428. package/dist/index75.js +7 -71
  429. package/dist/index76.cjs +1 -1
  430. package/dist/index76.js +71 -4
  431. package/dist/index77.cjs +1 -2
  432. package/dist/index77.js +47 -3
  433. package/dist/index78.cjs +1 -1
  434. package/dist/index78.js +24 -9
  435. package/dist/index79.cjs +1 -20
  436. package/dist/index79.js +36 -325
  437. package/dist/index8.cjs +1 -1
  438. package/dist/index8.js +13 -9
  439. package/dist/index80.cjs +1 -1
  440. package/dist/index80.js +17 -13
  441. package/dist/index81.cjs +1 -1
  442. package/dist/index81.js +6 -4
  443. package/dist/index82.cjs +1 -1
  444. package/dist/index82.js +9 -12
  445. package/dist/index83.cjs +1 -1
  446. package/dist/index83.js +14 -2
  447. package/dist/index84.cjs +1 -1
  448. package/dist/index84.js +163 -6
  449. package/dist/index85.cjs +1 -2
  450. package/dist/index85.js +74 -51
  451. package/dist/index86.cjs +1 -3
  452. package/dist/index86.js +13 -215
  453. package/dist/index87.cjs +1 -1
  454. package/dist/index87.js +51 -31
  455. package/dist/index88.cjs +1 -1
  456. package/dist/index88.js +7 -21
  457. package/dist/index89.cjs +1 -1
  458. package/dist/index89.js +7 -5
  459. package/dist/index90.cjs +1 -1
  460. package/dist/index90.js +21 -73
  461. package/dist/index91.cjs +1 -1
  462. package/dist/index91.js +8 -5
  463. package/dist/index92.cjs +1 -1
  464. package/dist/index92.js +31 -5
  465. package/dist/index93.cjs +1 -9
  466. package/dist/index93.js +16 -35
  467. package/dist/index94.cjs +1 -3
  468. package/dist/index94.js +68 -90
  469. package/dist/index95.cjs +1 -1
  470. package/dist/index95.js +36 -3
  471. package/dist/index96.cjs +1 -1
  472. package/dist/index96.js +16 -18
  473. package/dist/index97.cjs +1 -1
  474. package/dist/index97.js +73 -18
  475. package/dist/index98.cjs +1 -1
  476. package/dist/index98.js +12 -35
  477. package/dist/index99.cjs +1 -1
  478. package/dist/index99.js +28 -22
  479. package/dist/src/lib/store/store.interface.d.ts +2 -1
  480. package/dist/src/lib/utils.d.ts +15 -0
  481. package/package.json +3 -3
package/dist/index65.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index47.cjs"),a=require("./index200.cjs"),o=require("./index111.cjs");async function i(n,{account:e=n.account,message:r}){if(!e)throw new a.AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const t=c.parseAccount(e);if(t.signMessage)return t.signMessage({message:r});const s=typeof r=="string"?o.stringToHex(r):r.raw instanceof Uint8Array?o.toHex(r.raw):r.raw;return n.request({method:"personal_sign",params:[s,t.address]},{retryCount:0})}exports.signMessage=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index33.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/index65.js CHANGED
@@ -1,20 +1,27 @@
1
- import { parseAccount as e } from "./index47.js";
2
- import { AccountNotFoundError as i } from "./index200.js";
3
- import { stringToHex as a, toHex as c } from "./index111.js";
4
- async function g(n, { account: o = n.account, message: r }) {
5
- if (!o)
6
- throw new i({
7
- docsPath: "/docs/actions/wallet/signMessage"
8
- });
9
- const t = e(o);
10
- if (t.signMessage)
11
- return t.signMessage({ message: r });
12
- const s = typeof r == "string" ? a(r) : r.raw instanceof Uint8Array ? c(r.raw) : r.raw;
13
- return n.request({
14
- method: "personal_sign",
15
- params: [s, t.address]
16
- }, { retryCount: 0 });
1
+ import { bytesToHex as o, numberToHex as i } from "./index33.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
+ }));
17
23
  }
18
24
  export {
19
- g as signMessage
25
+ c as formatTransactionRequest,
26
+ a as rpcTransactionType
20
27
  };
package/dist/index66.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index47.cjs"),f=require("./index200.cjs"),C=require("./index147.cjs"),T=require("./index111.cjs"),m=require("./index157.cjs"),I=require("./index29.cjs"),w=require("./index173.cjs"),A=require("./index50.cjs");async function R(t,s){var i,u,d,h;const{account:o=t.account,chain:n=t.chain,...c}=s;if(!o)throw new f.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTransaction"});const r=g.parseAccount(o);w.assertRequest({account:r,...s});const a=await I.getAction(t,A.getChainId,"getChainId")({});n!==null&&C.assertCurrentChain({currentChainId:a,chain:n});const e=(n==null?void 0:n.formatters)||((i=t.chain)==null?void 0:i.formatters),q=((u=e==null?void 0:e.transactionRequest)==null?void 0:u.format)||m.formatTransactionRequest;return r.signTransaction?r.signTransaction({...c,chainId:a},{serializer:(h=(d=t.chain)==null?void 0:d.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...q(c),chainId:T.numberToHex(a),from:r.address}]},{retryCount:0})}exports.signTransaction=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index108.cjs"),l=new Map;function A({fn:a,id:o,shouldSplitBatch:h,wait:y=0,sort:u}){const i=async()=>{const e=n();f();const s=e.map(({args:t})=>t);s.length!==0&&a(s).then(t=>{u&&Array.isArray(t)&&t.sort(u);for(let c=0;c<e.length;c++){const{resolve:r}=e[c];r==null||r([t[c],t])}}).catch(t=>{for(let c=0;c<e.length;c++){const{reject:r}=e[c];r==null||r(t)}})},f=()=>l.delete(o),m=()=>n().map(({args:e})=>e),n=()=>l.get(o)||[],g=e=>l.set(o,[...n(),e]);return{flush:f,async schedule(e){const{promise:s,resolve:t,reject:c}=v.withResolvers();return(h==null?void 0:h([...m(),e]))&&i(),n().length>0?(g({args:e,resolve:t,reject:c}),s):(g({args:e,resolve:t,reject:c}),setTimeout(i,y),s)}}}exports.createBatchScheduler=A;
package/dist/index66.js CHANGED
@@ -1,43 +1,31 @@
1
- import { parseAccount as d } from "./index47.js";
2
- import { AccountNotFoundError as p } from "./index200.js";
3
- import { assertCurrentChain as g } from "./index147.js";
4
- import { numberToHex as T } from "./index111.js";
5
- import { formatTransactionRequest as C } from "./index157.js";
6
- import { getAction as w } from "./index29.js";
7
- import { assertRequest as I } from "./index173.js";
8
- import { getChainId as q } from "./index50.js";
9
- async function E(t, s) {
10
- var e, m, u, f;
11
- const { account: i = t.account, chain: r = t.chain, ...c } = s;
12
- if (!i)
13
- throw new p({
14
- docsPath: "/docs/actions/wallet/signTransaction"
15
- });
16
- const o = d(i);
17
- I({
18
- account: o,
19
- ...s
20
- });
21
- const n = await w(t, q, "getChainId")({});
22
- r !== null && g({
23
- currentChainId: n,
24
- chain: r
25
- });
26
- const a = (r == null ? void 0 : r.formatters) || ((e = t.chain) == null ? void 0 : e.formatters), h = ((m = a == null ? void 0 : a.transactionRequest) == null ? void 0 : m.format) || C;
27
- return o.signTransaction ? o.signTransaction({
28
- ...c,
29
- chainId: n
30
- }, { serializer: (f = (u = t.chain) == null ? void 0 : u.serializers) == null ? void 0 : f.transaction }) : await t.request({
31
- method: "eth_signTransaction",
32
- params: [
33
- {
34
- ...h(c),
35
- chainId: T(n),
36
- from: o.address
1
+ import { withResolvers as y } from "./index108.js";
2
+ const l = /* @__PURE__ */ new Map();
3
+ function w({ fn: m, id: o, shouldSplitBatch: h, wait: A = 0, sort: u }) {
4
+ const i = async () => {
5
+ const e = s();
6
+ f();
7
+ const r = e.map(({ args: t }) => t);
8
+ r.length !== 0 && m(r).then((t) => {
9
+ u && Array.isArray(t) && t.sort(u);
10
+ for (let c = 0; c < e.length; c++) {
11
+ const { resolve: n } = e[c];
12
+ n == null || n([t[c], t]);
13
+ }
14
+ }).catch((t) => {
15
+ for (let c = 0; c < e.length; c++) {
16
+ const { reject: n } = e[c];
17
+ n == null || n(t);
37
18
  }
38
- ]
39
- }, { retryCount: 0 });
19
+ });
20
+ }, f = () => l.delete(o), p = () => s().map(({ args: e }) => e), s = () => l.get(o) || [], g = (e) => l.set(o, [...s(), e]);
21
+ return {
22
+ flush: f,
23
+ async schedule(e) {
24
+ const { promise: r, resolve: t, reject: c } = y();
25
+ return (h == null ? void 0 : h([...p(), e])) && i(), s().length > 0 ? (g({ args: e, resolve: t, reject: c }), r) : (g({ args: e, resolve: t, reject: c }), setTimeout(i, A), r);
26
+ }
27
+ };
40
28
  }
41
29
  export {
42
- E as signTransaction
30
+ w as createBatchScheduler
43
31
  };
package/dist/index67.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index47.cjs"),y=require("./index200.cjs"),s=require("./index167.cjs");async function p(c,r){const{account:i=c.account,domain:t,message:a,primaryType:e}=r;if(!i)throw new y.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTypedData"});const n=u.parseAccount(i),o={EIP712Domain:s.getTypesForEIP712Domain({domain:t}),...r.types};if(s.validateTypedData({domain:t,message:a,primaryType:e,types:o}),n.signTypedData)return n.signTypedData({domain:t,message:a,primaryType:e,types:o});const d=s.serializeTypedData({domain:t,message:a,primaryType:e,types:o});return c.request({method:"eth_signTypedData_v4",params:[n.address,d]},{retryCount:0})}exports.signTypedData=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index41.cjs"),a=require("./index176.cjs"),f=require("./index174.cjs"),S=require("./index42.cjs"),c=require("./index33.cjs");function d(r){if(!(!r||r.length===0))return r.reduce((t,{slot:e,value:n})=>{if(e.length!==66)throw new a.InvalidBytesLengthError({size:e.length,targetSize:66,type:"hex"});if(n.length!==66)throw new a.InvalidBytesLengthError({size:n.length,targetSize:66,type:"hex"});return t[e]=n,t},{})}function u(r){const{balance:t,nonce:e,state:n,stateDiff:s,code:o}=r,i={};if(o!==void 0&&(i.code=o),t!==void 0&&(i.balance=c.numberToHex(t)),e!==void 0&&(i.nonce=c.numberToHex(e)),n!==void 0&&(i.state=d(n)),s!==void 0){if(i.state)throw new f.StateAssignmentConflictError;i.stateDiff=d(s)}return i}function h(r){if(!r)return;const t={};for(const{address:e,...n}of r){if(!S.isAddress(e,{strict:!1}))throw new l.InvalidAddressError({address:e});if(t[e])throw new f.AccountStateConflictError({address:e});t[e]=u(n)}return t}exports.serializeAccountStateOverride=u;exports.serializeStateMapping=d;exports.serializeStateOverride=h;
package/dist/index67.js CHANGED
@@ -1,24 +1,50 @@
1
- import { parseAccount as p } from "./index47.js";
2
- import { AccountNotFoundError as d } from "./index200.js";
3
- import { getTypesForEIP712Domain as y, validateTypedData as m, serializeTypedData as u } from "./index167.js";
4
- async function f(r, s) {
5
- const { account: c = r.account, domain: t, message: a, primaryType: o } = s;
6
- if (!c)
7
- throw new d({
8
- docsPath: "/docs/actions/wallet/signTypedData"
9
- });
10
- const e = p(c), n = {
11
- EIP712Domain: y({ domain: t }),
12
- ...s.types
13
- };
14
- if (m({ domain: t, message: a, primaryType: o, types: n }), e.signTypedData)
15
- return e.signTypedData({ domain: t, message: a, primaryType: o, types: n });
16
- const i = u({ domain: t, message: a, primaryType: o, types: n });
17
- return r.request({
18
- method: "eth_signTypedData_v4",
19
- params: [e.address, i]
20
- }, { retryCount: 0 });
1
+ import { InvalidAddressError as a } from "./index41.js";
2
+ import { InvalidBytesLengthError as d } from "./index176.js";
3
+ import { AccountStateConflictError as u, StateAssignmentConflictError as h } from "./index174.js";
4
+ import { isAddress as l } from "./index42.js";
5
+ import { numberToHex as c } from "./index33.js";
6
+ function s(r) {
7
+ if (!(!r || r.length === 0))
8
+ return r.reduce((t, { slot: e, value: n }) => {
9
+ if (e.length !== 66)
10
+ throw new d({
11
+ size: e.length,
12
+ targetSize: 66,
13
+ type: "hex"
14
+ });
15
+ if (n.length !== 66)
16
+ throw new d({
17
+ size: n.length,
18
+ targetSize: 66,
19
+ type: "hex"
20
+ });
21
+ return t[e] = n, t;
22
+ }, {});
23
+ }
24
+ function m(r) {
25
+ const { balance: t, nonce: e, state: n, stateDiff: o, code: f } = r, i = {};
26
+ if (f !== void 0 && (i.code = f), t !== void 0 && (i.balance = c(t)), e !== void 0 && (i.nonce = c(e)), n !== void 0 && (i.state = s(n)), o !== void 0) {
27
+ if (i.state)
28
+ throw new h();
29
+ i.stateDiff = s(o);
30
+ }
31
+ return i;
32
+ }
33
+ function A(r) {
34
+ if (!r)
35
+ return;
36
+ const t = {};
37
+ for (const { address: e, ...n } of r) {
38
+ if (!l(e, { strict: !1 }))
39
+ throw new a({ address: e });
40
+ if (t[e])
41
+ throw new u({ address: e });
42
+ t[e] = m(n);
43
+ }
44
+ return t;
21
45
  }
22
46
  export {
23
- f as signTypedData
47
+ m as serializeAccountStateOverride,
48
+ s as serializeStateMapping,
49
+ A as serializeStateOverride
24
50
  };
package/dist/index68.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index111.cjs");async function a(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:i.numberToHex(t)}]},{retryCount:0})}exports.switchChain=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index43.cjs"),u=require("./index19.cjs"),d=require("./index41.cjs"),n=require("./index180.cjs"),i=require("./index42.cjs");function w(a){const{account:t,maxFeePerGas:e,maxPriorityFeePerGas:r,to:s}=a,o=t?c.parseAccount(t):void 0;if(o&&!i.isAddress(o.address))throw new d.InvalidAddressError({address:o.address});if(s&&!i.isAddress(s))throw new d.InvalidAddressError({address:s});if(e&&e>u.maxUint256)throw new n.FeeCapTooHighError({maxFeePerGas:e});if(r&&e&&r>e)throw new n.TipAboveFeeCapError({maxFeePerGas:e,maxPriorityFeePerGas:r})}exports.assertRequest=w;
package/dist/index68.js CHANGED
@@ -1,14 +1,19 @@
1
- import { numberToHex as a } from "./index111.js";
2
- async function i(t, { id: e }) {
3
- await t.request({
4
- method: "wallet_switchEthereumChain",
5
- params: [
6
- {
7
- chainId: a(e)
8
- }
9
- ]
10
- }, { retryCount: 0 });
1
+ import { parseAccount as d } from "./index43.js";
2
+ import { maxUint256 as m } from "./index19.js";
3
+ import { InvalidAddressError as i } from "./index41.js";
4
+ import { FeeCapTooHighError as c, TipAboveFeeCapError as f } from "./index180.js";
5
+ import { isAddress as a } from "./index42.js";
6
+ function A(n) {
7
+ const { account: s, maxFeePerGas: r, maxPriorityFeePerGas: o, to: e } = n, t = s ? d(s) : void 0;
8
+ if (t && !a(t.address))
9
+ throw new i({ address: t.address });
10
+ if (e && !a(e))
11
+ throw new i({ address: e });
12
+ if (r && r > m)
13
+ throw new c({ maxFeePerGas: r });
14
+ if (o && r && o > r)
15
+ throw new f({ maxFeePerGas: r, maxPriorityFeePerGas: o });
11
16
  }
12
17
  export {
13
- i as switchChain
18
+ A as assertRequest
14
19
  };
package/dist/index69.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function a(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}exports.watchAsset=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index234.cjs"),c=require("./index235.cjs"),o=require("./index236.cjs");function a(t){const n=c.parseStructs(t),r=[],i=t.length;for(let e=0;e<i;e++){const s=t[e];u.isStructSignature(s)||r.push(o.parseSignature(s,n))}return r}exports.parseAbi=a;
package/dist/index69.js CHANGED
@@ -1,9 +1,14 @@
1
- async function d(t, e) {
2
- return await t.request({
3
- method: "wallet_watchAsset",
4
- params: e
5
- }, { retryCount: 0 });
1
+ import { isStructSignature as c } from "./index234.js";
2
+ import { parseStructs as s } from "./index235.js";
3
+ import { parseSignature as p } from "./index236.js";
4
+ function a(t) {
5
+ const i = s(t), o = [], e = t.length;
6
+ for (let r = 0; r < e; r++) {
7
+ const n = t[r];
8
+ c(n) || o.push(p(n, i));
9
+ }
10
+ return o;
6
11
  }
7
12
  export {
8
- d as watchAsset
13
+ a as parseAbi
9
14
  };
package/dist/index70.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index71.cjs"),b=require("./index48.cjs");function l({key:r,methods:e,name:n,request:u,retryCount:i=3,retryDelay:t=150,timeout:c,type:o},s){const d=b.uid();return{config:{key:r,methods:e,name:n,request:u,retryCount:i,retryDelay:t,timeout:c,type:o},request:a.buildRequest(u,{methods:e,retryCount:i,retryDelay:t,uid:d}),value:s}}exports.createTransport=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index71.cjs"),s=require("./index33.cjs"),q=require("./index72.cjs");async function b(r,a){const{address:u,abi:n,args:c,eventName:e,fromBlock:t,strict:l,toBlock:o}=a,d=q.createFilterRequestScope(r,{method:"eth_newFilter"}),p=e?m.encodeEventTopics({abi:n,args:c,eventName:e}):void 0,i=await r.request({method:"eth_newFilter",params:[{address:u,fromBlock:typeof t=="bigint"?s.numberToHex(t):t,toBlock:typeof o=="bigint"?s.numberToHex(o):o,topics:p}]});return{abi:n,args:c,eventName:e,id:i,request:d(i),strict:!!l,type:"event"}}exports.createContractEventFilter=b;
package/dist/index70.js CHANGED
@@ -1,22 +1,34 @@
1
- import { buildRequest as m } from "./index71.js";
2
- import { uid as e } from "./index48.js";
3
- function b({ key: n, methods: i, name: t, request: o, retryCount: r = 3, retryDelay: u = 150, timeout: c, type: f }, p) {
4
- const d = e();
1
+ import { encodeEventTopics as l } from "./index71.js";
2
+ import { numberToHex as s } from "./index33.js";
3
+ import { createFilterRequestScope as u } from "./index72.js";
4
+ async function h(r, a) {
5
+ const { address: m, abi: n, args: i, eventName: e, fromBlock: t, strict: p, toBlock: o } = a, f = u(r, {
6
+ method: "eth_newFilter"
7
+ }), d = e ? l({
8
+ abi: n,
9
+ args: i,
10
+ eventName: e
11
+ }) : void 0, c = await r.request({
12
+ method: "eth_newFilter",
13
+ params: [
14
+ {
15
+ address: m,
16
+ fromBlock: typeof t == "bigint" ? s(t) : t,
17
+ toBlock: typeof o == "bigint" ? s(o) : o,
18
+ topics: d
19
+ }
20
+ ]
21
+ });
5
22
  return {
6
- config: {
7
- key: n,
8
- methods: i,
9
- name: t,
10
- request: o,
11
- retryCount: r,
12
- retryDelay: u,
13
- timeout: c,
14
- type: f
15
- },
16
- request: m(o, { methods: i, retryCount: r, retryDelay: u, uid: d }),
17
- value: p
23
+ abi: n,
24
+ args: i,
25
+ eventName: e,
26
+ id: c,
27
+ request: f(c),
28
+ strict: !!p,
29
+ type: "event"
18
30
  };
19
31
  }
20
32
  export {
21
- b as createTransport
33
+ h as createContractEventFilter
22
34
  };
package/dist/index71.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("./index38.cjs"),p=require("./index72.cjs"),e=require("./index102.cjs"),I=require("./index111.cjs"),q=require("./index223.cjs"),m=require("./index43.cjs"),v=require("./index44.cjs");function N(t,E={}){return async(c,h={})=>{var i;const{dedupe:s=!1,methods:o,retryDelay:R=150,retryCount:l=3,uid:f}={...E,...h},{method:d}=c;if((i=o==null?void 0:o.exclude)!=null&&i.includes(d))throw new e.MethodNotSupportedRpcError(new Error("method not supported"),{method:d});if(o!=null&&o.include&&!o.include.includes(d))throw new e.MethodNotSupportedRpcError(new Error("method not supported"),{method:d});const y=s?I.stringToHex(`${f}.${v.stringify(c)}`):void 0;return q.withDedupe(()=>m.withRetry(async()=>{try{return await t(c)}catch(n){const r=n;switch(r.code){case e.ParseRpcError.code:throw new e.ParseRpcError(r);case e.InvalidRequestRpcError.code:throw new e.InvalidRequestRpcError(r);case e.MethodNotFoundRpcError.code:throw new e.MethodNotFoundRpcError(r,{method:c.method});case e.InvalidParamsRpcError.code:throw new e.InvalidParamsRpcError(r);case e.InternalRpcError.code:throw new e.InternalRpcError(r);case e.InvalidInputRpcError.code:throw new e.InvalidInputRpcError(r);case e.ResourceNotFoundRpcError.code:throw new e.ResourceNotFoundRpcError(r);case e.ResourceUnavailableRpcError.code:throw new e.ResourceUnavailableRpcError(r);case e.TransactionRejectedRpcError.code:throw new e.TransactionRejectedRpcError(r);case e.MethodNotSupportedRpcError.code:throw new e.MethodNotSupportedRpcError(r,{method:c.method});case e.LimitExceededRpcError.code:throw new e.LimitExceededRpcError(r);case e.JsonRpcVersionUnsupportedError.code:throw new e.JsonRpcVersionUnsupportedError(r);case e.UserRejectedRequestError.code:throw new e.UserRejectedRequestError(r);case e.UnauthorizedProviderError.code:throw new e.UnauthorizedProviderError(r);case e.UnsupportedProviderMethodError.code:throw new e.UnsupportedProviderMethodError(r);case e.ProviderDisconnectedError.code:throw new e.ProviderDisconnectedError(r);case e.ChainDisconnectedError.code:throw new e.ChainDisconnectedError(r);case e.SwitchChainError.code:throw new e.SwitchChainError(r);case e.UnsupportedNonOptionalCapabilityError.code:throw new e.UnsupportedNonOptionalCapabilityError(r);case e.UnsupportedChainIdError.code:throw new e.UnsupportedChainIdError(r);case e.DuplicateIdError.code:throw new e.DuplicateIdError(r);case e.UnknownBundleIdError.code:throw new e.UnknownBundleIdError(r);case e.BundleTooLargeError.code:throw new e.BundleTooLargeError(r);case e.AtomicReadyWalletRejectedUpgradeError.code:throw new e.AtomicReadyWalletRejectedUpgradeError(r);case e.AtomicityNotSupportedError.code:throw new e.AtomicityNotSupportedError(r);case 5e3:throw new e.UserRejectedRequestError(r);default:throw n instanceof U.BaseError?n:new e.UnknownRpcError(r)}}},{delay:({count:n,error:r})=>{var a;if(r&&r instanceof p.HttpRequestError){const u=(a=r==null?void 0:r.headers)==null?void 0:a.get("Retry-After");if(u!=null&&u.match(/\d/))return Number.parseInt(u,10)*1e3}return~~(1<<n)*R},retryCount:l,shouldRetry:({error:n})=>w(n)}),{enabled:s,id:y})}}function w(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===e.LimitExceededRpcError.code||t.code===e.InternalRpcError.code:t instanceof p.HttpRequestError&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}exports.buildRequest=N;exports.shouldRetry=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index114.cjs"),v=require("./index179.cjs"),m=require("./index32.cjs"),p=require("./index45.cjs"),E=require("./index188.cjs"),q=require("./index185.cjs"),h=require("./index166.cjs"),w=require("./index94.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;
package/dist/index71.js CHANGED
@@ -1,109 +1,39 @@
1
- import { BaseError as z } from "./index38.js";
2
- import { HttpRequestError as k } from "./index72.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 "./index102.js";
4
- import { stringToHex as O } from "./index111.js";
5
- import { withDedupe as V } from "./index223.js";
6
- import { withRetry as W } from "./index43.js";
7
- import { stringify as _ } from "./index44.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
- };
1
+ import { AbiEventNotFoundError as u } from "./index114.js";
2
+ import { FilterTypeNotSupportedError as b } from "./index179.js";
3
+ import { toBytes as g } from "./index32.js";
4
+ import { keccak256 as v } from "./index45.js";
5
+ import { toEventSelector as h } from "./index188.js";
6
+ import { encodeAbiParameters as w } from "./index185.js";
7
+ import { formatAbiItem as E } from "./index166.js";
8
+ import { getAbiItem as N } from "./index94.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];
102
29
  }
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;
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]);
105
36
  }
106
37
  export {
107
- te as buildRequest,
108
- G as shouldRetry
38
+ $ as encodeEventTopics
109
39
  };
package/dist/index72.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index44.cjs"),i=require("./index38.cjs"),o=require("./index95.cjs");class d extends i.BaseError{constructor({body:t,cause:e,details:r,headers:n,status:s,url:l}){super("HTTP request failed.",{cause:e,details:r,metaMessages:[s&&`Status: ${s}`,`URL: ${o.getUrl(l)}`,t&&`Request body: ${u.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=s,this.url=l}}class c extends i.BaseError{constructor({body:t,error:e,url:r}){super("RPC Request failed.",{cause:e,details:e.message,metaMessages:[`URL: ${o.getUrl(r)}`,`Request body: ${u.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}),this.code=e.code,this.data=e.data}}class b extends i.BaseError{constructor({body:t,url:e}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${o.getUrl(e)}`,`Request body: ${u.stringify(t)}`],name:"TimeoutError"})}}exports.HttpRequestError=d;exports.RpcRequestError=c;exports.TimeoutError=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(e,{method:u}){var s,o;const r={};return e.transport.type==="fallback"&&((o=(s=e.transport).onResponse)==null||o.call(s,({method:t,response:a,status:c,transport:n})=>{c==="success"&&u===t&&(r[a]=n.request)})),t=>r[t]||e.request}exports.createFilterRequestScope=p;
package/dist/index72.js CHANGED
@@ -1,71 +1,10 @@
1
- import { stringify as s } from "./index44.js";
2
- import { BaseError as a } from "./index38.js";
3
- import { getUrl as o } from "./index95.js";
4
- class m extends a {
5
- constructor({ body: t, cause: e, details: r, headers: d, status: u, url: l }) {
6
- super("HTTP request failed.", {
7
- cause: e,
8
- details: r,
9
- metaMessages: [
10
- u && `Status: ${u}`,
11
- `URL: ${o(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 = d, 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: ${o(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
- }), this.code = e.code, this.data = e.data;
56
- }
57
- }
58
- class p extends a {
59
- constructor({ body: t, url: e }) {
60
- super("The request took too long to respond.", {
61
- details: "The request timed out.",
62
- metaMessages: [`URL: ${o(e)}`, `Request body: ${s(t)}`],
63
- name: "TimeoutError"
64
- });
65
- }
1
+ function c(e, { method: p }) {
2
+ var r, o;
3
+ const t = {};
4
+ return e.transport.type === "fallback" && ((o = (r = e.transport).onResponse) == null || o.call(r, ({ method: s, response: n, status: u, transport: a }) => {
5
+ u === "success" && p === s && (t[n] = a.request);
6
+ })), (s) => t[s] || e.request;
66
7
  }
67
8
  export {
68
- m as HttpRequestError,
69
- f as RpcRequestError,
70
- p as TimeoutError
9
+ c as createFilterRequestScope
71
10
  };
package/dist/index73.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index38.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 g=require("./index43.cjs"),m=require("./index61.cjs"),f=require("./index74.cjs"),q=require("./index75.cjs"),G=require("./index76.cjs");async function C(i,u){const{abi:a,address:r,args:c,functionName:n,dataSuffix:o,...t}=u,d=m.encodeFunctionData({abi:a,args:c,functionName:n});try{return await q.getAction(i,G.estimateGas,"estimateGas")({data:`${d}${o?o.replace("0x",""):""}`,to:r,...t})}catch(s){const e=t.account?g.parseAccount(t.account):void 0;throw f.getContractError(s,{abi:a,address:r,args:c,docsPath:"/docs/contract/estimateContractGas",functionName:n,sender:e==null?void 0:e.address})}}exports.estimateContractGas=C;