@sentio/sdk 2.57.12-rc.j → 2.57.13-rc.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 (250) hide show
  1. package/lib/core/template.d.ts +1 -5
  2. package/lib/core/template.d.ts.map +1 -1
  3. package/lib/core/template.js +1 -4
  4. package/lib/core/template.js.map +1 -1
  5. package/lib/store/store.d.ts +2 -2
  6. package/lib/store/store.d.ts.map +1 -1
  7. package/lib/store/store.js.map +1 -1
  8. package/package.json +3 -3
  9. package/src/core/template.ts +1 -6
  10. package/src/store/store.ts +2 -3
  11. package/lib/chunk-2F2KNF4Z.js +0 -71905
  12. package/lib/chunk-2F2KNF4Z.js.map +0 -1
  13. package/lib/chunk-43HP4DQZ.js +0 -47
  14. package/lib/chunk-43HP4DQZ.js.map +0 -1
  15. package/lib/chunk-4HPFNKDX.js +0 -6763
  16. package/lib/chunk-4HPFNKDX.js.map +0 -1
  17. package/lib/chunk-4OCWUYSJ.js +0 -898
  18. package/lib/chunk-4OCWUYSJ.js.map +0 -1
  19. package/lib/chunk-6UVWNOIX.js +0 -4207
  20. package/lib/chunk-6UVWNOIX.js.map +0 -1
  21. package/lib/chunk-73SHERGU.js +0 -23970
  22. package/lib/chunk-73SHERGU.js.map +0 -1
  23. package/lib/chunk-742S42NO.js +0 -1323
  24. package/lib/chunk-742S42NO.js.map +0 -1
  25. package/lib/chunk-7ECRTQD7.js +0 -26757
  26. package/lib/chunk-7ECRTQD7.js.map +0 -1
  27. package/lib/chunk-7IDGS56O.js +0 -5058
  28. package/lib/chunk-7IDGS56O.js.map +0 -1
  29. package/lib/chunk-7S6WQ4RL.js +0 -1069
  30. package/lib/chunk-7S6WQ4RL.js.map +0 -1
  31. package/lib/chunk-AZFMPZRN.js +0 -3613
  32. package/lib/chunk-AZFMPZRN.js.map +0 -1
  33. package/lib/chunk-BZCXYTDE.js +0 -1333
  34. package/lib/chunk-BZCXYTDE.js.map +0 -1
  35. package/lib/chunk-E2DS6WZF.js +0 -1690
  36. package/lib/chunk-E2DS6WZF.js.map +0 -1
  37. package/lib/chunk-GE6BRIGS.js +0 -1721
  38. package/lib/chunk-GE6BRIGS.js.map +0 -1
  39. package/lib/chunk-J3I3VNTV.js +0 -767
  40. package/lib/chunk-J3I3VNTV.js.map +0 -1
  41. package/lib/chunk-J3QOJ2RV.js +0 -661
  42. package/lib/chunk-J3QOJ2RV.js.map +0 -1
  43. package/lib/chunk-J5UEW4B7.js +0 -1351
  44. package/lib/chunk-J5UEW4B7.js.map +0 -1
  45. package/lib/chunk-LPSNAS2G.js +0 -460
  46. package/lib/chunk-LPSNAS2G.js.map +0 -1
  47. package/lib/chunk-LR232ZJV.js +0 -2593
  48. package/lib/chunk-LR232ZJV.js.map +0 -1
  49. package/lib/chunk-N36N7RXJ.js +0 -653
  50. package/lib/chunk-N36N7RXJ.js.map +0 -1
  51. package/lib/chunk-OJG2VJ5T.js +0 -7063
  52. package/lib/chunk-OJG2VJ5T.js.map +0 -1
  53. package/lib/chunk-ONBEMKI5.js +0 -323
  54. package/lib/chunk-ONBEMKI5.js.map +0 -1
  55. package/lib/chunk-PVX2LIM5.js +0 -205
  56. package/lib/chunk-PVX2LIM5.js.map +0 -1
  57. package/lib/chunk-R7PMHHKJ.js +0 -52
  58. package/lib/chunk-R7PMHHKJ.js.map +0 -1
  59. package/lib/chunk-RMT2JEWA.js +0 -7740
  60. package/lib/chunk-RMT2JEWA.js.map +0 -1
  61. package/lib/chunk-S6MJ3KIL.js +0 -27798
  62. package/lib/chunk-S6MJ3KIL.js.map +0 -1
  63. package/lib/chunk-UEFVZL4I.js +0 -199
  64. package/lib/chunk-UEFVZL4I.js.map +0 -1
  65. package/lib/chunk-UIBPOKNT.js +0 -945
  66. package/lib/chunk-UIBPOKNT.js.map +0 -1
  67. package/lib/chunk-ZR7UHHH2.js +0 -5
  68. package/lib/chunk-ZR7UHHH2.js.map +0 -1
  69. package/lib/multipart-parser-SQIYSR67.js +0 -368
  70. package/lib/multipart-parser-SQIYSR67.js.map +0 -1
  71. package/src/aptos/builtin/0x1.d.ts +0 -6451
  72. package/src/aptos/builtin/0x1.d.ts.map +0 -1
  73. package/src/aptos/builtin/0x1.js +0 -7138
  74. package/src/aptos/builtin/0x1.js.map +0 -1
  75. package/src/aptos/builtin/0x3.d.ts +0 -1122
  76. package/src/aptos/builtin/0x3.d.ts.map +0 -1
  77. package/src/aptos/builtin/0x3.js +0 -937
  78. package/src/aptos/builtin/0x3.js.map +0 -1
  79. package/src/aptos/builtin/0x4.d.ts +0 -551
  80. package/src/aptos/builtin/0x4.d.ts.map +0 -1
  81. package/src/aptos/builtin/0x4.js +0 -529
  82. package/src/aptos/builtin/0x4.js.map +0 -1
  83. package/src/aptos/builtin/index.d.ts +0 -4
  84. package/src/aptos/builtin/index.d.ts.map +0 -1
  85. package/src/aptos/builtin/index.js +0 -7
  86. package/src/aptos/builtin/index.js.map +0 -1
  87. package/src/eth/builtin/eacaggregatorproxy.d.ts +0 -5
  88. package/src/eth/builtin/eacaggregatorproxy.d.ts.map +0 -1
  89. package/src/eth/builtin/eacaggregatorproxy.js +0 -8
  90. package/src/eth/builtin/eacaggregatorproxy.js.map +0 -1
  91. package/src/eth/builtin/erc1155.d.ts +0 -5
  92. package/src/eth/builtin/erc1155.d.ts.map +0 -1
  93. package/src/eth/builtin/erc1155.js +0 -8
  94. package/src/eth/builtin/erc1155.js.map +0 -1
  95. package/src/eth/builtin/erc20.d.ts +0 -5
  96. package/src/eth/builtin/erc20.d.ts.map +0 -1
  97. package/src/eth/builtin/erc20.js +0 -8
  98. package/src/eth/builtin/erc20.js.map +0 -1
  99. package/src/eth/builtin/erc20bytes.d.ts +0 -5
  100. package/src/eth/builtin/erc20bytes.d.ts.map +0 -1
  101. package/src/eth/builtin/erc20bytes.js +0 -8
  102. package/src/eth/builtin/erc20bytes.js.map +0 -1
  103. package/src/eth/builtin/erc721.d.ts +0 -5
  104. package/src/eth/builtin/erc721.d.ts.map +0 -1
  105. package/src/eth/builtin/erc721.js +0 -8
  106. package/src/eth/builtin/erc721.js.map +0 -1
  107. package/src/eth/builtin/index.d.ts +0 -13
  108. package/src/eth/builtin/index.d.ts.map +0 -1
  109. package/src/eth/builtin/index.js +0 -16
  110. package/src/eth/builtin/index.js.map +0 -1
  111. package/src/eth/builtin/internal/EACAggregatorProxy.d.ts +0 -50
  112. package/src/eth/builtin/internal/EACAggregatorProxy.d.ts.map +0 -1
  113. package/src/eth/builtin/internal/EACAggregatorProxy.js +0 -2
  114. package/src/eth/builtin/internal/EACAggregatorProxy.js.map +0 -1
  115. package/src/eth/builtin/internal/ERC1155.d.ts +0 -57
  116. package/src/eth/builtin/internal/ERC1155.d.ts.map +0 -1
  117. package/src/eth/builtin/internal/ERC1155.js +0 -2
  118. package/src/eth/builtin/internal/ERC1155.js.map +0 -1
  119. package/src/eth/builtin/internal/ERC20.d.ts +0 -41
  120. package/src/eth/builtin/internal/ERC20.d.ts.map +0 -1
  121. package/src/eth/builtin/internal/ERC20.js +0 -2
  122. package/src/eth/builtin/internal/ERC20.js.map +0 -1
  123. package/src/eth/builtin/internal/ERC20Bytes.d.ts +0 -32
  124. package/src/eth/builtin/internal/ERC20Bytes.d.ts.map +0 -1
  125. package/src/eth/builtin/internal/ERC20Bytes.js +0 -2
  126. package/src/eth/builtin/internal/ERC20Bytes.js.map +0 -1
  127. package/src/eth/builtin/internal/ERC721.d.ts +0 -43
  128. package/src/eth/builtin/internal/ERC721.d.ts.map +0 -1
  129. package/src/eth/builtin/internal/ERC721.js +0 -2
  130. package/src/eth/builtin/internal/ERC721.js.map +0 -1
  131. package/src/eth/builtin/internal/WETH9.d.ts +0 -47
  132. package/src/eth/builtin/internal/WETH9.d.ts.map +0 -1
  133. package/src/eth/builtin/internal/WETH9.js +0 -2
  134. package/src/eth/builtin/internal/WETH9.js.map +0 -1
  135. package/src/eth/builtin/internal/common.d.ts +0 -3
  136. package/src/eth/builtin/internal/common.d.ts.map +0 -1
  137. package/src/eth/builtin/internal/common.js +0 -8
  138. package/src/eth/builtin/internal/common.js.map +0 -1
  139. package/src/eth/builtin/internal/eacaggregatorproxy-processor.d.ts +0 -373
  140. package/src/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +0 -1
  141. package/src/eth/builtin/internal/eacaggregatorproxy-processor.js +0 -1355
  142. package/src/eth/builtin/internal/eacaggregatorproxy-processor.js.map +0 -1
  143. package/src/eth/builtin/internal/eacaggregatorproxy-test-utils.d.ts +0 -7
  144. package/src/eth/builtin/internal/eacaggregatorproxy-test-utils.d.ts.map +0 -1
  145. package/src/eth/builtin/internal/eacaggregatorproxy-test-utils.js +0 -55
  146. package/src/eth/builtin/internal/eacaggregatorproxy-test-utils.js.map +0 -1
  147. package/src/eth/builtin/internal/erc1155-processor.d.ts +0 -173
  148. package/src/eth/builtin/internal/erc1155-processor.d.ts.map +0 -1
  149. package/src/eth/builtin/internal/erc1155-processor.js +0 -596
  150. package/src/eth/builtin/internal/erc1155-processor.js.map +0 -1
  151. package/src/eth/builtin/internal/erc1155-test-utils.d.ts +0 -7
  152. package/src/eth/builtin/internal/erc1155-test-utils.d.ts.map +0 -1
  153. package/src/eth/builtin/internal/erc1155-test-utils.js +0 -55
  154. package/src/eth/builtin/internal/erc1155-test-utils.js.map +0 -1
  155. package/src/eth/builtin/internal/erc20-processor.d.ts +0 -244
  156. package/src/eth/builtin/internal/erc20-processor.d.ts.map +0 -1
  157. package/src/eth/builtin/internal/erc20-processor.js +0 -1109
  158. package/src/eth/builtin/internal/erc20-processor.js.map +0 -1
  159. package/src/eth/builtin/internal/erc20-test-utils.d.ts +0 -6
  160. package/src/eth/builtin/internal/erc20-test-utils.d.ts.map +0 -1
  161. package/src/eth/builtin/internal/erc20-test-utils.js +0 -44
  162. package/src/eth/builtin/internal/erc20-test-utils.js.map +0 -1
  163. package/src/eth/builtin/internal/erc20bytes-processor.d.ts +0 -144
  164. package/src/eth/builtin/internal/erc20bytes-processor.d.ts.map +0 -1
  165. package/src/eth/builtin/internal/erc20bytes-processor.js +0 -594
  166. package/src/eth/builtin/internal/erc20bytes-processor.js.map +0 -1
  167. package/src/eth/builtin/internal/erc20bytes-test-utils.d.ts +0 -5
  168. package/src/eth/builtin/internal/erc20bytes-test-utils.d.ts.map +0 -1
  169. package/src/eth/builtin/internal/erc20bytes-test-utils.js +0 -33
  170. package/src/eth/builtin/internal/erc20bytes-test-utils.js.map +0 -1
  171. package/src/eth/builtin/internal/erc721-processor.d.ts +0 -215
  172. package/src/eth/builtin/internal/erc721-processor.d.ts.map +0 -1
  173. package/src/eth/builtin/internal/erc721-processor.js +0 -895
  174. package/src/eth/builtin/internal/erc721-processor.js.map +0 -1
  175. package/src/eth/builtin/internal/erc721-test-utils.d.ts +0 -6
  176. package/src/eth/builtin/internal/erc721-test-utils.d.ts.map +0 -1
  177. package/src/eth/builtin/internal/erc721-test-utils.js +0 -44
  178. package/src/eth/builtin/internal/erc721-test-utils.js.map +0 -1
  179. package/src/eth/builtin/internal/factories/EACAggregatorProxy__factory.d.ts +0 -400
  180. package/src/eth/builtin/internal/factories/EACAggregatorProxy__factory.d.ts.map +0 -1
  181. package/src/eth/builtin/internal/factories/EACAggregatorProxy__factory.js +0 -524
  182. package/src/eth/builtin/internal/factories/EACAggregatorProxy__factory.js.map +0 -1
  183. package/src/eth/builtin/internal/factories/ERC1155__factory.d.ts +0 -251
  184. package/src/eth/builtin/internal/factories/ERC1155__factory.d.ts.map +0 -1
  185. package/src/eth/builtin/internal/factories/ERC1155__factory.js +0 -329
  186. package/src/eth/builtin/internal/factories/ERC1155__factory.js.map +0 -1
  187. package/src/eth/builtin/internal/factories/ERC20Bytes__factory.d.ts +0 -185
  188. package/src/eth/builtin/internal/factories/ERC20Bytes__factory.d.ts.map +0 -1
  189. package/src/eth/builtin/internal/factories/ERC20Bytes__factory.js +0 -251
  190. package/src/eth/builtin/internal/factories/ERC20Bytes__factory.js.map +0 -1
  191. package/src/eth/builtin/internal/factories/ERC20__factory.d.ts +0 -303
  192. package/src/eth/builtin/internal/factories/ERC20__factory.d.ts.map +0 -1
  193. package/src/eth/builtin/internal/factories/ERC20__factory.js +0 -401
  194. package/src/eth/builtin/internal/factories/ERC20__factory.js.map +0 -1
  195. package/src/eth/builtin/internal/factories/ERC721__factory.d.ts +0 -273
  196. package/src/eth/builtin/internal/factories/ERC721__factory.d.ts.map +0 -1
  197. package/src/eth/builtin/internal/factories/ERC721__factory.js +0 -361
  198. package/src/eth/builtin/internal/factories/ERC721__factory.js.map +0 -1
  199. package/src/eth/builtin/internal/factories/WETH9__factory.d.ts +0 -220
  200. package/src/eth/builtin/internal/factories/WETH9__factory.d.ts.map +0 -1
  201. package/src/eth/builtin/internal/factories/WETH9__factory.js +0 -294
  202. package/src/eth/builtin/internal/factories/WETH9__factory.js.map +0 -1
  203. package/src/eth/builtin/internal/factories/index.d.ts +0 -7
  204. package/src/eth/builtin/internal/factories/index.d.ts.map +0 -1
  205. package/src/eth/builtin/internal/factories/index.js +0 -10
  206. package/src/eth/builtin/internal/factories/index.js.map +0 -1
  207. package/src/eth/builtin/internal/index.d.ts +0 -14
  208. package/src/eth/builtin/internal/index.d.ts.map +0 -1
  209. package/src/eth/builtin/internal/index.js +0 -8
  210. package/src/eth/builtin/internal/index.js.map +0 -1
  211. package/src/eth/builtin/internal/weth9-processor.d.ts +0 -172
  212. package/src/eth/builtin/internal/weth9-processor.d.ts.map +0 -1
  213. package/src/eth/builtin/internal/weth9-processor.js +0 -729
  214. package/src/eth/builtin/internal/weth9-processor.js.map +0 -1
  215. package/src/eth/builtin/internal/weth9-test-utils.d.ts +0 -7
  216. package/src/eth/builtin/internal/weth9-test-utils.d.ts.map +0 -1
  217. package/src/eth/builtin/internal/weth9-test-utils.js +0 -55
  218. package/src/eth/builtin/internal/weth9-test-utils.js.map +0 -1
  219. package/src/eth/builtin/weth9.d.ts +0 -5
  220. package/src/eth/builtin/weth9.d.ts.map +0 -1
  221. package/src/eth/builtin/weth9.js +0 -8
  222. package/src/eth/builtin/weth9.js.map +0 -1
  223. package/src/solana/builtin/index.d.ts +0 -2
  224. package/src/solana/builtin/index.d.ts.map +0 -1
  225. package/src/solana/builtin/index.js +0 -2
  226. package/src/solana/builtin/index.js.map +0 -1
  227. package/src/solana/builtin/spl-token-processor.d.ts +0 -40
  228. package/src/solana/builtin/spl-token-processor.d.ts.map +0 -1
  229. package/src/solana/builtin/spl-token-processor.js +0 -254
  230. package/src/solana/builtin/spl-token-processor.js.map +0 -1
  231. package/src/solana/builtin/types.d.ts +0 -428
  232. package/src/solana/builtin/types.d.ts.map +0 -1
  233. package/src/solana/builtin/types.js +0 -201
  234. package/src/solana/builtin/types.js.map +0 -1
  235. package/src/sui/builtin/0x1.d.ts +0 -114
  236. package/src/sui/builtin/0x1.d.ts.map +0 -1
  237. package/src/sui/builtin/0x1.js +0 -159
  238. package/src/sui/builtin/0x1.js.map +0 -1
  239. package/src/sui/builtin/0x2.d.ts +0 -1250
  240. package/src/sui/builtin/0x2.d.ts.map +0 -1
  241. package/src/sui/builtin/0x2.js +0 -1511
  242. package/src/sui/builtin/0x2.js.map +0 -1
  243. package/src/sui/builtin/0x3.d.ts +0 -774
  244. package/src/sui/builtin/0x3.d.ts.map +0 -1
  245. package/src/sui/builtin/0x3.js +0 -720
  246. package/src/sui/builtin/0x3.js.map +0 -1
  247. package/src/sui/builtin/index.d.ts +0 -4
  248. package/src/sui/builtin/index.d.ts.map +0 -1
  249. package/src/sui/builtin/index.js +0 -7
  250. package/src/sui/builtin/index.js.map +0 -1
@@ -1,945 +0,0 @@
1
- import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import {
3
- Field,
4
- HashMD,
5
- aInRange,
6
- abool,
7
- bytesToHex2 as bytesToHex,
8
- bytesToNumberLE,
9
- concatBytes,
10
- ensureBytes,
11
- init_curve,
12
- init_md,
13
- init_modular,
14
- init_u64,
15
- init_utils,
16
- init_utils2,
17
- isNegativeLE,
18
- memoized,
19
- mod,
20
- numberToBytesLE,
21
- pippenger,
22
- pow2,
23
- randomBytes,
24
- u64_default,
25
- validateBasic,
26
- validateObject,
27
- wNAF,
28
- wrapConstructor
29
- } from "./chunk-2F2KNF4Z.js";
30
- import {
31
- __commonJS,
32
- __esm,
33
- __name,
34
- __toESM
35
- } from "./chunk-R7PMHHKJ.js";
36
-
37
- // ../../node_modules/.pnpm/@noble+hashes@1.5.0/node_modules/@noble/hashes/esm/sha512.js
38
- var SHA512_Kh, SHA512_Kl, SHA512_W_H, SHA512_W_L, SHA512, sha512;
39
- var init_sha512 = __esm({
40
- "../../node_modules/.pnpm/@noble+hashes@1.5.0/node_modules/@noble/hashes/esm/sha512.js"() {
41
- "use strict";
42
- init_md();
43
- init_u64();
44
- init_utils();
45
- [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64_default.split([
46
- "0x428a2f98d728ae22",
47
- "0x7137449123ef65cd",
48
- "0xb5c0fbcfec4d3b2f",
49
- "0xe9b5dba58189dbbc",
50
- "0x3956c25bf348b538",
51
- "0x59f111f1b605d019",
52
- "0x923f82a4af194f9b",
53
- "0xab1c5ed5da6d8118",
54
- "0xd807aa98a3030242",
55
- "0x12835b0145706fbe",
56
- "0x243185be4ee4b28c",
57
- "0x550c7dc3d5ffb4e2",
58
- "0x72be5d74f27b896f",
59
- "0x80deb1fe3b1696b1",
60
- "0x9bdc06a725c71235",
61
- "0xc19bf174cf692694",
62
- "0xe49b69c19ef14ad2",
63
- "0xefbe4786384f25e3",
64
- "0x0fc19dc68b8cd5b5",
65
- "0x240ca1cc77ac9c65",
66
- "0x2de92c6f592b0275",
67
- "0x4a7484aa6ea6e483",
68
- "0x5cb0a9dcbd41fbd4",
69
- "0x76f988da831153b5",
70
- "0x983e5152ee66dfab",
71
- "0xa831c66d2db43210",
72
- "0xb00327c898fb213f",
73
- "0xbf597fc7beef0ee4",
74
- "0xc6e00bf33da88fc2",
75
- "0xd5a79147930aa725",
76
- "0x06ca6351e003826f",
77
- "0x142929670a0e6e70",
78
- "0x27b70a8546d22ffc",
79
- "0x2e1b21385c26c926",
80
- "0x4d2c6dfc5ac42aed",
81
- "0x53380d139d95b3df",
82
- "0x650a73548baf63de",
83
- "0x766a0abb3c77b2a8",
84
- "0x81c2c92e47edaee6",
85
- "0x92722c851482353b",
86
- "0xa2bfe8a14cf10364",
87
- "0xa81a664bbc423001",
88
- "0xc24b8b70d0f89791",
89
- "0xc76c51a30654be30",
90
- "0xd192e819d6ef5218",
91
- "0xd69906245565a910",
92
- "0xf40e35855771202a",
93
- "0x106aa07032bbd1b8",
94
- "0x19a4c116b8d2d0c8",
95
- "0x1e376c085141ab53",
96
- "0x2748774cdf8eeb99",
97
- "0x34b0bcb5e19b48a8",
98
- "0x391c0cb3c5c95a63",
99
- "0x4ed8aa4ae3418acb",
100
- "0x5b9cca4f7763e373",
101
- "0x682e6ff3d6b2b8a3",
102
- "0x748f82ee5defb2fc",
103
- "0x78a5636f43172f60",
104
- "0x84c87814a1f0ab72",
105
- "0x8cc702081a6439ec",
106
- "0x90befffa23631e28",
107
- "0xa4506cebde82bde9",
108
- "0xbef9a3f7b2c67915",
109
- "0xc67178f2e372532b",
110
- "0xca273eceea26619c",
111
- "0xd186b8c721c0c207",
112
- "0xeada7dd6cde0eb1e",
113
- "0xf57d4f7fee6ed178",
114
- "0x06f067aa72176fba",
115
- "0x0a637dc5a2c898a6",
116
- "0x113f9804bef90dae",
117
- "0x1b710b35131c471b",
118
- "0x28db77f523047d84",
119
- "0x32caab7b40c72493",
120
- "0x3c9ebe0a15c9bebc",
121
- "0x431d67c49c100d4c",
122
- "0x4cc5d4becb3e42b6",
123
- "0x597f299cfc657e2a",
124
- "0x5fcb6fab3ad6faec",
125
- "0x6c44198c4a475817"
126
- ].map((n) => BigInt(n))))();
127
- SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);
128
- SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);
129
- SHA512 = class extends HashMD {
130
- static {
131
- __name(this, "SHA512");
132
- }
133
- constructor() {
134
- super(128, 64, 16, false);
135
- this.Ah = 1779033703 | 0;
136
- this.Al = 4089235720 | 0;
137
- this.Bh = 3144134277 | 0;
138
- this.Bl = 2227873595 | 0;
139
- this.Ch = 1013904242 | 0;
140
- this.Cl = 4271175723 | 0;
141
- this.Dh = 2773480762 | 0;
142
- this.Dl = 1595750129 | 0;
143
- this.Eh = 1359893119 | 0;
144
- this.El = 2917565137 | 0;
145
- this.Fh = 2600822924 | 0;
146
- this.Fl = 725511199 | 0;
147
- this.Gh = 528734635 | 0;
148
- this.Gl = 4215389547 | 0;
149
- this.Hh = 1541459225 | 0;
150
- this.Hl = 327033209 | 0;
151
- }
152
- // prettier-ignore
153
- get() {
154
- const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
155
- return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];
156
- }
157
- // prettier-ignore
158
- set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {
159
- this.Ah = Ah | 0;
160
- this.Al = Al | 0;
161
- this.Bh = Bh | 0;
162
- this.Bl = Bl | 0;
163
- this.Ch = Ch | 0;
164
- this.Cl = Cl | 0;
165
- this.Dh = Dh | 0;
166
- this.Dl = Dl | 0;
167
- this.Eh = Eh | 0;
168
- this.El = El | 0;
169
- this.Fh = Fh | 0;
170
- this.Fl = Fl | 0;
171
- this.Gh = Gh | 0;
172
- this.Gl = Gl | 0;
173
- this.Hh = Hh | 0;
174
- this.Hl = Hl | 0;
175
- }
176
- process(view, offset) {
177
- for (let i = 0; i < 16; i++, offset += 4) {
178
- SHA512_W_H[i] = view.getUint32(offset);
179
- SHA512_W_L[i] = view.getUint32(offset += 4);
180
- }
181
- for (let i = 16; i < 80; i++) {
182
- const W15h = SHA512_W_H[i - 15] | 0;
183
- const W15l = SHA512_W_L[i - 15] | 0;
184
- const s0h = u64_default.rotrSH(W15h, W15l, 1) ^ u64_default.rotrSH(W15h, W15l, 8) ^ u64_default.shrSH(W15h, W15l, 7);
185
- const s0l = u64_default.rotrSL(W15h, W15l, 1) ^ u64_default.rotrSL(W15h, W15l, 8) ^ u64_default.shrSL(W15h, W15l, 7);
186
- const W2h = SHA512_W_H[i - 2] | 0;
187
- const W2l = SHA512_W_L[i - 2] | 0;
188
- const s1h = u64_default.rotrSH(W2h, W2l, 19) ^ u64_default.rotrBH(W2h, W2l, 61) ^ u64_default.shrSH(W2h, W2l, 6);
189
- const s1l = u64_default.rotrSL(W2h, W2l, 19) ^ u64_default.rotrBL(W2h, W2l, 61) ^ u64_default.shrSL(W2h, W2l, 6);
190
- const SUMl = u64_default.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
191
- const SUMh = u64_default.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
192
- SHA512_W_H[i] = SUMh | 0;
193
- SHA512_W_L[i] = SUMl | 0;
194
- }
195
- let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
196
- for (let i = 0; i < 80; i++) {
197
- const sigma1h = u64_default.rotrSH(Eh, El, 14) ^ u64_default.rotrSH(Eh, El, 18) ^ u64_default.rotrBH(Eh, El, 41);
198
- const sigma1l = u64_default.rotrSL(Eh, El, 14) ^ u64_default.rotrSL(Eh, El, 18) ^ u64_default.rotrBL(Eh, El, 41);
199
- const CHIh = Eh & Fh ^ ~Eh & Gh;
200
- const CHIl = El & Fl ^ ~El & Gl;
201
- const T1ll = u64_default.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
202
- const T1h = u64_default.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
203
- const T1l = T1ll | 0;
204
- const sigma0h = u64_default.rotrSH(Ah, Al, 28) ^ u64_default.rotrBH(Ah, Al, 34) ^ u64_default.rotrBH(Ah, Al, 39);
205
- const sigma0l = u64_default.rotrSL(Ah, Al, 28) ^ u64_default.rotrBL(Ah, Al, 34) ^ u64_default.rotrBL(Ah, Al, 39);
206
- const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch;
207
- const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl;
208
- Hh = Gh | 0;
209
- Hl = Gl | 0;
210
- Gh = Fh | 0;
211
- Gl = Fl | 0;
212
- Fh = Eh | 0;
213
- Fl = El | 0;
214
- ({ h: Eh, l: El } = u64_default.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
215
- Dh = Ch | 0;
216
- Dl = Cl | 0;
217
- Ch = Bh | 0;
218
- Cl = Bl | 0;
219
- Bh = Ah | 0;
220
- Bl = Al | 0;
221
- const All = u64_default.add3L(T1l, sigma0l, MAJl);
222
- Ah = u64_default.add3H(All, T1h, sigma0h, MAJh);
223
- Al = All | 0;
224
- }
225
- ({ h: Ah, l: Al } = u64_default.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
226
- ({ h: Bh, l: Bl } = u64_default.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
227
- ({ h: Ch, l: Cl } = u64_default.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
228
- ({ h: Dh, l: Dl } = u64_default.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
229
- ({ h: Eh, l: El } = u64_default.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
230
- ({ h: Fh, l: Fl } = u64_default.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
231
- ({ h: Gh, l: Gl } = u64_default.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
232
- ({ h: Hh, l: Hl } = u64_default.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
233
- this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);
234
- }
235
- roundClean() {
236
- SHA512_W_H.fill(0);
237
- SHA512_W_L.fill(0);
238
- }
239
- destroy() {
240
- this.buffer.fill(0);
241
- this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
242
- }
243
- };
244
- sha512 = /* @__PURE__ */ wrapConstructor(() => new SHA512());
245
- }
246
- });
247
-
248
- // ../../node_modules/.pnpm/@noble+curves@1.6.0/node_modules/@noble/curves/esm/abstract/edwards.js
249
- function validateOpts(curve) {
250
- const opts = validateBasic(curve);
251
- validateObject(curve, {
252
- hash: "function",
253
- a: "bigint",
254
- d: "bigint",
255
- randomBytes: "function"
256
- }, {
257
- adjustScalarBytes: "function",
258
- domain: "function",
259
- uvRatio: "function",
260
- mapToCurve: "function"
261
- });
262
- return Object.freeze({ ...opts });
263
- }
264
- function twistedEdwards(curveDef) {
265
- const CURVE = validateOpts(curveDef);
266
- const { Fp: Fp2, n: CURVE_ORDER, prehash, hash: cHash, randomBytes: randomBytes2, nByteLength, h: cofactor } = CURVE;
267
- const MASK = _2n << BigInt(nByteLength * 8) - _1n;
268
- const modP = Fp2.create;
269
- const Fn = Field(CURVE.n, CURVE.nBitLength);
270
- const uvRatio2 = CURVE.uvRatio || ((u, v) => {
271
- try {
272
- return { isValid: true, value: Fp2.sqrt(u * Fp2.inv(v)) };
273
- } catch (e) {
274
- return { isValid: false, value: _0n };
275
- }
276
- });
277
- const adjustScalarBytes2 = CURVE.adjustScalarBytes || ((bytes) => bytes);
278
- const domain = CURVE.domain || ((data, ctx, phflag) => {
279
- abool("phflag", phflag);
280
- if (ctx.length || phflag)
281
- throw new Error("Contexts/pre-hash are not supported");
282
- return data;
283
- });
284
- function aCoordinate(title, n) {
285
- aInRange("coordinate " + title, n, _0n, MASK);
286
- }
287
- __name(aCoordinate, "aCoordinate");
288
- function assertPoint(other) {
289
- if (!(other instanceof Point))
290
- throw new Error("ExtendedPoint expected");
291
- }
292
- __name(assertPoint, "assertPoint");
293
- const toAffineMemo = memoized((p, iz) => {
294
- const { ex: x, ey: y, ez: z } = p;
295
- const is0 = p.is0();
296
- if (iz == null)
297
- iz = is0 ? _8n : Fp2.inv(z);
298
- const ax = modP(x * iz);
299
- const ay = modP(y * iz);
300
- const zz = modP(z * iz);
301
- if (is0)
302
- return { x: _0n, y: _1n };
303
- if (zz !== _1n)
304
- throw new Error("invZ was invalid");
305
- return { x: ax, y: ay };
306
- });
307
- const assertValidMemo = memoized((p) => {
308
- const { a, d } = CURVE;
309
- if (p.is0())
310
- throw new Error("bad point: ZERO");
311
- const { ex: X, ey: Y, ez: Z, et: T } = p;
312
- const X2 = modP(X * X);
313
- const Y2 = modP(Y * Y);
314
- const Z2 = modP(Z * Z);
315
- const Z4 = modP(Z2 * Z2);
316
- const aX2 = modP(X2 * a);
317
- const left = modP(Z2 * modP(aX2 + Y2));
318
- const right = modP(Z4 + modP(d * modP(X2 * Y2)));
319
- if (left !== right)
320
- throw new Error("bad point: equation left != right (1)");
321
- const XY = modP(X * Y);
322
- const ZT = modP(Z * T);
323
- if (XY !== ZT)
324
- throw new Error("bad point: equation left != right (2)");
325
- return true;
326
- });
327
- class Point {
328
- static {
329
- __name(this, "Point");
330
- }
331
- constructor(ex, ey, ez, et) {
332
- this.ex = ex;
333
- this.ey = ey;
334
- this.ez = ez;
335
- this.et = et;
336
- aCoordinate("x", ex);
337
- aCoordinate("y", ey);
338
- aCoordinate("z", ez);
339
- aCoordinate("t", et);
340
- Object.freeze(this);
341
- }
342
- get x() {
343
- return this.toAffine().x;
344
- }
345
- get y() {
346
- return this.toAffine().y;
347
- }
348
- static fromAffine(p) {
349
- if (p instanceof Point)
350
- throw new Error("extended point not allowed");
351
- const { x, y } = p || {};
352
- aCoordinate("x", x);
353
- aCoordinate("y", y);
354
- return new Point(x, y, _1n, modP(x * y));
355
- }
356
- static normalizeZ(points) {
357
- const toInv = Fp2.invertBatch(points.map((p) => p.ez));
358
- return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);
359
- }
360
- // Multiscalar Multiplication
361
- static msm(points, scalars) {
362
- return pippenger(Point, Fn, points, scalars);
363
- }
364
- // "Private method", don't use it directly
365
- _setWindowSize(windowSize) {
366
- wnaf.setWindowSize(this, windowSize);
367
- }
368
- // Not required for fromHex(), which always creates valid points.
369
- // Could be useful for fromAffine().
370
- assertValidity() {
371
- assertValidMemo(this);
372
- }
373
- // Compare one point to another.
374
- equals(other) {
375
- assertPoint(other);
376
- const { ex: X1, ey: Y1, ez: Z1 } = this;
377
- const { ex: X2, ey: Y2, ez: Z2 } = other;
378
- const X1Z2 = modP(X1 * Z2);
379
- const X2Z1 = modP(X2 * Z1);
380
- const Y1Z2 = modP(Y1 * Z2);
381
- const Y2Z1 = modP(Y2 * Z1);
382
- return X1Z2 === X2Z1 && Y1Z2 === Y2Z1;
383
- }
384
- is0() {
385
- return this.equals(Point.ZERO);
386
- }
387
- negate() {
388
- return new Point(modP(-this.ex), this.ey, this.ez, modP(-this.et));
389
- }
390
- // Fast algo for doubling Extended Point.
391
- // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd
392
- // Cost: 4M + 4S + 1*a + 6add + 1*2.
393
- double() {
394
- const { a } = CURVE;
395
- const { ex: X1, ey: Y1, ez: Z1 } = this;
396
- const A = modP(X1 * X1);
397
- const B = modP(Y1 * Y1);
398
- const C = modP(_2n * modP(Z1 * Z1));
399
- const D = modP(a * A);
400
- const x1y1 = X1 + Y1;
401
- const E = modP(modP(x1y1 * x1y1) - A - B);
402
- const G2 = D + B;
403
- const F = G2 - C;
404
- const H = D - B;
405
- const X3 = modP(E * F);
406
- const Y3 = modP(G2 * H);
407
- const T3 = modP(E * H);
408
- const Z3 = modP(F * G2);
409
- return new Point(X3, Y3, Z3, T3);
410
- }
411
- // Fast algo for adding 2 Extended Points.
412
- // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd
413
- // Cost: 9M + 1*a + 1*d + 7add.
414
- add(other) {
415
- assertPoint(other);
416
- const { a, d } = CURVE;
417
- const { ex: X1, ey: Y1, ez: Z1, et: T1 } = this;
418
- const { ex: X2, ey: Y2, ez: Z2, et: T2 } = other;
419
- if (a === BigInt(-1)) {
420
- const A2 = modP((Y1 - X1) * (Y2 + X2));
421
- const B2 = modP((Y1 + X1) * (Y2 - X2));
422
- const F2 = modP(B2 - A2);
423
- if (F2 === _0n)
424
- return this.double();
425
- const C2 = modP(Z1 * _2n * T2);
426
- const D2 = modP(T1 * _2n * Z2);
427
- const E2 = D2 + C2;
428
- const G3 = B2 + A2;
429
- const H2 = D2 - C2;
430
- const X32 = modP(E2 * F2);
431
- const Y32 = modP(G3 * H2);
432
- const T32 = modP(E2 * H2);
433
- const Z32 = modP(F2 * G3);
434
- return new Point(X32, Y32, Z32, T32);
435
- }
436
- const A = modP(X1 * X2);
437
- const B = modP(Y1 * Y2);
438
- const C = modP(T1 * d * T2);
439
- const D = modP(Z1 * Z2);
440
- const E = modP((X1 + Y1) * (X2 + Y2) - A - B);
441
- const F = D - C;
442
- const G2 = D + C;
443
- const H = modP(B - a * A);
444
- const X3 = modP(E * F);
445
- const Y3 = modP(G2 * H);
446
- const T3 = modP(E * H);
447
- const Z3 = modP(F * G2);
448
- return new Point(X3, Y3, Z3, T3);
449
- }
450
- subtract(other) {
451
- return this.add(other.negate());
452
- }
453
- wNAF(n) {
454
- return wnaf.wNAFCached(this, n, Point.normalizeZ);
455
- }
456
- // Constant-time multiplication.
457
- multiply(scalar) {
458
- const n = scalar;
459
- aInRange("scalar", n, _1n, CURVE_ORDER);
460
- const { p, f } = this.wNAF(n);
461
- return Point.normalizeZ([p, f])[0];
462
- }
463
- // Non-constant-time multiplication. Uses double-and-add algorithm.
464
- // It's faster, but should only be used when you don't care about
465
- // an exposed private key e.g. sig verification.
466
- // Does NOT allow scalars higher than CURVE.n.
467
- multiplyUnsafe(scalar) {
468
- const n = scalar;
469
- aInRange("scalar", n, _0n, CURVE_ORDER);
470
- if (n === _0n)
471
- return I;
472
- if (this.equals(I) || n === _1n)
473
- return this;
474
- if (this.equals(G))
475
- return this.wNAF(n).p;
476
- return wnaf.unsafeLadder(this, n);
477
- }
478
- // Checks if point is of small order.
479
- // If you add something to small order point, you will have "dirty"
480
- // point with torsion component.
481
- // Multiplies point by cofactor and checks if the result is 0.
482
- isSmallOrder() {
483
- return this.multiplyUnsafe(cofactor).is0();
484
- }
485
- // Multiplies point by curve order and checks if the result is 0.
486
- // Returns `false` is the point is dirty.
487
- isTorsionFree() {
488
- return wnaf.unsafeLadder(this, CURVE_ORDER).is0();
489
- }
490
- // Converts Extended point to default (x, y) coordinates.
491
- // Can accept precomputed Z^-1 - for example, from invertBatch.
492
- toAffine(iz) {
493
- return toAffineMemo(this, iz);
494
- }
495
- clearCofactor() {
496
- const { h: cofactor2 } = CURVE;
497
- if (cofactor2 === _1n)
498
- return this;
499
- return this.multiplyUnsafe(cofactor2);
500
- }
501
- // Converts hash string or Uint8Array to Point.
502
- // Uses algo from RFC8032 5.1.3.
503
- static fromHex(hex, zip215 = false) {
504
- const { d, a } = CURVE;
505
- const len = Fp2.BYTES;
506
- hex = ensureBytes("pointHex", hex, len);
507
- abool("zip215", zip215);
508
- const normed = hex.slice();
509
- const lastByte = hex[len - 1];
510
- normed[len - 1] = lastByte & ~128;
511
- const y = bytesToNumberLE(normed);
512
- const max = zip215 ? MASK : Fp2.ORDER;
513
- aInRange("pointHex.y", y, _0n, max);
514
- const y2 = modP(y * y);
515
- const u = modP(y2 - _1n);
516
- const v = modP(d * y2 - a);
517
- let { isValid, value: x } = uvRatio2(u, v);
518
- if (!isValid)
519
- throw new Error("Point.fromHex: invalid y coordinate");
520
- const isXOdd = (x & _1n) === _1n;
521
- const isLastByteOdd = (lastByte & 128) !== 0;
522
- if (!zip215 && x === _0n && isLastByteOdd)
523
- throw new Error("Point.fromHex: x=0 and x_0=1");
524
- if (isLastByteOdd !== isXOdd)
525
- x = modP(-x);
526
- return Point.fromAffine({ x, y });
527
- }
528
- static fromPrivateKey(privKey) {
529
- return getExtendedPublicKey(privKey).point;
530
- }
531
- toRawBytes() {
532
- const { x, y } = this.toAffine();
533
- const bytes = numberToBytesLE(y, Fp2.BYTES);
534
- bytes[bytes.length - 1] |= x & _1n ? 128 : 0;
535
- return bytes;
536
- }
537
- toHex() {
538
- return bytesToHex(this.toRawBytes());
539
- }
540
- }
541
- Point.BASE = new Point(CURVE.Gx, CURVE.Gy, _1n, modP(CURVE.Gx * CURVE.Gy));
542
- Point.ZERO = new Point(_0n, _1n, _1n, _0n);
543
- const { BASE: G, ZERO: I } = Point;
544
- const wnaf = wNAF(Point, nByteLength * 8);
545
- function modN(a) {
546
- return mod(a, CURVE_ORDER);
547
- }
548
- __name(modN, "modN");
549
- function modN_LE(hash) {
550
- return modN(bytesToNumberLE(hash));
551
- }
552
- __name(modN_LE, "modN_LE");
553
- function getExtendedPublicKey(key) {
554
- const len = nByteLength;
555
- key = ensureBytes("private key", key, len);
556
- const hashed = ensureBytes("hashed private key", cHash(key), 2 * len);
557
- const head = adjustScalarBytes2(hashed.slice(0, len));
558
- const prefix = hashed.slice(len, 2 * len);
559
- const scalar = modN_LE(head);
560
- const point = G.multiply(scalar);
561
- const pointBytes = point.toRawBytes();
562
- return { head, prefix, scalar, point, pointBytes };
563
- }
564
- __name(getExtendedPublicKey, "getExtendedPublicKey");
565
- function getPublicKey(privKey) {
566
- return getExtendedPublicKey(privKey).pointBytes;
567
- }
568
- __name(getPublicKey, "getPublicKey");
569
- function hashDomainToScalar(context = new Uint8Array(), ...msgs) {
570
- const msg = concatBytes(...msgs);
571
- return modN_LE(cHash(domain(msg, ensureBytes("context", context), !!prehash)));
572
- }
573
- __name(hashDomainToScalar, "hashDomainToScalar");
574
- function sign(msg, privKey, options = {}) {
575
- msg = ensureBytes("message", msg);
576
- if (prehash)
577
- msg = prehash(msg);
578
- const { prefix, scalar, pointBytes } = getExtendedPublicKey(privKey);
579
- const r = hashDomainToScalar(options.context, prefix, msg);
580
- const R = G.multiply(r).toRawBytes();
581
- const k = hashDomainToScalar(options.context, R, pointBytes, msg);
582
- const s = modN(r + k * scalar);
583
- aInRange("signature.s", s, _0n, CURVE_ORDER);
584
- const res = concatBytes(R, numberToBytesLE(s, Fp2.BYTES));
585
- return ensureBytes("result", res, nByteLength * 2);
586
- }
587
- __name(sign, "sign");
588
- const verifyOpts = VERIFY_DEFAULT;
589
- function verify(sig, msg, publicKey, options = verifyOpts) {
590
- const { context, zip215 } = options;
591
- const len = Fp2.BYTES;
592
- sig = ensureBytes("signature", sig, 2 * len);
593
- msg = ensureBytes("message", msg);
594
- if (zip215 !== void 0)
595
- abool("zip215", zip215);
596
- if (prehash)
597
- msg = prehash(msg);
598
- const s = bytesToNumberLE(sig.slice(len, 2 * len));
599
- let A, R, SB;
600
- try {
601
- A = Point.fromHex(publicKey, zip215);
602
- R = Point.fromHex(sig.slice(0, len), zip215);
603
- SB = G.multiplyUnsafe(s);
604
- } catch (error) {
605
- return false;
606
- }
607
- if (!zip215 && A.isSmallOrder())
608
- return false;
609
- const k = hashDomainToScalar(context, R.toRawBytes(), A.toRawBytes(), msg);
610
- const RkA = R.add(A.multiplyUnsafe(k));
611
- return RkA.subtract(SB).clearCofactor().equals(Point.ZERO);
612
- }
613
- __name(verify, "verify");
614
- G._setWindowSize(8);
615
- const utils = {
616
- getExtendedPublicKey,
617
- // ed25519 private keys are uniform 32b. No need to check for modulo bias, like in secp256k1.
618
- randomPrivateKey: /* @__PURE__ */ __name(() => randomBytes2(Fp2.BYTES), "randomPrivateKey"),
619
- /**
620
- * We're doing scalar multiplication (used in getPublicKey etc) with precomputed BASE_POINT
621
- * values. This slows down first getPublicKey() by milliseconds (see Speed section),
622
- * but allows to speed-up subsequent getPublicKey() calls up to 20x.
623
- * @param windowSize 2, 4, 8, 16
624
- */
625
- precompute(windowSize = 8, point = Point.BASE) {
626
- point._setWindowSize(windowSize);
627
- point.multiply(BigInt(3));
628
- return point;
629
- }
630
- };
631
- return {
632
- CURVE,
633
- getPublicKey,
634
- sign,
635
- verify,
636
- ExtendedPoint: Point,
637
- utils
638
- };
639
- }
640
- var _0n, _1n, _2n, _8n, VERIFY_DEFAULT;
641
- var init_edwards = __esm({
642
- "../../node_modules/.pnpm/@noble+curves@1.6.0/node_modules/@noble/curves/esm/abstract/edwards.js"() {
643
- "use strict";
644
- init_curve();
645
- init_modular();
646
- init_utils2();
647
- init_utils2();
648
- _0n = BigInt(0);
649
- _1n = BigInt(1);
650
- _2n = BigInt(2);
651
- _8n = BigInt(8);
652
- VERIFY_DEFAULT = { zip215: true };
653
- __name(validateOpts, "validateOpts");
654
- __name(twistedEdwards, "twistedEdwards");
655
- }
656
- });
657
-
658
- // ../../node_modules/.pnpm/@noble+curves@1.6.0/node_modules/@noble/curves/esm/ed25519.js
659
- function ed25519_pow_2_252_3(x) {
660
- const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80);
661
- const P = ED25519_P;
662
- const x2 = x * x % P;
663
- const b2 = x2 * x % P;
664
- const b4 = pow2(b2, _2n2, P) * b2 % P;
665
- const b5 = pow2(b4, _1n2, P) * x % P;
666
- const b10 = pow2(b5, _5n, P) * b5 % P;
667
- const b20 = pow2(b10, _10n, P) * b10 % P;
668
- const b40 = pow2(b20, _20n, P) * b20 % P;
669
- const b80 = pow2(b40, _40n, P) * b40 % P;
670
- const b160 = pow2(b80, _80n, P) * b80 % P;
671
- const b240 = pow2(b160, _80n, P) * b80 % P;
672
- const b250 = pow2(b240, _10n, P) * b10 % P;
673
- const pow_p_5_8 = pow2(b250, _2n2, P) * x % P;
674
- return { pow_p_5_8, b2 };
675
- }
676
- function adjustScalarBytes(bytes) {
677
- bytes[0] &= 248;
678
- bytes[31] &= 127;
679
- bytes[31] |= 64;
680
- return bytes;
681
- }
682
- function uvRatio(u, v) {
683
- const P = ED25519_P;
684
- const v3 = mod(v * v * v, P);
685
- const v7 = mod(v3 * v3 * v, P);
686
- const pow = ed25519_pow_2_252_3(u * v7).pow_p_5_8;
687
- let x = mod(u * v3 * pow, P);
688
- const vx2 = mod(v * x * x, P);
689
- const root1 = x;
690
- const root2 = mod(x * ED25519_SQRT_M1, P);
691
- const useRoot1 = vx2 === u;
692
- const useRoot2 = vx2 === mod(-u, P);
693
- const noRoot = vx2 === mod(-u * ED25519_SQRT_M1, P);
694
- if (useRoot1)
695
- x = root1;
696
- if (useRoot2 || noRoot)
697
- x = root2;
698
- if (isNegativeLE(x, P))
699
- x = mod(-x, P);
700
- return { isValid: useRoot1 || useRoot2, value: x };
701
- }
702
- var ED25519_P, ED25519_SQRT_M1, _0n2, _1n2, _2n2, _3n, _5n, _8n2, Fp, ed25519Defaults, ed25519;
703
- var init_ed25519 = __esm({
704
- "../../node_modules/.pnpm/@noble+curves@1.6.0/node_modules/@noble/curves/esm/ed25519.js"() {
705
- "use strict";
706
- init_sha512();
707
- init_utils();
708
- init_edwards();
709
- init_modular();
710
- ED25519_P = BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949");
711
- ED25519_SQRT_M1 = /* @__PURE__ */ BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");
712
- _0n2 = BigInt(0);
713
- _1n2 = BigInt(1);
714
- _2n2 = BigInt(2);
715
- _3n = BigInt(3);
716
- _5n = BigInt(5);
717
- _8n2 = BigInt(8);
718
- __name(ed25519_pow_2_252_3, "ed25519_pow_2_252_3");
719
- __name(adjustScalarBytes, "adjustScalarBytes");
720
- __name(uvRatio, "uvRatio");
721
- Fp = /* @__PURE__ */ (() => Field(ED25519_P, void 0, true))();
722
- ed25519Defaults = /* @__PURE__ */ (() => ({
723
- // Param: a
724
- a: BigInt(-1),
725
- // Fp.create(-1) is proper; our way still works and is faster
726
- // d is equal to -121665/121666 over finite field.
727
- // Negative number is P - number, and division is invert(number, P)
728
- d: BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),
729
- // Finite field 𝔽p over which we'll do calculations; 2n**255n - 19n
730
- Fp,
731
- // Subgroup order: how many points curve has
732
- // 2n**252n + 27742317777372353535851937790883648493n;
733
- n: BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),
734
- // Cofactor
735
- h: _8n2,
736
- // Base point (x, y) aka generator point
737
- Gx: BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),
738
- Gy: BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),
739
- hash: sha512,
740
- randomBytes,
741
- adjustScalarBytes,
742
- // dom2
743
- // Ratio of u to v. Allows us to combine inversion and square root. Uses algo from RFC8032 5.1.3.
744
- // Constant-time, u/√v
745
- uvRatio
746
- }))();
747
- ed25519 = /* @__PURE__ */ (() => twistedEdwards(ed25519Defaults))();
748
- }
749
- });
750
-
751
- // ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js
752
- var require_eventemitter3 = __commonJS({
753
- "../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js"(exports, module) {
754
- "use strict";
755
- var has = Object.prototype.hasOwnProperty;
756
- var prefix = "~";
757
- function Events() {
758
- }
759
- __name(Events, "Events");
760
- if (Object.create) {
761
- Events.prototype = /* @__PURE__ */ Object.create(null);
762
- if (!new Events().__proto__) prefix = false;
763
- }
764
- function EE(fn, context, once) {
765
- this.fn = fn;
766
- this.context = context;
767
- this.once = once || false;
768
- }
769
- __name(EE, "EE");
770
- function addListener(emitter, event, fn, context, once) {
771
- if (typeof fn !== "function") {
772
- throw new TypeError("The listener must be a function");
773
- }
774
- var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
775
- if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
776
- else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
777
- else emitter._events[evt] = [emitter._events[evt], listener];
778
- return emitter;
779
- }
780
- __name(addListener, "addListener");
781
- function clearEvent(emitter, evt) {
782
- if (--emitter._eventsCount === 0) emitter._events = new Events();
783
- else delete emitter._events[evt];
784
- }
785
- __name(clearEvent, "clearEvent");
786
- function EventEmitter2() {
787
- this._events = new Events();
788
- this._eventsCount = 0;
789
- }
790
- __name(EventEmitter2, "EventEmitter");
791
- EventEmitter2.prototype.eventNames = /* @__PURE__ */ __name(function eventNames() {
792
- var names = [], events, name;
793
- if (this._eventsCount === 0) return names;
794
- for (name in events = this._events) {
795
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
796
- }
797
- if (Object.getOwnPropertySymbols) {
798
- return names.concat(Object.getOwnPropertySymbols(events));
799
- }
800
- return names;
801
- }, "eventNames");
802
- EventEmitter2.prototype.listeners = /* @__PURE__ */ __name(function listeners(event) {
803
- var evt = prefix ? prefix + event : event, handlers = this._events[evt];
804
- if (!handlers) return [];
805
- if (handlers.fn) return [handlers.fn];
806
- for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
807
- ee[i] = handlers[i].fn;
808
- }
809
- return ee;
810
- }, "listeners");
811
- EventEmitter2.prototype.listenerCount = /* @__PURE__ */ __name(function listenerCount(event) {
812
- var evt = prefix ? prefix + event : event, listeners = this._events[evt];
813
- if (!listeners) return 0;
814
- if (listeners.fn) return 1;
815
- return listeners.length;
816
- }, "listenerCount");
817
- EventEmitter2.prototype.emit = /* @__PURE__ */ __name(function emit(event, a1, a2, a3, a4, a5) {
818
- var evt = prefix ? prefix + event : event;
819
- if (!this._events[evt]) return false;
820
- var listeners = this._events[evt], len = arguments.length, args, i;
821
- if (listeners.fn) {
822
- if (listeners.once) this.removeListener(event, listeners.fn, void 0, true);
823
- switch (len) {
824
- case 1:
825
- return listeners.fn.call(listeners.context), true;
826
- case 2:
827
- return listeners.fn.call(listeners.context, a1), true;
828
- case 3:
829
- return listeners.fn.call(listeners.context, a1, a2), true;
830
- case 4:
831
- return listeners.fn.call(listeners.context, a1, a2, a3), true;
832
- case 5:
833
- return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
834
- case 6:
835
- return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
836
- }
837
- for (i = 1, args = new Array(len - 1); i < len; i++) {
838
- args[i - 1] = arguments[i];
839
- }
840
- listeners.fn.apply(listeners.context, args);
841
- } else {
842
- var length = listeners.length, j;
843
- for (i = 0; i < length; i++) {
844
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, void 0, true);
845
- switch (len) {
846
- case 1:
847
- listeners[i].fn.call(listeners[i].context);
848
- break;
849
- case 2:
850
- listeners[i].fn.call(listeners[i].context, a1);
851
- break;
852
- case 3:
853
- listeners[i].fn.call(listeners[i].context, a1, a2);
854
- break;
855
- case 4:
856
- listeners[i].fn.call(listeners[i].context, a1, a2, a3);
857
- break;
858
- default:
859
- if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
860
- args[j - 1] = arguments[j];
861
- }
862
- listeners[i].fn.apply(listeners[i].context, args);
863
- }
864
- }
865
- }
866
- return true;
867
- }, "emit");
868
- EventEmitter2.prototype.on = /* @__PURE__ */ __name(function on(event, fn, context) {
869
- return addListener(this, event, fn, context, false);
870
- }, "on");
871
- EventEmitter2.prototype.once = /* @__PURE__ */ __name(function once(event, fn, context) {
872
- return addListener(this, event, fn, context, true);
873
- }, "once");
874
- EventEmitter2.prototype.removeListener = /* @__PURE__ */ __name(function removeListener(event, fn, context, once) {
875
- var evt = prefix ? prefix + event : event;
876
- if (!this._events[evt]) return this;
877
- if (!fn) {
878
- clearEvent(this, evt);
879
- return this;
880
- }
881
- var listeners = this._events[evt];
882
- if (listeners.fn) {
883
- if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
884
- clearEvent(this, evt);
885
- }
886
- } else {
887
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
888
- if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
889
- events.push(listeners[i]);
890
- }
891
- }
892
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
893
- else clearEvent(this, evt);
894
- }
895
- return this;
896
- }, "removeListener");
897
- EventEmitter2.prototype.removeAllListeners = /* @__PURE__ */ __name(function removeAllListeners(event) {
898
- var evt;
899
- if (event) {
900
- evt = prefix ? prefix + event : event;
901
- if (this._events[evt]) clearEvent(this, evt);
902
- } else {
903
- this._events = new Events();
904
- this._eventsCount = 0;
905
- }
906
- return this;
907
- }, "removeAllListeners");
908
- EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener;
909
- EventEmitter2.prototype.addListener = EventEmitter2.prototype.on;
910
- EventEmitter2.prefixed = prefix;
911
- EventEmitter2.EventEmitter = EventEmitter2;
912
- if ("undefined" !== typeof module) {
913
- module.exports = EventEmitter2;
914
- }
915
- }
916
- });
917
-
918
- // ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
919
- var import_index, eventemitter3_default;
920
- var init_eventemitter3 = __esm({
921
- "../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs"() {
922
- "use strict";
923
- import_index = __toESM(require_eventemitter3(), 1);
924
- eventemitter3_default = import_index.default;
925
- }
926
- });
927
-
928
- export {
929
- sha512,
930
- init_sha512,
931
- ed25519,
932
- init_ed25519,
933
- import_index,
934
- eventemitter3_default,
935
- init_eventemitter3
936
- };
937
- /*! Bundled license information:
938
-
939
- @noble/curves/esm/abstract/edwards.js:
940
- (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
941
-
942
- @noble/curves/esm/ed25519.js:
943
- (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
944
- */
945
- //# sourceMappingURL=chunk-UIBPOKNT.js.map