Skip to main content

KvaultError

Enum KvaultError 

Source
#[repr(u32)]
pub enum KvaultError {
Show 64 variants DepositAmountsZero = 7_000, SharesIssuedAmountDoesNotMatch = 7_001, MathOverflow = 7_002, IntegerOverflow = 7_003, WithdrawAmountBelowMinimum = 7_004, TooMuchLiquidityToWithdraw = 7_005, ReserveAlreadyExists = 7_006, ReserveNotPartOfAllocations = 7_007, CouldNotDeserializeAccountAsReserve = 7_008, ReserveNotProvidedInTheAccounts = 7_009, ReserveAccountAndKeyMismatch = 7_010, OutOfRangeOfReserveIndex = 7_011, CannotFindReserveInAllocations = 7_012, InvestAmountBelowMinimum = 7_013, AdminAuthorityIncorrect = 7_014, BaseVaultAuthorityIncorrect = 7_015, BaseVaultAuthorityBumpIncorrect = 7_016, TokenMintIncorrect = 7_017, TokenMintDecimalsIncorrect = 7_018, TokenVaultIncorrect = 7_019, SharesMintDecimalsIncorrect = 7_020, SharesMintIncorrect = 7_021, InitialAccountingIncorrect = 7_022, ReserveIsStale = 7_023, NotEnoughLiquidityDisinvestedToSendToUser = 7_024, BPSValueTooBig = 7_025, DepositAmountBelowMinimum = 7_026, ReserveSpaceExhausted = 7_027, CannotWithdrawFromEmptyVault = 7_028, TokensDepositedAmountDoesNotMatch = 7_029, AmountToWithdrawDoesNotMatch = 7_030, LiquidityToWithdrawDoesNotMatch = 7_031, UserReceivedAmountDoesNotMatch = 7_032, SharesBurnedAmountDoesNotMatch = 7_033, DisinvestedLiquidityAmountDoesNotMatch = 7_034, SharesMintedAmountDoesNotMatch = 7_035, AUMDecreasedAfterInvest = 7_036, AUMBelowPendingFees = 7_037, DepositAmountsZeroShares = 7_038, WithdrawResultsInZeroShares = 7_039, CannotWithdrawZeroShares = 7_040, ManagementFeeGreaterThanMaxAllowed = 7_041, VaultAUMZero = 7_042, MissingReserveForBatchRefresh = 7_043, MinWithdrawAmountTooBig = 7_044, InvestTooSoon = 7_045, WrongAdminOrAllocationAdmin = 7_046, ReserveHasNonZeroAllocationOrCTokens = 7_047, DepositAmountGreaterThanRequestedAmount = 7_048, WithdrawAmountLessThanWithdrawalPenalty = 7_049, CannotWithdrawZeroLamports = 7_050, NoUpgradeAuthority = 7_051, WithdrawalFeeBPSGreaterThanMaxAllowed = 7_052, WithdrawalFeeLamportsGreaterThanMaxAllowed = 7_053, ReserveNotWhitelisted = 7_054, InvalidBoolLikeValue = 7_055, AUMDecreasedMoreThanExpected = 7_056, RewardTopupAmountZero = 7_057, RewardTopupAmountNotExpected = 7_058, RewardWithdrawAmountZero = 7_059, RewardWithdrawAmountNotExpected = 7_060, RewardsStaleForFeeUpdate = 7_061, VaultDepositCapReached = 7_062, MaxInvestAmountMustBeGreaterThanZero = 7_063,
}

Variants§

§

DepositAmountsZero = 7_000

Deposit amounts are zero.

§

SharesIssuedAmountDoesNotMatch = 7_001

Shares issued amount does not match expected.

§

MathOverflow = 7_002

Math operation overflowed.

§

IntegerOverflow = 7_003

Integer conversion overflowed.

§

WithdrawAmountBelowMinimum = 7_004

Withdraw amount is below the minimum.

§

TooMuchLiquidityToWithdraw = 7_005

Too much liquidity requested for withdrawal.

§

ReserveAlreadyExists = 7_006

Reserve already exists in the vault.

§

ReserveNotPartOfAllocations = 7_007

Reserve is not part of vault allocations.

§

CouldNotDeserializeAccountAsReserve = 7_008

Could not deserialize account as a reserve.

§

ReserveNotProvidedInTheAccounts = 7_009

Reserve not provided in the accounts.

§

ReserveAccountAndKeyMismatch = 7_010

Reserve account and key mismatch.

§

OutOfRangeOfReserveIndex = 7_011

Reserve index is out of range.

§

CannotFindReserveInAllocations = 7_012

Cannot find reserve in allocations.

§

InvestAmountBelowMinimum = 7_013

Invest amount is below the minimum.

§

AdminAuthorityIncorrect = 7_014

Admin authority is incorrect.

§

BaseVaultAuthorityIncorrect = 7_015

Base vault authority is incorrect.

§

BaseVaultAuthorityBumpIncorrect = 7_016

Base vault authority bump is incorrect.

§

TokenMintIncorrect = 7_017

Token mint is incorrect.

§

TokenMintDecimalsIncorrect = 7_018

Token mint decimals are incorrect.

§

TokenVaultIncorrect = 7_019

Token vault is incorrect.

§

SharesMintDecimalsIncorrect = 7_020

Shares mint decimals are incorrect.

§

SharesMintIncorrect = 7_021

Shares mint is incorrect.

§

InitialAccountingIncorrect = 7_022

Initial accounting is incorrect.

§

ReserveIsStale = 7_023

Reserve state needs to be refreshed.

§

NotEnoughLiquidityDisinvestedToSendToUser = 7_024

Not enough liquidity disinvested to send to user.

§

BPSValueTooBig = 7_025

Basis points value is too large.

§

DepositAmountBelowMinimum = 7_026

Deposit amount is below the minimum.

§

ReserveSpaceExhausted = 7_027

No more reserve slots available in the vault.

§

CannotWithdrawFromEmptyVault = 7_028

Cannot withdraw from an empty vault.

§

TokensDepositedAmountDoesNotMatch = 7_029

Tokens deposited amount does not match expected.

§

AmountToWithdrawDoesNotMatch = 7_030

Amount to withdraw does not match expected.

§

LiquidityToWithdrawDoesNotMatch = 7_031

Liquidity to withdraw does not match expected.

§

UserReceivedAmountDoesNotMatch = 7_032

User received amount does not match expected.

§

SharesBurnedAmountDoesNotMatch = 7_033

Shares burned amount does not match expected.

§

DisinvestedLiquidityAmountDoesNotMatch = 7_034

Disinvested liquidity amount does not match expected.

§

SharesMintedAmountDoesNotMatch = 7_035

Shares minted amount does not match expected.

§

AUMDecreasedAfterInvest = 7_036

Assets under management decreased after invest.

§

AUMBelowPendingFees = 7_037

Assets under management is below pending fees.

§

DepositAmountsZeroShares = 7_038

Deposit would result in zero shares.

§

WithdrawResultsInZeroShares = 7_039

Withdraw results in zero shares.

§

CannotWithdrawZeroShares = 7_040

Cannot withdraw zero shares.

§

ManagementFeeGreaterThanMaxAllowed = 7_041

Management fee exceeds the maximum allowed.

§

VaultAUMZero = 7_042

Vault assets under management is zero.

§

MissingReserveForBatchRefresh = 7_043

Missing reserve account for batch refresh.

§

MinWithdrawAmountTooBig = 7_044

Minimum withdraw amount is too large.

§

InvestTooSoon = 7_045

Invest called too soon after the previous invest.

§

WrongAdminOrAllocationAdmin = 7_046

Signer is neither the admin nor the allocation admin.

§

ReserveHasNonZeroAllocationOrCTokens = 7_047

Reserve has non-zero allocation or cToken balance.

§

DepositAmountGreaterThanRequestedAmount = 7_048

Deposit amount exceeds the requested amount.

§

WithdrawAmountLessThanWithdrawalPenalty = 7_049

Withdraw amount is less than the withdrawal penalty.

§

CannotWithdrawZeroLamports = 7_050

Cannot withdraw zero lamports.

§

NoUpgradeAuthority = 7_051

Program has no upgrade authority.

§

WithdrawalFeeBPSGreaterThanMaxAllowed = 7_052

Withdrawal fee BPS exceeds the maximum allowed.

§

WithdrawalFeeLamportsGreaterThanMaxAllowed = 7_053

Withdrawal fee lamports exceeds the maximum allowed.

§

ReserveNotWhitelisted = 7_054

Reserve is not whitelisted.

§

InvalidBoolLikeValue = 7_055

Invalid boolean-like value.

§

AUMDecreasedMoreThanExpected = 7_056

Assets under management decreased more than expected.

§

RewardTopupAmountZero = 7_057

§

RewardTopupAmountNotExpected = 7_058

§

RewardWithdrawAmountZero = 7_059

§

RewardWithdrawAmountNotExpected = 7_060

§

RewardsStaleForFeeUpdate = 7_061

§

VaultDepositCapReached = 7_062

Vault deposit cap reached.

§

MaxInvestAmountMustBeGreaterThanZero = 7_063

Max invest amount must be greater than zero.

Implementations§

Source§

impl KvaultError

Source

pub const fn error_code(self) -> u32

Returns the Anchor error code for this variant (6000 + offset).

Source

pub const fn message(self) -> &'static str

Returns the human-readable error message.

Source

pub const fn from_error_code(code: u32) -> Option<Self>

Converts an Anchor error code to a KvaultError, if it matches a known variant.

Trait Implementations§

Source§

impl Clone for KvaultError

Source§

fn clone(&self) -> KvaultError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for KvaultError

Source§

impl Debug for KvaultError

Source§

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

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

impl Display for KvaultError

Source§

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

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

impl Eq for KvaultError

Source§

impl Error for KvaultError

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 Hash for KvaultError

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for KvaultError

Source§

fn eq(&self, other: &KvaultError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for KvaultError

Source§

impl TryFrom<u32> for KvaultError

Source§

fn try_from(code: u32) -> Result<Self, Self::Error>

Converts an error code to a KvaultError. Returns Err(code) if the code doesn’t match any known variant.

Source§

type Error = u32

The type returned in the event of a conversion error.

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> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
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.

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<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
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
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.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.