@gardenfi/utils 3.1.0 → 3.1.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (467) hide show
  1. package/dist/index100.cjs +1 -2
  2. package/dist/index100.js +119 -114
  3. package/dist/index101.cjs +1 -1
  4. package/dist/index101.js +5 -14
  5. package/dist/index102.cjs +1 -1
  6. package/dist/index102.js +21 -24
  7. package/dist/index103.cjs +1 -1
  8. package/dist/index103.js +43 -31
  9. package/dist/index104.cjs +1 -1
  10. package/dist/index104.js +37 -43
  11. package/dist/index105.cjs +1 -1
  12. package/dist/index105.js +6 -6
  13. package/dist/index106.cjs +1 -1
  14. package/dist/index106.js +88 -101
  15. package/dist/index107.cjs +1 -1
  16. package/dist/index107.js +14 -37
  17. package/dist/index108.cjs +1 -1
  18. package/dist/index108.js +3 -8
  19. package/dist/index109.cjs +1 -1
  20. package/dist/index109.js +26 -20
  21. package/dist/index110.cjs +2 -1
  22. package/dist/index110.js +25 -2
  23. package/dist/index111.cjs +1 -1
  24. package/dist/index111.js +9 -75
  25. package/dist/index112.cjs +1 -1
  26. package/dist/index112.js +8 -15
  27. package/dist/index113.cjs +1 -1
  28. package/dist/index113.js +10 -151
  29. package/dist/index114.cjs +1 -20
  30. package/dist/index114.js +11 -326
  31. package/dist/index115.cjs +1 -3
  32. package/dist/index115.js +13 -451
  33. package/dist/index116.cjs +1 -1
  34. package/dist/index116.js +19 -71
  35. package/dist/index117.cjs +1 -1
  36. package/dist/index117.js +14 -16
  37. package/dist/index118.cjs +1 -1
  38. package/dist/index118.js +4 -10
  39. package/dist/index119.cjs +1 -1
  40. package/dist/index119.js +6 -125
  41. package/dist/index120.cjs +1 -1
  42. package/dist/index120.js +18 -5
  43. package/dist/index121.cjs +1 -1
  44. package/dist/index121.js +10 -45
  45. package/dist/index122.cjs +1 -1
  46. package/dist/index122.js +56 -36
  47. package/dist/index123.cjs +1 -1
  48. package/dist/index123.js +6 -6
  49. package/dist/index124.cjs +1 -1
  50. package/dist/index124.js +13 -90
  51. package/dist/index125.cjs +1 -1
  52. package/dist/index125.js +7 -14
  53. package/dist/index126.cjs +1 -1
  54. package/dist/index126.js +138 -3
  55. package/dist/index127.cjs +1 -1
  56. package/dist/index127.js +7 -26
  57. package/dist/index128.cjs +1 -2
  58. package/dist/index128.js +19 -22
  59. package/dist/index129.cjs +1 -1
  60. package/dist/index129.js +17 -9
  61. package/dist/index130.cjs +1 -1
  62. package/dist/index130.js +43 -8
  63. package/dist/index131.cjs +1 -1
  64. package/dist/index131.js +21 -10
  65. package/dist/index132.cjs +1 -1
  66. package/dist/index132.js +80 -11
  67. package/dist/index133.cjs +1 -1
  68. package/dist/index133.js +11 -13
  69. package/dist/index134.cjs +1 -1
  70. package/dist/index134.js +7 -15
  71. package/dist/index135.cjs +1 -1
  72. package/dist/index135.js +6 -14
  73. package/dist/index136.cjs +1 -1
  74. package/dist/index136.js +41 -4
  75. package/dist/index137.cjs +1 -1
  76. package/dist/index137.js +5 -6
  77. package/dist/index138.cjs +1 -1
  78. package/dist/index138.js +33 -18
  79. package/dist/index139.cjs +1 -1
  80. package/dist/index139.js +9 -10
  81. package/dist/index140.cjs +1 -1
  82. package/dist/index140.js +60 -58
  83. package/dist/index141.cjs +1 -1
  84. package/dist/index141.js +19 -6
  85. package/dist/index142.cjs +1 -1
  86. package/dist/index142.js +106 -13
  87. package/dist/index143.cjs +1 -1
  88. package/dist/index143.js +78 -7
  89. package/dist/index144.cjs +1 -1
  90. package/dist/index144.js +7 -136
  91. package/dist/index145.cjs +1 -1
  92. package/dist/index145.js +90 -7
  93. package/dist/index146.cjs +2 -1
  94. package/dist/index146.js +3 -22
  95. package/dist/index147.cjs +1 -1
  96. package/dist/index147.js +9 -18
  97. package/dist/index148.cjs +1 -1
  98. package/dist/index148.js +13 -43
  99. package/dist/index149.cjs +1 -1
  100. package/dist/index149.js +4 -21
  101. package/dist/index150.cjs +1 -1
  102. package/dist/index150.js +11 -79
  103. package/dist/index151.cjs +1 -1
  104. package/dist/index151.js +2 -12
  105. package/dist/index152.cjs +1 -1
  106. package/dist/index152.js +32 -14
  107. package/dist/index153.cjs +1 -1
  108. package/dist/index153.js +21 -6
  109. package/dist/index154.cjs +1 -1
  110. package/dist/index154.js +5 -41
  111. package/dist/index155.cjs +1 -1
  112. package/dist/index155.js +5 -5
  113. package/dist/index156.cjs +1 -1
  114. package/dist/index156.js +5 -33
  115. package/dist/index157.cjs +9 -1
  116. package/dist/index157.js +34 -8
  117. package/dist/index158.cjs +1 -1
  118. package/dist/index158.js +3 -61
  119. package/dist/index159.cjs +1 -1
  120. package/dist/index159.js +18 -19
  121. package/dist/index160.cjs +1 -1
  122. package/dist/index160.js +19 -105
  123. package/dist/index161.cjs +1 -1
  124. package/dist/index161.js +27 -70
  125. package/dist/index162.cjs +1 -1
  126. package/dist/index162.js +6 -7
  127. package/dist/index163.cjs +4 -1
  128. package/dist/index163.js +192 -88
  129. package/dist/index164.cjs +1 -2
  130. package/dist/index164.js +28 -3
  131. package/dist/index165.cjs +1 -1
  132. package/dist/index165.js +162 -9
  133. package/dist/index166.cjs +1 -1
  134. package/dist/index166.js +127 -13
  135. package/dist/index167.cjs +1 -1
  136. package/dist/index167.js +27 -4
  137. package/dist/index168.cjs +1 -1
  138. package/dist/index168.js +56 -2
  139. package/dist/index169.cjs +1 -1
  140. package/dist/index169.js +191 -31
  141. package/dist/index170.cjs +1 -1
  142. package/dist/index170.js +4 -22
  143. package/dist/index171.cjs +1 -1
  144. package/dist/index171.js +20 -5
  145. package/dist/index172.cjs +1 -1
  146. package/dist/index172.js +3 -6
  147. package/dist/index173.cjs +1 -1
  148. package/dist/index173.js +16 -5
  149. package/dist/index174.cjs +1 -9
  150. package/dist/index174.js +11 -35
  151. package/dist/index175.cjs +1 -1
  152. package/dist/index175.js +35 -3
  153. package/dist/index176.cjs +1 -1
  154. package/dist/index176.js +3 -19
  155. package/dist/index177.cjs +1 -1
  156. package/dist/index177.js +25 -18
  157. package/dist/index178.cjs +1 -1
  158. package/dist/index178.js +8 -35
  159. package/dist/index179.cjs +1 -1
  160. package/dist/index179.js +23 -6
  161. package/dist/index18.cjs +1 -1
  162. package/dist/index18.js +8 -8
  163. package/dist/index180.cjs +1 -4
  164. package/dist/index180.js +28 -194
  165. package/dist/index181.cjs +1 -1
  166. package/dist/index181.js +3 -27
  167. package/dist/index182.cjs +1 -1
  168. package/dist/index182.js +6 -161
  169. package/dist/index183.cjs +1 -1
  170. package/dist/index183.js +6 -127
  171. package/dist/index184.cjs +1 -1
  172. package/dist/index184.js +32 -27
  173. package/dist/index185.cjs +1 -1
  174. package/dist/index185.js +5 -192
  175. package/dist/index186.cjs +1 -1
  176. package/dist/index186.js +38 -4
  177. package/dist/index187.cjs +1 -1
  178. package/dist/index187.js +43 -14
  179. package/dist/index188.cjs +1 -1
  180. package/dist/index188.js +33 -3
  181. package/dist/index189.cjs +1 -1
  182. package/dist/index189.js +16 -15
  183. package/dist/index190.cjs +1 -1
  184. package/dist/index190.js +40 -32
  185. package/dist/index191.cjs +1 -1
  186. package/dist/index191.js +105 -3
  187. package/dist/index192.cjs +1 -1
  188. package/dist/index192.js +3 -28
  189. package/dist/index193.cjs +1 -1
  190. package/dist/index193.js +5 -25
  191. package/dist/index194.cjs +1 -1
  192. package/dist/index194.js +3 -28
  193. package/dist/index195.cjs +1 -1
  194. package/dist/index195.js +17 -6
  195. package/dist/index196.cjs +1 -1
  196. package/dist/index196.js +5 -6
  197. package/dist/index197.cjs +1 -1
  198. package/dist/index197.js +8 -32
  199. package/dist/index198.cjs +1 -1
  200. package/dist/index198.js +104 -5
  201. package/dist/index199.cjs +1 -1
  202. package/dist/index199.js +5 -37
  203. package/dist/index20.cjs +1 -1
  204. package/dist/index20.js +2 -2
  205. package/dist/index200.cjs +1 -1
  206. package/dist/index200.js +6 -49
  207. package/dist/index201.cjs +1 -1
  208. package/dist/index201.js +25 -30
  209. package/dist/index202.cjs +1 -1
  210. package/dist/index202.js +34 -17
  211. package/dist/index203.cjs +1 -1
  212. package/dist/index203.js +13 -42
  213. package/dist/index204.cjs +1 -1
  214. package/dist/index204.js +74 -100
  215. package/dist/index205.cjs +1 -1
  216. package/dist/index205.js +2 -3
  217. package/dist/index206.cjs +1 -1
  218. package/dist/index206.js +17 -4
  219. package/dist/index207.cjs +1 -1
  220. package/dist/index207.js +171 -3
  221. package/dist/index208.cjs +1 -1
  222. package/dist/index208.js +17 -17
  223. package/dist/index209.cjs +1 -1
  224. package/dist/index209.js +10 -8
  225. package/dist/index210.cjs +1 -1
  226. package/dist/index210.js +25 -5
  227. package/dist/index211.cjs +1 -1
  228. package/dist/index211.js +18 -27
  229. package/dist/index212.cjs +1 -1
  230. package/dist/index212.js +15 -78
  231. package/dist/index213.cjs +1 -1
  232. package/dist/index213.js +6 -2
  233. package/dist/index214.cjs +1 -1
  234. package/dist/index214.js +13 -18
  235. package/dist/index215.cjs +1 -1
  236. package/dist/index215.js +10 -17
  237. package/dist/index216.cjs +1 -1
  238. package/dist/index216.js +16 -10
  239. package/dist/index217.cjs +1 -1
  240. package/dist/index217.js +10 -102
  241. package/dist/index218.cjs +1 -1
  242. package/dist/index218.js +18 -15
  243. package/dist/index219.cjs +1 -1
  244. package/dist/index219.js +23 -213
  245. package/dist/index22.cjs +1 -1
  246. package/dist/index22.js +9 -9
  247. package/dist/index220.cjs +1 -1
  248. package/dist/index220.js +43 -105
  249. package/dist/index221.cjs +1 -1
  250. package/dist/index221.js +8 -205
  251. package/dist/index222.cjs +2 -1
  252. package/dist/index222.js +40 -41
  253. package/dist/index223.cjs +1 -1
  254. package/dist/index223.js +2 -79
  255. package/dist/index224.cjs +1 -1
  256. package/dist/index224.js +6 -2
  257. package/dist/index225.cjs +1 -1
  258. package/dist/index225.js +10 -24
  259. package/dist/index226.cjs +1 -1
  260. package/dist/index226.js +17 -44
  261. package/dist/index227.cjs +1 -1
  262. package/dist/index227.js +8 -9
  263. package/dist/index228.cjs +1 -2
  264. package/dist/index228.js +66 -41
  265. package/dist/index229.cjs +1 -1
  266. package/dist/index229.js +66 -2
  267. package/dist/index23.cjs +1 -1
  268. package/dist/index23.js +2 -2
  269. package/dist/index230.cjs +1 -1
  270. package/dist/index230.js +188 -5
  271. package/dist/index231.cjs +1 -1
  272. package/dist/index231.js +27 -9
  273. package/dist/index232.cjs +1 -1
  274. package/dist/index232.js +74 -17
  275. package/dist/index233.cjs +1 -1
  276. package/dist/index233.js +40 -8
  277. package/dist/index234.cjs +1 -1
  278. package/dist/index234.js +16 -66
  279. package/dist/index235.cjs +1 -1
  280. package/dist/index235.js +12 -64
  281. package/dist/index236.cjs +1 -1
  282. package/dist/index236.js +11 -188
  283. package/dist/index237.cjs +1 -1
  284. package/dist/index237.js +12 -28
  285. package/dist/index238.cjs +1 -1
  286. package/dist/index238.js +17 -74
  287. package/dist/index239.cjs +1 -1
  288. package/dist/index239.js +105 -37
  289. package/dist/index24.cjs +1 -1
  290. package/dist/index24.js +5 -5
  291. package/dist/index240.cjs +1 -1
  292. package/dist/index240.js +6 -16
  293. package/dist/index241.cjs +1 -1
  294. package/dist/index241.js +7 -14
  295. package/dist/index242.cjs +1 -1
  296. package/dist/index242.js +26 -11
  297. package/dist/index243.cjs +1 -1
  298. package/dist/index243.js +102 -11
  299. package/dist/index244.cjs +1 -1
  300. package/dist/index244.js +16 -6
  301. package/dist/index245.cjs +1 -1
  302. package/dist/index245.js +215 -7
  303. package/dist/index246.cjs +1 -1
  304. package/dist/index246.js +205 -18
  305. package/dist/index247.cjs +1 -1
  306. package/dist/index247.js +41 -25
  307. package/dist/index248.cjs +1 -1
  308. package/dist/index248.js +77 -10
  309. package/dist/index249.cjs +1 -1
  310. package/dist/index249.js +2 -20
  311. package/dist/index25.cjs +1 -1
  312. package/dist/index25.js +3 -3
  313. package/dist/index250.cjs +2 -1
  314. package/dist/index250.js +88 -654
  315. package/dist/index251.cjs +1 -1
  316. package/dist/index251.js +14 -177
  317. package/dist/index252.cjs +1 -2
  318. package/dist/index252.js +68 -91
  319. package/dist/index253.cjs +1 -1
  320. package/dist/index253.js +657 -14
  321. package/dist/index254.cjs +1 -1
  322. package/dist/index254.js +176 -67
  323. package/dist/index26.cjs +1 -1
  324. package/dist/index26.js +1 -1
  325. package/dist/index29.cjs +1 -1
  326. package/dist/index29.js +171 -13
  327. package/dist/index30.cjs +1 -1
  328. package/dist/index30.js +109 -32
  329. package/dist/index31.cjs +1 -1
  330. package/dist/index31.js +30 -32
  331. package/dist/index32.cjs +1 -1
  332. package/dist/index32.js +3 -55
  333. package/dist/index33.cjs +1 -1
  334. package/dist/index33.js +2 -46
  335. package/dist/index34.cjs +1 -1
  336. package/dist/index34.js +4 -26
  337. package/dist/index35.cjs +2 -1
  338. package/dist/index35.js +59 -6
  339. package/dist/index36.cjs +2 -1
  340. package/dist/index36.js +54 -18
  341. package/dist/index37.cjs +3 -1
  342. package/dist/index37.js +215 -15
  343. package/dist/index38.cjs +1 -1
  344. package/dist/index38.js +23 -5
  345. package/dist/index39.cjs +1 -1
  346. package/dist/index39.js +18 -13
  347. package/dist/index40.cjs +1 -1
  348. package/dist/index40.js +10 -10
  349. package/dist/index41.cjs +1 -1
  350. package/dist/index41.js +19 -11
  351. package/dist/index42.cjs +1 -1
  352. package/dist/index42.js +45 -11
  353. package/dist/index43.cjs +1 -1
  354. package/dist/index43.js +13 -3
  355. package/dist/index44.cjs +1 -1
  356. package/dist/index44.js +12 -21
  357. package/dist/index45.cjs +1 -1
  358. package/dist/index45.js +24 -8
  359. package/dist/index46.cjs +1 -1
  360. package/dist/index46.js +28 -3
  361. package/dist/index47.cjs +1 -1
  362. package/dist/index47.js +47 -16
  363. package/dist/index48.cjs +1 -1
  364. package/dist/index48.js +16 -5
  365. package/dist/index49.cjs +1 -1
  366. package/dist/index49.js +10 -170
  367. package/dist/index50.cjs +1 -1
  368. package/dist/index50.js +30 -102
  369. package/dist/index51.cjs +1 -1
  370. package/dist/index51.js +34 -169
  371. package/dist/index52.cjs +1 -1
  372. package/dist/index52.js +7 -111
  373. package/dist/index53.cjs +1 -1
  374. package/dist/index53.js +29 -30
  375. package/dist/index54.cjs +1 -1
  376. package/dist/index54.js +23 -2
  377. package/dist/index55.cjs +1 -1
  378. package/dist/index55.js +8 -4
  379. package/dist/index56.cjs +1 -2
  380. package/dist/index56.js +69 -58
  381. package/dist/index57.cjs +1 -2
  382. package/dist/index57.js +43 -51
  383. package/dist/index58.cjs +1 -3
  384. package/dist/index58.js +16 -208
  385. package/dist/index59.cjs +1 -1
  386. package/dist/index59.js +36 -22
  387. package/dist/index60.cjs +1 -1
  388. package/dist/index60.js +17 -18
  389. package/dist/index61.cjs +1 -1
  390. package/dist/index61.js +6 -10
  391. package/dist/index62.cjs +1 -1
  392. package/dist/index62.js +9 -20
  393. package/dist/index63.cjs +1 -1
  394. package/dist/index63.js +10 -10
  395. package/dist/index64.cjs +1 -1
  396. package/dist/index64.js +164 -12
  397. package/dist/index65.cjs +1 -1
  398. package/dist/index65.js +31 -23
  399. package/dist/index66.cjs +1 -1
  400. package/dist/index66.js +74 -25
  401. package/dist/index67.cjs +1 -1
  402. package/dist/index67.js +13 -47
  403. package/dist/index68.cjs +1 -1
  404. package/dist/index68.js +51 -16
  405. package/dist/index69.cjs +1 -1
  406. package/dist/index69.js +7 -11
  407. package/dist/index70.cjs +1 -1
  408. package/dist/index70.js +7 -31
  409. package/dist/index71.cjs +1 -1
  410. package/dist/index71.js +21 -36
  411. package/dist/index72.cjs +1 -1
  412. package/dist/index72.js +8 -7
  413. package/dist/index73.cjs +1 -1
  414. package/dist/index73.js +29 -27
  415. package/dist/index74.cjs +1 -1
  416. package/dist/index74.js +15 -21
  417. package/dist/index75.cjs +1 -1
  418. package/dist/index75.js +73 -7
  419. package/dist/index76.cjs +1 -1
  420. package/dist/index76.js +35 -70
  421. package/dist/index77.cjs +1 -1
  422. package/dist/index77.js +16 -46
  423. package/dist/index78.cjs +1 -1
  424. package/dist/index78.js +73 -21
  425. package/dist/index79.cjs +1 -1
  426. package/dist/index79.js +12 -37
  427. package/dist/index80.cjs +1 -1
  428. package/dist/index80.js +29 -17
  429. package/dist/index81.cjs +2 -1
  430. package/dist/index81.js +120 -6
  431. package/dist/index82.cjs +1 -1
  432. package/dist/index82.js +13 -8
  433. package/dist/index83.cjs +1 -1
  434. package/dist/index83.js +24 -13
  435. package/dist/index84.cjs +1 -1
  436. package/dist/index84.js +31 -162
  437. package/dist/index85.cjs +1 -1
  438. package/dist/index85.js +39 -72
  439. package/dist/index86.cjs +1 -1
  440. package/dist/index86.js +5 -12
  441. package/dist/index87.cjs +1 -1
  442. package/dist/index87.js +102 -50
  443. package/dist/index88.cjs +1 -1
  444. package/dist/index88.js +37 -7
  445. package/dist/index89.cjs +1 -1
  446. package/dist/index89.js +8 -7
  447. package/dist/index90.cjs +1 -1
  448. package/dist/index90.js +20 -21
  449. package/dist/index91.cjs +1 -1
  450. package/dist/index91.js +2 -9
  451. package/dist/index92.cjs +1 -1
  452. package/dist/index92.js +75 -31
  453. package/dist/index93.cjs +1 -1
  454. package/dist/index93.js +15 -16
  455. package/dist/index94.cjs +1 -1
  456. package/dist/index94.js +150 -72
  457. package/dist/index95.cjs +20 -1
  458. package/dist/index95.js +326 -35
  459. package/dist/index96.cjs +3 -1
  460. package/dist/index96.js +451 -16
  461. package/dist/index97.cjs +1 -1
  462. package/dist/index97.js +70 -72
  463. package/dist/index98.cjs +1 -1
  464. package/dist/index98.js +16 -12
  465. package/dist/index99.cjs +1 -1
  466. package/dist/index99.js +10 -29
  467. package/package.json +1 -1
package/dist/index187.js CHANGED
@@ -1,23 +1,52 @@
1
- import { BaseError as o } from "./index56.js";
2
- class i extends o {
3
- constructor({ offset: e }) {
4
- super(`Offset \`${e}\` cannot be negative.`, {
5
- name: "NegativeOffsetError"
1
+ import { stringify as i } from "./index91.js";
2
+ import { BaseError as a } from "./index35.js";
3
+ import { getUrl as n } from "./index158.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"
6
23
  });
7
24
  }
8
25
  }
9
- class n extends o {
10
- constructor({ length: e, position: r }) {
11
- super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`, { name: "PositionOutOfBoundsError" });
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
+ });
12
35
  }
13
36
  }
14
- class c extends o {
15
- constructor({ count: e, limit: r }) {
16
- super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`, { name: "RecursiveReadLimitExceededError" });
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
+ });
17
46
  }
18
47
  }
19
48
  export {
20
- i as NegativeOffsetError,
21
- n as PositionOutOfBoundsError,
22
- c as RecursiveReadLimitExceededError
49
+ u as OffchainLookupError,
50
+ g as OffchainLookupResponseMalformedError,
51
+ M as OffchainLookupSenderMismatchError
23
52
  };
package/dist/index188.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index206.cjs"),e=t.toSignatureHash;exports.toEventSelector=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index21.cjs"),y=require("./index152.cjs"),h=require("./index173.cjs"),n=require("./index177.cjs"),w=require("./index180.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;
package/dist/index188.js CHANGED
@@ -1,5 +1,35 @@
1
- import { toSignatureHash as t } from "./index206.js";
2
- const e = t;
1
+ import { batchGatewayAbi as o } from "./index21.js";
2
+ import { solidityError as l } from "./index152.js";
3
+ import { decodeFunctionData as f } from "./index173.js";
4
+ import { encodeErrorResult as n } from "./index177.js";
5
+ import { encodeFunctionResult as p } from "./index180.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
+ });
31
+ }
3
32
  export {
4
- e as toEventSelector
33
+ g as localBatchGatewayRequest,
34
+ d as localBatchGatewayUrl
5
35
  };
package/dist/index189.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index114.cjs"),o=require("./index122.cjs"),u=require("./index186.cjs"),s=require("./index182.cjs"),d=require("./index166.cjs");function b(c){const{abi:r,data:e}=c,n=o.slice(e,0,4),t=r.find(i=>i.type==="function"&&n===u.toFunctionSelector(d.formatAbiItem(i)));if(!t)throw new a.AbiFunctionSignatureNotFoundError(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:t.name,args:"inputs"in t&&t.inputs&&t.inputs.length>0?s.decodeAbiParameters(t.inputs,o.slice(e,4)):void 0}}exports.decodeFunctionData=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function c(r){const n={formatters:void 0,fees:void 0,serializers:void 0,...r};function t(i){return e=>{const s=typeof e=="function"?e(i):e,o={...i,...s};return Object.assign(o,{extend:t(o)})}}return Object.assign(n,{extend:t(n)})}exports.defineChain=c;
package/dist/index189.js CHANGED
@@ -1,19 +1,20 @@
1
- import { AbiFunctionSignatureNotFoundError as a } from "./index114.js";
2
- import { slice as r } from "./index122.js";
3
- import { toFunctionSelector as u } from "./index186.js";
4
- import { decodeAbiParameters as m } from "./index182.js";
5
- import { formatAbiItem as d } from "./index166.js";
6
- function g(e) {
7
- const { abi: c, data: o } = e, n = r(o, 0, 4), t = c.find((i) => i.type === "function" && n === u(d(i)));
8
- if (!t)
9
- throw new a(n, {
10
- docsPath: "/docs/contract/decodeFunctionData"
11
- });
12
- return {
13
- functionName: t.name,
14
- args: "inputs" in t && t.inputs && t.inputs.length > 0 ? m(t.inputs, r(o, 4)) : void 0
1
+ function r(c) {
2
+ const n = {
3
+ formatters: void 0,
4
+ fees: void 0,
5
+ serializers: void 0,
6
+ ...c
15
7
  };
8
+ function t(i) {
9
+ return (e) => {
10
+ const o = typeof e == "function" ? e(i) : e, s = { ...i, ...o };
11
+ return Object.assign(s, { extend: t(s) });
12
+ };
13
+ }
14
+ return Object.assign(n, {
15
+ extend: t(n)
16
+ });
16
17
  }
17
18
  export {
18
- g as decodeFunctionData
19
+ r as defineChain
19
20
  };
package/dist/index190.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index176.cjs");function p(e,{dir:n,size:t=32}={}){return typeof e=="string"?o(e,{dir:n,size:t}):l(e,{dir:n,size:t})}function o(e,{dir:n,size:t=32}={}){if(t===null)return e;const r=e.replace("0x","");if(r.length>t*2)throw new i.SizeExceedsPaddingSizeError({size:Math.ceil(r.length/2),targetSize:t,type:"hex"});return`0x${r[n==="right"?"padEnd":"padStart"](t*2,"0")}`}function l(e,{dir:n,size:t=32}={}){if(t===null)return e;if(e.length>t)throw new i.SizeExceedsPaddingSizeError({size:e.length,targetSize:t,type:"bytes"});const r=new Uint8Array(t);for(let a=0;a<t;a++){const d=n==="right";r[d?a:t-a-1]=e[d?a:e.length-a-1]}return r}exports.pad=p;exports.padBytes=l;exports.padHex=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index35.cjs"),u=require("./index166.cjs"),f=require("./index168.cjs"),g=require("./index42.cjs");function c(n,e="hex"){const i=o(n),s=u.createCursor(new Uint8Array(i.length));return i.encode(s),e==="hex"?g.bytesToHex(s.bytes):s.bytes}function o(n){return Array.isArray(n)?p(n.map(e=>o(e))):y(n)}function p(n){const e=n.reduce((t,h)=>t+h.length,0),i=l(e);return{length:e<=55?1+e:1+i+e,encode(t){e<=55?t.pushByte(192+e):(t.pushByte(247+i),i===1?t.pushUint8(e):i===2?t.pushUint16(e):i===3?t.pushUint24(e):t.pushUint32(e));for(const{encode:h}of n)h(t)}}}function y(n){const e=typeof n=="string"?f.hexToBytes(n):n,i=l(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+i+e.length,encode(t){e.length===1&&e[0]<128?t.pushBytes(e):e.length<=55?(t.pushByte(128+e.length),t.pushBytes(e)):(t.pushByte(183+i),i===1?t.pushUint8(e.length):i===2?t.pushUint16(e.length):i===3?t.pushUint24(e.length):t.pushUint32(e.length),t.pushBytes(e))}}}function l(n){if(n<2**8)return 1;if(n<2**16)return 2;if(n<2**24)return 3;if(n<2**32)return 4;throw new r.BaseError("Length is too large.")}exports.toRlp=c;
package/dist/index190.js CHANGED
@@ -1,37 +1,45 @@
1
- import { SizeExceedsPaddingSizeError as d } from "./index176.js";
2
- function f(n, { dir: r, size: t = 32 } = {}) {
3
- return typeof n == "string" ? p(n, { dir: r, size: t }) : i(n, { dir: r, size: t });
1
+ import { BaseError as l } from "./index35.js";
2
+ import { createCursor as r } from "./index166.js";
3
+ import { hexToBytes as g } from "./index168.js";
4
+ import { bytesToHex as u } from "./index42.js";
5
+ function m(n, e = "hex") {
6
+ const i = s(n), h = r(new Uint8Array(i.length));
7
+ return i.encode(h), e === "hex" ? u(h.bytes) : h.bytes;
4
8
  }
5
- function p(n, { dir: r, size: t = 32 } = {}) {
6
- if (t === null)
7
- return n;
8
- const e = n.replace("0x", "");
9
- if (e.length > t * 2)
10
- throw new d({
11
- size: Math.ceil(e.length / 2),
12
- targetSize: t,
13
- type: "hex"
14
- });
15
- return `0x${e[r === "right" ? "padEnd" : "padStart"](t * 2, "0")}`;
9
+ function s(n) {
10
+ return Array.isArray(n) ? p(n.map((e) => s(e))) : y(n);
16
11
  }
17
- function i(n, { dir: r, size: t = 32 } = {}) {
18
- if (t === null)
19
- return n;
20
- if (n.length > t)
21
- throw new d({
22
- size: n.length,
23
- targetSize: t,
24
- type: "bytes"
25
- });
26
- const e = new Uint8Array(t);
27
- for (let a = 0; a < t; a++) {
28
- const o = r === "right";
29
- e[o ? a : t - a - 1] = n[o ? a : n.length - a - 1];
30
- }
31
- return e;
12
+ function p(n) {
13
+ const e = n.reduce((t, f) => t + f.length, 0), i = o(e);
14
+ return {
15
+ length: e <= 55 ? 1 + e : 1 + i + e,
16
+ encode(t) {
17
+ e <= 55 ? t.pushByte(192 + e) : (t.pushByte(247 + i), i === 1 ? t.pushUint8(e) : i === 2 ? t.pushUint16(e) : i === 3 ? t.pushUint24(e) : t.pushUint32(e));
18
+ for (const { encode: f } of n)
19
+ f(t);
20
+ }
21
+ };
22
+ }
23
+ function y(n) {
24
+ const e = typeof n == "string" ? g(n) : n, i = o(e.length);
25
+ return {
26
+ length: e.length === 1 && e[0] < 128 ? 1 : e.length <= 55 ? 1 + e.length : 1 + i + e.length,
27
+ encode(t) {
28
+ e.length === 1 && e[0] < 128 ? t.pushBytes(e) : e.length <= 55 ? (t.pushByte(128 + e.length), t.pushBytes(e)) : (t.pushByte(183 + i), i === 1 ? t.pushUint8(e.length) : i === 2 ? t.pushUint16(e.length) : i === 3 ? t.pushUint24(e.length) : t.pushUint32(e.length), t.pushBytes(e));
29
+ }
30
+ };
31
+ }
32
+ function o(n) {
33
+ if (n < 2 ** 8)
34
+ return 1;
35
+ if (n < 2 ** 16)
36
+ return 2;
37
+ if (n < 2 ** 24)
38
+ return 3;
39
+ if (n < 2 ** 32)
40
+ return 4;
41
+ throw new l("Length is too large.");
32
42
  }
33
43
  export {
34
- f as pad,
35
- i as padBytes,
36
- p as padHex
44
+ m as toRlp
37
45
  };
package/dist/index191.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,t=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;exports.bytesRegex=e;exports.integerRegex=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index238.cjs"),c=require("./index239.cjs"),A=BigInt(0),u=BigInt(1),H=BigInt(2),L=BigInt(7),S=BigInt(256),T=BigInt(113),O=[],y=[],w=[];for(let n=0,t=u,s=1,i=0;n<24;n++){[s,i]=[i,(2*s+3*i)%5],O.push(2*(5*i+s)),y.push((n+1)*(n+2)/2%64);let o=A;for(let r=0;r<7;r++)t=(t<<u^(t>>L)*T)%S,t&H&&(o^=u<<(u<<BigInt(r))-u);w.push(o)}const _=f.split(w,!0),F=_[0],X=_[1],I=(n,t,s)=>s>32?f.rotlBH(n,t,s):f.rotlSH(n,t,s),x=(n,t,s)=>s>32?f.rotlBL(n,t,s):f.rotlSL(n,t,s);function b(n,t=24){const s=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let e=0;e<10;e++)s[e]=n[e]^n[e+10]^n[e+20]^n[e+30]^n[e+40];for(let e=0;e<10;e+=2){const h=(e+8)%10,l=(e+2)%10,p=s[l],a=s[l+1],g=I(p,a,1)^s[h],B=x(p,a,1)^s[h+1];for(let d=0;d<50;d+=10)n[e+d]^=g,n[e+d+1]^=B}let o=n[2],r=n[3];for(let e=0;e<24;e++){const h=y[e],l=I(o,r,h),p=x(o,r,h),a=O[e];o=n[a],r=n[a+1],n[a]=l,n[a+1]=p}for(let e=0;e<50;e+=10){for(let h=0;h<10;h++)s[h]=n[e+h];for(let h=0;h<10;h++)n[e+h]^=~s[(h+2)%10]&s[(h+4)%10]}n[0]^=F[i],n[1]^=X[i]}c.clean(s)}class k extends c.Hash{constructor(t,s,i,o=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=s,this.outputLen=i,this.enableXOF=o,this.rounds=r,c.anumber(i),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=c.u32(this.state)}clone(){return this._cloneInto()}keccak(){c.swap32IfBE(this.state32),b(this.state32,this.rounds),c.swap32IfBE(this.state32),this.posOut=0,this.pos=0}update(t){c.aexists(this),t=c.toBytes(t),c.abytes(t);const{blockLen:s,state:i}=this,o=t.length;for(let r=0;r<o;){const e=Math.min(s-this.pos,o-r);for(let h=0;h<e;h++)i[this.pos++]^=t[r++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:s,pos:i,blockLen:o}=this;t[i]^=s,s&128&&i===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){c.aexists(this,!1),c.abytes(t),this.finish();const s=this.state,{blockLen:i}=this;for(let o=0,r=t.length;o<r;){this.posOut>=i&&this.keccak();const e=Math.min(i-this.posOut,r-o);t.set(s.subarray(this.posOut,this.posOut+e),o),this.posOut+=e,o+=e}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return c.anumber(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(c.aoutput(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,c.clean(this.state)}_cloneInto(t){const{blockLen:s,suffix:i,outputLen:o,rounds:r,enableXOF:e}=this;return t||(t=new k(s,i,o,e,r)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=r,t.suffix=i,t.outputLen=o,t.enableXOF=e,t.destroyed=this.destroyed,t}}const m=(n,t,s)=>c.createHasher(()=>new k(t,n,s)),E=m(1,136,256/8);exports.Keccak=k;exports.keccakP=b;exports.keccak_256=E;
package/dist/index191.js CHANGED
@@ -1,5 +1,107 @@
1
- const e = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, t = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
1
+ import { split as L, rotlSH as T, rotlSL as S, rotlBH as m, rotlBL as F } from "./index238.js";
2
+ import { createHasher as X, Hash as E, anumber as d, u32 as U, swap32IfBE as I, aexists as x, toBytes as P, abytes as k, aoutput as M, clean as y } from "./index239.js";
3
+ const R = BigInt(0), f = BigInt(1), j = BigInt(2), q = BigInt(7), v = BigInt(256), z = BigInt(113), _ = [], g = [], B = [];
4
+ for (let n = 0, t = f, s = 1, i = 0; n < 24; n++) {
5
+ [s, i] = [i, (2 * s + 3 * i) % 5], _.push(2 * (5 * i + s)), g.push((n + 1) * (n + 2) / 2 % 64);
6
+ let o = R;
7
+ for (let r = 0; r < 7; r++)
8
+ t = (t << f ^ (t >> q) * z) % v, t & j && (o ^= f << (f << /* @__PURE__ */ BigInt(r)) - f);
9
+ B.push(o);
10
+ }
11
+ const A = L(B, !0), C = A[0], D = A[1], O = (n, t, s) => s > 32 ? m(n, t, s) : T(n, t, s), w = (n, t, s) => s > 32 ? F(n, t, s) : S(n, t, s);
12
+ function G(n, t = 24) {
13
+ const s = new Uint32Array(10);
14
+ for (let i = 24 - t; i < 24; i++) {
15
+ for (let e = 0; e < 10; e++)
16
+ s[e] = n[e] ^ n[e + 10] ^ n[e + 20] ^ n[e + 30] ^ n[e + 40];
17
+ for (let e = 0; e < 10; e += 2) {
18
+ const h = (e + 8) % 10, l = (e + 2) % 10, u = s[l], c = s[l + 1], b = O(u, c, 1) ^ s[h], H = w(u, c, 1) ^ s[h + 1];
19
+ for (let a = 0; a < 50; a += 10)
20
+ n[e + a] ^= b, n[e + a + 1] ^= H;
21
+ }
22
+ let o = n[2], r = n[3];
23
+ for (let e = 0; e < 24; e++) {
24
+ const h = g[e], l = O(o, r, h), u = w(o, r, h), c = _[e];
25
+ o = n[c], r = n[c + 1], n[c] = l, n[c + 1] = u;
26
+ }
27
+ for (let e = 0; e < 50; e += 10) {
28
+ for (let h = 0; h < 10; h++)
29
+ s[h] = n[e + h];
30
+ for (let h = 0; h < 10; h++)
31
+ n[e + h] ^= ~s[(h + 2) % 10] & s[(h + 4) % 10];
32
+ }
33
+ n[0] ^= C[i], n[1] ^= D[i];
34
+ }
35
+ y(s);
36
+ }
37
+ class p extends E {
38
+ // NOTE: we accept arguments in bytes instead of bits here.
39
+ constructor(t, s, i, o = !1, r = 24) {
40
+ if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = t, this.suffix = s, this.outputLen = i, this.enableXOF = o, this.rounds = r, d(i), !(0 < t && t < 200))
41
+ throw new Error("only keccak-f1600 function is supported");
42
+ this.state = new Uint8Array(200), this.state32 = U(this.state);
43
+ }
44
+ clone() {
45
+ return this._cloneInto();
46
+ }
47
+ keccak() {
48
+ I(this.state32), G(this.state32, this.rounds), I(this.state32), this.posOut = 0, this.pos = 0;
49
+ }
50
+ update(t) {
51
+ x(this), t = P(t), k(t);
52
+ const { blockLen: s, state: i } = this, o = t.length;
53
+ for (let r = 0; r < o; ) {
54
+ const e = Math.min(s - this.pos, o - r);
55
+ for (let h = 0; h < e; h++)
56
+ i[this.pos++] ^= t[r++];
57
+ this.pos === s && this.keccak();
58
+ }
59
+ return this;
60
+ }
61
+ finish() {
62
+ if (this.finished)
63
+ return;
64
+ this.finished = !0;
65
+ const { state: t, suffix: s, pos: i, blockLen: o } = this;
66
+ t[i] ^= s, s & 128 && i === o - 1 && this.keccak(), t[o - 1] ^= 128, this.keccak();
67
+ }
68
+ writeInto(t) {
69
+ x(this, !1), k(t), this.finish();
70
+ const s = this.state, { blockLen: i } = this;
71
+ for (let o = 0, r = t.length; o < r; ) {
72
+ this.posOut >= i && this.keccak();
73
+ const e = Math.min(i - this.posOut, r - o);
74
+ t.set(s.subarray(this.posOut, this.posOut + e), o), this.posOut += e, o += e;
75
+ }
76
+ return t;
77
+ }
78
+ xofInto(t) {
79
+ if (!this.enableXOF)
80
+ throw new Error("XOF is not possible for this instance");
81
+ return this.writeInto(t);
82
+ }
83
+ xof(t) {
84
+ return d(t), this.xofInto(new Uint8Array(t));
85
+ }
86
+ digestInto(t) {
87
+ if (M(t, this), this.finished)
88
+ throw new Error("digest() was already called");
89
+ return this.writeInto(t), this.destroy(), t;
90
+ }
91
+ digest() {
92
+ return this.digestInto(new Uint8Array(this.outputLen));
93
+ }
94
+ destroy() {
95
+ this.destroyed = !0, y(this.state);
96
+ }
97
+ _cloneInto(t) {
98
+ const { blockLen: s, suffix: i, outputLen: o, rounds: r, enableXOF: e } = this;
99
+ return t || (t = new p(s, i, o, e, r)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = r, t.suffix = i, t.outputLen = o, t.enableXOF = e, t.destroyed = this.destroyed, t;
100
+ }
101
+ }
102
+ const J = (n, t, s) => X(() => new p(t, n, s)), Q = J(1, 136, 256 / 8);
2
103
  export {
3
- e as bytesRegex,
4
- t as integerRegex
104
+ p as Keccak,
105
+ G as keccakP,
106
+ Q as keccak_256
5
107
  };
package/dist/index192.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index114.cjs"),d=require("./index138.cjs"),m=require("./index186.cjs"),f=require("./index185.cjs"),l=require("./index166.cjs"),A=require("./index94.cjs"),n="/docs/contract/encodeErrorResult";function E(a){const{abi:i,errorName:t,args:r}=a;let e=i[0];if(t){const s=A.getAbiItem({abi:i,args:r,name:t});if(!s)throw new o.AbiErrorNotFoundError(t,{docsPath:n});e=s}if(e.type!=="error")throw new o.AbiErrorNotFoundError(void 0,{docsPath:n});const u=l.formatAbiItem(e),b=m.toFunctionSelector(u);let c="0x";if(r&&r.length>0){if(!e.inputs)throw new o.AbiErrorInputsNotFoundError(e.name,{docsPath:n});c=f.encodeAbiParameters(e.inputs,r)}return d.concatHex([b,c])}exports.encodeErrorResult=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index243.cjs"),s=e.sha256;exports.sha256=s;
package/dist/index192.js CHANGED
@@ -1,30 +1,5 @@
1
- import { AbiErrorNotFoundError as c, AbiErrorInputsNotFoundError as u } from "./index114.js";
2
- import { concatHex as d } from "./index138.js";
3
- import { toFunctionSelector as p } from "./index186.js";
4
- import { encodeAbiParameters as b } from "./index185.js";
5
- import { formatAbiItem as l } from "./index166.js";
6
- import { getAbiItem as w } from "./index94.js";
7
- const e = "/docs/contract/encodeErrorResult";
8
- function F(a) {
9
- const { abi: n, errorName: t, args: o } = a;
10
- let r = n[0];
11
- if (t) {
12
- const m = w({ abi: n, args: o, name: t });
13
- if (!m)
14
- throw new c(t, { docsPath: e });
15
- r = m;
16
- }
17
- if (r.type !== "error")
18
- throw new c(void 0, { docsPath: e });
19
- const f = l(r), s = p(f);
20
- let i = "0x";
21
- if (o && o.length > 0) {
22
- if (!r.inputs)
23
- throw new u(r.name, { docsPath: e });
24
- i = b(r.inputs, o);
25
- }
26
- return d([s, i]);
27
- }
1
+ import { sha256 as s } from "./index243.js";
2
+ const o = s;
28
3
  export {
29
- F as encodeErrorResult
4
+ o as sha256
30
5
  };
package/dist/index193.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index114.cjs"),u=require("./index186.cjs"),b=require("./index166.cjs"),m=require("./index94.cjs"),r="/docs/contract/encodeFunctionData";function s(c){const{abi:n,args:a,functionName:e}=c;let t=n[0];if(e){const o=m.getAbiItem({abi:n,args:a,name:e});if(!o)throw new i.AbiFunctionNotFoundError(e,{docsPath:r});t=o}if(t.type!=="function")throw new i.AbiFunctionNotFoundError(void 0,{docsPath:r});return{abi:[t],functionName:u.toFunctionSelector(b.formatAbiItem(t))}}exports.prepareEncodeFunctionData=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index240.cjs"),r=require("./index241.cjs");function n(t){return e.hashSignature(r.toSignature(t))}exports.toSignatureHash=n;
package/dist/index193.js CHANGED
@@ -1,28 +1,8 @@
1
- import { AbiFunctionNotFoundError as i } from "./index114.js";
2
- import { toFunctionSelector as a } from "./index186.js";
3
- import { formatAbiItem as f } from "./index166.js";
4
- import { getAbiItem as u } from "./index94.js";
5
- const r = "/docs/contract/encodeFunctionData";
6
- function F(c) {
7
- const { abi: n, args: m, functionName: o } = c;
8
- let t = n[0];
9
- if (o) {
10
- const e = u({
11
- abi: n,
12
- args: m,
13
- name: o
14
- });
15
- if (!e)
16
- throw new i(o, { docsPath: r });
17
- t = e;
18
- }
19
- if (t.type !== "function")
20
- throw new i(void 0, { docsPath: r });
21
- return {
22
- abi: [t],
23
- functionName: a(f(t))
24
- };
1
+ import { hashSignature as t } from "./index240.js";
2
+ import { toSignature as o } from "./index241.js";
3
+ function a(r) {
4
+ return t(o(r));
25
5
  }
26
6
  export {
27
- F as prepareEncodeFunctionData
7
+ a as toSignatureHash
28
8
  };
package/dist/index194.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index114.cjs"),a=require("./index185.cjs"),d=require("./index94.cjs"),r="/docs/contract/encodeFunctionResult";function b(c){const{abi:i,functionName:o,result:e}=c;let t=i[0];if(o){const u=d.getAbiItem({abi:i,name:o});if(!u)throw new n.AbiFunctionNotFoundError(o,{docsPath:r});t=u}if(t.type!=="function")throw new n.AbiFunctionNotFoundError(void 0,{docsPath:r});if(!t.outputs)throw new n.AbiFunctionOutputsNotFoundError(t.name,{docsPath:r});const s=(()=>{if(t.outputs.length===0)return[];if(t.outputs.length===1)return[e];if(Array.isArray(e))return e;throw new n.InvalidArrayError(e)})();return a.encodeAbiParameters(t.outputs,s)}exports.encodeFunctionResult=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function i(e){return new Promise(t=>setTimeout(t,e))}exports.wait=i;
package/dist/index194.js CHANGED
@@ -1,31 +1,6 @@
1
- import { AbiFunctionNotFoundError as i, AbiFunctionOutputsNotFoundError as a, InvalidArrayError as f } from "./index114.js";
2
- import { encodeAbiParameters as m } from "./index185.js";
3
- import { getAbiItem as d } from "./index94.js";
4
- const r = "/docs/contract/encodeFunctionResult";
5
- function h(c) {
6
- const { abi: e, functionName: o, result: n } = c;
7
- let t = e[0];
8
- if (o) {
9
- const u = d({ abi: e, name: o });
10
- if (!u)
11
- throw new i(o, { docsPath: r });
12
- t = u;
13
- }
14
- if (t.type !== "function")
15
- throw new i(void 0, { docsPath: r });
16
- if (!t.outputs)
17
- throw new a(t.name, { docsPath: r });
18
- const s = (() => {
19
- if (t.outputs.length === 0)
20
- return [];
21
- if (t.outputs.length === 1)
22
- return [n];
23
- if (Array.isArray(n))
24
- return n;
25
- throw new f(n);
26
- })();
27
- return m(t.outputs, s);
1
+ async function n(e) {
2
+ return new Promise((t) => setTimeout(t, e));
28
3
  }
29
4
  export {
30
- h as encodeFunctionResult
5
+ n as wait
31
6
  };
package/dist/index195.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index33.cjs"),r=require("./index196.cjs");function c(t){const{commitment:o,version:s=1}=t,n=t.to??(typeof o=="string"?"hex":"bytes"),e=r.sha256(o);return e.set([s],0),n==="bytes"?e:i.bytesToHex(e)}exports.commitmentToVersionedHash=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function u(n,{errorInstance:r=new Error("timed out"),timeout:i,signal:a}){return new Promise((l,e)=>{(async()=>{let o;try{const t=new AbortController;i>0&&(o=setTimeout(()=>{a&&t.abort()},i)),l(await n({signal:(t==null?void 0:t.signal)||null}))}catch(t){(t==null?void 0:t.name)==="AbortError"&&e(r),e(t)}finally{clearTimeout(o)}})()})}exports.withTimeout=u;
package/dist/index195.js CHANGED
@@ -1,9 +1,20 @@
1
- import { bytesToHex as i } from "./index33.js";
2
- import { sha256 as m } from "./index196.js";
3
- function f(t) {
4
- const { commitment: e, version: s = 1 } = t, n = t.to ?? (typeof e == "string" ? "hex" : "bytes"), o = m(e);
5
- return o.set([s], 0), n === "bytes" ? o : i(o);
1
+ function u(r, { errorInstance: e = new Error("timed out"), timeout: i, signal: a }) {
2
+ return new Promise((l, n) => {
3
+ (async () => {
4
+ let o;
5
+ try {
6
+ const t = new AbortController();
7
+ i > 0 && (o = setTimeout(() => {
8
+ a && t.abort();
9
+ }, i)), l(await r({ signal: (t == null ? void 0 : t.signal) || null }));
10
+ } catch (t) {
11
+ (t == null ? void 0 : t.name) === "AbortError" && n(e), n(t);
12
+ } finally {
13
+ clearTimeout(o);
14
+ }
15
+ })();
16
+ });
6
17
  }
7
18
  export {
8
- f as commitmentToVersionedHash
19
+ u as withTimeout
9
20
  };
package/dist/index196.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index205.cjs"),s=require("./index46.cjs"),r=require("./index32.cjs");function o(t,i){return e.sha256(s.isHex(t,{strict:!1})?r.toBytes(t):t)}exports.sha256=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index178.cjs"),t=require("./index197.cjs");function a(e,s){return r.keccak256(t.toPrefixedMessage(e),s)}exports.hashMessage=a;
package/dist/index196.js CHANGED
@@ -1,9 +1,8 @@
1
- import { sha256 as o } from "./index205.js";
2
- import { isHex as s } from "./index46.js";
3
- import { toBytes as r } from "./index32.js";
4
- function p(t, i) {
5
- return o(s(t, { strict: !1 }) ? r(t) : t);
1
+ import { keccak256 as o } from "./index178.js";
2
+ import { toPrefixedMessage as t } from "./index197.js";
3
+ function f(e, r) {
4
+ return o(t(e), r);
6
5
  }
7
6
  export {
8
- p as sha256
7
+ f as hashMessage
9
8
  };
package/dist/index197.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index198.cjs"),y=require("./index199.cjs"),u=require("./index183.cjs"),B=require("./index167.cjs"),h=require("./index32.cjs"),d=require("./index33.cjs");function f(t){const a=t.to??(typeof t.data=="string"?"hex":"bytes"),n=typeof t.data=="string"?h.hexToBytes(t.data):t.data,s=B.size(n);if(!s)throw new y.EmptyBlobError;if(s>o.maxBytesPerTransaction)throw new y.BlobSizeTooLargeError({maxSize:o.maxBytesPerTransaction,size:s});const r=[];let b=!0,i=0;for(;b;){const e=u.createCursor(new Uint8Array(o.bytesPerBlob));let l=0;for(;l<o.fieldElementsPerBlob;){const c=n.slice(i,i+(o.bytesPerFieldElement-1));if(e.pushByte(0),e.pushBytes(c),c.length<31){e.pushByte(128),b=!1;break}l++,i+=31}r.push(e)}return a==="bytes"?r.map(e=>e.bytes):r.map(e=>d.bytesToHex(e.bytes))}exports.toBlobs=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index146.cjs"),o=require("./index120.cjs"),s=require("./index149.cjs"),r=require("./index42.cjs");function c(e){const t=typeof e=="string"?r.stringToHex(e):typeof e.raw=="string"?e.raw:r.bytesToHex(e.raw),i=r.stringToHex(`${n.presignMessagePrefix}${s.size(t)}`);return o.concat([i,t])}exports.toPrefixedMessage=c;
package/dist/index197.js CHANGED
@@ -1,35 +1,11 @@
1
- import { maxBytesPerTransaction as y, fieldElementsPerBlob as a, bytesPerFieldElement as f, bytesPerBlob as p } from "./index198.js";
2
- import { EmptyBlobError as c, BlobSizeTooLargeError as h } from "./index199.js";
3
- import { createCursor as B } from "./index183.js";
4
- import { size as u } from "./index167.js";
5
- import { hexToBytes as x } from "./index32.js";
6
- import { bytesToHex as d } from "./index33.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 { presignMessagePrefix as e } from "./index146.js";
2
+ import { concat as n } from "./index120.js";
3
+ import { size as f } from "./index149.js";
4
+ import { stringToHex as o, bytesToHex as p } from "./index42.js";
5
+ function u(r) {
6
+ const t = typeof r == "string" ? o(r) : typeof r.raw == "string" ? r.raw : p(r.raw), i = o(`${e}${f(t)}`);
7
+ return n([i, t]);
32
8
  }
33
9
  export {
34
- S as toBlobs
10
+ u as toPrefixedMessage
35
11
  };
package/dist/index198.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 p=require("./index169.cjs"),D=require("./index120.cjs"),y=require("./index42.cjs"),s=require("./index178.cjs"),u=require("./index132.cjs");function b(a){const{domain:n={},message:e,primaryType:t}=a,o={EIP712Domain:u.getTypesForEIP712Domain({domain:n}),...a.types};u.validateTypedData({domain:n,message:e,primaryType:t,types:o});const c=["0x1901"];return n&&c.push(f({domain:n,types:o})),t!=="EIP712Domain"&&c.push(d({data:e,primaryType:t,types:o})),s.keccak256(D.concat(c))}function f({domain:a,types:n}){return d({data:a,primaryType:"EIP712Domain",types:n})}function d({data:a,primaryType:n,types:e}){const t=m({data:a,primaryType:n,types:e});return s.keccak256(t)}function m({data:a,primaryType:n,types:e}){const t=[{type:"bytes32"}],o=[l({primaryType:n,types:e})];for(const c of e[n]){const[r,i]=T({types:e,name:c.name,type:c.type,value:a[c.name]});t.push(r),o.push(i)}return p.encodeAbiParameters(t,o)}function l({primaryType:a,types:n}){const e=y.toHex(h({primaryType:a,types:n}));return s.keccak256(e)}function h({primaryType:a,types:n}){let e="";const t=k({primaryType:a,types:n});t.delete(a);const o=[a,...Array.from(t).sort()];for(const c of o)e+=`${c}(${n[c].map(({name:r,type:i})=>`${i} ${r}`).join(",")})`;return e}function k({primaryType:a,types:n},e=new Set){const t=a.match(/^\w*/u),o=t==null?void 0:t[0];if(e.has(o)||n[o]===void 0)return e;e.add(o);for(const c of n[o])k({primaryType:c.type,types:n},e);return e}function T({types:a,name:n,type:e,value:t}){if(a[e]!==void 0)return[{type:"bytes32"},s.keccak256(m({data:t,primaryType:e,types:a}))];if(e==="bytes")return[{type:"bytes32"},s.keccak256(t)];if(e==="string")return[{type:"bytes32"},s.keccak256(y.toHex(t))];if(e.lastIndexOf("]")===e.length-1){const o=e.slice(0,e.lastIndexOf("[")),c=t.map(r=>T({name:n,type:o,types:a,value:r}));return[{type:"bytes32"},s.keccak256(p.encodeAbiParameters(c.map(([r])=>r),c.map(([,r])=>r)))]}return[{type:e},t]}exports.encodeType=h;exports.hashDomain=f;exports.hashStruct=d;exports.hashTypedData=b;