@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,27 @@
|
|
1
|
+
import '../../../../interfaces/dist/protocols.js';
|
2
|
+
import '../../../../interfaces/dist/connection_manager.js';
|
3
|
+
import '../../../../interfaces/dist/health_indicator.js';
|
4
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base10.js';
|
5
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base16.js';
|
6
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base2.js';
|
7
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base256emoji.js';
|
8
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base32.js';
|
9
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base36.js';
|
10
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base58.js';
|
11
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base64.js';
|
12
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base8.js';
|
13
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/identity.js';
|
14
|
+
import '../../../../../node_modules/multiformats/dist/src/codecs/json.js';
|
15
|
+
import { Logger } from '../../../../utils/dist/logger/index.js';
|
16
|
+
import '../../../../../node_modules/it-length-prefixed/dist/src/decode.js';
|
17
|
+
import '../../../../proto/dist/generated/message.js';
|
18
|
+
import '../../../../proto/dist/generated/filter.js';
|
19
|
+
import '../../../../proto/dist/generated/topic_only_message.js';
|
20
|
+
import '../../../../proto/dist/generated/filter_v2.js';
|
21
|
+
import '../../../../proto/dist/generated/light_push.js';
|
22
|
+
import '../../../../proto/dist/generated/store_v3.js';
|
23
|
+
import '../../../../proto/dist/generated/peer_exchange.js';
|
24
|
+
import '../../../../proto/dist/generated/metadata.js';
|
25
|
+
import '../../../../proto/dist/generated/sds_message.js';
|
26
|
+
|
27
|
+
new Logger("filter:v2");
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import '../../../../interfaces/dist/protocols.js';
|
2
|
+
import '../../../../interfaces/dist/connection_manager.js';
|
3
|
+
import '../../../../interfaces/dist/health_indicator.js';
|
4
|
+
import '../../../../proto/dist/generated/message.js';
|
5
|
+
import '../../../../proto/dist/generated/filter.js';
|
6
|
+
import '../../../../proto/dist/generated/topic_only_message.js';
|
7
|
+
import '../../../../proto/dist/generated/filter_v2.js';
|
8
|
+
export { PushResponse } from '../../../../proto/dist/generated/light_push.js';
|
9
|
+
import '../../../../proto/dist/generated/store_v3.js';
|
10
|
+
import '../../../../proto/dist/generated/peer_exchange.js';
|
11
|
+
import '../../../../proto/dist/generated/metadata.js';
|
12
|
+
import '../../../../proto/dist/generated/sds_message.js';
|
13
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base10.js';
|
14
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base16.js';
|
15
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base2.js';
|
16
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base256emoji.js';
|
17
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base32.js';
|
18
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base36.js';
|
19
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base58.js';
|
20
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base64.js';
|
21
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base8.js';
|
22
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/identity.js';
|
23
|
+
import '../../../../../node_modules/multiformats/dist/src/codecs/json.js';
|
24
|
+
import { Logger } from '../../../../utils/dist/logger/index.js';
|
25
|
+
import '../../../../../node_modules/it-length-prefixed/dist/src/decode.js';
|
26
|
+
|
27
|
+
new Logger("light-push");
|
@@ -0,0 +1,154 @@
|
|
1
|
+
import { WakuMessage } from '../../../../proto/dist/generated/message.js';
|
2
|
+
import '../../../../proto/dist/generated/filter.js';
|
3
|
+
import '../../../../proto/dist/generated/topic_only_message.js';
|
4
|
+
import '../../../../proto/dist/generated/filter_v2.js';
|
5
|
+
import '../../../../proto/dist/generated/light_push.js';
|
6
|
+
import '../../../../proto/dist/generated/store_v3.js';
|
7
|
+
import '../../../../proto/dist/generated/peer_exchange.js';
|
8
|
+
import '../../../../proto/dist/generated/metadata.js';
|
9
|
+
import '../../../../proto/dist/generated/sds_message.js';
|
10
|
+
import { determinePubsubTopic } from '../../../../utils/dist/common/sharding/index.js';
|
11
|
+
import { Logger } from '../../../../utils/dist/logger/index.js';
|
12
|
+
|
13
|
+
const log = new Logger("message:version-0");
|
14
|
+
const OneMillion = BigInt(1_000_000);
|
15
|
+
const Version = 0;
|
16
|
+
class DecodedMessage {
|
17
|
+
pubsubTopic;
|
18
|
+
proto;
|
19
|
+
constructor(pubsubTopic, proto) {
|
20
|
+
this.pubsubTopic = pubsubTopic;
|
21
|
+
this.proto = proto;
|
22
|
+
}
|
23
|
+
get ephemeral() {
|
24
|
+
return Boolean(this.proto.ephemeral);
|
25
|
+
}
|
26
|
+
get payload() {
|
27
|
+
return this.proto.payload;
|
28
|
+
}
|
29
|
+
get contentTopic() {
|
30
|
+
return this.proto.contentTopic;
|
31
|
+
}
|
32
|
+
get _rawTimestamp() {
|
33
|
+
return this.proto.timestamp;
|
34
|
+
}
|
35
|
+
get timestamp() {
|
36
|
+
// In the case we receive a value that is bigger than JS's max number,
|
37
|
+
// we catch the error and return undefined.
|
38
|
+
try {
|
39
|
+
if (this.proto.timestamp) {
|
40
|
+
// nanoseconds 10^-9 to milliseconds 10^-3
|
41
|
+
const timestamp = this.proto.timestamp / OneMillion;
|
42
|
+
return new Date(Number(timestamp));
|
43
|
+
}
|
44
|
+
return;
|
45
|
+
}
|
46
|
+
catch (e) {
|
47
|
+
return;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
get meta() {
|
51
|
+
return this.proto.meta;
|
52
|
+
}
|
53
|
+
get version() {
|
54
|
+
// https://rfc.vac.dev/spec/14/
|
55
|
+
// > If omitted, the value SHOULD be interpreted as version 0.
|
56
|
+
return this.proto.version ?? 0;
|
57
|
+
}
|
58
|
+
get rateLimitProof() {
|
59
|
+
return this.proto.rateLimitProof;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
class Encoder {
|
63
|
+
contentTopic;
|
64
|
+
ephemeral;
|
65
|
+
pubsubTopic;
|
66
|
+
metaSetter;
|
67
|
+
constructor(contentTopic, ephemeral = false, pubsubTopic, metaSetter) {
|
68
|
+
this.contentTopic = contentTopic;
|
69
|
+
this.ephemeral = ephemeral;
|
70
|
+
this.pubsubTopic = pubsubTopic;
|
71
|
+
this.metaSetter = metaSetter;
|
72
|
+
if (!contentTopic || contentTopic === "") {
|
73
|
+
throw new Error("Content topic must be specified");
|
74
|
+
}
|
75
|
+
}
|
76
|
+
async toWire(message) {
|
77
|
+
return WakuMessage.encode(await this.toProtoObj(message));
|
78
|
+
}
|
79
|
+
async toProtoObj(message) {
|
80
|
+
const timestamp = message.timestamp ?? new Date();
|
81
|
+
const protoMessage = {
|
82
|
+
payload: message.payload,
|
83
|
+
version: Version,
|
84
|
+
contentTopic: this.contentTopic,
|
85
|
+
timestamp: BigInt(timestamp.valueOf()) * OneMillion,
|
86
|
+
meta: undefined,
|
87
|
+
rateLimitProof: message.rateLimitProof,
|
88
|
+
ephemeral: this.ephemeral
|
89
|
+
};
|
90
|
+
if (this.metaSetter) {
|
91
|
+
const meta = this.metaSetter(protoMessage);
|
92
|
+
return { ...protoMessage, meta };
|
93
|
+
}
|
94
|
+
return protoMessage;
|
95
|
+
}
|
96
|
+
}
|
97
|
+
/**
|
98
|
+
* Creates an encoder that encode messages without Waku level encryption or signature.
|
99
|
+
*
|
100
|
+
* An encoder is used to encode messages in the [14/WAKU2-MESSAGE](https://rfc.vac.dev/spec/14/)
|
101
|
+
* format to be sent over the Waku network. The resulting encoder can then be
|
102
|
+
* pass to { @link @waku/interfaces!ISender.send } to automatically encode outgoing
|
103
|
+
* messages.
|
104
|
+
*/
|
105
|
+
function createEncoder({ pubsubTopic, pubsubTopicShardInfo, contentTopic, ephemeral, metaSetter }) {
|
106
|
+
return new Encoder(contentTopic, ephemeral, determinePubsubTopic(contentTopic, pubsubTopic ?? pubsubTopicShardInfo), metaSetter);
|
107
|
+
}
|
108
|
+
class Decoder {
|
109
|
+
pubsubTopic;
|
110
|
+
contentTopic;
|
111
|
+
constructor(pubsubTopic, contentTopic) {
|
112
|
+
this.pubsubTopic = pubsubTopic;
|
113
|
+
this.contentTopic = contentTopic;
|
114
|
+
if (!contentTopic || contentTopic === "") {
|
115
|
+
throw new Error("Content topic must be specified");
|
116
|
+
}
|
117
|
+
}
|
118
|
+
fromWireToProtoObj(bytes) {
|
119
|
+
const protoMessage = WakuMessage.decode(bytes);
|
120
|
+
return Promise.resolve({
|
121
|
+
payload: protoMessage.payload,
|
122
|
+
contentTopic: protoMessage.contentTopic,
|
123
|
+
version: protoMessage.version ?? undefined,
|
124
|
+
timestamp: protoMessage.timestamp ?? undefined,
|
125
|
+
meta: protoMessage.meta ?? undefined,
|
126
|
+
rateLimitProof: protoMessage.rateLimitProof ?? undefined,
|
127
|
+
ephemeral: protoMessage.ephemeral ?? false
|
128
|
+
});
|
129
|
+
}
|
130
|
+
async fromProtoObj(pubsubTopic, proto) {
|
131
|
+
// https://rfc.vac.dev/spec/14/
|
132
|
+
// > If omitted, the value SHOULD be interpreted as version 0.
|
133
|
+
if (proto.version ?? 0 !== Version) {
|
134
|
+
log.error("Failed to decode due to incorrect version, expected:", Version, ", actual:", proto.version);
|
135
|
+
return Promise.resolve(undefined);
|
136
|
+
}
|
137
|
+
return new DecodedMessage(pubsubTopic, proto);
|
138
|
+
}
|
139
|
+
}
|
140
|
+
/**
|
141
|
+
* Creates a decoder that decode messages without Waku level encryption.
|
142
|
+
*
|
143
|
+
* A decoder is used to decode messages from the [14/WAKU2-MESSAGE](https://rfc.vac.dev/spec/14/)
|
144
|
+
* format when received from the Waku network. The resulting decoder can then be
|
145
|
+
* pass to { @link @waku/interfaces!IReceiver.subscribe } to automatically decode incoming
|
146
|
+
* messages.
|
147
|
+
*
|
148
|
+
* @param contentTopic The resulting decoder will only decode messages with this content topic.
|
149
|
+
*/
|
150
|
+
function createDecoder(contentTopic, pubsubTopicShardInfo) {
|
151
|
+
return new Decoder(determinePubsubTopic(contentTopic, pubsubTopicShardInfo), contentTopic);
|
152
|
+
}
|
153
|
+
|
154
|
+
export { DecodedMessage, Decoder, Encoder, Version, createDecoder, createEncoder };
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import '../../../../interfaces/dist/protocols.js';
|
2
|
+
import '../../../../interfaces/dist/connection_manager.js';
|
3
|
+
import '../../../../interfaces/dist/health_indicator.js';
|
4
|
+
import '../../../../proto/dist/generated/message.js';
|
5
|
+
import '../../../../proto/dist/generated/filter.js';
|
6
|
+
import '../../../../proto/dist/generated/topic_only_message.js';
|
7
|
+
import '../../../../proto/dist/generated/filter_v2.js';
|
8
|
+
import '../../../../proto/dist/generated/light_push.js';
|
9
|
+
import '../../../../proto/dist/generated/store_v3.js';
|
10
|
+
import '../../../../proto/dist/generated/peer_exchange.js';
|
11
|
+
import '../../../../proto/dist/generated/metadata.js';
|
12
|
+
import '../../../../proto/dist/generated/sds_message.js';
|
13
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base10.js';
|
14
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base16.js';
|
15
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base2.js';
|
16
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base256emoji.js';
|
17
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base32.js';
|
18
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base36.js';
|
19
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base58.js';
|
20
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base64.js';
|
21
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base8.js';
|
22
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/identity.js';
|
23
|
+
import '../../../../../node_modules/multiformats/dist/src/codecs/json.js';
|
24
|
+
import { Logger } from '../../../../utils/dist/logger/index.js';
|
25
|
+
import '../../../../../node_modules/it-length-prefixed/dist/src/decode.js';
|
26
|
+
|
27
|
+
new Logger("metadata");
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import '../../../../interfaces/dist/protocols.js';
|
2
|
+
import '../../../../interfaces/dist/connection_manager.js';
|
3
|
+
import '../../../../interfaces/dist/health_indicator.js';
|
4
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base10.js';
|
5
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base16.js';
|
6
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base2.js';
|
7
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base256emoji.js';
|
8
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base32.js';
|
9
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base36.js';
|
10
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base58.js';
|
11
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base64.js';
|
12
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/base8.js';
|
13
|
+
import '../../../../../node_modules/multiformats/dist/src/bases/identity.js';
|
14
|
+
import '../../../../../node_modules/multiformats/dist/src/codecs/json.js';
|
15
|
+
import { Logger } from '../../../../utils/dist/logger/index.js';
|
16
|
+
import '../../../../../node_modules/it-length-prefixed/dist/src/decode.js';
|
17
|
+
import '../../../../proto/dist/generated/message.js';
|
18
|
+
import '../../../../proto/dist/generated/filter.js';
|
19
|
+
import '../../../../proto/dist/generated/topic_only_message.js';
|
20
|
+
import '../../../../proto/dist/generated/filter_v2.js';
|
21
|
+
import '../../../../proto/dist/generated/light_push.js';
|
22
|
+
import '../../../../proto/dist/generated/store_v3.js';
|
23
|
+
import '../../../../proto/dist/generated/peer_exchange.js';
|
24
|
+
import '../../../../proto/dist/generated/metadata.js';
|
25
|
+
import '../../../../proto/dist/generated/sds_message.js';
|
26
|
+
|
27
|
+
new Logger("store");
|
@@ -0,0 +1,19 @@
|
|
1
|
+
var Tags;
|
2
|
+
(function (Tags) {
|
3
|
+
Tags["BOOTSTRAP"] = "bootstrap";
|
4
|
+
Tags["PEER_EXCHANGE"] = "peer-exchange";
|
5
|
+
Tags["LOCAL"] = "local-peer-cache";
|
6
|
+
})(Tags || (Tags = {}));
|
7
|
+
var EPeersByDiscoveryEvents;
|
8
|
+
(function (EPeersByDiscoveryEvents) {
|
9
|
+
EPeersByDiscoveryEvents["PEER_DISCOVERY_BOOTSTRAP"] = "peer:discovery:bootstrap";
|
10
|
+
EPeersByDiscoveryEvents["PEER_DISCOVERY_PEER_EXCHANGE"] = "peer:discovery:peer-exchange";
|
11
|
+
EPeersByDiscoveryEvents["PEER_CONNECT_BOOTSTRAP"] = "peer:connected:bootstrap";
|
12
|
+
EPeersByDiscoveryEvents["PEER_CONNECT_PEER_EXCHANGE"] = "peer:connected:peer-exchange";
|
13
|
+
})(EPeersByDiscoveryEvents || (EPeersByDiscoveryEvents = {}));
|
14
|
+
var EConnectionStateEvents;
|
15
|
+
(function (EConnectionStateEvents) {
|
16
|
+
EConnectionStateEvents["CONNECTION_STATUS"] = "waku:connection";
|
17
|
+
})(EConnectionStateEvents || (EConnectionStateEvents = {}));
|
18
|
+
|
19
|
+
export { EConnectionStateEvents, EPeersByDiscoveryEvents, Tags };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
var HealthStatusChangeEvents;
|
2
|
+
(function (HealthStatusChangeEvents) {
|
3
|
+
HealthStatusChangeEvents["StatusChange"] = "health:change";
|
4
|
+
})(HealthStatusChangeEvents || (HealthStatusChangeEvents = {}));
|
5
|
+
var HealthStatus;
|
6
|
+
(function (HealthStatus) {
|
7
|
+
HealthStatus["Unhealthy"] = "Unhealthy";
|
8
|
+
HealthStatus["MinimallyHealthy"] = "MinimallyHealthy";
|
9
|
+
HealthStatus["SufficientlyHealthy"] = "SufficientlyHealthy";
|
10
|
+
})(HealthStatus || (HealthStatus = {}));
|
11
|
+
|
12
|
+
export { HealthStatus, HealthStatusChangeEvents };
|
@@ -0,0 +1,92 @@
|
|
1
|
+
var Protocols;
|
2
|
+
(function (Protocols) {
|
3
|
+
Protocols["Relay"] = "relay";
|
4
|
+
Protocols["Store"] = "store";
|
5
|
+
Protocols["LightPush"] = "lightpush";
|
6
|
+
Protocols["Filter"] = "filter";
|
7
|
+
})(Protocols || (Protocols = {}));
|
8
|
+
var ProtocolError;
|
9
|
+
(function (ProtocolError) {
|
10
|
+
//
|
11
|
+
// GENERAL ERRORS SECTION
|
12
|
+
//
|
13
|
+
/**
|
14
|
+
* Could not determine the origin of the fault. Best to check connectivity and try again
|
15
|
+
* */
|
16
|
+
ProtocolError["GENERIC_FAIL"] = "Generic error";
|
17
|
+
/**
|
18
|
+
* The remote peer rejected the message. Information provided by the remote peer
|
19
|
+
* is logged. Review message validity, or mitigation for `NO_PEER_AVAILABLE`
|
20
|
+
* or `DECODE_FAILED` can be used.
|
21
|
+
*/
|
22
|
+
ProtocolError["REMOTE_PEER_REJECTED"] = "Remote peer rejected";
|
23
|
+
/**
|
24
|
+
* Failure to protobuf decode the message. May be due to a remote peer issue,
|
25
|
+
* ensuring that messages are sent via several peer enable mitigation of this error.
|
26
|
+
*/
|
27
|
+
ProtocolError["DECODE_FAILED"] = "Failed to decode";
|
28
|
+
/**
|
29
|
+
* Failure to find a peer with suitable protocols. This may due to a connection issue.
|
30
|
+
* Mitigation can be: retrying after a given time period, display connectivity issue
|
31
|
+
* to user or listening for `peer:connected:bootstrap` or `peer:connected:peer-exchange`
|
32
|
+
* on the connection manager before retrying.
|
33
|
+
*/
|
34
|
+
ProtocolError["NO_PEER_AVAILABLE"] = "No peer available";
|
35
|
+
/**
|
36
|
+
* Failure to find a stream to the peer. This may be because the connection with the peer is not still alive.
|
37
|
+
* Mitigation can be: retrying after a given time period, or mitigation for `NO_PEER_AVAILABLE` can be used.
|
38
|
+
*/
|
39
|
+
ProtocolError["NO_STREAM_AVAILABLE"] = "No stream available";
|
40
|
+
/**
|
41
|
+
* The remote peer did not behave as expected. Mitigation for `NO_PEER_AVAILABLE`
|
42
|
+
* or `DECODE_FAILED` can be used.
|
43
|
+
*/
|
44
|
+
ProtocolError["NO_RESPONSE"] = "No response received";
|
45
|
+
//
|
46
|
+
// SEND ERRORS SECTION
|
47
|
+
//
|
48
|
+
/**
|
49
|
+
* Failure to protobuf encode the message. This is not recoverable and needs
|
50
|
+
* further investigation.
|
51
|
+
*/
|
52
|
+
ProtocolError["ENCODE_FAILED"] = "Failed to encode";
|
53
|
+
/**
|
54
|
+
* The message payload is empty, making the message invalid. Ensure that a non-empty
|
55
|
+
* payload is set on the outgoing message.
|
56
|
+
*/
|
57
|
+
ProtocolError["EMPTY_PAYLOAD"] = "Payload is empty";
|
58
|
+
/**
|
59
|
+
* The message size is above the maximum message size allowed on the Waku Network.
|
60
|
+
* Compressing the message or using an alternative strategy for large messages is recommended.
|
61
|
+
*/
|
62
|
+
ProtocolError["SIZE_TOO_BIG"] = "Size is too big";
|
63
|
+
/**
|
64
|
+
* The PubsubTopic passed to the send function is not configured on the Waku node.
|
65
|
+
* Please ensure that the PubsubTopic is used when initializing the Waku node.
|
66
|
+
*/
|
67
|
+
ProtocolError["TOPIC_NOT_CONFIGURED"] = "Topic not configured";
|
68
|
+
/**
|
69
|
+
* Fails when
|
70
|
+
*/
|
71
|
+
ProtocolError["STREAM_ABORTED"] = "Stream aborted";
|
72
|
+
/**
|
73
|
+
* General proof generation error message.
|
74
|
+
* nwaku: https://github.com/waku-org/nwaku/blob/c3cb06ac6c03f0f382d3941ea53b330f6a8dd127/waku/waku_rln_relay/group_manager/group_manager_base.nim#L201C19-L201C42
|
75
|
+
*/
|
76
|
+
ProtocolError["RLN_PROOF_GENERATION"] = "Proof generation failed";
|
77
|
+
//
|
78
|
+
// RECEIVE ERRORS SECTION
|
79
|
+
//
|
80
|
+
/**
|
81
|
+
* The pubsub topic configured on the decoder does not match the pubsub topic setup on the protocol.
|
82
|
+
* Ensure that the pubsub topic used for decoder creation is the same as the one used for protocol.
|
83
|
+
*/
|
84
|
+
ProtocolError["TOPIC_DECODER_MISMATCH"] = "Topic decoder mismatch";
|
85
|
+
/**
|
86
|
+
* The topics passed in the decoders do not match each other, or don't exist at all.
|
87
|
+
* Ensure that all the pubsub topics used in the decoders are valid and match each other.
|
88
|
+
*/
|
89
|
+
ProtocolError["INVALID_DECODER_TOPICS"] = "Invalid decoder topics";
|
90
|
+
})(ProtocolError || (ProtocolError = {}));
|
91
|
+
|
92
|
+
export { ProtocolError, Protocols };
|