@magmaprotocol/magma-clmm-sdk 0.5.65 → 0.5.67
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 +9 -5
- package/dist/index.d.ts +26 -10
- package/dist/index.js +232 -331
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +238 -332
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ Our SDK now includes a default initialization method that allows for quick gener
|
|
|
43
43
|
```typescript
|
|
44
44
|
import { initMagmaSDK } from '@magmaprotocol/magma-clmm-sdk'
|
|
45
45
|
|
|
46
|
-
const magmaClmmSDK = initMagmaSDK({network: 'mainnet'})
|
|
46
|
+
const magmaClmmSDK = initMagmaSDK({ network: 'mainnet' })
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
If you wish to set your own full node URL and simulate address, you can do so as follows:
|
|
@@ -51,24 +51,28 @@ If you wish to set your own full node URL and simulate address, you can do so as
|
|
|
51
51
|
```typescript
|
|
52
52
|
import { initMagmaSDK } from '@magmaprotocol/magma-clmm-sdk'
|
|
53
53
|
|
|
54
|
-
const network = 'mainnnet'
|
|
55
|
-
const fullNodeUrl =
|
|
56
|
-
const simulationAccount =
|
|
57
|
-
const magmaClmmSDK = initMagmaSDK({network, fullNodeUrl, simulationAccount})
|
|
54
|
+
const network = 'mainnnet'
|
|
55
|
+
const fullNodeUrl = 'https://...'
|
|
56
|
+
const simulationAccount = '0x...'
|
|
57
|
+
const magmaClmmSDK = initMagmaSDK({ network, fullNodeUrl, simulationAccount })
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
Now, you can start using Magma SDK.
|
|
61
61
|
|
|
62
62
|
### Typrscript Doc
|
|
63
|
+
|
|
63
64
|
You can view this typescript sdk in
|
|
64
65
|
<a href="https://github.com/MagmaFinanceIO/magma_sdk_doc"><strong> Magma Development Documents. </strong></a>
|
|
65
66
|
<br />
|
|
66
67
|
|
|
67
68
|
## LICENSE
|
|
69
|
+
|
|
68
70
|
MAGMA-CLMM-SDK released under the Apache license. See the [LICENSE](./LICENSE) file for details.
|
|
69
71
|
|
|
70
72
|
## More About Magma
|
|
73
|
+
|
|
71
74
|
Use the following links to learn more about Magma:
|
|
75
|
+
|
|
72
76
|
- [ ] Learn more about working with Magma in the [Magma Documentation]().
|
|
73
77
|
|
|
74
78
|
- [ ] Join the Magma community on [Magma Discord]().
|
package/dist/index.d.ts
CHANGED
|
@@ -1832,7 +1832,7 @@ type DlmmCreatePairAddLiquidityParams = {
|
|
|
1832
1832
|
coinTypeA: string;
|
|
1833
1833
|
coinTypeB: string;
|
|
1834
1834
|
activeId: number;
|
|
1835
|
-
|
|
1835
|
+
realIds: number[];
|
|
1836
1836
|
amountsX: number[];
|
|
1837
1837
|
amountsY: number[];
|
|
1838
1838
|
to: string;
|
|
@@ -1851,6 +1851,21 @@ type DlmmPositionInfo = {
|
|
|
1851
1851
|
fees: DlmmEventEarnedFees;
|
|
1852
1852
|
contractPool: DlmmPoolInfo | undefined;
|
|
1853
1853
|
};
|
|
1854
|
+
type MintByStrategyParams = {
|
|
1855
|
+
pair: string;
|
|
1856
|
+
bin_step: number;
|
|
1857
|
+
coinTypeA: string;
|
|
1858
|
+
coinTypeB: string;
|
|
1859
|
+
amountATotal: number;
|
|
1860
|
+
amountBTotal: number;
|
|
1861
|
+
fixCoinA: boolean;
|
|
1862
|
+
fixCoinB: boolean;
|
|
1863
|
+
strategy: number;
|
|
1864
|
+
min_bin: number;
|
|
1865
|
+
max_bin: number;
|
|
1866
|
+
active_bin: number;
|
|
1867
|
+
slippage: number;
|
|
1868
|
+
};
|
|
1854
1869
|
|
|
1855
1870
|
type BigNumber = Decimal.Value | number | string;
|
|
1856
1871
|
|
|
@@ -2401,9 +2416,9 @@ type CollectFeesQuote = {
|
|
|
2401
2416
|
declare function collectFeesQuote(param: CollectFeesQuoteParam): CollectFeesQuote;
|
|
2402
2417
|
|
|
2403
2418
|
declare enum StrategyType {
|
|
2404
|
-
Spot =
|
|
2405
|
-
Curve =
|
|
2406
|
-
BidAsk =
|
|
2419
|
+
Spot = 1,
|
|
2420
|
+
Curve = 2,
|
|
2421
|
+
BidAsk = 3
|
|
2407
2422
|
}
|
|
2408
2423
|
type BinLiquidity = {
|
|
2409
2424
|
ActiveId: number;
|
|
@@ -3725,6 +3740,7 @@ declare class DlmmModule implements IModule {
|
|
|
3725
3740
|
getPoolInfo(pools: string[]): Promise<DlmmPoolInfo[]>;
|
|
3726
3741
|
fetchPairParams(params: FetchPairParams): Promise<EventPairParams>;
|
|
3727
3742
|
createPairPayload(params: CreatePairParams): Promise<Transaction>;
|
|
3743
|
+
mintByStrategy(params: MintByStrategyParams): Promise<Transaction>;
|
|
3728
3744
|
mintPercent(params: MintPercentParams): Promise<Transaction>;
|
|
3729
3745
|
createPositionByAmount(params: MintAmountParams): Promise<Transaction>;
|
|
3730
3746
|
addLiquidity(params: DlmmAddLiquidityParams): Promise<Transaction>;
|
|
@@ -3739,11 +3755,11 @@ declare class DlmmModule implements IModule {
|
|
|
3739
3755
|
swap(params: DLMMSwapParams): Promise<Transaction>;
|
|
3740
3756
|
fetchBins(params: FetchBinsParams): Promise<EventBin[]>;
|
|
3741
3757
|
/**
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3758
|
+
* Gets a list of positions for the given account address.
|
|
3759
|
+
* @param accountAddress The account address to get positions for.
|
|
3760
|
+
* @param assignPoolIds An array of pool IDs to filter the positions by.
|
|
3761
|
+
* @returns array of Position objects.
|
|
3762
|
+
*/
|
|
3747
3763
|
getUserPositionById(positionId: string, showDisplay?: boolean): Promise<DlmmPositionInfo>;
|
|
3748
3764
|
/**
|
|
3749
3765
|
* Gets a list of positions for the given account address.
|
|
@@ -4510,4 +4526,4 @@ interface InitMagmaSDKOptions {
|
|
|
4510
4526
|
*/
|
|
4511
4527
|
declare function initMagmaSDK(options: InitMagmaSDKOptions): MagmaClmmSDK;
|
|
4512
4528
|
|
|
4513
|
-
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, DLMMSwapParams, DataPage, DeepbookClobV2Moudle, DeepbookCustodianV2Moudle, DeepbookEndpointsV2Moudle, DeepbookPool, DeepbookUtils, DepositPosition, DlmmAddLiquidityParams, DlmmBurnPositionParams, DlmmCollectFeeParams, DlmmCollectRewardParams, DlmmConfig, DlmmCreatePairAddLiquidityParams, DlmmEventEarnedFees, DlmmEventEarnedRewards, DlmmEventPairRewardTypes, DlmmPoolInfo, DlmmPosition, DlmmPositionInfo, DlmmRewardsParams, DlmmScript, DlmmShrinkPosition, 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, 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, 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, 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 };
|
|
4529
|
+
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, DLMMSwapParams, DataPage, DeepbookClobV2Moudle, DeepbookCustodianV2Moudle, DeepbookEndpointsV2Moudle, DeepbookPool, DeepbookUtils, DepositPosition, DlmmAddLiquidityParams, DlmmBurnPositionParams, DlmmCollectFeeParams, DlmmCollectRewardParams, DlmmConfig, DlmmCreatePairAddLiquidityParams, DlmmEventEarnedFees, DlmmEventEarnedRewards, DlmmEventPairRewardTypes, DlmmPoolInfo, DlmmPosition, DlmmPositionInfo, DlmmRewardsParams, DlmmScript, DlmmShrinkPosition, 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, 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, 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 };
|