Skip to main content

SdkError

Enum SdkError 

Source
pub enum SdkError {
Show 19 variants SparkError(String), InsufficientFunds { token_identifier: Option<String>, }, InvalidUuid(String), InvalidInput(String), CrossChainAmountOutOfRange { reason: String, too_small: bool, bound_amount: Option<u128>, bound_usd_cents: Option<u64>, }, CrossChainRouteUnavailable { reason: String, temporary: bool, }, NetworkError(String), StorageError(String), ChainServiceError(String), MaxDepositClaimFeeExceeded { tx: String, vout: u32, max_fee: Option<Fee>, required_fee_sats: u64, required_fee_rate_sat_per_vbyte: u64, }, MissingUtxo { tx: String, vout: u32, }, DepositClaimInProgress { tx: String, vout: u32, }, RefundReplacementFeeTooLow { pending_fee_sats: u64, required_fee_sats: u64, }, LnurlError(String), Signer(String), OptimizationAlreadyRunning, OptimizationCancelled, InsufficientCpfpFunds { required_sat: u64, }, Generic(String),
}
Expand description

Error type for the BreezSdk

Variants§

§

SparkError(String)

§

InsufficientFunds

Fields

§token_identifier: Option<String>

The token that cannot cover the payment. Unset when the shortfall is in sats or when no single token can be named.

§

InvalidUuid(String)

§

InvalidInput(String)

Invalid input error

§

CrossChainAmountOutOfRange

A cross-chain provider rejected the amount as outside what it accepts for the route.

The bound fields carry what the route publishes in the direction that failed, in whichever denominations the provider publishes. A route can enforce a tighter bound than it publishes, so an amount inside the published one can still land here.

The message is the provider’s own rejection text with the published bound appended, so it already names the direction.

Fields

§reason: String
§too_small: bool

true for a rejection below the minimum, false for one above the maximum or beyond available liquidity.

§bound_amount: Option<u128>

The published bound in the base units of the asset paid in: the Spark-side asset on a send, the external asset on a receive.

§bound_usd_cents: Option<u64>

The published bound as an order value in USD cents.

§

CrossChainRouteUnavailable

A cross-chain provider won’t serve the route, for now or at all.

The message leads with a fixed phrase for each case, for bindings that only see the text, followed by the provider’s own reason.

Fields

§reason: String
§temporary: bool

true when the provider expects the route back shortly, so the same request can succeed later. Otherwise try another route.

§

NetworkError(String)

Network error

§

StorageError(String)

Storage error

§

ChainServiceError(String)

§

MaxDepositClaimFeeExceeded

Fields

§vout: u32
§max_fee: Option<Fee>
§required_fee_sats: u64
§required_fee_rate_sat_per_vbyte: u64
§

MissingUtxo

Fields

§vout: u32
§

DepositClaimInProgress

Another claim on this deposit is already running.

Fields

§vout: u32
§

RefundReplacementFeeTooLow

A refund for this deposit is already on the network, and the requested replacement does not pay enough to displace it.

Fields

§pending_fee_sats: u64
§required_fee_sats: u64
§

LnurlError(String)

§

Signer(String)

§

OptimizationAlreadyRunning

optimize_leaves was called while another optimization run (auto or manual) was already in flight.

§

OptimizationCancelled

optimize_leaves was preempted by the SDK to free leaves for a higher-priority operation (typically a payment).

§

InsufficientCpfpFunds

The provided CPFP funding is too low to cover the exit’s on-chain fees.

Fields

§required_sat: u64
§

Generic(String)

Trait Implementations§

Source§

impl Clone for SdkError

Source§

fn clone(&self) -> SdkError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SdkError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SdkError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for SdkError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<&str> for SdkError

Source§

fn from(s: &str) -> Self

Converts to this type from the input type.
Source§

impl From<BoltzError> for SdkError

Source§

fn from(e: BoltzError) -> Self

Converts to this type from the input type.
Source§

impl From<ChainServiceError> for SdkError

Source§

fn from(e: ChainServiceError) -> Self

Converts to this type from the input type.
Source§

impl From<ConversionError> for SdkError

Source§

fn from(e: ConversionError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for SdkError

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for SdkError

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<FlashnetError> for SdkError

Source§

fn from(e: FlashnetError) -> Self

Converts to this type from the input type.
Source§

impl From<FromHexError> for SdkError

Source§

fn from(e: FromHexError) -> Self

Converts to this type from the input type.
Source§

impl From<HttpError> for SdkError

Source§

fn from(value: ServiceConnectivityError) -> Self

Converts to this type from the input type.
Source§

impl From<Infallible> for SdkError

Source§

fn from(value: Infallible) -> Self

Converts to this type from the input type.
Source§

impl From<LnurlError> for SdkError

Source§

fn from(e: LnurlError) -> Self

Converts to this type from the input type.
Source§

impl From<OptimizationError> for SdkError

Source§

fn from(e: OptimizationError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseError> for SdkError

Source§

fn from(e: ParseError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseError> for SdkError

Source§

fn from(e: ParseError) -> Self

Converts to this type from the input type.
Source§

impl From<SdkError> for ConversionError

Source§

fn from(source: SdkError) -> Self

Converts to this type from the input type.
Source§

impl From<SdkError> for DepositClaimError

Source§

fn from(value: SdkError) -> Self

Converts to this type from the input type.
Source§

impl From<SparkWalletError> for SdkError

Source§

fn from(e: SparkWalletError) -> Self

Converts to this type from the input type.
Source§

impl From<StorageError> for SdkError

Source§

fn from(e: StorageError) -> Self

Converts to this type from the input type.
Source§

impl From<String> for SdkError

Source§

fn from(s: String) -> Self

Converts to this type from the input type.
Source§

impl From<SystemTimeError> for SdkError

Source§

fn from(e: SystemTimeError) -> Self

Converts to this type from the input type.
Source§

impl From<TryFromIntError> for SdkError

Source§

fn from(e: TryFromIntError) -> Self

Converts to this type from the input type.
Source§

impl From<TryInitError> for SdkError

Source§

fn from(_value: TryInitError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more