pub struct WalletsBuilder { /* private fields */ }Expand description
Builds a Wallets. Everything the module cannot decide for a venture —
which domain its messages are bound to, where its entropy comes from,
whether it can check a contract wallet — is set here.
Implementations§
Source§impl WalletsBuilder
impl WalletsBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
The defaults: no domain, no entropy source, Ethereum mainnet, a ten-minute nonce and no contract verifier.
Sourcepub fn domain(self, domain: impl Into<String>) -> Self
pub fn domain(self, domain: impl Into<String>) -> Self
The domain every SIWE/SIWS message must name. This is the phishing defence, so it is required: a message minted for another site is refused rather than verified.
Sourcepub fn uri(self, uri: impl Into<String>) -> Self
pub fn uri(self, uri: impl Into<String>) -> Self
The URI field of the messages, the page the signer is being sent
back to. Defaults to https://<domain>.
Sourcepub fn statement(self, statement: impl Into<String>) -> Self
pub fn statement(self, statement: impl Into<String>) -> Self
The Statement line — the words the person reads before signing.
This is the one line that reaches a human, so it should say what is
about to happen in the plainest words available.
Sourcepub fn chain_id(self, chain_id: impl Into<String>) -> Self
pub fn chain_id(self, chain_id: impl Into<String>) -> Self
The EVM chain id the messages carry. Defaults to
DEFAULT_EVM_CHAIN_ID.
Sourcepub fn nonce_ttl(self, ttl: Duration) -> Self
pub fn nonce_ttl(self, ttl: Duration) -> Self
How long a nonce stays usable. Clamped to at least one second and at
most MAX_NONCE_TTL.
Sourcepub fn random(self, random: impl RandomBytes + 'static) -> Self
pub fn random(self, random: impl RandomBytes + 'static) -> Self
Sets the entropy source nonces are drawn from. Required: core carries no CSPRNG, so the venture supplies one (ADR 0002).
Sourcepub fn contract_verifier(
self,
verifier: impl ContractSignatureVerifier + 'static,
) -> Self
pub fn contract_verifier( self, verifier: impl ContractSignatureVerifier + 'static, ) -> Self
Sets the EIP-1271 contract-wallet verifier. Left unset the module
serves EOAs only; a smart-contract wallet then fails with
wallets/signature-invalid rather than hanging on a chain call.