@waku/rln 0.1.3-f6d5deb → 0.1.4-2a94244.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.
- package/README.md +10 -186
- package/bundle/_virtual/__node-resolve_empty.js +6 -0
- package/bundle/_virtual/_assert.js +3 -0
- package/bundle/_virtual/_commonjs-dynamic-modules.js +5 -0
- package/bundle/_virtual/_commonjsHelpers.js +32 -0
- package/bundle/_virtual/_node-resolve_empty.js +3 -0
- package/bundle/_virtual/_sha2.js +3 -0
- package/bundle/_virtual/_u64.js +3 -0
- package/bundle/_virtual/aes.js +3 -0
- package/bundle/_virtual/bn.js +3 -0
- package/bundle/_virtual/browser.js +3 -0
- package/bundle/_virtual/checksum.js +3 -0
- package/bundle/_virtual/cipher.js +3 -0
- package/bundle/_virtual/class.js +3 -0
- package/bundle/_virtual/common.js +3 -0
- package/bundle/_virtual/common2.js +3 -0
- package/bundle/_virtual/cryptoBrowser.js +3 -0
- package/bundle/_virtual/functional.js +3 -0
- package/bundle/_virtual/hash.js +3 -0
- package/bundle/_virtual/hmac.js +3 -0
- package/bundle/_virtual/index.js +3 -0
- package/bundle/_virtual/index2.js +6 -0
- package/bundle/_virtual/inherits_browser.js +3 -0
- package/bundle/_virtual/kdf.js +3 -0
- package/bundle/_virtual/lodash.js +3 -0
- package/bundle/_virtual/password.js +3 -0
- package/bundle/_virtual/pbkdf2.js +3 -0
- package/bundle/_virtual/pbkdf22.js +3 -0
- package/bundle/_virtual/random.js +3 -0
- package/bundle/_virtual/ripemd.js +3 -0
- package/bundle/_virtual/schema-validation-generated.js +3 -0
- package/bundle/_virtual/schema-validation.js +3 -0
- package/bundle/_virtual/scrypt.js +3 -0
- package/bundle/_virtual/scrypt2.js +3 -0
- package/bundle/_virtual/sha.js +3 -0
- package/bundle/_virtual/sha256.js +3 -0
- package/bundle/_virtual/sha2562.js +3 -0
- package/bundle/_virtual/sha3.js +3 -0
- package/bundle/_virtual/sha512.js +3 -0
- package/bundle/_virtual/types.js +3 -0
- package/bundle/_virtual/utils.js +3 -0
- package/bundle/_virtual/utils2.js +3 -0
- package/bundle/_virtual/utils3.js +3 -0
- package/bundle/index.js +12 -74804
- package/bundle/node_modules/@ethersproject/abi/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/abi-coder.js +96 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js +148 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/address.js +26 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/anonymous.js +20 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/array.js +210 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/boolean.js +18 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/bytes.js +30 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/fixed-bytes.js +26 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/null.js +22 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/number.js +43 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/string.js +19 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/tuple.js +58 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/fragments.js +854 -0
- package/bundle/node_modules/@ethersproject/abi/lib.esm/interface.js +609 -0
- package/bundle/node_modules/@ethersproject/abstract-provider/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/abstract-provider/lib.esm/index.js +66 -0
- package/bundle/node_modules/@ethersproject/abstract-signer/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/abstract-signer/lib.esm/index.js +302 -0
- package/bundle/node_modules/@ethersproject/address/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/address/lib.esm/index.js +110 -0
- package/bundle/node_modules/@ethersproject/base64/lib.esm/base64.js +20 -0
- package/bundle/node_modules/@ethersproject/basex/lib.esm/index.js +120 -0
- package/bundle/node_modules/@ethersproject/bignumber/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/bignumber/lib.esm/bignumber.js +287 -0
- package/bundle/node_modules/@ethersproject/bytes/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/bytes/lib.esm/index.js +402 -0
- package/bundle/node_modules/@ethersproject/constants/lib.esm/addresses.js +3 -0
- package/bundle/node_modules/@ethersproject/constants/lib.esm/bignumbers.js +8 -0
- package/bundle/node_modules/@ethersproject/constants/lib.esm/hashes.js +3 -0
- package/bundle/node_modules/@ethersproject/contracts/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/contracts/lib.esm/index.js +893 -0
- package/bundle/node_modules/@ethersproject/hash/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/decoder.js +256 -0
- package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/include.js +36 -0
- package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/lib.js +135 -0
- package/bundle/node_modules/@ethersproject/hash/lib.esm/id.js +8 -0
- package/bundle/node_modules/@ethersproject/hash/lib.esm/namehash.js +64 -0
- package/bundle/node_modules/@ethersproject/hash/lib.esm/typed-data.js +443 -0
- package/bundle/node_modules/@ethersproject/keccak256/lib.esm/index.js +8 -0
- package/bundle/node_modules/@ethersproject/keccak256/node_modules/js-sha3/src/sha3.js +660 -0
- package/bundle/node_modules/@ethersproject/logger/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/logger/lib.esm/index.js +352 -0
- package/bundle/node_modules/@ethersproject/networks/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/networks/lib.esm/index.js +248 -0
- package/bundle/node_modules/@ethersproject/properties/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/properties/lib.esm/index.js +127 -0
- package/bundle/node_modules/@ethersproject/providers/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/providers/lib.esm/base-provider.js +2007 -0
- package/bundle/node_modules/@ethersproject/providers/lib.esm/formatter.js +422 -0
- package/bundle/node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js +674 -0
- package/bundle/node_modules/@ethersproject/providers/lib.esm/web3-provider.js +132 -0
- package/bundle/node_modules/@ethersproject/rlp/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/rlp/lib.esm/index.js +120 -0
- package/bundle/node_modules/@ethersproject/sha2/lib.esm/sha2.js +8 -0
- package/bundle/node_modules/@ethersproject/signing-key/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/signing-key/lib.esm/elliptic.js +2430 -0
- package/bundle/node_modules/@ethersproject/signing-key/lib.esm/index.js +76 -0
- package/bundle/node_modules/@ethersproject/strings/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/strings/lib.esm/utf8.js +219 -0
- package/bundle/node_modules/@ethersproject/transactions/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/transactions/lib.esm/index.js +279 -0
- package/bundle/node_modules/@ethersproject/web/lib.esm/_version.js +3 -0
- package/bundle/node_modules/@ethersproject/web/lib.esm/geturl.js +69 -0
- package/bundle/node_modules/@ethersproject/web/lib.esm/index.js +404 -0
- package/bundle/node_modules/@multiformats/multiaddr/dist/src/convert.js +15 -0
- package/bundle/node_modules/@multiformats/multiaddr/dist/src/multiaddr.js +20 -0
- package/bundle/node_modules/@multiformats/multiaddr/dist/src/protocols-table.js +92 -0
- package/bundle/node_modules/@noble/hashes/esm/_assert.js +37 -0
- package/bundle/node_modules/@noble/hashes/esm/_md.js +132 -0
- package/bundle/node_modules/@noble/hashes/esm/_u64.js +29 -0
- package/bundle/node_modules/@noble/hashes/esm/sha256.js +113 -0
- package/bundle/node_modules/@noble/hashes/esm/sha3.js +210 -0
- package/bundle/node_modules/@noble/hashes/esm/utils.js +144 -0
- package/bundle/node_modules/@waku/zerokit-rln-wasm/rln_wasm.js +756 -0
- package/bundle/node_modules/bech32/index.js +187 -0
- package/bundle/node_modules/bn.js/lib/bn.js +3361 -0
- package/bundle/node_modules/debug/src/browser.js +283 -0
- package/bundle/node_modules/debug/src/common.js +295 -0
- package/bundle/node_modules/ethereum-cryptography/esm/keccak.js +10 -0
- package/bundle/node_modules/ethereum-cryptography/esm/sha256.js +6 -0
- package/bundle/node_modules/ethereum-cryptography/esm/utils.js +24 -0
- package/bundle/node_modules/hash.js/lib/hash/common.js +97 -0
- package/bundle/node_modules/hash.js/lib/hash/hmac.js +51 -0
- package/bundle/node_modules/hash.js/lib/hash/ripemd.js +152 -0
- package/bundle/node_modules/hash.js/lib/hash/sha/1.js +81 -0
- package/bundle/node_modules/hash.js/lib/hash/sha/224.js +33 -0
- package/bundle/node_modules/hash.js/lib/hash/sha/256.js +113 -0
- package/bundle/node_modules/hash.js/lib/hash/sha/384.js +39 -0
- package/bundle/node_modules/hash.js/lib/hash/sha/512.js +336 -0
- package/bundle/node_modules/hash.js/lib/hash/sha/common.js +53 -0
- package/bundle/node_modules/hash.js/lib/hash/sha.js +14 -0
- package/bundle/node_modules/hash.js/lib/hash/utils.js +282 -0
- package/bundle/node_modules/hash.js/lib/hash.js +33 -0
- package/bundle/node_modules/inherits/inherits_browser.js +33 -0
- package/bundle/node_modules/it-length-prefixed/dist/src/decode.js +6 -0
- package/bundle/node_modules/lodash/lodash.js +17207 -0
- package/bundle/node_modules/minimalistic-assert/index.js +13 -0
- package/bundle/node_modules/ms/index.js +172 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base.js +205 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base10.js +9 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base16.js +16 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base2.js +10 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base256emoji.js +41 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base32.js +58 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base36.js +14 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base58.js +14 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base64.js +28 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base8.js +10 -0
- package/bundle/node_modules/multiformats/dist/src/bases/identity.js +11 -0
- package/bundle/node_modules/multiformats/dist/src/basics.js +15 -0
- package/bundle/node_modules/multiformats/dist/src/bytes.js +18 -0
- package/bundle/node_modules/multiformats/dist/src/codecs/json.js +2 -0
- package/bundle/node_modules/multiformats/dist/src/vendor/base-x.js +170 -0
- package/bundle/node_modules/protons-runtime/dist/src/codec.js +20 -0
- package/bundle/node_modules/protons-runtime/dist/src/codecs/enum.js +24 -0
- package/bundle/node_modules/protons-runtime/dist/src/codecs/message.js +7 -0
- package/bundle/node_modules/protons-runtime/dist/src/decode.js +8 -0
- package/bundle/node_modules/protons-runtime/dist/src/encode.js +11 -0
- package/bundle/node_modules/protons-runtime/dist/src/index.js +30 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/float.js +54 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/longbits.js +175 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/pool.js +28 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/reader.js +367 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/utf8.js +99 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/writer.js +438 -0
- package/bundle/node_modules/uint8-varint/dist/src/index.js +124 -0
- package/bundle/node_modules/uint8arrays/dist/src/alloc.js +17 -0
- package/bundle/node_modules/uint8arrays/dist/src/from-string.js +19 -0
- package/bundle/node_modules/uint8arrays/dist/src/util/bases.js +49 -0
- package/bundle/packages/core/dist/lib/connection_manager/connection_manager.js +21 -0
- package/bundle/packages/core/dist/lib/connection_manager/keep_alive_manager.js +18 -0
- package/bundle/packages/core/dist/lib/filter/filter.js +27 -0
- package/bundle/packages/core/dist/lib/light_push/light_push.js +27 -0
- package/bundle/packages/core/dist/lib/message/version_0.js +154 -0
- package/bundle/packages/core/dist/lib/metadata/metadata.js +27 -0
- package/bundle/packages/core/dist/lib/store/store.js +27 -0
- package/bundle/packages/interfaces/dist/connection_manager.js +19 -0
- package/bundle/packages/interfaces/dist/constants.js +6 -0
- package/bundle/packages/interfaces/dist/health_indicator.js +12 -0
- package/bundle/packages/interfaces/dist/protocols.js +92 -0
- package/bundle/packages/proto/dist/generated/filter.js +445 -0
- package/bundle/packages/proto/dist/generated/filter_v2.js +424 -0
- package/bundle/packages/proto/dist/generated/light_push.js +389 -0
- package/bundle/packages/proto/dist/generated/message.js +213 -0
- package/bundle/packages/proto/dist/generated/metadata.js +130 -0
- package/bundle/packages/proto/dist/generated/peer_exchange.js +209 -0
- package/bundle/packages/proto/dist/generated/sds_message.js +105 -0
- package/bundle/packages/proto/dist/generated/store_v3.js +490 -0
- package/bundle/packages/proto/dist/generated/topic_only_message.js +61 -0
- package/bundle/packages/rln/dist/codec.js +93 -0
- package/bundle/packages/rln/dist/contract/abi.js +394 -0
- package/bundle/packages/rln/dist/contract/constants.js +27 -0
- package/bundle/packages/rln/dist/contract/rln_contract.js +438 -0
- package/bundle/packages/rln/dist/create.js +9 -0
- package/bundle/packages/rln/dist/identity.js +30 -0
- package/bundle/packages/rln/dist/keystore/cipher.js +31 -0
- package/bundle/packages/rln/dist/keystore/credential_validation_generated.js +119 -0
- package/bundle/packages/rln/dist/keystore/keystore.js +223 -0
- package/bundle/packages/rln/dist/keystore/keystore_validation_generated.js +74 -0
- package/bundle/packages/rln/dist/keystore/schema_validator.js +20 -0
- package/bundle/packages/rln/dist/message.js +51 -0
- package/bundle/packages/rln/dist/proof.js +54 -0
- package/bundle/packages/rln/dist/resources/verification_key.js +112 -0
- package/bundle/packages/rln/dist/resources/witness_calculator.js +330 -0
- package/bundle/packages/rln/dist/rln.js +220 -0
- package/bundle/packages/rln/dist/root_tracker.js +76 -0
- package/bundle/packages/rln/dist/utils/bytes.js +65 -0
- package/bundle/packages/rln/dist/utils/epoch.js +39 -0
- package/bundle/packages/rln/dist/utils/hash.js +10 -0
- package/bundle/packages/rln/dist/utils/metamask.js +14 -0
- package/bundle/packages/rln/dist/zerokit.js +128 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/checksum.js +52 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/cipher.js +65 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/class.js +99 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/functional.js +103 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/index.js +28 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/kdf.js +78 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/password.js +17 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/schema-validation-generated.js +1253 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/schema-validation.js +40 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/types.js +5 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/aes.js +103 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/pbkdf2.js +41 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/random.js +17 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/scrypt.js +23 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/sha256.js +12 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/utils.js +77 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/index.js +9 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/md5.js +215 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/nil.js +3 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/parse.js +35 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/regex.js +3 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/rng.js +21 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/sha1.js +96 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/stringify.js +31 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v1.js +96 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v3.js +6 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v35.js +66 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v4.js +24 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v5.js +6 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/validate.js +7 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/version.js +11 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/_assert.js +52 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/_sha2.js +124 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/_u64.js +71 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/cryptoBrowser.js +10 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/hmac.js +88 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/pbkdf2.js +99 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/scrypt.js +233 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/sha256.js +133 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/sha512.js +243 -0
- package/bundle/packages/rln/node_modules/@noble/hashes/utils.js +167 -0
- package/bundle/packages/rln/node_modules/uuid/dist/esm-browser/native.js +4 -0
- package/bundle/packages/rln/node_modules/uuid/dist/esm-browser/rng.js +13 -0
- package/bundle/packages/rln/node_modules/uuid/dist/esm-browser/stringify.js +28 -0
- package/bundle/packages/rln/node_modules/uuid/dist/esm-browser/v4.js +19 -0
- package/bundle/packages/utils/dist/bytes/index.js +44 -0
- package/bundle/packages/utils/dist/common/sharding/index.js +91 -0
- package/bundle/packages/utils/dist/logger/index.js +31 -0
- package/bundle/resources/verification_key.d.ts +13 -0
- package/bundle/resources/verification_key.js +112 -0
- package/bundle/resources/witness_calculator.d.ts +11 -0
- package/bundle/resources/witness_calculator.js +328 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/codec.d.ts +5 -5
- package/dist/codec.js +6 -6
- package/dist/codec.js.map +1 -1
- package/dist/contract/abi.d.ts +42 -0
- package/dist/contract/abi.js +393 -0
- package/dist/contract/abi.js.map +1 -0
- package/dist/contract/constants.d.ts +59 -3
- package/dist/contract/constants.js +21 -63
- package/dist/contract/constants.js.map +1 -1
- package/dist/contract/rln_contract.d.ts +98 -17
- package/dist/contract/rln_contract.js +292 -71
- package/dist/contract/rln_contract.js.map +1 -1
- package/dist/identity.js +5 -2
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/keystore/cipher.js +3 -3
- package/dist/keystore/cipher.js.map +1 -1
- package/dist/keystore/credential_validation_generated.js.map +1 -1
- package/dist/keystore/keystore.js +4 -4
- package/dist/keystore/keystore.js.map +1 -1
- package/dist/keystore/keystore_validation_generated.js.map +1 -1
- package/dist/message.js +3 -3
- package/dist/message.js.map +1 -1
- package/dist/proof.js +3 -2
- package/dist/proof.js.map +1 -1
- package/dist/resources/verification_key.d.ts +12 -11
- package/dist/resources/verification_key.js +103 -103
- package/dist/resources/witness_calculator.d.ts +10 -15
- package/dist/resources/witness_calculator.js +302 -265
- package/dist/rln.d.ts +5 -1
- package/dist/rln.js +56 -28
- package/dist/rln.js.map +1 -1
- package/dist/root_tracker.js.map +1 -1
- package/dist/utils/epoch.js +5 -5
- package/dist/utils/epoch.js.map +1 -1
- package/dist/zerokit.d.ts +13 -9
- package/dist/zerokit.js +40 -20
- package/dist/zerokit.js.map +1 -1
- package/package.json +1 -146
- package/src/codec.ts +26 -22
- package/src/contract/abi.ts +392 -0
- package/src/contract/constants.ts +28 -0
- package/src/contract/index.ts +2 -0
- package/src/contract/rln_contract.ts +686 -0
- package/src/identity.ts +8 -4
- package/src/index.ts +4 -9
- package/src/keystore/cipher.ts +54 -0
- package/src/keystore/credential_validation_generated.ts +7 -0
- package/src/keystore/index.ts +5 -0
- package/src/keystore/keystore.ts +330 -0
- package/src/keystore/keystore_validation_generated.ts +7 -0
- package/src/keystore/schema_validator.ts +34 -0
- package/src/keystore/types.ts +36 -0
- package/src/message.ts +10 -10
- package/src/proof.ts +13 -11
- package/src/resources/verification_key.d.ts +13 -0
- package/src/resources/witness_calculator.d.ts +11 -0
- package/src/rln.ts +76 -31
- package/src/root_tracker.ts +7 -6
- package/src/utils/bytes.ts +84 -0
- package/src/utils/epoch.ts +30 -0
- package/src/utils/hash.ts +15 -0
- package/src/utils/index.ts +9 -0
- package/src/utils/metamask.ts +17 -0
- package/src/zerokit.ts +95 -33
- package/bundle/assets/rln_wasm_bg-a503e304.wasm +0 -0
- package/dist/resources/verification_key.js.map +0 -1
- package/dist/resources/witness_calculator.js.map +0 -1
- /package/bundle/{assets/rln-6ded2896.wasm → resources/rln.wasm} +0 -0
- /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 };
|