UNPKG

@kamino-finance/kliquidity-sdk

Version:

Typescript SDK for interacting with the Kamino Liquidity (kliquidity) protocol

837 lines 25.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OperatorsAreTheSame = exports.UnauthorizedAddress = exports.MustWithdrawnIneligibleReward = exports.RewardNotEnded = exports.InvalidIndex = exports.ExceedMaxWhitelist = exports.InvalidPoolType = exports.PoolDisabled = exports.ExcessiveFeeUpdate = exports.InvalidPositionWidth = exports.InsufficientOutAmount = exports.BinIdOutOfBound = exports.CannotFindNonZeroLiquidityBinArrayId = exports.BitmapExtensionAccountIsNotProvided = exports.InvalidLookupTimestamp = exports.InsufficientSample = exports.MissingOracle = exports.InvalidFeeParameter = exports.UnauthorizedAccess = exports.NonEmptyPosition = exports.InvalidRewardVault = exports.NonContinuousBinArrays = exports.InvalidBinArray = exports.IdenticalRewardDuration = exports.RewardCampaignInProgress = exports.IdenticalFunder = exports.RewardUninitialized = exports.RewardInitialized = exports.InvalidRewardDuration = exports.InvalidRewardIndex = exports.TypeCastFailed = exports.MathOverflow = exports.InvalidBps = exports.IdenticalFeeOwner = exports.InvalidAdmin = exports.InvalidFeeWithdrawAmount = exports.InvalidFeeOwner = exports.PairInsufficientLiquidity = exports.InvalidAccountForSingleDeposit = exports.InvalidTokenMint = exports.BinArrayNotFound = exports.InvalidPosition = exports.ZeroLiquidity = exports.NonPresetBinStep = exports.CompositionFactorFlawed = exports.ExceededBinSlippageTolerance = exports.ExceededAmountSlippageTolerance = exports.InvalidInput = exports.InvalidBinId = exports.InvalidStartBinIndex = void 0; exports.BinRangeIsNotEmpty = exports.InvalidLockReleaseSlot = exports.LiquidityLocked = exports.InvalidStrategyParameters = exports.ExceedMaxSwappedAmount = exports.LastSlotCannotBeSmallerThanActivateSlot = exports.AlreadyPassActivationSlot = exports.WrongRentReceiver = exports.WithdrawToWrongTokenAccount = void 0; exports.fromCode = fromCode; class InvalidStartBinIndex extends Error { logs; static code = 6000; code = 6000; name = "InvalidStartBinIndex"; msg = "Invalid start bin index"; constructor(logs) { super("6000: Invalid start bin index"); this.logs = logs; } } exports.InvalidStartBinIndex = InvalidStartBinIndex; class InvalidBinId extends Error { logs; static code = 6001; code = 6001; name = "InvalidBinId"; msg = "Invalid bin id"; constructor(logs) { super("6001: Invalid bin id"); this.logs = logs; } } exports.InvalidBinId = InvalidBinId; class InvalidInput extends Error { logs; static code = 6002; code = 6002; name = "InvalidInput"; msg = "Invalid input data"; constructor(logs) { super("6002: Invalid input data"); this.logs = logs; } } exports.InvalidInput = InvalidInput; class ExceededAmountSlippageTolerance extends Error { logs; static code = 6003; code = 6003; name = "ExceededAmountSlippageTolerance"; msg = "Exceeded amount slippage tolerance"; constructor(logs) { super("6003: Exceeded amount slippage tolerance"); this.logs = logs; } } exports.ExceededAmountSlippageTolerance = ExceededAmountSlippageTolerance; class ExceededBinSlippageTolerance extends Error { logs; static code = 6004; code = 6004; name = "ExceededBinSlippageTolerance"; msg = "Exceeded bin slippage tolerance"; constructor(logs) { super("6004: Exceeded bin slippage tolerance"); this.logs = logs; } } exports.ExceededBinSlippageTolerance = ExceededBinSlippageTolerance; class CompositionFactorFlawed extends Error { logs; static code = 6005; code = 6005; name = "CompositionFactorFlawed"; msg = "Composition factor flawed"; constructor(logs) { super("6005: Composition factor flawed"); this.logs = logs; } } exports.CompositionFactorFlawed = CompositionFactorFlawed; class NonPresetBinStep extends Error { logs; static code = 6006; code = 6006; name = "NonPresetBinStep"; msg = "Non preset bin step"; constructor(logs) { super("6006: Non preset bin step"); this.logs = logs; } } exports.NonPresetBinStep = NonPresetBinStep; class ZeroLiquidity extends Error { logs; static code = 6007; code = 6007; name = "ZeroLiquidity"; msg = "Zero liquidity"; constructor(logs) { super("6007: Zero liquidity"); this.logs = logs; } } exports.ZeroLiquidity = ZeroLiquidity; class InvalidPosition extends Error { logs; static code = 6008; code = 6008; name = "InvalidPosition"; msg = "Invalid position"; constructor(logs) { super("6008: Invalid position"); this.logs = logs; } } exports.InvalidPosition = InvalidPosition; class BinArrayNotFound extends Error { logs; static code = 6009; code = 6009; name = "BinArrayNotFound"; msg = "Bin array not found"; constructor(logs) { super("6009: Bin array not found"); this.logs = logs; } } exports.BinArrayNotFound = BinArrayNotFound; class InvalidTokenMint extends Error { logs; static code = 6010; code = 6010; name = "InvalidTokenMint"; msg = "Invalid token mint"; constructor(logs) { super("6010: Invalid token mint"); this.logs = logs; } } exports.InvalidTokenMint = InvalidTokenMint; class InvalidAccountForSingleDeposit extends Error { logs; static code = 6011; code = 6011; name = "InvalidAccountForSingleDeposit"; msg = "Invalid account for single deposit"; constructor(logs) { super("6011: Invalid account for single deposit"); this.logs = logs; } } exports.InvalidAccountForSingleDeposit = InvalidAccountForSingleDeposit; class PairInsufficientLiquidity extends Error { logs; static code = 6012; code = 6012; name = "PairInsufficientLiquidity"; msg = "Pair insufficient liquidity"; constructor(logs) { super("6012: Pair insufficient liquidity"); this.logs = logs; } } exports.PairInsufficientLiquidity = PairInsufficientLiquidity; class InvalidFeeOwner extends Error { logs; static code = 6013; code = 6013; name = "InvalidFeeOwner"; msg = "Invalid fee owner"; constructor(logs) { super("6013: Invalid fee owner"); this.logs = logs; } } exports.InvalidFeeOwner = InvalidFeeOwner; class InvalidFeeWithdrawAmount extends Error { logs; static code = 6014; code = 6014; name = "InvalidFeeWithdrawAmount"; msg = "Invalid fee withdraw amount"; constructor(logs) { super("6014: Invalid fee withdraw amount"); this.logs = logs; } } exports.InvalidFeeWithdrawAmount = InvalidFeeWithdrawAmount; class InvalidAdmin extends Error { logs; static code = 6015; code = 6015; name = "InvalidAdmin"; msg = "Invalid admin"; constructor(logs) { super("6015: Invalid admin"); this.logs = logs; } } exports.InvalidAdmin = InvalidAdmin; class IdenticalFeeOwner extends Error { logs; static code = 6016; code = 6016; name = "IdenticalFeeOwner"; msg = "Identical fee owner"; constructor(logs) { super("6016: Identical fee owner"); this.logs = logs; } } exports.IdenticalFeeOwner = IdenticalFeeOwner; class InvalidBps extends Error { logs; static code = 6017; code = 6017; name = "InvalidBps"; msg = "Invalid basis point"; constructor(logs) { super("6017: Invalid basis point"); this.logs = logs; } } exports.InvalidBps = InvalidBps; class MathOverflow extends Error { logs; static code = 6018; code = 6018; name = "MathOverflow"; msg = "Math operation overflow"; constructor(logs) { super("6018: Math operation overflow"); this.logs = logs; } } exports.MathOverflow = MathOverflow; class TypeCastFailed extends Error { logs; static code = 6019; code = 6019; name = "TypeCastFailed"; msg = "Type cast error"; constructor(logs) { super("6019: Type cast error"); this.logs = logs; } } exports.TypeCastFailed = TypeCastFailed; class InvalidRewardIndex extends Error { logs; static code = 6020; code = 6020; name = "InvalidRewardIndex"; msg = "Invalid reward index"; constructor(logs) { super("6020: Invalid reward index"); this.logs = logs; } } exports.InvalidRewardIndex = InvalidRewardIndex; class InvalidRewardDuration extends Error { logs; static code = 6021; code = 6021; name = "InvalidRewardDuration"; msg = "Invalid reward duration"; constructor(logs) { super("6021: Invalid reward duration"); this.logs = logs; } } exports.InvalidRewardDuration = InvalidRewardDuration; class RewardInitialized extends Error { logs; static code = 6022; code = 6022; name = "RewardInitialized"; msg = "Reward already initialized"; constructor(logs) { super("6022: Reward already initialized"); this.logs = logs; } } exports.RewardInitialized = RewardInitialized; class RewardUninitialized extends Error { logs; static code = 6023; code = 6023; name = "RewardUninitialized"; msg = "Reward not initialized"; constructor(logs) { super("6023: Reward not initialized"); this.logs = logs; } } exports.RewardUninitialized = RewardUninitialized; class IdenticalFunder extends Error { logs; static code = 6024; code = 6024; name = "IdenticalFunder"; msg = "Identical funder"; constructor(logs) { super("6024: Identical funder"); this.logs = logs; } } exports.IdenticalFunder = IdenticalFunder; class RewardCampaignInProgress extends Error { logs; static code = 6025; code = 6025; name = "RewardCampaignInProgress"; msg = "Reward campaign in progress"; constructor(logs) { super("6025: Reward campaign in progress"); this.logs = logs; } } exports.RewardCampaignInProgress = RewardCampaignInProgress; class IdenticalRewardDuration extends Error { logs; static code = 6026; code = 6026; name = "IdenticalRewardDuration"; msg = "Reward duration is the same"; constructor(logs) { super("6026: Reward duration is the same"); this.logs = logs; } } exports.IdenticalRewardDuration = IdenticalRewardDuration; class InvalidBinArray extends Error { logs; static code = 6027; code = 6027; name = "InvalidBinArray"; msg = "Invalid bin array"; constructor(logs) { super("6027: Invalid bin array"); this.logs = logs; } } exports.InvalidBinArray = InvalidBinArray; class NonContinuousBinArrays extends Error { logs; static code = 6028; code = 6028; name = "NonContinuousBinArrays"; msg = "Bin arrays must be continuous"; constructor(logs) { super("6028: Bin arrays must be continuous"); this.logs = logs; } } exports.NonContinuousBinArrays = NonContinuousBinArrays; class InvalidRewardVault extends Error { logs; static code = 6029; code = 6029; name = "InvalidRewardVault"; msg = "Invalid reward vault"; constructor(logs) { super("6029: Invalid reward vault"); this.logs = logs; } } exports.InvalidRewardVault = InvalidRewardVault; class NonEmptyPosition extends Error { logs; static code = 6030; code = 6030; name = "NonEmptyPosition"; msg = "Position is not empty"; constructor(logs) { super("6030: Position is not empty"); this.logs = logs; } } exports.NonEmptyPosition = NonEmptyPosition; class UnauthorizedAccess extends Error { logs; static code = 6031; code = 6031; name = "UnauthorizedAccess"; msg = "Unauthorized access"; constructor(logs) { super("6031: Unauthorized access"); this.logs = logs; } } exports.UnauthorizedAccess = UnauthorizedAccess; class InvalidFeeParameter extends Error { logs; static code = 6032; code = 6032; name = "InvalidFeeParameter"; msg = "Invalid fee parameter"; constructor(logs) { super("6032: Invalid fee parameter"); this.logs = logs; } } exports.InvalidFeeParameter = InvalidFeeParameter; class MissingOracle extends Error { logs; static code = 6033; code = 6033; name = "MissingOracle"; msg = "Missing oracle account"; constructor(logs) { super("6033: Missing oracle account"); this.logs = logs; } } exports.MissingOracle = MissingOracle; class InsufficientSample extends Error { logs; static code = 6034; code = 6034; name = "InsufficientSample"; msg = "Insufficient observation sample"; constructor(logs) { super("6034: Insufficient observation sample"); this.logs = logs; } } exports.InsufficientSample = InsufficientSample; class InvalidLookupTimestamp extends Error { logs; static code = 6035; code = 6035; name = "InvalidLookupTimestamp"; msg = "Invalid lookup timestamp"; constructor(logs) { super("6035: Invalid lookup timestamp"); this.logs = logs; } } exports.InvalidLookupTimestamp = InvalidLookupTimestamp; class BitmapExtensionAccountIsNotProvided extends Error { logs; static code = 6036; code = 6036; name = "BitmapExtensionAccountIsNotProvided"; msg = "Bitmap extension account is not provided"; constructor(logs) { super("6036: Bitmap extension account is not provided"); this.logs = logs; } } exports.BitmapExtensionAccountIsNotProvided = BitmapExtensionAccountIsNotProvided; class CannotFindNonZeroLiquidityBinArrayId extends Error { logs; static code = 6037; code = 6037; name = "CannotFindNonZeroLiquidityBinArrayId"; msg = "Cannot find non-zero liquidity binArrayId"; constructor(logs) { super("6037: Cannot find non-zero liquidity binArrayId"); this.logs = logs; } } exports.CannotFindNonZeroLiquidityBinArrayId = CannotFindNonZeroLiquidityBinArrayId; class BinIdOutOfBound extends Error { logs; static code = 6038; code = 6038; name = "BinIdOutOfBound"; msg = "Bin id out of bound"; constructor(logs) { super("6038: Bin id out of bound"); this.logs = logs; } } exports.BinIdOutOfBound = BinIdOutOfBound; class InsufficientOutAmount extends Error { logs; static code = 6039; code = 6039; name = "InsufficientOutAmount"; msg = "Insufficient amount in for minimum out"; constructor(logs) { super("6039: Insufficient amount in for minimum out"); this.logs = logs; } } exports.InsufficientOutAmount = InsufficientOutAmount; class InvalidPositionWidth extends Error { logs; static code = 6040; code = 6040; name = "InvalidPositionWidth"; msg = "Invalid position width"; constructor(logs) { super("6040: Invalid position width"); this.logs = logs; } } exports.InvalidPositionWidth = InvalidPositionWidth; class ExcessiveFeeUpdate extends Error { logs; static code = 6041; code = 6041; name = "ExcessiveFeeUpdate"; msg = "Excessive fee update"; constructor(logs) { super("6041: Excessive fee update"); this.logs = logs; } } exports.ExcessiveFeeUpdate = ExcessiveFeeUpdate; class PoolDisabled extends Error { logs; static code = 6042; code = 6042; name = "PoolDisabled"; msg = "Pool disabled"; constructor(logs) { super("6042: Pool disabled"); this.logs = logs; } } exports.PoolDisabled = PoolDisabled; class InvalidPoolType extends Error { logs; static code = 6043; code = 6043; name = "InvalidPoolType"; msg = "Invalid pool type"; constructor(logs) { super("6043: Invalid pool type"); this.logs = logs; } } exports.InvalidPoolType = InvalidPoolType; class ExceedMaxWhitelist extends Error { logs; static code = 6044; code = 6044; name = "ExceedMaxWhitelist"; msg = "Whitelist for wallet is full"; constructor(logs) { super("6044: Whitelist for wallet is full"); this.logs = logs; } } exports.ExceedMaxWhitelist = ExceedMaxWhitelist; class InvalidIndex extends Error { logs; static code = 6045; code = 6045; name = "InvalidIndex"; msg = "Invalid index"; constructor(logs) { super("6045: Invalid index"); this.logs = logs; } } exports.InvalidIndex = InvalidIndex; class RewardNotEnded extends Error { logs; static code = 6046; code = 6046; name = "RewardNotEnded"; msg = "Reward not ended"; constructor(logs) { super("6046: Reward not ended"); this.logs = logs; } } exports.RewardNotEnded = RewardNotEnded; class MustWithdrawnIneligibleReward extends Error { logs; static code = 6047; code = 6047; name = "MustWithdrawnIneligibleReward"; msg = "Must withdraw ineligible reward"; constructor(logs) { super("6047: Must withdraw ineligible reward"); this.logs = logs; } } exports.MustWithdrawnIneligibleReward = MustWithdrawnIneligibleReward; class UnauthorizedAddress extends Error { logs; static code = 6048; code = 6048; name = "UnauthorizedAddress"; msg = "Unauthorized address"; constructor(logs) { super("6048: Unauthorized address"); this.logs = logs; } } exports.UnauthorizedAddress = UnauthorizedAddress; class OperatorsAreTheSame extends Error { logs; static code = 6049; code = 6049; name = "OperatorsAreTheSame"; msg = "Cannot update because operators are the same"; constructor(logs) { super("6049: Cannot update because operators are the same"); this.logs = logs; } } exports.OperatorsAreTheSame = OperatorsAreTheSame; class WithdrawToWrongTokenAccount extends Error { logs; static code = 6050; code = 6050; name = "WithdrawToWrongTokenAccount"; msg = "Withdraw to wrong token account"; constructor(logs) { super("6050: Withdraw to wrong token account"); this.logs = logs; } } exports.WithdrawToWrongTokenAccount = WithdrawToWrongTokenAccount; class WrongRentReceiver extends Error { logs; static code = 6051; code = 6051; name = "WrongRentReceiver"; msg = "Wrong rent receiver"; constructor(logs) { super("6051: Wrong rent receiver"); this.logs = logs; } } exports.WrongRentReceiver = WrongRentReceiver; class AlreadyPassActivationSlot extends Error { logs; static code = 6052; code = 6052; name = "AlreadyPassActivationSlot"; msg = "Already activated"; constructor(logs) { super("6052: Already activated"); this.logs = logs; } } exports.AlreadyPassActivationSlot = AlreadyPassActivationSlot; class LastSlotCannotBeSmallerThanActivateSlot extends Error { logs; static code = 6053; code = 6053; name = "LastSlotCannotBeSmallerThanActivateSlot"; msg = "Last slot cannot be smaller than activate slot"; constructor(logs) { super("6053: Last slot cannot be smaller than activate slot"); this.logs = logs; } } exports.LastSlotCannotBeSmallerThanActivateSlot = LastSlotCannotBeSmallerThanActivateSlot; class ExceedMaxSwappedAmount extends Error { logs; static code = 6054; code = 6054; name = "ExceedMaxSwappedAmount"; msg = "Swapped amount is exceeded max swapped amount"; constructor(logs) { super("6054: Swapped amount is exceeded max swapped amount"); this.logs = logs; } } exports.ExceedMaxSwappedAmount = ExceedMaxSwappedAmount; class InvalidStrategyParameters extends Error { logs; static code = 6055; code = 6055; name = "InvalidStrategyParameters"; msg = "Invalid strategy parameters"; constructor(logs) { super("6055: Invalid strategy parameters"); this.logs = logs; } } exports.InvalidStrategyParameters = InvalidStrategyParameters; class LiquidityLocked extends Error { logs; static code = 6056; code = 6056; name = "LiquidityLocked"; msg = "Liquidity locked"; constructor(logs) { super("6056: Liquidity locked"); this.logs = logs; } } exports.LiquidityLocked = LiquidityLocked; class InvalidLockReleaseSlot extends Error { logs; static code = 6057; code = 6057; name = "InvalidLockReleaseSlot"; msg = "Invalid lock release slot"; constructor(logs) { super("6057: Invalid lock release slot"); this.logs = logs; } } exports.InvalidLockReleaseSlot = InvalidLockReleaseSlot; class BinRangeIsNotEmpty extends Error { logs; static code = 6058; code = 6058; name = "BinRangeIsNotEmpty"; msg = "Bin range is not empty"; constructor(logs) { super("6058: Bin range is not empty"); this.logs = logs; } } exports.BinRangeIsNotEmpty = BinRangeIsNotEmpty; function fromCode(code, logs) { switch (code) { case 6000: return new InvalidStartBinIndex(logs); case 6001: return new InvalidBinId(logs); case 6002: return new InvalidInput(logs); case 6003: return new ExceededAmountSlippageTolerance(logs); case 6004: return new ExceededBinSlippageTolerance(logs); case 6005: return new CompositionFactorFlawed(logs); case 6006: return new NonPresetBinStep(logs); case 6007: return new ZeroLiquidity(logs); case 6008: return new InvalidPosition(logs); case 6009: return new BinArrayNotFound(logs); case 6010: return new InvalidTokenMint(logs); case 6011: return new InvalidAccountForSingleDeposit(logs); case 6012: return new PairInsufficientLiquidity(logs); case 6013: return new InvalidFeeOwner(logs); case 6014: return new InvalidFeeWithdrawAmount(logs); case 6015: return new InvalidAdmin(logs); case 6016: return new IdenticalFeeOwner(logs); case 6017: return new InvalidBps(logs); case 6018: return new MathOverflow(logs); case 6019: return new TypeCastFailed(logs); case 6020: return new InvalidRewardIndex(logs); case 6021: return new InvalidRewardDuration(logs); case 6022: return new RewardInitialized(logs); case 6023: return new RewardUninitialized(logs); case 6024: return new IdenticalFunder(logs); case 6025: return new RewardCampaignInProgress(logs); case 6026: return new IdenticalRewardDuration(logs); case 6027: return new InvalidBinArray(logs); case 6028: return new NonContinuousBinArrays(logs); case 6029: return new InvalidRewardVault(logs); case 6030: return new NonEmptyPosition(logs); case 6031: return new UnauthorizedAccess(logs); case 6032: return new InvalidFeeParameter(logs); case 6033: return new MissingOracle(logs); case 6034: return new InsufficientSample(logs); case 6035: return new InvalidLookupTimestamp(logs); case 6036: return new BitmapExtensionAccountIsNotProvided(logs); case 6037: return new CannotFindNonZeroLiquidityBinArrayId(logs); case 6038: return new BinIdOutOfBound(logs); case 6039: return new InsufficientOutAmount(logs); case 6040: return new InvalidPositionWidth(logs); case 6041: return new ExcessiveFeeUpdate(logs); case 6042: return new PoolDisabled(logs); case 6043: return new InvalidPoolType(logs); case 6044: return new ExceedMaxWhitelist(logs); case 6045: return new InvalidIndex(logs); case 6046: return new RewardNotEnded(logs); case 6047: return new MustWithdrawnIneligibleReward(logs); case 6048: return new UnauthorizedAddress(logs); case 6049: return new OperatorsAreTheSame(logs); case 6050: return new WithdrawToWrongTokenAccount(logs); case 6051: return new WrongRentReceiver(logs); case 6052: return new AlreadyPassActivationSlot(logs); case 6053: return new LastSlotCannotBeSmallerThanActivateSlot(logs); case 6054: return new ExceedMaxSwappedAmount(logs); case 6055: return new InvalidStrategyParameters(logs); case 6056: return new LiquidityLocked(logs); case 6057: return new InvalidLockReleaseSlot(logs); case 6058: return new BinRangeIsNotEmpty(logs); } return null; } //# sourceMappingURL=custom.js.map