@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,393 @@
|
|
1
|
+
export const RLN_ABI = [
|
2
|
+
{
|
3
|
+
type: "constructor",
|
4
|
+
inputs: [],
|
5
|
+
stateMutability: "nonpayable"
|
6
|
+
},
|
7
|
+
{
|
8
|
+
type: "error",
|
9
|
+
name: "DuplicateIdCommitment",
|
10
|
+
inputs: []
|
11
|
+
},
|
12
|
+
{
|
13
|
+
type: "error",
|
14
|
+
name: "InvalidIdCommitment",
|
15
|
+
inputs: [
|
16
|
+
{
|
17
|
+
name: "idCommitment",
|
18
|
+
type: "uint256"
|
19
|
+
}
|
20
|
+
]
|
21
|
+
},
|
22
|
+
{
|
23
|
+
type: "error",
|
24
|
+
name: "InvalidPaginationQuery",
|
25
|
+
inputs: [
|
26
|
+
{
|
27
|
+
name: "startIndex",
|
28
|
+
type: "uint256"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
name: "endIndex",
|
32
|
+
type: "uint256"
|
33
|
+
}
|
34
|
+
]
|
35
|
+
},
|
36
|
+
{
|
37
|
+
type: "function",
|
38
|
+
name: "MAX_MEMBERSHIP_SET_SIZE",
|
39
|
+
inputs: [],
|
40
|
+
outputs: [
|
41
|
+
{
|
42
|
+
name: "",
|
43
|
+
type: "uint32"
|
44
|
+
}
|
45
|
+
],
|
46
|
+
stateMutability: "view"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
type: "function",
|
50
|
+
name: "MERKLE_TREE_DEPTH",
|
51
|
+
inputs: [],
|
52
|
+
outputs: [
|
53
|
+
{
|
54
|
+
name: "",
|
55
|
+
type: "uint8"
|
56
|
+
}
|
57
|
+
],
|
58
|
+
stateMutability: "view"
|
59
|
+
},
|
60
|
+
{
|
61
|
+
type: "function",
|
62
|
+
name: "Q",
|
63
|
+
inputs: [],
|
64
|
+
outputs: [
|
65
|
+
{
|
66
|
+
name: "",
|
67
|
+
type: "uint256"
|
68
|
+
}
|
69
|
+
],
|
70
|
+
stateMutability: "view"
|
71
|
+
},
|
72
|
+
{
|
73
|
+
type: "function",
|
74
|
+
name: "activeDurationForNewMemberships",
|
75
|
+
inputs: [],
|
76
|
+
outputs: [
|
77
|
+
{
|
78
|
+
name: "",
|
79
|
+
type: "uint32"
|
80
|
+
}
|
81
|
+
],
|
82
|
+
stateMutability: "view"
|
83
|
+
},
|
84
|
+
{
|
85
|
+
type: "function",
|
86
|
+
name: "currentTotalRateLimit",
|
87
|
+
inputs: [],
|
88
|
+
outputs: [
|
89
|
+
{
|
90
|
+
name: "",
|
91
|
+
type: "uint256"
|
92
|
+
}
|
93
|
+
],
|
94
|
+
stateMutability: "view"
|
95
|
+
},
|
96
|
+
{
|
97
|
+
type: "function",
|
98
|
+
name: "deployedBlockNumber",
|
99
|
+
inputs: [],
|
100
|
+
outputs: [
|
101
|
+
{
|
102
|
+
name: "",
|
103
|
+
type: "uint32"
|
104
|
+
}
|
105
|
+
],
|
106
|
+
stateMutability: "view"
|
107
|
+
},
|
108
|
+
{
|
109
|
+
type: "function",
|
110
|
+
name: "depositsToWithdraw",
|
111
|
+
inputs: [
|
112
|
+
{
|
113
|
+
name: "holder",
|
114
|
+
type: "address"
|
115
|
+
},
|
116
|
+
{
|
117
|
+
name: "token",
|
118
|
+
type: "address"
|
119
|
+
}
|
120
|
+
],
|
121
|
+
outputs: [
|
122
|
+
{
|
123
|
+
name: "balance",
|
124
|
+
type: "uint256"
|
125
|
+
}
|
126
|
+
],
|
127
|
+
stateMutability: "view"
|
128
|
+
},
|
129
|
+
{
|
130
|
+
type: "function",
|
131
|
+
name: "eraseMemberships",
|
132
|
+
inputs: [
|
133
|
+
{
|
134
|
+
name: "idCommitments",
|
135
|
+
type: "uint256[]"
|
136
|
+
}
|
137
|
+
],
|
138
|
+
outputs: [],
|
139
|
+
stateMutability: "nonpayable"
|
140
|
+
},
|
141
|
+
{
|
142
|
+
type: "function",
|
143
|
+
name: "eraseMemberships",
|
144
|
+
inputs: [
|
145
|
+
{
|
146
|
+
name: "idCommitments",
|
147
|
+
type: "uint256[]"
|
148
|
+
},
|
149
|
+
{
|
150
|
+
name: "eraseFromMembershipSet",
|
151
|
+
type: "bool"
|
152
|
+
}
|
153
|
+
],
|
154
|
+
outputs: [],
|
155
|
+
stateMutability: "nonpayable"
|
156
|
+
},
|
157
|
+
{
|
158
|
+
type: "function",
|
159
|
+
name: "extendMemberships",
|
160
|
+
inputs: [
|
161
|
+
{
|
162
|
+
name: "idCommitments",
|
163
|
+
type: "uint256[]"
|
164
|
+
}
|
165
|
+
],
|
166
|
+
outputs: [],
|
167
|
+
stateMutability: "nonpayable"
|
168
|
+
},
|
169
|
+
{
|
170
|
+
type: "function",
|
171
|
+
name: "getMembershipInfo",
|
172
|
+
inputs: [
|
173
|
+
{
|
174
|
+
name: "idCommitment",
|
175
|
+
type: "uint256"
|
176
|
+
}
|
177
|
+
],
|
178
|
+
outputs: [
|
179
|
+
{
|
180
|
+
name: "",
|
181
|
+
type: "uint32"
|
182
|
+
},
|
183
|
+
{
|
184
|
+
name: "",
|
185
|
+
type: "uint32"
|
186
|
+
},
|
187
|
+
{
|
188
|
+
name: "",
|
189
|
+
type: "uint256"
|
190
|
+
}
|
191
|
+
],
|
192
|
+
stateMutability: "view"
|
193
|
+
},
|
194
|
+
{
|
195
|
+
type: "function",
|
196
|
+
name: "getMerkleProof",
|
197
|
+
inputs: [
|
198
|
+
{
|
199
|
+
name: "index",
|
200
|
+
type: "uint40"
|
201
|
+
}
|
202
|
+
],
|
203
|
+
outputs: [
|
204
|
+
{
|
205
|
+
name: "",
|
206
|
+
type: "uint256[20]"
|
207
|
+
}
|
208
|
+
],
|
209
|
+
stateMutability: "view"
|
210
|
+
},
|
211
|
+
{
|
212
|
+
type: "function",
|
213
|
+
name: "getRateCommitmentsInRangeBoundsInclusive",
|
214
|
+
inputs: [
|
215
|
+
{
|
216
|
+
name: "startIndex",
|
217
|
+
type: "uint32"
|
218
|
+
},
|
219
|
+
{
|
220
|
+
name: "endIndex",
|
221
|
+
type: "uint32"
|
222
|
+
}
|
223
|
+
],
|
224
|
+
outputs: [
|
225
|
+
{
|
226
|
+
name: "",
|
227
|
+
type: "uint256[]"
|
228
|
+
}
|
229
|
+
],
|
230
|
+
stateMutability: "view"
|
231
|
+
},
|
232
|
+
{
|
233
|
+
type: "function",
|
234
|
+
name: "gracePeriodDurationForNewMemberships",
|
235
|
+
inputs: [],
|
236
|
+
outputs: [
|
237
|
+
{
|
238
|
+
name: "",
|
239
|
+
type: "uint32"
|
240
|
+
}
|
241
|
+
],
|
242
|
+
stateMutability: "view"
|
243
|
+
},
|
244
|
+
{
|
245
|
+
type: "function",
|
246
|
+
name: "initialize",
|
247
|
+
inputs: [
|
248
|
+
{
|
249
|
+
name: "_priceCalculator",
|
250
|
+
type: "address"
|
251
|
+
},
|
252
|
+
{
|
253
|
+
name: "_maxTotalRateLimit",
|
254
|
+
type: "uint32"
|
255
|
+
},
|
256
|
+
{
|
257
|
+
name: "_minMembershipRateLimit",
|
258
|
+
type: "uint32"
|
259
|
+
},
|
260
|
+
{
|
261
|
+
name: "_maxMembershipRateLimit",
|
262
|
+
type: "uint32"
|
263
|
+
},
|
264
|
+
{
|
265
|
+
name: "_activeDuration",
|
266
|
+
type: "uint32"
|
267
|
+
},
|
268
|
+
{
|
269
|
+
name: "_gracePeriod",
|
270
|
+
type: "uint32"
|
271
|
+
}
|
272
|
+
],
|
273
|
+
outputs: [],
|
274
|
+
stateMutability: "nonpayable"
|
275
|
+
},
|
276
|
+
{
|
277
|
+
type: "function",
|
278
|
+
name: "isExpired",
|
279
|
+
inputs: [
|
280
|
+
{
|
281
|
+
name: "_idCommitment",
|
282
|
+
type: "uint256"
|
283
|
+
}
|
284
|
+
],
|
285
|
+
outputs: [
|
286
|
+
{
|
287
|
+
name: "",
|
288
|
+
type: "bool"
|
289
|
+
}
|
290
|
+
],
|
291
|
+
stateMutability: "view"
|
292
|
+
},
|
293
|
+
{
|
294
|
+
type: "function",
|
295
|
+
name: "register",
|
296
|
+
inputs: [
|
297
|
+
{
|
298
|
+
name: "idCommitment",
|
299
|
+
type: "uint256"
|
300
|
+
},
|
301
|
+
{
|
302
|
+
name: "rateLimit",
|
303
|
+
type: "uint32"
|
304
|
+
},
|
305
|
+
{
|
306
|
+
name: "idCommitmentsToErase",
|
307
|
+
type: "uint256[]"
|
308
|
+
}
|
309
|
+
],
|
310
|
+
outputs: [],
|
311
|
+
stateMutability: "nonpayable"
|
312
|
+
},
|
313
|
+
{
|
314
|
+
type: "function",
|
315
|
+
name: "registerWithPermit",
|
316
|
+
inputs: [
|
317
|
+
{
|
318
|
+
name: "owner",
|
319
|
+
type: "address"
|
320
|
+
},
|
321
|
+
{
|
322
|
+
name: "deadline",
|
323
|
+
type: "uint256"
|
324
|
+
},
|
325
|
+
{
|
326
|
+
name: "v",
|
327
|
+
type: "uint8"
|
328
|
+
},
|
329
|
+
{
|
330
|
+
name: "r",
|
331
|
+
type: "bytes32"
|
332
|
+
},
|
333
|
+
{
|
334
|
+
name: "s",
|
335
|
+
type: "bytes32"
|
336
|
+
},
|
337
|
+
{
|
338
|
+
name: "idCommitment",
|
339
|
+
type: "uint256"
|
340
|
+
},
|
341
|
+
{
|
342
|
+
name: "rateLimit",
|
343
|
+
type: "uint32"
|
344
|
+
},
|
345
|
+
{
|
346
|
+
name: "idCommitmentsToErase",
|
347
|
+
type: "uint256[]"
|
348
|
+
}
|
349
|
+
],
|
350
|
+
outputs: [],
|
351
|
+
stateMutability: "nonpayable"
|
352
|
+
},
|
353
|
+
{
|
354
|
+
type: "event",
|
355
|
+
name: "MembershipRegistered",
|
356
|
+
inputs: [
|
357
|
+
{
|
358
|
+
name: "idCommitment",
|
359
|
+
type: "uint256",
|
360
|
+
indexed: false
|
361
|
+
},
|
362
|
+
{
|
363
|
+
name: "rateLimit",
|
364
|
+
type: "uint32",
|
365
|
+
indexed: false
|
366
|
+
},
|
367
|
+
{
|
368
|
+
name: "index",
|
369
|
+
type: "uint256",
|
370
|
+
indexed: false
|
371
|
+
}
|
372
|
+
],
|
373
|
+
anonymous: false
|
374
|
+
},
|
375
|
+
{
|
376
|
+
type: "event",
|
377
|
+
name: "MembershipRemoved",
|
378
|
+
inputs: [
|
379
|
+
{
|
380
|
+
name: "idCommitment",
|
381
|
+
type: "uint256",
|
382
|
+
indexed: false
|
383
|
+
},
|
384
|
+
{
|
385
|
+
name: "index",
|
386
|
+
type: "uint256",
|
387
|
+
indexed: false
|
388
|
+
}
|
389
|
+
],
|
390
|
+
anonymous: false
|
391
|
+
}
|
392
|
+
];
|
393
|
+
//# sourceMappingURL=abi.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"abi.js","sourceRoot":"","sources":["../../src/contract/abi.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB;QACE,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,EAAE;QACV,eAAe,EAAE,YAAY;KAC9B;IACD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,uBAAuB;QAC7B,MAAM,EAAE,EAAE;KACX;IACD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,SAAS;aAChB;SACF;KACF;IACD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,wBAAwB;QAC9B,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;aAChB;SACF;KACF;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,yBAAyB;QAC/B,MAAM,EAAE,EAAE;QACV,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,QAAQ;aACf;SACF;QACD,eAAe,EAAE,MAAM;KACxB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,mBAAmB;QACzB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,OAAO;aACd;SACF;QAC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AAI,EAAE,cAAc;gBACpB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;aACf;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;aACf;SACF;QACD,SAAS,EAAE,KAAK;KACjB;CACF,CAAC"}
|
@@ -1,7 +1,63 @@
|
|
1
|
-
export declare const RLN_REGISTRY_ABI: string[];
|
2
|
-
export declare const RLN_STORAGE_ABI: string[];
|
3
1
|
export declare const SEPOLIA_CONTRACT: {
|
4
2
|
chainId: number;
|
5
3
|
address: string;
|
6
|
-
abi:
|
4
|
+
abi: ({
|
5
|
+
type: string;
|
6
|
+
inputs: never[];
|
7
|
+
stateMutability: string;
|
8
|
+
name?: undefined;
|
9
|
+
outputs?: undefined;
|
10
|
+
anonymous?: undefined;
|
11
|
+
} | {
|
12
|
+
type: string;
|
13
|
+
name: string;
|
14
|
+
inputs: {
|
15
|
+
name: string;
|
16
|
+
type: string;
|
17
|
+
}[];
|
18
|
+
stateMutability?: undefined;
|
19
|
+
outputs?: undefined;
|
20
|
+
anonymous?: undefined;
|
21
|
+
} | {
|
22
|
+
type: string;
|
23
|
+
name: string;
|
24
|
+
inputs: {
|
25
|
+
name: string;
|
26
|
+
type: string;
|
27
|
+
}[];
|
28
|
+
outputs: {
|
29
|
+
name: string;
|
30
|
+
type: string;
|
31
|
+
}[];
|
32
|
+
stateMutability: string;
|
33
|
+
anonymous?: undefined;
|
34
|
+
} | {
|
35
|
+
type: string;
|
36
|
+
name: string;
|
37
|
+
inputs: {
|
38
|
+
name: string;
|
39
|
+
type: string;
|
40
|
+
indexed: boolean;
|
41
|
+
}[];
|
42
|
+
anonymous: boolean;
|
43
|
+
stateMutability?: undefined;
|
44
|
+
outputs?: undefined;
|
45
|
+
})[];
|
7
46
|
};
|
47
|
+
/**
|
48
|
+
* Rate limit tiers (messages per epoch)
|
49
|
+
* Each membership can specify a rate limit within these bounds.
|
50
|
+
* @see https://github.com/waku-org/specs/blob/master/standards/core/rln-contract.md#implementation-suggestions
|
51
|
+
*/
|
52
|
+
export declare const RATE_LIMIT_TIERS: {
|
53
|
+
readonly LOW: 20;
|
54
|
+
readonly MEDIUM: 200;
|
55
|
+
readonly HIGH: 600;
|
56
|
+
};
|
57
|
+
export declare const RATE_LIMIT_PARAMS: {
|
58
|
+
readonly MIN_RATE: 20;
|
59
|
+
readonly MAX_RATE: 600;
|
60
|
+
readonly MAX_TOTAL_RATE: 160000;
|
61
|
+
readonly EPOCH_LENGTH: 600;
|
62
|
+
};
|
63
|
+
export declare const DEFAULT_RATE_LIMIT: 600;
|
@@ -1,67 +1,25 @@
|
|
1
|
-
|
2
|
-
export const RLN_REGISTRY_ABI = [
|
3
|
-
"error IncompatibleStorage()",
|
4
|
-
"error IncompatibleStorageIndex()",
|
5
|
-
"error NoStorageContractAvailable()",
|
6
|
-
"error StorageAlreadyExists(address storageAddress)",
|
7
|
-
"event AdminChanged(address previousAdmin, address newAdmin)",
|
8
|
-
"event BeaconUpgraded(address indexed beacon)",
|
9
|
-
"event Initialized(uint8 version)",
|
10
|
-
"event NewStorageContract(uint16 index, address storageAddress)",
|
11
|
-
"event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)",
|
12
|
-
"event Upgraded(address indexed implementation)",
|
13
|
-
"function forceProgress()",
|
14
|
-
"function initialize(address _poseidonHasher)",
|
15
|
-
"function newStorage()",
|
16
|
-
"function nextStorageIndex() view returns (uint16)",
|
17
|
-
"function owner() view returns (address)",
|
18
|
-
"function poseidonHasher() view returns (address)",
|
19
|
-
"function proxiableUUID() view returns (bytes32)",
|
20
|
-
"function register(uint16 storageIndex, uint256 commitment)",
|
21
|
-
"function register(uint256[] commitments)",
|
22
|
-
"function register(uint16 storageIndex, uint256[] commitments)",
|
23
|
-
"function registerStorage(address storageAddress)",
|
24
|
-
"function renounceOwnership()",
|
25
|
-
"function storages(uint16) view returns (address)",
|
26
|
-
"function transferOwnership(address newOwner)",
|
27
|
-
"function upgradeTo(address newImplementation)",
|
28
|
-
"function upgradeToAndCall(address newImplementation, bytes data) payable",
|
29
|
-
"function usingStorageIndex() view returns (uint16)"
|
30
|
-
];
|
31
|
-
// ref https://github.com/waku-org/waku-rln-contract/blob/19fded82bca07e7b535b429dc507cfb83f10dfcf/deployments/sepolia/WakuRlnStorage_0.json#L3
|
32
|
-
export const RLN_STORAGE_ABI = [
|
33
|
-
"constructor(address _poseidonHasher, uint16 _contractIndex)",
|
34
|
-
"error DuplicateIdCommitment()",
|
35
|
-
"error FullTree()",
|
36
|
-
"error InvalidIdCommitment(uint256 idCommitment)",
|
37
|
-
"error NotImplemented()",
|
38
|
-
"event MemberRegistered(uint256 idCommitment, uint256 index)",
|
39
|
-
"event MemberWithdrawn(uint256 idCommitment, uint256 index)",
|
40
|
-
"event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)",
|
41
|
-
"function DEPTH() view returns (uint256)",
|
42
|
-
"function MEMBERSHIP_DEPOSIT() view returns (uint256)",
|
43
|
-
"function SET_SIZE() view returns (uint256)",
|
44
|
-
"function contractIndex() view returns (uint16)",
|
45
|
-
"function deployedBlockNumber() view returns (uint32)",
|
46
|
-
"function idCommitmentIndex() view returns (uint256)",
|
47
|
-
"function isValidCommitment(uint256 idCommitment) view returns (bool)",
|
48
|
-
"function memberExists(uint256) view returns (bool)",
|
49
|
-
"function members(uint256) view returns (uint256)",
|
50
|
-
"function owner() view returns (address)",
|
51
|
-
"function poseidonHasher() view returns (address)",
|
52
|
-
"function register(uint256[] idCommitments)",
|
53
|
-
"function register(uint256 idCommitment) payable",
|
54
|
-
"function renounceOwnership()",
|
55
|
-
"function slash(uint256 idCommitment, address receiver, uint256[8] proof) pure",
|
56
|
-
"function stakedAmounts(uint256) view returns (uint256)",
|
57
|
-
"function transferOwnership(address newOwner)",
|
58
|
-
"function verifier() view returns (address)",
|
59
|
-
"function withdraw() pure",
|
60
|
-
"function withdrawalBalance(address) view returns (uint256)"
|
61
|
-
];
|
1
|
+
import { RLN_ABI } from "./abi.js";
|
62
2
|
export const SEPOLIA_CONTRACT = {
|
63
3
|
chainId: 11155111,
|
64
|
-
address: "
|
65
|
-
abi:
|
4
|
+
address: "0xCB33Aa5B38d79E3D9Fa8B10afF38AA201399a7e3",
|
5
|
+
abi: RLN_ABI
|
66
6
|
};
|
7
|
+
/**
|
8
|
+
* Rate limit tiers (messages per epoch)
|
9
|
+
* Each membership can specify a rate limit within these bounds.
|
10
|
+
* @see https://github.com/waku-org/specs/blob/master/standards/core/rln-contract.md#implementation-suggestions
|
11
|
+
*/
|
12
|
+
export const RATE_LIMIT_TIERS = {
|
13
|
+
LOW: 20, // Suggested minimum rate - 20 messages per epoch
|
14
|
+
MEDIUM: 200,
|
15
|
+
HIGH: 600 // Suggested maximum rate - 600 messages per epoch
|
16
|
+
};
|
17
|
+
// Global rate limit parameters
|
18
|
+
export const RATE_LIMIT_PARAMS = {
|
19
|
+
MIN_RATE: RATE_LIMIT_TIERS.LOW,
|
20
|
+
MAX_RATE: RATE_LIMIT_TIERS.HIGH,
|
21
|
+
MAX_TOTAL_RATE: 160_000, // Maximum total rate limit across all memberships
|
22
|
+
EPOCH_LENGTH: 600 // Epoch length in seconds (10 minutes)
|
23
|
+
};
|
24
|
+
export const DEFAULT_RATE_LIMIT = RATE_LIMIT_PARAMS.MAX_RATE;
|
67
25
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/contract/constants.ts"],"names":[],"mappings":"AAAA,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/contract/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,4CAA4C;IACrD,GAAG,EAAE,OAAO;CACb,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,GAAG,EAAE,EAAE,EAAE,iDAAiD;IAC1D,MAAM,EAAE,GAAG;IACX,IAAI,EAAE,GAAG,CAAC,kDAAkD;CACpD,CAAC;AAEX,+BAA+B;AAC/B,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,EAAE,gBAAgB,CAAC,GAAG;IAC9B,QAAQ,EAAE,gBAAgB,CAAC,IAAI;IAC/B,cAAc,EAAE,OAAO,EAAE,kDAAkD;IAC3E,YAAY,EAAE,GAAG,CAAC,uCAAuC;CACjD,CAAC;AAEX,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,QAAQ,CAAC"}
|