pub struct Config { /* private fields */ }Expand description
Global configuration to interact with the different components of the Protocol.
Used by Authenticators and RPs.
Implementations§
Source§impl Config
impl Config
Sourcepub fn new(
rpc_url: Option<String>,
chain_id: u64,
registry_address: Address,
indexer_url: String,
gateway_url: String,
nullifier_oracle_urls: Vec<String>,
nullifier_oracle_threshold: usize,
) -> Result<Config, PrimitiveError>
pub fn new( rpc_url: Option<String>, chain_id: u64, registry_address: Address, indexer_url: String, gateway_url: String, nullifier_oracle_urls: Vec<String>, nullifier_oracle_threshold: usize, ) -> Result<Config, PrimitiveError>
Sourcepub const fn chain_id(&self) -> u64
pub const fn chain_id(&self) -> u64
The chain ID of the network where the WorldIDRegistry contract is deployed.
Sourcepub const fn registry_address(&self) -> &Address
pub const fn registry_address(&self) -> &Address
The address of the WorldIDRegistry contract.
Sourcepub const fn indexer_url(&self) -> &String
pub const fn indexer_url(&self) -> &String
The URL of the world-id-indexer service to use. The indexer is used to fetch inclusion proofs from the WorldIDRegistry contract.
Sourcepub const fn gateway_url(&self) -> &String
pub const fn gateway_url(&self) -> &String
The URL of the world-id-gateway service to use. The gateway is used to perform operations on the WorldIDRegistry contract
without leaking a wallet address.
Sourcepub const fn nullifier_oracle_urls(&self) -> &Vec<String>
pub const fn nullifier_oracle_urls(&self) -> &Vec<String>
The list of URLs of all and each node of the Nullifier Oracle.
Sourcepub const fn nullifier_oracle_threshold(&self) -> usize
pub const fn nullifier_oracle_threshold(&self) -> usize
The minimum number of Nullifier Oracle responses required to build a nullifier.
Sourcepub fn zkey_cache_dir(&self) -> Option<&Path>
pub fn zkey_cache_dir(&self) -> Option<&Path>
Optional directory to cache uncompressed circuit zkeys.
Sourcepub fn with_zkey_cache_dir(self, zkey_cache_dir: impl Into<PathBuf>) -> Config
pub fn with_zkey_cache_dir(self, zkey_cache_dir: impl Into<PathBuf>) -> Config
Sets the directory used to cache uncompressed circuit zkeys.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Config, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Config, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Config
impl Serialize for Config
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more