@waku/rln 0.1.3-f6d5deb → 0.1.4-d27db21.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,187 @@
|
|
1
|
+
import { getDefaultExportFromCjs } from '../../_virtual/_commonjsHelpers.js';
|
2
|
+
|
3
|
+
var ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l';
|
4
|
+
|
5
|
+
// pre-compute lookup table
|
6
|
+
var ALPHABET_MAP = {};
|
7
|
+
for (var z = 0; z < ALPHABET.length; z++) {
|
8
|
+
var x = ALPHABET.charAt(z);
|
9
|
+
|
10
|
+
if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')
|
11
|
+
ALPHABET_MAP[x] = z;
|
12
|
+
}
|
13
|
+
|
14
|
+
function polymodStep (pre) {
|
15
|
+
var b = pre >> 25;
|
16
|
+
return ((pre & 0x1FFFFFF) << 5) ^
|
17
|
+
(-((b >> 0) & 1) & 0x3b6a57b2) ^
|
18
|
+
(-((b >> 1) & 1) & 0x26508e6d) ^
|
19
|
+
(-((b >> 2) & 1) & 0x1ea119fa) ^
|
20
|
+
(-((b >> 3) & 1) & 0x3d4233dd) ^
|
21
|
+
(-((b >> 4) & 1) & 0x2a1462b3)
|
22
|
+
}
|
23
|
+
|
24
|
+
function prefixChk (prefix) {
|
25
|
+
var chk = 1;
|
26
|
+
for (var i = 0; i < prefix.length; ++i) {
|
27
|
+
var c = prefix.charCodeAt(i);
|
28
|
+
if (c < 33 || c > 126) return 'Invalid prefix (' + prefix + ')'
|
29
|
+
|
30
|
+
chk = polymodStep(chk) ^ (c >> 5);
|
31
|
+
}
|
32
|
+
chk = polymodStep(chk);
|
33
|
+
|
34
|
+
for (i = 0; i < prefix.length; ++i) {
|
35
|
+
var v = prefix.charCodeAt(i);
|
36
|
+
chk = polymodStep(chk) ^ (v & 0x1f);
|
37
|
+
}
|
38
|
+
return chk
|
39
|
+
}
|
40
|
+
|
41
|
+
function encode (prefix, words, LIMIT) {
|
42
|
+
LIMIT = LIMIT || 90;
|
43
|
+
if ((prefix.length + 7 + words.length) > LIMIT) throw new TypeError('Exceeds length limit')
|
44
|
+
|
45
|
+
prefix = prefix.toLowerCase();
|
46
|
+
|
47
|
+
// determine chk mod
|
48
|
+
var chk = prefixChk(prefix);
|
49
|
+
if (typeof chk === 'string') throw new Error(chk)
|
50
|
+
|
51
|
+
var result = prefix + '1';
|
52
|
+
for (var i = 0; i < words.length; ++i) {
|
53
|
+
var x = words[i];
|
54
|
+
if ((x >> 5) !== 0) throw new Error('Non 5-bit word')
|
55
|
+
|
56
|
+
chk = polymodStep(chk) ^ x;
|
57
|
+
result += ALPHABET.charAt(x);
|
58
|
+
}
|
59
|
+
|
60
|
+
for (i = 0; i < 6; ++i) {
|
61
|
+
chk = polymodStep(chk);
|
62
|
+
}
|
63
|
+
chk ^= 1;
|
64
|
+
|
65
|
+
for (i = 0; i < 6; ++i) {
|
66
|
+
var v = (chk >> ((5 - i) * 5)) & 0x1f;
|
67
|
+
result += ALPHABET.charAt(v);
|
68
|
+
}
|
69
|
+
|
70
|
+
return result
|
71
|
+
}
|
72
|
+
|
73
|
+
function __decode (str, LIMIT) {
|
74
|
+
LIMIT = LIMIT || 90;
|
75
|
+
if (str.length < 8) return str + ' too short'
|
76
|
+
if (str.length > LIMIT) return 'Exceeds length limit'
|
77
|
+
|
78
|
+
// don't allow mixed case
|
79
|
+
var lowered = str.toLowerCase();
|
80
|
+
var uppered = str.toUpperCase();
|
81
|
+
if (str !== lowered && str !== uppered) return 'Mixed-case string ' + str
|
82
|
+
str = lowered;
|
83
|
+
|
84
|
+
var split = str.lastIndexOf('1');
|
85
|
+
if (split === -1) return 'No separator character for ' + str
|
86
|
+
if (split === 0) return 'Missing prefix for ' + str
|
87
|
+
|
88
|
+
var prefix = str.slice(0, split);
|
89
|
+
var wordChars = str.slice(split + 1);
|
90
|
+
if (wordChars.length < 6) return 'Data too short'
|
91
|
+
|
92
|
+
var chk = prefixChk(prefix);
|
93
|
+
if (typeof chk === 'string') return chk
|
94
|
+
|
95
|
+
var words = [];
|
96
|
+
for (var i = 0; i < wordChars.length; ++i) {
|
97
|
+
var c = wordChars.charAt(i);
|
98
|
+
var v = ALPHABET_MAP[c];
|
99
|
+
if (v === undefined) return 'Unknown character ' + c
|
100
|
+
chk = polymodStep(chk) ^ v;
|
101
|
+
|
102
|
+
// not in the checksum?
|
103
|
+
if (i + 6 >= wordChars.length) continue
|
104
|
+
words.push(v);
|
105
|
+
}
|
106
|
+
|
107
|
+
if (chk !== 1) return 'Invalid checksum for ' + str
|
108
|
+
return { prefix: prefix, words: words }
|
109
|
+
}
|
110
|
+
|
111
|
+
function decodeUnsafe () {
|
112
|
+
var res = __decode.apply(null, arguments);
|
113
|
+
if (typeof res === 'object') return res
|
114
|
+
}
|
115
|
+
|
116
|
+
function decode (str) {
|
117
|
+
var res = __decode.apply(null, arguments);
|
118
|
+
if (typeof res === 'object') return res
|
119
|
+
|
120
|
+
throw new Error(res)
|
121
|
+
}
|
122
|
+
|
123
|
+
function convert (data, inBits, outBits, pad) {
|
124
|
+
var value = 0;
|
125
|
+
var bits = 0;
|
126
|
+
var maxV = (1 << outBits) - 1;
|
127
|
+
|
128
|
+
var result = [];
|
129
|
+
for (var i = 0; i < data.length; ++i) {
|
130
|
+
value = (value << inBits) | data[i];
|
131
|
+
bits += inBits;
|
132
|
+
|
133
|
+
while (bits >= outBits) {
|
134
|
+
bits -= outBits;
|
135
|
+
result.push((value >> bits) & maxV);
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
if (pad) {
|
140
|
+
if (bits > 0) {
|
141
|
+
result.push((value << (outBits - bits)) & maxV);
|
142
|
+
}
|
143
|
+
} else {
|
144
|
+
if (bits >= inBits) return 'Excess padding'
|
145
|
+
if ((value << (outBits - bits)) & maxV) return 'Non-zero padding'
|
146
|
+
}
|
147
|
+
|
148
|
+
return result
|
149
|
+
}
|
150
|
+
|
151
|
+
function toWordsUnsafe (bytes) {
|
152
|
+
var res = convert(bytes, 8, 5, true);
|
153
|
+
if (Array.isArray(res)) return res
|
154
|
+
}
|
155
|
+
|
156
|
+
function toWords (bytes) {
|
157
|
+
var res = convert(bytes, 8, 5, true);
|
158
|
+
if (Array.isArray(res)) return res
|
159
|
+
|
160
|
+
throw new Error(res)
|
161
|
+
}
|
162
|
+
|
163
|
+
function fromWordsUnsafe (words) {
|
164
|
+
var res = convert(words, 5, 8, false);
|
165
|
+
if (Array.isArray(res)) return res
|
166
|
+
}
|
167
|
+
|
168
|
+
function fromWords (words) {
|
169
|
+
var res = convert(words, 5, 8, false);
|
170
|
+
if (Array.isArray(res)) return res
|
171
|
+
|
172
|
+
throw new Error(res)
|
173
|
+
}
|
174
|
+
|
175
|
+
var bech32 = {
|
176
|
+
decodeUnsafe: decodeUnsafe,
|
177
|
+
decode: decode,
|
178
|
+
encode: encode,
|
179
|
+
toWordsUnsafe: toWordsUnsafe,
|
180
|
+
toWords: toWords,
|
181
|
+
fromWordsUnsafe: fromWordsUnsafe,
|
182
|
+
fromWords: fromWords
|
183
|
+
};
|
184
|
+
|
185
|
+
var bech32$1 = /*@__PURE__*/getDefaultExportFromCjs(bech32);
|
186
|
+
|
187
|
+
export { bech32$1 as default };
|