@bonfida/spl-name-service 3.0.19 → 3.0.21

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 (329) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/bindings/burnDomain.js.map +1 -1
  3. package/dist/cjs/bindings/createNameRegistry.js.map +1 -1
  4. package/dist/cjs/bindings/createRecordInstruction.js.map +1 -1
  5. package/dist/cjs/bindings/createRecordV2Instruction.js.map +1 -1
  6. package/dist/cjs/bindings/createReverseName.js.map +1 -1
  7. package/dist/cjs/bindings/createSolRecordInstruction.js.map +1 -1
  8. package/dist/cjs/bindings/createSubdomain.js.map +1 -1
  9. package/dist/cjs/bindings/deleteNameRegistry.js.map +1 -1
  10. package/dist/cjs/bindings/deleteRecordV2.js.map +1 -1
  11. package/dist/cjs/bindings/ethValidateRecordV2Content.js.map +1 -1
  12. package/dist/cjs/bindings/registerDomainName.js +1 -1
  13. package/dist/cjs/bindings/registerDomainName.js.map +1 -1
  14. package/dist/cjs/bindings/registerDomainNameV2.js +1 -1
  15. package/dist/cjs/bindings/registerDomainNameV2.js.map +1 -1
  16. package/dist/cjs/bindings/registerFavorite.js.map +1 -1
  17. package/dist/cjs/bindings/registerWithNft.js.map +1 -1
  18. package/dist/cjs/bindings/transferNameOwnership.js.map +1 -1
  19. package/dist/cjs/bindings/transferSubdomain.js.map +1 -1
  20. package/dist/cjs/bindings/updateNameRegistryData.js.map +1 -1
  21. package/dist/cjs/bindings/updateRecordInstruction.js.map +1 -1
  22. package/dist/cjs/bindings/updateRecordV2Instruction.js.map +1 -1
  23. package/dist/cjs/bindings/updateSolRecordInstruction.js.map +1 -1
  24. package/dist/cjs/bindings/validateRecordV2Content.js.map +1 -1
  25. package/dist/cjs/bindings/writRoaRecordV2.js.map +1 -1
  26. package/dist/cjs/custom-bg.js.map +1 -1
  27. package/dist/cjs/deprecated/utils.js +1 -1
  28. package/dist/cjs/deprecated/utils.js.map +1 -1
  29. package/dist/cjs/devnet.js +1 -1
  30. package/dist/cjs/devnet.js.map +1 -1
  31. package/dist/cjs/error.js.map +1 -1
  32. package/dist/cjs/favorite-domain.js +1 -1
  33. package/dist/cjs/favorite-domain.js.map +1 -1
  34. package/dist/cjs/index.d.ts +1 -1
  35. package/dist/cjs/index.js +1 -1
  36. package/dist/cjs/instructions/burnInstruction.js.map +1 -1
  37. package/dist/cjs/instructions/createInstruction.js.map +1 -1
  38. package/dist/cjs/instructions/createInstructionV3.js.map +1 -1
  39. package/dist/cjs/instructions/createReverseInstruction.js.map +1 -1
  40. package/dist/cjs/instructions/createSplitV2Instruction.js.map +1 -1
  41. package/dist/cjs/instructions/createV2Instruction.js.map +1 -1
  42. package/dist/cjs/instructions/createWithNftInstruction.js.map +1 -1
  43. package/dist/cjs/instructions/reallocInstruction.js.map +1 -1
  44. package/dist/cjs/instructions/registerFavoriteInstruction.js.map +1 -1
  45. package/dist/cjs/instructions/transferInstruction.js.map +1 -1
  46. package/dist/cjs/instructions/updateInstruction.js.map +1 -1
  47. package/dist/cjs/int.js.map +1 -1
  48. package/dist/cjs/nft/getDomainMint.js.map +1 -1
  49. package/dist/cjs/nft/getRecordFromMint.js.map +1 -1
  50. package/dist/cjs/nft/retrieveNftOwner.js.map +1 -1
  51. package/dist/cjs/nft/retrieveNftOwnerV2.js.map +1 -1
  52. package/dist/cjs/nft/retrieveNfts.js +1 -1
  53. package/dist/cjs/nft/retrieveNfts.js.map +1 -1
  54. package/dist/cjs/nft/retrieveRecords.js +1 -1
  55. package/dist/cjs/nft/retrieveRecords.js.map +1 -1
  56. package/dist/cjs/nft/state.js.map +1 -1
  57. package/dist/cjs/node_modules/@bonfida/sns-records/dist/index.js +1 -1
  58. package/dist/cjs/node_modules/@noble/curves/esm/abstract/curve.js +2 -2
  59. package/dist/cjs/node_modules/@noble/curves/esm/abstract/curve.js.map +1 -1
  60. package/dist/cjs/node_modules/@noble/curves/esm/abstract/edwards.js +2 -2
  61. package/dist/cjs/node_modules/@noble/curves/esm/abstract/edwards.js.map +1 -1
  62. package/dist/cjs/node_modules/@noble/curves/esm/abstract/modular.js +2 -2
  63. package/dist/cjs/node_modules/@noble/curves/esm/abstract/modular.js.map +1 -1
  64. package/dist/cjs/node_modules/@noble/curves/esm/ed25519.js +2 -2
  65. package/dist/cjs/node_modules/@noble/curves/esm/ed25519.js.map +1 -1
  66. package/dist/cjs/node_modules/@noble/curves/esm/utils.js +3 -0
  67. package/dist/cjs/node_modules/@noble/curves/esm/utils.js.map +1 -0
  68. package/dist/cjs/node_modules/@noble/hashes/esm/_md.js +1 -1
  69. package/dist/cjs/node_modules/@noble/hashes/esm/_md.js.map +1 -1
  70. package/dist/cjs/node_modules/@noble/hashes/esm/sha2.js +1 -1
  71. package/dist/cjs/node_modules/@noble/hashes/esm/sha2.js.map +1 -1
  72. package/dist/cjs/node_modules/@noble/hashes/esm/utils.js +2 -2
  73. package/dist/cjs/node_modules/@noble/hashes/esm/utils.js.map +1 -1
  74. package/dist/cjs/node_modules/@scure/base/lib/esm/index.js +1 -1
  75. package/dist/cjs/node_modules/@scure/base/lib/esm/index.js.map +1 -1
  76. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/extensions/accountType.js.map +1 -1
  77. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/state/account.js.map +1 -1
  78. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/state/mint.js.map +1 -1
  79. package/dist/cjs/node_modules/@solana/spl-token/lib/esm/state/multisig.js.map +1 -1
  80. package/dist/cjs/node_modules/base64-js/index.js +1 -1
  81. package/dist/cjs/node_modules/base64-js/index.js.map +1 -1
  82. package/dist/cjs/node_modules/borsh/lib/esm/buffer.js.map +1 -1
  83. package/dist/cjs/node_modules/borsh/lib/esm/deserialize.js +1 -1
  84. package/dist/cjs/node_modules/borsh/lib/esm/deserialize.js.map +1 -1
  85. package/dist/cjs/node_modules/borsh/lib/esm/index.js.map +1 -1
  86. package/dist/cjs/node_modules/borsh/lib/esm/serialize.js.map +1 -1
  87. package/dist/cjs/node_modules/borsh/lib/esm/utils.js.map +1 -1
  88. package/dist/cjs/node_modules/bs58/index.js.map +1 -1
  89. package/dist/cjs/node_modules/bs58/node_modules/base-x/src/index.js.map +1 -1
  90. package/dist/cjs/node_modules/buffer/index.js +1 -1
  91. package/dist/cjs/node_modules/buffer/index.js.map +1 -1
  92. package/dist/cjs/node_modules/graphemesplit/index.js.map +1 -1
  93. package/dist/cjs/node_modules/ieee754/index.js.map +1 -1
  94. package/dist/cjs/node_modules/ipaddr.js/lib/ipaddr.js +1 -1
  95. package/dist/cjs/node_modules/ipaddr.js/lib/ipaddr.js.map +1 -1
  96. package/dist/cjs/node_modules/js-base64/base64.js +1 -1
  97. package/dist/cjs/node_modules/js-base64/base64.js.map +1 -1
  98. package/dist/cjs/node_modules/punycode/punycode.es6.js +1 -1
  99. package/dist/cjs/node_modules/punycode/punycode.es6.js.map +1 -1
  100. package/dist/cjs/node_modules/tiny-inflate/index.js.map +1 -1
  101. package/dist/cjs/node_modules/unicode-trie/index.js.map +1 -1
  102. package/dist/cjs/node_modules/unicode-trie/swap.js.map +1 -1
  103. package/dist/cjs/record/deserializeRecord.js +1 -1
  104. package/dist/cjs/record/deserializeRecord.js.map +1 -1
  105. package/dist/cjs/record/getRecord.js.map +1 -1
  106. package/dist/cjs/record/getRecordKeySync.js.map +1 -1
  107. package/dist/cjs/record/getRecords.js +1 -1
  108. package/dist/cjs/record/getRecords.js.map +1 -1
  109. package/dist/cjs/record/helpers/getSolRecord.js.map +1 -1
  110. package/dist/cjs/record/serializeRecord.js.map +1 -1
  111. package/dist/cjs/record/serializeSolRecord.js.map +1 -1
  112. package/dist/cjs/record_v2/const.d.ts +1 -0
  113. package/dist/cjs/record_v2/const.js +1 -1
  114. package/dist/cjs/record_v2/const.js.map +1 -1
  115. package/dist/cjs/record_v2/deserializeRecordV2Content.js.map +1 -1
  116. package/dist/cjs/record_v2/getMultipleRecordsV2.d.ts +16 -5
  117. package/dist/cjs/record_v2/getMultipleRecordsV2.js +1 -1
  118. package/dist/cjs/record_v2/getMultipleRecordsV2.js.map +1 -1
  119. package/dist/cjs/record_v2/getRecordV2.d.ts +16 -8
  120. package/dist/cjs/record_v2/getRecordV2.js +1 -1
  121. package/dist/cjs/record_v2/getRecordV2.js.map +1 -1
  122. package/dist/cjs/record_v2/getRecordV2Key.js.map +1 -1
  123. package/dist/cjs/record_v2/serializeRecordV2Content.js.map +1 -1
  124. package/dist/cjs/record_v2/verifyRightOfAssociation.js.map +1 -1
  125. package/dist/cjs/record_v2/{utils.js → verifyStaleness.js} +1 -1
  126. package/dist/cjs/record_v2/verifyStaleness.js.map +1 -0
  127. package/dist/cjs/resolve/resolve.js +1 -1
  128. package/dist/cjs/resolve/resolve.js.map +1 -1
  129. package/dist/cjs/resolve/resolveSolRecordV1.js.map +1 -1
  130. package/dist/cjs/resolve/resolveSolRecordV2.js.map +1 -1
  131. package/dist/cjs/state.js +1 -1
  132. package/dist/cjs/state.js.map +1 -1
  133. package/dist/cjs/twitter/ReverseTwitterRegistryState.js.map +1 -1
  134. package/dist/cjs/twitter/changeTwitterRegistryData.js.map +1 -1
  135. package/dist/cjs/twitter/changeVerifiedPubkey.js.map +1 -1
  136. package/dist/cjs/twitter/createReverseTwitterRegistry.js.map +1 -1
  137. package/dist/cjs/twitter/createVerifiedTwitterRegistry.js.map +1 -1
  138. package/dist/cjs/twitter/deleteTwitterRegistry.js.map +1 -1
  139. package/dist/cjs/twitter/getHandleAndRegistryKey.js.map +1 -1
  140. package/dist/cjs/twitter/getTwitterHandleandRegistryKeyViaFilters.js.map +1 -1
  141. package/dist/cjs/twitter/getTwitterRegistry.js.map +1 -1
  142. package/dist/cjs/twitter/getTwitterRegistryData.js.map +1 -1
  143. package/dist/cjs/twitter/getTwitterRegistryKey.js.map +1 -1
  144. package/dist/cjs/types/custom-bg.js.map +1 -1
  145. package/dist/cjs/types/record.d.ts +2 -1
  146. package/dist/cjs/types/record.js +1 -1
  147. package/dist/cjs/types/record.js.map +1 -1
  148. package/dist/cjs/utils/findSubdomains.js +1 -1
  149. package/dist/cjs/utils/findSubdomains.js.map +1 -1
  150. package/dist/cjs/utils/getAllDomains.js +1 -1
  151. package/dist/cjs/utils/getAllDomains.js.map +1 -1
  152. package/dist/cjs/utils/getAllRegisteredDomains.js.map +1 -1
  153. package/dist/cjs/utils/getDomainKeySync.js.map +1 -1
  154. package/dist/cjs/utils/getDomainKeysWithReverses.js +1 -1
  155. package/dist/cjs/utils/getDomainKeysWithReverses.js.map +1 -1
  156. package/dist/cjs/utils/getDomainPriceFromName.js.map +1 -1
  157. package/dist/cjs/utils/getHashedNameSync.js.map +1 -1
  158. package/dist/cjs/utils/getNameAccountKeySync.js.map +1 -1
  159. package/dist/cjs/utils/getPythFeedAccountKey.js.map +1 -1
  160. package/dist/cjs/utils/getReverseKeyFromDomainKey.js.map +1 -1
  161. package/dist/cjs/utils/getReverseKeySync.js.map +1 -1
  162. package/dist/cjs/utils/getTokenizedDomains.js +1 -1
  163. package/dist/cjs/utils/getTokenizedDomains.js.map +1 -1
  164. package/dist/cjs/utils/reverseLookup.js.map +1 -1
  165. package/dist/cjs/utils/reverseLookupBatch.js +1 -1
  166. package/dist/cjs/utils/reverseLookupBatch.js.map +1 -1
  167. package/dist/esm/bindings/burnDomain.js.map +1 -1
  168. package/dist/esm/bindings/createNameRegistry.js.map +1 -1
  169. package/dist/esm/bindings/createRecordInstruction.js.map +1 -1
  170. package/dist/esm/bindings/createRecordV2Instruction.js.map +1 -1
  171. package/dist/esm/bindings/createReverseName.js.map +1 -1
  172. package/dist/esm/bindings/createSolRecordInstruction.js.map +1 -1
  173. package/dist/esm/bindings/createSubdomain.js.map +1 -1
  174. package/dist/esm/bindings/deleteRecordV2.js.map +1 -1
  175. package/dist/esm/bindings/ethValidateRecordV2Content.js.map +1 -1
  176. package/dist/esm/bindings/registerDomainName.js +1 -1
  177. package/dist/esm/bindings/registerDomainName.js.map +1 -1
  178. package/dist/esm/bindings/registerDomainNameV2.js +1 -1
  179. package/dist/esm/bindings/registerDomainNameV2.js.map +1 -1
  180. package/dist/esm/bindings/registerFavorite.js.map +1 -1
  181. package/dist/esm/bindings/registerWithNft.js.map +1 -1
  182. package/dist/esm/bindings/transferSubdomain.js.map +1 -1
  183. package/dist/esm/bindings/updateRecordInstruction.js.map +1 -1
  184. package/dist/esm/bindings/updateRecordV2Instruction.js.map +1 -1
  185. package/dist/esm/bindings/updateSolRecordInstruction.js.map +1 -1
  186. package/dist/esm/bindings/validateRecordV2Content.js.map +1 -1
  187. package/dist/esm/bindings/writRoaRecordV2.js.map +1 -1
  188. package/dist/esm/custom-bg.js +1 -1
  189. package/dist/esm/custom-bg.js.map +1 -1
  190. package/dist/esm/deprecated/utils.js +1 -1
  191. package/dist/esm/deprecated/utils.js.map +1 -1
  192. package/dist/esm/devnet.js +1 -1
  193. package/dist/esm/devnet.js.map +1 -1
  194. package/dist/esm/error.js.map +1 -1
  195. package/dist/esm/favorite-domain.js +1 -1
  196. package/dist/esm/favorite-domain.js.map +1 -1
  197. package/dist/esm/index.d.ts +1 -1
  198. package/dist/esm/index.js +1 -1
  199. package/dist/esm/instructions/burnInstruction.js.map +1 -1
  200. package/dist/esm/instructions/createInstruction.js.map +1 -1
  201. package/dist/esm/instructions/createInstructionV3.js.map +1 -1
  202. package/dist/esm/instructions/createReverseInstruction.js.map +1 -1
  203. package/dist/esm/instructions/createSplitV2Instruction.js.map +1 -1
  204. package/dist/esm/instructions/createV2Instruction.js.map +1 -1
  205. package/dist/esm/instructions/createWithNftInstruction.js.map +1 -1
  206. package/dist/esm/instructions/reallocInstruction.js.map +1 -1
  207. package/dist/esm/instructions/registerFavoriteInstruction.js.map +1 -1
  208. package/dist/esm/instructions/transferInstruction.js.map +1 -1
  209. package/dist/esm/instructions/updateInstruction.js.map +1 -1
  210. package/dist/esm/int.js.map +1 -1
  211. package/dist/esm/nft/getDomainMint.js.map +1 -1
  212. package/dist/esm/nft/getRecordFromMint.js.map +1 -1
  213. package/dist/esm/nft/retrieveNftOwner.js.map +1 -1
  214. package/dist/esm/nft/retrieveNftOwnerV2.js.map +1 -1
  215. package/dist/esm/nft/retrieveNfts.js +1 -1
  216. package/dist/esm/nft/retrieveNfts.js.map +1 -1
  217. package/dist/esm/nft/retrieveRecords.js +1 -1
  218. package/dist/esm/nft/retrieveRecords.js.map +1 -1
  219. package/dist/esm/nft/state.js.map +1 -1
  220. package/dist/esm/node_modules/@bonfida/sns-records/dist/index.js +1 -1
  221. package/dist/esm/node_modules/@noble/curves/esm/abstract/curve.js +2 -2
  222. package/dist/esm/node_modules/@noble/curves/esm/abstract/curve.js.map +1 -1
  223. package/dist/esm/node_modules/@noble/curves/esm/abstract/edwards.js +2 -2
  224. package/dist/esm/node_modules/@noble/curves/esm/abstract/edwards.js.map +1 -1
  225. package/dist/esm/node_modules/@noble/curves/esm/abstract/modular.js +2 -2
  226. package/dist/esm/node_modules/@noble/curves/esm/abstract/modular.js.map +1 -1
  227. package/dist/esm/node_modules/@noble/curves/esm/ed25519.js +2 -2
  228. package/dist/esm/node_modules/@noble/curves/esm/ed25519.js.map +1 -1
  229. package/dist/esm/node_modules/@noble/curves/esm/utils.js +3 -0
  230. package/dist/esm/node_modules/@noble/curves/esm/utils.js.map +1 -0
  231. package/dist/esm/node_modules/@noble/hashes/esm/_md.js +1 -1
  232. package/dist/esm/node_modules/@noble/hashes/esm/_md.js.map +1 -1
  233. package/dist/esm/node_modules/@noble/hashes/esm/_u64.js.map +1 -1
  234. package/dist/esm/node_modules/@noble/hashes/esm/sha2.js +1 -1
  235. package/dist/esm/node_modules/@noble/hashes/esm/sha2.js.map +1 -1
  236. package/dist/esm/node_modules/@noble/hashes/esm/utils.js +2 -2
  237. package/dist/esm/node_modules/@noble/hashes/esm/utils.js.map +1 -1
  238. package/dist/esm/node_modules/@scure/base/lib/esm/index.js +1 -1
  239. package/dist/esm/node_modules/@scure/base/lib/esm/index.js.map +1 -1
  240. package/dist/esm/node_modules/@solana/spl-token/lib/esm/extensions/accountType.js.map +1 -1
  241. package/dist/esm/node_modules/@solana/spl-token/lib/esm/state/account.js.map +1 -1
  242. package/dist/esm/node_modules/@solana/spl-token/lib/esm/state/mint.js.map +1 -1
  243. package/dist/esm/node_modules/base64-js/index.js +1 -1
  244. package/dist/esm/node_modules/base64-js/index.js.map +1 -1
  245. package/dist/esm/node_modules/borsh/lib/esm/buffer.js.map +1 -1
  246. package/dist/esm/node_modules/borsh/lib/esm/deserialize.js +1 -1
  247. package/dist/esm/node_modules/borsh/lib/esm/deserialize.js.map +1 -1
  248. package/dist/esm/node_modules/borsh/lib/esm/serialize.js.map +1 -1
  249. package/dist/esm/node_modules/borsh/lib/esm/utils.js.map +1 -1
  250. package/dist/esm/node_modules/bs58/node_modules/base-x/src/index.js.map +1 -1
  251. package/dist/esm/node_modules/buffer/index.js +1 -1
  252. package/dist/esm/node_modules/buffer/index.js.map +1 -1
  253. package/dist/esm/node_modules/graphemesplit/index.js +1 -1
  254. package/dist/esm/node_modules/graphemesplit/index.js.map +1 -1
  255. package/dist/esm/node_modules/ieee754/index.js.map +1 -1
  256. package/dist/esm/node_modules/ipaddr.js/lib/ipaddr.js +1 -1
  257. package/dist/esm/node_modules/ipaddr.js/lib/ipaddr.js.map +1 -1
  258. package/dist/esm/node_modules/js-base64/base64.js +1 -1
  259. package/dist/esm/node_modules/js-base64/base64.js.map +1 -1
  260. package/dist/esm/node_modules/punycode/punycode.es6.js +1 -1
  261. package/dist/esm/node_modules/punycode/punycode.es6.js.map +1 -1
  262. package/dist/esm/node_modules/tiny-inflate/index.js.map +1 -1
  263. package/dist/esm/node_modules/unicode-trie/index.js.map +1 -1
  264. package/dist/esm/node_modules/unicode-trie/swap.js.map +1 -1
  265. package/dist/esm/record/checkSolRecord.js.map +1 -1
  266. package/dist/esm/record/deserializeRecord.js +1 -1
  267. package/dist/esm/record/deserializeRecord.js.map +1 -1
  268. package/dist/esm/record/getRecordKeySync.js.map +1 -1
  269. package/dist/esm/record/getRecords.js +1 -1
  270. package/dist/esm/record/getRecords.js.map +1 -1
  271. package/dist/esm/record/serializeRecord.js.map +1 -1
  272. package/dist/esm/record/serializeSolRecord.js.map +1 -1
  273. package/dist/esm/record_v2/const.d.ts +1 -0
  274. package/dist/esm/record_v2/const.js +1 -1
  275. package/dist/esm/record_v2/const.js.map +1 -1
  276. package/dist/esm/record_v2/deserializeRecordV2Content.js.map +1 -1
  277. package/dist/esm/record_v2/getMultipleRecordsV2.d.ts +16 -5
  278. package/dist/esm/record_v2/getMultipleRecordsV2.js +1 -1
  279. package/dist/esm/record_v2/getMultipleRecordsV2.js.map +1 -1
  280. package/dist/esm/record_v2/getRecordV2.d.ts +16 -8
  281. package/dist/esm/record_v2/getRecordV2.js +1 -1
  282. package/dist/esm/record_v2/getRecordV2.js.map +1 -1
  283. package/dist/esm/record_v2/getRecordV2Key.js.map +1 -1
  284. package/dist/esm/record_v2/serializeRecordV2Content.js.map +1 -1
  285. package/dist/esm/record_v2/verifyRightOfAssociation.js.map +1 -1
  286. package/dist/esm/record_v2/{utils.js → verifyStaleness.js} +1 -1
  287. package/dist/esm/record_v2/verifyStaleness.js.map +1 -0
  288. package/dist/esm/resolve/resolve.js +1 -1
  289. package/dist/esm/resolve/resolve.js.map +1 -1
  290. package/dist/esm/resolve/resolveSolRecordV1.js.map +1 -1
  291. package/dist/esm/resolve/resolveSolRecordV2.js.map +1 -1
  292. package/dist/esm/state.js +1 -1
  293. package/dist/esm/state.js.map +1 -1
  294. package/dist/esm/twitter/ReverseTwitterRegistryState.js.map +1 -1
  295. package/dist/esm/twitter/changeVerifiedPubkey.js +1 -1
  296. package/dist/esm/twitter/createReverseTwitterRegistry.js +1 -1
  297. package/dist/esm/twitter/createVerifiedTwitterRegistry.js +1 -1
  298. package/dist/esm/twitter/getTwitterHandleandRegistryKeyViaFilters.js.map +1 -1
  299. package/dist/esm/types/custom-bg.js.map +1 -1
  300. package/dist/esm/types/record.d.ts +2 -1
  301. package/dist/esm/types/record.js +1 -1
  302. package/dist/esm/types/record.js.map +1 -1
  303. package/dist/esm/utils/findSubdomains.js +1 -1
  304. package/dist/esm/utils/findSubdomains.js.map +1 -1
  305. package/dist/esm/utils/getAllDomains.js +1 -1
  306. package/dist/esm/utils/getAllDomains.js.map +1 -1
  307. package/dist/esm/utils/getAllRegisteredDomains.js.map +1 -1
  308. package/dist/esm/utils/getDomainKeySync.js.map +1 -1
  309. package/dist/esm/utils/getDomainKeysWithReverses.js +1 -1
  310. package/dist/esm/utils/getDomainKeysWithReverses.js.map +1 -1
  311. package/dist/esm/utils/getDomainPriceFromName.js.map +1 -1
  312. package/dist/esm/utils/getHashedNameSync.js.map +1 -1
  313. package/dist/esm/utils/getNameAccountKeySync.js.map +1 -1
  314. package/dist/esm/utils/getPythFeedAccountKey.js.map +1 -1
  315. package/dist/esm/utils/getReverseKeyFromDomainKey.js.map +1 -1
  316. package/dist/esm/utils/getReverseKeySync.js.map +1 -1
  317. package/dist/esm/utils/getTokenizedDomains.js +1 -1
  318. package/dist/esm/utils/getTokenizedDomains.js.map +1 -1
  319. package/dist/esm/utils/reverseLookupBatch.js +1 -1
  320. package/dist/esm/utils/reverseLookupBatch.js.map +1 -1
  321. package/package.json +2 -2
  322. package/dist/cjs/node_modules/@noble/curves/esm/abstract/utils.js +0 -3
  323. package/dist/cjs/node_modules/@noble/curves/esm/abstract/utils.js.map +0 -1
  324. package/dist/cjs/record_v2/utils.js.map +0 -1
  325. package/dist/esm/node_modules/@noble/curves/esm/abstract/utils.js +0 -3
  326. package/dist/esm/node_modules/@noble/curves/esm/abstract/utils.js.map +0 -1
  327. package/dist/esm/record_v2/utils.js.map +0 -1
  328. /package/dist/cjs/record_v2/{utils.d.ts → verifyStaleness.d.ts} +0 -0
  329. /package/dist/esm/record_v2/{utils.d.ts → verifyStaleness.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"sha2.js","sources":["../../../../../../node_modules/@noble/hashes/esm/sha2.js"],"sourcesContent":["/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and\n * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from \"./_md.js\";\nimport * as u64 from \"./_u64.js\";\nimport { clean, createHasher, rotr } from \"./utils.js\";\n/**\n * Round constants:\n * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n/** Reusable temporary buffer. \"W\" comes straight from spec. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nexport class SHA256 extends HashMD {\n constructor(outputLen = 32) {\n super(64, outputLen, 8, false);\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n this.A = SHA256_IV[0] | 0;\n this.B = SHA256_IV[1] | 0;\n this.C = SHA256_IV[2] | 0;\n this.D = SHA256_IV[3] | 0;\n this.E = SHA256_IV[4] | 0;\n this.F = SHA256_IV[5] | 0;\n this.G = SHA256_IV[6] | 0;\n this.H = SHA256_IV[7] | 0;\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n set(A, B, C, D, E, F, G, H) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4)\n SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n roundClean() {\n clean(SHA256_W);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\nexport class SHA224 extends SHA256 {\n constructor() {\n super(28);\n this.A = SHA224_IV[0] | 0;\n this.B = SHA224_IV[1] | 0;\n this.C = SHA224_IV[2] | 0;\n this.D = SHA224_IV[3] | 0;\n this.E = SHA224_IV[4] | 0;\n this.F = SHA224_IV[5] | 0;\n this.G = SHA224_IV[6] | 0;\n this.H = SHA224_IV[7] | 0;\n }\n}\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n// Round contants\n// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n// Reusable temporary buffers\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\nexport class SHA512 extends HashMD {\n constructor(outputLen = 64) {\n super(128, outputLen, 16, false);\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = SHA512_IV[0] | 0;\n this.Al = SHA512_IV[1] | 0;\n this.Bh = SHA512_IV[2] | 0;\n this.Bl = SHA512_IV[3] | 0;\n this.Ch = SHA512_IV[4] | 0;\n this.Cl = SHA512_IV[5] | 0;\n this.Dh = SHA512_IV[6] | 0;\n this.Dl = SHA512_IV[7] | 0;\n this.Eh = SHA512_IV[8] | 0;\n this.El = SHA512_IV[9] | 0;\n this.Fh = SHA512_IV[10] | 0;\n this.Fl = SHA512_IV[11] | 0;\n this.Gh = SHA512_IV[12] | 0;\n this.Gl = SHA512_IV[13] | 0;\n this.Hh = SHA512_IV[14] | 0;\n this.Hl = SHA512_IV[15] | 0;\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy() {\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\nexport class SHA384 extends SHA512 {\n constructor() {\n super(48);\n this.Ah = SHA384_IV[0] | 0;\n this.Al = SHA384_IV[1] | 0;\n this.Bh = SHA384_IV[2] | 0;\n this.Bl = SHA384_IV[3] | 0;\n this.Ch = SHA384_IV[4] | 0;\n this.Cl = SHA384_IV[5] | 0;\n this.Dh = SHA384_IV[6] | 0;\n this.Dl = SHA384_IV[7] | 0;\n this.Eh = SHA384_IV[8] | 0;\n this.El = SHA384_IV[9] | 0;\n this.Fh = SHA384_IV[10] | 0;\n this.Fl = SHA384_IV[11] | 0;\n this.Gh = SHA384_IV[12] | 0;\n this.Gl = SHA384_IV[13] | 0;\n this.Hh = SHA384_IV[14] | 0;\n this.Hl = SHA384_IV[15] | 0;\n }\n}\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See `test/misc/sha2-gen-iv.js`.\n */\n/** SHA512/224 IV */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA512/256 IV */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\nexport class SHA512_224 extends SHA512 {\n constructor() {\n super(28);\n this.Ah = T224_IV[0] | 0;\n this.Al = T224_IV[1] | 0;\n this.Bh = T224_IV[2] | 0;\n this.Bl = T224_IV[3] | 0;\n this.Ch = T224_IV[4] | 0;\n this.Cl = T224_IV[5] | 0;\n this.Dh = T224_IV[6] | 0;\n this.Dl = T224_IV[7] | 0;\n this.Eh = T224_IV[8] | 0;\n this.El = T224_IV[9] | 0;\n this.Fh = T224_IV[10] | 0;\n this.Fl = T224_IV[11] | 0;\n this.Gh = T224_IV[12] | 0;\n this.Gl = T224_IV[13] | 0;\n this.Hh = T224_IV[14] | 0;\n this.Hl = T224_IV[15] | 0;\n }\n}\nexport class SHA512_256 extends SHA512 {\n constructor() {\n super(32);\n this.Ah = T256_IV[0] | 0;\n this.Al = T256_IV[1] | 0;\n this.Bh = T256_IV[2] | 0;\n this.Bl = T256_IV[3] | 0;\n this.Ch = T256_IV[4] | 0;\n this.Cl = T256_IV[5] | 0;\n this.Dh = T256_IV[6] | 0;\n this.Dl = T256_IV[7] | 0;\n this.Eh = T256_IV[8] | 0;\n this.El = T256_IV[9] | 0;\n this.Fh = T256_IV[10] | 0;\n this.Fl = T256_IV[11] | 0;\n this.Gh = T256_IV[12] | 0;\n this.Gl = T256_IV[13] | 0;\n this.Hh = T256_IV[14] | 0;\n this.Hl = T256_IV[15] | 0;\n }\n}\n/**\n * SHA2-256 hash function from RFC 4634.\n *\n * It is the fastest JS hash, even faster than Blake3.\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n */\nexport const sha256 = /* @__PURE__ */ createHasher(() => new SHA256());\n/** SHA2-224 hash function from RFC 4634 */\nexport const sha224 = /* @__PURE__ */ createHasher(() => new SHA224());\n/** SHA2-512 hash function from RFC 4634. */\nexport const sha512 = /* @__PURE__ */ createHasher(() => new SHA512());\n/** SHA2-384 hash function from RFC 4634. */\nexport const sha384 = /* @__PURE__ */ createHasher(() => new SHA384());\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_256 = /* @__PURE__ */ createHasher(() => new SHA512_256());\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_224 = /* @__PURE__ */ createHasher(() => new SHA512_224());\n//# sourceMappingURL=sha2.js.map"],"names":["SHA256_K","Uint32Array","from","SHA256_W","SHA256","HashMD","constructor","outputLen","super","this","A","SHA256_IV","B","C","D","E","F","G","H","get","set","process","view","offset","i","getUint32","W15","W2","s0","rotr","s1","T1","Chi","T2","Maj","roundClean","clean","destroy","buffer","K512","u64","map","n","BigInt","SHA512_Kh","SHA512_Kl","SHA512_W_H","SHA512_W_L","SHA512","Ah","SHA512_IV","Al","Bh","Bl","Ch","Cl","Dh","Dl","Eh","El","Fh","Fl","Gh","Gl","Hh","Hl","W15h","W15l","s0h","s0l","W2h","W2l","s1h","s1l","SUMl","SUMh","sigma1h","sigma1l","CHIh","T1ll","T1h","T1l","sigma0h","sigma0l","MAJh","MAJl","h","l","All","sha256","createHasher","sha512"],"mappings":"oUAgBA,MAAMA,EAA2BC,YAAYC,KAAK,CAChD,WAAY,WAAY,WAAY,WAAY,UAAY,WAAY,WAAY,WACpF,WAAY,UAAY,UAAY,WAAY,WAAY,WAAY,WAAY,WACpF,WAAY,WAAY,UAAY,UAAY,UAAY,WAAY,WAAY,WACpF,WAAY,WAAY,WA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AIE,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EACvE,CACU9B,UAAAA,GACRC,EAAMU,EAAYC,EACpB,CACAV,OAAAA,GACED,EAAM3B,KAAK6B,QACX7B,KAAKW,IAAI,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EACxD,EAkGK,MAAMqE,EAAgCC,GAAa,IAAM,IAAItF,IAKvDuF,EAAgCD,GAAa,IAAM,IAAI1C","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"sha2.js","sources":["../../../../../../node_modules/@noble/hashes/esm/sha2.js"],"sourcesContent":["/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and\n * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from \"./_md.js\";\nimport * as u64 from \"./_u64.js\";\nimport { clean, createHasher, rotr } from \"./utils.js\";\n/**\n * Round constants:\n * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n/** Reusable temporary buffer. \"W\" comes straight from spec. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nexport class SHA256 extends HashMD {\n constructor(outputLen = 32) {\n super(64, outputLen, 8, false);\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n this.A = SHA256_IV[0] | 0;\n this.B = SHA256_IV[1] | 0;\n this.C = SHA256_IV[2] | 0;\n this.D = SHA256_IV[3] | 0;\n this.E = SHA256_IV[4] | 0;\n this.F = SHA256_IV[5] | 0;\n this.G = SHA256_IV[6] | 0;\n this.H = SHA256_IV[7] | 0;\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n set(A, B, C, D, E, F, G, H) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4)\n SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n roundClean() {\n clean(SHA256_W);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\nexport class SHA224 extends SHA256 {\n constructor() {\n super(28);\n this.A = SHA224_IV[0] | 0;\n this.B = SHA224_IV[1] | 0;\n this.C = SHA224_IV[2] | 0;\n this.D = SHA224_IV[3] | 0;\n this.E = SHA224_IV[4] | 0;\n this.F = SHA224_IV[5] | 0;\n this.G = SHA224_IV[6] | 0;\n this.H = SHA224_IV[7] | 0;\n }\n}\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n// Round contants\n// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n// Reusable temporary buffers\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\nexport class SHA512 extends HashMD {\n constructor(outputLen = 64) {\n super(128, outputLen, 16, false);\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = SHA512_IV[0] | 0;\n this.Al = SHA512_IV[1] | 0;\n this.Bh = SHA512_IV[2] | 0;\n this.Bl = SHA512_IV[3] | 0;\n this.Ch = SHA512_IV[4] | 0;\n this.Cl = SHA512_IV[5] | 0;\n this.Dh = SHA512_IV[6] | 0;\n this.Dl = SHA512_IV[7] | 0;\n this.Eh = SHA512_IV[8] | 0;\n this.El = SHA512_IV[9] | 0;\n this.Fh = SHA512_IV[10] | 0;\n this.Fl = SHA512_IV[11] | 0;\n this.Gh = SHA512_IV[12] | 0;\n this.Gl = SHA512_IV[13] | 0;\n this.Hh = SHA512_IV[14] | 0;\n this.Hl = SHA512_IV[15] | 0;\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy() {\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\nexport class SHA384 extends SHA512 {\n constructor() {\n super(48);\n this.Ah = SHA384_IV[0] | 0;\n this.Al = SHA384_IV[1] | 0;\n this.Bh = SHA384_IV[2] | 0;\n this.Bl = SHA384_IV[3] | 0;\n this.Ch = SHA384_IV[4] | 0;\n this.Cl = SHA384_IV[5] | 0;\n this.Dh = SHA384_IV[6] | 0;\n this.Dl = SHA384_IV[7] | 0;\n this.Eh = SHA384_IV[8] | 0;\n this.El = SHA384_IV[9] | 0;\n this.Fh = SHA384_IV[10] | 0;\n this.Fl = SHA384_IV[11] | 0;\n this.Gh = SHA384_IV[12] | 0;\n this.Gl = SHA384_IV[13] | 0;\n this.Hh = SHA384_IV[14] | 0;\n this.Hl = SHA384_IV[15] | 0;\n }\n}\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See `test/misc/sha2-gen-iv.js`.\n */\n/** SHA512/224 IV */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA512/256 IV */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\nexport class SHA512_224 extends SHA512 {\n constructor() {\n super(28);\n this.Ah = T224_IV[0] | 0;\n this.Al = T224_IV[1] | 0;\n this.Bh = T224_IV[2] | 0;\n this.Bl = T224_IV[3] | 0;\n this.Ch = T224_IV[4] | 0;\n this.Cl = T224_IV[5] | 0;\n this.Dh = T224_IV[6] | 0;\n this.Dl = T224_IV[7] | 0;\n this.Eh = T224_IV[8] | 0;\n this.El = T224_IV[9] | 0;\n this.Fh = T224_IV[10] | 0;\n this.Fl = T224_IV[11] | 0;\n this.Gh = T224_IV[12] | 0;\n this.Gl = T224_IV[13] | 0;\n this.Hh = T224_IV[14] | 0;\n this.Hl = T224_IV[15] | 0;\n }\n}\nexport class SHA512_256 extends SHA512 {\n constructor() {\n super(32);\n this.Ah = T256_IV[0] | 0;\n this.Al = T256_IV[1] | 0;\n this.Bh = T256_IV[2] | 0;\n this.Bl = T256_IV[3] | 0;\n this.Ch = T256_IV[4] | 0;\n this.Cl = T256_IV[5] | 0;\n this.Dh = T256_IV[6] | 0;\n this.Dl = T256_IV[7] | 0;\n this.Eh = T256_IV[8] | 0;\n this.El = T256_IV[9] | 0;\n this.Fh = T256_IV[10] | 0;\n this.Fl = T256_IV[11] | 0;\n this.Gh = T256_IV[12] | 0;\n this.Gl = T256_IV[13] | 0;\n this.Hh = T256_IV[14] | 0;\n this.Hl = T256_IV[15] | 0;\n }\n}\n/**\n * SHA2-256 hash function from RFC 4634.\n *\n * It is the fastest JS hash, even faster than Blake3.\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n */\nexport const sha256 = /* @__PURE__ */ createHasher(() => new SHA256());\n/** SHA2-224 hash function from RFC 4634 */\nexport const sha224 = /* @__PURE__ */ createHasher(() => new SHA224());\n/** SHA2-512 hash function from RFC 4634. */\nexport const sha512 = /* @__PURE__ */ createHasher(() => new SHA512());\n/** SHA2-384 hash function from RFC 4634. */\nexport const sha384 = /* @__PURE__ */ createHasher(() => new SHA384());\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_256 = /* @__PURE__ */ createHasher(() => new SHA512_256());\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_224 = /* @__PURE__ */ createHasher(() => new SHA512_224());\n//# sourceMappingURL=sha2.js.map"],"names":["SHA256_K","Uint32Array","from","SHA256_W","SHA256","HashMD","constructor","outputLen","super","this","A","SHA256_IV","B","C","D","E","F","G","H","get","set","process","view","offset","i","getUint32","W15","W2","s0","rotr","s1","T1","Chi","T2","Maj","roundClean","clean","destroy","buffer","K512","u64","map","n","BigInt","SHA512_Kh","SHA512_Kl","SHA512_W_H","SHA512_W_L","SHA512","Ah","SHA512_IV","Al","Bh","Bl","Ch","Cl","Dh","Dl","Eh","El","Fh","Fl","Gh","Gl","Hh","Hl","W15h","W15l","s0h","s0l","W2h","W2l","s1h","s1l","SUMl","SUMh","sigma1h","sigma1l","CHIh","T1ll","T1h","T1l","sigma0h","sigma0l","MAJh","MAJl","h","l","All","sha256","createHasher","sha512"],"mappings":"oUAgBA,MAAMA,EAA2BC,YAAYC,KAAK,CAChD,WAAY,WAAY,WAAY,WAAY,UAAY,WAAY,WAAY,WACpF,WAAY,UAAY,UAAY,WAAY,WAAY,WAAY,WAAY,WACpF,WAAY,WAAY,UAAY,UAAY,UAAY,WAAY,WAAY,WACpF,WAAY,WAAY,WAAY,WAAY,WAAY,WAAY,UAAY,UACpF,UAAY,UAAY,WAAY,WAAY,WAAY,WAAY,WAAY,WACpF,WAAY,WAAY,WAAY,WAAY,WAAY,WAAY,WAAY,UACpF,UAAY,UAAY,UAAY,UAAY,UAAY,WAAY,WAAY,WACpF,WAAY,WAAY,WAAY,WAAY,WAAY,WAAY,WAAY,aAIhFC,EAA2B,IAAIF,YAAY,IAC3C,MAAOG,UAAeC,EAY1BC,WAAAA,CAAYC,EAAoB,IAC9BC,MAAM,GAAID,EAAW,GAAG,GAVhBE,KAAAC,EAA2B,EAAfC,EAAU,GACtBF,KAAAG,EAA2B,EAAfD,EAAU,GACtBF,KAAAI,EAA2B,EAAfF,EAAU,GACtBF,KAAAK,EAA2B,EAAfH,EAAU,GACtBF,KAAAM,EAA2B,EAAfJ,EAAU,GACtBF,KAAAO,EAA2B,EAAfL,EAAU,GACtBF,KAAAQ,EAA2B,EAAfN,EAAU,GACtBF,KAAAS,EAA2B,EAAfP,EAAU,EAIhC,CACUQ,GAAAA,GACR,MAAMT,EAAEA,EAACE,EAAEA,EAACC,EAAEA,EAACC,EAAEA,EAACC,EAAEA,EAACC,EAAEA,EAACC,EAAEA,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EAALC,MAC3D6B,EAAG5B,EAAI6B,EAAG5B,GAAOnB,EAAkB,EAAV/B,KAAKiD,GAAkB,EAAVjD,KAAKkD,GAAa,EAALD,EAAa,EAALC,MAC3D2B,EAAG1B,EAAI2B,EAAG1B,GAAOrB,EAAkB,EAAV/B,KAAKmD,GAAkB,EAAVnD,KAAKoD,GAAa,EAALD,EAAa,EAALC,MAC3DyB,EAAGxB,EAAIyB,EAAGxB,GAAOvB,EAAkB,EAAV/B,KAAKqD,GAAkB,EAAVrD,KAAKsD,GAAa,EAALD,EAAa,EAALC,MAC3DuB,EAAGtB,EAAIuB,EAAGtB,GAAOzB,EAAkB,EAAV/B,KAAKuD,GAAkB,EAAVvD,KAAKwD,GAAa,EAALD,EAAa,EAALC,IAC9DxD,KAAKW,IAAI6B,EAAIE,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EACvE,CACU9B,UAAAA,GACRC,EAAMU,EAAYC,EACpB,CACAV,OAAAA,GACED,EAAM3B,KAAK6B,QACX7B,KAAKW,IAAI,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EACxD,EAkGK,MAAMqE,EAAgCC,EAAa,IAAM,IAAItF,GAKvDuF,EAAgCD,EAAa,IAAM,IAAI1C","x_google_ignoreList":[0]}
@@ -1,4 +1,4 @@
1
- import{crypto as e}from"./crypto.js";
1
+ import{crypto as t}from"./crypto.js";
2
2
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
- function t(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function n(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function r(e,...n){if(!t(e))throw new Error("Uint8Array expected");if(n.length>0&&!n.includes(e.length))throw new Error("Uint8Array expected of length "+n+", got length="+e.length)}function o(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function i(e,t){r(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function f(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function u(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function c(e,t){return e<<32-t|e>>>t}function a(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function s(e){return"string"==typeof e&&(e=a(e)),r(e),e}class d{}function g(e){const t=t=>e().update(s(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function h(t=32){if(e&&"function"==typeof e.getRandomValues)return e.getRandomValues(new Uint8Array(t));if(e&&"function"==typeof e.randomBytes)return Uint8Array.from(e.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}export{d as Hash,r as abytes,o as aexists,n as anumber,i as aoutput,f as clean,g as createHasher,u as createView,t as isBytes,h as randomBytes,c as rotr,s as toBytes,a as utf8ToBytes};
3
+ function e(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function n(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function r(t,...n){if(!e(t))throw new Error("Uint8Array expected");if(n.length>0&&!n.includes(t.length))throw new Error("Uint8Array expected of length "+n+", got length="+t.length)}function o(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function i(t,e){r(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function f(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function c(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function u(t,e){return t<<32-e|t>>>e}const a=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),s=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function h(t){if(r(t),a)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=s[t[n]];return e}const d=48,g=57,l=65,y=70,w=97,p=102;function x(t){return t>=d&&t<=g?t-d:t>=l&&t<=y?t-(l-10):t>=w&&t<=p?t-(w-10):void 0}function A(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);if(a)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let e=0,o=0;e<n;e++,o+=2){const n=x(t.charCodeAt(o)),i=x(t.charCodeAt(o+1));if(void 0===n||void 0===i){const e=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+o)}r[e]=16*n+i}return r}function m(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))}function E(t){return"string"==typeof t&&(t=m(t)),r(t),t}function U(...t){let e=0;for(let n=0;n<t.length;n++){const o=t[n];r(o),e+=o.length}const n=new Uint8Array(e);for(let e=0,r=0;e<t.length;e++){const o=t[e];n.set(o,r),r+=o.length}return n}class b{}function H(t){const e=e=>t().update(E(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function L(e=32){if(t&&"function"==typeof t.getRandomValues)return t.getRandomValues(new Uint8Array(e));if(t&&"function"==typeof t.randomBytes)return Uint8Array.from(t.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}export{b as Hash,r as abytes,o as aexists,n as anumber,i as aoutput,h as bytesToHex,f as clean,U as concatBytes,H as createHasher,c as createView,A as hexToBytes,e as isBytes,L as randomBytes,u as rotr,E as toBytes,m as utf8ToBytes};
4
4
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../../node_modules/@noble/hashes/esm/utils.js"],"sourcesContent":["/**\n * Utilities for hex, bytes, CSPRNG.\n * @module\n */\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\nexport function isBytes(a) {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n/** Asserts something is positive integer. */\nexport function anumber(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error('positive integer expected, got ' + n);\n}\n/** Asserts something is Uint8Array. */\nexport function abytes(b, ...lengths) {\n if (!isBytes(b))\n throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\n/** Asserts something is hash */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash should be wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n}\n/** Asserts a hash instance has not been destroyed / finished */\nexport function aexists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\n/** Asserts output is properly-sized byte array */\nexport function aoutput(out, instance) {\n abytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error('digestInto() expects output buffer of length at least ' + min);\n }\n}\n/** Cast u8 / u16 / u32 to u8. */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** Cast u8 / u16 / u32 to u32. */\nexport function u32(arr) {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/** Zeroize a byte array. Warning: JS provides no guarantees. */\nexport function clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n/** Create DataView of an array for easy byte-level manipulation. */\nexport function createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** The rotate right (circular right shift) operation for uint32 */\nexport function rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/** The rotate left (circular left shift) operation for uint32 */\nexport function rotl(word, shift) {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Is current platform little-endian? Most are. Big-Endian platform: IBM */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n/** The byte swap operation for uint32 */\nexport function byteSwap(word) {\n return (((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff));\n}\n/** Conditionally byte swap if on a big-endian platform */\nexport const swap8IfBE = isLE\n ? (n) => n\n : (n) => byteSwap(n);\n/** @deprecated */\nexport const byteSwapIfBE = swap8IfBE;\n/** In place byte swap for Uint32Array */\nexport function byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\nexport const swap32IfBE = isLE\n ? (u) => u\n : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \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/**\n * There is no setImmediate in browser and setTimeout is slow.\n * Call of async fn will return Promise, which will be fullfiled only on\n * next scheduler queue processing step and this is exactly what we need.\n */\nexport const nextTick = async () => { };\n/** Returns control to thread each 'tick' ms to avoid blocking. */\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * @example utf8ToBytes('abc') // Uint8Array.from([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/**\n * Converts bytes to string using UTF8 encoding.\n * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc'\n */\nexport function bytesToUtf8(bytes) {\n return new TextDecoder().decode(bytes);\n}\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n/**\n * Helper for KDFs: consumes uint8array or string.\n * When string is passed, does utf8 decoding, using TextDecoder.\n */\nexport function kdfInputToBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n/** Copies several Uint8Arrays into one. */\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}\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n throw new Error('options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\n/** For runtime check if class implements interface */\nexport class Hash {\n}\n/** Wraps hash function, creating an interface on top of it */\nexport function createHasher(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexport function createOptHasher(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexport function createXOFer(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexport const wrapConstructor = createHasher;\nexport const wrapConstructorWithOpts = createOptHasher;\nexport const wrapXOFConstructorWithOpts = createXOFer;\n/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */\nexport function randomBytes(bytesLength = 32) {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n // Legacy Node.js compatibility\n if (crypto && typeof crypto.randomBytes === 'function') {\n return Uint8Array.from(crypto.randomBytes(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.js.map"],"names":["isBytes","a","Uint8Array","ArrayBuffer","isView","constructor","name","anumber","n","Number","isSafeInteger","Error","abytes","b","lengths","length","includes","aexists","instance","checkFinished","destroyed","finished","aoutput","out","min","outputLen","clean","arrays","i","fill","createView","arr","DataView","buffer","byteOffset","byteLength","rotr","word","shift","utf8ToBytes","str","TextEncoder","encode","toBytes","data"],"mappings":";;AAeA,SAAAA,EAAAC,GACE,OAAOA,aAAaC,YAAeC,YAAOC,OAAAH,IAAA,eAAAA,EAAAI,YAAAC,IAC5C,CAGA,SAAAC,EAAAC,GACE,IAAKC,OAAOC,cAAcF,IAAMA,EAAI,EAAA,MAAA,IAAAG,MAAA,kCAAAH,EACtC,CAGM,SAAUI,EAAOC,KAA8BC,GACnD,IAAKd,EAAQa,GAAI,MAAM,IAAIF,MAAM,uBACnC,GAAAG,EAAAC,OAAA,IAAAD,EAAAE,SAAAH,EAAAE,QACI,MAAM,IAAIJ,MAAM,iCAAWG,EAAA,gBAAAD,EAAAE,OAC/B,CAWM,SAAUE,EAAQC,EAAeC,GAAgB,GACvD,GAAAD,EAAAE,UAAA,MAAA,IAAAT,MAAA,oCACE,GAAIQ,GAAiBD,EAASG,SAAU,MAAM,IAACV,MAAA,wCACjD,CAGM,SAAUW,EAAQC,EAAEL,GACxBN,EAAOW,GACP,MAAEC,EAAAN,EAAAO,UACJ,GAAAF,EAAAR,OAAAS,EACI,MAAM,IAAIb,MAAM,yDAAYa,EAEhC,CAkBM,SAAUE,KAASC,GACzB,IAAA,IAAAC,EAAA,EAAAA,EAAAD,EAAAZ,OAAAa,IACID,EAAOC,GAAGC,KAAK,EAEnB,CAGM,SAAUC,EAAWC,GACzB,OAAO,IAAIC,SAASD,EAAIE,OAAQF,EAAIG,WAAEH,EAAAI,WACxC,CAGM,SAAUC,EAAKC,EAAWC,GAC9B,OAAQD,GAAS,GAAKC,EAAOD,IAAAC,CAC/B,CAkIM,SAASC,EAAAC,GACf,GAAA,iBAAAA,EAAA,MAAA,IAAA7B,MAAA,mBACE,OAAO,IAAIT,YAAW,IAAIuC,aAAcC,OAAAF,GAC1C,CAiBM,SAAUG,EAAQC,GAGxB,MAFsB,iBAATA,IAAmBA,EAAOL,EAASK,IAC9ChC,EAAOgC,GACTA,CACA","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../../node_modules/@noble/hashes/esm/utils.js"],"sourcesContent":["/**\n * Utilities for hex, bytes, CSPRNG.\n * @module\n */\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\nexport function isBytes(a) {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n/** Asserts something is positive integer. */\nexport function anumber(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error('positive integer expected, got ' + n);\n}\n/** Asserts something is Uint8Array. */\nexport function abytes(b, ...lengths) {\n if (!isBytes(b))\n throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\n/** Asserts something is hash */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash should be wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n}\n/** Asserts a hash instance has not been destroyed / finished */\nexport function aexists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\n/** Asserts output is properly-sized byte array */\nexport function aoutput(out, instance) {\n abytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error('digestInto() expects output buffer of length at least ' + min);\n }\n}\n/** Cast u8 / u16 / u32 to u8. */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** Cast u8 / u16 / u32 to u32. */\nexport function u32(arr) {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/** Zeroize a byte array. Warning: JS provides no guarantees. */\nexport function clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n/** Create DataView of an array for easy byte-level manipulation. */\nexport function createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** The rotate right (circular right shift) operation for uint32 */\nexport function rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/** The rotate left (circular left shift) operation for uint32 */\nexport function rotl(word, shift) {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Is current platform little-endian? Most are. Big-Endian platform: IBM */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n/** The byte swap operation for uint32 */\nexport function byteSwap(word) {\n return (((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff));\n}\n/** Conditionally byte swap if on a big-endian platform */\nexport const swap8IfBE = isLE\n ? (n) => n\n : (n) => byteSwap(n);\n/** @deprecated */\nexport const byteSwapIfBE = swap8IfBE;\n/** In place byte swap for Uint32Array */\nexport function byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\nexport const swap32IfBE = isLE\n ? (u) => u\n : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \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/**\n * There is no setImmediate in browser and setTimeout is slow.\n * Call of async fn will return Promise, which will be fullfiled only on\n * next scheduler queue processing step and this is exactly what we need.\n */\nexport const nextTick = async () => { };\n/** Returns control to thread each 'tick' ms to avoid blocking. */\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * @example utf8ToBytes('abc') // Uint8Array.from([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/**\n * Converts bytes to string using UTF8 encoding.\n * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc'\n */\nexport function bytesToUtf8(bytes) {\n return new TextDecoder().decode(bytes);\n}\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n/**\n * Helper for KDFs: consumes uint8array or string.\n * When string is passed, does utf8 decoding, using TextDecoder.\n */\nexport function kdfInputToBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n/** Copies several Uint8Arrays into one. */\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}\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n throw new Error('options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\n/** For runtime check if class implements interface */\nexport class Hash {\n}\n/** Wraps hash function, creating an interface on top of it */\nexport function createHasher(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexport function createOptHasher(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexport function createXOFer(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexport const wrapConstructor = createHasher;\nexport const wrapConstructorWithOpts = createOptHasher;\nexport const wrapXOFConstructorWithOpts = createXOFer;\n/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */\nexport function randomBytes(bytesLength = 32) {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n // Legacy Node.js compatibility\n if (crypto && typeof crypto.randomBytes === 'function') {\n return Uint8Array.from(crypto.randomBytes(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.js.map"],"names":["isBytes","a","Uint8Array","ArrayBuffer","isView","constructor","name","anumber","n","Number","isSafeInteger","Error","abytes","b","lengths","length","includes","aexists","instance","checkFinished","destroyed","finished","aoutput","out","min","outputLen","clean","arrays","i","fill","createView","arr","DataView","buffer","byteOffset","byteLength","rotr","word","shift","hasHexBuiltin","from","toHex","fromHex","hexes","Array","_","toString","padStart","bytesToHex","bytes","hex","asciis","asciiToBase16","ch","hexToBytes","hl","al","array","ai","hi","n1","charCodeAt","n2","undefined","char","utf8ToBytes","str","TextEncoder","encode","toBytes","data","concatBytes","sum","res","pad","set"],"mappings":";;AAeA,SAAAA,EAAAC,GACE,OAAOA,aAAaC,YAAeC,YAAOC,OAAAH,IAAA,eAAAA,EAAAI,YAAAC,IAC5C,CAGA,SAAAC,EAAAC,GACE,IAAKC,OAAOC,cAAcF,IAAMA,EAAI,EAAA,MAAA,IAAAG,MAAA,kCAAAH,EACtC,CAGM,SAAUI,EAAOC,KAA8BC,GACnD,IAAKd,EAAQa,GAAI,MAAM,IAAIF,MAAM,uBACnC,GAAAG,EAAAC,OAAA,IAAAD,EAAAE,SAAAH,EAAAE,QACI,MAAM,IAAIJ,MAAM,iCAAWG,EAAA,gBAAAD,EAAAE,OAC/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AO0D,CACT","x_google_ignoreList":[0]}
@@ -1,3 +1,3 @@
1
1
  /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
2
- function r(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name}function e(r,e){return!!Array.isArray(e)&&(0===e.length||(r?e.every((r=>"string"==typeof r)):e.every((r=>Number.isSafeInteger(r)))))}function o(r,e){if("string"!=typeof e)throw new Error(`${r}: string expected`);return!0}function n(r){if(!Number.isSafeInteger(r))throw new Error(`invalid integer: ${r}`)}function t(r){if(!Array.isArray(r))throw new Error("array expected")}function i(r,o){if(!e(!0,o))throw new Error(`${r}: array of strings expected`)}function c(r,o){if(!e(!1,o))throw new Error(`${r}: array of numbers expected`)}const d=(r,e)=>0===e?r:d(e,r%e),f=(r,e)=>r+(e-d(r,e)),a=(()=>{let r=[];for(let e=0;e<40;e++)r.push(2**e);return r})();function s(r,e,o,i){if(t(r),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(o<=0||o>32)throw new Error(`convertRadix2: wrong to=${o}`);if(f(e,o)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${o} carryBits=${f(e,o)}`);let c=0,d=0;const s=a[e],w=a[o]-1,u=[];for(const t of r){if(n(t),t>=s)throw new Error(`convertRadix2: invalid data word=${t} from=${e}`);if(c=c<<e|t,d+e>32)throw new Error(`convertRadix2: carry overflow pos=${d} from=${e}`);for(d+=e;d>=o;d-=o)u.push((c>>d-o&w)>>>0);const r=a[d];if(void 0===r)throw new Error("invalid carry");c&=r-1}if(c=c<<o-d&w,!i&&d>=e)throw new Error("Excess padding");if(!i&&c>0)throw new Error(`Non-zero padding: ${c}`);return i&&d>0&&u.push(c>>>0),u}function w(r){return function(r){if("function"!=typeof r)throw new Error("function expected")}(r),function(...e){try{return r.apply(null,e)}catch(r){}}}const u=function(...r){const e=r=>r,o=(r,e)=>o=>r(e(o));return{encode:r.map((r=>r.encode)).reduceRight(o,e),decode:r.map((r=>r.decode)).reduce(o,e)}}(function(r){const e="string"==typeof r?r.split(""):r,n=e.length;i("alphabet",e);const c=new Map(e.map(((r,e)=>[r,e])));return{encode:o=>(t(o),o.map((o=>{if(!Number.isSafeInteger(o)||o<0||o>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${o}". Allowed: ${r}`);return e[o]}))),decode:e=>(t(e),e.map((e=>{o("alphabet.decode",e);const n=c.get(e);if(void 0===n)throw new Error(`Unknown letter: "${e}". Allowed: ${r}`);return n})))}}("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),function(r=""){return o("join",r),{encode:e=>(i("join.decode",e),e.join(r)),decode:e=>(o("join.decode",e),e.split(r))}}("")),h=[996825010,642813549,513874426,1027748829,705979059];function l(r){const e=r>>25;let o=(33554431&r)<<5;for(let r=0;r<h.length;r++)1==(e>>r&1)&&(o^=h[r]);return o}function p(r,e,o=1){const n=r.length;let t=1;for(let e=0;e<n;e++){const o=r.charCodeAt(e);if(o<33||o>126)throw new Error(`Invalid prefix (${r})`);t=l(t)^o>>5}t=l(t);for(let e=0;e<n;e++)t=l(t)^31&r.charCodeAt(e);for(let r of e)t=l(t)^r;for(let r=0;r<6;r++)t=l(t);return t^=o,u.encode(s([t%a[30]],30,5,!1))}const y=function(e){const t="bech32"===e?1:734539939,i=function(e,o=!1){if(n(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(f(8,e)>32||f(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!r(n))throw new Error("radix2.encode input should be Uint8Array");return s(Array.from(n),8,e,!o)},decode:r=>(c("radix2.decode",r),Uint8Array.from(s(r,e,8,o)))}}(5),d=i.decode,a=i.encode,h=w(d);function l(e,n,i=90){o("bech32.encode prefix",e),r(n)&&(n=Array.from(n)),c("bech32.encode",n);const d=e.length;if(0===d)throw new TypeError(`Invalid prefix length ${d}`);const f=d+7+n.length;if(!1!==i&&f>i)throw new TypeError(`Length ${f} exceeds limit ${i}`);const a=e.toLowerCase(),s=p(a,n,t);return`${a}1${u.encode(n)}${s}`}function y(r,e=90){o("bech32.decode input",r);const n=r.length;if(n<8||!1!==e&&n>e)throw new TypeError(`invalid string length: ${n} (${r}). Expected (8..${e})`);const i=r.toLowerCase();if(r!==i&&r!==r.toUpperCase())throw new Error("String must be lowercase or uppercase");const c=i.lastIndexOf("1");if(0===c||-1===c)throw new Error('Letter "1" must be present between prefix and data only');const d=i.slice(0,c),f=i.slice(c+1);if(f.length<6)throw new Error("Data must be at least 6 characters long");const a=u.decode(f).slice(0,-6),s=p(d,a,t);if(!f.endsWith(s))throw new Error(`Invalid checksum in ${r}: expected "${s}"`);return{prefix:d,words:a}}return{encode:l,decode:y,encodeFromBytes:function(r,e){return l(r,a(e))},decodeToBytes:function(r){const{prefix:e,words:o}=y(r,!1);return{prefix:e,words:o,bytes:d(o)}},decodeUnsafe:w(y),fromWords:d,fromWordsUnsafe:h,toWords:a}}("bech32");export{y as bech32};
2
+ function r(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name}function e(r,e){return!!Array.isArray(e)&&(0===e.length||(r?e.every(r=>"string"==typeof r):e.every(r=>Number.isSafeInteger(r))))}function o(r,e){if("string"!=typeof e)throw new Error(`${r}: string expected`);return!0}function n(r){if(!Number.isSafeInteger(r))throw new Error(`invalid integer: ${r}`)}function t(r){if(!Array.isArray(r))throw new Error("array expected")}function i(r,o){if(!e(!0,o))throw new Error(`${r}: array of strings expected`)}function c(r,o){if(!e(!1,o))throw new Error(`${r}: array of numbers expected`)}const d=(r,e)=>0===e?r:d(e,r%e),f=(r,e)=>r+(e-d(r,e)),a=(()=>{let r=[];for(let e=0;e<40;e++)r.push(2**e);return r})();function s(r,e,o,i){if(t(r),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(o<=0||o>32)throw new Error(`convertRadix2: wrong to=${o}`);if(f(e,o)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${o} carryBits=${f(e,o)}`);let c=0,d=0;const s=a[e],w=a[o]-1,u=[];for(const t of r){if(n(t),t>=s)throw new Error(`convertRadix2: invalid data word=${t} from=${e}`);if(c=c<<e|t,d+e>32)throw new Error(`convertRadix2: carry overflow pos=${d} from=${e}`);for(d+=e;d>=o;d-=o)u.push((c>>d-o&w)>>>0);const r=a[d];if(void 0===r)throw new Error("invalid carry");c&=r-1}if(c=c<<o-d&w,!i&&d>=e)throw new Error("Excess padding");if(!i&&c>0)throw new Error(`Non-zero padding: ${c}`);return i&&d>0&&u.push(c>>>0),u}function w(r){return function(r){if("function"!=typeof r)throw new Error("function expected")}(r),function(...e){try{return r.apply(null,e)}catch(r){}}}const u=function(...r){const e=r=>r,o=(r,e)=>o=>r(e(o));return{encode:r.map(r=>r.encode).reduceRight(o,e),decode:r.map(r=>r.decode).reduce(o,e)}}(function(r){const e="string"==typeof r?r.split(""):r,n=e.length;i("alphabet",e);const c=new Map(e.map((r,e)=>[r,e]));return{encode:o=>(t(o),o.map(o=>{if(!Number.isSafeInteger(o)||o<0||o>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${o}". Allowed: ${r}`);return e[o]})),decode:e=>(t(e),e.map(e=>{o("alphabet.decode",e);const n=c.get(e);if(void 0===n)throw new Error(`Unknown letter: "${e}". Allowed: ${r}`);return n}))}}("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),function(r=""){return o("join",r),{encode:e=>(i("join.decode",e),e.join(r)),decode:e=>(o("join.decode",e),e.split(r))}}("")),h=[996825010,642813549,513874426,1027748829,705979059];function l(r){const e=r>>25;let o=(33554431&r)<<5;for(let r=0;r<h.length;r++)1==(e>>r&1)&&(o^=h[r]);return o}function p(r,e,o=1){const n=r.length;let t=1;for(let e=0;e<n;e++){const o=r.charCodeAt(e);if(o<33||o>126)throw new Error(`Invalid prefix (${r})`);t=l(t)^o>>5}t=l(t);for(let e=0;e<n;e++)t=l(t)^31&r.charCodeAt(e);for(let r of e)t=l(t)^r;for(let r=0;r<6;r++)t=l(t);return t^=o,u.encode(s([t%a[30]],30,5,!1))}const y=function(e){const t="bech32"===e?1:734539939,i=function(e,o=!1){if(n(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(f(8,e)>32||f(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!r(n))throw new Error("radix2.encode input should be Uint8Array");return s(Array.from(n),8,e,!o)},decode:r=>(c("radix2.decode",r),Uint8Array.from(s(r,e,8,o)))}}(5),d=i.decode,a=i.encode,h=w(d);function l(e,n,i=90){o("bech32.encode prefix",e),r(n)&&(n=Array.from(n)),c("bech32.encode",n);const d=e.length;if(0===d)throw new TypeError(`Invalid prefix length ${d}`);const f=d+7+n.length;if(!1!==i&&f>i)throw new TypeError(`Length ${f} exceeds limit ${i}`);const a=e.toLowerCase(),s=p(a,n,t);return`${a}1${u.encode(n)}${s}`}function y(r,e=90){o("bech32.decode input",r);const n=r.length;if(n<8||!1!==e&&n>e)throw new TypeError(`invalid string length: ${n} (${r}). Expected (8..${e})`);const i=r.toLowerCase();if(r!==i&&r!==r.toUpperCase())throw new Error("String must be lowercase or uppercase");const c=i.lastIndexOf("1");if(0===c||-1===c)throw new Error('Letter "1" must be present between prefix and data only');const d=i.slice(0,c),f=i.slice(c+1);if(f.length<6)throw new Error("Data must be at least 6 characters long");const a=u.decode(f).slice(0,-6),s=p(d,a,t);if(!f.endsWith(s))throw new Error(`Invalid checksum in ${r}: expected "${s}"`);return{prefix:d,words:a}}return{encode:l,decode:y,encodeFromBytes:function(r,e){return l(r,a(e))},decodeToBytes:function(r){const{prefix:e,words:o}=y(r,!1);return{prefix:e,words:o,bytes:d(o)}},decodeUnsafe:w(y),fromWords:d,fromWordsUnsafe:h,toWords:a}}("bech32");export{y as bech32};
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../node_modules/@scure/base/lib/esm/index.js"],"sourcesContent":["/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nfunction isBytes(a) {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n/** Asserts something is Uint8Array. */\nfunction abytes(b, ...lengths) {\n if (!isBytes(b))\n throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\nfunction isArrayOf(isString, arr) {\n if (!Array.isArray(arr))\n return false;\n if (arr.length === 0)\n return true;\n if (isString) {\n return arr.every((item) => typeof item === 'string');\n }\n else {\n return arr.every((item) => Number.isSafeInteger(item));\n }\n}\n// no abytes: seems to have 10% slowdown. Why?!\nfunction afn(input) {\n if (typeof input !== 'function')\n throw new Error('function expected');\n return true;\n}\nfunction astr(label, input) {\n if (typeof input !== 'string')\n throw new Error(`${label}: string expected`);\n return true;\n}\nfunction anumber(n) {\n if (!Number.isSafeInteger(n))\n throw new Error(`invalid integer: ${n}`);\n}\nfunction aArr(input) {\n if (!Array.isArray(input))\n throw new Error('array expected');\n}\nfunction astrArr(label, input) {\n if (!isArrayOf(true, input))\n throw new Error(`${label}: array of strings expected`);\n}\nfunction anumArr(label, input) {\n if (!isArrayOf(false, input))\n throw new Error(`${label}: array of numbers expected`);\n}\n/**\n * @__NO_SIDE_EFFECTS__\n */\nfunction chain(...args) {\n const id = (a) => a;\n // Wrap call in closure so JIT can inline calls\n const wrap = (a, b) => (c) => a(b(c));\n // Construct chain of args[-1].encode(args[-2].encode([...]))\n const encode = args.map((x) => x.encode).reduceRight(wrap, id);\n // Construct chain of args[0].decode(args[1].decode(...))\n const decode = args.map((x) => x.decode).reduce(wrap, id);\n return { encode, decode };\n}\n/**\n * Encodes integer radix representation to array of strings using alphabet and back.\n * Could also be array of strings.\n * @__NO_SIDE_EFFECTS__\n */\nfunction alphabet(letters) {\n // mapping 1 to \"b\"\n const lettersA = typeof letters === 'string' ? letters.split('') : letters;\n const len = lettersA.length;\n astrArr('alphabet', lettersA);\n // mapping \"b\" to 1\n const indexes = new Map(lettersA.map((l, i) => [l, i]));\n return {\n encode: (digits) => {\n aArr(digits);\n return digits.map((i) => {\n if (!Number.isSafeInteger(i) || i < 0 || i >= len)\n throw new Error(`alphabet.encode: digit index outside alphabet \"${i}\". Allowed: ${letters}`);\n return lettersA[i];\n });\n },\n decode: (input) => {\n aArr(input);\n return input.map((letter) => {\n astr('alphabet.decode', letter);\n const i = indexes.get(letter);\n if (i === undefined)\n throw new Error(`Unknown letter: \"${letter}\". Allowed: ${letters}`);\n return i;\n });\n },\n };\n}\n/**\n * @__NO_SIDE_EFFECTS__\n */\nfunction join(separator = '') {\n astr('join', separator);\n return {\n encode: (from) => {\n astrArr('join.decode', from);\n return from.join(separator);\n },\n decode: (to) => {\n astr('join.decode', to);\n return to.split(separator);\n },\n };\n}\n/**\n * Pad strings array so it has integer number of bits\n * @__NO_SIDE_EFFECTS__\n */\nfunction padding(bits, chr = '=') {\n anumber(bits);\n astr('padding', chr);\n return {\n encode(data) {\n astrArr('padding.encode', data);\n while ((data.length * bits) % 8)\n data.push(chr);\n return data;\n },\n decode(input) {\n astrArr('padding.decode', input);\n let end = input.length;\n if ((end * bits) % 8)\n throw new Error('padding: invalid, string should have whole number of bytes');\n for (; end > 0 && input[end - 1] === chr; end--) {\n const last = end - 1;\n const byte = last * bits;\n if (byte % 8 === 0)\n throw new Error('padding: invalid, string has too much padding');\n }\n return input.slice(0, end);\n },\n };\n}\n/**\n * @__NO_SIDE_EFFECTS__\n */\nfunction normalize(fn) {\n afn(fn);\n return { encode: (from) => from, decode: (to) => fn(to) };\n}\n/**\n * Slow: O(n^2) time complexity\n */\nfunction convertRadix(data, from, to) {\n // base 1 is impossible\n if (from < 2)\n throw new Error(`convertRadix: invalid from=${from}, base cannot be less than 2`);\n if (to < 2)\n throw new Error(`convertRadix: invalid to=${to}, base cannot be less than 2`);\n aArr(data);\n if (!data.length)\n return [];\n let pos = 0;\n const res = [];\n const digits = Array.from(data, (d) => {\n anumber(d);\n if (d < 0 || d >= from)\n throw new Error(`invalid integer: ${d}`);\n return d;\n });\n const dlen = digits.length;\n while (true) {\n let carry = 0;\n let done = true;\n for (let i = pos; i < dlen; i++) {\n const digit = digits[i];\n const fromCarry = from * carry;\n const digitBase = fromCarry + digit;\n if (!Number.isSafeInteger(digitBase) ||\n fromCarry / from !== carry ||\n digitBase - digit !== fromCarry) {\n throw new Error('convertRadix: carry overflow');\n }\n const div = digitBase / to;\n carry = digitBase % to;\n const rounded = Math.floor(div);\n digits[i] = rounded;\n if (!Number.isSafeInteger(rounded) || rounded * to + carry !== digitBase)\n throw new Error('convertRadix: carry overflow');\n if (!done)\n continue;\n else if (!rounded)\n pos = i;\n else\n done = false;\n }\n res.push(carry);\n if (done)\n break;\n }\n for (let i = 0; i < data.length - 1 && data[i] === 0; i++)\n res.push(0);\n return res.reverse();\n}\nconst gcd = (a, b) => (b === 0 ? a : gcd(b, a % b));\nconst radix2carry = /* @__NO_SIDE_EFFECTS__ */ (from, to) => from + (to - gcd(from, to));\nconst powers = /* @__PURE__ */ (() => {\n let res = [];\n for (let i = 0; i < 40; i++)\n res.push(2 ** i);\n return res;\n})();\n/**\n * Implemented with numbers, because BigInt is 5x slower\n */\nfunction convertRadix2(data, from, to, padding) {\n aArr(data);\n if (from <= 0 || from > 32)\n throw new Error(`convertRadix2: wrong from=${from}`);\n if (to <= 0 || to > 32)\n throw new Error(`convertRadix2: wrong to=${to}`);\n if (radix2carry(from, to) > 32) {\n throw new Error(`convertRadix2: carry overflow from=${from} to=${to} carryBits=${radix2carry(from, to)}`);\n }\n let carry = 0;\n let pos = 0; // bitwise position in current element\n const max = powers[from];\n const mask = powers[to] - 1;\n const res = [];\n for (const n of data) {\n anumber(n);\n if (n >= max)\n throw new Error(`convertRadix2: invalid data word=${n} from=${from}`);\n carry = (carry << from) | n;\n if (pos + from > 32)\n throw new Error(`convertRadix2: carry overflow pos=${pos} from=${from}`);\n pos += from;\n for (; pos >= to; pos -= to)\n res.push(((carry >> (pos - to)) & mask) >>> 0);\n const pow = powers[pos];\n if (pow === undefined)\n throw new Error('invalid carry');\n carry &= pow - 1; // clean carry, otherwise it will cause overflow\n }\n carry = (carry << (to - pos)) & mask;\n if (!padding && pos >= from)\n throw new Error('Excess padding');\n if (!padding && carry > 0)\n throw new Error(`Non-zero padding: ${carry}`);\n if (padding && pos > 0)\n res.push(carry >>> 0);\n return res;\n}\n/**\n * @__NO_SIDE_EFFECTS__\n */\nfunction radix(num) {\n anumber(num);\n const _256 = 2 ** 8;\n return {\n encode: (bytes) => {\n if (!isBytes(bytes))\n throw new Error('radix.encode input should be Uint8Array');\n return convertRadix(Array.from(bytes), _256, num);\n },\n decode: (digits) => {\n anumArr('radix.decode', digits);\n return Uint8Array.from(convertRadix(digits, num, _256));\n },\n };\n}\n/**\n * If both bases are power of same number (like `2**8 <-> 2**64`),\n * there is a linear algorithm. For now we have implementation for power-of-two bases only.\n * @__NO_SIDE_EFFECTS__\n */\nfunction radix2(bits, revPadding = false) {\n anumber(bits);\n if (bits <= 0 || bits > 32)\n throw new Error('radix2: bits should be in (0..32]');\n if (radix2carry(8, bits) > 32 || radix2carry(bits, 8) > 32)\n throw new Error('radix2: carry overflow');\n return {\n encode: (bytes) => {\n if (!isBytes(bytes))\n throw new Error('radix2.encode input should be Uint8Array');\n return convertRadix2(Array.from(bytes), 8, bits, !revPadding);\n },\n decode: (digits) => {\n anumArr('radix2.decode', digits);\n return Uint8Array.from(convertRadix2(digits, bits, 8, revPadding));\n },\n };\n}\nfunction unsafeWrapper(fn) {\n afn(fn);\n return function (...args) {\n try {\n return fn.apply(null, args);\n }\n catch (e) { }\n };\n}\nfunction checksum(len, fn) {\n anumber(len);\n afn(fn);\n return {\n encode(data) {\n if (!isBytes(data))\n throw new Error('checksum.encode: input should be Uint8Array');\n const sum = fn(data).slice(0, len);\n const res = new Uint8Array(data.length + len);\n res.set(data);\n res.set(sum, data.length);\n return res;\n },\n decode(data) {\n if (!isBytes(data))\n throw new Error('checksum.decode: input should be Uint8Array');\n const payload = data.slice(0, -len);\n const oldChecksum = data.slice(-len);\n const newChecksum = fn(payload).slice(0, len);\n for (let i = 0; i < len; i++)\n if (newChecksum[i] !== oldChecksum[i])\n throw new Error('Invalid checksum');\n return payload;\n },\n };\n}\n// prettier-ignore\nexport const utils = {\n alphabet, chain, checksum, convertRadix, convertRadix2, radix, radix2, join, padding,\n};\n// RFC 4648 aka RFC 3548\n// ---------------------\n/**\n * base16 encoding from RFC 4648.\n * @example\n * ```js\n * base16.encode(Uint8Array.from([0x12, 0xab]));\n * // => '12AB'\n * ```\n */\nexport const base16 = chain(radix2(4), alphabet('0123456789ABCDEF'), join(''));\n/**\n * base32 encoding from RFC 4648. Has padding.\n * Use `base32nopad` for unpadded version.\n * Also check out `base32hex`, `base32hexnopad`, `base32crockford`.\n * @example\n * ```js\n * base32.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'CKVQ===='\n * base32.decode('CKVQ====');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base32 = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), padding(5), join(''));\n/**\n * base32 encoding from RFC 4648. No padding.\n * Use `base32` for padded version.\n * Also check out `base32hex`, `base32hexnopad`, `base32crockford`.\n * @example\n * ```js\n * base32nopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'CKVQ'\n * base32nopad.decode('CKVQ');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base32nopad = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), join(''));\n/**\n * base32 encoding from RFC 4648. Padded. Compared to ordinary `base32`, slightly different alphabet.\n * Use `base32hexnopad` for unpadded version.\n * @example\n * ```js\n * base32hex.encode(Uint8Array.from([0x12, 0xab]));\n * // => '2ALG===='\n * base32hex.decode('2ALG====');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base32hex = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), padding(5), join(''));\n/**\n * base32 encoding from RFC 4648. No padding. Compared to ordinary `base32`, slightly different alphabet.\n * Use `base32hex` for padded version.\n * @example\n * ```js\n * base32hexnopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => '2ALG'\n * base32hexnopad.decode('2ALG');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base32hexnopad = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), join(''));\n/**\n * base32 encoding from RFC 4648. Doug Crockford's version.\n * https://www.crockford.com/base32.html\n * @example\n * ```js\n * base32crockford.encode(Uint8Array.from([0x12, 0xab]));\n * // => '2ANG'\n * base32crockford.decode('2ANG');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base32crockford = chain(radix2(5), alphabet('0123456789ABCDEFGHJKMNPQRSTVWXYZ'), join(''), normalize((s) => s.toUpperCase().replace(/O/g, '0').replace(/[IL]/g, '1')));\n// Built-in base64 conversion https://caniuse.com/mdn-javascript_builtins_uint8array_frombase64\n// TODO: temporarily set to false, trying to understand bugs\n// prettier-ignore\nconst hasBase64Builtin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toBase64 === 'function' &&\n typeof Uint8Array.fromBase64 === 'function')();\n/**\n * base64 from RFC 4648. Padded.\n * Use `base64nopad` for unpadded version.\n * Also check out `base64url`, `base64urlnopad`.\n * Falls back to built-in function, when available.\n * @example\n * ```js\n * base64.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs='\n * base64.decode('Eqs=');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\n// prettier-ignore\nexport const base64 = hasBase64Builtin ? {\n encode(b) { abytes(b); return b.toBase64(); },\n decode(s) {\n astr('base64', s);\n return Uint8Array.fromBase64(s, { lastChunkHandling: 'strict' });\n },\n} : chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), padding(6), join(''));\n/**\n * base64 from RFC 4648. No padding.\n * Use `base64` for padded version.\n * @example\n * ```js\n * base64nopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs'\n * base64nopad.decode('Eqs');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base64nopad = chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), join(''));\n/**\n * base64 from RFC 4648, using URL-safe alphabet. Padded.\n * Use `base64urlnopad` for unpadded version.\n * Falls back to built-in function, when available.\n * @example\n * ```js\n * base64url.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs='\n * base64url.decode('Eqs=');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\n// prettier-ignore\nexport const base64url = hasBase64Builtin ? {\n encode(b) { abytes(b); return b.toBase64({ alphabet: 'base64url' }); },\n decode(s) { astr('base64', s); return Uint8Array.fromBase64(s, { alphabet: 'base64url' }); },\n} : chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), padding(6), join(''));\n/**\n * base64 from RFC 4648, using URL-safe alphabet. No padding.\n * Use `base64url` for padded version.\n * @example\n * ```js\n * base64urlnopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs'\n * base64urlnopad.decode('Eqs');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base64urlnopad = chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), join(''));\n// base58 code\n// -----------\nconst genBase58 = /* @__NO_SIDE_EFFECTS__ */ (abc) => chain(radix(58), alphabet(abc), join(''));\n/**\n * base58: base64 without ambigous characters +, /, 0, O, I, l.\n * Quadratic (O(n^2)) - so, can't be used on large inputs.\n * @example\n * ```js\n * base58.decode('01abcdef');\n * // => '3UhJW'\n * ```\n */\nexport const base58 = genBase58('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz');\n/**\n * base58: flickr version. Check out `base58`.\n */\nexport const base58flickr = genBase58('123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ');\n/**\n * base58: XRP version. Check out `base58`.\n */\nexport const base58xrp = genBase58('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz');\n// Data len (index) -> encoded block len\nconst XMR_BLOCK_LEN = [0, 2, 3, 5, 6, 7, 9, 10, 11];\n/**\n * base58: XMR version. Check out `base58`.\n * Done in 8-byte blocks (which equals 11 chars in decoding). Last (non-full) block padded with '1' to size in XMR_BLOCK_LEN.\n * Block encoding significantly reduces quadratic complexity of base58.\n */\nexport const base58xmr = {\n encode(data) {\n let res = '';\n for (let i = 0; i < data.length; i += 8) {\n const block = data.subarray(i, i + 8);\n res += base58.encode(block).padStart(XMR_BLOCK_LEN[block.length], '1');\n }\n return res;\n },\n decode(str) {\n let res = [];\n for (let i = 0; i < str.length; i += 11) {\n const slice = str.slice(i, i + 11);\n const blockLen = XMR_BLOCK_LEN.indexOf(slice.length);\n const block = base58.decode(slice);\n for (let j = 0; j < block.length - blockLen; j++) {\n if (block[j] !== 0)\n throw new Error('base58xmr: wrong padding');\n }\n res = res.concat(Array.from(block.slice(block.length - blockLen)));\n }\n return Uint8Array.from(res);\n },\n};\n/**\n * Method, which creates base58check encoder.\n * Requires function, calculating sha256.\n */\nexport const createBase58check = (sha256) => chain(checksum(4, (data) => sha256(sha256(data))), base58);\n/**\n * Use `createBase58check` instead.\n * @deprecated\n */\nexport const base58check = createBase58check;\nconst BECH_ALPHABET = chain(alphabet('qpzry9x8gf2tvdw0s3jn54khce6mua7l'), join(''));\nconst POLYMOD_GENERATORS = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3];\nfunction bech32Polymod(pre) {\n const b = pre >> 25;\n let chk = (pre & 0x1ffffff) << 5;\n for (let i = 0; i < POLYMOD_GENERATORS.length; i++) {\n if (((b >> i) & 1) === 1)\n chk ^= POLYMOD_GENERATORS[i];\n }\n return chk;\n}\nfunction bechChecksum(prefix, words, encodingConst = 1) {\n const len = prefix.length;\n let chk = 1;\n for (let i = 0; i < len; i++) {\n const c = prefix.charCodeAt(i);\n if (c < 33 || c > 126)\n throw new Error(`Invalid prefix (${prefix})`);\n chk = bech32Polymod(chk) ^ (c >> 5);\n }\n chk = bech32Polymod(chk);\n for (let i = 0; i < len; i++)\n chk = bech32Polymod(chk) ^ (prefix.charCodeAt(i) & 0x1f);\n for (let v of words)\n chk = bech32Polymod(chk) ^ v;\n for (let i = 0; i < 6; i++)\n chk = bech32Polymod(chk);\n chk ^= encodingConst;\n return BECH_ALPHABET.encode(convertRadix2([chk % powers[30]], 30, 5, false));\n}\n/**\n * @__NO_SIDE_EFFECTS__\n */\nfunction genBech32(encoding) {\n const ENCODING_CONST = encoding === 'bech32' ? 1 : 0x2bc830a3;\n const _words = radix2(5);\n const fromWords = _words.decode;\n const toWords = _words.encode;\n const fromWordsUnsafe = unsafeWrapper(fromWords);\n function encode(prefix, words, limit = 90) {\n astr('bech32.encode prefix', prefix);\n if (isBytes(words))\n words = Array.from(words);\n anumArr('bech32.encode', words);\n const plen = prefix.length;\n if (plen === 0)\n throw new TypeError(`Invalid prefix length ${plen}`);\n const actualLength = plen + 7 + words.length;\n if (limit !== false && actualLength > limit)\n throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`);\n const lowered = prefix.toLowerCase();\n const sum = bechChecksum(lowered, words, ENCODING_CONST);\n return `${lowered}1${BECH_ALPHABET.encode(words)}${sum}`;\n }\n function decode(str, limit = 90) {\n astr('bech32.decode input', str);\n const slen = str.length;\n if (slen < 8 || (limit !== false && slen > limit))\n throw new TypeError(`invalid string length: ${slen} (${str}). Expected (8..${limit})`);\n // don't allow mixed case\n const lowered = str.toLowerCase();\n if (str !== lowered && str !== str.toUpperCase())\n throw new Error(`String must be lowercase or uppercase`);\n const sepIndex = lowered.lastIndexOf('1');\n if (sepIndex === 0 || sepIndex === -1)\n throw new Error(`Letter \"1\" must be present between prefix and data only`);\n const prefix = lowered.slice(0, sepIndex);\n const data = lowered.slice(sepIndex + 1);\n if (data.length < 6)\n throw new Error('Data must be at least 6 characters long');\n const words = BECH_ALPHABET.decode(data).slice(0, -6);\n const sum = bechChecksum(prefix, words, ENCODING_CONST);\n if (!data.endsWith(sum))\n throw new Error(`Invalid checksum in ${str}: expected \"${sum}\"`);\n return { prefix, words };\n }\n const decodeUnsafe = unsafeWrapper(decode);\n function decodeToBytes(str) {\n const { prefix, words } = decode(str, false);\n return { prefix, words, bytes: fromWords(words) };\n }\n function encodeFromBytes(prefix, bytes) {\n return encode(prefix, toWords(bytes));\n }\n return {\n encode,\n decode,\n encodeFromBytes,\n decodeToBytes,\n decodeUnsafe,\n fromWords,\n fromWordsUnsafe,\n toWords,\n };\n}\n/**\n * bech32 from BIP 173. Operates on words.\n * For high-level, check out scure-btc-signer:\n * https://github.com/paulmillr/scure-btc-signer.\n */\nexport const bech32 = genBech32('bech32');\n/**\n * bech32m from BIP 350. Operates on words.\n * It was to mitigate `bech32` weaknesses.\n * For high-level, check out scure-btc-signer:\n * https://github.com/paulmillr/scure-btc-signer.\n */\nexport const bech32m = genBech32('bech32m');\n/**\n * UTF-8-to-byte decoder. Uses built-in TextDecoder / TextEncoder.\n * @example\n * ```js\n * const b = utf8.decode(\"hey\"); // => new Uint8Array([ 104, 101, 121 ])\n * const str = utf8.encode(b); // \"hey\"\n * ```\n */\nexport const utf8 = {\n encode: (data) => new TextDecoder().decode(data),\n decode: (str) => new TextEncoder().encode(str),\n};\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\n// prettier-ignore\nconst hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === 'function' &&\n typeof Uint8Array.fromHex === 'function')();\n// prettier-ignore\nconst hexBuiltin = {\n encode(data) { abytes(data); return data.toHex(); },\n decode(s) { astr('hex', s); return Uint8Array.fromHex(s); },\n};\n/**\n * hex string decoder. Uses built-in function, when available.\n * @example\n * ```js\n * const b = hex.decode(\"0102ff\"); // => new Uint8Array([ 1, 2, 255 ])\n * const str = hex.encode(b); // \"0102ff\"\n * ```\n */\nexport const hex = hasHexBuiltin\n ? hexBuiltin\n : chain(radix2(4), alphabet('0123456789abcdef'), join(''), normalize((s) => {\n if (typeof s !== 'string' || s.length % 2 !== 0)\n throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`);\n return s.toLowerCase();\n }));\n// prettier-ignore\nconst CODERS = {\n utf8, hex, base16, base32, base64, base64url, base58, base58xmr\n};\nconst coderTypeError = 'Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr';\n/** @deprecated */\nexport const bytesToString = (type, bytes) => {\n if (typeof type !== 'string' || !CODERS.hasOwnProperty(type))\n throw new TypeError(coderTypeError);\n if (!isBytes(bytes))\n throw new TypeError('bytesToString() expects Uint8Array');\n return CODERS[type].encode(bytes);\n};\n/** @deprecated */\nexport const str = bytesToString; // as in python, but for bytes only\n/** @deprecated */\nexport const stringToBytes = (type, str) => {\n if (!CODERS.hasOwnProperty(type))\n throw new TypeError(coderTypeError);\n if (typeof str !== 'string')\n throw new TypeError('stringToBytes() expects string');\n return CODERS[type].decode(str);\n};\n/** @deprecated */\nexport const bytes = stringToBytes;\n//# sourceMappingURL=index.js.map"],"names":["isBytes","a","Uint8Array","ArrayBuffer","isView","constructor","name","isArrayOf","isString","arr","Array","isArray","length","every","item","Number","isSafeInteger","astr","label","input","Error","anumber","n","aArr","astrArr","anumArr","gcd","b","radix2carry","from","to","powers","res","i","push","convertRadix2","data","padding","carry","pos","max","mask","pow","undefined","unsafeWrapper","fn","afn","args","apply","e","BECH_ALPHABET","id","wrap","c","encode","map","x","reduceRight","decode","reduce","chain","letters","lettersA","split","len","indexes","Map","l","digits","letter","get","alphabet","separator","join","POLYMOD_GENERATORS","bech32Polymod","pre","chk","bechChecksum","prefix","words","encodingConst","charCodeAt","v","encoding","ENCODING_CONST","_words","bits","revPadding","bytes","radix2","fromWords","toWords","fromWordsUnsafe","limit","plen","TypeError","actualLength","lowered","toLowerCase"],"mappings":";AAYA,SAASA,EAAQC,GACf,OAAOA,aAAWC,YAAAC,YAAAC,OAAAH,IAAA,eAAAA,EAAAI,YAAAC,IACpB,CAQA,SAAAC,EAAAC,EAAAC,GACE,QAAKC,MAAMC,QAAQF,KACD,IAAdA,EAAIG,SACJJ,EACKC,EAAII,OAAOC,GAAsB,iBAANA,IAEtCL,EAAAI,OAAAC,GAAAC,OAAAC,cAAAF,MAEA,CASA,SAASG,EAAKC,EAAeC,GAC3B,GAAqB,iBAAVA,EAAoB,MAAM,IAAEC,MAAA,GAAAF,sBACzC,OAAA,CACA,CAEA,SAASG,EAAQC,GACjB,IAAAP,OAAAC,cAAAM,GAAA,MAAA,IAAAF,MAAA,oBAAAE,IACA,CAEA,SAASC,EAAKJ,GACd,IAAAT,MAAAC,QAAAQ,GAAA,MAAA,IAAAC,MAAA,iBACA,CACA,SAASI,EAAQN,EAAKC,GACpB,IAAAZ,GAAA,EAAAY,GAAA,MAAA,IAAAC,MAAA,GAAAF,+BACF,CACA,SAASO,EAAQP,EAAMC,GACrB,IAAKZ,GAAU,EAAOY,GAAQ,MAAM,IAAIC,MAAM,GAAEF,+BAClD,CAyKA,MAAMQ,EAAMA,CAACzB,EAAW0B,IAAO,IAAAA,EAAA1B,EAAAyB,EAAAC,EAAA1B,EAAA0B,GACzBC,EAAYA,CAAAC,EAAAC,IAChBD,GAAQC,EAAKJ,EAAIG,EAAMC,IACnBC,EAAY,MAChB,IAAIC,EAAM,GACV,IAAK,IAAIC,EAAI,EAAGA,EAAI,GAAIA,IAAKD,EAAIE,KAAK,GAAKD,GAC3C,OAAOD,CACR,EAJiB,GAQlB,SAASG,EAAcC,EAAgBP,EAAcC,EAAKO,GAExD,GADAd,EAAKa,GACDP,GAAQ,GAAKA,EAAO,GAAG,MAAA,IAA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C,EACAc,EAAa,IAEb7E,EAAK,uBAAwB8D,GACzB/E,EAAQgF,KAAQA,EAAQtE,MAAMmB,KAAKmD,IACvCvD,EAAQ,gBAAiBuD,GACzB,MAAMe,EAAOhB,EAAOnE,OACpB,GAAa,IAATmF,EAAY,MAAM,IAAIC,UAAK,yBAAAD,KAClC,MAAAE,EAAAF,EAAA,EAAAf,EAAApE,OACG,IAAa,IAATkF,GAASG,EAAAH,EACX,MAAM,IAAIE,UAAU,UAAQC,mBAAAH,KAC9B,MAAMI,EAAUnB,EAAOoB","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../node_modules/@scure/base/lib/esm/index.js"],"sourcesContent":["/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nfunction isBytes(a) {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n/** Asserts something is Uint8Array. */\nfunction abytes(b, ...lengths) {\n if (!isBytes(b))\n throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\nfunction isArrayOf(isString, arr) {\n if (!Array.isArray(arr))\n return false;\n if (arr.length === 0)\n return true;\n if (isString) {\n return arr.every((item) => typeof item === 'string');\n }\n else {\n return arr.every((item) => Number.isSafeInteger(item));\n }\n}\n// no abytes: seems to have 10% slowdown. Why?!\nfunction afn(input) {\n if (typeof input !== 'function')\n throw new Error('function expected');\n return true;\n}\nfunction astr(label, input) {\n if (typeof input !== 'string')\n throw new Error(`${label}: string expected`);\n return true;\n}\nfunction anumber(n) {\n if (!Number.isSafeInteger(n))\n throw new Error(`invalid integer: ${n}`);\n}\nfunction aArr(input) {\n if (!Array.isArray(input))\n throw new Error('array expected');\n}\nfunction astrArr(label, input) {\n if (!isArrayOf(true, input))\n throw new Error(`${label}: array of strings expected`);\n}\nfunction anumArr(label, input) {\n if (!isArrayOf(false, input))\n throw new Error(`${label}: array of numbers expected`);\n}\n/**\n * @__NO_SIDE_EFFECTS__\n */\nfunction chain(...args) {\n const id = (a) => a;\n // Wrap call in closure so JIT can inline calls\n const wrap = (a, b) => (c) => a(b(c));\n // Construct chain of args[-1].encode(args[-2].encode([...]))\n const encode = args.map((x) => x.encode).reduceRight(wrap, id);\n // Construct chain of args[0].decode(args[1].decode(...))\n const decode = args.map((x) => x.decode).reduce(wrap, id);\n return { encode, decode };\n}\n/**\n * Encodes integer radix representation to array of strings using alphabet and back.\n * Could also be array of strings.\n * @__NO_SIDE_EFFECTS__\n */\nfunction alphabet(letters) {\n // mapping 1 to \"b\"\n const lettersA = typeof letters === 'string' ? letters.split('') : letters;\n const len = lettersA.length;\n astrArr('alphabet', lettersA);\n // mapping \"b\" to 1\n const indexes = new Map(lettersA.map((l, i) => [l, i]));\n return {\n encode: (digits) => {\n aArr(digits);\n return digits.map((i) => {\n if (!Number.isSafeInteger(i) || i < 0 || i >= len)\n throw new Error(`alphabet.encode: digit index outside alphabet \"${i}\". Allowed: ${letters}`);\n return lettersA[i];\n });\n },\n decode: (input) => {\n aArr(input);\n return input.map((letter) => {\n astr('alphabet.decode', letter);\n const i = indexes.get(letter);\n if (i === undefined)\n throw new Error(`Unknown letter: \"${letter}\". Allowed: ${letters}`);\n return i;\n });\n },\n };\n}\n/**\n * @__NO_SIDE_EFFECTS__\n */\nfunction join(separator = '') {\n astr('join', separator);\n return {\n encode: (from) => {\n astrArr('join.decode', from);\n return from.join(separator);\n },\n decode: (to) => {\n astr('join.decode', to);\n return to.split(separator);\n },\n };\n}\n/**\n * Pad strings array so it has integer number of bits\n * @__NO_SIDE_EFFECTS__\n */\nfunction padding(bits, chr = '=') {\n anumber(bits);\n astr('padding', chr);\n return {\n encode(data) {\n astrArr('padding.encode', data);\n while ((data.length * bits) % 8)\n data.push(chr);\n return data;\n },\n decode(input) {\n astrArr('padding.decode', input);\n let end = input.length;\n if ((end * bits) % 8)\n throw new Error('padding: invalid, string should have whole number of bytes');\n for (; end > 0 && input[end - 1] === chr; end--) {\n const last = end - 1;\n const byte = last * bits;\n if (byte % 8 === 0)\n throw new Error('padding: invalid, string has too much padding');\n }\n return input.slice(0, end);\n },\n };\n}\n/**\n * @__NO_SIDE_EFFECTS__\n */\nfunction normalize(fn) {\n afn(fn);\n return { encode: (from) => from, decode: (to) => fn(to) };\n}\n/**\n * Slow: O(n^2) time complexity\n */\nfunction convertRadix(data, from, to) {\n // base 1 is impossible\n if (from < 2)\n throw new Error(`convertRadix: invalid from=${from}, base cannot be less than 2`);\n if (to < 2)\n throw new Error(`convertRadix: invalid to=${to}, base cannot be less than 2`);\n aArr(data);\n if (!data.length)\n return [];\n let pos = 0;\n const res = [];\n const digits = Array.from(data, (d) => {\n anumber(d);\n if (d < 0 || d >= from)\n throw new Error(`invalid integer: ${d}`);\n return d;\n });\n const dlen = digits.length;\n while (true) {\n let carry = 0;\n let done = true;\n for (let i = pos; i < dlen; i++) {\n const digit = digits[i];\n const fromCarry = from * carry;\n const digitBase = fromCarry + digit;\n if (!Number.isSafeInteger(digitBase) ||\n fromCarry / from !== carry ||\n digitBase - digit !== fromCarry) {\n throw new Error('convertRadix: carry overflow');\n }\n const div = digitBase / to;\n carry = digitBase % to;\n const rounded = Math.floor(div);\n digits[i] = rounded;\n if (!Number.isSafeInteger(rounded) || rounded * to + carry !== digitBase)\n throw new Error('convertRadix: carry overflow');\n if (!done)\n continue;\n else if (!rounded)\n pos = i;\n else\n done = false;\n }\n res.push(carry);\n if (done)\n break;\n }\n for (let i = 0; i < data.length - 1 && data[i] === 0; i++)\n res.push(0);\n return res.reverse();\n}\nconst gcd = (a, b) => (b === 0 ? a : gcd(b, a % b));\nconst radix2carry = /* @__NO_SIDE_EFFECTS__ */ (from, to) => from + (to - gcd(from, to));\nconst powers = /* @__PURE__ */ (() => {\n let res = [];\n for (let i = 0; i < 40; i++)\n res.push(2 ** i);\n return res;\n})();\n/**\n * Implemented with numbers, because BigInt is 5x slower\n */\nfunction convertRadix2(data, from, to, padding) {\n aArr(data);\n if (from <= 0 || from > 32)\n throw new Error(`convertRadix2: wrong from=${from}`);\n if (to <= 0 || to > 32)\n throw new Error(`convertRadix2: wrong to=${to}`);\n if (radix2carry(from, to) > 32) {\n throw new Error(`convertRadix2: carry overflow from=${from} to=${to} carryBits=${radix2carry(from, to)}`);\n }\n let carry = 0;\n let pos = 0; // bitwise position in current element\n const max = powers[from];\n const mask = powers[to] - 1;\n const res = [];\n for (const n of data) {\n anumber(n);\n if (n >= max)\n throw new Error(`convertRadix2: invalid data word=${n} from=${from}`);\n carry = (carry << from) | n;\n if (pos + from > 32)\n throw new Error(`convertRadix2: carry overflow pos=${pos} from=${from}`);\n pos += from;\n for (; pos >= to; pos -= to)\n res.push(((carry >> (pos - to)) & mask) >>> 0);\n const pow = powers[pos];\n if (pow === undefined)\n throw new Error('invalid carry');\n carry &= pow - 1; // clean carry, otherwise it will cause overflow\n }\n carry = (carry << (to - pos)) & mask;\n if (!padding && pos >= from)\n throw new Error('Excess padding');\n if (!padding && carry > 0)\n throw new Error(`Non-zero padding: ${carry}`);\n if (padding && pos > 0)\n res.push(carry >>> 0);\n return res;\n}\n/**\n * @__NO_SIDE_EFFECTS__\n */\nfunction radix(num) {\n anumber(num);\n const _256 = 2 ** 8;\n return {\n encode: (bytes) => {\n if (!isBytes(bytes))\n throw new Error('radix.encode input should be Uint8Array');\n return convertRadix(Array.from(bytes), _256, num);\n },\n decode: (digits) => {\n anumArr('radix.decode', digits);\n return Uint8Array.from(convertRadix(digits, num, _256));\n },\n };\n}\n/**\n * If both bases are power of same number (like `2**8 <-> 2**64`),\n * there is a linear algorithm. For now we have implementation for power-of-two bases only.\n * @__NO_SIDE_EFFECTS__\n */\nfunction radix2(bits, revPadding = false) {\n anumber(bits);\n if (bits <= 0 || bits > 32)\n throw new Error('radix2: bits should be in (0..32]');\n if (radix2carry(8, bits) > 32 || radix2carry(bits, 8) > 32)\n throw new Error('radix2: carry overflow');\n return {\n encode: (bytes) => {\n if (!isBytes(bytes))\n throw new Error('radix2.encode input should be Uint8Array');\n return convertRadix2(Array.from(bytes), 8, bits, !revPadding);\n },\n decode: (digits) => {\n anumArr('radix2.decode', digits);\n return Uint8Array.from(convertRadix2(digits, bits, 8, revPadding));\n },\n };\n}\nfunction unsafeWrapper(fn) {\n afn(fn);\n return function (...args) {\n try {\n return fn.apply(null, args);\n }\n catch (e) { }\n };\n}\nfunction checksum(len, fn) {\n anumber(len);\n afn(fn);\n return {\n encode(data) {\n if (!isBytes(data))\n throw new Error('checksum.encode: input should be Uint8Array');\n const sum = fn(data).slice(0, len);\n const res = new Uint8Array(data.length + len);\n res.set(data);\n res.set(sum, data.length);\n return res;\n },\n decode(data) {\n if (!isBytes(data))\n throw new Error('checksum.decode: input should be Uint8Array');\n const payload = data.slice(0, -len);\n const oldChecksum = data.slice(-len);\n const newChecksum = fn(payload).slice(0, len);\n for (let i = 0; i < len; i++)\n if (newChecksum[i] !== oldChecksum[i])\n throw new Error('Invalid checksum');\n return payload;\n },\n };\n}\n// prettier-ignore\nexport const utils = {\n alphabet, chain, checksum, convertRadix, convertRadix2, radix, radix2, join, padding,\n};\n// RFC 4648 aka RFC 3548\n// ---------------------\n/**\n * base16 encoding from RFC 4648.\n * @example\n * ```js\n * base16.encode(Uint8Array.from([0x12, 0xab]));\n * // => '12AB'\n * ```\n */\nexport const base16 = chain(radix2(4), alphabet('0123456789ABCDEF'), join(''));\n/**\n * base32 encoding from RFC 4648. Has padding.\n * Use `base32nopad` for unpadded version.\n * Also check out `base32hex`, `base32hexnopad`, `base32crockford`.\n * @example\n * ```js\n * base32.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'CKVQ===='\n * base32.decode('CKVQ====');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base32 = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), padding(5), join(''));\n/**\n * base32 encoding from RFC 4648. No padding.\n * Use `base32` for padded version.\n * Also check out `base32hex`, `base32hexnopad`, `base32crockford`.\n * @example\n * ```js\n * base32nopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'CKVQ'\n * base32nopad.decode('CKVQ');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base32nopad = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), join(''));\n/**\n * base32 encoding from RFC 4648. Padded. Compared to ordinary `base32`, slightly different alphabet.\n * Use `base32hexnopad` for unpadded version.\n * @example\n * ```js\n * base32hex.encode(Uint8Array.from([0x12, 0xab]));\n * // => '2ALG===='\n * base32hex.decode('2ALG====');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base32hex = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), padding(5), join(''));\n/**\n * base32 encoding from RFC 4648. No padding. Compared to ordinary `base32`, slightly different alphabet.\n * Use `base32hex` for padded version.\n * @example\n * ```js\n * base32hexnopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => '2ALG'\n * base32hexnopad.decode('2ALG');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base32hexnopad = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), join(''));\n/**\n * base32 encoding from RFC 4648. Doug Crockford's version.\n * https://www.crockford.com/base32.html\n * @example\n * ```js\n * base32crockford.encode(Uint8Array.from([0x12, 0xab]));\n * // => '2ANG'\n * base32crockford.decode('2ANG');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base32crockford = chain(radix2(5), alphabet('0123456789ABCDEFGHJKMNPQRSTVWXYZ'), join(''), normalize((s) => s.toUpperCase().replace(/O/g, '0').replace(/[IL]/g, '1')));\n// Built-in base64 conversion https://caniuse.com/mdn-javascript_builtins_uint8array_frombase64\n// prettier-ignore\nconst hasBase64Builtin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toBase64 === 'function' &&\n typeof Uint8Array.fromBase64 === 'function')();\nconst decodeBase64Builtin = (s, isUrl) => {\n astr('base64', s);\n const re = isUrl ? /^[A-Za-z0-9=_-]+$/ : /^[A-Za-z0-9=+/]+$/;\n const alphabet = isUrl ? 'base64url' : 'base64';\n if (s.length > 0 && !re.test(s))\n throw new Error('invalid base64');\n return Uint8Array.fromBase64(s, { alphabet, lastChunkHandling: 'strict' });\n};\n/**\n * base64 from RFC 4648. Padded.\n * Use `base64nopad` for unpadded version.\n * Also check out `base64url`, `base64urlnopad`.\n * Falls back to built-in function, when available.\n * @example\n * ```js\n * base64.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs='\n * base64.decode('Eqs=');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\n// prettier-ignore\nexport const base64 = hasBase64Builtin ? {\n encode(b) { abytes(b); return b.toBase64(); },\n decode(s) { return decodeBase64Builtin(s, false); },\n} : chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), padding(6), join(''));\n/**\n * base64 from RFC 4648. No padding.\n * Use `base64` for padded version.\n * @example\n * ```js\n * base64nopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs'\n * base64nopad.decode('Eqs');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base64nopad = chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), join(''));\n/**\n * base64 from RFC 4648, using URL-safe alphabet. Padded.\n * Use `base64urlnopad` for unpadded version.\n * Falls back to built-in function, when available.\n * @example\n * ```js\n * base64url.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs='\n * base64url.decode('Eqs=');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\n// prettier-ignore\nexport const base64url = hasBase64Builtin ? {\n encode(b) { abytes(b); return b.toBase64({ alphabet: 'base64url' }); },\n decode(s) { return decodeBase64Builtin(s, true); },\n} : chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), padding(6), join(''));\n/**\n * base64 from RFC 4648, using URL-safe alphabet. No padding.\n * Use `base64url` for padded version.\n * @example\n * ```js\n * base64urlnopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs'\n * base64urlnopad.decode('Eqs');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexport const base64urlnopad = chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), join(''));\n// base58 code\n// -----------\nconst genBase58 = /* @__NO_SIDE_EFFECTS__ */ (abc) => chain(radix(58), alphabet(abc), join(''));\n/**\n * base58: base64 without ambigous characters +, /, 0, O, I, l.\n * Quadratic (O(n^2)) - so, can't be used on large inputs.\n * @example\n * ```js\n * base58.decode('01abcdef');\n * // => '3UhJW'\n * ```\n */\nexport const base58 = genBase58('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz');\n/**\n * base58: flickr version. Check out `base58`.\n */\nexport const base58flickr = genBase58('123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ');\n/**\n * base58: XRP version. Check out `base58`.\n */\nexport const base58xrp = genBase58('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz');\n// Data len (index) -> encoded block len\nconst XMR_BLOCK_LEN = [0, 2, 3, 5, 6, 7, 9, 10, 11];\n/**\n * base58: XMR version. Check out `base58`.\n * Done in 8-byte blocks (which equals 11 chars in decoding). Last (non-full) block padded with '1' to size in XMR_BLOCK_LEN.\n * Block encoding significantly reduces quadratic complexity of base58.\n */\nexport const base58xmr = {\n encode(data) {\n let res = '';\n for (let i = 0; i < data.length; i += 8) {\n const block = data.subarray(i, i + 8);\n res += base58.encode(block).padStart(XMR_BLOCK_LEN[block.length], '1');\n }\n return res;\n },\n decode(str) {\n let res = [];\n for (let i = 0; i < str.length; i += 11) {\n const slice = str.slice(i, i + 11);\n const blockLen = XMR_BLOCK_LEN.indexOf(slice.length);\n const block = base58.decode(slice);\n for (let j = 0; j < block.length - blockLen; j++) {\n if (block[j] !== 0)\n throw new Error('base58xmr: wrong padding');\n }\n res = res.concat(Array.from(block.slice(block.length - blockLen)));\n }\n return Uint8Array.from(res);\n },\n};\n/**\n * Method, which creates base58check encoder.\n * Requires function, calculating sha256.\n */\nexport const createBase58check = (sha256) => chain(checksum(4, (data) => sha256(sha256(data))), base58);\n/**\n * Use `createBase58check` instead.\n * @deprecated\n */\nexport const base58check = createBase58check;\nconst BECH_ALPHABET = chain(alphabet('qpzry9x8gf2tvdw0s3jn54khce6mua7l'), join(''));\nconst POLYMOD_GENERATORS = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3];\nfunction bech32Polymod(pre) {\n const b = pre >> 25;\n let chk = (pre & 0x1ffffff) << 5;\n for (let i = 0; i < POLYMOD_GENERATORS.length; i++) {\n if (((b >> i) & 1) === 1)\n chk ^= POLYMOD_GENERATORS[i];\n }\n return chk;\n}\nfunction bechChecksum(prefix, words, encodingConst = 1) {\n const len = prefix.length;\n let chk = 1;\n for (let i = 0; i < len; i++) {\n const c = prefix.charCodeAt(i);\n if (c < 33 || c > 126)\n throw new Error(`Invalid prefix (${prefix})`);\n chk = bech32Polymod(chk) ^ (c >> 5);\n }\n chk = bech32Polymod(chk);\n for (let i = 0; i < len; i++)\n chk = bech32Polymod(chk) ^ (prefix.charCodeAt(i) & 0x1f);\n for (let v of words)\n chk = bech32Polymod(chk) ^ v;\n for (let i = 0; i < 6; i++)\n chk = bech32Polymod(chk);\n chk ^= encodingConst;\n return BECH_ALPHABET.encode(convertRadix2([chk % powers[30]], 30, 5, false));\n}\n/**\n * @__NO_SIDE_EFFECTS__\n */\nfunction genBech32(encoding) {\n const ENCODING_CONST = encoding === 'bech32' ? 1 : 0x2bc830a3;\n const _words = radix2(5);\n const fromWords = _words.decode;\n const toWords = _words.encode;\n const fromWordsUnsafe = unsafeWrapper(fromWords);\n function encode(prefix, words, limit = 90) {\n astr('bech32.encode prefix', prefix);\n if (isBytes(words))\n words = Array.from(words);\n anumArr('bech32.encode', words);\n const plen = prefix.length;\n if (plen === 0)\n throw new TypeError(`Invalid prefix length ${plen}`);\n const actualLength = plen + 7 + words.length;\n if (limit !== false && actualLength > limit)\n throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`);\n const lowered = prefix.toLowerCase();\n const sum = bechChecksum(lowered, words, ENCODING_CONST);\n return `${lowered}1${BECH_ALPHABET.encode(words)}${sum}`;\n }\n function decode(str, limit = 90) {\n astr('bech32.decode input', str);\n const slen = str.length;\n if (slen < 8 || (limit !== false && slen > limit))\n throw new TypeError(`invalid string length: ${slen} (${str}). Expected (8..${limit})`);\n // don't allow mixed case\n const lowered = str.toLowerCase();\n if (str !== lowered && str !== str.toUpperCase())\n throw new Error(`String must be lowercase or uppercase`);\n const sepIndex = lowered.lastIndexOf('1');\n if (sepIndex === 0 || sepIndex === -1)\n throw new Error(`Letter \"1\" must be present between prefix and data only`);\n const prefix = lowered.slice(0, sepIndex);\n const data = lowered.slice(sepIndex + 1);\n if (data.length < 6)\n throw new Error('Data must be at least 6 characters long');\n const words = BECH_ALPHABET.decode(data).slice(0, -6);\n const sum = bechChecksum(prefix, words, ENCODING_CONST);\n if (!data.endsWith(sum))\n throw new Error(`Invalid checksum in ${str}: expected \"${sum}\"`);\n return { prefix, words };\n }\n const decodeUnsafe = unsafeWrapper(decode);\n function decodeToBytes(str) {\n const { prefix, words } = decode(str, false);\n return { prefix, words, bytes: fromWords(words) };\n }\n function encodeFromBytes(prefix, bytes) {\n return encode(prefix, toWords(bytes));\n }\n return {\n encode,\n decode,\n encodeFromBytes,\n decodeToBytes,\n decodeUnsafe,\n fromWords,\n fromWordsUnsafe,\n toWords,\n };\n}\n/**\n * bech32 from BIP 173. Operates on words.\n * For high-level, check out scure-btc-signer:\n * https://github.com/paulmillr/scure-btc-signer.\n */\nexport const bech32 = genBech32('bech32');\n/**\n * bech32m from BIP 350. Operates on words.\n * It was to mitigate `bech32` weaknesses.\n * For high-level, check out scure-btc-signer:\n * https://github.com/paulmillr/scure-btc-signer.\n */\nexport const bech32m = genBech32('bech32m');\n/**\n * UTF-8-to-byte decoder. Uses built-in TextDecoder / TextEncoder.\n * @example\n * ```js\n * const b = utf8.decode(\"hey\"); // => new Uint8Array([ 104, 101, 121 ])\n * const str = utf8.encode(b); // \"hey\"\n * ```\n */\nexport const utf8 = {\n encode: (data) => new TextDecoder().decode(data),\n decode: (str) => new TextEncoder().encode(str),\n};\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\n// prettier-ignore\nconst hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === 'function' &&\n typeof Uint8Array.fromHex === 'function')();\n// prettier-ignore\nconst hexBuiltin = {\n encode(data) { abytes(data); return data.toHex(); },\n decode(s) { astr('hex', s); return Uint8Array.fromHex(s); },\n};\n/**\n * hex string decoder. Uses built-in function, when available.\n * @example\n * ```js\n * const b = hex.decode(\"0102ff\"); // => new Uint8Array([ 1, 2, 255 ])\n * const str = hex.encode(b); // \"0102ff\"\n * ```\n */\nexport const hex = hasHexBuiltin\n ? hexBuiltin\n : chain(radix2(4), alphabet('0123456789abcdef'), join(''), normalize((s) => {\n if (typeof s !== 'string' || s.length % 2 !== 0)\n throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`);\n return s.toLowerCase();\n }));\n// prettier-ignore\nconst CODERS = {\n utf8, hex, base16, base32, base64, base64url, base58, base58xmr\n};\nconst coderTypeError = 'Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr';\n/** @deprecated */\nexport const bytesToString = (type, bytes) => {\n if (typeof type !== 'string' || !CODERS.hasOwnProperty(type))\n throw new TypeError(coderTypeError);\n if (!isBytes(bytes))\n throw new TypeError('bytesToString() expects Uint8Array');\n return CODERS[type].encode(bytes);\n};\n/** @deprecated */\nexport const str = bytesToString; // as in python, but for bytes only\n/** @deprecated */\nexport const stringToBytes = (type, str) => {\n if (!CODERS.hasOwnProperty(type))\n throw new TypeError(coderTypeError);\n if (typeof str !== 'string')\n throw new TypeError('stringToBytes() expects string');\n return CODERS[type].decode(str);\n};\n/** @deprecated */\nexport const bytes = stringToBytes;\n//# sourceMappingURL=index.js.map"],"names":["isBytes","a","Uint8Array","ArrayBuffer","isView","constructor","name","isArrayOf","isString","arr","Array","isArray","length","every","item","Number","isSafeInteger","astr","label","input","Error","anumber","n","aArr","astrArr","anumArr","gcd","b","radix2carry","from","to","powers","res","i","push","convertRadix2","data","padding","carry","pos","max","mask","pow","undefined","unsafeWrapper","fn","afn","args","apply","e","BECH_ALPHABET","id","wrap","c","encode","map","x","reduceRight","decode","reduce","chain","letters","lettersA","split","len","indexes","Map","l","digits","letter","get","alphabet","separator","join","POLYMOD_GENERATORS","bech32Polymod","pre","chk","bechChecksum","prefix","words","encodingConst","charCodeAt","v","encoding","ENCODING_CONST","_words","bits","revPadding","bytes","radix2","fromWords","toWords","fromWordsUnsafe","limit","plen","TypeError","actualLength"],"mappings":";AAYA,SAASA,EAAQC,GACf,OAAOA,aAAWC,YAAAC,YAAAC,OAAAH,IAAA,eAAAA,EAAAI,YAAAC,IACpB,CAQA,SAAAC,EAAAC,EAAAC,GACE,QAAKC,MAAMC,QAAQF,KACD,IAAdA,EAAIG,SACJJ,EACKC,EAAII,MAAOC,GAAsB,iBAANA,GAEtCL,EAAAI,MAAAC,GAAAC,OAAAC,cAAAF,KAEA,CASA,SAASG,EAAKC,EAAeC,GAC3B,GAAqB,iBAAVA,EAAoB,MAAM,IAAEC,MAAA,GAAAF,sBACzC,OAAA,CACA,CAEA,SAASG,EAAQC,GACjB,IAAAP,OAAAC,cAAAM,GAAA,MAAA,IAAAF,MAAA,oBAAAE,IACA,CAEA,SAASC,EAAKJ,GACd,IAAAT,MAAAC,Q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AsBA,SAAmBqD,GACjB,MAAMC,EAA8B,WAAbD,EAAwB,EAAI,UAC7CE,EA9YR,SAAAC,EAAAC,GAAA,GAEE,GADAnE,EAAQkE,GACJA,GAAK,GAAAA,EAAA,GAAA,MAAA,IAAAnE,MAAA,qCACT,GAAIQ,EAAY,EAAG2D,GAAQ,IAAC3D,EAAA2D,EAAA,GAAA,GAC1B,MAAM,IAAEnE,MAAA,0BACV,MAAO,CACLkC,OAAImC,IACF,IAAKzF,EAAQyF,GAAC,MAAA,IAAArE,MAAA,4CACf,OAAAe,EAAAzB,MAAAmB,KAAA4D,GAAA,EAAAF,GAAAC,IAED9B,OAASU,IACP3C,EAAQ,gBAAE2C,GACLlE,WAAA2B,KAAAM,EAAAiC,EAAAmB,EAAA,EAAAC,KAGX,CA+XiBE,CAAO,GAChBC,EAAYL,EAAG5B,OACfkC,EAAUN,EAAOhC,OACjBuC,EAAkBjD,EAAW+C,GAEnC,SAASrC,EACPyB,EACAC,EACAc,EAAwB,IAExB7E,EAAK,uBAAwB8D,GACzB/E,EAAQgF,KAAQA,EAAOtE,MAAAmB,KAAAmD,IAC3BvD,EAAQ,gBAAiBuD,GACzB,MAAMe,EAAOhB,EAAOnE,OACvB,GAAA,IAAAmF,EAAA,MAAA,IAAAC,UAAA,yBAAAD,KACG,MAAME,EAAOF,EAAA,EAAAf,EAAApE,OACb,IAAc,IAAVkF,GAAmBG,EAAOH,EAC5B,MAAM,IAAIE,UAAU,UAAMC,mBAAAH","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"accountType.js","sources":["../../../../../../../../node_modules/@solana/spl-token/lib/esm/extensions/accountType.js"],"sourcesContent":["export var AccountType;\n(function (AccountType) {\n AccountType[AccountType[\"Uninitialized\"] = 0] = \"Uninitialized\";\n AccountType[AccountType[\"Mint\"] = 1] = \"Mint\";\n AccountType[AccountType[\"Account\"] = 2] = \"Account\";\n})(AccountType || (AccountType = {}));\nexport const ACCOUNT_TYPE_SIZE = 1;\n//# sourceMappingURL=accountType.js.map"],"names":["AccountType","ACCOUNT_TYPE_SIZE"],"mappings":"AAAA,IAAYA,GAAZ,SAAYA,GACRA,EAAAA,EAAa,cAAA,GAAA,gBACbA,EAAAA,EAAI,KAAA,GAAA,OACJA,EAAAA,EAAO,QAAA,GAAA,SACV,CAJD,CAAYA,IAAAA,EAAW,CAAA,IAKhB,MAAMC,EAAoB","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"accountType.js","sources":["../../../../../../../../node_modules/@solana/spl-token/lib/esm/extensions/accountType.js"],"sourcesContent":["export var AccountType;\n(function (AccountType) {\n AccountType[AccountType[\"Uninitialized\"] = 0] = \"Uninitialized\";\n AccountType[AccountType[\"Mint\"] = 1] = \"Mint\";\n AccountType[AccountType[\"Account\"] = 2] = \"Account\";\n})(AccountType || (AccountType = {}));\nexport const ACCOUNT_TYPE_SIZE = 1;\n//# sourceMappingURL=accountType.js.map"],"names":["AccountType","ACCOUNT_TYPE_SIZE"],"mappings":"AAAA,IAAYA,GAAZ,SAAYA,GACRA,EAAAA,EAAA,cAAA,GAAA,gBACAA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,QAAA,GAAA,SACH,CAJD,CAAYA,IAAAA,EAAW,CAAA,IAKhB,MAAMC,EAAoB","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sources":["../../../../../../../../node_modules/@solana/spl-token/lib/esm/state/account.js"],"sourcesContent":["import { struct, u32, u8 } from '@solana/buffer-layout';\nimport { publicKey, u64 } from '@solana/buffer-layout-utils';\nimport { TOKEN_PROGRAM_ID } from '../constants.js';\nimport { TokenAccountNotFoundError, TokenInvalidAccountError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, } from '../errors.js';\nimport { ACCOUNT_TYPE_SIZE, AccountType } from '../extensions/accountType.js';\nimport { getAccountLen } from '../extensions/extensionType.js';\nimport { MULTISIG_SIZE } from './multisig.js';\n/** Token account state as stored by the program */\nexport var AccountState;\n(function (AccountState) {\n AccountState[AccountState[\"Uninitialized\"] = 0] = \"Uninitialized\";\n AccountState[AccountState[\"Initialized\"] = 1] = \"Initialized\";\n AccountState[AccountState[\"Frozen\"] = 2] = \"Frozen\";\n})(AccountState || (AccountState = {}));\n/** Buffer layout for de/serializing a token account */\nexport const AccountLayout = struct([\n publicKey('mint'),\n publicKey('owner'),\n u64('amount'),\n u32('delegateOption'),\n publicKey('delegate'),\n u8('state'),\n u32('isNativeOption'),\n u64('isNative'),\n u64('delegatedAmount'),\n u32('closeAuthorityOption'),\n publicKey('closeAuthority'),\n]);\n/** Byte length of a token account */\nexport const ACCOUNT_SIZE = AccountLayout.span;\n/**\n * Retrieve information about a token account\n *\n * @param connection Connection to use\n * @param address Token account\n * @param commitment Desired level of commitment for querying the state\n * @param programId SPL Token program account\n *\n * @return Token account information\n */\nexport async function getAccount(connection, address, commitment, programId = TOKEN_PROGRAM_ID) {\n const info = await connection.getAccountInfo(address, commitment);\n return unpackAccount(address, info, programId);\n}\n/**\n * Retrieve information about multiple token accounts in a single RPC call\n *\n * @param connection Connection to use\n * @param addresses Token accounts\n * @param commitment Desired level of commitment for querying the state\n * @param programId SPL Token program account\n *\n * @return Token account information\n */\nexport async function getMultipleAccounts(connection, addresses, commitment, programId = TOKEN_PROGRAM_ID) {\n const infos = await connection.getMultipleAccountsInfo(addresses, commitment);\n return addresses.map((address, i) => unpackAccount(address, infos[i], programId));\n}\n/** Get the minimum lamport balance for a base token account to be rent exempt\n *\n * @param connection Connection to use\n * @param commitment Desired level of commitment for querying the state\n *\n * @return Amount of lamports required\n */\nexport async function getMinimumBalanceForRentExemptAccount(connection, commitment) {\n return await getMinimumBalanceForRentExemptAccountWithExtensions(connection, [], commitment);\n}\n/** Get the minimum lamport balance for a rent-exempt token account with extensions\n *\n * @param connection Connection to use\n * @param commitment Desired level of commitment for querying the state\n *\n * @return Amount of lamports required\n */\nexport async function getMinimumBalanceForRentExemptAccountWithExtensions(connection, extensions, commitment) {\n const accountLen = getAccountLen(extensions);\n return await connection.getMinimumBalanceForRentExemption(accountLen, commitment);\n}\n/**\n * Unpack a token account\n *\n * @param address Token account\n * @param info Token account data\n * @param programId SPL Token program account\n *\n * @return Unpacked token account\n */\nexport function unpackAccount(address, info, programId = TOKEN_PROGRAM_ID) {\n if (!info)\n throw new TokenAccountNotFoundError();\n if (!info.owner.equals(programId))\n throw new TokenInvalidAccountOwnerError();\n if (info.data.length < ACCOUNT_SIZE)\n throw new TokenInvalidAccountSizeError();\n const rawAccount = AccountLayout.decode(info.data.slice(0, ACCOUNT_SIZE));\n let tlvData = Buffer.alloc(0);\n if (info.data.length > ACCOUNT_SIZE) {\n if (info.data.length === MULTISIG_SIZE)\n throw new TokenInvalidAccountSizeError();\n if (info.data[ACCOUNT_SIZE] != AccountType.Account)\n throw new TokenInvalidAccountError();\n tlvData = info.data.slice(ACCOUNT_SIZE + ACCOUNT_TYPE_SIZE);\n }\n return {\n address,\n mint: rawAccount.mint,\n owner: rawAccount.owner,\n amount: rawAccount.amount,\n delegate: rawAccount.delegateOption ? rawAccount.delegate : null,\n delegatedAmount: rawAccount.delegatedAmount,\n isInitialized: rawAccount.state !== AccountState.Uninitialized,\n isFrozen: rawAccount.state === AccountState.Frozen,\n isNative: !!rawAccount.isNativeOption,\n rentExemptReserve: rawAccount.isNativeOption ? rawAccount.isNative : null,\n closeAuthority: rawAccount.closeAuthorityOption ? rawAccount.closeAuthority : null,\n tlvData,\n };\n}\n//# sourceMappingURL=account.js.map"],"names":["AccountState","AccountLayout","struct","publicKey","u64","u32","u8"],"mappings":"iIA6CI,IAAAA,YACHA,GACGA,EAAAA,EAAU,cAAA,GAAA,gBAHZA,EAAAA,EAID,YAAA,GAAA,cAiBDA,EAAAA,EAAuD,OAAA,GAAA,QACvD,EAAAA,IAAaA,EAAsB,CAAA,IAE/B,MAASC,EAASC,EACrBC,CAAAA,UACGA,EACAC,SAAAA,YACHC,EAAA,kBACGF,EAAoB,YACtBG,EAAA,SACED,EAAI,kBACJD,EAAI,YACJA,EAAU,mBACdC,EAAA,wBAEAF,EACA","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"account.js","sources":["../../../../../../../../node_modules/@solana/spl-token/lib/esm/state/account.js"],"sourcesContent":["import { struct, u32, u8 } from '@solana/buffer-layout';\nimport { publicKey, u64 } from '@solana/buffer-layout-utils';\nimport { TOKEN_PROGRAM_ID } from '../constants.js';\nimport { TokenAccountNotFoundError, TokenInvalidAccountError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, } from '../errors.js';\nimport { ACCOUNT_TYPE_SIZE, AccountType } from '../extensions/accountType.js';\nimport { getAccountLen } from '../extensions/extensionType.js';\nimport { MULTISIG_SIZE } from './multisig.js';\n/** Token account state as stored by the program */\nexport var AccountState;\n(function (AccountState) {\n AccountState[AccountState[\"Uninitialized\"] = 0] = \"Uninitialized\";\n AccountState[AccountState[\"Initialized\"] = 1] = \"Initialized\";\n AccountState[AccountState[\"Frozen\"] = 2] = \"Frozen\";\n})(AccountState || (AccountState = {}));\n/** Buffer layout for de/serializing a token account */\nexport const AccountLayout = struct([\n publicKey('mint'),\n publicKey('owner'),\n u64('amount'),\n u32('delegateOption'),\n publicKey('delegate'),\n u8('state'),\n u32('isNativeOption'),\n u64('isNative'),\n u64('delegatedAmount'),\n u32('closeAuthorityOption'),\n publicKey('closeAuthority'),\n]);\n/** Byte length of a token account */\nexport const ACCOUNT_SIZE = AccountLayout.span;\n/**\n * Retrieve information about a token account\n *\n * @param connection Connection to use\n * @param address Token account\n * @param commitment Desired level of commitment for querying the state\n * @param programId SPL Token program account\n *\n * @return Token account information\n */\nexport async function getAccount(connection, address, commitment, programId = TOKEN_PROGRAM_ID) {\n const info = await connection.getAccountInfo(address, commitment);\n return unpackAccount(address, info, programId);\n}\n/**\n * Retrieve information about multiple token accounts in a single RPC call\n *\n * @param connection Connection to use\n * @param addresses Token accounts\n * @param commitment Desired level of commitment for querying the state\n * @param programId SPL Token program account\n *\n * @return Token account information\n */\nexport async function getMultipleAccounts(connection, addresses, commitment, programId = TOKEN_PROGRAM_ID) {\n const infos = await connection.getMultipleAccountsInfo(addresses, commitment);\n return addresses.map((address, i) => unpackAccount(address, infos[i], programId));\n}\n/** Get the minimum lamport balance for a base token account to be rent exempt\n *\n * @param connection Connection to use\n * @param commitment Desired level of commitment for querying the state\n *\n * @return Amount of lamports required\n */\nexport async function getMinimumBalanceForRentExemptAccount(connection, commitment) {\n return await getMinimumBalanceForRentExemptAccountWithExtensions(connection, [], commitment);\n}\n/** Get the minimum lamport balance for a rent-exempt token account with extensions\n *\n * @param connection Connection to use\n * @param commitment Desired level of commitment for querying the state\n *\n * @return Amount of lamports required\n */\nexport async function getMinimumBalanceForRentExemptAccountWithExtensions(connection, extensions, commitment) {\n const accountLen = getAccountLen(extensions);\n return await connection.getMinimumBalanceForRentExemption(accountLen, commitment);\n}\n/**\n * Unpack a token account\n *\n * @param address Token account\n * @param info Token account data\n * @param programId SPL Token program account\n *\n * @return Unpacked token account\n */\nexport function unpackAccount(address, info, programId = TOKEN_PROGRAM_ID) {\n if (!info)\n throw new TokenAccountNotFoundError();\n if (!info.owner.equals(programId))\n throw new TokenInvalidAccountOwnerError();\n if (info.data.length < ACCOUNT_SIZE)\n throw new TokenInvalidAccountSizeError();\n const rawAccount = AccountLayout.decode(info.data.slice(0, ACCOUNT_SIZE));\n let tlvData = Buffer.alloc(0);\n if (info.data.length > ACCOUNT_SIZE) {\n if (info.data.length === MULTISIG_SIZE)\n throw new TokenInvalidAccountSizeError();\n if (info.data[ACCOUNT_SIZE] != AccountType.Account)\n throw new TokenInvalidAccountError();\n tlvData = info.data.slice(ACCOUNT_SIZE + ACCOUNT_TYPE_SIZE);\n }\n return {\n address,\n mint: rawAccount.mint,\n owner: rawAccount.owner,\n amount: rawAccount.amount,\n delegate: rawAccount.delegateOption ? rawAccount.delegate : null,\n delegatedAmount: rawAccount.delegatedAmount,\n isInitialized: rawAccount.state !== AccountState.Uninitialized,\n isFrozen: rawAccount.state === AccountState.Frozen,\n isNative: !!rawAccount.isNativeOption,\n rentExemptReserve: rawAccount.isNativeOption ? rawAccount.isNative : null,\n closeAuthority: rawAccount.closeAuthorityOption ? rawAccount.closeAuthority : null,\n tlvData,\n };\n}\n//# sourceMappingURL=account.js.map"],"names":["AccountState","AccountLayout","struct","publicKey","u64","u32","u8"],"mappings":"iIA6CI,IAAAA,YACHA,GACGA,EAAAA,EAAA,cAAA,GAAA,gBAHFA,EAAAA,EAID,YAAA,GAAA,cAiBDA,EAAAA,EAAA,OAAA,GAAA,QACA,EAAAA,IAAaA,EAAsB,CAAA,IAE/B,MAASC,EAASC,EAAA,CACrBC,UACGA,EAAI,SACJC,YACHC,EAAA,kBACGF,EAAI,YACNG,EAAA,SACED,EAAI,kBACJD,EAAI,YACJA,EAAA,mBACJC,EAAA,wBAEAF,EAAA","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"mint.js","sources":["../../../../../../../../node_modules/@solana/spl-token/lib/esm/state/mint.js"],"sourcesContent":["import { struct, u32, u8 } from '@solana/buffer-layout';\nimport { bool, publicKey, u64 } from '@solana/buffer-layout-utils';\nimport { PublicKey } from '@solana/web3.js';\nimport { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from '../constants.js';\nimport { TokenAccountNotFoundError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, TokenInvalidMintError, TokenOwnerOffCurveError, } from '../errors.js';\nimport { ACCOUNT_TYPE_SIZE, AccountType } from '../extensions/accountType.js';\nimport { getMintLen } from '../extensions/extensionType.js';\nimport { ACCOUNT_SIZE } from './account.js';\nimport { MULTISIG_SIZE } from './multisig.js';\n/** Buffer layout for de/serializing a mint */\nexport const MintLayout = struct([\n u32('mintAuthorityOption'),\n publicKey('mintAuthority'),\n u64('supply'),\n u8('decimals'),\n bool('isInitialized'),\n u32('freezeAuthorityOption'),\n publicKey('freezeAuthority'),\n]);\n/** Byte length of a mint */\nexport const MINT_SIZE = MintLayout.span;\n/**\n * Retrieve information about a mint\n *\n * @param connection Connection to use\n * @param address Mint account\n * @param commitment Desired level of commitment for querying the state\n * @param programId SPL Token program account\n *\n * @return Mint information\n */\nexport async function getMint(connection, address, commitment, programId = TOKEN_PROGRAM_ID) {\n const info = await connection.getAccountInfo(address, commitment);\n return unpackMint(address, info, programId);\n}\n/**\n * Unpack a mint\n *\n * @param address Mint account\n * @param info Mint account data\n * @param programId SPL Token program account\n *\n * @return Unpacked mint\n */\nexport function unpackMint(address, info, programId = TOKEN_PROGRAM_ID) {\n if (!info)\n throw new TokenAccountNotFoundError();\n if (!info.owner.equals(programId))\n throw new TokenInvalidAccountOwnerError();\n if (info.data.length < MINT_SIZE)\n throw new TokenInvalidAccountSizeError();\n const rawMint = MintLayout.decode(info.data.slice(0, MINT_SIZE));\n let tlvData = Buffer.alloc(0);\n if (info.data.length > MINT_SIZE) {\n if (info.data.length <= ACCOUNT_SIZE)\n throw new TokenInvalidAccountSizeError();\n if (info.data.length === MULTISIG_SIZE)\n throw new TokenInvalidAccountSizeError();\n if (info.data[ACCOUNT_SIZE] != AccountType.Mint)\n throw new TokenInvalidMintError();\n tlvData = info.data.slice(ACCOUNT_SIZE + ACCOUNT_TYPE_SIZE);\n }\n return {\n address,\n mintAuthority: rawMint.mintAuthorityOption ? rawMint.mintAuthority : null,\n supply: rawMint.supply,\n decimals: rawMint.decimals,\n isInitialized: rawMint.isInitialized,\n freezeAuthority: rawMint.freezeAuthorityOption ? rawMint.freezeAuthority : null,\n tlvData,\n };\n}\n/** Get the minimum lamport balance for a mint to be rent exempt\n *\n * @param connection Connection to use\n * @param commitment Desired level of commitment for querying the state\n *\n * @return Amount of lamports required\n */\nexport async function getMinimumBalanceForRentExemptMint(connection, commitment) {\n return await getMinimumBalanceForRentExemptMintWithExtensions(connection, [], commitment);\n}\n/** Get the minimum lamport balance for a rent-exempt mint with extensions\n *\n * @param connection Connection to use\n * @param extensions Extension types included in the mint\n * @param commitment Desired level of commitment for querying the state\n *\n * @return Amount of lamports required\n */\nexport async function getMinimumBalanceForRentExemptMintWithExtensions(connection, extensions, commitment) {\n const mintLen = getMintLen(extensions);\n return await connection.getMinimumBalanceForRentExemption(mintLen, commitment);\n}\n/**\n * Async version of getAssociatedTokenAddressSync\n * For backwards compatibility\n *\n * @param mint Token mint account\n * @param owner Owner of the new account\n * @param allowOwnerOffCurve Allow the owner account to be a PDA (Program Derived Address)\n * @param programId SPL Token program account\n * @param associatedTokenProgramId SPL Associated Token program account\n *\n * @return Promise containing the address of the associated token account\n */\nexport async function getAssociatedTokenAddress(mint, owner, allowOwnerOffCurve = false, programId = TOKEN_PROGRAM_ID, associatedTokenProgramId = ASSOCIATED_TOKEN_PROGRAM_ID) {\n if (!allowOwnerOffCurve && !PublicKey.isOnCurve(owner.toBuffer()))\n throw new TokenOwnerOffCurveError();\n const [address] = await PublicKey.findProgramAddress([owner.toBuffer(), programId.toBuffer(), mint.toBuffer()], associatedTokenProgramId);\n return address;\n}\n/**\n * Get the address of the associated token account for a given mint and owner\n *\n * @param mint Token mint account\n * @param owner Owner of the new account\n * @param allowOwnerOffCurve Allow the owner account to be a PDA (Program Derived Address)\n * @param programId SPL Token program account\n * @param associatedTokenProgramId SPL Associated Token program account\n *\n * @return Address of the associated token account\n */\nexport function getAssociatedTokenAddressSync(mint, owner, allowOwnerOffCurve = false, programId = TOKEN_PROGRAM_ID, associatedTokenProgramId = ASSOCIATED_TOKEN_PROGRAM_ID) {\n if (!allowOwnerOffCurve && !PublicKey.isOnCurve(owner.toBuffer()))\n throw new TokenOwnerOffCurveError();\n const [address] = PublicKey.findProgramAddressSync([owner.toBuffer(), programId.toBuffer(), mint.toBuffer()], associatedTokenProgramId);\n return address;\n}\n//# sourceMappingURL=mint.js.map"],"names":["MintLayout","struct","u32","publicKey","u64","u8","bool","async","getMint","connection","address","commitment","programId","TOKEN_PROGRAM_ID","unpackMint","getAccountInfo","info","TokenAccountNotFoundError","owner","equals","TokenInvalidAccountOwnerError","data","length","MINT_SIZE","TokenInvalidAccountSizeError","rawMint","decode","slice","tlvData","Buffer","alloc","ACCOUNT_SIZE","MULTISIG_SIZE","AccountType","Mint","TokenInvalidMintError","ACCOUNT_TYPE_SIZE","mintAuthority","mintAuthorityOption","supply","decimals","isInitialized","freezeAuthority","freezeAuthorityOption"],"mappings":"otBAmDaA,MAAAA,EAACC,EACVC,CAAAA,EAAI,uBACJC,EAAc,iBACdC,EAAI,UACJC,EAAG,YACHC,EAAU,iBACXJ,EAAA,yBAEHC,EAAA,8BAoBII,eAAkBC,EAAOC,EAAQC,EAAWC,EAAAC,EAAAC,GAGhD,OAAAC,EAAAJ,QAFCD,EAAAM,eAAAL,EAAAC,GAEDC,GAUqBE,SAAAA,EAAIJ,EAAAM,EAAAJ,EAA4BC,GACrD,IAAAG,EAAA,MAAA,IAAAC,EACE,IAAAD,EAAAE,MAAAC,OAAAP,GAAA,MAAA,IAAAQ,EAEE,GAAAJ,EAAMK,KAAOC,OAAGC,EACnB,MAAA,IAAAC,EACG,MAAIC,EAAUzB,EAAS0B,OAAWV,EAACK,KAAAM,MAAA,EAAAJ,IAC/BK,IAAAA,EAASC,EAAAA,OAAKC,MAAU,GAAc,GAAAd,EAAAK,KAAMC,OAAIC,EAAA,CAChD,GAAIP,EAAKK,KAAKC,QAAMS,EAAoB,MAAM,IAAIP,EAClD,GAAIR,EAAKK,KAAKC,SAAAU,EAAmC,MAAE,IAAAR,EACnD,GAAAR,EAAOK,KAAOU,IAAYE,EAAeC,KAChD,MAAA,IAAAC,EAECP,EAAAZ,EAAAK,KAAAM,MAAAI,EAAAK,GAEM,MAAA,CACA1B,UACA2B,cAAUZ,EAAQa,oBAAQb,EAAAY,cAAA,KAC1BE,OAAAd,EAAUc,OAClBC,SAAAf,EAAAe,SACEC,cAAAhB,EAAAgB,cACIC,gBAAAjB,EAAAkB,sBAAAlB,EAAAiB,gBAAA,KACLd","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"mint.js","sources":["../../../../../../../../node_modules/@solana/spl-token/lib/esm/state/mint.js"],"sourcesContent":["import { struct, u32, u8 } from '@solana/buffer-layout';\nimport { bool, publicKey, u64 } from '@solana/buffer-layout-utils';\nimport { PublicKey } from '@solana/web3.js';\nimport { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from '../constants.js';\nimport { TokenAccountNotFoundError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, TokenInvalidMintError, TokenOwnerOffCurveError, } from '../errors.js';\nimport { ACCOUNT_TYPE_SIZE, AccountType } from '../extensions/accountType.js';\nimport { getMintLen } from '../extensions/extensionType.js';\nimport { ACCOUNT_SIZE } from './account.js';\nimport { MULTISIG_SIZE } from './multisig.js';\n/** Buffer layout for de/serializing a mint */\nexport const MintLayout = struct([\n u32('mintAuthorityOption'),\n publicKey('mintAuthority'),\n u64('supply'),\n u8('decimals'),\n bool('isInitialized'),\n u32('freezeAuthorityOption'),\n publicKey('freezeAuthority'),\n]);\n/** Byte length of a mint */\nexport const MINT_SIZE = MintLayout.span;\n/**\n * Retrieve information about a mint\n *\n * @param connection Connection to use\n * @param address Mint account\n * @param commitment Desired level of commitment for querying the state\n * @param programId SPL Token program account\n *\n * @return Mint information\n */\nexport async function getMint(connection, address, commitment, programId = TOKEN_PROGRAM_ID) {\n const info = await connection.getAccountInfo(address, commitment);\n return unpackMint(address, info, programId);\n}\n/**\n * Unpack a mint\n *\n * @param address Mint account\n * @param info Mint account data\n * @param programId SPL Token program account\n *\n * @return Unpacked mint\n */\nexport function unpackMint(address, info, programId = TOKEN_PROGRAM_ID) {\n if (!info)\n throw new TokenAccountNotFoundError();\n if (!info.owner.equals(programId))\n throw new TokenInvalidAccountOwnerError();\n if (info.data.length < MINT_SIZE)\n throw new TokenInvalidAccountSizeError();\n const rawMint = MintLayout.decode(info.data.slice(0, MINT_SIZE));\n let tlvData = Buffer.alloc(0);\n if (info.data.length > MINT_SIZE) {\n if (info.data.length <= ACCOUNT_SIZE)\n throw new TokenInvalidAccountSizeError();\n if (info.data.length === MULTISIG_SIZE)\n throw new TokenInvalidAccountSizeError();\n if (info.data[ACCOUNT_SIZE] != AccountType.Mint)\n throw new TokenInvalidMintError();\n tlvData = info.data.slice(ACCOUNT_SIZE + ACCOUNT_TYPE_SIZE);\n }\n return {\n address,\n mintAuthority: rawMint.mintAuthorityOption ? rawMint.mintAuthority : null,\n supply: rawMint.supply,\n decimals: rawMint.decimals,\n isInitialized: rawMint.isInitialized,\n freezeAuthority: rawMint.freezeAuthorityOption ? rawMint.freezeAuthority : null,\n tlvData,\n };\n}\n/** Get the minimum lamport balance for a mint to be rent exempt\n *\n * @param connection Connection to use\n * @param commitment Desired level of commitment for querying the state\n *\n * @return Amount of lamports required\n */\nexport async function getMinimumBalanceForRentExemptMint(connection, commitment) {\n return await getMinimumBalanceForRentExemptMintWithExtensions(connection, [], commitment);\n}\n/** Get the minimum lamport balance for a rent-exempt mint with extensions\n *\n * @param connection Connection to use\n * @param extensions Extension types included in the mint\n * @param commitment Desired level of commitment for querying the state\n *\n * @return Amount of lamports required\n */\nexport async function getMinimumBalanceForRentExemptMintWithExtensions(connection, extensions, commitment) {\n const mintLen = getMintLen(extensions);\n return await connection.getMinimumBalanceForRentExemption(mintLen, commitment);\n}\n/**\n * Async version of getAssociatedTokenAddressSync\n * For backwards compatibility\n *\n * @param mint Token mint account\n * @param owner Owner of the new account\n * @param allowOwnerOffCurve Allow the owner account to be a PDA (Program Derived Address)\n * @param programId SPL Token program account\n * @param associatedTokenProgramId SPL Associated Token program account\n *\n * @return Promise containing the address of the associated token account\n */\nexport async function getAssociatedTokenAddress(mint, owner, allowOwnerOffCurve = false, programId = TOKEN_PROGRAM_ID, associatedTokenProgramId = ASSOCIATED_TOKEN_PROGRAM_ID) {\n if (!allowOwnerOffCurve && !PublicKey.isOnCurve(owner.toBuffer()))\n throw new TokenOwnerOffCurveError();\n const [address] = await PublicKey.findProgramAddress([owner.toBuffer(), programId.toBuffer(), mint.toBuffer()], associatedTokenProgramId);\n return address;\n}\n/**\n * Get the address of the associated token account for a given mint and owner\n *\n * @param mint Token mint account\n * @param owner Owner of the new account\n * @param allowOwnerOffCurve Allow the owner account to be a PDA (Program Derived Address)\n * @param programId SPL Token program account\n * @param associatedTokenProgramId SPL Associated Token program account\n *\n * @return Address of the associated token account\n */\nexport function getAssociatedTokenAddressSync(mint, owner, allowOwnerOffCurve = false, programId = TOKEN_PROGRAM_ID, associatedTokenProgramId = ASSOCIATED_TOKEN_PROGRAM_ID) {\n if (!allowOwnerOffCurve && !PublicKey.isOnCurve(owner.toBuffer()))\n throw new TokenOwnerOffCurveError();\n const [address] = PublicKey.findProgramAddressSync([owner.toBuffer(), programId.toBuffer(), mint.toBuffer()], associatedTokenProgramId);\n return address;\n}\n//# sourceMappingURL=mint.js.map"],"names":["MintLayout","struct","u32","publicKey","u64","u8","bool","async","getMint","connection","address","commitment","programId","TOKEN_PROGRAM_ID","unpackMint","getAccountInfo","info","TokenAccountNotFoundError","owner","equals","TokenInvalidAccountOwnerError","data","length","MINT_SIZE","TokenInvalidAccountSizeError","rawMint","decode","slice","tlvData","Buffer","alloc","ACCOUNT_SIZE","MULTISIG_SIZE","AccountType","Mint","TokenInvalidMintError","ACCOUNT_TYPE_SIZE","mintAuthority","mintAuthorityOption","supply","decimals","isInitialized","freezeAuthority","freezeAuthorityOption"],"mappings":"otBAmDI,MAASA,EAACC,EAAgB,CAC1BC,EAAI,uBACJC,EAAG,iBACHC,EAAI,UACJC,EAAG,YACHC,EAAA,iBACDJ,EAAA,yBAEHC,EAAA,8BAoBII,eAAkBC,EAAOC,EAAQC,EAAWC,EAAAC,EAAAC,GAGhD,OAAAC,EAAAJ,QAFCD,EAAAM,eAAAL,EAAAC,GAEDC,GAUqBE,SAAAA,EAAIJ,EAAAM,EAAAJ,EAA4BC,GACrD,IAAAG,EAAA,MAAA,IAAAC,EACE,IAAAD,EAAAE,MAAAC,OAAAP,GAAA,MAAA,IAAAQ,EAEE,GAAAJ,EAAMK,KAAOC,OAAGC,EACnB,MAAA,IAAAC,EACG,MAAIC,EAAUzB,EAAS0B,OAAWV,EAACK,KAAAM,MAAA,EAAAJ,IAC/BK,IAAAA,EAASC,EAAAA,OAAKC,MAAM,GAAkB,GAAAd,EAAAK,KAAMC,OAAIC,EAAA,CAChD,GAAIP,EAAKK,KAAKC,QAAMS,EAAoB,MAAM,IAAIP,EAClD,GAAIR,EAAKK,KAAKC,SAAAU,EAAmC,MAAE,IAAAR,EACnD,GAAAR,EAAOK,KAAOU,IAAYE,EAAeC,KAChD,MAAA,IAAAC,EAECP,EAAAZ,EAAAK,KAAAM,MAAAI,EAAAK,GAEM,MAAA,CACA1B,UACA2B,cAAUZ,EAAQa,oBAAQb,EAAAY,cAAA,KAC1BE,OAAAd,EAAUc,OAClBC,SAAAf,EAAAe,SACEC,cAAAhB,EAAAgB,cACIC,gBAAAjB,EAAAkB,sBAAAlB,EAAAiB,gBAAA,KACLd","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import{__exports as r}from"../../_virtual/index3.js";r.byteLength=function(r){var t=h(r),e=t[0],n=t[1];return 3*(e+n)/4-n},r.toByteArray=function(r){var t,o,a=h(r),u=a[0],i=a[1],c=new n(function(r,t,e){return 3*(t+e)/4-e}(0,u,i)),d=0,f=i>0?u-4:u;for(o=0;o<f;o+=4)t=e[r.charCodeAt(o)]<<18|e[r.charCodeAt(o+1)]<<12|e[r.charCodeAt(o+2)]<<6|e[r.charCodeAt(o+3)],c[d++]=t>>16&255,c[d++]=t>>8&255,c[d++]=255&t;2===i&&(t=e[r.charCodeAt(o)]<<2|e[r.charCodeAt(o+1)]>>4,c[d++]=255&t);1===i&&(t=e[r.charCodeAt(o)]<<10|e[r.charCodeAt(o+1)]<<4|e[r.charCodeAt(o+2)]>>2,c[d++]=t>>8&255,c[d++]=255&t);return c},r.fromByteArray=function(r){for(var e,n=r.length,o=n%3,a=[],h=16383,i=0,c=n-o;i<c;i+=h)a.push(u(r,i,i+h>c?c:i+h));1===o?(e=r[n-1],a.push(t[e>>2]+t[e<<4&63]+"==")):2===o&&(e=(r[n-2]<<8)+r[n-1],a.push(t[e>>10]+t[e>>4&63]+t[e<<2&63]+"="));return a.join("")};for(var t=[],e=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)t[a]=o[a],e[o.charCodeAt(a)]=a;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(r,e,n){for(var o,a,h=[],u=e;u<n;u+=3)o=(r[u]<<16&16711680)+(r[u+1]<<8&65280)+(255&r[u+2]),h.push(t[(a=o)>>18&63]+t[a>>12&63]+t[a>>6&63]+t[63&a]);return h.join("")}e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63;export{r as default};
1
+ import{__exports as r}from"../../_virtual/index3.js";r.byteLength=function(r){var t=u(r),e=t[0],n=t[1];return 3*(e+n)/4-n},r.toByteArray=function(r){var t,o,a=u(r),h=a[0],i=a[1],c=new n(function(r,t,e){return 3*(t+e)/4-e}(0,h,i)),f=0,d=i>0?h-4:h;for(o=0;o<d;o+=4)t=e[r.charCodeAt(o)]<<18|e[r.charCodeAt(o+1)]<<12|e[r.charCodeAt(o+2)]<<6|e[r.charCodeAt(o+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;2===i&&(t=e[r.charCodeAt(o)]<<2|e[r.charCodeAt(o+1)]>>4,c[f++]=255&t);1===i&&(t=e[r.charCodeAt(o)]<<10|e[r.charCodeAt(o+1)]<<4|e[r.charCodeAt(o+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t);return c},r.fromByteArray=function(r){for(var e,n=r.length,o=n%3,a=[],u=16383,h=0,c=n-o;h<c;h+=u)a.push(i(r,h,h+u>c?c:h+u));1===o?(e=r[n-1],a.push(t[e>>2]+t[e<<4&63]+"==")):2===o&&(e=(r[n-2]<<8)+r[n-1],a.push(t[e>>10]+t[e>>4&63]+t[e<<2&63]+"="));return a.join("")};for(var t=[],e=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)t[a]=o[a],e[o.charCodeAt(a)]=a;function u(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function h(r){return t[r>>18&63]+t[r>>12&63]+t[r>>6&63]+t[63&r]}function i(r,t,e){for(var n,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(h(n));return o.join("")}e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63;export{r as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../node_modules/base64-js/index.js"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n"],"names":["base64Js","byteLength","b64","lens","getLens","validLen","placeHoldersLen","toByteArray","tmp","i","arr","Arr","_byteLength","curByte","len","revLookup","charCodeAt","fromByteArray","uint8","length","extraBytes","parts","maxChunkLength","len2","push","encodeChunk","lookup","join","Uint8Array","Array","code","Error","indexOf","start","end","num","output"],"mappings":"qDAEAA,EAAAC,WAuCA,SAAqBC,GACnB,IAAIC,EAAOC,EAAQF,GACfG,EAAWF,EAAK,GAChBG,EAAkBH,EAAK,GAC3B,OAAuC,GAA9BE,EAAWC,GAAuB,EAAKA,CAClD,EA3CAN,EAAAO,YAiDA,SAAsBL,GACpB,IAAIM,EAcAC,EAbAN,EAAOC,EAAQF,GACfG,EAAWF,EAAK,GAChBG,EAAkBH,EAAK,GAEvBO,EAAM,I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,IAAM,GAAKI,EAAMJ,EAAM,GAC1CO,EAAMG,KACJE,EAAOlB,GAAO,IACdkB,EAAQlB,GAAO,EAAK,IACpBkB,EAAQlB,GAAO,EAAK,IACpB,MAIJ,OAAOa,EAAMM,KAAK,GACpB,EA1IA,IALA,IAAID,EAAS,GACTX,EAAY,GACZJ,EAA4B,oBAAfiB,WAA6BA,WAAaC,MAEvDC,EAAO,mEACFrB,EAAI,EAAsBA,EAAbqB,KAAwBrB,EAC5CiB,EAAOjB,GAAKqB,EAAKrB,GACjBM,EAAUe,EAAKd,WAAWP,IAAMA,EAQlC,SAASL,EAASF,GAChB,IAAIY,EAAMZ,EAAIiB,OAEd,GAAIL,EAAM,EAAI,EACZ,MAAM,IAAIiB,MAAM,kDAKlB,IAAI1B,EAAWH,EAAI8B,QAAQ,KAO3B,WANI3B,IAAiBA,EAAWS,GAMzB,CAACT,EAJcA,IAAaS,EAC/B,EACA,EAAKT,EAAW,EAGtB,CAmEA,SAASoB,EAAaP,EAAOe,EAAOC,GAGlC,IAFA,IAAI1B,EARoB2B,EASpBC,EAAS,GACJ3B,EAAIwB,EAAOxB,EAAIyB,EAAKzB,GAAK,EAChCD,GACIU,EAAMT,IAAM,GAAM,WAClBS,EAAMT,EAAI,IAAM,EAAK,QACP,IAAfS,EAAMT,EAAI,IACb2B,EAAOZ,KAdFE,GADiBS,EAeM3B,IAdT,GAAK,IACxBkB,EAAOS,GAAO,GAAK,IACnBT,EAAOS,GAAO,EAAI,IAClBT,EAAa,GAANS,IAaT,OAAOC,EAAOT,KAAK,GACrB,CAlGAZ,EAAU,IAAIC,WAAW,IAAM,GAC/BD,EAAU,IAAIC,WAAW,IAAM","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.js","sources":["../../../../node_modules/base64-js/index.js"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n"],"names":["base64Js","byteLength","b64","lens","getLens","validLen","placeHoldersLen","toByteArray","tmp","i","arr","Arr","_byteLength","curByte","len","revLookup","charCodeAt","fromByteArray","uint8","length","extraBytes","parts","maxChunkLength","len2","push","encodeChunk","lookup","join","Uint8Array","Array","code","Error","indexOf","tripletToBase64","num","start","end","output"],"mappings":"qDAEAA,EAAAC,WAuCA,SAAqBC,GACnB,IAAIC,EAAOC,EAAQF,GACfG,EAAWF,EAAK,GAChBG,EAAkBH,EAAK,GAC3B,OAAuC,GAA9BE,EAAWC,GAAuB,EAAKA,CAClD,EA3CAN,EAAAO,YAiDA,SAAsBL,GACpB,IAAIM,EAcAC,EAbAN,EAAOC,EAAQF,GACfG,EAAWF,EAAK,GAChBG,EAAkBH,EAAK,GAEvBO,EAAM,IAAIC,EAVhB,SAAsBT,EAAKG,EAAUC,GACnC,OAAuC,GAA9BD,EAAWC,GAAuB,EAAKA,CAClD,CAQoBM,CAAYV,EAAKG,EAAUC,IAEzCO,EAAU,EAGVC,EAAMR,EAAkB,EACxBD,EAAW,EACXA,EAGJ,IAAKI,EAAI,EAAGA,EAAIK,EAAKL,GAAK,EACxBD,EACGO,EAAUb,EAAIc,WAAWP,KAAO,GAChCM,EAAUb,EAAIc,WAAWP,EAAI,KAAO,GACpCM,EAAUb,EAAIc,WAAWP,EAAI,KAAO,EACrCM,EAAUb,EAAIc,WAAWP,EAAI,IAC/BC,EAAIG,KAAcL,GAAO,GAAM,IAC/BE,EAAIG,KAAcL,GAAO,EAAK,IAC9BE,EAAIG,KAAmB,IAANL,EAGK,IAApBF,IACFE,EACGO,EAAUb,EAAIc,WAAWP,KAAO,EAChCM,EAAUb,EAAIc,WAAWP,EAAI,KAAO,EACvCC,EAAIG,KAAmB,IAANL,GAGK,IAApBF,IACFE,EACGO,EAAUb,EAAIc,WAAWP,KAAO,GAChCM,EAAUb,EAAIc,WAAWP,EAAI,KAAO,EACpCM,EAAUb,EAAIc,WAAWP,EAAI,KAAO,EACvCC,EAAIG,KAAcL,GAAO,EAAK,IAC9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