@raydium-io/raydium-sdk-v2 0.0.23-alpha → 0.0.25-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 +2 -2
- package/lib/api/api.js +1 -1
- package/lib/api/api.js.map +1 -1
- package/lib/api/api.mjs +1 -1
- package/lib/api/api.mjs.map +1 -1
- package/lib/api/index.d.ts +1 -1
- package/lib/api/index.js +1 -1
- package/lib/api/index.js.map +1 -1
- package/lib/api/index.mjs +1 -1
- package/lib/api/index.mjs.map +1 -1
- package/lib/api/type.d.ts +1 -1
- package/lib/api/type.js.map +1 -1
- package/lib/api/type.mjs.map +1 -1
- package/lib/common/accountInfo.d.ts +1 -1
- package/lib/common/bignumber.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 +4 -4
- package/lib/index.js.map +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/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 +4 -4
- package/lib/raydium/cpmm/cpmm.js.map +1 -1
- package/lib/raydium/cpmm/cpmm.mjs.map +1 -1
- package/lib/raydium/cpmm/index.d.ts +2 -2
- package/lib/raydium/cpmm/index.js +1 -1
- package/lib/raydium/cpmm/index.mjs +1 -1
- package/lib/raydium/cpmm/type.d.ts +12 -6
- package/lib/raydium/cpmm/type.js +1 -1
- package/lib/raydium/cpmm/type.js.map +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 +4 -4
- package/lib/raydium/index.js.map +1 -1
- package/lib/raydium/index.mjs.map +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.map +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-97f3539d.d.ts → raydium-1fe6ab0b.d.ts} +4 -9
- package/lib/{type-485c1df6.d.ts → type-6fd96950.d.ts} +1 -1
- package/lib/{type-2bed92a9.d.ts → type-83523f5f.d.ts} +1 -7
- package/package.json +1 -1
- package/src/api/api.ts +2 -2
- package/src/api/type.ts +0 -6
- package/src/raydium/cpmm/cpmm.ts +3 -7
- package/src/raydium/cpmm/type.ts +12 -4
|
@@ -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 {
|
|
3
|
+
export { bC as LpToken, bB as SplToken, bz as TokenInfo, bA as TokenJson } from '../../type-83523f5f.js';
|
|
4
4
|
export { parseTokenInfo, solToWSolToken, toToken, toTokenAmount, toTokenInfo, wSolToSolToken } from './utils.js';
|
|
5
5
|
import '@solana/web3.js';
|
|
6
6
|
import 'bn.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@solana/web3.js';
|
|
2
|
-
import '../../type-
|
|
3
|
-
export { j as default } from '../../raydium-
|
|
2
|
+
import '../../type-83523f5f.js';
|
|
3
|
+
export { j as default } from '../../raydium-1fe6ab0b.js';
|
|
4
4
|
import 'bn.js';
|
|
5
5
|
import '@solana/spl-token';
|
|
6
6
|
import '../../common/txTool/txType.js';
|
|
@@ -20,7 +20,7 @@ import '../../api/url.js';
|
|
|
20
20
|
import '../account/types.js';
|
|
21
21
|
import '../account/layout.js';
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
|
-
import '../../type-
|
|
23
|
+
import '../../type-6fd96950.js';
|
|
24
24
|
import '../clmm/layout.js';
|
|
25
25
|
import '../cpmm/type.js';
|
|
26
26
|
import '../cpmm/curve/calculator.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { bC as LpToken, bB as SplToken, bz as TokenInfo, bA as TokenJson } from '../../type-83523f5f.js';
|
|
2
2
|
import '../../module/token.js';
|
|
3
3
|
import '@solana/web3.js';
|
|
4
4
|
import 'bn.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { RawMint } from '@solana/spl-token';
|
|
3
|
-
import {
|
|
3
|
+
import { bz as TokenInfo, a9 as BigNumberish, c1 as TokenAmount, e as ApiV3Token } from '../../type-83523f5f.js';
|
|
4
4
|
import { Token } from '../../module/token.js';
|
|
5
5
|
import 'bn.js';
|
|
6
6
|
import '../../common/txTool/txType.js';
|
|
@@ -2,7 +2,7 @@ export { makeSwapInstruction, route1Instruction, route2Instruction, routeInstruc
|
|
|
2
2
|
export { ComputeAmountOutAmmLayout, ComputeAmountOutLayout, ComputeAmountOutRouteLayout, MakeSwapInstructionParam, PoolAccountInfoV4, ReturnTypeFetchMultipleInfo, ReturnTypeGetAddLiquidityDefaultPool, ReturnTypeGetAllRoute, ReturnTypeMakeSwapInstruction, ReturnTypeMakeSwapTransaction, RoutePathType } from './type.js';
|
|
3
3
|
import '@solana/web3.js';
|
|
4
4
|
import 'bn.js';
|
|
5
|
-
import '../../type-
|
|
5
|
+
import '../../type-83523f5f.js';
|
|
6
6
|
import '@solana/spl-token';
|
|
7
7
|
import '../../common/txTool/txType.js';
|
|
8
8
|
import '../../common/owner.js';
|
|
@@ -14,5 +14,5 @@ import '../../marshmallow/index.js';
|
|
|
14
14
|
import '../../marshmallow/buffer-layout.js';
|
|
15
15
|
import '../../common/logger.js';
|
|
16
16
|
import '../../module/currency.js';
|
|
17
|
-
import '../../type-
|
|
17
|
+
import '../../type-6fd96950.js';
|
|
18
18
|
import '../clmm/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 { n as ApiV3PoolInfoItem, w as PoolKeys } from '../../type-
|
|
3
|
+
import { n as ApiV3PoolInfoItem, w as PoolKeys } from '../../type-83523f5f.js';
|
|
4
4
|
import { ReturnTypeMakeSwapInstruction, ComputeAmountOutLayout } from './type.js';
|
|
5
5
|
import '@solana/spl-token';
|
|
6
6
|
import '../../common/txTool/txType.js';
|
|
@@ -13,7 +13,7 @@ import '../../marshmallow/index.js';
|
|
|
13
13
|
import '../../marshmallow/buffer-layout.js';
|
|
14
14
|
import '../../common/logger.js';
|
|
15
15
|
import '../../module/currency.js';
|
|
16
|
-
import '../../type-
|
|
16
|
+
import '../../type-6fd96950.js';
|
|
17
17
|
import '../clmm/layout.js';
|
|
18
18
|
|
|
19
19
|
declare function route1Instruction(programId: PublicKey, poolInfoA: ApiV3PoolInfoItem, poolKeyA: PoolKeys, poolKeyB: PoolKeys, userSourceToken: PublicKey, userRouteToken: PublicKey, userPdaAccount: PublicKey, ownerWallet: PublicKey, inputMint: PublicKey, amountIn: BN__default, amountOut: BN__default, tickArrayA?: PublicKey[]): TransactionInstruction;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@solana/web3.js';
|
|
2
|
-
export { i as default } from '../../raydium-
|
|
2
|
+
export { i as default } from '../../raydium-1fe6ab0b.js';
|
|
3
3
|
import './type.js';
|
|
4
|
-
import '../../type-
|
|
4
|
+
import '../../type-83523f5f.js';
|
|
5
5
|
import '../../api/api.js';
|
|
6
6
|
import 'axios';
|
|
7
7
|
import '../../solana/type.js';
|
|
@@ -21,7 +21,7 @@ import '../../module/currency.js';
|
|
|
21
21
|
import '../account/types.js';
|
|
22
22
|
import '../account/layout.js';
|
|
23
23
|
import '../liquidity/type.js';
|
|
24
|
-
import '../../type-
|
|
24
|
+
import '../../type-6fd96950.js';
|
|
25
25
|
import '../clmm/layout.js';
|
|
26
26
|
import '../cpmm/type.js';
|
|
27
27
|
import '../cpmm/curve/calculator.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PublicKey, Keypair, Signer, TransactionInstruction, Transaction } from '@solana/web3.js';
|
|
2
2
|
import BN__default from 'bn.js';
|
|
3
|
-
import {
|
|
3
|
+
import { bK as TransferAmountFee, c6 as Price, c5 as Percent, c1 as TokenAmount, n as ApiV3PoolInfoItem, w as PoolKeys } from '../../type-83523f5f.js';
|
|
4
4
|
import { Token } from '../../module/token.js';
|
|
5
|
-
import { c as ClmmPoolInfo } from '../../type-
|
|
5
|
+
import { c as ClmmPoolInfo } from '../../type-6fd96950.js';
|
|
6
6
|
import '@solana/spl-token';
|
|
7
7
|
import '../../common/txTool/txType.js';
|
|
8
8
|
import '../../common/owner.js';
|
package/lib/raydium/type.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@solana/web3.js';
|
|
2
2
|
import '@solana/spl-token';
|
|
3
|
-
export {
|
|
3
|
+
export { bS as ArrayItem, bI as ComputeBudgetConfig, bZ as Cover, bT as ExactPartial, bU as ExactRequired, bY as Fallback, bL as GetTransferAmountFee, bW as GetValue, bH as InstructionReturn, bJ as LoadParams, bG as MakeMultiTransaction, bE as MakeTransaction, bF as MakeV0Transaction, bP as MayArray, bQ as MayDeepArray, bR as MayFunction, bO as ReplaceType, bM as ReturnTypeFetchMultipleMintInfo, bN as ReturnTypeFetchMultipleMintInfos, bV as SKeyof, bX as SOR, bD as SignAllTransactions, bK as TransferAmountFee, b_ as UnionCover, b$ as unionArr } from '../type-83523f5f.js';
|
|
4
4
|
import 'bn.js';
|
|
5
5
|
import '../common/txTool/txType.js';
|
|
6
6
|
import '../common/owner.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
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-1fe6ab0b.js';
|
|
2
2
|
import '@solana/web3.js';
|
|
3
3
|
import '../../api/api.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import '../../solana/type.js';
|
|
6
|
-
import '../../type-
|
|
6
|
+
import '../../type-83523f5f.js';
|
|
7
7
|
import 'bn.js';
|
|
8
8
|
import '@solana/spl-token';
|
|
9
9
|
import '../../common/txTool/txType.js';
|
|
@@ -20,7 +20,7 @@ import '../../api/url.js';
|
|
|
20
20
|
import '../account/types.js';
|
|
21
21
|
import '../account/layout.js';
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
|
-
import '../../type-
|
|
23
|
+
import '../../type-6fd96950.js';
|
|
24
24
|
import '../clmm/layout.js';
|
|
25
25
|
import '../cpmm/type.js';
|
|
26
26
|
import '../cpmm/curve/calculator.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
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-1fe6ab0b.js';
|
|
5
5
|
import '../../marshmallow/buffer-layout.js';
|
|
6
6
|
import '../../api/api.js';
|
|
7
7
|
import 'axios';
|
|
8
8
|
import '../../solana/type.js';
|
|
9
|
-
import '../../type-
|
|
9
|
+
import '../../type-83523f5f.js';
|
|
10
10
|
import '@solana/spl-token';
|
|
11
11
|
import '../../common/txTool/txType.js';
|
|
12
12
|
import '../../common/owner.js';
|
|
@@ -20,7 +20,7 @@ import '../../api/url.js';
|
|
|
20
20
|
import '../account/types.js';
|
|
21
21
|
import '../account/layout.js';
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
|
-
import '../../type-
|
|
23
|
+
import '../../type-6fd96950.js';
|
|
24
24
|
import '../clmm/layout.js';
|
|
25
25
|
import '../cpmm/type.js';
|
|
26
26
|
import '../cpmm/curve/calculator.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublicKey, Commitment, Connection, Transaction, Signer, TransactionInstruction, Keypair, EpochInfo } from '@solana/web3.js';
|
|
2
2
|
import { Api } from './api/api.js';
|
|
3
|
-
import {
|
|
3
|
+
import { ax as TxBuilder, ap as AddInstructionParam, a9 as BigNumberish, bk as CreateFarm, aw as MakeTxData, bl as CreateFarmExtInfo, bm as UpdateFarmReward, bn as UpdateFarmRewards, bo as FarmDWParam, U as FormatFarmInfoOut, bI as ComputeBudgetConfig, av as MakeMultiTxData, l as ApiV3PoolInfoStandardItem, c5 as Percent, c1 as TokenAmount, s as AmmV4Keys, t as AmmV5Keys, k as ApiV3PoolInfoConcentratedItem, S as FormatFarmInfoOutV6, v as ClmmKeys, bE as MakeTransaction, C as CpmmKeys, X as OwnerIdoInfo, Y as IdoKeysData, bJ as LoadParams, J as JupTokenType, bz as TokenInfo, e as ApiV3Token, bD as SignAllTransactions, V as AvailabilityCheckAPI3, f as ApiV3TokenRes } from './type-83523f5f.js';
|
|
4
4
|
import { API_URL_CONFIG } from './api/url.js';
|
|
5
5
|
import { Owner } from './common/owner.js';
|
|
6
6
|
import { Cluster } from './solana/type.js';
|
|
@@ -10,9 +10,9 @@ import { TxVersion } from './common/txTool/txType.js';
|
|
|
10
10
|
import BN__default from 'bn.js';
|
|
11
11
|
import Decimal from 'decimal.js';
|
|
12
12
|
import { AddLiquidityParams, RemoveParams, CreatePoolParam, CreatePoolAddress, ComputeAmountOutParam, SwapParam } from './raydium/liquidity/type.js';
|
|
13
|
-
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, s as InitRewardParams, E as InitRewardExtInfo, t as InitRewardsParams, u as SetRewardParams, v as SetRewardsParams, w as CollectRewardParams, x as CollectRewardsParams, H as HarvestAllRewardsParams } from './type-
|
|
13
|
+
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, s as InitRewardParams, E as InitRewardExtInfo, t as InitRewardsParams, u as SetRewardParams, v as SetRewardsParams, w as CollectRewardParams, x as CollectRewardsParams, H as HarvestAllRewardsParams } from './type-6fd96950.js';
|
|
14
14
|
import { ClmmPositionLayout } from './raydium/clmm/layout.js';
|
|
15
|
-
import { CreateCpmmPoolParam, CreateCpmmPoolAddress, AddCpmmLiquidityParams, WithdrawCpmmLiquidityParams, CpmmSwapParams } from './raydium/cpmm/type.js';
|
|
15
|
+
import { CreateCpmmPoolParam, CreateCpmmPoolAddress, AddCpmmLiquidityParams, WithdrawCpmmLiquidityParams, CpmmSwapParams, ComputePairAmountParams } from './raydium/cpmm/type.js';
|
|
16
16
|
import { CpmmPoolInfoLayout } from './raydium/cpmm/layout.js';
|
|
17
17
|
import { PoolAccountInfoV4, ReturnTypeGetAddLiquidityDefaultPool } from './raydium/tradeV2/type.js';
|
|
18
18
|
import { Structure } from './marshmallow/index.js';
|
|
@@ -234,12 +234,7 @@ declare class CpmmModule extends ModuleBase {
|
|
|
234
234
|
addLiquidity<T extends TxVersion>(params: AddCpmmLiquidityParams<T>): Promise<MakeTxData<T>>;
|
|
235
235
|
withdrawLiquidity<T extends TxVersion>(params: WithdrawCpmmLiquidityParams<T>): Promise<MakeTxData<T>>;
|
|
236
236
|
swap<T extends TxVersion>(params: CpmmSwapParams): Promise<MakeTxData<T>>;
|
|
237
|
-
computePairAmount({ poolInfo, amount, slippage, baseIn, }: {
|
|
238
|
-
poolInfo: ApiV3PoolInfoStandardItem;
|
|
239
|
-
amount: string | Decimal;
|
|
240
|
-
slippage: Percent;
|
|
241
|
-
baseIn?: boolean;
|
|
242
|
-
}): {
|
|
237
|
+
computePairAmount({ poolInfo, amount, slippage, baseIn, }: ComputePairAmountParams): {
|
|
243
238
|
anotherAmount: TokenAmount;
|
|
244
239
|
maxAnotherAmount: TokenAmount;
|
|
245
240
|
liquidity: BN__default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PublicKey, Transaction, Signer, Keypair, TransactionInstruction, EpochInfo } from '@solana/web3.js';
|
|
2
2
|
import BN__default from 'bn.js';
|
|
3
3
|
import Decimal from 'decimal.js';
|
|
4
|
-
import { k as ApiV3PoolInfoConcentratedItem, b as ApiClmmConfigInfo, e as ApiV3Token,
|
|
4
|
+
import { k as ApiV3PoolInfoConcentratedItem, b as ApiClmmConfigInfo, e as ApiV3Token, bL as GetTransferAmountFee, bK as TransferAmountFee, c6 as Price, c5 as Percent, c1 as TokenAmount, bI as ComputeBudgetConfig, c3 as Fraction, bz as TokenInfo, v as ClmmKeys } from './type-83523f5f.js';
|
|
5
5
|
import { TxVersion } from './common/txTool/txType.js';
|
|
6
6
|
import { ClmmPositionLayout } from './raydium/clmm/layout.js';
|
|
7
7
|
|
|
@@ -1079,12 +1079,6 @@ declare enum JupTokenType {
|
|
|
1079
1079
|
Strict = "strict"
|
|
1080
1080
|
}
|
|
1081
1081
|
declare type PoolsApiReturn = ApiV3PageIns<ApiV3PoolInfoItem>;
|
|
1082
|
-
interface SearchPoolsApiReturn {
|
|
1083
|
-
hasNextPage: boolean;
|
|
1084
|
-
data: ApiV3PoolInfoItem[];
|
|
1085
|
-
bestUse: "id" | "mint" | null;
|
|
1086
|
-
search: string;
|
|
1087
|
-
}
|
|
1088
1082
|
interface TransferFeeDataBaseType {
|
|
1089
1083
|
transferFeeConfigAuthority: string;
|
|
1090
1084
|
withdrawWithheldAuthority: string;
|
|
@@ -1418,4 +1412,4 @@ declare type FarmPositionData = Record<string, Record<string, Record<string, {
|
|
|
1418
1412
|
version: "V1" | "V2";
|
|
1419
1413
|
}>>>;
|
|
1420
1414
|
|
|
1421
|
-
export {
|
|
1415
|
+
export { Rounding as $, ApiPoolInfoV4 as A, FarmRewardTypeV6Key as B, CpmmKeys as C, RewardKeyInfoV345 as D, RewardKeyInfoV6 as E, FarmRewardInfoV6 as F, FormatFarmKeyOutV345 as G, FormatFarmKeyOutV6 as H, FormatFarmKeyOut as I, JupTokenType as J, RewardInfoV345 as K, LiquidityVersion as L, RewardInfoV6 as M, FarmTagsItem as N, FormatFarmInfoOutBase as O, PoolsApiReturn as P, FormatFarmInfoOutV345 as Q, RpcItemA as R, FormatFarmInfoOutV6 as S, TransferFeeDataBaseType as T, FormatFarmInfoOut as U, AvailabilityCheckAPI3 as V, OwnerCreatedFarmInfo as W, OwnerIdoInfo as X, IdoKeysData as Y, ApiStakePool as Z, FarmPositionData as _, ApiStakePoolInfo as a, FarmLedgerLayoutV6_1 as a$, BN_ZERO as a0, BN_ONE as a1, BN_TWO as a2, BN_THREE as a3, BN_FIVE as a4, BN_TEN as a5, BN_100 as a6, BN_1000 as a7, BN_10000 as a8, BigNumberish as a9, realFarmStateV3Layout as aA, realFarmStateV5Layout as aB, realFarmV6Layout as aC, farmStateV3Layout as aD, farmStateV5Layout as aE, farmStateV6Layout as aF, farmRewardTimeInfoLayout as aG, farmRewardLayout as aH, farmRewardRestartLayout as aI, farmAddRewardLayout as aJ, FarmStateLayoutV3 as aK, FarmStateLayoutV5 as aL, FarmStateLayoutV6 as aM, FarmStateV3 as aN, FarmStateV5 as aO, FarmStateV6 as aP, FarmState as aQ, FarmStateLayout as aR, farmLedgerLayoutV3_1 as aS, farmLedgerLayoutV3_2 as aT, farmLedgerLayoutV5_1 as aU, farmLedgerLayoutV5_2 as aV, farmLedgerLayoutV6_1 as aW, FarmLedgerLayoutV3_1 as aX, FarmLedgerLayoutV3_2 as aY, FarmLedgerLayoutV5_1 as aZ, FarmLedgerLayoutV5_2 as a_, Numberish as aa, parseBigNumberish as ab, tenExponential as ac, parseNumberInfo as ad, divCeil as ae, shakeFractionDecimal as af, toBN as ag, toFraction as ah, toPercent as ai, toTokenPrice as aj, toUsdCurrency as ak, toTotalPrice as al, decimalToFraction as am, isDecimal as an, recursivelyDecimalToFraction as ao, AddInstructionParam as ap, TxBuildData as aq, TxV0BuildData as ar, ExecuteParam as as, MultiTxBuildData as at, MultiTxV0BuildData as au, MakeMultiTxData as av, MakeTxData as aw, TxBuilder as ax, associatedLedgerAccountLayout as ay, withdrawRewardLayout as az, ApiClmmConfigInfo as b, unionArr as b$, FarmLedgerLayout as b0, FarmLedgerV3_1 as b1, FarmLedgerV3_2 as b2, FarmLedgerV5_1 as b3, FarmLedgerV5_2 as b4, FarmLedgerV6_1 as b5, FarmLedger as b6, dwLayout as b7, VoterVotingMintConfig as b8, VoterRegistrar as b9, TokenJson as bA, SplToken as bB, LpToken as bC, SignAllTransactions as bD, MakeTransaction as bE, MakeV0Transaction as bF, MakeMultiTransaction as bG, InstructionReturn as bH, ComputeBudgetConfig as bI, LoadParams as bJ, TransferAmountFee as bK, GetTransferAmountFee as bL, ReturnTypeFetchMultipleMintInfo as bM, ReturnTypeFetchMultipleMintInfos as bN, ReplaceType as bO, MayArray as bP, MayDeepArray as bQ, MayFunction as bR, ArrayItem as bS, ExactPartial as bT, ExactRequired as bU, SKeyof as bV, GetValue as bW, SOR as bX, Fallback as bY, Cover as bZ, UnionCover as b_, VoterLockup as ba, VoterDepositEntry as bb, Voter as bc, RewardType as bd, APIRewardInfo as be, RewardInfoWithKey as bf, FarmRewardInfo as bg, FarmRewardInfoConfig as bh, RewardInfoKey as bi, FarmPoolInfoV6 as bj, CreateFarm as bk, CreateFarmExtInfo as bl, UpdateFarmReward as bm, UpdateFarmRewards as bn, FarmDWParam as bo, FarmPoolKeys as bp, FarmVersion as bq, FARM_LOCK_MINT as br, FARM_LOCK_VAULT as bs, FARM_VERSION_TO_STATE_LAYOUT as bt, FARM_VERSION_TO_LEDGER_LAYOUT as bu, isValidFarmVersion as bv, validateFarmRewards as bw, poolTypeV6 as bx, FARM_PROGRAM_TO_VERSION as by, TokenInfo as bz, ApiClmmPoolsItemStatistics as c, splitNumber as c0, TokenAmount as c1, CurrencyAmount as c2, Fraction as c3, _100_PERCENT as c4, Percent as c5, Price as c6, ApiV3PageIns as d, ApiV3Token as e, ApiV3TokenRes as f, ApiV3PoolInfoCountItem as g, PoolFarmRewardInfo as h, PoolRewardInfoItem as i, ApiV3PoolInfoBaseItem as j, ApiV3PoolInfoConcentratedItem as k, ApiV3PoolInfoStandardItem as l, ApiV3PoolInfoStandardItemCpmm as m, ApiV3PoolInfoItem as n, PoolFetchType as o, FetchPoolParams as p, Point as q, LiquidityLineApi as r, AmmV4Keys as s, AmmV5Keys as t, ClmmRewardType as u, ClmmKeys as v, PoolKeys as w, ApiClmmConfigV3 as x, RpcItemB as y, RpcType as z };
|
package/package.json
CHANGED
package/src/api/api.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
ApiV3Token,
|
|
9
9
|
FetchPoolParams,
|
|
10
10
|
PoolsApiReturn,
|
|
11
|
-
|
|
11
|
+
ApiV3PoolInfoItem,
|
|
12
12
|
JupTokenType,
|
|
13
13
|
PoolKeys,
|
|
14
14
|
FormatFarmInfoOut,
|
|
@@ -187,7 +187,7 @@ export class Api {
|
|
|
187
187
|
return res.data;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
async fetchPoolById(props: { ids: string }): Promise<
|
|
190
|
+
async fetchPoolById(props: { ids: string }): Promise<ApiV3PoolInfoItem[]> {
|
|
191
191
|
const { ids } = props;
|
|
192
192
|
const res = await this.api.get((this.urlConfigs.POOL_SEARCH_BY_ID || API_URLS.POOL_SEARCH_BY_ID) + `?ids=${ids}`);
|
|
193
193
|
return res.data;
|
package/src/api/type.ts
CHANGED
|
@@ -118,12 +118,6 @@ export enum JupTokenType {
|
|
|
118
118
|
Strict = "strict",
|
|
119
119
|
}
|
|
120
120
|
export type PoolsApiReturn = ApiV3PageIns<ApiV3PoolInfoItem>;
|
|
121
|
-
export interface SearchPoolsApiReturn {
|
|
122
|
-
hasNextPage: boolean;
|
|
123
|
-
data: ApiV3PoolInfoItem[];
|
|
124
|
-
bestUse: "id" | "mint" | null;
|
|
125
|
-
search: string;
|
|
126
|
-
}
|
|
127
121
|
|
|
128
122
|
export interface TransferFeeDataBaseType {
|
|
129
123
|
transferFeeConfigAuthority: string;
|
package/src/raydium/cpmm/cpmm.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublicKey } from "@solana/web3.js";
|
|
2
2
|
import { NATIVE_MINT, TOKEN_PROGRAM_ID, AccountLayout } from "@solana/spl-token";
|
|
3
|
-
import {
|
|
3
|
+
import { CpmmKeys } from "@/api/type";
|
|
4
4
|
import { TokenAmount, Percent } from "@/module";
|
|
5
5
|
import { toToken } from "../token";
|
|
6
6
|
import { BN_ZERO } from "@/common/bignumber";
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
AddCpmmLiquidityParams,
|
|
17
17
|
WithdrawCpmmLiquidityParams,
|
|
18
18
|
CpmmSwapParams,
|
|
19
|
+
ComputePairAmountParams,
|
|
19
20
|
} from "./type";
|
|
20
21
|
import { getCreatePoolKeys, getPdaObservationId } from "./pda";
|
|
21
22
|
import {
|
|
@@ -508,12 +509,7 @@ export default class CpmmModule extends ModuleBase {
|
|
|
508
509
|
// anotherToken,
|
|
509
510
|
slippage,
|
|
510
511
|
baseIn,
|
|
511
|
-
}: {
|
|
512
|
-
poolInfo: ApiV3PoolInfoStandardItem;
|
|
513
|
-
amount: string | Decimal;
|
|
514
|
-
slippage: Percent;
|
|
515
|
-
baseIn?: boolean;
|
|
516
|
-
}): { anotherAmount: TokenAmount; maxAnotherAmount: TokenAmount; liquidity: BN } {
|
|
512
|
+
}: ComputePairAmountParams): { anotherAmount: TokenAmount; maxAnotherAmount: TokenAmount; liquidity: BN } {
|
|
517
513
|
const inputAmount = new BN(new Decimal(amount).mul(10 ** poolInfo[baseIn ? "mintA" : "mintB"].decimals).toFixed(0));
|
|
518
514
|
const _anotherToken = toToken(poolInfo[baseIn ? "mintB" : "mintA"]);
|
|
519
515
|
|
package/src/raydium/cpmm/type.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { PublicKey } from "@solana/web3.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ApiV3PoolInfoStandardItemCpmm, ApiV3Token } from "@/api/type";
|
|
3
3
|
import { TxVersion } from "@/common/txTool/txType";
|
|
4
4
|
import BN from "bn.js";
|
|
5
5
|
import { ComputeBudgetConfig } from "@/raydium/type";
|
|
6
6
|
import { SwapResult } from "./curve/calculator";
|
|
7
7
|
import { Percent } from "@/module";
|
|
8
|
+
import Decimal from "decimal.js";
|
|
8
9
|
|
|
9
10
|
export interface CpmmConfigInfoInterface {
|
|
10
11
|
bump: number;
|
|
@@ -84,7 +85,7 @@ export interface CreateCpmmPoolAddress {
|
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
export interface AddCpmmLiquidityParams<T = TxVersion.LEGACY> {
|
|
87
|
-
poolInfo:
|
|
88
|
+
poolInfo: ApiV3PoolInfoStandardItemCpmm;
|
|
88
89
|
payer?: PublicKey;
|
|
89
90
|
inputAmount: BN;
|
|
90
91
|
baseIn: boolean;
|
|
@@ -98,7 +99,7 @@ export interface AddCpmmLiquidityParams<T = TxVersion.LEGACY> {
|
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
export interface WithdrawCpmmLiquidityParams<T = TxVersion.LEGACY> {
|
|
101
|
-
poolInfo:
|
|
102
|
+
poolInfo: ApiV3PoolInfoStandardItemCpmm;
|
|
102
103
|
payer?: PublicKey;
|
|
103
104
|
lpAmount: BN;
|
|
104
105
|
slippage: Percent;
|
|
@@ -107,7 +108,7 @@ export interface WithdrawCpmmLiquidityParams<T = TxVersion.LEGACY> {
|
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
export interface CpmmSwapParams<T = TxVersion.LEGACY> {
|
|
110
|
-
poolInfo:
|
|
111
|
+
poolInfo: ApiV3PoolInfoStandardItemCpmm;
|
|
111
112
|
payer?: PublicKey;
|
|
112
113
|
baseIn: boolean;
|
|
113
114
|
swapResult: SwapResult;
|
|
@@ -119,3 +120,10 @@ export interface CpmmSwapParams<T = TxVersion.LEGACY> {
|
|
|
119
120
|
computeBudgetConfig?: ComputeBudgetConfig;
|
|
120
121
|
txVersion?: T;
|
|
121
122
|
}
|
|
123
|
+
|
|
124
|
+
export interface ComputePairAmountParams {
|
|
125
|
+
poolInfo: ApiV3PoolInfoStandardItemCpmm;
|
|
126
|
+
amount: string | Decimal;
|
|
127
|
+
slippage: Percent;
|
|
128
|
+
baseIn?: boolean;
|
|
129
|
+
}
|