@magmaprotocol/magma-clmm-sdk 0.5.97 → 0.5.100
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/dist/index.d.ts +36 -36
- package/dist/index.js +69 -70
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +68 -69
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ declare const Voter = "voter";
|
|
|
37
37
|
declare const RewardDistributor = "reward_distributor";
|
|
38
38
|
declare const Gauge = "gauge";
|
|
39
39
|
declare const Minter = "minter";
|
|
40
|
-
declare const
|
|
40
|
+
declare const AlmmScript = "almm_script";
|
|
41
41
|
/**
|
|
42
42
|
* The address for CoinInfo module.
|
|
43
43
|
*/
|
|
@@ -452,7 +452,7 @@ type ClmmConfig = {
|
|
|
452
452
|
*/
|
|
453
453
|
partners_id?: SuiObjectIdType;
|
|
454
454
|
};
|
|
455
|
-
type
|
|
455
|
+
type AlmmConfig = {
|
|
456
456
|
factory: SuiObjectIdType;
|
|
457
457
|
rewarder_global_vault: SuiObjectIdType;
|
|
458
458
|
};
|
|
@@ -1667,7 +1667,7 @@ type MintAmountParams = {
|
|
|
1667
1667
|
amountsB: number[];
|
|
1668
1668
|
to: string;
|
|
1669
1669
|
};
|
|
1670
|
-
type
|
|
1670
|
+
type ALMMSwapParams = {
|
|
1671
1671
|
pair: string;
|
|
1672
1672
|
coinTypeA: string;
|
|
1673
1673
|
coinTypeB: string;
|
|
@@ -1745,7 +1745,7 @@ type EventPairLiquidity = {
|
|
|
1745
1745
|
bin_x: number[] | string[];
|
|
1746
1746
|
bin_y: number[] | string[];
|
|
1747
1747
|
};
|
|
1748
|
-
type
|
|
1748
|
+
type AlmmPoolInfo = {
|
|
1749
1749
|
pool_id: string;
|
|
1750
1750
|
bin_step: number;
|
|
1751
1751
|
coin_a: string;
|
|
@@ -1758,7 +1758,7 @@ type DlmmPoolInfo = {
|
|
|
1758
1758
|
coinAmountB: string;
|
|
1759
1759
|
index?: number;
|
|
1760
1760
|
};
|
|
1761
|
-
type
|
|
1761
|
+
type AlmmAddLiquidityParams = {
|
|
1762
1762
|
pool_id: string;
|
|
1763
1763
|
coin_a: string;
|
|
1764
1764
|
coin_b: string;
|
|
@@ -1768,14 +1768,14 @@ type DlmmAddLiquidityParams = {
|
|
|
1768
1768
|
receiver: string;
|
|
1769
1769
|
rewards_token: string[];
|
|
1770
1770
|
};
|
|
1771
|
-
type
|
|
1771
|
+
type AlmmBurnPositionParams = {
|
|
1772
1772
|
pool_id: string;
|
|
1773
1773
|
position_id: string;
|
|
1774
1774
|
coin_a: string;
|
|
1775
1775
|
coin_b: string;
|
|
1776
1776
|
rewards_token: string[];
|
|
1777
1777
|
};
|
|
1778
|
-
type
|
|
1778
|
+
type AlmmShrinkPosition = {
|
|
1779
1779
|
pool_id: string;
|
|
1780
1780
|
position_id: string;
|
|
1781
1781
|
coin_a: string;
|
|
@@ -1783,34 +1783,34 @@ type DlmmShrinkPosition = {
|
|
|
1783
1783
|
delta_percentage: number;
|
|
1784
1784
|
rewards_token: string[];
|
|
1785
1785
|
};
|
|
1786
|
-
type
|
|
1786
|
+
type AlmmCollectRewardParams = {
|
|
1787
1787
|
pool_id: string;
|
|
1788
1788
|
coin_a: string;
|
|
1789
1789
|
coin_b: string;
|
|
1790
1790
|
position_id: string;
|
|
1791
1791
|
rewards_token: string[];
|
|
1792
1792
|
};
|
|
1793
|
-
type
|
|
1793
|
+
type AlmmCollectFeeParams = {
|
|
1794
1794
|
pool_id: string;
|
|
1795
1795
|
coin_a: string;
|
|
1796
1796
|
coin_b: string;
|
|
1797
1797
|
position_id: string;
|
|
1798
1798
|
};
|
|
1799
|
-
type
|
|
1799
|
+
type AlmmRewardsParams = {
|
|
1800
1800
|
pool_id: string;
|
|
1801
1801
|
position_id: string;
|
|
1802
1802
|
coin_a: string;
|
|
1803
1803
|
coin_b: string;
|
|
1804
1804
|
rewards_token: string[];
|
|
1805
1805
|
};
|
|
1806
|
-
type
|
|
1806
|
+
type AlmmEventEarnedFees = {
|
|
1807
1807
|
position_id: string;
|
|
1808
1808
|
x: string;
|
|
1809
1809
|
y: string;
|
|
1810
1810
|
fee_x: number;
|
|
1811
1811
|
fee_y: number;
|
|
1812
1812
|
};
|
|
1813
|
-
type
|
|
1813
|
+
type AlmmEventEarnedRewards = {
|
|
1814
1814
|
position_id: string;
|
|
1815
1815
|
reward: string[];
|
|
1816
1816
|
amount: number[];
|
|
@@ -1820,7 +1820,7 @@ type GetPairRewarderParams = {
|
|
|
1820
1820
|
coin_a: string;
|
|
1821
1821
|
coin_b: string;
|
|
1822
1822
|
};
|
|
1823
|
-
type
|
|
1823
|
+
type AlmmEventPairRewardTypes = {
|
|
1824
1824
|
pair_id: string;
|
|
1825
1825
|
tokens: string[];
|
|
1826
1826
|
};
|
|
@@ -1829,7 +1829,7 @@ type BinDisplay = {
|
|
|
1829
1829
|
amountX: BN;
|
|
1830
1830
|
amountY: BN;
|
|
1831
1831
|
};
|
|
1832
|
-
type
|
|
1832
|
+
type AlmmCreatePairAddLiquidityParams = {
|
|
1833
1833
|
baseFee: number;
|
|
1834
1834
|
binStep: number;
|
|
1835
1835
|
coinTypeA: string;
|
|
@@ -1840,19 +1840,19 @@ type DlmmCreatePairAddLiquidityParams = {
|
|
|
1840
1840
|
amountsY: number[];
|
|
1841
1841
|
to: string;
|
|
1842
1842
|
};
|
|
1843
|
-
type
|
|
1843
|
+
type AlmmPosition = {
|
|
1844
1844
|
pos_object_id: SuiObjectIdType;
|
|
1845
1845
|
owner: SuiObjectIdType;
|
|
1846
1846
|
pool: SuiObjectIdType;
|
|
1847
1847
|
type: SuiAddressType;
|
|
1848
1848
|
bin_real_ids: number[];
|
|
1849
1849
|
};
|
|
1850
|
-
type
|
|
1851
|
-
position:
|
|
1850
|
+
type AlmmPositionInfo = {
|
|
1851
|
+
position: AlmmPosition;
|
|
1852
1852
|
liquidity: EventPositionLiquidity;
|
|
1853
|
-
rewards:
|
|
1854
|
-
fees:
|
|
1855
|
-
contractPool:
|
|
1853
|
+
rewards: AlmmEventEarnedRewards;
|
|
1854
|
+
fees: AlmmEventEarnedFees;
|
|
1855
|
+
contractPool: AlmmPoolInfo | undefined;
|
|
1856
1856
|
};
|
|
1857
1857
|
type MintByStrategyParams = {
|
|
1858
1858
|
pair: string;
|
|
@@ -3765,25 +3765,25 @@ declare class GaugeModule implements IModule {
|
|
|
3765
3765
|
getEpochRewardByPool(pool: string, incentive_tokens: string[]): Promise<Map<string, string>>;
|
|
3766
3766
|
}
|
|
3767
3767
|
|
|
3768
|
-
declare class
|
|
3768
|
+
declare class AlmmModule implements IModule {
|
|
3769
3769
|
protected _sdk: MagmaClmmSDK;
|
|
3770
3770
|
private readonly _cache;
|
|
3771
3771
|
constructor(sdk: MagmaClmmSDK);
|
|
3772
3772
|
get sdk(): MagmaClmmSDK;
|
|
3773
|
-
getPoolInfo(pools: string[]): Promise<
|
|
3773
|
+
getPoolInfo(pools: string[]): Promise<AlmmPoolInfo[]>;
|
|
3774
3774
|
fetchPairParams(params: FetchPairParams): Promise<EventPairParams>;
|
|
3775
3775
|
createPairPayload(params: CreatePairParams): Promise<Transaction>;
|
|
3776
3776
|
mintByStrategy(params: MintByStrategyParams): Promise<Transaction>;
|
|
3777
3777
|
addLiquidityByStrategy(params: RaiseByStrategyParams): Promise<Transaction>;
|
|
3778
3778
|
private _raisePositionByAmounts;
|
|
3779
3779
|
private _raisePositionByAmountsReward;
|
|
3780
|
-
burnPosition(params:
|
|
3781
|
-
shrinkPosition(params:
|
|
3782
|
-
collectFeeAndReward(params:
|
|
3783
|
-
collectReward(params:
|
|
3784
|
-
collectFees(params:
|
|
3785
|
-
createPairAddLiquidity(params:
|
|
3786
|
-
swap(params:
|
|
3780
|
+
burnPosition(params: AlmmBurnPositionParams): Promise<Transaction>;
|
|
3781
|
+
shrinkPosition(params: AlmmShrinkPosition): Promise<Transaction>;
|
|
3782
|
+
collectFeeAndReward(params: AlmmCollectRewardParams & AlmmCollectFeeParams): Promise<Transaction>;
|
|
3783
|
+
collectReward(params: AlmmCollectRewardParams, transaction?: Transaction): Promise<Transaction>;
|
|
3784
|
+
collectFees(params: AlmmCollectFeeParams, transaction?: Transaction): Promise<Transaction>;
|
|
3785
|
+
createPairAddLiquidity(params: AlmmCreatePairAddLiquidityParams): Promise<Transaction>;
|
|
3786
|
+
swap(params: ALMMSwapParams): Promise<Transaction>;
|
|
3787
3787
|
fetchBins(params: FetchBinsParams): Promise<EventBin[]>;
|
|
3788
3788
|
/**
|
|
3789
3789
|
* Gets a list of positions for the given account address.
|
|
@@ -3791,7 +3791,7 @@ declare class DlmmModule implements IModule {
|
|
|
3791
3791
|
* @param assignPoolIds An array of pool IDs to filter the positions by.
|
|
3792
3792
|
* @returns array of Position objects.
|
|
3793
3793
|
*/
|
|
3794
|
-
getUserPositions(accountAddress: string, assignPoolIds?: string[], showDisplay?: boolean): Promise<
|
|
3794
|
+
getUserPositions(accountAddress: string, assignPoolIds?: string[], showDisplay?: boolean): Promise<AlmmPositionInfo[]>;
|
|
3795
3795
|
private buildPosition;
|
|
3796
3796
|
private getPoolCoins;
|
|
3797
3797
|
private buildPositionType;
|
|
@@ -3800,11 +3800,11 @@ declare class DlmmModule implements IModule {
|
|
|
3800
3800
|
private _getPositionLiquidity;
|
|
3801
3801
|
private _parsePositionLiquidity;
|
|
3802
3802
|
getPairLiquidity(params: GetPairLiquidityParams): Promise<EventPairLiquidity>;
|
|
3803
|
-
getEarnedFeesLimit(params:
|
|
3803
|
+
getEarnedFeesLimit(params: AlmmCollectFeeParams[]): Promise<AlmmEventEarnedFees[]>;
|
|
3804
3804
|
private getEarnedFees;
|
|
3805
3805
|
private _getEarnedFees;
|
|
3806
3806
|
private _parseEarnedFees;
|
|
3807
|
-
getEarnedRewards(params:
|
|
3807
|
+
getEarnedRewards(params: AlmmRewardsParams[]): Promise<AlmmEventEarnedRewards[]>;
|
|
3808
3808
|
private _getEarnedRewards;
|
|
3809
3809
|
private _parseEarnedRewards;
|
|
3810
3810
|
getPairRewarders(params: GetPairRewarderParams[]): Promise<Map<string, string[]>>;
|
|
@@ -3866,7 +3866,7 @@ type SdkOptions = {
|
|
|
3866
3866
|
* Package containing Cryptocurrency Liquidity Mining Module (CLMM) pool configurations.
|
|
3867
3867
|
*/
|
|
3868
3868
|
clmm_pool: Package<ClmmConfig>;
|
|
3869
|
-
|
|
3869
|
+
almm_pool: Package<AlmmConfig>;
|
|
3870
3870
|
distribution: Package;
|
|
3871
3871
|
/**
|
|
3872
3872
|
* Package containing integration-related configurations.
|
|
@@ -3915,7 +3915,7 @@ declare class MagmaClmmSDK {
|
|
|
3915
3915
|
*/
|
|
3916
3916
|
protected _lock: LockModule;
|
|
3917
3917
|
protected _gauge: GaugeModule;
|
|
3918
|
-
protected
|
|
3918
|
+
protected _almm: AlmmModule;
|
|
3919
3919
|
/**
|
|
3920
3920
|
* Provide interact with a position rewarder interface.
|
|
3921
3921
|
*/
|
|
@@ -3963,7 +3963,7 @@ declare class MagmaClmmSDK {
|
|
|
3963
3963
|
get Swap(): SwapModule;
|
|
3964
3964
|
get Lock(): LockModule;
|
|
3965
3965
|
get Gauge(): GaugeModule;
|
|
3966
|
-
get
|
|
3966
|
+
get Almm(): AlmmModule;
|
|
3967
3967
|
/**
|
|
3968
3968
|
* Getter for the fullClient property.
|
|
3969
3969
|
* @returns {RpcModule} The fullClient property value.
|
|
@@ -4559,4 +4559,4 @@ interface InitMagmaSDKOptions {
|
|
|
4559
4559
|
*/
|
|
4560
4560
|
declare function initMagmaSDK(options: InitMagmaSDKOptions): MagmaClmmSDK;
|
|
4561
4561
|
|
|
4562
|
-
export { AMM_SWAP_MODULE, AddBribeReward, AddLiquidityCommonParams, AddLiquidityFixTokenParams, AddLiquidityParams, AddLiquidityWithProtectionParams, AddressAndDirection, AdjustResult, AggregatorResult, AmountSpecified, BasePath, BigNumber, BinDisplay, BinLiquidity, BinMath, Bits, BuildCoinResult, CLOCK_ADDRESS, CachedContent, CalculateRatesParams, CalculateRatesResult, ClaimAndLockParams, ClaimFeesParams, ClaimFeesPoolsParams, ClmmConfig, ClmmExpectSwapModule, ClmmFetcherModule, ClmmIntegratePoolModule, ClmmIntegratePoolV2Module, ClmmIntegratePoolV3Module, ClmmIntegrateRouterModule, ClmmIntegrateRouterWithPartnerModule, ClmmIntegrateUtilsModule, ClmmPartnerModule, ClmmPoolConfig, ClmmPoolUtil, ClmmPositionStatus, ClmmpoolData, ClosePositionParams, CoinAmounts, CoinAsset, CoinAssist, CoinConfig, CoinInfoAddress, CoinNode, CoinPairType, CoinProvider, CoinStoreAddress, CollectFeeParams, CollectFeesQuote, CollectFeesQuoteParam, CollectRewarderParams, ConfigModule, CreateLockParams, CreatePairParams, CreatePartnerEvent, CreatePoolAddLiquidityParams, CreatePoolParams, DEFAULT_GAS_BUDGET_FOR_MERGE, DEFAULT_GAS_BUDGET_FOR_SPLIT, DEFAULT_GAS_BUDGET_FOR_STAKE, DEFAULT_GAS_BUDGET_FOR_TRANSFER, DEFAULT_GAS_BUDGET_FOR_TRANSFER_SUI, DEFAULT_NFT_TRANSFER_GAS_FEE,
|
|
4562
|
+
export { ALMMSwapParams, AMM_SWAP_MODULE, AddBribeReward, AddLiquidityCommonParams, AddLiquidityFixTokenParams, AddLiquidityParams, AddLiquidityWithProtectionParams, AddressAndDirection, AdjustResult, AggregatorResult, AlmmAddLiquidityParams, AlmmBurnPositionParams, AlmmCollectFeeParams, AlmmCollectRewardParams, AlmmConfig, AlmmCreatePairAddLiquidityParams, AlmmEventEarnedFees, AlmmEventEarnedRewards, AlmmEventPairRewardTypes, AlmmPoolInfo, AlmmPosition, AlmmPositionInfo, AlmmRewardsParams, AlmmScript, AlmmShrinkPosition, AmountSpecified, BasePath, BigNumber, BinDisplay, BinLiquidity, BinMath, Bits, BuildCoinResult, CLOCK_ADDRESS, CachedContent, CalculateRatesParams, CalculateRatesResult, ClaimAndLockParams, ClaimFeesParams, ClaimFeesPoolsParams, ClmmConfig, ClmmExpectSwapModule, ClmmFetcherModule, ClmmIntegratePoolModule, ClmmIntegratePoolV2Module, ClmmIntegratePoolV3Module, ClmmIntegrateRouterModule, ClmmIntegrateRouterWithPartnerModule, ClmmIntegrateUtilsModule, ClmmPartnerModule, ClmmPoolConfig, ClmmPoolUtil, ClmmPositionStatus, ClmmpoolData, ClosePositionParams, CoinAmounts, CoinAsset, CoinAssist, CoinConfig, CoinInfoAddress, CoinNode, CoinPairType, CoinProvider, CoinStoreAddress, CollectFeeParams, CollectFeesQuote, CollectFeesQuoteParam, CollectRewarderParams, ConfigModule, CreateLockParams, CreatePairParams, CreatePartnerEvent, CreatePoolAddLiquidityParams, CreatePoolParams, DEFAULT_GAS_BUDGET_FOR_MERGE, DEFAULT_GAS_BUDGET_FOR_SPLIT, DEFAULT_GAS_BUDGET_FOR_STAKE, DEFAULT_GAS_BUDGET_FOR_TRANSFER, DEFAULT_GAS_BUDGET_FOR_TRANSFER_SUI, DEFAULT_NFT_TRANSFER_GAS_FEE, DataPage, DeepbookClobV2Moudle, DeepbookCustodianV2Moudle, DeepbookEndpointsV2Moudle, DeepbookPool, DeepbookUtils, DepositPosition, EpochEmission, EventBin, EventPairLiquidity, EventPairParams, EventPositionLiquidity, FEE_RATE_DENOMINATOR, FaucetCoin, FetchBinsParams, FetchPairParams, FetchParams, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, Gauge, GetPairLiquidityParams, GetPairRewarderParams, GetPositionLiquidityParams, GetRewardByPosition, IncreaseLockAmountParams, IncreaseUnlockTimeParams, LaunchpadPoolConfig, LiquidityAndCoinYResult, LiquidityInput, LockModule, LockPermanentParams, LockVoteEvent, MAX_SQRT_PRICE, MAX_TICK_INDEX, MIN_SQRT_PRICE, MIN_TICK_INDEX, MagmaClmmSDK, MagmaConfigs, MathUtil, MergeLockParams, MintAmountParams, MintByStrategyParams, MintPercentParams, Minter, NFT, ONE, OnePath, OpenPositionAddLiquidityWithProtectionParams, OpenPositionParams, Order, POOL_NO_LIQUIDITY, POOL_STRUCT, Package, PageQuery, PaginationArgs, PathLink, PathProvider, Percentage, PokeParams, Pool, PoolImmutables, PoolInfo, PoolModule, Position, PositionModule, PositionReward, PositionStatus, PositionUtil, PreRouterSwapParams, PreSwapLpChangeParams, PreSwapParams, PreSwapResult, PreSwapWithMultiPoolParams, PriceResult, RaiseByStrategyParams, RemoveLiquidityParams, RewardDistributor, Rewarder, RewarderAmountOwed, RouterModule, RouterModuleV2, RpcModule, SUI_SYSTEM_STATE_OBJECT_ID, SdkOptions, SplitPath, SplitSwap, SplitSwapResult, SplitUnit, StakedPositionOfPool, StrategyType, SuiAddressType, SuiBasicTypes, SuiInputTypes, SuiObjectDataWithContent, SuiObjectIdType, SuiResource, SuiStructTag, SuiTxArg, SwapDirection, SwapModule, SwapParams, SwapResult, SwapStepResult, SwapUtils, SwapWithRouterParams, TICK_ARRAY_SIZE, TWO, Tick, TickData, TickMath, TickUtil, TokenConfig, TokenConfigEvent, TokenInfo, TokenModule, TransPreSwapWithMultiPoolParams, TransactionUtil, TransferLockParams, TxBlock, U128, U128_MAX, U64_MAX, Ve33Config, VoteParams, Voter, VotingEscrow, WithdrawPosition, ZERO, addHexPrefix, adjustForCoinSlippage, adjustForSlippage, asIntN, asUintN, autoFillXByStrategy, autoFillXByWeight, autoFillYByStrategy, autoFillYByWeight, bufferToHex, buildClmmPositionName, buildNFT, buildPool, buildPosition, buildPositionReward, buildTickData, buildTickDataByEvent, cacheTime24h, cacheTime5min, checkAddress, checkInvalidSuiAddress, clmmMainnet, clmmTestnet, collectFeesQuote, composeType, computeSwap, computeSwapStep, createSplitAmountArray, createSplitArray, createTestTransferTxPayloadParams, d, decimalsMultiplier, MagmaClmmSDK as default, estPoolAPR, estPosAPRResult, estPositionAPRWithDeltaMethod, estPositionAPRWithMultiMethod, estimateLiquidityForCoinA, estimateLiquidityForCoinB, extractAddressFromType, extractStructTagFromType, findAdjustCoin, fixCoinType, fixSuiObjectId, fromDecimalsAmount, getAmountFixedDelta, getAmountUnfixedDelta, getCoinAFromLiquidity, getCoinBFromLiquidity, getCoinXYForLiquidity, getDefaultSuiInputType, getDeltaA, getDeltaB, getDeltaDownFromOutput, getDeltaUpFromInput, getFutureTime, getLiquidityAndCoinYByCoinX, getLiquidityFromCoinA, getLiquidityFromCoinB, getLowerSqrtPriceFromCoinA, getLowerSqrtPriceFromCoinB, getMoveObject, getMoveObjectType, getMovePackageContent, getNearestTickByTick, getNextSqrtPriceAUp, getNextSqrtPriceBDown, getNextSqrtPriceFromInput, getNextSqrtPriceFromOutput, getObjectDeletedResponse, getObjectDisplay, getObjectFields, getObjectId, getObjectNotExistsResponse, getObjectOwner, getObjectPreviousTransactionDigest, getObjectReference, getObjectType, getObjectVersion, getPackagerConfigs, getPriceOfBinByBinId, getRewardInTickRange, getSuiObjectData, getTickDataFromUrlData, getUpperSqrtPriceFromCoinA, getUpperSqrtPriceFromCoinB, hasPublicTransfer, hexToNumber, hexToString, initMagmaSDK, initMainnetSDK, initTestnetSDK, isSortedSymbols, isSuiObjectResponse, newBits, normalizeCoinType, patchFixSuiObjectId, printTransaction, removeHexPrefix, secretKeyToEd25519Keypair, secretKeyToSecp256k1Keypair, shortAddress, shortString, tickScore, toAmountAskSide, toAmountBidSide, toAmountBothSide, toAmountsBothSideByStrategy, toBuffer, toCoinAmount, toDecimalsAmount, transClmmpoolDataWithoutTicks, utf8to16, withLiquiditySlippage };
|