@gardenfi/utils 3.0.0-beta.1 → 3.0.0-beta.3

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 (453) hide show
  1. package/dist/index10.cjs +1 -1
  2. package/dist/index10.js +4 -4
  3. package/dist/index100.cjs +1 -1
  4. package/dist/index100.js +125 -3
  5. package/dist/index101.cjs +1 -1
  6. package/dist/index101.js +5 -26
  7. package/dist/index102.cjs +1 -2
  8. package/dist/index102.js +20 -23
  9. package/dist/index103.cjs +1 -1
  10. package/dist/index103.js +45 -9
  11. package/dist/index104.cjs +1 -1
  12. package/dist/index104.js +38 -8
  13. package/dist/index105.cjs +1 -1
  14. package/dist/index105.js +6 -10
  15. package/dist/index106.cjs +1 -1
  16. package/dist/index106.js +90 -11
  17. package/dist/index107.cjs +1 -1
  18. package/dist/index107.js +14 -13
  19. package/dist/index108.cjs +1 -1
  20. package/dist/index108.js +3 -14
  21. package/dist/index109.cjs +1 -1
  22. package/dist/index109.js +26 -4
  23. package/dist/index110.cjs +2 -1
  24. package/dist/index110.js +24 -6
  25. package/dist/index111.cjs +1 -1
  26. package/dist/index111.js +9 -18
  27. package/dist/index112.cjs +1 -1
  28. package/dist/index112.js +8 -13
  29. package/dist/index113.cjs +1 -1
  30. package/dist/index113.js +10 -6
  31. package/dist/index114.cjs +1 -1
  32. package/dist/index114.js +11 -7
  33. package/dist/index115.cjs +1 -1
  34. package/dist/index115.js +13 -21
  35. package/dist/index116.cjs +1 -1
  36. package/dist/index116.js +21 -7
  37. package/dist/index117.cjs +1 -1
  38. package/dist/index117.js +14 -21
  39. package/dist/index118.cjs +1 -1
  40. package/dist/index118.js +4 -17
  41. package/dist/index119.cjs +1 -1
  42. package/dist/index119.js +5 -39
  43. package/dist/index120.cjs +1 -1
  44. package/dist/index120.js +18 -21
  45. package/dist/index121.cjs +1 -1
  46. package/dist/index121.js +10 -80
  47. package/dist/index122.cjs +1 -1
  48. package/dist/index122.js +57 -10
  49. package/dist/index123.cjs +1 -1
  50. package/dist/index123.js +6 -58
  51. package/dist/index124.cjs +1 -1
  52. package/dist/index124.js +13 -13
  53. package/dist/index125.cjs +1 -1
  54. package/dist/index125.js +7 -8
  55. package/dist/index126.cjs +1 -1
  56. package/dist/index126.js +137 -20
  57. package/dist/index127.cjs +1 -1
  58. package/dist/index127.js +7 -6
  59. package/dist/index128.cjs +1 -1
  60. package/dist/index128.js +19 -33
  61. package/dist/index129.cjs +1 -1
  62. package/dist/index129.js +17 -32
  63. package/dist/index130.cjs +1 -1
  64. package/dist/index130.js +43 -9
  65. package/dist/index131.cjs +1 -1
  66. package/dist/index131.js +20 -49
  67. package/dist/index132.cjs +1 -1
  68. package/dist/index132.js +79 -18
  69. package/dist/index133.cjs +1 -1
  70. package/dist/index133.js +10 -105
  71. package/dist/index134.cjs +1 -1
  72. package/dist/index134.js +8 -63
  73. package/dist/index135.cjs +1 -1
  74. package/dist/index135.js +6 -9
  75. package/dist/index136.cjs +1 -1
  76. package/dist/index136.js +41 -71
  77. package/dist/index137.cjs +1 -2
  78. package/dist/index137.js +6 -3
  79. package/dist/index138.cjs +1 -1
  80. package/dist/index138.js +34 -9
  81. package/dist/index139.cjs +1 -1
  82. package/dist/index139.js +9 -13
  83. package/dist/index140.cjs +1 -1
  84. package/dist/index140.js +60 -4
  85. package/dist/index141.cjs +1 -1
  86. package/dist/index141.js +19 -12
  87. package/dist/index142.cjs +1 -1
  88. package/dist/index142.js +107 -2
  89. package/dist/index143.cjs +1 -1
  90. package/dist/index143.js +79 -32
  91. package/dist/index144.cjs +1 -1
  92. package/dist/index144.js +8 -20
  93. package/dist/index145.cjs +1 -1
  94. package/dist/index145.js +71 -5
  95. package/dist/index146.cjs +2 -1
  96. package/dist/index146.js +3 -6
  97. package/dist/index147.cjs +1 -1
  98. package/dist/index147.js +9 -6
  99. package/dist/index148.cjs +1 -9
  100. package/dist/index148.js +11 -33
  101. package/dist/index149.cjs +1 -1
  102. package/dist/index149.js +5 -3
  103. package/dist/index150.cjs +1 -1
  104. package/dist/index150.js +11 -17
  105. package/dist/index151.cjs +1 -1
  106. package/dist/index151.js +2 -21
  107. package/dist/index152.cjs +1 -1
  108. package/dist/index152.js +32 -36
  109. package/dist/index153.cjs +1 -1
  110. package/dist/index153.js +20 -7
  111. package/dist/index154.cjs +1 -4
  112. package/dist/index154.js +5 -194
  113. package/dist/index155.cjs +1 -1
  114. package/dist/index155.js +5 -27
  115. package/dist/index156.cjs +1 -1
  116. package/dist/index156.js +5 -161
  117. package/dist/index157.cjs +9 -1
  118. package/dist/index157.js +34 -126
  119. package/dist/index158.cjs +1 -1
  120. package/dist/index158.js +3 -28
  121. package/dist/index159.cjs +1 -1
  122. package/dist/index159.js +15 -52
  123. package/dist/index160.cjs +1 -1
  124. package/dist/index160.js +14 -185
  125. package/dist/index161.cjs +1 -1
  126. package/dist/index161.js +36 -4
  127. package/dist/index162.cjs +1 -1
  128. package/dist/index162.js +6 -18
  129. package/dist/index163.cjs +4 -1
  130. package/dist/index163.js +195 -3
  131. package/dist/index164.cjs +1 -1
  132. package/dist/index164.js +26 -15
  133. package/dist/index165.cjs +1 -1
  134. package/dist/index165.js +161 -11
  135. package/dist/index166.cjs +1 -1
  136. package/dist/index166.js +126 -33
  137. package/dist/index167.cjs +1 -1
  138. package/dist/index167.js +28 -3
  139. package/dist/index168.cjs +1 -1
  140. package/dist/index168.js +54 -26
  141. package/dist/index169.cjs +1 -1
  142. package/dist/index169.js +191 -8
  143. package/dist/index17.cjs +1 -1
  144. package/dist/index17.js +2 -2
  145. package/dist/index170.cjs +1 -1
  146. package/dist/index170.js +4 -26
  147. package/dist/index171.cjs +1 -1
  148. package/dist/index171.js +19 -27
  149. package/dist/index172.cjs +1 -1
  150. package/dist/index172.js +3 -4
  151. package/dist/index173.cjs +1 -1
  152. package/dist/index173.js +16 -6
  153. package/dist/index174.cjs +1 -1
  154. package/dist/index174.js +11 -6
  155. package/dist/index175.cjs +1 -1
  156. package/dist/index175.js +32 -30
  157. package/dist/index176.cjs +1 -1
  158. package/dist/index176.js +3 -5
  159. package/dist/index177.cjs +1 -1
  160. package/dist/index177.js +25 -35
  161. package/dist/index178.cjs +1 -1
  162. package/dist/index178.js +8 -49
  163. package/dist/index179.cjs +1 -1
  164. package/dist/index179.js +25 -32
  165. package/dist/index18.cjs +1 -1
  166. package/dist/index18.js +5 -5
  167. package/dist/index180.cjs +1 -1
  168. package/dist/index180.js +28 -8
  169. package/dist/index181.cjs +1 -1
  170. package/dist/index181.js +3 -42
  171. package/dist/index182.cjs +1 -1
  172. package/dist/index182.js +6 -51
  173. package/dist/index183.cjs +1 -1
  174. package/dist/index183.js +6 -104
  175. package/dist/index184.cjs +1 -1
  176. package/dist/index184.js +33 -3
  177. package/dist/index185.cjs +1 -1
  178. package/dist/index185.js +5 -6
  179. package/dist/index186.cjs +1 -1
  180. package/dist/index186.js +37 -3
  181. package/dist/index187.cjs +1 -1
  182. package/dist/index187.js +49 -17
  183. package/dist/index188.cjs +1 -1
  184. package/dist/index188.js +32 -5
  185. package/dist/index189.cjs +1 -1
  186. package/dist/index189.js +17 -8
  187. package/dist/index190.cjs +1 -1
  188. package/dist/index190.js +39 -100
  189. package/dist/index191.cjs +1 -1
  190. package/dist/index191.js +104 -5
  191. package/dist/index192.cjs +1 -1
  192. package/dist/index192.js +3 -7
  193. package/dist/index193.cjs +1 -1
  194. package/dist/index193.js +5 -27
  195. package/dist/index194.cjs +1 -1
  196. package/dist/index194.js +3 -34
  197. package/dist/index195.cjs +1 -1
  198. package/dist/index195.js +17 -13
  199. package/dist/index196.cjs +1 -1
  200. package/dist/index196.js +5 -78
  201. package/dist/index197.cjs +1 -1
  202. package/dist/index197.js +9 -2
  203. package/dist/index198.cjs +1 -1
  204. package/dist/index198.js +102 -17
  205. package/dist/index199.cjs +1 -1
  206. package/dist/index199.js +5 -171
  207. package/dist/index20.cjs +1 -1
  208. package/dist/index20.js +8 -8
  209. package/dist/index200.cjs +1 -1
  210. package/dist/index200.js +6 -17
  211. package/dist/index201.cjs +1 -1
  212. package/dist/index201.js +27 -10
  213. package/dist/index202.cjs +1 -1
  214. package/dist/index202.js +34 -25
  215. package/dist/index203.cjs +1 -1
  216. package/dist/index203.js +13 -18
  217. package/dist/index204.cjs +1 -1
  218. package/dist/index204.js +78 -15
  219. package/dist/index205.cjs +1 -1
  220. package/dist/index205.js +2 -6
  221. package/dist/index206.cjs +1 -1
  222. package/dist/index206.js +18 -13
  223. package/dist/index207.cjs +1 -1
  224. package/dist/index207.js +171 -10
  225. package/dist/index208.cjs +1 -1
  226. package/dist/index208.js +17 -16
  227. package/dist/index209.cjs +1 -1
  228. package/dist/index209.js +10 -24
  229. package/dist/index210.cjs +1 -1
  230. package/dist/index210.js +24 -45
  231. package/dist/index211.cjs +1 -1
  232. package/dist/index211.js +17 -8
  233. package/dist/index212.cjs +1 -2
  234. package/dist/index212.js +15 -41
  235. package/dist/index213.cjs +1 -1
  236. package/dist/index213.js +6 -2
  237. package/dist/index214.cjs +1 -1
  238. package/dist/index214.js +13 -5
  239. package/dist/index215.cjs +1 -1
  240. package/dist/index215.js +10 -10
  241. package/dist/index216.cjs +1 -1
  242. package/dist/index216.js +16 -19
  243. package/dist/index217.cjs +1 -1
  244. package/dist/index217.js +24 -8
  245. package/dist/index218.cjs +1 -1
  246. package/dist/index218.js +46 -66
  247. package/dist/index219.cjs +1 -1
  248. package/dist/index219.js +9 -65
  249. package/dist/index22.cjs +1 -1
  250. package/dist/index22.js +8 -8
  251. package/dist/index220.cjs +2 -1
  252. package/dist/index220.js +40 -187
  253. package/dist/index221.cjs +1 -1
  254. package/dist/index221.js +2 -29
  255. package/dist/index222.cjs +1 -1
  256. package/dist/index222.js +5 -76
  257. package/dist/index223.cjs +1 -1
  258. package/dist/index223.js +9 -39
  259. package/dist/index224.cjs +1 -1
  260. package/dist/index224.js +17 -14
  261. package/dist/index225.cjs +1 -1
  262. package/dist/index225.js +8 -13
  263. package/dist/index226.cjs +1 -1
  264. package/dist/index226.js +66 -11
  265. package/dist/index227.cjs +1 -1
  266. package/dist/index227.js +64 -11
  267. package/dist/index228.cjs +1 -1
  268. package/dist/index228.js +187 -18
  269. package/dist/index229.cjs +1 -1
  270. package/dist/index229.js +26 -106
  271. package/dist/index23.cjs +1 -1
  272. package/dist/index23.js +26 -12
  273. package/dist/index230.cjs +1 -1
  274. package/dist/index230.js +76 -6
  275. package/dist/index231.cjs +1 -1
  276. package/dist/index231.js +41 -7
  277. package/dist/index232.cjs +1 -1
  278. package/dist/index232.js +15 -102
  279. package/dist/index233.cjs +1 -1
  280. package/dist/index233.js +12 -25
  281. package/dist/index234.cjs +1 -1
  282. package/dist/index234.js +11 -16
  283. package/dist/index235.cjs +1 -1
  284. package/dist/index235.js +10 -212
  285. package/dist/index236.cjs +1 -1
  286. package/dist/index236.js +18 -41
  287. package/dist/index237.cjs +1 -1
  288. package/dist/index237.js +106 -76
  289. package/dist/index238.cjs +1 -1
  290. package/dist/index238.js +104 -2
  291. package/dist/index239.cjs +1 -1
  292. package/dist/index239.js +6 -11
  293. package/dist/index24.cjs +1 -1
  294. package/dist/index24.js +8 -59
  295. package/dist/index240.cjs +1 -1
  296. package/dist/index240.js +7 -20
  297. package/dist/index241.cjs +1 -2
  298. package/dist/index241.js +24 -64
  299. package/dist/index242.cjs +1 -1
  300. package/dist/index242.js +16 -14
  301. package/dist/index243.cjs +1 -1
  302. package/dist/index243.js +214 -68
  303. package/dist/index244.cjs +1 -1
  304. package/dist/index244.js +196 -647
  305. package/dist/index245.cjs +1 -1
  306. package/dist/index245.js +39 -203
  307. package/dist/index246.cjs +1 -1
  308. package/dist/index246.js +72 -171
  309. package/dist/index247.cjs +1 -1
  310. package/dist/index247.js +2 -5
  311. package/dist/index248.cjs +1 -1
  312. package/dist/index248.js +12 -2
  313. package/dist/index249.cjs +1 -0
  314. package/dist/index249.js +22 -0
  315. package/dist/index25.cjs +1 -16
  316. package/dist/index25.js +12 -113
  317. package/dist/index250.cjs +2 -0
  318. package/dist/index250.js +94 -0
  319. package/dist/index251.cjs +1 -0
  320. package/dist/index251.js +17 -0
  321. package/dist/index252.cjs +1 -0
  322. package/dist/index252.js +71 -0
  323. package/dist/index253.cjs +1 -0
  324. package/dist/index253.js +660 -0
  325. package/dist/index254.cjs +1 -0
  326. package/dist/index254.js +180 -0
  327. package/dist/index255.cjs +1 -0
  328. package/dist/index255.js +7 -0
  329. package/dist/index256.cjs +1 -0
  330. package/dist/index256.js +4 -0
  331. package/dist/index26.cjs +1 -1
  332. package/dist/index26.js +59 -30
  333. package/dist/index27.cjs +16 -1
  334. package/dist/index27.js +111 -24
  335. package/dist/index28.cjs +1 -1
  336. package/dist/index28.js +29 -7
  337. package/dist/index29.cjs +1 -1
  338. package/dist/index29.js +35 -35
  339. package/dist/index30.cjs +1 -1
  340. package/dist/index30.js +9 -9
  341. package/dist/index31.cjs +1 -1
  342. package/dist/index31.js +2 -2
  343. package/dist/index35.cjs +1 -1
  344. package/dist/index35.js +1 -1
  345. package/dist/index37.cjs +1 -1
  346. package/dist/index37.js +11 -11
  347. package/dist/index38.cjs +1 -1
  348. package/dist/index38.js +3 -3
  349. package/dist/index39.cjs +1 -1
  350. package/dist/index39.js +3 -3
  351. package/dist/index40.cjs +1 -1
  352. package/dist/index40.js +3 -3
  353. package/dist/index42.cjs +1 -1
  354. package/dist/index42.js +2 -2
  355. package/dist/index43.cjs +1 -1
  356. package/dist/index43.js +2 -2
  357. package/dist/index45.cjs +1 -1
  358. package/dist/index45.js +15 -15
  359. package/dist/index46.cjs +1 -1
  360. package/dist/index46.js +1 -1
  361. package/dist/index47.cjs +1 -1
  362. package/dist/index47.js +4 -4
  363. package/dist/index48.cjs +1 -1
  364. package/dist/index48.js +14 -17
  365. package/dist/index49.cjs +1 -1
  366. package/dist/index49.js +3 -3
  367. package/dist/index51.cjs +1 -1
  368. package/dist/index51.js +8 -8
  369. package/dist/index54.cjs +1 -1
  370. package/dist/index54.js +14 -14
  371. package/dist/index56.cjs +1 -1
  372. package/dist/index56.js +60 -56
  373. package/dist/index58.cjs +1 -1
  374. package/dist/index58.js +1 -1
  375. package/dist/index60.cjs +1 -1
  376. package/dist/index60.js +8 -8
  377. package/dist/index62.cjs +1 -1
  378. package/dist/index62.js +2 -2
  379. package/dist/index63.cjs +1 -1
  380. package/dist/index63.js +3 -3
  381. package/dist/index64.cjs +1 -1
  382. package/dist/index64.js +131 -76
  383. package/dist/index65.cjs +1 -1
  384. package/dist/index65.js +2 -2
  385. package/dist/index66.cjs +1 -1
  386. package/dist/index66.js +76 -6
  387. package/dist/index67.cjs +1 -1
  388. package/dist/index67.js +13 -21
  389. package/dist/index68.cjs +1 -1
  390. package/dist/index68.js +51 -8
  391. package/dist/index69.cjs +1 -1
  392. package/dist/index69.js +7 -31
  393. package/dist/index70.cjs +1 -1
  394. package/dist/index70.js +7 -7
  395. package/dist/index71.cjs +1 -1
  396. package/dist/index71.js +21 -16
  397. package/dist/index72.cjs +1 -1
  398. package/dist/index72.js +8 -73
  399. package/dist/index73.cjs +1 -1
  400. package/dist/index73.js +31 -35
  401. package/dist/index74.cjs +1 -1
  402. package/dist/index74.js +15 -15
  403. package/dist/index75.cjs +1 -1
  404. package/dist/index75.js +69 -61
  405. package/dist/index76.cjs +1 -1
  406. package/dist/index76.js +35 -11
  407. package/dist/index77.cjs +1 -1
  408. package/dist/index77.js +15 -13
  409. package/dist/index78.cjs +1 -3
  410. package/dist/index78.js +72 -92
  411. package/dist/index79.cjs +1 -1
  412. package/dist/index79.js +11 -23
  413. package/dist/index80.cjs +1 -1
  414. package/dist/index80.js +28 -32
  415. package/dist/index81.cjs +2 -1
  416. package/dist/index81.js +118 -42
  417. package/dist/index82.cjs +1 -1
  418. package/dist/index82.js +13 -5
  419. package/dist/index83.cjs +1 -1
  420. package/dist/index83.js +24 -151
  421. package/dist/index84.cjs +1 -20
  422. package/dist/index84.js +31 -324
  423. package/dist/index85.cjs +1 -3
  424. package/dist/index85.js +42 -449
  425. package/dist/index86.cjs +1 -1
  426. package/dist/index86.js +6 -64
  427. package/dist/index87.cjs +1 -1
  428. package/dist/index87.js +101 -35
  429. package/dist/index88.cjs +1 -1
  430. package/dist/index88.js +36 -14
  431. package/dist/index89.cjs +1 -1
  432. package/dist/index89.js +9 -2
  433. package/dist/index90.cjs +1 -1
  434. package/dist/index90.js +19 -15
  435. package/dist/index91.cjs +1 -1
  436. package/dist/index91.js +2 -11
  437. package/dist/index92.cjs +1 -1
  438. package/dist/index92.js +72 -122
  439. package/dist/index93.cjs +1 -1
  440. package/dist/index93.js +15 -5
  441. package/dist/index94.cjs +1 -1
  442. package/dist/index94.js +151 -21
  443. package/dist/index95.cjs +20 -1
  444. package/dist/index95.js +326 -45
  445. package/dist/index96.cjs +3 -1
  446. package/dist/index96.js +451 -38
  447. package/dist/index97.cjs +1 -1
  448. package/dist/index97.js +64 -6
  449. package/dist/index98.cjs +1 -1
  450. package/dist/index98.js +15 -87
  451. package/dist/index99.cjs +1 -1
  452. package/dist/index99.js +10 -14
  453. package/package.json +3 -3
package/dist/index204.js CHANGED
@@ -1,18 +1,81 @@
1
- import { hashAuthorization as a } from "./index208.js";
2
- import { sign as e } from "./index203.js";
3
- async function u(t) {
4
- const { chainId: o, nonce: n, privateKey: c, to: i = "object" } = t, r = t.contractAddress ?? t.address, s = await e({
5
- hash: a({ address: r, chainId: o, nonce: n }),
6
- privateKey: c,
7
- to: i
8
- });
9
- return i === "object" ? {
10
- address: r,
11
- chainId: o,
12
- nonce: n,
13
- ...s
14
- } : s;
1
+ import { versionedHashVersionKzg as c } from "./index205.js";
2
+ import { maxUint256 as m } from "./index19.js";
3
+ import { InvalidAddressError as s } from "./index150.js";
4
+ import { BaseError as h } from "./index35.js";
5
+ import { EmptyBlobError as P, InvalidVersionedHashSizeError as p, InvalidVersionedHashVersionError as x } from "./index186.js";
6
+ import { InvalidChainIdError as n } from "./index36.js";
7
+ import { FeeCapTooHighError as w, TipAboveFeeCapError as E } from "./index163.js";
8
+ import { isAddress as f } from "./index174.js";
9
+ import { size as F } from "./index149.js";
10
+ import { slice as I } from "./index104.js";
11
+ import { hexToNumber as G } from "./index65.js";
12
+ function C(t) {
13
+ const { authorizationList: e } = t;
14
+ if (e)
15
+ for (const o of e) {
16
+ const { chainId: r } = o, i = o.address;
17
+ if (!f(i))
18
+ throw new s({ address: i });
19
+ if (r < 0)
20
+ throw new n({ chainId: r });
21
+ }
22
+ d(t);
23
+ }
24
+ function L(t) {
25
+ const { blobVersionedHashes: e } = t;
26
+ if (e) {
27
+ if (e.length === 0)
28
+ throw new P();
29
+ for (const o of e) {
30
+ const r = F(o), i = G(I(o, 0, 1));
31
+ if (r !== 32)
32
+ throw new p({ hash: o, size: r });
33
+ if (i !== c)
34
+ throw new x({
35
+ hash: o,
36
+ version: i
37
+ });
38
+ }
39
+ }
40
+ d(t);
41
+ }
42
+ function d(t) {
43
+ const { chainId: e, maxPriorityFeePerGas: o, maxFeePerGas: r, to: i } = t;
44
+ if (e <= 0)
45
+ throw new n({ chainId: e });
46
+ if (i && !f(i))
47
+ throw new s({ address: i });
48
+ if (r && r > m)
49
+ throw new w({ maxFeePerGas: r });
50
+ if (o && r && o > r)
51
+ throw new E({ maxFeePerGas: r, maxPriorityFeePerGas: o });
52
+ }
53
+ function B(t) {
54
+ const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
55
+ if (e <= 0)
56
+ throw new n({ chainId: e });
57
+ if (a && !f(a))
58
+ throw new s({ address: a });
59
+ if (o || i)
60
+ throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");
61
+ if (r && r > m)
62
+ throw new w({ maxFeePerGas: r });
63
+ }
64
+ function K(t) {
65
+ const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
66
+ if (a && !f(a))
67
+ throw new s({ address: a });
68
+ if (typeof e < "u" && e <= 0)
69
+ throw new n({ chainId: e });
70
+ if (o || i)
71
+ throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
72
+ if (r && r > m)
73
+ throw new w({ maxFeePerGas: r });
15
74
  }
16
75
  export {
17
- u as signAuthorization
76
+ d as assertTransactionEIP1559,
77
+ B as assertTransactionEIP2930,
78
+ L as assertTransactionEIP4844,
79
+ C as assertTransactionEIP7702,
80
+ K as assertTransactionLegacy
18
81
  };
package/dist/index205.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index188.cjs"),n=require("./index203.cjs");async function t({message:e,privateKey:s}){return await n.sign({hash:a.hashMessage(e),privateKey:s,to:"hex"})}exports.signMessage=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=1;exports.versionedHashVersionKzg=e;
package/dist/index205.js CHANGED
@@ -1,8 +1,4 @@
1
- import { hashMessage as e } from "./index188.js";
2
- import { sign as o } from "./index203.js";
3
- async function i({ message: s, privateKey: a }) {
4
- return await o({ hash: e(s), privateKey: a, to: "hex" });
5
- }
1
+ const e = 1;
6
2
  export {
7
- i as signMessage
3
+ e as versionedHashVersionKzg
8
4
  };
package/dist/index206.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index169.cjs"),c=require("./index199.cjs"),o=require("./index203.cjs");async function u(i){const{privateKey:r,transaction:e,serializer:n=c.serializeTransaction}=i,a=e.type==="eip4844"?{...e,sidecars:!1}:e,s=await o.sign({hash:t.keccak256(n(a)),privateKey:r});return n(e,s)}exports.signTransaction=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index150.cjs"),d=require("./index81.cjs"),l=require("./index174.cjs");function a(e){if(!e||e.length===0)return[];const n=[];for(let t=0;t<e.length;t++){const{address:i,storageKeys:r}=e[t];for(let s=0;s<r.length;s++)if(r[s].length-2!==64)throw new d.InvalidStorageKeySizeError({storageKey:r[s]});if(!l.isAddress(i,{strict:!1}))throw new o.InvalidAddressError({address:i});n.push([i,r])}return n}exports.serializeAccessList=a;
package/dist/index206.js CHANGED
@@ -1,16 +1,21 @@
1
- import { keccak256 as e } from "./index169.js";
2
- import { serializeTransaction as o } from "./index199.js";
3
- import { sign as c } from "./index203.js";
4
- async function u(n) {
5
- const { privateKey: a, transaction: r, serializer: i = o } = n, t = r.type === "eip4844" ? {
6
- ...r,
7
- sidecars: !1
8
- } : r, s = await c({
9
- hash: e(i(t)),
10
- privateKey: a
11
- });
12
- return i(r, s);
1
+ import { InvalidAddressError as s } from "./index150.js";
2
+ import { InvalidStorageKeySizeError as l } from "./index81.js";
3
+ import { isAddress as f } from "./index174.js";
4
+ function a(r) {
5
+ if (!r || r.length === 0)
6
+ return [];
7
+ const n = [];
8
+ for (let o = 0; o < r.length; o++) {
9
+ const { address: i, storageKeys: e } = r[o];
10
+ for (let t = 0; t < e.length; t++)
11
+ if (e[t].length - 2 !== 64)
12
+ throw new l({ storageKey: e[t] });
13
+ if (!f(i, { strict: !1 }))
14
+ throw new s({ address: i });
15
+ n.push([i, e]);
16
+ }
17
+ return n;
13
18
  }
14
19
  export {
15
- u as signTransaction
20
+ a as serializeAccessList
16
21
  };
package/dist/index207.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index190.cjs"),s=require("./index203.cjs");async function i(e){const{privateKey:t,...a}=e;return await s.sign({hash:n.hashTypedData(a),privateKey:t,to:"hex"})}exports.signTypedData=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./index81.cjs"),G=require("./index208.cjs"),R=require("./index112.cjs"),S=require("./index113.cjs"),B=require("./index114.cjs"),V=require("./index115.cjs"),L=require("./index120.cjs"),h=require("./index105.cjs"),r=require("./index42.cjs"),d=require("./index190.cjs"),y=require("./index204.cjs"),C=require("./index117.cjs"),v=require("./index206.cjs");function k(e,o){const n=C.getTransactionType(e);return n==="eip1559"?_(e,o):n==="eip2930"?j(e,o):n==="eip4844"?Y(e,o):n==="eip7702"?w(e,o):M(e,o)}function w(e,o){const{authorizationList:n,chainId:s,gas:i,nonce:c,to:a,value:x,maxFeePerGas:u,maxPriorityFeePerGas:t,accessList:l,data:T}=e;y.assertTransactionEIP7702(e);const b=v.serializeAccessList(l),m=G.serializeAuthorizationList(n);return L.concatHex(["0x04",d.toRlp([r.numberToHex(s),c?r.numberToHex(c):"0x",t?r.numberToHex(t):"0x",u?r.numberToHex(u):"0x",i?r.numberToHex(i):"0x",a??"0x",x?r.numberToHex(x):"0x",T??"0x",b,m,...z(e,o)])])}function Y(e,o){const{chainId:n,gas:s,nonce:i,to:c,value:a,maxFeePerBlobGas:x,maxFeePerGas:u,maxPriorityFeePerGas:t,accessList:l,data:T}=e;y.assertTransactionEIP4844(e);let b=e.blobVersionedHashes,m=e.sidecars;if(e.blobs&&(typeof b>"u"||typeof m>"u")){const f=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(p=>r.bytesToHex(p)),P=e.kzg,H=R.blobsToCommitments({blobs:f,kzg:P});if(typeof b>"u"&&(b=B.commitmentsToVersionedHashes({commitments:H})),typeof m>"u"){const p=S.blobsToProofs({blobs:f,commitments:H,kzg:P});m=V.toBlobSidecars({blobs:f,commitments:H,proofs:p})}}const I=v.serializeAccessList(l),A=[r.numberToHex(n),i?r.numberToHex(i):"0x",t?r.numberToHex(t):"0x",u?r.numberToHex(u):"0x",s?r.numberToHex(s):"0x",c??"0x",a?r.numberToHex(a):"0x",T??"0x",I,x?r.numberToHex(x):"0x",b??[],...z(e,o)],q=[],g=[],E=[];if(m)for(let f=0;f<m.length;f++){const{blob:P,commitment:H,proof:p}=m[f];q.push(P),g.push(H),E.push(p)}return L.concatHex(["0x03",m?d.toRlp([A,q,g,E]):d.toRlp(A)])}function _(e,o){const{chainId:n,gas:s,nonce:i,to:c,value:a,maxFeePerGas:x,maxPriorityFeePerGas:u,accessList:t,data:l}=e;y.assertTransactionEIP1559(e);const T=v.serializeAccessList(t),b=[r.numberToHex(n),i?r.numberToHex(i):"0x",u?r.numberToHex(u):"0x",x?r.numberToHex(x):"0x",s?r.numberToHex(s):"0x",c??"0x",a?r.numberToHex(a):"0x",l??"0x",T,...z(e,o)];return L.concatHex(["0x02",d.toRlp(b)])}function j(e,o){const{chainId:n,gas:s,data:i,nonce:c,to:a,value:x,accessList:u,gasPrice:t}=e;y.assertTransactionEIP2930(e);const l=v.serializeAccessList(u),T=[r.numberToHex(n),c?r.numberToHex(c):"0x",t?r.numberToHex(t):"0x",s?r.numberToHex(s):"0x",a??"0x",x?r.numberToHex(x):"0x",i??"0x",l,...z(e,o)];return L.concatHex(["0x01",d.toRlp(T)])}function M(e,o){const{chainId:n=0,gas:s,data:i,nonce:c,to:a,value:x,gasPrice:u}=e;y.assertTransactionLegacy(e);let t=[c?r.numberToHex(c):"0x",u?r.numberToHex(u):"0x",s?r.numberToHex(s):"0x",a??"0x",x?r.numberToHex(x):"0x",i??"0x"];if(o){const l=(()=>{if(o.v>=35n)return(o.v-35n)/2n>0?o.v:27n+(o.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+o.v-27n);const m=27n+(o.v===27n?0n:1n);if(o.v!==m)throw new F.InvalidLegacyVError({v:o.v});return m})(),T=h.trim(o.r),b=h.trim(o.s);t=[...t,r.numberToHex(l),T==="0x00"?"0x":T,b==="0x00"?"0x":b]}else n>0&&(t=[...t,r.numberToHex(n),"0x","0x"]);return d.toRlp(t)}function z(e,o){const n=o??e,{v:s,yParity:i}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof s>"u"&&typeof i>"u")return[];const c=h.trim(n.r),a=h.trim(n.s);return[typeof i=="number"?i?r.numberToHex(1):"0x":s===0n?"0x":s===1n?r.numberToHex(1):s===27n?"0x":r.numberToHex(1),c==="0x00"?"0x":c,a==="0x00"?"0x":a]}exports.serializeTransaction=k;exports.toYParitySignatureArray=z;
package/dist/index207.js CHANGED
@@ -1,13 +1,174 @@
1
- import { hashTypedData as o } from "./index190.js";
2
- import { sign as r } from "./index203.js";
3
- async function p(t) {
4
- const { privateKey: a, ...e } = t;
5
- return await r({
6
- hash: o(e),
7
- privateKey: a,
8
- to: "hex"
9
- });
1
+ import { InvalidLegacyVError as H } from "./index81.js";
2
+ import { serializeAuthorizationList as g } from "./index208.js";
3
+ import { blobsToCommitments as B } from "./index112.js";
4
+ import { blobsToProofs as V } from "./index113.js";
5
+ import { commitmentsToVersionedHashes as C } from "./index114.js";
6
+ import { toBlobSidecars as k } from "./index115.js";
7
+ import { concatHex as h } from "./index120.js";
8
+ import { trim as T } from "./index105.js";
9
+ import { numberToHex as o, bytesToHex as w } from "./index42.js";
10
+ import { toRlp as b } from "./index190.js";
11
+ import { assertTransactionEIP1559 as S, assertTransactionEIP2930 as _, assertTransactionEIP4844 as R, assertTransactionEIP7702 as Y, assertTransactionLegacy as j } from "./index204.js";
12
+ import { getTransactionType as q } from "./index117.js";
13
+ import { serializeAccessList as v } from "./index206.js";
14
+ function te(e, r) {
15
+ const i = q(e);
16
+ return i === "eip1559" ? K(e, r) : i === "eip2930" ? M(e, r) : i === "eip4844" ? J(e, r) : i === "eip7702" ? D(e, r) : N(e, r);
17
+ }
18
+ function D(e, r) {
19
+ const { authorizationList: i, chainId: s, gas: n, nonce: c, to: f, value: a, maxFeePerGas: x, maxPriorityFeePerGas: t, accessList: p, data: l } = e;
20
+ Y(e);
21
+ const d = v(p), m = g(i);
22
+ return h([
23
+ "0x04",
24
+ b([
25
+ o(s),
26
+ c ? o(c) : "0x",
27
+ t ? o(t) : "0x",
28
+ x ? o(x) : "0x",
29
+ n ? o(n) : "0x",
30
+ f ?? "0x",
31
+ a ? o(a) : "0x",
32
+ l ?? "0x",
33
+ d,
34
+ m,
35
+ ...I(e, r)
36
+ ])
37
+ ]);
38
+ }
39
+ function J(e, r) {
40
+ const { chainId: i, gas: s, nonce: n, to: c, value: f, maxFeePerBlobGas: a, maxFeePerGas: x, maxPriorityFeePerGas: t, accessList: p, data: l } = e;
41
+ R(e);
42
+ let d = e.blobVersionedHashes, m = e.sidecars;
43
+ if (e.blobs && (typeof d > "u" || typeof m > "u")) {
44
+ const u = typeof e.blobs[0] == "string" ? e.blobs : e.blobs.map((P) => w(P)), z = e.kzg, y = B({
45
+ blobs: u,
46
+ kzg: z
47
+ });
48
+ if (typeof d > "u" && (d = C({
49
+ commitments: y
50
+ })), typeof m > "u") {
51
+ const P = V({ blobs: u, commitments: y, kzg: z });
52
+ m = k({ blobs: u, commitments: y, proofs: P });
53
+ }
54
+ }
55
+ const L = v(p), E = [
56
+ o(i),
57
+ n ? o(n) : "0x",
58
+ t ? o(t) : "0x",
59
+ x ? o(x) : "0x",
60
+ s ? o(s) : "0x",
61
+ c ?? "0x",
62
+ f ? o(f) : "0x",
63
+ l ?? "0x",
64
+ L,
65
+ a ? o(a) : "0x",
66
+ d ?? [],
67
+ ...I(e, r)
68
+ ], A = [], F = [], G = [];
69
+ if (m)
70
+ for (let u = 0; u < m.length; u++) {
71
+ const { blob: z, commitment: y, proof: P } = m[u];
72
+ A.push(z), F.push(y), G.push(P);
73
+ }
74
+ return h([
75
+ "0x03",
76
+ m ? (
77
+ // If sidecars are enabled, envelope turns into a "wrapper":
78
+ b([E, A, F, G])
79
+ ) : (
80
+ // If sidecars are disabled, standard envelope is used:
81
+ b(E)
82
+ )
83
+ ]);
84
+ }
85
+ function K(e, r) {
86
+ const { chainId: i, gas: s, nonce: n, to: c, value: f, maxFeePerGas: a, maxPriorityFeePerGas: x, accessList: t, data: p } = e;
87
+ S(e);
88
+ const l = v(t), d = [
89
+ o(i),
90
+ n ? o(n) : "0x",
91
+ x ? o(x) : "0x",
92
+ a ? o(a) : "0x",
93
+ s ? o(s) : "0x",
94
+ c ?? "0x",
95
+ f ? o(f) : "0x",
96
+ p ?? "0x",
97
+ l,
98
+ ...I(e, r)
99
+ ];
100
+ return h([
101
+ "0x02",
102
+ b(d)
103
+ ]);
104
+ }
105
+ function M(e, r) {
106
+ const { chainId: i, gas: s, data: n, nonce: c, to: f, value: a, accessList: x, gasPrice: t } = e;
107
+ _(e);
108
+ const p = v(x), l = [
109
+ o(i),
110
+ c ? o(c) : "0x",
111
+ t ? o(t) : "0x",
112
+ s ? o(s) : "0x",
113
+ f ?? "0x",
114
+ a ? o(a) : "0x",
115
+ n ?? "0x",
116
+ p,
117
+ ...I(e, r)
118
+ ];
119
+ return h([
120
+ "0x01",
121
+ b(l)
122
+ ]);
123
+ }
124
+ function N(e, r) {
125
+ const { chainId: i = 0, gas: s, data: n, nonce: c, to: f, value: a, gasPrice: x } = e;
126
+ j(e);
127
+ let t = [
128
+ c ? o(c) : "0x",
129
+ x ? o(x) : "0x",
130
+ s ? o(s) : "0x",
131
+ f ?? "0x",
132
+ a ? o(a) : "0x",
133
+ n ?? "0x"
134
+ ];
135
+ if (r) {
136
+ const p = (() => {
137
+ if (r.v >= 35n)
138
+ return (r.v - 35n) / 2n > 0 ? r.v : 27n + (r.v === 35n ? 0n : 1n);
139
+ if (i > 0)
140
+ return BigInt(i * 2) + BigInt(35n + r.v - 27n);
141
+ const m = 27n + (r.v === 27n ? 0n : 1n);
142
+ if (r.v !== m)
143
+ throw new H({ v: r.v });
144
+ return m;
145
+ })(), l = T(r.r), d = T(r.s);
146
+ t = [
147
+ ...t,
148
+ o(p),
149
+ l === "0x00" ? "0x" : l,
150
+ d === "0x00" ? "0x" : d
151
+ ];
152
+ } else i > 0 && (t = [
153
+ ...t,
154
+ o(i),
155
+ "0x",
156
+ "0x"
157
+ ]);
158
+ return b(t);
159
+ }
160
+ function I(e, r) {
161
+ const i = r ?? e, { v: s, yParity: n } = i;
162
+ if (typeof i.r > "u")
163
+ return [];
164
+ if (typeof i.s > "u")
165
+ return [];
166
+ if (typeof s > "u" && typeof n > "u")
167
+ return [];
168
+ const c = T(i.r), f = T(i.s);
169
+ return [typeof n == "number" ? n ? o(1) : "0x" : s === 0n ? "0x" : s === 1n ? o(1) : s === 27n ? "0x" : o(1), c === "0x00" ? "0x" : c, f === "0x00" ? "0x" : f];
10
170
  }
11
171
  export {
12
- p as signTypedData
172
+ te as serializeTransaction,
173
+ I as toYParitySignatureArray
13
174
  };
package/dist/index208.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index111.cjs"),u=require("./index159.cjs"),c=require("./index42.cjs"),a=require("./index181.cjs"),h=require("./index169.cjs");function d(e){const{chainId:t,nonce:o,to:r}=e,s=e.contractAddress??e.address,n=h.keccak256(i.concatHex(["0x05",a.toRlp([t?c.numberToHex(t):"0x",s,o?c.numberToHex(o):"0x"])]));return r==="bytes"?u.hexToBytes(n):n}exports.hashAuthorization=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index42.cjs"),c=require("./index207.cjs");function u(t){if(!t||t.length===0)return[];const e=[];for(const r of t){const{chainId:i,nonce:o,...s}=r,a=r.address;e.push([i?n.toHex(i):"0x",a,o?n.toHex(o):"0x",...c.toYParitySignatureArray({},s)])}return e}exports.serializeAuthorizationList=u;
package/dist/index208.js CHANGED
@@ -1,19 +1,20 @@
1
- import { concatHex as i } from "./index111.js";
2
- import { hexToBytes as m } from "./index159.js";
3
- import { numberToHex as c } from "./index42.js";
4
- import { toRlp as d } from "./index181.js";
5
- import { keccak256 as f } from "./index169.js";
6
- function b(o) {
7
- const { chainId: t, nonce: r, to: s } = o, e = o.contractAddress ?? o.address, n = f(i([
8
- "0x05",
9
- d([
10
- t ? c(t) : "0x",
11
- e,
12
- r ? c(r) : "0x"
13
- ])
14
- ]));
15
- return s === "bytes" ? m(n) : n;
1
+ import { toHex as i } from "./index42.js";
2
+ import { toYParitySignatureArray as c } from "./index207.js";
3
+ function f(r) {
4
+ if (!r || r.length === 0)
5
+ return [];
6
+ const t = [];
7
+ for (const o of r) {
8
+ const { chainId: n, nonce: e, ...s } = o, a = o.address;
9
+ t.push([
10
+ n ? i(n) : "0x",
11
+ a,
12
+ e ? i(e) : "0x",
13
+ ...c({}, s)
14
+ ]);
15
+ }
16
+ return t;
16
17
  }
17
18
  export {
18
- b as hashAuthorization
19
+ f as serializeAuthorizationList
19
20
  };
package/dist/index209.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index35.cjs"),o=require("./index154.cjs");function s(n,e){const t=(n.details||"").toLowerCase(),i=n instanceof c.BaseError?n.walk(r=>(r==null?void 0:r.code)===o.ExecutionRevertedError.code):n;return i instanceof c.BaseError?new o.ExecutionRevertedError({cause:n,message:i.details}):o.ExecutionRevertedError.nodeMessage.test(t)?new o.ExecutionRevertedError({cause:n,message:n.details}):o.FeeCapTooHighError.nodeMessage.test(t)?new o.FeeCapTooHighError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):o.FeeCapTooLowError.nodeMessage.test(t)?new o.FeeCapTooLowError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):o.NonceTooHighError.nodeMessage.test(t)?new o.NonceTooHighError({cause:n,nonce:e==null?void 0:e.nonce}):o.NonceTooLowError.nodeMessage.test(t)?new o.NonceTooLowError({cause:n,nonce:e==null?void 0:e.nonce}):o.NonceMaxValueError.nodeMessage.test(t)?new o.NonceMaxValueError({cause:n,nonce:e==null?void 0:e.nonce}):o.InsufficientFundsError.nodeMessage.test(t)?new o.InsufficientFundsError({cause:n}):o.IntrinsicGasTooHighError.nodeMessage.test(t)?new o.IntrinsicGasTooHighError({cause:n,gas:e==null?void 0:e.gas}):o.IntrinsicGasTooLowError.nodeMessage.test(t)?new o.IntrinsicGasTooLowError({cause:n,gas:e==null?void 0:e.gas}):o.TransactionTypeNotSupportedError.nodeMessage.test(t)?new o.TransactionTypeNotSupportedError({cause:n}):o.TipAboveFeeCapError.nodeMessage.test(t)?new o.TipAboveFeeCapError({cause:n,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new o.UnknownNodeError({cause:n})}exports.getNodeError=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(r,i){let t=r.toString();const n=t.startsWith("-");n&&(t=t.slice(1)),t=t.padStart(i,"0");let[l,e]=[t.slice(0,t.length-i),t.slice(t.length-i)];return e=e.replace(/(0+)$/,""),`${n?"-":""}${l||"0"}${e?`.${e}`:""}`}exports.formatUnits=o;
package/dist/index209.js CHANGED
@@ -1,27 +1,13 @@
1
- import { BaseError as c } from "./index35.js";
2
- import { ExecutionRevertedError as t, FeeCapTooHighError as u, FeeCapTooLowError as d, NonceTooHighError as a, NonceTooLowError as f, NonceMaxValueError as w, InsufficientFundsError as r, IntrinsicGasTooHighError as E, IntrinsicGasTooLowError as m, TransactionTypeNotSupportedError as x, TipAboveFeeCapError as F, UnknownNodeError as M } from "./index154.js";
3
- function P(o, e) {
4
- const n = (o.details || "").toLowerCase(), s = o instanceof c ? o.walk((i) => (i == null ? void 0 : i.code) === t.code) : o;
5
- return s instanceof c ? new t({
6
- cause: o,
7
- message: s.details
8
- }) : t.nodeMessage.test(n) ? new t({
9
- cause: o,
10
- message: o.details
11
- }) : u.nodeMessage.test(n) ? new u({
12
- cause: o,
13
- maxFeePerGas: e == null ? void 0 : e.maxFeePerGas
14
- }) : d.nodeMessage.test(n) ? new d({
15
- cause: o,
16
- maxFeePerGas: e == null ? void 0 : e.maxFeePerGas
17
- }) : a.nodeMessage.test(n) ? new a({ cause: o, nonce: e == null ? void 0 : e.nonce }) : f.nodeMessage.test(n) ? new f({ cause: o, nonce: e == null ? void 0 : e.nonce }) : w.nodeMessage.test(n) ? new w({ cause: o, nonce: e == null ? void 0 : e.nonce }) : r.nodeMessage.test(n) ? new r({ cause: o }) : E.nodeMessage.test(n) ? new E({ cause: o, gas: e == null ? void 0 : e.gas }) : m.nodeMessage.test(n) ? new m({ cause: o, gas: e == null ? void 0 : e.gas }) : x.nodeMessage.test(n) ? new x({ cause: o }) : F.nodeMessage.test(n) ? new F({
18
- cause: o,
19
- maxFeePerGas: e == null ? void 0 : e.maxFeePerGas,
20
- maxPriorityFeePerGas: e == null ? void 0 : e.maxPriorityFeePerGas
21
- }) : new M({
22
- cause: o
23
- });
1
+ function a(r, n) {
2
+ let t = r.toString();
3
+ const i = t.startsWith("-");
4
+ i && (t = t.slice(1)), t = t.padStart(n, "0");
5
+ let [l, e] = [
6
+ t.slice(0, t.length - n),
7
+ t.slice(t.length - n)
8
+ ];
9
+ return e = e.replace(/(0+)$/, ""), `${i ? "-" : ""}${l || "0"}${e ? `.${e}` : ""}`;
24
10
  }
25
11
  export {
26
- P as getNodeError
12
+ a as formatUnits
27
13
  };
package/dist/index210.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index241.cjs"),f=require("./index242.cjs");function l(t,i={}){const{signed:n,size:e}=i,o=BigInt(t);let r;e?n?r=(1n<<BigInt(e)*8n-1n)-1n:r=2n**(BigInt(e)*8n)-1n:typeof t=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const u=typeof r=="bigint"&&n?-r-1n:0;if(r&&o>r||o<u){const s=typeof t=="bigint"?"n":"";throw new d({max:r?`${r}${s}`:void 0,min:`${u}${s}`,signed:n,size:e,value:`${t}${s}`})}const a=`0x${(n&&o<0?(1n<<BigInt(e*8))+BigInt(o):o).toString(16)}`;return e?c(a,e):a}function c(t,i){return f.pad(t,{dir:"left",size:i})}class d extends g.BaseError{constructor({max:i,min:n,signed:e,size:o,value:r}){super(`Number \`${r}\` is not in safe${o?` ${o*8}-bit`:""}${e?" signed":" unsigned"} integer range ${i?`(\`${n}\` to \`${i}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class b extends g.BaseError{constructor({size:i,targetSize:n,type:e}){super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (\`${i}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}exports.IntegerOutOfRangeError=d;exports.SizeExceedsPaddingSizeError=b;exports.fromNumber=l;exports.padLeft=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index150.cjs"),t=require("./index174.cjs");function i(s){if(typeof s=="string"){if(!t.isAddress(s,{strict:!1}))throw new n.InvalidAddressError({address:s});return{address:s,type:"json-rpc"}}if(!t.isAddress(s.address,{strict:!1}))throw new n.InvalidAddressError({address:s.address});return{address:s.address,nonceManager:s.nonceManager,sign:s.sign,signAuthorization:s.signAuthorization,signMessage:s.signMessage,signTransaction:s.signTransaction,signTypedData:s.signTypedData,source:"custom",type:"local"}}exports.toAccount=i;
package/dist/index210.js CHANGED
@@ -1,49 +1,28 @@
1
- import { BaseError as f } from "./index241.js";
2
- import { pad as g } from "./index242.js";
3
- function m(t, i = {}) {
4
- const { signed: r, size: e } = i, o = BigInt(t);
5
- let n;
6
- e ? r ? n = (1n << BigInt(e) * 8n - 1n) - 1n : n = 2n ** (BigInt(e) * 8n) - 1n : typeof t == "number" && (n = BigInt(Number.MAX_SAFE_INTEGER));
7
- const u = typeof n == "bigint" && r ? -n - 1n : 0;
8
- if (n && o > n || o < u) {
9
- const s = typeof t == "bigint" ? "n" : "";
10
- throw new d({
11
- max: n ? `${n}${s}` : void 0,
12
- min: `${u}${s}`,
13
- signed: r,
14
- size: e,
15
- value: `${t}${s}`
16
- });
17
- }
18
- const a = `0x${(r && o < 0 ? (1n << BigInt(e * 8)) + BigInt(o) : o).toString(16)}`;
19
- return e ? c(a, e) : a;
20
- }
21
- function c(t, i) {
22
- return g(t, { dir: "left", size: i });
23
- }
24
- class d extends f {
25
- constructor({ max: i, min: r, signed: e, size: o, value: n }) {
26
- super(`Number \`${n}\` is not in safe${o ? ` ${o * 8}-bit` : ""}${e ? " signed" : " unsigned"} integer range ${i ? `(\`${r}\` to \`${i}\`)` : `(above \`${r}\`)`}`), Object.defineProperty(this, "name", {
27
- enumerable: !0,
28
- configurable: !0,
29
- writable: !0,
30
- value: "Hex.IntegerOutOfRangeError"
31
- });
32
- }
33
- }
34
- class p extends f {
35
- constructor({ size: i, targetSize: r, type: e }) {
36
- super(`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()} size (\`${i}\`) exceeds padding size (\`${r}\`).`), Object.defineProperty(this, "name", {
37
- enumerable: !0,
38
- configurable: !0,
39
- writable: !0,
40
- value: "Hex.SizeExceedsPaddingSizeError"
41
- });
1
+ import { InvalidAddressError as s } from "./index150.js";
2
+ import { isAddress as a } from "./index174.js";
3
+ function r(n) {
4
+ if (typeof n == "string") {
5
+ if (!a(n, { strict: !1 }))
6
+ throw new s({ address: n });
7
+ return {
8
+ address: n,
9
+ type: "json-rpc"
10
+ };
42
11
  }
12
+ if (!a(n.address, { strict: !1 }))
13
+ throw new s({ address: n.address });
14
+ return {
15
+ address: n.address,
16
+ nonceManager: n.nonceManager,
17
+ sign: n.sign,
18
+ signAuthorization: n.signAuthorization,
19
+ signMessage: n.signMessage,
20
+ signTransaction: n.signTransaction,
21
+ signTypedData: n.signTypedData,
22
+ source: "custom",
23
+ type: "local"
24
+ };
43
25
  }
44
26
  export {
45
- d as IntegerOutOfRangeError,
46
- p as SizeExceedsPaddingSizeError,
47
- m as fromNumber,
48
- c as padLeft
27
+ r as toAccount
49
28
  };
package/dist/index211.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index210.cjs");function r(e){return{address:e.address,amount:o.fromNumber(e.amount),index:o.fromNumber(e.index),validatorIndex:o.fromNumber(e.validatorIndex)}}exports.toRpc=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index202.cjs"),l=require("./index181.cjs"),y=require("./index168.cjs"),i=require("./index42.cjs"),x=require("./index203.cjs");let r=!1;async function g({hash:n,privateKey:o,to:e="object"}){const{r:c,s:u,recovery:t}=a.secp256k1.sign(n.slice(2),o.slice(2),{lowS:!0,extraEntropy:l.isHex(r,{strict:!1})?y.hexToBytes(r):r}),s={r:i.numberToHex(c,{size:32}),s:i.numberToHex(u,{size:32}),v:t?28n:27n,yParity:t};return e==="bytes"||e==="hex"?x.serializeSignature({...s,to:e}):s}exports.sign=g;
package/dist/index211.js CHANGED
@@ -1,12 +1,21 @@
1
- import { fromNumber as e } from "./index210.js";
2
- function r(o) {
3
- return {
4
- address: o.address,
5
- amount: e(o.amount),
6
- index: e(o.index),
7
- validatorIndex: e(o.validatorIndex)
1
+ import { secp256k1 as a } from "./index202.js";
2
+ import { isHex as f } from "./index181.js";
3
+ import { hexToBytes as p } from "./index168.js";
4
+ import { numberToHex as s } from "./index42.js";
5
+ import { serializeSignature as u } from "./index203.js";
6
+ let e = !1;
7
+ async function z({ hash: o, privateKey: n, to: r = "object" }) {
8
+ const { r: m, s: c, recovery: t } = a.sign(o.slice(2), n.slice(2), {
9
+ lowS: !0,
10
+ extraEntropy: f(e, { strict: !1 }) ? p(e) : e
11
+ }), i = {
12
+ r: s(m, { size: 32 }),
13
+ s: s(c, { size: 32 }),
14
+ v: t ? 28n : 27n,
15
+ yParity: t
8
16
  };
17
+ return r === "bytes" || r === "hex" ? u({ ...i, to: r }) : i;
9
18
  }
10
19
  export {
11
- r as toRpc
20
+ z as sign
12
21
  };
package/dist/index212.cjs CHANGED
@@ -1,2 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index213.cjs");class t extends Error{constructor(a,e={}){var i;const s=e.cause instanceof t?e.cause.details:(i=e.cause)!=null&&i.message?e.cause.message:e.details,r=e.cause instanceof t&&e.cause.docsPath||e.docsPath,u=[a||"An error occurred.","",...e.metaMessages?[...e.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...s?[`Details: ${s}`]:[],`Version: abitype@${o.version}`].join(`
2
- `);super(u),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),e.cause&&(this.cause=e.cause),this.details=s,this.docsPath=r,this.metaMessages=e.metaMessages,this.shortMessage=a}}exports.BaseError=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index216.cjs"),a=require("./index211.cjs");async function u(t){const{chainId:n,nonce:i,privateKey:r,to:o="object"}=t,s=t.contractAddress??t.address,e=await a.sign({hash:c.hashAuthorization({address:s,chainId:n,nonce:i}),privateKey:r,to:o});return o==="object"?{address:s,chainId:n,nonce:i,...e}:e}exports.signAuthorization=u;
package/dist/index212.js CHANGED
@@ -1,44 +1,18 @@
1
- import { version as o } from "./index213.js";
2
- class a extends Error {
3
- constructor(i, e = {}) {
4
- var r;
5
- const t = e.cause instanceof a ? e.cause.details : (r = e.cause) != null && r.message ? e.cause.message : e.details, s = e.cause instanceof a && e.cause.docsPath || e.docsPath, u = [
6
- i || "An error occurred.",
7
- "",
8
- ...e.metaMessages ? [...e.metaMessages, ""] : [],
9
- ...s ? [`Docs: https://abitype.dev${s}`] : [],
10
- ...t ? [`Details: ${t}`] : [],
11
- `Version: abitype@${o}`
12
- ].join(`
13
- `);
14
- super(u), Object.defineProperty(this, "details", {
15
- enumerable: !0,
16
- configurable: !0,
17
- writable: !0,
18
- value: void 0
19
- }), Object.defineProperty(this, "docsPath", {
20
- enumerable: !0,
21
- configurable: !0,
22
- writable: !0,
23
- value: void 0
24
- }), Object.defineProperty(this, "metaMessages", {
25
- enumerable: !0,
26
- configurable: !0,
27
- writable: !0,
28
- value: void 0
29
- }), Object.defineProperty(this, "shortMessage", {
30
- enumerable: !0,
31
- configurable: !0,
32
- writable: !0,
33
- value: void 0
34
- }), Object.defineProperty(this, "name", {
35
- enumerable: !0,
36
- configurable: !0,
37
- writable: !0,
38
- value: "AbiTypeError"
39
- }), e.cause && (this.cause = e.cause), this.details = t, this.docsPath = s, this.metaMessages = e.metaMessages, this.shortMessage = i;
40
- }
1
+ import { hashAuthorization as a } from "./index216.js";
2
+ import { sign as e } from "./index211.js";
3
+ async function u(t) {
4
+ const { chainId: o, nonce: n, privateKey: c, to: i = "object" } = t, r = t.contractAddress ?? t.address, s = await e({
5
+ hash: a({ address: r, chainId: o, nonce: n }),
6
+ privateKey: c,
7
+ to: i
8
+ });
9
+ return i === "object" ? {
10
+ address: r,
11
+ chainId: o,
12
+ nonce: n,
13
+ ...s
14
+ } : s;
41
15
  }
42
16
  export {
43
- a as BaseError
17
+ u as signAuthorization
44
18
  };
package/dist/index213.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="1.1.0";exports.version=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index196.cjs"),n=require("./index211.cjs");async function t({message:e,privateKey:s}){return await n.sign({hash:a.hashMessage(e),privateKey:s,to:"hex"})}exports.signMessage=t;