@gardenfi/utils 2.5.3-beta.6 → 2.5.3-beta.7

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 (445) hide show
  1. package/dist/index100.cjs +1 -1
  2. package/dist/index100.js +3 -8
  3. package/dist/index101.cjs +1 -4
  4. package/dist/index101.js +26 -194
  5. package/dist/index102.cjs +2 -3
  6. package/dist/index102.js +19 -446
  7. package/dist/index103.cjs +1 -1
  8. package/dist/index103.js +9 -27
  9. package/dist/index104.cjs +1 -1
  10. package/dist/index104.js +8 -161
  11. package/dist/index105.cjs +1 -1
  12. package/dist/index105.js +10 -21
  13. package/dist/index106.cjs +1 -1
  14. package/dist/index106.js +11 -127
  15. package/dist/index107.cjs +1 -1
  16. package/dist/index107.js +12 -37
  17. package/dist/index108.cjs +1 -1
  18. package/dist/index108.js +14 -6
  19. package/dist/index109.cjs +1 -1
  20. package/dist/index109.js +4 -27
  21. package/dist/index110.cjs +1 -1
  22. package/dist/index110.js +6 -55
  23. package/dist/index111.cjs +1 -1
  24. package/dist/index111.js +16 -43
  25. package/dist/index112.cjs +1 -1
  26. package/dist/index112.js +12 -190
  27. package/dist/index113.cjs +1 -1
  28. package/dist/index113.js +7 -4
  29. package/dist/index114.cjs +1 -1
  30. package/dist/index114.js +7 -64
  31. package/dist/index115.cjs +1 -1
  32. package/dist/index115.js +18 -17
  33. package/dist/index116.cjs +1 -1
  34. package/dist/index116.js +8 -3
  35. package/dist/index117.cjs +1 -1
  36. package/dist/index117.js +20 -15
  37. package/dist/index118.cjs +1 -1
  38. package/dist/index118.js +17 -23
  39. package/dist/index119.cjs +1 -1
  40. package/dist/index119.js +40 -11
  41. package/dist/index120.cjs +1 -1
  42. package/dist/index120.js +21 -18
  43. package/dist/index121.cjs +1 -1
  44. package/dist/index121.js +78 -32
  45. package/dist/index122.cjs +1 -1
  46. package/dist/index122.js +12 -3
  47. package/dist/index123.cjs +1 -1
  48. package/dist/index123.js +58 -18
  49. package/dist/index124.cjs +1 -1
  50. package/dist/index124.js +12 -26
  51. package/dist/index125.cjs +1 -1
  52. package/dist/index125.js +8 -36
  53. package/dist/index126.cjs +1 -1
  54. package/dist/index126.js +20 -8
  55. package/dist/index127.cjs +1 -1
  56. package/dist/index127.js +6 -10
  57. package/dist/index128.cjs +1 -1
  58. package/dist/index128.js +32 -22
  59. package/dist/index129.cjs +1 -1
  60. package/dist/index129.js +31 -27
  61. package/dist/index130.cjs +1 -1
  62. package/dist/index130.js +9 -3
  63. package/dist/index131.cjs +1 -1
  64. package/dist/index131.js +50 -65
  65. package/dist/index132.cjs +1 -1
  66. package/dist/index132.js +19 -9
  67. package/dist/index133.cjs +1 -1
  68. package/dist/index133.js +106 -21
  69. package/dist/index134.cjs +1 -1
  70. package/dist/index134.js +68 -8
  71. package/dist/index135.cjs +1 -1
  72. package/dist/index135.js +8 -9
  73. package/dist/index136.cjs +1 -1
  74. package/dist/index136.js +71 -11
  75. package/dist/index137.cjs +2 -1
  76. package/dist/index137.js +3 -7
  77. package/dist/index138.cjs +1 -1
  78. package/dist/index138.js +9 -7
  79. package/dist/index139.cjs +1 -1
  80. package/dist/index139.js +13 -13
  81. package/dist/index140.cjs +1 -1
  82. package/dist/index140.js +4 -32
  83. package/dist/index141.cjs +1 -1
  84. package/dist/index141.js +13 -5
  85. package/dist/index142.cjs +1 -1
  86. package/dist/index142.js +2 -38
  87. package/dist/index143.cjs +1 -1
  88. package/dist/index143.js +27 -107
  89. package/dist/index144.cjs +1 -1
  90. package/dist/index144.js +20 -170
  91. package/dist/index145.cjs +1 -1
  92. package/dist/index145.js +5 -49
  93. package/dist/index146.cjs +1 -1
  94. package/dist/index146.js +5 -32
  95. package/dist/index147.cjs +1 -1
  96. package/dist/index147.js +5 -7
  97. package/dist/index148.cjs +9 -1
  98. package/dist/index148.js +35 -8
  99. package/dist/index149.cjs +1 -1
  100. package/dist/index149.js +3 -21
  101. package/dist/index150.cjs +1 -1
  102. package/dist/index150.js +16 -21
  103. package/dist/index151.cjs +1 -1
  104. package/dist/index151.js +18 -40
  105. package/dist/index152.cjs +1 -1
  106. package/dist/index152.js +35 -22
  107. package/dist/index153.cjs +1 -1
  108. package/dist/index153.js +8 -21
  109. package/dist/index154.cjs +4 -1
  110. package/dist/index154.js +194 -51
  111. package/dist/index155.cjs +1 -1
  112. package/dist/index155.js +27 -11
  113. package/dist/index156.cjs +1 -1
  114. package/dist/index156.js +161 -24
  115. package/dist/index157.cjs +1 -1
  116. package/dist/index157.js +126 -23
  117. package/dist/index158.cjs +1 -1
  118. package/dist/index158.js +25 -102
  119. package/dist/index159.cjs +1 -1
  120. package/dist/index159.js +56 -3
  121. package/dist/index160.cjs +1 -1
  122. package/dist/index160.js +191 -5
  123. package/dist/index161.cjs +1 -1
  124. package/dist/index161.js +4 -32
  125. package/dist/index162.cjs +1 -1
  126. package/dist/index162.js +20 -3
  127. package/dist/index163.cjs +1 -1
  128. package/dist/index163.js +3 -18
  129. package/dist/index164.cjs +1 -1
  130. package/dist/index164.js +16 -5
  131. package/dist/index165.cjs +1 -1
  132. package/dist/index165.js +11 -8
  133. package/dist/index166.cjs +1 -1
  134. package/dist/index166.js +31 -100
  135. package/dist/index167.cjs +1 -1
  136. package/dist/index167.js +3 -81
  137. package/dist/index168.cjs +1 -1
  138. package/dist/index168.js +27 -5
  139. package/dist/index169.cjs +1 -1
  140. package/dist/index169.js +8 -6
  141. package/dist/index170.cjs +1 -1
  142. package/dist/index170.js +25 -27
  143. package/dist/index171.cjs +1 -1
  144. package/dist/index171.js +28 -34
  145. package/dist/index172.cjs +1 -1
  146. package/dist/index172.js +3 -13
  147. package/dist/index173.cjs +1 -1
  148. package/dist/index173.js +6 -19
  149. package/dist/index174.cjs +1 -1
  150. package/dist/index174.js +6 -78
  151. package/dist/index175.cjs +1 -1
  152. package/dist/index175.js +33 -2
  153. package/dist/index176.cjs +1 -1
  154. package/dist/index176.js +5 -15
  155. package/dist/index177.cjs +1 -1
  156. package/dist/index177.js +36 -17
  157. package/dist/index178.cjs +1 -1
  158. package/dist/index178.js +45 -167
  159. package/dist/index179.cjs +1 -1
  160. package/dist/index179.js +32 -17
  161. package/dist/index18.cjs +1 -1
  162. package/dist/index18.js +8 -8
  163. package/dist/index180.cjs +1 -1
  164. package/dist/index180.js +8 -10
  165. package/dist/index181.cjs +1 -1
  166. package/dist/index181.js +39 -27
  167. package/dist/index182.cjs +1 -1
  168. package/dist/index182.js +52 -2
  169. package/dist/index183.cjs +1 -1
  170. package/dist/index183.js +104 -13
  171. package/dist/index184.cjs +1 -1
  172. package/dist/index184.js +3 -13
  173. package/dist/index185.cjs +1 -1
  174. package/dist/index185.js +5 -47
  175. package/dist/index186.cjs +1 -1
  176. package/dist/index186.js +3 -11
  177. package/dist/index187.cjs +1 -1
  178. package/dist/index187.js +17 -7
  179. package/dist/index188.cjs +1 -1
  180. package/dist/index188.js +5 -66
  181. package/dist/index189.cjs +1 -1
  182. package/dist/index189.js +8 -46
  183. package/dist/index190.cjs +1 -1
  184. package/dist/index190.js +101 -35
  185. package/dist/index191.cjs +1 -1
  186. package/dist/index191.js +5 -17
  187. package/dist/index192.cjs +1 -1
  188. package/dist/index192.js +6 -6
  189. package/dist/index193.cjs +1 -1
  190. package/dist/index193.js +27 -9
  191. package/dist/index194.cjs +1 -1
  192. package/dist/index194.js +34 -13
  193. package/dist/index195.cjs +1 -1
  194. package/dist/index195.js +13 -8
  195. package/dist/index196.cjs +1 -1
  196. package/dist/index196.js +78 -35
  197. package/dist/index197.cjs +1 -1
  198. package/dist/index197.js +2 -17
  199. package/dist/index198.cjs +1 -1
  200. package/dist/index198.js +18 -14
  201. package/dist/index199.cjs +1 -1
  202. package/dist/index199.js +171 -6
  203. package/dist/index20.cjs +1 -1
  204. package/dist/index20.js +2 -2
  205. package/dist/index200.cjs +1 -2
  206. package/dist/index200.js +16 -23
  207. package/dist/index201.cjs +1 -1
  208. package/dist/index201.js +10 -13
  209. package/dist/index202.cjs +1 -1
  210. package/dist/index202.js +2 -2
  211. package/dist/index203.cjs +1 -1
  212. package/dist/index203.js +5 -5
  213. package/dist/index205.cjs +1 -1
  214. package/dist/index205.js +1 -1
  215. package/dist/index206.cjs +1 -1
  216. package/dist/index206.js +2 -2
  217. package/dist/index207.cjs +1 -1
  218. package/dist/index207.js +1 -1
  219. package/dist/index208.cjs +1 -1
  220. package/dist/index208.js +5 -5
  221. package/dist/index209.cjs +1 -2
  222. package/dist/index209.js +39 -34
  223. package/dist/index210.cjs +1 -1
  224. package/dist/index210.js +10 -2
  225. package/dist/index211.cjs +1 -1
  226. package/dist/index211.js +24 -5
  227. package/dist/index212.cjs +2 -1
  228. package/dist/index212.js +40 -9
  229. package/dist/index213.cjs +1 -1
  230. package/dist/index213.js +2 -20
  231. package/dist/index214.cjs +1 -1
  232. package/dist/index214.js +5 -8
  233. package/dist/index215.cjs +1 -1
  234. package/dist/index215.js +9 -65
  235. package/dist/index216.cjs +1 -1
  236. package/dist/index216.js +17 -63
  237. package/dist/index217.cjs +1 -1
  238. package/dist/index217.js +8 -188
  239. package/dist/index218.cjs +1 -1
  240. package/dist/index218.js +66 -28
  241. package/dist/index219.cjs +1 -1
  242. package/dist/index219.js +61 -72
  243. package/dist/index22.cjs +1 -1
  244. package/dist/index22.js +3 -3
  245. package/dist/index220.cjs +1 -1
  246. package/dist/index220.js +183 -35
  247. package/dist/index221.cjs +1 -1
  248. package/dist/index221.js +21 -9
  249. package/dist/index222.cjs +1 -1
  250. package/dist/index222.js +70 -7
  251. package/dist/index223.cjs +1 -1
  252. package/dist/index223.js +40 -11
  253. package/dist/index224.cjs +1 -1
  254. package/dist/index224.js +16 -12
  255. package/dist/index225.cjs +1 -1
  256. package/dist/index225.js +13 -6
  257. package/dist/index226.cjs +1 -1
  258. package/dist/index226.js +12 -7
  259. package/dist/index227.cjs +1 -1
  260. package/dist/index227.js +12 -19
  261. package/dist/index228.cjs +1 -1
  262. package/dist/index228.js +18 -107
  263. package/dist/index229.cjs +1 -1
  264. package/dist/index229.js +106 -101
  265. package/dist/index23.cjs +1 -1
  266. package/dist/index23.js +2 -2
  267. package/dist/index230.cjs +1 -1
  268. package/dist/index230.js +101 -24
  269. package/dist/index231.cjs +1 -1
  270. package/dist/index231.js +6 -16
  271. package/dist/index232.cjs +1 -1
  272. package/dist/index232.js +7 -215
  273. package/dist/index233.cjs +1 -1
  274. package/dist/index233.js +26 -24
  275. package/dist/index234.cjs +1 -1
  276. package/dist/index234.js +15 -45
  277. package/dist/index235.cjs +1 -1
  278. package/dist/index235.js +213 -8
  279. package/dist/index236.cjs +1 -1
  280. package/dist/index236.js +1 -1
  281. package/dist/index237.cjs +1 -1
  282. package/dist/index237.js +1 -1
  283. package/dist/index239.cjs +1 -1
  284. package/dist/index239.js +1 -1
  285. package/dist/index24.cjs +1 -1
  286. package/dist/index24.js +5 -5
  287. package/dist/index241.cjs +2 -1
  288. package/dist/index241.js +66 -68
  289. package/dist/index242.cjs +1 -1
  290. package/dist/index242.js +14 -657
  291. package/dist/index243.cjs +1 -1
  292. package/dist/index243.js +68 -206
  293. package/dist/index244.cjs +1 -1
  294. package/dist/index244.js +634 -154
  295. package/dist/index245.cjs +1 -2
  296. package/dist/index245.js +203 -63
  297. package/dist/index246.cjs +1 -1
  298. package/dist/index246.js +177 -14
  299. package/dist/index25.cjs +1 -1
  300. package/dist/index25.js +1 -1
  301. package/dist/index26.cjs +1 -1
  302. package/dist/index26.js +1 -1
  303. package/dist/index29.cjs +1 -1
  304. package/dist/index29.js +171 -7
  305. package/dist/index30.cjs +1 -1
  306. package/dist/index30.js +110 -30
  307. package/dist/index31.cjs +1 -1
  308. package/dist/index31.js +30 -29
  309. package/dist/index32.cjs +1 -1
  310. package/dist/index32.js +3 -16
  311. package/dist/index33.cjs +1 -1
  312. package/dist/index33.js +2 -34
  313. package/dist/index34.cjs +1 -1
  314. package/dist/index34.js +4 -45
  315. package/dist/index35.cjs +2 -1
  316. package/dist/index35.js +59 -151
  317. package/dist/index36.cjs +2 -1
  318. package/dist/index36.js +50 -31
  319. package/dist/index37.cjs +3 -1
  320. package/dist/index37.js +210 -53
  321. package/dist/index38.cjs +1 -2
  322. package/dist/index38.js +22 -58
  323. package/dist/index39.cjs +1 -1
  324. package/dist/index39.js +18 -13
  325. package/dist/index40.cjs +1 -1
  326. package/dist/index40.js +10 -37
  327. package/dist/index41.cjs +1 -1
  328. package/dist/index41.js +20 -15
  329. package/dist/index42.cjs +1 -1
  330. package/dist/index42.js +45 -8
  331. package/dist/index43.cjs +1 -1
  332. package/dist/index43.js +12 -19
  333. package/dist/index44.cjs +1 -1
  334. package/dist/index44.js +13 -2
  335. package/dist/index45.cjs +1 -1
  336. package/dist/index45.js +24 -45
  337. package/dist/index46.cjs +1 -1
  338. package/dist/index46.js +27 -31
  339. package/dist/index47.cjs +1 -1
  340. package/dist/index47.js +47 -3
  341. package/dist/index48.cjs +1 -1
  342. package/dist/index48.js +19 -9
  343. package/dist/index49.cjs +1 -1
  344. package/dist/index49.js +11 -50
  345. package/dist/index50.cjs +1 -1
  346. package/dist/index50.js +31 -7
  347. package/dist/index51.cjs +1 -1
  348. package/dist/index51.js +36 -16
  349. package/dist/index52.cjs +1 -1
  350. package/dist/index52.js +7 -10
  351. package/dist/index53.cjs +1 -1
  352. package/dist/index53.js +29 -5
  353. package/dist/index54.cjs +1 -1
  354. package/dist/index54.js +22 -14
  355. package/dist/index55.cjs +1 -1
  356. package/dist/index55.js +7 -3
  357. package/dist/index56.cjs +1 -1
  358. package/dist/index56.js +65 -25
  359. package/dist/index57.cjs +1 -1
  360. package/dist/index57.js +44 -107
  361. package/dist/index58.cjs +1 -1
  362. package/dist/index58.js +23 -4
  363. package/dist/index59.cjs +1 -1
  364. package/dist/index59.js +37 -6
  365. package/dist/index60.cjs +1 -1
  366. package/dist/index60.js +17 -88
  367. package/dist/index61.cjs +1 -1
  368. package/dist/index61.js +6 -6
  369. package/dist/index62.cjs +1 -1
  370. package/dist/index62.js +9 -125
  371. package/dist/index63.cjs +1 -1
  372. package/dist/index63.js +12 -6
  373. package/dist/index64.cjs +1 -1
  374. package/dist/index64.js +109 -21
  375. package/dist/index65.cjs +1 -1
  376. package/dist/index65.js +22 -16
  377. package/dist/index66.cjs +1 -1
  378. package/dist/index66.js +7 -40
  379. package/dist/index67.cjs +1 -1
  380. package/dist/index67.js +20 -20
  381. package/dist/index68.cjs +1 -1
  382. package/dist/index68.js +8 -11
  383. package/dist/index69.cjs +1 -1
  384. package/dist/index69.js +31 -6
  385. package/dist/index70.cjs +1 -1
  386. package/dist/index70.js +7 -19
  387. package/dist/index71.cjs +1 -1
  388. package/dist/index71.js +16 -106
  389. package/dist/index72.cjs +1 -1
  390. package/dist/index72.js +68 -63
  391. package/dist/index73.cjs +1 -1
  392. package/dist/index73.js +35 -9
  393. package/dist/index74.cjs +1 -1
  394. package/dist/index74.js +16 -28
  395. package/dist/index75.cjs +1 -1
  396. package/dist/index75.js +63 -69
  397. package/dist/index76.cjs +1 -1
  398. package/dist/index76.js +12 -4
  399. package/dist/index77.cjs +1 -2
  400. package/dist/index77.js +15 -3
  401. package/dist/index78.cjs +3 -1
  402. package/dist/index78.js +96 -9
  403. package/dist/index79.cjs +1 -20
  404. package/dist/index79.js +24 -326
  405. package/dist/index80.cjs +1 -1
  406. package/dist/index80.js +33 -13
  407. package/dist/index81.cjs +1 -1
  408. package/dist/index81.js +44 -4
  409. package/dist/index82.cjs +1 -1
  410. package/dist/index82.js +6 -12
  411. package/dist/index83.cjs +1 -1
  412. package/dist/index83.js +152 -2
  413. package/dist/index84.cjs +20 -1
  414. package/dist/index84.js +325 -6
  415. package/dist/index85.cjs +3 -2
  416. package/dist/index85.js +438 -41
  417. package/dist/index86.cjs +1 -3
  418. package/dist/index86.js +58 -209
  419. package/dist/index87.cjs +1 -1
  420. package/dist/index87.js +37 -31
  421. package/dist/index88.cjs +1 -1
  422. package/dist/index88.js +15 -21
  423. package/dist/index89.cjs +1 -1
  424. package/dist/index89.js +2 -6
  425. package/dist/index90.cjs +1 -1
  426. package/dist/index90.js +15 -72
  427. package/dist/index91.cjs +1 -1
  428. package/dist/index91.js +10 -5
  429. package/dist/index92.cjs +1 -1
  430. package/dist/index92.js +125 -5
  431. package/dist/index93.cjs +1 -9
  432. package/dist/index93.js +5 -35
  433. package/dist/index94.cjs +1 -3
  434. package/dist/index94.js +20 -94
  435. package/dist/index95.cjs +1 -1
  436. package/dist/index95.js +46 -3
  437. package/dist/index96.cjs +1 -1
  438. package/dist/index96.js +36 -16
  439. package/dist/index97.cjs +1 -1
  440. package/dist/index97.js +6 -20
  441. package/dist/index98.cjs +1 -1
  442. package/dist/index98.js +86 -33
  443. package/dist/index99.cjs +1 -1
  444. package/dist/index99.js +13 -22
  445. package/package.json +1 -1
package/dist/index140.js CHANGED
@@ -1,35 +1,7 @@
1
- import { maxBytesPerTransaction as y, fieldElementsPerBlob as a, bytesPerFieldElement as f, bytesPerBlob as p } from "./index141.js";
2
- import { EmptyBlobError as c, BlobSizeTooLargeError as h } from "./index142.js";
3
- import { createCursor as B } from "./index106.js";
4
- import { size as u } from "./index81.js";
5
- import { hexToBytes as x } from "./index110.js";
6
- import { bytesToHex as d } from "./index111.js";
7
- function S(e) {
8
- const m = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), i = typeof e.data == "string" ? x(e.data) : e.data, o = u(i);
9
- if (!o)
10
- throw new c();
11
- if (o > y)
12
- throw new h({
13
- maxSize: y,
14
- size: o
15
- });
16
- const s = [];
17
- let n = !0, r = 0;
18
- for (; n; ) {
19
- const t = B(new Uint8Array(p));
20
- let l = 0;
21
- for (; l < a; ) {
22
- const b = i.slice(r, r + (f - 1));
23
- if (t.pushByte(0), t.pushBytes(b), b.length < 31) {
24
- t.pushByte(128), n = !1;
25
- break;
26
- }
27
- l++, r += 31;
28
- }
29
- s.push(t);
30
- }
31
- return m === "bytes" ? s.map((t) => t.bytes) : s.map((t) => d(t.bytes));
1
+ import { isHex as r } from "./index172.js";
2
+ function i(t) {
3
+ return r(t, { strict: !1 }) ? Math.ceil((t.length - 2) / 2) : t.length;
32
4
  }
33
5
  export {
34
- S as toBlobs
6
+ i as size
35
7
  };
package/dist/index141.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=6,s=32,e=4096,n=s*e,o=n*t-1-1*e*t;exports.bytesPerBlob=n;exports.bytesPerFieldElement=s;exports.fieldElementsPerBlob=e;exports.maxBytesPerTransaction=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index35.cjs");class r extends s.BaseError{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}exports.InvalidAddressError=r;
package/dist/index141.js CHANGED
@@ -1,7 +1,15 @@
1
- const e = 32, s = 4096, t = 131072, l = 761855;
1
+ import { BaseError as r } from "./index35.js";
2
+ class d extends r {
3
+ constructor({ address: s }) {
4
+ super(`Address "${s}" is invalid.`, {
5
+ metaMessages: [
6
+ "- Address must be a hex value of 20 bytes (40 hex characters).",
7
+ "- Address must match its checksum counterpart."
8
+ ],
9
+ name: "InvalidAddressError"
10
+ });
11
+ }
12
+ }
2
13
  export {
3
- t as bytesPerBlob,
4
- e as bytesPerFieldElement,
5
- s as fieldElementsPerBlob,
6
- l as maxBytesPerTransaction
14
+ d as InvalidAddressError
7
15
  };
package/dist/index142.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index175.cjs"),s=require("./index38.cjs");class i extends s.BaseError{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class n extends s.BaseError{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class t extends s.BaseError{constructor({hash:e,size:r}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}}class d extends s.BaseError{constructor({hash:e,version:r}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${a.versionedHashVersionKzg}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}exports.BlobSizeTooLargeError=i;exports.EmptyBlobError=n;exports.InvalidVersionedHashSizeError=t;exports.InvalidVersionedHashVersionError=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="2.37.8";exports.version=e;
package/dist/index142.js CHANGED
@@ -1,40 +1,4 @@
1
- import { versionedHashVersionKzg as a } from "./index175.js";
2
- import { BaseError as s } from "./index38.js";
3
- class t extends s {
4
- constructor({ maxSize: e, size: r }) {
5
- super("Blob size is too large.", {
6
- metaMessages: [`Max: ${e} bytes`, `Given: ${r} bytes`],
7
- name: "BlobSizeTooLargeError"
8
- });
9
- }
10
- }
11
- class d extends s {
12
- constructor() {
13
- super("Blob data must not be empty.", { name: "EmptyBlobError" });
14
- }
15
- }
16
- class l extends s {
17
- constructor({ hash: e, size: r }) {
18
- super(`Versioned hash "${e}" size is invalid.`, {
19
- metaMessages: ["Expected: 32", `Received: ${r}`],
20
- name: "InvalidVersionedHashSizeError"
21
- });
22
- }
23
- }
24
- class c extends s {
25
- constructor({ hash: e, version: r }) {
26
- super(`Versioned hash "${e}" version is invalid.`, {
27
- metaMessages: [
28
- `Expected: ${a}`,
29
- `Received: ${r}`
30
- ],
31
- name: "InvalidVersionedHashVersionError"
32
- });
33
- }
34
- }
1
+ const o = "2.37.8";
35
2
  export {
36
- t as BlobSizeTooLargeError,
37
- d as EmptyBlobError,
38
- l as InvalidVersionedHashSizeError,
39
- c as InvalidVersionedHashVersionError
3
+ o as version
40
4
  };
package/dist/index143.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./index144.cjs"),p=require("./index145.cjs"),h=require("./index72.cjs"),g=require("./index88.cjs"),E=require("./index112.cjs"),L=require("./index132.cjs"),R=require("./index120.cjs"),S=require("./index130.cjs"),q=require("./index146.cjs"),O=require("./index44.cjs"),T="0x556f1830",w={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function x(c,{blockNumber:u,blockTag:l,data:a,to:n}){const{args:i}=g.decodeErrorResult({data:a,abi:[w]}),[r,o,s,d,t]=i,{ccipRead:e}=c,y=e&&typeof(e==null?void 0:e.request)=="function"?e.request:b;try{if(!L.isAddressEqual(n,r))throw new p.OffchainLookupSenderMismatchError({sender:r,to:n});const f=o.includes(q.localBatchGatewayUrl)?await q.localBatchGatewayRequest({data:s,ccipRequest:y}):await y({data:s,sender:r,urls:o}),{data:m}=await k.call(c,{blockNumber:u,blockTag:l,data:R.concat([d,E.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[f,t])]),to:n});return m}catch(f){throw new p.OffchainLookupError({callbackSelector:d,cause:f,data:a,extraData:t,sender:r,urls:o})}}async function b({data:c,sender:u,urls:l}){var n;let a=new Error("An unknown error occurred.");for(let i=0;i<l.length;i++){const r=l[i],o=r.includes("{data}")?"GET":"POST",s=o==="POST"?{data:c,sender:u}:void 0,d=o==="POST"?{"Content-Type":"application/json"}:{};try{const t=await fetch(r.replace("{sender}",u.toLowerCase()).replace("{data}",c),{body:JSON.stringify(s),headers:d,method:o});let e;if((n=t.headers.get("Content-Type"))!=null&&n.startsWith("application/json")?e=(await t.json()).data:e=await t.text(),!t.ok){a=new h.HttpRequestError({body:s,details:e!=null&&e.error?O.stringify(e.error):t.statusText,headers:t.headers,status:t.status,url:r});continue}if(!S.isHex(e)){a=new p.OffchainLookupResponseMalformedError({result:e,url:r});continue}return e}catch(t){a=new h.HttpRequestError({body:s,details:t.message,url:r})}}throw a}exports.ccipRequest=b;exports.offchainLookup=x;exports.offchainLookupAbiItem=w;exports.offchainLookupSignature=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},o={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},t={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};exports.panicReasons=e;exports.solidityError=o;exports.solidityPanic=t;
package/dist/index143.js CHANGED
@@ -1,114 +1,34 @@
1
- import { call as h } from "./index144.js";
2
- import { OffchainLookupSenderMismatchError as w, OffchainLookupError as b, OffchainLookupResponseMalformedError as k } from "./index145.js";
3
- import { HttpRequestError as d } from "./index72.js";
4
- import { decodeErrorResult as g } from "./index88.js";
5
- import { encodeAbiParameters as q } from "./index112.js";
6
- import { isAddressEqual as E } from "./index132.js";
7
- import { concat as L } from "./index120.js";
8
- import { isHex as O } from "./index130.js";
9
- import { localBatchGatewayUrl as x, localBatchGatewayRequest as S } from "./index146.js";
10
- import { stringify as T } from "./index44.js";
11
- const I = "0x556f1830", R = {
12
- name: "OffchainLookup",
13
- type: "error",
1
+ const e = {
2
+ 1: "An `assert` condition failed.",
3
+ 17: "Arithmetic operation resulted in underflow or overflow.",
4
+ 18: "Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",
5
+ 33: "Attempted to convert to an invalid type.",
6
+ 34: "Attempted to access a storage byte array that is incorrectly encoded.",
7
+ 49: "Performed `.pop()` on an empty array",
8
+ 50: "Array index is out of bounds.",
9
+ 65: "Allocated too much memory or created an array which is too large.",
10
+ 81: "Attempted to call a zero-initialized variable of internal function type."
11
+ }, o = {
14
12
  inputs: [
15
13
  {
16
- name: "sender",
17
- type: "address"
18
- },
19
- {
20
- name: "urls",
21
- type: "string[]"
22
- },
23
- {
24
- name: "callData",
25
- type: "bytes"
26
- },
27
- {
28
- name: "callbackFunction",
29
- type: "bytes4"
30
- },
14
+ name: "message",
15
+ type: "string"
16
+ }
17
+ ],
18
+ name: "Error",
19
+ type: "error"
20
+ }, t = {
21
+ inputs: [
31
22
  {
32
- name: "extraData",
33
- type: "bytes"
23
+ name: "reason",
24
+ type: "uint256"
34
25
  }
35
- ]
26
+ ],
27
+ name: "Panic",
28
+ type: "error"
36
29
  };
37
- async function J(c, { blockNumber: p, blockTag: f, data: o, to: n }) {
38
- const { args: i } = g({
39
- data: o,
40
- abi: [R]
41
- }), [r, a, s, u, e] = i, { ccipRead: t } = c, m = t && typeof (t == null ? void 0 : t.request) == "function" ? t.request : A;
42
- try {
43
- if (!E(n, r))
44
- throw new w({ sender: r, to: n });
45
- const l = a.includes(x) ? await S({
46
- data: s,
47
- ccipRequest: m
48
- }) : await m({ data: s, sender: r, urls: a }), { data: y } = await h(c, {
49
- blockNumber: p,
50
- blockTag: f,
51
- data: L([
52
- u,
53
- q([{ type: "bytes" }, { type: "bytes" }], [l, e])
54
- ]),
55
- to: n
56
- });
57
- return y;
58
- } catch (l) {
59
- throw new b({
60
- callbackSelector: u,
61
- cause: l,
62
- data: o,
63
- extraData: e,
64
- sender: r,
65
- urls: a
66
- });
67
- }
68
- }
69
- async function A({ data: c, sender: p, urls: f }) {
70
- var n;
71
- let o = new Error("An unknown error occurred.");
72
- for (let i = 0; i < f.length; i++) {
73
- const r = f[i], a = r.includes("{data}") ? "GET" : "POST", s = a === "POST" ? { data: c, sender: p } : void 0, u = a === "POST" ? { "Content-Type": "application/json" } : {};
74
- try {
75
- const e = await fetch(r.replace("{sender}", p.toLowerCase()).replace("{data}", c), {
76
- body: JSON.stringify(s),
77
- headers: u,
78
- method: a
79
- });
80
- let t;
81
- if ((n = e.headers.get("Content-Type")) != null && n.startsWith("application/json") ? t = (await e.json()).data : t = await e.text(), !e.ok) {
82
- o = new d({
83
- body: s,
84
- details: t != null && t.error ? T(t.error) : e.statusText,
85
- headers: e.headers,
86
- status: e.status,
87
- url: r
88
- });
89
- continue;
90
- }
91
- if (!O(t)) {
92
- o = new k({
93
- result: t,
94
- url: r
95
- });
96
- continue;
97
- }
98
- return t;
99
- } catch (e) {
100
- o = new d({
101
- body: s,
102
- details: e.message,
103
- url: r
104
- });
105
- }
106
- }
107
- throw o;
108
- }
109
30
  export {
110
- A as ccipRequest,
111
- J as offchainLookup,
112
- R as offchainLookupAbiItem,
113
- I as offchainLookupSignature
31
+ e as panicReasons,
32
+ o as solidityError,
33
+ t as solidityPanic
114
34
  };
package/dist/index144.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("./index181.cjs"),Z=require("./index47.cjs"),j=require("./index21.cjs"),ee=require("./index182.cjs"),E=require("./index76.cjs"),A=require("./index38.cjs"),R=require("./index85.cjs"),L=require("./index86.cjs"),te=require("./index118.cjs"),$=require("./index123.cjs"),ae=require("./index127.cjs"),re=require("./index149.cjs"),G=require("./index111.cjs"),oe=require("./index183.cjs"),ce=require("./index184.cjs"),ne=require("./index157.cjs"),se=require("./index74.cjs"),ie=require("./index185.cjs"),le=require("./index173.cjs"),M=require("./index186.cjs");async function ue(e,t){var P,T,H,_;const{account:a=e.account,authorizationList:s,batch:i=!!((P=e.batch)!=null&&P.multicall),blockNumber:l,blockTag:C=e.experimental_blockTag??"latest",accessList:k,blobs:x,blockOverrides:y,code:m,data:c,factory:b,factoryData:u,gas:v,gasPrice:w,maxFeePerBlobGas:p,maxFeePerGas:g,maxPriorityFeePerGas:h,nonce:q,to:r,value:J,stateOverride:K,...Q}=t,D=a?Z.parseAccount(a):void 0;if(m&&(b||u))throw new A.BaseError("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(m&&r)throw new A.BaseError("Cannot provide both `code` & `to` as parameters.");const N=m&&c,S=b&&u&&r&&c,O=N||S,U=N?W({code:m,data:c}):S?be({data:c,factory:b,factoryData:u,to:r}):c;try{le.assertRequest(t);const o=(typeof l=="bigint"?G.numberToHex(l):void 0)||C,d=y?Y.toRpc(y):void 0,f=ie.serializeStateOverride(K),V=(_=(H=(T=e.chain)==null?void 0:T.formatters)==null?void 0:H.transactionRequest)==null?void 0:_.format,F=(V||ne.formatTransactionRequest)({...ce.extract(Q,{format:V}),from:D==null?void 0:D.address,accessList:k,authorizationList:s,blobs:x,data:U,gas:v,gasPrice:w,maxFeePerBlobGas:p,maxFeePerGas:g,maxPriorityFeePerGas:h,nonce:q,to:O?void 0:r,value:J});if(i&&de({request:F})&&!f&&!d)try{return await fe(e,{...F,blockNumber:l,blockTag:C})}catch(n){if(!(n instanceof R.ClientChainNotConfiguredError)&&!(n instanceof R.ChainDoesNotSupportContract))throw n}const X=(()=>{const n=[F,o];return f&&d?[...n,f,d]:f?[...n,f]:d?[...n,{},d]:n})(),z=await e.request({method:"eth_call",params:X});return z==="0x"?{data:void 0}:{data:z}}catch(B){const o=I(B),{offchainLookup:d,offchainLookupSignature:f}=await Promise.resolve().then(()=>require("./index143.cjs"));if(e.ccipRead!==!1&&(o==null?void 0:o.slice(0,10))===f&&r)return{data:await d(e,{data:o,to:r})};throw O&&(o==null?void 0:o.slice(0,10))==="0x101bb98d"?new L.CounterfactualDeploymentFailedError({factory:b}):oe.getCallError(B,{...t,account:D,chain:e.chain})}}function de({request:e}){const{data:t,to:a,...s}=e;return!(!t||t.startsWith(ee.aggregate3Signature)||!a||Object.values(s).filter(i=>typeof i<"u").length>0)}async function fe(e,t){var w;const{batchSize:a=1024,deployless:s=!1,wait:i=0}=typeof((w=e.batch)==null?void 0:w.multicall)=="object"?e.batch.multicall:{},{blockNumber:l,blockTag:C=e.experimental_blockTag??"latest",data:k,to:x}=t,y=(()=>{if(s)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return re.getChainContractAddress({blockNumber:l,chain:e.chain,contract:"multicall3"});throw new R.ClientChainNotConfiguredError})(),c=(typeof l=="bigint"?G.numberToHex(l):void 0)||C,{schedule:b}=se.createBatchScheduler({id:`${e.uid}.${c}`,wait:i,shouldSplitBatch(p){return p.reduce((h,{data:q})=>h+(q.length-2),0)>a*2},fn:async p=>{const g=p.map(r=>({allowFailure:!0,callData:r.data,target:r.to})),h=ae.encodeFunctionData({abi:j.multicall3Abi,args:[g],functionName:"aggregate3"}),q=await e.request({method:"eth_call",params:[{...y===null?{data:W({code:E.multicall3Bytecode,data:h})}:{to:y,data:h}},c]});return te.decodeFunctionResult({abi:j.multicall3Abi,args:[g],functionName:"aggregate3",data:q||"0x"})}}),[{returnData:u,success:v}]=await b({data:k,to:x});if(!v)throw new L.RawContractError({data:u});return u==="0x"?{data:void 0}:{data:u}}function W(e){const{code:t,data:a}=e;return $.encodeDeployData({abi:M.parseAbi(["constructor(bytes, bytes)"]),bytecode:E.deploylessCallViaBytecodeBytecode,args:[t,a]})}function be(e){const{data:t,factory:a,factoryData:s,to:i}=e;return $.encodeDeployData({abi:M.parseAbi(["constructor(address, bytes, address, bytes)"]),bytecode:E.deploylessCallViaFactoryBytecode,args:[i,t,a,s]})}function I(e){var a;if(!(e instanceof A.BaseError))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(a=t.data)==null?void 0:a.data:t.data}exports.call=ue;exports.getRevertErrorData=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index143.cjs"),n=require("./index84.cjs"),c=require("./index96.cjs"),u=require("./index161.cjs"),d=require("./index156.cjs"),l=require("./index139.cjs");function b(s){const{abi:a,data:t}=s,r=c.slice(t,0,4);if(r==="0x")throw new n.AbiDecodingZeroDataError;const e=[...a||[],i.solidityError,i.solidityPanic].find(o=>o.type==="error"&&r===u.toFunctionSelector(l.formatAbiItem(o)));if(!e)throw new n.AbiErrorSignatureNotFoundError(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:e,args:"inputs"in e&&e.inputs&&e.inputs.length>0?d.decodeAbiParameters(e.inputs,c.slice(t,4)):void 0,errorName:e.name}}exports.decodeErrorResult=b;
package/dist/index144.js CHANGED
@@ -1,174 +1,24 @@
1
- import { toRpc as Q } from "./index181.js";
2
- import { parseAccount as U } from "./index47.js";
3
- import { multicall3Abi as z } from "./index21.js";
4
- import { aggregate3Signature as X } from "./index182.js";
5
- import { deploylessCallViaBytecodeBytecode as Y, deploylessCallViaFactoryBytecode as Z, multicall3Bytecode as tt } from "./index76.js";
6
- import { BaseError as R } from "./index38.js";
7
- import { ClientChainNotConfiguredError as H, ChainDoesNotSupportContract as at } from "./index85.js";
8
- import { CounterfactualDeploymentFailedError as et, RawContractError as rt } from "./index86.js";
9
- import { decodeFunctionResult as ot } from "./index118.js";
10
- import { encodeDeployData as L } from "./index123.js";
11
- import { encodeFunctionData as ct } from "./index127.js";
12
- import { getChainContractAddress as nt } from "./index149.js";
13
- import { numberToHex as j } from "./index111.js";
14
- import { getCallError as st } from "./index183.js";
15
- import { extract as it } from "./index184.js";
16
- import { formatTransactionRequest as lt } from "./index157.js";
17
- import { createBatchScheduler as ut } from "./index74.js";
18
- import { serializeStateOverride as dt } from "./index185.js";
19
- import { assertRequest as ft } from "./index173.js";
20
- import { parseAbi as G } from "./index186.js";
21
- async function zt(t, a) {
22
- var q, E, O, P;
23
- const { account: e = t.account, authorizationList: s, batch: i = !!((q = t.batch) != null && q.multicall), blockNumber: l, blockTag: C = t.experimental_blockTag ?? "latest", accessList: D, blobs: B, blockOverrides: b, code: h, data: c, factory: m, factoryData: u, gas: F, gasPrice: k, maxFeePerBlobGas: y, maxFeePerGas: g, maxPriorityFeePerGas: p, nonce: w, to: r, value: $, stateOverride: W, ...I } = a, x = e ? U(e) : void 0;
24
- if (h && (m || u))
25
- throw new R("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
26
- if (h && r)
27
- throw new R("Cannot provide both `code` & `to` as parameters.");
28
- const S = h && c, A = m && u && r && c, _ = S || A, J = S ? M({
29
- code: h,
30
- data: c
31
- }) : A ? bt({
32
- data: c,
33
- factory: m,
34
- factoryData: u,
35
- to: r
36
- }) : c;
37
- try {
38
- ft(a);
39
- const o = (typeof l == "bigint" ? j(l) : void 0) || C, d = b ? Q(b) : void 0, f = dt(W), T = (P = (O = (E = t.chain) == null ? void 0 : E.formatters) == null ? void 0 : O.transactionRequest) == null ? void 0 : P.format, N = (T || lt)({
40
- // Pick out extra data that might exist on the chain's transaction request type.
41
- ...it(I, { format: T }),
42
- from: x == null ? void 0 : x.address,
43
- accessList: D,
44
- authorizationList: s,
45
- blobs: B,
46
- data: J,
47
- gas: F,
48
- gasPrice: k,
49
- maxFeePerBlobGas: y,
50
- maxFeePerGas: g,
51
- maxPriorityFeePerGas: p,
52
- nonce: w,
53
- to: _ ? void 0 : r,
54
- value: $
1
+ import { solidityError as m, solidityPanic as s } from "./index143.js";
2
+ import { AbiDecodingZeroDataError as c, AbiErrorSignatureNotFoundError as d } from "./index84.js";
3
+ import { slice as e } from "./index96.js";
4
+ import { toFunctionSelector as u } from "./index161.js";
5
+ import { decodeAbiParameters as f } from "./index156.js";
6
+ import { formatAbiItem as p } from "./index139.js";
7
+ function y(n) {
8
+ const { abi: a, data: t } = n, o = e(t, 0, 4);
9
+ if (o === "0x")
10
+ throw new c();
11
+ const r = [...a || [], m, s].find((i) => i.type === "error" && o === u(p(i)));
12
+ if (!r)
13
+ throw new d(o, {
14
+ docsPath: "/docs/contract/decodeErrorResult"
55
15
  });
56
- if (i && mt({ request: N }) && !f && !d)
57
- try {
58
- return await pt(t, {
59
- ...N,
60
- blockNumber: l,
61
- blockTag: C
62
- });
63
- } catch (n) {
64
- if (!(n instanceof H) && !(n instanceof at))
65
- throw n;
66
- }
67
- const K = (() => {
68
- const n = [
69
- N,
70
- o
71
- ];
72
- return f && d ? [...n, f, d] : f ? [...n, f] : d ? [...n, {}, d] : n;
73
- })(), V = await t.request({
74
- method: "eth_call",
75
- params: K
76
- });
77
- return V === "0x" ? { data: void 0 } : { data: V };
78
- } catch (v) {
79
- const o = ht(v), { offchainLookup: d, offchainLookupSignature: f } = await import("./index143.js");
80
- if (t.ccipRead !== !1 && (o == null ? void 0 : o.slice(0, 10)) === f && r)
81
- return { data: await d(t, { data: o, to: r }) };
82
- throw _ && (o == null ? void 0 : o.slice(0, 10)) === "0x101bb98d" ? new et({ factory: m }) : st(v, {
83
- ...a,
84
- account: x,
85
- chain: t.chain
86
- });
87
- }
88
- }
89
- function mt({ request: t }) {
90
- const { data: a, to: e, ...s } = t;
91
- return !(!a || a.startsWith(X) || !e || Object.values(s).filter((i) => typeof i < "u").length > 0);
92
- }
93
- async function pt(t, a) {
94
- var k;
95
- const { batchSize: e = 1024, deployless: s = !1, wait: i = 0 } = typeof ((k = t.batch) == null ? void 0 : k.multicall) == "object" ? t.batch.multicall : {}, { blockNumber: l, blockTag: C = t.experimental_blockTag ?? "latest", data: D, to: B } = a, b = (() => {
96
- if (s)
97
- return null;
98
- if (a.multicallAddress)
99
- return a.multicallAddress;
100
- if (t.chain)
101
- return nt({
102
- blockNumber: l,
103
- chain: t.chain,
104
- contract: "multicall3"
105
- });
106
- throw new H();
107
- })(), c = (typeof l == "bigint" ? j(l) : void 0) || C, { schedule: m } = ut({
108
- id: `${t.uid}.${c}`,
109
- wait: i,
110
- shouldSplitBatch(y) {
111
- return y.reduce((p, { data: w }) => p + (w.length - 2), 0) > e * 2;
112
- },
113
- fn: async (y) => {
114
- const g = y.map((r) => ({
115
- allowFailure: !0,
116
- callData: r.data,
117
- target: r.to
118
- })), p = ct({
119
- abi: z,
120
- args: [g],
121
- functionName: "aggregate3"
122
- }), w = await t.request({
123
- method: "eth_call",
124
- params: [
125
- {
126
- ...b === null ? {
127
- data: M({
128
- code: tt,
129
- data: p
130
- })
131
- } : { to: b, data: p }
132
- },
133
- c
134
- ]
135
- });
136
- return ot({
137
- abi: z,
138
- args: [g],
139
- functionName: "aggregate3",
140
- data: w || "0x"
141
- });
142
- }
143
- }), [{ returnData: u, success: F }] = await m({ data: D, to: B });
144
- if (!F)
145
- throw new rt({ data: u });
146
- return u === "0x" ? { data: void 0 } : { data: u };
147
- }
148
- function M(t) {
149
- const { code: a, data: e } = t;
150
- return L({
151
- abi: G(["constructor(bytes, bytes)"]),
152
- bytecode: Y,
153
- args: [a, e]
154
- });
155
- }
156
- function bt(t) {
157
- const { data: a, factory: e, factoryData: s, to: i } = t;
158
- return L({
159
- abi: G(["constructor(address, bytes, address, bytes)"]),
160
- bytecode: Z,
161
- args: [i, a, e, s]
162
- });
163
- }
164
- function ht(t) {
165
- var e;
166
- if (!(t instanceof R))
167
- return;
168
- const a = t.walk();
169
- return typeof (a == null ? void 0 : a.data) == "object" ? (e = a.data) == null ? void 0 : e.data : a.data;
16
+ return {
17
+ abiItem: r,
18
+ args: "inputs" in r && r.inputs && r.inputs.length > 0 ? f(r.inputs, e(t, 4)) : void 0,
19
+ errorName: r.name
20
+ };
170
21
  }
171
22
  export {
172
- zt as call,
173
- ht as getRevertErrorData
23
+ y as decodeErrorResult
174
24
  };
package/dist/index145.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index44.cjs"),s=require("./index38.cjs"),n=require("./index95.cjs");class h extends s.BaseError{constructor({callbackSelector:r,cause:e,data:c,extraData:f,sender:i,urls:o}){var t;super(e.shortMessage||"An error occurred while fetching for an offchain result.",{cause:e,metaMessages:[...e.metaMessages||[],(t=e.metaMessages)!=null&&t.length?"":[],"Offchain Gateway Call:",o&&[" Gateway URL(s):",...o.map(d=>` ${n.getUrl(d)}`)],` Sender: ${i}`,` Data: ${c}`,` Callback selector: ${r}`,` Extra data: ${f}`].flat(),name:"OffchainLookupError"})}}class l extends s.BaseError{constructor({result:r,url:e}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${n.getUrl(e)}`,`Response: ${u.stringify(r)}`],name:"OffchainLookupResponseMalformedError"})}}class p extends s.BaseError{constructor({sender:r,to:e}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${e}`,`OffchainLookup sender address: ${r}`],name:"OffchainLookupSenderMismatchError"})}}exports.OffchainLookupError=h;exports.OffchainLookupResponseMalformedError=l;exports.OffchainLookupSenderMismatchError=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index89.cjs");function o({abiItem:t,args:n,includeFunctionName:i=!0,includeName:u=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${i?t.name:""}(${t.inputs.map((r,e)=>`${u&&r.name?`${r.name}: `:""}${typeof n[e]=="object"?f.stringify(n[e]):n[e]}`).join(", ")})`}exports.formatAbiItemWithArgs=o;
package/dist/index145.js CHANGED
@@ -1,52 +1,8 @@
1
- import { stringify as i } from "./index44.js";
2
- import { BaseError as a } from "./index38.js";
3
- import { getUrl as n } from "./index95.js";
4
- class u extends a {
5
- constructor({ callbackSelector: r, cause: e, data: f, extraData: c, sender: d, urls: o }) {
6
- var t;
7
- super(e.shortMessage || "An error occurred while fetching for an offchain result.", {
8
- cause: e,
9
- metaMessages: [
10
- ...e.metaMessages || [],
11
- (t = e.metaMessages) != null && t.length ? "" : [],
12
- "Offchain Gateway Call:",
13
- o && [
14
- " Gateway URL(s):",
15
- ...o.map((m) => ` ${n(m)}`)
16
- ],
17
- ` Sender: ${d}`,
18
- ` Data: ${f}`,
19
- ` Callback selector: ${r}`,
20
- ` Extra data: ${c}`
21
- ].flat(),
22
- name: "OffchainLookupError"
23
- });
24
- }
25
- }
26
- class g extends a {
27
- constructor({ result: r, url: e }) {
28
- super("Offchain gateway response is malformed. Response data must be a hex value.", {
29
- metaMessages: [
30
- `Gateway URL: ${n(e)}`,
31
- `Response: ${i(r)}`
32
- ],
33
- name: "OffchainLookupResponseMalformedError"
34
- });
35
- }
36
- }
37
- class M extends a {
38
- constructor({ sender: r, to: e }) {
39
- super("Reverted sender address does not match target contract address (`to`).", {
40
- metaMessages: [
41
- `Contract address: ${e}`,
42
- `OffchainLookup sender address: ${r}`
43
- ],
44
- name: "OffchainLookupSenderMismatchError"
45
- });
46
- }
1
+ import { stringify as o } from "./index89.js";
2
+ function p({ abiItem: n, args: r, includeFunctionName: f = !0, includeName: i = !1 }) {
3
+ if ("name" in n && "inputs" in n && n.inputs)
4
+ return `${f ? n.name : ""}(${n.inputs.map((e, t) => `${i && e.name ? `${e.name}: ` : ""}${typeof r[t] == "object" ? o(r[t]) : r[t]}`).join(", ")})`;
47
5
  }
48
6
  export {
49
- u as OffchainLookupError,
50
- g as OffchainLookupResponseMalformedError,
51
- M as OffchainLookupSenderMismatchError
7
+ p as formatAbiItemWithArgs
52
8
  };
package/dist/index146.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index21.cjs"),y=require("./index87.cjs"),h=require("./index117.cjs"),n=require("./index124.cjs"),w=require("./index129.cjs"),u="x-batch-gateway:true";async function i(t){const{data:l,ccipRequest:o}=t,{args:[d]}=h.decodeFunctionData({abi:c.batchGatewayAbi,data:l}),a=[],s=[];return await Promise.all(d.map(async(r,e)=>{try{s[e]=r.urls.includes(u)?await i({data:r.data,ccipRequest:o}):await o(r),a[e]=!1}catch(b){a[e]=!0,s[e]=g(b)}})),w.encodeFunctionResult({abi:c.batchGatewayAbi,functionName:"query",result:[a,s]})}function g(t){return t.name==="HttpRequestError"&&t.status?n.encodeErrorResult({abi:c.batchGatewayAbi,errorName:"HttpError",args:[t.status,t.shortMessage]}):n.encodeErrorResult({abi:[y.solidityError],errorName:"Error",args:["shortMessage"in t?t.shortMessage:t.message]})}exports.localBatchGatewayRequest=i;exports.localBatchGatewayUrl=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index138.cjs"),i=require("./index201.cjs");function n(t,e="wei"){return i.formatUnits(t,r.etherUnits[e])}exports.formatEther=n;
package/dist/index146.js CHANGED
@@ -1,35 +1,8 @@
1
- import { batchGatewayAbi as o } from "./index21.js";
2
- import { solidityError as l } from "./index87.js";
3
- import { decodeFunctionData as f } from "./index117.js";
4
- import { encodeErrorResult as n } from "./index124.js";
5
- import { encodeFunctionResult as p } from "./index129.js";
6
- const d = "x-batch-gateway:true";
7
- async function g(t) {
8
- const { data: i, ccipRequest: c } = t, { args: [u] } = f({ abi: o, data: i }), e = [], s = [];
9
- return await Promise.all(u.map(async (r, a) => {
10
- try {
11
- s[a] = r.urls.includes(d) ? await g({ data: r.data, ccipRequest: c }) : await c(r), e[a] = !1;
12
- } catch (m) {
13
- e[a] = !0, s[a] = h(m);
14
- }
15
- })), p({
16
- abi: o,
17
- functionName: "query",
18
- result: [e, s]
19
- });
20
- }
21
- function h(t) {
22
- return t.name === "HttpRequestError" && t.status ? n({
23
- abi: o,
24
- errorName: "HttpError",
25
- args: [t.status, t.shortMessage]
26
- }) : n({
27
- abi: [l],
28
- errorName: "Error",
29
- args: ["shortMessage" in t ? t.shortMessage : t.message]
30
- });
1
+ import { etherUnits as o } from "./index138.js";
2
+ import { formatUnits as e } from "./index201.js";
3
+ function f(r, t = "wei") {
4
+ return e(r, o[t]);
31
5
  }
32
6
  export {
33
- g as localBatchGatewayRequest,
34
- d as localBatchGatewayUrl
7
+ f as formatEther
35
8
  };
package/dist/index147.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index85.cjs");function i({chain:r,currentChainId:t}){if(!r)throw new e.ChainNotFoundError;if(t!==r.id)throw new e.ChainMismatchError({chain:r,currentChainId:t})}exports.assertCurrentChain=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index138.cjs"),r=require("./index201.cjs");function n(t,e="wei"){return r.formatUnits(t,i.gweiUnits[e])}exports.formatGwei=n;
package/dist/index147.js CHANGED
@@ -1,10 +1,8 @@
1
- import { ChainNotFoundError as t, ChainMismatchError as i } from "./index85.js";
2
- function e({ chain: r, currentChainId: o }) {
3
- if (!r)
4
- throw new t();
5
- if (o !== r.id)
6
- throw new i({ chain: r, currentChainId: o });
1
+ import { gweiUnits as i } from "./index138.js";
2
+ import { formatUnits as o } from "./index201.js";
3
+ function f(r, t = "wei") {
4
+ return o(r, i[t]);
7
5
  }
8
6
  export {
9
- e as assertCurrentChain
7
+ f as formatGwei
10
8
  };
package/dist/index148.cjs CHANGED
@@ -1 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}exports.defineChain=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index35.cjs");class i extends a.BaseError{constructor({address:n}){super(`State for account "${n}" is set multiple times.`,{name:"AccountStateConflictError"})}}class s extends a.BaseError{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function o(r){return r.reduce((n,{slot:c,value:e})=>`${n} ${c}: ${e}
2
+ `,"")}function f(r){return r.reduce((n,{address:c,...e})=>{let t=`${n} ${c}:
3
+ `;return e.nonce&&(t+=` nonce: ${e.nonce}
4
+ `),e.balance&&(t+=` balance: ${e.balance}
5
+ `),e.code&&(t+=` code: ${e.code}
6
+ `),e.state&&(t+=` state:
7
+ `,t+=o(e.state)),e.stateDiff&&(t+=` stateDiff:
8
+ `,t+=o(e.stateDiff)),t},` State Override:
9
+ `).slice(0,-1)}exports.AccountStateConflictError=i;exports.StateAssignmentConflictError=s;exports.prettyStateMapping=o;exports.prettyStateOverride=f;