Enum stable_swap::error::SwapError[][src]

pub enum SwapError {
Show 29 variants AlreadyInUse, InvalidAdmin, InvalidOwner, InvalidOutputOwner, InvalidProgramAddress, ExpectedMint, ExpectedAccount, EmptyPool, EmptySupply, InvalidSupply, InvalidDelegate, InvalidInput, IncorrectSwapAccount, IncorrectMint, CalculationFailure, InvalidInstruction, RepeatedMint, ExceededSlippage, InvalidCloseAuthority, InvalidFreezeAuthority, ConversionFailure, Unauthorized, IsPaused, RampLocked, InsufficientRampTime, ActiveTransfer, NoActiveTransfer, AdminDeadlineExceeded, MismatchedDecimals,
}
Expand description

Errors that may be returned by the StableSwap program.

Variants

AlreadyInUse

The account cannot be initialized because it is already being used.

InvalidAdmin

The address of the admin fee account is incorrect.

InvalidOwner

The owner of the input isn’t set to the program address generated by the program.

InvalidOutputOwner

The owner of the pool token output is set to the program address generated by the program.

InvalidProgramAddress

The program address provided doesn’t match the value generated by the program.

ExpectedMint

The deserialization of the account returned something besides State::Mint.

ExpectedAccount

The deserialization of the account returned something besides State::Account.

EmptyPool

The pool supply is empty.

EmptySupply

The input token account is empty.

InvalidSupply

The pool token mint has a non-zero supply.

InvalidDelegate

The provided token account has a delegate.

InvalidInput

The input token is invalid for swap.

IncorrectSwapAccount

Address of the provided swap token account is incorrect.

IncorrectMint

Address of the provided token mint is incorrect

CalculationFailure

The calculation failed.

InvalidInstruction

Invalid instruction number passed in.

RepeatedMint

Swap input token accounts have the same mint

ExceededSlippage

Swap instruction exceeds desired slippage limit

InvalidCloseAuthority

The provided token account has a close authority.

InvalidFreezeAuthority

The pool token mint has a freeze authority.

ConversionFailure

ConversionFailure

Unauthorized

Unauthorized

IsPaused

Swap pool is paused

RampLocked

Amp. coefficient change is within min ramp duration

InsufficientRampTime

Insufficient ramp time for the ramp operation

ActiveTransfer

Active admin transfer in progress

NoActiveTransfer

No active admin transfer in progress

AdminDeadlineExceeded

Admin transfer deadline exceeded

MismatchedDecimals

Token mint decimals must be the same.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.