@waku/rln 0.1.3-f6d5deb → 0.1.4-0e49a1e.0

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 (341) hide show
  1. package/README.md +10 -186
  2. package/bundle/_virtual/__node-resolve_empty.js +6 -0
  3. package/bundle/_virtual/_assert.js +3 -0
  4. package/bundle/_virtual/_commonjs-dynamic-modules.js +5 -0
  5. package/bundle/_virtual/_commonjsHelpers.js +32 -0
  6. package/bundle/_virtual/_node-resolve_empty.js +3 -0
  7. package/bundle/_virtual/_sha2.js +3 -0
  8. package/bundle/_virtual/_u64.js +3 -0
  9. package/bundle/_virtual/aes.js +3 -0
  10. package/bundle/_virtual/bn.js +3 -0
  11. package/bundle/_virtual/browser.js +3 -0
  12. package/bundle/_virtual/checksum.js +3 -0
  13. package/bundle/_virtual/cipher.js +3 -0
  14. package/bundle/_virtual/class.js +3 -0
  15. package/bundle/_virtual/common.js +3 -0
  16. package/bundle/_virtual/common2.js +3 -0
  17. package/bundle/_virtual/cryptoBrowser.js +3 -0
  18. package/bundle/_virtual/functional.js +3 -0
  19. package/bundle/_virtual/hash.js +3 -0
  20. package/bundle/_virtual/hmac.js +3 -0
  21. package/bundle/_virtual/index.js +3 -0
  22. package/bundle/_virtual/index2.js +6 -0
  23. package/bundle/_virtual/inherits_browser.js +3 -0
  24. package/bundle/_virtual/kdf.js +3 -0
  25. package/bundle/_virtual/lodash.js +3 -0
  26. package/bundle/_virtual/password.js +3 -0
  27. package/bundle/_virtual/pbkdf2.js +3 -0
  28. package/bundle/_virtual/pbkdf22.js +3 -0
  29. package/bundle/_virtual/random.js +3 -0
  30. package/bundle/_virtual/ripemd.js +3 -0
  31. package/bundle/_virtual/schema-validation-generated.js +3 -0
  32. package/bundle/_virtual/schema-validation.js +3 -0
  33. package/bundle/_virtual/scrypt.js +3 -0
  34. package/bundle/_virtual/scrypt2.js +3 -0
  35. package/bundle/_virtual/sha.js +3 -0
  36. package/bundle/_virtual/sha256.js +3 -0
  37. package/bundle/_virtual/sha2562.js +3 -0
  38. package/bundle/_virtual/sha3.js +3 -0
  39. package/bundle/_virtual/sha512.js +3 -0
  40. package/bundle/_virtual/types.js +3 -0
  41. package/bundle/_virtual/utils.js +3 -0
  42. package/bundle/_virtual/utils2.js +3 -0
  43. package/bundle/_virtual/utils3.js +3 -0
  44. package/bundle/index.js +12 -74804
  45. package/bundle/node_modules/@ethersproject/abi/lib.esm/_version.js +3 -0
  46. package/bundle/node_modules/@ethersproject/abi/lib.esm/abi-coder.js +96 -0
  47. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js +148 -0
  48. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/address.js +26 -0
  49. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/anonymous.js +20 -0
  50. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/array.js +210 -0
  51. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/boolean.js +18 -0
  52. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/bytes.js +30 -0
  53. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/fixed-bytes.js +26 -0
  54. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/null.js +22 -0
  55. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/number.js +43 -0
  56. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/string.js +19 -0
  57. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/tuple.js +58 -0
  58. package/bundle/node_modules/@ethersproject/abi/lib.esm/fragments.js +854 -0
  59. package/bundle/node_modules/@ethersproject/abi/lib.esm/interface.js +609 -0
  60. package/bundle/node_modules/@ethersproject/abstract-provider/lib.esm/_version.js +3 -0
  61. package/bundle/node_modules/@ethersproject/abstract-provider/lib.esm/index.js +66 -0
  62. package/bundle/node_modules/@ethersproject/abstract-signer/lib.esm/_version.js +3 -0
  63. package/bundle/node_modules/@ethersproject/abstract-signer/lib.esm/index.js +302 -0
  64. package/bundle/node_modules/@ethersproject/address/lib.esm/_version.js +3 -0
  65. package/bundle/node_modules/@ethersproject/address/lib.esm/index.js +110 -0
  66. package/bundle/node_modules/@ethersproject/base64/lib.esm/base64.js +20 -0
  67. package/bundle/node_modules/@ethersproject/basex/lib.esm/index.js +120 -0
  68. package/bundle/node_modules/@ethersproject/bignumber/lib.esm/_version.js +3 -0
  69. package/bundle/node_modules/@ethersproject/bignumber/lib.esm/bignumber.js +287 -0
  70. package/bundle/node_modules/@ethersproject/bytes/lib.esm/_version.js +3 -0
  71. package/bundle/node_modules/@ethersproject/bytes/lib.esm/index.js +402 -0
  72. package/bundle/node_modules/@ethersproject/constants/lib.esm/addresses.js +3 -0
  73. package/bundle/node_modules/@ethersproject/constants/lib.esm/bignumbers.js +8 -0
  74. package/bundle/node_modules/@ethersproject/constants/lib.esm/hashes.js +3 -0
  75. package/bundle/node_modules/@ethersproject/contracts/lib.esm/_version.js +3 -0
  76. package/bundle/node_modules/@ethersproject/contracts/lib.esm/index.js +893 -0
  77. package/bundle/node_modules/@ethersproject/hash/lib.esm/_version.js +3 -0
  78. package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/decoder.js +256 -0
  79. package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/include.js +36 -0
  80. package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/lib.js +135 -0
  81. package/bundle/node_modules/@ethersproject/hash/lib.esm/id.js +8 -0
  82. package/bundle/node_modules/@ethersproject/hash/lib.esm/namehash.js +64 -0
  83. package/bundle/node_modules/@ethersproject/hash/lib.esm/typed-data.js +443 -0
  84. package/bundle/node_modules/@ethersproject/keccak256/lib.esm/index.js +8 -0
  85. package/bundle/node_modules/@ethersproject/keccak256/node_modules/js-sha3/src/sha3.js +660 -0
  86. package/bundle/node_modules/@ethersproject/logger/lib.esm/_version.js +3 -0
  87. package/bundle/node_modules/@ethersproject/logger/lib.esm/index.js +352 -0
  88. package/bundle/node_modules/@ethersproject/networks/lib.esm/_version.js +3 -0
  89. package/bundle/node_modules/@ethersproject/networks/lib.esm/index.js +248 -0
  90. package/bundle/node_modules/@ethersproject/properties/lib.esm/_version.js +3 -0
  91. package/bundle/node_modules/@ethersproject/properties/lib.esm/index.js +127 -0
  92. package/bundle/node_modules/@ethersproject/providers/lib.esm/_version.js +3 -0
  93. package/bundle/node_modules/@ethersproject/providers/lib.esm/base-provider.js +2007 -0
  94. package/bundle/node_modules/@ethersproject/providers/lib.esm/formatter.js +422 -0
  95. package/bundle/node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js +674 -0
  96. package/bundle/node_modules/@ethersproject/providers/lib.esm/web3-provider.js +132 -0
  97. package/bundle/node_modules/@ethersproject/rlp/lib.esm/_version.js +3 -0
  98. package/bundle/node_modules/@ethersproject/rlp/lib.esm/index.js +120 -0
  99. package/bundle/node_modules/@ethersproject/sha2/lib.esm/sha2.js +8 -0
  100. package/bundle/node_modules/@ethersproject/signing-key/lib.esm/_version.js +3 -0
  101. package/bundle/node_modules/@ethersproject/signing-key/lib.esm/elliptic.js +2430 -0
  102. package/bundle/node_modules/@ethersproject/signing-key/lib.esm/index.js +76 -0
  103. package/bundle/node_modules/@ethersproject/strings/lib.esm/_version.js +3 -0
  104. package/bundle/node_modules/@ethersproject/strings/lib.esm/utf8.js +219 -0
  105. package/bundle/node_modules/@ethersproject/transactions/lib.esm/_version.js +3 -0
  106. package/bundle/node_modules/@ethersproject/transactions/lib.esm/index.js +279 -0
  107. package/bundle/node_modules/@ethersproject/web/lib.esm/_version.js +3 -0
  108. package/bundle/node_modules/@ethersproject/web/lib.esm/geturl.js +69 -0
  109. package/bundle/node_modules/@ethersproject/web/lib.esm/index.js +404 -0
  110. package/bundle/node_modules/@multiformats/multiaddr/dist/src/convert.js +15 -0
  111. package/bundle/node_modules/@multiformats/multiaddr/dist/src/multiaddr.js +20 -0
  112. package/bundle/node_modules/@multiformats/multiaddr/dist/src/protocols-table.js +92 -0
  113. package/bundle/node_modules/@noble/hashes/esm/_assert.js +37 -0
  114. package/bundle/node_modules/@noble/hashes/esm/_md.js +132 -0
  115. package/bundle/node_modules/@noble/hashes/esm/_u64.js +29 -0
  116. package/bundle/node_modules/@noble/hashes/esm/sha256.js +113 -0
  117. package/bundle/node_modules/@noble/hashes/esm/sha3.js +210 -0
  118. package/bundle/node_modules/@noble/hashes/esm/utils.js +144 -0
  119. package/bundle/node_modules/@waku/zerokit-rln-wasm/rln_wasm.js +756 -0
  120. package/bundle/node_modules/bech32/index.js +187 -0
  121. package/bundle/node_modules/bn.js/lib/bn.js +3361 -0
  122. package/bundle/node_modules/debug/src/browser.js +283 -0
  123. package/bundle/node_modules/debug/src/common.js +295 -0
  124. package/bundle/node_modules/ethereum-cryptography/esm/keccak.js +10 -0
  125. package/bundle/node_modules/ethereum-cryptography/esm/sha256.js +6 -0
  126. package/bundle/node_modules/ethereum-cryptography/esm/utils.js +24 -0
  127. package/bundle/node_modules/hash.js/lib/hash/common.js +97 -0
  128. package/bundle/node_modules/hash.js/lib/hash/hmac.js +51 -0
  129. package/bundle/node_modules/hash.js/lib/hash/ripemd.js +152 -0
  130. package/bundle/node_modules/hash.js/lib/hash/sha/1.js +81 -0
  131. package/bundle/node_modules/hash.js/lib/hash/sha/224.js +33 -0
  132. package/bundle/node_modules/hash.js/lib/hash/sha/256.js +113 -0
  133. package/bundle/node_modules/hash.js/lib/hash/sha/384.js +39 -0
  134. package/bundle/node_modules/hash.js/lib/hash/sha/512.js +336 -0
  135. package/bundle/node_modules/hash.js/lib/hash/sha/common.js +53 -0
  136. package/bundle/node_modules/hash.js/lib/hash/sha.js +14 -0
  137. package/bundle/node_modules/hash.js/lib/hash/utils.js +282 -0
  138. package/bundle/node_modules/hash.js/lib/hash.js +33 -0
  139. package/bundle/node_modules/inherits/inherits_browser.js +33 -0
  140. package/bundle/node_modules/it-length-prefixed/dist/src/decode.js +6 -0
  141. package/bundle/node_modules/lodash/lodash.js +17207 -0
  142. package/bundle/node_modules/minimalistic-assert/index.js +13 -0
  143. package/bundle/node_modules/ms/index.js +172 -0
  144. package/bundle/node_modules/multiformats/dist/src/bases/base.js +205 -0
  145. package/bundle/node_modules/multiformats/dist/src/bases/base10.js +9 -0
  146. package/bundle/node_modules/multiformats/dist/src/bases/base16.js +16 -0
  147. package/bundle/node_modules/multiformats/dist/src/bases/base2.js +10 -0
  148. package/bundle/node_modules/multiformats/dist/src/bases/base256emoji.js +41 -0
  149. package/bundle/node_modules/multiformats/dist/src/bases/base32.js +58 -0
  150. package/bundle/node_modules/multiformats/dist/src/bases/base36.js +14 -0
  151. package/bundle/node_modules/multiformats/dist/src/bases/base58.js +14 -0
  152. package/bundle/node_modules/multiformats/dist/src/bases/base64.js +28 -0
  153. package/bundle/node_modules/multiformats/dist/src/bases/base8.js +10 -0
  154. package/bundle/node_modules/multiformats/dist/src/bases/identity.js +11 -0
  155. package/bundle/node_modules/multiformats/dist/src/basics.js +15 -0
  156. package/bundle/node_modules/multiformats/dist/src/bytes.js +18 -0
  157. package/bundle/node_modules/multiformats/dist/src/codecs/json.js +2 -0
  158. package/bundle/node_modules/multiformats/dist/src/vendor/base-x.js +170 -0
  159. package/bundle/node_modules/protons-runtime/dist/src/codec.js +20 -0
  160. package/bundle/node_modules/protons-runtime/dist/src/codecs/enum.js +24 -0
  161. package/bundle/node_modules/protons-runtime/dist/src/codecs/message.js +7 -0
  162. package/bundle/node_modules/protons-runtime/dist/src/decode.js +8 -0
  163. package/bundle/node_modules/protons-runtime/dist/src/encode.js +11 -0
  164. package/bundle/node_modules/protons-runtime/dist/src/index.js +30 -0
  165. package/bundle/node_modules/protons-runtime/dist/src/utils/float.js +54 -0
  166. package/bundle/node_modules/protons-runtime/dist/src/utils/longbits.js +175 -0
  167. package/bundle/node_modules/protons-runtime/dist/src/utils/pool.js +28 -0
  168. package/bundle/node_modules/protons-runtime/dist/src/utils/reader.js +367 -0
  169. package/bundle/node_modules/protons-runtime/dist/src/utils/utf8.js +99 -0
  170. package/bundle/node_modules/protons-runtime/dist/src/utils/writer.js +438 -0
  171. package/bundle/node_modules/uint8-varint/dist/src/index.js +124 -0
  172. package/bundle/node_modules/uint8arrays/dist/src/alloc.js +17 -0
  173. package/bundle/node_modules/uint8arrays/dist/src/from-string.js +19 -0
  174. package/bundle/node_modules/uint8arrays/dist/src/util/bases.js +49 -0
  175. package/bundle/packages/core/dist/lib/connection_manager/connection_manager.js +21 -0
  176. package/bundle/packages/core/dist/lib/connection_manager/keep_alive_manager.js +18 -0
  177. package/bundle/packages/core/dist/lib/filter/filter.js +27 -0
  178. package/bundle/packages/core/dist/lib/light_push/light_push.js +27 -0
  179. package/bundle/packages/core/dist/lib/message/version_0.js +154 -0
  180. package/bundle/packages/core/dist/lib/metadata/metadata.js +27 -0
  181. package/bundle/packages/core/dist/lib/store/store.js +27 -0
  182. package/bundle/packages/interfaces/dist/connection_manager.js +19 -0
  183. package/bundle/packages/interfaces/dist/constants.js +6 -0
  184. package/bundle/packages/interfaces/dist/health_indicator.js +12 -0
  185. package/bundle/packages/interfaces/dist/protocols.js +92 -0
  186. package/bundle/packages/proto/dist/generated/filter.js +445 -0
  187. package/bundle/packages/proto/dist/generated/filter_v2.js +424 -0
  188. package/bundle/packages/proto/dist/generated/light_push.js +389 -0
  189. package/bundle/packages/proto/dist/generated/message.js +213 -0
  190. package/bundle/packages/proto/dist/generated/metadata.js +130 -0
  191. package/bundle/packages/proto/dist/generated/peer_exchange.js +209 -0
  192. package/bundle/packages/proto/dist/generated/sds_message.js +105 -0
  193. package/bundle/packages/proto/dist/generated/store_v3.js +490 -0
  194. package/bundle/packages/proto/dist/generated/topic_only_message.js +61 -0
  195. package/bundle/packages/rln/dist/codec.js +93 -0
  196. package/bundle/packages/rln/dist/contract/abi.js +394 -0
  197. package/bundle/packages/rln/dist/contract/constants.js +27 -0
  198. package/bundle/packages/rln/dist/contract/rln_contract.js +438 -0
  199. package/bundle/packages/rln/dist/create.js +9 -0
  200. package/bundle/packages/rln/dist/identity.js +30 -0
  201. package/bundle/packages/rln/dist/keystore/cipher.js +31 -0
  202. package/bundle/packages/rln/dist/keystore/credential_validation_generated.js +119 -0
  203. package/bundle/packages/rln/dist/keystore/keystore.js +223 -0
  204. package/bundle/packages/rln/dist/keystore/keystore_validation_generated.js +74 -0
  205. package/bundle/packages/rln/dist/keystore/schema_validator.js +20 -0
  206. package/bundle/packages/rln/dist/message.js +51 -0
  207. package/bundle/packages/rln/dist/proof.js +54 -0
  208. package/bundle/packages/rln/dist/resources/verification_key.js +112 -0
  209. package/bundle/packages/rln/dist/resources/witness_calculator.js +330 -0
  210. package/bundle/packages/rln/dist/rln.js +220 -0
  211. package/bundle/packages/rln/dist/root_tracker.js +76 -0
  212. package/bundle/packages/rln/dist/utils/bytes.js +65 -0
  213. package/bundle/packages/rln/dist/utils/epoch.js +39 -0
  214. package/bundle/packages/rln/dist/utils/hash.js +10 -0
  215. package/bundle/packages/rln/dist/utils/metamask.js +14 -0
  216. package/bundle/packages/rln/dist/zerokit.js +128 -0
  217. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/checksum.js +52 -0
  218. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/cipher.js +65 -0
  219. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/class.js +99 -0
  220. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/functional.js +103 -0
  221. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/index.js +28 -0
  222. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/kdf.js +78 -0
  223. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/password.js +17 -0
  224. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/schema-validation-generated.js +1253 -0
  225. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/schema-validation.js +40 -0
  226. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/types.js +5 -0
  227. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/aes.js +103 -0
  228. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/pbkdf2.js +41 -0
  229. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/random.js +17 -0
  230. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/scrypt.js +23 -0
  231. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/sha256.js +12 -0
  232. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/utils.js +77 -0
  233. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/index.js +9 -0
  234. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/md5.js +215 -0
  235. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/nil.js +3 -0
  236. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/parse.js +35 -0
  237. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/regex.js +3 -0
  238. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/rng.js +21 -0
  239. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/sha1.js +96 -0
  240. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/stringify.js +31 -0
  241. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v1.js +96 -0
  242. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v3.js +6 -0
  243. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v35.js +66 -0
  244. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v4.js +24 -0
  245. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v5.js +6 -0
  246. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/validate.js +7 -0
  247. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/version.js +11 -0
  248. package/bundle/packages/rln/node_modules/@noble/hashes/_assert.js +52 -0
  249. package/bundle/packages/rln/node_modules/@noble/hashes/_sha2.js +124 -0
  250. package/bundle/packages/rln/node_modules/@noble/hashes/_u64.js +71 -0
  251. package/bundle/packages/rln/node_modules/@noble/hashes/cryptoBrowser.js +10 -0
  252. package/bundle/packages/rln/node_modules/@noble/hashes/hmac.js +88 -0
  253. package/bundle/packages/rln/node_modules/@noble/hashes/pbkdf2.js +99 -0
  254. package/bundle/packages/rln/node_modules/@noble/hashes/scrypt.js +233 -0
  255. package/bundle/packages/rln/node_modules/@noble/hashes/sha256.js +133 -0
  256. package/bundle/packages/rln/node_modules/@noble/hashes/sha512.js +243 -0
  257. package/bundle/packages/rln/node_modules/@noble/hashes/utils.js +167 -0
  258. package/bundle/packages/rln/node_modules/uuid/dist/esm-browser/native.js +4 -0
  259. package/bundle/packages/rln/node_modules/uuid/dist/esm-browser/rng.js +13 -0
  260. package/bundle/packages/rln/node_modules/uuid/dist/esm-browser/stringify.js +28 -0
  261. package/bundle/packages/rln/node_modules/uuid/dist/esm-browser/v4.js +19 -0
  262. package/bundle/packages/utils/dist/bytes/index.js +44 -0
  263. package/bundle/packages/utils/dist/common/sharding/index.js +91 -0
  264. package/bundle/packages/utils/dist/logger/index.js +31 -0
  265. package/bundle/resources/verification_key.d.ts +13 -0
  266. package/bundle/resources/verification_key.js +112 -0
  267. package/bundle/resources/witness_calculator.d.ts +11 -0
  268. package/bundle/resources/witness_calculator.js +328 -0
  269. package/dist/.tsbuildinfo +1 -0
  270. package/dist/codec.d.ts +5 -5
  271. package/dist/codec.js +6 -6
  272. package/dist/codec.js.map +1 -1
  273. package/dist/contract/abi.d.ts +42 -0
  274. package/dist/contract/abi.js +393 -0
  275. package/dist/contract/abi.js.map +1 -0
  276. package/dist/contract/constants.d.ts +59 -3
  277. package/dist/contract/constants.js +21 -63
  278. package/dist/contract/constants.js.map +1 -1
  279. package/dist/contract/rln_contract.d.ts +98 -17
  280. package/dist/contract/rln_contract.js +292 -71
  281. package/dist/contract/rln_contract.js.map +1 -1
  282. package/dist/identity.js +5 -2
  283. package/dist/identity.js.map +1 -1
  284. package/dist/index.d.ts +3 -3
  285. package/dist/index.js +3 -3
  286. package/dist/index.js.map +1 -1
  287. package/dist/keystore/cipher.js +3 -3
  288. package/dist/keystore/cipher.js.map +1 -1
  289. package/dist/keystore/credential_validation_generated.js.map +1 -1
  290. package/dist/keystore/keystore.js +4 -4
  291. package/dist/keystore/keystore.js.map +1 -1
  292. package/dist/keystore/keystore_validation_generated.js.map +1 -1
  293. package/dist/message.js +3 -3
  294. package/dist/message.js.map +1 -1
  295. package/dist/proof.js +3 -2
  296. package/dist/proof.js.map +1 -1
  297. package/dist/resources/verification_key.d.ts +12 -11
  298. package/dist/resources/verification_key.js +103 -103
  299. package/dist/resources/witness_calculator.d.ts +10 -15
  300. package/dist/resources/witness_calculator.js +302 -265
  301. package/dist/rln.d.ts +5 -1
  302. package/dist/rln.js +56 -28
  303. package/dist/rln.js.map +1 -1
  304. package/dist/root_tracker.js.map +1 -1
  305. package/dist/utils/epoch.js +5 -5
  306. package/dist/utils/epoch.js.map +1 -1
  307. package/dist/zerokit.d.ts +13 -9
  308. package/dist/zerokit.js +40 -20
  309. package/dist/zerokit.js.map +1 -1
  310. package/package.json +1 -146
  311. package/src/codec.ts +26 -22
  312. package/src/contract/abi.ts +392 -0
  313. package/src/contract/constants.ts +28 -0
  314. package/src/contract/index.ts +2 -0
  315. package/src/contract/rln_contract.ts +686 -0
  316. package/src/identity.ts +8 -4
  317. package/src/index.ts +4 -9
  318. package/src/keystore/cipher.ts +54 -0
  319. package/src/keystore/credential_validation_generated.ts +7 -0
  320. package/src/keystore/index.ts +5 -0
  321. package/src/keystore/keystore.ts +330 -0
  322. package/src/keystore/keystore_validation_generated.ts +7 -0
  323. package/src/keystore/schema_validator.ts +34 -0
  324. package/src/keystore/types.ts +36 -0
  325. package/src/message.ts +10 -10
  326. package/src/proof.ts +13 -11
  327. package/src/resources/verification_key.d.ts +13 -0
  328. package/src/resources/witness_calculator.d.ts +11 -0
  329. package/src/rln.ts +76 -31
  330. package/src/root_tracker.ts +7 -6
  331. package/src/utils/bytes.ts +84 -0
  332. package/src/utils/epoch.ts +30 -0
  333. package/src/utils/hash.ts +15 -0
  334. package/src/utils/index.ts +9 -0
  335. package/src/utils/metamask.ts +17 -0
  336. package/src/zerokit.ts +95 -33
  337. package/bundle/assets/rln_wasm_bg-a503e304.wasm +0 -0
  338. package/dist/resources/verification_key.js.map +0 -1
  339. package/dist/resources/witness_calculator.js.map +0 -1
  340. /package/bundle/{assets/rln-6ded2896.wasm → resources/rln.wasm} +0 -0
  341. /package/bundle/{assets/rln_final-8b299152.zkey → resources/rln_final.zkey} +0 -0
@@ -0,0 +1,756 @@
1
+ let wasm;
2
+
3
+ const heap = new Array(128).fill(undefined);
4
+
5
+ heap.push(undefined, null, true, false);
6
+
7
+ function getObject(idx) { return heap[idx]; }
8
+
9
+ let heap_next = heap.length;
10
+
11
+ function dropObject(idx) {
12
+ if (idx < 132) return;
13
+ heap[idx] = heap_next;
14
+ heap_next = idx;
15
+ }
16
+
17
+ function takeObject(idx) {
18
+ const ret = getObject(idx);
19
+ dropObject(idx);
20
+ return ret;
21
+ }
22
+
23
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
24
+
25
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }
26
+ let cachedUint8Memory0 = null;
27
+
28
+ function getUint8Memory0() {
29
+ if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
30
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
31
+ }
32
+ return cachedUint8Memory0;
33
+ }
34
+
35
+ function getStringFromWasm0(ptr, len) {
36
+ ptr = ptr >>> 0;
37
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
38
+ }
39
+
40
+ function addHeapObject(obj) {
41
+ if (heap_next === heap.length) heap.push(heap.length + 1);
42
+ const idx = heap_next;
43
+ heap_next = heap[idx];
44
+
45
+ heap[idx] = obj;
46
+ return idx;
47
+ }
48
+
49
+ let WASM_VECTOR_LEN = 0;
50
+
51
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
52
+
53
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
54
+ ? function (arg, view) {
55
+ return cachedTextEncoder.encodeInto(arg, view);
56
+ }
57
+ : function (arg, view) {
58
+ const buf = cachedTextEncoder.encode(arg);
59
+ view.set(buf);
60
+ return {
61
+ read: arg.length,
62
+ written: buf.length
63
+ };
64
+ });
65
+
66
+ function passStringToWasm0(arg, malloc, realloc) {
67
+
68
+ if (realloc === undefined) {
69
+ const buf = cachedTextEncoder.encode(arg);
70
+ const ptr = malloc(buf.length) >>> 0;
71
+ getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
72
+ WASM_VECTOR_LEN = buf.length;
73
+ return ptr;
74
+ }
75
+
76
+ let len = arg.length;
77
+ let ptr = malloc(len) >>> 0;
78
+
79
+ const mem = getUint8Memory0();
80
+
81
+ let offset = 0;
82
+
83
+ for (; offset < len; offset++) {
84
+ const code = arg.charCodeAt(offset);
85
+ if (code > 0x7F) break;
86
+ mem[ptr + offset] = code;
87
+ }
88
+
89
+ if (offset !== len) {
90
+ if (offset !== 0) {
91
+ arg = arg.slice(offset);
92
+ }
93
+ ptr = realloc(ptr, len, len = offset + arg.length * 3) >>> 0;
94
+ const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
95
+ const ret = encodeString(arg, view);
96
+
97
+ offset += ret.written;
98
+ }
99
+
100
+ WASM_VECTOR_LEN = offset;
101
+ return ptr;
102
+ }
103
+
104
+ function isLikeNone(x) {
105
+ return x === undefined || x === null;
106
+ }
107
+
108
+ let cachedInt32Memory0 = null;
109
+
110
+ function getInt32Memory0() {
111
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
112
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
113
+ }
114
+ return cachedInt32Memory0;
115
+ }
116
+
117
+ function debugString(val) {
118
+ // primitive types
119
+ const type = typeof val;
120
+ if (type == 'number' || type == 'boolean' || val == null) {
121
+ return `${val}`;
122
+ }
123
+ if (type == 'string') {
124
+ return `"${val}"`;
125
+ }
126
+ if (type == 'symbol') {
127
+ const description = val.description;
128
+ if (description == null) {
129
+ return 'Symbol';
130
+ } else {
131
+ return `Symbol(${description})`;
132
+ }
133
+ }
134
+ if (type == 'function') {
135
+ const name = val.name;
136
+ if (typeof name == 'string' && name.length > 0) {
137
+ return `Function(${name})`;
138
+ } else {
139
+ return 'Function';
140
+ }
141
+ }
142
+ // objects
143
+ if (Array.isArray(val)) {
144
+ const length = val.length;
145
+ let debug = '[';
146
+ if (length > 0) {
147
+ debug += debugString(val[0]);
148
+ }
149
+ for(let i = 1; i < length; i++) {
150
+ debug += ', ' + debugString(val[i]);
151
+ }
152
+ debug += ']';
153
+ return debug;
154
+ }
155
+ // Test for built-in
156
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
157
+ let className;
158
+ if (builtInMatches.length > 1) {
159
+ className = builtInMatches[1];
160
+ } else {
161
+ // Failed to match the standard '[object ClassName]'
162
+ return toString.call(val);
163
+ }
164
+ if (className == 'Object') {
165
+ // we're a user defined class or Object
166
+ // JSON.stringify avoids problems with cycles, and is generally much
167
+ // easier than looping through ownProperties of `val`.
168
+ try {
169
+ return 'Object(' + JSON.stringify(val) + ')';
170
+ } catch (_) {
171
+ return 'Object';
172
+ }
173
+ }
174
+ // errors
175
+ if (val instanceof Error) {
176
+ return `${val.name}: ${val.message}\n${val.stack}`;
177
+ }
178
+ // TODO we could test for more things here, like `Set`s and `Map`s.
179
+ return className;
180
+ }
181
+ /**
182
+ */
183
+ function init_panic_hook() {
184
+ wasm.init_panic_hook();
185
+ }
186
+
187
+ /**
188
+ * @param {number} tree_height
189
+ * @param {Uint8Array} zkey
190
+ * @param {Uint8Array} vk
191
+ * @returns {number}
192
+ */
193
+ function newRLN(tree_height, zkey, vk) {
194
+ try {
195
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
196
+ wasm.newRLN(retptr, tree_height, addHeapObject(zkey), addHeapObject(vk));
197
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
198
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
199
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
200
+ if (r2) {
201
+ throw takeObject(r1);
202
+ }
203
+ return r0;
204
+ } finally {
205
+ wasm.__wbindgen_add_to_stack_pointer(16);
206
+ }
207
+ }
208
+
209
+ /**
210
+ * @param {number} ctx
211
+ * @param {Uint8Array} input
212
+ * @returns {Uint8Array}
213
+ */
214
+ function getSerializedRLNWitness(ctx, input) {
215
+ try {
216
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
217
+ wasm.getSerializedRLNWitness(retptr, ctx, addHeapObject(input));
218
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
219
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
220
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
221
+ if (r2) {
222
+ throw takeObject(r1);
223
+ }
224
+ return takeObject(r0);
225
+ } finally {
226
+ wasm.__wbindgen_add_to_stack_pointer(16);
227
+ }
228
+ }
229
+
230
+ /**
231
+ * @param {number} ctx
232
+ * @param {Uint8Array} input
233
+ */
234
+ function insertMember(ctx, input) {
235
+ try {
236
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
237
+ wasm.insertMember(retptr, ctx, addHeapObject(input));
238
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
239
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
240
+ if (r1) {
241
+ throw takeObject(r0);
242
+ }
243
+ } finally {
244
+ wasm.__wbindgen_add_to_stack_pointer(16);
245
+ }
246
+ }
247
+
248
+ /**
249
+ * @param {number} ctx
250
+ * @param {number} index
251
+ * @param {Uint8Array} input
252
+ */
253
+ function setLeavesFrom(ctx, index, input) {
254
+ try {
255
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
256
+ wasm.setLeavesFrom(retptr, ctx, index, addHeapObject(input));
257
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
258
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
259
+ if (r1) {
260
+ throw takeObject(r0);
261
+ }
262
+ } finally {
263
+ wasm.__wbindgen_add_to_stack_pointer(16);
264
+ }
265
+ }
266
+
267
+ /**
268
+ * @param {number} ctx
269
+ * @param {number} index
270
+ */
271
+ function deleteLeaf(ctx, index) {
272
+ try {
273
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
274
+ wasm.deleteLeaf(retptr, ctx, index);
275
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
276
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
277
+ if (r1) {
278
+ throw takeObject(r0);
279
+ }
280
+ } finally {
281
+ wasm.__wbindgen_add_to_stack_pointer(16);
282
+ }
283
+ }
284
+
285
+ /**
286
+ * @param {number} ctx
287
+ * @param {Uint8Array} serialized_witness
288
+ * @returns {object}
289
+ */
290
+ function RLNWitnessToJson(ctx, serialized_witness) {
291
+ try {
292
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
293
+ wasm.RLNWitnessToJson(retptr, ctx, addHeapObject(serialized_witness));
294
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
295
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
296
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
297
+ if (r2) {
298
+ throw takeObject(r1);
299
+ }
300
+ return takeObject(r0);
301
+ } finally {
302
+ wasm.__wbindgen_add_to_stack_pointer(16);
303
+ }
304
+ }
305
+
306
+ let cachedUint32Memory0 = null;
307
+
308
+ function getUint32Memory0() {
309
+ if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
310
+ cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
311
+ }
312
+ return cachedUint32Memory0;
313
+ }
314
+
315
+ function passArrayJsValueToWasm0(array, malloc) {
316
+ const ptr = malloc(array.length * 4) >>> 0;
317
+ const mem = getUint32Memory0();
318
+ for (let i = 0; i < array.length; i++) {
319
+ mem[ptr / 4 + i] = addHeapObject(array[i]);
320
+ }
321
+ WASM_VECTOR_LEN = array.length;
322
+ return ptr;
323
+ }
324
+ /**
325
+ * @param {number} ctx
326
+ * @param {(bigint)[]} calculated_witness
327
+ * @param {Uint8Array} serialized_witness
328
+ * @returns {Uint8Array}
329
+ */
330
+ function generate_rln_proof_with_witness(ctx, calculated_witness, serialized_witness) {
331
+ try {
332
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
333
+ const ptr0 = passArrayJsValueToWasm0(calculated_witness, wasm.__wbindgen_malloc);
334
+ const len0 = WASM_VECTOR_LEN;
335
+ wasm.generate_rln_proof_with_witness(retptr, ctx, ptr0, len0, addHeapObject(serialized_witness));
336
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
337
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
338
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
339
+ if (r2) {
340
+ throw takeObject(r1);
341
+ }
342
+ return takeObject(r0);
343
+ } finally {
344
+ wasm.__wbindgen_add_to_stack_pointer(16);
345
+ }
346
+ }
347
+
348
+ /**
349
+ * @param {number} ctx
350
+ * @returns {Uint8Array}
351
+ */
352
+ function generateExtendedMembershipKey(ctx) {
353
+ try {
354
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
355
+ wasm.generateExtendedMembershipKey(retptr, ctx);
356
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
357
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
358
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
359
+ if (r2) {
360
+ throw takeObject(r1);
361
+ }
362
+ return takeObject(r0);
363
+ } finally {
364
+ wasm.__wbindgen_add_to_stack_pointer(16);
365
+ }
366
+ }
367
+
368
+ /**
369
+ * @param {number} ctx
370
+ * @param {Uint8Array} seed
371
+ * @returns {Uint8Array}
372
+ */
373
+ function generateSeededExtendedMembershipKey(ctx, seed) {
374
+ try {
375
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
376
+ wasm.generateSeededExtendedMembershipKey(retptr, ctx, addHeapObject(seed));
377
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
378
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
379
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
380
+ if (r2) {
381
+ throw takeObject(r1);
382
+ }
383
+ return takeObject(r0);
384
+ } finally {
385
+ wasm.__wbindgen_add_to_stack_pointer(16);
386
+ }
387
+ }
388
+
389
+ /**
390
+ * @param {number} ctx
391
+ * @param {Uint8Array} proof
392
+ * @returns {boolean}
393
+ */
394
+ function verifyRLNProof(ctx, proof) {
395
+ try {
396
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
397
+ wasm.verifyRLNProof(retptr, ctx, addHeapObject(proof));
398
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
399
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
400
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
401
+ if (r2) {
402
+ throw takeObject(r1);
403
+ }
404
+ return r0 !== 0;
405
+ } finally {
406
+ wasm.__wbindgen_add_to_stack_pointer(16);
407
+ }
408
+ }
409
+
410
+ /**
411
+ * @param {number} ctx
412
+ * @param {Uint8Array} proof
413
+ * @param {Uint8Array} roots
414
+ * @returns {boolean}
415
+ */
416
+ function verifyWithRoots(ctx, proof, roots) {
417
+ try {
418
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
419
+ wasm.verifyWithRoots(retptr, ctx, addHeapObject(proof), addHeapObject(roots));
420
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
421
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
422
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
423
+ if (r2) {
424
+ throw takeObject(r1);
425
+ }
426
+ return r0 !== 0;
427
+ } finally {
428
+ wasm.__wbindgen_add_to_stack_pointer(16);
429
+ }
430
+ }
431
+
432
+ /**
433
+ * @param {number} ctx
434
+ * @returns {Uint8Array}
435
+ */
436
+ function getRoot(ctx) {
437
+ try {
438
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
439
+ wasm.getRoot(retptr, ctx);
440
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
441
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
442
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
443
+ if (r2) {
444
+ throw takeObject(r1);
445
+ }
446
+ return takeObject(r0);
447
+ } finally {
448
+ wasm.__wbindgen_add_to_stack_pointer(16);
449
+ }
450
+ }
451
+
452
+ /**
453
+ * @param {Uint8Array} input
454
+ * @returns {Uint8Array}
455
+ */
456
+ function poseidonHash(input) {
457
+ try {
458
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
459
+ wasm.poseidonHash(retptr, addHeapObject(input));
460
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
461
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
462
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
463
+ if (r2) {
464
+ throw takeObject(r1);
465
+ }
466
+ return takeObject(r0);
467
+ } finally {
468
+ wasm.__wbindgen_add_to_stack_pointer(16);
469
+ }
470
+ }
471
+
472
+ function handleError(f, args) {
473
+ try {
474
+ return f.apply(this, args);
475
+ } catch (e) {
476
+ wasm.__wbindgen_exn_store(addHeapObject(e));
477
+ }
478
+ }
479
+
480
+ async function __wbg_load(module, imports) {
481
+ if (typeof Response === 'function' && module instanceof Response) {
482
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
483
+ try {
484
+ return await WebAssembly.instantiateStreaming(module, imports);
485
+
486
+ } catch (e) {
487
+ if (module.headers.get('Content-Type') != 'application/wasm') {
488
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
489
+
490
+ } else {
491
+ throw e;
492
+ }
493
+ }
494
+ }
495
+
496
+ const bytes = await module.arrayBuffer();
497
+ return await WebAssembly.instantiate(bytes, imports);
498
+
499
+ } else {
500
+ const instance = await WebAssembly.instantiate(module, imports);
501
+
502
+ if (instance instanceof WebAssembly.Instance) {
503
+ return { instance, module };
504
+
505
+ } else {
506
+ return instance;
507
+ }
508
+ }
509
+ }
510
+
511
+ function __wbg_get_imports() {
512
+ const imports = {};
513
+ imports.wbg = {};
514
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
515
+ takeObject(arg0);
516
+ };
517
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
518
+ const ret = getStringFromWasm0(arg0, arg1);
519
+ return addHeapObject(ret);
520
+ };
521
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
522
+ const obj = getObject(arg1);
523
+ const ret = typeof(obj) === 'string' ? obj : undefined;
524
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
525
+ var len1 = WASM_VECTOR_LEN;
526
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
527
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
528
+ };
529
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
530
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
531
+ return addHeapObject(ret);
532
+ };
533
+ imports.wbg.__wbindgen_is_string = function(arg0) {
534
+ const ret = typeof(getObject(arg0)) === 'string';
535
+ return ret;
536
+ };
537
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
538
+ const ret = getObject(arg0);
539
+ return addHeapObject(ret);
540
+ };
541
+ imports.wbg.__wbindgen_is_object = function(arg0) {
542
+ const val = getObject(arg0);
543
+ const ret = typeof(val) === 'object' && val !== null;
544
+ return ret;
545
+ };
546
+ imports.wbg.__wbg_String_91fba7ded13ba54c = function(arg0, arg1) {
547
+ const ret = String(getObject(arg1));
548
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
549
+ const len1 = WASM_VECTOR_LEN;
550
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
551
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
552
+ };
553
+ imports.wbg.__wbindgen_number_new = function(arg0) {
554
+ const ret = arg0;
555
+ return addHeapObject(ret);
556
+ };
557
+ imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
558
+ const ret = arg0;
559
+ return addHeapObject(ret);
560
+ };
561
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
562
+ const ret = BigInt.asUintN(64, arg0);
563
+ return addHeapObject(ret);
564
+ };
565
+ imports.wbg.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
566
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
567
+ };
568
+ imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
569
+ const ret = new Error();
570
+ return addHeapObject(ret);
571
+ };
572
+ imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
573
+ const ret = getObject(arg1).stack;
574
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
575
+ const len1 = WASM_VECTOR_LEN;
576
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
577
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
578
+ };
579
+ imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
580
+ let deferred0_0;
581
+ let deferred0_1;
582
+ try {
583
+ deferred0_0 = arg0;
584
+ deferred0_1 = arg1;
585
+ console.error(getStringFromWasm0(arg0, arg1));
586
+ } finally {
587
+ wasm.__wbindgen_free(deferred0_0, deferred0_1);
588
+ }
589
+ };
590
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
591
+ const ret = getObject(arg0) === undefined;
592
+ return ret;
593
+ };
594
+ imports.wbg.__wbg_crypto_70a96de3b6b73dac = function(arg0) {
595
+ const ret = getObject(arg0).crypto;
596
+ return addHeapObject(ret);
597
+ };
598
+ imports.wbg.__wbg_process_dd1577445152112e = function(arg0) {
599
+ const ret = getObject(arg0).process;
600
+ return addHeapObject(ret);
601
+ };
602
+ imports.wbg.__wbg_versions_58036bec3add9e6f = function(arg0) {
603
+ const ret = getObject(arg0).versions;
604
+ return addHeapObject(ret);
605
+ };
606
+ imports.wbg.__wbg_node_6a9d28205ed5b0d8 = function(arg0) {
607
+ const ret = getObject(arg0).node;
608
+ return addHeapObject(ret);
609
+ };
610
+ imports.wbg.__wbg_msCrypto_adbc770ec9eca9c7 = function(arg0) {
611
+ const ret = getObject(arg0).msCrypto;
612
+ return addHeapObject(ret);
613
+ };
614
+ imports.wbg.__wbg_require_f05d779769764e82 = function() { return handleError(function () {
615
+ const ret = module.require;
616
+ return addHeapObject(ret);
617
+ }, arguments) };
618
+ imports.wbg.__wbindgen_is_function = function(arg0) {
619
+ const ret = typeof(getObject(arg0)) === 'function';
620
+ return ret;
621
+ };
622
+ imports.wbg.__wbg_getRandomValues_3774744e221a22ad = function() { return handleError(function (arg0, arg1) {
623
+ getObject(arg0).getRandomValues(getObject(arg1));
624
+ }, arguments) };
625
+ imports.wbg.__wbg_randomFillSync_e950366c42764a07 = function() { return handleError(function (arg0, arg1) {
626
+ getObject(arg0).randomFillSync(takeObject(arg1));
627
+ }, arguments) };
628
+ imports.wbg.__wbg_new_18bc2084e9a3e1ff = function() {
629
+ const ret = new Array();
630
+ return addHeapObject(ret);
631
+ };
632
+ imports.wbg.__wbg_newnoargs_e643855c6572a4a8 = function(arg0, arg1) {
633
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
634
+ return addHeapObject(ret);
635
+ };
636
+ imports.wbg.__wbg_new_b6fd0149e79ffce8 = function() {
637
+ const ret = new Map();
638
+ return addHeapObject(ret);
639
+ };
640
+ imports.wbg.__wbg_call_f96b398515635514 = function() { return handleError(function (arg0, arg1) {
641
+ const ret = getObject(arg0).call(getObject(arg1));
642
+ return addHeapObject(ret);
643
+ }, arguments) };
644
+ imports.wbg.__wbg_new_7befa02319b36069 = function() {
645
+ const ret = new Object();
646
+ return addHeapObject(ret);
647
+ };
648
+ imports.wbg.__wbg_self_b9aad7f1c618bfaf = function() { return handleError(function () {
649
+ const ret = self.self;
650
+ return addHeapObject(ret);
651
+ }, arguments) };
652
+ imports.wbg.__wbg_window_55e469842c98b086 = function() { return handleError(function () {
653
+ const ret = window.window;
654
+ return addHeapObject(ret);
655
+ }, arguments) };
656
+ imports.wbg.__wbg_globalThis_d0957e302752547e = function() { return handleError(function () {
657
+ const ret = globalThis.globalThis;
658
+ return addHeapObject(ret);
659
+ }, arguments) };
660
+ imports.wbg.__wbg_global_ae2f87312b8987fb = function() { return handleError(function () {
661
+ const ret = global.global;
662
+ return addHeapObject(ret);
663
+ }, arguments) };
664
+ imports.wbg.__wbg_set_aee8682c7ee9ac44 = function(arg0, arg1, arg2) {
665
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
666
+ };
667
+ imports.wbg.__wbg_toString_27ba0397f8cf84a6 = function() { return handleError(function (arg0, arg1) {
668
+ const ret = getObject(arg0).toString(arg1);
669
+ return addHeapObject(ret);
670
+ }, arguments) };
671
+ imports.wbg.__wbg_call_35782e9a1aa5e091 = function() { return handleError(function (arg0, arg1, arg2) {
672
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
673
+ return addHeapObject(ret);
674
+ }, arguments) };
675
+ imports.wbg.__wbg_set_6c1b2b7b73337778 = function(arg0, arg1, arg2) {
676
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
677
+ return addHeapObject(ret);
678
+ };
679
+ imports.wbg.__wbg_fromEntries_10a57760b5d7d9b8 = function() { return handleError(function (arg0) {
680
+ const ret = Object.fromEntries(getObject(arg0));
681
+ return addHeapObject(ret);
682
+ }, arguments) };
683
+ imports.wbg.__wbg_buffer_fcbfb6d88b2732e9 = function(arg0) {
684
+ const ret = getObject(arg0).buffer;
685
+ return addHeapObject(ret);
686
+ };
687
+ imports.wbg.__wbg_newwithbyteoffsetandlength_92c251989c485785 = function(arg0, arg1, arg2) {
688
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
689
+ return addHeapObject(ret);
690
+ };
691
+ imports.wbg.__wbg_new_bc5d9aad3f9ac80e = function(arg0) {
692
+ const ret = new Uint8Array(getObject(arg0));
693
+ return addHeapObject(ret);
694
+ };
695
+ imports.wbg.__wbg_set_4b3aa8445ac1e91c = function(arg0, arg1, arg2) {
696
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
697
+ };
698
+ imports.wbg.__wbg_length_d9c4ded7e708c6a1 = function(arg0) {
699
+ const ret = getObject(arg0).length;
700
+ return ret;
701
+ };
702
+ imports.wbg.__wbg_newwithlength_89eca18f2603a999 = function(arg0) {
703
+ const ret = new Uint8Array(arg0 >>> 0);
704
+ return addHeapObject(ret);
705
+ };
706
+ imports.wbg.__wbg_subarray_7649d027b2b141b3 = function(arg0, arg1, arg2) {
707
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
708
+ return addHeapObject(ret);
709
+ };
710
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
711
+ const ret = debugString(getObject(arg1));
712
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
713
+ const len1 = WASM_VECTOR_LEN;
714
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
715
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
716
+ };
717
+ imports.wbg.__wbindgen_throw = function(arg0, arg1) {
718
+ throw new Error(getStringFromWasm0(arg0, arg1));
719
+ };
720
+ imports.wbg.__wbindgen_memory = function() {
721
+ const ret = wasm.memory;
722
+ return addHeapObject(ret);
723
+ };
724
+
725
+ return imports;
726
+ }
727
+
728
+ function __wbg_finalize_init(instance, module) {
729
+ wasm = instance.exports;
730
+ __wbg_init.__wbindgen_wasm_module = module;
731
+ cachedInt32Memory0 = null;
732
+ cachedUint32Memory0 = null;
733
+ cachedUint8Memory0 = null;
734
+
735
+
736
+ return wasm;
737
+ }
738
+
739
+ async function __wbg_init(input) {
740
+ if (wasm !== undefined) return wasm;
741
+
742
+ if (typeof input === 'undefined') {
743
+ input = new URL('rln_wasm_bg.wasm', import.meta.url);
744
+ }
745
+ const imports = __wbg_get_imports();
746
+
747
+ if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
748
+ input = fetch(input);
749
+ }
750
+
751
+ const { instance, module } = await __wbg_load(await input, imports);
752
+
753
+ return __wbg_finalize_init(instance, module);
754
+ }
755
+
756
+ export { RLNWitnessToJson, __wbg_init as default, deleteLeaf, generateExtendedMembershipKey, generateSeededExtendedMembershipKey, generate_rln_proof_with_witness, getRoot, getSerializedRLNWitness, init_panic_hook, insertMember, newRLN, poseidonHash, setLeavesFrom, verifyRLNProof, verifyWithRoots };