|
@@ -13,55 +13,55 @@ use crate::util::hex;
|
|
#[derive(Debug, Error)]
|
|
#[derive(Debug, Error)]
|
|
pub enum Error {
|
|
pub enum Error {
|
|
/// Insufficient Funds
|
|
/// Insufficient Funds
|
|
- #[error("Insufficient Funds")]
|
|
|
|
|
|
+ #[error("Insufficient funds")]
|
|
InsufficientFunds,
|
|
InsufficientFunds,
|
|
/// Quote Expired
|
|
/// Quote Expired
|
|
- #[error("Quote Expired")]
|
|
|
|
|
|
+ #[error("Quote expired")]
|
|
QuoteExpired,
|
|
QuoteExpired,
|
|
/// Unknown Quote
|
|
/// Unknown Quote
|
|
- #[error("Quote Unknown")]
|
|
|
|
|
|
+ #[error("Quote unknown")]
|
|
QuoteUnknown,
|
|
QuoteUnknown,
|
|
/// Not active keyset
|
|
/// Not active keyset
|
|
#[error("No active keyset")]
|
|
#[error("No active keyset")]
|
|
NoActiveKeyset,
|
|
NoActiveKeyset,
|
|
- /// Invalid DLEQ prood
|
|
|
|
- #[error("Could not verify Dleq")]
|
|
|
|
|
|
+ /// Invalid DLEQ proof
|
|
|
|
+ #[error("Could not verify DLEQ proof")]
|
|
CouldNotVerifyDleq,
|
|
CouldNotVerifyDleq,
|
|
/// P2PK spending conditions not met
|
|
/// P2PK spending conditions not met
|
|
- #[error("P2PK Condition Not met `{0}`")]
|
|
|
|
|
|
+ #[error("P2PK condition not met `{0}`")]
|
|
P2PKConditionsNotMet(String),
|
|
P2PKConditionsNotMet(String),
|
|
/// Invalid Spending Conditions
|
|
/// Invalid Spending Conditions
|
|
- #[error("Invalid Spending Conditions: `{0}`")]
|
|
|
|
|
|
+ #[error("Invalid spending conditions: `{0}`")]
|
|
InvalidSpendConditions(String),
|
|
InvalidSpendConditions(String),
|
|
/// Preimage not provided
|
|
/// Preimage not provided
|
|
#[error("Preimage not provided")]
|
|
#[error("Preimage not provided")]
|
|
PreimageNotProvided,
|
|
PreimageNotProvided,
|
|
/// Unknown Key
|
|
/// Unknown Key
|
|
- #[error("Unknown Key")]
|
|
|
|
|
|
+ #[error("Unknown key")]
|
|
UnknownKey,
|
|
UnknownKey,
|
|
/// Spending Locktime not provided
|
|
/// Spending Locktime not provided
|
|
#[error("Spending condition locktime not provided")]
|
|
#[error("Spending condition locktime not provided")]
|
|
LocktimeNotProvided,
|
|
LocktimeNotProvided,
|
|
- /// Unknown Keyset
|
|
|
|
- #[error("Url Path segments could not be joined")]
|
|
|
|
|
|
+ /// Url path segments could not be joined
|
|
|
|
+ #[error("Url path segments could not be joined")]
|
|
UrlPathSegments,
|
|
UrlPathSegments,
|
|
/// Quote not paid
|
|
/// Quote not paid
|
|
#[error("Quote not paid")]
|
|
#[error("Quote not paid")]
|
|
QuoteNotePaid,
|
|
QuoteNotePaid,
|
|
- /// Token Already spent error
|
|
|
|
- #[error("Token Already Spent Error")]
|
|
|
|
|
|
+ /// Token Already Spent
|
|
|
|
+ #[error("Token already spent")]
|
|
TokenAlreadySpent,
|
|
TokenAlreadySpent,
|
|
/// Unit Not supported
|
|
/// Unit Not supported
|
|
#[error("Unit not supported for method")]
|
|
#[error("Unit not supported for method")]
|
|
UnitNotSupported,
|
|
UnitNotSupported,
|
|
/// Bolt11 invoice does not have amount
|
|
/// Bolt11 invoice does not have amount
|
|
- #[error("Invoice Amount undefined")]
|
|
|
|
|
|
+ #[error("Invoice amount undefined")]
|
|
InvoiceAmountUndefined,
|
|
InvoiceAmountUndefined,
|
|
/// Incorrect quote amount
|
|
/// Incorrect quote amount
|
|
#[error("Incorrect quote amount")]
|
|
#[error("Incorrect quote amount")]
|
|
IncorrectQuoteAmount,
|
|
IncorrectQuoteAmount,
|
|
/// Keyset Not Found
|
|
/// Keyset Not Found
|
|
- #[error("Keyset Not Found")]
|
|
|
|
|
|
+ #[error("Keyset not found")]
|
|
KeysetNotFound,
|
|
KeysetNotFound,
|
|
/// Receive can only be used with tokens from single mint
|
|
/// Receive can only be used with tokens from single mint
|
|
#[error("Multiple mint tokens not supported by receive. Please deconstruct the token and use receive with_proof")]
|
|
#[error("Multiple mint tokens not supported by receive. Please deconstruct the token and use receive with_proof")]
|
|
@@ -74,16 +74,16 @@ pub enum Error {
|
|
#[error(transparent)]
|
|
#[error(transparent)]
|
|
ReqwestError(#[from] reqwest::Error),
|
|
ReqwestError(#[from] reqwest::Error),
|
|
/// Unknown error response
|
|
/// Unknown error response
|
|
- #[error("Unknown Error response: `{0}`")]
|
|
|
|
|
|
+ #[error("Unknown error response: `{0}`")]
|
|
UnknownErrorResponse(String),
|
|
UnknownErrorResponse(String),
|
|
/// Hex Error
|
|
/// Hex Error
|
|
#[error(transparent)]
|
|
#[error(transparent)]
|
|
HexError(#[from] hex::Error),
|
|
HexError(#[from] hex::Error),
|
|
/// Unknown Wallet
|
|
/// Unknown Wallet
|
|
- #[error("Unknown Wallet: `{0}`")]
|
|
|
|
|
|
+ #[error("Unknown wallet: `{0}`")]
|
|
UnknownWallet(WalletKey),
|
|
UnknownWallet(WalletKey),
|
|
/// Incorrect Wallet
|
|
/// Incorrect Wallet
|
|
- #[error("Incorrect Wallet: `{0}`")]
|
|
|
|
|
|
+ #[error("Incorrect wallet: `{0}`")]
|
|
IncorrectWallet(String),
|
|
IncorrectWallet(String),
|
|
/// Max Fee Ecxeded
|
|
/// Max Fee Ecxeded
|
|
#[error("Max fee exceeded")]
|
|
#[error("Max fee exceeded")]
|