@kamino-finance/kliquidity-sdk 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +462 -0
- package/dist/Kamino.d.ts +962 -0
- package/dist/Kamino.js +5116 -0
- package/dist/Kamino.js.map +1 -0
- package/dist/constants/DefaultStrategyConfig.d.ts +6 -0
- package/dist/constants/DefaultStrategyConfig.js +13 -0
- package/dist/constants/DefaultStrategyConfig.js.map +1 -0
- package/dist/constants/deposit_method.d.ts +2 -0
- package/dist/constants/deposit_method.js +6 -0
- package/dist/constants/deposit_method.js.map +1 -0
- package/dist/constants/frontend.d.ts +1 -0
- package/dist/constants/frontend.js +5 -0
- package/dist/constants/frontend.js.map +1 -0
- package/dist/constants/index.d.ts +3 -0
- package/dist/constants/index.js +20 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/metadata.d.ts +3 -0
- package/dist/constants/metadata.js +7 -0
- package/dist/constants/metadata.js.map +1 -0
- package/dist/constants/numericalValues.d.ts +1 -0
- package/dist/constants/numericalValues.js +5 -0
- package/dist/constants/numericalValues.js.map +1 -0
- package/dist/constants/pubkeys.d.ts +10 -0
- package/dist/constants/pubkeys.js +14 -0
- package/dist/constants/pubkeys.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/kamino-client/accounts/CollateralInfos.d.ts +19 -0
- package/dist/kamino-client/accounts/CollateralInfos.js +96 -0
- package/dist/kamino-client/accounts/CollateralInfos.js.map +1 -0
- package/dist/kamino-client/accounts/GlobalConfig.d.ts +88 -0
- package/dist/kamino-client/accounts/GlobalConfig.js +218 -0
- package/dist/kamino-client/accounts/GlobalConfig.js.map +1 -0
- package/dist/kamino-client/accounts/PersonalPositionState.d.ts +83 -0
- package/dist/kamino-client/accounts/PersonalPositionState.js +156 -0
- package/dist/kamino-client/accounts/PersonalPositionState.js.map +1 -0
- package/dist/kamino-client/accounts/PoolState.d.ts +212 -0
- package/dist/kamino-client/accounts/PoolState.js +281 -0
- package/dist/kamino-client/accounts/PoolState.js.map +1 -0
- package/dist/kamino-client/accounts/Position.d.ts +47 -0
- package/dist/kamino-client/accounts/Position.js +146 -0
- package/dist/kamino-client/accounts/Position.js.map +1 -0
- package/dist/kamino-client/accounts/ProtocolPositionState.d.ts +79 -0
- package/dist/kamino-client/accounts/ProtocolPositionState.js +150 -0
- package/dist/kamino-client/accounts/ProtocolPositionState.js.map +1 -0
- package/dist/kamino-client/accounts/ScopeChainAccount.d.ts +18 -0
- package/dist/kamino-client/accounts/ScopeChainAccount.js +95 -0
- package/dist/kamino-client/accounts/ScopeChainAccount.js.map +1 -0
- package/dist/kamino-client/accounts/TermsSignature.d.ts +18 -0
- package/dist/kamino-client/accounts/TermsSignature.js +95 -0
- package/dist/kamino-client/accounts/TermsSignature.js.map +1 -0
- package/dist/kamino-client/accounts/Whirlpool.d.ts +75 -0
- package/dist/kamino-client/accounts/Whirlpool.js +192 -0
- package/dist/kamino-client/accounts/Whirlpool.js.map +1 -0
- package/dist/kamino-client/accounts/WhirlpoolStrategy.d.ts +317 -0
- package/dist/kamino-client/accounts/WhirlpoolStrategy.js +596 -0
- package/dist/kamino-client/accounts/WhirlpoolStrategy.js.map +1 -0
- package/dist/kamino-client/accounts/index.d.ts +20 -0
- package/dist/kamino-client/accounts/index.js +24 -0
- package/dist/kamino-client/accounts/index.js.map +1 -0
- package/dist/kamino-client/errors/anchor.d.ts +434 -0
- package/dist/kamino-client/errors/anchor.js +713 -0
- package/dist/kamino-client/errors/anchor.js.map +1 -0
- package/dist/kamino-client/errors/custom.d.ts +1258 -0
- package/dist/kamino-client/errors/custom.js +2054 -0
- package/dist/kamino-client/errors/custom.js.map +1 -0
- package/dist/kamino-client/errors/index.d.ts +5 -0
- package/dist/kamino-client/errors/index.js +70 -0
- package/dist/kamino-client/errors/index.js.map +1 -0
- package/dist/kamino-client/idl.json +7186 -0
- package/dist/kamino-client/instructions/addKaminoRewards.d.ts +17 -0
- package/dist/kamino-client/instructions/addKaminoRewards.js +55 -0
- package/dist/kamino-client/instructions/addKaminoRewards.js.map +1 -0
- package/dist/kamino-client/instructions/changePool.d.ts +12 -0
- package/dist/kamino-client/instructions/changePool.js +34 -0
- package/dist/kamino-client/instructions/changePool.js.map +1 -0
- package/dist/kamino-client/instructions/checkExpectedVaultsBalances.d.ts +13 -0
- package/dist/kamino-client/instructions/checkExpectedVaultsBalances.js +51 -0
- package/dist/kamino-client/instructions/checkExpectedVaultsBalances.js.map +1 -0
- package/dist/kamino-client/instructions/closeProgramAccount.d.ts +9 -0
- package/dist/kamino-client/instructions/closeProgramAccount.js +19 -0
- package/dist/kamino-client/instructions/closeProgramAccount.js.map +1 -0
- package/dist/kamino-client/instructions/closeStrategy.d.ts +49 -0
- package/dist/kamino-client/instructions/closeStrategy.js +79 -0
- package/dist/kamino-client/instructions/closeStrategy.js.map +1 -0
- package/dist/kamino-client/instructions/collectFeesAndRewards.d.ts +43 -0
- package/dist/kamino-client/instructions/collectFeesAndRewards.js +71 -0
- package/dist/kamino-client/instructions/collectFeesAndRewards.js.map +1 -0
- package/dist/kamino-client/instructions/deposit.d.ts +33 -0
- package/dist/kamino-client/instructions/deposit.js +79 -0
- package/dist/kamino-client/instructions/deposit.js.map +1 -0
- package/dist/kamino-client/instructions/depositAndInvest.d.ts +42 -0
- package/dist/kamino-client/instructions/depositAndInvest.js +95 -0
- package/dist/kamino-client/instructions/depositAndInvest.js.map +1 -0
- package/dist/kamino-client/instructions/emergencySwap.d.ts +35 -0
- package/dist/kamino-client/instructions/emergencySwap.js +70 -0
- package/dist/kamino-client/instructions/emergencySwap.js.map +1 -0
- package/dist/kamino-client/instructions/executiveWithdraw.d.ts +33 -0
- package/dist/kamino-client/instructions/executiveWithdraw.js +77 -0
- package/dist/kamino-client/instructions/executiveWithdraw.js.map +1 -0
- package/dist/kamino-client/instructions/flashSwapUnevenVaultsEnd.d.ts +40 -0
- package/dist/kamino-client/instructions/flashSwapUnevenVaultsEnd.js +83 -0
- package/dist/kamino-client/instructions/flashSwapUnevenVaultsEnd.js.map +1 -0
- package/dist/kamino-client/instructions/flashSwapUnevenVaultsStart.d.ts +41 -0
- package/dist/kamino-client/instructions/flashSwapUnevenVaultsStart.js +80 -0
- package/dist/kamino-client/instructions/flashSwapUnevenVaultsStart.js.map +1 -0
- package/dist/kamino-client/instructions/index.d.ts +72 -0
- package/dist/kamino-client/instructions/index.js +76 -0
- package/dist/kamino-client/instructions/index.js.map +1 -0
- package/dist/kamino-client/instructions/initializeCollateralInfo.d.ts +8 -0
- package/dist/kamino-client/instructions/initializeCollateralInfo.js +18 -0
- package/dist/kamino-client/instructions/initializeCollateralInfo.js.map +1 -0
- package/dist/kamino-client/instructions/initializeGlobalConfig.d.ts +7 -0
- package/dist/kamino-client/instructions/initializeGlobalConfig.js +17 -0
- package/dist/kamino-client/instructions/initializeGlobalConfig.js.map +1 -0
- package/dist/kamino-client/instructions/initializeKaminoReward.d.ts +20 -0
- package/dist/kamino-client/instructions/initializeKaminoReward.js +58 -0
- package/dist/kamino-client/instructions/initializeKaminoReward.js.map +1 -0
- package/dist/kamino-client/instructions/initializeSharesMetadata.d.ts +19 -0
- package/dist/kamino-client/instructions/initializeSharesMetadata.js +63 -0
- package/dist/kamino-client/instructions/initializeSharesMetadata.js.map +1 -0
- package/dist/kamino-client/instructions/initializeStrategy.d.ts +29 -0
- package/dist/kamino-client/instructions/initializeStrategy.js +67 -0
- package/dist/kamino-client/instructions/initializeStrategy.js.map +1 -0
- package/dist/kamino-client/instructions/insertCollateralInfo.d.ts +14 -0
- package/dist/kamino-client/instructions/insertCollateralInfo.js +52 -0
- package/dist/kamino-client/instructions/insertCollateralInfo.js.map +1 -0
- package/dist/kamino-client/instructions/invest.d.ts +30 -0
- package/dist/kamino-client/instructions/invest.js +52 -0
- package/dist/kamino-client/instructions/invest.js.map +1 -0
- package/dist/kamino-client/instructions/openLiquidityPosition.d.ts +46 -0
- package/dist/kamino-client/instructions/openLiquidityPosition.js +117 -0
- package/dist/kamino-client/instructions/openLiquidityPosition.js.map +1 -0
- package/dist/kamino-client/instructions/orcaSwap.d.ts +30 -0
- package/dist/kamino-client/instructions/orcaSwap.js +71 -0
- package/dist/kamino-client/instructions/orcaSwap.js.map +1 -0
- package/dist/kamino-client/instructions/permisionlessWithdrawFromTreasury.d.ts +11 -0
- package/dist/kamino-client/instructions/permisionlessWithdrawFromTreasury.js +25 -0
- package/dist/kamino-client/instructions/permisionlessWithdrawFromTreasury.js.map +1 -0
- package/dist/kamino-client/instructions/signTerms.d.ts +12 -0
- package/dist/kamino-client/instructions/signTerms.js +48 -0
- package/dist/kamino-client/instructions/signTerms.js.map +1 -0
- package/dist/kamino-client/instructions/singleTokenDepositAndInvestWithMin.d.ts +42 -0
- package/dist/kamino-client/instructions/singleTokenDepositAndInvestWithMin.js +95 -0
- package/dist/kamino-client/instructions/singleTokenDepositAndInvestWithMin.js.map +1 -0
- package/dist/kamino-client/instructions/singleTokenDepositWithMin.d.ts +33 -0
- package/dist/kamino-client/instructions/singleTokenDepositWithMin.js +79 -0
- package/dist/kamino-client/instructions/singleTokenDepositWithMin.js.map +1 -0
- package/dist/kamino-client/instructions/swapRewards.d.ts +37 -0
- package/dist/kamino-client/instructions/swapRewards.js +98 -0
- package/dist/kamino-client/instructions/swapRewards.js.map +1 -0
- package/dist/kamino-client/instructions/swapUnevenVaults.d.ts +42 -0
- package/dist/kamino-client/instructions/swapUnevenVaults.js +82 -0
- package/dist/kamino-client/instructions/swapUnevenVaults.js.map +1 -0
- package/dist/kamino-client/instructions/updateCollateralInfo.d.ts +14 -0
- package/dist/kamino-client/instructions/updateCollateralInfo.js +53 -0
- package/dist/kamino-client/instructions/updateCollateralInfo.js.map +1 -0
- package/dist/kamino-client/instructions/updateGlobalConfig.d.ts +13 -0
- package/dist/kamino-client/instructions/updateGlobalConfig.js +53 -0
- package/dist/kamino-client/instructions/updateGlobalConfig.js.map +1 -0
- package/dist/kamino-client/instructions/updateRewardMapping.d.ts +20 -0
- package/dist/kamino-client/instructions/updateRewardMapping.js +59 -0
- package/dist/kamino-client/instructions/updateRewardMapping.js.map +1 -0
- package/dist/kamino-client/instructions/updateSharesMetadata.d.ts +17 -0
- package/dist/kamino-client/instructions/updateSharesMetadata.js +61 -0
- package/dist/kamino-client/instructions/updateSharesMetadata.js.map +1 -0
- package/dist/kamino-client/instructions/updateStrategyConfig.d.ts +14 -0
- package/dist/kamino-client/instructions/updateStrategyConfig.js +53 -0
- package/dist/kamino-client/instructions/updateStrategyConfig.js.map +1 -0
- package/dist/kamino-client/instructions/updateTreasuryFeeVault.d.ts +17 -0
- package/dist/kamino-client/instructions/updateTreasuryFeeVault.js +57 -0
- package/dist/kamino-client/instructions/updateTreasuryFeeVault.js.map +1 -0
- package/dist/kamino-client/instructions/withdraw.d.ts +38 -0
- package/dist/kamino-client/instructions/withdraw.js +89 -0
- package/dist/kamino-client/instructions/withdraw.js.map +1 -0
- package/dist/kamino-client/instructions/withdrawFromTopup.d.ts +12 -0
- package/dist/kamino-client/instructions/withdrawFromTopup.js +47 -0
- package/dist/kamino-client/instructions/withdrawFromTopup.js.map +1 -0
- package/dist/kamino-client/instructions/withdrawFromTreasury.d.ts +18 -0
- package/dist/kamino-client/instructions/withdrawFromTreasury.js +57 -0
- package/dist/kamino-client/instructions/withdrawFromTreasury.js.map +1 -0
- package/dist/kamino-client/programId.d.ts +4 -0
- package/dist/kamino-client/programId.js +13 -0
- package/dist/kamino-client/programId.js.map +1 -0
- package/dist/kamino-client/types/BalanceStatus.d.ts +31 -0
- package/dist/kamino-client/types/BalanceStatus.js +102 -0
- package/dist/kamino-client/types/BalanceStatus.js.map +1 -0
- package/dist/kamino-client/types/BinAddLiquidityStrategy.d.ts +76 -0
- package/dist/kamino-client/types/BinAddLiquidityStrategy.js +162 -0
- package/dist/kamino-client/types/BinAddLiquidityStrategy.js.map +1 -0
- package/dist/kamino-client/types/CollateralInfo.d.ts +93 -0
- package/dist/kamino-client/types/CollateralInfo.js +152 -0
- package/dist/kamino-client/types/CollateralInfo.js.map +1 -0
- package/dist/kamino-client/types/CollateralInfoParams.d.ts +83 -0
- package/dist/kamino-client/types/CollateralInfoParams.js +140 -0
- package/dist/kamino-client/types/CollateralInfoParams.js.map +1 -0
- package/dist/kamino-client/types/CollateralTestToken.d.ts +369 -0
- package/dist/kamino-client/types/CollateralTestToken.js +778 -0
- package/dist/kamino-client/types/CollateralTestToken.js.map +1 -0
- package/dist/kamino-client/types/CreationStatus.d.ts +70 -0
- package/dist/kamino-client/types/CreationStatus.js +180 -0
- package/dist/kamino-client/types/CreationStatus.js.map +1 -0
- package/dist/kamino-client/types/DEX.d.ts +44 -0
- package/dist/kamino-client/types/DEX.js +128 -0
- package/dist/kamino-client/types/DEX.js.map +1 -0
- package/dist/kamino-client/types/DexSpecificPrice.d.ts +46 -0
- package/dist/kamino-client/types/DexSpecificPrice.js +116 -0
- package/dist/kamino-client/types/DexSpecificPrice.js.map +1 -0
- package/dist/kamino-client/types/DriftDirection.d.ts +31 -0
- package/dist/kamino-client/types/DriftDirection.js +102 -0
- package/dist/kamino-client/types/DriftDirection.js.map +1 -0
- package/dist/kamino-client/types/ExecutiveWithdrawAction.d.ts +44 -0
- package/dist/kamino-client/types/ExecutiveWithdrawAction.js +128 -0
- package/dist/kamino-client/types/ExecutiveWithdrawAction.js.map +1 -0
- package/dist/kamino-client/types/ExpanderStep.d.ts +38 -0
- package/dist/kamino-client/types/ExpanderStep.js +107 -0
- package/dist/kamino-client/types/ExpanderStep.js.map +1 -0
- package/dist/kamino-client/types/GlobalConfigOption.d.ts +304 -0
- package/dist/kamino-client/types/GlobalConfigOption.js +648 -0
- package/dist/kamino-client/types/GlobalConfigOption.js.map +1 -0
- package/dist/kamino-client/types/KaminoRewardInfo.d.ts +63 -0
- package/dist/kamino-client/types/KaminoRewardInfo.js +116 -0
- package/dist/kamino-client/types/KaminoRewardInfo.js.map +1 -0
- package/dist/kamino-client/types/LiquidityCalculationMode.d.ts +31 -0
- package/dist/kamino-client/types/LiquidityCalculationMode.js +102 -0
- package/dist/kamino-client/types/LiquidityCalculationMode.js.map +1 -0
- package/dist/kamino-client/types/MintingMethod.d.ts +31 -0
- package/dist/kamino-client/types/MintingMethod.js +102 -0
- package/dist/kamino-client/types/MintingMethod.js.map +1 -0
- package/dist/kamino-client/types/PeriodicRebalanceState.d.ts +22 -0
- package/dist/kamino-client/types/PeriodicRebalanceState.js +65 -0
- package/dist/kamino-client/types/PeriodicRebalanceState.js.map +1 -0
- package/dist/kamino-client/types/PositionRewardInfo.d.ts +27 -0
- package/dist/kamino-client/types/PositionRewardInfo.js +70 -0
- package/dist/kamino-client/types/PositionRewardInfo.js.map +1 -0
- package/dist/kamino-client/types/Price.d.ts +27 -0
- package/dist/kamino-client/types/Price.js +70 -0
- package/dist/kamino-client/types/Price.js.map +1 -0
- package/dist/kamino-client/types/RebalanceAction.d.ts +83 -0
- package/dist/kamino-client/types/RebalanceAction.js +150 -0
- package/dist/kamino-client/types/RebalanceAction.js.map +1 -0
- package/dist/kamino-client/types/RebalanceAutodriftParams.d.ts +75 -0
- package/dist/kamino-client/types/RebalanceAutodriftParams.js +100 -0
- package/dist/kamino-client/types/RebalanceAutodriftParams.js.map +1 -0
- package/dist/kamino-client/types/RebalanceAutodriftState.d.ts +88 -0
- package/dist/kamino-client/types/RebalanceAutodriftState.js +76 -0
- package/dist/kamino-client/types/RebalanceAutodriftState.js.map +1 -0
- package/dist/kamino-client/types/RebalanceAutodriftStep.d.ts +31 -0
- package/dist/kamino-client/types/RebalanceAutodriftStep.js +102 -0
- package/dist/kamino-client/types/RebalanceAutodriftStep.js.map +1 -0
- package/dist/kamino-client/types/RebalanceAutodriftWindow.d.ts +54 -0
- package/dist/kamino-client/types/RebalanceAutodriftWindow.js +98 -0
- package/dist/kamino-client/types/RebalanceAutodriftWindow.js.map +1 -0
- package/dist/kamino-client/types/RebalanceDriftParams.d.ts +50 -0
- package/dist/kamino-client/types/RebalanceDriftParams.js +92 -0
- package/dist/kamino-client/types/RebalanceDriftParams.js.map +1 -0
- package/dist/kamino-client/types/RebalanceDriftState.d.ts +40 -0
- package/dist/kamino-client/types/RebalanceDriftState.js +80 -0
- package/dist/kamino-client/types/RebalanceDriftState.js.map +1 -0
- package/dist/kamino-client/types/RebalanceDriftStep.d.ts +31 -0
- package/dist/kamino-client/types/RebalanceDriftStep.js +102 -0
- package/dist/kamino-client/types/RebalanceDriftStep.js.map +1 -0
- package/dist/kamino-client/types/RebalanceEffects.d.ts +39 -0
- package/dist/kamino-client/types/RebalanceEffects.js +108 -0
- package/dist/kamino-client/types/RebalanceEffects.js.map +1 -0
- package/dist/kamino-client/types/RebalanceExpanderState.d.ts +27 -0
- package/dist/kamino-client/types/RebalanceExpanderState.js +70 -0
- package/dist/kamino-client/types/RebalanceExpanderState.js.map +1 -0
- package/dist/kamino-client/types/RebalanceManualState.d.ts +14 -0
- package/dist/kamino-client/types/RebalanceManualState.js +51 -0
- package/dist/kamino-client/types/RebalanceManualState.js.map +1 -0
- package/dist/kamino-client/types/RebalancePricePercentageState.d.ts +27 -0
- package/dist/kamino-client/types/RebalancePricePercentageState.js +73 -0
- package/dist/kamino-client/types/RebalancePricePercentageState.js.map +1 -0
- package/dist/kamino-client/types/RebalancePricePercentageWithResetState.d.ts +27 -0
- package/dist/kamino-client/types/RebalancePricePercentageWithResetState.js +75 -0
- package/dist/kamino-client/types/RebalancePricePercentageWithResetState.js.map +1 -0
- package/dist/kamino-client/types/RebalanceRaw.d.ts +31 -0
- package/dist/kamino-client/types/RebalanceRaw.js +75 -0
- package/dist/kamino-client/types/RebalanceRaw.js.map +1 -0
- package/dist/kamino-client/types/RebalanceTakeProfitState.d.ts +33 -0
- package/dist/kamino-client/types/RebalanceTakeProfitState.js +62 -0
- package/dist/kamino-client/types/RebalanceTakeProfitState.js.map +1 -0
- package/dist/kamino-client/types/RebalanceTakeProfitStep.d.ts +44 -0
- package/dist/kamino-client/types/RebalanceTakeProfitStep.js +128 -0
- package/dist/kamino-client/types/RebalanceTakeProfitStep.js.map +1 -0
- package/dist/kamino-client/types/RebalanceTakeProfitToken.d.ts +31 -0
- package/dist/kamino-client/types/RebalanceTakeProfitToken.js +99 -0
- package/dist/kamino-client/types/RebalanceTakeProfitToken.js.map +1 -0
- package/dist/kamino-client/types/RebalanceType.d.ts +109 -0
- package/dist/kamino-client/types/RebalanceType.js +258 -0
- package/dist/kamino-client/types/RebalanceType.js.map +1 -0
- package/dist/kamino-client/types/ReferencePriceType.d.ts +31 -0
- package/dist/kamino-client/types/ReferencePriceType.js +102 -0
- package/dist/kamino-client/types/ReferencePriceType.js.map +1 -0
- package/dist/kamino-client/types/RemoveLiquidityMode.d.ts +59 -0
- package/dist/kamino-client/types/RemoveLiquidityMode.js +142 -0
- package/dist/kamino-client/types/RemoveLiquidityMode.js.map +1 -0
- package/dist/kamino-client/types/RewardInfo.d.ts +115 -0
- package/dist/kamino-client/types/RewardInfo.js +128 -0
- package/dist/kamino-client/types/RewardInfo.js.map +1 -0
- package/dist/kamino-client/types/ScopeConversionChain.d.ts +0 -0
- package/dist/kamino-client/types/ScopeConversionChain.js +2 -0
- package/dist/kamino-client/types/ScopeConversionChain.js.map +1 -0
- package/dist/kamino-client/types/ScopePriceIdTest.d.ts +915 -0
- package/dist/kamino-client/types/ScopePriceIdTest.js +1871 -0
- package/dist/kamino-client/types/ScopePriceIdTest.js.map +1 -0
- package/dist/kamino-client/types/SimulationPrice.d.ts +59 -0
- package/dist/kamino-client/types/SimulationPrice.js +142 -0
- package/dist/kamino-client/types/SimulationPrice.js.map +1 -0
- package/dist/kamino-client/types/StakingRateSource.d.ts +31 -0
- package/dist/kamino-client/types/StakingRateSource.js +102 -0
- package/dist/kamino-client/types/StakingRateSource.js.map +1 -0
- package/dist/kamino-client/types/StrategyConfigOption.d.ts +668 -0
- package/dist/kamino-client/types/StrategyConfigOption.js +1377 -0
- package/dist/kamino-client/types/StrategyConfigOption.js.map +1 -0
- package/dist/kamino-client/types/StrategyStatus.d.ts +70 -0
- package/dist/kamino-client/types/StrategyStatus.js +180 -0
- package/dist/kamino-client/types/StrategyStatus.js.map +1 -0
- package/dist/kamino-client/types/StrategyType.d.ts +44 -0
- package/dist/kamino-client/types/StrategyType.js +128 -0
- package/dist/kamino-client/types/StrategyType.js.map +1 -0
- package/dist/kamino-client/types/SwapLimit.d.ts +66 -0
- package/dist/kamino-client/types/SwapLimit.js +138 -0
- package/dist/kamino-client/types/SwapLimit.js.map +1 -0
- package/dist/kamino-client/types/UpdateCollateralInfoMode.d.ts +174 -0
- package/dist/kamino-client/types/UpdateCollateralInfoMode.js +388 -0
- package/dist/kamino-client/types/UpdateCollateralInfoMode.js.map +1 -0
- package/dist/kamino-client/types/WhirlpoolRewardInfo.d.ts +67 -0
- package/dist/kamino-client/types/WhirlpoolRewardInfo.js +92 -0
- package/dist/kamino-client/types/WhirlpoolRewardInfo.js.map +1 -0
- package/dist/kamino-client/types/WithdrawalCapAccumulatorAction.d.ts +31 -0
- package/dist/kamino-client/types/WithdrawalCapAccumulatorAction.js +102 -0
- package/dist/kamino-client/types/WithdrawalCapAccumulatorAction.js.map +1 -0
- package/dist/kamino-client/types/WithdrawalCaps.d.ts +37 -0
- package/dist/kamino-client/types/WithdrawalCaps.js +85 -0
- package/dist/kamino-client/types/WithdrawalCaps.js.map +1 -0
- package/dist/kamino-client/types/index.d.ts +160 -0
- package/dist/kamino-client/types/index.js +127 -0
- package/dist/kamino-client/types/index.js.map +1 -0
- package/dist/meteora_client/accounts/BinArray.d.ts +41 -0
- package/dist/meteora_client/accounts/BinArray.js +127 -0
- package/dist/meteora_client/accounts/BinArray.js.map +1 -0
- package/dist/meteora_client/accounts/BinArrayBitmapExtension.d.ts +31 -0
- package/dist/meteora_client/accounts/BinArrayBitmapExtension.js +110 -0
- package/dist/meteora_client/accounts/BinArrayBitmapExtension.js.map +1 -0
- package/dist/meteora_client/accounts/LbPair.d.ts +179 -0
- package/dist/meteora_client/accounts/LbPair.js +246 -0
- package/dist/meteora_client/accounts/LbPair.js.map +1 -0
- package/dist/meteora_client/accounts/Oracle.d.ts +34 -0
- package/dist/meteora_client/accounts/Oracle.js +109 -0
- package/dist/meteora_client/accounts/Oracle.js.map +1 -0
- package/dist/meteora_client/accounts/Position.d.ts +89 -0
- package/dist/meteora_client/accounts/Position.js +156 -0
- package/dist/meteora_client/accounts/Position.js.map +1 -0
- package/dist/meteora_client/accounts/PositionV2.d.ts +113 -0
- package/dist/meteora_client/accounts/PositionV2.js +177 -0
- package/dist/meteora_client/accounts/PositionV2.js.map +1 -0
- package/dist/meteora_client/accounts/PresetParameter.d.ts +75 -0
- package/dist/meteora_client/accounts/PresetParameter.js +140 -0
- package/dist/meteora_client/accounts/PresetParameter.js.map +1 -0
- package/dist/meteora_client/accounts/index.d.ts +14 -0
- package/dist/meteora_client/accounts/index.js +18 -0
- package/dist/meteora_client/accounts/index.js.map +1 -0
- package/dist/meteora_client/errors/anchor.d.ts +434 -0
- package/dist/meteora_client/errors/anchor.js +713 -0
- package/dist/meteora_client/errors/anchor.js.map +1 -0
- package/dist/meteora_client/errors/custom.d.ts +474 -0
- package/dist/meteora_client/errors/custom.js +778 -0
- package/dist/meteora_client/errors/custom.js.map +1 -0
- package/dist/meteora_client/errors/index.d.ts +5 -0
- package/dist/meteora_client/errors/index.js +70 -0
- package/dist/meteora_client/errors/index.js.map +1 -0
- package/dist/meteora_client/instructions/addLiquidity.d.ts +25 -0
- package/dist/meteora_client/instructions/addLiquidity.js +67 -0
- package/dist/meteora_client/instructions/addLiquidity.js.map +1 -0
- package/dist/meteora_client/instructions/addLiquidityByStrategy.d.ts +25 -0
- package/dist/meteora_client/instructions/addLiquidityByStrategy.js +67 -0
- package/dist/meteora_client/instructions/addLiquidityByStrategy.js.map +1 -0
- package/dist/meteora_client/instructions/addLiquidityByStrategyOneSide.d.ts +21 -0
- package/dist/meteora_client/instructions/addLiquidityByStrategyOneSide.js +63 -0
- package/dist/meteora_client/instructions/addLiquidityByStrategyOneSide.js.map +1 -0
- package/dist/meteora_client/instructions/addLiquidityByWeight.d.ts +25 -0
- package/dist/meteora_client/instructions/addLiquidityByWeight.js +67 -0
- package/dist/meteora_client/instructions/addLiquidityByWeight.js.map +1 -0
- package/dist/meteora_client/instructions/addLiquidityOneSide.d.ts +21 -0
- package/dist/meteora_client/instructions/addLiquidityOneSide.js +63 -0
- package/dist/meteora_client/instructions/addLiquidityOneSide.js.map +1 -0
- package/dist/meteora_client/instructions/addLiquidityOneSidePrecise.d.ts +21 -0
- package/dist/meteora_client/instructions/addLiquidityOneSidePrecise.js +63 -0
- package/dist/meteora_client/instructions/addLiquidityOneSidePrecise.js.map +1 -0
- package/dist/meteora_client/instructions/claimFee.d.ts +18 -0
- package/dist/meteora_client/instructions/claimFee.js +28 -0
- package/dist/meteora_client/instructions/claimFee.js.map +1 -0
- package/dist/meteora_client/instructions/claimReward.d.ts +20 -0
- package/dist/meteora_client/instructions/claimReward.js +55 -0
- package/dist/meteora_client/instructions/claimReward.js.map +1 -0
- package/dist/meteora_client/instructions/closePosition.d.ts +12 -0
- package/dist/meteora_client/instructions/closePosition.js +22 -0
- package/dist/meteora_client/instructions/closePosition.js.map +1 -0
- package/dist/meteora_client/instructions/closePresetParameter.d.ts +7 -0
- package/dist/meteora_client/instructions/closePresetParameter.js +17 -0
- package/dist/meteora_client/instructions/closePresetParameter.js.map +1 -0
- package/dist/meteora_client/instructions/fundReward.d.ts +20 -0
- package/dist/meteora_client/instructions/fundReward.js +59 -0
- package/dist/meteora_client/instructions/fundReward.js.map +1 -0
- package/dist/meteora_client/instructions/goToABin.d.ts +14 -0
- package/dist/meteora_client/instructions/goToABin.js +54 -0
- package/dist/meteora_client/instructions/goToABin.js.map +1 -0
- package/dist/meteora_client/instructions/increaseOracleLength.d.ts +14 -0
- package/dist/meteora_client/instructions/increaseOracleLength.js +49 -0
- package/dist/meteora_client/instructions/increaseOracleLength.js.map +1 -0
- package/dist/meteora_client/instructions/index.d.ts +84 -0
- package/dist/meteora_client/instructions/index.js +88 -0
- package/dist/meteora_client/instructions/index.js.map +1 -0
- package/dist/meteora_client/instructions/initializeBinArray.d.ts +13 -0
- package/dist/meteora_client/instructions/initializeBinArray.js +48 -0
- package/dist/meteora_client/instructions/initializeBinArray.js.map +1 -0
- package/dist/meteora_client/instructions/initializeBinArrayBitmapExtension.d.ts +10 -0
- package/dist/meteora_client/instructions/initializeBinArrayBitmapExtension.js +23 -0
- package/dist/meteora_client/instructions/initializeBinArrayBitmapExtension.js.map +1 -0
- package/dist/meteora_client/instructions/initializeLbPair.d.ts +23 -0
- package/dist/meteora_client/instructions/initializeLbPair.js +66 -0
- package/dist/meteora_client/instructions/initializeLbPair.js.map +1 -0
- package/dist/meteora_client/instructions/initializePermissionLbPair.d.ts +23 -0
- package/dist/meteora_client/instructions/initializePermissionLbPair.js +65 -0
- package/dist/meteora_client/instructions/initializePermissionLbPair.js.map +1 -0
- package/dist/meteora_client/instructions/initializePosition.d.ts +17 -0
- package/dist/meteora_client/instructions/initializePosition.js +56 -0
- package/dist/meteora_client/instructions/initializePosition.js.map +1 -0
- package/dist/meteora_client/instructions/initializePositionByOperator.d.ts +21 -0
- package/dist/meteora_client/instructions/initializePositionByOperator.js +61 -0
- package/dist/meteora_client/instructions/initializePositionByOperator.js.map +1 -0
- package/dist/meteora_client/instructions/initializePositionPda.d.ts +19 -0
- package/dist/meteora_client/instructions/initializePositionPda.js +57 -0
- package/dist/meteora_client/instructions/initializePositionPda.js.map +1 -0
- package/dist/meteora_client/instructions/initializePresetParameter.d.ts +13 -0
- package/dist/meteora_client/instructions/initializePresetParameter.js +49 -0
- package/dist/meteora_client/instructions/initializePresetParameter.js.map +1 -0
- package/dist/meteora_client/instructions/initializeReward.d.ts +20 -0
- package/dist/meteora_client/instructions/initializeReward.js +59 -0
- package/dist/meteora_client/instructions/initializeReward.js.map +1 -0
- package/dist/meteora_client/instructions/migrateBinArray.d.ts +5 -0
- package/dist/meteora_client/instructions/migrateBinArray.js +15 -0
- package/dist/meteora_client/instructions/migrateBinArray.js.map +1 -0
- package/dist/meteora_client/instructions/migratePosition.d.ts +14 -0
- package/dist/meteora_client/instructions/migratePosition.js +24 -0
- package/dist/meteora_client/instructions/migratePosition.js.map +1 -0
- package/dist/meteora_client/instructions/removeAllLiquidity.d.ts +20 -0
- package/dist/meteora_client/instructions/removeAllLiquidity.js +34 -0
- package/dist/meteora_client/instructions/removeAllLiquidity.js.map +1 -0
- package/dist/meteora_client/instructions/removeLiquidity.d.ts +25 -0
- package/dist/meteora_client/instructions/removeLiquidity.js +67 -0
- package/dist/meteora_client/instructions/removeLiquidity.js.map +1 -0
- package/dist/meteora_client/instructions/removeLiquidityByRange.d.ts +26 -0
- package/dist/meteora_client/instructions/removeLiquidityByRange.js +70 -0
- package/dist/meteora_client/instructions/removeLiquidityByRange.js.map +1 -0
- package/dist/meteora_client/instructions/setActivationSlot.d.ts +11 -0
- package/dist/meteora_client/instructions/setActivationSlot.js +46 -0
- package/dist/meteora_client/instructions/setActivationSlot.js.map +1 -0
- package/dist/meteora_client/instructions/setLockReleaseSlot.d.ts +14 -0
- package/dist/meteora_client/instructions/setLockReleaseSlot.js +49 -0
- package/dist/meteora_client/instructions/setLockReleaseSlot.js.map +1 -0
- package/dist/meteora_client/instructions/setPreActivationSlotDuration.d.ts +10 -0
- package/dist/meteora_client/instructions/setPreActivationSlotDuration.js +46 -0
- package/dist/meteora_client/instructions/setPreActivationSlotDuration.js.map +1 -0
- package/dist/meteora_client/instructions/setPreActivationSwapAddress.d.ts +10 -0
- package/dist/meteora_client/instructions/setPreActivationSwapAddress.js +48 -0
- package/dist/meteora_client/instructions/setPreActivationSwapAddress.js.map +1 -0
- package/dist/meteora_client/instructions/swap.d.ts +25 -0
- package/dist/meteora_client/instructions/swap.js +67 -0
- package/dist/meteora_client/instructions/swap.js.map +1 -0
- package/dist/meteora_client/instructions/togglePairStatus.d.ts +6 -0
- package/dist/meteora_client/instructions/togglePairStatus.js +16 -0
- package/dist/meteora_client/instructions/togglePairStatus.js.map +1 -0
- package/dist/meteora_client/instructions/updateFeeOwner.d.ts +7 -0
- package/dist/meteora_client/instructions/updateFeeOwner.js +17 -0
- package/dist/meteora_client/instructions/updateFeeOwner.js.map +1 -0
- package/dist/meteora_client/instructions/updateFeeParameters.d.ts +13 -0
- package/dist/meteora_client/instructions/updateFeeParameters.js +49 -0
- package/dist/meteora_client/instructions/updateFeeParameters.js.map +1 -0
- package/dist/meteora_client/instructions/updateFeesAndRewards.d.ts +9 -0
- package/dist/meteora_client/instructions/updateFeesAndRewards.js +19 -0
- package/dist/meteora_client/instructions/updateFeesAndRewards.js.map +1 -0
- package/dist/meteora_client/instructions/updatePositionOperator.d.ts +12 -0
- package/dist/meteora_client/instructions/updatePositionOperator.js +48 -0
- package/dist/meteora_client/instructions/updatePositionOperator.js.map +1 -0
- package/dist/meteora_client/instructions/updateRewardDuration.d.ts +15 -0
- package/dist/meteora_client/instructions/updateRewardDuration.js +53 -0
- package/dist/meteora_client/instructions/updateRewardDuration.js.map +1 -0
- package/dist/meteora_client/instructions/updateRewardFunder.d.ts +14 -0
- package/dist/meteora_client/instructions/updateRewardFunder.js +52 -0
- package/dist/meteora_client/instructions/updateRewardFunder.js.map +1 -0
- package/dist/meteora_client/instructions/updateWhitelistedWallet.d.ts +10 -0
- package/dist/meteora_client/instructions/updateWhitelistedWallet.js +46 -0
- package/dist/meteora_client/instructions/updateWhitelistedWallet.js.map +1 -0
- package/dist/meteora_client/instructions/withdrawIneligibleReward.d.ts +18 -0
- package/dist/meteora_client/instructions/withdrawIneligibleReward.js +53 -0
- package/dist/meteora_client/instructions/withdrawIneligibleReward.js.map +1 -0
- package/dist/meteora_client/instructions/withdrawProtocolFee.d.ts +19 -0
- package/dist/meteora_client/instructions/withdrawProtocolFee.js +54 -0
- package/dist/meteora_client/instructions/withdrawProtocolFee.js.map +1 -0
- package/dist/meteora_client/programId.d.ts +5 -0
- package/dist/meteora_client/programId.js +15 -0
- package/dist/meteora_client/programId.js.map +1 -0
- package/dist/meteora_client/types/AddLiquiditySingleSidePreciseParameter.d.ts +33 -0
- package/dist/meteora_client/types/AddLiquiditySingleSidePreciseParameter.js +74 -0
- package/dist/meteora_client/types/AddLiquiditySingleSidePreciseParameter.js.map +1 -0
- package/dist/meteora_client/types/Bin.d.ts +89 -0
- package/dist/meteora_client/types/Bin.js +115 -0
- package/dist/meteora_client/types/Bin.js.map +1 -0
- package/dist/meteora_client/types/BinLiquidityDistribution.d.ts +40 -0
- package/dist/meteora_client/types/BinLiquidityDistribution.js +75 -0
- package/dist/meteora_client/types/BinLiquidityDistribution.js.map +1 -0
- package/dist/meteora_client/types/BinLiquidityDistributionByWeight.d.ts +32 -0
- package/dist/meteora_client/types/BinLiquidityDistributionByWeight.js +66 -0
- package/dist/meteora_client/types/BinLiquidityDistributionByWeight.js.map +1 -0
- package/dist/meteora_client/types/BinLiquidityReduction.d.ts +26 -0
- package/dist/meteora_client/types/BinLiquidityReduction.js +66 -0
- package/dist/meteora_client/types/BinLiquidityReduction.js.map +1 -0
- package/dist/meteora_client/types/CompressedBinDepositAmount.d.ts +26 -0
- package/dist/meteora_client/types/CompressedBinDepositAmount.js +66 -0
- package/dist/meteora_client/types/CompressedBinDepositAmount.js.map +1 -0
- package/dist/meteora_client/types/FeeInfo.d.ts +37 -0
- package/dist/meteora_client/types/FeeInfo.js +85 -0
- package/dist/meteora_client/types/FeeInfo.js.map +1 -0
- package/dist/meteora_client/types/FeeParameter.d.ts +32 -0
- package/dist/meteora_client/types/FeeParameter.js +66 -0
- package/dist/meteora_client/types/FeeParameter.js.map +1 -0
- package/dist/meteora_client/types/InitPermissionPairIx.d.ts +47 -0
- package/dist/meteora_client/types/InitPermissionPairIx.js +97 -0
- package/dist/meteora_client/types/InitPermissionPairIx.js.map +1 -0
- package/dist/meteora_client/types/InitPresetParametersIx.d.ts +96 -0
- package/dist/meteora_client/types/InitPresetParametersIx.js +117 -0
- package/dist/meteora_client/types/InitPresetParametersIx.js.map +1 -0
- package/dist/meteora_client/types/LayoutVersion.d.ts +31 -0
- package/dist/meteora_client/types/LayoutVersion.js +99 -0
- package/dist/meteora_client/types/LayoutVersion.js.map +1 -0
- package/dist/meteora_client/types/LiquidityOneSideParameter.d.ts +55 -0
- package/dist/meteora_client/types/LiquidityOneSideParameter.js +86 -0
- package/dist/meteora_client/types/LiquidityOneSideParameter.js.map +1 -0
- package/dist/meteora_client/types/LiquidityParameter.d.ts +49 -0
- package/dist/meteora_client/types/LiquidityParameter.js +80 -0
- package/dist/meteora_client/types/LiquidityParameter.js.map +1 -0
- package/dist/meteora_client/types/LiquidityParameterByStrategy.d.ts +103 -0
- package/dist/meteora_client/types/LiquidityParameterByStrategy.js +92 -0
- package/dist/meteora_client/types/LiquidityParameterByStrategy.js.map +1 -0
- package/dist/meteora_client/types/LiquidityParameterByStrategyOneSide.d.ts +95 -0
- package/dist/meteora_client/types/LiquidityParameterByStrategyOneSide.js +86 -0
- package/dist/meteora_client/types/LiquidityParameterByStrategyOneSide.js.map +1 -0
- package/dist/meteora_client/types/LiquidityParameterByWeight.d.ts +63 -0
- package/dist/meteora_client/types/LiquidityParameterByWeight.js +92 -0
- package/dist/meteora_client/types/LiquidityParameterByWeight.js.map +1 -0
- package/dist/meteora_client/types/Observation.d.ts +41 -0
- package/dist/meteora_client/types/Observation.js +79 -0
- package/dist/meteora_client/types/Observation.js.map +1 -0
- package/dist/meteora_client/types/PairStatus.d.ts +31 -0
- package/dist/meteora_client/types/PairStatus.js +102 -0
- package/dist/meteora_client/types/PairStatus.js.map +1 -0
- package/dist/meteora_client/types/PairType.d.ts +31 -0
- package/dist/meteora_client/types/PairType.js +102 -0
- package/dist/meteora_client/types/PairType.js.map +1 -0
- package/dist/meteora_client/types/ProtocolFee.d.ts +27 -0
- package/dist/meteora_client/types/ProtocolFee.js +70 -0
- package/dist/meteora_client/types/ProtocolFee.js.map +1 -0
- package/dist/meteora_client/types/RewardInfo.d.ts +83 -0
- package/dist/meteora_client/types/RewardInfo.js +112 -0
- package/dist/meteora_client/types/RewardInfo.js.map +1 -0
- package/dist/meteora_client/types/Rounding.d.ts +31 -0
- package/dist/meteora_client/types/Rounding.js +99 -0
- package/dist/meteora_client/types/Rounding.js.map +1 -0
- package/dist/meteora_client/types/StaticParameters.d.ts +97 -0
- package/dist/meteora_client/types/StaticParameters.js +118 -0
- package/dist/meteora_client/types/StaticParameters.js.map +1 -0
- package/dist/meteora_client/types/StrategyParameters.d.ts +84 -0
- package/dist/meteora_client/types/StrategyParameters.js +82 -0
- package/dist/meteora_client/types/StrategyParameters.js.map +1 -0
- package/dist/meteora_client/types/StrategyType.d.ts +122 -0
- package/dist/meteora_client/types/StrategyType.js +284 -0
- package/dist/meteora_client/types/StrategyType.js.map +1 -0
- package/dist/meteora_client/types/UserRewardInfo.d.ts +27 -0
- package/dist/meteora_client/types/UserRewardInfo.js +73 -0
- package/dist/meteora_client/types/UserRewardInfo.js.map +1 -0
- package/dist/meteora_client/types/VariableParameters.d.ts +75 -0
- package/dist/meteora_client/types/VariableParameters.js +98 -0
- package/dist/meteora_client/types/VariableParameters.js.map +1 -0
- package/dist/meteora_client/types/index.d.ts +67 -0
- package/dist/meteora_client/types/index.js +81 -0
- package/dist/meteora_client/types/index.js.map +1 -0
- package/dist/models/EnrichedScopePrice.d.ts +28 -0
- package/dist/models/EnrichedScopePrice.js +3 -0
- package/dist/models/EnrichedScopePrice.js.map +1 -0
- package/dist/models/Holdings.d.ts +13 -0
- package/dist/models/Holdings.js +3 -0
- package/dist/models/Holdings.js.map +1 -0
- package/dist/models/KaminoPosition.d.ts +10 -0
- package/dist/models/KaminoPosition.js +3 -0
- package/dist/models/KaminoPosition.js.map +1 -0
- package/dist/models/KaminoStrategyWithShareMint.d.ts +8 -0
- package/dist/models/KaminoStrategyWithShareMint.js +3 -0
- package/dist/models/KaminoStrategyWithShareMint.js.map +1 -0
- package/dist/models/KaminoToken.d.ts +5 -0
- package/dist/models/KaminoToken.js +3 -0
- package/dist/models/KaminoToken.js.map +1 -0
- package/dist/models/LbPairWithAddress.d.ts +7 -0
- package/dist/models/LbPairWithAddress.js +3 -0
- package/dist/models/LbPairWithAddress.js.map +1 -0
- package/dist/models/MultipleAccountsResponse.d.ts +42 -0
- package/dist/models/MultipleAccountsResponse.js +3 -0
- package/dist/models/MultipleAccountsResponse.js.map +1 -0
- package/dist/models/PoolSimulationResponseData.d.ts +27 -0
- package/dist/models/PoolSimulationResponseData.js +3 -0
- package/dist/models/PoolSimulationResponseData.js.map +1 -0
- package/dist/models/PriceData.d.ts +15 -0
- package/dist/models/PriceData.js +3 -0
- package/dist/models/PriceData.js.map +1 -0
- package/dist/models/RaydiumPoolWithAddress.d.ts +7 -0
- package/dist/models/RaydiumPoolWithAddress.js +3 -0
- package/dist/models/RaydiumPoolWithAddress.js.map +1 -0
- package/dist/models/ShareData.d.ts +15 -0
- package/dist/models/ShareData.js +25 -0
- package/dist/models/ShareData.js.map +1 -0
- package/dist/models/StrategyBalances.d.ts +14 -0
- package/dist/models/StrategyBalances.js +3 -0
- package/dist/models/StrategyBalances.js.map +1 -0
- package/dist/models/StrategyHolder.d.ts +6 -0
- package/dist/models/StrategyHolder.js +3 -0
- package/dist/models/StrategyHolder.js.map +1 -0
- package/dist/models/StrategyPrices.d.ts +10 -0
- package/dist/models/StrategyPrices.js +3 -0
- package/dist/models/StrategyPrices.js.map +1 -0
- package/dist/models/StrategyProgramAddress.d.ts +13 -0
- package/dist/models/StrategyProgramAddress.js +3 -0
- package/dist/models/StrategyProgramAddress.js.map +1 -0
- package/dist/models/StrategyVaultBalances.d.ts +5 -0
- package/dist/models/StrategyVaultBalances.js +3 -0
- package/dist/models/StrategyVaultBalances.js.map +1 -0
- package/dist/models/StrategyVaultTokens.d.ts +12 -0
- package/dist/models/StrategyVaultTokens.js +3 -0
- package/dist/models/StrategyVaultTokens.js.map +1 -0
- package/dist/models/StrategyWithAddress.d.ts +7 -0
- package/dist/models/StrategyWithAddress.js +3 -0
- package/dist/models/StrategyWithAddress.js.map +1 -0
- package/dist/models/StrategyWithPendingFees.d.ts +6 -0
- package/dist/models/StrategyWithPendingFees.js +3 -0
- package/dist/models/StrategyWithPendingFees.js.map +1 -0
- package/dist/models/TokenAmounts.d.ts +5 -0
- package/dist/models/TokenAmounts.js +3 -0
- package/dist/models/TokenAmounts.js.map +1 -0
- package/dist/models/TreasuryFeeVault.d.ts +7 -0
- package/dist/models/TreasuryFeeVault.js +3 -0
- package/dist/models/TreasuryFeeVault.js.map +1 -0
- package/dist/models/WhirlpoolWithAddress.d.ts +7 -0
- package/dist/models/WhirlpoolWithAddress.js +3 -0
- package/dist/models/WhirlpoolWithAddress.js.map +1 -0
- package/dist/models/index.d.ts +19 -0
- package/dist/models/index.js +36 -0
- package/dist/models/index.js.map +1 -0
- package/dist/raydium_client/accounts/AmmConfig.d.ts +46 -0
- package/dist/raydium_client/accounts/AmmConfig.js +145 -0
- package/dist/raydium_client/accounts/AmmConfig.js.map +1 -0
- package/dist/raydium_client/accounts/ObservationState.d.ts +29 -0
- package/dist/raydium_client/accounts/ObservationState.js +116 -0
- package/dist/raydium_client/accounts/ObservationState.js.map +1 -0
- package/dist/raydium_client/accounts/OperationState.d.ts +24 -0
- package/dist/raydium_client/accounts/OperationState.js +106 -0
- package/dist/raydium_client/accounts/OperationState.js.map +1 -0
- package/dist/raydium_client/accounts/PersonalPositionState.d.ts +53 -0
- package/dist/raydium_client/accounts/PersonalPositionState.js +156 -0
- package/dist/raydium_client/accounts/PersonalPositionState.js.map +1 -0
- package/dist/raydium_client/accounts/PoolState.d.ts +128 -0
- package/dist/raydium_client/accounts/PoolState.js +281 -0
- package/dist/raydium_client/accounts/PoolState.js.map +1 -0
- package/dist/raydium_client/accounts/ProtocolPositionState.d.ts +49 -0
- package/dist/raydium_client/accounts/ProtocolPositionState.js +150 -0
- package/dist/raydium_client/accounts/ProtocolPositionState.js.map +1 -0
- package/dist/raydium_client/accounts/TickArrayBitmapExtension.d.ts +25 -0
- package/dist/raydium_client/accounts/TickArrayBitmapExtension.js +110 -0
- package/dist/raydium_client/accounts/TickArrayBitmapExtension.js.map +1 -0
- package/dist/raydium_client/accounts/TickArrayState.d.ts +31 -0
- package/dist/raydium_client/accounts/TickArrayState.js +117 -0
- package/dist/raydium_client/accounts/TickArrayState.js.map +1 -0
- package/dist/raydium_client/accounts/index.d.ts +16 -0
- package/dist/raydium_client/accounts/index.js +20 -0
- package/dist/raydium_client/accounts/index.js.map +1 -0
- package/dist/raydium_client/errors/anchor.d.ts +434 -0
- package/dist/raydium_client/errors/anchor.js +713 -0
- package/dist/raydium_client/errors/anchor.js.map +1 -0
- package/dist/raydium_client/errors/custom.d.ts +338 -0
- package/dist/raydium_client/errors/custom.js +556 -0
- package/dist/raydium_client/errors/custom.js.map +1 -0
- package/dist/raydium_client/errors/index.d.ts +5 -0
- package/dist/raydium_client/errors/index.js +70 -0
- package/dist/raydium_client/errors/index.js.map +1 -0
- package/dist/raydium_client/index.d.ts +4 -0
- package/dist/raydium_client/index.js +21 -0
- package/dist/raydium_client/index.js.map +1 -0
- package/dist/raydium_client/instructions/closePosition.d.ts +10 -0
- package/dist/raydium_client/instructions/closePosition.js +20 -0
- package/dist/raydium_client/instructions/closePosition.js.map +1 -0
- package/dist/raydium_client/instructions/collectFundFee.d.ts +21 -0
- package/dist/raydium_client/instructions/collectFundFee.js +67 -0
- package/dist/raydium_client/instructions/collectFundFee.js.map +1 -0
- package/dist/raydium_client/instructions/collectProtocolFee.d.ts +21 -0
- package/dist/raydium_client/instructions/collectProtocolFee.js +67 -0
- package/dist/raydium_client/instructions/collectProtocolFee.js.map +1 -0
- package/dist/raydium_client/instructions/collectRemainingRewards.d.ts +16 -0
- package/dist/raydium_client/instructions/collectRemainingRewards.js +52 -0
- package/dist/raydium_client/instructions/collectRemainingRewards.js.map +1 -0
- package/dist/raydium_client/instructions/createAmmConfig.d.ts +15 -0
- package/dist/raydium_client/instructions/createAmmConfig.js +57 -0
- package/dist/raydium_client/instructions/createAmmConfig.js.map +1 -0
- package/dist/raydium_client/instructions/createOperationAccount.d.ts +7 -0
- package/dist/raydium_client/instructions/createOperationAccount.js +17 -0
- package/dist/raydium_client/instructions/createOperationAccount.js.map +1 -0
- package/dist/raydium_client/instructions/createPool.d.ts +23 -0
- package/dist/raydium_client/instructions/createPool.js +61 -0
- package/dist/raydium_client/instructions/createPool.js.map +1 -0
- package/dist/raydium_client/instructions/decreaseLiquidity.d.ts +23 -0
- package/dist/raydium_client/instructions/decreaseLiquidity.js +70 -0
- package/dist/raydium_client/instructions/decreaseLiquidity.js.map +1 -0
- package/dist/raydium_client/instructions/decreaseLiquidityV2.d.ts +27 -0
- package/dist/raydium_client/instructions/decreaseLiquidityV2.js +74 -0
- package/dist/raydium_client/instructions/decreaseLiquidityV2.js.map +1 -0
- package/dist/raydium_client/instructions/increaseLiquidity.d.ts +23 -0
- package/dist/raydium_client/instructions/increaseLiquidity.js +62 -0
- package/dist/raydium_client/instructions/increaseLiquidity.js.map +1 -0
- package/dist/raydium_client/instructions/increaseLiquidityV2.d.ts +27 -0
- package/dist/raydium_client/instructions/increaseLiquidityV2.js +67 -0
- package/dist/raydium_client/instructions/increaseLiquidityV2.js.map +1 -0
- package/dist/raydium_client/instructions/index.d.ts +46 -0
- package/dist/raydium_client/instructions/index.js +50 -0
- package/dist/raydium_client/instructions/index.js.map +1 -0
- package/dist/raydium_client/instructions/initializeReward.d.ts +19 -0
- package/dist/raydium_client/instructions/initializeReward.js +57 -0
- package/dist/raydium_client/instructions/initializeReward.js.map +1 -0
- package/dist/raydium_client/instructions/openPosition.d.ts +34 -0
- package/dist/raydium_client/instructions/openPosition.js +81 -0
- package/dist/raydium_client/instructions/openPosition.js.map +1 -0
- package/dist/raydium_client/instructions/openPositionV2.d.ts +39 -0
- package/dist/raydium_client/instructions/openPositionV2.js +88 -0
- package/dist/raydium_client/instructions/openPositionV2.js.map +1 -0
- package/dist/raydium_client/instructions/setRewardParams.d.ts +18 -0
- package/dist/raydium_client/instructions/setRewardParams.js +58 -0
- package/dist/raydium_client/instructions/setRewardParams.js.map +1 -0
- package/dist/raydium_client/instructions/swap.d.ts +22 -0
- package/dist/raydium_client/instructions/swap.js +62 -0
- package/dist/raydium_client/instructions/swap.js.map +1 -0
- package/dist/raydium_client/instructions/swapRouterBaseIn.d.ts +16 -0
- package/dist/raydium_client/instructions/swapRouterBaseIn.js +54 -0
- package/dist/raydium_client/instructions/swapRouterBaseIn.js.map +1 -0
- package/dist/raydium_client/instructions/swapV2.d.ts +25 -0
- package/dist/raydium_client/instructions/swapV2.js +65 -0
- package/dist/raydium_client/instructions/swapV2.js.map +1 -0
- package/dist/raydium_client/instructions/transferRewardOwner.d.ts +10 -0
- package/dist/raydium_client/instructions/transferRewardOwner.js +46 -0
- package/dist/raydium_client/instructions/transferRewardOwner.js.map +1 -0
- package/dist/raydium_client/instructions/updateAmmConfig.d.ts +11 -0
- package/dist/raydium_client/instructions/updateAmmConfig.js +47 -0
- package/dist/raydium_client/instructions/updateAmmConfig.js.map +1 -0
- package/dist/raydium_client/instructions/updateOperationAccount.d.ts +12 -0
- package/dist/raydium_client/instructions/updateOperationAccount.js +51 -0
- package/dist/raydium_client/instructions/updateOperationAccount.js.map +1 -0
- package/dist/raydium_client/instructions/updatePoolStatus.d.ts +10 -0
- package/dist/raydium_client/instructions/updatePoolStatus.js +46 -0
- package/dist/raydium_client/instructions/updatePoolStatus.js.map +1 -0
- package/dist/raydium_client/instructions/updateRewardInfos.d.ts +5 -0
- package/dist/raydium_client/instructions/updateRewardInfos.js +15 -0
- package/dist/raydium_client/instructions/updateRewardInfos.js.map +1 -0
- package/dist/raydium_client/programId.d.ts +5 -0
- package/dist/raydium_client/programId.js +15 -0
- package/dist/raydium_client/programId.js.map +1 -0
- package/dist/raydium_client/types/InitializeRewardParam.d.ts +32 -0
- package/dist/raydium_client/types/InitializeRewardParam.js +79 -0
- package/dist/raydium_client/types/InitializeRewardParam.js.map +1 -0
- package/dist/raydium_client/types/Observation.d.ts +37 -0
- package/dist/raydium_client/types/Observation.js +85 -0
- package/dist/raydium_client/types/Observation.js.map +1 -0
- package/dist/raydium_client/types/PoolStatusBitFlag.d.ts +31 -0
- package/dist/raydium_client/types/PoolStatusBitFlag.js +102 -0
- package/dist/raydium_client/types/PoolStatusBitFlag.js.map +1 -0
- package/dist/raydium_client/types/PoolStatusBitIndex.d.ts +70 -0
- package/dist/raydium_client/types/PoolStatusBitIndex.js +180 -0
- package/dist/raydium_client/types/PoolStatusBitIndex.js.map +1 -0
- package/dist/raydium_client/types/PositionRewardInfo.d.ts +27 -0
- package/dist/raydium_client/types/PositionRewardInfo.js +70 -0
- package/dist/raydium_client/types/PositionRewardInfo.js.map +1 -0
- package/dist/raydium_client/types/RewardInfo.d.ts +73 -0
- package/dist/raydium_client/types/RewardInfo.js +128 -0
- package/dist/raydium_client/types/RewardInfo.js.map +1 -0
- package/dist/raydium_client/types/RewardState.d.ts +57 -0
- package/dist/raydium_client/types/RewardState.js +154 -0
- package/dist/raydium_client/types/RewardState.js.map +1 -0
- package/dist/raydium_client/types/TickArryBitmap.d.ts +0 -0
- package/dist/raydium_client/types/TickArryBitmap.js +2 -0
- package/dist/raydium_client/types/TickArryBitmap.js.map +1 -0
- package/dist/raydium_client/types/TickState.d.ts +52 -0
- package/dist/raydium_client/types/TickState.js +103 -0
- package/dist/raydium_client/types/TickState.js.map +1 -0
- package/dist/raydium_client/types/index.d.ts +22 -0
- package/dist/raydium_client/types/index.js +43 -0
- package/dist/raydium_client/types/index.js.map +1 -0
- package/dist/rebalance_methods/autodriftRebalance.d.ts +20 -0
- package/dist/rebalance_methods/autodriftRebalance.js +220 -0
- package/dist/rebalance_methods/autodriftRebalance.js.map +1 -0
- package/dist/rebalance_methods/consts.d.ts +1 -0
- package/dist/rebalance_methods/consts.js +5 -0
- package/dist/rebalance_methods/consts.js.map +1 -0
- package/dist/rebalance_methods/driftRebalance.d.ts +17 -0
- package/dist/rebalance_methods/driftRebalance.js +180 -0
- package/dist/rebalance_methods/driftRebalance.js.map +1 -0
- package/dist/rebalance_methods/expanderRebalance.d.ts +18 -0
- package/dist/rebalance_methods/expanderRebalance.js +283 -0
- package/dist/rebalance_methods/expanderRebalance.js.map +1 -0
- package/dist/rebalance_methods/index.d.ts +7 -0
- package/dist/rebalance_methods/index.js +24 -0
- package/dist/rebalance_methods/index.js.map +1 -0
- package/dist/rebalance_methods/manualRebalance.d.ts +5 -0
- package/dist/rebalance_methods/manualRebalance.js +35 -0
- package/dist/rebalance_methods/manualRebalance.js.map +1 -0
- package/dist/rebalance_methods/math_utils.d.ts +4 -0
- package/dist/rebalance_methods/math_utils.js +18 -0
- package/dist/rebalance_methods/math_utils.js.map +1 -0
- package/dist/rebalance_methods/periodicRebalance.d.ts +14 -0
- package/dist/rebalance_methods/periodicRebalance.js +92 -0
- package/dist/rebalance_methods/periodicRebalance.js.map +1 -0
- package/dist/rebalance_methods/pricePercentageRebalance.d.ts +13 -0
- package/dist/rebalance_methods/pricePercentageRebalance.js +150 -0
- package/dist/rebalance_methods/pricePercentageRebalance.js.map +1 -0
- package/dist/rebalance_methods/pricePercentageWithResetRebalance.d.ts +14 -0
- package/dist/rebalance_methods/pricePercentageWithResetRebalance.js +233 -0
- package/dist/rebalance_methods/pricePercentageWithResetRebalance.js.map +1 -0
- package/dist/rebalance_methods/takeProfitRebalance.d.ts +14 -0
- package/dist/rebalance_methods/takeProfitRebalance.js +99 -0
- package/dist/rebalance_methods/takeProfitRebalance.js.map +1 -0
- package/dist/rebalance_methods/utils.d.ts +10 -0
- package/dist/rebalance_methods/utils.js +103 -0
- package/dist/rebalance_methods/utils.js.map +1 -0
- package/dist/services/JupService.d.ts +22 -0
- package/dist/services/JupService.js +130 -0
- package/dist/services/JupService.js.map +1 -0
- package/dist/services/MeteoraService.d.ts +24 -0
- package/dist/services/MeteoraService.js +193 -0
- package/dist/services/MeteoraService.js.map +1 -0
- package/dist/services/OrcaService.d.ts +36 -0
- package/dist/services/OrcaService.js +290 -0
- package/dist/services/OrcaService.js.map +1 -0
- package/dist/services/OrcaWhirlpoolsResponse.d.ts +105 -0
- package/dist/services/OrcaWhirlpoolsResponse.js +3 -0
- package/dist/services/OrcaWhirlpoolsResponse.js.map +1 -0
- package/dist/services/PoolSimulationService.d.ts +20 -0
- package/dist/services/PoolSimulationService.js +30 -0
- package/dist/services/PoolSimulationService.js.map +1 -0
- package/dist/services/RaydiumPoolsResponse.d.ts +85 -0
- package/dist/services/RaydiumPoolsResponse.js +3 -0
- package/dist/services/RaydiumPoolsResponse.js.map +1 -0
- package/dist/services/RaydiumService.d.ts +18 -0
- package/dist/services/RaydiumService.js +202 -0
- package/dist/services/RaydiumService.js.map +1 -0
- package/dist/services/WhirlpoolAprApy.d.ts +13 -0
- package/dist/services/WhirlpoolAprApy.js +3 -0
- package/dist/services/WhirlpoolAprApy.js.map +1 -0
- package/dist/services/index.d.ts +5 -0
- package/dist/services/index.js +22 -0
- package/dist/services/index.js.map +1 -0
- package/dist/utils/CreationParameters.d.ts +32 -0
- package/dist/utils/CreationParameters.js +81 -0
- package/dist/utils/CreationParameters.js.map +1 -0
- package/dist/utils/anchorUtils.d.ts +5 -0
- package/dist/utils/anchorUtils.js +27 -0
- package/dist/utils/anchorUtils.js.map +1 -0
- package/dist/utils/batch.d.ts +2 -0
- package/dist/utils/batch.js +24 -0
- package/dist/utils/batch.js.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +25 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/instructions.d.ts +6 -0
- package/dist/utils/instructions.js +40 -0
- package/dist/utils/instructions.js.map +1 -0
- package/dist/utils/lookupTable.d.ts +4 -0
- package/dist/utils/lookupTable.js +51 -0
- package/dist/utils/lookupTable.js.map +1 -0
- package/dist/utils/math.d.ts +3 -0
- package/dist/utils/math.js +16 -0
- package/dist/utils/math.js.map +1 -0
- package/dist/utils/meteora.d.ts +20 -0
- package/dist/utils/meteora.js +80 -0
- package/dist/utils/meteora.js.map +1 -0
- package/dist/utils/orca.d.ts +2 -0
- package/dist/utils/orca.js +8 -0
- package/dist/utils/orca.js.map +1 -0
- package/dist/utils/priceReferenceTypes.d.ts +3 -0
- package/dist/utils/priceReferenceTypes.js +12 -0
- package/dist/utils/priceReferenceTypes.js.map +1 -0
- package/dist/utils/pubkey.d.ts +65 -0
- package/dist/utils/pubkey.js +218 -0
- package/dist/utils/pubkey.js.map +1 -0
- package/dist/utils/raydium.d.ts +1 -0
- package/dist/utils/raydium.js +15 -0
- package/dist/utils/raydium.js.map +1 -0
- package/dist/utils/tokenUtils.d.ts +47 -0
- package/dist/utils/tokenUtils.js +185 -0
- package/dist/utils/tokenUtils.js.map +1 -0
- package/dist/utils/transactions.d.ts +13 -0
- package/dist/utils/transactions.js +147 -0
- package/dist/utils/transactions.js.map +1 -0
- package/dist/utils/types.d.ts +178 -0
- package/dist/utils/types.js +110 -0
- package/dist/utils/types.js.map +1 -0
- package/dist/utils/utils.d.ts +36 -0
- package/dist/utils/utils.js +313 -0
- package/dist/utils/utils.js.map +1 -0
- package/dist/whirlpools-client/accounts/FeeTier.d.ts +24 -0
- package/dist/whirlpools-client/accounts/FeeTier.js +106 -0
- package/dist/whirlpools-client/accounts/FeeTier.js.map +1 -0
- package/dist/whirlpools-client/accounts/Position.d.ts +47 -0
- package/dist/whirlpools-client/accounts/Position.js +146 -0
- package/dist/whirlpools-client/accounts/Position.js.map +1 -0
- package/dist/whirlpools-client/accounts/PositionBundle.d.ts +21 -0
- package/dist/whirlpools-client/accounts/PositionBundle.js +101 -0
- package/dist/whirlpools-client/accounts/PositionBundle.js.map +1 -0
- package/dist/whirlpools-client/accounts/TickArray.d.ts +25 -0
- package/dist/whirlpools-client/accounts/TickArray.js +107 -0
- package/dist/whirlpools-client/accounts/TickArray.js.map +1 -0
- package/dist/whirlpools-client/accounts/TokenBadge.d.ts +21 -0
- package/dist/whirlpools-client/accounts/TokenBadge.js +101 -0
- package/dist/whirlpools-client/accounts/TokenBadge.js.map +1 -0
- package/dist/whirlpools-client/accounts/Whirlpool.d.ts +74 -0
- package/dist/whirlpools-client/accounts/Whirlpool.js +191 -0
- package/dist/whirlpools-client/accounts/Whirlpool.js.map +1 -0
- package/dist/whirlpools-client/accounts/WhirlpoolsConfig.d.ts +27 -0
- package/dist/whirlpools-client/accounts/WhirlpoolsConfig.js +111 -0
- package/dist/whirlpools-client/accounts/WhirlpoolsConfig.js.map +1 -0
- package/dist/whirlpools-client/accounts/WhirlpoolsConfigExtension.d.ts +24 -0
- package/dist/whirlpools-client/accounts/WhirlpoolsConfigExtension.js +106 -0
- package/dist/whirlpools-client/accounts/WhirlpoolsConfigExtension.js.map +1 -0
- package/dist/whirlpools-client/accounts/index.d.ts +16 -0
- package/dist/whirlpools-client/accounts/index.js +20 -0
- package/dist/whirlpools-client/accounts/index.js.map +1 -0
- package/dist/whirlpools-client/errors/anchor.d.ts +434 -0
- package/dist/whirlpools-client/errors/anchor.js +713 -0
- package/dist/whirlpools-client/errors/anchor.js.map +1 -0
- package/dist/whirlpools-client/errors/custom.d.ts +434 -0
- package/dist/whirlpools-client/errors/custom.js +713 -0
- package/dist/whirlpools-client/errors/custom.js.map +1 -0
- package/dist/whirlpools-client/errors/index.d.ts +5 -0
- package/dist/whirlpools-client/errors/index.js +70 -0
- package/dist/whirlpools-client/errors/index.js.map +1 -0
- package/dist/whirlpools-client/index.d.ts +4 -0
- package/dist/whirlpools-client/index.js +21 -0
- package/dist/whirlpools-client/index.js.map +1 -0
- package/dist/whirlpools-client/instructions/closeBundledPosition.d.ts +13 -0
- package/dist/whirlpools-client/instructions/closeBundledPosition.js +57 -0
- package/dist/whirlpools-client/instructions/closeBundledPosition.js.map +1 -0
- package/dist/whirlpools-client/instructions/closePosition.d.ts +10 -0
- package/dist/whirlpools-client/instructions/closePosition.js +24 -0
- package/dist/whirlpools-client/instructions/closePosition.js.map +1 -0
- package/dist/whirlpools-client/instructions/collectFees.d.ts +13 -0
- package/dist/whirlpools-client/instructions/collectFees.js +27 -0
- package/dist/whirlpools-client/instructions/collectFees.js.map +1 -0
- package/dist/whirlpools-client/instructions/collectFeesV2.d.ts +22 -0
- package/dist/whirlpools-client/instructions/collectFeesV2.js +66 -0
- package/dist/whirlpools-client/instructions/collectFeesV2.js.map +1 -0
- package/dist/whirlpools-client/instructions/collectProtocolFees.d.ts +12 -0
- package/dist/whirlpools-client/instructions/collectProtocolFees.js +26 -0
- package/dist/whirlpools-client/instructions/collectProtocolFees.js.map +1 -0
- package/dist/whirlpools-client/instructions/collectProtocolFeesV2.d.ts +21 -0
- package/dist/whirlpools-client/instructions/collectProtocolFeesV2.js +65 -0
- package/dist/whirlpools-client/instructions/collectProtocolFeesV2.js.map +1 -0
- package/dist/whirlpools-client/instructions/collectReward.d.ts +15 -0
- package/dist/whirlpools-client/instructions/collectReward.js +55 -0
- package/dist/whirlpools-client/instructions/collectReward.js.map +1 -0
- package/dist/whirlpools-client/instructions/collectRewardV2.d.ts +19 -0
- package/dist/whirlpools-client/instructions/collectRewardV2.js +64 -0
- package/dist/whirlpools-client/instructions/collectRewardV2.js.map +1 -0
- package/dist/whirlpools-client/instructions/decreaseLiquidity.d.ts +22 -0
- package/dist/whirlpools-client/instructions/decreaseLiquidity.js +65 -0
- package/dist/whirlpools-client/instructions/decreaseLiquidity.js.map +1 -0
- package/dist/whirlpools-client/instructions/decreaseLiquidityV2.d.ts +28 -0
- package/dist/whirlpools-client/instructions/decreaseLiquidityV2.js +74 -0
- package/dist/whirlpools-client/instructions/decreaseLiquidityV2.js.map +1 -0
- package/dist/whirlpools-client/instructions/deletePositionBundle.d.ts +10 -0
- package/dist/whirlpools-client/instructions/deletePositionBundle.js +24 -0
- package/dist/whirlpools-client/instructions/deletePositionBundle.js.map +1 -0
- package/dist/whirlpools-client/instructions/deleteTokenBadge.d.ts +10 -0
- package/dist/whirlpools-client/instructions/deleteTokenBadge.js +24 -0
- package/dist/whirlpools-client/instructions/deleteTokenBadge.js.map +1 -0
- package/dist/whirlpools-client/instructions/increaseLiquidity.d.ts +22 -0
- package/dist/whirlpools-client/instructions/increaseLiquidity.js +65 -0
- package/dist/whirlpools-client/instructions/increaseLiquidity.js.map +1 -0
- package/dist/whirlpools-client/instructions/increaseLiquidityV2.d.ts +28 -0
- package/dist/whirlpools-client/instructions/increaseLiquidityV2.js +74 -0
- package/dist/whirlpools-client/instructions/increaseLiquidityV2.js.map +1 -0
- package/dist/whirlpools-client/instructions/index.d.ts +92 -0
- package/dist/whirlpools-client/instructions/index.js +96 -0
- package/dist/whirlpools-client/instructions/index.js.map +1 -0
- package/dist/whirlpools-client/instructions/initializeConfig.d.ts +14 -0
- package/dist/whirlpools-client/instructions/initializeConfig.js +55 -0
- package/dist/whirlpools-client/instructions/initializeConfig.js.map +1 -0
- package/dist/whirlpools-client/instructions/initializeConfigExtension.d.ts +9 -0
- package/dist/whirlpools-client/instructions/initializeConfigExtension.js +19 -0
- package/dist/whirlpools-client/instructions/initializeConfigExtension.js.map +1 -0
- package/dist/whirlpools-client/instructions/initializeFeeTier.d.ts +14 -0
- package/dist/whirlpools-client/instructions/initializeFeeTier.js +53 -0
- package/dist/whirlpools-client/instructions/initializeFeeTier.js.map +1 -0
- package/dist/whirlpools-client/instructions/initializePool.d.ts +23 -0
- package/dist/whirlpools-client/instructions/initializePool.js +62 -0
- package/dist/whirlpools-client/instructions/initializePool.js.map +1 -0
- package/dist/whirlpools-client/instructions/initializePoolV2.d.ts +24 -0
- package/dist/whirlpools-client/instructions/initializePoolV2.js +62 -0
- package/dist/whirlpools-client/instructions/initializePoolV2.js.map +1 -0
- package/dist/whirlpools-client/instructions/initializePositionBundle.d.ts +13 -0
- package/dist/whirlpools-client/instructions/initializePositionBundle.js +35 -0
- package/dist/whirlpools-client/instructions/initializePositionBundle.js.map +1 -0
- package/dist/whirlpools-client/instructions/initializePositionBundleWithMetadata.d.ts +16 -0
- package/dist/whirlpools-client/instructions/initializePositionBundleWithMetadata.js +42 -0
- package/dist/whirlpools-client/instructions/initializePositionBundleWithMetadata.js.map +1 -0
- package/dist/whirlpools-client/instructions/initializeReward.d.ts +16 -0
- package/dist/whirlpools-client/instructions/initializeReward.js +52 -0
- package/dist/whirlpools-client/instructions/initializeReward.js.map +1 -0
- package/dist/whirlpools-client/instructions/initializeRewardV2.d.ts +17 -0
- package/dist/whirlpools-client/instructions/initializeRewardV2.js +53 -0
- package/dist/whirlpools-client/instructions/initializeRewardV2.js.map +1 -0
- package/dist/whirlpools-client/instructions/initializeTickArray.d.ts +12 -0
- package/dist/whirlpools-client/instructions/initializeTickArray.js +48 -0
- package/dist/whirlpools-client/instructions/initializeTickArray.js.map +1 -0
- package/dist/whirlpools-client/instructions/initializeTokenBadge.d.ts +11 -0
- package/dist/whirlpools-client/instructions/initializeTokenBadge.js +25 -0
- package/dist/whirlpools-client/instructions/initializeTokenBadge.js.map +1 -0
- package/dist/whirlpools-client/instructions/openBundledPosition.d.ts +18 -0
- package/dist/whirlpools-client/instructions/openBundledPosition.js +66 -0
- package/dist/whirlpools-client/instructions/openBundledPosition.js.map +1 -0
- package/dist/whirlpools-client/instructions/openPosition.d.ts +21 -0
- package/dist/whirlpools-client/instructions/openPosition.js +69 -0
- package/dist/whirlpools-client/instructions/openPosition.js.map +1 -0
- package/dist/whirlpools-client/instructions/openPositionWithMetadata.d.ts +24 -0
- package/dist/whirlpools-client/instructions/openPositionWithMetadata.js +76 -0
- package/dist/whirlpools-client/instructions/openPositionWithMetadata.js.map +1 -0
- package/dist/whirlpools-client/instructions/setCollectProtocolFeesAuthority.d.ts +7 -0
- package/dist/whirlpools-client/instructions/setCollectProtocolFeesAuthority.js +25 -0
- package/dist/whirlpools-client/instructions/setCollectProtocolFeesAuthority.js.map +1 -0
- package/dist/whirlpools-client/instructions/setConfigExtensionAuthority.d.ts +8 -0
- package/dist/whirlpools-client/instructions/setConfigExtensionAuthority.js +30 -0
- package/dist/whirlpools-client/instructions/setConfigExtensionAuthority.js.map +1 -0
- package/dist/whirlpools-client/instructions/setDefaultFeeRate.d.ts +11 -0
- package/dist/whirlpools-client/instructions/setDefaultFeeRate.js +47 -0
- package/dist/whirlpools-client/instructions/setDefaultFeeRate.js.map +1 -0
- package/dist/whirlpools-client/instructions/setDefaultProtocolFeeRate.d.ts +10 -0
- package/dist/whirlpools-client/instructions/setDefaultProtocolFeeRate.js +46 -0
- package/dist/whirlpools-client/instructions/setDefaultProtocolFeeRate.js.map +1 -0
- package/dist/whirlpools-client/instructions/setFeeAuthority.d.ts +7 -0
- package/dist/whirlpools-client/instructions/setFeeAuthority.js +17 -0
- package/dist/whirlpools-client/instructions/setFeeAuthority.js.map +1 -0
- package/dist/whirlpools-client/instructions/setFeeRate.d.ts +11 -0
- package/dist/whirlpools-client/instructions/setFeeRate.js +47 -0
- package/dist/whirlpools-client/instructions/setFeeRate.js.map +1 -0
- package/dist/whirlpools-client/instructions/setProtocolFeeRate.d.ts +11 -0
- package/dist/whirlpools-client/instructions/setProtocolFeeRate.js +47 -0
- package/dist/whirlpools-client/instructions/setProtocolFeeRate.js.map +1 -0
- package/dist/whirlpools-client/instructions/setRewardAuthority.d.ts +11 -0
- package/dist/whirlpools-client/instructions/setRewardAuthority.js +47 -0
- package/dist/whirlpools-client/instructions/setRewardAuthority.js.map +1 -0
- package/dist/whirlpools-client/instructions/setRewardAuthorityBySuperAuthority.d.ts +12 -0
- package/dist/whirlpools-client/instructions/setRewardAuthorityBySuperAuthority.js +52 -0
- package/dist/whirlpools-client/instructions/setRewardAuthorityBySuperAuthority.js.map +1 -0
- package/dist/whirlpools-client/instructions/setRewardEmissions.d.ts +13 -0
- package/dist/whirlpools-client/instructions/setRewardEmissions.js +51 -0
- package/dist/whirlpools-client/instructions/setRewardEmissions.js.map +1 -0
- package/dist/whirlpools-client/instructions/setRewardEmissionsSuperAuthority.d.ts +7 -0
- package/dist/whirlpools-client/instructions/setRewardEmissionsSuperAuthority.js +25 -0
- package/dist/whirlpools-client/instructions/setRewardEmissionsSuperAuthority.js.map +1 -0
- package/dist/whirlpools-client/instructions/setRewardEmissionsV2.d.ts +13 -0
- package/dist/whirlpools-client/instructions/setRewardEmissionsV2.js +51 -0
- package/dist/whirlpools-client/instructions/setRewardEmissionsV2.js.map +1 -0
- package/dist/whirlpools-client/instructions/setTokenBadgeAuthority.d.ts +8 -0
- package/dist/whirlpools-client/instructions/setTokenBadgeAuthority.js +30 -0
- package/dist/whirlpools-client/instructions/setTokenBadgeAuthority.js.map +1 -0
- package/dist/whirlpools-client/instructions/swap.d.ts +24 -0
- package/dist/whirlpools-client/instructions/swap.js +65 -0
- package/dist/whirlpools-client/instructions/swap.js.map +1 -0
- package/dist/whirlpools-client/instructions/swapV2.d.ts +30 -0
- package/dist/whirlpools-client/instructions/swapV2.js +74 -0
- package/dist/whirlpools-client/instructions/swapV2.js.map +1 -0
- package/dist/whirlpools-client/instructions/twoHopSwap.d.ts +35 -0
- package/dist/whirlpools-client/instructions/twoHopSwap.js +94 -0
- package/dist/whirlpools-client/instructions/twoHopSwap.js.map +1 -0
- package/dist/whirlpools-client/instructions/twoHopSwapV2.d.ts +41 -0
- package/dist/whirlpools-client/instructions/twoHopSwapV2.js +111 -0
- package/dist/whirlpools-client/instructions/twoHopSwapV2.js.map +1 -0
- package/dist/whirlpools-client/instructions/updateFeesAndRewards.d.ts +8 -0
- package/dist/whirlpools-client/instructions/updateFeesAndRewards.js +18 -0
- package/dist/whirlpools-client/instructions/updateFeesAndRewards.js.map +1 -0
- package/dist/whirlpools-client/programId.d.ts +5 -0
- package/dist/whirlpools-client/programId.js +15 -0
- package/dist/whirlpools-client/programId.js.map +1 -0
- package/dist/whirlpools-client/shim/remove-liquidity.d.ts +15 -0
- package/dist/whirlpools-client/shim/remove-liquidity.js +72 -0
- package/dist/whirlpools-client/shim/remove-liquidity.js.map +1 -0
- package/dist/whirlpools-client/types/AccountsType.d.ts +83 -0
- package/dist/whirlpools-client/types/AccountsType.js +206 -0
- package/dist/whirlpools-client/types/AccountsType.js.map +1 -0
- package/dist/whirlpools-client/types/CurrIndex.d.ts +44 -0
- package/dist/whirlpools-client/types/CurrIndex.js +128 -0
- package/dist/whirlpools-client/types/CurrIndex.js.map +1 -0
- package/dist/whirlpools-client/types/Direction.d.ts +31 -0
- package/dist/whirlpools-client/types/Direction.js +102 -0
- package/dist/whirlpools-client/types/Direction.js.map +1 -0
- package/dist/whirlpools-client/types/OpenPositionBumps.d.ts +21 -0
- package/dist/whirlpools-client/types/OpenPositionBumps.js +61 -0
- package/dist/whirlpools-client/types/OpenPositionBumps.js.map +1 -0
- package/dist/whirlpools-client/types/OpenPositionWithMetadataBumps.d.ts +26 -0
- package/dist/whirlpools-client/types/OpenPositionWithMetadataBumps.js +66 -0
- package/dist/whirlpools-client/types/OpenPositionWithMetadataBumps.js.map +1 -0
- package/dist/whirlpools-client/types/PositionRewardInfo.d.ts +27 -0
- package/dist/whirlpools-client/types/PositionRewardInfo.js +70 -0
- package/dist/whirlpools-client/types/PositionRewardInfo.js.map +1 -0
- package/dist/whirlpools-client/types/RemainingAccountsInfo.d.ts +51 -0
- package/dist/whirlpools-client/types/RemainingAccountsInfo.js +62 -0
- package/dist/whirlpools-client/types/RemainingAccountsInfo.js.map +1 -0
- package/dist/whirlpools-client/types/RemainingAccountsSlice.d.ts +50 -0
- package/dist/whirlpools-client/types/RemainingAccountsSlice.js +67 -0
- package/dist/whirlpools-client/types/RemainingAccountsSlice.js.map +1 -0
- package/dist/whirlpools-client/types/Tick.d.ts +47 -0
- package/dist/whirlpools-client/types/Tick.js +97 -0
- package/dist/whirlpools-client/types/Tick.js.map +1 -0
- package/dist/whirlpools-client/types/TickLabel.d.ts +31 -0
- package/dist/whirlpools-client/types/TickLabel.js +102 -0
- package/dist/whirlpools-client/types/TickLabel.js.map +1 -0
- package/dist/whirlpools-client/types/WhirlpoolBumps.d.ts +21 -0
- package/dist/whirlpools-client/types/WhirlpoolBumps.js +61 -0
- package/dist/whirlpools-client/types/WhirlpoolBumps.js.map +1 -0
- package/dist/whirlpools-client/types/WhirlpoolRewardInfo.d.ts +43 -0
- package/dist/whirlpools-client/types/WhirlpoolRewardInfo.js +92 -0
- package/dist/whirlpools-client/types/WhirlpoolRewardInfo.js.map +1 -0
- package/dist/whirlpools-client/types/index.d.ts +32 -0
- package/dist/whirlpools-client/types/index.js +51 -0
- package/dist/whirlpools-client/types/index.js.map +1 -0
- package/package.json +92 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.PoolState = void 0;
|
|
39
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
40
|
+
const bn_js_1 = __importDefault(require("bn.js")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
41
|
+
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
42
|
+
const types = __importStar(require("../types")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
43
|
+
const programId_1 = require("../programId");
|
|
44
|
+
class PoolState {
|
|
45
|
+
constructor(fields) {
|
|
46
|
+
this.bump = fields.bump;
|
|
47
|
+
this.ammConfig = fields.ammConfig;
|
|
48
|
+
this.owner = fields.owner;
|
|
49
|
+
this.tokenMint0 = fields.tokenMint0;
|
|
50
|
+
this.tokenMint1 = fields.tokenMint1;
|
|
51
|
+
this.tokenVault0 = fields.tokenVault0;
|
|
52
|
+
this.tokenVault1 = fields.tokenVault1;
|
|
53
|
+
this.observationKey = fields.observationKey;
|
|
54
|
+
this.mintDecimals0 = fields.mintDecimals0;
|
|
55
|
+
this.mintDecimals1 = fields.mintDecimals1;
|
|
56
|
+
this.tickSpacing = fields.tickSpacing;
|
|
57
|
+
this.liquidity = fields.liquidity;
|
|
58
|
+
this.sqrtPriceX64 = fields.sqrtPriceX64;
|
|
59
|
+
this.tickCurrent = fields.tickCurrent;
|
|
60
|
+
this.observationIndex = fields.observationIndex;
|
|
61
|
+
this.observationUpdateDuration = fields.observationUpdateDuration;
|
|
62
|
+
this.feeGrowthGlobal0X64 = fields.feeGrowthGlobal0X64;
|
|
63
|
+
this.feeGrowthGlobal1X64 = fields.feeGrowthGlobal1X64;
|
|
64
|
+
this.protocolFeesToken0 = fields.protocolFeesToken0;
|
|
65
|
+
this.protocolFeesToken1 = fields.protocolFeesToken1;
|
|
66
|
+
this.swapInAmountToken0 = fields.swapInAmountToken0;
|
|
67
|
+
this.swapOutAmountToken1 = fields.swapOutAmountToken1;
|
|
68
|
+
this.swapInAmountToken1 = fields.swapInAmountToken1;
|
|
69
|
+
this.swapOutAmountToken0 = fields.swapOutAmountToken0;
|
|
70
|
+
this.status = fields.status;
|
|
71
|
+
this.padding = fields.padding;
|
|
72
|
+
this.rewardInfos = fields.rewardInfos.map((item) => new types.RewardInfo(Object.assign({}, item)));
|
|
73
|
+
this.tickArrayBitmap = fields.tickArrayBitmap;
|
|
74
|
+
this.totalFeesToken0 = fields.totalFeesToken0;
|
|
75
|
+
this.totalFeesClaimedToken0 = fields.totalFeesClaimedToken0;
|
|
76
|
+
this.totalFeesToken1 = fields.totalFeesToken1;
|
|
77
|
+
this.totalFeesClaimedToken1 = fields.totalFeesClaimedToken1;
|
|
78
|
+
this.fundFeesToken0 = fields.fundFeesToken0;
|
|
79
|
+
this.fundFeesToken1 = fields.fundFeesToken1;
|
|
80
|
+
this.openTime = fields.openTime;
|
|
81
|
+
this.padding1 = fields.padding1;
|
|
82
|
+
this.padding2 = fields.padding2;
|
|
83
|
+
}
|
|
84
|
+
static fetch(c_1, address_1) {
|
|
85
|
+
return __awaiter(this, arguments, void 0, function* (c, address, programId = programId_1.PROGRAM_ID) {
|
|
86
|
+
const info = yield c.getAccountInfo(address);
|
|
87
|
+
if (info === null) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
if (!info.owner.equals(programId)) {
|
|
91
|
+
throw new Error("account doesn't belong to this program");
|
|
92
|
+
}
|
|
93
|
+
return this.decode(info.data);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
static fetchMultiple(c_1, addresses_1) {
|
|
97
|
+
return __awaiter(this, arguments, void 0, function* (c, addresses, programId = programId_1.PROGRAM_ID) {
|
|
98
|
+
const infos = yield c.getMultipleAccountsInfo(addresses);
|
|
99
|
+
return infos.map((info) => {
|
|
100
|
+
if (info === null) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
if (!info.owner.equals(programId)) {
|
|
104
|
+
throw new Error("account doesn't belong to this program");
|
|
105
|
+
}
|
|
106
|
+
return this.decode(info.data);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
static decode(data) {
|
|
111
|
+
if (!data.slice(0, 8).equals(PoolState.discriminator)) {
|
|
112
|
+
throw new Error("invalid account discriminator");
|
|
113
|
+
}
|
|
114
|
+
const dec = PoolState.layout.decode(data.slice(8));
|
|
115
|
+
return new PoolState({
|
|
116
|
+
bump: dec.bump,
|
|
117
|
+
ammConfig: dec.ammConfig,
|
|
118
|
+
owner: dec.owner,
|
|
119
|
+
tokenMint0: dec.tokenMint0,
|
|
120
|
+
tokenMint1: dec.tokenMint1,
|
|
121
|
+
tokenVault0: dec.tokenVault0,
|
|
122
|
+
tokenVault1: dec.tokenVault1,
|
|
123
|
+
observationKey: dec.observationKey,
|
|
124
|
+
mintDecimals0: dec.mintDecimals0,
|
|
125
|
+
mintDecimals1: dec.mintDecimals1,
|
|
126
|
+
tickSpacing: dec.tickSpacing,
|
|
127
|
+
liquidity: dec.liquidity,
|
|
128
|
+
sqrtPriceX64: dec.sqrtPriceX64,
|
|
129
|
+
tickCurrent: dec.tickCurrent,
|
|
130
|
+
observationIndex: dec.observationIndex,
|
|
131
|
+
observationUpdateDuration: dec.observationUpdateDuration,
|
|
132
|
+
feeGrowthGlobal0X64: dec.feeGrowthGlobal0X64,
|
|
133
|
+
feeGrowthGlobal1X64: dec.feeGrowthGlobal1X64,
|
|
134
|
+
protocolFeesToken0: dec.protocolFeesToken0,
|
|
135
|
+
protocolFeesToken1: dec.protocolFeesToken1,
|
|
136
|
+
swapInAmountToken0: dec.swapInAmountToken0,
|
|
137
|
+
swapOutAmountToken1: dec.swapOutAmountToken1,
|
|
138
|
+
swapInAmountToken1: dec.swapInAmountToken1,
|
|
139
|
+
swapOutAmountToken0: dec.swapOutAmountToken0,
|
|
140
|
+
status: dec.status,
|
|
141
|
+
padding: dec.padding,
|
|
142
|
+
rewardInfos: dec.rewardInfos.map((item /* eslint-disable-line @typescript-eslint/no-explicit-any */) => types.RewardInfo.fromDecoded(item)),
|
|
143
|
+
tickArrayBitmap: dec.tickArrayBitmap,
|
|
144
|
+
totalFeesToken0: dec.totalFeesToken0,
|
|
145
|
+
totalFeesClaimedToken0: dec.totalFeesClaimedToken0,
|
|
146
|
+
totalFeesToken1: dec.totalFeesToken1,
|
|
147
|
+
totalFeesClaimedToken1: dec.totalFeesClaimedToken1,
|
|
148
|
+
fundFeesToken0: dec.fundFeesToken0,
|
|
149
|
+
fundFeesToken1: dec.fundFeesToken1,
|
|
150
|
+
openTime: dec.openTime,
|
|
151
|
+
padding1: dec.padding1,
|
|
152
|
+
padding2: dec.padding2,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
toJSON() {
|
|
156
|
+
return {
|
|
157
|
+
bump: this.bump,
|
|
158
|
+
ammConfig: this.ammConfig.toString(),
|
|
159
|
+
owner: this.owner.toString(),
|
|
160
|
+
tokenMint0: this.tokenMint0.toString(),
|
|
161
|
+
tokenMint1: this.tokenMint1.toString(),
|
|
162
|
+
tokenVault0: this.tokenVault0.toString(),
|
|
163
|
+
tokenVault1: this.tokenVault1.toString(),
|
|
164
|
+
observationKey: this.observationKey.toString(),
|
|
165
|
+
mintDecimals0: this.mintDecimals0,
|
|
166
|
+
mintDecimals1: this.mintDecimals1,
|
|
167
|
+
tickSpacing: this.tickSpacing,
|
|
168
|
+
liquidity: this.liquidity.toString(),
|
|
169
|
+
sqrtPriceX64: this.sqrtPriceX64.toString(),
|
|
170
|
+
tickCurrent: this.tickCurrent,
|
|
171
|
+
observationIndex: this.observationIndex,
|
|
172
|
+
observationUpdateDuration: this.observationUpdateDuration,
|
|
173
|
+
feeGrowthGlobal0X64: this.feeGrowthGlobal0X64.toString(),
|
|
174
|
+
feeGrowthGlobal1X64: this.feeGrowthGlobal1X64.toString(),
|
|
175
|
+
protocolFeesToken0: this.protocolFeesToken0.toString(),
|
|
176
|
+
protocolFeesToken1: this.protocolFeesToken1.toString(),
|
|
177
|
+
swapInAmountToken0: this.swapInAmountToken0.toString(),
|
|
178
|
+
swapOutAmountToken1: this.swapOutAmountToken1.toString(),
|
|
179
|
+
swapInAmountToken1: this.swapInAmountToken1.toString(),
|
|
180
|
+
swapOutAmountToken0: this.swapOutAmountToken0.toString(),
|
|
181
|
+
status: this.status,
|
|
182
|
+
padding: this.padding,
|
|
183
|
+
rewardInfos: this.rewardInfos.map((item) => item.toJSON()),
|
|
184
|
+
tickArrayBitmap: this.tickArrayBitmap.map((item) => item.toString()),
|
|
185
|
+
totalFeesToken0: this.totalFeesToken0.toString(),
|
|
186
|
+
totalFeesClaimedToken0: this.totalFeesClaimedToken0.toString(),
|
|
187
|
+
totalFeesToken1: this.totalFeesToken1.toString(),
|
|
188
|
+
totalFeesClaimedToken1: this.totalFeesClaimedToken1.toString(),
|
|
189
|
+
fundFeesToken0: this.fundFeesToken0.toString(),
|
|
190
|
+
fundFeesToken1: this.fundFeesToken1.toString(),
|
|
191
|
+
openTime: this.openTime.toString(),
|
|
192
|
+
padding1: this.padding1.map((item) => item.toString()),
|
|
193
|
+
padding2: this.padding2.map((item) => item.toString()),
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
static fromJSON(obj) {
|
|
197
|
+
return new PoolState({
|
|
198
|
+
bump: obj.bump,
|
|
199
|
+
ammConfig: new web3_js_1.PublicKey(obj.ammConfig),
|
|
200
|
+
owner: new web3_js_1.PublicKey(obj.owner),
|
|
201
|
+
tokenMint0: new web3_js_1.PublicKey(obj.tokenMint0),
|
|
202
|
+
tokenMint1: new web3_js_1.PublicKey(obj.tokenMint1),
|
|
203
|
+
tokenVault0: new web3_js_1.PublicKey(obj.tokenVault0),
|
|
204
|
+
tokenVault1: new web3_js_1.PublicKey(obj.tokenVault1),
|
|
205
|
+
observationKey: new web3_js_1.PublicKey(obj.observationKey),
|
|
206
|
+
mintDecimals0: obj.mintDecimals0,
|
|
207
|
+
mintDecimals1: obj.mintDecimals1,
|
|
208
|
+
tickSpacing: obj.tickSpacing,
|
|
209
|
+
liquidity: new bn_js_1.default(obj.liquidity),
|
|
210
|
+
sqrtPriceX64: new bn_js_1.default(obj.sqrtPriceX64),
|
|
211
|
+
tickCurrent: obj.tickCurrent,
|
|
212
|
+
observationIndex: obj.observationIndex,
|
|
213
|
+
observationUpdateDuration: obj.observationUpdateDuration,
|
|
214
|
+
feeGrowthGlobal0X64: new bn_js_1.default(obj.feeGrowthGlobal0X64),
|
|
215
|
+
feeGrowthGlobal1X64: new bn_js_1.default(obj.feeGrowthGlobal1X64),
|
|
216
|
+
protocolFeesToken0: new bn_js_1.default(obj.protocolFeesToken0),
|
|
217
|
+
protocolFeesToken1: new bn_js_1.default(obj.protocolFeesToken1),
|
|
218
|
+
swapInAmountToken0: new bn_js_1.default(obj.swapInAmountToken0),
|
|
219
|
+
swapOutAmountToken1: new bn_js_1.default(obj.swapOutAmountToken1),
|
|
220
|
+
swapInAmountToken1: new bn_js_1.default(obj.swapInAmountToken1),
|
|
221
|
+
swapOutAmountToken0: new bn_js_1.default(obj.swapOutAmountToken0),
|
|
222
|
+
status: obj.status,
|
|
223
|
+
padding: obj.padding,
|
|
224
|
+
rewardInfos: obj.rewardInfos.map((item) => types.RewardInfo.fromJSON(item)),
|
|
225
|
+
tickArrayBitmap: obj.tickArrayBitmap.map((item) => new bn_js_1.default(item)),
|
|
226
|
+
totalFeesToken0: new bn_js_1.default(obj.totalFeesToken0),
|
|
227
|
+
totalFeesClaimedToken0: new bn_js_1.default(obj.totalFeesClaimedToken0),
|
|
228
|
+
totalFeesToken1: new bn_js_1.default(obj.totalFeesToken1),
|
|
229
|
+
totalFeesClaimedToken1: new bn_js_1.default(obj.totalFeesClaimedToken1),
|
|
230
|
+
fundFeesToken0: new bn_js_1.default(obj.fundFeesToken0),
|
|
231
|
+
fundFeesToken1: new bn_js_1.default(obj.fundFeesToken1),
|
|
232
|
+
openTime: new bn_js_1.default(obj.openTime),
|
|
233
|
+
padding1: obj.padding1.map((item) => new bn_js_1.default(item)),
|
|
234
|
+
padding2: obj.padding2.map((item) => new bn_js_1.default(item)),
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
exports.PoolState = PoolState;
|
|
239
|
+
PoolState.discriminator = Buffer.from([
|
|
240
|
+
247, 237, 227, 245, 215, 195, 222, 70,
|
|
241
|
+
]);
|
|
242
|
+
PoolState.layout = borsh.struct([
|
|
243
|
+
borsh.u8("bump"),
|
|
244
|
+
borsh.publicKey("ammConfig"),
|
|
245
|
+
borsh.publicKey("owner"),
|
|
246
|
+
borsh.publicKey("tokenMint0"),
|
|
247
|
+
borsh.publicKey("tokenMint1"),
|
|
248
|
+
borsh.publicKey("tokenVault0"),
|
|
249
|
+
borsh.publicKey("tokenVault1"),
|
|
250
|
+
borsh.publicKey("observationKey"),
|
|
251
|
+
borsh.u8("mintDecimals0"),
|
|
252
|
+
borsh.u8("mintDecimals1"),
|
|
253
|
+
borsh.u16("tickSpacing"),
|
|
254
|
+
borsh.u128("liquidity"),
|
|
255
|
+
borsh.u128("sqrtPriceX64"),
|
|
256
|
+
borsh.i32("tickCurrent"),
|
|
257
|
+
borsh.u16("observationIndex"),
|
|
258
|
+
borsh.u16("observationUpdateDuration"),
|
|
259
|
+
borsh.u128("feeGrowthGlobal0X64"),
|
|
260
|
+
borsh.u128("feeGrowthGlobal1X64"),
|
|
261
|
+
borsh.u64("protocolFeesToken0"),
|
|
262
|
+
borsh.u64("protocolFeesToken1"),
|
|
263
|
+
borsh.u128("swapInAmountToken0"),
|
|
264
|
+
borsh.u128("swapOutAmountToken1"),
|
|
265
|
+
borsh.u128("swapInAmountToken1"),
|
|
266
|
+
borsh.u128("swapOutAmountToken0"),
|
|
267
|
+
borsh.u8("status"),
|
|
268
|
+
borsh.array(borsh.u8(), 7, "padding"),
|
|
269
|
+
borsh.array(types.RewardInfo.layout(), 3, "rewardInfos"),
|
|
270
|
+
borsh.array(borsh.u64(), 16, "tickArrayBitmap"),
|
|
271
|
+
borsh.u64("totalFeesToken0"),
|
|
272
|
+
borsh.u64("totalFeesClaimedToken0"),
|
|
273
|
+
borsh.u64("totalFeesToken1"),
|
|
274
|
+
borsh.u64("totalFeesClaimedToken1"),
|
|
275
|
+
borsh.u64("fundFeesToken0"),
|
|
276
|
+
borsh.u64("fundFeesToken1"),
|
|
277
|
+
borsh.u64("openTime"),
|
|
278
|
+
borsh.array(borsh.u64(), 25, "padding1"),
|
|
279
|
+
borsh.array(borsh.u64(), 32, "padding2"),
|
|
280
|
+
]);
|
|
281
|
+
//# sourceMappingURL=PoolState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PoolState.js","sourceRoot":"","sources":["../../../src/kamino-client/accounts/PoolState.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAuD;AACvD,kDAAsB,CAAC,wDAAwD;AAC/E,wDAAyC,CAAC,wDAAwD;AAClG,gDAAiC,CAAC,wDAAwD;AAC1F,4CAAyC;AA0IzC,MAAa,SAAS;IA+GpB,YAAY,MAAuB;QACjC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;QACvB,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;QACjC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;QACzB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAA;QACnC,IAAI,CAAC,U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EAAE,EAAE,EAAE,EAAE,iBAAiB,CAAC;IAC/C,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC;IAC5B,KAAK,CAAC,GAAG,CAAC,wBAAwB,CAAC;IACnC,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC;IAC5B,KAAK,CAAC,GAAG,CAAC,wBAAwB,CAAC;IACnC,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAC3B,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAC3B,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC;IACrB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,UAAU,CAAC;IACxC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,UAAU,CAAC;CACzC,CAAC,CAAA","sourcesContent":["import { PublicKey, Connection } from \"@solana/web3.js\"\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport { PROGRAM_ID } from \"../programId\"\n\nexport interface PoolStateFields {\n /** Bump to identify PDA */\n bump: number\n ammConfig: PublicKey\n owner: PublicKey\n /** Token pair of the pool, where token_mint_0 address < token_mint_1 address */\n tokenMint0: PublicKey\n tokenMint1: PublicKey\n /** Token pair vault */\n tokenVault0: PublicKey\n tokenVault1: PublicKey\n /** observation account key */\n observationKey: PublicKey\n /** mint0 and mint1 decimals */\n mintDecimals0: number\n mintDecimals1: number\n /** The minimum number of ticks between initialized ticks */\n tickSpacing: number\n /** The currently in range liquidity available to the pool. */\n liquidity: BN\n /** The current price of the pool as a sqrt(token_1/token_0) Q64.64 value */\n sqrtPriceX64: BN\n /** The current tick of the pool, i.e. according to the last tick transition that was run. */\n tickCurrent: number\n /** the most-recently updated index of the observations array */\n observationIndex: number\n observationUpdateDuration: number\n /**\n * The fee growth as a Q64.64 number, i.e. fees of token_0 and token_1 collected per\n * unit of liquidity for the entire life of the pool.\n */\n feeGrowthGlobal0X64: BN\n feeGrowthGlobal1X64: BN\n /** The amounts of token_0 and token_1 that are owed to the protocol. */\n protocolFeesToken0: BN\n protocolFeesToken1: BN\n /** The amounts in and out of swap token_0 and token_1 */\n swapInAmountToken0: BN\n swapOutAmountToken1: BN\n swapInAmountToken1: BN\n swapOutAmountToken0: BN\n /**\n * Bitwise representation of the state of the pool\n * bit0, 1: disable open position and increase liquidity, 0: normal\n * bit1, 1: disable decrease liquidity, 0: normal\n * bit2, 1: disable collect fee, 0: normal\n * bit3, 1: disable collect reward, 0: normal\n * bit4, 1: disable swap, 0: normal\n */\n status: number\n /** Leave blank for future use */\n padding: Array<number>\n rewardInfos: Array<types.RewardInfoFields>\n /** Packed initialized tick array state */\n tickArrayBitmap: Array<BN>\n /** except protocol_fee and fund_fee */\n totalFeesToken0: BN\n /** except protocol_fee and fund_fee */\n totalFeesClaimedToken0: BN\n totalFeesToken1: BN\n totalFeesClaimedToken1: BN\n fundFeesToken0: BN\n fundFeesToken1: BN\n openTime: BN\n padding1: Array<BN>\n padding2: Array<BN>\n}\n\nexport interface PoolStateJSON {\n /** Bump to identify PDA */\n bump: number\n ammConfig: string\n owner: string\n /** Token pair of the pool, where token_mint_0 address < token_mint_1 address */\n tokenMint0: string\n tokenMint1: string\n /** Token pair vault */\n tokenVault0: string\n tokenVault1: string\n /** observation account key */\n observationKey: string\n /** mint0 and mint1 decimals */\n mintDecimals0: number\n mintDecimals1: number\n /** The minimum number of ticks between initialized ticks */\n tickSpacing: number\n /** The currently in range liquidity available to the pool. */\n liquidity: string\n /** The current price of the pool as a sqrt(token_1/token_0) Q64.64 value */\n sqrtPriceX64: string\n /** The current tick of the pool, i.e. according to the last tick transition that was run. */\n tickCurrent: number\n /** the most-recently updated index of the observations array */\n observationIndex: number\n observationUpdateDuration: number\n /**\n * The fee growth as a Q64.64 number, i.e. fees of token_0 and token_1 collected per\n * unit of liquidity for the entire life of the pool.\n */\n feeGrowthGlobal0X64: string\n feeGrowthGlobal1X64: string\n /** The amounts of token_0 and token_1 that are owed to the protocol. */\n protocolFeesToken0: string\n protocolFeesToken1: string\n /** The amounts in and out of swap token_0 and token_1 */\n swapInAmountToken0: string\n swapOutAmountToken1: string\n swapInAmountToken1: string\n swapOutAmountToken0: string\n /**\n * Bitwise representation of the state of the pool\n * bit0, 1: disable open position and increase liquidity, 0: normal\n * bit1, 1: disable decrease liquidity, 0: normal\n * bit2, 1: disable collect fee, 0: normal\n * bit3, 1: disable collect reward, 0: normal\n * bit4, 1: disable swap, 0: normal\n */\n status: number\n /** Leave blank for future use */\n padding: Array<number>\n rewardInfos: Array<types.RewardInfoJSON>\n /** Packed initialized tick array state */\n tickArrayBitmap: Array<string>\n /** except protocol_fee and fund_fee */\n totalFeesToken0: string\n /** except protocol_fee and fund_fee */\n totalFeesClaimedToken0: string\n totalFeesToken1: string\n totalFeesClaimedToken1: string\n fundFeesToken0: string\n fundFeesToken1: string\n openTime: string\n padding1: Array<string>\n padding2: Array<string>\n}\n\nexport class PoolState {\n /** Bump to identify PDA */\n readonly bump: number\n readonly ammConfig: PublicKey\n readonly owner: PublicKey\n /** Token pair of the pool, where token_mint_0 address < token_mint_1 address */\n readonly tokenMint0: PublicKey\n readonly tokenMint1: PublicKey\n /** Token pair vault */\n readonly tokenVault0: PublicKey\n readonly tokenVault1: PublicKey\n /** observation account key */\n readonly observationKey: PublicKey\n /** mint0 and mint1 decimals */\n readonly mintDecimals0: number\n readonly mintDecimals1: number\n /** The minimum number of ticks between initialized ticks */\n readonly tickSpacing: number\n /** The currently in range liquidity available to the pool. */\n readonly liquidity: BN\n /** The current price of the pool as a sqrt(token_1/token_0) Q64.64 value */\n readonly sqrtPriceX64: BN\n /** The current tick of the pool, i.e. according to the last tick transition that was run. */\n readonly tickCurrent: number\n /** the most-recently updated index of the observations array */\n readonly observationIndex: number\n readonly observationUpdateDuration: number\n /**\n * The fee growth as a Q64.64 number, i.e. fees of token_0 and token_1 collected per\n * unit of liquidity for the entire life of the pool.\n */\n readonly feeGrowthGlobal0X64: BN\n readonly feeGrowthGlobal1X64: BN\n /** The amounts of token_0 and token_1 that are owed to the protocol. */\n readonly protocolFeesToken0: BN\n readonly protocolFeesToken1: BN\n /** The amounts in and out of swap token_0 and token_1 */\n readonly swapInAmountToken0: BN\n readonly swapOutAmountToken1: BN\n readonly swapInAmountToken1: BN\n readonly swapOutAmountToken0: BN\n /**\n * Bitwise representation of the state of the pool\n * bit0, 1: disable open position and increase liquidity, 0: normal\n * bit1, 1: disable decrease liquidity, 0: normal\n * bit2, 1: disable collect fee, 0: normal\n * bit3, 1: disable collect reward, 0: normal\n * bit4, 1: disable swap, 0: normal\n */\n readonly status: number\n /** Leave blank for future use */\n readonly padding: Array<number>\n readonly rewardInfos: Array<types.RewardInfo>\n /** Packed initialized tick array state */\n readonly tickArrayBitmap: Array<BN>\n /** except protocol_fee and fund_fee */\n readonly totalFeesToken0: BN\n /** except protocol_fee and fund_fee */\n readonly totalFeesClaimedToken0: BN\n readonly totalFeesToken1: BN\n readonly totalFeesClaimedToken1: BN\n readonly fundFeesToken0: BN\n readonly fundFeesToken1: BN\n readonly openTime: BN\n readonly padding1: Array<BN>\n readonly padding2: Array<BN>\n\n static readonly discriminator = Buffer.from([\n 247, 237, 227, 245, 215, 195, 222, 70,\n ])\n\n static readonly layout = borsh.struct([\n borsh.u8(\"bump\"),\n borsh.publicKey(\"ammConfig\"),\n borsh.publicKey(\"owner\"),\n borsh.publicKey(\"tokenMint0\"),\n borsh.publicKey(\"tokenMint1\"),\n borsh.publicKey(\"tokenVault0\"),\n borsh.publicKey(\"tokenVault1\"),\n borsh.publicKey(\"observationKey\"),\n borsh.u8(\"mintDecimals0\"),\n borsh.u8(\"mintDecimals1\"),\n borsh.u16(\"tickSpacing\"),\n borsh.u128(\"liquidity\"),\n borsh.u128(\"sqrtPriceX64\"),\n borsh.i32(\"tickCurrent\"),\n borsh.u16(\"observationIndex\"),\n borsh.u16(\"observationUpdateDuration\"),\n borsh.u128(\"feeGrowthGlobal0X64\"),\n borsh.u128(\"feeGrowthGlobal1X64\"),\n borsh.u64(\"protocolFeesToken0\"),\n borsh.u64(\"protocolFeesToken1\"),\n borsh.u128(\"swapInAmountToken0\"),\n borsh.u128(\"swapOutAmountToken1\"),\n borsh.u128(\"swapInAmountToken1\"),\n borsh.u128(\"swapOutAmountToken0\"),\n borsh.u8(\"status\"),\n borsh.array(borsh.u8(), 7, \"padding\"),\n borsh.array(types.RewardInfo.layout(), 3, \"rewardInfos\"),\n borsh.array(borsh.u64(), 16, \"tickArrayBitmap\"),\n borsh.u64(\"totalFeesToken0\"),\n borsh.u64(\"totalFeesClaimedToken0\"),\n borsh.u64(\"totalFeesToken1\"),\n borsh.u64(\"totalFeesClaimedToken1\"),\n borsh.u64(\"fundFeesToken0\"),\n borsh.u64(\"fundFeesToken1\"),\n borsh.u64(\"openTime\"),\n borsh.array(borsh.u64(), 25, \"padding1\"),\n borsh.array(borsh.u64(), 32, \"padding2\"),\n ])\n\n constructor(fields: PoolStateFields) {\n this.bump = fields.bump\n this.ammConfig = fields.ammConfig\n this.owner = fields.owner\n this.tokenMint0 = fields.tokenMint0\n this.tokenMint1 = fields.tokenMint1\n this.tokenVault0 = fields.tokenVault0\n this.tokenVault1 = fields.tokenVault1\n this.observationKey = fields.observationKey\n this.mintDecimals0 = fields.mintDecimals0\n this.mintDecimals1 = fields.mintDecimals1\n this.tickSpacing = fields.tickSpacing\n this.liquidity = fields.liquidity\n this.sqrtPriceX64 = fields.sqrtPriceX64\n this.tickCurrent = fields.tickCurrent\n this.observationIndex = fields.observationIndex\n this.observationUpdateDuration = fields.observationUpdateDuration\n this.feeGrowthGlobal0X64 = fields.feeGrowthGlobal0X64\n this.feeGrowthGlobal1X64 = fields.feeGrowthGlobal1X64\n this.protocolFeesToken0 = fields.protocolFeesToken0\n this.protocolFeesToken1 = fields.protocolFeesToken1\n this.swapInAmountToken0 = fields.swapInAmountToken0\n this.swapOutAmountToken1 = fields.swapOutAmountToken1\n this.swapInAmountToken1 = fields.swapInAmountToken1\n this.swapOutAmountToken0 = fields.swapOutAmountToken0\n this.status = fields.status\n this.padding = fields.padding\n this.rewardInfos = fields.rewardInfos.map(\n (item) => new types.RewardInfo({ ...item })\n )\n this.tickArrayBitmap = fields.tickArrayBitmap\n this.totalFeesToken0 = fields.totalFeesToken0\n this.totalFeesClaimedToken0 = fields.totalFeesClaimedToken0\n this.totalFeesToken1 = fields.totalFeesToken1\n this.totalFeesClaimedToken1 = fields.totalFeesClaimedToken1\n this.fundFeesToken0 = fields.fundFeesToken0\n this.fundFeesToken1 = fields.fundFeesToken1\n this.openTime = fields.openTime\n this.padding1 = fields.padding1\n this.padding2 = fields.padding2\n }\n\n static async fetch(\n c: Connection,\n address: PublicKey,\n programId: PublicKey = PROGRAM_ID\n ): Promise<PoolState | null> {\n const info = await c.getAccountInfo(address)\n\n if (info === null) {\n return null\n }\n if (!info.owner.equals(programId)) {\n throw new Error(\"account doesn't belong to this program\")\n }\n\n return this.decode(info.data)\n }\n\n static async fetchMultiple(\n c: Connection,\n addresses: PublicKey[],\n programId: PublicKey = PROGRAM_ID\n ): Promise<Array<PoolState | null>> {\n const infos = await c.getMultipleAccountsInfo(addresses)\n\n return infos.map((info) => {\n if (info === null) {\n return null\n }\n if (!info.owner.equals(programId)) {\n throw new Error(\"account doesn't belong to this program\")\n }\n\n return this.decode(info.data)\n })\n }\n\n static decode(data: Buffer): PoolState {\n if (!data.slice(0, 8).equals(PoolState.discriminator)) {\n throw new Error(\"invalid account discriminator\")\n }\n\n const dec = PoolState.layout.decode(data.slice(8))\n\n return new PoolState({\n bump: dec.bump,\n ammConfig: dec.ammConfig,\n owner: dec.owner,\n tokenMint0: dec.tokenMint0,\n tokenMint1: dec.tokenMint1,\n tokenVault0: dec.tokenVault0,\n tokenVault1: dec.tokenVault1,\n observationKey: dec.observationKey,\n mintDecimals0: dec.mintDecimals0,\n mintDecimals1: dec.mintDecimals1,\n tickSpacing: dec.tickSpacing,\n liquidity: dec.liquidity,\n sqrtPriceX64: dec.sqrtPriceX64,\n tickCurrent: dec.tickCurrent,\n observationIndex: dec.observationIndex,\n observationUpdateDuration: dec.observationUpdateDuration,\n feeGrowthGlobal0X64: dec.feeGrowthGlobal0X64,\n feeGrowthGlobal1X64: dec.feeGrowthGlobal1X64,\n protocolFeesToken0: dec.protocolFeesToken0,\n protocolFeesToken1: dec.protocolFeesToken1,\n swapInAmountToken0: dec.swapInAmountToken0,\n swapOutAmountToken1: dec.swapOutAmountToken1,\n swapInAmountToken1: dec.swapInAmountToken1,\n swapOutAmountToken0: dec.swapOutAmountToken0,\n status: dec.status,\n padding: dec.padding,\n rewardInfos: dec.rewardInfos.map(\n (\n item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */\n ) => types.RewardInfo.fromDecoded(item)\n ),\n tickArrayBitmap: dec.tickArrayBitmap,\n totalFeesToken0: dec.totalFeesToken0,\n totalFeesClaimedToken0: dec.totalFeesClaimedToken0,\n totalFeesToken1: dec.totalFeesToken1,\n totalFeesClaimedToken1: dec.totalFeesClaimedToken1,\n fundFeesToken0: dec.fundFeesToken0,\n fundFeesToken1: dec.fundFeesToken1,\n openTime: dec.openTime,\n padding1: dec.padding1,\n padding2: dec.padding2,\n })\n }\n\n toJSON(): PoolStateJSON {\n return {\n bump: this.bump,\n ammConfig: this.ammConfig.toString(),\n owner: this.owner.toString(),\n tokenMint0: this.tokenMint0.toString(),\n tokenMint1: this.tokenMint1.toString(),\n tokenVault0: this.tokenVault0.toString(),\n tokenVault1: this.tokenVault1.toString(),\n observationKey: this.observationKey.toString(),\n mintDecimals0: this.mintDecimals0,\n mintDecimals1: this.mintDecimals1,\n tickSpacing: this.tickSpacing,\n liquidity: this.liquidity.toString(),\n sqrtPriceX64: this.sqrtPriceX64.toString(),\n tickCurrent: this.tickCurrent,\n observationIndex: this.observationIndex,\n observationUpdateDuration: this.observationUpdateDuration,\n feeGrowthGlobal0X64: this.feeGrowthGlobal0X64.toString(),\n feeGrowthGlobal1X64: this.feeGrowthGlobal1X64.toString(),\n protocolFeesToken0: this.protocolFeesToken0.toString(),\n protocolFeesToken1: this.protocolFeesToken1.toString(),\n swapInAmountToken0: this.swapInAmountToken0.toString(),\n swapOutAmountToken1: this.swapOutAmountToken1.toString(),\n swapInAmountToken1: this.swapInAmountToken1.toString(),\n swapOutAmountToken0: this.swapOutAmountToken0.toString(),\n status: this.status,\n padding: this.padding,\n rewardInfos: this.rewardInfos.map((item) => item.toJSON()),\n tickArrayBitmap: this.tickArrayBitmap.map((item) => item.toString()),\n totalFeesToken0: this.totalFeesToken0.toString(),\n totalFeesClaimedToken0: this.totalFeesClaimedToken0.toString(),\n totalFeesToken1: this.totalFeesToken1.toString(),\n totalFeesClaimedToken1: this.totalFeesClaimedToken1.toString(),\n fundFeesToken0: this.fundFeesToken0.toString(),\n fundFeesToken1: this.fundFeesToken1.toString(),\n openTime: this.openTime.toString(),\n padding1: this.padding1.map((item) => item.toString()),\n padding2: this.padding2.map((item) => item.toString()),\n }\n }\n\n static fromJSON(obj: PoolStateJSON): PoolState {\n return new PoolState({\n bump: obj.bump,\n ammConfig: new PublicKey(obj.ammConfig),\n owner: new PublicKey(obj.owner),\n tokenMint0: new PublicKey(obj.tokenMint0),\n tokenMint1: new PublicKey(obj.tokenMint1),\n tokenVault0: new PublicKey(obj.tokenVault0),\n tokenVault1: new PublicKey(obj.tokenVault1),\n observationKey: new PublicKey(obj.observationKey),\n mintDecimals0: obj.mintDecimals0,\n mintDecimals1: obj.mintDecimals1,\n tickSpacing: obj.tickSpacing,\n liquidity: new BN(obj.liquidity),\n sqrtPriceX64: new BN(obj.sqrtPriceX64),\n tickCurrent: obj.tickCurrent,\n observationIndex: obj.observationIndex,\n observationUpdateDuration: obj.observationUpdateDuration,\n feeGrowthGlobal0X64: new BN(obj.feeGrowthGlobal0X64),\n feeGrowthGlobal1X64: new BN(obj.feeGrowthGlobal1X64),\n protocolFeesToken0: new BN(obj.protocolFeesToken0),\n protocolFeesToken1: new BN(obj.protocolFeesToken1),\n swapInAmountToken0: new BN(obj.swapInAmountToken0),\n swapOutAmountToken1: new BN(obj.swapOutAmountToken1),\n swapInAmountToken1: new BN(obj.swapInAmountToken1),\n swapOutAmountToken0: new BN(obj.swapOutAmountToken0),\n status: obj.status,\n padding: obj.padding,\n rewardInfos: obj.rewardInfos.map((item) =>\n types.RewardInfo.fromJSON(item)\n ),\n tickArrayBitmap: obj.tickArrayBitmap.map((item) => new BN(item)),\n totalFeesToken0: new BN(obj.totalFeesToken0),\n totalFeesClaimedToken0: new BN(obj.totalFeesClaimedToken0),\n totalFeesToken1: new BN(obj.totalFeesToken1),\n totalFeesClaimedToken1: new BN(obj.totalFeesClaimedToken1),\n fundFeesToken0: new BN(obj.fundFeesToken0),\n fundFeesToken1: new BN(obj.fundFeesToken1),\n openTime: new BN(obj.openTime),\n padding1: obj.padding1.map((item) => new BN(item)),\n padding2: obj.padding2.map((item) => new BN(item)),\n })\n }\n}\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { PublicKey, Connection } from "@solana/web3.js";
|
|
2
|
+
import BN from "bn.js";
|
|
3
|
+
import * as types from "../types";
|
|
4
|
+
export interface PositionFields {
|
|
5
|
+
whirlpool: PublicKey;
|
|
6
|
+
positionMint: PublicKey;
|
|
7
|
+
liquidity: BN;
|
|
8
|
+
tickLowerIndex: number;
|
|
9
|
+
tickUpperIndex: number;
|
|
10
|
+
feeGrowthCheckpointA: BN;
|
|
11
|
+
feeOwedA: BN;
|
|
12
|
+
feeGrowthCheckpointB: BN;
|
|
13
|
+
feeOwedB: BN;
|
|
14
|
+
rewardInfos: Array<types.PositionRewardInfoFields>;
|
|
15
|
+
}
|
|
16
|
+
export interface PositionJSON {
|
|
17
|
+
whirlpool: string;
|
|
18
|
+
positionMint: string;
|
|
19
|
+
liquidity: string;
|
|
20
|
+
tickLowerIndex: number;
|
|
21
|
+
tickUpperIndex: number;
|
|
22
|
+
feeGrowthCheckpointA: string;
|
|
23
|
+
feeOwedA: string;
|
|
24
|
+
feeGrowthCheckpointB: string;
|
|
25
|
+
feeOwedB: string;
|
|
26
|
+
rewardInfos: Array<types.PositionRewardInfoJSON>;
|
|
27
|
+
}
|
|
28
|
+
export declare class Position {
|
|
29
|
+
readonly whirlpool: PublicKey;
|
|
30
|
+
readonly positionMint: PublicKey;
|
|
31
|
+
readonly liquidity: BN;
|
|
32
|
+
readonly tickLowerIndex: number;
|
|
33
|
+
readonly tickUpperIndex: number;
|
|
34
|
+
readonly feeGrowthCheckpointA: BN;
|
|
35
|
+
readonly feeOwedA: BN;
|
|
36
|
+
readonly feeGrowthCheckpointB: BN;
|
|
37
|
+
readonly feeOwedB: BN;
|
|
38
|
+
readonly rewardInfos: Array<types.PositionRewardInfo>;
|
|
39
|
+
static readonly discriminator: Buffer;
|
|
40
|
+
static readonly layout: any;
|
|
41
|
+
constructor(fields: PositionFields);
|
|
42
|
+
static fetch(c: Connection, address: PublicKey, programId?: PublicKey): Promise<Position | null>;
|
|
43
|
+
static fetchMultiple(c: Connection, addresses: PublicKey[], programId?: PublicKey): Promise<Array<Position | null>>;
|
|
44
|
+
static decode(data: Buffer): Position;
|
|
45
|
+
toJSON(): PositionJSON;
|
|
46
|
+
static fromJSON(obj: PositionJSON): Position;
|
|
47
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.Position = void 0;
|
|
39
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
40
|
+
const bn_js_1 = __importDefault(require("bn.js")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
41
|
+
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
42
|
+
const types = __importStar(require("../types")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
43
|
+
const programId_1 = require("../programId");
|
|
44
|
+
class Position {
|
|
45
|
+
constructor(fields) {
|
|
46
|
+
this.whirlpool = fields.whirlpool;
|
|
47
|
+
this.positionMint = fields.positionMint;
|
|
48
|
+
this.liquidity = fields.liquidity;
|
|
49
|
+
this.tickLowerIndex = fields.tickLowerIndex;
|
|
50
|
+
this.tickUpperIndex = fields.tickUpperIndex;
|
|
51
|
+
this.feeGrowthCheckpointA = fields.feeGrowthCheckpointA;
|
|
52
|
+
this.feeOwedA = fields.feeOwedA;
|
|
53
|
+
this.feeGrowthCheckpointB = fields.feeGrowthCheckpointB;
|
|
54
|
+
this.feeOwedB = fields.feeOwedB;
|
|
55
|
+
this.rewardInfos = fields.rewardInfos.map((item) => new types.PositionRewardInfo(Object.assign({}, item)));
|
|
56
|
+
}
|
|
57
|
+
static fetch(c_1, address_1) {
|
|
58
|
+
return __awaiter(this, arguments, void 0, function* (c, address, programId = programId_1.PROGRAM_ID) {
|
|
59
|
+
const info = yield c.getAccountInfo(address);
|
|
60
|
+
if (info === null) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
if (!info.owner.equals(programId)) {
|
|
64
|
+
throw new Error("account doesn't belong to this program");
|
|
65
|
+
}
|
|
66
|
+
return this.decode(info.data);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
static fetchMultiple(c_1, addresses_1) {
|
|
70
|
+
return __awaiter(this, arguments, void 0, function* (c, addresses, programId = programId_1.PROGRAM_ID) {
|
|
71
|
+
const infos = yield c.getMultipleAccountsInfo(addresses);
|
|
72
|
+
return infos.map((info) => {
|
|
73
|
+
if (info === null) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
if (!info.owner.equals(programId)) {
|
|
77
|
+
throw new Error("account doesn't belong to this program");
|
|
78
|
+
}
|
|
79
|
+
return this.decode(info.data);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
static decode(data) {
|
|
84
|
+
if (!data.slice(0, 8).equals(Position.discriminator)) {
|
|
85
|
+
throw new Error("invalid account discriminator");
|
|
86
|
+
}
|
|
87
|
+
const dec = Position.layout.decode(data.slice(8));
|
|
88
|
+
return new Position({
|
|
89
|
+
whirlpool: dec.whirlpool,
|
|
90
|
+
positionMint: dec.positionMint,
|
|
91
|
+
liquidity: dec.liquidity,
|
|
92
|
+
tickLowerIndex: dec.tickLowerIndex,
|
|
93
|
+
tickUpperIndex: dec.tickUpperIndex,
|
|
94
|
+
feeGrowthCheckpointA: dec.feeGrowthCheckpointA,
|
|
95
|
+
feeOwedA: dec.feeOwedA,
|
|
96
|
+
feeGrowthCheckpointB: dec.feeGrowthCheckpointB,
|
|
97
|
+
feeOwedB: dec.feeOwedB,
|
|
98
|
+
rewardInfos: dec.rewardInfos.map((item /* eslint-disable-line @typescript-eslint/no-explicit-any */) => types.PositionRewardInfo.fromDecoded(item)),
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
toJSON() {
|
|
102
|
+
return {
|
|
103
|
+
whirlpool: this.whirlpool.toString(),
|
|
104
|
+
positionMint: this.positionMint.toString(),
|
|
105
|
+
liquidity: this.liquidity.toString(),
|
|
106
|
+
tickLowerIndex: this.tickLowerIndex,
|
|
107
|
+
tickUpperIndex: this.tickUpperIndex,
|
|
108
|
+
feeGrowthCheckpointA: this.feeGrowthCheckpointA.toString(),
|
|
109
|
+
feeOwedA: this.feeOwedA.toString(),
|
|
110
|
+
feeGrowthCheckpointB: this.feeGrowthCheckpointB.toString(),
|
|
111
|
+
feeOwedB: this.feeOwedB.toString(),
|
|
112
|
+
rewardInfos: this.rewardInfos.map((item) => item.toJSON()),
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
static fromJSON(obj) {
|
|
116
|
+
return new Position({
|
|
117
|
+
whirlpool: new web3_js_1.PublicKey(obj.whirlpool),
|
|
118
|
+
positionMint: new web3_js_1.PublicKey(obj.positionMint),
|
|
119
|
+
liquidity: new bn_js_1.default(obj.liquidity),
|
|
120
|
+
tickLowerIndex: obj.tickLowerIndex,
|
|
121
|
+
tickUpperIndex: obj.tickUpperIndex,
|
|
122
|
+
feeGrowthCheckpointA: new bn_js_1.default(obj.feeGrowthCheckpointA),
|
|
123
|
+
feeOwedA: new bn_js_1.default(obj.feeOwedA),
|
|
124
|
+
feeGrowthCheckpointB: new bn_js_1.default(obj.feeGrowthCheckpointB),
|
|
125
|
+
feeOwedB: new bn_js_1.default(obj.feeOwedB),
|
|
126
|
+
rewardInfos: obj.rewardInfos.map((item) => types.PositionRewardInfo.fromJSON(item)),
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.Position = Position;
|
|
131
|
+
Position.discriminator = Buffer.from([
|
|
132
|
+
170, 188, 143, 228, 122, 64, 247, 208,
|
|
133
|
+
]);
|
|
134
|
+
Position.layout = borsh.struct([
|
|
135
|
+
borsh.publicKey("whirlpool"),
|
|
136
|
+
borsh.publicKey("positionMint"),
|
|
137
|
+
borsh.u128("liquidity"),
|
|
138
|
+
borsh.i32("tickLowerIndex"),
|
|
139
|
+
borsh.i32("tickUpperIndex"),
|
|
140
|
+
borsh.u128("feeGrowthCheckpointA"),
|
|
141
|
+
borsh.u64("feeOwedA"),
|
|
142
|
+
borsh.u128("feeGrowthCheckpointB"),
|
|
143
|
+
borsh.u64("feeOwedB"),
|
|
144
|
+
borsh.array(types.PositionRewardInfo.layout(), 3, "rewardInfos"),
|
|
145
|
+
]);
|
|
146
|
+
//# sourceMappingURL=Position.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Position.js","sourceRoot":"","sources":["../../../src/kamino-client/accounts/Position.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAuD;AACvD,kDAAsB,CAAC,wDAA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ACtD,QAAQ,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;YAC9B,oBAAoB,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,oBAAoB,CAAC;YACtD,QAAQ,EAAE,IAAI,eAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;YAC9B,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACxC,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CACxC;SACF,CAAC,CAAA;IACJ,CAAC;;AAvIH,4BAwIC;AA5HiB,sBAAa,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1C,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG;CACtC,CAAC,CAAA;AAEc,eAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IACpC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;IAC5B,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IAC/B,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC;IACvB,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAC3B,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAClC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC;IACrB,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAClC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC;IACrB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,aAAa,CAAC;CACjE,CAAC,CAAA","sourcesContent":["import { PublicKey, Connection } from \"@solana/web3.js\"\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport { PROGRAM_ID } from \"../programId\"\n\nexport interface PositionFields {\n whirlpool: PublicKey\n positionMint: PublicKey\n liquidity: BN\n tickLowerIndex: number\n tickUpperIndex: number\n feeGrowthCheckpointA: BN\n feeOwedA: BN\n feeGrowthCheckpointB: BN\n feeOwedB: BN\n rewardInfos: Array<types.PositionRewardInfoFields>\n}\n\nexport interface PositionJSON {\n whirlpool: string\n positionMint: string\n liquidity: string\n tickLowerIndex: number\n tickUpperIndex: number\n feeGrowthCheckpointA: string\n feeOwedA: string\n feeGrowthCheckpointB: string\n feeOwedB: string\n rewardInfos: Array<types.PositionRewardInfoJSON>\n}\n\nexport class Position {\n readonly whirlpool: PublicKey\n readonly positionMint: PublicKey\n readonly liquidity: BN\n readonly tickLowerIndex: number\n readonly tickUpperIndex: number\n readonly feeGrowthCheckpointA: BN\n readonly feeOwedA: BN\n readonly feeGrowthCheckpointB: BN\n readonly feeOwedB: BN\n readonly rewardInfos: Array<types.PositionRewardInfo>\n\n static readonly discriminator = Buffer.from([\n 170, 188, 143, 228, 122, 64, 247, 208,\n ])\n\n static readonly layout = borsh.struct([\n borsh.publicKey(\"whirlpool\"),\n borsh.publicKey(\"positionMint\"),\n borsh.u128(\"liquidity\"),\n borsh.i32(\"tickLowerIndex\"),\n borsh.i32(\"tickUpperIndex\"),\n borsh.u128(\"feeGrowthCheckpointA\"),\n borsh.u64(\"feeOwedA\"),\n borsh.u128(\"feeGrowthCheckpointB\"),\n borsh.u64(\"feeOwedB\"),\n borsh.array(types.PositionRewardInfo.layout(), 3, \"rewardInfos\"),\n ])\n\n constructor(fields: PositionFields) {\n this.whirlpool = fields.whirlpool\n this.positionMint = fields.positionMint\n this.liquidity = fields.liquidity\n this.tickLowerIndex = fields.tickLowerIndex\n this.tickUpperIndex = fields.tickUpperIndex\n this.feeGrowthCheckpointA = fields.feeGrowthCheckpointA\n this.feeOwedA = fields.feeOwedA\n this.feeGrowthCheckpointB = fields.feeGrowthCheckpointB\n this.feeOwedB = fields.feeOwedB\n this.rewardInfos = fields.rewardInfos.map(\n (item) => new types.PositionRewardInfo({ ...item })\n )\n }\n\n static async fetch(\n c: Connection,\n address: PublicKey,\n programId: PublicKey = PROGRAM_ID\n ): Promise<Position | null> {\n const info = await c.getAccountInfo(address)\n\n if (info === null) {\n return null\n }\n if (!info.owner.equals(programId)) {\n throw new Error(\"account doesn't belong to this program\")\n }\n\n return this.decode(info.data)\n }\n\n static async fetchMultiple(\n c: Connection,\n addresses: PublicKey[],\n programId: PublicKey = PROGRAM_ID\n ): Promise<Array<Position | null>> {\n const infos = await c.getMultipleAccountsInfo(addresses)\n\n return infos.map((info) => {\n if (info === null) {\n return null\n }\n if (!info.owner.equals(programId)) {\n throw new Error(\"account doesn't belong to this program\")\n }\n\n return this.decode(info.data)\n })\n }\n\n static decode(data: Buffer): Position {\n if (!data.slice(0, 8).equals(Position.discriminator)) {\n throw new Error(\"invalid account discriminator\")\n }\n\n const dec = Position.layout.decode(data.slice(8))\n\n return new Position({\n whirlpool: dec.whirlpool,\n positionMint: dec.positionMint,\n liquidity: dec.liquidity,\n tickLowerIndex: dec.tickLowerIndex,\n tickUpperIndex: dec.tickUpperIndex,\n feeGrowthCheckpointA: dec.feeGrowthCheckpointA,\n feeOwedA: dec.feeOwedA,\n feeGrowthCheckpointB: dec.feeGrowthCheckpointB,\n feeOwedB: dec.feeOwedB,\n rewardInfos: dec.rewardInfos.map(\n (\n item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */\n ) => types.PositionRewardInfo.fromDecoded(item)\n ),\n })\n }\n\n toJSON(): PositionJSON {\n return {\n whirlpool: this.whirlpool.toString(),\n positionMint: this.positionMint.toString(),\n liquidity: this.liquidity.toString(),\n tickLowerIndex: this.tickLowerIndex,\n tickUpperIndex: this.tickUpperIndex,\n feeGrowthCheckpointA: this.feeGrowthCheckpointA.toString(),\n feeOwedA: this.feeOwedA.toString(),\n feeGrowthCheckpointB: this.feeGrowthCheckpointB.toString(),\n feeOwedB: this.feeOwedB.toString(),\n rewardInfos: this.rewardInfos.map((item) => item.toJSON()),\n }\n }\n\n static fromJSON(obj: PositionJSON): Position {\n return new Position({\n whirlpool: new PublicKey(obj.whirlpool),\n positionMint: new PublicKey(obj.positionMint),\n liquidity: new BN(obj.liquidity),\n tickLowerIndex: obj.tickLowerIndex,\n tickUpperIndex: obj.tickUpperIndex,\n feeGrowthCheckpointA: new BN(obj.feeGrowthCheckpointA),\n feeOwedA: new BN(obj.feeOwedA),\n feeGrowthCheckpointB: new BN(obj.feeGrowthCheckpointB),\n feeOwedB: new BN(obj.feeOwedB),\n rewardInfos: obj.rewardInfos.map((item) =>\n types.PositionRewardInfo.fromJSON(item)\n ),\n })\n }\n}\n"]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { PublicKey, Connection } from "@solana/web3.js";
|
|
2
|
+
import BN from "bn.js";
|
|
3
|
+
export interface ProtocolPositionStateFields {
|
|
4
|
+
/** Bump to identify PDA */
|
|
5
|
+
bump: number;
|
|
6
|
+
/** The ID of the pool with which this token is connected */
|
|
7
|
+
poolId: PublicKey;
|
|
8
|
+
/** The lower bound tick of the position */
|
|
9
|
+
tickLowerIndex: number;
|
|
10
|
+
/** The upper bound tick of the position */
|
|
11
|
+
tickUpperIndex: number;
|
|
12
|
+
/** The amount of liquidity owned by this position */
|
|
13
|
+
liquidity: BN;
|
|
14
|
+
/** The token_0 fee growth per unit of liquidity as of the last update to liquidity or fees owed */
|
|
15
|
+
feeGrowthInside0LastX64: BN;
|
|
16
|
+
/** The token_1 fee growth per unit of liquidity as of the last update to liquidity or fees owed */
|
|
17
|
+
feeGrowthInside1LastX64: BN;
|
|
18
|
+
/** The fees owed to the position owner in token_0 */
|
|
19
|
+
tokenFeesOwed0: BN;
|
|
20
|
+
/** The fees owed to the position owner in token_1 */
|
|
21
|
+
tokenFeesOwed1: BN;
|
|
22
|
+
/** The reward growth per unit of liquidity as of the last update to liquidity */
|
|
23
|
+
rewardGrowthInside: Array<BN>;
|
|
24
|
+
padding: Array<BN>;
|
|
25
|
+
}
|
|
26
|
+
export interface ProtocolPositionStateJSON {
|
|
27
|
+
/** Bump to identify PDA */
|
|
28
|
+
bump: number;
|
|
29
|
+
/** The ID of the pool with which this token is connected */
|
|
30
|
+
poolId: string;
|
|
31
|
+
/** The lower bound tick of the position */
|
|
32
|
+
tickLowerIndex: number;
|
|
33
|
+
/** The upper bound tick of the position */
|
|
34
|
+
tickUpperIndex: number;
|
|
35
|
+
/** The amount of liquidity owned by this position */
|
|
36
|
+
liquidity: string;
|
|
37
|
+
/** The token_0 fee growth per unit of liquidity as of the last update to liquidity or fees owed */
|
|
38
|
+
feeGrowthInside0LastX64: string;
|
|
39
|
+
/** The token_1 fee growth per unit of liquidity as of the last update to liquidity or fees owed */
|
|
40
|
+
feeGrowthInside1LastX64: string;
|
|
41
|
+
/** The fees owed to the position owner in token_0 */
|
|
42
|
+
tokenFeesOwed0: string;
|
|
43
|
+
/** The fees owed to the position owner in token_1 */
|
|
44
|
+
tokenFeesOwed1: string;
|
|
45
|
+
/** The reward growth per unit of liquidity as of the last update to liquidity */
|
|
46
|
+
rewardGrowthInside: Array<string>;
|
|
47
|
+
padding: Array<string>;
|
|
48
|
+
}
|
|
49
|
+
export declare class ProtocolPositionState {
|
|
50
|
+
/** Bump to identify PDA */
|
|
51
|
+
readonly bump: number;
|
|
52
|
+
/** The ID of the pool with which this token is connected */
|
|
53
|
+
readonly poolId: PublicKey;
|
|
54
|
+
/** The lower bound tick of the position */
|
|
55
|
+
readonly tickLowerIndex: number;
|
|
56
|
+
/** The upper bound tick of the position */
|
|
57
|
+
readonly tickUpperIndex: number;
|
|
58
|
+
/** The amount of liquidity owned by this position */
|
|
59
|
+
readonly liquidity: BN;
|
|
60
|
+
/** The token_0 fee growth per unit of liquidity as of the last update to liquidity or fees owed */
|
|
61
|
+
readonly feeGrowthInside0LastX64: BN;
|
|
62
|
+
/** The token_1 fee growth per unit of liquidity as of the last update to liquidity or fees owed */
|
|
63
|
+
readonly feeGrowthInside1LastX64: BN;
|
|
64
|
+
/** The fees owed to the position owner in token_0 */
|
|
65
|
+
readonly tokenFeesOwed0: BN;
|
|
66
|
+
/** The fees owed to the position owner in token_1 */
|
|
67
|
+
readonly tokenFeesOwed1: BN;
|
|
68
|
+
/** The reward growth per unit of liquidity as of the last update to liquidity */
|
|
69
|
+
readonly rewardGrowthInside: Array<BN>;
|
|
70
|
+
readonly padding: Array<BN>;
|
|
71
|
+
static readonly discriminator: Buffer;
|
|
72
|
+
static readonly layout: any;
|
|
73
|
+
constructor(fields: ProtocolPositionStateFields);
|
|
74
|
+
static fetch(c: Connection, address: PublicKey, programId?: PublicKey): Promise<ProtocolPositionState | null>;
|
|
75
|
+
static fetchMultiple(c: Connection, addresses: PublicKey[], programId?: PublicKey): Promise<Array<ProtocolPositionState | null>>;
|
|
76
|
+
static decode(data: Buffer): ProtocolPositionState;
|
|
77
|
+
toJSON(): ProtocolPositionStateJSON;
|
|
78
|
+
static fromJSON(obj: ProtocolPositionStateJSON): ProtocolPositionState;
|
|
79
|
+
}
|