substrate_stellar_sdk/
error.rs

1use base64::DecodeError;
2use hex::FromHexError;
3
4#[cfg(feature = "offchain")]
5use crate::horizon::FetchError;
6
7use sp_std::vec::Vec;
8
9#[derive(Debug, Clone, PartialEq)]
10pub enum StellarSdkError {
11    InvalidBase32Character {
12        at_position: usize,
13    },
14
15    /// The encoding can be decoded but is not the canonical encoding of the underlying binary key
16    InvalidStellarKeyEncoding,
17
18    /// The encoding has an invalid length
19    InvalidStellarKeyEncodingLength,
20
21    /// The initial version byte is invalid for this `EncodableKey`
22    InvalidStellarKeyEncodingVersion {
23        expected_version: char,
24        found_version: char,
25    },
26
27    /// The checksum in the encoding is invaliid
28    InvalidStellarKeyChecksum {
29        expected: u16,
30        found: u16,
31    },
32
33    /// The signature has an invalid length
34    InvalidSignatureLength {
35        found_length: usize,
36        expected_length: usize,
37    },
38    /// Verification for this public key failed
39    PublicKeyCantVerify,
40
41    /// The base64 encoding of the signature is invalid
42    InvalidBase64Encoding(DecodeError),
43
44    /// The transaction envelope already has the maximal number of signatures (20)
45    TooManySignatures,
46
47    AssetCodeTooLong,
48
49    InvalidAssetCodeCharacter,
50
51    ExceedsMaximumLength {
52        requested_length: usize,
53        allowed_length: i32,
54    },
55
56    InvalidHexEncoding(FromHexError),
57
58    InvalidHashConversion,
59
60    NotApproximableAsFraction,
61
62    InvalidPrice,
63
64    InvalidTrustLineLimit,
65
66    InvalidAuthorizeFlag,
67
68    InvalidAmountString,
69
70    AmountOverflow,
71
72    AmountNegative,
73
74    AmountNonPositive,
75
76    InvalidBinaryLength {
77        found_length: usize,
78        expected_length: usize,
79    },
80
81    InvalidBalanceId,
82
83    EmptyClaimants,
84
85    InvalidSignerWeight,
86
87    CantWrapFeeBumpTransaction,
88
89    #[cfg(feature = "offchain")]
90    FetchError(FetchError),
91
92    DecodeError(Vec<u8>), // String converted as Bytes of u8
93}