@magmaprotocol/magma-clmm-sdk 0.5.15 → 0.5.17
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 +33 -20
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1590,6 +1590,37 @@ type PokeParams = {
|
|
|
1590
1590
|
lockId: SuiObjectIdType;
|
|
1591
1591
|
};
|
|
1592
1592
|
|
|
1593
|
+
type DepositPosition = {
|
|
1594
|
+
poolId: string;
|
|
1595
|
+
positionId: string;
|
|
1596
|
+
coinTypeA: string;
|
|
1597
|
+
coinTypeB: string;
|
|
1598
|
+
};
|
|
1599
|
+
type WithdrawPosition = {
|
|
1600
|
+
poolId: string;
|
|
1601
|
+
positionId: string;
|
|
1602
|
+
coinTypeA: string;
|
|
1603
|
+
coinTypeB: string;
|
|
1604
|
+
};
|
|
1605
|
+
type EpochEmission = {
|
|
1606
|
+
emission: number | string;
|
|
1607
|
+
rebase: number | string;
|
|
1608
|
+
total_supply: number | string;
|
|
1609
|
+
total_locked: number | string;
|
|
1610
|
+
};
|
|
1611
|
+
type StakedPositionOfPool = {
|
|
1612
|
+
coin_type_a: string;
|
|
1613
|
+
coin_type_b: string;
|
|
1614
|
+
liquidity: string;
|
|
1615
|
+
tick_lower_index: number;
|
|
1616
|
+
tick_upper_index: number;
|
|
1617
|
+
pos_object_id: string;
|
|
1618
|
+
magma_distribution_staked: boolean;
|
|
1619
|
+
pool: string;
|
|
1620
|
+
earned: string;
|
|
1621
|
+
name: string;
|
|
1622
|
+
};
|
|
1623
|
+
|
|
1593
1624
|
type BigNumber = Decimal.Value | number | string;
|
|
1594
1625
|
|
|
1595
1626
|
interface IModule {
|
|
@@ -3289,31 +3320,13 @@ declare class RpcModule extends SuiClient {
|
|
|
3289
3320
|
sendSimulationTransaction(tx: Transaction, simulationAccount: string, useDevInspect?: boolean): Promise<DevInspectResults | undefined>;
|
|
3290
3321
|
}
|
|
3291
3322
|
|
|
3292
|
-
type DepositPosition = {
|
|
3293
|
-
poolId: string;
|
|
3294
|
-
positionId: string;
|
|
3295
|
-
coinTypeA: string;
|
|
3296
|
-
coinTypeB: string;
|
|
3297
|
-
};
|
|
3298
|
-
type WithdrawPosition = {
|
|
3299
|
-
poolId: string;
|
|
3300
|
-
positionId: string;
|
|
3301
|
-
coinTypeA: string;
|
|
3302
|
-
coinTypeB: string;
|
|
3303
|
-
};
|
|
3304
|
-
type EpochEmission = {
|
|
3305
|
-
emission: number | string;
|
|
3306
|
-
rebase: number | string;
|
|
3307
|
-
total_supply: number | string;
|
|
3308
|
-
total_locked: number | string;
|
|
3309
|
-
};
|
|
3310
3323
|
declare class GaugeModule implements IModule {
|
|
3311
3324
|
protected _sdk: MagmaClmmSDK;
|
|
3312
3325
|
constructor(sdk: MagmaClmmSDK);
|
|
3313
3326
|
get sdk(): MagmaClmmSDK;
|
|
3314
3327
|
depositPosition(params: DepositPosition): Promise<Transaction>;
|
|
3315
3328
|
withdrawPosition(params: WithdrawPosition): Promise<Transaction>;
|
|
3316
|
-
getUserStakedPositionInfo(userAddr: string): Promise<
|
|
3329
|
+
getUserStakedPositionInfo(userAddr: string): Promise<StakedPositionOfPool[]>;
|
|
3317
3330
|
getUserStakedPositionInfoOfPool(userAddr: string, pool: string, gauger: string, poolCoinA: string, poolCoinB: string): Promise<any[]>;
|
|
3318
3331
|
getPoolGaguers(): Promise<Map<string, string>>;
|
|
3319
3332
|
getPoolCoins(pools: string[]): Promise<Map<string, string[]>>;
|
|
@@ -4045,4 +4058,4 @@ interface InitMagmaSDKOptions {
|
|
|
4045
4058
|
*/
|
|
4046
4059
|
declare function initMagmaSDK(options: InitMagmaSDKOptions): MagmaClmmSDK;
|
|
4047
4060
|
|
|
4048
|
-
export { AMM_SWAP_MODULE, AddBribeReward, AddLiquidityCommonParams, AddLiquidityFixTokenParams, AddLiquidityParams, AddLiquidityWithProtectionParams, AddressAndDirection, AdjustResult, AggregatorResult, AmountSpecified, BasePath, BigNumber, 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, 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, FEE_RATE_DENOMINATOR, FaucetCoin, FetchParams, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, Gauge, IncreaseLockAmountParams, IncreaseUnlockTimeParams, LaunchpadPoolConfig, LiquidityInput, LockModule, LockPermanentParams, MAX_SQRT_PRICE, MAX_TICK_INDEX, MIN_SQRT_PRICE, MIN_TICK_INDEX, MagmaClmmSDK, MagmaConfigs, MathUtil, MergeLockParams, Minter, NFT, ONE, OnePath, OpenPositionAddLiquidityWithProtectionParams, OpenPositionParams, Order, POOL_STRUCT, Package, PageQuery, PaginationArgs, PathLink, PathProvider, Percentage, PokeParams, Pool, PoolImmutables, PoolInfo, PoolModule, Position, PositionModule, PositionReward, PositionStatus, PositionUtil, PreRouterSwapParams, PreSwapLpChangeParams, PreSwapParams, PreSwapResult, PreSwapWithMultiPoolParams, PriceResult, RemoveLiquidityParams, RewardDistributor, Rewarder, RewarderAmountOwed, RouterModule, RouterModuleV2, RpcModule, SUI_SYSTEM_STATE_OBJECT_ID, SdkOptions, SplitPath, SplitSwap, SplitSwapResult, SplitUnit, 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, VoteParams, Voter, VotingEscrow, ZERO, addHexPrefix, adjustForCoinSlippage, adjustForSlippage, asIntN, asUintN, 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, getDefaultSuiInputType, getDeltaA, getDeltaB, getDeltaDownFromOutput, getDeltaUpFromInput, getFutureTime, getLiquidityFromCoinA, getLiquidityFromCoinB, getLowerSqrtPriceFromCoinA, getLowerSqrtPriceFromCoinB, getMoveObject, getMoveObjectType, getMovePackageContent, getNearestTickByTick, getNextSqrtPriceAUp, getNextSqrtPriceBDown, getNextSqrtPriceFromInput, getNextSqrtPriceFromOutput, getObjectDeletedResponse, getObjectDisplay, getObjectFields, getObjectId, getObjectNotExistsResponse, getObjectOwner, getObjectPreviousTransactionDigest, getObjectReference, getObjectType, getObjectVersion, getPackagerConfigs, getRewardInTickRange, getSuiObjectData, getTickDataFromUrlData, getUpperSqrtPriceFromCoinA, getUpperSqrtPriceFromCoinB, hasPublicTransfer, hexToNumber, hexToString, initMagmaSDK, initMainnetSDK, initTestnetSDK, isSortedSymbols, isSuiObjectResponse, newBits, normalizeCoinType, patchFixSuiObjectId, printTransaction, removeHexPrefix, secretKeyToEd25519Keypair, secretKeyToSecp256k1Keypair, shortAddress, shortString, tickScore, toBuffer, toCoinAmount, toDecimalsAmount, transClmmpoolDataWithoutTicks, utf8to16 };
|
|
4061
|
+
export { AMM_SWAP_MODULE, AddBribeReward, AddLiquidityCommonParams, AddLiquidityFixTokenParams, AddLiquidityParams, AddLiquidityWithProtectionParams, AddressAndDirection, AdjustResult, AggregatorResult, AmountSpecified, BasePath, BigNumber, 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, 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, FEE_RATE_DENOMINATOR, FaucetCoin, FetchParams, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, Gauge, IncreaseLockAmountParams, IncreaseUnlockTimeParams, LaunchpadPoolConfig, LiquidityInput, LockModule, LockPermanentParams, MAX_SQRT_PRICE, MAX_TICK_INDEX, MIN_SQRT_PRICE, MIN_TICK_INDEX, MagmaClmmSDK, MagmaConfigs, MathUtil, MergeLockParams, Minter, NFT, ONE, OnePath, OpenPositionAddLiquidityWithProtectionParams, OpenPositionParams, Order, POOL_STRUCT, Package, PageQuery, PaginationArgs, PathLink, PathProvider, Percentage, PokeParams, Pool, PoolImmutables, PoolInfo, PoolModule, Position, PositionModule, PositionReward, PositionStatus, PositionUtil, PreRouterSwapParams, PreSwapLpChangeParams, PreSwapParams, PreSwapResult, PreSwapWithMultiPoolParams, PriceResult, RemoveLiquidityParams, RewardDistributor, Rewarder, RewarderAmountOwed, RouterModule, RouterModuleV2, RpcModule, SUI_SYSTEM_STATE_OBJECT_ID, SdkOptions, SplitPath, SplitSwap, SplitSwapResult, SplitUnit, StakedPositionOfPool, 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, VoteParams, Voter, VotingEscrow, WithdrawPosition, ZERO, addHexPrefix, adjustForCoinSlippage, adjustForSlippage, asIntN, asUintN, 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, getDefaultSuiInputType, getDeltaA, getDeltaB, getDeltaDownFromOutput, getDeltaUpFromInput, getFutureTime, getLiquidityFromCoinA, getLiquidityFromCoinB, getLowerSqrtPriceFromCoinA, getLowerSqrtPriceFromCoinB, getMoveObject, getMoveObjectType, getMovePackageContent, getNearestTickByTick, getNextSqrtPriceAUp, getNextSqrtPriceBDown, getNextSqrtPriceFromInput, getNextSqrtPriceFromOutput, getObjectDeletedResponse, getObjectDisplay, getObjectFields, getObjectId, getObjectNotExistsResponse, getObjectOwner, getObjectPreviousTransactionDigest, getObjectReference, getObjectType, getObjectVersion, getPackagerConfigs, getRewardInTickRange, getSuiObjectData, getTickDataFromUrlData, getUpperSqrtPriceFromCoinA, getUpperSqrtPriceFromCoinB, hasPublicTransfer, hexToNumber, hexToString, initMagmaSDK, initMainnetSDK, initTestnetSDK, isSortedSymbols, isSuiObjectResponse, newBits, normalizeCoinType, patchFixSuiObjectId, printTransaction, removeHexPrefix, secretKeyToEd25519Keypair, secretKeyToSecp256k1Keypair, shortAddress, shortString, tickScore, toBuffer, toCoinAmount, toDecimalsAmount, transClmmpoolDataWithoutTicks, utf8to16 };
|
package/dist/index.js
CHANGED
|
@@ -7843,7 +7843,7 @@ var LockModule = class {
|
|
|
7843
7843
|
sender: simulationAccount.address
|
|
7844
7844
|
});
|
|
7845
7845
|
if (simulateRes.error != null) {
|
|
7846
|
-
throw new Error(`
|
|
7846
|
+
throw new Error(`getPoolBribeRewardTokens error code: ${simulateRes.error ?? "unknown error"}`);
|
|
7847
7847
|
}
|
|
7848
7848
|
const poolBirbeRewardTokens = /* @__PURE__ */ new Map();
|
|
7849
7849
|
simulateRes.events?.forEach((item) => {
|
|
@@ -9280,10 +9280,13 @@ var GaugeModule = class {
|
|
|
9280
9280
|
coin_type_a: coins[0],
|
|
9281
9281
|
coin_type_b: coins[1],
|
|
9282
9282
|
liquidity: info.info.liquidity,
|
|
9283
|
-
tick_lower_index: info.info.tick_lower_index.bits,
|
|
9284
|
-
tick_upper_index: info.info.tick_upper_index.bits,
|
|
9283
|
+
tick_lower_index: asIntN(BigInt(info.info.tick_lower_index.bits)),
|
|
9284
|
+
tick_upper_index: asIntN(BigInt(info.info.tick_upper_index.bits)),
|
|
9285
9285
|
pos_object_id: info.info.position_id,
|
|
9286
|
-
|
|
9286
|
+
magma_distribution_staked: info.info.magma_distribution_staked,
|
|
9287
|
+
pool: info.pool_id,
|
|
9288
|
+
earned: info.earned,
|
|
9289
|
+
name: info.name
|
|
9287
9290
|
});
|
|
9288
9291
|
});
|
|
9289
9292
|
});
|
|
@@ -9330,7 +9333,7 @@ var GaugeModule = class {
|
|
|
9330
9333
|
sender: simulationAccount.address
|
|
9331
9334
|
});
|
|
9332
9335
|
if (simulateRes.error != null) {
|
|
9333
|
-
throw new Error(`
|
|
9336
|
+
throw new Error(`getPoolGaguers error code: ${simulateRes.error ?? "unknown error"}`);
|
|
9334
9337
|
}
|
|
9335
9338
|
const poolGauger = /* @__PURE__ */ new Map();
|
|
9336
9339
|
simulateRes.events?.forEach((item) => {
|