#[non_exhaustive]pub enum TokenError {
Rpc(ClientError),
MintNotFound(Pubkey),
MintDecodeFailed {
mint: Pubkey,
reason: String,
},
TokenAccountDecodeFailed {
token_account: Pubkey,
reason: String,
},
LengthMismatch {
mints: usize,
mint_accounts: usize,
},
TransferHookDetected {
mint: Pubkey,
program: Pubkey,
},
WithBalanceNotSupported(Pubkey),
IncoherentWrapStrategy,
InstructionBuild(String),
InsufficientBalance {
mint: Pubkey,
required: u64,
actual: u64,
},
RequireBalanceForSolNotSupported(Pubkey),
}Expand description
All errors returned by solana-token-toolkit public API.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Rpc(ClientError)
An RPC call failed.
MintNotFound(Pubkey)
A requested mint account does not exist on chain.
MintDecodeFailed
Failed to decode a mint account.
Fields
TokenAccountDecodeFailed
Failed to decode a token account (e.g. while reading wSOL balance).
Fields
LengthMismatch
assemble_token_account_state was called with mismatched slice lengths.
Fields
TransferHookDetected
reject_transfer_hook_mints found a hook on a mint.
Fields
WithBalanceNotSupported(Pubkey)
MintIntent::WithBalance was used with a non-SOL mint.
IncoherentWrapStrategy
MintIntent::WithBalance for native SOL was paired with
WrapSolStrategy::None.
InstructionBuild(String)
An spl-token-* instruction builder returned an error.
InsufficientBalance
MintIntent::RequireTokenBalance failed because actual balance is
below required. actual is 0 when the ATA does not exist on chain.
Fields
RequireBalanceForSolNotSupported(Pubkey)
MintIntent::RequireTokenBalance was used with native_mint::ID
(SOL/wSOL). For SOL balance preparation, use MintIntent::WithBalance
(which transfers SOL into wSOL).
Trait Implementations§
Source§impl Debug for TokenError
impl Debug for TokenError
Source§impl Display for TokenError
impl Display for TokenError
Source§impl Error for TokenError
impl Error for TokenError
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 TokenError
impl From<Error> for TokenError
Source§fn from(source: ClientError) -> Self
fn from(source: ClientError) -> Self
Auto Trait Implementations§
impl Freeze for TokenError
impl !RefUnwindSafe for TokenError
impl Send for TokenError
impl Sync for TokenError
impl Unpin for TokenError
impl UnsafeUnpin for TokenError
impl !UnwindSafe for TokenError
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Pointable for T
impl<T> Pointable for T
Source§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.