#[non_exhaustive]pub enum Error {
Show 18 variants
BadAmount,
BadDestination(String),
Insufficient {
have: u64,
need: u64,
},
InsufficientForFee {
amount: u64,
fee: u64,
},
BelowPegoutMin {
value: u64,
min: u64,
},
FeeBelowMinimum {
fee: u64,
min: u64,
vsize: u64,
rate: u64,
},
Dust {
value: u64,
min: u64,
script: String,
},
WrongNetwork {
address: String,
network: String,
parent: String,
},
MarkerTooLong(usize),
Policy(String),
Signer(String),
Asset(String),
Refused(String),
Json(Error),
Encoding(String),
Core(Error),
Secp(Error),
Http(String),
}Expand description
Everything that can go wrong between “I want to pay” and a transaction the producer accepts.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BadAmount
The amount is zero (spend.mjs: “the amount is a whole number of sats”).
BadDestination(String)
The destination is neither a script hex nor a segwit address under
any prefix (spend.mjs resolveTo: “bad address …”).
Insufficient
The mature coins do not cover the amount plus the fee bound
(spend.mjs: “insufficient: … sats mature, … needed”).
InsufficientForFee
The coins covered the bound but not the fee the size came to
(spend.mjs: “insufficient coins for … plus the …-sat minimum fee”).
BelowPegoutMin
A burn below the document’s pegoutMin (SPEC 7; spend.mjs: “a
peg-out burns at least … sats”).
FeeBelowMinimum
An explicit fee under the producer’s minFeeRate policy, in the
words State::submit would refuse it with.
Fields
Dust
An output below Bitcoin’s dust threshold for its script: the chain would accept it and no wallet could economically spend it. The reference does not check; this crate does (see the crate docs).
Fields
WrongNetwork
A parent address for the wrong network: a peg-in to a bc1…
address beside tbtc4, or the reverse (SPEC 6, 3.2).
Fields
MarkerTooLong(usize)
A parent-side marker (peg-in, peg-out record) longer than the
parent’s 80-byte OP_RETURN relay policy allows, or any marker push
over the 255 bytes the shared grammar reads back (a 61-byte peg-in
marker for a 15-byte chain id fits).
Policy(String)
The SpendPolicy refused the intent.
Signer(String)
The SpendSigner could not sign.
Asset(String)
An issued-asset build the assets view would not read as asked
(SPEC 12): too little of the asset, a memo shaped like an assets
record, an input carrying another asset.
Refused(String)
A producer answered {"error": …} to a POST /tx.
Json(Error)
JSON that does not parse or does not fit the shape.
Encoding(String)
Hex or bytes that do not decode.
Core(Error)
An error from sidestr-core: a document naming an unknown parent, a
marker that cannot be built.
Secp(Error)
A secp256k1 failure: a derived scalar out of range, a bad key.
Http(String)
An HTTP failure talking to a producer (feature client).
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()