pub struct SiwxGate { /* private fields */ }Available on crate feature
server only.Expand description
Resource-server SIWX configuration used by the HTTP gate.
Implementations§
Source§impl SiwxGate
impl SiwxGate
Sourcepub fn new(origin: SiwxOrigin, store: impl PaidAddressStore + 'static) -> Self
pub fn new(origin: SiwxOrigin, store: impl PaidAddressStore + 'static) -> Self
Binds SIWX to a configured public origin and paid-address store.
Origin is required. There is no Host constructor.
Sourcepub fn with_chain(self, chain: SiwxChain) -> Self
pub fn with_chain(self, chain: SiwxChain) -> Self
Adds a supported authentication chain.
Sourcepub fn with_statement(self, statement: impl Into<CompactString>) -> Self
pub fn with_statement(self, statement: impl Into<CompactString>) -> Self
Sets the CAIP-122 statement shown to the wallet.
Sourcepub const fn with_auth_only(self) -> Self
pub const fn with_auth_only(self) -> Self
Grants access on valid signature even when the address has not paid.
Sourcepub fn with_evm_rpc_map(
self,
map: impl IntoIterator<Item = (u64, impl Into<String>)>,
timeout: Option<Duration>,
) -> Self
Available on crate feature siwx-eip1271 only.
pub fn with_evm_rpc_map( self, map: impl IntoIterator<Item = (u64, impl Into<String>)>, timeout: Option<Duration>, ) -> Self
siwx-eip1271 only.Server-configured per-chain RPC for EIP-1271 / EIP-6492.
timeout None keeps siwx-evm’s 5s default. Some is applied after
with_rpc_map, which resets timeout.
Sourcepub const fn is_auth_only(&self) -> bool
pub const fn is_auth_only(&self) -> bool
Whether empty price tags must not bypass the gate.
Sourcepub const fn origin(&self) -> &SiwxOrigin
pub const fn origin(&self) -> &SiwxOrigin
Configured public origin (never Host).
Sourcepub fn store(&self) -> &dyn PaidAddressStore
pub fn store(&self) -> &dyn PaidAddressStore
Shared paid-address / nonce store.
Sourcepub fn challenge_entry(&self, path: &str) -> Result<ExtensionEntry, SiwxError>
pub fn challenge_entry(&self, path: &str) -> Result<ExtensionEntry, SiwxError>
Sourcepub fn record_success(&self, path: &str, address: &str)
pub fn record_success(&self, path: &str, address: &str)
Records a successful settlement against configured origin + path.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SiwxGate
impl !UnwindSafe for SiwxGate
impl Freeze for SiwxGate
impl Send for SiwxGate
impl Sync for SiwxGate
impl Unpin for SiwxGate
impl UnsafeUnpin for SiwxGate
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DynGateHooks for T
impl<T> DynGateHooks for T
Source§fn on_protected_request<'a>(
&'a self,
req: &'a Request<Body>,
) -> Pin<Box<dyn Future<Output = ProtectedRequestOutcome> + Send + 'a>>
fn on_protected_request<'a>( &'a self, req: &'a Request<Body>, ) -> Pin<Box<dyn Future<Output = ProtectedRequestOutcome> + Send + 'a>>
Available on crate feature
server only.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> ⓘ
Converts
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> ⓘ
Converts
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