@gardenfi/utils 2.2.1-beta.1 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (642) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +30 -34
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +44 -2
  5. package/dist/index100.cjs +1 -1
  6. package/dist/index100.js +8 -6
  7. package/dist/index101.cjs +1 -1
  8. package/dist/index101.js +26 -50
  9. package/dist/index102.cjs +1 -1
  10. package/dist/index102.js +10 -16
  11. package/dist/index103.cjs +1 -1
  12. package/dist/index103.js +13 -9
  13. package/dist/index104.cjs +1 -1
  14. package/dist/index104.js +117 -5
  15. package/dist/index105.cjs +1 -1
  16. package/dist/index105.js +80 -13
  17. package/dist/index106.cjs +1 -1
  18. package/dist/index106.js +177 -3
  19. package/dist/index107.cjs +1 -1
  20. package/dist/index107.js +6 -26
  21. package/dist/index108.cjs +1 -1
  22. package/dist/index108.js +13 -4
  23. package/dist/index109.cjs +1 -1
  24. package/dist/index109.js +13 -6
  25. package/dist/index11.cjs +1 -1
  26. package/dist/index11.js +17 -115
  27. package/dist/index110.cjs +1 -1
  28. package/dist/index110.js +93 -86
  29. package/dist/index111.cjs +1 -1
  30. package/dist/index111.js +72 -122
  31. package/dist/index112.cjs +1 -1
  32. package/dist/index112.js +89 -7
  33. package/dist/index113.cjs +1 -1
  34. package/dist/index113.js +137 -20
  35. package/dist/index114.cjs +1 -1
  36. package/dist/index114.js +68 -16
  37. package/dist/index115.cjs +1 -1
  38. package/dist/index115.js +22 -39
  39. package/dist/index116.cjs +1 -1
  40. package/dist/index116.js +109 -21
  41. package/dist/index117.cjs +1 -1
  42. package/dist/index117.js +5 -10
  43. package/dist/index118.cjs +1 -1
  44. package/dist/index118.js +50 -6
  45. package/dist/index119.cjs +1 -1
  46. package/dist/index119.js +15 -105
  47. package/dist/index12.cjs +1 -1
  48. package/dist/index12.js +134 -37
  49. package/dist/index120.cjs +1 -1
  50. package/dist/index120.js +11 -3
  51. package/dist/index121.cjs +1 -1
  52. package/dist/index121.js +6 -4
  53. package/dist/index122.cjs +1 -1
  54. package/dist/index122.js +15 -9
  55. package/dist/index123.cjs +1 -1
  56. package/dist/index123.js +4 -2
  57. package/dist/index124.cjs +1 -2
  58. package/dist/index124.js +27 -3
  59. package/dist/index125.cjs +1 -20
  60. package/dist/index125.js +4 -326
  61. package/dist/index126.cjs +1 -1
  62. package/dist/index126.js +6 -13
  63. package/dist/index127.cjs +1 -1
  64. package/dist/index127.js +88 -4
  65. package/dist/index128.cjs +1 -1
  66. package/dist/index128.js +126 -2
  67. package/dist/index129.cjs +1 -1
  68. package/dist/index129.js +7 -7
  69. package/dist/index13.cjs +1 -1
  70. package/dist/index13.js +10 -21
  71. package/dist/index130.cjs +1 -3
  72. package/dist/index130.js +17 -211
  73. package/dist/index131.cjs +1 -1
  74. package/dist/index131.js +18 -32
  75. package/dist/index132.cjs +1 -1
  76. package/dist/index132.js +39 -20
  77. package/dist/index133.cjs +1 -1
  78. package/dist/index133.js +21 -5
  79. package/dist/index134.cjs +1 -1
  80. package/dist/index134.js +10 -72
  81. package/dist/index135.cjs +1 -1
  82. package/dist/index135.js +6 -5
  83. package/dist/index136.cjs +1 -1
  84. package/dist/index136.js +106 -5
  85. package/dist/index137.cjs +1 -9
  86. package/dist/index137.js +3 -36
  87. package/dist/index138.cjs +1 -3
  88. package/dist/index138.js +4 -111
  89. package/dist/index139.cjs +1 -1
  90. package/dist/index139.js +9 -3
  91. package/dist/index14.cjs +1 -1
  92. package/dist/index14.js +2 -142
  93. package/dist/index140.cjs +1 -1
  94. package/dist/index140.js +2 -24
  95. package/dist/index141.cjs +2 -3
  96. package/dist/index141.js +3 -452
  97. package/dist/index142.cjs +20 -2
  98. package/dist/index142.js +307 -35
  99. package/dist/index143.cjs +1 -1
  100. package/dist/index143.js +11 -24
  101. package/dist/index144.cjs +1 -1
  102. package/dist/index144.js +4 -33
  103. package/dist/index145.cjs +1 -1
  104. package/dist/index145.js +2 -36
  105. package/dist/index146.cjs +1 -4
  106. package/dist/index146.js +6 -193
  107. package/dist/index147.cjs +3 -1
  108. package/dist/index147.js +213 -6
  109. package/dist/index148.cjs +1 -1
  110. package/dist/index148.js +32 -13
  111. package/dist/index149.cjs +1 -1
  112. package/dist/index149.js +21 -18
  113. package/dist/index15.cjs +1 -1
  114. package/dist/index15.js +33 -13
  115. package/dist/index150.cjs +1 -1
  116. package/dist/index150.js +5 -27
  117. package/dist/index151.cjs +1 -1
  118. package/dist/index151.js +73 -8
  119. package/dist/index152.cjs +1 -1
  120. package/dist/index152.js +5 -55
  121. package/dist/index153.cjs +1 -1
  122. package/dist/index153.js +5 -45
  123. package/dist/index154.cjs +9 -1
  124. package/dist/index154.js +35 -8
  125. package/dist/index155.cjs +3 -1
  126. package/dist/index155.js +110 -7
  127. package/dist/index156.cjs +1 -1
  128. package/dist/index156.js +3 -17
  129. package/dist/index157.cjs +1 -1
  130. package/dist/index157.js +21 -16
  131. package/dist/index158.cjs +3 -1
  132. package/dist/index158.js +451 -21
  133. package/dist/index159.cjs +2 -1
  134. package/dist/index159.js +53 -50
  135. package/dist/index16.cjs +1 -1
  136. package/dist/index16.js +19 -2
  137. package/dist/index160.cjs +1 -1
  138. package/dist/index160.js +26 -11
  139. package/dist/index161.cjs +1 -1
  140. package/dist/index161.js +24 -152
  141. package/dist/index162.cjs +1 -1
  142. package/dist/index162.js +35 -21
  143. package/dist/index163.cjs +4 -1
  144. package/dist/index163.js +193 -126
  145. package/dist/index164.cjs +1 -1
  146. package/dist/index164.js +7 -37
  147. package/dist/index165.cjs +1 -1
  148. package/dist/index165.js +18 -6
  149. package/dist/index166.cjs +1 -1
  150. package/dist/index166.js +25 -25
  151. package/dist/index167.cjs +1 -1
  152. package/dist/index167.js +8 -191
  153. package/dist/index168.cjs +1 -1
  154. package/dist/index168.js +8 -4
  155. package/dist/index169.cjs +1 -1
  156. package/dist/index169.js +15 -63
  157. package/dist/index17.cjs +1 -1
  158. package/dist/index17.js +186 -24
  159. package/dist/index170.cjs +1 -1
  160. package/dist/index170.js +19 -3
  161. package/dist/index171.cjs +1 -1
  162. package/dist/index171.js +21 -20
  163. package/dist/index172.cjs +1 -1
  164. package/dist/index172.js +50 -15
  165. package/dist/index173.cjs +1 -1
  166. package/dist/index173.js +11 -23
  167. package/dist/index174.cjs +1 -1
  168. package/dist/index174.js +161 -11
  169. package/dist/index175.cjs +1 -1
  170. package/dist/index175.js +126 -33
  171. package/dist/index176.cjs +1 -1
  172. package/dist/index176.js +39 -3
  173. package/dist/index177.cjs +1 -1
  174. package/dist/index177.js +6 -18
  175. package/dist/index178.cjs +1 -1
  176. package/dist/index178.js +27 -27
  177. package/dist/index179.cjs +1 -1
  178. package/dist/index179.js +191 -36
  179. package/dist/index18.cjs +1 -1
  180. package/dist/index18.js +120 -18
  181. package/dist/index180.cjs +1 -1
  182. package/dist/index180.js +4 -11
  183. package/dist/index181.cjs +1 -1
  184. package/dist/index181.js +60 -21
  185. package/dist/index182.cjs +1 -1
  186. package/dist/index182.js +3 -29
  187. package/dist/index183.cjs +1 -1
  188. package/dist/index183.js +18 -63
  189. package/dist/index184.cjs +1 -1
  190. package/dist/index184.js +16 -9
  191. package/dist/index185.cjs +1 -1
  192. package/dist/index185.js +23 -33
  193. package/dist/index186.cjs +1 -1
  194. package/dist/index186.js +34 -24
  195. package/dist/index187.cjs +1 -1
  196. package/dist/index187.js +3 -25
  197. package/dist/index188.cjs +1 -1
  198. package/dist/index188.js +18 -3
  199. package/dist/index189.cjs +1 -1
  200. package/dist/index189.js +27 -14
  201. package/dist/index19.cjs +1 -1
  202. package/dist/index19.js +2 -121
  203. package/dist/index190.cjs +1 -1
  204. package/dist/index190.js +34 -101
  205. package/dist/index191.cjs +1 -1
  206. package/dist/index191.js +10 -80
  207. package/dist/index192.cjs +1 -1
  208. package/dist/index192.js +25 -5
  209. package/dist/index193.cjs +1 -1
  210. package/dist/index193.js +28 -6
  211. package/dist/index194.cjs +1 -1
  212. package/dist/index194.js +63 -25
  213. package/dist/index195.cjs +1 -1
  214. package/dist/index195.js +9 -39
  215. package/dist/index196.cjs +1 -1
  216. package/dist/index196.js +24 -13
  217. package/dist/index197.cjs +1 -1
  218. package/dist/index197.js +23 -41
  219. package/dist/index198.cjs +1 -1
  220. package/dist/index198.js +3 -5
  221. package/dist/index199.cjs +1 -1
  222. package/dist/index199.js +14 -11
  223. package/dist/index20.cjs +1 -1
  224. package/dist/index20.js +13 -2
  225. package/dist/index200.cjs +1 -1
  226. package/dist/index200.js +80 -19
  227. package/dist/index201.cjs +1 -1
  228. package/dist/index201.js +5 -78
  229. package/dist/index202.cjs +1 -1
  230. package/dist/index202.js +28 -2
  231. package/dist/index203.cjs +1 -1
  232. package/dist/index203.js +39 -34
  233. package/dist/index204.cjs +1 -1
  234. package/dist/index204.js +5 -111
  235. package/dist/index205.cjs +1 -1
  236. package/dist/index205.js +11 -49
  237. package/dist/index206.cjs +1 -1
  238. package/dist/index206.js +19 -32
  239. package/dist/index207.cjs +1 -1
  240. package/dist/index207.js +78 -8
  241. package/dist/index208.cjs +1 -1
  242. package/dist/index208.js +2 -7
  243. package/dist/index209.cjs +1 -1
  244. package/dist/index209.js +37 -6
  245. package/dist/index21.cjs +1 -1
  246. package/dist/index21.js +464 -13
  247. package/dist/index210.cjs +1 -1
  248. package/dist/index210.js +111 -11
  249. package/dist/index211.cjs +1 -1
  250. package/dist/index211.js +48 -9
  251. package/dist/index212.cjs +1 -1
  252. package/dist/index212.js +32 -13
  253. package/dist/index213.cjs +1 -1
  254. package/dist/index213.js +8 -32
  255. package/dist/index214.cjs +1 -1
  256. package/dist/index214.js +7 -5
  257. package/dist/index215.cjs +1 -1
  258. package/dist/index215.js +6 -7
  259. package/dist/index216.cjs +1 -1
  260. package/dist/index216.js +11 -8
  261. package/dist/index217.cjs +1 -1
  262. package/dist/index217.js +10 -20
  263. package/dist/index218.cjs +1 -1
  264. package/dist/index218.js +13 -31
  265. package/dist/index219.cjs +1 -1
  266. package/dist/index219.js +31 -19
  267. package/dist/index22.cjs +1 -1
  268. package/dist/index22.js +36 -464
  269. package/dist/index220.cjs +1 -1
  270. package/dist/index220.js +5 -4
  271. package/dist/index221.cjs +1 -1
  272. package/dist/index221.js +7 -17
  273. package/dist/index222.cjs +1 -1
  274. package/dist/index222.js +8 -10
  275. package/dist/index223.cjs +1 -1
  276. package/dist/index223.js +20 -21
  277. package/dist/index224.cjs +1 -1
  278. package/dist/index224.js +31 -22
  279. package/dist/index225.cjs +1 -1
  280. package/dist/index225.js +20 -5
  281. package/dist/index226.cjs +1 -1
  282. package/dist/index226.js +3 -5
  283. package/dist/index227.cjs +1 -1
  284. package/dist/index227.js +17 -8
  285. package/dist/index228.cjs +1 -1
  286. package/dist/index228.js +10 -104
  287. package/dist/index229.cjs +1 -1
  288. package/dist/index229.js +22 -3
  289. package/dist/index23.cjs +1 -1
  290. package/dist/index23.js +12 -35
  291. package/dist/index230.cjs +1 -1
  292. package/dist/index230.js +22 -18
  293. package/dist/index231.cjs +1 -1
  294. package/dist/index231.js +5 -171
  295. package/dist/index232.cjs +1 -1
  296. package/dist/index232.js +8 -17
  297. package/dist/index233.cjs +1 -1
  298. package/dist/index233.js +104 -10
  299. package/dist/index234.cjs +1 -1
  300. package/dist/index234.js +3 -17
  301. package/dist/index235.cjs +1 -1
  302. package/dist/index235.js +17 -21
  303. package/dist/index236.cjs +1 -1
  304. package/dist/index236.js +17 -30
  305. package/dist/index237.cjs +1 -1
  306. package/dist/index237.js +11 -2
  307. package/dist/index238.cjs +1 -1
  308. package/dist/index238.js +16 -13
  309. package/dist/index239.cjs +1 -1
  310. package/dist/index239.js +21 -11
  311. package/dist/index24.cjs +1 -1
  312. package/dist/index24.js +57 -26
  313. package/dist/index240.cjs +1 -1
  314. package/dist/index240.js +30 -47
  315. package/dist/index241.cjs +1 -1
  316. package/dist/index241.js +2 -12
  317. package/dist/index242.cjs +1 -1
  318. package/dist/index242.js +13 -7
  319. package/dist/index243.cjs +1 -1
  320. package/dist/index243.js +12 -9
  321. package/dist/index244.cjs +1 -1
  322. package/dist/index244.js +47 -13
  323. package/dist/index245.cjs +1 -1
  324. package/dist/index245.js +10 -13
  325. package/dist/index246.cjs +1 -1
  326. package/dist/index246.js +7 -9
  327. package/dist/index247.cjs +1 -1
  328. package/dist/index247.js +8 -23
  329. package/dist/index248.cjs +1 -1
  330. package/dist/index248.js +13 -12
  331. package/dist/index249.cjs +1 -1
  332. package/dist/index249.js +14 -24
  333. package/dist/index25.cjs +16 -1
  334. package/dist/index25.js +113 -7
  335. package/dist/index250.cjs +1 -1
  336. package/dist/index250.js +9 -13
  337. package/dist/index251.cjs +1 -1
  338. package/dist/index251.js +24 -15
  339. package/dist/index252.cjs +1 -2
  340. package/dist/index252.js +11 -23
  341. package/dist/index253.cjs +1 -1
  342. package/dist/index253.js +24 -52
  343. package/dist/index254.cjs +1 -1
  344. package/dist/index254.js +13 -25
  345. package/dist/index255.cjs +1 -1
  346. package/dist/index255.js +14 -12
  347. package/dist/index256.cjs +2 -1
  348. package/dist/index256.js +24 -15
  349. package/dist/index257.cjs +1 -1
  350. package/dist/index257.js +52 -5
  351. package/dist/index258.cjs +1 -1
  352. package/dist/index258.js +12 -13
  353. package/dist/index259.cjs +2 -1
  354. package/dist/index259.js +18 -10
  355. package/dist/index26.cjs +1 -1
  356. package/dist/index26.js +32 -13
  357. package/dist/index260.cjs +1 -1
  358. package/dist/index260.js +14 -16
  359. package/dist/index261.cjs +1 -2
  360. package/dist/index261.js +11 -41
  361. package/dist/index262.cjs +1 -1
  362. package/dist/index262.js +225 -2
  363. package/dist/index263.cjs +1 -1
  364. package/dist/index263.js +139 -5
  365. package/dist/index264.cjs +1 -1
  366. package/dist/index264.js +144 -8
  367. package/dist/index265.cjs +1 -1
  368. package/dist/index265.js +101 -17
  369. package/dist/index266.cjs +1 -1
  370. package/dist/index266.js +6 -8
  371. package/dist/index267.cjs +1 -1
  372. package/dist/index267.js +43 -67
  373. package/dist/index268.cjs +1 -1
  374. package/dist/index268.js +73 -60
  375. package/dist/index269.cjs +1 -1
  376. package/dist/index269.js +2 -187
  377. package/dist/index27.cjs +1 -1
  378. package/dist/index27.js +31 -58
  379. package/dist/index270.cjs +2 -1
  380. package/dist/index270.js +40 -21
  381. package/dist/index271.cjs +1 -1
  382. package/dist/index271.js +2 -43
  383. package/dist/index272.cjs +1 -1
  384. package/dist/index272.js +5 -76
  385. package/dist/index273.cjs +1 -1
  386. package/dist/index273.js +9 -39
  387. package/dist/index274.cjs +1 -1
  388. package/dist/index274.js +17 -14
  389. package/dist/index275.cjs +1 -1
  390. package/dist/index275.js +8 -13
  391. package/dist/index276.cjs +1 -1
  392. package/dist/index276.js +67 -13
  393. package/dist/index277.cjs +1 -2
  394. package/dist/index277.js +65 -18
  395. package/dist/index278.cjs +1 -1
  396. package/dist/index278.js +185 -13
  397. package/dist/index279.cjs +1 -1
  398. package/dist/index279.js +22 -11
  399. package/dist/index28.cjs +1 -16
  400. package/dist/index28.js +11 -113
  401. package/dist/index280.cjs +1 -1
  402. package/dist/index280.js +39 -100
  403. package/dist/index281.cjs +1 -1
  404. package/dist/index281.js +76 -6
  405. package/dist/index282.cjs +1 -1
  406. package/dist/index282.js +37 -221
  407. package/dist/index283.cjs +1 -1
  408. package/dist/index283.js +16 -6
  409. package/dist/index284.cjs +1 -1
  410. package/dist/index284.js +14 -7
  411. package/dist/index285.cjs +1 -1
  412. package/dist/index285.js +6 -26
  413. package/dist/index286.cjs +1 -1
  414. package/dist/index286.js +7 -20
  415. package/dist/index287.cjs +1 -1
  416. package/dist/index287.js +24 -144
  417. package/dist/index288.cjs +1 -1
  418. package/dist/index288.js +19 -3
  419. package/dist/index289.cjs +1 -1
  420. package/dist/index289.js +3 -140
  421. package/dist/index29.cjs +1 -1
  422. package/dist/index29.js +38 -30
  423. package/dist/index290.cjs +1 -1
  424. package/dist/index290.js +128 -143
  425. package/dist/index291.cjs +1 -1
  426. package/dist/index291.js +155 -9
  427. package/dist/index292.cjs +1 -1
  428. package/dist/index292.js +7 -111
  429. package/dist/index293.cjs +1 -2
  430. package/dist/index293.js +95 -116
  431. package/dist/index294.cjs +2 -1
  432. package/dist/index294.js +126 -131
  433. package/dist/index295.cjs +1 -1
  434. package/dist/index295.js +10 -41
  435. package/dist/index296.cjs +1 -1
  436. package/dist/index296.js +18 -77
  437. package/dist/index297.cjs +1 -1
  438. package/dist/index297.js +699 -2
  439. package/dist/index298.cjs +1 -1
  440. package/dist/index298.js +200 -10
  441. package/dist/index299.cjs +1 -1
  442. package/dist/index299.js +68 -19
  443. package/dist/index3.cjs +1 -1
  444. package/dist/index3.js +11 -15
  445. package/dist/index30.cjs +1 -1
  446. package/dist/index30.js +46 -31
  447. package/dist/index300.cjs +2 -1
  448. package/dist/index300.js +66 -68
  449. package/dist/index301.cjs +1 -1
  450. package/dist/index301.js +4 -698
  451. package/dist/index302.cjs +1 -1
  452. package/dist/index302.js +40 -201
  453. package/dist/index303.cjs +1 -2
  454. package/dist/index303.js +7 -66
  455. package/dist/index304.cjs +1 -1
  456. package/dist/index304.js +62 -4
  457. package/dist/index305.cjs +1 -1
  458. package/dist/index305.js +70 -33
  459. package/dist/index306.cjs +1 -1
  460. package/dist/index306.js +4 -8
  461. package/dist/index307.cjs +1 -1
  462. package/dist/index307.js +187 -55
  463. package/dist/index308.cjs +1 -1
  464. package/dist/index308.js +4 -77
  465. package/dist/index309.cjs +1 -1
  466. package/dist/index309.js +64 -4
  467. package/dist/index31.cjs +1 -1
  468. package/dist/index31.js +25 -11
  469. package/dist/index310.cjs +1 -1
  470. package/dist/index310.js +5 -195
  471. package/dist/index311.cjs +1 -1
  472. package/dist/index311.js +40 -59
  473. package/dist/index312.cjs +1 -1
  474. package/dist/index312.js +2 -45
  475. package/dist/index313.cjs +1 -1
  476. package/dist/index313.js +21 -4
  477. package/dist/index32.cjs +1 -1
  478. package/dist/index32.js +6 -7
  479. package/dist/index33.cjs +1 -1
  480. package/dist/index33.js +12 -30
  481. package/dist/index34.cjs +1 -1
  482. package/dist/index34.js +14 -28
  483. package/dist/index35.cjs +1 -1
  484. package/dist/index35.js +5 -16
  485. package/dist/index36.cjs +1 -1
  486. package/dist/index36.js +12 -32
  487. package/dist/index37.cjs +1 -1
  488. package/dist/index37.js +10 -44
  489. package/dist/index38.cjs +1 -1
  490. package/dist/index38.js +11 -150
  491. package/dist/index39.cjs +1 -1
  492. package/dist/index39.js +11 -35
  493. package/dist/index4.cjs +1 -1
  494. package/dist/index4.js +17 -17
  495. package/dist/index40.cjs +1 -1
  496. package/dist/index40.js +13 -38
  497. package/dist/index41.cjs +1 -2
  498. package/dist/index41.js +32 -58
  499. package/dist/index42.cjs +1 -1
  500. package/dist/index42.js +55 -37
  501. package/dist/index43.cjs +1 -1
  502. package/dist/index43.js +16 -15
  503. package/dist/index44.cjs +1 -1
  504. package/dist/index44.js +5 -8
  505. package/dist/index45.cjs +1 -1
  506. package/dist/index45.js +9 -2
  507. package/dist/index46.cjs +1 -1
  508. package/dist/index46.js +168 -42
  509. package/dist/index47.cjs +1 -1
  510. package/dist/index47.js +101 -29
  511. package/dist/index49.cjs +1 -1
  512. package/dist/index49.js +21 -9
  513. package/dist/index50.cjs +1 -1
  514. package/dist/index50.js +7 -68
  515. package/dist/index51.cjs +1 -1
  516. package/dist/index51.js +31 -9
  517. package/dist/index52.cjs +1 -1
  518. package/dist/index52.js +28 -27
  519. package/dist/index53.cjs +1 -1
  520. package/dist/index53.js +16 -71
  521. package/dist/index54.cjs +1 -1
  522. package/dist/index54.js +33 -19
  523. package/dist/index55.cjs +1 -1
  524. package/dist/index55.js +44 -110
  525. package/dist/index56.cjs +1 -1
  526. package/dist/index56.js +150 -59
  527. package/dist/index57.cjs +1 -1
  528. package/dist/index57.js +31 -20
  529. package/dist/index58.cjs +1 -1
  530. package/dist/index58.js +36 -38
  531. package/dist/index59.cjs +2 -1
  532. package/dist/index59.js +59 -37
  533. package/dist/index6.cjs +1 -1
  534. package/dist/index6.js +6 -6
  535. package/dist/index60.cjs +1 -1
  536. package/dist/index60.js +37 -58
  537. package/dist/index61.cjs +1 -1
  538. package/dist/index61.js +15 -166
  539. package/dist/index62.cjs +1 -1
  540. package/dist/index62.js +8 -40
  541. package/dist/index63.cjs +1 -1
  542. package/dist/index63.js +2 -10
  543. package/dist/index64.cjs +1 -1
  544. package/dist/index64.js +43 -34
  545. package/dist/index65.cjs +1 -1
  546. package/dist/index65.js +31 -9
  547. package/dist/index66.cjs +1 -1
  548. package/dist/index66.js +8 -49
  549. package/dist/index67.cjs +1 -1
  550. package/dist/index67.js +66 -83
  551. package/dist/index68.cjs +1 -1
  552. package/dist/index68.js +7 -39
  553. package/dist/index69.cjs +1 -1
  554. package/dist/index69.js +28 -8
  555. package/dist/index7.cjs +1 -1
  556. package/dist/index7.js +22 -105
  557. package/dist/index70.cjs +1 -1
  558. package/dist/index70.js +71 -6
  559. package/dist/index71.cjs +1 -1
  560. package/dist/index71.js +19 -17
  561. package/dist/index72.cjs +1 -1
  562. package/dist/index72.js +110 -8
  563. package/dist/index73.cjs +1 -1
  564. package/dist/index73.js +60 -13
  565. package/dist/index74.cjs +1 -1
  566. package/dist/index74.js +24 -7
  567. package/dist/index75.cjs +1 -1
  568. package/dist/index75.js +40 -9
  569. package/dist/index76.cjs +1 -1
  570. package/dist/index76.js +36 -45
  571. package/dist/index77.cjs +1 -1
  572. package/dist/index77.js +58 -13
  573. package/dist/index78.cjs +1 -1
  574. package/dist/index78.js +164 -14
  575. package/dist/index79.cjs +1 -1
  576. package/dist/index79.js +40 -13
  577. package/dist/index8.cjs +1 -1
  578. package/dist/index8.js +2 -10
  579. package/dist/index80.cjs +1 -1
  580. package/dist/index80.js +8 -5
  581. package/dist/index81.cjs +1 -1
  582. package/dist/index81.js +30 -29
  583. package/dist/index82.cjs +1 -1
  584. package/dist/index82.js +8 -8
  585. package/dist/index83.cjs +1 -1
  586. package/dist/index83.js +50 -8
  587. package/dist/index84.cjs +1 -1
  588. package/dist/index84.js +84 -25
  589. package/dist/index85.cjs +1 -1
  590. package/dist/index85.js +41 -10
  591. package/dist/index86.cjs +1 -1
  592. package/dist/index86.js +7 -13
  593. package/dist/index87.cjs +1 -1
  594. package/dist/index87.js +6 -117
  595. package/dist/index88.cjs +1 -1
  596. package/dist/index88.js +17 -81
  597. package/dist/index89.cjs +1 -1
  598. package/dist/index89.js +8 -177
  599. package/dist/index9.cjs +1 -1
  600. package/dist/index9.js +119 -19
  601. package/dist/index90.cjs +1 -1
  602. package/dist/index90.js +13 -6
  603. package/dist/index91.cjs +1 -1
  604. package/dist/index91.js +7 -13
  605. package/dist/index92.cjs +1 -1
  606. package/dist/index92.js +9 -13
  607. package/dist/index93.cjs +1 -1
  608. package/dist/index93.js +45 -94
  609. package/dist/index94.cjs +1 -1
  610. package/dist/index94.js +13 -75
  611. package/dist/index95.cjs +1 -1
  612. package/dist/index95.js +16 -89
  613. package/dist/index96.cjs +1 -1
  614. package/dist/index96.js +13 -138
  615. package/dist/index97.cjs +1 -1
  616. package/dist/index97.js +6 -69
  617. package/dist/index98.cjs +1 -1
  618. package/dist/index98.js +34 -22
  619. package/dist/index99.cjs +1 -1
  620. package/dist/index99.js +9 -109
  621. package/dist/src/index.d.ts +0 -3
  622. package/dist/src/lib/approve.d.ts +1 -1
  623. package/dist/src/lib/auth/apikey/apikey.d.ts +1 -1
  624. package/dist/src/lib/auth/auth.types.d.ts +1 -1
  625. package/dist/src/lib/auth/passkey/passkey.d.ts +1 -1
  626. package/dist/src/lib/auth/passkey/passkeyLogin.d.ts +3 -3
  627. package/dist/src/lib/auth/siwe/siwe.d.ts +1 -1
  628. package/dist/src/lib/blockNumber/blockNumber.d.ts +9 -2
  629. package/dist/src/lib/blockNumber/index.d.ts +1 -1
  630. package/dist/src/lib/utils.d.ts +0 -1
  631. package/package.json +1 -1
  632. package/dist/index314.cjs +0 -1
  633. package/dist/index314.js +0 -7
  634. package/dist/index315.cjs +0 -1
  635. package/dist/index315.js +0 -4
  636. package/dist/index316.cjs +0 -1
  637. package/dist/index316.js +0 -24
  638. package/dist/src/lib/fetcher.d.ts +0 -45
  639. package/dist/src/lib/retry.d.ts +0 -16
  640. package/dist/src/lib/safeParseJson.d.ts +0 -7
  641. package/dist/src/lib/tryCatch.d.ts +0 -7
  642. package/dist/src/lib/types.d.ts +0 -3
package/dist/index297.js CHANGED
@@ -1,4 +1,701 @@
1
- const o = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
1
+ import { hmac as dt } from "./index267.js";
2
+ import { _validateObject as at, bitMask as ft, abool as Q, ensureBytes as z, memoized as nt, createHmacDrbg as ht, bytesToNumberBE as ct, numberToHexUnpadded as M, aInRange as mt } from "./index263.js";
3
+ import { _createCurveFields as wt, wNAF as yt, normalizeZ as pt, pippenger as gt, mulEndoUnsafe as Et, negateCt as ot } from "./index298.js";
4
+ import { Field as bt, mapHashToField as vt, getMinHashLength as Bt } from "./index262.js";
5
+ import { concatBytes as I, abytes as it, bytesToHex as rt, hexToBytes as xt, randomBytes as St, isBytes as Rt } from "./index264.js";
6
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
7
+ function st(e) {
8
+ e.lowS !== void 0 && Q("lowS", e.lowS), e.prehash !== void 0 && Q("prehash", e.prehash);
9
+ }
10
+ class Ot extends Error {
11
+ constructor(i = "") {
12
+ super(i);
13
+ }
14
+ }
15
+ const F = {
16
+ // asn.1 DER encoding utils
17
+ Err: Ot,
18
+ // Basic building block is TLV (Tag-Length-Value)
19
+ _tlv: {
20
+ encode: (e, i) => {
21
+ const { Err: t } = F;
22
+ if (e < 0 || e > 256)
23
+ throw new t("tlv.encode: wrong tag");
24
+ if (i.length & 1)
25
+ throw new t("tlv.encode: unpadded data");
26
+ const w = i.length / 2, p = M(w);
27
+ if (p.length / 2 & 128)
28
+ throw new t("tlv.encode: long form length too big");
29
+ const b = w > 127 ? M(p.length / 2 | 128) : "";
30
+ return M(e) + b + p + i;
31
+ },
32
+ // v - value, l - left bytes (unparsed)
33
+ decode(e, i) {
34
+ const { Err: t } = F;
35
+ let w = 0;
36
+ if (e < 0 || e > 256)
37
+ throw new t("tlv.encode: wrong tag");
38
+ if (i.length < 2 || i[w++] !== e)
39
+ throw new t("tlv.decode: wrong tlv");
40
+ const p = i[w++], b = !!(p & 128);
41
+ let u = 0;
42
+ if (!b)
43
+ u = p;
44
+ else {
45
+ const S = p & 127;
46
+ if (!S)
47
+ throw new t("tlv.decode(long): indefinite length not supported");
48
+ if (S > 4)
49
+ throw new t("tlv.decode(long): byte length is too big");
50
+ const N = i.subarray(w, w + S);
51
+ if (N.length !== S)
52
+ throw new t("tlv.decode: length bytes not complete");
53
+ if (N[0] === 0)
54
+ throw new t("tlv.decode(long): zero leftmost byte");
55
+ for (const q of N)
56
+ u = u << 8 | q;
57
+ if (w += S, u < 128)
58
+ throw new t("tlv.decode(long): not minimal encoding");
59
+ }
60
+ const x = i.subarray(w, w + u);
61
+ if (x.length !== u)
62
+ throw new t("tlv.decode: wrong value length");
63
+ return { v: x, l: i.subarray(w + u) };
64
+ }
65
+ },
66
+ // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,
67
+ // since we always use positive integers here. It must always be empty:
68
+ // - add zero byte if exists
69
+ // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)
70
+ _int: {
71
+ encode(e) {
72
+ const { Err: i } = F;
73
+ if (e < U)
74
+ throw new i("integer: negative integers are not allowed");
75
+ let t = M(e);
76
+ if (Number.parseInt(t[0], 16) & 8 && (t = "00" + t), t.length & 1)
77
+ throw new i("unexpected DER parsing assertion: unpadded hex");
78
+ return t;
79
+ },
80
+ decode(e) {
81
+ const { Err: i } = F;
82
+ if (e[0] & 128)
83
+ throw new i("invalid signature integer: negative");
84
+ if (e[0] === 0 && !(e[1] & 128))
85
+ throw new i("invalid signature integer: unnecessary leading zero");
86
+ return ct(e);
87
+ }
88
+ },
89
+ toSig(e) {
90
+ const { Err: i, _int: t, _tlv: w } = F, p = z("signature", e), { v: b, l: u } = w.decode(48, p);
91
+ if (u.length)
92
+ throw new i("invalid signature: left bytes after parsing");
93
+ const { v: x, l: S } = w.decode(2, b), { v: N, l: q } = w.decode(2, S);
94
+ if (q.length)
95
+ throw new i("invalid signature: left bytes after parsing");
96
+ return { r: t.decode(x), s: t.decode(N) };
97
+ },
98
+ hexFromSig(e) {
99
+ const { _tlv: i, _int: t } = F, w = i.encode(2, t.encode(e.r)), p = i.encode(2, t.encode(e.s)), b = w + p;
100
+ return i.encode(48, b);
101
+ }
102
+ }, U = BigInt(0), k = BigInt(1), At = BigInt(2), W = BigInt(3), Zt = BigInt(4);
103
+ function Tt(e, i, t) {
104
+ function w(p) {
105
+ const b = e.sqr(p), u = e.mul(b, p);
106
+ return e.add(e.add(u, e.mul(p, i)), t);
107
+ }
108
+ return w;
109
+ }
110
+ function lt(e, i, t) {
111
+ const { BYTES: w } = e;
112
+ function p(b) {
113
+ let u;
114
+ if (typeof b == "bigint")
115
+ u = b;
116
+ else {
117
+ let x = z("private key", b);
118
+ if (i) {
119
+ if (!i.includes(x.length * 2))
120
+ throw new Error("invalid private key");
121
+ const S = new Uint8Array(w);
122
+ S.set(x, S.length - x.length), x = S;
123
+ }
124
+ try {
125
+ u = e.fromBytes(x);
126
+ } catch {
127
+ throw new Error(`invalid private key: expected ui8a of size ${w}, got ${typeof b}`);
128
+ }
129
+ }
130
+ if (t && (u = e.create(u)), !e.isValidNot0(u))
131
+ throw new Error("invalid private key: out of range [1..N-1]");
132
+ return u;
133
+ }
134
+ return p;
135
+ }
136
+ function zt(e, i = {}) {
137
+ const { Fp: t, Fn: w } = wt("weierstrass", e, i), { h: p, n: b } = e;
138
+ at(i, {}, {
139
+ allowInfinityPoint: "boolean",
140
+ clearCofactor: "function",
141
+ isTorsionFree: "function",
142
+ fromBytes: "function",
143
+ toBytes: "function",
144
+ endo: "object",
145
+ wrapPrivateKey: "boolean"
146
+ });
147
+ const { endo: u } = i;
148
+ if (u && (!t.is0(e.a) || typeof u.beta != "bigint" || typeof u.splitScalar != "function"))
149
+ throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function');
150
+ function x() {
151
+ if (!t.isOdd)
152
+ throw new Error("compression is not supported: Field does not have .isOdd()");
153
+ }
154
+ function S(v, r, s) {
155
+ const { x: n, y: o } = r.toAffine(), a = t.toBytes(n);
156
+ if (Q("isCompressed", s), s) {
157
+ x();
158
+ const d = !t.isOdd(o);
159
+ return I(ut(d), a);
160
+ } else
161
+ return I(Uint8Array.of(4), a, t.toBytes(o));
162
+ }
163
+ function N(v) {
164
+ it(v);
165
+ const r = t.BYTES, s = r + 1, n = 2 * r + 1, o = v.length, a = v[0], d = v.subarray(1);
166
+ if (o === s && (a === 2 || a === 3)) {
167
+ const c = t.fromBytes(d);
168
+ if (!t.isValid(c))
169
+ throw new Error("bad point: is not on curve, wrong x");
170
+ const l = T(c);
171
+ let h;
172
+ try {
173
+ h = t.sqrt(l);
174
+ } catch (g) {
175
+ const m = g instanceof Error ? ": " + g.message : "";
176
+ throw new Error("bad point: is not on curve, sqrt error" + m);
177
+ }
178
+ x();
179
+ const f = t.isOdd(h);
180
+ return (a & 1) === 1 !== f && (h = t.neg(h)), { x: c, y: h };
181
+ } else if (o === n && a === 4) {
182
+ const c = t.fromBytes(d.subarray(r * 0, r * 1)), l = t.fromBytes(d.subarray(r * 1, r * 2));
183
+ if (!L(c, l))
184
+ throw new Error("bad point: is not on curve");
185
+ return { x: c, y: l };
186
+ } else
187
+ throw new Error(`bad point: got length ${o}, expected compressed=${s} or uncompressed=${n}`);
188
+ }
189
+ const q = i.toBytes || S, C = i.fromBytes || N, T = Tt(t, e.a, e.b);
190
+ function L(v, r) {
191
+ const s = t.sqr(r), n = T(v);
192
+ return t.eql(s, n);
193
+ }
194
+ if (!L(e.Gx, e.Gy))
195
+ throw new Error("bad curve params: generator point");
196
+ const J = t.mul(t.pow(e.a, W), Zt), tt = t.mul(t.sqr(e.b), BigInt(27));
197
+ if (t.is0(t.add(J, tt)))
198
+ throw new Error("bad curve params: a or b");
199
+ function K(v, r, s = !1) {
200
+ if (!t.isValid(r) || s && t.is0(r))
201
+ throw new Error(`bad point coordinate ${v}`);
202
+ return r;
203
+ }
204
+ function G(v) {
205
+ if (!(v instanceof y))
206
+ throw new Error("ProjectivePoint expected");
207
+ }
208
+ const X = nt((v, r) => {
209
+ const { px: s, py: n, pz: o } = v;
210
+ if (t.eql(o, t.ONE))
211
+ return { x: s, y: n };
212
+ const a = v.is0();
213
+ r == null && (r = a ? t.ONE : t.inv(o));
214
+ const d = t.mul(s, r), c = t.mul(n, r), l = t.mul(o, r);
215
+ if (a)
216
+ return { x: t.ZERO, y: t.ZERO };
217
+ if (!t.eql(l, t.ONE))
218
+ throw new Error("invZ was invalid");
219
+ return { x: d, y: c };
220
+ }), V = nt((v) => {
221
+ if (v.is0()) {
222
+ if (i.allowInfinityPoint && !t.is0(v.py))
223
+ return;
224
+ throw new Error("bad point: ZERO");
225
+ }
226
+ const { x: r, y: s } = v.toAffine();
227
+ if (!t.isValid(r) || !t.isValid(s))
228
+ throw new Error("bad point: x or y not field elements");
229
+ if (!L(r, s))
230
+ throw new Error("bad point: equation left != right");
231
+ if (!v.isTorsionFree())
232
+ throw new Error("bad point: not in prime-order subgroup");
233
+ return !0;
234
+ });
235
+ function $(v, r, s, n, o) {
236
+ return s = new y(t.mul(s.px, v), s.py, s.pz), r = ot(n, r), s = ot(o, s), r.add(s);
237
+ }
238
+ class y {
239
+ /** Does NOT validate if the point is valid. Use `.assertValidity()`. */
240
+ constructor(r, s, n) {
241
+ this.px = K("x", r), this.py = K("y", s, !0), this.pz = K("z", n), Object.freeze(this);
242
+ }
243
+ /** Does NOT validate if the point is valid. Use `.assertValidity()`. */
244
+ static fromAffine(r) {
245
+ const { x: s, y: n } = r || {};
246
+ if (!r || !t.isValid(s) || !t.isValid(n))
247
+ throw new Error("invalid affine point");
248
+ if (r instanceof y)
249
+ throw new Error("projective point not allowed");
250
+ return t.is0(s) && t.is0(n) ? y.ZERO : new y(s, n, t.ONE);
251
+ }
252
+ get x() {
253
+ return this.toAffine().x;
254
+ }
255
+ get y() {
256
+ return this.toAffine().y;
257
+ }
258
+ static normalizeZ(r) {
259
+ return pt(y, "pz", r);
260
+ }
261
+ static fromBytes(r) {
262
+ return it(r), y.fromHex(r);
263
+ }
264
+ /** Converts hash string or Uint8Array to Point. */
265
+ static fromHex(r) {
266
+ const s = y.fromAffine(C(z("pointHex", r)));
267
+ return s.assertValidity(), s;
268
+ }
269
+ /** Multiplies generator point by privateKey. */
270
+ static fromPrivateKey(r) {
271
+ const s = lt(w, i.allowedPrivateKeyLengths, i.wrapPrivateKey);
272
+ return y.BASE.multiply(s(r));
273
+ }
274
+ /** Multiscalar Multiplication */
275
+ static msm(r, s) {
276
+ return gt(y, w, r, s);
277
+ }
278
+ /**
279
+ *
280
+ * @param windowSize
281
+ * @param isLazy true will defer table computation until the first multiplication
282
+ * @returns
283
+ */
284
+ precompute(r = 8, s = !0) {
285
+ return _.setWindowSize(this, r), s || this.multiply(W), this;
286
+ }
287
+ /** "Private method", don't use it directly */
288
+ _setWindowSize(r) {
289
+ this.precompute(r);
290
+ }
291
+ // TODO: return `this`
292
+ /** A point on curve is valid if it conforms to equation. */
293
+ assertValidity() {
294
+ V(this);
295
+ }
296
+ hasEvenY() {
297
+ const { y: r } = this.toAffine();
298
+ if (!t.isOdd)
299
+ throw new Error("Field doesn't support isOdd");
300
+ return !t.isOdd(r);
301
+ }
302
+ /** Compare one point to another. */
303
+ equals(r) {
304
+ G(r);
305
+ const { px: s, py: n, pz: o } = this, { px: a, py: d, pz: c } = r, l = t.eql(t.mul(s, c), t.mul(a, o)), h = t.eql(t.mul(n, c), t.mul(d, o));
306
+ return l && h;
307
+ }
308
+ /** Flips point to one corresponding to (x, -y) in Affine coordinates. */
309
+ negate() {
310
+ return new y(this.px, t.neg(this.py), this.pz);
311
+ }
312
+ // Renes-Costello-Batina exception-free doubling formula.
313
+ // There is 30% faster Jacobian formula, but it is not complete.
314
+ // https://eprint.iacr.org/2015/1060, algorithm 3
315
+ // Cost: 8M + 3S + 3*a + 2*b3 + 15add.
316
+ double() {
317
+ const { a: r, b: s } = e, n = t.mul(s, W), { px: o, py: a, pz: d } = this;
318
+ let c = t.ZERO, l = t.ZERO, h = t.ZERO, f = t.mul(o, o), B = t.mul(a, a), g = t.mul(d, d), m = t.mul(o, a);
319
+ return m = t.add(m, m), h = t.mul(o, d), h = t.add(h, h), c = t.mul(r, h), l = t.mul(n, g), l = t.add(c, l), c = t.sub(B, l), l = t.add(B, l), l = t.mul(c, l), c = t.mul(m, c), h = t.mul(n, h), g = t.mul(r, g), m = t.sub(f, g), m = t.mul(r, m), m = t.add(m, h), h = t.add(f, f), f = t.add(h, f), f = t.add(f, g), f = t.mul(f, m), l = t.add(l, f), g = t.mul(a, d), g = t.add(g, g), f = t.mul(g, m), c = t.sub(c, f), h = t.mul(g, B), h = t.add(h, h), h = t.add(h, h), new y(c, l, h);
320
+ }
321
+ // Renes-Costello-Batina exception-free addition formula.
322
+ // There is 30% faster Jacobian formula, but it is not complete.
323
+ // https://eprint.iacr.org/2015/1060, algorithm 1
324
+ // Cost: 12M + 0S + 3*a + 3*b3 + 23add.
325
+ add(r) {
326
+ G(r);
327
+ const { px: s, py: n, pz: o } = this, { px: a, py: d, pz: c } = r;
328
+ let l = t.ZERO, h = t.ZERO, f = t.ZERO;
329
+ const B = e.a, g = t.mul(e.b, W);
330
+ let m = t.mul(s, a), R = t.mul(n, d), O = t.mul(o, c), A = t.add(s, n), E = t.add(a, d);
331
+ A = t.mul(A, E), E = t.add(m, R), A = t.sub(A, E), E = t.add(s, o);
332
+ let Z = t.add(a, c);
333
+ return E = t.mul(E, Z), Z = t.add(m, O), E = t.sub(E, Z), Z = t.add(n, o), l = t.add(d, c), Z = t.mul(Z, l), l = t.add(R, O), Z = t.sub(Z, l), f = t.mul(B, E), l = t.mul(g, O), f = t.add(l, f), l = t.sub(R, f), f = t.add(R, f), h = t.mul(l, f), R = t.add(m, m), R = t.add(R, m), O = t.mul(B, O), E = t.mul(g, E), R = t.add(R, O), O = t.sub(m, O), O = t.mul(B, O), E = t.add(E, O), m = t.mul(R, E), h = t.add(h, m), m = t.mul(Z, E), l = t.mul(A, l), l = t.sub(l, m), m = t.mul(A, R), f = t.mul(Z, f), f = t.add(f, m), new y(l, h, f);
334
+ }
335
+ subtract(r) {
336
+ return this.add(r.negate());
337
+ }
338
+ is0() {
339
+ return this.equals(y.ZERO);
340
+ }
341
+ /**
342
+ * Constant time multiplication.
343
+ * Uses wNAF method. Windowed method may be 10% faster,
344
+ * but takes 2x longer to generate and consumes 2x memory.
345
+ * Uses precomputes when available.
346
+ * Uses endomorphism for Koblitz curves.
347
+ * @param scalar by which the point would be multiplied
348
+ * @returns New point
349
+ */
350
+ multiply(r) {
351
+ const { endo: s } = i;
352
+ if (!w.isValidNot0(r))
353
+ throw new Error("invalid scalar: out of range");
354
+ let n, o;
355
+ const a = (d) => _.wNAFCached(this, d, y.normalizeZ);
356
+ if (s) {
357
+ const { k1neg: d, k1: c, k2neg: l, k2: h } = s.splitScalar(r), { p: f, f: B } = a(c), { p: g, f: m } = a(h);
358
+ o = B.add(m), n = $(s.beta, f, g, d, l);
359
+ } else {
360
+ const { p: d, f: c } = a(r);
361
+ n = d, o = c;
362
+ }
363
+ return y.normalizeZ([n, o])[0];
364
+ }
365
+ /**
366
+ * Non-constant-time multiplication. Uses double-and-add algorithm.
367
+ * It's faster, but should only be used when you don't care about
368
+ * an exposed private key e.g. sig verification, which works over *public* keys.
369
+ */
370
+ multiplyUnsafe(r) {
371
+ const { endo: s } = i, n = this;
372
+ if (!w.isValid(r))
373
+ throw new Error("invalid scalar: out of range");
374
+ if (r === U || n.is0())
375
+ return y.ZERO;
376
+ if (r === k)
377
+ return n;
378
+ if (_.hasPrecomputes(this))
379
+ return this.multiply(r);
380
+ if (s) {
381
+ const { k1neg: o, k1: a, k2neg: d, k2: c } = s.splitScalar(r), { p1: l, p2: h } = Et(y, n, a, c);
382
+ return $(s.beta, l, h, o, d);
383
+ } else
384
+ return _.wNAFCachedUnsafe(n, r);
385
+ }
386
+ multiplyAndAddUnsafe(r, s, n) {
387
+ const o = this.multiplyUnsafe(s).add(r.multiplyUnsafe(n));
388
+ return o.is0() ? void 0 : o;
389
+ }
390
+ /**
391
+ * Converts Projective point to affine (x, y) coordinates.
392
+ * @param invertedZ Z^-1 (inverted zero) - optional, precomputation is useful for invertBatch
393
+ */
394
+ toAffine(r) {
395
+ return X(this, r);
396
+ }
397
+ /**
398
+ * Checks whether Point is free of torsion elements (is in prime subgroup).
399
+ * Always torsion-free for cofactor=1 curves.
400
+ */
401
+ isTorsionFree() {
402
+ const { isTorsionFree: r } = i;
403
+ return p === k ? !0 : r ? r(y, this) : _.wNAFCachedUnsafe(this, b).is0();
404
+ }
405
+ clearCofactor() {
406
+ const { clearCofactor: r } = i;
407
+ return p === k ? this : r ? r(y, this) : this.multiplyUnsafe(p);
408
+ }
409
+ toBytes(r = !0) {
410
+ return Q("isCompressed", r), this.assertValidity(), q(y, this, r);
411
+ }
412
+ /** @deprecated use `toBytes` */
413
+ toRawBytes(r = !0) {
414
+ return this.toBytes(r);
415
+ }
416
+ toHex(r = !0) {
417
+ return rt(this.toBytes(r));
418
+ }
419
+ toString() {
420
+ return `<Point ${this.is0() ? "ZERO" : this.toHex()}>`;
421
+ }
422
+ }
423
+ y.BASE = new y(e.Gx, e.Gy, t.ONE), y.ZERO = new y(t.ZERO, t.ONE, t.ZERO), y.Fp = t, y.Fn = w;
424
+ const P = w.BITS, _ = yt(y, i.endo ? Math.ceil(P / 2) : P);
425
+ return y;
426
+ }
427
+ function ut(e) {
428
+ return Uint8Array.of(e ? 2 : 3);
429
+ }
430
+ function Nt(e, i, t = {}) {
431
+ at(i, { hash: "function" }, {
432
+ hmac: "function",
433
+ lowS: "boolean",
434
+ randomBytes: "function",
435
+ bits2int: "function",
436
+ bits2int_modN: "function"
437
+ });
438
+ const w = i.randomBytes || St, p = i.hmac || ((n, ...o) => dt(i.hash, n, I(...o))), { Fp: b, Fn: u } = e, { ORDER: x, BITS: S } = u;
439
+ function N(n) {
440
+ const o = x >> k;
441
+ return n > o;
442
+ }
443
+ function q(n) {
444
+ return N(n) ? u.neg(n) : n;
445
+ }
446
+ function C(n, o) {
447
+ if (!u.isValidNot0(o))
448
+ throw new Error(`invalid signature ${n}: out of range 1..CURVE.n`);
449
+ }
450
+ class T {
451
+ constructor(o, a, d) {
452
+ C("r", o), C("s", a), this.r = o, this.s = a, d != null && (this.recovery = d), Object.freeze(this);
453
+ }
454
+ // pair (bytes of r, bytes of s)
455
+ static fromCompact(o) {
456
+ const a = u.BYTES, d = z("compactSignature", o, a * 2);
457
+ return new T(u.fromBytes(d.subarray(0, a)), u.fromBytes(d.subarray(a, a * 2)));
458
+ }
459
+ // DER encoded ECDSA signature
460
+ // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script
461
+ static fromDER(o) {
462
+ const { r: a, s: d } = F.toSig(z("DER", o));
463
+ return new T(a, d);
464
+ }
465
+ /**
466
+ * @todo remove
467
+ * @deprecated
468
+ */
469
+ assertValidity() {
470
+ }
471
+ addRecoveryBit(o) {
472
+ return new T(this.r, this.s, o);
473
+ }
474
+ // ProjPointType<bigint>
475
+ recoverPublicKey(o) {
476
+ const a = b.ORDER, { r: d, s: c, recovery: l } = this;
477
+ if (l == null || ![0, 1, 2, 3].includes(l))
478
+ throw new Error("recovery id invalid");
479
+ if (x * At < a && l > 1)
480
+ throw new Error("recovery id is ambiguous for h>1 curve");
481
+ const f = l === 2 || l === 3 ? d + x : d;
482
+ if (!b.isValid(f))
483
+ throw new Error("recovery id 2 or 3 invalid");
484
+ const B = b.toBytes(f), g = e.fromHex(I(ut((l & 1) === 0), B)), m = u.inv(f), R = V(z("msgHash", o)), O = u.create(-R * m), A = u.create(c * m), E = e.BASE.multiplyUnsafe(O).add(g.multiplyUnsafe(A));
485
+ if (E.is0())
486
+ throw new Error("point at infinify");
487
+ return E.assertValidity(), E;
488
+ }
489
+ // Signatures should be low-s, to prevent malleability.
490
+ hasHighS() {
491
+ return N(this.s);
492
+ }
493
+ normalizeS() {
494
+ return this.hasHighS() ? new T(this.r, u.neg(this.s), this.recovery) : this;
495
+ }
496
+ toBytes(o) {
497
+ if (o === "compact")
498
+ return I(u.toBytes(this.r), u.toBytes(this.s));
499
+ if (o === "der")
500
+ return xt(F.hexFromSig(this));
501
+ throw new Error("invalid format");
502
+ }
503
+ // DER-encoded
504
+ toDERRawBytes() {
505
+ return this.toBytes("der");
506
+ }
507
+ toDERHex() {
508
+ return rt(this.toBytes("der"));
509
+ }
510
+ // padded bytes of r, then padded bytes of s
511
+ toCompactRawBytes() {
512
+ return this.toBytes("compact");
513
+ }
514
+ toCompactHex() {
515
+ return rt(this.toBytes("compact"));
516
+ }
517
+ }
518
+ const L = lt(u, t.allowedPrivateKeyLengths, t.wrapPrivateKey), J = {
519
+ isValidPrivateKey(n) {
520
+ try {
521
+ return L(n), !0;
522
+ } catch {
523
+ return !1;
524
+ }
525
+ },
526
+ normPrivateKeyToScalar: L,
527
+ /**
528
+ * Produces cryptographically secure private key from random of size
529
+ * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible.
530
+ */
531
+ randomPrivateKey: () => {
532
+ const n = x;
533
+ return vt(w(Bt(n)), n);
534
+ },
535
+ precompute(n = 8, o = e.BASE) {
536
+ return o.precompute(n, !1);
537
+ }
538
+ };
539
+ function tt(n, o = !0) {
540
+ return e.fromPrivateKey(n).toBytes(o);
541
+ }
542
+ function K(n) {
543
+ if (typeof n == "bigint")
544
+ return !1;
545
+ if (n instanceof e)
546
+ return !0;
547
+ const a = z("key", n).length, d = b.BYTES, c = d + 1, l = 2 * d + 1;
548
+ if (!(t.allowedPrivateKeyLengths || u.BYTES === c))
549
+ return a === c || a === l;
550
+ }
551
+ function G(n, o, a = !0) {
552
+ if (K(n) === !0)
553
+ throw new Error("first arg must be private key");
554
+ if (K(o) === !1)
555
+ throw new Error("second arg must be public key");
556
+ return e.fromHex(o).multiply(L(n)).toBytes(a);
557
+ }
558
+ const X = i.bits2int || function(n) {
559
+ if (n.length > 8192)
560
+ throw new Error("input is too large");
561
+ const o = ct(n), a = n.length * 8 - S;
562
+ return a > 0 ? o >> BigInt(a) : o;
563
+ }, V = i.bits2int_modN || function(n) {
564
+ return u.create(X(n));
565
+ }, $ = ft(S);
566
+ function y(n) {
567
+ return mt("num < 2^" + S, n, U, $), u.toBytes(n);
568
+ }
569
+ function P(n, o, a = _) {
570
+ if (["recovered", "canonical"].some((A) => A in a))
571
+ throw new Error("sign() legacy options not supported");
572
+ const { hash: d } = i;
573
+ let { lowS: c, prehash: l, extraEntropy: h } = a;
574
+ c == null && (c = !0), n = z("msgHash", n), st(a), l && (n = z("prehashed msgHash", d(n)));
575
+ const f = V(n), B = L(o), g = [y(B), y(f)];
576
+ if (h != null && h !== !1) {
577
+ const A = h === !0 ? w(b.BYTES) : h;
578
+ g.push(z("extraEntropy", A));
579
+ }
580
+ const m = I(...g), R = f;
581
+ function O(A) {
582
+ const E = X(A);
583
+ if (!u.isValidNot0(E))
584
+ return;
585
+ const Z = u.inv(E), j = e.BASE.multiply(E).toAffine(), Y = u.create(j.x);
586
+ if (Y === U)
587
+ return;
588
+ const H = u.create(Z * u.create(R + Y * B));
589
+ if (H === U)
590
+ return;
591
+ let et = (j.x === Y ? 0 : 2) | Number(j.y & k), D = H;
592
+ return c && N(H) && (D = q(H), et ^= 1), new T(Y, D, et);
593
+ }
594
+ return { seed: m, k2sig: O };
595
+ }
596
+ const _ = { lowS: i.lowS, prehash: !1 }, v = { lowS: i.lowS, prehash: !1 };
597
+ function r(n, o, a = _) {
598
+ const { seed: d, k2sig: c } = P(n, o, a);
599
+ return ht(i.hash.outputLen, u.BYTES, p)(d, c);
600
+ }
601
+ e.BASE.precompute(8);
602
+ function s(n, o, a, d = v) {
603
+ const c = n;
604
+ o = z("msgHash", o), a = z("publicKey", a), st(d);
605
+ const { lowS: l, prehash: h, format: f } = d;
606
+ if ("strict" in d)
607
+ throw new Error("options.strict was renamed to lowS");
608
+ if (f !== void 0 && !["compact", "der", "js"].includes(f))
609
+ throw new Error('format must be "compact", "der" or "js"');
610
+ const B = typeof c == "string" || Rt(c), g = !B && !f && typeof c == "object" && c !== null && typeof c.r == "bigint" && typeof c.s == "bigint";
611
+ if (!B && !g)
612
+ throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");
613
+ let m, R;
614
+ try {
615
+ if (g)
616
+ if (f === void 0 || f === "js")
617
+ m = new T(c.r, c.s);
618
+ else
619
+ throw new Error("invalid format");
620
+ if (B) {
621
+ try {
622
+ f !== "compact" && (m = T.fromDER(c));
623
+ } catch (D) {
624
+ if (!(D instanceof F.Err))
625
+ throw D;
626
+ }
627
+ !m && f !== "der" && (m = T.fromCompact(c));
628
+ }
629
+ R = e.fromHex(a);
630
+ } catch {
631
+ return !1;
632
+ }
633
+ if (!m || l && m.hasHighS())
634
+ return !1;
635
+ h && (o = i.hash(o));
636
+ const { r: O, s: A } = m, E = V(o), Z = u.inv(A), j = u.create(E * Z), Y = u.create(O * Z), H = e.BASE.multiplyUnsafe(j).add(R.multiplyUnsafe(Y));
637
+ return H.is0() ? !1 : u.create(H.x) === O;
638
+ }
639
+ return Object.freeze({
640
+ getPublicKey: tt,
641
+ getSharedSecret: G,
642
+ sign: r,
643
+ verify: s,
644
+ utils: J,
645
+ Point: e,
646
+ Signature: T
647
+ });
648
+ }
649
+ function Ft(e) {
650
+ const i = {
651
+ a: e.a,
652
+ b: e.b,
653
+ p: e.Fp.ORDER,
654
+ n: e.n,
655
+ h: e.h,
656
+ Gx: e.Gx,
657
+ Gy: e.Gy
658
+ }, t = e.Fp, w = bt(i.n, e.nBitLength), p = {
659
+ Fp: t,
660
+ Fn: w,
661
+ allowedPrivateKeyLengths: e.allowedPrivateKeyLengths,
662
+ allowInfinityPoint: e.allowInfinityPoint,
663
+ endo: e.endo,
664
+ wrapPrivateKey: e.wrapPrivateKey,
665
+ isTorsionFree: e.isTorsionFree,
666
+ clearCofactor: e.clearCofactor,
667
+ fromBytes: e.fromBytes,
668
+ toBytes: e.toBytes
669
+ };
670
+ return { CURVE: i, curveOpts: p };
671
+ }
672
+ function Lt(e) {
673
+ const { CURVE: i, curveOpts: t } = Ft(e), w = {
674
+ hash: e.hash,
675
+ hmac: e.hmac,
676
+ randomBytes: e.randomBytes,
677
+ lowS: e.lowS,
678
+ bits2int: e.bits2int,
679
+ bits2int_modN: e.bits2int_modN
680
+ };
681
+ return { CURVE: i, curveOpts: t, ecdsaOpts: w };
682
+ }
683
+ function _t(e, i) {
684
+ return Object.assign({}, i, {
685
+ ProjectivePoint: i.Point,
686
+ CURVE: e
687
+ });
688
+ }
689
+ function It(e) {
690
+ const { CURVE: i, curveOpts: t, ecdsaOpts: w } = Lt(e), p = zt(i, t), b = Nt(p, w, t);
691
+ return _t(e, b);
692
+ }
2
693
  export {
3
- o as crypto
694
+ F as DER,
695
+ Ot as DERErr,
696
+ Tt as _legacyHelperEquat,
697
+ lt as _legacyHelperNormPriv,
698
+ Nt as ecdsa,
699
+ It as weierstrass,
700
+ zt as weierstrassN
4
701
  };