@gardenfi/swap 0.1.0 → 0.1.1

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 (448) hide show
  1. package/dist/index102.cjs +1 -1
  2. package/dist/index102.js +2 -2
  3. package/dist/index103.cjs +1 -1
  4. package/dist/index103.js +2 -2
  5. package/dist/index104.cjs +1 -1
  6. package/dist/index104.js +6 -6
  7. package/dist/index105.cjs +1 -1
  8. package/dist/index105.js +2 -2
  9. package/dist/index109.cjs +1 -1
  10. package/dist/index109.js +41 -34
  11. package/dist/index110.cjs +1 -1
  12. package/dist/index110.js +33 -3
  13. package/dist/index111.cjs +1 -1
  14. package/dist/index111.js +3 -9
  15. package/dist/index112.cjs +1 -1
  16. package/dist/index112.js +9 -116
  17. package/dist/index113.cjs +1 -1
  18. package/dist/index113.js +116 -61
  19. package/dist/index114.cjs +1 -1
  20. package/dist/index114.js +57 -20
  21. package/dist/index115.cjs +1 -1
  22. package/dist/index115.js +22 -34
  23. package/dist/index116.cjs +1 -1
  24. package/dist/index116.js +33 -38
  25. package/dist/index117.cjs +1 -1
  26. package/dist/index117.js +38 -55
  27. package/dist/index118.cjs +1 -1
  28. package/dist/index118.js +55 -37
  29. package/dist/index119.cjs +1 -1
  30. package/dist/index119.js +40 -9
  31. package/dist/index120.cjs +1 -1
  32. package/dist/index120.js +8 -30
  33. package/dist/index121.cjs +1 -1
  34. package/dist/index121.js +21 -26
  35. package/dist/index122.cjs +1 -1
  36. package/dist/index122.js +35 -8
  37. package/dist/index123.cjs +1 -1
  38. package/dist/index123.js +8 -28
  39. package/dist/index124.cjs +1 -1
  40. package/dist/index124.js +27 -48
  41. package/dist/index125.cjs +1 -1
  42. package/dist/index125.js +47 -67
  43. package/dist/index126.cjs +1 -1
  44. package/dist/index126.js +67 -38
  45. package/dist/index127.cjs +1 -1
  46. package/dist/index127.js +38 -74
  47. package/dist/index128.cjs +1 -1
  48. package/dist/index128.js +77 -8
  49. package/dist/index129.cjs +1 -1
  50. package/dist/index129.js +7 -5
  51. package/dist/index130.cjs +1 -1
  52. package/dist/index130.js +6 -17
  53. package/dist/index131.cjs +1 -1
  54. package/dist/index131.js +17 -8
  55. package/dist/index132.cjs +1 -1
  56. package/dist/index132.js +8 -13
  57. package/dist/index133.cjs +1 -1
  58. package/dist/index133.js +13 -7
  59. package/dist/index134.cjs +1 -1
  60. package/dist/index134.js +7 -16
  61. package/dist/index135.cjs +1 -1
  62. package/dist/index135.js +16 -46
  63. package/dist/index136.cjs +1 -1
  64. package/dist/index136.js +46 -13
  65. package/dist/index137.cjs +1 -1
  66. package/dist/index137.js +13 -16
  67. package/dist/index138.cjs +1 -1
  68. package/dist/index138.js +14 -11
  69. package/dist/index139.cjs +1 -1
  70. package/dist/index139.js +13 -6
  71. package/dist/index140.cjs +1 -1
  72. package/dist/index140.js +5 -34
  73. package/dist/index141.cjs +1 -1
  74. package/dist/index141.js +34 -8
  75. package/dist/index142.cjs +1 -1
  76. package/dist/index142.js +8 -7
  77. package/dist/index143.cjs +1 -1
  78. package/dist/index143.js +8 -29
  79. package/dist/index144.cjs +1 -1
  80. package/dist/index144.js +29 -10
  81. package/dist/index145.cjs +1 -1
  82. package/dist/index145.js +10 -14
  83. package/dist/index146.cjs +1 -1
  84. package/dist/index146.js +14 -12
  85. package/dist/index147.cjs +1 -1
  86. package/dist/index147.js +12 -121
  87. package/dist/index148.cjs +1 -1
  88. package/dist/index148.js +118 -79
  89. package/dist/index149.cjs +1 -1
  90. package/dist/index149.js +81 -176
  91. package/dist/index150.cjs +1 -1
  92. package/dist/index150.js +174 -41
  93. package/dist/index151.cjs +1 -1
  94. package/dist/index151.js +44 -6
  95. package/dist/index152.cjs +1 -1
  96. package/dist/index152.js +5 -13
  97. package/dist/index153.cjs +1 -1
  98. package/dist/index153.js +12 -12
  99. package/dist/index154.cjs +1 -1
  100. package/dist/index154.js +14 -103
  101. package/dist/index155.cjs +1 -1
  102. package/dist/index155.js +100 -72
  103. package/dist/index156.cjs +1 -1
  104. package/dist/index156.js +64 -78
  105. package/dist/index157.cjs +1 -1
  106. package/dist/index157.js +76 -138
  107. package/dist/index158.cjs +1 -1
  108. package/dist/index158.js +115 -102
  109. package/dist/index159.cjs +1 -1
  110. package/dist/index159.js +116 -47
  111. package/dist/index160.cjs +1 -1
  112. package/dist/index160.js +69 -23
  113. package/dist/index161.cjs +1 -1
  114. package/dist/index161.js +23 -164
  115. package/dist/index162.cjs +1 -1
  116. package/dist/index162.js +164 -6
  117. package/dist/index163.cjs +1 -1
  118. package/dist/index163.js +6 -13
  119. package/dist/index164.cjs +1 -1
  120. package/dist/index164.js +13 -19
  121. package/dist/index165.cjs +1 -1
  122. package/dist/index165.js +18 -105
  123. package/dist/index166.cjs +1 -1
  124. package/dist/index166.js +105 -77
  125. package/dist/index167.cjs +1 -1
  126. package/dist/index167.js +77 -8
  127. package/dist/index168.cjs +1 -1
  128. package/dist/index168.js +8 -27
  129. package/dist/index169.cjs +1 -1
  130. package/dist/index169.js +25 -87
  131. package/dist/index170.cjs +1 -1
  132. package/dist/index170.js +91 -3
  133. package/dist/index171.cjs +1 -1
  134. package/dist/index171.js +3 -2
  135. package/dist/index172.cjs +1 -2
  136. package/dist/index172.js +2 -3
  137. package/dist/index173.cjs +2 -1
  138. package/dist/index173.js +3 -9
  139. package/dist/index174.cjs +1 -20
  140. package/dist/index174.js +9 -327
  141. package/dist/index175.cjs +20 -1
  142. package/dist/index175.js +324 -11
  143. package/dist/index176.cjs +1 -2
  144. package/dist/index176.js +12 -58
  145. package/dist/index177.cjs +2 -1
  146. package/dist/index177.js +60 -2
  147. package/dist/index178.cjs +1 -1
  148. package/dist/index178.js +2 -8
  149. package/dist/index179.cjs +1 -1
  150. package/dist/index179.js +8 -32
  151. package/dist/index180.cjs +1 -1
  152. package/dist/index180.js +32 -22
  153. package/dist/index181.cjs +1 -1
  154. package/dist/index181.js +21 -5
  155. package/dist/index182.cjs +1 -1
  156. package/dist/index182.js +5 -73
  157. package/dist/index183.cjs +1 -1
  158. package/dist/index183.js +73 -5
  159. package/dist/index184.cjs +1 -1
  160. package/dist/index184.js +4 -4
  161. package/dist/index185.cjs +1 -9
  162. package/dist/index185.js +5 -35
  163. package/dist/index186.cjs +9 -2
  164. package/dist/index186.js +28 -113
  165. package/dist/index187.cjs +2 -1
  166. package/dist/index187.js +121 -3
  167. package/dist/index188.cjs +1 -1
  168. package/dist/index188.js +3 -19
  169. package/dist/index189.cjs +1 -1
  170. package/dist/index189.js +13 -28
  171. package/dist/index190.cjs +1 -1
  172. package/dist/index190.js +31 -33
  173. package/dist/index191.cjs +1 -1
  174. package/dist/index191.js +33 -21
  175. package/dist/index192.cjs +1 -1
  176. package/dist/index192.js +20 -5
  177. package/dist/index193.cjs +1 -4
  178. package/dist/index193.js +6 -192
  179. package/dist/index194.cjs +4 -1
  180. package/dist/index194.js +195 -2
  181. package/dist/index195.cjs +1 -3
  182. package/dist/index195.js +2 -452
  183. package/dist/index196.cjs +3 -1
  184. package/dist/index196.js +443 -19
  185. package/dist/index197.cjs +1 -1
  186. package/dist/index197.js +19 -153
  187. package/dist/index198.cjs +1 -1
  188. package/dist/index198.js +158 -124
  189. package/dist/index199.cjs +1 -1
  190. package/dist/index199.js +127 -38
  191. package/dist/index200.cjs +1 -1
  192. package/dist/index200.js +35 -24
  193. package/dist/index201.cjs +1 -1
  194. package/dist/index201.js +24 -52
  195. package/dist/index202.cjs +1 -1
  196. package/dist/index202.js +55 -191
  197. package/dist/index203.cjs +1 -1
  198. package/dist/index203.js +192 -4
  199. package/dist/index204.cjs +1 -1
  200. package/dist/index204.js +4 -74
  201. package/dist/index205.cjs +1 -1
  202. package/dist/index205.js +69 -16
  203. package/dist/index206.cjs +1 -1
  204. package/dist/index206.js +21 -3
  205. package/dist/index207.cjs +1 -1
  206. package/dist/index207.js +3 -17
  207. package/dist/index208.cjs +1 -1
  208. package/dist/index208.js +16 -23
  209. package/dist/index209.cjs +1 -1
  210. package/dist/index209.js +22 -33
  211. package/dist/index210.cjs +1 -1
  212. package/dist/index210.js +35 -3
  213. package/dist/index211.cjs +1 -1
  214. package/dist/index211.js +3 -28
  215. package/dist/index212.cjs +1 -1
  216. package/dist/index212.js +25 -34
  217. package/dist/index213.cjs +1 -1
  218. package/dist/index213.js +36 -8
  219. package/dist/index214.cjs +1 -1
  220. package/dist/index214.js +8 -25
  221. package/dist/index215.cjs +1 -1
  222. package/dist/index215.js +20 -23
  223. package/dist/index216.cjs +1 -1
  224. package/dist/index216.js +27 -74
  225. package/dist/index217.cjs +1 -1
  226. package/dist/index217.js +73 -19
  227. package/dist/index218.cjs +1 -1
  228. package/dist/index218.js +21 -8
  229. package/dist/index219.cjs +1 -1
  230. package/dist/index219.js +8 -10
  231. package/dist/index220.cjs +1 -1
  232. package/dist/index220.js +10 -11
  233. package/dist/index221.cjs +1 -1
  234. package/dist/index221.js +11 -6
  235. package/dist/index222.cjs +1 -1
  236. package/dist/index222.js +6 -6
  237. package/dist/index223.cjs +1 -1
  238. package/dist/index223.js +6 -13
  239. package/dist/index224.cjs +1 -1
  240. package/dist/index224.js +12 -31
  241. package/dist/index225.cjs +1 -1
  242. package/dist/index225.js +33 -5
  243. package/dist/index226.cjs +1 -1
  244. package/dist/index226.js +5 -38
  245. package/dist/index227.cjs +1 -1
  246. package/dist/index227.js +32 -106
  247. package/dist/index228.cjs +1 -1
  248. package/dist/index228.js +106 -44
  249. package/dist/index229.cjs +1 -1
  250. package/dist/index229.js +48 -31
  251. package/dist/index230.cjs +1 -1
  252. package/dist/index230.js +32 -8
  253. package/dist/index231.cjs +1 -1
  254. package/dist/index231.js +8 -7
  255. package/dist/index232.cjs +1 -1
  256. package/dist/index232.js +7 -16
  257. package/dist/index233.cjs +1 -1
  258. package/dist/index233.js +16 -22
  259. package/dist/index234.cjs +1 -1
  260. package/dist/index234.js +22 -104
  261. package/dist/index235.cjs +1 -1
  262. package/dist/index235.js +105 -3
  263. package/dist/index236.cjs +1 -1
  264. package/dist/index236.js +3 -6
  265. package/dist/index237.cjs +1 -1
  266. package/dist/index237.js +5 -31
  267. package/dist/index238.cjs +1 -1
  268. package/dist/index238.js +31 -20
  269. package/dist/index239.cjs +1 -1
  270. package/dist/index239.js +20 -3
  271. package/dist/index24.cjs +1 -1
  272. package/dist/index24.js +2 -2
  273. package/dist/index240.cjs +1 -1
  274. package/dist/index240.js +3 -17
  275. package/dist/index241.cjs +1 -1
  276. package/dist/index241.js +17 -5
  277. package/dist/index242.cjs +1 -1
  278. package/dist/index242.js +5 -8
  279. package/dist/index243.cjs +1 -1
  280. package/dist/index243.js +8 -103
  281. package/dist/index244.cjs +1 -1
  282. package/dist/index244.js +99 -60
  283. package/dist/index245.cjs +1 -1
  284. package/dist/index245.js +64 -6
  285. package/dist/index246.cjs +1 -1
  286. package/dist/index246.js +6 -27
  287. package/dist/index247.cjs +1 -1
  288. package/dist/index247.js +27 -34
  289. package/dist/index248.cjs +1 -1
  290. package/dist/index248.js +34 -16
  291. package/dist/index249.cjs +1 -1
  292. package/dist/index249.js +14 -76
  293. package/dist/index250.cjs +1 -1
  294. package/dist/index250.js +79 -2
  295. package/dist/index251.cjs +1 -1
  296. package/dist/index251.js +2 -15
  297. package/dist/index252.cjs +1 -1
  298. package/dist/index252.js +14 -18
  299. package/dist/index253.cjs +1 -1
  300. package/dist/index253.js +15 -14
  301. package/dist/index254.cjs +1 -1
  302. package/dist/index254.js +17 -10
  303. package/dist/index255.cjs +1 -1
  304. package/dist/index255.js +10 -79
  305. package/dist/index256.cjs +1 -1
  306. package/dist/index256.js +80 -3
  307. package/dist/index257.cjs +1 -1
  308. package/dist/index257.js +3 -33
  309. package/dist/index258.cjs +1 -1
  310. package/dist/index258.js +28 -111
  311. package/dist/index259.cjs +1 -1
  312. package/dist/index259.js +116 -4
  313. package/dist/index260.cjs +1 -1
  314. package/dist/index260.js +4 -16
  315. package/dist/index261.cjs +1 -1
  316. package/dist/index261.js +14 -10
  317. package/dist/index262.cjs +1 -1
  318. package/dist/index262.js +11 -18
  319. package/dist/index263.cjs +1 -1
  320. package/dist/index263.js +17 -57
  321. package/dist/index264.cjs +1 -1
  322. package/dist/index264.js +57 -19
  323. package/dist/index265.cjs +1 -1
  324. package/dist/index265.js +21 -14
  325. package/dist/index266.cjs +1 -1
  326. package/dist/index266.js +13 -284
  327. package/dist/index267.cjs +1 -1
  328. package/dist/index267.js +256 -545
  329. package/dist/index268.cjs +1 -1
  330. package/dist/index268.js +570 -37
  331. package/dist/index269.cjs +1 -1
  332. package/dist/index269.js +1 -1
  333. package/dist/index270.cjs +1 -1
  334. package/dist/index270.js +2 -2
  335. package/dist/index275.cjs +1 -1
  336. package/dist/index275.js +2 -2
  337. package/dist/index29.cjs +1 -1
  338. package/dist/index29.js +1 -1
  339. package/dist/index299.cjs +1 -1
  340. package/dist/index299.js +37 -7
  341. package/dist/index30.cjs +1 -1
  342. package/dist/index30.js +2 -2
  343. package/dist/index300.cjs +1 -1
  344. package/dist/index300.js +14 -36
  345. package/dist/index301.cjs +1 -1
  346. package/dist/index301.js +8 -15
  347. package/dist/index302.cjs +1 -1
  348. package/dist/index302.js +7 -8
  349. package/dist/index303.cjs +1 -1
  350. package/dist/index303.js +1 -1
  351. package/dist/index304.cjs +1 -1
  352. package/dist/index304.js +2 -2
  353. package/dist/index306.cjs +1 -1
  354. package/dist/index306.js +2 -2
  355. package/dist/index307.cjs +1 -1
  356. package/dist/index307.js +2 -2
  357. package/dist/index308.cjs +1 -1
  358. package/dist/index308.js +1 -1
  359. package/dist/index315.cjs +1 -1
  360. package/dist/index315.js +1 -1
  361. package/dist/index320.cjs +1 -1
  362. package/dist/index320.js +2 -2
  363. package/dist/index322.cjs +1 -1
  364. package/dist/index322.js +1 -1
  365. package/dist/index326.cjs +1 -1
  366. package/dist/index326.js +3 -3
  367. package/dist/index328.cjs +1 -1
  368. package/dist/index328.js +2 -2
  369. package/dist/index329.cjs +1 -1
  370. package/dist/index329.js +1 -1
  371. package/dist/index330.cjs +1 -1
  372. package/dist/index330.js +1 -1
  373. package/dist/index332.cjs +1 -1
  374. package/dist/index332.js +2 -2
  375. package/dist/index336.cjs +1 -1
  376. package/dist/index336.js +2 -2
  377. package/dist/index337.cjs +1 -1
  378. package/dist/index337.js +1 -1
  379. package/dist/index338.cjs +1 -1
  380. package/dist/index338.js +1 -1
  381. package/dist/index339.cjs +1 -1
  382. package/dist/index339.js +3 -3
  383. package/dist/index343.cjs +1 -1
  384. package/dist/index343.js +1 -1
  385. package/dist/index344.cjs +1 -1
  386. package/dist/index344.js +3 -3
  387. package/dist/index347.cjs +1 -1
  388. package/dist/index347.js +1 -1
  389. package/dist/index356.cjs +1 -1
  390. package/dist/index356.js +2 -2
  391. package/dist/index362.cjs +1 -1
  392. package/dist/index362.js +1 -1
  393. package/dist/index373.cjs +1 -1
  394. package/dist/index373.js +1 -1
  395. package/dist/index376.cjs +1 -1
  396. package/dist/index376.js +4 -4
  397. package/dist/index378.cjs +1 -1
  398. package/dist/index378.js +1 -1
  399. package/dist/index379.cjs +1 -1
  400. package/dist/index379.js +1 -1
  401. package/dist/index380.cjs +1 -1
  402. package/dist/index380.js +1 -1
  403. package/dist/index39.cjs +1 -1
  404. package/dist/index39.js +83 -24
  405. package/dist/index40.cjs +1 -1
  406. package/dist/index40.js +11 -15
  407. package/dist/index41.cjs +1 -1
  408. package/dist/index41.js +24 -103
  409. package/dist/index42.cjs +1 -1
  410. package/dist/index42.js +16 -86
  411. package/dist/index43.cjs +1 -1
  412. package/dist/index43.js +105 -11
  413. package/dist/index44.cjs +1 -1
  414. package/dist/index44.js +2 -2
  415. package/dist/index45.cjs +1 -1
  416. package/dist/index45.js +5 -5
  417. package/dist/index67.cjs +1 -1
  418. package/dist/index67.js +1 -1
  419. package/dist/index76.cjs +1 -1
  420. package/dist/index76.js +10 -10
  421. package/dist/index77.cjs +1 -1
  422. package/dist/index77.js +2 -2
  423. package/dist/index78.cjs +1 -1
  424. package/dist/index78.js +1 -1
  425. package/dist/index79.cjs +1 -1
  426. package/dist/index79.js +1 -1
  427. package/dist/index81.cjs +1 -1
  428. package/dist/index81.js +1 -1
  429. package/dist/index82.cjs +1 -1
  430. package/dist/index82.js +3 -3
  431. package/dist/index83.cjs +1 -1
  432. package/dist/index83.js +9 -9
  433. package/dist/index85.cjs +1 -1
  434. package/dist/index85.js +1 -1
  435. package/dist/index86.cjs +1 -1
  436. package/dist/index86.js +1 -1
  437. package/dist/index9.cjs +1 -1
  438. package/dist/index9.js +14 -12
  439. package/dist/index94.cjs +1 -1
  440. package/dist/index94.js +13 -13
  441. package/dist/index95.cjs +1 -1
  442. package/dist/index95.js +2 -2
  443. package/dist/index96.cjs +1 -1
  444. package/dist/index96.js +2 -2
  445. package/dist/index97.cjs +1 -1
  446. package/dist/index97.js +3 -3
  447. package/dist/src/lib/store/swapStore.d.ts +1 -1
  448. package/package.json +5 -5
package/dist/index161.js CHANGED
@@ -1,167 +1,26 @@
1
- import { parseAccount as K } from "./index110.js";
2
- import { internal_estimateFeesPerGas as M } from "./index124.js";
3
- import { estimateGas as S } from "./index125.js";
4
- import { getBlock as z } from "./index130.js";
5
- import { getTransactionCount as L } from "./index145.js";
6
- import { MaxFeePerGasTooLowError as $, Eip1559FeesNotSupportedError as q } from "./index191.js";
7
- import { blobsToCommitments as v } from "./index218.js";
8
- import { blobsToProofs as j } from "./index219.js";
9
- import { commitmentsToVersionedHashes as D } from "./index220.js";
10
- import { toBlobSidecars as J } from "./index223.js";
11
- import { getAction as p } from "./index101.js";
12
- import { LruMap as O } from "./index217.js";
13
- import { assertRequest as Q } from "./index248.js";
14
- import { getTransactionType as U } from "./index251.js";
15
- import { fillTransaction as W } from "./index127.js";
16
- import { getChainId as X } from "./index133.js";
17
- const Y = [
18
- "blobVersionedHashes",
19
- "chainId",
20
- "fees",
21
- "gas",
22
- "nonce",
23
- "type"
24
- ], B = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new O(128);
25
- async function be(a, N) {
26
- var I, k, A;
27
- let e = N;
28
- e.account ?? (e.account = a.account), e.parameters ?? (e.parameters = Y);
29
- const { account: g, chain: o = a.chain, nonceManager: P, parameters: r } = e, i = (() => {
30
- if (typeof (o == null ? void 0 : o.prepareTransactionRequest) == "function")
31
- return {
32
- fn: o.prepareTransactionRequest,
33
- runAt: ["beforeFillTransaction"]
34
- };
35
- if (Array.isArray(o == null ? void 0 : o.prepareTransactionRequest))
36
- return {
37
- fn: o.prepareTransactionRequest[0],
38
- runAt: o.prepareTransactionRequest[1].runAt
39
- };
40
- })();
41
- let m;
42
- async function G() {
43
- return m || (typeof e.chainId < "u" ? e.chainId : o ? o.id : (m = await p(a, X, "getChainId")({}), m));
44
- }
45
- const s = g && K(g);
46
- let f = e.nonce;
47
- if (r.includes("nonce") && typeof f > "u" && s && P) {
48
- const n = await G();
49
- f = await P.consume({
50
- address: s.address,
51
- chainId: n,
52
- client: a
53
- });
54
- }
55
- i != null && i.fn && ((I = i.runAt) != null && I.includes("beforeFillTransaction")) && (e = await i.fn({ ...e, chain: o }, {
56
- phase: "beforeFillTransaction"
57
- }), f ?? (f = e.nonce));
58
- const T = ((r.includes("blobVersionedHashes") || r.includes("sidecars")) && e.kzg && e.blobs || x.get(a.uid) === !1 || !["fees", "gas"].some((t) => r.includes(t)) ? !1 : !!(r.includes("chainId") && typeof e.chainId != "number" || r.includes("nonce") && typeof f != "number" || r.includes("fees") && typeof e.gasPrice != "bigint" && (typeof e.maxFeePerGas != "bigint" || typeof e.maxPriorityFeePerGas != "bigint") || r.includes("gas") && typeof e.gas != "bigint")) ? await p(a, W, "fillTransaction")({ ...e, nonce: f }).then((n) => {
59
- const { chainId: t, from: d, gas: c, gasPrice: b, nonce: u, maxFeePerBlobGas: E, maxFeePerGas: H, maxPriorityFeePerGas: C, type: V, ...w } = n.transaction;
60
- return x.set(a.uid, !0), {
61
- ...e,
62
- ...d ? { from: d } : {},
63
- ...V ? { type: V } : {},
64
- ...typeof t < "u" ? { chainId: t } : {},
65
- ...typeof c < "u" ? { gas: c } : {},
66
- ...typeof b < "u" ? { gasPrice: b } : {},
67
- ...typeof u < "u" ? { nonce: u } : {},
68
- ...typeof E < "u" ? { maxFeePerBlobGas: E } : {},
69
- ...typeof H < "u" ? { maxFeePerGas: H } : {},
70
- ...typeof C < "u" ? { maxPriorityFeePerGas: C } : {},
71
- ..."nonceKey" in w && typeof w.nonceKey < "u" ? { nonceKey: w.nonceKey } : {}
72
- };
73
- }).catch((n) => {
74
- var c;
75
- const t = n;
76
- return t.name !== "TransactionExecutionError" || ((c = t.walk) == null ? void 0 : c.call(t, (b) => {
77
- const u = b;
78
- return u.name === "MethodNotFoundRpcError" || u.name === "MethodNotSupportedRpcError";
79
- })) && x.set(a.uid, !1), e;
80
- }) : e;
81
- f ?? (f = T.nonce), e = {
82
- ...T,
83
- ...s ? { from: s == null ? void 0 : s.address } : {},
84
- ...f ? { nonce: f } : {}
85
- };
86
- const { blobs: l, gas: R, kzg: h, type: _ } = e;
87
- i != null && i.fn && ((k = i.runAt) != null && k.includes("beforeFillParameters")) && (e = await i.fn({ ...e, chain: o }, {
88
- phase: "beforeFillParameters"
89
- }));
90
- let y;
91
- async function F() {
92
- return y || (y = await p(a, z, "getBlock")({ blockTag: "latest" }), y);
93
- }
94
- if (r.includes("nonce") && typeof f > "u" && s && !P && (e.nonce = await p(a, L, "getTransactionCount")({
95
- address: s.address,
96
- blockTag: "pending"
97
- })), (r.includes("blobVersionedHashes") || r.includes("sidecars")) && l && h) {
98
- const n = v({ blobs: l, kzg: h });
99
- if (r.includes("blobVersionedHashes")) {
100
- const t = D({
101
- commitments: n,
102
- to: "hex"
103
- });
104
- e.blobVersionedHashes = t;
105
- }
106
- if (r.includes("sidecars")) {
107
- const t = j({ blobs: l, commitments: n, kzg: h }), d = J({
108
- blobs: l,
109
- commitments: n,
110
- proofs: t,
111
- to: "hex"
112
- });
113
- e.sidecars = d;
114
- }
115
- }
116
- if (r.includes("chainId") && (e.chainId = await G()), (r.includes("fees") || r.includes("type")) && typeof _ > "u")
117
- try {
118
- e.type = U(e);
119
- } catch {
120
- let n = B.get(a.uid);
121
- if (typeof n > "u") {
122
- const t = await F();
123
- n = typeof (t == null ? void 0 : t.baseFeePerGas) == "bigint", B.set(a.uid, n);
124
- }
125
- e.type = n ? "eip1559" : "legacy";
126
- }
127
- if (r.includes("fees"))
128
- if (e.type !== "legacy" && e.type !== "eip2930") {
129
- if (typeof e.maxFeePerGas > "u" || typeof e.maxPriorityFeePerGas > "u") {
130
- const n = await F(), { maxFeePerGas: t, maxPriorityFeePerGas: d } = await M(a, {
131
- block: n,
132
- chain: o,
133
- request: e
134
- });
135
- if (typeof e.maxPriorityFeePerGas > "u" && e.maxFeePerGas && e.maxFeePerGas < d)
136
- throw new $({
137
- maxPriorityFeePerGas: d
138
- });
139
- e.maxPriorityFeePerGas = d, e.maxFeePerGas = t;
140
- }
141
- } else {
142
- if (typeof e.maxFeePerGas < "u" || typeof e.maxPriorityFeePerGas < "u")
143
- throw new q();
144
- if (typeof e.gasPrice > "u") {
145
- const n = await F(), { gasPrice: t } = await M(a, {
146
- block: n,
147
- chain: o,
148
- request: e,
149
- type: "legacy"
150
- });
151
- e.gasPrice = t;
152
- }
153
- }
154
- return r.includes("gas") && typeof R > "u" && (e.gas = await p(a, S, "estimateGas")({
155
- ...e,
156
- account: s,
157
- prepare: (s == null ? void 0 : s.type) === "local" ? [] : ["blobVersionedHashes"]
158
- })), i != null && i.fn && ((A = i.runAt) != null && A.includes("afterFillParameters")) && (e = await i.fn({ ...e, chain: o }, {
159
- phase: "afterFillParameters"
160
- })), Q(e), delete e.parameters, e;
1
+ import { hashMessage as g } from "./index242.js";
2
+ import { parseSiweMessage as l } from "./index313.js";
3
+ import { validateSiweMessage as p } from "./index314.js";
4
+ import { verifyHash as h } from "./index92.js";
5
+ async function S(a, r) {
6
+ const { address: i, domain: t, message: s, nonce: o, scheme: n, signature: d, time: m = /* @__PURE__ */ new Date(), ...f } = r, e = l(s);
7
+ if (!e.address || !p({
8
+ address: i,
9
+ domain: t,
10
+ message: e,
11
+ nonce: o,
12
+ scheme: n,
13
+ time: m
14
+ }))
15
+ return !1;
16
+ const c = g(s);
17
+ return h(a, {
18
+ address: e.address,
19
+ hash: c,
20
+ signature: d,
21
+ ...f
22
+ });
161
23
  }
162
24
  export {
163
- Y as defaultParameters,
164
- B as eip1559NetworkCache,
165
- be as prepareTransactionRequest,
166
- x as supportsFillTransaction
25
+ S as verifySiweMessage
167
26
  };
package/dist/index162.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function t(e,{serializedTransaction:n}){return e.request({method:"eth_sendRawTransaction",params:[n]},{retryCount:0})}exports.sendRawTransaction=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("./index111.cjs"),B=require("./index125.cjs"),v=require("./index126.cjs"),z=require("./index131.cjs"),L=require("./index146.cjs"),M=require("./index192.cjs"),$=require("./index219.cjs"),j=require("./index220.cjs"),O=require("./index221.cjs"),D=require("./index224.cjs"),l=require("./index101.cjs"),J=require("./index218.cjs"),Q=require("./index249.cjs"),U=require("./index252.cjs"),W=require("./index128.cjs"),X=require("./index134.cjs"),R=["blobVersionedHashes","chainId","fees","gas","nonce","type"],G=new Map,b=new J.LruMap(128);async function Y(a,N){var A,k,I;let e=N;e.account??(e.account=a.account),e.parameters??(e.parameters=R);const{account:P,chain:s=a.chain,nonceManager:h,parameters:r}=e,i=(()=>{if(typeof(s==null?void 0:s.prepareTransactionRequest)=="function")return{fn:s.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(s==null?void 0:s.prepareTransactionRequest))return{fn:s.prepareTransactionRequest[0],runAt:s.prepareTransactionRequest[1].runAt}})();let p;async function x(){return p||(typeof e.chainId<"u"?e.chainId:s?s.id:(p=await l.getAction(a,X.getChainId,"getChainId")({}),p))}const o=P&&K.parseAccount(P);let c=e.nonce;if(r.includes("nonce")&&typeof c>"u"&&o&&h){const n=await x();c=await h.consume({address:o.address,chainId:n,client:a})}i!=null&&i.fn&&((A=i.runAt)!=null&&A.includes("beforeFillTransaction"))&&(e=await i.fn({...e,chain:s},{phase:"beforeFillTransaction"}),c??(c=e.nonce));const q=((r.includes("blobVersionedHashes")||r.includes("sidecars"))&&e.kzg&&e.blobs||b.get(a.uid)===!1||!["fees","gas"].some(t=>r.includes(t))?!1:!!(r.includes("chainId")&&typeof e.chainId!="number"||r.includes("nonce")&&typeof c!="number"||r.includes("fees")&&typeof e.gasPrice!="bigint"&&(typeof e.maxFeePerGas!="bigint"||typeof e.maxPriorityFeePerGas!="bigint")||r.includes("gas")&&typeof e.gas!="bigint"))?await l.getAction(a,W.fillTransaction,"fillTransaction")({...e,nonce:c}).then(n=>{const{chainId:t,from:u,gas:d,gasPrice:g,nonce:f,maxFeePerBlobGas:C,maxFeePerGas:H,maxPriorityFeePerGas:E,type:V,...w}=n.transaction;return b.set(a.uid,!0),{...e,...u?{from:u}:{},...V?{type:V}:{},...typeof t<"u"?{chainId:t}:{},...typeof d<"u"?{gas:d}:{},...typeof g<"u"?{gasPrice:g}:{},...typeof f<"u"?{nonce:f}:{},...typeof C<"u"?{maxFeePerBlobGas:C}:{},...typeof H<"u"?{maxFeePerGas:H}:{},...typeof E<"u"?{maxPriorityFeePerGas:E}:{},..."nonceKey"in w&&typeof w.nonceKey<"u"?{nonceKey:w.nonceKey}:{}}}).catch(n=>{var d;const t=n;return t.name!=="TransactionExecutionError"||((d=t.walk)==null?void 0:d.call(t,g=>{const f=g;return f.name==="MethodNotFoundRpcError"||f.name==="MethodNotSupportedRpcError"}))&&b.set(a.uid,!1),e}):e;c??(c=q.nonce),e={...q,...o?{from:o==null?void 0:o.address}:{},...c?{nonce:c}:{}};const{blobs:y,gas:S,kzg:F,type:_}=e;i!=null&&i.fn&&((k=i.runAt)!=null&&k.includes("beforeFillParameters"))&&(e=await i.fn({...e,chain:s},{phase:"beforeFillParameters"}));let m;async function T(){return m||(m=await l.getAction(a,z.getBlock,"getBlock")({blockTag:"latest"}),m)}if(r.includes("nonce")&&typeof c>"u"&&o&&!h&&(e.nonce=await l.getAction(a,L.getTransactionCount,"getTransactionCount")({address:o.address,blockTag:"pending"})),(r.includes("blobVersionedHashes")||r.includes("sidecars"))&&y&&F){const n=$.blobsToCommitments({blobs:y,kzg:F});if(r.includes("blobVersionedHashes")){const t=O.commitmentsToVersionedHashes({commitments:n,to:"hex"});e.blobVersionedHashes=t}if(r.includes("sidecars")){const t=j.blobsToProofs({blobs:y,commitments:n,kzg:F}),u=D.toBlobSidecars({blobs:y,commitments:n,proofs:t,to:"hex"});e.sidecars=u}}if(r.includes("chainId")&&(e.chainId=await x()),(r.includes("fees")||r.includes("type"))&&typeof _>"u")try{e.type=U.getTransactionType(e)}catch{let n=G.get(a.uid);if(typeof n>"u"){const t=await T();n=typeof(t==null?void 0:t.baseFeePerGas)=="bigint",G.set(a.uid,n)}e.type=n?"eip1559":"legacy"}if(r.includes("fees"))if(e.type!=="legacy"&&e.type!=="eip2930"){if(typeof e.maxFeePerGas>"u"||typeof e.maxPriorityFeePerGas>"u"){const n=await T(),{maxFeePerGas:t,maxPriorityFeePerGas:u}=await B.internal_estimateFeesPerGas(a,{block:n,chain:s,request:e});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas<u)throw new M.MaxFeePerGasTooLowError({maxPriorityFeePerGas:u});e.maxPriorityFeePerGas=u,e.maxFeePerGas=t}}else{if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")throw new M.Eip1559FeesNotSupportedError;if(typeof e.gasPrice>"u"){const n=await T(),{gasPrice:t}=await B.internal_estimateFeesPerGas(a,{block:n,chain:s,request:e,type:"legacy"});e.gasPrice=t}}return r.includes("gas")&&typeof S>"u"&&(e.gas=await l.getAction(a,v.estimateGas,"estimateGas")({...e,account:o,prepare:(o==null?void 0:o.type)==="local"?[]:["blobVersionedHashes"]})),i!=null&&i.fn&&((I=i.runAt)!=null&&I.includes("afterFillParameters"))&&(e=await i.fn({...e,chain:s},{phase:"afterFillParameters"})),Q.assertRequest(e),delete e.parameters,e}exports.defaultParameters=R;exports.eip1559NetworkCache=G;exports.prepareTransactionRequest=Y;exports.supportsFillTransaction=b;
package/dist/index162.js CHANGED
@@ -1,9 +1,167 @@
1
- async function a(n, { serializedTransaction: t }) {
2
- return n.request({
3
- method: "eth_sendRawTransaction",
4
- params: [t]
5
- }, { retryCount: 0 });
1
+ import { parseAccount as K } from "./index111.js";
2
+ import { internal_estimateFeesPerGas as M } from "./index125.js";
3
+ import { estimateGas as S } from "./index126.js";
4
+ import { getBlock as z } from "./index131.js";
5
+ import { getTransactionCount as L } from "./index146.js";
6
+ import { MaxFeePerGasTooLowError as $, Eip1559FeesNotSupportedError as q } from "./index192.js";
7
+ import { blobsToCommitments as v } from "./index219.js";
8
+ import { blobsToProofs as j } from "./index220.js";
9
+ import { commitmentsToVersionedHashes as D } from "./index221.js";
10
+ import { toBlobSidecars as J } from "./index224.js";
11
+ import { getAction as p } from "./index101.js";
12
+ import { LruMap as O } from "./index218.js";
13
+ import { assertRequest as Q } from "./index249.js";
14
+ import { getTransactionType as U } from "./index252.js";
15
+ import { fillTransaction as W } from "./index128.js";
16
+ import { getChainId as X } from "./index134.js";
17
+ const Y = [
18
+ "blobVersionedHashes",
19
+ "chainId",
20
+ "fees",
21
+ "gas",
22
+ "nonce",
23
+ "type"
24
+ ], B = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new O(128);
25
+ async function be(a, N) {
26
+ var I, k, A;
27
+ let e = N;
28
+ e.account ?? (e.account = a.account), e.parameters ?? (e.parameters = Y);
29
+ const { account: g, chain: o = a.chain, nonceManager: P, parameters: r } = e, i = (() => {
30
+ if (typeof (o == null ? void 0 : o.prepareTransactionRequest) == "function")
31
+ return {
32
+ fn: o.prepareTransactionRequest,
33
+ runAt: ["beforeFillTransaction"]
34
+ };
35
+ if (Array.isArray(o == null ? void 0 : o.prepareTransactionRequest))
36
+ return {
37
+ fn: o.prepareTransactionRequest[0],
38
+ runAt: o.prepareTransactionRequest[1].runAt
39
+ };
40
+ })();
41
+ let m;
42
+ async function G() {
43
+ return m || (typeof e.chainId < "u" ? e.chainId : o ? o.id : (m = await p(a, X, "getChainId")({}), m));
44
+ }
45
+ const s = g && K(g);
46
+ let f = e.nonce;
47
+ if (r.includes("nonce") && typeof f > "u" && s && P) {
48
+ const n = await G();
49
+ f = await P.consume({
50
+ address: s.address,
51
+ chainId: n,
52
+ client: a
53
+ });
54
+ }
55
+ i != null && i.fn && ((I = i.runAt) != null && I.includes("beforeFillTransaction")) && (e = await i.fn({ ...e, chain: o }, {
56
+ phase: "beforeFillTransaction"
57
+ }), f ?? (f = e.nonce));
58
+ const T = ((r.includes("blobVersionedHashes") || r.includes("sidecars")) && e.kzg && e.blobs || x.get(a.uid) === !1 || !["fees", "gas"].some((t) => r.includes(t)) ? !1 : !!(r.includes("chainId") && typeof e.chainId != "number" || r.includes("nonce") && typeof f != "number" || r.includes("fees") && typeof e.gasPrice != "bigint" && (typeof e.maxFeePerGas != "bigint" || typeof e.maxPriorityFeePerGas != "bigint") || r.includes("gas") && typeof e.gas != "bigint")) ? await p(a, W, "fillTransaction")({ ...e, nonce: f }).then((n) => {
59
+ const { chainId: t, from: d, gas: c, gasPrice: b, nonce: u, maxFeePerBlobGas: E, maxFeePerGas: H, maxPriorityFeePerGas: C, type: V, ...w } = n.transaction;
60
+ return x.set(a.uid, !0), {
61
+ ...e,
62
+ ...d ? { from: d } : {},
63
+ ...V ? { type: V } : {},
64
+ ...typeof t < "u" ? { chainId: t } : {},
65
+ ...typeof c < "u" ? { gas: c } : {},
66
+ ...typeof b < "u" ? { gasPrice: b } : {},
67
+ ...typeof u < "u" ? { nonce: u } : {},
68
+ ...typeof E < "u" ? { maxFeePerBlobGas: E } : {},
69
+ ...typeof H < "u" ? { maxFeePerGas: H } : {},
70
+ ...typeof C < "u" ? { maxPriorityFeePerGas: C } : {},
71
+ ..."nonceKey" in w && typeof w.nonceKey < "u" ? { nonceKey: w.nonceKey } : {}
72
+ };
73
+ }).catch((n) => {
74
+ var c;
75
+ const t = n;
76
+ return t.name !== "TransactionExecutionError" || ((c = t.walk) == null ? void 0 : c.call(t, (b) => {
77
+ const u = b;
78
+ return u.name === "MethodNotFoundRpcError" || u.name === "MethodNotSupportedRpcError";
79
+ })) && x.set(a.uid, !1), e;
80
+ }) : e;
81
+ f ?? (f = T.nonce), e = {
82
+ ...T,
83
+ ...s ? { from: s == null ? void 0 : s.address } : {},
84
+ ...f ? { nonce: f } : {}
85
+ };
86
+ const { blobs: l, gas: R, kzg: h, type: _ } = e;
87
+ i != null && i.fn && ((k = i.runAt) != null && k.includes("beforeFillParameters")) && (e = await i.fn({ ...e, chain: o }, {
88
+ phase: "beforeFillParameters"
89
+ }));
90
+ let y;
91
+ async function F() {
92
+ return y || (y = await p(a, z, "getBlock")({ blockTag: "latest" }), y);
93
+ }
94
+ if (r.includes("nonce") && typeof f > "u" && s && !P && (e.nonce = await p(a, L, "getTransactionCount")({
95
+ address: s.address,
96
+ blockTag: "pending"
97
+ })), (r.includes("blobVersionedHashes") || r.includes("sidecars")) && l && h) {
98
+ const n = v({ blobs: l, kzg: h });
99
+ if (r.includes("blobVersionedHashes")) {
100
+ const t = D({
101
+ commitments: n,
102
+ to: "hex"
103
+ });
104
+ e.blobVersionedHashes = t;
105
+ }
106
+ if (r.includes("sidecars")) {
107
+ const t = j({ blobs: l, commitments: n, kzg: h }), d = J({
108
+ blobs: l,
109
+ commitments: n,
110
+ proofs: t,
111
+ to: "hex"
112
+ });
113
+ e.sidecars = d;
114
+ }
115
+ }
116
+ if (r.includes("chainId") && (e.chainId = await G()), (r.includes("fees") || r.includes("type")) && typeof _ > "u")
117
+ try {
118
+ e.type = U(e);
119
+ } catch {
120
+ let n = B.get(a.uid);
121
+ if (typeof n > "u") {
122
+ const t = await F();
123
+ n = typeof (t == null ? void 0 : t.baseFeePerGas) == "bigint", B.set(a.uid, n);
124
+ }
125
+ e.type = n ? "eip1559" : "legacy";
126
+ }
127
+ if (r.includes("fees"))
128
+ if (e.type !== "legacy" && e.type !== "eip2930") {
129
+ if (typeof e.maxFeePerGas > "u" || typeof e.maxPriorityFeePerGas > "u") {
130
+ const n = await F(), { maxFeePerGas: t, maxPriorityFeePerGas: d } = await M(a, {
131
+ block: n,
132
+ chain: o,
133
+ request: e
134
+ });
135
+ if (typeof e.maxPriorityFeePerGas > "u" && e.maxFeePerGas && e.maxFeePerGas < d)
136
+ throw new $({
137
+ maxPriorityFeePerGas: d
138
+ });
139
+ e.maxPriorityFeePerGas = d, e.maxFeePerGas = t;
140
+ }
141
+ } else {
142
+ if (typeof e.maxFeePerGas < "u" || typeof e.maxPriorityFeePerGas < "u")
143
+ throw new q();
144
+ if (typeof e.gasPrice > "u") {
145
+ const n = await F(), { gasPrice: t } = await M(a, {
146
+ block: n,
147
+ chain: o,
148
+ request: e,
149
+ type: "legacy"
150
+ });
151
+ e.gasPrice = t;
152
+ }
153
+ }
154
+ return r.includes("gas") && typeof R > "u" && (e.gas = await p(a, S, "estimateGas")({
155
+ ...e,
156
+ account: s,
157
+ prepare: (s == null ? void 0 : s.type) === "local" ? [] : ["blobVersionedHashes"]
158
+ })), i != null && i.fn && ((A = i.runAt) != null && A.includes("afterFillParameters")) && (e = await i.fn({ ...e, chain: o }, {
159
+ phase: "afterFillParameters"
160
+ })), Q(e), delete e.parameters, e;
6
161
  }
7
162
  export {
8
- a as sendRawTransaction
163
+ Y as defaultParameters,
164
+ B as eip1559NetworkCache,
165
+ be as prepareTransactionRequest,
166
+ x as supportsFillTransaction
9
167
  };
package/dist/index163.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index186.cjs"),f=require("./index74.cjs"),m=require("./index81.cjs");async function d(e,{serializedTransaction:r,throwOnReceiptRevert:s,timeout:n}){var a,o,c;const i=await e.request({method:"eth_sendRawTransactionSync",params:n?[r,m.numberToHex(n)]:[r]},{retryCount:0}),t=(((c=(o=(a=e.chain)==null?void 0:a.formatters)==null?void 0:o.transactionReceipt)==null?void 0:c.format)||f.formatTransactionReceipt)(i);if(t.status==="reverted"&&s)throw new u.TransactionReceiptRevertedError({receipt:t});return t}exports.sendRawTransactionSync=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function t(e,{serializedTransaction:n}){return e.request({method:"eth_sendRawTransaction",params:[n]},{retryCount:0})}exports.sendRawTransaction=t;
package/dist/index163.js CHANGED
@@ -1,16 +1,9 @@
1
- import { TransactionReceiptRevertedError as i } from "./index186.js";
2
- import { formatTransactionReceipt as f } from "./index74.js";
3
- import { numberToHex as p } from "./index81.js";
4
- async function h(r, { serializedTransaction: e, throwOnReceiptRevert: m, timeout: o }) {
5
- var a, n, c;
6
- const s = await r.request({
7
- method: "eth_sendRawTransactionSync",
8
- params: o ? [e, p(o)] : [e]
9
- }, { retryCount: 0 }), t = (((c = (n = (a = r.chain) == null ? void 0 : a.formatters) == null ? void 0 : n.transactionReceipt) == null ? void 0 : c.format) || f)(s);
10
- if (t.status === "reverted" && m)
11
- throw new i({ receipt: t });
12
- return t;
1
+ async function a(n, { serializedTransaction: t }) {
2
+ return n.request({
3
+ method: "eth_sendRawTransaction",
4
+ params: [t]
5
+ }, { retryCount: 0 });
13
6
  }
14
7
  export {
15
- h as sendRawTransactionSync
8
+ a as sendRawTransaction
16
9
  };
package/dist/index164.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index165.cjs"),b=require("./index111.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 u=require("./index187.cjs"),f=require("./index74.cjs"),m=require("./index81.cjs");async function d(e,{serializedTransaction:r,throwOnReceiptRevert:s,timeout:n}){var a,o,c;const i=await e.request({method:"eth_sendRawTransactionSync",params:n?[r,m.numberToHex(n)]:[r]},{retryCount:0}),t=(((c=(o=(a=e.chain)==null?void 0:a.formatters)==null?void 0:o.transactionReceipt)==null?void 0:c.format)||f.formatTransactionReceipt)(i);if(t.status==="reverted"&&s)throw new u.TransactionReceiptRevertedError({receipt:t});return t}exports.sendRawTransactionSync=d;
package/dist/index164.js CHANGED
@@ -1,22 +1,16 @@
1
- import { buildRequest as m } from "./index165.js";
2
- import { uid as e } from "./index111.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();
5
- 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
18
- };
1
+ import { TransactionReceiptRevertedError as i } from "./index187.js";
2
+ import { formatTransactionReceipt as f } from "./index74.js";
3
+ import { numberToHex as p } from "./index81.js";
4
+ async function h(r, { serializedTransaction: e, throwOnReceiptRevert: m, timeout: o }) {
5
+ var a, n, c;
6
+ const s = await r.request({
7
+ method: "eth_sendRawTransactionSync",
8
+ params: o ? [e, p(o)] : [e]
9
+ }, { retryCount: 0 }), t = (((c = (n = (a = r.chain) == null ? void 0 : a.formatters) == null ? void 0 : n.transactionReceipt) == null ? void 0 : c.format) || f)(s);
10
+ if (t.status === "reverted" && m)
11
+ throw new i({ receipt: t });
12
+ return t;
19
13
  }
20
14
  export {
21
- b as createTransport
15
+ h as sendRawTransactionSync
22
16
  };
package/dist/index165.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("./index176.cjs"),p=require("./index166.cjs"),e=require("./index195.cjs"),I=require("./index81.cjs"),q=require("./index315.cjs"),m=require("./index238.cjs"),v=require("./index194.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 a=require("./index166.cjs"),b=require("./index112.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;
package/dist/index165.js CHANGED
@@ -1,109 +1,22 @@
1
- import { BaseError as z } from "./index176.js";
2
- import { HttpRequestError as k } from "./index166.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 "./index195.js";
4
- import { stringToHex as O } from "./index81.js";
5
- import { withDedupe as V } from "./index315.js";
6
- import { withRetry as W } from "./index238.js";
7
- import { stringify as _ } from "./index194.js";
8
- function te(r, A = {}) {
9
- return async (n, F = {}) => {
10
- var h;
11
- const { dedupe: w = !1, methods: t, retryDelay: H = 150, retryCount: L = 3, uid: $ } = {
12
- ...A,
13
- ...F
14
- }, { method: c } = n;
15
- if ((h = t == null ? void 0 : t.exclude) != null && h.includes(c))
16
- throw new s(new Error("method not supported"), {
17
- method: c
18
- });
19
- if (t != null && t.include && !t.include.includes(c))
20
- throw new s(new Error("method not supported"), {
21
- method: c
22
- });
23
- const g = w ? O(`${$}.${_(n)}`) : void 0;
24
- return V(() => W(async () => {
25
- try {
26
- return await r(n);
27
- } catch (o) {
28
- const e = o;
29
- switch (e.code) {
30
- case T.code:
31
- throw new T(e);
32
- case S.code:
33
- throw new S(e);
34
- case M.code:
35
- throw new M(e, { method: n.method });
36
- case B.code:
37
- throw new B(e);
38
- case i.code:
39
- throw new i(e);
40
- case j.code:
41
- throw new j(e);
42
- case x.code:
43
- throw new x(e);
44
- case P.code:
45
- throw new P(e);
46
- case D.code:
47
- throw new D(e);
48
- case s.code:
49
- throw new s(e, {
50
- method: n.method
51
- });
52
- case a.code:
53
- throw new a(e);
54
- case C.code:
55
- throw new C(e);
56
- case u.code:
57
- throw new u(e);
58
- case q.code:
59
- throw new q(e);
60
- case N.code:
61
- throw new N(e);
62
- case b.code:
63
- throw new b(e);
64
- case v.code:
65
- throw new v(e);
66
- case U.code:
67
- throw new U(e);
68
- case I.code:
69
- throw new I(e);
70
- case y.code:
71
- throw new y(e);
72
- case m.code:
73
- throw new m(e);
74
- case R.code:
75
- throw new R(e);
76
- case l.code:
77
- throw new l(e);
78
- case E.code:
79
- throw new E(e);
80
- case f.code:
81
- throw new f(e);
82
- case 5e3:
83
- throw new u(e);
84
- default:
85
- throw o instanceof z ? o : new J(e);
86
- }
87
- }
88
- }, {
89
- delay: ({ count: o, error: e }) => {
90
- var p;
91
- if (e && e instanceof k) {
92
- const d = (p = e == null ? void 0 : e.headers) == null ? void 0 : p.get("Retry-After");
93
- if (d != null && d.match(/\d/))
94
- return Number.parseInt(d, 10) * 1e3;
95
- }
96
- return ~~(1 << o) * H;
97
- },
98
- retryCount: L,
99
- shouldRetry: ({ error: o }) => G(o)
100
- }), { enabled: w, id: g });
1
+ import { buildRequest as m } from "./index166.js";
2
+ import { uid as e } from "./index112.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();
5
+ 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
101
18
  };
102
19
  }
103
- function G(r) {
104
- return "code" in r && typeof r.code == "number" ? r.code === -1 || r.code === a.code || r.code === i.code : r instanceof k && r.status ? r.status === 403 || r.status === 408 || r.status === 413 || r.status === 429 || r.status === 500 || r.status === 502 || r.status === 503 || r.status === 504 : !0;
105
- }
106
20
  export {
107
- te as buildRequest,
108
- G as shouldRetry
21
+ b as createTransport
109
22
  };
package/dist/index166.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index194.cjs"),i=require("./index176.cjs"),a=require("./index187.cjs");class b extends i.BaseError{constructor({body:t,cause:e,details:r,headers:n,status:u,url:l}){super("HTTP request failed.",{cause:e,details:r,metaMessages:[u&&`Status: ${u}`,`URL: ${a.getUrl(l)}`,t&&`Request body: ${s.stringify(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=n,this.status=u,this.url=l}}class d extends i.BaseError{constructor({body:t,error:e,url:r}){super("RPC Request failed.",{cause:e,details:e.message,metaMessages:[`URL: ${a.getUrl(r)}`,`Request body: ${s.stringify(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e.code,this.data=e.data,this.url=r}}class c extends i.BaseError{constructor({body:t,url:e}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${a.getUrl(e)}`,`Request body: ${s.stringify(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e}}exports.HttpRequestError=b;exports.RpcRequestError=d;exports.TimeoutError=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("./index177.cjs"),p=require("./index167.cjs"),e=require("./index196.cjs"),I=require("./index81.cjs"),q=require("./index315.cjs"),m=require("./index239.cjs"),v=require("./index195.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;