@nosana/kit
Version:
Nosana KIT
46 lines (45 loc) • 3.03 kB
TypeScript
/**
* This code was AUTOGENERATED using the Codama library.
* Please DO NOT EDIT THIS FILE, instead use visitors
* to add features, then rerun Codama to update it.
*
* @see https://github.com/codama-idl/codama
*/
import { type Address, type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, type SolanaError } from '@solana/kit';
/** AmountNotEnough: This amount is not enough. */
export declare const NOSANA_STAKING_ERROR__AMOUNT_NOT_ENOUGH = 6000;
/** AlreadyInitialized: This stake is already running. */
export declare const NOSANA_STAKING_ERROR__ALREADY_INITIALIZED = 6001;
/** AlreadyClaimed: This stake is already claimed. */
export declare const NOSANA_STAKING_ERROR__ALREADY_CLAIMED = 6002;
/** AlreadyStaked: This stake is already staked. */
export declare const NOSANA_STAKING_ERROR__ALREADY_STAKED = 6003;
/** AlreadyUnstaked: This stake is already unstaked. */
export declare const NOSANA_STAKING_ERROR__ALREADY_UNSTAKED = 6004;
/** NotUnstaked: This stake is not yet unstaked. */
export declare const NOSANA_STAKING_ERROR__NOT_UNSTAKED = 6005;
/** Locked: This stake is still locked. */
export declare const NOSANA_STAKING_ERROR__LOCKED = 6006;
/** DurationTooShort: This stake duration is not long enough. */
export declare const NOSANA_STAKING_ERROR__DURATION_TOO_SHORT = 6007;
/** DurationTooLong: This stake duration is too long. */
export declare const NOSANA_STAKING_ERROR__DURATION_TOO_LONG = 6008;
/** DoesNotExist: This stake account does not exist. */
export declare const NOSANA_STAKING_ERROR__DOES_NOT_EXIST = 6009;
/** Decreased: This stake is not allowed to decrease. */
export declare const NOSANA_STAKING_ERROR__DECREASED = 6010;
/** HasReward: This stake still has a reward account. */
export declare const NOSANA_STAKING_ERROR__HAS_REWARD = 6011;
/** InvalidStakeAccount: This stake does not belong to the authority. */
export declare const NOSANA_STAKING_ERROR__INVALID_STAKE_ACCOUNT = 6012;
export type NosanaStakingError = typeof NOSANA_STAKING_ERROR__ALREADY_CLAIMED | typeof NOSANA_STAKING_ERROR__ALREADY_INITIALIZED | typeof NOSANA_STAKING_ERROR__ALREADY_STAKED | typeof NOSANA_STAKING_ERROR__ALREADY_UNSTAKED | typeof NOSANA_STAKING_ERROR__AMOUNT_NOT_ENOUGH | typeof NOSANA_STAKING_ERROR__DECREASED | typeof NOSANA_STAKING_ERROR__DOES_NOT_EXIST | typeof NOSANA_STAKING_ERROR__DURATION_TOO_LONG | typeof NOSANA_STAKING_ERROR__DURATION_TOO_SHORT | typeof NOSANA_STAKING_ERROR__HAS_REWARD | typeof NOSANA_STAKING_ERROR__INVALID_STAKE_ACCOUNT | typeof NOSANA_STAKING_ERROR__LOCKED | typeof NOSANA_STAKING_ERROR__NOT_UNSTAKED;
export declare function getNosanaStakingErrorMessage(code: NosanaStakingError): string;
export declare function isNosanaStakingError<TProgramErrorCode extends NosanaStakingError>(error: unknown, transactionMessage: {
instructions: Record<number, {
programAddress: Address;
}>;
}, code?: TProgramErrorCode): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> & Readonly<{
context: Readonly<{
code: TProgramErrorCode;
}>;
}>;