pub enum WalletError {
Show 17 variants
Internal(String),
InvalidParameter {
parameter: String,
must_be: String,
},
NotImplemented(String),
BadRequest(String),
Unauthorized(String),
NotActive(String),
InvalidOperation(String),
MissingParameter(String),
InsufficientFunds {
message: String,
total_satoshis_needed: i64,
more_satoshis_needed: i64,
},
BroadcastUnavailable,
NetworkChain(String),
InvalidPublicKey {
message: String,
key: String,
},
ReviewActions {
message: String,
review_action_results: Vec<ReviewActionResult>,
send_with_results: Vec<SendWithResult>,
txid: Option<String>,
tx: Option<Vec<u8>>,
no_send_change: Vec<OutpointString>,
},
InvalidMerkleRoot {
message: String,
block_hash: String,
block_height: u32,
merkle_root: String,
txid: Option<String>,
},
Sqlx(Error),
Io(Error),
SerdeJson(Error),
}Expand description
Unified error type for all wallet operations.
Each variant maps to a WERR error code from the TypeScript wallet-toolbox. Display output always includes the WERR prefix (e.g., “WERR_INTERNAL: description”).
Variants§
Internal(String)
An internal error with a descriptive message.
InvalidParameter
A parameter has an invalid value.
Fields
NotImplemented(String)
The requested operation is not yet implemented.
BadRequest(String)
The request was malformed or invalid.
The caller is not authenticated or authorized.
NotActive(String)
The wallet or resource is not in an active state.
InvalidOperation(String)
The operation is not valid in the current state.
MissingParameter(String)
A required parameter was not provided.
InsufficientFunds
The wallet does not have enough funds for the operation.
Fields
No broadcast service is currently available.
NetworkChain(String)
A network or chain-related error occurred.
InvalidPublicKey
A public key value is invalid.
ReviewActions
Undelayed broadcast results require review (code=5).
Fields
review_action_results: Vec<ReviewActionResult>Results from the undelayed broadcast review.
send_with_results: Vec<SendWithResult>Results from batch sending.
no_send_change: Vec<OutpointString>Outpoints of change outputs for noSend transactions.
InvalidMerkleRoot
Invalid merkle root detected during chain validation (code=8).
Fields
Sqlx(Error)
A database error from sqlx.
Io(Error)
An I/O error.
SerdeJson(Error)
A JSON serialization/deserialization error.
Implementations§
Source§impl WalletError
impl WalletError
Sourcepub fn to_wallet_error_object(&self) -> WalletErrorObject
pub fn to_wallet_error_object(&self) -> WalletErrorObject
Converts this error into a WalletErrorObject suitable for JSON wire format.
This matches the TypeScript WalletError.toJson() output format.
Trait Implementations§
Source§impl Debug for WalletError
impl Debug for WalletError
Source§impl Display for WalletError
impl Display for WalletError
Source§impl Error for WalletError
impl Error for WalletError
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<Error> for WalletError
impl From<Error> for WalletError
Source§impl From<Error> for WalletError
impl From<Error> for WalletError
Auto Trait Implementations§
impl Freeze for WalletError
impl !RefUnwindSafe for WalletError
impl Send for WalletError
impl Sync for WalletError
impl Unpin for WalletError
impl UnsafeUnpin for WalletError
impl !UnwindSafe for WalletError
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> 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 moreSource§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.