@bonfida/spl-name-service 3.0.13 → 3.0.15

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 (1594) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/dist/cjs/_virtual/_commonjsHelpers.js +2 -0
  4. package/dist/cjs/_virtual/_commonjsHelpers.js.map +1 -0
  5. package/dist/cjs/_virtual/base64.js +2 -0
  6. package/dist/cjs/_virtual/base64.js.map +1 -0
  7. package/dist/cjs/_virtual/index.js +2 -0
  8. package/dist/cjs/_virtual/index.js.map +1 -0
  9. package/dist/cjs/_virtual/index2.js +2 -0
  10. package/dist/cjs/_virtual/index2.js.map +1 -0
  11. package/dist/cjs/_virtual/index3.js +2 -0
  12. package/dist/cjs/_virtual/index3.js.map +1 -0
  13. package/dist/cjs/_virtual/ipaddr.js +2 -0
  14. package/dist/cjs/_virtual/ipaddr.js.map +1 -0
  15. package/dist/{types → cjs}/bindings/burnDomain.d.ts +0 -0
  16. package/dist/cjs/bindings/burnDomain.js +2 -0
  17. package/dist/cjs/bindings/burnDomain.js.map +1 -0
  18. package/dist/{types → cjs}/bindings/createNameRegistry.d.ts +0 -0
  19. package/dist/cjs/bindings/createNameRegistry.js +2 -0
  20. package/dist/cjs/bindings/createNameRegistry.js.map +1 -0
  21. package/dist/{types → cjs}/bindings/createRecordInstruction.d.ts +0 -0
  22. package/dist/cjs/bindings/createRecordInstruction.js +2 -0
  23. package/dist/cjs/bindings/createRecordInstruction.js.map +1 -0
  24. package/dist/{types → cjs}/bindings/createRecordV2Instruction.d.ts +0 -0
  25. package/dist/cjs/bindings/createRecordV2Instruction.js +2 -0
  26. package/dist/cjs/bindings/createRecordV2Instruction.js.map +1 -0
  27. package/dist/{types → cjs}/bindings/createReverseName.d.ts +0 -0
  28. package/dist/cjs/bindings/createReverseName.js +2 -0
  29. package/dist/cjs/bindings/createReverseName.js.map +1 -0
  30. package/dist/{types → cjs}/bindings/createSolRecordInstruction.d.ts +0 -0
  31. package/dist/cjs/bindings/createSolRecordInstruction.js +2 -0
  32. package/dist/cjs/bindings/createSolRecordInstruction.js.map +1 -0
  33. package/dist/{types → cjs}/bindings/createSubdomain.d.ts +0 -0
  34. package/dist/cjs/bindings/createSubdomain.js +2 -0
  35. package/dist/cjs/bindings/createSubdomain.js.map +1 -0
  36. package/dist/{types → cjs}/bindings/deleteNameRegistry.d.ts +0 -0
  37. package/dist/cjs/bindings/deleteNameRegistry.js +2 -0
  38. package/dist/cjs/bindings/deleteNameRegistry.js.map +1 -0
  39. package/dist/{types → cjs}/bindings/deleteRecordV2.d.ts +0 -0
  40. package/dist/cjs/bindings/deleteRecordV2.js +2 -0
  41. package/dist/cjs/bindings/deleteRecordV2.js.map +1 -0
  42. package/dist/cjs/bindings/ethValidateRecordV2Content.d.ts +6 -0
  43. package/dist/cjs/bindings/ethValidateRecordV2Content.js +2 -0
  44. package/dist/cjs/bindings/ethValidateRecordV2Content.js.map +1 -0
  45. package/dist/{types → cjs}/bindings/registerDomainName.d.ts +0 -0
  46. package/dist/cjs/bindings/registerDomainName.js +2 -0
  47. package/dist/cjs/bindings/registerDomainName.js.map +1 -0
  48. package/dist/{types → cjs}/bindings/registerDomainNameV2.d.ts +0 -0
  49. package/dist/cjs/bindings/registerDomainNameV2.js +2 -0
  50. package/dist/cjs/bindings/registerDomainNameV2.js.map +1 -0
  51. package/dist/{types → cjs}/bindings/registerFavorite.d.ts +0 -0
  52. package/dist/cjs/bindings/registerFavorite.js +2 -0
  53. package/dist/cjs/bindings/registerFavorite.js.map +1 -0
  54. package/dist/{types → cjs}/bindings/registerWithNft.d.ts +0 -0
  55. package/dist/cjs/bindings/registerWithNft.js +2 -0
  56. package/dist/cjs/bindings/registerWithNft.js.map +1 -0
  57. package/dist/{types → cjs}/bindings/transferNameOwnership.d.ts +0 -0
  58. package/dist/cjs/bindings/transferNameOwnership.js +2 -0
  59. package/dist/cjs/bindings/transferNameOwnership.js.map +1 -0
  60. package/dist/{types → cjs}/bindings/transferSubdomain.d.ts +0 -0
  61. package/dist/cjs/bindings/transferSubdomain.js +2 -0
  62. package/dist/cjs/bindings/transferSubdomain.js.map +1 -0
  63. package/dist/{types → cjs}/bindings/updateNameRegistryData.d.ts +0 -0
  64. package/dist/cjs/bindings/updateNameRegistryData.js +2 -0
  65. package/dist/cjs/bindings/updateNameRegistryData.js.map +1 -0
  66. package/dist/{types → cjs}/bindings/updateRecordInstruction.d.ts +0 -0
  67. package/dist/cjs/bindings/updateRecordInstruction.js +2 -0
  68. package/dist/cjs/bindings/updateRecordInstruction.js.map +1 -0
  69. package/dist/{types → cjs}/bindings/updateRecordV2Instruction.d.ts +0 -0
  70. package/dist/cjs/bindings/updateRecordV2Instruction.js +2 -0
  71. package/dist/cjs/bindings/updateRecordV2Instruction.js.map +1 -0
  72. package/dist/{types → cjs}/bindings/updateSolRecordInstruction.d.ts +0 -0
  73. package/dist/cjs/bindings/updateSolRecordInstruction.js +2 -0
  74. package/dist/cjs/bindings/updateSolRecordInstruction.js.map +1 -0
  75. package/dist/{types → cjs}/bindings/validateRecordV2Content.d.ts +0 -0
  76. package/dist/cjs/bindings/validateRecordV2Content.js +2 -0
  77. package/dist/cjs/bindings/validateRecordV2Content.js.map +1 -0
  78. package/dist/{types → cjs}/bindings/writRoaRecordV2.d.ts +0 -0
  79. package/dist/cjs/bindings/writRoaRecordV2.js +2 -0
  80. package/dist/cjs/bindings/writRoaRecordV2.js.map +1 -0
  81. package/dist/{types → cjs}/constants.d.ts +0 -0
  82. package/dist/cjs/constants.js +2 -0
  83. package/dist/cjs/constants.js.map +1 -0
  84. package/dist/{types → cjs}/custom-bg.d.ts +0 -0
  85. package/dist/cjs/custom-bg.js +2 -0
  86. package/dist/cjs/custom-bg.js.map +1 -0
  87. package/dist/{types → cjs}/deprecated/utils.d.ts +0 -0
  88. package/dist/cjs/deprecated/utils.js +2 -0
  89. package/dist/cjs/deprecated/utils.js.map +1 -0
  90. package/dist/{types → cjs}/devnet.d.ts +0 -0
  91. package/dist/cjs/devnet.js +2 -0
  92. package/dist/cjs/devnet.js.map +1 -0
  93. package/dist/{types → cjs}/error.d.ts +0 -0
  94. package/dist/cjs/error.js +2 -0
  95. package/dist/cjs/error.js.map +1 -0
  96. package/dist/{types → cjs}/favorite-domain.d.ts +0 -0
  97. package/dist/cjs/favorite-domain.js +2 -0
  98. package/dist/cjs/favorite-domain.js.map +1 -0
  99. package/dist/{types → cjs}/index.d.ts +0 -0
  100. package/dist/cjs/index.js +2 -0
  101. package/dist/cjs/index.js.map +1 -0
  102. package/dist/{types → cjs}/instructions/burnInstruction.d.ts +0 -0
  103. package/dist/cjs/instructions/burnInstruction.js +2 -0
  104. package/dist/cjs/instructions/burnInstruction.js.map +1 -0
  105. package/dist/{types → cjs}/instructions/createInstruction.d.ts +0 -0
  106. package/dist/cjs/instructions/createInstruction.js +2 -0
  107. package/dist/cjs/instructions/createInstruction.js.map +1 -0
  108. package/dist/{types → cjs}/instructions/createInstructionV3.d.ts +0 -0
  109. package/dist/cjs/instructions/createInstructionV3.js +2 -0
  110. package/dist/cjs/instructions/createInstructionV3.js.map +1 -0
  111. package/dist/{types → cjs}/instructions/createReverseInstruction.d.ts +0 -0
  112. package/dist/cjs/instructions/createReverseInstruction.js +2 -0
  113. package/dist/cjs/instructions/createReverseInstruction.js.map +1 -0
  114. package/dist/{types → cjs}/instructions/createSplitV2Instruction.d.ts +0 -0
  115. package/dist/cjs/instructions/createSplitV2Instruction.js +2 -0
  116. package/dist/cjs/instructions/createSplitV2Instruction.js.map +1 -0
  117. package/dist/{types → cjs}/instructions/createV2Instruction.d.ts +0 -0
  118. package/dist/cjs/instructions/createV2Instruction.js +2 -0
  119. package/dist/cjs/instructions/createV2Instruction.js.map +1 -0
  120. package/dist/{types → cjs}/instructions/createWithNftInstruction.d.ts +0 -0
  121. package/dist/cjs/instructions/createWithNftInstruction.js +2 -0
  122. package/dist/cjs/instructions/createWithNftInstruction.js.map +1 -0
  123. package/dist/{types → cjs}/instructions/deleteInstruction.d.ts +0 -0
  124. package/dist/cjs/instructions/deleteInstruction.js +2 -0
  125. package/dist/cjs/instructions/deleteInstruction.js.map +1 -0
  126. package/dist/{types → cjs}/instructions/reallocInstruction.d.ts +0 -0
  127. package/dist/cjs/instructions/reallocInstruction.js +2 -0
  128. package/dist/cjs/instructions/reallocInstruction.js.map +1 -0
  129. package/dist/{types → cjs}/instructions/registerFavoriteInstruction.d.ts +0 -0
  130. package/dist/cjs/instructions/registerFavoriteInstruction.js +2 -0
  131. package/dist/cjs/instructions/registerFavoriteInstruction.js.map +1 -0
  132. package/dist/{types → cjs}/instructions/transferInstruction.d.ts +0 -0
  133. package/dist/cjs/instructions/transferInstruction.js +2 -0
  134. package/dist/cjs/instructions/transferInstruction.js.map +1 -0
  135. package/dist/{types → cjs}/instructions/types.d.ts +0 -0
  136. package/dist/cjs/instructions/types.js +2 -0
  137. package/dist/cjs/instructions/types.js.map +1 -0
  138. package/dist/{types → cjs}/instructions/updateInstruction.d.ts +0 -0
  139. package/dist/cjs/instructions/updateInstruction.js +2 -0
  140. package/dist/cjs/instructions/updateInstruction.js.map +1 -0
  141. package/dist/{types → cjs}/int.d.ts +0 -0
  142. package/dist/cjs/int.js +2 -0
  143. package/dist/cjs/int.js.map +1 -0
  144. package/dist/{types → cjs}/nft/const.d.ts +0 -0
  145. package/dist/cjs/nft/const.js +2 -0
  146. package/dist/cjs/nft/const.js.map +1 -0
  147. package/dist/{types → cjs}/nft/getDomainMint.d.ts +0 -0
  148. package/dist/cjs/nft/getDomainMint.js +2 -0
  149. package/dist/cjs/nft/getDomainMint.js.map +1 -0
  150. package/dist/{types → cjs}/nft/getRecordFromMint.d.ts +0 -0
  151. package/dist/cjs/nft/getRecordFromMint.js +2 -0
  152. package/dist/cjs/nft/getRecordFromMint.js.map +1 -0
  153. package/dist/{types → cjs}/nft/retrieveNftOwner.d.ts +0 -0
  154. package/dist/cjs/nft/retrieveNftOwner.js +2 -0
  155. package/dist/cjs/nft/retrieveNftOwner.js.map +1 -0
  156. package/dist/{types → cjs}/nft/retrieveNftOwnerV2.d.ts +0 -0
  157. package/dist/cjs/nft/retrieveNftOwnerV2.js +2 -0
  158. package/dist/cjs/nft/retrieveNftOwnerV2.js.map +1 -0
  159. package/dist/{types → cjs}/nft/retrieveNfts.d.ts +0 -0
  160. package/dist/cjs/nft/retrieveNfts.js +2 -0
  161. package/dist/cjs/nft/retrieveNfts.js.map +1 -0
  162. package/dist/{types → cjs}/nft/retrieveRecords.d.ts +0 -0
  163. package/dist/cjs/nft/retrieveRecords.js +2 -0
  164. package/dist/cjs/nft/retrieveRecords.js.map +1 -0
  165. package/dist/{types → cjs}/nft/state.d.ts +0 -0
  166. package/dist/cjs/nft/state.js +2 -0
  167. package/dist/cjs/nft/state.js.map +1 -0
  168. package/dist/cjs/node_modules/@bonfida/sns-records/dist/index.js +2 -0
  169. package/dist/cjs/node_modules/@bonfida/sns-records/dist/index.js.map +1 -0
  170. package/dist/cjs/node_modules/@noble/curves/esm/abstract/curve.js +4 -0
  171. package/dist/cjs/node_modules/@noble/curves/esm/abstract/curve.js.map +1 -0
  172. package/dist/cjs/node_modules/@noble/curves/esm/abstract/edwards.js +4 -0
  173. package/dist/cjs/node_modules/@noble/curves/esm/abstract/edwards.js.map +1 -0
  174. package/dist/cjs/node_modules/@noble/curves/esm/abstract/modular.js +4 -0
  175. package/dist/cjs/node_modules/@noble/curves/esm/abstract/modular.js.map +1 -0
  176. package/dist/cjs/node_modules/@noble/curves/esm/abstract/utils.js +3 -0
  177. package/dist/cjs/node_modules/@noble/curves/esm/abstract/utils.js.map +1 -0
  178. package/dist/cjs/node_modules/@noble/curves/esm/ed25519.js +4 -0
  179. package/dist/cjs/node_modules/@noble/curves/esm/ed25519.js.map +1 -0
  180. package/dist/cjs/node_modules/@noble/hashes/esm/_md.js +2 -0
  181. package/dist/cjs/node_modules/@noble/hashes/esm/_md.js.map +1 -0
  182. package/dist/cjs/node_modules/@noble/hashes/esm/_u64.js +2 -0
  183. package/dist/cjs/node_modules/@noble/hashes/esm/_u64.js.map +1 -0
  184. package/dist/cjs/node_modules/@noble/hashes/esm/crypto.js +2 -0
  185. package/dist/cjs/node_modules/@noble/hashes/esm/crypto.js.map +1 -0
  186. package/dist/cjs/node_modules/@noble/hashes/esm/sha2.js +2 -0
  187. package/dist/cjs/node_modules/@noble/hashes/esm/sha2.js.map +1 -0
  188. package/dist/cjs/node_modules/@noble/hashes/esm/sha256.js +2 -0
  189. package/dist/cjs/node_modules/@noble/hashes/esm/sha256.js.map +1 -0
  190. package/dist/cjs/node_modules/@noble/hashes/esm/utils.js +3 -0
  191. package/dist/cjs/node_modules/@noble/hashes/esm/utils.js.map +1 -0
  192. package/dist/cjs/node_modules/@scure/base/lib/esm/index.js +3 -0
  193. package/dist/cjs/node_modules/@scure/base/lib/esm/index.js.map +1 -0
  194. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/constants.js +2 -0
  195. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/constants.js.map +1 -0
  196. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/errors.js +2 -0
  197. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/errors.js.map +1 -0
  198. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/extensions/accountType.js +2 -0
  199. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/extensions/accountType.js.map +1 -0
  200. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/instructions/associatedTokenAccount.js +2 -0
  201. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/instructions/associatedTokenAccount.js.map +1 -0
  202. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/state/account.js +2 -0
  203. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/state/account.js.map +1 -0
  204. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/state/mint.js +2 -0
  205. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/state/mint.js.map +1 -0
  206. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/state/multisig.js +2 -0
  207. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/state/multisig.js.map +1 -0
  208. package/dist/cjs/node_modules/base64-js/index.js +2 -0
  209. package/dist/cjs/node_modules/base64-js/index.js.map +1 -0
  210. package/dist/cjs/node_modules/borsh/lib/esm/buffer.js +2 -0
  211. package/dist/cjs/node_modules/borsh/lib/esm/buffer.js.map +1 -0
  212. package/dist/cjs/node_modules/borsh/lib/esm/deserialize.js +2 -0
  213. package/dist/cjs/node_modules/borsh/lib/esm/deserialize.js.map +1 -0
  214. package/dist/cjs/node_modules/borsh/lib/esm/index.js +2 -0
  215. package/dist/cjs/node_modules/borsh/lib/esm/index.js.map +1 -0
  216. package/dist/cjs/node_modules/borsh/lib/esm/serialize.js +2 -0
  217. package/dist/cjs/node_modules/borsh/lib/esm/serialize.js.map +1 -0
  218. package/dist/cjs/node_modules/borsh/lib/esm/types.js +2 -0
  219. package/dist/cjs/node_modules/borsh/lib/esm/types.js.map +1 -0
  220. package/dist/cjs/node_modules/borsh/lib/esm/utils.js +2 -0
  221. package/dist/cjs/node_modules/borsh/lib/esm/utils.js.map +1 -0
  222. package/dist/cjs/node_modules/bs58/index.js +2 -0
  223. package/dist/cjs/node_modules/bs58/index.js.map +1 -0
  224. package/dist/cjs/node_modules/bs58/node_modules/base-x/src/index.js +2 -0
  225. package/dist/cjs/node_modules/bs58/node_modules/base-x/src/index.js.map +1 -0
  226. package/dist/cjs/node_modules/buffer/index.js +9 -0
  227. package/dist/cjs/node_modules/buffer/index.js.map +1 -0
  228. package/dist/cjs/node_modules/graphemesplit/extPict.json.js +2 -0
  229. package/dist/cjs/node_modules/graphemesplit/extPict.json.js.map +1 -0
  230. package/dist/cjs/node_modules/graphemesplit/inCB.json.js +2 -0
  231. package/dist/cjs/node_modules/graphemesplit/inCB.json.js.map +1 -0
  232. package/dist/cjs/node_modules/graphemesplit/index.js +2 -0
  233. package/dist/cjs/node_modules/graphemesplit/index.js.map +1 -0
  234. package/dist/cjs/node_modules/graphemesplit/typeTrie.json.js +2 -0
  235. package/dist/cjs/node_modules/graphemesplit/typeTrie.json.js.map +1 -0
  236. package/dist/cjs/node_modules/graphemesplit/types.js +2 -0
  237. package/dist/cjs/node_modules/graphemesplit/types.js.map +1 -0
  238. package/dist/cjs/node_modules/ieee754/index.js +3 -0
  239. package/dist/cjs/node_modules/ieee754/index.js.map +1 -0
  240. package/dist/cjs/node_modules/ipaddr.js/lib/ipaddr.js +2 -0
  241. package/dist/cjs/node_modules/ipaddr.js/lib/ipaddr.js.map +1 -0
  242. package/dist/cjs/node_modules/js-base64/base64.js +2 -0
  243. package/dist/cjs/node_modules/js-base64/base64.js.map +1 -0
  244. package/dist/cjs/node_modules/punycode/punycode.es6.js +2 -0
  245. package/dist/cjs/node_modules/punycode/punycode.es6.js.map +1 -0
  246. package/dist/cjs/node_modules/tiny-inflate/index.js +2 -0
  247. package/dist/cjs/node_modules/tiny-inflate/index.js.map +1 -0
  248. package/dist/cjs/node_modules/unicode-trie/index.js +2 -0
  249. package/dist/cjs/node_modules/unicode-trie/index.js.map +1 -0
  250. package/dist/cjs/node_modules/unicode-trie/swap.js +2 -0
  251. package/dist/cjs/node_modules/unicode-trie/swap.js.map +1 -0
  252. package/dist/cjs/package.json +1 -0
  253. package/dist/{types → cjs}/record/checkSolRecord.d.ts +0 -0
  254. package/dist/cjs/record/checkSolRecord.js +2 -0
  255. package/dist/cjs/record/checkSolRecord.js.map +1 -0
  256. package/dist/{types → cjs}/record/deserializeRecord.d.ts +0 -0
  257. package/dist/cjs/record/deserializeRecord.js +2 -0
  258. package/dist/cjs/record/deserializeRecord.js.map +1 -0
  259. package/dist/{types → cjs}/record/getRecord.d.ts +0 -0
  260. package/dist/cjs/record/getRecord.js +2 -0
  261. package/dist/cjs/record/getRecord.js.map +1 -0
  262. package/dist/{types → cjs}/record/getRecordKeySync.d.ts +0 -0
  263. package/dist/cjs/record/getRecordKeySync.js +2 -0
  264. package/dist/cjs/record/getRecordKeySync.js.map +1 -0
  265. package/dist/{types → cjs}/record/getRecords.d.ts +0 -0
  266. package/dist/cjs/record/getRecords.js +2 -0
  267. package/dist/cjs/record/getRecords.js.map +1 -0
  268. package/dist/{types → cjs}/record/helpers/getArweaveRecord.d.ts +0 -0
  269. package/dist/cjs/record/helpers/getArweaveRecord.js +2 -0
  270. package/dist/cjs/record/helpers/getArweaveRecord.js.map +1 -0
  271. package/dist/{types → cjs}/record/helpers/getBackgroundRecord.d.ts +0 -0
  272. package/dist/cjs/record/helpers/getBackgroundRecord.js +2 -0
  273. package/dist/cjs/record/helpers/getBackgroundRecord.js.map +1 -0
  274. package/dist/{types → cjs}/record/helpers/getBackpackRecord.d.ts +0 -0
  275. package/dist/cjs/record/helpers/getBackpackRecord.js +2 -0
  276. package/dist/cjs/record/helpers/getBackpackRecord.js.map +1 -0
  277. package/dist/{types → cjs}/record/helpers/getBscRecord.d.ts +0 -0
  278. package/dist/cjs/record/helpers/getBscRecord.js +2 -0
  279. package/dist/cjs/record/helpers/getBscRecord.js.map +1 -0
  280. package/dist/{types → cjs}/record/helpers/getBtcRecord.d.ts +0 -0
  281. package/dist/cjs/record/helpers/getBtcRecord.js +2 -0
  282. package/dist/cjs/record/helpers/getBtcRecord.js.map +1 -0
  283. package/dist/{types → cjs}/record/helpers/getDiscordRecord.d.ts +0 -0
  284. package/dist/cjs/record/helpers/getDiscordRecord.js +2 -0
  285. package/dist/cjs/record/helpers/getDiscordRecord.js.map +1 -0
  286. package/dist/{types → cjs}/record/helpers/getDogeRecord.d.ts +0 -0
  287. package/dist/cjs/record/helpers/getDogeRecord.js +2 -0
  288. package/dist/cjs/record/helpers/getDogeRecord.js.map +1 -0
  289. package/dist/{types → cjs}/record/helpers/getEmailRecord.d.ts +0 -0
  290. package/dist/cjs/record/helpers/getEmailRecord.js +2 -0
  291. package/dist/cjs/record/helpers/getEmailRecord.js.map +1 -0
  292. package/dist/{types → cjs}/record/helpers/getEthRecord.d.ts +0 -0
  293. package/dist/cjs/record/helpers/getEthRecord.js +2 -0
  294. package/dist/cjs/record/helpers/getEthRecord.js.map +1 -0
  295. package/dist/{types → cjs}/record/helpers/getGithubRecord.d.ts +0 -0
  296. package/dist/cjs/record/helpers/getGithubRecord.js +2 -0
  297. package/dist/cjs/record/helpers/getGithubRecord.js.map +1 -0
  298. package/dist/{types → cjs}/record/helpers/getInjectiveRecord.d.ts +0 -0
  299. package/dist/cjs/record/helpers/getInjectiveRecord.js +2 -0
  300. package/dist/cjs/record/helpers/getInjectiveRecord.js.map +1 -0
  301. package/dist/{types → cjs}/record/helpers/getIpfsRecord.d.ts +0 -0
  302. package/dist/cjs/record/helpers/getIpfsRecord.js +2 -0
  303. package/dist/cjs/record/helpers/getIpfsRecord.js.map +1 -0
  304. package/dist/{types → cjs}/record/helpers/getLtcRecord.d.ts +0 -0
  305. package/dist/cjs/record/helpers/getLtcRecord.js +2 -0
  306. package/dist/cjs/record/helpers/getLtcRecord.js.map +1 -0
  307. package/dist/{types → cjs}/record/helpers/getPicRecord.d.ts +0 -0
  308. package/dist/cjs/record/helpers/getPicRecord.js +2 -0
  309. package/dist/cjs/record/helpers/getPicRecord.js.map +1 -0
  310. package/dist/{types → cjs}/record/helpers/getPointRecord.d.ts +0 -0
  311. package/dist/cjs/record/helpers/getPointRecord.js +2 -0
  312. package/dist/cjs/record/helpers/getPointRecord.js.map +1 -0
  313. package/dist/{types → cjs}/record/helpers/getRedditRecord.d.ts +0 -0
  314. package/dist/cjs/record/helpers/getRedditRecord.js +2 -0
  315. package/dist/cjs/record/helpers/getRedditRecord.js.map +1 -0
  316. package/dist/{types → cjs}/record/helpers/getShdwRecord.d.ts +0 -0
  317. package/dist/cjs/record/helpers/getShdwRecord.js +2 -0
  318. package/dist/cjs/record/helpers/getShdwRecord.js.map +1 -0
  319. package/dist/{types → cjs}/record/helpers/getSolRecord.d.ts +0 -0
  320. package/dist/cjs/record/helpers/getSolRecord.js +2 -0
  321. package/dist/cjs/record/helpers/getSolRecord.js.map +1 -0
  322. package/dist/{types → cjs}/record/helpers/getTelegramRecord.d.ts +0 -0
  323. package/dist/cjs/record/helpers/getTelegramRecord.js +2 -0
  324. package/dist/cjs/record/helpers/getTelegramRecord.js.map +1 -0
  325. package/dist/{types → cjs}/record/helpers/getTwitterRecord.d.ts +0 -0
  326. package/dist/cjs/record/helpers/getTwitterRecord.js +2 -0
  327. package/dist/cjs/record/helpers/getTwitterRecord.js.map +1 -0
  328. package/dist/{types → cjs}/record/helpers/getUrlRecord.d.ts +0 -0
  329. package/dist/cjs/record/helpers/getUrlRecord.js +2 -0
  330. package/dist/cjs/record/helpers/getUrlRecord.js.map +1 -0
  331. package/dist/cjs/record/serializeRecord.d.ts +12 -0
  332. package/dist/cjs/record/serializeRecord.js +2 -0
  333. package/dist/cjs/record/serializeRecord.js.map +1 -0
  334. package/dist/cjs/record/serializeSolRecord.d.ts +13 -0
  335. package/dist/cjs/record/serializeSolRecord.js +2 -0
  336. package/dist/cjs/record/serializeSolRecord.js.map +1 -0
  337. package/dist/{types → cjs}/record_v2/const.d.ts +0 -0
  338. package/dist/cjs/record_v2/const.js +2 -0
  339. package/dist/cjs/record_v2/const.js.map +1 -0
  340. package/dist/{types → cjs}/record_v2/deserializeRecordV2Content.d.ts +0 -0
  341. package/dist/cjs/record_v2/deserializeRecordV2Content.js +2 -0
  342. package/dist/cjs/record_v2/deserializeRecordV2Content.js.map +1 -0
  343. package/dist/{types → cjs}/record_v2/getMultipleRecordsV2.d.ts +0 -0
  344. package/dist/cjs/record_v2/getMultipleRecordsV2.js +2 -0
  345. package/dist/cjs/record_v2/getMultipleRecordsV2.js.map +1 -0
  346. package/dist/{types → cjs}/record_v2/getRecordV2.d.ts +0 -0
  347. package/dist/cjs/record_v2/getRecordV2.js +2 -0
  348. package/dist/cjs/record_v2/getRecordV2.js.map +1 -0
  349. package/dist/{types → cjs}/record_v2/getRecordV2Key.d.ts +0 -0
  350. package/dist/cjs/record_v2/getRecordV2Key.js +2 -0
  351. package/dist/cjs/record_v2/getRecordV2Key.js.map +1 -0
  352. package/dist/cjs/record_v2/serializeRecordV2Content.d.ts +12 -0
  353. package/dist/cjs/record_v2/serializeRecordV2Content.js +2 -0
  354. package/dist/cjs/record_v2/serializeRecordV2Content.js.map +1 -0
  355. package/dist/{types → cjs}/record_v2/utils.d.ts +0 -0
  356. package/dist/cjs/record_v2/utils.js +2 -0
  357. package/dist/cjs/record_v2/utils.js.map +1 -0
  358. package/dist/{types → cjs}/record_v2/verifyRightOfAssociation.d.ts +0 -0
  359. package/dist/cjs/record_v2/verifyRightOfAssociation.js +2 -0
  360. package/dist/cjs/record_v2/verifyRightOfAssociation.js.map +1 -0
  361. package/dist/{types → cjs}/resolve/resolve.d.ts +0 -0
  362. package/dist/cjs/resolve/resolve.js +2 -0
  363. package/dist/cjs/resolve/resolve.js.map +1 -0
  364. package/dist/{types → cjs}/resolve/resolveSolRecordV1.d.ts +0 -0
  365. package/dist/cjs/resolve/resolveSolRecordV1.js +2 -0
  366. package/dist/cjs/resolve/resolveSolRecordV1.js.map +1 -0
  367. package/dist/{types → cjs}/resolve/resolveSolRecordV2.d.ts +0 -0
  368. package/dist/cjs/resolve/resolveSolRecordV2.js +2 -0
  369. package/dist/cjs/resolve/resolveSolRecordV2.js.map +1 -0
  370. package/dist/{types → cjs}/state.d.ts +0 -0
  371. package/dist/cjs/state.js +2 -0
  372. package/dist/cjs/state.js.map +1 -0
  373. package/dist/{types → cjs}/twitter/ReverseTwitterRegistryState.d.ts +0 -0
  374. package/dist/cjs/twitter/ReverseTwitterRegistryState.js +2 -0
  375. package/dist/cjs/twitter/ReverseTwitterRegistryState.js.map +1 -0
  376. package/dist/{types → cjs}/twitter/changeTwitterRegistryData.d.ts +0 -0
  377. package/dist/cjs/twitter/changeTwitterRegistryData.js +2 -0
  378. package/dist/cjs/twitter/changeTwitterRegistryData.js.map +1 -0
  379. package/dist/{types → cjs}/twitter/changeVerifiedPubkey.d.ts +0 -0
  380. package/dist/cjs/twitter/changeVerifiedPubkey.js +2 -0
  381. package/dist/cjs/twitter/changeVerifiedPubkey.js.map +1 -0
  382. package/dist/{types → cjs}/twitter/createReverseTwitterRegistry.d.ts +0 -0
  383. package/dist/cjs/twitter/createReverseTwitterRegistry.js +2 -0
  384. package/dist/cjs/twitter/createReverseTwitterRegistry.js.map +1 -0
  385. package/dist/{types → cjs}/twitter/createVerifiedTwitterRegistry.d.ts +0 -0
  386. package/dist/cjs/twitter/createVerifiedTwitterRegistry.js +2 -0
  387. package/dist/cjs/twitter/createVerifiedTwitterRegistry.js.map +1 -0
  388. package/dist/{types → cjs}/twitter/deleteTwitterRegistry.d.ts +0 -0
  389. package/dist/cjs/twitter/deleteTwitterRegistry.js +2 -0
  390. package/dist/cjs/twitter/deleteTwitterRegistry.js.map +1 -0
  391. package/dist/{types → cjs}/twitter/getHandleAndRegistryKey.d.ts +0 -0
  392. package/dist/cjs/twitter/getHandleAndRegistryKey.js +2 -0
  393. package/dist/cjs/twitter/getHandleAndRegistryKey.js.map +1 -0
  394. package/dist/{types → cjs}/twitter/getTwitterHandleandRegistryKeyViaFilters.d.ts +0 -0
  395. package/dist/cjs/twitter/getTwitterHandleandRegistryKeyViaFilters.js +2 -0
  396. package/dist/cjs/twitter/getTwitterHandleandRegistryKeyViaFilters.js.map +1 -0
  397. package/dist/{types → cjs}/twitter/getTwitterRegistry.d.ts +0 -0
  398. package/dist/cjs/twitter/getTwitterRegistry.js +2 -0
  399. package/dist/cjs/twitter/getTwitterRegistry.js.map +1 -0
  400. package/dist/{types → cjs}/twitter/getTwitterRegistryData.d.ts +0 -0
  401. package/dist/cjs/twitter/getTwitterRegistryData.js +2 -0
  402. package/dist/cjs/twitter/getTwitterRegistryData.js.map +1 -0
  403. package/dist/{types → cjs}/twitter/getTwitterRegistryKey.d.ts +0 -0
  404. package/dist/cjs/twitter/getTwitterRegistryKey.js +2 -0
  405. package/dist/cjs/twitter/getTwitterRegistryKey.js.map +1 -0
  406. package/dist/{types → cjs}/types/custom-bg.d.ts +0 -0
  407. package/dist/cjs/types/custom-bg.js +2 -0
  408. package/dist/cjs/types/custom-bg.js.map +1 -0
  409. package/dist/{types → cjs}/types/record.d.ts +0 -0
  410. package/dist/cjs/types/record.js +2 -0
  411. package/dist/cjs/types/record.js.map +1 -0
  412. package/dist/{types → cjs}/utils/check.d.ts +0 -0
  413. package/dist/cjs/utils/check.js +2 -0
  414. package/dist/cjs/utils/check.js.map +1 -0
  415. package/dist/{types → cjs}/utils/deserializeReverse.d.ts +0 -0
  416. package/dist/cjs/utils/deserializeReverse.js +2 -0
  417. package/dist/cjs/utils/deserializeReverse.js.map +1 -0
  418. package/dist/{types → cjs}/utils/findSubdomains.d.ts +0 -0
  419. package/dist/cjs/utils/findSubdomains.js +2 -0
  420. package/dist/cjs/utils/findSubdomains.js.map +1 -0
  421. package/dist/{types → cjs}/utils/getAllDomains.d.ts +0 -0
  422. package/dist/cjs/utils/getAllDomains.js +2 -0
  423. package/dist/cjs/utils/getAllDomains.js.map +1 -0
  424. package/dist/{types → cjs}/utils/getAllRegisteredDomains.d.ts +0 -0
  425. package/dist/cjs/utils/getAllRegisteredDomains.js +2 -0
  426. package/dist/cjs/utils/getAllRegisteredDomains.js.map +1 -0
  427. package/dist/{types → cjs}/utils/getDomainKeySync.d.ts +0 -0
  428. package/dist/cjs/utils/getDomainKeySync.js +2 -0
  429. package/dist/cjs/utils/getDomainKeySync.js.map +1 -0
  430. package/dist/{types → cjs}/utils/getDomainKeysWithReverses.d.ts +0 -0
  431. package/dist/cjs/utils/getDomainKeysWithReverses.js +2 -0
  432. package/dist/cjs/utils/getDomainKeysWithReverses.js.map +1 -0
  433. package/dist/{types → cjs}/utils/getDomainPriceFromName.d.ts +0 -0
  434. package/dist/cjs/utils/getDomainPriceFromName.js +2 -0
  435. package/dist/cjs/utils/getDomainPriceFromName.js.map +1 -0
  436. package/dist/cjs/utils/getHashedNameSync.d.ts +4 -0
  437. package/dist/cjs/utils/getHashedNameSync.js +2 -0
  438. package/dist/cjs/utils/getHashedNameSync.js.map +1 -0
  439. package/dist/cjs/utils/getNameAccountKeySync.d.ts +5 -0
  440. package/dist/cjs/utils/getNameAccountKeySync.js +2 -0
  441. package/dist/cjs/utils/getNameAccountKeySync.js.map +1 -0
  442. package/dist/{types → cjs}/utils/getPythFeedAccountKey.d.ts +0 -0
  443. package/dist/cjs/utils/getPythFeedAccountKey.js +2 -0
  444. package/dist/cjs/utils/getPythFeedAccountKey.js.map +1 -0
  445. package/dist/{types → cjs}/utils/getReverseKeyFromDomainKey.d.ts +0 -0
  446. package/dist/cjs/utils/getReverseKeyFromDomainKey.js +2 -0
  447. package/dist/cjs/utils/getReverseKeyFromDomainKey.js.map +1 -0
  448. package/dist/{types → cjs}/utils/getReverseKeySync.d.ts +0 -0
  449. package/dist/cjs/utils/getReverseKeySync.js +2 -0
  450. package/dist/cjs/utils/getReverseKeySync.js.map +1 -0
  451. package/dist/{types → cjs}/utils/getTokenizedDomains.d.ts +0 -0
  452. package/dist/cjs/utils/getTokenizedDomains.js +2 -0
  453. package/dist/cjs/utils/getTokenizedDomains.js.map +1 -0
  454. package/dist/{types → cjs}/utils/reverseLookup.d.ts +0 -0
  455. package/dist/cjs/utils/reverseLookup.js +2 -0
  456. package/dist/cjs/utils/reverseLookup.js.map +1 -0
  457. package/dist/{types → cjs}/utils/reverseLookupBatch.d.ts +0 -0
  458. package/dist/cjs/utils/reverseLookupBatch.js +2 -0
  459. package/dist/cjs/utils/reverseLookupBatch.js.map +1 -0
  460. package/dist/esm/_virtual/_commonjsHelpers.js +2 -0
  461. package/dist/esm/_virtual/_commonjsHelpers.js.map +1 -0
  462. package/dist/esm/_virtual/base64.js +2 -0
  463. package/dist/esm/_virtual/base64.js.map +1 -0
  464. package/dist/esm/_virtual/index.js +2 -0
  465. package/dist/esm/_virtual/index.js.map +1 -0
  466. package/dist/esm/_virtual/index2.js +2 -0
  467. package/dist/esm/_virtual/index2.js.map +1 -0
  468. package/dist/esm/_virtual/index3.js +2 -0
  469. package/dist/esm/_virtual/index3.js.map +1 -0
  470. package/dist/esm/_virtual/ipaddr.js +2 -0
  471. package/dist/esm/_virtual/ipaddr.js.map +1 -0
  472. package/dist/esm/bindings/burnDomain.d.ts +2 -0
  473. package/dist/esm/bindings/burnDomain.js +2 -0
  474. package/dist/esm/bindings/burnDomain.js.map +1 -0
  475. package/dist/esm/bindings/createNameRegistry.d.ts +15 -0
  476. package/dist/esm/bindings/createNameRegistry.js +2 -0
  477. package/dist/esm/bindings/createNameRegistry.js.map +1 -0
  478. package/dist/esm/bindings/createRecordInstruction.d.ts +14 -0
  479. package/dist/esm/bindings/createRecordInstruction.js +2 -0
  480. package/dist/esm/bindings/createRecordInstruction.js.map +1 -0
  481. package/dist/esm/bindings/createRecordV2Instruction.d.ts +12 -0
  482. package/dist/esm/bindings/createRecordV2Instruction.js +2 -0
  483. package/dist/esm/bindings/createRecordV2Instruction.js.map +1 -0
  484. package/dist/esm/bindings/createReverseName.d.ts +11 -0
  485. package/dist/esm/bindings/createReverseName.js +2 -0
  486. package/dist/esm/bindings/createReverseName.js.map +1 -0
  487. package/dist/esm/bindings/createSolRecordInstruction.d.ts +12 -0
  488. package/dist/esm/bindings/createSolRecordInstruction.js +2 -0
  489. package/dist/esm/bindings/createSolRecordInstruction.js.map +1 -0
  490. package/dist/esm/bindings/createSubdomain.d.ts +10 -0
  491. package/dist/esm/bindings/createSubdomain.js +2 -0
  492. package/dist/esm/bindings/createSubdomain.js.map +1 -0
  493. package/dist/esm/bindings/deleteNameRegistry.d.ts +12 -0
  494. package/dist/esm/bindings/deleteNameRegistry.js +2 -0
  495. package/dist/esm/bindings/deleteNameRegistry.js.map +1 -0
  496. package/dist/esm/bindings/deleteRecordV2.d.ts +11 -0
  497. package/dist/esm/bindings/deleteRecordV2.js +2 -0
  498. package/dist/esm/bindings/deleteRecordV2.js.map +1 -0
  499. package/dist/esm/bindings/ethValidateRecordV2Content.d.ts +6 -0
  500. package/dist/esm/bindings/ethValidateRecordV2Content.js +2 -0
  501. package/dist/esm/bindings/ethValidateRecordV2Content.js.map +1 -0
  502. package/dist/esm/bindings/registerDomainName.d.ts +14 -0
  503. package/dist/esm/bindings/registerDomainName.js +2 -0
  504. package/dist/esm/bindings/registerDomainName.js.map +1 -0
  505. package/dist/esm/bindings/registerDomainNameV2.d.ts +13 -0
  506. package/dist/esm/bindings/registerDomainNameV2.js +2 -0
  507. package/dist/esm/bindings/registerDomainNameV2.js.map +1 -0
  508. package/dist/esm/bindings/registerFavorite.d.ts +10 -0
  509. package/dist/esm/bindings/registerFavorite.js +2 -0
  510. package/dist/esm/bindings/registerFavorite.js.map +1 -0
  511. package/dist/esm/bindings/registerWithNft.d.ts +2 -0
  512. package/dist/esm/bindings/registerWithNft.js +2 -0
  513. package/dist/esm/bindings/registerWithNft.js.map +1 -0
  514. package/dist/esm/bindings/transferNameOwnership.d.ts +13 -0
  515. package/dist/esm/bindings/transferNameOwnership.js +2 -0
  516. package/dist/esm/bindings/transferNameOwnership.js.map +1 -0
  517. package/dist/esm/bindings/transferSubdomain.d.ts +13 -0
  518. package/dist/esm/bindings/transferSubdomain.js +2 -0
  519. package/dist/esm/bindings/transferSubdomain.js.map +1 -0
  520. package/dist/esm/bindings/updateNameRegistryData.d.ts +15 -0
  521. package/dist/esm/bindings/updateNameRegistryData.js +2 -0
  522. package/dist/esm/bindings/updateNameRegistryData.js.map +1 -0
  523. package/dist/esm/bindings/updateRecordInstruction.d.ts +3 -0
  524. package/dist/esm/bindings/updateRecordInstruction.js +2 -0
  525. package/dist/esm/bindings/updateRecordInstruction.js.map +1 -0
  526. package/dist/esm/bindings/updateRecordV2Instruction.d.ts +13 -0
  527. package/dist/esm/bindings/updateRecordV2Instruction.js +2 -0
  528. package/dist/esm/bindings/updateRecordV2Instruction.js.map +1 -0
  529. package/dist/esm/bindings/updateSolRecordInstruction.d.ts +2 -0
  530. package/dist/esm/bindings/updateSolRecordInstruction.js +2 -0
  531. package/dist/esm/bindings/updateSolRecordInstruction.js.map +1 -0
  532. package/dist/esm/bindings/validateRecordV2Content.d.ts +3 -0
  533. package/dist/esm/bindings/validateRecordV2Content.js +2 -0
  534. package/dist/esm/bindings/validateRecordV2Content.js.map +1 -0
  535. package/dist/esm/bindings/writRoaRecordV2.d.ts +3 -0
  536. package/dist/esm/bindings/writRoaRecordV2.js +2 -0
  537. package/dist/esm/bindings/writRoaRecordV2.js.map +1 -0
  538. package/dist/esm/constants.d.ts +45 -0
  539. package/dist/esm/constants.js +2 -0
  540. package/dist/esm/constants.js.map +1 -0
  541. package/dist/esm/custom-bg.d.ts +7 -0
  542. package/dist/esm/custom-bg.js +2 -0
  543. package/dist/esm/custom-bg.js.map +1 -0
  544. package/dist/esm/deprecated/utils.d.ts +68 -0
  545. package/dist/esm/deprecated/utils.js +2 -0
  546. package/dist/esm/deprecated/utils.js.map +1 -0
  547. package/dist/esm/devnet.d.ts +118 -0
  548. package/dist/esm/devnet.js +2 -0
  549. package/dist/esm/devnet.js.map +1 -0
  550. package/dist/esm/error.d.ts +162 -0
  551. package/dist/esm/error.js +2 -0
  552. package/dist/esm/error.js.map +1 -0
  553. package/dist/esm/favorite-domain.d.ts +74 -0
  554. package/dist/esm/favorite-domain.js +2 -0
  555. package/dist/esm/favorite-domain.js.map +1 -0
  556. package/dist/esm/index.d.ts +119 -0
  557. package/dist/esm/index.js +2 -0
  558. package/dist/esm/index.js.map +1 -0
  559. package/dist/esm/instructions/burnInstruction.d.ts +12 -0
  560. package/dist/esm/instructions/burnInstruction.js +2 -0
  561. package/dist/esm/instructions/burnInstruction.js.map +1 -0
  562. package/dist/esm/instructions/createInstruction.d.ts +6 -0
  563. package/dist/esm/instructions/createInstruction.js +2 -0
  564. package/dist/esm/instructions/createInstruction.js.map +1 -0
  565. package/dist/esm/instructions/createInstructionV3.d.ts +24 -0
  566. package/dist/esm/instructions/createInstructionV3.js +2 -0
  567. package/dist/esm/instructions/createInstructionV3.js.map +1 -0
  568. package/dist/esm/instructions/createReverseInstruction.d.ts +16 -0
  569. package/dist/esm/instructions/createReverseInstruction.js +2 -0
  570. package/dist/esm/instructions/createReverseInstruction.js.map +1 -0
  571. package/dist/esm/instructions/createSplitV2Instruction.d.ts +24 -0
  572. package/dist/esm/instructions/createSplitV2Instruction.js +2 -0
  573. package/dist/esm/instructions/createSplitV2Instruction.js.map +1 -0
  574. package/dist/esm/instructions/createV2Instruction.d.ts +19 -0
  575. package/dist/esm/instructions/createV2Instruction.js +2 -0
  576. package/dist/esm/instructions/createV2Instruction.js.map +1 -0
  577. package/dist/esm/instructions/createWithNftInstruction.d.ts +19 -0
  578. package/dist/esm/instructions/createWithNftInstruction.js +2 -0
  579. package/dist/esm/instructions/createWithNftInstruction.js.map +1 -0
  580. package/dist/esm/instructions/deleteInstruction.d.ts +2 -0
  581. package/dist/esm/instructions/deleteInstruction.js +2 -0
  582. package/dist/esm/instructions/deleteInstruction.js.map +1 -0
  583. package/dist/esm/instructions/reallocInstruction.d.ts +3 -0
  584. package/dist/esm/instructions/reallocInstruction.js +2 -0
  585. package/dist/esm/instructions/reallocInstruction.js.map +1 -0
  586. package/dist/esm/instructions/registerFavoriteInstruction.d.ts +12 -0
  587. package/dist/esm/instructions/registerFavoriteInstruction.js +2 -0
  588. package/dist/esm/instructions/registerFavoriteInstruction.js.map +1 -0
  589. package/dist/esm/instructions/transferInstruction.d.ts +2 -0
  590. package/dist/esm/instructions/transferInstruction.js +2 -0
  591. package/dist/esm/instructions/transferInstruction.js.map +1 -0
  592. package/dist/esm/instructions/types.d.ts +6 -0
  593. package/dist/esm/instructions/types.js +2 -0
  594. package/dist/esm/instructions/types.js.map +1 -0
  595. package/dist/esm/instructions/updateInstruction.d.ts +6 -0
  596. package/dist/esm/instructions/updateInstruction.js +2 -0
  597. package/dist/esm/instructions/updateInstruction.js.map +1 -0
  598. package/dist/esm/int.d.ts +31 -0
  599. package/dist/esm/int.js +2 -0
  600. package/dist/esm/int.js.map +1 -0
  601. package/dist/esm/nft/const.d.ts +6 -0
  602. package/dist/esm/nft/const.js +2 -0
  603. package/dist/esm/nft/const.js.map +1 -0
  604. package/dist/esm/nft/getDomainMint.d.ts +2 -0
  605. package/dist/esm/nft/getDomainMint.js +2 -0
  606. package/dist/esm/nft/getDomainMint.js.map +1 -0
  607. package/dist/esm/nft/getRecordFromMint.d.ts +9 -0
  608. package/dist/esm/nft/getRecordFromMint.js +2 -0
  609. package/dist/esm/nft/getRecordFromMint.js.map +1 -0
  610. package/dist/esm/nft/retrieveNftOwner.d.ts +9 -0
  611. package/dist/esm/nft/retrieveNftOwner.js +2 -0
  612. package/dist/esm/nft/retrieveNftOwner.js.map +1 -0
  613. package/dist/esm/nft/retrieveNftOwnerV2.d.ts +2 -0
  614. package/dist/esm/nft/retrieveNftOwnerV2.js +2 -0
  615. package/dist/esm/nft/retrieveNftOwnerV2.js.map +1 -0
  616. package/dist/esm/nft/retrieveNfts.d.ts +8 -0
  617. package/dist/esm/nft/retrieveNfts.js +2 -0
  618. package/dist/esm/nft/retrieveNfts.js.map +1 -0
  619. package/dist/esm/nft/retrieveRecords.d.ts +3 -0
  620. package/dist/esm/nft/retrieveRecords.js +2 -0
  621. package/dist/esm/nft/retrieveRecords.js.map +1 -0
  622. package/dist/esm/nft/state.d.ts +53 -0
  623. package/dist/esm/nft/state.js +2 -0
  624. package/dist/esm/nft/state.js.map +1 -0
  625. package/dist/esm/node_modules/@bonfida/sns-records/dist/index.js +2 -0
  626. package/dist/esm/node_modules/@bonfida/sns-records/dist/index.js.map +1 -0
  627. package/dist/esm/node_modules/@noble/curves/esm/abstract/curve.js +3 -0
  628. package/dist/esm/node_modules/@noble/curves/esm/abstract/curve.js.map +1 -0
  629. package/dist/esm/node_modules/@noble/curves/esm/abstract/edwards.js +4 -0
  630. package/dist/esm/node_modules/@noble/curves/esm/abstract/edwards.js.map +1 -0
  631. package/dist/esm/node_modules/@noble/curves/esm/abstract/modular.js +4 -0
  632. package/dist/esm/node_modules/@noble/curves/esm/abstract/modular.js.map +1 -0
  633. package/dist/esm/node_modules/@noble/curves/esm/abstract/utils.js +3 -0
  634. package/dist/esm/node_modules/@noble/curves/esm/abstract/utils.js.map +1 -0
  635. package/dist/esm/node_modules/@noble/curves/esm/ed25519.js +4 -0
  636. package/dist/esm/node_modules/@noble/curves/esm/ed25519.js.map +1 -0
  637. package/dist/esm/node_modules/@noble/hashes/esm/_md.js +2 -0
  638. package/dist/esm/node_modules/@noble/hashes/esm/_md.js.map +1 -0
  639. package/dist/esm/node_modules/@noble/hashes/esm/_u64.js +2 -0
  640. package/dist/esm/node_modules/@noble/hashes/esm/_u64.js.map +1 -0
  641. package/dist/esm/node_modules/@noble/hashes/esm/crypto.js +2 -0
  642. package/dist/esm/node_modules/@noble/hashes/esm/crypto.js.map +1 -0
  643. package/dist/esm/node_modules/@noble/hashes/esm/sha2.js +2 -0
  644. package/dist/esm/node_modules/@noble/hashes/esm/sha2.js.map +1 -0
  645. package/dist/esm/node_modules/@noble/hashes/esm/sha256.js +2 -0
  646. package/dist/esm/node_modules/@noble/hashes/esm/sha256.js.map +1 -0
  647. package/dist/esm/node_modules/@noble/hashes/esm/utils.js +4 -0
  648. package/dist/esm/node_modules/@noble/hashes/esm/utils.js.map +1 -0
  649. package/dist/esm/node_modules/@scure/base/lib/esm/index.js +3 -0
  650. package/dist/esm/node_modules/@scure/base/lib/esm/index.js.map +1 -0
  651. package/dist/esm/node_modules/@solana/spl-token/lib/esm/constants.js +2 -0
  652. package/dist/esm/node_modules/@solana/spl-token/lib/esm/constants.js.map +1 -0
  653. package/dist/esm/node_modules/@solana/spl-token/lib/esm/errors.js +2 -0
  654. package/dist/esm/node_modules/@solana/spl-token/lib/esm/errors.js.map +1 -0
  655. package/dist/esm/node_modules/@solana/spl-token/lib/esm/extensions/accountType.js +2 -0
  656. package/dist/esm/node_modules/@solana/spl-token/lib/esm/extensions/accountType.js.map +1 -0
  657. package/dist/esm/node_modules/@solana/spl-token/lib/esm/instructions/associatedTokenAccount.js +2 -0
  658. package/dist/esm/node_modules/@solana/spl-token/lib/esm/instructions/associatedTokenAccount.js.map +1 -0
  659. package/dist/esm/node_modules/@solana/spl-token/lib/esm/state/account.js +2 -0
  660. package/dist/esm/node_modules/@solana/spl-token/lib/esm/state/account.js.map +1 -0
  661. package/dist/esm/node_modules/@solana/spl-token/lib/esm/state/mint.js +2 -0
  662. package/dist/esm/node_modules/@solana/spl-token/lib/esm/state/mint.js.map +1 -0
  663. package/dist/esm/node_modules/@solana/spl-token/lib/esm/state/multisig.js +2 -0
  664. package/dist/esm/node_modules/@solana/spl-token/lib/esm/state/multisig.js.map +1 -0
  665. package/dist/esm/node_modules/base64-js/index.js +2 -0
  666. package/dist/esm/node_modules/base64-js/index.js.map +1 -0
  667. package/dist/esm/node_modules/borsh/lib/esm/buffer.js +2 -0
  668. package/dist/esm/node_modules/borsh/lib/esm/buffer.js.map +1 -0
  669. package/dist/esm/node_modules/borsh/lib/esm/deserialize.js +2 -0
  670. package/dist/esm/node_modules/borsh/lib/esm/deserialize.js.map +1 -0
  671. package/dist/esm/node_modules/borsh/lib/esm/index.js +2 -0
  672. package/dist/esm/node_modules/borsh/lib/esm/index.js.map +1 -0
  673. package/dist/esm/node_modules/borsh/lib/esm/serialize.js +2 -0
  674. package/dist/esm/node_modules/borsh/lib/esm/serialize.js.map +1 -0
  675. package/dist/esm/node_modules/borsh/lib/esm/types.js +2 -0
  676. package/dist/esm/node_modules/borsh/lib/esm/types.js.map +1 -0
  677. package/dist/esm/node_modules/borsh/lib/esm/utils.js +2 -0
  678. package/dist/esm/node_modules/borsh/lib/esm/utils.js.map +1 -0
  679. package/dist/esm/node_modules/bs58/index.js +2 -0
  680. package/dist/esm/node_modules/bs58/index.js.map +1 -0
  681. package/dist/esm/node_modules/bs58/node_modules/base-x/src/index.js +2 -0
  682. package/dist/esm/node_modules/bs58/node_modules/base-x/src/index.js.map +1 -0
  683. package/dist/esm/node_modules/buffer/index.js +8 -0
  684. package/dist/esm/node_modules/buffer/index.js.map +1 -0
  685. package/dist/esm/node_modules/graphemesplit/extPict.json.js +2 -0
  686. package/dist/esm/node_modules/graphemesplit/extPict.json.js.map +1 -0
  687. package/dist/esm/node_modules/graphemesplit/inCB.json.js +2 -0
  688. package/dist/esm/node_modules/graphemesplit/inCB.json.js.map +1 -0
  689. package/dist/esm/node_modules/graphemesplit/index.js +2 -0
  690. package/dist/esm/node_modules/graphemesplit/index.js.map +1 -0
  691. package/dist/esm/node_modules/graphemesplit/typeTrie.json.js +2 -0
  692. package/dist/esm/node_modules/graphemesplit/typeTrie.json.js.map +1 -0
  693. package/dist/esm/node_modules/graphemesplit/types.js +2 -0
  694. package/dist/esm/node_modules/graphemesplit/types.js.map +1 -0
  695. package/dist/esm/node_modules/ieee754/index.js +3 -0
  696. package/dist/esm/node_modules/ieee754/index.js.map +1 -0
  697. package/dist/esm/node_modules/ipaddr.js/lib/ipaddr.js +2 -0
  698. package/dist/esm/node_modules/ipaddr.js/lib/ipaddr.js.map +1 -0
  699. package/dist/esm/node_modules/js-base64/base64.js +2 -0
  700. package/dist/esm/node_modules/js-base64/base64.js.map +1 -0
  701. package/dist/esm/node_modules/punycode/punycode.es6.js +2 -0
  702. package/dist/esm/node_modules/punycode/punycode.es6.js.map +1 -0
  703. package/dist/esm/node_modules/tiny-inflate/index.js +2 -0
  704. package/dist/esm/node_modules/tiny-inflate/index.js.map +1 -0
  705. package/dist/esm/node_modules/unicode-trie/index.js +2 -0
  706. package/dist/esm/node_modules/unicode-trie/index.js.map +1 -0
  707. package/dist/esm/node_modules/unicode-trie/swap.js +2 -0
  708. package/dist/esm/node_modules/unicode-trie/swap.js.map +1 -0
  709. package/dist/esm/record/checkSolRecord.d.ts +9 -0
  710. package/dist/esm/record/checkSolRecord.js +2 -0
  711. package/dist/esm/record/checkSolRecord.js.map +1 -0
  712. package/dist/esm/record/deserializeRecord.d.ts +11 -0
  713. package/dist/esm/record/deserializeRecord.js +2 -0
  714. package/dist/esm/record/deserializeRecord.js.map +1 -0
  715. package/dist/esm/record/getRecord.d.ts +5 -0
  716. package/dist/esm/record/getRecord.js +2 -0
  717. package/dist/esm/record/getRecord.js.map +1 -0
  718. package/dist/esm/record/getRecordKeySync.d.ts +8 -0
  719. package/dist/esm/record/getRecordKeySync.js +2 -0
  720. package/dist/esm/record/getRecordKeySync.js.map +1 -0
  721. package/dist/esm/record/getRecords.d.ts +5 -0
  722. package/dist/esm/record/getRecords.js +2 -0
  723. package/dist/esm/record/getRecords.js.map +1 -0
  724. package/dist/esm/record/helpers/getArweaveRecord.d.ts +8 -0
  725. package/dist/esm/record/helpers/getArweaveRecord.js +2 -0
  726. package/dist/esm/record/helpers/getArweaveRecord.js.map +1 -0
  727. package/dist/esm/record/helpers/getBackgroundRecord.d.ts +9 -0
  728. package/dist/esm/record/helpers/getBackgroundRecord.js +2 -0
  729. package/dist/esm/record/helpers/getBackgroundRecord.js.map +1 -0
  730. package/dist/esm/record/helpers/getBackpackRecord.d.ts +8 -0
  731. package/dist/esm/record/helpers/getBackpackRecord.js +2 -0
  732. package/dist/esm/record/helpers/getBackpackRecord.js.map +1 -0
  733. package/dist/esm/record/helpers/getBscRecord.d.ts +8 -0
  734. package/dist/esm/record/helpers/getBscRecord.js +2 -0
  735. package/dist/esm/record/helpers/getBscRecord.js.map +1 -0
  736. package/dist/esm/record/helpers/getBtcRecord.d.ts +8 -0
  737. package/dist/esm/record/helpers/getBtcRecord.js +2 -0
  738. package/dist/esm/record/helpers/getBtcRecord.js.map +1 -0
  739. package/dist/esm/record/helpers/getDiscordRecord.d.ts +8 -0
  740. package/dist/esm/record/helpers/getDiscordRecord.js +2 -0
  741. package/dist/esm/record/helpers/getDiscordRecord.js.map +1 -0
  742. package/dist/esm/record/helpers/getDogeRecord.d.ts +8 -0
  743. package/dist/esm/record/helpers/getDogeRecord.js +2 -0
  744. package/dist/esm/record/helpers/getDogeRecord.js.map +1 -0
  745. package/dist/esm/record/helpers/getEmailRecord.d.ts +8 -0
  746. package/dist/esm/record/helpers/getEmailRecord.js +2 -0
  747. package/dist/esm/record/helpers/getEmailRecord.js.map +1 -0
  748. package/dist/esm/record/helpers/getEthRecord.d.ts +8 -0
  749. package/dist/esm/record/helpers/getEthRecord.js +2 -0
  750. package/dist/esm/record/helpers/getEthRecord.js.map +1 -0
  751. package/dist/esm/record/helpers/getGithubRecord.d.ts +8 -0
  752. package/dist/esm/record/helpers/getGithubRecord.js +2 -0
  753. package/dist/esm/record/helpers/getGithubRecord.js.map +1 -0
  754. package/dist/esm/record/helpers/getInjectiveRecord.d.ts +8 -0
  755. package/dist/esm/record/helpers/getInjectiveRecord.js +2 -0
  756. package/dist/esm/record/helpers/getInjectiveRecord.js.map +1 -0
  757. package/dist/esm/record/helpers/getIpfsRecord.d.ts +8 -0
  758. package/dist/esm/record/helpers/getIpfsRecord.js +2 -0
  759. package/dist/esm/record/helpers/getIpfsRecord.js.map +1 -0
  760. package/dist/esm/record/helpers/getLtcRecord.d.ts +8 -0
  761. package/dist/esm/record/helpers/getLtcRecord.js +2 -0
  762. package/dist/esm/record/helpers/getLtcRecord.js.map +1 -0
  763. package/dist/esm/record/helpers/getPicRecord.d.ts +8 -0
  764. package/dist/esm/record/helpers/getPicRecord.js +2 -0
  765. package/dist/esm/record/helpers/getPicRecord.js.map +1 -0
  766. package/dist/esm/record/helpers/getPointRecord.d.ts +8 -0
  767. package/dist/esm/record/helpers/getPointRecord.js +2 -0
  768. package/dist/esm/record/helpers/getPointRecord.js.map +1 -0
  769. package/dist/esm/record/helpers/getRedditRecord.d.ts +8 -0
  770. package/dist/esm/record/helpers/getRedditRecord.js +2 -0
  771. package/dist/esm/record/helpers/getRedditRecord.js.map +1 -0
  772. package/dist/esm/record/helpers/getShdwRecord.d.ts +8 -0
  773. package/dist/esm/record/helpers/getShdwRecord.js +2 -0
  774. package/dist/esm/record/helpers/getShdwRecord.js.map +1 -0
  775. package/dist/esm/record/helpers/getSolRecord.d.ts +8 -0
  776. package/dist/esm/record/helpers/getSolRecord.js +2 -0
  777. package/dist/esm/record/helpers/getSolRecord.js.map +1 -0
  778. package/dist/esm/record/helpers/getTelegramRecord.d.ts +8 -0
  779. package/dist/esm/record/helpers/getTelegramRecord.js +2 -0
  780. package/dist/esm/record/helpers/getTelegramRecord.js.map +1 -0
  781. package/dist/esm/record/helpers/getTwitterRecord.d.ts +8 -0
  782. package/dist/esm/record/helpers/getTwitterRecord.js +2 -0
  783. package/dist/esm/record/helpers/getTwitterRecord.js.map +1 -0
  784. package/dist/esm/record/helpers/getUrlRecord.d.ts +8 -0
  785. package/dist/esm/record/helpers/getUrlRecord.js +2 -0
  786. package/dist/esm/record/helpers/getUrlRecord.js.map +1 -0
  787. package/dist/esm/record/serializeRecord.d.ts +12 -0
  788. package/dist/esm/record/serializeRecord.js +2 -0
  789. package/dist/esm/record/serializeRecord.js.map +1 -0
  790. package/dist/esm/record/serializeSolRecord.d.ts +13 -0
  791. package/dist/esm/record/serializeSolRecord.js +2 -0
  792. package/dist/esm/record/serializeSolRecord.js.map +1 -0
  793. package/dist/esm/record_v2/const.d.ts +20 -0
  794. package/dist/esm/record_v2/const.js +2 -0
  795. package/dist/esm/record_v2/const.js.map +1 -0
  796. package/dist/esm/record_v2/deserializeRecordV2Content.d.ts +11 -0
  797. package/dist/esm/record_v2/deserializeRecordV2Content.js +2 -0
  798. package/dist/esm/record_v2/deserializeRecordV2Content.js.map +1 -0
  799. package/dist/esm/record_v2/getMultipleRecordsV2.d.ts +20 -0
  800. package/dist/esm/record_v2/getMultipleRecordsV2.js +2 -0
  801. package/dist/esm/record_v2/getMultipleRecordsV2.js.map +1 -0
  802. package/dist/esm/record_v2/getRecordV2.d.ts +21 -0
  803. package/dist/esm/record_v2/getRecordV2.js +2 -0
  804. package/dist/esm/record_v2/getRecordV2.js.map +1 -0
  805. package/dist/esm/record_v2/getRecordV2Key.d.ts +9 -0
  806. package/dist/esm/record_v2/getRecordV2Key.js +2 -0
  807. package/dist/esm/record_v2/getRecordV2Key.js.map +1 -0
  808. package/dist/esm/record_v2/serializeRecordV2Content.d.ts +12 -0
  809. package/dist/esm/record_v2/serializeRecordV2Content.js +2 -0
  810. package/dist/esm/record_v2/serializeRecordV2Content.js.map +1 -0
  811. package/dist/esm/record_v2/utils.d.ts +10 -0
  812. package/dist/esm/record_v2/utils.js +2 -0
  813. package/dist/esm/record_v2/utils.js.map +1 -0
  814. package/dist/esm/record_v2/verifyRightOfAssociation.d.ts +16 -0
  815. package/dist/esm/record_v2/verifyRightOfAssociation.js +2 -0
  816. package/dist/esm/record_v2/verifyRightOfAssociation.js.map +1 -0
  817. package/dist/esm/resolve/resolve.d.ts +18 -0
  818. package/dist/esm/resolve/resolve.js +2 -0
  819. package/dist/esm/resolve/resolve.js.map +1 -0
  820. package/dist/esm/resolve/resolveSolRecordV1.d.ts +2 -0
  821. package/dist/esm/resolve/resolveSolRecordV1.js +2 -0
  822. package/dist/esm/resolve/resolveSolRecordV1.js.map +1 -0
  823. package/dist/esm/resolve/resolveSolRecordV2.d.ts +2 -0
  824. package/dist/esm/resolve/resolveSolRecordV2.js +2 -0
  825. package/dist/esm/resolve/resolveSolRecordV2.js.map +1 -0
  826. package/dist/esm/state.d.ts +45 -0
  827. package/dist/esm/state.js +2 -0
  828. package/dist/esm/state.js.map +1 -0
  829. package/dist/esm/twitter/ReverseTwitterRegistryState.d.ts +21 -0
  830. package/dist/esm/twitter/ReverseTwitterRegistryState.js +2 -0
  831. package/dist/esm/twitter/ReverseTwitterRegistryState.js.map +1 -0
  832. package/dist/esm/twitter/changeTwitterRegistryData.d.ts +6 -0
  833. package/dist/esm/twitter/changeTwitterRegistryData.js +2 -0
  834. package/dist/esm/twitter/changeTwitterRegistryData.js.map +1 -0
  835. package/dist/esm/twitter/changeVerifiedPubkey.d.ts +2 -0
  836. package/dist/esm/twitter/changeVerifiedPubkey.js +2 -0
  837. package/dist/esm/twitter/changeVerifiedPubkey.js.map +1 -0
  838. package/dist/esm/twitter/createReverseTwitterRegistry.d.ts +2 -0
  839. package/dist/esm/twitter/createReverseTwitterRegistry.js +2 -0
  840. package/dist/esm/twitter/createReverseTwitterRegistry.js.map +1 -0
  841. package/dist/esm/twitter/createVerifiedTwitterRegistry.d.ts +3 -0
  842. package/dist/esm/twitter/createVerifiedTwitterRegistry.js +2 -0
  843. package/dist/esm/twitter/createVerifiedTwitterRegistry.js.map +1 -0
  844. package/dist/esm/twitter/deleteTwitterRegistry.d.ts +2 -0
  845. package/dist/esm/twitter/deleteTwitterRegistry.js +2 -0
  846. package/dist/esm/twitter/deleteTwitterRegistry.js.map +1 -0
  847. package/dist/esm/twitter/getHandleAndRegistryKey.d.ts +2 -0
  848. package/dist/esm/twitter/getHandleAndRegistryKey.js +2 -0
  849. package/dist/esm/twitter/getHandleAndRegistryKey.js.map +1 -0
  850. package/dist/esm/twitter/getTwitterHandleandRegistryKeyViaFilters.d.ts +2 -0
  851. package/dist/esm/twitter/getTwitterHandleandRegistryKeyViaFilters.js +2 -0
  852. package/dist/esm/twitter/getTwitterHandleandRegistryKeyViaFilters.js.map +1 -0
  853. package/dist/esm/twitter/getTwitterRegistry.d.ts +3 -0
  854. package/dist/esm/twitter/getTwitterRegistry.js +2 -0
  855. package/dist/esm/twitter/getTwitterRegistry.js.map +1 -0
  856. package/dist/esm/twitter/getTwitterRegistryData.d.ts +5 -0
  857. package/dist/esm/twitter/getTwitterRegistryData.js +2 -0
  858. package/dist/esm/twitter/getTwitterRegistryData.js.map +1 -0
  859. package/dist/esm/twitter/getTwitterRegistryKey.d.ts +2 -0
  860. package/dist/esm/twitter/getTwitterRegistryKey.js +2 -0
  861. package/dist/esm/twitter/getTwitterRegistryKey.js.map +1 -0
  862. package/dist/esm/types/custom-bg.d.ts +19 -0
  863. package/dist/esm/types/custom-bg.js +2 -0
  864. package/dist/esm/types/custom-bg.js.map +1 -0
  865. package/dist/esm/types/record.d.ts +37 -0
  866. package/dist/esm/types/record.js +2 -0
  867. package/dist/esm/types/record.js.map +1 -0
  868. package/dist/esm/utils/check.d.ts +2 -0
  869. package/dist/esm/utils/check.js +2 -0
  870. package/dist/esm/utils/check.js.map +1 -0
  871. package/dist/esm/utils/deserializeReverse.d.ts +5 -0
  872. package/dist/esm/utils/deserializeReverse.js +2 -0
  873. package/dist/esm/utils/deserializeReverse.js.map +1 -0
  874. package/dist/esm/utils/findSubdomains.d.ts +8 -0
  875. package/dist/esm/utils/findSubdomains.js +2 -0
  876. package/dist/esm/utils/findSubdomains.js.map +1 -0
  877. package/dist/esm/utils/getAllDomains.d.ts +8 -0
  878. package/dist/esm/utils/getAllDomains.js +2 -0
  879. package/dist/esm/utils/getAllDomains.js.map +1 -0
  880. package/dist/esm/utils/getAllRegisteredDomains.d.ts +8 -0
  881. package/dist/esm/utils/getAllRegisteredDomains.js +2 -0
  882. package/dist/esm/utils/getAllRegisteredDomains.js.map +1 -0
  883. package/dist/esm/utils/getDomainKeySync.d.ts +28 -0
  884. package/dist/esm/utils/getDomainKeySync.js +2 -0
  885. package/dist/esm/utils/getDomainKeySync.js.map +1 -0
  886. package/dist/esm/utils/getDomainKeysWithReverses.d.ts +11 -0
  887. package/dist/esm/utils/getDomainKeysWithReverses.js +2 -0
  888. package/dist/esm/utils/getDomainKeysWithReverses.js.map +1 -0
  889. package/dist/esm/utils/getDomainPriceFromName.d.ts +7 -0
  890. package/dist/esm/utils/getDomainPriceFromName.js +2 -0
  891. package/dist/esm/utils/getDomainPriceFromName.js.map +1 -0
  892. package/dist/esm/utils/getHashedNameSync.d.ts +4 -0
  893. package/dist/esm/utils/getHashedNameSync.js +2 -0
  894. package/dist/esm/utils/getHashedNameSync.js.map +1 -0
  895. package/dist/esm/utils/getNameAccountKeySync.d.ts +5 -0
  896. package/dist/esm/utils/getNameAccountKeySync.js +2 -0
  897. package/dist/esm/utils/getNameAccountKeySync.js.map +1 -0
  898. package/dist/esm/utils/getPythFeedAccountKey.d.ts +2 -0
  899. package/dist/esm/utils/getPythFeedAccountKey.js +2 -0
  900. package/dist/esm/utils/getPythFeedAccountKey.js.map +1 -0
  901. package/dist/esm/utils/getReverseKeyFromDomainKey.d.ts +8 -0
  902. package/dist/esm/utils/getReverseKeyFromDomainKey.js +2 -0
  903. package/dist/esm/utils/getReverseKeyFromDomainKey.js.map +1 -0
  904. package/dist/esm/utils/getReverseKeySync.d.ts +7 -0
  905. package/dist/esm/utils/getReverseKeySync.js +2 -0
  906. package/dist/esm/utils/getReverseKeySync.js.map +1 -0
  907. package/dist/esm/utils/getTokenizedDomains.d.ts +12 -0
  908. package/dist/esm/utils/getTokenizedDomains.js +2 -0
  909. package/dist/esm/utils/getTokenizedDomains.js.map +1 -0
  910. package/dist/esm/utils/reverseLookup.d.ts +8 -0
  911. package/dist/esm/utils/reverseLookup.js +2 -0
  912. package/dist/esm/utils/reverseLookup.js.map +1 -0
  913. package/dist/esm/utils/reverseLookupBatch.d.ts +8 -0
  914. package/dist/esm/utils/reverseLookupBatch.js +2 -0
  915. package/dist/esm/utils/reverseLookupBatch.js.map +1 -0
  916. package/package.json +16 -11
  917. package/dist/cjs/_virtual/_commonjsHelpers.cjs +0 -2
  918. package/dist/cjs/_virtual/_commonjsHelpers.cjs.map +0 -1
  919. package/dist/cjs/_virtual/base64.cjs +0 -2
  920. package/dist/cjs/_virtual/base64.cjs.map +0 -1
  921. package/dist/cjs/_virtual/index.cjs +0 -2
  922. package/dist/cjs/_virtual/index.cjs.map +0 -1
  923. package/dist/cjs/_virtual/index2.cjs +0 -2
  924. package/dist/cjs/_virtual/index2.cjs.map +0 -1
  925. package/dist/cjs/_virtual/index3.cjs +0 -2
  926. package/dist/cjs/_virtual/index3.cjs.map +0 -1
  927. package/dist/cjs/_virtual/ipaddr.cjs +0 -2
  928. package/dist/cjs/_virtual/ipaddr.cjs.map +0 -1
  929. package/dist/cjs/bindings/burnDomain.cjs +0 -2
  930. package/dist/cjs/bindings/burnDomain.cjs.map +0 -1
  931. package/dist/cjs/bindings/createNameRegistry.cjs +0 -2
  932. package/dist/cjs/bindings/createNameRegistry.cjs.map +0 -1
  933. package/dist/cjs/bindings/createRecordInstruction.cjs +0 -2
  934. package/dist/cjs/bindings/createRecordInstruction.cjs.map +0 -1
  935. package/dist/cjs/bindings/createRecordV2Instruction.cjs +0 -2
  936. package/dist/cjs/bindings/createRecordV2Instruction.cjs.map +0 -1
  937. package/dist/cjs/bindings/createReverseName.cjs +0 -2
  938. package/dist/cjs/bindings/createReverseName.cjs.map +0 -1
  939. package/dist/cjs/bindings/createSolRecordInstruction.cjs +0 -2
  940. package/dist/cjs/bindings/createSolRecordInstruction.cjs.map +0 -1
  941. package/dist/cjs/bindings/createSubdomain.cjs +0 -2
  942. package/dist/cjs/bindings/createSubdomain.cjs.map +0 -1
  943. package/dist/cjs/bindings/deleteNameRegistry.cjs +0 -2
  944. package/dist/cjs/bindings/deleteNameRegistry.cjs.map +0 -1
  945. package/dist/cjs/bindings/deleteRecordV2.cjs +0 -2
  946. package/dist/cjs/bindings/deleteRecordV2.cjs.map +0 -1
  947. package/dist/cjs/bindings/ethValidateRecordV2Content.cjs +0 -2
  948. package/dist/cjs/bindings/ethValidateRecordV2Content.cjs.map +0 -1
  949. package/dist/cjs/bindings/registerDomainName.cjs +0 -2
  950. package/dist/cjs/bindings/registerDomainName.cjs.map +0 -1
  951. package/dist/cjs/bindings/registerDomainNameV2.cjs +0 -2
  952. package/dist/cjs/bindings/registerDomainNameV2.cjs.map +0 -1
  953. package/dist/cjs/bindings/registerFavorite.cjs +0 -2
  954. package/dist/cjs/bindings/registerFavorite.cjs.map +0 -1
  955. package/dist/cjs/bindings/registerWithNft.cjs +0 -2
  956. package/dist/cjs/bindings/registerWithNft.cjs.map +0 -1
  957. package/dist/cjs/bindings/transferNameOwnership.cjs +0 -2
  958. package/dist/cjs/bindings/transferNameOwnership.cjs.map +0 -1
  959. package/dist/cjs/bindings/transferSubdomain.cjs +0 -2
  960. package/dist/cjs/bindings/transferSubdomain.cjs.map +0 -1
  961. package/dist/cjs/bindings/updateNameRegistryData.cjs +0 -2
  962. package/dist/cjs/bindings/updateNameRegistryData.cjs.map +0 -1
  963. package/dist/cjs/bindings/updateRecordInstruction.cjs +0 -2
  964. package/dist/cjs/bindings/updateRecordInstruction.cjs.map +0 -1
  965. package/dist/cjs/bindings/updateRecordV2Instruction.cjs +0 -2
  966. package/dist/cjs/bindings/updateRecordV2Instruction.cjs.map +0 -1
  967. package/dist/cjs/bindings/updateSolRecordInstruction.cjs +0 -2
  968. package/dist/cjs/bindings/updateSolRecordInstruction.cjs.map +0 -1
  969. package/dist/cjs/bindings/validateRecordV2Content.cjs +0 -2
  970. package/dist/cjs/bindings/validateRecordV2Content.cjs.map +0 -1
  971. package/dist/cjs/bindings/writRoaRecordV2.cjs +0 -2
  972. package/dist/cjs/bindings/writRoaRecordV2.cjs.map +0 -1
  973. package/dist/cjs/constants.cjs +0 -2
  974. package/dist/cjs/constants.cjs.map +0 -1
  975. package/dist/cjs/custom-bg.cjs +0 -2
  976. package/dist/cjs/custom-bg.cjs.map +0 -1
  977. package/dist/cjs/deprecated/utils.cjs +0 -2
  978. package/dist/cjs/deprecated/utils.cjs.map +0 -1
  979. package/dist/cjs/devnet.cjs +0 -2
  980. package/dist/cjs/devnet.cjs.map +0 -1
  981. package/dist/cjs/error.cjs +0 -2
  982. package/dist/cjs/error.cjs.map +0 -1
  983. package/dist/cjs/favorite-domain.cjs +0 -2
  984. package/dist/cjs/favorite-domain.cjs.map +0 -1
  985. package/dist/cjs/index.cjs +0 -2
  986. package/dist/cjs/index.cjs.map +0 -1
  987. package/dist/cjs/instructions/burnInstruction.cjs +0 -2
  988. package/dist/cjs/instructions/burnInstruction.cjs.map +0 -1
  989. package/dist/cjs/instructions/createInstruction.cjs +0 -2
  990. package/dist/cjs/instructions/createInstruction.cjs.map +0 -1
  991. package/dist/cjs/instructions/createInstructionV3.cjs +0 -2
  992. package/dist/cjs/instructions/createInstructionV3.cjs.map +0 -1
  993. package/dist/cjs/instructions/createReverseInstruction.cjs +0 -2
  994. package/dist/cjs/instructions/createReverseInstruction.cjs.map +0 -1
  995. package/dist/cjs/instructions/createSplitV2Instruction.cjs +0 -2
  996. package/dist/cjs/instructions/createSplitV2Instruction.cjs.map +0 -1
  997. package/dist/cjs/instructions/createV2Instruction.cjs +0 -2
  998. package/dist/cjs/instructions/createV2Instruction.cjs.map +0 -1
  999. package/dist/cjs/instructions/createWithNftInstruction.cjs +0 -2
  1000. package/dist/cjs/instructions/createWithNftInstruction.cjs.map +0 -1
  1001. package/dist/cjs/instructions/deleteInstruction.cjs +0 -2
  1002. package/dist/cjs/instructions/deleteInstruction.cjs.map +0 -1
  1003. package/dist/cjs/instructions/reallocInstruction.cjs +0 -2
  1004. package/dist/cjs/instructions/reallocInstruction.cjs.map +0 -1
  1005. package/dist/cjs/instructions/registerFavoriteInstruction.cjs +0 -2
  1006. package/dist/cjs/instructions/registerFavoriteInstruction.cjs.map +0 -1
  1007. package/dist/cjs/instructions/transferInstruction.cjs +0 -2
  1008. package/dist/cjs/instructions/transferInstruction.cjs.map +0 -1
  1009. package/dist/cjs/instructions/types.cjs +0 -2
  1010. package/dist/cjs/instructions/types.cjs.map +0 -1
  1011. package/dist/cjs/instructions/updateInstruction.cjs +0 -2
  1012. package/dist/cjs/instructions/updateInstruction.cjs.map +0 -1
  1013. package/dist/cjs/int.cjs +0 -2
  1014. package/dist/cjs/int.cjs.map +0 -1
  1015. package/dist/cjs/nft/const.cjs +0 -2
  1016. package/dist/cjs/nft/const.cjs.map +0 -1
  1017. package/dist/cjs/nft/getDomainMint.cjs +0 -2
  1018. package/dist/cjs/nft/getDomainMint.cjs.map +0 -1
  1019. package/dist/cjs/nft/getRecordFromMint.cjs +0 -2
  1020. package/dist/cjs/nft/getRecordFromMint.cjs.map +0 -1
  1021. package/dist/cjs/nft/retrieveNftOwner.cjs +0 -2
  1022. package/dist/cjs/nft/retrieveNftOwner.cjs.map +0 -1
  1023. package/dist/cjs/nft/retrieveNftOwnerV2.cjs +0 -2
  1024. package/dist/cjs/nft/retrieveNftOwnerV2.cjs.map +0 -1
  1025. package/dist/cjs/nft/retrieveNfts.cjs +0 -2
  1026. package/dist/cjs/nft/retrieveNfts.cjs.map +0 -1
  1027. package/dist/cjs/nft/retrieveRecords.cjs +0 -2
  1028. package/dist/cjs/nft/retrieveRecords.cjs.map +0 -1
  1029. package/dist/cjs/nft/state.cjs +0 -2
  1030. package/dist/cjs/nft/state.cjs.map +0 -1
  1031. package/dist/cjs/node_modules/@bonfida/sns-records/dist/index.cjs +0 -2
  1032. package/dist/cjs/node_modules/@bonfida/sns-records/dist/index.cjs.map +0 -1
  1033. package/dist/cjs/node_modules/@noble/curves/esm/abstract/curve.cjs +0 -4
  1034. package/dist/cjs/node_modules/@noble/curves/esm/abstract/curve.cjs.map +0 -1
  1035. package/dist/cjs/node_modules/@noble/curves/esm/abstract/edwards.cjs +0 -4
  1036. package/dist/cjs/node_modules/@noble/curves/esm/abstract/edwards.cjs.map +0 -1
  1037. package/dist/cjs/node_modules/@noble/curves/esm/abstract/modular.cjs +0 -4
  1038. package/dist/cjs/node_modules/@noble/curves/esm/abstract/modular.cjs.map +0 -1
  1039. package/dist/cjs/node_modules/@noble/curves/esm/abstract/utils.cjs +0 -3
  1040. package/dist/cjs/node_modules/@noble/curves/esm/abstract/utils.cjs.map +0 -1
  1041. package/dist/cjs/node_modules/@noble/curves/esm/ed25519.cjs +0 -4
  1042. package/dist/cjs/node_modules/@noble/curves/esm/ed25519.cjs.map +0 -1
  1043. package/dist/cjs/node_modules/@noble/hashes/esm/_md.cjs +0 -2
  1044. package/dist/cjs/node_modules/@noble/hashes/esm/_md.cjs.map +0 -1
  1045. package/dist/cjs/node_modules/@noble/hashes/esm/_u64.cjs +0 -2
  1046. package/dist/cjs/node_modules/@noble/hashes/esm/_u64.cjs.map +0 -1
  1047. package/dist/cjs/node_modules/@noble/hashes/esm/crypto.cjs +0 -2
  1048. package/dist/cjs/node_modules/@noble/hashes/esm/crypto.cjs.map +0 -1
  1049. package/dist/cjs/node_modules/@noble/hashes/esm/sha2.cjs +0 -2
  1050. package/dist/cjs/node_modules/@noble/hashes/esm/sha2.cjs.map +0 -1
  1051. package/dist/cjs/node_modules/@noble/hashes/esm/sha256.cjs +0 -2
  1052. package/dist/cjs/node_modules/@noble/hashes/esm/sha256.cjs.map +0 -1
  1053. package/dist/cjs/node_modules/@noble/hashes/esm/utils.cjs +0 -3
  1054. package/dist/cjs/node_modules/@noble/hashes/esm/utils.cjs.map +0 -1
  1055. package/dist/cjs/node_modules/@scure/base/lib/esm/index.cjs +0 -3
  1056. package/dist/cjs/node_modules/@scure/base/lib/esm/index.cjs.map +0 -1
  1057. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/constants.cjs +0 -2
  1058. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/constants.cjs.map +0 -1
  1059. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/errors.cjs +0 -2
  1060. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/errors.cjs.map +0 -1
  1061. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/extensions/accountType.cjs +0 -2
  1062. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/extensions/accountType.cjs.map +0 -1
  1063. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/instructions/associatedTokenAccount.cjs +0 -2
  1064. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/instructions/associatedTokenAccount.cjs.map +0 -1
  1065. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/state/account.cjs +0 -2
  1066. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/state/account.cjs.map +0 -1
  1067. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/state/mint.cjs +0 -2
  1068. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/state/mint.cjs.map +0 -1
  1069. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/state/multisig.cjs +0 -2
  1070. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/state/multisig.cjs.map +0 -1
  1071. package/dist/cjs/node_modules/base64-js/index.cjs +0 -2
  1072. package/dist/cjs/node_modules/base64-js/index.cjs.map +0 -1
  1073. package/dist/cjs/node_modules/borsh/lib/esm/buffer.cjs +0 -2
  1074. package/dist/cjs/node_modules/borsh/lib/esm/buffer.cjs.map +0 -1
  1075. package/dist/cjs/node_modules/borsh/lib/esm/deserialize.cjs +0 -2
  1076. package/dist/cjs/node_modules/borsh/lib/esm/deserialize.cjs.map +0 -1
  1077. package/dist/cjs/node_modules/borsh/lib/esm/index.cjs +0 -2
  1078. package/dist/cjs/node_modules/borsh/lib/esm/index.cjs.map +0 -1
  1079. package/dist/cjs/node_modules/borsh/lib/esm/serialize.cjs +0 -2
  1080. package/dist/cjs/node_modules/borsh/lib/esm/serialize.cjs.map +0 -1
  1081. package/dist/cjs/node_modules/borsh/lib/esm/types.cjs +0 -2
  1082. package/dist/cjs/node_modules/borsh/lib/esm/types.cjs.map +0 -1
  1083. package/dist/cjs/node_modules/borsh/lib/esm/utils.cjs +0 -2
  1084. package/dist/cjs/node_modules/borsh/lib/esm/utils.cjs.map +0 -1
  1085. package/dist/cjs/node_modules/bs58/index.cjs +0 -2
  1086. package/dist/cjs/node_modules/bs58/index.cjs.map +0 -1
  1087. package/dist/cjs/node_modules/bs58/node_modules/base-x/src/index.cjs +0 -2
  1088. package/dist/cjs/node_modules/bs58/node_modules/base-x/src/index.cjs.map +0 -1
  1089. package/dist/cjs/node_modules/buffer/index.cjs +0 -9
  1090. package/dist/cjs/node_modules/buffer/index.cjs.map +0 -1
  1091. package/dist/cjs/node_modules/graphemesplit/extPict.json.cjs +0 -2
  1092. package/dist/cjs/node_modules/graphemesplit/extPict.json.cjs.map +0 -1
  1093. package/dist/cjs/node_modules/graphemesplit/inCB.json.cjs +0 -2
  1094. package/dist/cjs/node_modules/graphemesplit/inCB.json.cjs.map +0 -1
  1095. package/dist/cjs/node_modules/graphemesplit/index.cjs +0 -2
  1096. package/dist/cjs/node_modules/graphemesplit/index.cjs.map +0 -1
  1097. package/dist/cjs/node_modules/graphemesplit/typeTrie.json.cjs +0 -2
  1098. package/dist/cjs/node_modules/graphemesplit/typeTrie.json.cjs.map +0 -1
  1099. package/dist/cjs/node_modules/graphemesplit/types.cjs +0 -2
  1100. package/dist/cjs/node_modules/graphemesplit/types.cjs.map +0 -1
  1101. package/dist/cjs/node_modules/ieee754/index.cjs +0 -3
  1102. package/dist/cjs/node_modules/ieee754/index.cjs.map +0 -1
  1103. package/dist/cjs/node_modules/ipaddr.js/lib/ipaddr.cjs +0 -2
  1104. package/dist/cjs/node_modules/ipaddr.js/lib/ipaddr.cjs.map +0 -1
  1105. package/dist/cjs/node_modules/js-base64/base64.cjs +0 -2
  1106. package/dist/cjs/node_modules/js-base64/base64.cjs.map +0 -1
  1107. package/dist/cjs/node_modules/punycode/punycode.es6.cjs +0 -2
  1108. package/dist/cjs/node_modules/punycode/punycode.es6.cjs.map +0 -1
  1109. package/dist/cjs/node_modules/tiny-inflate/index.cjs +0 -2
  1110. package/dist/cjs/node_modules/tiny-inflate/index.cjs.map +0 -1
  1111. package/dist/cjs/node_modules/unicode-trie/index.cjs +0 -2
  1112. package/dist/cjs/node_modules/unicode-trie/index.cjs.map +0 -1
  1113. package/dist/cjs/node_modules/unicode-trie/swap.cjs +0 -2
  1114. package/dist/cjs/node_modules/unicode-trie/swap.cjs.map +0 -1
  1115. package/dist/cjs/record/checkSolRecord.cjs +0 -2
  1116. package/dist/cjs/record/checkSolRecord.cjs.map +0 -1
  1117. package/dist/cjs/record/deserializeRecord.cjs +0 -2
  1118. package/dist/cjs/record/deserializeRecord.cjs.map +0 -1
  1119. package/dist/cjs/record/getRecord.cjs +0 -2
  1120. package/dist/cjs/record/getRecord.cjs.map +0 -1
  1121. package/dist/cjs/record/getRecordKeySync.cjs +0 -2
  1122. package/dist/cjs/record/getRecordKeySync.cjs.map +0 -1
  1123. package/dist/cjs/record/getRecords.cjs +0 -2
  1124. package/dist/cjs/record/getRecords.cjs.map +0 -1
  1125. package/dist/cjs/record/helpers/getArweaveRecord.cjs +0 -2
  1126. package/dist/cjs/record/helpers/getArweaveRecord.cjs.map +0 -1
  1127. package/dist/cjs/record/helpers/getBackgroundRecord.cjs +0 -2
  1128. package/dist/cjs/record/helpers/getBackgroundRecord.cjs.map +0 -1
  1129. package/dist/cjs/record/helpers/getBackpackRecord.cjs +0 -2
  1130. package/dist/cjs/record/helpers/getBackpackRecord.cjs.map +0 -1
  1131. package/dist/cjs/record/helpers/getBscRecord.cjs +0 -2
  1132. package/dist/cjs/record/helpers/getBscRecord.cjs.map +0 -1
  1133. package/dist/cjs/record/helpers/getBtcRecord.cjs +0 -2
  1134. package/dist/cjs/record/helpers/getBtcRecord.cjs.map +0 -1
  1135. package/dist/cjs/record/helpers/getDiscordRecord.cjs +0 -2
  1136. package/dist/cjs/record/helpers/getDiscordRecord.cjs.map +0 -1
  1137. package/dist/cjs/record/helpers/getDogeRecord.cjs +0 -2
  1138. package/dist/cjs/record/helpers/getDogeRecord.cjs.map +0 -1
  1139. package/dist/cjs/record/helpers/getEmailRecord.cjs +0 -2
  1140. package/dist/cjs/record/helpers/getEmailRecord.cjs.map +0 -1
  1141. package/dist/cjs/record/helpers/getEthRecord.cjs +0 -2
  1142. package/dist/cjs/record/helpers/getEthRecord.cjs.map +0 -1
  1143. package/dist/cjs/record/helpers/getGithubRecord.cjs +0 -2
  1144. package/dist/cjs/record/helpers/getGithubRecord.cjs.map +0 -1
  1145. package/dist/cjs/record/helpers/getInjectiveRecord.cjs +0 -2
  1146. package/dist/cjs/record/helpers/getInjectiveRecord.cjs.map +0 -1
  1147. package/dist/cjs/record/helpers/getIpfsRecord.cjs +0 -2
  1148. package/dist/cjs/record/helpers/getIpfsRecord.cjs.map +0 -1
  1149. package/dist/cjs/record/helpers/getLtcRecord.cjs +0 -2
  1150. package/dist/cjs/record/helpers/getLtcRecord.cjs.map +0 -1
  1151. package/dist/cjs/record/helpers/getPicRecord.cjs +0 -2
  1152. package/dist/cjs/record/helpers/getPicRecord.cjs.map +0 -1
  1153. package/dist/cjs/record/helpers/getPointRecord.cjs +0 -2
  1154. package/dist/cjs/record/helpers/getPointRecord.cjs.map +0 -1
  1155. package/dist/cjs/record/helpers/getRedditRecord.cjs +0 -2
  1156. package/dist/cjs/record/helpers/getRedditRecord.cjs.map +0 -1
  1157. package/dist/cjs/record/helpers/getShdwRecord.cjs +0 -2
  1158. package/dist/cjs/record/helpers/getShdwRecord.cjs.map +0 -1
  1159. package/dist/cjs/record/helpers/getSolRecord.cjs +0 -2
  1160. package/dist/cjs/record/helpers/getSolRecord.cjs.map +0 -1
  1161. package/dist/cjs/record/helpers/getTelegramRecord.cjs +0 -2
  1162. package/dist/cjs/record/helpers/getTelegramRecord.cjs.map +0 -1
  1163. package/dist/cjs/record/helpers/getTwitterRecord.cjs +0 -2
  1164. package/dist/cjs/record/helpers/getTwitterRecord.cjs.map +0 -1
  1165. package/dist/cjs/record/helpers/getUrlRecord.cjs +0 -2
  1166. package/dist/cjs/record/helpers/getUrlRecord.cjs.map +0 -1
  1167. package/dist/cjs/record/serializeRecord.cjs +0 -2
  1168. package/dist/cjs/record/serializeRecord.cjs.map +0 -1
  1169. package/dist/cjs/record/serializeSolRecord.cjs +0 -2
  1170. package/dist/cjs/record/serializeSolRecord.cjs.map +0 -1
  1171. package/dist/cjs/record_v2/const.cjs +0 -2
  1172. package/dist/cjs/record_v2/const.cjs.map +0 -1
  1173. package/dist/cjs/record_v2/deserializeRecordV2Content.cjs +0 -2
  1174. package/dist/cjs/record_v2/deserializeRecordV2Content.cjs.map +0 -1
  1175. package/dist/cjs/record_v2/getMultipleRecordsV2.cjs +0 -2
  1176. package/dist/cjs/record_v2/getMultipleRecordsV2.cjs.map +0 -1
  1177. package/dist/cjs/record_v2/getRecordV2.cjs +0 -2
  1178. package/dist/cjs/record_v2/getRecordV2.cjs.map +0 -1
  1179. package/dist/cjs/record_v2/getRecordV2Key.cjs +0 -2
  1180. package/dist/cjs/record_v2/getRecordV2Key.cjs.map +0 -1
  1181. package/dist/cjs/record_v2/serializeRecordV2Content.cjs +0 -2
  1182. package/dist/cjs/record_v2/serializeRecordV2Content.cjs.map +0 -1
  1183. package/dist/cjs/record_v2/utils.cjs +0 -2
  1184. package/dist/cjs/record_v2/utils.cjs.map +0 -1
  1185. package/dist/cjs/record_v2/verifyRightOfAssociation.cjs +0 -2
  1186. package/dist/cjs/record_v2/verifyRightOfAssociation.cjs.map +0 -1
  1187. package/dist/cjs/resolve/resolve.cjs +0 -2
  1188. package/dist/cjs/resolve/resolve.cjs.map +0 -1
  1189. package/dist/cjs/resolve/resolveSolRecordV1.cjs +0 -2
  1190. package/dist/cjs/resolve/resolveSolRecordV1.cjs.map +0 -1
  1191. package/dist/cjs/resolve/resolveSolRecordV2.cjs +0 -2
  1192. package/dist/cjs/resolve/resolveSolRecordV2.cjs.map +0 -1
  1193. package/dist/cjs/state.cjs +0 -2
  1194. package/dist/cjs/state.cjs.map +0 -1
  1195. package/dist/cjs/twitter/ReverseTwitterRegistryState.cjs +0 -2
  1196. package/dist/cjs/twitter/ReverseTwitterRegistryState.cjs.map +0 -1
  1197. package/dist/cjs/twitter/changeTwitterRegistryData.cjs +0 -2
  1198. package/dist/cjs/twitter/changeTwitterRegistryData.cjs.map +0 -1
  1199. package/dist/cjs/twitter/changeVerifiedPubkey.cjs +0 -2
  1200. package/dist/cjs/twitter/changeVerifiedPubkey.cjs.map +0 -1
  1201. package/dist/cjs/twitter/createReverseTwitterRegistry.cjs +0 -2
  1202. package/dist/cjs/twitter/createReverseTwitterRegistry.cjs.map +0 -1
  1203. package/dist/cjs/twitter/createVerifiedTwitterRegistry.cjs +0 -2
  1204. package/dist/cjs/twitter/createVerifiedTwitterRegistry.cjs.map +0 -1
  1205. package/dist/cjs/twitter/deleteTwitterRegistry.cjs +0 -2
  1206. package/dist/cjs/twitter/deleteTwitterRegistry.cjs.map +0 -1
  1207. package/dist/cjs/twitter/getHandleAndRegistryKey.cjs +0 -2
  1208. package/dist/cjs/twitter/getHandleAndRegistryKey.cjs.map +0 -1
  1209. package/dist/cjs/twitter/getTwitterHandleandRegistryKeyViaFilters.cjs +0 -2
  1210. package/dist/cjs/twitter/getTwitterHandleandRegistryKeyViaFilters.cjs.map +0 -1
  1211. package/dist/cjs/twitter/getTwitterRegistry.cjs +0 -2
  1212. package/dist/cjs/twitter/getTwitterRegistry.cjs.map +0 -1
  1213. package/dist/cjs/twitter/getTwitterRegistryData.cjs +0 -2
  1214. package/dist/cjs/twitter/getTwitterRegistryData.cjs.map +0 -1
  1215. package/dist/cjs/twitter/getTwitterRegistryKey.cjs +0 -2
  1216. package/dist/cjs/twitter/getTwitterRegistryKey.cjs.map +0 -1
  1217. package/dist/cjs/types/custom-bg.cjs +0 -2
  1218. package/dist/cjs/types/custom-bg.cjs.map +0 -1
  1219. package/dist/cjs/types/record.cjs +0 -2
  1220. package/dist/cjs/types/record.cjs.map +0 -1
  1221. package/dist/cjs/utils/check.cjs +0 -2
  1222. package/dist/cjs/utils/check.cjs.map +0 -1
  1223. package/dist/cjs/utils/deserializeReverse.cjs +0 -2
  1224. package/dist/cjs/utils/deserializeReverse.cjs.map +0 -1
  1225. package/dist/cjs/utils/findSubdomains.cjs +0 -2
  1226. package/dist/cjs/utils/findSubdomains.cjs.map +0 -1
  1227. package/dist/cjs/utils/getAllDomains.cjs +0 -2
  1228. package/dist/cjs/utils/getAllDomains.cjs.map +0 -1
  1229. package/dist/cjs/utils/getAllRegisteredDomains.cjs +0 -2
  1230. package/dist/cjs/utils/getAllRegisteredDomains.cjs.map +0 -1
  1231. package/dist/cjs/utils/getDomainKeySync.cjs +0 -2
  1232. package/dist/cjs/utils/getDomainKeySync.cjs.map +0 -1
  1233. package/dist/cjs/utils/getDomainKeysWithReverses.cjs +0 -2
  1234. package/dist/cjs/utils/getDomainKeysWithReverses.cjs.map +0 -1
  1235. package/dist/cjs/utils/getDomainPriceFromName.cjs +0 -2
  1236. package/dist/cjs/utils/getDomainPriceFromName.cjs.map +0 -1
  1237. package/dist/cjs/utils/getHashedNameSync.cjs +0 -2
  1238. package/dist/cjs/utils/getHashedNameSync.cjs.map +0 -1
  1239. package/dist/cjs/utils/getNameAccountKeySync.cjs +0 -2
  1240. package/dist/cjs/utils/getNameAccountKeySync.cjs.map +0 -1
  1241. package/dist/cjs/utils/getPythFeedAccountKey.cjs +0 -2
  1242. package/dist/cjs/utils/getPythFeedAccountKey.cjs.map +0 -1
  1243. package/dist/cjs/utils/getReverseKeyFromDomainKey.cjs +0 -2
  1244. package/dist/cjs/utils/getReverseKeyFromDomainKey.cjs.map +0 -1
  1245. package/dist/cjs/utils/getReverseKeySync.cjs +0 -2
  1246. package/dist/cjs/utils/getReverseKeySync.cjs.map +0 -1
  1247. package/dist/cjs/utils/getTokenizedDomains.cjs +0 -2
  1248. package/dist/cjs/utils/getTokenizedDomains.cjs.map +0 -1
  1249. package/dist/cjs/utils/reverseLookup.cjs +0 -2
  1250. package/dist/cjs/utils/reverseLookup.cjs.map +0 -1
  1251. package/dist/cjs/utils/reverseLookupBatch.cjs +0 -2
  1252. package/dist/cjs/utils/reverseLookupBatch.cjs.map +0 -1
  1253. package/dist/esm/_virtual/_commonjsHelpers.mjs +0 -2
  1254. package/dist/esm/_virtual/_commonjsHelpers.mjs.map +0 -1
  1255. package/dist/esm/_virtual/base64.mjs +0 -2
  1256. package/dist/esm/_virtual/base64.mjs.map +0 -1
  1257. package/dist/esm/_virtual/index.mjs +0 -2
  1258. package/dist/esm/_virtual/index.mjs.map +0 -1
  1259. package/dist/esm/_virtual/index2.mjs +0 -2
  1260. package/dist/esm/_virtual/index2.mjs.map +0 -1
  1261. package/dist/esm/_virtual/index3.mjs +0 -2
  1262. package/dist/esm/_virtual/index3.mjs.map +0 -1
  1263. package/dist/esm/_virtual/ipaddr.mjs +0 -2
  1264. package/dist/esm/_virtual/ipaddr.mjs.map +0 -1
  1265. package/dist/esm/bindings/burnDomain.mjs +0 -2
  1266. package/dist/esm/bindings/burnDomain.mjs.map +0 -1
  1267. package/dist/esm/bindings/createNameRegistry.mjs +0 -2
  1268. package/dist/esm/bindings/createNameRegistry.mjs.map +0 -1
  1269. package/dist/esm/bindings/createRecordInstruction.mjs +0 -2
  1270. package/dist/esm/bindings/createRecordInstruction.mjs.map +0 -1
  1271. package/dist/esm/bindings/createRecordV2Instruction.mjs +0 -2
  1272. package/dist/esm/bindings/createRecordV2Instruction.mjs.map +0 -1
  1273. package/dist/esm/bindings/createReverseName.mjs +0 -2
  1274. package/dist/esm/bindings/createReverseName.mjs.map +0 -1
  1275. package/dist/esm/bindings/createSolRecordInstruction.mjs +0 -2
  1276. package/dist/esm/bindings/createSolRecordInstruction.mjs.map +0 -1
  1277. package/dist/esm/bindings/createSubdomain.mjs +0 -2
  1278. package/dist/esm/bindings/createSubdomain.mjs.map +0 -1
  1279. package/dist/esm/bindings/deleteNameRegistry.mjs +0 -2
  1280. package/dist/esm/bindings/deleteNameRegistry.mjs.map +0 -1
  1281. package/dist/esm/bindings/deleteRecordV2.mjs +0 -2
  1282. package/dist/esm/bindings/deleteRecordV2.mjs.map +0 -1
  1283. package/dist/esm/bindings/ethValidateRecordV2Content.mjs +0 -2
  1284. package/dist/esm/bindings/ethValidateRecordV2Content.mjs.map +0 -1
  1285. package/dist/esm/bindings/registerDomainName.mjs +0 -2
  1286. package/dist/esm/bindings/registerDomainName.mjs.map +0 -1
  1287. package/dist/esm/bindings/registerDomainNameV2.mjs +0 -2
  1288. package/dist/esm/bindings/registerDomainNameV2.mjs.map +0 -1
  1289. package/dist/esm/bindings/registerFavorite.mjs +0 -2
  1290. package/dist/esm/bindings/registerFavorite.mjs.map +0 -1
  1291. package/dist/esm/bindings/registerWithNft.mjs +0 -2
  1292. package/dist/esm/bindings/registerWithNft.mjs.map +0 -1
  1293. package/dist/esm/bindings/transferNameOwnership.mjs +0 -2
  1294. package/dist/esm/bindings/transferNameOwnership.mjs.map +0 -1
  1295. package/dist/esm/bindings/transferSubdomain.mjs +0 -2
  1296. package/dist/esm/bindings/transferSubdomain.mjs.map +0 -1
  1297. package/dist/esm/bindings/updateNameRegistryData.mjs +0 -2
  1298. package/dist/esm/bindings/updateNameRegistryData.mjs.map +0 -1
  1299. package/dist/esm/bindings/updateRecordInstruction.mjs +0 -2
  1300. package/dist/esm/bindings/updateRecordInstruction.mjs.map +0 -1
  1301. package/dist/esm/bindings/updateRecordV2Instruction.mjs +0 -2
  1302. package/dist/esm/bindings/updateRecordV2Instruction.mjs.map +0 -1
  1303. package/dist/esm/bindings/updateSolRecordInstruction.mjs +0 -2
  1304. package/dist/esm/bindings/updateSolRecordInstruction.mjs.map +0 -1
  1305. package/dist/esm/bindings/validateRecordV2Content.mjs +0 -2
  1306. package/dist/esm/bindings/validateRecordV2Content.mjs.map +0 -1
  1307. package/dist/esm/bindings/writRoaRecordV2.mjs +0 -2
  1308. package/dist/esm/bindings/writRoaRecordV2.mjs.map +0 -1
  1309. package/dist/esm/constants.mjs +0 -2
  1310. package/dist/esm/constants.mjs.map +0 -1
  1311. package/dist/esm/custom-bg.mjs +0 -2
  1312. package/dist/esm/custom-bg.mjs.map +0 -1
  1313. package/dist/esm/deprecated/utils.mjs +0 -2
  1314. package/dist/esm/deprecated/utils.mjs.map +0 -1
  1315. package/dist/esm/devnet.mjs +0 -2
  1316. package/dist/esm/devnet.mjs.map +0 -1
  1317. package/dist/esm/error.mjs +0 -2
  1318. package/dist/esm/error.mjs.map +0 -1
  1319. package/dist/esm/favorite-domain.mjs +0 -2
  1320. package/dist/esm/favorite-domain.mjs.map +0 -1
  1321. package/dist/esm/index.mjs +0 -2
  1322. package/dist/esm/index.mjs.map +0 -1
  1323. package/dist/esm/instructions/burnInstruction.mjs +0 -2
  1324. package/dist/esm/instructions/burnInstruction.mjs.map +0 -1
  1325. package/dist/esm/instructions/createInstruction.mjs +0 -2
  1326. package/dist/esm/instructions/createInstruction.mjs.map +0 -1
  1327. package/dist/esm/instructions/createInstructionV3.mjs +0 -2
  1328. package/dist/esm/instructions/createInstructionV3.mjs.map +0 -1
  1329. package/dist/esm/instructions/createReverseInstruction.mjs +0 -2
  1330. package/dist/esm/instructions/createReverseInstruction.mjs.map +0 -1
  1331. package/dist/esm/instructions/createSplitV2Instruction.mjs +0 -2
  1332. package/dist/esm/instructions/createSplitV2Instruction.mjs.map +0 -1
  1333. package/dist/esm/instructions/createV2Instruction.mjs +0 -2
  1334. package/dist/esm/instructions/createV2Instruction.mjs.map +0 -1
  1335. package/dist/esm/instructions/createWithNftInstruction.mjs +0 -2
  1336. package/dist/esm/instructions/createWithNftInstruction.mjs.map +0 -1
  1337. package/dist/esm/instructions/deleteInstruction.mjs +0 -2
  1338. package/dist/esm/instructions/deleteInstruction.mjs.map +0 -1
  1339. package/dist/esm/instructions/reallocInstruction.mjs +0 -2
  1340. package/dist/esm/instructions/reallocInstruction.mjs.map +0 -1
  1341. package/dist/esm/instructions/registerFavoriteInstruction.mjs +0 -2
  1342. package/dist/esm/instructions/registerFavoriteInstruction.mjs.map +0 -1
  1343. package/dist/esm/instructions/transferInstruction.mjs +0 -2
  1344. package/dist/esm/instructions/transferInstruction.mjs.map +0 -1
  1345. package/dist/esm/instructions/types.mjs +0 -2
  1346. package/dist/esm/instructions/types.mjs.map +0 -1
  1347. package/dist/esm/instructions/updateInstruction.mjs +0 -2
  1348. package/dist/esm/instructions/updateInstruction.mjs.map +0 -1
  1349. package/dist/esm/int.mjs +0 -2
  1350. package/dist/esm/int.mjs.map +0 -1
  1351. package/dist/esm/nft/const.mjs +0 -2
  1352. package/dist/esm/nft/const.mjs.map +0 -1
  1353. package/dist/esm/nft/getDomainMint.mjs +0 -2
  1354. package/dist/esm/nft/getDomainMint.mjs.map +0 -1
  1355. package/dist/esm/nft/getRecordFromMint.mjs +0 -2
  1356. package/dist/esm/nft/getRecordFromMint.mjs.map +0 -1
  1357. package/dist/esm/nft/retrieveNftOwner.mjs +0 -2
  1358. package/dist/esm/nft/retrieveNftOwner.mjs.map +0 -1
  1359. package/dist/esm/nft/retrieveNftOwnerV2.mjs +0 -2
  1360. package/dist/esm/nft/retrieveNftOwnerV2.mjs.map +0 -1
  1361. package/dist/esm/nft/retrieveNfts.mjs +0 -2
  1362. package/dist/esm/nft/retrieveNfts.mjs.map +0 -1
  1363. package/dist/esm/nft/retrieveRecords.mjs +0 -2
  1364. package/dist/esm/nft/retrieveRecords.mjs.map +0 -1
  1365. package/dist/esm/nft/state.mjs +0 -2
  1366. package/dist/esm/nft/state.mjs.map +0 -1
  1367. package/dist/esm/node_modules/@bonfida/sns-records/dist/index.mjs +0 -2
  1368. package/dist/esm/node_modules/@bonfida/sns-records/dist/index.mjs.map +0 -1
  1369. package/dist/esm/node_modules/@noble/curves/esm/abstract/curve.mjs +0 -3
  1370. package/dist/esm/node_modules/@noble/curves/esm/abstract/curve.mjs.map +0 -1
  1371. package/dist/esm/node_modules/@noble/curves/esm/abstract/edwards.mjs +0 -4
  1372. package/dist/esm/node_modules/@noble/curves/esm/abstract/edwards.mjs.map +0 -1
  1373. package/dist/esm/node_modules/@noble/curves/esm/abstract/modular.mjs +0 -4
  1374. package/dist/esm/node_modules/@noble/curves/esm/abstract/modular.mjs.map +0 -1
  1375. package/dist/esm/node_modules/@noble/curves/esm/abstract/utils.mjs +0 -3
  1376. package/dist/esm/node_modules/@noble/curves/esm/abstract/utils.mjs.map +0 -1
  1377. package/dist/esm/node_modules/@noble/curves/esm/ed25519.mjs +0 -4
  1378. package/dist/esm/node_modules/@noble/curves/esm/ed25519.mjs.map +0 -1
  1379. package/dist/esm/node_modules/@noble/hashes/esm/_md.mjs +0 -2
  1380. package/dist/esm/node_modules/@noble/hashes/esm/_md.mjs.map +0 -1
  1381. package/dist/esm/node_modules/@noble/hashes/esm/_u64.mjs +0 -2
  1382. package/dist/esm/node_modules/@noble/hashes/esm/_u64.mjs.map +0 -1
  1383. package/dist/esm/node_modules/@noble/hashes/esm/crypto.mjs +0 -2
  1384. package/dist/esm/node_modules/@noble/hashes/esm/crypto.mjs.map +0 -1
  1385. package/dist/esm/node_modules/@noble/hashes/esm/sha2.mjs +0 -2
  1386. package/dist/esm/node_modules/@noble/hashes/esm/sha2.mjs.map +0 -1
  1387. package/dist/esm/node_modules/@noble/hashes/esm/sha256.mjs +0 -2
  1388. package/dist/esm/node_modules/@noble/hashes/esm/sha256.mjs.map +0 -1
  1389. package/dist/esm/node_modules/@noble/hashes/esm/utils.mjs +0 -4
  1390. package/dist/esm/node_modules/@noble/hashes/esm/utils.mjs.map +0 -1
  1391. package/dist/esm/node_modules/@scure/base/lib/esm/index.mjs +0 -3
  1392. package/dist/esm/node_modules/@scure/base/lib/esm/index.mjs.map +0 -1
  1393. package/dist/esm/node_modules/@solana/spl-token/lib/esm/constants.mjs +0 -2
  1394. package/dist/esm/node_modules/@solana/spl-token/lib/esm/constants.mjs.map +0 -1
  1395. package/dist/esm/node_modules/@solana/spl-token/lib/esm/errors.mjs +0 -2
  1396. package/dist/esm/node_modules/@solana/spl-token/lib/esm/errors.mjs.map +0 -1
  1397. package/dist/esm/node_modules/@solana/spl-token/lib/esm/extensions/accountType.mjs +0 -2
  1398. package/dist/esm/node_modules/@solana/spl-token/lib/esm/extensions/accountType.mjs.map +0 -1
  1399. package/dist/esm/node_modules/@solana/spl-token/lib/esm/instructions/associatedTokenAccount.mjs +0 -2
  1400. package/dist/esm/node_modules/@solana/spl-token/lib/esm/instructions/associatedTokenAccount.mjs.map +0 -1
  1401. package/dist/esm/node_modules/@solana/spl-token/lib/esm/state/account.mjs +0 -2
  1402. package/dist/esm/node_modules/@solana/spl-token/lib/esm/state/account.mjs.map +0 -1
  1403. package/dist/esm/node_modules/@solana/spl-token/lib/esm/state/mint.mjs +0 -2
  1404. package/dist/esm/node_modules/@solana/spl-token/lib/esm/state/mint.mjs.map +0 -1
  1405. package/dist/esm/node_modules/@solana/spl-token/lib/esm/state/multisig.mjs +0 -2
  1406. package/dist/esm/node_modules/@solana/spl-token/lib/esm/state/multisig.mjs.map +0 -1
  1407. package/dist/esm/node_modules/base64-js/index.mjs +0 -2
  1408. package/dist/esm/node_modules/base64-js/index.mjs.map +0 -1
  1409. package/dist/esm/node_modules/borsh/lib/esm/buffer.mjs +0 -2
  1410. package/dist/esm/node_modules/borsh/lib/esm/buffer.mjs.map +0 -1
  1411. package/dist/esm/node_modules/borsh/lib/esm/deserialize.mjs +0 -2
  1412. package/dist/esm/node_modules/borsh/lib/esm/deserialize.mjs.map +0 -1
  1413. package/dist/esm/node_modules/borsh/lib/esm/index.mjs +0 -2
  1414. package/dist/esm/node_modules/borsh/lib/esm/index.mjs.map +0 -1
  1415. package/dist/esm/node_modules/borsh/lib/esm/serialize.mjs +0 -2
  1416. package/dist/esm/node_modules/borsh/lib/esm/serialize.mjs.map +0 -1
  1417. package/dist/esm/node_modules/borsh/lib/esm/types.mjs +0 -2
  1418. package/dist/esm/node_modules/borsh/lib/esm/types.mjs.map +0 -1
  1419. package/dist/esm/node_modules/borsh/lib/esm/utils.mjs +0 -2
  1420. package/dist/esm/node_modules/borsh/lib/esm/utils.mjs.map +0 -1
  1421. package/dist/esm/node_modules/bs58/index.mjs +0 -2
  1422. package/dist/esm/node_modules/bs58/index.mjs.map +0 -1
  1423. package/dist/esm/node_modules/bs58/node_modules/base-x/src/index.mjs +0 -2
  1424. package/dist/esm/node_modules/bs58/node_modules/base-x/src/index.mjs.map +0 -1
  1425. package/dist/esm/node_modules/buffer/index.mjs +0 -8
  1426. package/dist/esm/node_modules/buffer/index.mjs.map +0 -1
  1427. package/dist/esm/node_modules/graphemesplit/extPict.json.mjs +0 -2
  1428. package/dist/esm/node_modules/graphemesplit/extPict.json.mjs.map +0 -1
  1429. package/dist/esm/node_modules/graphemesplit/inCB.json.mjs +0 -2
  1430. package/dist/esm/node_modules/graphemesplit/inCB.json.mjs.map +0 -1
  1431. package/dist/esm/node_modules/graphemesplit/index.mjs +0 -2
  1432. package/dist/esm/node_modules/graphemesplit/index.mjs.map +0 -1
  1433. package/dist/esm/node_modules/graphemesplit/typeTrie.json.mjs +0 -2
  1434. package/dist/esm/node_modules/graphemesplit/typeTrie.json.mjs.map +0 -1
  1435. package/dist/esm/node_modules/graphemesplit/types.mjs +0 -2
  1436. package/dist/esm/node_modules/graphemesplit/types.mjs.map +0 -1
  1437. package/dist/esm/node_modules/ieee754/index.mjs +0 -3
  1438. package/dist/esm/node_modules/ieee754/index.mjs.map +0 -1
  1439. package/dist/esm/node_modules/ipaddr.js/lib/ipaddr.mjs +0 -2
  1440. package/dist/esm/node_modules/ipaddr.js/lib/ipaddr.mjs.map +0 -1
  1441. package/dist/esm/node_modules/js-base64/base64.mjs +0 -2
  1442. package/dist/esm/node_modules/js-base64/base64.mjs.map +0 -1
  1443. package/dist/esm/node_modules/punycode/punycode.es6.mjs +0 -2
  1444. package/dist/esm/node_modules/punycode/punycode.es6.mjs.map +0 -1
  1445. package/dist/esm/node_modules/tiny-inflate/index.mjs +0 -2
  1446. package/dist/esm/node_modules/tiny-inflate/index.mjs.map +0 -1
  1447. package/dist/esm/node_modules/unicode-trie/index.mjs +0 -2
  1448. package/dist/esm/node_modules/unicode-trie/index.mjs.map +0 -1
  1449. package/dist/esm/node_modules/unicode-trie/swap.mjs +0 -2
  1450. package/dist/esm/node_modules/unicode-trie/swap.mjs.map +0 -1
  1451. package/dist/esm/record/checkSolRecord.mjs +0 -2
  1452. package/dist/esm/record/checkSolRecord.mjs.map +0 -1
  1453. package/dist/esm/record/deserializeRecord.mjs +0 -2
  1454. package/dist/esm/record/deserializeRecord.mjs.map +0 -1
  1455. package/dist/esm/record/getRecord.mjs +0 -2
  1456. package/dist/esm/record/getRecord.mjs.map +0 -1
  1457. package/dist/esm/record/getRecordKeySync.mjs +0 -2
  1458. package/dist/esm/record/getRecordKeySync.mjs.map +0 -1
  1459. package/dist/esm/record/getRecords.mjs +0 -2
  1460. package/dist/esm/record/getRecords.mjs.map +0 -1
  1461. package/dist/esm/record/helpers/getArweaveRecord.mjs +0 -2
  1462. package/dist/esm/record/helpers/getArweaveRecord.mjs.map +0 -1
  1463. package/dist/esm/record/helpers/getBackgroundRecord.mjs +0 -2
  1464. package/dist/esm/record/helpers/getBackgroundRecord.mjs.map +0 -1
  1465. package/dist/esm/record/helpers/getBackpackRecord.mjs +0 -2
  1466. package/dist/esm/record/helpers/getBackpackRecord.mjs.map +0 -1
  1467. package/dist/esm/record/helpers/getBscRecord.mjs +0 -2
  1468. package/dist/esm/record/helpers/getBscRecord.mjs.map +0 -1
  1469. package/dist/esm/record/helpers/getBtcRecord.mjs +0 -2
  1470. package/dist/esm/record/helpers/getBtcRecord.mjs.map +0 -1
  1471. package/dist/esm/record/helpers/getDiscordRecord.mjs +0 -2
  1472. package/dist/esm/record/helpers/getDiscordRecord.mjs.map +0 -1
  1473. package/dist/esm/record/helpers/getDogeRecord.mjs +0 -2
  1474. package/dist/esm/record/helpers/getDogeRecord.mjs.map +0 -1
  1475. package/dist/esm/record/helpers/getEmailRecord.mjs +0 -2
  1476. package/dist/esm/record/helpers/getEmailRecord.mjs.map +0 -1
  1477. package/dist/esm/record/helpers/getEthRecord.mjs +0 -2
  1478. package/dist/esm/record/helpers/getEthRecord.mjs.map +0 -1
  1479. package/dist/esm/record/helpers/getGithubRecord.mjs +0 -2
  1480. package/dist/esm/record/helpers/getGithubRecord.mjs.map +0 -1
  1481. package/dist/esm/record/helpers/getInjectiveRecord.mjs +0 -2
  1482. package/dist/esm/record/helpers/getInjectiveRecord.mjs.map +0 -1
  1483. package/dist/esm/record/helpers/getIpfsRecord.mjs +0 -2
  1484. package/dist/esm/record/helpers/getIpfsRecord.mjs.map +0 -1
  1485. package/dist/esm/record/helpers/getLtcRecord.mjs +0 -2
  1486. package/dist/esm/record/helpers/getLtcRecord.mjs.map +0 -1
  1487. package/dist/esm/record/helpers/getPicRecord.mjs +0 -2
  1488. package/dist/esm/record/helpers/getPicRecord.mjs.map +0 -1
  1489. package/dist/esm/record/helpers/getPointRecord.mjs +0 -2
  1490. package/dist/esm/record/helpers/getPointRecord.mjs.map +0 -1
  1491. package/dist/esm/record/helpers/getRedditRecord.mjs +0 -2
  1492. package/dist/esm/record/helpers/getRedditRecord.mjs.map +0 -1
  1493. package/dist/esm/record/helpers/getShdwRecord.mjs +0 -2
  1494. package/dist/esm/record/helpers/getShdwRecord.mjs.map +0 -1
  1495. package/dist/esm/record/helpers/getSolRecord.mjs +0 -2
  1496. package/dist/esm/record/helpers/getSolRecord.mjs.map +0 -1
  1497. package/dist/esm/record/helpers/getTelegramRecord.mjs +0 -2
  1498. package/dist/esm/record/helpers/getTelegramRecord.mjs.map +0 -1
  1499. package/dist/esm/record/helpers/getTwitterRecord.mjs +0 -2
  1500. package/dist/esm/record/helpers/getTwitterRecord.mjs.map +0 -1
  1501. package/dist/esm/record/helpers/getUrlRecord.mjs +0 -2
  1502. package/dist/esm/record/helpers/getUrlRecord.mjs.map +0 -1
  1503. package/dist/esm/record/serializeRecord.mjs +0 -2
  1504. package/dist/esm/record/serializeRecord.mjs.map +0 -1
  1505. package/dist/esm/record/serializeSolRecord.mjs +0 -2
  1506. package/dist/esm/record/serializeSolRecord.mjs.map +0 -1
  1507. package/dist/esm/record_v2/const.mjs +0 -2
  1508. package/dist/esm/record_v2/const.mjs.map +0 -1
  1509. package/dist/esm/record_v2/deserializeRecordV2Content.mjs +0 -2
  1510. package/dist/esm/record_v2/deserializeRecordV2Content.mjs.map +0 -1
  1511. package/dist/esm/record_v2/getMultipleRecordsV2.mjs +0 -2
  1512. package/dist/esm/record_v2/getMultipleRecordsV2.mjs.map +0 -1
  1513. package/dist/esm/record_v2/getRecordV2.mjs +0 -2
  1514. package/dist/esm/record_v2/getRecordV2.mjs.map +0 -1
  1515. package/dist/esm/record_v2/getRecordV2Key.mjs +0 -2
  1516. package/dist/esm/record_v2/getRecordV2Key.mjs.map +0 -1
  1517. package/dist/esm/record_v2/serializeRecordV2Content.mjs +0 -2
  1518. package/dist/esm/record_v2/serializeRecordV2Content.mjs.map +0 -1
  1519. package/dist/esm/record_v2/utils.mjs +0 -2
  1520. package/dist/esm/record_v2/utils.mjs.map +0 -1
  1521. package/dist/esm/record_v2/verifyRightOfAssociation.mjs +0 -2
  1522. package/dist/esm/record_v2/verifyRightOfAssociation.mjs.map +0 -1
  1523. package/dist/esm/resolve/resolve.mjs +0 -2
  1524. package/dist/esm/resolve/resolve.mjs.map +0 -1
  1525. package/dist/esm/resolve/resolveSolRecordV1.mjs +0 -2
  1526. package/dist/esm/resolve/resolveSolRecordV1.mjs.map +0 -1
  1527. package/dist/esm/resolve/resolveSolRecordV2.mjs +0 -2
  1528. package/dist/esm/resolve/resolveSolRecordV2.mjs.map +0 -1
  1529. package/dist/esm/state.mjs +0 -2
  1530. package/dist/esm/state.mjs.map +0 -1
  1531. package/dist/esm/twitter/ReverseTwitterRegistryState.mjs +0 -2
  1532. package/dist/esm/twitter/ReverseTwitterRegistryState.mjs.map +0 -1
  1533. package/dist/esm/twitter/changeTwitterRegistryData.mjs +0 -2
  1534. package/dist/esm/twitter/changeTwitterRegistryData.mjs.map +0 -1
  1535. package/dist/esm/twitter/changeVerifiedPubkey.mjs +0 -2
  1536. package/dist/esm/twitter/changeVerifiedPubkey.mjs.map +0 -1
  1537. package/dist/esm/twitter/createReverseTwitterRegistry.mjs +0 -2
  1538. package/dist/esm/twitter/createReverseTwitterRegistry.mjs.map +0 -1
  1539. package/dist/esm/twitter/createVerifiedTwitterRegistry.mjs +0 -2
  1540. package/dist/esm/twitter/createVerifiedTwitterRegistry.mjs.map +0 -1
  1541. package/dist/esm/twitter/deleteTwitterRegistry.mjs +0 -2
  1542. package/dist/esm/twitter/deleteTwitterRegistry.mjs.map +0 -1
  1543. package/dist/esm/twitter/getHandleAndRegistryKey.mjs +0 -2
  1544. package/dist/esm/twitter/getHandleAndRegistryKey.mjs.map +0 -1
  1545. package/dist/esm/twitter/getTwitterHandleandRegistryKeyViaFilters.mjs +0 -2
  1546. package/dist/esm/twitter/getTwitterHandleandRegistryKeyViaFilters.mjs.map +0 -1
  1547. package/dist/esm/twitter/getTwitterRegistry.mjs +0 -2
  1548. package/dist/esm/twitter/getTwitterRegistry.mjs.map +0 -1
  1549. package/dist/esm/twitter/getTwitterRegistryData.mjs +0 -2
  1550. package/dist/esm/twitter/getTwitterRegistryData.mjs.map +0 -1
  1551. package/dist/esm/twitter/getTwitterRegistryKey.mjs +0 -2
  1552. package/dist/esm/twitter/getTwitterRegistryKey.mjs.map +0 -1
  1553. package/dist/esm/types/custom-bg.mjs +0 -2
  1554. package/dist/esm/types/custom-bg.mjs.map +0 -1
  1555. package/dist/esm/types/record.mjs +0 -2
  1556. package/dist/esm/types/record.mjs.map +0 -1
  1557. package/dist/esm/utils/check.mjs +0 -2
  1558. package/dist/esm/utils/check.mjs.map +0 -1
  1559. package/dist/esm/utils/deserializeReverse.mjs +0 -2
  1560. package/dist/esm/utils/deserializeReverse.mjs.map +0 -1
  1561. package/dist/esm/utils/findSubdomains.mjs +0 -2
  1562. package/dist/esm/utils/findSubdomains.mjs.map +0 -1
  1563. package/dist/esm/utils/getAllDomains.mjs +0 -2
  1564. package/dist/esm/utils/getAllDomains.mjs.map +0 -1
  1565. package/dist/esm/utils/getAllRegisteredDomains.mjs +0 -2
  1566. package/dist/esm/utils/getAllRegisteredDomains.mjs.map +0 -1
  1567. package/dist/esm/utils/getDomainKeySync.mjs +0 -2
  1568. package/dist/esm/utils/getDomainKeySync.mjs.map +0 -1
  1569. package/dist/esm/utils/getDomainKeysWithReverses.mjs +0 -2
  1570. package/dist/esm/utils/getDomainKeysWithReverses.mjs.map +0 -1
  1571. package/dist/esm/utils/getDomainPriceFromName.mjs +0 -2
  1572. package/dist/esm/utils/getDomainPriceFromName.mjs.map +0 -1
  1573. package/dist/esm/utils/getHashedNameSync.mjs +0 -2
  1574. package/dist/esm/utils/getHashedNameSync.mjs.map +0 -1
  1575. package/dist/esm/utils/getNameAccountKeySync.mjs +0 -2
  1576. package/dist/esm/utils/getNameAccountKeySync.mjs.map +0 -1
  1577. package/dist/esm/utils/getPythFeedAccountKey.mjs +0 -2
  1578. package/dist/esm/utils/getPythFeedAccountKey.mjs.map +0 -1
  1579. package/dist/esm/utils/getReverseKeyFromDomainKey.mjs +0 -2
  1580. package/dist/esm/utils/getReverseKeyFromDomainKey.mjs.map +0 -1
  1581. package/dist/esm/utils/getReverseKeySync.mjs +0 -2
  1582. package/dist/esm/utils/getReverseKeySync.mjs.map +0 -1
  1583. package/dist/esm/utils/getTokenizedDomains.mjs +0 -2
  1584. package/dist/esm/utils/getTokenizedDomains.mjs.map +0 -1
  1585. package/dist/esm/utils/reverseLookup.mjs +0 -2
  1586. package/dist/esm/utils/reverseLookup.mjs.map +0 -1
  1587. package/dist/esm/utils/reverseLookupBatch.mjs +0 -2
  1588. package/dist/esm/utils/reverseLookupBatch.mjs.map +0 -1
  1589. package/dist/types/bindings/ethValidateRecordV2Content.d.ts +0 -4
  1590. package/dist/types/record/serializeRecord.d.ts +0 -10
  1591. package/dist/types/record/serializeSolRecord.d.ts +0 -11
  1592. package/dist/types/record_v2/serializeRecordV2Content.d.ts +0 -10
  1593. package/dist/types/utils/getHashedNameSync.d.ts +0 -2
  1594. package/dist/types/utils/getNameAccountKeySync.d.ts +0 -3
@@ -0,0 +1,2 @@
1
+ import{PublicKey as t}from"@solana/web3.js";import{getDomainMint as o}from"./getDomainMint.js";import{getMint as e}from"../node_modules/@solana/spl-token/lib/esm/state/mint.js";import{TOKEN_PROGRAM_ID as s}from"../node_modules/@solana/spl-token/lib/esm/constants.js";const n=async(n,a)=>{try{const r=o(a);if("0"===(await e(n,r)).supply.toString())return;const m=[{memcmp:{offset:0,bytes:r.toBase58()}},{memcmp:{offset:64,bytes:"2"}},{dataSize:165}],i=await n.getProgramAccounts(s,{filters:m});if(1!=i.length)return;return new t(i[0].account.data.slice(32,64))}catch{return}};export{n as retrieveNftOwner};
2
+ //# sourceMappingURL=retrieveNftOwner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retrieveNftOwner.js","sources":["../../../src/nft/retrieveNftOwner.ts"],"sourcesContent":[null],"names":["retrieveNftOwner","async","connection","nameAccount","mint","getDomainMint","getMint","supply","toString","filters","memcmp","offset","bytes","toBase58","dataSize","result","getProgramAccounts","TOKEN_PROGRAM_ID","length","PublicKey","account","data","slice"],"mappings":"2QAea,MAAAA,EAAmBC,MAC9BC,EACAC,KAEA,IACE,MAAMC,EAAOC,EAAcF,GAG3B,GAAmC,aADZG,EAAQJ,EAAYE,IAC9BG,OAAOC,WAClB,OAGF,MAAMC,EAAsC,CAC1C,CACEC,OAAQ,CACNC,OAAQ,EACRC,MAAOR,EAAKS,aAGhB,CACEH,OAAQ,CACNC,OAAQ,GACRC,MAAO,MAGX,CAAEE,SAAU,MAGRC,QAAeb,EAAWc,mBAAmBC,EAAkB,CACnER,YAGF,GAAqB,GAAjBM,EAAOG,OACT,OAGF,OAAO,IAAIC,EAAUJ,EAAO,GAAGK,QAAQC,KAAKC,MAAM,GAAI,KACtD,MACA"}
@@ -0,0 +1,2 @@
1
+ import { PublicKey, Connection } from "@solana/web3.js";
2
+ export declare const retrieveNftOwnerV2: (connection: Connection, nameAccount: PublicKey) => Promise<PublicKey | null>;
@@ -0,0 +1,2 @@
1
+ import{SolanaJSONRPCError as t}from"@solana/web3.js";import{getDomainMint as n}from"./getDomainMint.js";import{AccountLayout as o}from"../node_modules/@solana/spl-token/lib/esm/state/account.js";const e=async(e,a)=>{try{const t=n(a),r=await e.getTokenLargestAccounts(t);if(0===r.value.length)return null;const s=await e.getAccountInfo(r.value[0].address);if(!s)return null;const c=o.decode(s.data);return"1"===c.amount.toString()?c.owner:null}catch(n){if(n instanceof t&&-32602===n.code)return null;throw n}};export{e as retrieveNftOwnerV2};
2
+ //# sourceMappingURL=retrieveNftOwnerV2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retrieveNftOwnerV2.js","sources":["../../../src/nft/retrieveNftOwnerV2.ts"],"sourcesContent":[null],"names":["retrieveNftOwnerV2","async","connection","nameAccount","mint","getDomainMint","largestAccounts","getTokenLargestAccounts","value","length","largestAccountInfo","getAccountInfo","address","decoded","AccountLayout","decode","data","amount","toString","owner","err","SolanaJSONRPCError","code"],"mappings":"mMAIa,MAAAA,EAAqBC,MAChCC,EACAC,KAEA,IACE,MAAMC,EAAOC,EAAcF,GAErBG,QAAwBJ,EAAWK,wBAAwBH,GACjE,GAAqC,IAAjCE,EAAgBE,MAAMC,OACxB,OAAO,KAGT,MAAMC,QAA2BR,EAAWS,eAC1CL,EAAgBE,MAAM,GAAGI,SAG3B,IAAKF,EACH,OAAO,KAGT,MAAMG,EAAUC,EAAcC,OAAOL,EAAmBM,MACxD,MAAkC,MAA9BH,EAAQI,OAAOC,WACVL,EAAQM,MAEV,KACP,MAAOC,GACP,GAAIA,aAAeC,IAAmC,QAAbD,EAAIE,KAE3C,OAAO,KAET,MAAMF"}
@@ -0,0 +1,8 @@
1
+ import { Connection, PublicKey } from "@solana/web3.js";
2
+ /**
3
+ * This function can be used to retrieve all the tokenized domains name
4
+ *
5
+ * @param connection The solana connection object to the RPC node
6
+ * @returns
7
+ */
8
+ export declare const retrieveNfts: (connection: Connection) => Promise<PublicKey[]>;
@@ -0,0 +1,2 @@
1
+ import{PublicKey as t}from"@solana/web3.js";import{NAME_TOKENIZER_ID as o}from"./const.js";import{NftRecord as s}from"./state.js";const a=async a=>{const e=[{dataSize:s.LEN},{memcmp:{offset:0,bytes:"3"}}],r=await a.getProgramAccounts(o,{filters:e});return r.map((o=>new t(o.account.data.slice(66,98))))};export{a as retrieveNfts};
2
+ //# sourceMappingURL=retrieveNfts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retrieveNfts.js","sources":["../../../src/nft/retrieveNfts.ts"],"sourcesContent":[null],"names":["retrieveNfts","async","connection","filters","dataSize","NftRecord","LEN","memcmp","offset","bytes","result","getProgramAccounts","NAME_TOKENIZER_ID","map","e","PublicKey","account","data","slice"],"mappings":"wIAcaA,EAAeC,MAAOC,IACjC,MAAMC,EAAsC,CAC1C,CAAEC,SAAUC,EAAUC,KACtB,CACEC,OAAQ,CACNC,OAAQ,EACRC,MAAO,OAKPC,QAAeR,EAAWS,mBAAmBC,EAAmB,CACpET,YAGF,OAAOO,EAAOG,KACXC,GAAM,IAAIC,EAAUD,EAAEE,QAAQC,KAAKC,MAFvB,GAEqCV,MACnD"}
@@ -0,0 +1,3 @@
1
+ import { PublicKey, Connection } from "@solana/web3.js";
2
+ import { NftRecord } from "./state";
3
+ export declare const retrieveRecords: (connection: Connection, owner: PublicKey) => Promise<NftRecord[]>;
@@ -0,0 +1,2 @@
1
+ import{NftRecord as t}from"./state.js";import{getRecordFromMint as o}from"./getRecordFromMint.js";import{TOKEN_PROGRAM_ID as e}from"../node_modules/@solana/spl-token/lib/esm/constants.js";import{AccountLayout as a}from"../node_modules/@solana/spl-token/lib/esm/state/account.js";const s=t=>[{memcmp:{offset:32,bytes:t}},{memcmp:{offset:64,bytes:"2"}}],m=async(m,n)=>{const r=[...s(n.toBase58()),{dataSize:165}],i=(await m.getProgramAccounts(e,{filters:r})).map((t=>a.decode(t.account.data))).map((e=>(async(e,a)=>{const s=await o(e,a.mint);if(1===s.length)return t.deserialize(s[0].account.data)})(m,e)));return(await Promise.all(i)).filter((t=>void 0!==t))};export{m as retrieveRecords};
2
+ //# sourceMappingURL=retrieveRecords.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retrieveRecords.js","sources":["../../../src/nft/retrieveRecords.ts"],"sourcesContent":[null],"names":["getFilter","owner","memcmp","offset","bytes","retrieveRecords","async","connection","filters","toBase58","dataSize","promises","getProgramAccounts","TOKEN_PROGRAM_ID","map","e","AccountLayout","decode","account","data","acc","record","getRecordFromMint","mint","length","NftRecord","deserialize","closure","Promise","all","filter","undefined"],"mappings":"uRAUA,MAAMA,EAAaC,GACe,CAC9B,CACEC,OAAQ,CAAEC,OAAQ,GAAIC,MAAOH,IAE/B,CAAEC,OAAQ,CAAEC,OAAQ,GAAIC,MAAO,OAYtBC,EAAkBC,MAC7BC,EACAN,KAEA,MAAMO,EAAsC,IACvCR,EAAUC,EAAMQ,YACnB,CAAEC,SAAU,MAQRC,SANeJ,EAAWK,mBAAmBC,EAAkB,CACnEL,aAGuBM,KAAKC,GAAMC,EAAcC,OAAOF,EAAEG,QAAQC,QAExCL,KAAKM,GArBlBd,OAAOC,EAAwBa,KAC7C,MAAMC,QAAeC,EAAkBf,EAAYa,EAAIG,MACvD,GAAsB,IAAlBF,EAAOG,OACT,OAAOC,EAAUC,YAAYL,EAAO,GAAGH,QAAQC,OAkBTQ,CAAQpB,EAAYa,KAG5D,aAFsBQ,QAAQC,IAAIlB,IAEnBmB,QAAQf,QAAYgB,IAANhB,GAA+B"}
@@ -0,0 +1,53 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { Connection, PublicKey } from "@solana/web3.js";
4
+ import { Buffer } from "buffer";
5
+ export declare enum Tag {
6
+ Uninitialized = 0,
7
+ CentralState = 1,
8
+ ActiveRecord = 2,
9
+ InactiveRecord = 3
10
+ }
11
+ export declare class NftRecord {
12
+ tag: Tag;
13
+ nonce: number;
14
+ nameAccount: PublicKey;
15
+ owner: PublicKey;
16
+ nftMint: PublicKey;
17
+ static LEN: number;
18
+ static schema: {
19
+ struct: {
20
+ tag: string;
21
+ nonce: string;
22
+ nameAccount: {
23
+ array: {
24
+ type: string;
25
+ len: number;
26
+ };
27
+ };
28
+ owner: {
29
+ array: {
30
+ type: string;
31
+ len: number;
32
+ };
33
+ };
34
+ nftMint: {
35
+ array: {
36
+ type: string;
37
+ len: number;
38
+ };
39
+ };
40
+ };
41
+ };
42
+ constructor(obj: {
43
+ tag: number;
44
+ nonce: number;
45
+ nameAccount: Uint8Array;
46
+ owner: Uint8Array;
47
+ nftMint: Uint8Array;
48
+ });
49
+ static deserialize(data: Buffer): NftRecord;
50
+ static retrieve(connection: Connection, key: PublicKey): Promise<NftRecord>;
51
+ static findKey(nameAccount: PublicKey, programId: PublicKey): Promise<[PublicKey, number]>;
52
+ static findKeySync(nameAccount: PublicKey, programId: PublicKey): [PublicKey, number];
53
+ }
@@ -0,0 +1,2 @@
1
+ import{deserialize as e}from"../node_modules/borsh/lib/esm/index.js";import{PublicKey as t}from"@solana/web3.js";import"../node_modules/buffer/index.js";import{NftRecordNotFoundError as r}from"../error.js";import{__exports as n}from"../_virtual/index.js";var o;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.CentralState=1]="CentralState",e[e.ActiveRecord=2]="ActiveRecord",e[e.InactiveRecord=3]="InactiveRecord"}(o||(o={}));class i{constructor(e){this.tag=e.tag,this.nonce=e.nonce,this.nameAccount=new t(e.nameAccount),this.owner=new t(e.owner),this.nftMint=new t(e.nftMint)}static deserialize(t){return new i(e(this.schema,t))}static async retrieve(e,t){const n=await e.getAccountInfo(t);if(!n||!n.data)throw new r("NFT record not found: "+t.toBase58());return this.deserialize(n.data)}static async findKey(e,r){return await t.findProgramAddress([n.Buffer.from("nft_record"),e.toBuffer()],r)}static findKeySync(e,r){return t.findProgramAddressSync([n.Buffer.from("nft_record"),e.toBuffer()],r)}}i.LEN=98,i.schema={struct:{tag:"u8",nonce:"u8",nameAccount:{array:{type:"u8",len:32}},owner:{array:{type:"u8",len:32}},nftMint:{array:{type:"u8",len:32}}}};export{i as NftRecord,o as Tag};
2
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sources":["../../../src/nft/state.ts"],"sourcesContent":[null],"names":["Tag","NftRecord","constructor","obj","this","tag","nonce","nameAccount","PublicKey","owner","nftMint","deserialize","data","schema","retrieve","connection","key","accountInfo","getAccountInfo","NftRecordNotFoundError","toBase58","findKey","programId","findProgramAddress","Buffer","from","toBuffer","findKeySync","findProgramAddressSync","LEN","struct","array","type","len"],"mappings":"mQAKYA,GAAZ,SAAYA,GACVA,EAAAA,EAAA,cAAA,GAAA,gBACAA,EAAAA,EAAA,aAAA,GAAA,eACAA,EAAAA,EAAA,aAAA,GAAA,eACAA,EAAAA,EAAA,eAAA,GAAA,gBACD,CALD,CAAYA,IAAAA,EAKX,CAAA,UAEYC,EAmBX,WAAAC,CAAYC,GAOVC,KAAKC,IAAMF,EAAIE,IACfD,KAAKE,MAAQH,EAAIG,MACjBF,KAAKG,YAAc,IAAIC,EAAUL,EAAII,aACrCH,KAAKK,MAAQ,IAAID,EAAUL,EAAIM,OAC/BL,KAAKM,QAAU,IAAIF,EAAUL,EAAIO,SAGnC,kBAAOC,CAAYC,GACjB,OAAO,IAAIX,EAAUU,EAAYP,KAAKS,OAAQD,IAGhD,qBAAaE,CAASC,EAAwBC,GAC5C,MAAMC,QAAoBF,EAAWG,eAAeF,GACpD,IAAKC,IAAgBA,EAAYL,KAC/B,MAAM,IAAIO,EACR,yBAA2BH,EAAII,YAGnC,OAAOhB,KAAKO,YAAYM,EAAYL,MAEtC,oBAAaS,CAAQd,EAAwBe,GAC3C,aAAad,EAAUe,mBACrB,CAACC,SAAOC,KAAK,cAAelB,EAAYmB,YACxCJ,GAGJ,kBAAOK,CAAYpB,EAAwBe,GACzC,OAAOd,EAAUoB,uBACf,CAACJ,EAAAA,OAAOC,KAAK,cAAelB,EAAYmB,YACxCJ,IAhDGrB,EAAG4B,IAAG,GAEN5B,EAAAY,OAAS,CACdiB,OAAQ,CACNzB,IAAK,KACLC,MAAO,KACPC,YAAa,CAAEwB,MAAO,CAAEC,KAAM,KAAMC,IAAK,KACzCxB,MAAO,CAAEsB,MAAO,CAAEC,KAAM,KAAMC,IAAK,KACnCvB,QAAS,CAAEqB,MAAO,CAAEC,KAAM,KAAMC,IAAK"}
@@ -0,0 +1,2 @@
1
+ import"../../../buffer/index.js";import{PublicKey as e,SystemProgram as t,TransactionInstruction as r}from"@solana/web3.js";import{__exports as i}from"../../../../_virtual/index.js";var n,s=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"],o=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),i=parseInt(r)/8;this.resize_if_necessary(i);var n="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[n](this.offset,e,!0),this.offset+=i},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}(),a=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var i="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),n=this.view[i](this.offset,!0);return this.offset+=r,n},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}(),u=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});function c(e,t,r){if(typeof e!==t)throw new Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))}function h(e,t,r){if(e!==t)throw new Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(r.join(".")))}var f=s.concat(["bool","string"]),d=["option","enum","array","set","map","struct"],l=function(e){function t(t,r){var i="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,i)||this}return u(t,e),t}(Error);function p(e){if("string"!=typeof e||!f.includes(e)){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&d.includes(t[0])){var r=t[0];if("option"===r)return p(e[r]);if("enum"===r)return function(e){if(!Array.isArray(e))throw new l(e,"Array");for(var t=0,r=e;t<r.length;t++){var i=r[t];if("object"!=typeof i||!("struct"in i))throw new Error('Missing "struct" key in enum schema');if("object"!=typeof i.struct||1!==Object.keys(i.struct).length)throw new Error('The "struct" in each enum must have a single key');p({struct:i.struct})}}(e[r]);if("array"===r)return function(e){if("object"!=typeof e)throw new l(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw new Error("Invalid schema: ".concat(e));if("type"in e)return p(e.type);throw new l(e,"{ type, len? }")}(e[r]);if("set"===r)return p(e[r]);if("map"===r)return function(e){if("object"!=typeof e||!("key"in e)||!("value"in e))throw new l(e,"{ key, value }");p(e.key),p(e.value)}(e[r]);if("struct"===r)return function(e){if("object"!=typeof e)throw new l(e,"object");for(var t in e)p(e[t])}(e[r])}}throw new l(e,d.join(", ")+" or "+f.join(", "))}}var y=function(){function e(e){this.encoded=new o,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(s.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&c(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&function(e,t){if(!(["number","string","bigint","boolean"].includes(typeof e)||"object"==typeof e&&null!==e&&"toString"in e))throw new Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,i=new Uint8Array(r),n=0;n<r;n++)i[n]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(i))},e.prototype.encode_string=function(e){this.checkTypes&&c(e,"string",this.fieldPath);var t=e;this.encoded.store_value(t.length,"u32");for(var r=0;r<t.length;r++)this.encoded.store_value(t.charCodeAt(r),"u8")},e.prototype.encode_boolean=function(e){this.checkTypes&&c(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&function(e,t){if("object"!=typeof e||null===e)throw new Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}(e,this.fieldPath);for(var r=Object.keys(e)[0],i=0;i<t.enum.length;i++){var n=t.enum[i];if(r===Object.keys(n.struct)[0])return this.encoded.store_value(i,"u8"),this.encode_struct(e,n)}throw new Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(function(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e)}(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw new Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?h(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?h(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&c(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var i=0,n=r;i<n.length;i++){var s=n[i];this.encode_value(s,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&c(e,"object",this.fieldPath);var r=e instanceof Map,i=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(i.length,"u32");for(var n=0,s=i;n<s.length;n++){var o=s[n];this.encode_value(o,t.map.key),this.encode_value(r?e.get(o):e[o],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&c(e,"object",this.fieldPath);for(var r=0,i=Object.keys(t.struct);r<i.length;r++){var n=i[r];this.fieldPath.push(n),this.encode_value(e[n],t.struct[n]),this.fieldPath.pop()}},e}(),g=function(){function e(e){this.buffer=new a(e)}return e.prototype.decode=function(e){return this.decode_value(e)},e.prototype.decode_value=function(e){if("string"==typeof e){if(s.includes(e))return this.decode_integer(e);if("string"===e)return this.decode_string();if("bool"===e)return this.decode_boolean()}if("object"==typeof e){if("option"in e)return this.decode_option(e);if("enum"in e)return this.decode_enum(e);if("array"in e)return this.decode_array(e);if("set"in e)return this.decode_set(e);if("map"in e)return this.decode_map(e);if("struct"in e)return this.decode_struct(e)}throw new Error("Unsupported type: ".concat(e))},e.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},e.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,i=new Uint8Array(this.buffer.consume_bytes(r)),n=i.reduceRight((function(e,t){return e+t.toString(16).padStart(2,"0")}),"");return t&&i[r-1]?BigInt.asIntN(e,BigInt("0x".concat(n))):BigInt("0x".concat(n))},e.prototype.decode_string=function(){var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e));return String.fromCharCode.apply(null,t)},e.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},e.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw new Error("Invalid option ".concat(t));return null},e.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw new Error("Enum option ".concat(r," is not available"));var i=e.enum[r].struct,n=Object.keys(i)[0];return(t={})[n]=this.decode_value(i[n]),t},e.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),i=0;i<r;++i)t.push(this.decode_value(e.array.type));return t},e.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,i=0;i<t;++i)r.add(this.decode_value(e.set));return r},e.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,i=0;i<t;++i){var n=this.decode_value(e.map.key),s=this.decode_value(e.map.value);r.set(n,s)}return r},e.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t},e}();function b(e,t,r){return void 0===r&&(r=!0),r&&p(e),new y(r).encode(t,e)}class _{constructor(e){this.tag=1,this.record=e.record,this.content=e.content}serialize(){return b(_.schema,this)}getInstruction(e,t,n,s,o,a,u,c){const h=i.Buffer.from(this.serialize());let f=[];return f.push({pubkey:t,isSigner:!1,isWritable:!1}),f.push({pubkey:n,isSigner:!1,isWritable:!1}),f.push({pubkey:s,isSigner:!0,isWritable:!0}),f.push({pubkey:o,isSigner:!1,isWritable:!0}),f.push({pubkey:a,isSigner:!1,isWritable:!0}),f.push({pubkey:u,isSigner:!0,isWritable:!0}),f.push({pubkey:c,isSigner:!1,isWritable:!1}),new r({keys:f,programId:e,data:h})}}_.schema={struct:{tag:"u8",record:"string",content:{array:{type:"u8"}}}};class v{constructor(e){this.tag=4,this.validation=e.validation,this.signature=e.signature,this.expectedPubkey=e.expectedPubkey}serialize(){return b(v.schema,this)}getInstruction(e,t,n,s,o,a,u,c){const h=i.Buffer.from(this.serialize());let f=[];return f.push({pubkey:t,isSigner:!1,isWritable:!1}),f.push({pubkey:n,isSigner:!1,isWritable:!1}),f.push({pubkey:s,isSigner:!0,isWritable:!0}),f.push({pubkey:o,isSigner:!1,isWritable:!0}),f.push({pubkey:a,isSigner:!1,isWritable:!0}),f.push({pubkey:u,isSigner:!0,isWritable:!0}),f.push({pubkey:c,isSigner:!1,isWritable:!1}),new r({keys:f,programId:e,data:h})}}v.schema={struct:{tag:"u8",validation:"u8",signature:{array:{type:"u8"}},expectedPubkey:{array:{type:"u8"}}}};class m{constructor(e){this.tag=3,this.staleness=e.staleness}serialize(){return b(m.schema,this)}getInstruction(e,t,n,s,o,a,u,c,h){const f=i.Buffer.from(this.serialize());let d=[];return d.push({pubkey:t,isSigner:!1,isWritable:!1}),d.push({pubkey:n,isSigner:!1,isWritable:!1}),d.push({pubkey:s,isSigner:!0,isWritable:!0}),d.push({pubkey:o,isSigner:!1,isWritable:!0}),d.push({pubkey:a,isSigner:!1,isWritable:!0}),d.push({pubkey:u,isSigner:!1,isWritable:!0}),d.push({pubkey:c,isSigner:!1,isWritable:!1}),d.push({pubkey:h,isSigner:!0,isWritable:!0}),new r({keys:d,programId:e,data:f})}}m.schema={struct:{tag:"u8",staleness:"bool"}};class w{constructor(e){this.tag=2,this.record=e.record,this.content=e.content}serialize(){return b(w.schema,this)}getInstruction(e,t,n,s,o,a,u,c){const h=i.Buffer.from(this.serialize());let f=[];return f.push({pubkey:t,isSigner:!1,isWritable:!1}),f.push({pubkey:n,isSigner:!1,isWritable:!1}),f.push({pubkey:s,isSigner:!0,isWritable:!0}),f.push({pubkey:o,isSigner:!1,isWritable:!0}),f.push({pubkey:a,isSigner:!1,isWritable:!0}),f.push({pubkey:u,isSigner:!0,isWritable:!0}),f.push({pubkey:c,isSigner:!1,isWritable:!1}),new r({keys:f,programId:e,data:h})}}w.schema={struct:{tag:"u8",record:"string",content:{array:{type:"u8"}}}};class k{constructor(){this.tag=5}serialize(){return b(k.schema,this)}getInstruction(e,t,n,s,o,a,u,c){const h=i.Buffer.from(this.serialize());let f=[];return f.push({pubkey:t,isSigner:!1,isWritable:!1}),f.push({pubkey:n,isSigner:!1,isWritable:!1}),f.push({pubkey:s,isSigner:!0,isWritable:!0}),f.push({pubkey:o,isSigner:!1,isWritable:!0}),f.push({pubkey:a,isSigner:!1,isWritable:!0}),f.push({pubkey:u,isSigner:!0,isWritable:!0}),f.push({pubkey:c,isSigner:!1,isWritable:!1}),new r({keys:f,programId:e,data:h})}}k.schema={struct:{tag:"u8"}};class S{constructor(e){this.tag=6,this.roaId=e.roaId}serialize(){return b(S.schema,this)}getInstruction(e,t,n,s,o,a,u,c){const h=i.Buffer.from(this.serialize());let f=[];return f.push({pubkey:t,isSigner:!1,isWritable:!1}),f.push({pubkey:n,isSigner:!1,isWritable:!1}),f.push({pubkey:s,isSigner:!0,isWritable:!0}),f.push({pubkey:o,isSigner:!1,isWritable:!0}),f.push({pubkey:a,isSigner:!1,isWritable:!0}),f.push({pubkey:u,isSigner:!0,isWritable:!0}),f.push({pubkey:c,isSigner:!1,isWritable:!1}),new r({keys:f,programId:e,data:h})}}S.schema={struct:{tag:"u8",roaId:{array:{type:"u8"}}}};const I=new e("HP3D4D1ZCmohQGFVms2SS4LCANgJyksBf5s1F77FuFjZ"),[A]=e.findProgramAddressSync([I.toBuffer()],I),W=(e,r,i,n,s,o,a,u)=>new _({record:o,content:Array.from(a)}).getInstruction(u,t.programId,s,e,r,i,n,A),j=(e,r,i,n,s,o)=>(new k).getInstruction(o,t.programId,s,e,n,r,i,A),E=(e,r,i,n,s,o,a,u)=>new w({record:o,content:Array.from(a)}).getInstruction(u,t.programId,s,e,r,i,n,A),z=(e,r,i,n,s,o,a,u,c)=>new v({validation:o,signature:Array.from(a),expectedPubkey:Array.from(u)}).getInstruction(c,t.programId,s,e,r,i,n,A),P=(e,r,i,n,s,o,a,u)=>new m({staleness:a}).getInstruction(u,t.programId,o,e,r,i,n,A,s),O=(e,r,i,n,s,o,a)=>new S({roaId:Array.from(o.toBuffer())}).getInstruction(a,t.programId,r,e,i,n,s,A);var B,R;(R=B||(B={}))[R.None=0]="None",R[R.Solana=1]="Solana",R[R.Ethereum=2]="Ethereum",R[R.UnverifiedSolana=3]="UnverifiedSolana";const x=e=>{switch(e){case B.None:return 0;case B.Ethereum:return 20;case B.Solana:case B.UnverifiedSolana:return 32;default:throw new Error("Invalid validation enum")}};class U{constructor(e){this.stalenessValidation=e.stalenessValidation,this.rightOfAssociationValidation=e.rightOfAssociationValidation,this.contentLength=e.contentLength}static deserialize(e){return new U((t=this.schema,r=e,void 0===(i=!0)&&(i=!0),i&&p(t),new g(r).decode(t)));var t,r,i}static async retrieve(e,t){const r=await e.getAccountInfo(t);if(!r||!r.data)throw new Error("Record header account not found");return this.deserialize(r.data.slice(96,96+this.LEN))}}U.LEN=8,U.schema={struct:{stalenessValidation:"u16",rightOfAssociationValidation:"u16",contentLength:"u32"}};class V{constructor(e,t){this.data=t,this.header=e}static deserialize(e){const t=U.deserialize(e.slice(96,96+U.LEN)),r=e.slice(96+U.LEN);return new V(t,r)}static async retrieve(e,t){const r=await e.getAccountInfo(t);if(!r||!r.data)throw new Error("Record header account not found");return this.deserialize(r.data)}static async retrieveBatch(e,t){return(await e.getMultipleAccountsInfo(t)).map((e=>{if(null==e?void 0:e.data)return this.deserialize(e.data)}))}getContent(){let e=x(this.header.stalenessValidation)+x(this.header.rightOfAssociationValidation);return this.data.slice(e)}getStalenessId(){let e=x(this.header.stalenessValidation);return this.data.slice(0,e)}getRoAId(){let e=x(this.header.stalenessValidation),t=e+x(this.header.rightOfAssociationValidation);return this.data.slice(e,t)}}export{A as CENTRAL_STATE_SNS_RECORDS,V as Record,U as RecordHeader,I as SNS_RECORDS_ID,B as Validation,W as allocateAndPostRecord,_ as allocateAndPostRecordInstruction,j as deleteRecord,k as deleteRecordInstruction,E as editRecord,w as editRecordInstruction,x as getValidationLength,z as validateEthSignature,v as validateEthereumSignatureInstruction,P as validateSolanaSignature,m as validateSolanaSignatureInstruction,O as writeRoa,S as writeRoaInstruction};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import{validateField as e,nLength as t}from"./modular.js";import{validateObject as n,bitLen as r,bitMask as o}from"./utils.js";
2
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const i=BigInt(0),s=BigInt(1);function a(e,t){const n=t.negate();return e?n:t}function f(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function d(e,t){f(e,t);const n=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:o(e),maxNumber:n,shiftBy:BigInt(e)}}function c(e,t,n){const{windowSize:r,mask:o,maxNumber:i,shiftBy:a}=n;let f=Number(e&o),d=e>>a;f>r&&(f-=i,d+=s);const c=t*r;return{nextN:d,offset:c+Math.abs(f)-1,isZero:0===f,isNeg:f<0,isNegF:t%2!=0,offsetF:c}}const u=new WeakMap,l=new WeakMap;function w(e){return l.get(e)||1}function h(e,t){return{constTimeNegate:a,hasPrecomputes:e=>1!==w(e),unsafeLadder(t,n,r=e.ZERO){let o=t;for(;n>i;)n&s&&(r=r.add(o)),o=o.double(),n>>=s;return r},precomputeWindow(e,n){const{windows:r,windowSize:o}=d(n,t),i=[];let s=e,a=s;for(let e=0;e<r;e++){a=s,i.push(a);for(let e=1;e<o;e++)a=a.add(s),i.push(a);s=a.double()}return i},wNAF(n,r,o){let i=e.ZERO,s=e.BASE;const f=d(n,t);for(let e=0;e<f.windows;e++){const{nextN:t,offset:n,isZero:d,isNeg:u,isNegF:l,offsetF:w}=c(o,e,f);o=t,d?s=s.add(a(l,r[w])):i=i.add(a(u,r[n]))}return{p:i,f:s}},wNAFUnsafe(n,r,o,s=e.ZERO){const a=d(n,t);for(let e=0;e<a.windows&&o!==i;e++){const{nextN:t,offset:n,isZero:i,isNeg:f}=c(o,e,a);if(o=t,!i){const e=r[n];s=s.add(f?e.negate():e)}}return s},getPrecomputes(e,t,n){let r=u.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&u.set(t,n(r))),r},wNAFCached(e,t,n){const r=w(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)},wNAFCachedUnsafe(e,t,n,r){const o=w(e);return 1===o?this.unsafeLadder(e,t,r):this.wNAFUnsafe(o,this.getPrecomputes(o,e,n),t,r)},setWindowSize(e,n){f(n,t),l.set(e,n),u.delete(e)}}}function g(e,t,n,i){!function(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach(((e,n)=>{if(!(e instanceof t))throw new Error("invalid point at index "+n)}))}(n,e),function(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach(((e,n)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+n)}))}(i,t);const s=n.length,a=i.length;if(s!==a)throw new Error("arrays of points and scalars must have equal length");const f=e.ZERO,d=r(BigInt(s));let c=1;d>12?c=d-3:d>4?c=d-2:d>0&&(c=2);const u=o(c),l=new Array(Number(u)+1).fill(f);let w=f;for(let e=Math.floor((t.BITS-1)/c)*c;e>=0;e-=c){l.fill(f);for(let t=0;t<a;t++){const r=i[t],o=Number(r>>BigInt(e)&u);l[o]=l[o].add(n[t])}let t=f;for(let e=l.length-1,n=f;e>0;e--)n=n.add(l[e]),t=t.add(n);if(w=w.add(t),0!==e)for(let e=0;e<c;e++)w=w.double()}return w}function p(r){return e(r.Fp),n(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...t(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}export{g as pippenger,p as validateBasic,h as wNAF};
3
+ //# sourceMappingURL=curve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curve.js","sources":["../../../../../../../node_modules/@noble/curves/esm/abstract/curve.js"],"sourcesContent":["/**\n * Methods for elliptic curve multiplication by scalars.\n * Contains wNAF, pippenger\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { nLength, validateField } from \"./modular.js\";\nimport { bitLen, bitMask, validateObject } from \"./utils.js\";\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nfunction constTimeNegate(condition, item) {\n const neg = item.negate();\n return condition ? neg : item;\n}\nfunction validateW(W, bits) {\n if (!Number.isSafeInteger(W) || W <= 0 || W > bits)\n throw new Error('invalid window size, expected [1..' + bits + '], got W=' + W);\n}\nfunction calcWOpts(W, scalarBits) {\n validateW(W, scalarBits);\n const windows = Math.ceil(scalarBits / W) + 1; // W=8 33. Not 32, because we skip zero\n const windowSize = 2 ** (W - 1); // W=8 128. Not 256, because we skip zero\n const maxNumber = 2 ** W; // W=8 256\n const mask = bitMask(W); // W=8 255 == mask 0b11111111\n const shiftBy = BigInt(W); // W=8 8\n return { windows, windowSize, mask, maxNumber, shiftBy };\n}\nfunction calcOffsets(n, window, wOpts) {\n const { windowSize, mask, maxNumber, shiftBy } = wOpts;\n let wbits = Number(n & mask); // extract W bits.\n let nextN = n >> shiftBy; // shift number by W bits.\n // What actually happens here:\n // const highestBit = Number(mask ^ (mask >> 1n));\n // let wbits2 = wbits - 1; // skip zero\n // if (wbits2 & highestBit) { wbits2 ^= Number(mask); // (~);\n // split if bits > max: +224 => 256-32\n if (wbits > windowSize) {\n // we skip zero, which means instead of `>= size-1`, we do `> size`\n wbits -= maxNumber; // -32, can be maxNumber - wbits, but then we need to set isNeg here.\n nextN += _1n; // +256 (carry)\n }\n const offsetStart = window * windowSize;\n const offset = offsetStart + Math.abs(wbits) - 1; // -1 because we skip zero\n const isZero = wbits === 0; // is current window slice a 0?\n const isNeg = wbits < 0; // is current window slice negative?\n const isNegF = window % 2 !== 0; // fake random statement for noise\n const offsetF = offsetStart; // fake offset for noise\n return { nextN, offset, isZero, isNeg, isNegF, offsetF };\n}\nfunction validateMSMPoints(points, c) {\n if (!Array.isArray(points))\n throw new Error('array expected');\n points.forEach((p, i) => {\n if (!(p instanceof c))\n throw new Error('invalid point at index ' + i);\n });\n}\nfunction validateMSMScalars(scalars, field) {\n if (!Array.isArray(scalars))\n throw new Error('array of scalars expected');\n scalars.forEach((s, i) => {\n if (!field.isValid(s))\n throw new Error('invalid scalar at index ' + i);\n });\n}\n// Since points in different groups cannot be equal (different object constructor),\n// we can have single place to store precomputes.\n// Allows to make points frozen / immutable.\nconst pointPrecomputes = new WeakMap();\nconst pointWindowSizes = new WeakMap();\nfunction getW(P) {\n return pointWindowSizes.get(P) || 1;\n}\n/**\n * Elliptic curve multiplication of Point by scalar. Fragile.\n * Scalars should always be less than curve order: this should be checked inside of a curve itself.\n * Creates precomputation tables for fast multiplication:\n * - private scalar is split by fixed size windows of W bits\n * - every window point is collected from window's table & added to accumulator\n * - since windows are different, same point inside tables won't be accessed more than once per calc\n * - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar)\n * - +1 window is neccessary for wNAF\n * - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication\n *\n * @todo Research returning 2d JS array of windows, instead of a single window.\n * This would allow windows to be in different memory locations\n */\nexport function wNAF(c, bits) {\n return {\n constTimeNegate,\n hasPrecomputes(elm) {\n return getW(elm) !== 1;\n },\n // non-const time multiplication ladder\n unsafeLadder(elm, n, p = c.ZERO) {\n let d = elm;\n while (n > _0n) {\n if (n & _1n)\n p = p.add(d);\n d = d.double();\n n >>= _1n;\n }\n return p;\n },\n /**\n * Creates a wNAF precomputation window. Used for caching.\n * Default window size is set by `utils.precompute()` and is equal to 8.\n * Number of precomputed points depends on the curve size:\n * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:\n * - 𝑊 is the window size\n * - 𝑛 is the bitlength of the curve order.\n * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.\n * @param elm Point instance\n * @param W window size\n * @returns precomputed point tables flattened to a single array\n */\n precomputeWindow(elm, W) {\n const { windows, windowSize } = calcWOpts(W, bits);\n const points = [];\n let p = elm;\n let base = p;\n for (let window = 0; window < windows; window++) {\n base = p;\n points.push(base);\n // i=1, bc we skip 0\n for (let i = 1; i < windowSize; i++) {\n base = base.add(p);\n points.push(base);\n }\n p = base.double();\n }\n return points;\n },\n /**\n * Implements ec multiplication using precomputed tables and w-ary non-adjacent form.\n * @param W window size\n * @param precomputes precomputed tables\n * @param n scalar (we don't check here, but should be less than curve order)\n * @returns real and fake (for const-time) points\n */\n wNAF(W, precomputes, n) {\n // Smaller version:\n // https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541\n // TODO: check the scalar is less than group order?\n // wNAF behavior is undefined otherwise. But have to carefully remove\n // other checks before wNAF. ORDER == bits here.\n // Accumulators\n let p = c.ZERO;\n let f = c.BASE;\n // This code was first written with assumption that 'f' and 'p' will never be infinity point:\n // since each addition is multiplied by 2 ** W, it cannot cancel each other. However,\n // there is negate now: it is possible that negated element from low value\n // would be the same as high element, which will create carry into next window.\n // It's not obvious how this can fail, but still worth investigating later.\n const wo = calcWOpts(W, bits);\n for (let window = 0; window < wo.windows; window++) {\n // (n === _0n) is handled and not early-exited. isEven and offsetF are used for noise\n const { nextN, offset, isZero, isNeg, isNegF, offsetF } = calcOffsets(n, window, wo);\n n = nextN;\n if (isZero) {\n // bits are 0: add garbage to fake point\n // Important part for const-time getPublicKey: add random \"noise\" point to f.\n f = f.add(constTimeNegate(isNegF, precomputes[offsetF]));\n }\n else {\n // bits are 1: add to result point\n p = p.add(constTimeNegate(isNeg, precomputes[offset]));\n }\n }\n // Return both real and fake points: JIT won't eliminate f.\n // At this point there is a way to F be infinity-point even if p is not,\n // which makes it less const-time: around 1 bigint multiply.\n return { p, f };\n },\n /**\n * Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form.\n * @param W window size\n * @param precomputes precomputed tables\n * @param n scalar (we don't check here, but should be less than curve order)\n * @param acc accumulator point to add result of multiplication\n * @returns point\n */\n wNAFUnsafe(W, precomputes, n, acc = c.ZERO) {\n const wo = calcWOpts(W, bits);\n for (let window = 0; window < wo.windows; window++) {\n if (n === _0n)\n break; // Early-exit, skip 0 value\n const { nextN, offset, isZero, isNeg } = calcOffsets(n, window, wo);\n n = nextN;\n if (isZero) {\n // Window bits are 0: skip processing.\n // Move to next window.\n continue;\n }\n else {\n const item = precomputes[offset];\n acc = acc.add(isNeg ? item.negate() : item); // Re-using acc allows to save adds in MSM\n }\n }\n return acc;\n },\n getPrecomputes(W, P, transform) {\n // Calculate precomputes on a first run, reuse them after\n let comp = pointPrecomputes.get(P);\n if (!comp) {\n comp = this.precomputeWindow(P, W);\n if (W !== 1)\n pointPrecomputes.set(P, transform(comp));\n }\n return comp;\n },\n wNAFCached(P, n, transform) {\n const W = getW(P);\n return this.wNAF(W, this.getPrecomputes(W, P, transform), n);\n },\n wNAFCachedUnsafe(P, n, transform, prev) {\n const W = getW(P);\n if (W === 1)\n return this.unsafeLadder(P, n, prev); // For W=1 ladder is ~x2 faster\n return this.wNAFUnsafe(W, this.getPrecomputes(W, P, transform), n, prev);\n },\n // We calculate precomputes for elliptic curve point multiplication\n // using windowed method. This specifies window size and\n // stores precomputed values. Usually only base point would be precomputed.\n setWindowSize(P, W) {\n validateW(W, bits);\n pointWindowSizes.set(P, W);\n pointPrecomputes.delete(P);\n },\n };\n}\n/**\n * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).\n * 30x faster vs naive addition on L=4096, 10x faster than precomputes.\n * For N=254bit, L=1, it does: 1024 ADD + 254 DBL. For L=5: 1536 ADD + 254 DBL.\n * Algorithmically constant-time (for same L), even when 1 point + scalar, or when scalar = 0.\n * @param c Curve Point constructor\n * @param fieldN field over CURVE.N - important that it's not over CURVE.P\n * @param points array of L curve points\n * @param scalars array of L scalars (aka private keys / bigints)\n */\nexport function pippenger(c, fieldN, points, scalars) {\n // If we split scalars by some window (let's say 8 bits), every chunk will only\n // take 256 buckets even if there are 4096 scalars, also re-uses double.\n // TODO:\n // - https://eprint.iacr.org/2024/750.pdf\n // - https://tches.iacr.org/index.php/TCHES/article/view/10287\n // 0 is accepted in scalars\n validateMSMPoints(points, c);\n validateMSMScalars(scalars, fieldN);\n const plength = points.length;\n const slength = scalars.length;\n if (plength !== slength)\n throw new Error('arrays of points and scalars must have equal length');\n // if (plength === 0) throw new Error('array must be of length >= 2');\n const zero = c.ZERO;\n const wbits = bitLen(BigInt(plength));\n let windowSize = 1; // bits\n if (wbits > 12)\n windowSize = wbits - 3;\n else if (wbits > 4)\n windowSize = wbits - 2;\n else if (wbits > 0)\n windowSize = 2;\n const MASK = bitMask(windowSize);\n const buckets = new Array(Number(MASK) + 1).fill(zero); // +1 for zero array\n const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize;\n let sum = zero;\n for (let i = lastBits; i >= 0; i -= windowSize) {\n buckets.fill(zero);\n for (let j = 0; j < slength; j++) {\n const scalar = scalars[j];\n const wbits = Number((scalar >> BigInt(i)) & MASK);\n buckets[wbits] = buckets[wbits].add(points[j]);\n }\n let resI = zero; // not using this will do small speed-up, but will lose ct\n // Skip first bucket, because it is zero\n for (let j = buckets.length - 1, sumI = zero; j > 0; j--) {\n sumI = sumI.add(buckets[j]);\n resI = resI.add(sumI);\n }\n sum = sum.add(resI);\n if (i !== 0)\n for (let j = 0; j < windowSize; j++)\n sum = sum.double();\n }\n return sum;\n}\n/**\n * Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).\n * @param c Curve Point constructor\n * @param fieldN field over CURVE.N - important that it's not over CURVE.P\n * @param points array of L curve points\n * @returns function which multiplies points with scaars\n */\nexport function precomputeMSMUnsafe(c, fieldN, points, windowSize) {\n /**\n * Performance Analysis of Window-based Precomputation\n *\n * Base Case (256-bit scalar, 8-bit window):\n * - Standard precomputation requires:\n * - 31 additions per scalar × 256 scalars = 7,936 ops\n * - Plus 255 summary additions = 8,191 total ops\n * Note: Summary additions can be optimized via accumulator\n *\n * Chunked Precomputation Analysis:\n * - Using 32 chunks requires:\n * - 255 additions per chunk\n * - 256 doublings\n * - Total: (255 × 32) + 256 = 8,416 ops\n *\n * Memory Usage Comparison:\n * Window Size | Standard Points | Chunked Points\n * ------------|-----------------|---------------\n * 4-bit | 520 | 15\n * 8-bit | 4,224 | 255\n * 10-bit | 13,824 | 1,023\n * 16-bit | 557,056 | 65,535\n *\n * Key Advantages:\n * 1. Enables larger window sizes due to reduced memory overhead\n * 2. More efficient for smaller scalar counts:\n * - 16 chunks: (16 × 255) + 256 = 4,336 ops\n * - ~2x faster than standard 8,191 ops\n *\n * Limitations:\n * - Not suitable for plain precomputes (requires 256 constant doublings)\n * - Performance degrades with larger scalar counts:\n * - Optimal for ~256 scalars\n * - Less efficient for 4096+ scalars (Pippenger preferred)\n */\n validateW(windowSize, fieldN.BITS);\n validateMSMPoints(points, c);\n const zero = c.ZERO;\n const tableSize = 2 ** windowSize - 1; // table size (without zero)\n const chunks = Math.ceil(fieldN.BITS / windowSize); // chunks of item\n const MASK = bitMask(windowSize);\n const tables = points.map((p) => {\n const res = [];\n for (let i = 0, acc = p; i < tableSize; i++) {\n res.push(acc);\n acc = acc.add(p);\n }\n return res;\n });\n return (scalars) => {\n validateMSMScalars(scalars, fieldN);\n if (scalars.length > points.length)\n throw new Error('array of scalars must be smaller than array of points');\n let res = zero;\n for (let i = 0; i < chunks; i++) {\n // No need to double if accumulator is still zero.\n if (res !== zero)\n for (let j = 0; j < windowSize; j++)\n res = res.double();\n const shiftBy = BigInt(chunks * windowSize - (i + 1) * windowSize);\n for (let j = 0; j < scalars.length; j++) {\n const n = scalars[j];\n const curr = Number((n >> shiftBy) & MASK);\n if (!curr)\n continue; // skip zero scalars chunks\n res = res.add(tables[j][curr - 1]);\n }\n }\n return res;\n };\n}\nexport function validateBasic(curve) {\n validateField(curve.Fp);\n validateObject(curve, {\n n: 'bigint',\n h: 'bigint',\n Gx: 'field',\n Gy: 'field',\n }, {\n nBitLength: 'isSafeInteger',\n nByteLength: 'isSafeInteger',\n });\n // Set defaults\n return Object.freeze({\n ...nLength(curve.n, curve.nBitLength),\n ...curve,\n ...{ p: curve.Fp.ORDER },\n });\n}\n//# sourceMappingURL=curve.js.map"],"names":["_0n","BigInt","_1n","constTimeNegate","condition","item","neg","negate","validateW","W","bits","Number","isSafeInteger","Error","calcWOpts","scalarBits","maxNumber","windows","Math","ceil","windowSize","mask","bitMask","shiftBy","calcOffsets","n","window","wOpts","wbits","nextN","offsetStart","offset","abs","isZero","isNeg","isNegF","offsetF","pointPrecomputes","WeakMap","pointWindowSizes","getW","P","get","wNAF","c","hasPrecomputes","elm","unsafeLadder","p","ZERO","d","add","double","precomputeWindow","points","base","push","i","precomputes","f","BASE","wo","wNAFUnsafe","acc","getPrecomputes","transform","comp","this","set","wNAFCached","wNAFCachedUnsafe","prev","setWindowSize","delete","pippenger","fieldN","scalars","Array","isArray","forEach","validateMSMPoints","field","s","isValid","validateMSMScalars","plength","length","slength","zero","bitLen","MASK","buckets","fill","sum","floor","BITS","j","scalar","resI","sumI","validateBasic","curve","validateField","Fp","validateObject","h","Gx","Gy","nBitLength","nByteLength","Object","freeze","nLength","ORDER"],"mappings":";sEASA,MAAMA,EAAMC,OAAO,GACbC,EAAMD,OAAO,GAsBnB,SAASE,EAAoCC,EAAoBC,GAC/D,MAAMC,EAAMD,EAAKE,SACjB,OAAOH,EAAYE,EAAMD,CAC3B,CAEA,SAASG,EAAUC,EAAWC,GAC5B,IAAKC,OAAOC,cAAcH,IAAMA,GAAK,GAAKA,EAAIC,EAC5C,MAAM,IAAIG,MAAM,qCAAuCH,EAAO,YAAcD,EAChF,CAWA,SAASK,EAAUL,EAAWM,GAC5BP,EAAUC,EAAGM,GACb,MAEMC,EAAY,GAAKP,EAGvB,MAAO,CAAEQ,QALOC,KAAKC,KAAKJ,EAAaN,GAAK,EAK1BW,WAJC,IAAM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AO+E,GAAQ,GAAGE,KAAKJ,GAEjD,IAAIK,EAAML,EACV,IAAK,IAAI/B,EAFQvC,KAAK4E,OAAOnB,EAAOoB,KAAO,GAAK3E,GAAcA,EAEvCqC,GAAK,EAAGA,GAAKrC,EAAY,CAC9CuE,EAAQC,KAAKJ,GACb,IAAK,IAAIQ,EAAI,EAAGA,EAAIT,EAASS,IAAK,CAChC,MAAMC,EAASrB,EAAQoB,GACjBpE,EAAQjB,OAAQsF,GAAUhG,OAAOwD,GAAMiC,GAC7CC,EAAQ/D,GAAS+D,EAAQ/D,GAAOuB,IAAIG,EAAO0C,GAC7C,CACA,IAAIE,EAAOV,EAEX,IAAK,IAAIQ,EAAIL,EAAQL,OAAS,EAAGa,EAAOX,EAAMQ,EAAI,EAAGA,IACnDG,EAAOA,EAAKhD,IAAIwC,EAAQK,IACxBE,EAAOA,EAAK/C,IAAIgD,GAGlB,GADAN,EAAMA,EAAI1C,IAAI+C,GACJ,IAANzC,EAAS,IAAK,IAAIuC,EAAI,EAAGA,EAAI5E,EAAY4E,IAAKH,EAAMA,EAAIzC,QAC9D,CACA,OAAOyC,CACT,CAmGM,SAAUO,EACdC,GAyBA,OAfAC,EAAcD,EAAME,IACpBC,EACEH,EACA,CACE5E,EAAG,SACHgF,EAAG,SACHC,GAAI,QACJC,GAAI,SAEN,CACEC,WAAY,gBACZC,YAAa,kBAIVC,OAAOC,OAAO,IAChBC,EAAQX,EAAM5E,EAAG4E,EAAMO,eACvBP,EACErD,EAAGqD,EAAME,GAAGU,OAErB","x_google_ignoreList":[0]}
@@ -0,0 +1,4 @@
1
+ import{validateBasic as t,pippenger as e,wNAF as n}from"./curve.js";import{Field as r,FpInvertBatch as i,mod as o}from"./modular.js";import{validateObject as s,memoized as a,aInRange as c,ensureBytes as u,abool as f,bytesToNumberLE as l,numberToBytesLE as h,bytesToHex as d,concatBytes as y}from"./utils.js";
2
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
+ const p=BigInt(0),m=BigInt(1),x=BigInt(2),w=BigInt(8),E={zip215:!0};function B(B){const g=function(e){const n=t(e);return s(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...n})}(B),{Fp:z,n:v,prehash:S,hash:R,randomBytes:A,nByteLength:b,h:O}=g,Z=x<<BigInt(8*b)-m,q=z.create,T=r(g.n,g.nBitLength);if(!function(t,e){const n=z.sqr(t),r=z.sqr(e),i=z.add(z.mul(g.a,n),r),o=z.add(z.ONE,z.mul(g.d,z.mul(n,r)));return z.eql(i,o)}(g.Gx,g.Gy))throw new Error("bad curve params: generator point");const H=g.uvRatio||((t,e)=>{try{return{isValid:!0,value:z.sqrt(t*z.inv(e))}}catch(t){return{isValid:!1,value:p}}}),P=g.adjustScalarBytes||(t=>t),U=g.domain||((t,e,n)=>{if(f("phflag",n),e.length||n)throw new Error("Contexts/pre-hash are not supported");return t});function j(t,e,n=!1){c("coordinate "+t,e,n?m:p,Z)}function C(t){if(!(t instanceof G))throw new Error("ExtendedPoint expected")}const Y=a(((t,e)=>{const{ex:n,ey:r,ez:i}=t,o=t.is0();null==e&&(e=o?w:z.inv(i));const s=q(n*e),a=q(r*e),c=q(i*e);if(o)return{x:p,y:m};if(c!==m)throw new Error("invZ was invalid");return{x:s,y:a}})),F=a((t=>{const{a:e,d:n}=g;if(t.is0())throw new Error("bad point: ZERO");const{ex:r,ey:i,ez:o,et:s}=t,a=q(r*r),c=q(i*i),u=q(o*o),f=q(u*u),l=q(a*e);if(q(u*q(l+c))!==q(f+q(n*q(a*c))))throw new Error("bad point: equation left != right (1)");if(q(r*i)!==q(o*s))throw new Error("bad point: equation left != right (2)");return!0}));class G{constructor(t,e,n,r){j("x",t),j("y",e),j("z",n,!0),j("t",r),this.ex=t,this.ey=e,this.ez=n,this.et=r,Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(t){if(t instanceof G)throw new Error("extended point not allowed");const{x:e,y:n}=t||{};return j("x",e),j("y",n),new G(e,n,m,q(e*n))}static normalizeZ(t){const e=i(z,t.map((t=>t.ez)));return t.map(((t,n)=>t.toAffine(e[n]))).map(G.fromAffine)}static msm(t,n){return e(G,T,t,n)}_setWindowSize(t){N.setWindowSize(this,t)}assertValidity(){F(this)}equals(t){C(t);const{ex:e,ey:n,ez:r}=this,{ex:i,ey:o,ez:s}=t,a=q(e*s),c=q(i*r),u=q(n*s),f=q(o*r);return a===c&&u===f}is0(){return this.equals(G.ZERO)}negate(){return new G(q(-this.ex),this.ey,this.ez,q(-this.et))}double(){const{a:t}=g,{ex:e,ey:n,ez:r}=this,i=q(e*e),o=q(n*n),s=q(x*q(r*r)),a=q(t*i),c=e+n,u=q(q(c*c)-i-o),f=a+o,l=f-s,h=a-o,d=q(u*l),y=q(f*h),p=q(u*h),m=q(l*f);return new G(d,y,m,p)}add(t){C(t);const{a:e,d:n}=g,{ex:r,ey:i,ez:o,et:s}=this,{ex:a,ey:c,ez:u,et:f}=t,l=q(r*a),h=q(i*c),d=q(s*n*f),y=q(o*u),p=q((r+i)*(a+c)-l-h),m=y-d,x=y+d,w=q(h-e*l),E=q(p*m),B=q(x*w),z=q(p*w),v=q(m*x);return new G(E,B,v,z)}subtract(t){return this.add(t.negate())}wNAF(t){return N.wNAFCached(this,t,G.normalizeZ)}multiply(t){const e=t;c("scalar",e,m,v);const{p:n,f:r}=this.wNAF(e);return G.normalizeZ([n,r])[0]}multiplyUnsafe(t,e=G.ZERO){const n=t;return c("scalar",n,p,v),n===p?K:this.is0()||n===m?this:N.wNAFCachedUnsafe(this,n,G.normalizeZ,e)}isSmallOrder(){return this.multiplyUnsafe(O).is0()}isTorsionFree(){return N.unsafeLadder(this,v).is0()}toAffine(t){return Y(this,t)}clearCofactor(){const{h:t}=g;return t===m?this:this.multiplyUnsafe(t)}static fromHex(t,e=!1){const{d:n,a:r}=g,i=z.BYTES;t=u("pointHex",t,i),f("zip215",e);const o=t.slice(),s=t[i-1];o[i-1]=-129&s;const a=l(o),h=e?Z:z.ORDER;c("pointHex.y",a,p,h);const d=q(a*a),y=q(d-m),x=q(n*d-r);let{isValid:w,value:E}=H(y,x);if(!w)throw new Error("Point.fromHex: invalid y coordinate");const B=(E&m)===m,v=!!(128&s);if(!e&&E===p&&v)throw new Error("Point.fromHex: x=0 and x_0=1");return v!==B&&(E=q(-E)),G.fromAffine({x:E,y:a})}static fromPrivateKey(t){const{scalar:e}=_(t);return I.multiply(e)}toRawBytes(){const{x:t,y:e}=this.toAffine(),n=h(e,z.BYTES);return n[n.length-1]|=t&m?128:0,n}toHex(){return d(this.toRawBytes())}}G.BASE=new G(g.Gx,g.Gy,m,q(g.Gx*g.Gy)),G.ZERO=new G(p,m,m,p);const{BASE:I,ZERO:K}=G,N=n(G,8*b);function V(t){return o(t,v)}function W(t){return V(l(t))}function _(t){const e=z.BYTES;t=u("private key",t,e);const n=u("hashed private key",R(t),2*e),r=P(n.slice(0,e));return{head:r,prefix:n.slice(e,2*e),scalar:W(r)}}function L(t){const{head:e,prefix:n,scalar:r}=_(t),i=I.multiply(r),o=i.toRawBytes();return{head:e,prefix:n,scalar:r,point:i,pointBytes:o}}function k(t=Uint8Array.of(),...e){const n=y(...e);return W(R(U(n,u("context",t),!!S)))}const D=E;I._setWindowSize(8);return{CURVE:g,getPublicKey:function(t){return L(t).pointBytes},sign:function(t,e,n={}){t=u("message",t),S&&(t=S(t));const{prefix:r,scalar:i,pointBytes:o}=L(e),s=k(n.context,r,t),a=I.multiply(s).toRawBytes(),f=V(s+k(n.context,a,o,t)*i);c("signature.s",f,p,v);const l=y(a,h(f,z.BYTES));return u("result",l,2*z.BYTES)},verify:function(t,e,n,r=D){const{context:i,zip215:o}=r,s=z.BYTES;t=u("signature",t,2*s),e=u("message",e),n=u("publicKey",n,s),void 0!==o&&f("zip215",o),S&&(e=S(e));const a=l(t.slice(s,2*s));let c,h,d;try{c=G.fromHex(n,o),h=G.fromHex(t.slice(0,s),o),d=I.multiplyUnsafe(a)}catch(t){return!1}if(!o&&c.isSmallOrder())return!1;const y=k(i,h.toRawBytes(),c.toRawBytes(),e);return h.add(c.multiplyUnsafe(y)).subtract(d).clearCofactor().equals(G.ZERO)},ExtendedPoint:G,utils:{getExtendedPublicKey:L,randomPrivateKey:()=>A(z.BYTES),precompute:(t=8,e=G.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)}}}export{B as twistedEdwards};
4
+ //# sourceMappingURL=edwards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edwards.js","sources":["../../../../../../../node_modules/@noble/curves/esm/abstract/edwards.js"],"sourcesContent":["/**\n * Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y².\n * For design rationale of types / exports, see weierstrass module documentation.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// prettier-ignore\nimport { pippenger, validateBasic, wNAF } from \"./curve.js\";\nimport { Field, FpInvertBatch, mod } from \"./modular.js\";\n// prettier-ignore\nimport { abool, aInRange, bytesToHex, bytesToNumberLE, concatBytes, ensureBytes, memoized, numberToBytesLE, validateObject } from \"./utils.js\";\n// Be friendly to bad ECMAScript parsers by not using bigint literals\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _8n = BigInt(8);\n// verification rule is either zip215 or rfc8032 / nist186-5. Consult fromHex:\nconst VERIFY_DEFAULT = { zip215: true };\nfunction validateOpts(curve) {\n const opts = validateBasic(curve);\n validateObject(curve, {\n hash: 'function',\n a: 'bigint',\n d: 'bigint',\n randomBytes: 'function',\n }, {\n adjustScalarBytes: 'function',\n domain: 'function',\n uvRatio: 'function',\n mapToCurve: 'function',\n });\n // Set defaults\n return Object.freeze({ ...opts });\n}\n/**\n * Creates Twisted Edwards curve with EdDSA signatures.\n * @example\n * import { Field } from '@noble/curves/abstract/modular';\n * // Before that, define BigInt-s: a, d, p, n, Gx, Gy, h\n * const curve = twistedEdwards({ a, d, Fp: Field(p), n, Gx, Gy, h })\n */\nexport function twistedEdwards(curveDef) {\n const CURVE = validateOpts(curveDef);\n const { Fp, n: CURVE_ORDER, prehash: prehash, hash: cHash, randomBytes, nByteLength, h: cofactor, } = CURVE;\n // Important:\n // There are some places where Fp.BYTES is used instead of nByteLength.\n // So far, everything has been tested with curves of Fp.BYTES == nByteLength.\n // TODO: test and find curves which behave otherwise.\n const MASK = _2n << (BigInt(nByteLength * 8) - _1n);\n const modP = Fp.create; // Function overrides\n const Fn = Field(CURVE.n, CURVE.nBitLength);\n function isEdValidXY(x, y) {\n const x2 = Fp.sqr(x);\n const y2 = Fp.sqr(y);\n const left = Fp.add(Fp.mul(CURVE.a, x2), y2);\n const right = Fp.add(Fp.ONE, Fp.mul(CURVE.d, Fp.mul(x2, y2)));\n return Fp.eql(left, right);\n }\n // Validate whether the passed curve params are valid.\n // equation ax² + y² = 1 + dx²y² should work for generator point.\n if (!isEdValidXY(CURVE.Gx, CURVE.Gy))\n throw new Error('bad curve params: generator point');\n // sqrt(u/v)\n const uvRatio = CURVE.uvRatio ||\n ((u, v) => {\n try {\n return { isValid: true, value: Fp.sqrt(u * Fp.inv(v)) };\n }\n catch (e) {\n return { isValid: false, value: _0n };\n }\n });\n const adjustScalarBytes = CURVE.adjustScalarBytes || ((bytes) => bytes); // NOOP\n const domain = CURVE.domain ||\n ((data, ctx, phflag) => {\n abool('phflag', phflag);\n if (ctx.length || phflag)\n throw new Error('Contexts/pre-hash are not supported');\n return data;\n }); // NOOP\n // 0 <= n < MASK\n // Coordinates larger than Fp.ORDER are allowed for zip215\n function aCoordinate(title, n, banZero = false) {\n const min = banZero ? _1n : _0n;\n aInRange('coordinate ' + title, n, min, MASK);\n }\n function aextpoint(other) {\n if (!(other instanceof Point))\n throw new Error('ExtendedPoint expected');\n }\n // Converts Extended point to default (x, y) coordinates.\n // Can accept precomputed Z^-1 - for example, from invertBatch.\n const toAffineMemo = memoized((p, iz) => {\n const { ex: x, ey: y, ez: z } = p;\n const is0 = p.is0();\n if (iz == null)\n iz = is0 ? _8n : Fp.inv(z); // 8 was chosen arbitrarily\n const ax = modP(x * iz);\n const ay = modP(y * iz);\n const zz = modP(z * iz);\n if (is0)\n return { x: _0n, y: _1n };\n if (zz !== _1n)\n throw new Error('invZ was invalid');\n return { x: ax, y: ay };\n });\n const assertValidMemo = memoized((p) => {\n const { a, d } = CURVE;\n if (p.is0())\n throw new Error('bad point: ZERO'); // TODO: optimize, with vars below?\n // Equation in affine coordinates: ax² + y² = 1 + dx²y²\n // Equation in projective coordinates (X/Z, Y/Z, Z): (aX² + Y²)Z² = Z⁴ + dX²Y²\n const { ex: X, ey: Y, ez: Z, et: T } = p;\n const X2 = modP(X * X); // X²\n const Y2 = modP(Y * Y); // Y²\n const Z2 = modP(Z * Z); // Z²\n const Z4 = modP(Z2 * Z2); // Z⁴\n const aX2 = modP(X2 * a); // aX²\n const left = modP(Z2 * modP(aX2 + Y2)); // (aX² + Y²)Z²\n const right = modP(Z4 + modP(d * modP(X2 * Y2))); // Z⁴ + dX²Y²\n if (left !== right)\n throw new Error('bad point: equation left != right (1)');\n // In Extended coordinates we also have T, which is x*y=T/Z: check X*Y == Z*T\n const XY = modP(X * Y);\n const ZT = modP(Z * T);\n if (XY !== ZT)\n throw new Error('bad point: equation left != right (2)');\n return true;\n });\n // Extended Point works in extended coordinates: (X, Y, Z, T) ∋ (x=X/Z, y=Y/Z, T=xy).\n // https://en.wikipedia.org/wiki/Twisted_Edwards_curve#Extended_coordinates\n class Point {\n constructor(ex, ey, ez, et) {\n aCoordinate('x', ex);\n aCoordinate('y', ey);\n aCoordinate('z', ez, true);\n aCoordinate('t', et);\n this.ex = ex;\n this.ey = ey;\n this.ez = ez;\n this.et = et;\n Object.freeze(this);\n }\n get x() {\n return this.toAffine().x;\n }\n get y() {\n return this.toAffine().y;\n }\n static fromAffine(p) {\n if (p instanceof Point)\n throw new Error('extended point not allowed');\n const { x, y } = p || {};\n aCoordinate('x', x);\n aCoordinate('y', y);\n return new Point(x, y, _1n, modP(x * y));\n }\n static normalizeZ(points) {\n const toInv = FpInvertBatch(Fp, points.map((p) => p.ez));\n return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n }\n // Multiscalar Multiplication\n static msm(points, scalars) {\n return pippenger(Point, Fn, points, scalars);\n }\n // \"Private method\", don't use it directly\n _setWindowSize(windowSize) {\n wnaf.setWindowSize(this, windowSize);\n }\n // Not required for fromHex(), which always creates valid points.\n // Could be useful for fromAffine().\n assertValidity() {\n assertValidMemo(this);\n }\n // Compare one point to another.\n equals(other) {\n aextpoint(other);\n const { ex: X1, ey: Y1, ez: Z1 } = this;\n const { ex: X2, ey: Y2, ez: Z2 } = other;\n const X1Z2 = modP(X1 * Z2);\n const X2Z1 = modP(X2 * Z1);\n const Y1Z2 = modP(Y1 * Z2);\n const Y2Z1 = modP(Y2 * Z1);\n return X1Z2 === X2Z1 && Y1Z2 === Y2Z1;\n }\n is0() {\n return this.equals(Point.ZERO);\n }\n negate() {\n // Flips point sign to a negative one (-x, y in affine coords)\n return new Point(modP(-this.ex), this.ey, this.ez, modP(-this.et));\n }\n // Fast algo for doubling Extended Point.\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd\n // Cost: 4M + 4S + 1*a + 6add + 1*2.\n double() {\n const { a } = CURVE;\n const { ex: X1, ey: Y1, ez: Z1 } = this;\n const A = modP(X1 * X1); // A = X12\n const B = modP(Y1 * Y1); // B = Y12\n const C = modP(_2n * modP(Z1 * Z1)); // C = 2*Z12\n const D = modP(a * A); // D = a*A\n const x1y1 = X1 + Y1;\n const E = modP(modP(x1y1 * x1y1) - A - B); // E = (X1+Y1)2-A-B\n const G = D + B; // G = D+B\n const F = G - C; // F = G-C\n const H = D - B; // H = D-B\n const X3 = modP(E * F); // X3 = E*F\n const Y3 = modP(G * H); // Y3 = G*H\n const T3 = modP(E * H); // T3 = E*H\n const Z3 = modP(F * G); // Z3 = F*G\n return new Point(X3, Y3, Z3, T3);\n }\n // Fast algo for adding 2 Extended Points.\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd\n // Cost: 9M + 1*a + 1*d + 7add.\n add(other) {\n aextpoint(other);\n const { a, d } = CURVE;\n const { ex: X1, ey: Y1, ez: Z1, et: T1 } = this;\n const { ex: X2, ey: Y2, ez: Z2, et: T2 } = other;\n const A = modP(X1 * X2); // A = X1*X2\n const B = modP(Y1 * Y2); // B = Y1*Y2\n const C = modP(T1 * d * T2); // C = T1*d*T2\n const D = modP(Z1 * Z2); // D = Z1*Z2\n const E = modP((X1 + Y1) * (X2 + Y2) - A - B); // E = (X1+Y1)*(X2+Y2)-A-B\n const F = D - C; // F = D-C\n const G = D + C; // G = D+C\n const H = modP(B - a * A); // H = B-a*A\n const X3 = modP(E * F); // X3 = E*F\n const Y3 = modP(G * H); // Y3 = G*H\n const T3 = modP(E * H); // T3 = E*H\n const Z3 = modP(F * G); // Z3 = F*G\n return new Point(X3, Y3, Z3, T3);\n }\n subtract(other) {\n return this.add(other.negate());\n }\n wNAF(n) {\n return wnaf.wNAFCached(this, n, Point.normalizeZ);\n }\n // Constant-time multiplication.\n multiply(scalar) {\n const n = scalar;\n aInRange('scalar', n, _1n, CURVE_ORDER); // 1 <= scalar < L\n const { p, f } = this.wNAF(n);\n return Point.normalizeZ([p, f])[0];\n }\n // Non-constant-time multiplication. Uses double-and-add algorithm.\n // It's faster, but should only be used when you don't care about\n // an exposed private key e.g. sig verification.\n // Does NOT allow scalars higher than CURVE.n.\n // Accepts optional accumulator to merge with multiply (important for sparse scalars)\n multiplyUnsafe(scalar, acc = Point.ZERO) {\n const n = scalar;\n aInRange('scalar', n, _0n, CURVE_ORDER); // 0 <= scalar < L\n if (n === _0n)\n return I;\n if (this.is0() || n === _1n)\n return this;\n return wnaf.wNAFCachedUnsafe(this, n, Point.normalizeZ, acc);\n }\n // Checks if point is of small order.\n // If you add something to small order point, you will have \"dirty\"\n // point with torsion component.\n // Multiplies point by cofactor and checks if the result is 0.\n isSmallOrder() {\n return this.multiplyUnsafe(cofactor).is0();\n }\n // Multiplies point by curve order and checks if the result is 0.\n // Returns `false` is the point is dirty.\n isTorsionFree() {\n return wnaf.unsafeLadder(this, CURVE_ORDER).is0();\n }\n // Converts Extended point to default (x, y) coordinates.\n // Can accept precomputed Z^-1 - for example, from invertBatch.\n toAffine(iz) {\n return toAffineMemo(this, iz);\n }\n clearCofactor() {\n const { h: cofactor } = CURVE;\n if (cofactor === _1n)\n return this;\n return this.multiplyUnsafe(cofactor);\n }\n // Converts hash string or Uint8Array to Point.\n // Uses algo from RFC8032 5.1.3.\n static fromHex(hex, zip215 = false) {\n const { d, a } = CURVE;\n const len = Fp.BYTES;\n hex = ensureBytes('pointHex', hex, len); // copy hex to a new array\n abool('zip215', zip215);\n const normed = hex.slice(); // copy again, we'll manipulate it\n const lastByte = hex[len - 1]; // select last byte\n normed[len - 1] = lastByte & ~0x80; // clear last bit\n const y = bytesToNumberLE(normed);\n // zip215=true is good for consensus-critical apps. =false follows RFC8032 / NIST186-5.\n // RFC8032 prohibits >= p, but ZIP215 doesn't\n // zip215=true: 0 <= y < MASK (2^256 for ed25519)\n // zip215=false: 0 <= y < P (2^255-19 for ed25519)\n const max = zip215 ? MASK : Fp.ORDER;\n aInRange('pointHex.y', y, _0n, max);\n // Ed25519: x² = (y²-1)/(dy²+1) mod p. Ed448: x² = (y²-1)/(dy²-1) mod p. Generic case:\n // ax²+y²=1+dx²y² => y²-1=dx²y²-ax² => y²-1=x²(dy²-a) => x²=(y²-1)/(dy²-a)\n const y2 = modP(y * y); // denominator is always non-0 mod p.\n const u = modP(y2 - _1n); // u = y² - 1\n const v = modP(d * y2 - a); // v = d y² + 1.\n let { isValid, value: x } = uvRatio(u, v); // √(u/v)\n if (!isValid)\n throw new Error('Point.fromHex: invalid y coordinate');\n const isXOdd = (x & _1n) === _1n; // There are 2 square roots. Use x_0 bit to select proper\n const isLastByteOdd = (lastByte & 0x80) !== 0; // x_0, last bit\n if (!zip215 && x === _0n && isLastByteOdd)\n // if x=0 and x_0 = 1, fail\n throw new Error('Point.fromHex: x=0 and x_0=1');\n if (isLastByteOdd !== isXOdd)\n x = modP(-x); // if x_0 != x mod 2, set x = p-x\n return Point.fromAffine({ x, y });\n }\n static fromPrivateKey(privKey) {\n const { scalar } = getPrivateScalar(privKey);\n return G.multiply(scalar); // reduced one call of `toRawBytes`\n }\n toRawBytes() {\n const { x, y } = this.toAffine();\n const bytes = numberToBytesLE(y, Fp.BYTES); // each y has 2 x values (x, -y)\n bytes[bytes.length - 1] |= x & _1n ? 0x80 : 0; // when compressing, it's enough to store y\n return bytes; // and use the last byte to encode sign of x\n }\n toHex() {\n return bytesToHex(this.toRawBytes()); // Same as toRawBytes, but returns string.\n }\n }\n // base / generator point\n Point.BASE = new Point(CURVE.Gx, CURVE.Gy, _1n, modP(CURVE.Gx * CURVE.Gy));\n // zero / infinity / identity point\n Point.ZERO = new Point(_0n, _1n, _1n, _0n); // 0, 1, 1, 0\n const { BASE: G, ZERO: I } = Point;\n const wnaf = wNAF(Point, nByteLength * 8);\n function modN(a) {\n return mod(a, CURVE_ORDER);\n }\n // Little-endian SHA512 with modulo n\n function modN_LE(hash) {\n return modN(bytesToNumberLE(hash));\n }\n // Get the hashed private scalar per RFC8032 5.1.5\n function getPrivateScalar(key) {\n const len = Fp.BYTES;\n key = ensureBytes('private key', key, len);\n // Hash private key with curve's hash function to produce uniformingly random input\n // Check byte lengths: ensure(64, h(ensure(32, key)))\n const hashed = ensureBytes('hashed private key', cHash(key), 2 * len);\n const head = adjustScalarBytes(hashed.slice(0, len)); // clear first half bits, produce FE\n const prefix = hashed.slice(len, 2 * len); // second half is called key prefix (5.1.6)\n const scalar = modN_LE(head); // The actual private scalar\n return { head, prefix, scalar };\n }\n // Convenience method that creates public key from scalar. RFC8032 5.1.5\n function getExtendedPublicKey(key) {\n const { head, prefix, scalar } = getPrivateScalar(key);\n const point = G.multiply(scalar); // Point on Edwards curve aka public key\n const pointBytes = point.toRawBytes(); // Uint8Array representation\n return { head, prefix, scalar, point, pointBytes };\n }\n // Calculates EdDSA pub key. RFC8032 5.1.5. Privkey is hashed. Use first half with 3 bits cleared\n function getPublicKey(privKey) {\n return getExtendedPublicKey(privKey).pointBytes;\n }\n // int('LE', SHA512(dom2(F, C) || msgs)) mod N\n function hashDomainToScalar(context = Uint8Array.of(), ...msgs) {\n const msg = concatBytes(...msgs);\n return modN_LE(cHash(domain(msg, ensureBytes('context', context), !!prehash)));\n }\n /** Signs message with privateKey. RFC8032 5.1.6 */\n function sign(msg, privKey, options = {}) {\n msg = ensureBytes('message', msg);\n if (prehash)\n msg = prehash(msg); // for ed25519ph etc.\n const { prefix, scalar, pointBytes } = getExtendedPublicKey(privKey);\n const r = hashDomainToScalar(options.context, prefix, msg); // r = dom2(F, C) || prefix || PH(M)\n const R = G.multiply(r).toRawBytes(); // R = rG\n const k = hashDomainToScalar(options.context, R, pointBytes, msg); // R || A || PH(M)\n const s = modN(r + k * scalar); // S = (r + k * s) mod L\n aInRange('signature.s', s, _0n, CURVE_ORDER); // 0 <= s < l\n const res = concatBytes(R, numberToBytesLE(s, Fp.BYTES));\n return ensureBytes('result', res, Fp.BYTES * 2); // 64-byte signature\n }\n const verifyOpts = VERIFY_DEFAULT;\n /**\n * Verifies EdDSA signature against message and public key. RFC8032 5.1.7.\n * An extended group equation is checked.\n */\n function verify(sig, msg, publicKey, options = verifyOpts) {\n const { context, zip215 } = options;\n const len = Fp.BYTES; // Verifies EdDSA signature against message and public key. RFC8032 5.1.7.\n sig = ensureBytes('signature', sig, 2 * len); // An extended group equation is checked.\n msg = ensureBytes('message', msg);\n publicKey = ensureBytes('publicKey', publicKey, len);\n if (zip215 !== undefined)\n abool('zip215', zip215);\n if (prehash)\n msg = prehash(msg); // for ed25519ph, etc\n const s = bytesToNumberLE(sig.slice(len, 2 * len));\n let A, R, SB;\n try {\n // zip215=true is good for consensus-critical apps. =false follows RFC8032 / NIST186-5.\n // zip215=true: 0 <= y < MASK (2^256 for ed25519)\n // zip215=false: 0 <= y < P (2^255-19 for ed25519)\n A = Point.fromHex(publicKey, zip215);\n R = Point.fromHex(sig.slice(0, len), zip215);\n SB = G.multiplyUnsafe(s); // 0 <= s < l is done inside\n }\n catch (error) {\n return false;\n }\n if (!zip215 && A.isSmallOrder())\n return false;\n const k = hashDomainToScalar(context, R.toRawBytes(), A.toRawBytes(), msg);\n const RkA = R.add(A.multiplyUnsafe(k));\n // Extended group equation\n // [8][S]B = [8]R + [8][k]A'\n return RkA.subtract(SB).clearCofactor().equals(Point.ZERO);\n }\n G._setWindowSize(8); // Enable precomputes. Slows down first publicKey computation by 20ms.\n const utils = {\n getExtendedPublicKey,\n /** ed25519 priv keys are uniform 32b. No need to check for modulo bias, like in secp256k1. */\n randomPrivateKey: () => randomBytes(Fp.BYTES),\n /**\n * We're doing scalar multiplication (used in getPublicKey etc) with precomputed BASE_POINT\n * values. This slows down first getPublicKey() by milliseconds (see Speed section),\n * but allows to speed-up subsequent getPublicKey() calls up to 20x.\n * @param windowSize 2, 4, 8, 16\n */\n precompute(windowSize = 8, point = Point.BASE) {\n point._setWindowSize(windowSize);\n point.multiply(BigInt(3));\n return point;\n },\n };\n return {\n CURVE,\n getPublicKey,\n sign,\n verify,\n ExtendedPoint: Point,\n utils,\n };\n}\n//# sourceMappingURL=edwards.js.map"],"names":["_0n","BigInt","_1n","_2n","_8n","VERIFY_DEFAULT","zip215","twistedEdwards","curveDef","CURVE","curve","opts","validateBasic","validateObject","hash","a","d","randomBytes","adjustScalarBytes","domain","uvRatio","mapToCurve","Object","freeze","validateOpts","Fp","n","CURVE_ORDER","prehash","cHash","nByteLength","h","cofactor","MASK","modP","create","Fn","Field","nBitLength","x","y","x2","sqr","y2","left","add","mul","right","ONE","eql","isEdValidXY","Gx","Gy","Error","u","v","isValid","value","sqrt","inv","e","bytes","data","ctx","phflag","abool","length","aCoordinate","title","banZero","aInRange","aextpoint","other","Point","toAffineMemo","memoized","p","iz","ex","ey","ez","z","is0","ax","ay","zz","assertValidMemo","X","Y","Z","et","T","X2","Y2","Z2","Z4","aX2","constructor","this","toAffine","fromAffine","normalizeZ","points","toInv","FpInvertBatch","map","i","msm","scalars","pippenger","_setWindowSize","windowSize","wnaf","setWindowSize","assertValidity","equals","X1","Y1","Z1","X1Z2","X2Z1","Y1Z2","Y2Z1","ZERO","negate","double","A","B","C","D","x1y1","E","G","F","H","X3","Y3","T3","Z3","T1","T2","subtract","wNAF","wNAFCached","multiply","scalar","f","multiplyUnsafe","acc","I","wNAFCachedUnsafe","isSmallOrder","isTorsionFree","unsafeLadder","clearCofactor","fromHex","hex","len","BYTES","ensureBytes","normed","slice","lastByte","bytesToNumberLE","max","ORDER","isXOdd","isLastByteOdd","fromPrivateKey","privKey","getPrivateScalar","toRawBytes","numberToBytesLE","toHex","bytesToHex","BASE","modN","mod","modN_LE","key","hashed","head","prefix","getExtendedPublicKey","point","pointBytes","hashDomainToScalar","context","Uint8Array","of","msgs","msg","concatBytes","verifyOpts","getPublicKey","sign","options","r","R","s","res","verify","sig","publicKey","undefined","SB","error","k","ExtendedPoint","utils","randomPrivateKey","precompute"],"mappings":";;AAqBA,MAAMA,EAAMC,OAAO,GAAIC,EAAMD,OAAO,GAAIE,EAAMF,OAAO,GAAIG,EAAMH,OAAO,GAkBhEI,EAAiB,CAAEC,QAAQ,GAsF3B,SAAUC,EAAeC,GAC7B,MAAMC,EArFR,SAAsBC,GACpB,MAAMC,EAAOC,EAAcF,GAiB3B,OAhBAG,EACEH,EACA,CACEI,KAAM,WACNC,EAAG,SACHC,EAAG,SACHC,YAAa,YAEf,CACEC,kBAAmB,WACnBC,OAAQ,WACRC,QAAS,WACTC,WAAY,aAITC,OAAOC,OAAO,IAAKZ,GAC5B,CAkEgBa,CAAahB,IACrBiB,GACJA,EACAC,EAAGC,EACHC,QAASA,EACTd,KAAMe,EAAKZ,YACXA,EAAWa,YACXA,EACAC,EAAGC,GACDvB,EAK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L,EACtBvC,EAAMpI,EAAGqI,MACf4C,EAAM3C,EAAY,YAAa2C,EAAK,EAAI7C,GACxCkC,EAAMhC,EAAY,UAAWgC,GAC7BY,EAAY5C,EAAY,YAAa4C,EAAW9C,QACjC+C,IAAXtM,GAAsB2D,EAAM,SAAU3D,GACtCsB,IAASmK,EAAMnK,EAAQmK,IAE3B,MAAMQ,EAAIpC,EAAgBuC,EAAIzC,MAAMJ,EAAK,EAAIA,IAC7C,IAAI/B,EAAGwE,EAAGO,EACV,IAIE/E,EAAIrD,EAAMkF,QAAQgD,EAAWrM,GAC7BgM,EAAI7H,EAAMkF,QAAQ+C,EAAIzC,MAAM,EAAGJ,GAAMvJ,GACrCuM,EAAKzE,EAAEe,eAAeoD,EACvB,CAAC,MAAOO,GACP,OAAO,CACT,CACA,IAAKxM,GAAUwH,EAAEyB,eAAgB,OAAO,EAExC,MAAMwD,EAAIrB,EAAmBC,EAASW,EAAE3B,aAAc7C,EAAE6C,aAAcoB,GAItE,OAHYO,EAAEzJ,IAAIiF,EAAEqB,eAAe4D,IAGxBlE,SAASgE,GAAInD,gBAAgBvC,OAAO1C,EAAMkD,KACvD,EA2BEqF,cAAevI,EACfwI,MAxBY,CACZ1B,uBAEA2B,iBAAkBA,IAAkBjM,EAAYQ,EAAGqI,OAQnDqD,WAAUA,CAACpG,EAAa,EAAGyE,EAAsB/G,EAAMsG,QACrDS,EAAM1E,eAAeC,GACrByE,EAAMxC,SAAS/I,OAAO,IACfuL,IAYb","x_google_ignoreList":[0]}
@@ -0,0 +1,4 @@
1
+ import{anumber as r}from"../../../hashes/esm/utils.js";import{numberToBytesLE as t,numberToBytesBE as e,bitMask as n,bytesToNumberLE as o,bytesToNumberBE as i,validateObject as s}from"./utils.js";
2
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
+ const u=BigInt(0),f=BigInt(1),l=BigInt(2),d=BigInt(3),c=BigInt(4),w=BigInt(5),E=BigInt(8);function g(r,t){const e=r%t;return e>=u?e:t+e}function a(r,t,e){let n=r;for(;t-- >u;)n*=n,n%=e;return n}function m(r,t){if(r===u)throw new Error("invert: expected non-zero number");if(t<=u)throw new Error("invert: expected positive modulus, got "+t);let e=g(r,t),n=t,o=u,i=f;for(;e!==u;){const r=n%e,t=o-i*(n/e);n=e,e=r,o=i,i=t}if(n!==f)throw new Error("invert: does not exist");return g(o,t)}function h(r,t){const e=(r.ORDER+f)/c,n=r.pow(t,e);if(!r.eql(r.sqr(n),t))throw new Error("Cannot find square root");return n}function q(r,t){const e=(r.ORDER-w)/E,n=r.mul(t,l),o=r.pow(n,e),i=r.mul(t,o),s=r.mul(r.mul(i,l),o),u=r.mul(i,r.sub(s,r.ONE));if(!r.eql(r.sqr(u),t))throw new Error("Cannot find square root");return u}function p(r){if(r<BigInt(3))throw new Error("sqrt is not defined for small field");let t=r-f,e=0;for(;t%l===u;)t/=l,e++;let n=l;const o=x(r);for(;1===I(o,n);)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===e)return h;let i=o.pow(n,t);const s=(t+f)/l;return function(r,n){if(r.is0(n))return n;if(1!==I(r,n))throw new Error("Cannot find square root");let o=e,u=r.mul(r.ONE,i),l=r.pow(n,t),d=r.pow(n,s);for(;!r.eql(l,r.ONE);){if(r.is0(l))return r.ZERO;let t=1,e=r.sqr(l);for(;!r.eql(e,r.ONE);)if(t++,e=r.sqr(e),t===o)throw new Error("Cannot find square root");const n=f<<BigInt(o-t-1),i=r.pow(u,n);o=t,u=r.sqr(i),l=r.mul(l,u),d=r.mul(d,i)}return d}}function O(r){return r%c===d?h:r%E===w?q:p(r)}const B=(r,t)=>(g(r,t)&f)===f,v=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function R(r){const t=v.reduce(((r,t)=>(r[t]="function",r)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return s(r,t)}function N(r,t,e){if(e<u)throw new Error("invalid exponent, negatives unsupported");if(e===u)return r.ONE;if(e===f)return t;let n=r.ONE,o=t;for(;e>u;)e&f&&(n=r.mul(n,o)),o=r.sqr(o),e>>=f;return n}function b(r,t,e=!1){const n=new Array(t.length).fill(e?r.ZERO:void 0),o=t.reduce(((t,e,o)=>r.is0(e)?t:(n[o]=t,r.mul(t,e))),r.ONE),i=r.inv(o);return t.reduceRight(((t,e,o)=>r.is0(e)?t:(n[o]=r.mul(t,n[o]),r.mul(t,e))),i),n}function I(r,t){const e=(r.ORDER-f)/l,n=r.pow(t,e),o=r.eql(n,r.ONE),i=r.eql(n,r.ZERO),s=r.eql(n,r.neg(r.ONE));if(!o&&!i&&!s)throw new Error("invalid Legendre symbol result");return o?1:i?0:-1}function y(t,e){void 0!==e&&r(e);const n=void 0!==e?e:t.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function x(r,s,l=!1,d={}){if(r<=u)throw new Error("invalid field: expected ORDER > 0, got "+r);const{nBitLength:c,nByteLength:w}=y(r,s);if(w>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let E;const a=Object.freeze({ORDER:r,isLE:l,BITS:c,BYTES:w,MASK:n(c),ZERO:u,ONE:f,create:t=>g(t,r),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return u<=t&&t<r},is0:r=>r===u,isOdd:r=>(r&f)===f,neg:t=>g(-t,r),eql:(r,t)=>r===t,sqr:t=>g(t*t,r),add:(t,e)=>g(t+e,r),sub:(t,e)=>g(t-e,r),mul:(t,e)=>g(t*e,r),pow:(r,t)=>N(a,r,t),div:(t,e)=>g(t*m(e,r),r),sqrN:r=>r*r,addN:(r,t)=>r+t,subN:(r,t)=>r-t,mulN:(r,t)=>r*t,inv:t=>m(t,r),sqrt:d.sqrt||(t=>(E||(E=O(r)),E(a,t))),toBytes:r=>l?t(r,w):e(r,w),fromBytes:r=>{if(r.length!==w)throw new Error("Field.fromBytes: expected "+w+" bytes, got "+r.length);return l?o(r):i(r)},invertBatch:r=>b(a,r),cmov:(r,t,e)=>e?t:r});return Object.freeze(a)}export{x as Field,b as FpInvertBatch,I as FpLegendre,N as FpPow,O as FpSqrt,m as invert,B as isNegativeLE,g as mod,y as nLength,a as pow2,p as tonelliShanks,R as validateField};
4
+ //# sourceMappingURL=modular.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modular.js","sources":["../../../../../../../node_modules/@noble/curves/esm/abstract/modular.js"],"sourcesContent":["/**\n * Utils for modular division and finite fields.\n * A finite field over 11 is integer number operations `mod 11`.\n * There is no division: it is replaced by modular multiplicative inverse.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { anumber } from '@noble/hashes/utils';\nimport { bitMask, bytesToNumberBE, bytesToNumberLE, ensureBytes, numberToBytesBE, numberToBytesLE, validateObject, } from \"./utils.js\";\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _3n = /* @__PURE__ */ BigInt(3);\n// prettier-ignore\nconst _4n = /* @__PURE__ */ BigInt(4), _5n = /* @__PURE__ */ BigInt(5), _8n = /* @__PURE__ */ BigInt(8);\n// Calculates a modulo b\nexport function mod(a, b) {\n const result = a % b;\n return result >= _0n ? result : b + result;\n}\n/**\n * Efficiently raise num to power and do modular division.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n * TODO: remove.\n * @example\n * pow(2n, 6n, 11n) // 64n % 11n == 9n\n */\nexport function pow(num, power, modulo) {\n return FpPow(Field(modulo), num, power);\n}\n/** Does `x^(2^power)` mod p. `pow2(30, 4)` == `30^(2^4)` */\nexport function pow2(x, power, modulo) {\n let res = x;\n while (power-- > _0n) {\n res *= res;\n res %= modulo;\n }\n return res;\n}\n/**\n * Inverses number over modulo.\n * Implemented using [Euclidean GCD](https://brilliant.org/wiki/extended-euclidean-algorithm/).\n */\nexport function invert(number, modulo) {\n if (number === _0n)\n throw new Error('invert: expected non-zero number');\n if (modulo <= _0n)\n throw new Error('invert: expected positive modulus, got ' + modulo);\n // Fermat's little theorem \"CT-like\" version inv(n) = n^(m-2) mod m is 30x slower.\n let a = mod(number, modulo);\n let b = modulo;\n // prettier-ignore\n let x = _0n, y = _1n, u = _1n, v = _0n;\n while (a !== _0n) {\n // JIT applies optimization if those two lines follow each other\n const q = b / a;\n const r = b % a;\n const m = x - u * q;\n const n = y - v * q;\n // prettier-ignore\n b = a, a = r, x = u, y = v, u = m, v = n;\n }\n const gcd = b;\n if (gcd !== _1n)\n throw new Error('invert: does not exist');\n return mod(x, modulo);\n}\n// Not all roots are possible! Example which will throw:\n// const NUM =\n// n = 72057594037927816n;\n// Fp = Field(BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab'));\nfunction sqrt3mod4(Fp, n) {\n const p1div4 = (Fp.ORDER + _1n) / _4n;\n const root = Fp.pow(n, p1div4);\n // Throw if root^2 != n\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n}\nfunction sqrt5mod8(Fp, n) {\n const p5div8 = (Fp.ORDER - _5n) / _8n;\n const n2 = Fp.mul(n, _2n);\n const v = Fp.pow(n2, p5div8);\n const nv = Fp.mul(n, v);\n const i = Fp.mul(Fp.mul(nv, _2n), v);\n const root = Fp.mul(nv, Fp.sub(i, Fp.ONE));\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n}\n// TODO: Commented-out for now. Provide test vectors.\n// Tonelli is too slow for extension fields Fp2.\n// That means we can't use sqrt (c1, c2...) even for initialization constants.\n// if (P % _16n === _9n) return sqrt9mod16;\n// // prettier-ignore\n// function sqrt9mod16<T>(Fp: IField<T>, n: T, p7div16?: bigint) {\n// if (p7div16 === undefined) p7div16 = (Fp.ORDER + BigInt(7)) / _16n;\n// const c1 = Fp.sqrt(Fp.neg(Fp.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F\n// const c2 = Fp.sqrt(c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F\n// const c3 = Fp.sqrt(Fp.neg(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F\n// const c4 = p7div16; // 4. c4 = (q + 7) / 16 # Integer arithmetic\n// let tv1 = Fp.pow(n, c4); // 1. tv1 = x^c4\n// let tv2 = Fp.mul(c1, tv1); // 2. tv2 = c1 * tv1\n// const tv3 = Fp.mul(c2, tv1); // 3. tv3 = c2 * tv1\n// let tv4 = Fp.mul(c3, tv1); // 4. tv4 = c3 * tv1\n// const e1 = Fp.eql(Fp.sqr(tv2), n); // 5. e1 = (tv2^2) == x\n// const e2 = Fp.eql(Fp.sqr(tv3), n); // 6. e2 = (tv3^2) == x\n// tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x\n// tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x\n// const e3 = Fp.eql(Fp.sqr(tv2), n); // 9. e3 = (tv2^2) == x\n// return Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select the sqrt from tv1 and tv2\n// }\n/**\n * Tonelli-Shanks square root search algorithm.\n * 1. https://eprint.iacr.org/2012/685.pdf (page 12)\n * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks\n * @param P field order\n * @returns function that takes field Fp (created from P) and number n\n */\nexport function tonelliShanks(P) {\n // Initialization (precomputation).\n if (P < BigInt(3))\n throw new Error('sqrt is not defined for small field');\n // Factor P - 1 = Q * 2^S, where Q is odd\n let Q = P - _1n;\n let S = 0;\n while (Q % _2n === _0n) {\n Q /= _2n;\n S++;\n }\n // Find the first quadratic non-residue Z >= 2\n let Z = _2n;\n const _Fp = Field(P);\n while (FpLegendre(_Fp, Z) === 1) {\n // Basic primality test for P. After x iterations, chance of\n // not finding quadratic non-residue is 2^x, so 2^1000.\n if (Z++ > 1000)\n throw new Error('Cannot find square root: probably non-prime P');\n }\n // Fast-path; usually done before Z, but we do \"primality test\".\n if (S === 1)\n return sqrt3mod4;\n // Slow-path\n // TODO: test on Fp2 and others\n let cc = _Fp.pow(Z, Q); // c = z^Q\n const Q1div2 = (Q + _1n) / _2n;\n return function tonelliSlow(Fp, n) {\n if (Fp.is0(n))\n return n;\n // Check if n is a quadratic residue using Legendre symbol\n if (FpLegendre(Fp, n) !== 1)\n throw new Error('Cannot find square root');\n // Initialize variables for the main loop\n let M = S;\n let c = Fp.mul(Fp.ONE, cc); // c = z^Q, move cc from field _Fp into field Fp\n let t = Fp.pow(n, Q); // t = n^Q, first guess at the fudge factor\n let R = Fp.pow(n, Q1div2); // R = n^((Q+1)/2), first guess at the square root\n // Main loop\n // while t != 1\n while (!Fp.eql(t, Fp.ONE)) {\n if (Fp.is0(t))\n return Fp.ZERO; // if t=0 return R=0\n let i = 1;\n // Find the smallest i >= 1 such that t^(2^i) ≡ 1 (mod P)\n let t_tmp = Fp.sqr(t); // t^(2^1)\n while (!Fp.eql(t_tmp, Fp.ONE)) {\n i++;\n t_tmp = Fp.sqr(t_tmp); // t^(2^2)...\n if (i === M)\n throw new Error('Cannot find square root');\n }\n // Calculate the exponent for b: 2^(M - i - 1)\n const exponent = _1n << BigInt(M - i - 1); // bigint is important\n const b = Fp.pow(c, exponent); // b = 2^(M - i - 1)\n // Update variables\n M = i;\n c = Fp.sqr(b); // c = b^2\n t = Fp.mul(t, c); // t = (t * b^2)\n R = Fp.mul(R, b); // R = R*b\n }\n return R;\n };\n}\n/**\n * Square root for a finite field. Will try optimized versions first:\n *\n * 1. P ≡ 3 (mod 4)\n * 2. P ≡ 5 (mod 8)\n * 3. Tonelli-Shanks algorithm\n *\n * Different algorithms can give different roots, it is up to user to decide which one they want.\n * For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve).\n */\nexport function FpSqrt(P) {\n // P ≡ 3 (mod 4) => √n = n^((P+1)/4)\n if (P % _4n === _3n)\n return sqrt3mod4;\n // P ≡ 5 (mod 8) => Atkin algorithm, page 10 of https://eprint.iacr.org/2012/685.pdf\n if (P % _8n === _5n)\n return sqrt5mod8;\n // P ≡ 9 (mod 16) not implemented, see above\n // Tonelli-Shanks algorithm\n return tonelliShanks(P);\n}\n// Little-endian check for first LE bit (last BE bit);\nexport const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n;\n// prettier-ignore\nconst FIELD_FIELDS = [\n 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr',\n 'eql', 'add', 'sub', 'mul', 'pow', 'div',\n 'addN', 'subN', 'mulN', 'sqrN'\n];\nexport function validateField(field) {\n const initial = {\n ORDER: 'bigint',\n MASK: 'bigint',\n BYTES: 'isSafeInteger',\n BITS: 'isSafeInteger',\n };\n const opts = FIELD_FIELDS.reduce((map, val) => {\n map[val] = 'function';\n return map;\n }, initial);\n return validateObject(field, opts);\n}\n// Generic field functions\n/**\n * Same as `pow` but for Fp: non-constant-time.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n */\nexport function FpPow(Fp, num, power) {\n if (power < _0n)\n throw new Error('invalid exponent, negatives unsupported');\n if (power === _0n)\n return Fp.ONE;\n if (power === _1n)\n return num;\n let p = Fp.ONE;\n let d = num;\n while (power > _0n) {\n if (power & _1n)\n p = Fp.mul(p, d);\n d = Fp.sqr(d);\n power >>= _1n;\n }\n return p;\n}\n/**\n * Efficiently invert an array of Field elements.\n * Exception-free. Will return `undefined` for 0 elements.\n * @param passZero map 0 to 0 (instead of undefined)\n */\nexport function FpInvertBatch(Fp, nums, passZero = false) {\n const inverted = new Array(nums.length).fill(passZero ? Fp.ZERO : undefined);\n // Walk from first to last, multiply them by each other MOD p\n const multipliedAcc = nums.reduce((acc, num, i) => {\n if (Fp.is0(num))\n return acc;\n inverted[i] = acc;\n return Fp.mul(acc, num);\n }, Fp.ONE);\n // Invert last element\n const invertedAcc = Fp.inv(multipliedAcc);\n // Walk from last to first, multiply them by inverted each other MOD p\n nums.reduceRight((acc, num, i) => {\n if (Fp.is0(num))\n return acc;\n inverted[i] = Fp.mul(acc, inverted[i]);\n return Fp.mul(acc, num);\n }, invertedAcc);\n return inverted;\n}\n// TODO: remove\nexport function FpDiv(Fp, lhs, rhs) {\n return Fp.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, Fp.ORDER) : Fp.inv(rhs));\n}\n/**\n * Legendre symbol.\n * Legendre constant is used to calculate Legendre symbol (a | p)\n * which denotes the value of a^((p-1)/2) (mod p).\n *\n * * (a | p) ≡ 1 if a is a square (mod p), quadratic residue\n * * (a | p) ≡ -1 if a is not a square (mod p), quadratic non residue\n * * (a | p) ≡ 0 if a ≡ 0 (mod p)\n */\nexport function FpLegendre(Fp, n) {\n // We can use 3rd argument as optional cache of this value\n // but seems unneeded for now. The operation is very fast.\n const p1mod2 = (Fp.ORDER - _1n) / _2n;\n const powered = Fp.pow(n, p1mod2);\n const yes = Fp.eql(powered, Fp.ONE);\n const zero = Fp.eql(powered, Fp.ZERO);\n const no = Fp.eql(powered, Fp.neg(Fp.ONE));\n if (!yes && !zero && !no)\n throw new Error('invalid Legendre symbol result');\n return yes ? 1 : zero ? 0 : -1;\n}\n// This function returns True whenever the value x is a square in the field F.\nexport function FpIsSquare(Fp, n) {\n const l = FpLegendre(Fp, n);\n return l === 1;\n}\n// CURVE.n lengths\nexport function nLength(n, nBitLength) {\n // Bit size, byte size of CURVE.n\n if (nBitLength !== undefined)\n anumber(nBitLength);\n const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length;\n const nByteLength = Math.ceil(_nBitLength / 8);\n return { nBitLength: _nBitLength, nByteLength };\n}\n/**\n * Initializes a finite field over prime.\n * Major performance optimizations:\n * * a) denormalized operations like mulN instead of mul\n * * b) same object shape: never add or remove keys\n * * c) Object.freeze\n * Fragile: always run a benchmark on a change.\n * Security note: operations don't check 'isValid' for all elements for performance reasons,\n * it is caller responsibility to check this.\n * This is low-level code, please make sure you know what you're doing.\n * @param ORDER prime positive bigint\n * @param bitLen how many bits the field consumes\n * @param isLE (def: false) if encoding / decoding should be in little-endian\n * @param redef optional faster redefinitions of sqrt and other methods\n */\nexport function Field(ORDER, bitLen, isLE = false, redef = {}) {\n if (ORDER <= _0n)\n throw new Error('invalid field: expected ORDER > 0, got ' + ORDER);\n const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen);\n if (BYTES > 2048)\n throw new Error('invalid field: expected ORDER of <= 2048 bytes');\n let sqrtP; // cached sqrtP\n const f = Object.freeze({\n ORDER,\n isLE,\n BITS,\n BYTES,\n MASK: bitMask(BITS),\n ZERO: _0n,\n ONE: _1n,\n create: (num) => mod(num, ORDER),\n isValid: (num) => {\n if (typeof num !== 'bigint')\n throw new Error('invalid field element: expected bigint, got ' + typeof num);\n return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible\n },\n is0: (num) => num === _0n,\n isOdd: (num) => (num & _1n) === _1n,\n neg: (num) => mod(-num, ORDER),\n eql: (lhs, rhs) => lhs === rhs,\n sqr: (num) => mod(num * num, ORDER),\n add: (lhs, rhs) => mod(lhs + rhs, ORDER),\n sub: (lhs, rhs) => mod(lhs - rhs, ORDER),\n mul: (lhs, rhs) => mod(lhs * rhs, ORDER),\n pow: (num, power) => FpPow(f, num, power),\n div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER),\n // Same as above, but doesn't normalize\n sqrN: (num) => num * num,\n addN: (lhs, rhs) => lhs + rhs,\n subN: (lhs, rhs) => lhs - rhs,\n mulN: (lhs, rhs) => lhs * rhs,\n inv: (num) => invert(num, ORDER),\n sqrt: redef.sqrt ||\n ((n) => {\n if (!sqrtP)\n sqrtP = FpSqrt(ORDER);\n return sqrtP(f, n);\n }),\n toBytes: (num) => (isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES)),\n fromBytes: (bytes) => {\n if (bytes.length !== BYTES)\n throw new Error('Field.fromBytes: expected ' + BYTES + ' bytes, got ' + bytes.length);\n return isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);\n },\n // TODO: we don't need it here, move out to separate fn\n invertBatch: (lst) => FpInvertBatch(f, lst),\n // We can't move this out because Fp6, Fp12 implement it\n // and it's unclear what to return in there.\n cmov: (a, b, c) => (c ? b : a),\n });\n return Object.freeze(f);\n}\nexport function FpSqrtOdd(Fp, elm) {\n if (!Fp.isOdd)\n throw new Error(\"Field doesn't have isOdd\");\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? root : Fp.neg(root);\n}\nexport function FpSqrtEven(Fp, elm) {\n if (!Fp.isOdd)\n throw new Error(\"Field doesn't have isOdd\");\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? Fp.neg(root) : root;\n}\n/**\n * \"Constant-time\" private key generation utility.\n * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field).\n * Which makes it slightly more biased, less secure.\n * @deprecated use `mapKeyToField` instead\n */\nexport function hashToPrivateScalar(hash, groupOrder, isLE = false) {\n hash = ensureBytes('privateHash', hash);\n const hashLen = hash.length;\n const minLen = nLength(groupOrder).nByteLength + 8;\n if (minLen < 24 || hashLen < minLen || hashLen > 1024)\n throw new Error('hashToPrivateScalar: expected ' + minLen + '-1024 bytes of input, got ' + hashLen);\n const num = isLE ? bytesToNumberLE(hash) : bytesToNumberBE(hash);\n return mod(num, groupOrder - _1n) + _1n;\n}\n/**\n * Returns total number of bytes consumed by the field element.\n * For example, 32 bytes for usual 256-bit weierstrass curve.\n * @param fieldOrder number of field elements, usually CURVE.n\n * @returns byte length of field\n */\nexport function getFieldBytesLength(fieldOrder) {\n if (typeof fieldOrder !== 'bigint')\n throw new Error('field order must be bigint');\n const bitLength = fieldOrder.toString(2).length;\n return Math.ceil(bitLength / 8);\n}\n/**\n * Returns minimal amount of bytes that can be safely reduced\n * by field order.\n * Should be 2^-128 for 128-bit curve such as P256.\n * @param fieldOrder number of field elements, usually CURVE.n\n * @returns byte length of target hash\n */\nexport function getMinHashLength(fieldOrder) {\n const length = getFieldBytesLength(fieldOrder);\n return length + Math.ceil(length / 2);\n}\n/**\n * \"Constant-time\" private key generation utility.\n * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF\n * and convert them into private scalar, with the modulo bias being negligible.\n * Needs at least 48 bytes of input for 32-byte private key.\n * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/\n * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final\n * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5\n * @param hash hash output from SHA3 or a similar function\n * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n)\n * @param isLE interpret hash bytes as LE num\n * @returns valid private scalar\n */\nexport function mapHashToField(key, fieldOrder, isLE = false) {\n const len = key.length;\n const fieldLen = getFieldBytesLength(fieldOrder);\n const minLen = getMinHashLength(fieldOrder);\n // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings.\n if (len < 16 || len < minLen || len > 1024)\n throw new Error('expected ' + minLen + '-1024 bytes of input, got ' + len);\n const num = isLE ? bytesToNumberLE(key) : bytesToNumberBE(key);\n // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0\n const reduced = mod(num, fieldOrder - _1n) + _1n;\n return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);\n}\n//# sourceMappingURL=modular.js.map"],"names":["_0n","BigInt","_1n","_2n","_3n","_4n","_5n","_8n","mod","a","b","result","pow2","x","power","modulo","res","invert","number","Error","u","r","m","sqrt3mod4","Fp","n","p1div4","ORDER","root","pow","eql","sqr","sqrt5mod8","p5div8","n2","mul","v","nv","i","sub","ONE","tonelliShanks","P","Q","S","Z","_Fp","Field","FpLegendre","cc","Q1div2","is0","M","c","t","R","ZERO","t_tmp","exponent","FpSqrt","isNegativeLE","num","FIELD_FIELDS","validateField","field","opts","reduce","map","val","MASK","BYTES","BITS","validateObject","FpPow","p","d","FpInvertBatch","nums","passZero","inverted","Array","length","fill","undefined","multipliedAcc","acc","invertedAcc","inv","reduceRight","p1mod2","powered","yes","zero","no","neg","nLength","nBitLength","anumber","_nBitLength","toString","nByteLength","Math","ceil","bitLen","isLE","redef","sqrtP","f","Object","freeze","bitMask","create","isValid","isOdd","lhs","rhs","add","div","sqrN","addN","subN","mulN","sqrt","toBytes","numberToBytesLE","numberToBytesBE","fromBytes","bytes","bytesToNumberLE","bytesToNumberBE","invertBatch","lst","cmov"],"mappings":";;AAmBA,MAAMA,EAAMC,OAAO,GAAIC,EAAMD,OAAO,GAAIE,EAAsBF,OAAO,GAAIG,EAAsBH,OAAO,GAEhGI,EAAsBJ,OAAO,GAAIK,EAAsBL,OAAO,GAAIM,EAAsBN,OAAO,GAG/F,SAAUO,EAAIC,EAAWC,GAC7B,MAAMC,EAASF,EAAIC,EACnB,OAAOC,GAAUX,EAAMW,EAASD,EAAIC,CACtC,CAaM,SAAUC,EAAKC,EAAWC,EAAeC,GAC7C,IAAIC,EAAMH,EACV,KAAOC,KAAUd,GACfgB,GAAOA,EACPA,GAAOD,EAET,OAAOC,CACT,CAMM,SAAUC,EAAOC,EAAgBH,GACrC,GAAIG,IAAWlB,EAAK,MAAM,IAAImB,MAAM,oCACpC,GAAIJ,GAAUf,EAAK,MAAM,IAAImB,MAAM,0CAA4CJ,GAE/E,IAAIN,EAAID,EAAIU,EAAQH,GAChBL,EAAIK,EAEJF,EAAIb,EAAcoB,EAAIlB,EAC1B,KAAOO,IAAMT,GAAK,CAEhB,MACMqB,EAAIX,EAAID,EACRa,EAAIT,EAAIO,GAFJV,EAAID,GAKdC,EAAID,EAAGA,EAAIY,EAAGR,EAAIO,EAAUA,EAAIE,CAClC,CAEA,GADYZ,IACAR,EAAK,MAAM,IAAIiB,MAAM,0BACjC,OAAOX,EAAIK,EAAGE,EAChB,CAMA,SAASQ,EAAaC,EAAeC,GACnC,MAAMC,G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MA,CAACP,EAAKC,IAAQD,EAAMC,EAE1B5B,IAAM1B,GAAQ5C,EAAO4C,EAAKlC,GAC1B+F,KACEjB,EAAMiB,MAAI,CACRjG,IACKiF,IAAOA,EAAQ/C,EAAOhC,IACpB+E,EAAMC,EAAGlF,KAEpBkG,QAAU9D,GAAS2C,EAAOoB,EAAgB/D,EAAKS,GAASuD,EAAgBhE,EAAKS,GAC7EwD,UAAYC,IACV,GAAIA,EAAM9C,SAAWX,EACnB,MAAM,IAAInD,MAAM,6BAA+BmD,EAAQ,eAAiByD,EAAM9C,QAChF,OAAOuB,EAAOwB,EAAgBD,GAASE,EAAgBF,EAAM,EAG/DG,YAAcC,GAAQvD,EAAc+B,EAAGwB,GAGvCC,KAAMA,CAAC3H,EAAGC,EAAG2C,IAAOA,EAAI3C,EAAID,IAE9B,OAAOmG,OAAOC,OAAOF,EACvB","x_google_ignoreList":[0]}
@@ -0,0 +1,3 @@
1
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
2
+ const t=BigInt(0),r=BigInt(1);function n(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function e(t){if(!n(t))throw new Error("Uint8Array expected")}function o(t,r){if("boolean"!=typeof r)throw new Error(t+" boolean expected, got "+r)}function i(r){if("string"!=typeof r)throw new Error("hex string expected, got "+typeof r);return""===r?t:BigInt("0x"+r)}const f="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,c=Array.from({length:256},((t,r)=>r.toString(16).padStart(2,"0")));function u(t){if(e(t),f)return t.toHex();let r="";for(let n=0;n<t.length;n++)r+=c[t[n]];return r}const s=48,a=57,g=65,h=70,y=97,p=102;function l(t){return t>=s&&t<=a?t-s:t>=g&&t<=h?t-(g-10):t>=y&&t<=p?t-(y-10):void 0}function d(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);if(f)return Uint8Array.fromHex(t);const r=t.length,n=r/2;if(r%2)throw new Error("hex string expected, got unpadded hex of length "+r);const e=new Uint8Array(n);for(let r=0,o=0;r<n;r++,o+=2){const n=l(t.charCodeAt(o)),i=l(t.charCodeAt(o+1));if(void 0===n||void 0===i){const r=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+r+'" at index '+o)}e[r]=16*n+i}return e}function w(t){return i(u(t))}function x(t){return e(t),i(u(Uint8Array.from(t).reverse()))}function A(t,r){return d(t.toString(16).padStart(2*r,"0"))}function b(t,r){return A(t,r).reverse()}function m(t,r,e){let o;if("string"==typeof r)try{o=d(r)}catch(r){throw new Error(t+" must be hex string or Uint8Array, cause: "+r)}else{if(!n(r))throw new Error(t+" must be hex string or Uint8Array");o=Uint8Array.from(r)}const i=o.length;if("number"==typeof e&&i!==e)throw new Error(t+" of length "+e+" expected, got "+i);return o}function E(...t){let r=0;for(let n=0;n<t.length;n++){const o=t[n];e(o),r+=o.length}const n=new Uint8Array(r);for(let r=0,e=0;r<t.length;r++){const o=t[r];n.set(o,e),e+=o.length}return n}const U=r=>"bigint"==typeof r&&t<=r;function v(t,r,n){return U(t)&&U(r)&&U(n)&&r<=t&&t<n}function S(t,r,n,e){if(!v(r,n,e))throw new Error("expected valid "+t+": "+n+" <= n < "+e+", got "+r)}function I(n){let e;for(e=0;n>t;n>>=r,e+=1);return e}const B=t=>(r<<BigInt(t))-r,H={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,stringOrUint8Array:t=>"string"==typeof t||n(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,r)=>r.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};function O(t,r,n={}){const e=(r,n,e)=>{const o=H[n];if("function"!=typeof o)throw new Error("invalid validator function");const i=t[r];if(!(e&&void 0===i||o(i,t)))throw new Error("param "+String(r)+" is invalid. Expected "+n+", got "+i)};for(const[t,n]of Object.entries(r))e(t,n,!1);for(const[t,r]of Object.entries(n))e(t,r,!0);return t}function j(t){const r=new WeakMap;return(n,...e)=>{const o=r.get(n);if(void 0!==o)return o;const i=t(n,...e);return r.set(n,i),i}}export{S as aInRange,o as abool,e as abytes,I as bitLen,B as bitMask,u as bytesToHex,w as bytesToNumberBE,x as bytesToNumberLE,E as concatBytes,m as ensureBytes,d as hexToBytes,i as hexToNumber,v as inRange,n as isBytes,j as memoized,A as numberToBytesBE,b as numberToBytesLE,O as validateObject};
3
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sources":["../../../../../../../node_modules/@noble/curves/esm/abstract/utils.js"],"sourcesContent":["/**\n * Hex, bytes and number utilities.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// 100 lines of code in the file are duplicated from noble-hashes (utils).\n// This is OK: `abstract` directory does not use noble-hashes.\n// User may opt-in into using different hashing library. This way, noble-hashes\n// won't be included into their bundle.\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nexport function isBytes(a) {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\nexport function abytes(item) {\n if (!isBytes(item))\n throw new Error('Uint8Array expected');\n}\nexport function abool(title, value) {\n if (typeof value !== 'boolean')\n throw new Error(title + ' boolean expected, got ' + value);\n}\n// Used in weierstrass, der\nexport function numberToHexUnpadded(num) {\n const hex = num.toString(16);\n return hex.length & 1 ? '0' + hex : hex;\n}\nexport function hexToNumber(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n return hex === '' ? _0n : BigInt('0x' + hex); // Big Endian\n}\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function';\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };\nfunction asciiToBase16(ch) {\n if (ch >= asciis._0 && ch <= asciis._9)\n return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F)\n return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f)\n return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n // @ts-ignore\n if (hasHexBuiltin)\n return Uint8Array.fromHex(hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new Error('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n// BE: Big Endian, LE: Little Endian\nexport function bytesToNumberBE(bytes) {\n return hexToNumber(bytesToHex(bytes));\n}\nexport function bytesToNumberLE(bytes) {\n abytes(bytes);\n return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));\n}\nexport function numberToBytesBE(n, len) {\n return hexToBytes(n.toString(16).padStart(len * 2, '0'));\n}\nexport function numberToBytesLE(n, len) {\n return numberToBytesBE(n, len).reverse();\n}\n// Unpadded, rarely used\nexport function numberToVarBytesBE(n) {\n return hexToBytes(numberToHexUnpadded(n));\n}\n/**\n * Takes hex string or Uint8Array, converts to Uint8Array.\n * Validates output length.\n * Will throw error for other types.\n * @param title descriptive title for an error e.g. 'private key'\n * @param hex hex string or Uint8Array\n * @param expectedLength optional, will compare to result array's length\n * @returns\n */\nexport function ensureBytes(title, hex, expectedLength) {\n let res;\n if (typeof hex === 'string') {\n try {\n res = hexToBytes(hex);\n }\n catch (e) {\n throw new Error(title + ' must be hex string or Uint8Array, cause: ' + e);\n }\n }\n else if (isBytes(hex)) {\n // Uint8Array.from() instead of hash.slice() because node.js Buffer\n // is instance of Uint8Array, and its slice() creates **mutable** copy\n res = Uint8Array.from(hex);\n }\n else {\n throw new Error(title + ' must be hex string or Uint8Array');\n }\n const len = res.length;\n if (typeof expectedLength === 'number' && len !== expectedLength)\n throw new Error(title + ' of length ' + expectedLength + ' expected, got ' + len);\n return res;\n}\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n// Compares 2 u8a-s in kinda constant time\nexport function equalBytes(a, b) {\n if (a.length !== b.length)\n return false;\n let diff = 0;\n for (let i = 0; i < a.length; i++)\n diff |= a[i] ^ b[i];\n return diff === 0;\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n// Is positive bigint\nconst isPosBig = (n) => typeof n === 'bigint' && _0n <= n;\nexport function inRange(n, min, max) {\n return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max;\n}\n/**\n * Asserts min <= n < max. NOTE: It's < max and not <= max.\n * @example\n * aInRange('x', x, 1n, 256n); // would assume x is in (1n..255n)\n */\nexport function aInRange(title, n, min, max) {\n // Why min <= n < max and not a (min < n < max) OR b (min <= n <= max)?\n // consider P=256n, min=0n, max=P\n // - a for min=0 would require -1: `inRange('x', x, -1n, P)`\n // - b would commonly require subtraction: `inRange('x', x, 0n, P - 1n)`\n // - our way is the cleanest: `inRange('x', x, 0n, P)\n if (!inRange(n, min, max))\n throw new Error('expected valid ' + title + ': ' + min + ' <= n < ' + max + ', got ' + n);\n}\n// Bit operations\n/**\n * Calculates amount of bits in a bigint.\n * Same as `n.toString(2).length`\n * TODO: merge with nLength in modular\n */\nexport function bitLen(n) {\n let len;\n for (len = 0; n > _0n; n >>= _1n, len += 1)\n ;\n return len;\n}\n/**\n * Gets single bit at position.\n * NOTE: first bit position is 0 (same as arrays)\n * Same as `!!+Array.from(n.toString(2)).reverse()[pos]`\n */\nexport function bitGet(n, pos) {\n return (n >> BigInt(pos)) & _1n;\n}\n/**\n * Sets single bit at position.\n */\nexport function bitSet(n, pos, value) {\n return n | ((value ? _1n : _0n) << BigInt(pos));\n}\n/**\n * Calculate mask for N bits. Not using ** operator with bigints because of old engines.\n * Same as BigInt(`0b${Array(i).fill('1').join('')}`)\n */\nexport const bitMask = (n) => (_1n << BigInt(n)) - _1n;\n// DRBG\nconst u8n = (len) => new Uint8Array(len); // creates Uint8Array\nconst u8fr = (arr) => Uint8Array.from(arr); // another shortcut\n/**\n * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n * @returns function that will call DRBG until 2nd arg returns something meaningful\n * @example\n * const drbg = createHmacDRBG<Key>(32, 32, hmac);\n * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined\n */\nexport function createHmacDrbg(hashLen, qByteLen, hmacFn) {\n if (typeof hashLen !== 'number' || hashLen < 2)\n throw new Error('hashLen must be a number');\n if (typeof qByteLen !== 'number' || qByteLen < 2)\n throw new Error('qByteLen must be a number');\n if (typeof hmacFn !== 'function')\n throw new Error('hmacFn must be a function');\n // Step B, Step C: set hashLen to 8*ceil(hlen/8)\n let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same\n let i = 0; // Iterations counter, will throw when over 1000\n const reset = () => {\n v.fill(1);\n k.fill(0);\n i = 0;\n };\n const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values)\n const reseed = (seed = u8n(0)) => {\n // HMAC-DRBG reseed() function. Steps D-G\n k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed)\n v = h(); // v = hmac(k || v)\n if (seed.length === 0)\n return;\n k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed)\n v = h(); // v = hmac(k || v)\n };\n const gen = () => {\n // HMAC-DRBG generate() function\n if (i++ >= 1000)\n throw new Error('drbg: tried 1000 values');\n let len = 0;\n const out = [];\n while (len < qByteLen) {\n v = h();\n const sl = v.slice();\n out.push(sl);\n len += v.length;\n }\n return concatBytes(...out);\n };\n const genUntil = (seed, pred) => {\n reset();\n reseed(seed); // Steps D-G\n let res = undefined; // Step H: grind until k is in [1..n-1]\n while (!(res = pred(gen())))\n reseed();\n reset();\n return res;\n };\n return genUntil;\n}\n// Validating curves and fields\nconst validatorFns = {\n bigint: (val) => typeof val === 'bigint',\n function: (val) => typeof val === 'function',\n boolean: (val) => typeof val === 'boolean',\n string: (val) => typeof val === 'string',\n stringOrUint8Array: (val) => typeof val === 'string' || isBytes(val),\n isSafeInteger: (val) => Number.isSafeInteger(val),\n array: (val) => Array.isArray(val),\n field: (val, object) => object.Fp.isValid(val),\n hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen),\n};\n// type Record<K extends string | number | symbol, T> = { [P in K]: T; }\nexport function validateObject(object, validators, optValidators = {}) {\n const checkField = (fieldName, type, isOptional) => {\n const checkVal = validatorFns[type];\n if (typeof checkVal !== 'function')\n throw new Error('invalid validator function');\n const val = object[fieldName];\n if (isOptional && val === undefined)\n return;\n if (!checkVal(val, object)) {\n throw new Error('param ' + String(fieldName) + ' is invalid. Expected ' + type + ', got ' + val);\n }\n };\n for (const [fieldName, type] of Object.entries(validators))\n checkField(fieldName, type, false);\n for (const [fieldName, type] of Object.entries(optValidators))\n checkField(fieldName, type, true);\n return object;\n}\n// validate type tests\n// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 };\n// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok!\n// // Should fail type-check\n// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' });\n// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' });\n// const z3 = validateObject(o, { test: 'boolean', z: 'bug' });\n// const z4 = validateObject(o, { a: 'boolean', z: 'bug' });\n/**\n * throws not implemented error\n */\nexport const notImplemented = () => {\n throw new Error('not implemented');\n};\n/**\n * Memoizes (caches) computation result.\n * Uses WeakMap: the value is going auto-cleaned by GC after last reference is removed.\n */\nexport function memoized(fn) {\n const map = new WeakMap();\n return (arg, ...args) => {\n const val = map.get(arg);\n if (val !== undefined)\n return val;\n const computed = fn(arg, ...args);\n map.set(arg, computed);\n return computed;\n };\n}\n//# sourceMappingURL=utils.js.map"],"names":["_0n","BigInt","_1n","isBytes","a","Uint8Array","ArrayBuffer","isView","constructor","name","abytes","item","Error","abool","title","value","hexToNumber","hex","hasHexBuiltin","from","toHex","fromHex","hexes","Array","length","_","i","toString","padStart","bytesToHex","bytes","asciis","asciiToBase16","ch","hexToBytes","hl","al","array","ai","hi","n1","charCodeAt","n2","undefined","char","bytesToNumberBE","bytesToNumberLE","reverse","numberToBytesBE","n","len","numberToBytesLE","ensureBytes","expectedLength","res","e","concatBytes","arrays","sum","pad","set","isPosBig","inRange","min","max","aInRange","bitLen","bitMask","validatorFns","bigint","val","function","boolean","string","stringOrUint8Array","isSafeInteger","Number","isArray","field","object","Fp","isValid","hash","outputLen","validateObject","validators","optValidators","checkField","fieldName","type","isOptional","checkVal","String","Object","entries"],"mappings":";AAUA,MAAMA,EAAsBC,OAAO,GAC7BC,EAAqBD,OAAA,GAWrB,SAAUE,EAAQC,GACtB,OAAOA,aAAaC,YAAeC,YAAIC,OAAAH,IAAA,eAAAA,EAAAI,YAAAC,IACzC,CAEA,SAAAC,EAAAC,GACE,IAAKR,EAAQQ,GAAO,MAAM,IAAIC,MAAC,sBACjC,CAEM,SAAUC,EAAMC,EAAeC,GACrC,GAAA,kBAAAA,EAAA,MAAA,IAAAH,MAAAE,EAAA,0BAAAC,EACA,CAQM,SAAUC,EAAYC,GAC1B,GAAA,iBAAAA,EAAA,MAAA,IAAAL,MAAA,mCAAAK,GACA,MAAe,KAARA,EAAajB,EAAMC,OAAM,KAAAgB,EAClC,CAGA,MAAMC,EAEU,mBAAPb,WAAOc,KAAA,IAAAC,OAAA,mBAAAf,WAAAgB,QAGZC,EAAAC,MAAAJ,KAAA,CAAAK,OAAA,MAAA,CAAAC,EAAAC,IACFA,EAAEC,SAAS,IAACC,SAAA,EAAA,OAOR,SAAUC,EAAWC,GAGzB,GAFApB,EAAOoB,GAEHZ,EAAe,OAAOY,EAAMV,QAElC,IAAAH,EAAA,GACE,IAAA,IAAAS,EAAA,EAAAA,EAAAI,EAAAN,OAAAE,IACET,GAAOK,EAAMQ,EAAMJ,IAErB,OAAAT,CACF,CAGA,MAAMc,EAAU,GAAVA,EAAU,GAAVA,EAAU,GAAVA,EAAU,GAAVA,EAAU,GAAVA,EAAU,IAChB,SAASC,EAAYC,GACnB,OAA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I,mBAAAA,EACjBE,QAAAF,GAAA,kBAAAA,EACEG,OAASH,GAAU,iBAAAA,EACnBI,mBAAqBJ,GAAqC,iBAARA,GAAkBnE,EAAAmE,GACpEK,cAAgBL,GAAsBM,OAAOD,cAAcL,GAC3DjC,MAAQiC,GAAiB/C,MAAAsD,QAAAP,GACzBQ,MAAOA,CAACR,EAAUS,IAAsBA,EAAeC,GAACC,QAAAX,GACxDY,KAAOZ,GAAqC,mBAARA,GAAsBM,OAAOD,cAACL,EAAAa,YAM9D,SAAUC,EACdL,EACDM,EACCC,EAAA,CAAA,GAEA,MAAMC,EAAaA,CAACC,EAAoBC,EAAiBC,KACzD,MAAAC,EAAAvB,EAAAqB,GACE,GAAwB,mBAAbE,EAAc,MAAA,IAAA/E,MAAA,8BAEzB,MAAM0D,EAAMS,EAAOS,GACnB,KAAIE,QAAsB/C,IAAR2B,GACbqB,EAASrB,EAAKS,IACjB,MAAM,IAAInE,MACR,SAAWgF,OAAOJ,GAAa,yBAAEC,EAAA,SAAAnB,EAErC,EAEJ,IAAA,MAAAkB,EAAAC,KAAAI,OAAAC,QAAAT,GAAAE,EAAAC,EAAAC,GAAA,GACE,IAAK,MAAOD,EAAWC,KAAOI,OAAAC,QAAAR,GAAAC,EAAAC,EAAAC,GAAA","x_google_ignoreList":[0]}
@@ -0,0 +1,4 @@
1
+ import{sha512 as t}from"../../hashes/esm/sha2.js";import{randomBytes as n}from"../../hashes/esm/utils.js";import{twistedEdwards as i}from"./abstract/edwards.js";import{Field as s,mod as o,pow2 as r,isNegativeLE as a}from"./abstract/modular.js";
2
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
+ const B=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),g=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const I=BigInt(1),e=BigInt(2);BigInt(3);const c=BigInt(5),m=BigInt(8);function u(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function p(t,n){const i=B,s=o(n*n*n,i),m=function(t){const n=BigInt(10),i=BigInt(20),s=BigInt(40),o=BigInt(80),a=B,g=t*t%a*t%a,m=r(g,e,a)*g%a,u=r(m,I,a)*t%a,p=r(u,c,a)*u%a,d=r(p,n,a)*p%a,h=r(d,i,a)*d%a,f=r(h,s,a)*h%a,l=r(f,o,a)*f%a,_=r(l,o,a)*f%a,j=r(_,n,a)*p%a;return{pow_p_5_8:r(j,e,a)*t%a,b2:g}}(t*o(s*s*n,i)).pow_p_5_8;let u=o(t*s*m,i);const p=o(n*u*u,i),d=u,h=o(u*g,i),f=p===t,l=p===o(-t,i),_=p===o(-t*g,i);return f&&(u=d),(l||_)&&(u=h),a(u,i)&&(u=o(-u,i)),{isValid:f||l,value:u}}const d=(()=>s(B,void 0,!0))(),h=(()=>({a:d.create(BigInt(-1)),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:d,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:m,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:t,randomBytes:n,adjustScalarBytes:u,uvRatio:p}))(),f=(()=>i(h))();export{f as ed25519};
4
+ //# sourceMappingURL=ed25519.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ed25519.js","sources":["../../../../../../node_modules/@noble/curves/esm/ed25519.js"],"sourcesContent":["/**\n * ed25519 Twisted Edwards curve with following addons:\n * - X25519 ECDH\n * - Ristretto cofactor elimination\n * - Elligator hash-to-group / point indistinguishability\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { sha512 } from '@noble/hashes/sha2';\nimport { concatBytes, randomBytes, utf8ToBytes } from '@noble/hashes/utils';\nimport { pippenger } from \"./abstract/curve.js\";\nimport { twistedEdwards } from \"./abstract/edwards.js\";\nimport { createHasher, expand_message_xmd, } from \"./abstract/hash-to-curve.js\";\nimport { Field, FpInvertBatch, FpSqrtEven, isNegativeLE, mod, pow2 } from \"./abstract/modular.js\";\nimport { montgomery } from \"./abstract/montgomery.js\";\nimport { bytesToHex, bytesToNumberLE, ensureBytes, equalBytes, numberToBytesLE, } from \"./abstract/utils.js\";\n// 2n**255n - 19n\nconst ED25519_P = BigInt('57896044618658097711785492504343953926634992332820282019728792003956564819949');\n// √(-1) aka √(a) aka 2^((p-1)/4)\n// Fp.sqrt(Fp.neg(1))\nconst ED25519_SQRT_M1 = /* @__PURE__ */ BigInt('19681161376707505956807079304988542015446066515923890162744021073123829784752');\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3);\n// prettier-ignore\nconst _5n = BigInt(5), _8n = BigInt(8);\nfunction ed25519_pow_2_252_3(x) {\n // prettier-ignore\n const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80);\n const P = ED25519_P;\n const x2 = (x * x) % P;\n const b2 = (x2 * x) % P; // x^3, 11\n const b4 = (pow2(b2, _2n, P) * b2) % P; // x^15, 1111\n const b5 = (pow2(b4, _1n, P) * x) % P; // x^31\n const b10 = (pow2(b5, _5n, P) * b5) % P;\n const b20 = (pow2(b10, _10n, P) * b10) % P;\n const b40 = (pow2(b20, _20n, P) * b20) % P;\n const b80 = (pow2(b40, _40n, P) * b40) % P;\n const b160 = (pow2(b80, _80n, P) * b80) % P;\n const b240 = (pow2(b160, _80n, P) * b80) % P;\n const b250 = (pow2(b240, _10n, P) * b10) % P;\n const pow_p_5_8 = (pow2(b250, _2n, P) * x) % P;\n // ^ To pow to (p+3)/8, multiply it by x.\n return { pow_p_5_8, b2 };\n}\nfunction adjustScalarBytes(bytes) {\n // Section 5: For X25519, in order to decode 32 random bytes as an integer scalar,\n // set the three least significant bits of the first byte\n bytes[0] &= 248; // 0b1111_1000\n // and the most significant bit of the last to zero,\n bytes[31] &= 127; // 0b0111_1111\n // set the second most significant bit of the last byte to 1\n bytes[31] |= 64; // 0b0100_0000\n return bytes;\n}\n// sqrt(u/v)\nfunction uvRatio(u, v) {\n const P = ED25519_P;\n const v3 = mod(v * v * v, P); // v³\n const v7 = mod(v3 * v3 * v, P); // v⁷\n // (p+3)/8 and (p-5)/8\n const pow = ed25519_pow_2_252_3(u * v7).pow_p_5_8;\n let x = mod(u * v3 * pow, P); // (uv³)(uv⁷)^(p-5)/8\n const vx2 = mod(v * x * x, P); // vx²\n const root1 = x; // First root candidate\n const root2 = mod(x * ED25519_SQRT_M1, P); // Second root candidate\n const useRoot1 = vx2 === u; // If vx² = u (mod p), x is a square root\n const useRoot2 = vx2 === mod(-u, P); // If vx² = -u, set x <-- x * 2^((p-1)/4)\n const noRoot = vx2 === mod(-u * ED25519_SQRT_M1, P); // There is no valid root, vx² = -u√(-1)\n if (useRoot1)\n x = root1;\n if (useRoot2 || noRoot)\n x = root2; // We return root2 anyway, for const-time\n if (isNegativeLE(x, P))\n x = mod(-x, P);\n return { isValid: useRoot1 || useRoot2, value: x };\n}\n/** Weird / bogus points, useful for debugging. */\nexport const ED25519_TORSION_SUBGROUP = [\n '0100000000000000000000000000000000000000000000000000000000000000',\n 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a',\n '0000000000000000000000000000000000000000000000000000000000000080',\n '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05',\n 'ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f',\n '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85',\n '0000000000000000000000000000000000000000000000000000000000000000',\n 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa',\n];\nconst Fp = /* @__PURE__ */ (() => Field(ED25519_P, undefined, true))();\nconst ed25519Defaults = /* @__PURE__ */ (() => ({\n // Removing Fp.create() will still work, and is 10% faster on sign\n a: Fp.create(BigInt(-1)),\n // d is -121665/121666 a.k.a. Fp.neg(121665 * Fp.inv(121666))\n d: BigInt('37095705934669439343138083508754565189542113879843219016388785533085940283555'),\n // Finite field 2n**255n - 19n\n Fp,\n // Subgroup order 2n**252n + 27742317777372353535851937790883648493n;\n n: BigInt('7237005577332262213973186563042994240857116359379907606001950938285454250989'),\n h: _8n,\n Gx: BigInt('15112221349535400772501151409588531511454012693041857206046113283949847762202'),\n Gy: BigInt('46316835694926478169428394003475163141307993866256225615783033603165251855960'),\n hash: sha512,\n randomBytes,\n adjustScalarBytes,\n // dom2\n // Ratio of u to v. Allows us to combine inversion and square root. Uses algo from RFC8032 5.1.3.\n // Constant-time, u/√v\n uvRatio,\n}))();\n/**\n * ed25519 curve with EdDSA signatures.\n * @example\n * import { ed25519 } from '@noble/curves/ed25519';\n * const priv = ed25519.utils.randomPrivateKey();\n * const pub = ed25519.getPublicKey(priv);\n * const msg = new TextEncoder().encode('hello');\n * const sig = ed25519.sign(msg, priv);\n * ed25519.verify(sig, msg, pub); // Default mode: follows ZIP215\n * ed25519.verify(sig, msg, pub, { zip215: false }); // RFC8032 / FIPS 186-5\n */\nexport const ed25519 = /* @__PURE__ */ (() => twistedEdwards(ed25519Defaults))();\nfunction ed25519_domain(data, ctx, phflag) {\n if (ctx.length > 255)\n throw new Error('Context is too big');\n return concatBytes(utf8ToBytes('SigEd25519 no Ed25519 collisions'), new Uint8Array([phflag ? 1 : 0, ctx.length]), ctx, data);\n}\nexport const ed25519ctx = /* @__PURE__ */ (() => twistedEdwards({\n ...ed25519Defaults,\n domain: ed25519_domain,\n}))();\nexport const ed25519ph = /* @__PURE__ */ (() => twistedEdwards(Object.assign({}, ed25519Defaults, {\n domain: ed25519_domain,\n prehash: sha512,\n})))();\n/**\n * ECDH using curve25519 aka x25519.\n * @example\n * import { x25519 } from '@noble/curves/ed25519';\n * const priv = 'a546e36bf0527c9d3b16154b82465edd62144c0ac1fc5a18506a2244ba449ac4';\n * const pub = 'e6db6867583030db3594c1a424b15f7c726624ec26b3353b10a903a6d0ab1c4c';\n * x25519.getSharedSecret(priv, pub) === x25519.scalarMult(priv, pub); // aliases\n * x25519.getPublicKey(priv) === x25519.scalarMultBase(priv);\n * x25519.getPublicKey(x25519.utils.randomPrivateKey());\n */\nexport const x25519 = /* @__PURE__ */ (() => montgomery({\n P: ED25519_P,\n type: 'x25519',\n powPminus2: (x) => {\n const P = ED25519_P;\n // x^(p-2) aka x^(2^255-21)\n const { pow_p_5_8, b2 } = ed25519_pow_2_252_3(x);\n return mod(pow2(pow_p_5_8, _3n, P) * b2, P);\n },\n adjustScalarBytes,\n randomBytes,\n}))();\n/**\n * Converts ed25519 public key to x25519 public key. Uses formula:\n * * `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)`\n * * `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))`\n * @example\n * const someonesPub = ed25519.getPublicKey(ed25519.utils.randomPrivateKey());\n * const aPriv = x25519.utils.randomPrivateKey();\n * x25519.getSharedSecret(aPriv, edwardsToMontgomeryPub(someonesPub))\n */\nexport function edwardsToMontgomeryPub(edwardsPub) {\n const { y } = ed25519.ExtendedPoint.fromHex(edwardsPub);\n const _1n = BigInt(1);\n return Fp.toBytes(Fp.create((_1n + y) * Fp.inv(_1n - y)));\n}\nexport const edwardsToMontgomery = edwardsToMontgomeryPub; // deprecated\n/**\n * Converts ed25519 secret key to x25519 secret key.\n * @example\n * const someonesPub = x25519.getPublicKey(x25519.utils.randomPrivateKey());\n * const aPriv = ed25519.utils.randomPrivateKey();\n * x25519.getSharedSecret(edwardsToMontgomeryPriv(aPriv), someonesPub)\n */\nexport function edwardsToMontgomeryPriv(edwardsPriv) {\n const hashed = ed25519Defaults.hash(edwardsPriv.subarray(0, 32));\n return ed25519Defaults.adjustScalarBytes(hashed).subarray(0, 32);\n}\n// Hash To Curve Elligator2 Map (NOTE: different from ristretto255 elligator)\n// NOTE: very important part is usage of FpSqrtEven for ELL2_C1_EDWARDS, since\n// SageMath returns different root first and everything falls apart\nconst ELL2_C1 = /* @__PURE__ */ (() => (Fp.ORDER + _3n) / _8n)(); // 1. c1 = (q + 3) / 8 # Integer arithmetic\nconst ELL2_C2 = /* @__PURE__ */ (() => Fp.pow(_2n, ELL2_C1))(); // 2. c2 = 2^c1\nconst ELL2_C3 = /* @__PURE__ */ (() => Fp.sqrt(Fp.neg(Fp.ONE)))(); // 3. c3 = sqrt(-1)\n// prettier-ignore\nfunction map_to_curve_elligator2_curve25519(u) {\n const ELL2_C4 = (Fp.ORDER - _5n) / _8n; // 4. c4 = (q - 5) / 8 # Integer arithmetic\n const ELL2_J = BigInt(486662);\n let tv1 = Fp.sqr(u); // 1. tv1 = u^2\n tv1 = Fp.mul(tv1, _2n); // 2. tv1 = 2 * tv1\n let xd = Fp.add(tv1, Fp.ONE); // 3. xd = tv1 + 1 # Nonzero: -1 is square (mod p), tv1 is not\n let x1n = Fp.neg(ELL2_J); // 4. x1n = -J # x1 = x1n / xd = -J / (1 + 2 * u^2)\n let tv2 = Fp.sqr(xd); // 5. tv2 = xd^2\n let gxd = Fp.mul(tv2, xd); // 6. gxd = tv2 * xd # gxd = xd^3\n let gx1 = Fp.mul(tv1, ELL2_J); // 7. gx1 = J * tv1 # x1n + J * xd\n gx1 = Fp.mul(gx1, x1n); // 8. gx1 = gx1 * x1n # x1n^2 + J * x1n * xd\n gx1 = Fp.add(gx1, tv2); // 9. gx1 = gx1 + tv2 # x1n^2 + J * x1n * xd + xd^2\n gx1 = Fp.mul(gx1, x1n); // 10. gx1 = gx1 * x1n # x1n^3 + J * x1n^2 * xd + x1n * xd^2\n let tv3 = Fp.sqr(gxd); // 11. tv3 = gxd^2\n tv2 = Fp.sqr(tv3); // 12. tv2 = tv3^2 # gxd^4\n tv3 = Fp.mul(tv3, gxd); // 13. tv3 = tv3 * gxd # gxd^3\n tv3 = Fp.mul(tv3, gx1); // 14. tv3 = tv3 * gx1 # gx1 * gxd^3\n tv2 = Fp.mul(tv2, tv3); // 15. tv2 = tv2 * tv3 # gx1 * gxd^7\n let y11 = Fp.pow(tv2, ELL2_C4); // 16. y11 = tv2^c4 # (gx1 * gxd^7)^((p - 5) / 8)\n y11 = Fp.mul(y11, tv3); // 17. y11 = y11 * tv3 # gx1*gxd^3*(gx1*gxd^7)^((p-5)/8)\n let y12 = Fp.mul(y11, ELL2_C3); // 18. y12 = y11 * c3\n tv2 = Fp.sqr(y11); // 19. tv2 = y11^2\n tv2 = Fp.mul(tv2, gxd); // 20. tv2 = tv2 * gxd\n let e1 = Fp.eql(tv2, gx1); // 21. e1 = tv2 == gx1\n let y1 = Fp.cmov(y12, y11, e1); // 22. y1 = CMOV(y12, y11, e1) # If g(x1) is square, this is its sqrt\n let x2n = Fp.mul(x1n, tv1); // 23. x2n = x1n * tv1 # x2 = x2n / xd = 2 * u^2 * x1n / xd\n let y21 = Fp.mul(y11, u); // 24. y21 = y11 * u\n y21 = Fp.mul(y21, ELL2_C2); // 25. y21 = y21 * c2\n let y22 = Fp.mul(y21, ELL2_C3); // 26. y22 = y21 * c3\n let gx2 = Fp.mul(gx1, tv1); // 27. gx2 = gx1 * tv1 # g(x2) = gx2 / gxd = 2 * u^2 * g(x1)\n tv2 = Fp.sqr(y21); // 28. tv2 = y21^2\n tv2 = Fp.mul(tv2, gxd); // 29. tv2 = tv2 * gxd\n let e2 = Fp.eql(tv2, gx2); // 30. e2 = tv2 == gx2\n let y2 = Fp.cmov(y22, y21, e2); // 31. y2 = CMOV(y22, y21, e2) # If g(x2) is square, this is its sqrt\n tv2 = Fp.sqr(y1); // 32. tv2 = y1^2\n tv2 = Fp.mul(tv2, gxd); // 33. tv2 = tv2 * gxd\n let e3 = Fp.eql(tv2, gx1); // 34. e3 = tv2 == gx1\n let xn = Fp.cmov(x2n, x1n, e3); // 35. xn = CMOV(x2n, x1n, e3) # If e3, x = x1, else x = x2\n let y = Fp.cmov(y2, y1, e3); // 36. y = CMOV(y2, y1, e3) # If e3, y = y1, else y = y2\n let e4 = Fp.isOdd(y); // 37. e4 = sgn0(y) == 1 # Fix sign of y\n y = Fp.cmov(y, Fp.neg(y), e3 !== e4); // 38. y = CMOV(y, -y, e3 XOR e4)\n return { xMn: xn, xMd: xd, yMn: y, yMd: _1n }; // 39. return (xn, xd, y, 1)\n}\nconst ELL2_C1_EDWARDS = /* @__PURE__ */ (() => FpSqrtEven(Fp, Fp.neg(BigInt(486664))))(); // sgn0(c1) MUST equal 0\nfunction map_to_curve_elligator2_edwards25519(u) {\n const { xMn, xMd, yMn, yMd } = map_to_curve_elligator2_curve25519(u); // 1. (xMn, xMd, yMn, yMd) =\n // map_to_curve_elligator2_curve25519(u)\n let xn = Fp.mul(xMn, yMd); // 2. xn = xMn * yMd\n xn = Fp.mul(xn, ELL2_C1_EDWARDS); // 3. xn = xn * c1\n let xd = Fp.mul(xMd, yMn); // 4. xd = xMd * yMn # xn / xd = c1 * xM / yM\n let yn = Fp.sub(xMn, xMd); // 5. yn = xMn - xMd\n let yd = Fp.add(xMn, xMd); // 6. yd = xMn + xMd # (n / d - 1) / (n / d + 1) = (n - d) / (n + d)\n let tv1 = Fp.mul(xd, yd); // 7. tv1 = xd * yd\n let e = Fp.eql(tv1, Fp.ZERO); // 8. e = tv1 == 0\n xn = Fp.cmov(xn, Fp.ZERO, e); // 9. xn = CMOV(xn, 0, e)\n xd = Fp.cmov(xd, Fp.ONE, e); // 10. xd = CMOV(xd, 1, e)\n yn = Fp.cmov(yn, Fp.ONE, e); // 11. yn = CMOV(yn, 1, e)\n yd = Fp.cmov(yd, Fp.ONE, e); // 12. yd = CMOV(yd, 1, e)\n const [xd_inv, yd_inv] = FpInvertBatch(Fp, [xd, yd], true); // batch division\n return { x: Fp.mul(xn, xd_inv), y: Fp.mul(yn, yd_inv) }; // 13. return (xn, xd, yn, yd)\n}\nexport const ed25519_hasher = /* @__PURE__ */ (() => createHasher(ed25519.ExtendedPoint, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), {\n DST: 'edwards25519_XMD:SHA-512_ELL2_RO_',\n encodeDST: 'edwards25519_XMD:SHA-512_ELL2_NU_',\n p: Fp.ORDER,\n m: 1,\n k: 128,\n expand: 'xmd',\n hash: sha512,\n}))();\nexport const hashToCurve = /* @__PURE__ */ (() => ed25519_hasher.hashToCurve)();\nexport const encodeToCurve = /* @__PURE__ */ (() => ed25519_hasher.encodeToCurve)();\nfunction aristp(other) {\n if (!(other instanceof RistPoint))\n throw new Error('RistrettoPoint expected');\n}\n// √(-1) aka √(a) aka 2^((p-1)/4)\nconst SQRT_M1 = ED25519_SQRT_M1;\n// √(ad - 1)\nconst SQRT_AD_MINUS_ONE = /* @__PURE__ */ BigInt('25063068953384623474111414158702152701244531502492656460079210482610430750235');\n// 1 / √(a-d)\nconst INVSQRT_A_MINUS_D = /* @__PURE__ */ BigInt('54469307008909316920995813868745141605393597292927456921205312896311721017578');\n// 1-d²\nconst ONE_MINUS_D_SQ = /* @__PURE__ */ BigInt('1159843021668779879193775521855586647937357759715417654439879720876111806838');\n// (d-1)²\nconst D_MINUS_ONE_SQ = /* @__PURE__ */ BigInt('40440834346308536858101042469323190826248399146238708352240133220865137265952');\n// Calculates 1/√(number)\nconst invertSqrt = (number) => uvRatio(_1n, number);\nconst MAX_255B = /* @__PURE__ */ BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');\nconst bytes255ToNumberLE = (bytes) => ed25519.CURVE.Fp.create(bytesToNumberLE(bytes) & MAX_255B);\n/**\n * Computes Elligator map for Ristretto255.\n * Described in [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#appendix-B) and on\n * the [website](https://ristretto.group/formulas/elligator.html).\n */\nfunction calcElligatorRistrettoMap(r0) {\n const { d } = ed25519.CURVE;\n const P = ed25519.CURVE.Fp.ORDER;\n const mod = ed25519.CURVE.Fp.create;\n const r = mod(SQRT_M1 * r0 * r0); // 1\n const Ns = mod((r + _1n) * ONE_MINUS_D_SQ); // 2\n let c = BigInt(-1); // 3\n const D = mod((c - d * r) * mod(r + d)); // 4\n let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D); // 5\n let s_ = mod(s * r0); // 6\n if (!isNegativeLE(s_, P))\n s_ = mod(-s_);\n if (!Ns_D_is_sq)\n s = s_; // 7\n if (!Ns_D_is_sq)\n c = r; // 8\n const Nt = mod(c * (r - _1n) * D_MINUS_ONE_SQ - D); // 9\n const s2 = s * s;\n const W0 = mod((s + s) * D); // 10\n const W1 = mod(Nt * SQRT_AD_MINUS_ONE); // 11\n const W2 = mod(_1n - s2); // 12\n const W3 = mod(_1n + s2); // 13\n return new ed25519.ExtendedPoint(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2));\n}\n/**\n * Each ed25519/ExtendedPoint has 8 different equivalent points. This can be\n * a source of bugs for protocols like ring signatures. Ristretto was created to solve this.\n * Ristretto point operates in X:Y:Z:T extended coordinates like ExtendedPoint,\n * but it should work in its own namespace: do not combine those two.\n * See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496).\n */\nclass RistPoint {\n // Private property to discourage combining ExtendedPoint + RistrettoPoint\n // Always use Ristretto encoding/decoding instead.\n constructor(ep) {\n this.ep = ep;\n }\n static fromAffine(ap) {\n return new RistPoint(ed25519.ExtendedPoint.fromAffine(ap));\n }\n /**\n * Takes uniform output of 64-byte hash function like sha512 and converts it to `RistrettoPoint`.\n * The hash-to-group operation applies Elligator twice and adds the results.\n * **Note:** this is one-way map, there is no conversion from point to hash.\n * Described in [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#appendix-B) and on\n * the [website](https://ristretto.group/formulas/elligator.html).\n * @param hex 64-byte output of a hash function\n */\n static hashToCurve(hex) {\n hex = ensureBytes('ristrettoHash', hex, 64);\n const r1 = bytes255ToNumberLE(hex.slice(0, 32));\n const R1 = calcElligatorRistrettoMap(r1);\n const r2 = bytes255ToNumberLE(hex.slice(32, 64));\n const R2 = calcElligatorRistrettoMap(r2);\n return new RistPoint(R1.add(R2));\n }\n /**\n * Converts ristretto-encoded string to ristretto point.\n * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode).\n * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding\n */\n static fromHex(hex) {\n hex = ensureBytes('ristrettoHex', hex, 32);\n const { a, d } = ed25519.CURVE;\n const P = ed25519.CURVE.Fp.ORDER;\n const mod = ed25519.CURVE.Fp.create;\n const emsg = 'RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint';\n const s = bytes255ToNumberLE(hex);\n // 1. Check that s_bytes is the canonical encoding of a field element, or else abort.\n // 3. Check that s is non-negative, or else abort\n if (!equalBytes(numberToBytesLE(s, 32), hex) || isNegativeLE(s, P))\n throw new Error(emsg);\n const s2 = mod(s * s);\n const u1 = mod(_1n + a * s2); // 4 (a is -1)\n const u2 = mod(_1n - a * s2); // 5\n const u1_2 = mod(u1 * u1);\n const u2_2 = mod(u2 * u2);\n const v = mod(a * d * u1_2 - u2_2); // 6\n const { isValid, value: I } = invertSqrt(mod(v * u2_2)); // 7\n const Dx = mod(I * u2); // 8\n const Dy = mod(I * Dx * v); // 9\n let x = mod((s + s) * Dx); // 10\n if (isNegativeLE(x, P))\n x = mod(-x); // 10\n const y = mod(u1 * Dy); // 11\n const t = mod(x * y); // 12\n if (!isValid || isNegativeLE(t, P) || y === _0n)\n throw new Error(emsg);\n return new RistPoint(new ed25519.ExtendedPoint(x, y, _1n, t));\n }\n static msm(points, scalars) {\n const Fn = Field(ed25519.CURVE.n, ed25519.CURVE.nBitLength);\n return pippenger(RistPoint, Fn, points, scalars);\n }\n /**\n * Encodes ristretto point to Uint8Array.\n * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode).\n */\n toRawBytes() {\n let { ex: x, ey: y, ez: z, et: t } = this.ep;\n const P = ed25519.CURVE.Fp.ORDER;\n const mod = ed25519.CURVE.Fp.create;\n const u1 = mod(mod(z + y) * mod(z - y)); // 1\n const u2 = mod(x * y); // 2\n // Square root always exists\n const u2sq = mod(u2 * u2);\n const { value: invsqrt } = invertSqrt(mod(u1 * u2sq)); // 3\n const D1 = mod(invsqrt * u1); // 4\n const D2 = mod(invsqrt * u2); // 5\n const zInv = mod(D1 * D2 * t); // 6\n let D; // 7\n if (isNegativeLE(t * zInv, P)) {\n let _x = mod(y * SQRT_M1);\n let _y = mod(x * SQRT_M1);\n x = _x;\n y = _y;\n D = mod(D1 * INVSQRT_A_MINUS_D);\n }\n else {\n D = D2; // 8\n }\n if (isNegativeLE(x * zInv, P))\n y = mod(-y); // 9\n let s = mod((z - y) * D); // 10 (check footer's note, no sqrt(-a))\n if (isNegativeLE(s, P))\n s = mod(-s);\n return numberToBytesLE(s, 32); // 11\n }\n toHex() {\n return bytesToHex(this.toRawBytes());\n }\n toString() {\n return this.toHex();\n }\n /**\n * Compares two Ristretto points.\n * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals).\n */\n equals(other) {\n aristp(other);\n const { ex: X1, ey: Y1 } = this.ep;\n const { ex: X2, ey: Y2 } = other.ep;\n const mod = ed25519.CURVE.Fp.create;\n // (x1 * y2 == y1 * x2) | (y1 * y2 == x1 * x2)\n const one = mod(X1 * Y2) === mod(Y1 * X2);\n const two = mod(Y1 * Y2) === mod(X1 * X2);\n return one || two;\n }\n add(other) {\n aristp(other);\n return new RistPoint(this.ep.add(other.ep));\n }\n subtract(other) {\n aristp(other);\n return new RistPoint(this.ep.subtract(other.ep));\n }\n multiply(scalar) {\n return new RistPoint(this.ep.multiply(scalar));\n }\n multiplyUnsafe(scalar) {\n return new RistPoint(this.ep.multiplyUnsafe(scalar));\n }\n double() {\n return new RistPoint(this.ep.double());\n }\n negate() {\n return new RistPoint(this.ep.negate());\n }\n}\n/**\n * Wrapper over Edwards Point for ristretto255 from\n * [RFC9496](https://www.rfc-editor.org/rfc/rfc9496).\n */\nexport const RistrettoPoint = /* @__PURE__ */ (() => {\n if (!RistPoint.BASE)\n RistPoint.BASE = new RistPoint(ed25519.ExtendedPoint.BASE);\n if (!RistPoint.ZERO)\n RistPoint.ZERO = new RistPoint(ed25519.ExtendedPoint.ZERO);\n return RistPoint;\n})();\n/**\n * hash-to-curve for ristretto255.\n * Described in [RFC9380](https://www.rfc-editor.org/rfc/rfc9380#appendix-B).\n */\nexport const hashToRistretto255 = (msg, options) => {\n const d = options.DST;\n const DST = typeof d === 'string' ? utf8ToBytes(d) : d;\n const uniform_bytes = expand_message_xmd(msg, DST, 64, sha512);\n const P = RistPoint.hashToCurve(uniform_bytes);\n return P;\n};\n/** @deprecated */\nexport const hash_to_ristretto255 = hashToRistretto255; // legacy\n//# sourceMappingURL=ed25519.js.map"],"names":["ED25519_P","BigInt","ED25519_SQRT_M1","_1n","_2n","_5n","_8n","adjustScalarBytes","bytes","uvRatio","u","v","P","v3","mod","pow","x","_10n","_20n","_40n","_80n","b2","b4","pow2","b5","b10","b20","b40","b80","b160","b240","b250","pow_p_5_8","ed25519_pow_2_252_3","vx2","root1","root2","useRoot1","useRoot2","noRoot","isNegativeLE","isValid","value","Fp","Field","undefined","ed25519Defaults","a","create","d","n","h","Gx","Gy","hash","sha512","randomBytes","ed25519","twistedEdwards"],"mappings":";;AA+BA,MAAMA,EAAYC,OAChB,iFAIIC,EAAkCD,OACtC,iFAIUA,OAAO,GAAIE,MAAAA,EAAMF,OAAO,GAAIG,EAAMH,OAAO,GAAUA,OAAO,GAEtE,MAAMI,EAAMJ,OAAO,GAAIK,EAAML,OAAO,GAsBpC,SAASM,EAAkBC,GAQzB,OALAA,EAAM,IAAM,IAEZA,EAAM,KAAO,IAEbA,EAAM,KAAO,GACNA,CACT,CAGA,SAASC,EAAQC,EAAWC,GAC1B,MAAMC,EAAIZ,EACJa,EAAKC,EAAIH,EAAIA,EAAIA,EAAGC,GAGpBG,EArCR,SAA6BC,GAE3B,MAAMC,EAAOhB,OAAO,IAAKiB,EAAOjB,OAAO,IAAKkB,EAAOlB,OAAO,IAAKmB,EAAOnB,OAAO,IACvEW,EAAIZ,EAEJqB,EADML,EAAIA,EAAKJ,EACJI,EAAKJ,EAChBU,EAAMC,EAAKF,EAAIjB,EA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,iFACXoD,GAAIpD,OAAO,iFACXqD,KAAMC,EACNC,cACAjD,oBAIAE,YAnBoC,GAiC3BgD,EAAmC,KAAOC,EAAeZ,GAAtB","x_google_ignoreList":[0]}
@@ -0,0 +1,2 @@
1
+ import{Hash as t,createView as s,aexists as e,toBytes as i,abytes as n,aoutput as o,clean as r}from"./utils.js";function h(t,s,e,i){if("function"==typeof t.setBigUint64)return t.setBigUint64(s,e,i);const n=BigInt(32),o=BigInt(4294967295),r=Number(e>>n&o),h=Number(e&o),f=i?4:0,u=i?0:4;t.setUint32(s+f,r,i),t.setUint32(s+u,h,i)}function f(t,s,e){return t&s^~t&e}function u(t,s,e){return t&s^t&e^s&e}class c extends t{constructor(t,e,i,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=e,this.padOffset=i,this.isLE=n,this.buffer=new Uint8Array(t),this.view=s(this.buffer)}update(t){e(this),t=i(t),n(t);const{view:o,buffer:r,blockLen:h}=this,f=t.length;for(let e=0;e<f;){const i=Math.min(h-this.pos,f-e);if(i!==h)r.set(t.subarray(e,e+i),this.pos),this.pos+=i,e+=i,this.pos===h&&(this.process(o,0),this.pos=0);else{const i=s(t);for(;h<=f-e;e+=h)this.process(i,e)}}return this.length+=t.length,this.roundClean(),this}digestInto(t){e(this),o(t,this),this.finished=!0;const{buffer:i,view:n,blockLen:f,isLE:u}=this;let{pos:c}=this;i[c++]=128,r(this.buffer.subarray(c)),this.padOffset>f-c&&(this.process(n,0),c=0);for(let t=c;t<f;t++)i[t]=0;h(n,f-8,BigInt(8*this.length),u),this.process(n,0);const l=s(t),p=this.outputLen;if(p%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=p/4,g=this.get();if(d>g.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<d;t++)l.setUint32(4*t,g[t],u)}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const e=t.slice(0,s);return this.destroy(),e}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:s,buffer:e,length:i,finished:n,destroyed:o,pos:r}=this;return t.destroyed=o,t.finished=n,t.length=i,t.pos=r,i%s&&t.buffer.set(e),t}clone(){return this._cloneInto()}}const l=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),p=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);export{f as Chi,c as HashMD,u as Maj,l as SHA256_IV,p as SHA512_IV,h as setBigUint64};
2
+ //# sourceMappingURL=_md.js.map