#[non_exhaustive]pub enum BrowserWalletError {
Show 19 variants
WalletUnavailable,
DiscoverySelectionRequired {
candidates: usize,
},
DiscoverySelectionOutOfRange {
index: usize,
candidates: usize,
},
InvalidProviderOrigin {
message: Redacted<String>,
},
UntrustedProviderOrigin {
origin: Redacted<String>,
},
UserRejectedRequest {
method: String,
code: i32,
message: Redacted<String>,
},
Disconnected {
method: String,
code: i32,
message: Redacted<String>,
},
WrongChain {
method: String,
code: i32,
message: Redacted<String>,
},
ChainNotAdded {
chain_id: Option<ChainId>,
method: String,
code: i32,
message: Redacted<String>,
},
InvalidChainConfiguration {
chain_id: ChainId,
message: Redacted<String>,
},
SessionChainMismatch {
expected_chain_id: ChainId,
session_chain_id: ChainId,
},
TypedDataChainMismatch {
expected_chain_id: ChainId,
typed_data_chain_id: ChainId,
},
UnsupportedRpcMethod {
method: String,
message: Redacted<String>,
},
MalformedResponse {
method: String,
message: Redacted<String>,
},
Rpc {
method: String,
code: i32,
message: Redacted<String>,
data: Option<Redacted<Value>>,
},
JsInterop {
message: Redacted<String>,
},
Serialization {
message: Redacted<String>,
},
Core(CoreError),
Cancelled,
}Expand description
Errors produced by typed browser-wallet discovery, session, provider, and signer flows.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
No injected browser wallet provider is available in the current runtime.
DiscoverySelectionRequired
Discovery found more than one candidate and requires an explicit wallet selection.
DiscoverySelectionOutOfRange
A requested discovery index is outside the available wallet range.
Fields
InvalidProviderOrigin
A provider origin label failed local validation before provider construction.
UntrustedProviderOrigin
An EIP-1193 provider did not have discovery metadata or an explicit trusted origin.
UserRejectedRequest
The wallet explicitly rejected a user-authorized request.
The rejected RPC method and the EIP-1193 code are surfaced; the
provider’s free-form message is retained for programmatic access but
kept off the public rendering, so this variant reads as cleanly as the
signing-layer typed-data rejection for the same 4001 condition.
Fields
Disconnected
The wallet reported that it is disconnected from all chains.
Fields
WrongChain
The wallet reported that the currently connected chain is incompatible with the request.
Fields
ChainNotAdded
The requested chain has not been added to the wallet yet.
Fields
InvalidChainConfiguration
The typed add-chain input is invalid before any wallet request is attempted.
Fields
SessionChainMismatch
The wallet session chain does not match the expected workflow chain.
Fields
TypedDataChainMismatch
The typed-data payload chain does not match the expected workflow chain.
Fields
UnsupportedRpcMethod
The wallet does not support the requested RPC method.
Fields
MalformedResponse
The wallet returned a response that does not match the typed contract.
Fields
Rpc
An unclassified wallet or RPC error payload.
Fields
JsInterop
JavaScript interop or DOM interaction failed in the browser runtime.
Serialization
JSON serialization, ABI conversion, or typed-data encoding failed locally.
Core(CoreError)
Shared core type or validation error.
Cancelled
A long-running browser-wallet operation was cancelled through a cooperative cancellation token.
Implementations§
Source§impl BrowserWalletError
impl BrowserWalletError
Sourcepub const fn class(&self) -> ErrorClass
pub const fn class(&self) -> ErrorClass
Returns the coarse-grained ErrorClass for this error.
Trait Implementations§
Source§impl Clone for BrowserWalletError
impl Clone for BrowserWalletError
Source§fn clone(&self) -> BrowserWalletError
fn clone(&self) -> BrowserWalletError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BrowserWalletError
impl Debug for BrowserWalletError
Source§impl Display for BrowserWalletError
impl Display for BrowserWalletError
Source§impl Error for BrowserWalletError
impl Error for BrowserWalletError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Cancelled> for BrowserWalletError
impl From<Cancelled> for BrowserWalletError
Source§impl From<CoreError> for BrowserWalletError
impl From<CoreError> for BrowserWalletError
Source§impl PartialEq for BrowserWalletError
impl PartialEq for BrowserWalletError
Source§fn eq(&self, other: &BrowserWalletError) -> bool
fn eq(&self, other: &BrowserWalletError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BrowserWalletError
Source§impl UserRejection for BrowserWalletError
Exposes the EIP-1193 provider error code carried by the
UserRejectedRequest variant so the signing crate can route the
rejection through cow_sdk_signing::SigningError::SignerRejection.
Every other variant returns None and falls through to the
signing crate’s redacted display path.
impl UserRejection for BrowserWalletError
Exposes the EIP-1193 provider error code carried by the
UserRejectedRequest variant so the signing crate can route the
rejection through cow_sdk_signing::SigningError::SignerRejection.
Every other variant returns None and falls through to the
signing crate’s redacted display path.
The match is exhaustive over every typed rejection-class variant
the wallet error carries today; new EIP-1193 rejection variants
must add a row here so the classification contract stays pinned
against the typed error surface (and not against the Display
shape). Pinning lives in
crates/browser-wallet/tests/signer_error_trait_contract.rs.
Auto Trait Implementations§
impl Freeze for BrowserWalletError
impl RefUnwindSafe for BrowserWalletError
impl Send for BrowserWalletError
impl Sync for BrowserWalletError
impl Unpin for BrowserWalletError
impl UnsafeUnpin for BrowserWalletError
impl UnwindSafe for BrowserWalletError
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.