@hubbleprotocol/farms-sdk
Version:
435 lines (434 loc) • 18.3 kB
TypeScript
export type CustomError = StakeZero | UnstakeZero | NothingToUnstake | NoRewardToHarvest | NoRewardInList | RewardAlreadyInitialized | MaxRewardNumberReached | RewardDoesNotExist | WrongRewardVaultAccount | RewardVaultMismatch | RewardVaultAuthorityMismatch | NothingStaked | IntegerOverflow | ConversionFailure | UnexpectedAccount | OperationForbidden | MathOverflow | MinClaimDurationNotReached | RewardsVaultHasDelegate | RewardsVaultHasCloseAuthority | FarmVaultHasDelegate | FarmVaultHasCloseAuthority | RewardsTreasuryVaultHasDelegate | RewardsTreasuryVaultHasCloseAuthority | UserAtaRewardVaultMintMissmatch | UserAtaFarmTokenMintMissmatch | TokenFarmTokenMintMissmatch | RewardAtaRewardMintMissmatch | RewardAtaOwnerNotPayer | InvalidGlobalConfigMode | RewardIndexOutOfRange | NothingToWithdraw | UserDelegatedFarmNonDelegatedMissmatch | AuthorityFarmDelegateMissmatch | FarmNotDelegated | FarmDelegated | UnstakeNotElapsed | PendingWithdrawalNotWithdrawnYet | DepositZero | InvalidConfigValue | InvalidPenaltyPercentage | EarlyWithdrawalNotAllowed | InvalidLockingTimestamps | InvalidRpsCurvePoint | InvalidTimestamp | DepositCapReached | MissingScopePrices | ScopeOraclePriceTooOld | InvalidOracleConfig | CouldNotDeserializeScope | RewardAtaOwnerNotAdmin | WithdrawRewardZeroAvailable | RewardScheduleCurveSet | UnsupportedTokenExtension;
export declare class StakeZero extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6000;
readonly code = 6000;
readonly name = "StakeZero";
readonly msg = "Cannot stake 0 amount";
constructor(logs?: string[] | undefined);
}
export declare class UnstakeZero extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6001;
readonly code = 6001;
readonly name = "UnstakeZero";
readonly msg = "Cannot unstake 0 amount";
constructor(logs?: string[] | undefined);
}
export declare class NothingToUnstake extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6002;
readonly code = 6002;
readonly name = "NothingToUnstake";
readonly msg = "Nothing to unstake";
constructor(logs?: string[] | undefined);
}
export declare class NoRewardToHarvest extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6003;
readonly code = 6003;
readonly name = "NoRewardToHarvest";
readonly msg = "No reward to harvest";
constructor(logs?: string[] | undefined);
}
export declare class NoRewardInList extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6004;
readonly code = 6004;
readonly name = "NoRewardInList";
readonly msg = "Reward not present in reward list";
constructor(logs?: string[] | undefined);
}
export declare class RewardAlreadyInitialized extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6005;
readonly code = 6005;
readonly name = "RewardAlreadyInitialized";
readonly msg = "Reward already initialized";
constructor(logs?: string[] | undefined);
}
export declare class MaxRewardNumberReached extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6006;
readonly code = 6006;
readonly name = "MaxRewardNumberReached";
readonly msg = "Max number of reward tokens reached";
constructor(logs?: string[] | undefined);
}
export declare class RewardDoesNotExist extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6007;
readonly code = 6007;
readonly name = "RewardDoesNotExist";
readonly msg = "Reward does not exist";
constructor(logs?: string[] | undefined);
}
export declare class WrongRewardVaultAccount extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6008;
readonly code = 6008;
readonly name = "WrongRewardVaultAccount";
readonly msg = "Reward vault exists but the account is wrong";
constructor(logs?: string[] | undefined);
}
export declare class RewardVaultMismatch extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6009;
readonly code = 6009;
readonly name = "RewardVaultMismatch";
readonly msg = "Reward vault pubkey does not match staking pool vault";
constructor(logs?: string[] | undefined);
}
export declare class RewardVaultAuthorityMismatch extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6010;
readonly code = 6010;
readonly name = "RewardVaultAuthorityMismatch";
readonly msg = "Reward vault authority pubkey does not match staking pool vault";
constructor(logs?: string[] | undefined);
}
export declare class NothingStaked extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6011;
readonly code = 6011;
readonly name = "NothingStaked";
readonly msg = "Nothing staked, cannot collect any rewards";
constructor(logs?: string[] | undefined);
}
export declare class IntegerOverflow extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6012;
readonly code = 6012;
readonly name = "IntegerOverflow";
readonly msg = "Integer overflow";
constructor(logs?: string[] | undefined);
}
export declare class ConversionFailure extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6013;
readonly code = 6013;
readonly name = "ConversionFailure";
readonly msg = "Conversion failure";
constructor(logs?: string[] | undefined);
}
export declare class UnexpectedAccount extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6014;
readonly code = 6014;
readonly name = "UnexpectedAccount";
readonly msg = "Unexpected account in instruction";
constructor(logs?: string[] | undefined);
}
export declare class OperationForbidden extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6015;
readonly code = 6015;
readonly name = "OperationForbidden";
readonly msg = "Operation forbidden";
constructor(logs?: string[] | undefined);
}
export declare class MathOverflow extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6016;
readonly code = 6016;
readonly name = "MathOverflow";
readonly msg = "Mathematical operation with overflow";
constructor(logs?: string[] | undefined);
}
export declare class MinClaimDurationNotReached extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6017;
readonly code = 6017;
readonly name = "MinClaimDurationNotReached";
readonly msg = "Minimum claim duration has not been reached";
constructor(logs?: string[] | undefined);
}
export declare class RewardsVaultHasDelegate extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6018;
readonly code = 6018;
readonly name = "RewardsVaultHasDelegate";
readonly msg = "Reward vault has a delegate";
constructor(logs?: string[] | undefined);
}
export declare class RewardsVaultHasCloseAuthority extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6019;
readonly code = 6019;
readonly name = "RewardsVaultHasCloseAuthority";
readonly msg = "Reward vault has a close authority";
constructor(logs?: string[] | undefined);
}
export declare class FarmVaultHasDelegate extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6020;
readonly code = 6020;
readonly name = "FarmVaultHasDelegate";
readonly msg = "Farm vault has a delegate";
constructor(logs?: string[] | undefined);
}
export declare class FarmVaultHasCloseAuthority extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6021;
readonly code = 6021;
readonly name = "FarmVaultHasCloseAuthority";
readonly msg = "Farm vault has a close authority";
constructor(logs?: string[] | undefined);
}
export declare class RewardsTreasuryVaultHasDelegate extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6022;
readonly code = 6022;
readonly name = "RewardsTreasuryVaultHasDelegate";
readonly msg = "Reward vault has a delegate";
constructor(logs?: string[] | undefined);
}
export declare class RewardsTreasuryVaultHasCloseAuthority extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6023;
readonly code = 6023;
readonly name = "RewardsTreasuryVaultHasCloseAuthority";
readonly msg = "Reward vault has a close authority";
constructor(logs?: string[] | undefined);
}
export declare class UserAtaRewardVaultMintMissmatch extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6024;
readonly code = 6024;
readonly name = "UserAtaRewardVaultMintMissmatch";
readonly msg = "User ata and reward vault have different mints";
constructor(logs?: string[] | undefined);
}
export declare class UserAtaFarmTokenMintMissmatch extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6025;
readonly code = 6025;
readonly name = "UserAtaFarmTokenMintMissmatch";
readonly msg = "User ata and farm token have different mints";
constructor(logs?: string[] | undefined);
}
export declare class TokenFarmTokenMintMissmatch extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6026;
readonly code = 6026;
readonly name = "TokenFarmTokenMintMissmatch";
readonly msg = "Token mint and farm token have different mints";
constructor(logs?: string[] | undefined);
}
export declare class RewardAtaRewardMintMissmatch extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6027;
readonly code = 6027;
readonly name = "RewardAtaRewardMintMissmatch";
readonly msg = "Reward ata mint is different than reward mint";
constructor(logs?: string[] | undefined);
}
export declare class RewardAtaOwnerNotPayer extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6028;
readonly code = 6028;
readonly name = "RewardAtaOwnerNotPayer";
readonly msg = "Reward ata owner is different than payer";
constructor(logs?: string[] | undefined);
}
export declare class InvalidGlobalConfigMode extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6029;
readonly code = 6029;
readonly name = "InvalidGlobalConfigMode";
readonly msg = "Mode to update global_config is invalid";
constructor(logs?: string[] | undefined);
}
export declare class RewardIndexOutOfRange extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6030;
readonly code = 6030;
readonly name = "RewardIndexOutOfRange";
readonly msg = "Reward Index is higher than number of rewards";
constructor(logs?: string[] | undefined);
}
export declare class NothingToWithdraw extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6031;
readonly code = 6031;
readonly name = "NothingToWithdraw";
readonly msg = "No tokens available to withdraw";
constructor(logs?: string[] | undefined);
}
export declare class UserDelegatedFarmNonDelegatedMissmatch extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6032;
readonly code = 6032;
readonly name = "UserDelegatedFarmNonDelegatedMissmatch";
readonly msg = "user, user_ref, authority and payer must match for non-delegated farm";
constructor(logs?: string[] | undefined);
}
export declare class AuthorityFarmDelegateMissmatch extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6033;
readonly code = 6033;
readonly name = "AuthorityFarmDelegateMissmatch";
readonly msg = "Authority must match farm delegate authority";
constructor(logs?: string[] | undefined);
}
export declare class FarmNotDelegated extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6034;
readonly code = 6034;
readonly name = "FarmNotDelegated";
readonly msg = "Farm not delegated, can not set stake";
constructor(logs?: string[] | undefined);
}
export declare class FarmDelegated extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6035;
readonly code = 6035;
readonly name = "FarmDelegated";
readonly msg = "Operation not allowed for delegated farm";
constructor(logs?: string[] | undefined);
}
export declare class UnstakeNotElapsed extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6036;
readonly code = 6036;
readonly name = "UnstakeNotElapsed";
readonly msg = "Unstake lockup period is not elapsed. Deposit is locked until end of unstake period";
constructor(logs?: string[] | undefined);
}
export declare class PendingWithdrawalNotWithdrawnYet extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6037;
readonly code = 6037;
readonly name = "PendingWithdrawalNotWithdrawnYet";
readonly msg = "Pending withdrawal already exist and not withdrawn yet";
constructor(logs?: string[] | undefined);
}
export declare class DepositZero extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6038;
readonly code = 6038;
readonly name = "DepositZero";
readonly msg = "Cannot deposit zero amount directly to farm vault";
constructor(logs?: string[] | undefined);
}
export declare class InvalidConfigValue extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6039;
readonly code = 6039;
readonly name = "InvalidConfigValue";
readonly msg = "Invalid config value";
constructor(logs?: string[] | undefined);
}
export declare class InvalidPenaltyPercentage extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6040;
readonly code = 6040;
readonly name = "InvalidPenaltyPercentage";
readonly msg = "Invalid penalty percentage";
constructor(logs?: string[] | undefined);
}
export declare class EarlyWithdrawalNotAllowed extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6041;
readonly code = 6041;
readonly name = "EarlyWithdrawalNotAllowed";
readonly msg = "Early withdrawal not allowed";
constructor(logs?: string[] | undefined);
}
export declare class InvalidLockingTimestamps extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6042;
readonly code = 6042;
readonly name = "InvalidLockingTimestamps";
readonly msg = "Invalid locking timestamps";
constructor(logs?: string[] | undefined);
}
export declare class InvalidRpsCurvePoint extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6043;
readonly code = 6043;
readonly name = "InvalidRpsCurvePoint";
readonly msg = "Invalid reward rate curve point";
constructor(logs?: string[] | undefined);
}
export declare class InvalidTimestamp extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6044;
readonly code = 6044;
readonly name = "InvalidTimestamp";
readonly msg = "Invalid timestamp";
constructor(logs?: string[] | undefined);
}
export declare class DepositCapReached extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6045;
readonly code = 6045;
readonly name = "DepositCapReached";
readonly msg = "Deposit cap reached";
constructor(logs?: string[] | undefined);
}
export declare class MissingScopePrices extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6046;
readonly code = 6046;
readonly name = "MissingScopePrices";
readonly msg = "Missing Scope Prices";
constructor(logs?: string[] | undefined);
}
export declare class ScopeOraclePriceTooOld extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6047;
readonly code = 6047;
readonly name = "ScopeOraclePriceTooOld";
readonly msg = "Scope Oracle Price Too Old";
constructor(logs?: string[] | undefined);
}
export declare class InvalidOracleConfig extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6048;
readonly code = 6048;
readonly name = "InvalidOracleConfig";
readonly msg = "Invalid Oracle Config";
constructor(logs?: string[] | undefined);
}
export declare class CouldNotDeserializeScope extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6049;
readonly code = 6049;
readonly name = "CouldNotDeserializeScope";
readonly msg = "Could not deserialize scope";
constructor(logs?: string[] | undefined);
}
export declare class RewardAtaOwnerNotAdmin extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6050;
readonly code = 6050;
readonly name = "RewardAtaOwnerNotAdmin";
readonly msg = "Reward ata owner is different than farm admin";
constructor(logs?: string[] | undefined);
}
export declare class WithdrawRewardZeroAvailable extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6051;
readonly code = 6051;
readonly name = "WithdrawRewardZeroAvailable";
readonly msg = "Cannot withdraw reward as available amount is zero";
constructor(logs?: string[] | undefined);
}
export declare class RewardScheduleCurveSet extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6052;
readonly code = 6052;
readonly name = "RewardScheduleCurveSet";
readonly msg = "Cannot withdraw reward as reward schedule is set";
constructor(logs?: string[] | undefined);
}
export declare class UnsupportedTokenExtension extends Error {
readonly logs?: string[] | undefined;
static readonly code = 6053;
readonly code = 6053;
readonly name = "UnsupportedTokenExtension";
readonly msg = "Cannot initialize farm while having a mint with token22 and requested extensions";
constructor(logs?: string[] | undefined);
}
export declare function fromCode(code: number, logs?: string[]): CustomError | null;