@raydium-io/raydium-sdk-v2 0.2.6-alpha → 0.2.7-alpha
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/lib/api/api.d.ts +1 -1
- package/lib/api/index.d.ts +1 -1
- package/lib/api/type.d.ts +1 -1
- package/lib/{api-c81dd6be.d.ts → api-92e9adc3.d.ts} +3 -3
- package/lib/common/accountInfo.d.ts +1 -1
- package/lib/common/bignumber.d.ts +1 -1
- package/lib/common/constant.d.ts +1 -1
- package/lib/common/fractionUtil.d.ts +1 -1
- package/lib/common/index.d.ts +1 -1
- package/lib/common/transfer.d.ts +1 -1
- package/lib/common/txTool/txTool.d.ts +1 -1
- package/lib/common/txTool/txUtils.d.ts +1 -1
- package/lib/common/utility.d.ts +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/module/amount.d.ts +1 -1
- package/lib/module/fraction.d.ts +1 -1
- package/lib/module/index.d.ts +1 -1
- package/lib/module/percent.d.ts +1 -1
- package/lib/module/price.d.ts +1 -1
- package/lib/raydium/account/account.d.ts +3 -3
- package/lib/raydium/account/index.d.ts +1 -1
- package/lib/raydium/account/instruction.d.ts +1 -1
- package/lib/raydium/account/types.d.ts +1 -1
- package/lib/raydium/account/util.d.ts +1 -1
- package/lib/raydium/clmm/clmm.d.ts +3 -3
- package/lib/raydium/clmm/index.d.ts +3 -3
- package/lib/raydium/clmm/instrument.d.ts +2 -2
- package/lib/raydium/clmm/layout.d.ts +5 -5
- package/lib/raydium/clmm/type.d.ts +2 -2
- package/lib/raydium/clmm/utils/math.d.ts +2 -2
- package/lib/raydium/clmm/utils/pool.d.ts +2 -2
- package/lib/raydium/clmm/utils/position.d.ts +2 -2
- package/lib/raydium/clmm/utils/tick.d.ts +2 -2
- package/lib/raydium/clmm/utils/tickQuery.d.ts +2 -2
- package/lib/raydium/clmm/utils/tickarrayBitmap.d.ts +2 -2
- package/lib/raydium/cpmm/cpmm.d.ts +3 -3
- package/lib/raydium/cpmm/cpmm.js +1 -1
- package/lib/raydium/cpmm/cpmm.js.map +1 -1
- package/lib/raydium/cpmm/cpmm.mjs +1 -1
- package/lib/raydium/cpmm/cpmm.mjs.map +1 -1
- package/lib/raydium/cpmm/curve/calculator.d.ts +1 -1
- package/lib/raydium/cpmm/curve/constantProduct.d.ts +1 -1
- package/lib/raydium/cpmm/index.d.ts +1 -1
- package/lib/raydium/cpmm/instruction.d.ts +1 -1
- package/lib/raydium/cpmm/type.d.ts +1 -1
- package/lib/raydium/farm/config.d.ts +1 -1
- package/lib/raydium/farm/farm.d.ts +3 -3
- package/lib/raydium/farm/index.d.ts +1 -1
- package/lib/raydium/farm/instruction.d.ts +1 -1
- package/lib/raydium/farm/layout.d.ts +1 -1
- package/lib/raydium/farm/type.d.ts +1 -1
- package/lib/raydium/farm/util.d.ts +1 -1
- package/lib/raydium/ido/ido.d.ts +3 -3
- package/lib/raydium/ido/index.d.ts +3 -3
- package/lib/raydium/ido/instruction.d.ts +1 -1
- package/lib/raydium/ido/type.d.ts +1 -1
- package/lib/raydium/index.d.ts +3 -3
- package/lib/raydium/index.js +1 -1
- package/lib/raydium/index.js.map +1 -1
- package/lib/raydium/index.mjs +1 -1
- package/lib/raydium/index.mjs.map +1 -1
- package/lib/raydium/launchpad/curve/curve.d.ts +1 -1
- package/lib/raydium/launchpad/index.d.ts +3 -3
- package/lib/raydium/launchpad/launchpad.d.ts +3 -3
- package/lib/raydium/launchpad/layout.d.ts +2 -2
- package/lib/raydium/launchpad/pda.d.ts +1 -1
- package/lib/raydium/launchpad/type.d.ts +1 -1
- package/lib/raydium/liquidity/index.d.ts +1 -1
- package/lib/raydium/liquidity/instruction.d.ts +1 -1
- package/lib/raydium/liquidity/liquidity.d.ts +3 -3
- package/lib/raydium/liquidity/type.d.ts +1 -1
- package/lib/raydium/liquidity/utils.d.ts +1 -1
- package/lib/raydium/marketV2/createMarket.d.ts +3 -3
- package/lib/raydium/marketV2/index.d.ts +3 -3
- package/lib/raydium/moduleBase.d.ts +3 -3
- package/lib/raydium/raydium.d.ts +3 -3
- package/lib/raydium/raydium.js +1 -1
- package/lib/raydium/raydium.js.map +1 -1
- package/lib/raydium/raydium.mjs +1 -1
- package/lib/raydium/raydium.mjs.map +1 -1
- package/lib/raydium/token/constant.d.ts +1 -1
- package/lib/raydium/token/index.d.ts +1 -1
- package/lib/raydium/token/token.d.ts +3 -3
- package/lib/raydium/token/type.d.ts +1 -1
- package/lib/raydium/token/utils.d.ts +1 -1
- package/lib/raydium/tradeV2/index.d.ts +2 -2
- package/lib/raydium/tradeV2/instrument.d.ts +2 -2
- package/lib/raydium/tradeV2/trade.d.ts +3 -3
- package/lib/raydium/tradeV2/type.d.ts +2 -2
- package/lib/raydium/type.d.ts +1 -1
- package/lib/raydium/utils1216/index.d.ts +3 -3
- package/lib/raydium/utils1216/utils1216.d.ts +3 -3
- package/lib/{raydium-0ce2c946.d.ts → raydium-bd752ae1.d.ts} +2 -2
- package/lib/{type-dabc7a99.d.ts → type-f95c297a.d.ts} +1 -1
- package/package.json +1 -1
- package/src/raydium/cpmm/cpmm.ts +70 -65
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { SOL_INFO, TOKEN_WSOL } from './constant.js';
|
|
2
2
|
export { SPL_MINT_LAYOUT, SplMintLayout } from './layout.js';
|
|
3
|
-
export { bN as LpToken, bM as SplToken, bK as TokenInfo, bL as TokenJson } from '../../api-
|
|
3
|
+
export { bN as LpToken, bM as SplToken, bK as TokenInfo, bL as TokenJson } from '../../api-92e9adc3.js';
|
|
4
4
|
export { parseTokenInfo, solToWSolToken, toApiV3Token, toFeeConfig, toToken, toTokenAmount, toTokenInfo, wSolToSolToken } from './utils.js';
|
|
5
5
|
import 'axios';
|
|
6
6
|
import '../../solana/type.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@solana/web3.js';
|
|
2
|
-
import '../../api-
|
|
3
|
-
export { n as default } from '../../raydium-
|
|
2
|
+
import '../../api-92e9adc3.js';
|
|
3
|
+
export { n as default } from '../../raydium-bd752ae1.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import '../../solana/type.js';
|
|
6
6
|
import 'bn.js';
|
|
@@ -22,7 +22,7 @@ import '../liquidity/stable.js';
|
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
23
|
import '../liquidity/layout.js';
|
|
24
24
|
import '../clmm/layout.js';
|
|
25
|
-
import '../../type-
|
|
25
|
+
import '../../type-f95c297a.js';
|
|
26
26
|
import '../cpmm/type.js';
|
|
27
27
|
import '../cpmm/curve/calculator.js';
|
|
28
28
|
import '../cpmm/layout.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { bN as LpToken, bM as SplToken, bK as TokenInfo, bL as TokenJson } from '../../api-
|
|
1
|
+
export { bN as LpToken, bM as SplToken, bK as TokenInfo, bL as TokenJson } from '../../api-92e9adc3.js';
|
|
2
2
|
import '../../module/token.js';
|
|
3
3
|
import 'axios';
|
|
4
4
|
import '../../solana/type.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { RawMint, TransferFeeConfigLayout } from '@solana/spl-token';
|
|
3
|
-
import { bK as TokenInfo, af as BigNumberish, ce as TokenAmount, i as ApiV3Token } from '../../api-
|
|
3
|
+
import { bK as TokenInfo, af as BigNumberish, ce as TokenAmount, i as ApiV3Token } from '../../api-92e9adc3.js';
|
|
4
4
|
import { Token } from '../../module/token.js';
|
|
5
5
|
import 'axios';
|
|
6
6
|
import '../../solana/type.js';
|
|
@@ -2,7 +2,7 @@ export { ApiSwapV1Out, makeSwapInstruction, route1Instruction, route2Instruction
|
|
|
2
2
|
export { BasicPoolInfo, ComputeAmountOutAmmLayout, ComputeAmountOutLayout, ComputeAmountOutRouteLayout, ComputePoolType, ComputeRoutePathType, MakeSwapInstructionParam, PoolAccountInfoV4, ReturnTypeFetchMultipleInfo, ReturnTypeGetAddLiquidityDefaultPool, ReturnTypeGetAllRoute, ReturnTypeMakeSwapInstruction, ReturnTypeMakeSwapTransaction, RoutePathType } from './type.js';
|
|
3
3
|
import '@solana/web3.js';
|
|
4
4
|
import 'bn.js';
|
|
5
|
-
import '../../api-
|
|
5
|
+
import '../../api-92e9adc3.js';
|
|
6
6
|
import 'axios';
|
|
7
7
|
import '../../solana/type.js';
|
|
8
8
|
import '@solana/spl-token';
|
|
@@ -17,7 +17,7 @@ import '../../common/logger.js';
|
|
|
17
17
|
import '../../module/currency.js';
|
|
18
18
|
import '../../marshmallow/index.js';
|
|
19
19
|
import '../../marshmallow/buffer-layout.js';
|
|
20
|
-
import '../../type-
|
|
20
|
+
import '../../type-f95c297a.js';
|
|
21
21
|
import '../clmm/layout.js';
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
23
|
import '../liquidity/layout.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
|
|
2
2
|
import BN__default from 'bn.js';
|
|
3
|
-
import { s as ApiV3PoolInfoItem, G as PoolKeys } from '../../api-
|
|
3
|
+
import { s as ApiV3PoolInfoItem, G as PoolKeys } from '../../api-92e9adc3.js';
|
|
4
4
|
import { ComputePoolType, MakeSwapInstructionParam, ReturnTypeMakeSwapInstruction } from './type.js';
|
|
5
5
|
import 'axios';
|
|
6
6
|
import '../../solana/type.js';
|
|
@@ -16,7 +16,7 @@ import '../../common/logger.js';
|
|
|
16
16
|
import '../../module/currency.js';
|
|
17
17
|
import '../../marshmallow/index.js';
|
|
18
18
|
import '../../marshmallow/buffer-layout.js';
|
|
19
|
-
import '../../type-
|
|
19
|
+
import '../../type-f95c297a.js';
|
|
20
20
|
import '../clmm/layout.js';
|
|
21
21
|
import '../liquidity/type.js';
|
|
22
22
|
import '../liquidity/layout.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import '@solana/web3.js';
|
|
2
2
|
import 'bn.js';
|
|
3
|
-
import '../../api-
|
|
3
|
+
import '../../api-92e9adc3.js';
|
|
4
4
|
import '../../common/txTool/txType.js';
|
|
5
|
-
export { l as default } from '../../raydium-
|
|
6
|
-
import '../../type-
|
|
5
|
+
export { l as default } from '../../raydium-bd752ae1.js';
|
|
6
|
+
import '../../type-f95c297a.js';
|
|
7
7
|
import '../liquidity/type.js';
|
|
8
8
|
import '../cpmm/type.js';
|
|
9
9
|
import './type.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PublicKey, Keypair, Signer, TransactionInstruction, Transaction } from '@solana/web3.js';
|
|
2
2
|
import BN__default from 'bn.js';
|
|
3
3
|
import Decimal from 'decimal.js';
|
|
4
|
-
import { bX as TransferAmountFee, ce as TokenAmount, G as PoolKeys, s as ApiV3PoolInfoItem } from '../../api-
|
|
4
|
+
import { bX as TransferAmountFee, ce as TokenAmount, G as PoolKeys, s as ApiV3PoolInfoItem } from '../../api-92e9adc3.js';
|
|
5
5
|
import { Token } from '../../module/token.js';
|
|
6
|
-
import { d as ComputeClmmPoolInfo } from '../../type-
|
|
6
|
+
import { d as ComputeClmmPoolInfo } from '../../type-f95c297a.js';
|
|
7
7
|
import { ComputeAmountOutParam } from '../liquidity/type.js';
|
|
8
8
|
import { CpmmComputeData } from '../cpmm/type.js';
|
|
9
9
|
import 'axios';
|
package/lib/raydium/type.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@solana/web3.js';
|
|
2
2
|
import 'bn.js';
|
|
3
3
|
import '@solana/spl-token';
|
|
4
|
-
export { c3 as ArrayItem, bU as ComputeBudgetConfig, ca as Cover, c4 as ExactPartial, c5 as ExactRequired, c9 as Fallback, bY as GetTransferAmountFee, c7 as GetValue, bT as InstructionReturn, bW as LoadParams, bS as MakeMultiTransaction, bQ as MakeTransaction, bR as MakeV0Transaction, c0 as MayArray, c1 as MayDeepArray, c2 as MayFunction, b$ as ReplaceType, bZ as ReturnTypeFetchMultipleMintInfo, b_ as ReturnTypeFetchMultipleMintInfos, bO as ReturnTypeMakeInstructions, c6 as SKeyof, c8 as SOR, bP as SignAllTransactions, bX as TransferAmountFee, bV as TxTipConfig, cb as UnionCover, cc as unionArr } from '../api-
|
|
4
|
+
export { c3 as ArrayItem, bU as ComputeBudgetConfig, ca as Cover, c4 as ExactPartial, c5 as ExactRequired, c9 as Fallback, bY as GetTransferAmountFee, c7 as GetValue, bT as InstructionReturn, bW as LoadParams, bS as MakeMultiTransaction, bQ as MakeTransaction, bR as MakeV0Transaction, c0 as MayArray, c1 as MayDeepArray, c2 as MayFunction, b$ as ReplaceType, bZ as ReturnTypeFetchMultipleMintInfo, b_ as ReturnTypeFetchMultipleMintInfos, bO as ReturnTypeMakeInstructions, c6 as SKeyof, c8 as SOR, bP as SignAllTransactions, bX as TransferAmountFee, bV as TxTipConfig, cb as UnionCover, cc as unionArr } from '../api-92e9adc3.js';
|
|
5
5
|
import 'axios';
|
|
6
6
|
import '../solana/type.js';
|
|
7
7
|
import '../api/url.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-
|
|
1
|
+
export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-bd752ae1.js';
|
|
2
2
|
import '@solana/web3.js';
|
|
3
|
-
import '../../api-
|
|
3
|
+
import '../../api-92e9adc3.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import '../../solana/type.js';
|
|
6
6
|
import 'bn.js';
|
|
@@ -22,7 +22,7 @@ import '../liquidity/stable.js';
|
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
23
|
import '../liquidity/layout.js';
|
|
24
24
|
import '../clmm/layout.js';
|
|
25
|
-
import '../../type-
|
|
25
|
+
import '../../type-f95c297a.js';
|
|
26
26
|
import '../cpmm/type.js';
|
|
27
27
|
import '../cpmm/curve/calculator.js';
|
|
28
28
|
import '../cpmm/layout.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import '../../marshmallow/index.js';
|
|
2
2
|
import '@solana/web3.js';
|
|
3
3
|
import 'bn.js';
|
|
4
|
-
export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-
|
|
4
|
+
export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-bd752ae1.js';
|
|
5
5
|
import '../../marshmallow/buffer-layout.js';
|
|
6
|
-
import '../../api-
|
|
6
|
+
import '../../api-92e9adc3.js';
|
|
7
7
|
import 'axios';
|
|
8
8
|
import '../../solana/type.js';
|
|
9
9
|
import '@solana/spl-token';
|
|
@@ -22,7 +22,7 @@ import '../liquidity/stable.js';
|
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
23
|
import '../liquidity/layout.js';
|
|
24
24
|
import '../clmm/layout.js';
|
|
25
|
-
import '../../type-
|
|
25
|
+
import '../../type-f95c297a.js';
|
|
26
26
|
import '../cpmm/type.js';
|
|
27
27
|
import '../cpmm/curve/calculator.js';
|
|
28
28
|
import '../cpmm/layout.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PublicKey, Commitment, EpochInfo, Connection, Transaction, Signer, TransactionInstruction, Keypair } from '@solana/web3.js';
|
|
2
|
-
import { aG as TxBuilder, ay as AddInstructionParam, af as BigNumberish, bt as CreateFarm, aF as MakeTxData, bu as CreateFarmExtInfo, bv as UpdateFarmReward, bw as UpdateFarmRewards, bx as FarmDWParam, $ as FormatFarmInfoOut, bU as ComputeBudgetConfig, bV as TxTipConfig, aE as MakeMultiTxData, q as ApiV3PoolInfoStandardItem, ci as Percent, ce as TokenAmount, x as AmmV4Keys, y as AmmV5Keys, p as ApiV3PoolInfoConcentratedItem, _ as FormatFarmInfoOutV6, D as ClmmKeys, bQ as MakeTransaction, b_ as ReturnTypeFetchMultipleMintInfos, z as CpmmKeys, r as ApiV3PoolInfoStandardItemCpmm, bY as GetTransferAmountFee, G as PoolKeys, i as ApiV3Token, a2 as OwnerIdoInfo, a3 as IdoKeysData, bW as LoadParams, J as JupTokenType, bK as TokenInfo, bP as SignAllTransactions, a as Api, a0 as AvailabilityCheckAPI3, k as ApiV3TokenRes } from './api-
|
|
2
|
+
import { aG as TxBuilder, ay as AddInstructionParam, af as BigNumberish, bt as CreateFarm, aF as MakeTxData, bu as CreateFarmExtInfo, bv as UpdateFarmReward, bw as UpdateFarmRewards, bx as FarmDWParam, $ as FormatFarmInfoOut, bU as ComputeBudgetConfig, bV as TxTipConfig, aE as MakeMultiTxData, q as ApiV3PoolInfoStandardItem, ci as Percent, ce as TokenAmount, x as AmmV4Keys, y as AmmV5Keys, p as ApiV3PoolInfoConcentratedItem, _ as FormatFarmInfoOutV6, D as ClmmKeys, bQ as MakeTransaction, b_ as ReturnTypeFetchMultipleMintInfos, z as CpmmKeys, r as ApiV3PoolInfoStandardItemCpmm, bY as GetTransferAmountFee, G as PoolKeys, i as ApiV3Token, a2 as OwnerIdoInfo, a3 as IdoKeysData, bW as LoadParams, J as JupTokenType, bK as TokenInfo, bP as SignAllTransactions, a as Api, a0 as AvailabilityCheckAPI3, k as ApiV3TokenRes } from './api-92e9adc3.js';
|
|
3
3
|
import { API_URL_CONFIG } from './api/url.js';
|
|
4
4
|
import { Owner } from './common/owner.js';
|
|
5
5
|
import { Cluster } from './solana/type.js';
|
|
@@ -11,7 +11,7 @@ import Decimal from 'decimal.js';
|
|
|
11
11
|
import { StableLayout } from './raydium/liquidity/stable.js';
|
|
12
12
|
import { AddLiquidityParams, RemoveParams, CreatePoolParam, CreatePoolAddress, CreateMarketAndPoolParam, ComputeAmountOutParam, ComputeAmountInParam, SwapParam, AmmRpcData } from './raydium/liquidity/type.js';
|
|
13
13
|
import { ClmmPositionLayout, PositionInfoLayout, LockClPositionLayoutV2, PoolInfoLayout } from './raydium/clmm/layout.js';
|
|
14
|
-
import { m as CreateConcentratedPool, O as OpenPositionFromBase, p as OpenPositionFromBaseExtInfo, q as OpenPositionFromLiquidity, r as OpenPositionFromLiquidityExtInfo, I as IncreasePositionFromLiquidity, M as ManipulateLiquidityExtInfo, n as IncreasePositionFromBase, D as DecreaseLiquidity, B as ClosePositionExtInfo, L as LockPosition, J as ClmmLockAddress, H as HarvestLockPosition, s as InitRewardParams, E as InitRewardExtInfo, t as InitRewardsParams, u as SetRewardParams, v as SetRewardsParams, w as CollectRewardParams, x as CollectRewardsParams, y as HarvestAllRewardsParams, F as ClmmRpcData, d as ComputeClmmPoolInfo, l as ReturnTypeFetchMultiplePoolTickArrays } from './type-
|
|
14
|
+
import { m as CreateConcentratedPool, O as OpenPositionFromBase, p as OpenPositionFromBaseExtInfo, q as OpenPositionFromLiquidity, r as OpenPositionFromLiquidityExtInfo, I as IncreasePositionFromLiquidity, M as ManipulateLiquidityExtInfo, n as IncreasePositionFromBase, D as DecreaseLiquidity, B as ClosePositionExtInfo, L as LockPosition, J as ClmmLockAddress, H as HarvestLockPosition, s as InitRewardParams, E as InitRewardExtInfo, t as InitRewardsParams, u as SetRewardParams, v as SetRewardsParams, w as CollectRewardParams, x as CollectRewardsParams, y as HarvestAllRewardsParams, F as ClmmRpcData, d as ComputeClmmPoolInfo, l as ReturnTypeFetchMultiplePoolTickArrays } from './type-f95c297a.js';
|
|
15
15
|
import { CpmmRpcData, CpmmComputeData, CreateCpmmPoolParam, CreateCpmmPoolAddress, AddCpmmLiquidityParams, WithdrawCpmmLiquidityParams, CpmmSwapParams, LockCpmmLpParams, CpmmLockExtInfo, HarvestLockCpmmLpParams, HarvestMultiLockCpmmLpParams, ComputePairAmountParams } from './raydium/cpmm/type.js';
|
|
16
16
|
import { ComputeAmountOutLayout, BasicPoolInfo, ReturnTypeGetAllRoute, ComputeRoutePathType, ComputePoolType, ReturnTypeFetchMultipleInfo } from './raydium/tradeV2/type.js';
|
|
17
17
|
import { Structure } from './marshmallow/index.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PublicKey, Transaction, Signer, Keypair, EpochInfo } from '@solana/web3.js';
|
|
2
2
|
import BN__default from 'bn.js';
|
|
3
3
|
import Decimal from 'decimal.js';
|
|
4
|
-
import { p as ApiV3PoolInfoConcentratedItem, d as ApiClmmConfigInfo, i as ApiV3Token, bY as GetTransferAmountFee, bX as TransferAmountFee, cj as Price, ci as Percent, ce as TokenAmount, bU as ComputeBudgetConfig, bV as TxTipConfig, cg as Fraction, bK as TokenInfo, D as ClmmKeys } from './api-
|
|
4
|
+
import { p as ApiV3PoolInfoConcentratedItem, d as ApiClmmConfigInfo, i as ApiV3Token, bY as GetTransferAmountFee, bX as TransferAmountFee, cj as Price, ci as Percent, ce as TokenAmount, bU as ComputeBudgetConfig, bV as TxTipConfig, cg as Fraction, bK as TokenInfo, D as ClmmKeys } from './api-92e9adc3.js';
|
|
5
5
|
import { TxVersion } from './common/txTool/txType.js';
|
|
6
6
|
import { PoolInfoLayout, ClmmPositionLayout, LockClPositionLayoutV2 } from './raydium/clmm/layout.js';
|
|
7
7
|
|
package/package.json
CHANGED
package/src/raydium/cpmm/cpmm.ts
CHANGED
|
@@ -969,6 +969,7 @@ export default class CpmmModule extends ModuleBase {
|
|
|
969
969
|
|
|
970
970
|
const feePayer = params.feePayer || this.scope.ownerPubKey;
|
|
971
971
|
const txBuilder = this.createTxBuilder(feePayer);
|
|
972
|
+
const tokenAccRecord: Record<string, PublicKey | undefined> = {};
|
|
972
973
|
|
|
973
974
|
lockInfo.forEach(async (lockData) => {
|
|
974
975
|
const { poolInfo, lpFeeAmount, nftMint } = lockData;
|
|
@@ -979,71 +980,79 @@ export default class CpmmModule extends ModuleBase {
|
|
|
979
980
|
const mintAUseSOLBalance = mintA.equals(WSOLMint);
|
|
980
981
|
const mintBUseSOLBalance = mintB.equals(WSOLMint);
|
|
981
982
|
|
|
982
|
-
let tokenAccountA: PublicKey | undefined =
|
|
983
|
-
let tokenAccountB: PublicKey | undefined =
|
|
984
|
-
|
|
985
|
-
if (
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
983
|
+
let tokenAccountA: PublicKey | undefined = tokenAccRecord[poolInfo.mintA.address];
|
|
984
|
+
let tokenAccountB: PublicKey | undefined = tokenAccRecord[poolInfo.mintB.address];
|
|
985
|
+
|
|
986
|
+
if (!tokenAccountA) {
|
|
987
|
+
if (mintAUseSOLBalance) {
|
|
988
|
+
const { account: _ownerTokenAccountA, instructionParams: accountAInstructions } =
|
|
989
|
+
await this.scope.account.getOrCreateTokenAccount({
|
|
990
|
+
tokenProgram: poolInfo.mintA.programId,
|
|
991
|
+
mint: new PublicKey(poolInfo.mintA.address),
|
|
992
|
+
notUseTokenAccount: true,
|
|
993
|
+
owner: this.scope.ownerPubKey,
|
|
994
|
+
createInfo: {
|
|
995
|
+
payer: this.scope.ownerPubKey,
|
|
996
|
+
amount: 0,
|
|
997
|
+
},
|
|
998
|
+
skipCloseAccount: !closeWsol,
|
|
999
|
+
associatedOnly: false,
|
|
1000
|
+
checkCreateATAOwner: false,
|
|
1001
|
+
});
|
|
1002
|
+
tokenAccountA = _ownerTokenAccountA;
|
|
1003
|
+
accountAInstructions && txBuilder.addInstruction(accountAInstructions);
|
|
1004
|
+
tokenAccRecord[poolInfo.mintA.address] = _ownerTokenAccountA;
|
|
1005
|
+
} else {
|
|
1006
|
+
const mint = new PublicKey(poolInfo.mintA.address);
|
|
1007
|
+
tokenAccountA = this.scope.account.getAssociatedTokenAccount(mint, new PublicKey(poolInfo.mintA.programId));
|
|
1008
|
+
txBuilder.addInstruction({
|
|
1009
|
+
instructions: [
|
|
1010
|
+
createAssociatedTokenAccountIdempotentInstruction(
|
|
1011
|
+
this.scope.ownerPubKey,
|
|
1012
|
+
tokenAccountA,
|
|
1013
|
+
this.scope.ownerPubKey,
|
|
1014
|
+
mint,
|
|
1015
|
+
),
|
|
1016
|
+
],
|
|
999
1017
|
});
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
} else {
|
|
1003
|
-
const mint = new PublicKey(poolInfo.mintA.address);
|
|
1004
|
-
tokenAccountA = this.scope.account.getAssociatedTokenAccount(mint, new PublicKey(poolInfo.mintA.programId));
|
|
1005
|
-
txBuilder.addInstruction({
|
|
1006
|
-
instructions: [
|
|
1007
|
-
createAssociatedTokenAccountIdempotentInstruction(
|
|
1008
|
-
this.scope.ownerPubKey,
|
|
1009
|
-
tokenAccountA,
|
|
1010
|
-
this.scope.ownerPubKey,
|
|
1011
|
-
mint,
|
|
1012
|
-
),
|
|
1013
|
-
],
|
|
1014
|
-
});
|
|
1018
|
+
tokenAccRecord[poolInfo.mintA.address] = tokenAccountA;
|
|
1019
|
+
}
|
|
1015
1020
|
}
|
|
1016
1021
|
|
|
1017
|
-
if (
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1022
|
+
if (!tokenAccountB) {
|
|
1023
|
+
if (mintBUseSOLBalance) {
|
|
1024
|
+
const { account: _ownerTokenAccountB, instructionParams: accountBInstructions } =
|
|
1025
|
+
await this.scope.account.getOrCreateTokenAccount({
|
|
1026
|
+
tokenProgram: poolInfo.mintB.programId,
|
|
1027
|
+
mint: new PublicKey(poolInfo.mintB.address),
|
|
1028
|
+
notUseTokenAccount: true,
|
|
1029
|
+
owner: this.scope.ownerPubKey,
|
|
1030
|
+
createInfo: {
|
|
1031
|
+
payer: this.scope.ownerPubKey,
|
|
1032
|
+
amount: 0,
|
|
1033
|
+
},
|
|
1034
|
+
skipCloseAccount: !closeWsol,
|
|
1035
|
+
associatedOnly: false,
|
|
1036
|
+
checkCreateATAOwner: false,
|
|
1037
|
+
});
|
|
1038
|
+
tokenAccountB = _ownerTokenAccountB;
|
|
1039
|
+
accountBInstructions && txBuilder.addInstruction(accountBInstructions);
|
|
1040
|
+
tokenAccRecord[poolInfo.mintB.address] = _ownerTokenAccountB;
|
|
1041
|
+
} else {
|
|
1042
|
+
const mint = new PublicKey(poolInfo.mintB.address);
|
|
1043
|
+
tokenAccountB = this.scope.account.getAssociatedTokenAccount(mint, new PublicKey(poolInfo.mintB.programId));
|
|
1044
|
+
txBuilder.addInstruction({
|
|
1045
|
+
instructions: [
|
|
1046
|
+
createAssociatedTokenAccountIdempotentInstruction(
|
|
1047
|
+
this.scope.ownerPubKey,
|
|
1048
|
+
tokenAccountB,
|
|
1049
|
+
this.scope.ownerPubKey,
|
|
1050
|
+
mint,
|
|
1051
|
+
),
|
|
1052
|
+
],
|
|
1031
1053
|
});
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
} else {
|
|
1035
|
-
const mint = new PublicKey(poolInfo.mintB.address);
|
|
1036
|
-
tokenAccountB = this.scope.account.getAssociatedTokenAccount(mint, new PublicKey(poolInfo.mintB.programId));
|
|
1037
|
-
txBuilder.addInstruction({
|
|
1038
|
-
instructions: [
|
|
1039
|
-
createAssociatedTokenAccountIdempotentInstruction(
|
|
1040
|
-
this.scope.ownerPubKey,
|
|
1041
|
-
tokenAccountB,
|
|
1042
|
-
this.scope.ownerPubKey,
|
|
1043
|
-
mint,
|
|
1044
|
-
),
|
|
1045
|
-
],
|
|
1046
|
-
});
|
|
1054
|
+
tokenAccRecord[poolInfo.mintB.address] = tokenAccountB;
|
|
1055
|
+
}
|
|
1047
1056
|
}
|
|
1048
1057
|
|
|
1049
1058
|
if (!tokenAccountA || !tokenAccountB)
|
|
@@ -1091,13 +1100,9 @@ export default class CpmmModule extends ModuleBase {
|
|
|
1091
1100
|
});
|
|
1092
1101
|
});
|
|
1093
1102
|
|
|
1094
|
-
// txBuilder.addCustomComputeBudget(computeBudgetConfig);
|
|
1095
|
-
// txBuilder.addTipInstruction(txTipConfig);
|
|
1096
|
-
|
|
1097
1103
|
if (txVersion === TxVersion.V0)
|
|
1098
1104
|
return txBuilder.sizeCheckBuildV0({ computeBudgetConfig }) as Promise<MakeMultiTxData<T>>;
|
|
1099
1105
|
return txBuilder.sizeCheckBuild({ computeBudgetConfig }) as Promise<MakeMultiTxData<T>>;
|
|
1100
|
-
// return txBuilder.versionBuild({ txVersion }) as Promise<MakeTxData>;
|
|
1101
1106
|
}
|
|
1102
1107
|
|
|
1103
1108
|
public computeSwapAmount({
|