@gardenfi/utils 2.2.1-beta.2 → 2.2.1-beta.4

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 (585) hide show
  1. package/dist/index10.cjs +1 -1
  2. package/dist/index10.js +3 -3
  3. package/dist/index100.cjs +1 -1
  4. package/dist/index100.js +6 -6
  5. package/dist/index101.cjs +1 -1
  6. package/dist/index101.js +50 -35
  7. package/dist/index102.cjs +1 -1
  8. package/dist/index102.js +16 -9
  9. package/dist/index103.cjs +1 -1
  10. package/dist/index103.js +9 -7
  11. package/dist/index104.cjs +1 -1
  12. package/dist/index104.js +5 -26
  13. package/dist/index105.cjs +1 -1
  14. package/dist/index105.js +14 -10
  15. package/dist/index106.cjs +1 -1
  16. package/dist/index106.js +3 -14
  17. package/dist/index107.cjs +1 -1
  18. package/dist/index107.js +25 -116
  19. package/dist/index108.cjs +1 -1
  20. package/dist/index108.js +4 -81
  21. package/dist/index109.cjs +1 -1
  22. package/dist/index109.js +6 -177
  23. package/dist/index110.cjs +1 -1
  24. package/dist/index110.js +87 -5
  25. package/dist/index111.cjs +1 -1
  26. package/dist/index111.js +125 -13
  27. package/dist/index112.cjs +1 -1
  28. package/dist/index112.js +6 -12
  29. package/dist/index113.cjs +1 -1
  30. package/dist/index113.js +20 -94
  31. package/dist/index114.cjs +1 -1
  32. package/dist/index114.js +16 -74
  33. package/dist/index115.cjs +1 -1
  34. package/dist/index115.js +39 -88
  35. package/dist/index116.cjs +1 -1
  36. package/dist/index116.js +20 -137
  37. package/dist/index117.cjs +1 -1
  38. package/dist/index117.js +10 -68
  39. package/dist/index118.cjs +1 -1
  40. package/dist/index118.js +6 -23
  41. package/dist/index119.cjs +1 -1
  42. package/dist/index119.js +103 -106
  43. package/dist/index120.cjs +1 -1
  44. package/dist/index120.js +3 -7
  45. package/dist/index121.cjs +1 -1
  46. package/dist/index121.js +4 -51
  47. package/dist/index122.cjs +1 -1
  48. package/dist/index122.js +9 -17
  49. package/dist/index123.cjs +1 -1
  50. package/dist/index123.js +2 -11
  51. package/dist/index124.cjs +2 -1
  52. package/dist/index124.js +3 -6
  53. package/dist/index125.cjs +20 -1
  54. package/dist/index125.js +326 -14
  55. package/dist/index126.cjs +1 -1
  56. package/dist/index126.js +13 -3
  57. package/dist/index127.cjs +1 -1
  58. package/dist/index127.js +4 -26
  59. package/dist/index128.cjs +1 -1
  60. package/dist/index128.js +2 -5
  61. package/dist/index129.cjs +1 -1
  62. package/dist/index129.js +7 -6
  63. package/dist/index130.cjs +3 -1
  64. package/dist/index130.js +211 -84
  65. package/dist/index131.cjs +1 -1
  66. package/dist/index131.js +30 -124
  67. package/dist/index132.cjs +1 -1
  68. package/dist/index132.js +21 -7
  69. package/dist/index133.cjs +1 -1
  70. package/dist/index133.js +5 -21
  71. package/dist/index134.cjs +1 -1
  72. package/dist/index134.js +73 -17
  73. package/dist/index135.cjs +1 -1
  74. package/dist/index135.js +5 -40
  75. package/dist/index136.cjs +1 -1
  76. package/dist/index136.js +5 -21
  77. package/dist/index137.cjs +9 -1
  78. package/dist/index137.js +35 -11
  79. package/dist/index138.cjs +3 -1
  80. package/dist/index138.js +110 -6
  81. package/dist/index139.cjs +1 -1
  82. package/dist/index139.js +3 -107
  83. package/dist/index140.cjs +1 -1
  84. package/dist/index140.js +24 -3
  85. package/dist/index141.cjs +3 -1
  86. package/dist/index141.js +452 -4
  87. package/dist/index142.cjs +2 -1
  88. package/dist/index142.js +55 -9
  89. package/dist/index143.cjs +1 -1
  90. package/dist/index143.js +27 -2
  91. package/dist/index144.cjs +1 -2
  92. package/dist/index144.js +34 -3
  93. package/dist/index145.cjs +1 -20
  94. package/dist/index145.js +29 -320
  95. package/dist/index146.cjs +4 -1
  96. package/dist/index146.js +192 -11
  97. package/dist/index147.cjs +1 -1
  98. package/dist/index147.js +8 -4
  99. package/dist/index148.cjs +1 -1
  100. package/dist/index148.js +13 -2
  101. package/dist/index149.cjs +1 -1
  102. package/dist/index149.js +17 -6
  103. package/dist/index150.cjs +1 -3
  104. package/dist/index150.js +19 -207
  105. package/dist/index151.cjs +1 -1
  106. package/dist/index151.js +9 -32
  107. package/dist/index152.cjs +1 -1
  108. package/dist/index152.js +55 -21
  109. package/dist/index153.cjs +1 -1
  110. package/dist/index153.js +45 -5
  111. package/dist/index154.cjs +1 -1
  112. package/dist/index154.js +8 -73
  113. package/dist/index155.cjs +1 -1
  114. package/dist/index155.js +7 -5
  115. package/dist/index156.cjs +1 -1
  116. package/dist/index156.js +16 -5
  117. package/dist/index157.cjs +1 -9
  118. package/dist/index157.js +16 -33
  119. package/dist/index158.cjs +1 -3
  120. package/dist/index158.js +21 -110
  121. package/dist/index159.cjs +1 -1
  122. package/dist/index159.js +52 -3
  123. package/dist/index16.cjs +1 -1
  124. package/dist/index16.js +3 -3
  125. package/dist/index160.cjs +1 -1
  126. package/dist/index160.js +11 -23
  127. package/dist/index161.cjs +1 -3
  128. package/dist/index161.js +161 -451
  129. package/dist/index162.cjs +1 -2
  130. package/dist/index162.js +20 -53
  131. package/dist/index163.cjs +1 -1
  132. package/dist/index163.js +126 -25
  133. package/dist/index164.cjs +1 -1
  134. package/dist/index164.js +33 -28
  135. package/dist/index165.cjs +1 -1
  136. package/dist/index165.js +6 -35
  137. package/dist/index166.cjs +1 -4
  138. package/dist/index166.js +27 -194
  139. package/dist/index167.cjs +1 -1
  140. package/dist/index167.js +189 -6
  141. package/dist/index168.cjs +1 -1
  142. package/dist/index168.js +4 -19
  143. package/dist/index169.cjs +1 -1
  144. package/dist/index169.js +60 -23
  145. package/dist/index170.cjs +1 -1
  146. package/dist/index170.js +3 -9
  147. package/dist/index171.cjs +1 -1
  148. package/dist/index171.js +20 -7
  149. package/dist/index172.cjs +1 -1
  150. package/dist/index172.js +16 -16
  151. package/dist/index173.cjs +1 -1
  152. package/dist/index173.js +23 -18
  153. package/dist/index174.cjs +1 -1
  154. package/dist/index174.js +11 -21
  155. package/dist/index175.cjs +1 -1
  156. package/dist/index175.js +33 -50
  157. package/dist/index176.cjs +1 -1
  158. package/dist/index176.js +3 -12
  159. package/dist/index177.cjs +1 -1
  160. package/dist/index177.js +18 -161
  161. package/dist/index178.cjs +1 -1
  162. package/dist/index178.js +26 -126
  163. package/dist/index179.cjs +1 -1
  164. package/dist/index179.js +35 -37
  165. package/dist/index18.cjs +1 -1
  166. package/dist/index18.js +2 -2
  167. package/dist/index180.cjs +1 -1
  168. package/dist/index180.js +10 -6
  169. package/dist/index181.cjs +1 -1
  170. package/dist/index181.js +25 -27
  171. package/dist/index182.cjs +1 -1
  172. package/dist/index182.js +27 -190
  173. package/dist/index183.cjs +1 -1
  174. package/dist/index183.js +66 -4
  175. package/dist/index184.cjs +1 -1
  176. package/dist/index184.js +9 -64
  177. package/dist/index185.cjs +1 -1
  178. package/dist/index185.js +34 -3
  179. package/dist/index186.cjs +1 -1
  180. package/dist/index186.js +24 -20
  181. package/dist/index187.cjs +1 -1
  182. package/dist/index187.js +24 -16
  183. package/dist/index188.cjs +1 -1
  184. package/dist/index188.js +3 -23
  185. package/dist/index189.cjs +1 -1
  186. package/dist/index189.js +14 -34
  187. package/dist/index19.cjs +1 -1
  188. package/dist/index19.js +8 -8
  189. package/dist/index190.cjs +1 -1
  190. package/dist/index190.js +104 -3
  191. package/dist/index191.cjs +1 -1
  192. package/dist/index191.js +80 -18
  193. package/dist/index192.cjs +1 -1
  194. package/dist/index192.js +5 -27
  195. package/dist/index193.cjs +1 -1
  196. package/dist/index193.js +6 -36
  197. package/dist/index194.cjs +1 -1
  198. package/dist/index194.js +27 -10
  199. package/dist/index195.cjs +1 -1
  200. package/dist/index195.js +39 -25
  201. package/dist/index196.cjs +1 -1
  202. package/dist/index196.js +13 -28
  203. package/dist/index197.cjs +1 -1
  204. package/dist/index197.js +39 -62
  205. package/dist/index198.cjs +1 -1
  206. package/dist/index198.js +5 -9
  207. package/dist/index199.cjs +1 -1
  208. package/dist/index199.js +11 -24
  209. package/dist/index200.cjs +1 -1
  210. package/dist/index200.js +19 -24
  211. package/dist/index201.cjs +1 -1
  212. package/dist/index201.js +78 -3
  213. package/dist/index202.cjs +1 -1
  214. package/dist/index202.js +2 -15
  215. package/dist/index203.cjs +1 -1
  216. package/dist/index203.js +33 -76
  217. package/dist/index204.cjs +1 -1
  218. package/dist/index204.js +111 -5
  219. package/dist/index205.cjs +1 -1
  220. package/dist/index205.js +48 -26
  221. package/dist/index206.cjs +1 -1
  222. package/dist/index206.js +30 -40
  223. package/dist/index207.cjs +1 -1
  224. package/dist/index207.js +8 -5
  225. package/dist/index208.cjs +1 -1
  226. package/dist/index208.js +6 -11
  227. package/dist/index209.cjs +1 -1
  228. package/dist/index209.js +6 -19
  229. package/dist/index21.cjs +1 -1
  230. package/dist/index21.js +2 -2
  231. package/dist/index210.cjs +1 -1
  232. package/dist/index210.js +11 -78
  233. package/dist/index211.cjs +1 -1
  234. package/dist/index211.js +11 -2
  235. package/dist/index212.cjs +1 -1
  236. package/dist/index212.js +12 -36
  237. package/dist/index213.cjs +1 -1
  238. package/dist/index213.js +28 -107
  239. package/dist/index214.cjs +1 -1
  240. package/dist/index214.js +5 -50
  241. package/dist/index215.cjs +1 -1
  242. package/dist/index215.js +7 -32
  243. package/dist/index216.cjs +1 -1
  244. package/dist/index216.js +8 -8
  245. package/dist/index217.cjs +1 -1
  246. package/dist/index217.js +20 -6
  247. package/dist/index218.cjs +1 -1
  248. package/dist/index218.js +31 -6
  249. package/dist/index219.cjs +1 -1
  250. package/dist/index219.js +20 -11
  251. package/dist/index220.cjs +1 -1
  252. package/dist/index220.js +3 -10
  253. package/dist/index221.cjs +1 -1
  254. package/dist/index221.js +17 -13
  255. package/dist/index222.cjs +1 -1
  256. package/dist/index222.js +10 -32
  257. package/dist/index223.cjs +1 -1
  258. package/dist/index223.js +22 -5
  259. package/dist/index224.cjs +1 -1
  260. package/dist/index224.js +22 -7
  261. package/dist/index225.cjs +1 -1
  262. package/dist/index225.js +5 -8
  263. package/dist/index226.cjs +1 -1
  264. package/dist/index226.js +5 -20
  265. package/dist/index227.cjs +1 -1
  266. package/dist/index227.js +8 -31
  267. package/dist/index228.cjs +1 -1
  268. package/dist/index228.js +104 -20
  269. package/dist/index229.cjs +1 -1
  270. package/dist/index229.js +3 -4
  271. package/dist/index23.cjs +1 -1
  272. package/dist/index23.js +9 -9
  273. package/dist/index230.cjs +1 -1
  274. package/dist/index230.js +18 -17
  275. package/dist/index231.cjs +1 -1
  276. package/dist/index231.js +170 -9
  277. package/dist/index232.cjs +1 -1
  278. package/dist/index232.js +16 -20
  279. package/dist/index233.cjs +1 -1
  280. package/dist/index233.js +10 -22
  281. package/dist/index234.cjs +1 -1
  282. package/dist/index234.js +16 -5
  283. package/dist/index235.cjs +1 -1
  284. package/dist/index235.js +22 -8
  285. package/dist/index236.cjs +1 -1
  286. package/dist/index236.js +29 -103
  287. package/dist/index237.cjs +1 -1
  288. package/dist/index237.js +2 -3
  289. package/dist/index238.cjs +1 -1
  290. package/dist/index238.js +13 -18
  291. package/dist/index239.cjs +1 -1
  292. package/dist/index239.js +11 -16
  293. package/dist/index24.cjs +1 -1
  294. package/dist/index24.js +12 -26
  295. package/dist/index240.cjs +1 -1
  296. package/dist/index240.js +47 -10
  297. package/dist/index241.cjs +1 -1
  298. package/dist/index241.js +10 -15
  299. package/dist/index242.cjs +1 -1
  300. package/dist/index242.js +7 -22
  301. package/dist/index243.cjs +1 -1
  302. package/dist/index243.js +9 -30
  303. package/dist/index244.cjs +1 -1
  304. package/dist/index244.js +14 -2
  305. package/dist/index245.cjs +1 -1
  306. package/dist/index245.js +14 -13
  307. package/dist/index246.cjs +1 -1
  308. package/dist/index246.js +9 -12
  309. package/dist/index247.cjs +1 -1
  310. package/dist/index247.js +24 -47
  311. package/dist/index248.cjs +1 -1
  312. package/dist/index248.js +12 -11
  313. package/dist/index249.cjs +1 -1
  314. package/dist/index249.js +24 -7
  315. package/dist/index25.cjs +1 -1
  316. package/dist/index25.js +58 -8
  317. package/dist/index250.cjs +1 -1
  318. package/dist/index250.js +12 -8
  319. package/dist/index251.cjs +1 -1
  320. package/dist/index251.js +15 -13
  321. package/dist/index252.cjs +2 -1
  322. package/dist/index252.js +22 -12
  323. package/dist/index253.cjs +1 -1
  324. package/dist/index253.js +52 -9
  325. package/dist/index254.cjs +1 -1
  326. package/dist/index254.js +25 -24
  327. package/dist/index255.cjs +1 -1
  328. package/dist/index255.js +13 -12
  329. package/dist/index256.cjs +1 -1
  330. package/dist/index256.js +15 -24
  331. package/dist/index257.cjs +1 -1
  332. package/dist/index257.js +5 -13
  333. package/dist/index258.cjs +1 -1
  334. package/dist/index258.js +13 -15
  335. package/dist/index259.cjs +1 -2
  336. package/dist/index259.js +10 -24
  337. package/dist/index26.cjs +16 -1
  338. package/dist/index26.js +113 -30
  339. package/dist/index260.cjs +1 -1
  340. package/dist/index260.js +16 -52
  341. package/dist/index261.cjs +2 -1
  342. package/dist/index261.js +40 -223
  343. package/dist/index262.cjs +1 -1
  344. package/dist/index262.js +2 -140
  345. package/dist/index263.cjs +1 -1
  346. package/dist/index263.js +5 -146
  347. package/dist/index264.cjs +1 -1
  348. package/dist/index264.js +10 -103
  349. package/dist/index265.cjs +1 -1
  350. package/dist/index265.js +19 -6
  351. package/dist/index266.cjs +1 -1
  352. package/dist/index266.js +8 -42
  353. package/dist/index267.cjs +1 -1
  354. package/dist/index267.js +62 -74
  355. package/dist/index268.cjs +1 -1
  356. package/dist/index268.js +66 -2
  357. package/dist/index269.cjs +1 -2
  358. package/dist/index269.js +185 -40
  359. package/dist/index27.cjs +1 -1
  360. package/dist/index27.js +1 -1
  361. package/dist/index270.cjs +1 -1
  362. package/dist/index270.js +23 -2
  363. package/dist/index271.cjs +1 -1
  364. package/dist/index271.js +42 -5
  365. package/dist/index272.cjs +1 -1
  366. package/dist/index272.js +75 -9
  367. package/dist/index273.cjs +1 -1
  368. package/dist/index273.js +38 -17
  369. package/dist/index274.cjs +1 -1
  370. package/dist/index274.js +16 -8
  371. package/dist/index275.cjs +1 -1
  372. package/dist/index275.js +13 -66
  373. package/dist/index276.cjs +1 -1
  374. package/dist/index276.js +11 -64
  375. package/dist/index277.cjs +2 -1
  376. package/dist/index277.js +16 -184
  377. package/dist/index278.cjs +1 -1
  378. package/dist/index278.js +13 -21
  379. package/dist/index279.cjs +1 -1
  380. package/dist/index279.js +11 -42
  381. package/dist/index28.cjs +1 -1
  382. package/dist/index28.js +31 -12
  383. package/dist/index280.cjs +1 -1
  384. package/dist/index280.js +6 -76
  385. package/dist/index281.cjs +1 -1
  386. package/dist/index281.js +7 -41
  387. package/dist/index282.cjs +1 -1
  388. package/dist/index282.js +25 -15
  389. package/dist/index283.cjs +1 -1
  390. package/dist/index283.js +18 -12
  391. package/dist/index284.cjs +1 -1
  392. package/dist/index284.js +145 -11
  393. package/dist/index285.cjs +1 -2
  394. package/dist/index285.js +103 -18
  395. package/dist/index286.cjs +1 -1
  396. package/dist/index286.js +6 -14
  397. package/dist/index287.cjs +1 -1
  398. package/dist/index287.js +224 -11
  399. package/dist/index288.cjs +1 -1
  400. package/dist/index288.js +3 -6
  401. package/dist/index289.cjs +1 -1
  402. package/dist/index289.js +141 -7
  403. package/dist/index29.cjs +1 -1
  404. package/dist/index29.js +11 -57
  405. package/dist/index290.cjs +1 -1
  406. package/dist/index290.js +155 -26
  407. package/dist/index291.cjs +1 -1
  408. package/dist/index291.js +9 -19
  409. package/dist/index292.cjs +1 -1
  410. package/dist/index292.js +113 -3
  411. package/dist/index293.cjs +2 -1
  412. package/dist/index293.js +122 -128
  413. package/dist/index294.cjs +1 -1
  414. package/dist/index294.js +137 -153
  415. package/dist/index295.cjs +1 -1
  416. package/dist/index295.js +42 -9
  417. package/dist/index296.cjs +1 -1
  418. package/dist/index296.js +72 -107
  419. package/dist/index297.cjs +1 -2
  420. package/dist/index297.js +2 -135
  421. package/dist/index298.cjs +1 -1
  422. package/dist/index298.js +1 -1
  423. package/dist/index30.cjs +1 -1
  424. package/dist/index30.js +26 -12
  425. package/dist/index300.cjs +1 -1
  426. package/dist/index300.js +68 -698
  427. package/dist/index301.cjs +1 -1
  428. package/dist/index301.js +675 -178
  429. package/dist/index302.cjs +1 -1
  430. package/dist/index302.js +200 -67
  431. package/dist/index303.cjs +1 -1
  432. package/dist/index303.js +1 -1
  433. package/dist/index305.cjs +1 -1
  434. package/dist/index305.js +1 -1
  435. package/dist/index306.cjs +1 -1
  436. package/dist/index306.js +3 -3
  437. package/dist/index308.cjs +1 -1
  438. package/dist/index308.js +1 -1
  439. package/dist/index31.cjs +1 -16
  440. package/dist/index31.js +7 -113
  441. package/dist/index310.cjs +1 -1
  442. package/dist/index310.js +2 -2
  443. package/dist/index311.cjs +1 -1
  444. package/dist/index311.js +63 -4
  445. package/dist/index312.cjs +1 -1
  446. package/dist/index312.js +40 -59
  447. package/dist/index313.cjs +1 -1
  448. package/dist/index313.js +4 -44
  449. package/dist/index32.cjs +1 -1
  450. package/dist/index32.js +7 -39
  451. package/dist/index33.cjs +1 -1
  452. package/dist/index33.js +31 -45
  453. package/dist/index34.cjs +1 -1
  454. package/dist/index34.js +28 -24
  455. package/dist/index35.cjs +1 -1
  456. package/dist/index35.js +16 -6
  457. package/dist/index36.cjs +1 -1
  458. package/dist/index36.js +33 -13
  459. package/dist/index37.cjs +1 -1
  460. package/dist/index37.js +44 -15
  461. package/dist/index38.cjs +1 -1
  462. package/dist/index38.js +151 -5
  463. package/dist/index39.cjs +1 -1
  464. package/dist/index39.js +34 -12
  465. package/dist/index40.cjs +1 -1
  466. package/dist/index40.js +37 -9
  467. package/dist/index41.cjs +2 -1
  468. package/dist/index41.js +58 -11
  469. package/dist/index42.cjs +1 -1
  470. package/dist/index42.js +37 -11
  471. package/dist/index43.cjs +1 -1
  472. package/dist/index43.js +15 -13
  473. package/dist/index44.cjs +1 -1
  474. package/dist/index44.js +8 -33
  475. package/dist/index45.cjs +1 -1
  476. package/dist/index45.js +2 -56
  477. package/dist/index46.cjs +1 -1
  478. package/dist/index46.js +45 -16
  479. package/dist/index47.cjs +1 -1
  480. package/dist/index47.js +31 -5
  481. package/dist/index48.cjs +1 -1
  482. package/dist/index48.js +3 -8
  483. package/dist/index49.cjs +1 -1
  484. package/dist/index49.js +8 -170
  485. package/dist/index50.cjs +1 -1
  486. package/dist/index50.js +64 -99
  487. package/dist/index51.cjs +1 -1
  488. package/dist/index51.js +9 -3
  489. package/dist/index52.cjs +1 -1
  490. package/dist/index52.js +28 -21
  491. package/dist/index53.cjs +1 -1
  492. package/dist/index53.js +71 -7
  493. package/dist/index54.cjs +1 -1
  494. package/dist/index54.js +17 -29
  495. package/dist/index55.cjs +1 -1
  496. package/dist/index55.js +110 -29
  497. package/dist/index56.cjs +1 -1
  498. package/dist/index56.js +60 -16
  499. package/dist/index57.cjs +1 -1
  500. package/dist/index57.js +20 -29
  501. package/dist/index58.cjs +1 -1
  502. package/dist/index58.js +37 -41
  503. package/dist/index59.cjs +1 -1
  504. package/dist/index59.js +35 -149
  505. package/dist/index60.cjs +1 -1
  506. package/dist/index60.js +54 -31
  507. package/dist/index61.cjs +1 -1
  508. package/dist/index61.js +161 -33
  509. package/dist/index62.cjs +1 -2
  510. package/dist/index62.js +39 -58
  511. package/dist/index63.cjs +1 -1
  512. package/dist/index63.js +9 -37
  513. package/dist/index64.cjs +1 -1
  514. package/dist/index64.js +36 -15
  515. package/dist/index65.cjs +1 -1
  516. package/dist/index65.js +9 -8
  517. package/dist/index66.cjs +1 -1
  518. package/dist/index66.js +51 -2
  519. package/dist/index67.cjs +1 -1
  520. package/dist/index67.js +82 -42
  521. package/dist/index68.cjs +1 -1
  522. package/dist/index68.js +40 -30
  523. package/dist/index69.cjs +1 -1
  524. package/dist/index69.js +8 -9
  525. package/dist/index70.cjs +1 -1
  526. package/dist/index70.js +6 -68
  527. package/dist/index71.cjs +1 -1
  528. package/dist/index71.js +17 -9
  529. package/dist/index72.cjs +1 -1
  530. package/dist/index72.js +8 -28
  531. package/dist/index73.cjs +1 -1
  532. package/dist/index73.js +13 -71
  533. package/dist/index74.cjs +1 -1
  534. package/dist/index74.js +7 -19
  535. package/dist/index75.cjs +1 -1
  536. package/dist/index75.js +9 -110
  537. package/dist/index76.cjs +1 -1
  538. package/dist/index76.js +43 -57
  539. package/dist/index77.cjs +1 -1
  540. package/dist/index77.js +13 -24
  541. package/dist/index78.cjs +1 -1
  542. package/dist/index78.js +16 -40
  543. package/dist/index79.cjs +1 -1
  544. package/dist/index79.js +13 -37
  545. package/dist/index80.cjs +1 -1
  546. package/dist/index80.js +6 -58
  547. package/dist/index81.cjs +1 -1
  548. package/dist/index81.js +33 -164
  549. package/dist/index82.cjs +1 -1
  550. package/dist/index82.js +9 -40
  551. package/dist/index83.cjs +1 -1
  552. package/dist/index83.js +7 -8
  553. package/dist/index84.cjs +1 -1
  554. package/dist/index84.js +26 -36
  555. package/dist/index85.cjs +1 -1
  556. package/dist/index85.js +10 -9
  557. package/dist/index86.cjs +1 -1
  558. package/dist/index86.js +14 -50
  559. package/dist/index87.cjs +1 -1
  560. package/dist/index87.js +113 -81
  561. package/dist/index88.cjs +1 -1
  562. package/dist/index88.js +77 -37
  563. package/dist/index89.cjs +1 -1
  564. package/dist/index89.js +177 -8
  565. package/dist/index90.cjs +1 -1
  566. package/dist/index90.js +5 -5
  567. package/dist/index91.cjs +1 -1
  568. package/dist/index91.js +13 -17
  569. package/dist/index92.cjs +1 -1
  570. package/dist/index92.js +13 -8
  571. package/dist/index93.cjs +1 -1
  572. package/dist/index93.js +95 -13
  573. package/dist/index94.cjs +1 -1
  574. package/dist/index94.js +75 -7
  575. package/dist/index95.cjs +1 -1
  576. package/dist/index95.js +89 -9
  577. package/dist/index96.cjs +1 -1
  578. package/dist/index96.js +137 -45
  579. package/dist/index97.cjs +1 -1
  580. package/dist/index97.js +69 -13
  581. package/dist/index98.cjs +1 -1
  582. package/dist/index98.js +22 -15
  583. package/dist/index99.cjs +1 -1
  584. package/dist/index99.js +109 -13
  585. package/package.json +1 -1
package/dist/index302.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(n,a,y){let i="";if(y)for(const e of Object.entries(y)){if(!e)continue;let s="";for(const t of e[1])s+=`[${t.type}${t.name?`:${t.name}`:""}]`;i+=`(${e[0]}{${s}})`}return a?`${a}:${n}${i}`:n}const d=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);exports.getParameterCacheKey=r;exports.parameterCache=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index294.cjs"),v=require("./index287.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const m=BigInt(0),h=BigInt(1);function b(t,r){const e=r.negate();return t?e:r}function B(t,r,e){const n=s=>s.pz,i=v.FpInvertBatch(t.Fp,e.map(n));return e.map((s,a)=>s.toAffine(i[a])).map(t.fromAffine)}function I(t,r){if(!Number.isSafeInteger(t)||t<=0||t>r)throw new Error("invalid window size, expected [1.."+r+"], got W="+t)}function E(t,r){I(t,r);const e=Math.ceil(r/t)+1,n=2**(t-1),i=2**t,o=y.bitMask(t),s=BigInt(t);return{windows:e,windowSize:n,mask:o,maxNumber:i,shiftBy:s}}function M(t,r,e){const{windowSize:n,mask:i,maxNumber:o,shiftBy:s}=e;let a=Number(t&i),f=t>>s;a>n&&(a-=o,f+=h);const d=r*n,c=d+Math.abs(a)-1,p=a===0,l=a<0,w=r%2!==0;return{nextN:f,offset:c,isZero:p,isNeg:l,isNegF:w,offsetF:d}}function O(t,r){if(!Array.isArray(t))throw new Error("array expected");t.forEach((e,n)=>{if(!(e instanceof r))throw new Error("invalid point at index "+n)})}function R(t,r){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((e,n)=>{if(!r.isValid(e))throw new Error("invalid scalar at index "+n)})}const N=new WeakMap,Z=new WeakMap;function A(t){return Z.get(t)||1}function x(t){if(t!==m)throw new Error("invalid wNAF")}function j(t,r){return{constTimeNegate:b,hasPrecomputes(e){return A(e)!==1},unsafeLadder(e,n,i=t.ZERO){let o=e;for(;n>m;)n&h&&(i=i.add(o)),o=o.double(),n>>=h;return i},precomputeWindow(e,n){const{windows:i,windowSize:o}=E(n,r),s=[];let a=e,f=a;for(let d=0;d<i;d++){f=a,s.push(f);for(let c=1;c<o;c++)f=f.add(a),s.push(f);a=f.double()}return s},wNAF(e,n,i){let o=t.ZERO,s=t.BASE;const a=E(e,r);for(let f=0;f<a.windows;f++){const{nextN:d,offset:c,isZero:p,isNeg:l,isNegF:w,offsetF:g}=M(i,f,a);i=d,p?s=s.add(b(w,n[g])):o=o.add(b(l,n[c]))}return x(i),{p:o,f:s}},wNAFUnsafe(e,n,i,o=t.ZERO){const s=E(e,r);for(let a=0;a<s.windows&&i!==m;a++){const{nextN:f,offset:d,isZero:c,isNeg:p}=M(i,a,s);if(i=f,!c){const l=n[d];o=o.add(p?l.negate():l)}}return x(i),o},getPrecomputes(e,n,i){let o=N.get(n);return o||(o=this.precomputeWindow(n,e),e!==1&&(typeof i=="function"&&(o=i(o)),N.set(n,o))),o},wNAFCached(e,n,i){const o=A(e);return this.wNAF(o,this.getPrecomputes(o,e,i),n)},wNAFCachedUnsafe(e,n,i,o){const s=A(e);return s===1?this.unsafeLadder(e,n,o):this.wNAFUnsafe(s,this.getPrecomputes(s,e,i),n,o)},setWindowSize(e,n){I(n,r),Z.set(e,n),N.delete(e)}}}function _(t,r,e,n){let i=r,o=t.ZERO,s=t.ZERO;for(;e>m||n>m;)e&h&&(o=o.add(i)),n&h&&(s=s.add(i)),i=i.double(),e>>=h,n>>=h;return{p1:o,p2:s}}function C(t,r,e,n){O(e,t),R(n,r);const i=e.length,o=n.length;if(i!==o)throw new Error("arrays of points and scalars must have equal length");const s=t.ZERO,a=y.bitLen(BigInt(i));let f=1;a>12?f=a-3:a>4?f=a-2:a>0&&(f=2);const d=y.bitMask(f),c=new Array(Number(d)+1).fill(s),p=Math.floor((r.BITS-1)/f)*f;let l=s;for(let w=p;w>=0;w-=f){c.fill(s);for(let u=0;u<o;u++){const F=n[u],S=Number(F>>BigInt(w)&d);c[S]=c[S].add(e[u])}let g=s;for(let u=c.length-1,F=s;u>0;u--)F=F.add(c[u]),g=g.add(F);if(l=l.add(g),w!==0)for(let u=0;u<f;u++)l=l.double()}return l}function z(t,r){if(r){if(r.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return v.validateField(r),r}else return v.Field(t)}function k(t,r,e={}){if(!r||typeof r!="object")throw new Error(`expected valid ${t} CURVE object`);for(const a of["p","n","h"]){const f=r[a];if(!(typeof f=="bigint"&&f>m))throw new Error(`CURVE.${a} must be positive bigint`)}const n=z(r.p,e.Fp),i=z(r.n,e.Fn),s=["Gx","Gy","a","b"];for(const a of s)if(!n.isValid(r[a]))throw new Error(`CURVE.${a} must be valid field element of CURVE.Fp`);return{Fp:n,Fn:i}}exports._createCurveFields=k;exports.mulEndoUnsafe=_;exports.negateCt=b;exports.normalizeZ=B;exports.pippenger=C;exports.wNAF=j;
package/dist/index302.js CHANGED
@@ -1,71 +1,204 @@
1
- function d(n, y, i) {
2
- let a = "";
3
- if (i)
4
- for (const e of Object.entries(i)) {
5
- if (!e)
6
- continue;
7
- let s = "";
8
- for (const t of e[1])
9
- s += `[${t.type}${t.name ? `:${t.name}` : ""}]`;
10
- a += `(${e[0]}{${s}})`;
1
+ import { bitLen as B, bitMask as z } from "./index294.js";
2
+ import { validateField as Z, Field as O, FpInvertBatch as R } from "./index287.js";
3
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
4
+ const g = BigInt(0), h = BigInt(1);
5
+ function b(t, r) {
6
+ const e = r.negate();
7
+ return t ? e : r;
8
+ }
9
+ function L(t, r, e) {
10
+ const n = (s) => s.pz, i = R(t.Fp, e.map(n));
11
+ return e.map((s, f) => s.toAffine(i[f])).map(t.fromAffine);
12
+ }
13
+ function I(t, r) {
14
+ if (!Number.isSafeInteger(t) || t <= 0 || t > r)
15
+ throw new Error("invalid window size, expected [1.." + r + "], got W=" + t);
16
+ }
17
+ function E(t, r) {
18
+ I(t, r);
19
+ const e = Math.ceil(r / t) + 1, n = 2 ** (t - 1), i = 2 ** t, o = z(t), s = BigInt(t);
20
+ return { windows: e, windowSize: n, mask: o, maxNumber: i, shiftBy: s };
21
+ }
22
+ function v(t, r, e) {
23
+ const { windowSize: n, mask: i, maxNumber: o, shiftBy: s } = e;
24
+ let f = Number(t & i), a = t >> s;
25
+ f > n && (f -= o, a += h);
26
+ const d = r * n, c = d + Math.abs(f) - 1, p = f === 0, l = f < 0, u = r % 2 !== 0;
27
+ return { nextN: a, offset: c, isZero: p, isNeg: l, isNegF: u, offsetF: d };
28
+ }
29
+ function j(t, r) {
30
+ if (!Array.isArray(t))
31
+ throw new Error("array expected");
32
+ t.forEach((e, n) => {
33
+ if (!(e instanceof r))
34
+ throw new Error("invalid point at index " + n);
35
+ });
36
+ }
37
+ function _(t, r) {
38
+ if (!Array.isArray(t))
39
+ throw new Error("array of scalars expected");
40
+ t.forEach((e, n) => {
41
+ if (!r.isValid(e))
42
+ throw new Error("invalid scalar at index " + n);
43
+ });
44
+ }
45
+ const N = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap();
46
+ function A(t) {
47
+ return M.get(t) || 1;
48
+ }
49
+ function S(t) {
50
+ if (t !== g)
51
+ throw new Error("invalid wNAF");
52
+ }
53
+ function U(t, r) {
54
+ return {
55
+ constTimeNegate: b,
56
+ hasPrecomputes(e) {
57
+ return A(e) !== 1;
58
+ },
59
+ // non-const time multiplication ladder
60
+ unsafeLadder(e, n, i = t.ZERO) {
61
+ let o = e;
62
+ for (; n > g; )
63
+ n & h && (i = i.add(o)), o = o.double(), n >>= h;
64
+ return i;
65
+ },
66
+ /**
67
+ * Creates a wNAF precomputation window. Used for caching.
68
+ * Default window size is set by `utils.precompute()` and is equal to 8.
69
+ * Number of precomputed points depends on the curve size:
70
+ * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:
71
+ * - 𝑊 is the window size
72
+ * - 𝑛 is the bitlength of the curve order.
73
+ * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.
74
+ * @param elm Point instance
75
+ * @param W window size
76
+ * @returns precomputed point tables flattened to a single array
77
+ */
78
+ precomputeWindow(e, n) {
79
+ const { windows: i, windowSize: o } = E(n, r), s = [];
80
+ let f = e, a = f;
81
+ for (let d = 0; d < i; d++) {
82
+ a = f, s.push(a);
83
+ for (let c = 1; c < o; c++)
84
+ a = a.add(f), s.push(a);
85
+ f = a.double();
86
+ }
87
+ return s;
88
+ },
89
+ /**
90
+ * Implements ec multiplication using precomputed tables and w-ary non-adjacent form.
91
+ * @param W window size
92
+ * @param precomputes precomputed tables
93
+ * @param n scalar (we don't check here, but should be less than curve order)
94
+ * @returns real and fake (for const-time) points
95
+ */
96
+ wNAF(e, n, i) {
97
+ let o = t.ZERO, s = t.BASE;
98
+ const f = E(e, r);
99
+ for (let a = 0; a < f.windows; a++) {
100
+ const { nextN: d, offset: c, isZero: p, isNeg: l, isNegF: u, offsetF: m } = v(i, a, f);
101
+ i = d, p ? s = s.add(b(u, n[m])) : o = o.add(b(l, n[c]));
102
+ }
103
+ return S(i), { p: o, f: s };
104
+ },
105
+ /**
106
+ * Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form.
107
+ * @param W window size
108
+ * @param precomputes precomputed tables
109
+ * @param n scalar (we don't check here, but should be less than curve order)
110
+ * @param acc accumulator point to add result of multiplication
111
+ * @returns point
112
+ */
113
+ wNAFUnsafe(e, n, i, o = t.ZERO) {
114
+ const s = E(e, r);
115
+ for (let f = 0; f < s.windows && i !== g; f++) {
116
+ const { nextN: a, offset: d, isZero: c, isNeg: p } = v(i, f, s);
117
+ if (i = a, !c) {
118
+ const l = n[d];
119
+ o = o.add(p ? l.negate() : l);
120
+ }
121
+ }
122
+ return S(i), o;
123
+ },
124
+ getPrecomputes(e, n, i) {
125
+ let o = N.get(n);
126
+ return o || (o = this.precomputeWindow(n, e), e !== 1 && (typeof i == "function" && (o = i(o)), N.set(n, o))), o;
127
+ },
128
+ wNAFCached(e, n, i) {
129
+ const o = A(e);
130
+ return this.wNAF(o, this.getPrecomputes(o, e, i), n);
131
+ },
132
+ wNAFCachedUnsafe(e, n, i, o) {
133
+ const s = A(e);
134
+ return s === 1 ? this.unsafeLadder(e, n, o) : this.wNAFUnsafe(s, this.getPrecomputes(s, e, i), n, o);
135
+ },
136
+ // We calculate precomputes for elliptic curve point multiplication
137
+ // using windowed method. This specifies window size and
138
+ // stores precomputed values. Usually only base point would be precomputed.
139
+ setWindowSize(e, n) {
140
+ I(n, r), M.set(e, n), N.delete(e);
11
141
  }
12
- return y ? `${y}:${n}${a}` : n;
142
+ };
143
+ }
144
+ function $(t, r, e, n) {
145
+ let i = r, o = t.ZERO, s = t.ZERO;
146
+ for (; e > g || n > g; )
147
+ e & h && (o = o.add(i)), n & h && (s = s.add(i)), i = i.double(), e >>= h, n >>= h;
148
+ return { p1: o, p2: s };
149
+ }
150
+ function D(t, r, e, n) {
151
+ j(e, t), _(n, r);
152
+ const i = e.length, o = n.length;
153
+ if (i !== o)
154
+ throw new Error("arrays of points and scalars must have equal length");
155
+ const s = t.ZERO, f = B(BigInt(i));
156
+ let a = 1;
157
+ f > 12 ? a = f - 3 : f > 4 ? a = f - 2 : f > 0 && (a = 2);
158
+ const d = z(a), c = new Array(Number(d) + 1).fill(s), p = Math.floor((r.BITS - 1) / a) * a;
159
+ let l = s;
160
+ for (let u = p; u >= 0; u -= a) {
161
+ c.fill(s);
162
+ for (let w = 0; w < o; w++) {
163
+ const F = n[w], y = Number(F >> BigInt(u) & d);
164
+ c[y] = c[y].add(e[w]);
165
+ }
166
+ let m = s;
167
+ for (let w = c.length - 1, F = s; w > 0; w--)
168
+ F = F.add(c[w]), m = m.add(F);
169
+ if (l = l.add(m), u !== 0)
170
+ for (let w = 0; w < a; w++)
171
+ l = l.double();
172
+ }
173
+ return l;
174
+ }
175
+ function x(t, r) {
176
+ if (r) {
177
+ if (r.ORDER !== t)
178
+ throw new Error("Field.ORDER must match order: Fp == p, Fn == n");
179
+ return Z(r), r;
180
+ } else
181
+ return O(t);
182
+ }
183
+ function G(t, r, e = {}) {
184
+ if (!r || typeof r != "object")
185
+ throw new Error(`expected valid ${t} CURVE object`);
186
+ for (const f of ["p", "n", "h"]) {
187
+ const a = r[f];
188
+ if (!(typeof a == "bigint" && a > g))
189
+ throw new Error(`CURVE.${f} must be positive bigint`);
190
+ }
191
+ const n = x(r.p, e.Fp), i = x(r.n, e.Fn), s = ["Gx", "Gy", "a", "b"];
192
+ for (const f of s)
193
+ if (!n.isValid(r[f]))
194
+ throw new Error(`CURVE.${f} must be valid field element of CURVE.Fp`);
195
+ return { Fp: n, Fn: i };
13
196
  }
14
- const p = /* @__PURE__ */ new Map([
15
- // Unnamed
16
- ["address", { type: "address" }],
17
- ["bool", { type: "bool" }],
18
- ["bytes", { type: "bytes" }],
19
- ["bytes32", { type: "bytes32" }],
20
- ["int", { type: "int256" }],
21
- ["int256", { type: "int256" }],
22
- ["string", { type: "string" }],
23
- ["uint", { type: "uint256" }],
24
- ["uint8", { type: "uint8" }],
25
- ["uint16", { type: "uint16" }],
26
- ["uint24", { type: "uint24" }],
27
- ["uint32", { type: "uint32" }],
28
- ["uint64", { type: "uint64" }],
29
- ["uint96", { type: "uint96" }],
30
- ["uint112", { type: "uint112" }],
31
- ["uint160", { type: "uint160" }],
32
- ["uint192", { type: "uint192" }],
33
- ["uint256", { type: "uint256" }],
34
- // Named
35
- ["address owner", { type: "address", name: "owner" }],
36
- ["address to", { type: "address", name: "to" }],
37
- ["bool approved", { type: "bool", name: "approved" }],
38
- ["bytes _data", { type: "bytes", name: "_data" }],
39
- ["bytes data", { type: "bytes", name: "data" }],
40
- ["bytes signature", { type: "bytes", name: "signature" }],
41
- ["bytes32 hash", { type: "bytes32", name: "hash" }],
42
- ["bytes32 r", { type: "bytes32", name: "r" }],
43
- ["bytes32 root", { type: "bytes32", name: "root" }],
44
- ["bytes32 s", { type: "bytes32", name: "s" }],
45
- ["string name", { type: "string", name: "name" }],
46
- ["string symbol", { type: "string", name: "symbol" }],
47
- ["string tokenURI", { type: "string", name: "tokenURI" }],
48
- ["uint tokenId", { type: "uint256", name: "tokenId" }],
49
- ["uint8 v", { type: "uint8", name: "v" }],
50
- ["uint256 balance", { type: "uint256", name: "balance" }],
51
- ["uint256 tokenId", { type: "uint256", name: "tokenId" }],
52
- ["uint256 value", { type: "uint256", name: "value" }],
53
- // Indexed
54
- [
55
- "event:address indexed from",
56
- { type: "address", name: "from", indexed: !0 }
57
- ],
58
- ["event:address indexed to", { type: "address", name: "to", indexed: !0 }],
59
- [
60
- "event:uint indexed tokenId",
61
- { type: "uint256", name: "tokenId", indexed: !0 }
62
- ],
63
- [
64
- "event:uint256 indexed tokenId",
65
- { type: "uint256", name: "tokenId", indexed: !0 }
66
- ]
67
- ]);
68
197
  export {
69
- d as getParameterCacheKey,
70
- p as parameterCache
198
+ G as _createCurveFields,
199
+ $ as mulEndoUnsafe,
200
+ b as negateCt,
201
+ L as normalizeZ,
202
+ D as pippenger,
203
+ U as wNAF
71
204
  };
package/dist/index303.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index311.cjs");class c extends Error{constructor(r,e={}){const a=(()=>{var s;if(e.cause instanceof c){if(e.cause.details)return e.cause.details;if(e.cause.shortMessage)return e.cause.shortMessage}return e.cause&&"details"in e.cause&&typeof e.cause.details=="string"?e.cause.details:(s=e.cause)!=null&&s.message?e.cause.message:e.details})(),u=e.cause instanceof c&&e.cause.docsPath||e.docsPath,i=`https://oxlib.sh${u??""}`,d=[r||"An error occurred.",...e.metaMessages?["",...e.metaMessages]:[],...a||u?["",a?`Details: ${a}`:void 0,u?`See: ${i}`:void 0]:[]].filter(s=>typeof s=="string").join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index313.cjs");class c extends Error{constructor(r,e={}){const a=(()=>{var s;if(e.cause instanceof c){if(e.cause.details)return e.cause.details;if(e.cause.shortMessage)return e.cause.shortMessage}return e.cause&&"details"in e.cause&&typeof e.cause.details=="string"?e.cause.details:(s=e.cause)!=null&&s.message?e.cause.message:e.details})(),u=e.cause instanceof c&&e.cause.docsPath||e.docsPath,i=`https://oxlib.sh${u??""}`,d=[r||"An error occurred.",...e.metaMessages?["",...e.metaMessages]:[],...a||u?["",a?`Details: ${a}`:void 0,u?`See: ${i}`:void 0]:[]].filter(s=>typeof s=="string").join(`
2
2
  `);super(d,e.cause?{cause:e.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${n.getVersion()}`}),this.cause=e.cause,this.details=a,this.docs=i,this.docsPath=u,this.shortMessage=r}walk(r){return l(this,r)}}function l(t,r){return r!=null&&r(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?l(t.cause,r):r?null:t}exports.BaseError=c;
package/dist/index303.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getVersion as n } from "./index311.js";
1
+ import { getVersion as n } from "./index313.js";
2
2
  class c extends Error {
3
3
  constructor(t, e = {}) {
4
4
  const a = (() => {
package/dist/index305.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index294.cjs");function n(t,e){if(i.size(t)>e)throw new i.SizeOverflowError({givenSize:i.size(t),maxSize:e})}function o(t,e){if(typeof e=="number"&&e>0&&e>i.size(t)-1)throw new i.SliceOffsetOutOfBoundsError({offset:e,position:"start",size:i.size(t)})}function z(t,e,r){if(typeof e=="number"&&typeof r=="number"&&i.size(t)!==r-e)throw new i.SliceOffsetOutOfBoundsError({offset:r,position:"end",size:i.size(t)})}function a(t,e={}){const{dir:r,size:s=32}=e;if(s===0)return t;const f=t.replace("0x","");if(f.length>s*2)throw new i.SizeExceedsPaddingSizeError({size:Math.ceil(f.length/2),targetSize:s,type:"Hex"});return`0x${f[r==="right"?"padEnd":"padStart"](s*2,"0")}`}exports.assertEndOffset=z;exports.assertSize=n;exports.assertStartOffset=o;exports.pad=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index290.cjs");function n(t,e){if(i.size(t)>e)throw new i.SizeOverflowError({givenSize:i.size(t),maxSize:e})}function o(t,e){if(typeof e=="number"&&e>0&&e>i.size(t)-1)throw new i.SliceOffsetOutOfBoundsError({offset:e,position:"start",size:i.size(t)})}function z(t,e,r){if(typeof e=="number"&&typeof r=="number"&&i.size(t)!==r-e)throw new i.SliceOffsetOutOfBoundsError({offset:r,position:"end",size:i.size(t)})}function a(t,e={}){const{dir:r,size:s=32}=e;if(s===0)return t;const f=t.replace("0x","");if(f.length>s*2)throw new i.SizeExceedsPaddingSizeError({size:Math.ceil(f.length/2),targetSize:s,type:"Hex"});return`0x${f[r==="right"?"padEnd":"padStart"](s*2,"0")}`}exports.assertEndOffset=z;exports.assertSize=n;exports.assertStartOffset=o;exports.pad=a;
package/dist/index305.js CHANGED
@@ -1,4 +1,4 @@
1
- import { SizeExceedsPaddingSizeError as s, size as i, SliceOffsetOutOfBoundsError as f, SizeOverflowError as p } from "./index294.js";
1
+ import { SizeExceedsPaddingSizeError as s, size as i, SliceOffsetOutOfBoundsError as f, SizeOverflowError as p } from "./index290.js";
2
2
  function c(t, e) {
3
3
  if (i(t) > e)
4
4
  throw new p({
package/dist/index306.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index236.cjs"),o=require("./index312.cjs"),n=require("./index294.cjs");function i(e,r={}){const{as:s=typeof e=="string"?"Hex":"Bytes"}=r,t=c.keccak_256(o.from(e));return s==="Bytes"?t:n.fromBytes(t)}exports.keccak256=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index228.cjs"),o=require("./index311.cjs"),n=require("./index290.cjs");function i(e,r={}){const{as:s=typeof e=="string"?"Hex":"Bytes"}=r,t=c.keccak_256(o.from(e));return s==="Bytes"?t:n.fromBytes(t)}exports.keccak256=i;
package/dist/index306.js CHANGED
@@ -1,6 +1,6 @@
1
- import { keccak_256 as f } from "./index236.js";
2
- import { from as m } from "./index312.js";
3
- import { fromBytes as s } from "./index294.js";
1
+ import { keccak_256 as f } from "./index228.js";
2
+ import { from as m } from "./index311.js";
3
+ import { fromBytes as s } from "./index290.js";
4
4
  function p(t, o = {}) {
5
5
  const { as: e = typeof t == "string" ? "Hex" : "Bytes" } = o, r = f(m(t));
6
6
  return e === "Bytes" ? r : s(r);
package/dist/index308.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index312.cjs"),c=require("./index314.cjs"),o=require("./index303.cjs"),m=require("./index306.cjs"),b=/^0x[a-fA-F0-9]{40}$/;function i(e,t={}){const{strict:s=!0}=t;if(!b.test(e))throw new a({address:e,cause:new l});if(s){if(e.toLowerCase()===e)return;if(d(e)!==e)throw new a({address:e,cause:new h})}}function d(e){if(c.checksum.has(e))return c.checksum.get(e);i(e,{strict:!1});const t=e.substring(2).toLowerCase(),s=m.keccak256(f.fromString(t),{as:"Bytes"}),n=t.split("");for(let r=0;r<40;r+=2)s[r>>1]>>4>=8&&n[r]&&(n[r]=n[r].toUpperCase()),(s[r>>1]&15)>=8&&n[r+1]&&(n[r+1]=n[r+1].toUpperCase());const u=`0x${n.join("")}`;return c.checksum.set(e,u),u}function p(e,t={}){const{strict:s=!0}=t??{};try{return i(e,{strict:s}),!0}catch{return!1}}class a extends o.BaseError{constructor({address:t,cause:s}){super(`Address "${t}" is invalid.`,{cause:s}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class l extends o.BaseError{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class h extends o.BaseError{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}exports.InvalidAddressError=a;exports.InvalidChecksumError=h;exports.InvalidInputError=l;exports.assert=i;exports.checksum=d;exports.validate=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index311.cjs"),c=require("./index314.cjs"),o=require("./index303.cjs"),m=require("./index306.cjs"),b=/^0x[a-fA-F0-9]{40}$/;function i(e,t={}){const{strict:s=!0}=t;if(!b.test(e))throw new a({address:e,cause:new l});if(s){if(e.toLowerCase()===e)return;if(d(e)!==e)throw new a({address:e,cause:new h})}}function d(e){if(c.checksum.has(e))return c.checksum.get(e);i(e,{strict:!1});const t=e.substring(2).toLowerCase(),s=m.keccak256(f.fromString(t),{as:"Bytes"}),n=t.split("");for(let r=0;r<40;r+=2)s[r>>1]>>4>=8&&n[r]&&(n[r]=n[r].toUpperCase()),(s[r>>1]&15)>=8&&n[r+1]&&(n[r+1]=n[r+1].toUpperCase());const u=`0x${n.join("")}`;return c.checksum.set(e,u),u}function p(e,t={}){const{strict:s=!0}=t??{};try{return i(e,{strict:s}),!0}catch{return!1}}class a extends o.BaseError{constructor({address:t,cause:s}){super(`Address "${t}" is invalid.`,{cause:s}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class l extends o.BaseError{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class h extends o.BaseError{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}exports.InvalidAddressError=a;exports.InvalidChecksumError=h;exports.InvalidInputError=l;exports.assert=i;exports.checksum=d;exports.validate=p;
package/dist/index308.js CHANGED
@@ -1,4 +1,4 @@
1
- import { fromString as d } from "./index312.js";
1
+ import { fromString as d } from "./index311.js";
2
2
  import { checksum as o } from "./index314.js";
3
3
  import { BaseError as c } from "./index303.js";
4
4
  import { keccak256 as f } from "./index306.js";
package/dist/index31.cjs CHANGED
@@ -1,16 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index298.cjs"),M=require("./index52.cjs"),h=require("./index299.cjs");function R(r){const{chainId:o,domain:s,expirationTime:l,issuedAt:m=new Date,nonce:a,notBefore:f,requestId:w,resources:g,scheme:i,uri:c,version:d}=r;{if(o!==Math.floor(o))throw new e.SiweInvalidMessageFieldError({field:"chainId",metaMessages:["- Chain ID must be a EIP-155 chain ID.","- See https://eips.ethereum.org/EIPS/eip-155","",`Provided value: ${o}`]});if(!(E.test(s)||F.test(s)||b.test(s)))throw new e.SiweInvalidMessageFieldError({field:"domain",metaMessages:["- Domain must be an RFC 3986 authority.","- See https://www.rfc-editor.org/rfc/rfc3986","",`Provided value: ${s}`]});if(!A.test(a))throw new e.SiweInvalidMessageFieldError({field:"nonce",metaMessages:["- Nonce must be at least 8 characters.","- Nonce must be alphanumeric.","",`Provided value: ${a}`]});if(!h.isUri(c))throw new e.SiweInvalidMessageFieldError({field:"uri",metaMessages:["- URI must be a RFC 3986 URI referring to the resource that is the subject of the signing.","- See https://www.rfc-editor.org/rfc/rfc3986","",`Provided value: ${c}`]});if(d!=="1")throw new e.SiweInvalidMessageFieldError({field:"version",metaMessages:["- Version must be '1'.","",`Provided value: ${d}`]});if(i&&!P.test(i))throw new e.SiweInvalidMessageFieldError({field:"scheme",metaMessages:["- Scheme must be an RFC 3986 URI scheme.","- See https://www.rfc-editor.org/rfc/rfc3986#section-3.1","",`Provided value: ${i}`]});const t=r.statement;if(t!=null&&t.includes(`
2
- `))throw new e.SiweInvalidMessageFieldError({field:"statement",metaMessages:["- Statement must not include '\\n'.","",`Provided value: ${t}`]})}const $=M.getAddress(r.address),v=i?`${i}://${s}`:s,I=r.statement?`${r.statement}
3
- `:"",S=`${v} wants you to sign in with your Ethereum account:
4
- ${$}
5
-
6
- ${I}`;let n=`URI: ${c}
7
- Version: ${d}
8
- Chain ID: ${o}
9
- Nonce: ${a}
10
- Issued At: ${m.toISOString()}`;if(l&&(n+=`
11
- Expiration Time: ${l.toISOString()}`),f&&(n+=`
12
- Not Before: ${f.toISOString()}`),w&&(n+=`
13
- Request ID: ${w}`),g){let t=`
14
- Resources:`;for(const u of g){if(!h.isUri(u))throw new e.SiweInvalidMessageFieldError({field:"resources",metaMessages:["- Every resource must be a RFC 3986 URI.","- See https://www.rfc-editor.org/rfc/rfc3986","",`Provided value: ${u}`]});t+=`
15
- - ${u}`}n+=t}return`${S}
16
- ${n}`}const E=/^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(:[0-9]{1,5})?$/,F=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:[0-9]{1,5})?$/,b=/^localhost(:[0-9]{1,5})?$/,A=/^[a-zA-Z0-9]{8,}$/,P=/^([a-zA-Z][a-zA-Z0-9+-.]*)$/;exports.createSiweMessage=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=e=>{try{return JSON.parse(e)}catch{return e}};exports.safeParseJson=r;
package/dist/index31.js CHANGED
@@ -1,116 +1,10 @@
1
- import { SiweInvalidMessageFieldError as e } from "./index298.js";
2
- import { getAddress as S } from "./index52.js";
3
- import { isUri as $ } from "./index299.js";
4
- function C(n) {
5
- const { chainId: i, domain: s, expirationTime: u, issuedAt: g = /* @__PURE__ */ new Date(), nonce: a, notBefore: m, requestId: h, resources: w, scheme: o, uri: c, version: f } = n;
6
- {
7
- if (i !== Math.floor(i))
8
- throw new e({
9
- field: "chainId",
10
- metaMessages: [
11
- "- Chain ID must be a EIP-155 chain ID.",
12
- "- See https://eips.ethereum.org/EIPS/eip-155",
13
- "",
14
- `Provided value: ${i}`
15
- ]
16
- });
17
- if (!(p.test(s) || M.test(s) || x.test(s)))
18
- throw new e({
19
- field: "domain",
20
- metaMessages: [
21
- "- Domain must be an RFC 3986 authority.",
22
- "- See https://www.rfc-editor.org/rfc/rfc3986",
23
- "",
24
- `Provided value: ${s}`
25
- ]
26
- });
27
- if (!A.test(a))
28
- throw new e({
29
- field: "nonce",
30
- metaMessages: [
31
- "- Nonce must be at least 8 characters.",
32
- "- Nonce must be alphanumeric.",
33
- "",
34
- `Provided value: ${a}`
35
- ]
36
- });
37
- if (!$(c))
38
- throw new e({
39
- field: "uri",
40
- metaMessages: [
41
- "- URI must be a RFC 3986 URI referring to the resource that is the subject of the signing.",
42
- "- See https://www.rfc-editor.org/rfc/rfc3986",
43
- "",
44
- `Provided value: ${c}`
45
- ]
46
- });
47
- if (f !== "1")
48
- throw new e({
49
- field: "version",
50
- metaMessages: [
51
- "- Version must be '1'.",
52
- "",
53
- `Provided value: ${f}`
54
- ]
55
- });
56
- if (o && !P.test(o))
57
- throw new e({
58
- field: "scheme",
59
- metaMessages: [
60
- "- Scheme must be an RFC 3986 URI scheme.",
61
- "- See https://www.rfc-editor.org/rfc/rfc3986#section-3.1",
62
- "",
63
- `Provided value: ${o}`
64
- ]
65
- });
66
- const t = n.statement;
67
- if (t != null && t.includes(`
68
- `))
69
- throw new e({
70
- field: "statement",
71
- metaMessages: [
72
- "- Statement must not include '\\n'.",
73
- "",
74
- `Provided value: ${t}`
75
- ]
76
- });
1
+ const t = (r) => {
2
+ try {
3
+ return JSON.parse(r);
4
+ } catch {
5
+ return r;
77
6
  }
78
- const l = S(n.address), v = o ? `${o}://${s}` : s, I = n.statement ? `${n.statement}
79
- ` : "", R = `${v} wants you to sign in with your Ethereum account:
80
- ${l}
81
-
82
- ${I}`;
83
- let r = `URI: ${c}
84
- Version: ${f}
85
- Chain ID: ${i}
86
- Nonce: ${a}
87
- Issued At: ${g.toISOString()}`;
88
- if (u && (r += `
89
- Expiration Time: ${u.toISOString()}`), m && (r += `
90
- Not Before: ${m.toISOString()}`), h && (r += `
91
- Request ID: ${h}`), w) {
92
- let t = `
93
- Resources:`;
94
- for (const d of w) {
95
- if (!$(d))
96
- throw new e({
97
- field: "resources",
98
- metaMessages: [
99
- "- Every resource must be a RFC 3986 URI.",
100
- "- See https://www.rfc-editor.org/rfc/rfc3986",
101
- "",
102
- `Provided value: ${d}`
103
- ]
104
- });
105
- t += `
106
- - ${d}`;
107
- }
108
- r += t;
109
- }
110
- return `${R}
111
- ${r}`;
112
- }
113
- const p = /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(:[0-9]{1,5})?$/, M = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:[0-9]{1,5})?$/, x = /^localhost(:[0-9]{1,5})?$/, A = /^[a-zA-Z0-9]{8,}$/, P = /^([a-zA-Z][a-zA-Z0-9+-.]*)$/;
7
+ };
114
8
  export {
115
- C as createSiweMessage
9
+ t as safeParseJson
116
10
  };
package/dist/index310.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index297.cjs"),w=require("./index308.cjs"),N=require("./index303.cjs"),c=require("./index294.cjs"),x=require("./index309.cjs");function P({checksumAddress:e,parameters:r,values:n}){const t=[];for(let o=0;o<r.length;o++)t.push(f({checksumAddress:e,parameter:r[o],value:n[o]}));return t}function f({checksumAddress:e=!1,parameter:r,value:n}){const t=r,o=S(t.type);if(o){const[i,s]=o;return h(n,{checksumAddress:e,length:i,parameter:{...t,type:s}})}if(t.type==="tuple")return A(n,{checksumAddress:e,parameter:t});if(t.type==="address")return y(n,{checksum:e});if(t.type==="bool")return g(n);if(t.type.startsWith("uint")||t.type.startsWith("int")){const i=t.type.startsWith("int"),[,,s="256"]=x.integerRegex.exec(t.type)??[];return b(n,{signed:i,size:Number(s)})}if(t.type.startsWith("bytes"))return l(n,{type:t.type});if(t.type==="string")return z(n);throw new m.InvalidTypeError(t.type)}function u(e){let r=0;for(let i=0;i<e.length;i++){const{dynamic:s,encoded:a}=e[i];s?r+=32:r+=c.size(a)}const n=[],t=[];let o=0;for(let i=0;i<e.length;i++){const{dynamic:s,encoded:a}=e[i];s?(n.push(c.fromNumber(r+o,{size:32})),t.push(a),o+=c.size(a)):n.push(a)}return c.concat(...n,...t)}function y(e,r){const{checksum:n=!1}=r;return w.assert(e,{strict:n}),{dynamic:!1,encoded:c.padLeft(e.toLowerCase())}}function h(e,r){const{checksumAddress:n,length:t,parameter:o}=r,i=t===null;if(!Array.isArray(e))throw new m.InvalidArrayError(e);if(!i&&e.length!==t)throw new m.ArrayLengthMismatchError({expectedLength:t,givenLength:e.length,type:`${o.type}[${t}]`});let s=!1;const a=[];for(let d=0;d<e.length;d++){const p=f({checksumAddress:n,parameter:o,value:e[d]});p.dynamic&&(s=!0),a.push(p)}if(i||s){const d=u(a);if(i){const p=c.fromNumber(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?c.concat(p,d):p}}if(s)return{dynamic:!0,encoded:d}}return{dynamic:!1,encoded:c.concat(...a.map(({encoded:d})=>d))}}function l(e,{type:r}){const[,n]=r.split("bytes"),t=c.size(e);if(!n){let o=e;return t%32!==0&&(o=c.padRight(o,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:c.concat(c.padLeft(c.fromNumber(t,{size:32})),o)}}if(t!==Number.parseInt(n))throw new m.BytesSizeMismatchError({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:c.padRight(e)}}function g(e){if(typeof e!="boolean")throw new N.BaseError(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:c.padLeft(c.fromBoolean(e))}}function b(e,{signed:r,size:n}){if(typeof n=="number"){const t=2n**(BigInt(n)-(r?1n:0n))-1n,o=r?-t-1n:0n;if(e>t||e<o)throw new c.IntegerOutOfRangeError({max:t.toString(),min:o.toString(),signed:r,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:c.fromNumber(e,{size:32,signed:r})}}function z(e){const r=c.fromString(e),n=Math.ceil(c.size(r)/32),t=[];for(let o=0;o<n;o++)t.push(c.padRight(c.slice(r,o*32,(o+1)*32)));return{dynamic:!0,encoded:c.concat(c.padRight(c.fromNumber(c.size(r),{size:32})),...t)}}function A(e,r){const{checksumAddress:n,parameter:t}=r;let o=!1;const i=[];for(let s=0;s<t.components.length;s++){const a=t.components[s],d=Array.isArray(e)?s:a.name,p=f({checksumAddress:n,parameter:a,value:e[d]});i.push(p),p.dynamic&&(o=!0)}return{dynamic:o,encoded:o?u(i):c.concat(...i.map(({encoded:s})=>s))}}function S(e){const r=e.match(/^(.*)\[(\d+)?\]$/);return r?[r[2]?Number(r[2]):null,r[1]]:void 0}exports.encode=u;exports.encodeAddress=y;exports.encodeArray=h;exports.encodeBoolean=g;exports.encodeBytes=l;exports.encodeNumber=b;exports.encodeString=z;exports.encodeTuple=A;exports.getArrayComponents=S;exports.prepareParameter=f;exports.prepareParameters=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index293.cjs"),w=require("./index308.cjs"),N=require("./index303.cjs"),c=require("./index290.cjs"),x=require("./index309.cjs");function P({checksumAddress:e,parameters:r,values:n}){const t=[];for(let o=0;o<r.length;o++)t.push(f({checksumAddress:e,parameter:r[o],value:n[o]}));return t}function f({checksumAddress:e=!1,parameter:r,value:n}){const t=r,o=S(t.type);if(o){const[i,s]=o;return h(n,{checksumAddress:e,length:i,parameter:{...t,type:s}})}if(t.type==="tuple")return A(n,{checksumAddress:e,parameter:t});if(t.type==="address")return y(n,{checksum:e});if(t.type==="bool")return g(n);if(t.type.startsWith("uint")||t.type.startsWith("int")){const i=t.type.startsWith("int"),[,,s="256"]=x.integerRegex.exec(t.type)??[];return b(n,{signed:i,size:Number(s)})}if(t.type.startsWith("bytes"))return l(n,{type:t.type});if(t.type==="string")return z(n);throw new m.InvalidTypeError(t.type)}function u(e){let r=0;for(let i=0;i<e.length;i++){const{dynamic:s,encoded:a}=e[i];s?r+=32:r+=c.size(a)}const n=[],t=[];let o=0;for(let i=0;i<e.length;i++){const{dynamic:s,encoded:a}=e[i];s?(n.push(c.fromNumber(r+o,{size:32})),t.push(a),o+=c.size(a)):n.push(a)}return c.concat(...n,...t)}function y(e,r){const{checksum:n=!1}=r;return w.assert(e,{strict:n}),{dynamic:!1,encoded:c.padLeft(e.toLowerCase())}}function h(e,r){const{checksumAddress:n,length:t,parameter:o}=r,i=t===null;if(!Array.isArray(e))throw new m.InvalidArrayError(e);if(!i&&e.length!==t)throw new m.ArrayLengthMismatchError({expectedLength:t,givenLength:e.length,type:`${o.type}[${t}]`});let s=!1;const a=[];for(let d=0;d<e.length;d++){const p=f({checksumAddress:n,parameter:o,value:e[d]});p.dynamic&&(s=!0),a.push(p)}if(i||s){const d=u(a);if(i){const p=c.fromNumber(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?c.concat(p,d):p}}if(s)return{dynamic:!0,encoded:d}}return{dynamic:!1,encoded:c.concat(...a.map(({encoded:d})=>d))}}function l(e,{type:r}){const[,n]=r.split("bytes"),t=c.size(e);if(!n){let o=e;return t%32!==0&&(o=c.padRight(o,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:c.concat(c.padLeft(c.fromNumber(t,{size:32})),o)}}if(t!==Number.parseInt(n))throw new m.BytesSizeMismatchError({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:c.padRight(e)}}function g(e){if(typeof e!="boolean")throw new N.BaseError(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:c.padLeft(c.fromBoolean(e))}}function b(e,{signed:r,size:n}){if(typeof n=="number"){const t=2n**(BigInt(n)-(r?1n:0n))-1n,o=r?-t-1n:0n;if(e>t||e<o)throw new c.IntegerOutOfRangeError({max:t.toString(),min:o.toString(),signed:r,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:c.fromNumber(e,{size:32,signed:r})}}function z(e){const r=c.fromString(e),n=Math.ceil(c.size(r)/32),t=[];for(let o=0;o<n;o++)t.push(c.padRight(c.slice(r,o*32,(o+1)*32)));return{dynamic:!0,encoded:c.concat(c.padRight(c.fromNumber(c.size(r),{size:32})),...t)}}function A(e,r){const{checksumAddress:n,parameter:t}=r;let o=!1;const i=[];for(let s=0;s<t.components.length;s++){const a=t.components[s],d=Array.isArray(e)?s:a.name,p=f({checksumAddress:n,parameter:a,value:e[d]});i.push(p),p.dynamic&&(o=!0)}return{dynamic:o,encoded:o?u(i):c.concat(...i.map(({encoded:s})=>s))}}function S(e){const r=e.match(/^(.*)\[(\d+)?\]$/);return r?[r[2]?Number(r[2]):null,r[1]]:void 0}exports.encode=u;exports.encodeAddress=y;exports.encodeArray=h;exports.encodeBoolean=g;exports.encodeBytes=l;exports.encodeNumber=b;exports.encodeString=z;exports.encodeTuple=A;exports.getArrayComponents=S;exports.prepareParameter=f;exports.prepareParameters=P;
package/dist/index310.js CHANGED
@@ -1,7 +1,7 @@
1
- import { InvalidTypeError as g, InvalidArrayError as b, ArrayLengthMismatchError as w, BytesSizeMismatchError as z } from "./index297.js";
1
+ import { InvalidTypeError as g, InvalidArrayError as b, ArrayLengthMismatchError as w, BytesSizeMismatchError as z } from "./index293.js";
2
2
  import { assert as x } from "./index308.js";
3
3
  import { BaseError as S } from "./index303.js";
4
- import { size as d, fromNumber as f, concat as p, padLeft as h, fromBoolean as A, IntegerOutOfRangeError as E, padRight as y, fromString as I, slice as B } from "./index294.js";
4
+ import { size as d, fromNumber as f, concat as p, padLeft as h, fromBoolean as A, IntegerOutOfRangeError as E, padRight as y, fromString as I, slice as B } from "./index290.js";
5
5
  import { integerRegex as L } from "./index309.js";
6
6
  function q({ checksumAddress: e, parameters: n, values: r }) {
7
7
  const t = [];
package/dist/index311.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index315.cjs");function r(){return e.version}exports.getVersion=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index303.cjs"),y=require("./index290.cjs"),s=require("./index312.cjs"),z=require("./index305.cjs"),S=new TextEncoder;function x(e){return e instanceof Uint8Array?e:typeof e=="string"?h(e):g(e)}function g(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function h(e,t={}){const{size:r}=t;let n=e;r&&(z.assertSize(e,r),n=y.padRight(e,r));let i=n.slice(2);i.length%2&&(i=`0${i}`);const d=i.length/2,f=new Uint8Array(d);for(let c=0,o=0;c<d;c++){const u=s.charCodeToBase16(i.charCodeAt(o++)),b=s.charCodeToBase16(i.charCodeAt(o++));if(u===void 0||b===void 0)throw new a.BaseError(`Invalid byte sequence ("${i[o-2]}${i[o-1]}" in "${i}").`);f[c]=u*16+b}return f}function m(e,t={}){const{size:r}=t,n=S.encode(e);return typeof r=="number"?(s.assertSize(n,r),l(n,r)):n}function l(e,t){return s.pad(e,{dir:"right",size:t})}function E(e){return e.length}class p extends a.BaseError{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class $ extends a.BaseError{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}exports.SizeExceedsPaddingSizeError=$;exports.SizeOverflowError=p;exports.from=x;exports.fromArray=g;exports.fromHex=h;exports.fromString=m;exports.padRight=l;exports.size=E;
package/dist/index311.js CHANGED
@@ -1,7 +1,66 @@
1
- import { version as r } from "./index315.js";
2
- function e() {
3
- return r;
1
+ import { BaseError as c } from "./index303.js";
2
+ import { padRight as h } from "./index290.js";
3
+ import { charCodeToBase16 as b, assertSize as g, pad as m } from "./index312.js";
4
+ import { assertSize as p } from "./index305.js";
5
+ const l = /* @__PURE__ */ new TextEncoder();
6
+ function E(e) {
7
+ return e instanceof Uint8Array ? e : typeof e == "string" ? y(e) : z(e);
8
+ }
9
+ function z(e) {
10
+ return e instanceof Uint8Array ? e : new Uint8Array(e);
11
+ }
12
+ function y(e, t = {}) {
13
+ const { size: r } = t;
14
+ let n = e;
15
+ r && (p(e, r), n = h(e, r));
16
+ let i = n.slice(2);
17
+ i.length % 2 && (i = `0${i}`);
18
+ const f = i.length / 2, a = new Uint8Array(f);
19
+ for (let s = 0, o = 0; s < f; s++) {
20
+ const d = b(i.charCodeAt(o++)), u = b(i.charCodeAt(o++));
21
+ if (d === void 0 || u === void 0)
22
+ throw new c(`Invalid byte sequence ("${i[o - 2]}${i[o - 1]}" in "${i}").`);
23
+ a[s] = d * 16 + u;
24
+ }
25
+ return a;
26
+ }
27
+ function C(e, t = {}) {
28
+ const { size: r } = t, n = l.encode(e);
29
+ return typeof r == "number" ? (g(n, r), x(n, r)) : n;
30
+ }
31
+ function x(e, t) {
32
+ return m(e, { dir: "right", size: t });
33
+ }
34
+ function U(e) {
35
+ return e.length;
36
+ }
37
+ class B extends c {
38
+ constructor({ givenSize: t, maxSize: r }) {
39
+ super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`), Object.defineProperty(this, "name", {
40
+ enumerable: !0,
41
+ configurable: !0,
42
+ writable: !0,
43
+ value: "Bytes.SizeOverflowError"
44
+ });
45
+ }
46
+ }
47
+ class O extends c {
48
+ constructor({ size: t, targetSize: r, type: n }) {
49
+ super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`), Object.defineProperty(this, "name", {
50
+ enumerable: !0,
51
+ configurable: !0,
52
+ writable: !0,
53
+ value: "Bytes.SizeExceedsPaddingSizeError"
54
+ });
55
+ }
4
56
  }
5
57
  export {
6
- e as getVersion
58
+ O as SizeExceedsPaddingSizeError,
59
+ B as SizeOverflowError,
60
+ E as from,
61
+ z as fromArray,
62
+ y as fromHex,
63
+ C as fromString,
64
+ x as padRight,
65
+ U as size
7
66
  };
package/dist/index312.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index303.cjs"),y=require("./index294.cjs"),s=require("./index313.cjs"),z=require("./index305.cjs"),S=new TextEncoder;function x(e){return e instanceof Uint8Array?e:typeof e=="string"?h(e):g(e)}function g(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function h(e,t={}){const{size:r}=t;let n=e;r&&(z.assertSize(e,r),n=y.padRight(e,r));let i=n.slice(2);i.length%2&&(i=`0${i}`);const d=i.length/2,f=new Uint8Array(d);for(let c=0,o=0;c<d;c++){const u=s.charCodeToBase16(i.charCodeAt(o++)),b=s.charCodeToBase16(i.charCodeAt(o++));if(u===void 0||b===void 0)throw new a.BaseError(`Invalid byte sequence ("${i[o-2]}${i[o-1]}" in "${i}").`);f[c]=u*16+b}return f}function m(e,t={}){const{size:r}=t,n=S.encode(e);return typeof r=="number"?(s.assertSize(n,r),l(n,r)):n}function l(e,t){return s.pad(e,{dir:"right",size:t})}function E(e){return e.length}class p extends a.BaseError{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class $ extends a.BaseError{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}exports.SizeExceedsPaddingSizeError=$;exports.SizeOverflowError=p;exports.from=x;exports.fromArray=g;exports.fromHex=h;exports.fromString=m;exports.padRight=l;exports.size=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index311.cjs");function s(e,t){if(o.size(e)>t)throw new o.SizeOverflowError({givenSize:o.size(e),maxSize:t})}const n={zero:48,nine:57,A:65,F:70,a:97,f:102};function u(e){if(e>=n.zero&&e<=n.nine)return e-n.zero;if(e>=n.A&&e<=n.F)return e-(n.A-10);if(e>=n.a&&e<=n.f)return e-(n.a-10)}function z(e,t={}){const{dir:f,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new o.SizeExceedsPaddingSizeError({size:e.length,targetSize:r,type:"Bytes"});const d=new Uint8Array(r);for(let i=0;i<r;i++){const a=f==="right";d[a?i:r-i-1]=e[a?i:e.length-i-1]}return d}exports.assertSize=s;exports.charCodeMap=n;exports.charCodeToBase16=u;exports.pad=z;