@gardenfi/utils 3.1.0 → 3.1.1-beta.2

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 (467) hide show
  1. package/dist/index100.cjs +1 -2
  2. package/dist/index100.js +119 -114
  3. package/dist/index101.cjs +1 -1
  4. package/dist/index101.js +5 -14
  5. package/dist/index102.cjs +1 -1
  6. package/dist/index102.js +21 -24
  7. package/dist/index103.cjs +1 -1
  8. package/dist/index103.js +43 -31
  9. package/dist/index104.cjs +1 -1
  10. package/dist/index104.js +37 -43
  11. package/dist/index105.cjs +1 -1
  12. package/dist/index105.js +6 -6
  13. package/dist/index106.cjs +1 -1
  14. package/dist/index106.js +88 -101
  15. package/dist/index107.cjs +1 -1
  16. package/dist/index107.js +14 -37
  17. package/dist/index108.cjs +1 -1
  18. package/dist/index108.js +3 -8
  19. package/dist/index109.cjs +1 -1
  20. package/dist/index109.js +26 -20
  21. package/dist/index110.cjs +2 -1
  22. package/dist/index110.js +25 -2
  23. package/dist/index111.cjs +1 -1
  24. package/dist/index111.js +9 -75
  25. package/dist/index112.cjs +1 -1
  26. package/dist/index112.js +8 -15
  27. package/dist/index113.cjs +1 -1
  28. package/dist/index113.js +10 -151
  29. package/dist/index114.cjs +1 -20
  30. package/dist/index114.js +11 -326
  31. package/dist/index115.cjs +1 -3
  32. package/dist/index115.js +13 -451
  33. package/dist/index116.cjs +1 -1
  34. package/dist/index116.js +19 -71
  35. package/dist/index117.cjs +1 -1
  36. package/dist/index117.js +14 -16
  37. package/dist/index118.cjs +1 -1
  38. package/dist/index118.js +4 -10
  39. package/dist/index119.cjs +1 -1
  40. package/dist/index119.js +6 -125
  41. package/dist/index120.cjs +1 -1
  42. package/dist/index120.js +18 -5
  43. package/dist/index121.cjs +1 -1
  44. package/dist/index121.js +10 -45
  45. package/dist/index122.cjs +1 -1
  46. package/dist/index122.js +56 -36
  47. package/dist/index123.cjs +1 -1
  48. package/dist/index123.js +6 -6
  49. package/dist/index124.cjs +1 -1
  50. package/dist/index124.js +13 -90
  51. package/dist/index125.cjs +1 -1
  52. package/dist/index125.js +7 -14
  53. package/dist/index126.cjs +1 -1
  54. package/dist/index126.js +138 -3
  55. package/dist/index127.cjs +1 -1
  56. package/dist/index127.js +7 -26
  57. package/dist/index128.cjs +1 -2
  58. package/dist/index128.js +19 -22
  59. package/dist/index129.cjs +1 -1
  60. package/dist/index129.js +17 -9
  61. package/dist/index130.cjs +1 -1
  62. package/dist/index130.js +43 -8
  63. package/dist/index131.cjs +1 -1
  64. package/dist/index131.js +21 -10
  65. package/dist/index132.cjs +1 -1
  66. package/dist/index132.js +80 -11
  67. package/dist/index133.cjs +1 -1
  68. package/dist/index133.js +11 -13
  69. package/dist/index134.cjs +1 -1
  70. package/dist/index134.js +7 -15
  71. package/dist/index135.cjs +1 -1
  72. package/dist/index135.js +6 -14
  73. package/dist/index136.cjs +1 -1
  74. package/dist/index136.js +41 -4
  75. package/dist/index137.cjs +1 -1
  76. package/dist/index137.js +5 -6
  77. package/dist/index138.cjs +1 -1
  78. package/dist/index138.js +33 -18
  79. package/dist/index139.cjs +1 -1
  80. package/dist/index139.js +9 -10
  81. package/dist/index140.cjs +1 -1
  82. package/dist/index140.js +60 -58
  83. package/dist/index141.cjs +1 -1
  84. package/dist/index141.js +19 -6
  85. package/dist/index142.cjs +1 -1
  86. package/dist/index142.js +106 -13
  87. package/dist/index143.cjs +1 -1
  88. package/dist/index143.js +78 -7
  89. package/dist/index144.cjs +1 -1
  90. package/dist/index144.js +7 -136
  91. package/dist/index145.cjs +1 -1
  92. package/dist/index145.js +90 -7
  93. package/dist/index146.cjs +2 -1
  94. package/dist/index146.js +3 -22
  95. package/dist/index147.cjs +1 -1
  96. package/dist/index147.js +9 -18
  97. package/dist/index148.cjs +1 -1
  98. package/dist/index148.js +13 -43
  99. package/dist/index149.cjs +1 -1
  100. package/dist/index149.js +4 -21
  101. package/dist/index150.cjs +1 -1
  102. package/dist/index150.js +11 -79
  103. package/dist/index151.cjs +1 -1
  104. package/dist/index151.js +2 -12
  105. package/dist/index152.cjs +1 -1
  106. package/dist/index152.js +32 -14
  107. package/dist/index153.cjs +1 -1
  108. package/dist/index153.js +21 -6
  109. package/dist/index154.cjs +1 -1
  110. package/dist/index154.js +5 -41
  111. package/dist/index155.cjs +1 -1
  112. package/dist/index155.js +5 -5
  113. package/dist/index156.cjs +1 -1
  114. package/dist/index156.js +5 -33
  115. package/dist/index157.cjs +9 -1
  116. package/dist/index157.js +34 -8
  117. package/dist/index158.cjs +1 -1
  118. package/dist/index158.js +3 -61
  119. package/dist/index159.cjs +1 -1
  120. package/dist/index159.js +18 -19
  121. package/dist/index160.cjs +1 -1
  122. package/dist/index160.js +19 -105
  123. package/dist/index161.cjs +1 -1
  124. package/dist/index161.js +27 -70
  125. package/dist/index162.cjs +1 -1
  126. package/dist/index162.js +6 -7
  127. package/dist/index163.cjs +4 -1
  128. package/dist/index163.js +192 -88
  129. package/dist/index164.cjs +1 -2
  130. package/dist/index164.js +28 -3
  131. package/dist/index165.cjs +1 -1
  132. package/dist/index165.js +162 -9
  133. package/dist/index166.cjs +1 -1
  134. package/dist/index166.js +127 -13
  135. package/dist/index167.cjs +1 -1
  136. package/dist/index167.js +27 -4
  137. package/dist/index168.cjs +1 -1
  138. package/dist/index168.js +56 -2
  139. package/dist/index169.cjs +1 -1
  140. package/dist/index169.js +191 -31
  141. package/dist/index170.cjs +1 -1
  142. package/dist/index170.js +4 -22
  143. package/dist/index171.cjs +1 -1
  144. package/dist/index171.js +20 -5
  145. package/dist/index172.cjs +1 -1
  146. package/dist/index172.js +3 -6
  147. package/dist/index173.cjs +1 -1
  148. package/dist/index173.js +16 -5
  149. package/dist/index174.cjs +1 -9
  150. package/dist/index174.js +11 -35
  151. package/dist/index175.cjs +1 -1
  152. package/dist/index175.js +35 -3
  153. package/dist/index176.cjs +1 -1
  154. package/dist/index176.js +3 -19
  155. package/dist/index177.cjs +1 -1
  156. package/dist/index177.js +25 -18
  157. package/dist/index178.cjs +1 -1
  158. package/dist/index178.js +8 -35
  159. package/dist/index179.cjs +1 -1
  160. package/dist/index179.js +23 -6
  161. package/dist/index18.cjs +1 -1
  162. package/dist/index18.js +8 -8
  163. package/dist/index180.cjs +1 -4
  164. package/dist/index180.js +28 -194
  165. package/dist/index181.cjs +1 -1
  166. package/dist/index181.js +3 -27
  167. package/dist/index182.cjs +1 -1
  168. package/dist/index182.js +6 -161
  169. package/dist/index183.cjs +1 -1
  170. package/dist/index183.js +6 -127
  171. package/dist/index184.cjs +1 -1
  172. package/dist/index184.js +32 -27
  173. package/dist/index185.cjs +1 -1
  174. package/dist/index185.js +5 -192
  175. package/dist/index186.cjs +1 -1
  176. package/dist/index186.js +38 -4
  177. package/dist/index187.cjs +1 -1
  178. package/dist/index187.js +43 -14
  179. package/dist/index188.cjs +1 -1
  180. package/dist/index188.js +33 -3
  181. package/dist/index189.cjs +1 -1
  182. package/dist/index189.js +16 -15
  183. package/dist/index190.cjs +1 -1
  184. package/dist/index190.js +40 -32
  185. package/dist/index191.cjs +1 -1
  186. package/dist/index191.js +105 -3
  187. package/dist/index192.cjs +1 -1
  188. package/dist/index192.js +3 -28
  189. package/dist/index193.cjs +1 -1
  190. package/dist/index193.js +5 -25
  191. package/dist/index194.cjs +1 -1
  192. package/dist/index194.js +3 -28
  193. package/dist/index195.cjs +1 -1
  194. package/dist/index195.js +17 -6
  195. package/dist/index196.cjs +1 -1
  196. package/dist/index196.js +5 -6
  197. package/dist/index197.cjs +1 -1
  198. package/dist/index197.js +8 -32
  199. package/dist/index198.cjs +1 -1
  200. package/dist/index198.js +104 -5
  201. package/dist/index199.cjs +1 -1
  202. package/dist/index199.js +5 -37
  203. package/dist/index20.cjs +1 -1
  204. package/dist/index20.js +2 -2
  205. package/dist/index200.cjs +1 -1
  206. package/dist/index200.js +6 -49
  207. package/dist/index201.cjs +1 -1
  208. package/dist/index201.js +25 -30
  209. package/dist/index202.cjs +1 -1
  210. package/dist/index202.js +34 -17
  211. package/dist/index203.cjs +1 -1
  212. package/dist/index203.js +13 -42
  213. package/dist/index204.cjs +1 -1
  214. package/dist/index204.js +74 -100
  215. package/dist/index205.cjs +1 -1
  216. package/dist/index205.js +2 -3
  217. package/dist/index206.cjs +1 -1
  218. package/dist/index206.js +17 -4
  219. package/dist/index207.cjs +1 -1
  220. package/dist/index207.js +171 -3
  221. package/dist/index208.cjs +1 -1
  222. package/dist/index208.js +17 -17
  223. package/dist/index209.cjs +1 -1
  224. package/dist/index209.js +10 -8
  225. package/dist/index210.cjs +1 -1
  226. package/dist/index210.js +25 -5
  227. package/dist/index211.cjs +1 -1
  228. package/dist/index211.js +18 -27
  229. package/dist/index212.cjs +1 -1
  230. package/dist/index212.js +15 -78
  231. package/dist/index213.cjs +1 -1
  232. package/dist/index213.js +6 -2
  233. package/dist/index214.cjs +1 -1
  234. package/dist/index214.js +13 -18
  235. package/dist/index215.cjs +1 -1
  236. package/dist/index215.js +10 -17
  237. package/dist/index216.cjs +1 -1
  238. package/dist/index216.js +16 -10
  239. package/dist/index217.cjs +1 -1
  240. package/dist/index217.js +10 -102
  241. package/dist/index218.cjs +1 -1
  242. package/dist/index218.js +18 -15
  243. package/dist/index219.cjs +1 -1
  244. package/dist/index219.js +23 -213
  245. package/dist/index22.cjs +1 -1
  246. package/dist/index22.js +9 -9
  247. package/dist/index220.cjs +1 -1
  248. package/dist/index220.js +43 -105
  249. package/dist/index221.cjs +1 -1
  250. package/dist/index221.js +8 -205
  251. package/dist/index222.cjs +2 -1
  252. package/dist/index222.js +40 -41
  253. package/dist/index223.cjs +1 -1
  254. package/dist/index223.js +2 -79
  255. package/dist/index224.cjs +1 -1
  256. package/dist/index224.js +6 -2
  257. package/dist/index225.cjs +1 -1
  258. package/dist/index225.js +10 -24
  259. package/dist/index226.cjs +1 -1
  260. package/dist/index226.js +17 -44
  261. package/dist/index227.cjs +1 -1
  262. package/dist/index227.js +8 -9
  263. package/dist/index228.cjs +1 -2
  264. package/dist/index228.js +66 -41
  265. package/dist/index229.cjs +1 -1
  266. package/dist/index229.js +66 -2
  267. package/dist/index23.cjs +1 -1
  268. package/dist/index23.js +2 -2
  269. package/dist/index230.cjs +1 -1
  270. package/dist/index230.js +188 -5
  271. package/dist/index231.cjs +1 -1
  272. package/dist/index231.js +27 -9
  273. package/dist/index232.cjs +1 -1
  274. package/dist/index232.js +74 -17
  275. package/dist/index233.cjs +1 -1
  276. package/dist/index233.js +40 -8
  277. package/dist/index234.cjs +1 -1
  278. package/dist/index234.js +16 -66
  279. package/dist/index235.cjs +1 -1
  280. package/dist/index235.js +12 -64
  281. package/dist/index236.cjs +1 -1
  282. package/dist/index236.js +11 -188
  283. package/dist/index237.cjs +1 -1
  284. package/dist/index237.js +12 -28
  285. package/dist/index238.cjs +1 -1
  286. package/dist/index238.js +17 -74
  287. package/dist/index239.cjs +1 -1
  288. package/dist/index239.js +105 -37
  289. package/dist/index24.cjs +1 -1
  290. package/dist/index24.js +5 -5
  291. package/dist/index240.cjs +1 -1
  292. package/dist/index240.js +6 -16
  293. package/dist/index241.cjs +1 -1
  294. package/dist/index241.js +7 -14
  295. package/dist/index242.cjs +1 -1
  296. package/dist/index242.js +26 -11
  297. package/dist/index243.cjs +1 -1
  298. package/dist/index243.js +102 -11
  299. package/dist/index244.cjs +1 -1
  300. package/dist/index244.js +16 -6
  301. package/dist/index245.cjs +1 -1
  302. package/dist/index245.js +215 -7
  303. package/dist/index246.cjs +1 -1
  304. package/dist/index246.js +205 -18
  305. package/dist/index247.cjs +1 -1
  306. package/dist/index247.js +41 -25
  307. package/dist/index248.cjs +1 -1
  308. package/dist/index248.js +77 -10
  309. package/dist/index249.cjs +1 -1
  310. package/dist/index249.js +2 -20
  311. package/dist/index25.cjs +1 -1
  312. package/dist/index25.js +3 -3
  313. package/dist/index250.cjs +2 -1
  314. package/dist/index250.js +88 -654
  315. package/dist/index251.cjs +1 -1
  316. package/dist/index251.js +14 -177
  317. package/dist/index252.cjs +1 -2
  318. package/dist/index252.js +68 -91
  319. package/dist/index253.cjs +1 -1
  320. package/dist/index253.js +657 -14
  321. package/dist/index254.cjs +1 -1
  322. package/dist/index254.js +176 -67
  323. package/dist/index26.cjs +1 -1
  324. package/dist/index26.js +1 -1
  325. package/dist/index29.cjs +1 -1
  326. package/dist/index29.js +171 -13
  327. package/dist/index30.cjs +1 -1
  328. package/dist/index30.js +109 -32
  329. package/dist/index31.cjs +1 -1
  330. package/dist/index31.js +30 -32
  331. package/dist/index32.cjs +1 -1
  332. package/dist/index32.js +3 -55
  333. package/dist/index33.cjs +1 -1
  334. package/dist/index33.js +2 -46
  335. package/dist/index34.cjs +1 -1
  336. package/dist/index34.js +4 -26
  337. package/dist/index35.cjs +2 -1
  338. package/dist/index35.js +59 -6
  339. package/dist/index36.cjs +2 -1
  340. package/dist/index36.js +54 -18
  341. package/dist/index37.cjs +3 -1
  342. package/dist/index37.js +215 -15
  343. package/dist/index38.cjs +1 -1
  344. package/dist/index38.js +23 -5
  345. package/dist/index39.cjs +1 -1
  346. package/dist/index39.js +18 -13
  347. package/dist/index40.cjs +1 -1
  348. package/dist/index40.js +10 -10
  349. package/dist/index41.cjs +1 -1
  350. package/dist/index41.js +19 -11
  351. package/dist/index42.cjs +1 -1
  352. package/dist/index42.js +45 -11
  353. package/dist/index43.cjs +1 -1
  354. package/dist/index43.js +13 -3
  355. package/dist/index44.cjs +1 -1
  356. package/dist/index44.js +12 -21
  357. package/dist/index45.cjs +1 -1
  358. package/dist/index45.js +24 -8
  359. package/dist/index46.cjs +1 -1
  360. package/dist/index46.js +28 -3
  361. package/dist/index47.cjs +1 -1
  362. package/dist/index47.js +47 -16
  363. package/dist/index48.cjs +1 -1
  364. package/dist/index48.js +16 -5
  365. package/dist/index49.cjs +1 -1
  366. package/dist/index49.js +10 -170
  367. package/dist/index50.cjs +1 -1
  368. package/dist/index50.js +30 -102
  369. package/dist/index51.cjs +1 -1
  370. package/dist/index51.js +34 -169
  371. package/dist/index52.cjs +1 -1
  372. package/dist/index52.js +7 -111
  373. package/dist/index53.cjs +1 -1
  374. package/dist/index53.js +29 -30
  375. package/dist/index54.cjs +1 -1
  376. package/dist/index54.js +23 -2
  377. package/dist/index55.cjs +1 -1
  378. package/dist/index55.js +8 -4
  379. package/dist/index56.cjs +1 -2
  380. package/dist/index56.js +69 -58
  381. package/dist/index57.cjs +1 -2
  382. package/dist/index57.js +43 -51
  383. package/dist/index58.cjs +1 -3
  384. package/dist/index58.js +16 -208
  385. package/dist/index59.cjs +1 -1
  386. package/dist/index59.js +36 -22
  387. package/dist/index60.cjs +1 -1
  388. package/dist/index60.js +17 -18
  389. package/dist/index61.cjs +1 -1
  390. package/dist/index61.js +6 -10
  391. package/dist/index62.cjs +1 -1
  392. package/dist/index62.js +9 -20
  393. package/dist/index63.cjs +1 -1
  394. package/dist/index63.js +10 -10
  395. package/dist/index64.cjs +1 -1
  396. package/dist/index64.js +164 -12
  397. package/dist/index65.cjs +1 -1
  398. package/dist/index65.js +31 -23
  399. package/dist/index66.cjs +1 -1
  400. package/dist/index66.js +74 -25
  401. package/dist/index67.cjs +1 -1
  402. package/dist/index67.js +13 -47
  403. package/dist/index68.cjs +1 -1
  404. package/dist/index68.js +51 -16
  405. package/dist/index69.cjs +1 -1
  406. package/dist/index69.js +7 -11
  407. package/dist/index70.cjs +1 -1
  408. package/dist/index70.js +7 -31
  409. package/dist/index71.cjs +1 -1
  410. package/dist/index71.js +21 -36
  411. package/dist/index72.cjs +1 -1
  412. package/dist/index72.js +8 -7
  413. package/dist/index73.cjs +1 -1
  414. package/dist/index73.js +29 -27
  415. package/dist/index74.cjs +1 -1
  416. package/dist/index74.js +15 -21
  417. package/dist/index75.cjs +1 -1
  418. package/dist/index75.js +73 -7
  419. package/dist/index76.cjs +1 -1
  420. package/dist/index76.js +35 -70
  421. package/dist/index77.cjs +1 -1
  422. package/dist/index77.js +16 -46
  423. package/dist/index78.cjs +1 -1
  424. package/dist/index78.js +73 -21
  425. package/dist/index79.cjs +1 -1
  426. package/dist/index79.js +12 -37
  427. package/dist/index80.cjs +1 -1
  428. package/dist/index80.js +29 -17
  429. package/dist/index81.cjs +2 -1
  430. package/dist/index81.js +120 -6
  431. package/dist/index82.cjs +1 -1
  432. package/dist/index82.js +13 -8
  433. package/dist/index83.cjs +1 -1
  434. package/dist/index83.js +24 -13
  435. package/dist/index84.cjs +1 -1
  436. package/dist/index84.js +31 -162
  437. package/dist/index85.cjs +1 -1
  438. package/dist/index85.js +39 -72
  439. package/dist/index86.cjs +1 -1
  440. package/dist/index86.js +5 -12
  441. package/dist/index87.cjs +1 -1
  442. package/dist/index87.js +102 -50
  443. package/dist/index88.cjs +1 -1
  444. package/dist/index88.js +37 -7
  445. package/dist/index89.cjs +1 -1
  446. package/dist/index89.js +8 -7
  447. package/dist/index90.cjs +1 -1
  448. package/dist/index90.js +20 -21
  449. package/dist/index91.cjs +1 -1
  450. package/dist/index91.js +2 -9
  451. package/dist/index92.cjs +1 -1
  452. package/dist/index92.js +75 -31
  453. package/dist/index93.cjs +1 -1
  454. package/dist/index93.js +15 -16
  455. package/dist/index94.cjs +1 -1
  456. package/dist/index94.js +150 -72
  457. package/dist/index95.cjs +20 -1
  458. package/dist/index95.js +326 -35
  459. package/dist/index96.cjs +3 -1
  460. package/dist/index96.js +451 -16
  461. package/dist/index97.cjs +1 -1
  462. package/dist/index97.js +70 -72
  463. package/dist/index98.cjs +1 -1
  464. package/dist/index98.js +16 -12
  465. package/dist/index99.cjs +1 -1
  466. package/dist/index99.js +10 -29
  467. package/package.json +1 -1
package/dist/index106.js CHANGED
@@ -1,106 +1,93 @@
1
- import { BlockNotFoundError as M } from "./index89.js";
2
- import { WaitForTransactionReceiptTimeoutError as O, TransactionNotFoundError as W, TransactionReceiptNotFoundError as q } from "./index100.js";
3
- import { getAction as u } from "./index75.js";
4
- import { observe as z } from "./index107.js";
5
- import { withResolvers as G } from "./index108.js";
6
- import { withRetry as B } from "./index109.js";
7
- import { stringify as H } from "./index110.js";
8
- import { getBlock as J } from "./index80.js";
9
- import { getTransaction as K } from "./index99.js";
10
- import { getTransactionReceipt as y } from "./index20.js";
11
- import { watchBlockNumber as L } from "./index111.js";
12
- async function er(t, b) {
13
- const {
14
- checkReplacement: F = !0,
15
- confirmations: a = 1,
16
- hash: m,
17
- onReplaced: I,
18
- retryCount: N = 6,
19
- retryDelay: R = ({ count: e }) => ~~(1 << e) * 200,
20
- // exponential backoff
21
- timeout: h = 18e4
22
- } = b, E = H(["waitForTransactionReceipt", t.uid, m]), j = (() => {
23
- var e;
24
- return b.pollingInterval ? b.pollingInterval : (e = t.chain) != null && e.experimental_preconfirmationTime ? t.chain.experimental_preconfirmationTime : t.pollingInterval;
25
- })();
26
- let l, i, r, s = !1, o, c;
27
- const { promise: x, resolve: A, reject: v } = G(), w = h ? setTimeout(() => {
28
- c == null || c(), o == null || o(), v(new O({ hash: m }));
29
- }, h) : void 0;
30
- return o = z(E, { onReplaced: I, resolve: A, reject: v }, async (e) => {
31
- if (r = await u(t, y, "getTransactionReceipt")({ hash: m }).catch(() => {
32
- }), r && a <= 1) {
33
- clearTimeout(w), e.resolve(r), o == null || o();
34
- return;
35
- }
36
- c = u(t, L, "watchBlockNumber")({
37
- emitMissed: !0,
38
- emitOnBegin: !0,
39
- poll: !0,
40
- pollingInterval: j,
41
- async onBlockNumber(C) {
42
- const p = (T) => {
43
- clearTimeout(w), c == null || c(), T(), o == null || o();
44
- };
45
- let d = C;
46
- if (!s)
47
- try {
48
- if (r) {
49
- if (a > 1 && (!r.blockNumber || d - r.blockNumber + 1n < a))
50
- return;
51
- p(() => e.resolve(r));
52
- return;
53
- }
54
- if (F && !l && (s = !0, await B(async () => {
55
- l = await u(t, K, "getTransaction")({ hash: m }), l.blockNumber && (d = l.blockNumber);
56
- }, {
57
- delay: R,
58
- retryCount: N
59
- }), s = !1), r = await u(t, y, "getTransactionReceipt")({ hash: m }), a > 1 && (!r.blockNumber || d - r.blockNumber + 1n < a))
60
- return;
61
- p(() => e.resolve(r));
62
- } catch (T) {
63
- if (T instanceof W || T instanceof q) {
64
- if (!l) {
65
- s = !1;
66
- return;
67
- }
68
- try {
69
- i = l, s = !0;
70
- const k = await B(() => u(t, J, "getBlock")({
71
- blockNumber: d,
72
- includeTransactions: !0
73
- }), {
74
- delay: R,
75
- retryCount: N,
76
- shouldRetry: ({ error: f }) => f instanceof M
77
- });
78
- s = !1;
79
- const n = k.transactions.find(({ from: f, nonce: D }) => f === i.from && D === i.nonce);
80
- if (!n || (r = await u(t, y, "getTransactionReceipt")({
81
- hash: n.hash
82
- }), a > 1 && (!r.blockNumber || d - r.blockNumber + 1n < a)))
83
- return;
84
- let g = "replaced";
85
- n.to === i.to && n.value === i.value && n.input === i.input ? g = "repriced" : n.from === n.to && n.value === 0n && (g = "cancelled"), p(() => {
86
- var f;
87
- (f = e.onReplaced) == null || f.call(e, {
88
- reason: g,
89
- replacedTransaction: i,
90
- transaction: n,
91
- transactionReceipt: r
92
- }), e.resolve(r);
93
- });
94
- } catch (k) {
95
- p(() => e.reject(k));
96
- }
97
- } else
98
- p(() => e.reject(T));
99
- }
1
+ import { parseAccount as E } from "./index32.js";
2
+ import { BaseError as w } from "./index35.js";
3
+ import { UnsupportedNonOptionalCapabilityError as L, AtomicityNotSupportedError as N } from "./index96.js";
4
+ import { encodeFunctionData as T } from "./index40.js";
5
+ import { concat as g } from "./index120.js";
6
+ import { hexToBigInt as k } from "./index65.js";
7
+ import { numberToHex as c } from "./index42.js";
8
+ import { getTransactionError as _ } from "./index67.js";
9
+ import { sendTransaction as S } from "./index100.js";
10
+ const q = "0x5792579257925792579257925792579257925792579257925792579257925792", A = c(0, {
11
+ size: 32
12
+ });
13
+ async function P(i, s) {
14
+ const { account: f = i.account, capabilities: l, chain: d = i.chain, experimental_fallback: b, experimental_fallbackDelay: m = 32, forceAtomic: h = !1, id: C, version: v = "2.0.0" } = s, r = f ? E(f) : null, u = s.calls.map((t) => {
15
+ const e = t, a = e.abi ? T({
16
+ abi: e.abi,
17
+ functionName: e.functionName,
18
+ args: e.args
19
+ }) : e.data;
20
+ return {
21
+ data: e.dataSuffix && a ? g([a, e.dataSuffix]) : a,
22
+ to: e.to,
23
+ value: e.value ? c(e.value) : void 0
24
+ };
25
+ });
26
+ try {
27
+ const t = await i.request({
28
+ method: "wallet_sendCalls",
29
+ params: [
30
+ {
31
+ atomicRequired: h,
32
+ calls: u,
33
+ capabilities: l,
34
+ chainId: c(d.id),
35
+ from: r == null ? void 0 : r.address,
36
+ id: C,
37
+ version: v
38
+ }
39
+ ]
40
+ }, { retryCount: 0 });
41
+ return typeof t == "string" ? { id: t } : t;
42
+ } catch (t) {
43
+ const e = t;
44
+ if (b && (e.name === "MethodNotFoundRpcError" || e.name === "MethodNotSupportedRpcError" || e.name === "UnknownRpcError" || e.details.toLowerCase().includes("does not exist / is not available") || e.details.toLowerCase().includes("missing or invalid. request()") || e.details.toLowerCase().includes("did not match any variant of untagged enum") || e.details.toLowerCase().includes("account upgraded to unsupported contract") || e.details.toLowerCase().includes("eip-7702 not supported") || e.details.toLowerCase().includes("unsupported wc_ method") || // magic.link
45
+ e.details.toLowerCase().includes("feature toggled misconfigured") || // Trust Wallet
46
+ e.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))) {
47
+ if (l && Object.values(l).some((n) => !n.optional)) {
48
+ const n = "non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";
49
+ throw new L(new w(n, {
50
+ details: n
51
+ }));
52
+ }
53
+ if (h && u.length > 1) {
54
+ const o = "`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";
55
+ throw new N(new w(o, {
56
+ details: o
57
+ }));
100
58
  }
59
+ const a = [];
60
+ for (const o of u) {
61
+ const n = S(i, {
62
+ account: r,
63
+ chain: d,
64
+ data: o.data,
65
+ to: o.to,
66
+ value: o.value ? k(o.value) : void 0
67
+ });
68
+ a.push(n), m > 0 && await new Promise((x) => setTimeout(x, m));
69
+ }
70
+ const p = await Promise.allSettled(a);
71
+ if (p.every((o) => o.status === "rejected"))
72
+ throw p[0].reason;
73
+ const y = p.map((o) => o.status === "fulfilled" ? o.value : A);
74
+ return {
75
+ id: g([
76
+ ...y,
77
+ c(d.id, { size: 32 }),
78
+ q
79
+ ])
80
+ };
81
+ }
82
+ throw _(t, {
83
+ ...s,
84
+ account: r,
85
+ chain: s.chain
101
86
  });
102
- }), x;
87
+ }
103
88
  }
104
89
  export {
105
- er as waitForTransactionReceipt
90
+ q as fallbackMagicIdentifier,
91
+ A as fallbackTransactionErrorMagicIdentifier,
92
+ P as sendCalls
106
93
  };
package/dist/index107.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=new Map,r=new Map;let b=0;function w(s,a,C){const o=++b,c=()=>i.get(s)||[],m=()=>{const t=c();i.set(s,t.filter(n=>n.id!==o))},f=()=>{const t=c();if(!t.some(e=>e.id===o))return;const n=r.get(s);if(t.length===1&&n){const e=n();e instanceof Promise&&e.catch(()=>{})}m()},l=c();if(i.set(s,[...l,{id:o,fns:a}]),l&&l.length>0)return f;const u={};for(const t in a)u[t]=(...n)=>{var p,g;const e=c();if(e.length!==0)for(const y of e)(g=(p=y.fns)[t])==null||g.call(p,...n)};const h=C(u);return typeof h=="function"&&r.set(s,h),f}exports.cleanupCache=r;exports.listenersCache=i;exports.observe=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index32.cjs"),p=require("./index42.cjs");async function f(s,c={}){const{account:n=s.account,chainId:t}=c,e=n?l.parseAccount(n):void 0,o=t?[e==null?void 0:e.address,[p.numberToHex(t)]]:[e==null?void 0:e.address],u=await s.request({method:"wallet_getCapabilities",params:o}),a={};for(const[r,b]of Object.entries(u)){a[Number(r)]={};for(let[i,d]of Object.entries(b))i==="addSubAccount"&&(i="unstable_addSubAccount"),a[Number(r)][i]=d}return typeof t=="number"?a[t]:a}exports.getCapabilities=f;
package/dist/index107.js CHANGED
@@ -1,40 +1,17 @@
1
- const f = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
2
- let k = 0;
3
- function y(s, l, m) {
4
- const i = ++k, c = () => f.get(s) || [], w = () => {
5
- const n = c();
6
- f.set(s, n.filter((e) => e.id !== i));
7
- }, r = () => {
8
- const n = c();
9
- if (!n.some((t) => t.id === i))
10
- return;
11
- const e = g.get(s);
12
- if (n.length === 1 && e) {
13
- const t = e();
14
- t instanceof Promise && t.catch(() => {
15
- });
16
- }
17
- w();
18
- }, o = c();
19
- if (f.set(s, [
20
- ...o,
21
- { id: i, fns: l }
22
- ]), o && o.length > 0)
23
- return r;
24
- const u = {};
25
- for (const n in l)
26
- u[n] = (...e) => {
27
- var p, h;
28
- const t = c();
29
- if (t.length !== 0)
30
- for (const C of t)
31
- (h = (p = C.fns)[n]) == null || h.call(p, ...e);
32
- };
33
- const a = m(u);
34
- return typeof a == "function" && g.set(s, a), r;
1
+ import { parseAccount as p } from "./index32.js";
2
+ import { numberToHex as f } from "./index42.js";
3
+ async function h(s, n = {}) {
4
+ const { account: o = s.account, chainId: t } = n, e = o ? p(o) : void 0, c = t ? [e == null ? void 0 : e.address, [f(t)]] : [e == null ? void 0 : e.address], b = await s.request({
5
+ method: "wallet_getCapabilities",
6
+ params: c
7
+ }), a = {};
8
+ for (const [r, u] of Object.entries(b)) {
9
+ a[Number(r)] = {};
10
+ for (let [i, d] of Object.entries(u))
11
+ i === "addSubAccount" && (i = "unstable_addSubAccount"), a[Number(r)][i] = d;
12
+ }
13
+ return typeof t == "number" ? a[t] : a;
35
14
  }
36
15
  export {
37
- g as cleanupCache,
38
- f as listenersCache,
39
- y as observe
16
+ h as getCapabilities
40
17
  };
package/dist/index108.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}exports.withResolvers=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function s(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}exports.getPermissions=s;
package/dist/index108.js CHANGED
@@ -1,11 +1,6 @@
1
- function i() {
2
- let e = () => {
3
- }, n = () => {
4
- };
5
- return { promise: new Promise((r, o) => {
6
- e = r, n = o;
7
- }), resolve: e, reject: n };
1
+ async function t(e) {
2
+ return await e.request({ method: "wallet_getPermissions" }, { dedupe: !0 });
8
3
  }
9
4
  export {
10
- i as withResolvers
5
+ t as getPermissions
11
6
  };
package/dist/index109.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index207.cjs");function f(n,{delay:e=100,retryCount:o=2,shouldRetry:c=()=>!0}={}){return new Promise((s,y)=>{const a=async({count:r=0}={})=>{const w=async({error:t})=>{const i=typeof e=="function"?e({count:r,error:t}):e;i&&await u.wait(i),a({count:r+1})};try{const t=await n();s(t)}catch(t){if(r<o&&await c({count:r,error:t}))return w({error:t});y(t)}};a()})}exports.withRetry=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index32.cjs"),f=require("./index110.cjs"),g=require("./index111.cjs"),s=require("./index55.cjs"),h=require("./index69.cjs"),A=require("./index82.cjs");async function p(o,n){var i;const{account:c=o.account,chainId:u,nonce:a}=n;if(!c)throw new f.AccountNotFoundError({docsPath:"/docs/eip7702/prepareAuthorization"});const r=d.parseAccount(c),t=(()=>{if(n.executor)return n.executor==="self"?n.executor:d.parseAccount(n.executor)})(),e={address:n.contractAddress??n.address,chainId:u,nonce:a};return typeof e.chainId>"u"&&(e.chainId=((i=o.chain)==null?void 0:i.id)??await s.getAction(o,h.getChainId,"getChainId")({})),typeof e.nonce>"u"&&(e.nonce=await s.getAction(o,A.getTransactionCount,"getTransactionCount")({address:r.address,blockTag:"pending"}),(t==="self"||t!=null&&t.address&&g.isAddressEqual(t.address,r.address))&&(e.nonce+=1)),e}exports.prepareAuthorization=p;
package/dist/index109.js CHANGED
@@ -1,23 +1,29 @@
1
- import { wait as w } from "./index207.js";
2
- function p(n, { delay: e = 100, retryCount: o = 2, shouldRetry: c = () => !0 } = {}) {
3
- return new Promise((s, y) => {
4
- const a = async ({ count: r = 0 } = {}) => {
5
- const f = async ({ error: t }) => {
6
- const i = typeof e == "function" ? e({ count: r, error: t }) : e;
7
- i && await w(i), a({ count: r + 1 });
8
- };
9
- try {
10
- const t = await n();
11
- s(t);
12
- } catch (t) {
13
- if (r < o && await c({ count: r, error: t }))
14
- return f({ error: t });
15
- y(t);
16
- }
17
- };
18
- a();
19
- });
1
+ import { parseAccount as e } from "./index32.js";
2
+ import { AccountNotFoundError as f } from "./index110.js";
3
+ import { isAddressEqual as h } from "./index111.js";
4
+ import { getAction as a } from "./index55.js";
5
+ import { getChainId as p } from "./index69.js";
6
+ import { getTransactionCount as g } from "./index82.js";
7
+ async function y(r, o) {
8
+ var i;
9
+ const { account: c = r.account, chainId: s, nonce: u } = o;
10
+ if (!c)
11
+ throw new f({
12
+ docsPath: "/docs/eip7702/prepareAuthorization"
13
+ });
14
+ const d = e(c), t = (() => {
15
+ if (o.executor)
16
+ return o.executor === "self" ? o.executor : e(o.executor);
17
+ })(), n = {
18
+ address: o.contractAddress ?? o.address,
19
+ chainId: s,
20
+ nonce: u
21
+ };
22
+ return typeof n.chainId > "u" && (n.chainId = ((i = r.chain) == null ? void 0 : i.id) ?? await a(r, p, "getChainId")({})), typeof n.nonce > "u" && (n.nonce = await a(r, g, "getTransactionCount")({
23
+ address: d.address,
24
+ blockTag: "pending"
25
+ }), (t === "self" || t != null && t.address && h(t.address, d.address)) && (n.nonce += 1)), n;
20
26
  }
21
27
  export {
22
- p as withRetry
28
+ y as prepareAuthorization
23
29
  };
package/dist/index110.cjs CHANGED
@@ -1 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=(e,n,i)=>JSON.stringify(e,(o,t)=>typeof t=="bigint"?t.toString():t,i);exports.stringify=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index35.cjs");class c extends t.BaseError{constructor({docsPath:o}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
2
+ `),{docsPath:o,docsSlug:"account",name:"AccountNotFoundError"})}}class u extends t.BaseError{constructor({docsPath:o,metaMessages:e,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:o,metaMessages:e,name:"AccountTypeNotSupportedError"})}}exports.AccountNotFoundError=c;exports.AccountTypeNotSupportedError=u;
package/dist/index110.js CHANGED
@@ -1,4 +1,27 @@
1
- const g = (r, n, i) => JSON.stringify(r, (e, t) => typeof t == "bigint" ? t.toString() : t, i);
1
+ import { BaseError as t } from "./index35.js";
2
+ class u extends t {
3
+ constructor({ docsPath: o } = {}) {
4
+ super([
5
+ "Could not find an Account to execute with this Action.",
6
+ "Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."
7
+ ].join(`
8
+ `), {
9
+ docsPath: o,
10
+ docsSlug: "account",
11
+ name: "AccountNotFoundError"
12
+ });
13
+ }
14
+ }
15
+ class s extends t {
16
+ constructor({ docsPath: o, metaMessages: c, type: r }) {
17
+ super(`Account type "${r}" is not supported.`, {
18
+ docsPath: o,
19
+ metaMessages: c,
20
+ name: "AccountTypeNotSupportedError"
21
+ });
22
+ }
23
+ }
2
24
  export {
3
- g as stringify
25
+ u as AccountNotFoundError,
26
+ s as AccountTypeNotSupportedError
4
27
  };
package/dist/index111.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index31.cjs"),w=require("./index75.cjs"),N=require("./index107.cjs"),h=require("./index112.cjs"),g=require("./index110.cjs"),m=require("./index91.cjs");function q(r,{emitOnBegin:b=!1,emitMissed:f=!1,onBlockNumber:p,onError:a,poll:i,pollingInterval:k=r.pollingInterval}){const B=typeof i<"u"?i:!(r.transport.type==="webSocket"||r.transport.type==="ipc"||r.transport.type==="fallback"&&(r.transport.transports[0].config.type==="webSocket"||r.transport.transports[0].config.type==="ipc"));let e;return B?(()=>{const l=g.stringify(["watchBlockNumber",r.uid,b,f,k]);return N.observe(l,{onBlockNumber:p,onError:a},o=>h.poll(async()=>{var u;try{const t=await w.getAction(r,m.getBlockNumber,"getBlockNumber")({cacheTime:0});if(e!==void 0){if(t===e)return;if(t-e>1&&f)for(let s=e+1n;s<t;s++)o.onBlockNumber(s,e),e=s}(e===void 0||t>e)&&(o.onBlockNumber(t,e),e=t)}catch(t){(u=o.onError)==null||u.call(o,t)}},{emitOnBegin:b,interval:k}))})():(()=>{const l=g.stringify(["watchBlockNumber",r.uid,b,f]);return N.observe(l,{onBlockNumber:p,onError:a},o=>{let u=!0,t=()=>u=!1;return(async()=>{try{const s=(()=>{if(r.transport.type==="fallback"){const c=r.transport.transports.find(n=>n.config.type==="webSocket"||n.config.type==="ipc");return c?c.value:r.transport}return r.transport})(),{unsubscribe:d}=await s.subscribe({params:["newHeads"],onData(c){var y;if(!u)return;const n=v.hexToBigInt((y=c.result)==null?void 0:y.number);o.onBlockNumber(n,e),e=n},onError(c){var n;(n=o.onError)==null||n.call(o,c)}});t=d,u||t()}catch(s){a==null||a(s)}})(),()=>t()})})()}exports.watchBlockNumber=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index150.cjs"),d=require("./index174.cjs");function t(s,r){if(!d.isAddress(s,{strict:!1}))throw new e.InvalidAddressError({address:s});if(!d.isAddress(r,{strict:!1}))throw new e.InvalidAddressError({address:r});return s.toLowerCase()===r.toLowerCase()}exports.isAddressEqual=t;
package/dist/index111.js CHANGED
@@ -1,78 +1,12 @@
1
- import { hexToBigInt as w } from "./index31.js";
2
- import { getAction as g } from "./index75.js";
3
- import { observe as y } from "./index107.js";
4
- import { poll as h } from "./index112.js";
5
- import { stringify as N } from "./index110.js";
6
- import { getBlockNumber as v } from "./index91.js";
7
- function j(r, { emitOnBegin: b = !1, emitMissed: p = !1, onBlockNumber: l, onError: a, poll: k, pollingInterval: i = r.pollingInterval }) {
8
- const B = typeof k < "u" ? k : !(r.transport.type === "webSocket" || r.transport.type === "ipc" || r.transport.type === "fallback" && (r.transport.transports[0].config.type === "webSocket" || r.transport.transports[0].config.type === "ipc"));
9
- let t;
10
- return B ? (() => {
11
- const f = N([
12
- "watchBlockNumber",
13
- r.uid,
14
- b,
15
- p,
16
- i
17
- ]);
18
- return y(f, { onBlockNumber: l, onError: a }, (e) => h(async () => {
19
- var u;
20
- try {
21
- const o = await g(r, v, "getBlockNumber")({ cacheTime: 0 });
22
- if (t !== void 0) {
23
- if (o === t)
24
- return;
25
- if (o - t > 1 && p)
26
- for (let s = t + 1n; s < o; s++)
27
- e.onBlockNumber(s, t), t = s;
28
- }
29
- (t === void 0 || o > t) && (e.onBlockNumber(o, t), t = o);
30
- } catch (o) {
31
- (u = e.onError) == null || u.call(e, o);
32
- }
33
- }, {
34
- emitOnBegin: b,
35
- interval: i
36
- }));
37
- })() : (() => {
38
- const f = N([
39
- "watchBlockNumber",
40
- r.uid,
41
- b,
42
- p
43
- ]);
44
- return y(f, { onBlockNumber: l, onError: a }, (e) => {
45
- let u = !0, o = () => u = !1;
46
- return (async () => {
47
- try {
48
- const s = (() => {
49
- if (r.transport.type === "fallback") {
50
- const c = r.transport.transports.find((n) => n.config.type === "webSocket" || n.config.type === "ipc");
51
- return c ? c.value : r.transport;
52
- }
53
- return r.transport;
54
- })(), { unsubscribe: d } = await s.subscribe({
55
- params: ["newHeads"],
56
- onData(c) {
57
- var m;
58
- if (!u)
59
- return;
60
- const n = w((m = c.result) == null ? void 0 : m.number);
61
- e.onBlockNumber(n, t), t = n;
62
- },
63
- onError(c) {
64
- var n;
65
- (n = e.onError) == null || n.call(e, c);
66
- }
67
- });
68
- o = d, u || o();
69
- } catch (s) {
70
- a == null || a(s);
71
- }
72
- })(), () => o();
73
- });
74
- })();
1
+ import { InvalidAddressError as e } from "./index150.js";
2
+ import { isAddress as o } from "./index174.js";
3
+ function i(r, s) {
4
+ if (!o(r, { strict: !1 }))
5
+ throw new e({ address: r });
6
+ if (!o(s, { strict: !1 }))
7
+ throw new e({ address: s });
8
+ return r.toLowerCase() === s.toLowerCase();
75
9
  }
76
10
  export {
77
- j as watchBlockNumber
11
+ i as isAddressEqual
78
12
  };
package/dist/index112.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index207.cjs");function s(o,{emitOnBegin:w,initialWaitTime:t,interval:c}){let l=!0;const a=()=>l=!1;return(async()=>{let e;w&&(e=await o({unpoll:a}));const r=await(t==null?void 0:t(e))??c;await u.wait(r);const n=async()=>{l&&(await o({unpoll:a}),await u.wait(c),n())};n()})(),a}exports.poll=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index168.cjs"),l=require("./index42.cjs");function c(o){const{kzg:s}=o,n=o.to??(typeof o.blobs[0]=="string"?"hex":"bytes"),e=typeof o.blobs[0]=="string"?o.blobs.map(t=>i.hexToBytes(t)):o.blobs,b=[];for(const t of e)b.push(Uint8Array.from(s.blobToKzgCommitment(t)));return n==="bytes"?b:b.map(t=>l.bytesToHex(t))}exports.blobsToCommitments=c;
package/dist/index112.js CHANGED
@@ -1,18 +1,11 @@
1
- import { wait as r } from "./index207.js";
2
- function e(o, { emitOnBegin: s, initialWaitTime: t, interval: c }) {
3
- let w = !0;
4
- const a = () => w = !1;
5
- return (async () => {
6
- let n;
7
- s && (n = await o({ unpoll: a }));
8
- const u = await (t == null ? void 0 : t(n)) ?? c;
9
- await r(u);
10
- const l = async () => {
11
- w && (await o({ unpoll: a }), await r(c), l());
12
- };
13
- l();
14
- })(), a;
1
+ import { hexToBytes as i } from "./index168.js";
2
+ import { bytesToHex as f } from "./index42.js";
3
+ function y(o) {
4
+ const { kzg: s } = o, n = o.to ?? (typeof o.blobs[0] == "string" ? "hex" : "bytes"), m = typeof o.blobs[0] == "string" ? o.blobs.map((t) => i(t)) : o.blobs, b = [];
5
+ for (const t of m)
6
+ b.push(Uint8Array.from(s.blobToKzgCommitment(t)));
7
+ return n === "bytes" ? b : b.map((t) => f(t));
15
8
  }
16
9
  export {
17
- e as poll
10
+ y as blobsToCommitments
18
11
  };
package/dist/index113.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index114.cjs"),M=require("./index115.cjs"),P=require("./index116.cjs"),_=require("./index71.cjs"),I=require("./index98.cjs"),b=require("./index75.cjs"),A=require("./index107.cjs"),O=require("./index112.cjs"),S=require("./index110.cjs"),$=require("./index70.cjs"),j=require("./index91.cjs"),z=require("./index93.cjs"),R=require("./index96.cjs"),U=require("./index105.cjs");function G(t,D){const{abi:v,address:l,args:u,batch:C=!0,eventName:c,fromBlock:g,onError:f,onLogs:k,poll:L,pollingInterval:h=t.pollingInterval,strict:d}=D;return(typeof L<"u"?L:typeof g=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].config.type==="webSocket"||t.transport.transports[0].config.type==="ipc")))?(()=>{const p=d??!1,q=S.stringify(["watchContractEvent",l,u,C,t.uid,c,h,p,g]);return A.observe(q,{onLogs:k,onError:f},o=>{let s;g!==void 0&&(s=g-1n);let n,a=!1;const w=O.poll(async()=>{var y;if(!a){try{n=await b.getAction(t,$.createContractEventFilter,"createContractEventFilter")({abi:v,address:l,args:u,eventName:c,strict:p,fromBlock:g})}catch{}a=!0;return}try{let e;if(n)e=await b.getAction(t,R.getFilterChanges,"getFilterChanges")({filter:n});else{const r=await b.getAction(t,j.getBlockNumber,"getBlockNumber")({});s&&s<r?e=await b.getAction(t,z.getContractEvents,"getContractEvents")({abi:v,address:l,args:u,eventName:c,fromBlock:s+1n,toBlock:r,strict:p}):e=[],s=r}if(e.length===0)return;if(C)o.onLogs(e);else for(const r of e)o.onLogs([r])}catch(e){n&&e instanceof M.InvalidInputRpcError&&(a=!1),(y=o.onError)==null||y.call(o,e)}},{emitOnBegin:!0,interval:h});return async()=>{n&&await b.getAction(t,U.uninstallFilter,"uninstallFilter")({filter:n}),w()}})})():(()=>{const p=d??!1,q=S.stringify(["watchContractEvent",l,u,C,t.uid,c,h,p]);let o=!0,s=()=>o=!1;return A.observe(q,{onLogs:k,onError:f},n=>((async()=>{try{const a=(()=>{if(t.transport.type==="fallback"){const e=t.transport.transports.find(r=>r.config.type==="webSocket"||r.config.type==="ipc");return e?e.value:t.transport}return t.transport})(),w=c?_.encodeEventTopics({abi:v,eventName:c,args:u}):[],{unsubscribe:y}=await a.subscribe({params:["logs",{address:l,topics:w}],onData(e){var N;if(!o)return;const r=e.result;try{const{eventName:i,args:E}=P.decodeEventLog({abi:v,data:r.data,topics:r.topics,strict:d}),m=I.formatLog(r,{args:E,eventName:i});n.onLogs([m])}catch(i){let E,m;if(i instanceof B.DecodeLogDataMismatch||i instanceof B.DecodeLogTopicsMismatch){if(d)return;E=i.abiItem.name,m=(N=i.abiItem.inputs)==null?void 0:N.some(F=>!("name"in F&&F.name))}const T=I.formatLog(r,{args:m?[]:{},eventName:E});n.onLogs([T])}},onError(e){var r;(r=n.onError)==null||r.call(n,e)}});s=y,o||s()}catch(a){f==null||f(a)}})(),()=>s()))})()}exports.watchContractEvent=G;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index168.cjs"),y=require("./index42.cjs");function f(t){const{kzg:c}=t,e=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(o=>b.hexToBytes(o)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(o=>b.hexToBytes(o)):t.commitments,s=[];for(let o=0;o<n.length;o++){const l=n[o],m=i[o];s.push(Uint8Array.from(c.computeBlobKzgProof(l,m)))}return e==="bytes"?s:s.map(o=>y.bytesToHex(o))}exports.blobsToProofs=f;