@raydium-io/raydium-sdk-v2 0.0.37-alpha → 0.0.39-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.
Files changed (107) hide show
  1. package/lib/api/api.d.ts +5 -1
  2. package/lib/api/api.js +1 -1
  3. package/lib/api/api.js.map +1 -1
  4. package/lib/api/api.mjs +1 -1
  5. package/lib/api/api.mjs.map +1 -1
  6. package/lib/api/index.d.ts +1 -1
  7. package/lib/api/index.js +1 -1
  8. package/lib/api/index.js.map +1 -1
  9. package/lib/api/index.mjs +1 -1
  10. package/lib/api/index.mjs.map +1 -1
  11. package/lib/api/type.d.ts +1 -1
  12. package/lib/api/type.js +1 -1
  13. package/lib/api/type.js.map +1 -1
  14. package/lib/api/type.mjs +1 -1
  15. package/lib/api/type.mjs.map +1 -1
  16. package/lib/common/accountInfo.d.ts +1 -1
  17. package/lib/common/bignumber.d.ts +1 -1
  18. package/lib/common/fractionUtil.d.ts +1 -1
  19. package/lib/common/index.d.ts +1 -1
  20. package/lib/common/transfer.d.ts +1 -1
  21. package/lib/common/txTool/txTool.d.ts +1 -1
  22. package/lib/common/txTool/txUtils.d.ts +1 -1
  23. package/lib/common/utility.d.ts +1 -1
  24. package/lib/index.d.ts +3 -3
  25. package/lib/index.js +1 -1
  26. package/lib/index.js.map +1 -1
  27. package/lib/index.mjs +1 -1
  28. package/lib/index.mjs.map +1 -1
  29. package/lib/module/amount.d.ts +1 -1
  30. package/lib/module/fraction.d.ts +1 -1
  31. package/lib/module/index.d.ts +1 -1
  32. package/lib/module/percent.d.ts +1 -1
  33. package/lib/module/price.d.ts +1 -1
  34. package/lib/raydium/account/account.d.ts +3 -3
  35. package/lib/raydium/account/index.d.ts +1 -1
  36. package/lib/raydium/account/instruction.d.ts +1 -1
  37. package/lib/raydium/account/types.d.ts +1 -1
  38. package/lib/raydium/account/util.d.ts +1 -1
  39. package/lib/raydium/clmm/clmm.d.ts +3 -3
  40. package/lib/raydium/clmm/index.d.ts +3 -3
  41. package/lib/raydium/clmm/instrument.d.ts +2 -2
  42. package/lib/raydium/clmm/layout.d.ts +1 -1
  43. package/lib/raydium/clmm/type.d.ts +2 -2
  44. package/lib/raydium/clmm/utils/math.d.ts +2 -2
  45. package/lib/raydium/clmm/utils/pool.d.ts +2 -2
  46. package/lib/raydium/clmm/utils/position.d.ts +2 -2
  47. package/lib/raydium/clmm/utils/tick.d.ts +2 -2
  48. package/lib/raydium/clmm/utils/tickQuery.d.ts +2 -2
  49. package/lib/raydium/clmm/utils/tickarrayBitmap.d.ts +2 -2
  50. package/lib/raydium/cpmm/cpmm.d.ts +3 -3
  51. package/lib/raydium/cpmm/index.d.ts +1 -1
  52. package/lib/raydium/cpmm/layout.d.ts +1 -1
  53. package/lib/raydium/cpmm/type.d.ts +1 -1
  54. package/lib/raydium/farm/config.d.ts +1 -1
  55. package/lib/raydium/farm/farm.d.ts +3 -3
  56. package/lib/raydium/farm/index.d.ts +1 -1
  57. package/lib/raydium/farm/instruction.d.ts +1 -1
  58. package/lib/raydium/farm/layout.d.ts +1 -1
  59. package/lib/raydium/farm/type.d.ts +1 -1
  60. package/lib/raydium/farm/util.d.ts +1 -1
  61. package/lib/raydium/ido/ido.d.ts +3 -3
  62. package/lib/raydium/ido/index.d.ts +3 -3
  63. package/lib/raydium/ido/instruction.d.ts +1 -1
  64. package/lib/raydium/ido/type.d.ts +1 -1
  65. package/lib/raydium/index.d.ts +3 -3
  66. package/lib/raydium/index.js +1 -1
  67. package/lib/raydium/index.js.map +1 -1
  68. package/lib/raydium/index.mjs +1 -1
  69. package/lib/raydium/index.mjs.map +1 -1
  70. package/lib/raydium/liquidity/index.d.ts +1 -1
  71. package/lib/raydium/liquidity/instruction.d.ts +1 -1
  72. package/lib/raydium/liquidity/layout.d.ts +6 -6
  73. package/lib/raydium/liquidity/liquidity.d.ts +3 -3
  74. package/lib/raydium/liquidity/liquidity.js +1 -1
  75. package/lib/raydium/liquidity/liquidity.js.map +1 -1
  76. package/lib/raydium/liquidity/liquidity.mjs +1 -1
  77. package/lib/raydium/liquidity/liquidity.mjs.map +1 -1
  78. package/lib/raydium/liquidity/type.d.ts +1 -1
  79. package/lib/raydium/liquidity/utils.d.ts +1 -1
  80. package/lib/raydium/marketV2/createMarket.d.ts +3 -3
  81. package/lib/raydium/marketV2/index.d.ts +3 -3
  82. package/lib/raydium/moduleBase.d.ts +3 -3
  83. package/lib/raydium/raydium.d.ts +3 -3
  84. package/lib/raydium/raydium.js +1 -1
  85. package/lib/raydium/raydium.js.map +1 -1
  86. package/lib/raydium/raydium.mjs +1 -1
  87. package/lib/raydium/raydium.mjs.map +1 -1
  88. package/lib/raydium/serum/layout.d.ts +2 -2
  89. package/lib/raydium/token/constant.d.ts +1 -1
  90. package/lib/raydium/token/index.d.ts +1 -1
  91. package/lib/raydium/token/token.d.ts +3 -3
  92. package/lib/raydium/token/type.d.ts +1 -1
  93. package/lib/raydium/token/utils.d.ts +1 -1
  94. package/lib/raydium/tradeV2/index.d.ts +2 -2
  95. package/lib/raydium/tradeV2/instrument.d.ts +2 -2
  96. package/lib/raydium/tradeV2/trade.d.ts +3 -3
  97. package/lib/raydium/tradeV2/type.d.ts +2 -2
  98. package/lib/raydium/type.d.ts +1 -1
  99. package/lib/raydium/utils1216/index.d.ts +3 -3
  100. package/lib/raydium/utils1216/utils1216.d.ts +3 -3
  101. package/lib/{raydium-3aa078dd.d.ts → raydium-2631faa2.d.ts} +3 -3
  102. package/lib/{type-930256a9.d.ts → type-08d7cf11.d.ts} +1 -1
  103. package/lib/{type-541fc296.d.ts → type-15746482.d.ts} +5 -2
  104. package/package.json +1 -1
  105. package/src/api/api.ts +35 -0
  106. package/src/api/type.ts +12 -9
  107. package/src/raydium/liquidity/liquidity.ts +9 -6
@@ -4,12 +4,12 @@ import * as _solana_web3_js from '@solana/web3.js';
4
4
  import { GetStructureSchema } from '../../marshmallow/buffer-layout.js';
5
5
 
6
6
  declare const MARKET_STATE_LAYOUT_V3: Structure<_solana_web3_js.PublicKey | Buffer | BN, "", {
7
+ baseMint: _solana_web3_js.PublicKey;
8
+ quoteMint: _solana_web3_js.PublicKey;
7
9
  baseLotSize: BN;
8
10
  quoteLotSize: BN;
9
11
  baseVault: _solana_web3_js.PublicKey;
10
12
  quoteVault: _solana_web3_js.PublicKey;
11
- baseMint: _solana_web3_js.PublicKey;
12
- quoteMint: _solana_web3_js.PublicKey;
13
13
  ownAddress: _solana_web3_js.PublicKey;
14
14
  vaultSignerNonce: BN;
15
15
  baseDepositsTotal: BN;
@@ -1,4 +1,4 @@
1
- import { bz as TokenInfo } from '../../type-541fc296.js';
1
+ import { bz as TokenInfo } from '../../type-15746482.js';
2
2
  import '@solana/web3.js';
3
3
  import 'bn.js';
4
4
  import '@solana/spl-token';
@@ -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 { bC as LpToken, bB as SplToken, bz as TokenInfo, bA as TokenJson } from '../../type-541fc296.js';
3
+ export { bC as LpToken, bB as SplToken, bz as TokenInfo, bA as TokenJson } from '../../type-15746482.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-541fc296.js';
3
- export { j as default } from '../../raydium-3aa078dd.js';
2
+ import '../../type-15746482.js';
3
+ export { j as default } from '../../raydium-2631faa2.js';
4
4
  import 'bn.js';
5
5
  import '@solana/spl-token';
6
6
  import '../../solana/type.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-930256a9.js';
23
+ import '../../type-08d7cf11.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 { bC as LpToken, bB as SplToken, bz as TokenInfo, bA as TokenJson } from '../../type-541fc296.js';
1
+ export { bC as LpToken, bB as SplToken, bz as TokenInfo, bA as TokenJson } from '../../type-15746482.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 { bz as TokenInfo, a9 as BigNumberish, c1 as TokenAmount, e as ApiV3Token } from '../../type-541fc296.js';
3
+ import { bz as TokenInfo, a9 as BigNumberish, c1 as TokenAmount, e as ApiV3Token } from '../../type-15746482.js';
4
4
  import { Token } from '../../module/token.js';
5
5
  import 'bn.js';
6
6
  import '../../solana/type.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-541fc296.js';
5
+ import '../../type-15746482.js';
6
6
  import '@solana/spl-token';
7
7
  import '../../solana/type.js';
8
8
  import '../../common/txTool/txType.js';
@@ -15,5 +15,5 @@ import '../../marshmallow/index.js';
15
15
  import '../../marshmallow/buffer-layout.js';
16
16
  import '../../common/logger.js';
17
17
  import '../../module/currency.js';
18
- import '../../type-930256a9.js';
18
+ import '../../type-08d7cf11.js';
19
19
  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-541fc296.js';
3
+ import { n as ApiV3PoolInfoItem, w as PoolKeys } from '../../type-15746482.js';
4
4
  import { ReturnTypeMakeSwapInstruction, ComputeAmountOutLayout } from './type.js';
5
5
  import '@solana/spl-token';
6
6
  import '../../solana/type.js';
@@ -14,7 +14,7 @@ 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-930256a9.js';
17
+ import '../../type-08d7cf11.js';
18
18
  import '../clmm/layout.js';
19
19
 
20
20
  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-3aa078dd.js';
2
+ export { i as default } from '../../raydium-2631faa2.js';
3
3
  import './type.js';
4
- import '../../type-541fc296.js';
4
+ import '../../type-15746482.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-930256a9.js';
24
+ import '../../type-08d7cf11.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 { bK as TransferAmountFee, c6 as Price, c5 as Percent, c1 as TokenAmount, n as ApiV3PoolInfoItem, w as PoolKeys } from '../../type-541fc296.js';
3
+ import { bK as TransferAmountFee, c6 as Price, c5 as Percent, c1 as TokenAmount, n as ApiV3PoolInfoItem, w as PoolKeys } from '../../type-15746482.js';
4
4
  import { Token } from '../../module/token.js';
5
- import { c as ClmmPoolInfo } from '../../type-930256a9.js';
5
+ import { c as ClmmPoolInfo } from '../../type-08d7cf11.js';
6
6
  import '@solana/spl-token';
7
7
  import '../../solana/type.js';
8
8
  import '../../common/txTool/txType.js';
@@ -1,6 +1,6 @@
1
1
  import '@solana/web3.js';
2
2
  import '@solana/spl-token';
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-541fc296.js';
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-15746482.js';
4
4
  import 'bn.js';
5
5
  import '../solana/type.js';
6
6
  import '../common/txTool/txType.js';
@@ -1,9 +1,9 @@
1
- export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-3aa078dd.js';
1
+ export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-2631faa2.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-541fc296.js';
6
+ import '../../type-15746482.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-930256a9.js';
23
+ import '../../type-08d7cf11.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-3aa078dd.js';
4
+ export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-2631faa2.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-541fc296.js';
9
+ import '../../type-15746482.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-930256a9.js';
23
+ import '../../type-08d7cf11.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 { 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, bL as GetTransferAmountFee, 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-541fc296.js';
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, bL as GetTransferAmountFee, 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-15746482.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,7 +10,7 @@ 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-930256a9.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-08d7cf11.js';
14
14
  import { ClmmPositionLayout, PositionInfoLayout, PoolInfoLayout } from './raydium/clmm/layout.js';
15
15
  import { CpmmConfigInfoInterface, CreateCpmmPoolParam, CreateCpmmPoolAddress, AddCpmmLiquidityParams, WithdrawCpmmLiquidityParams, CpmmSwapParams, ComputePairAmountParams } from './raydium/cpmm/type.js';
16
16
  import { CpmmPoolInfoLayout } from './raydium/cpmm/layout.js';
@@ -299,11 +299,11 @@ declare class Utils1216 extends ModuleBase {
299
299
  perLpLoss: BN__default;
300
300
  totalClaimedAmount: BN__default;
301
301
  }[], "", {
302
+ status: number;
302
303
  padding: BN__default[];
303
304
  bump: number;
304
305
  endTime: BN__default;
305
306
  openTime: BN__default;
306
- status: number;
307
307
  ammId: PublicKey;
308
308
  tokenInfo: {
309
309
  mintDecimals: number;
@@ -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, 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-541fc296.js';
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-15746482.js';
5
5
  import { TxVersion } from './common/txTool/txType.js';
6
6
  import { ClmmPositionLayout } from './raydium/clmm/layout.js';
7
7
 
@@ -1189,11 +1189,14 @@ declare type ApiV3PoolInfoItem = ApiV3PoolInfoConcentratedItem | ApiV3PoolInfoSt
1189
1189
  declare enum PoolFetchType {
1190
1190
  All = "all",
1191
1191
  Standard = "standard",
1192
- Concentrated = "concentrated"
1192
+ Concentrated = "concentrated",
1193
+ AllFarm = "allFarm",
1194
+ StandardFarm = "standardFarm",
1195
+ ConcentratedFarm = "concentratedFarm"
1193
1196
  }
1194
1197
  interface FetchPoolParams {
1195
1198
  type?: PoolFetchType;
1196
- sort?: "liquidity" | "volume_24h" | "volume_7d" | "volume_30d" | "fee_24h" | "fee_7d" | "fee_30d" | "apr_24h" | "apr_7d" | "apr_30d";
1199
+ sort?: "liquidity" | "volume24h" | "volume7d" | "volume30d" | "fee24h" | "fee7d" | "fee30d" | "apr24h" | "apr7d" | "apr30d";
1197
1200
  order?: "desc" | "asc";
1198
1201
  pageSize?: number;
1199
1202
  page?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raydium-io/raydium-sdk-v2",
3
- "version": "0.0.37-alpha",
3
+ "version": "0.0.39-alpha",
4
4
  "description": "An SDK for building applications on top of Raydium.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "./lib/index.js",
package/src/api/api.ts CHANGED
@@ -14,10 +14,12 @@ import {
14
14
  FormatFarmInfoOut,
15
15
  FormatFarmKeyOut,
16
16
  AvailabilityCheckAPI3,
17
+ PoolFetchType,
17
18
  } from "./type";
18
19
  import { API_URLS, API_URL_CONFIG } from "./url";
19
20
  import { updateReqHistory } from "./utils";
20
21
  import { PublicKey } from "@solana/web3.js";
22
+ import { solToWSol } from "../common";
21
23
 
22
24
  const logger = createLogger("Raydium_Api");
23
25
  const poolKeysCache: Map<string, PoolKeys> = new Map();
@@ -221,6 +223,39 @@ export class Api {
221
223
  return cacheList.concat(data);
222
224
  }
223
225
 
226
+ async fetchPoolByMints(
227
+ props: {
228
+ mint1: string | PublicKey;
229
+ mint2?: string | PublicKey;
230
+ } & Omit<FetchPoolParams, "pageSize">,
231
+ ): Promise<ApiV3PoolInfoItem[]> {
232
+ const {
233
+ mint1: propMint1,
234
+ mint2: propMint2,
235
+ type = PoolFetchType.All,
236
+ sort = "default",
237
+ order = "desc",
238
+ page = 1,
239
+ } = props;
240
+
241
+ const [mint1, mint2] = [
242
+ propMint1 ? solToWSol(propMint1).toBase58() : propMint1,
243
+ propMint2 && propMint2 !== "undefined" ? solToWSol(propMint2).toBase58() : "",
244
+ ];
245
+ const [baseMint, quoteMint] = mint2 && mint1 > mint2 ? [mint2, mint1] : [mint1, mint2];
246
+
247
+ console.log(
248
+ 123123555,
249
+ `?mint1=${baseMint}&mint2=${quoteMint}&poolType=${type}&poolSortField=${sort}&sortType=${order}&pageSize=100&page=${page}`,
250
+ );
251
+
252
+ const res = await this.api.get(
253
+ (this.urlConfigs.POOL_SEARCH_MINT || API_URLS.POOL_SEARCH_MINT) +
254
+ `?mint1=${baseMint}&mint2=${quoteMint}&poolType=${type}&poolSortField=${sort}&sortType=${order}&pageSize=100&page=${page}`,
255
+ );
256
+ return res.data;
257
+ }
258
+
224
259
  async fetchFarmInfoById(props: { ids: string }): Promise<FormatFarmInfoOut[]> {
225
260
  const { ids } = props;
226
261
 
package/src/api/type.ts CHANGED
@@ -240,21 +240,24 @@ export enum PoolFetchType {
240
240
  All = "all",
241
241
  Standard = "standard",
242
242
  Concentrated = "concentrated",
243
+ AllFarm = "allFarm",
244
+ StandardFarm = "standardFarm",
245
+ ConcentratedFarm = "concentratedFarm",
243
246
  }
244
247
 
245
248
  export interface FetchPoolParams {
246
249
  type?: PoolFetchType;
247
250
  sort?:
248
251
  | "liquidity"
249
- | "volume_24h"
250
- | "volume_7d"
251
- | "volume_30d"
252
- | "fee_24h"
253
- | "fee_7d"
254
- | "fee_30d"
255
- | "apr_24h"
256
- | "apr_7d"
257
- | "apr_30d";
252
+ | "volume24h"
253
+ | "volume7d"
254
+ | "volume30d"
255
+ | "fee24h"
256
+ | "fee7d"
257
+ | "fee30d"
258
+ | "apr24h"
259
+ | "apr7d"
260
+ | "apr30d";
258
261
  order?: "desc" | "asc";
259
262
  pageSize?: number;
260
263
  page?: number;
@@ -97,6 +97,10 @@ export default class LiquidityModule extends ModuleBase {
97
97
  baseIn ? poolInfo.mintB.symbol : poolInfo.mintA.symbol,
98
98
  "slippage:",
99
99
  `${slippage.toSignificant()}%`,
100
+ "baseReserve",
101
+ baseReserve.toString(),
102
+ "quoteReserve",
103
+ quoteReserve.toString(),
100
104
  );
101
105
 
102
106
  // input is fixed
@@ -112,12 +116,11 @@ export default class LiquidityModule extends ModuleBase {
112
116
  : divCeil(inputAmount.mul(baseReserve), quoteReserve);
113
117
  }
114
118
 
115
- const liquidity = divCeil(
116
- inputAmount.mul(lpAmount),
117
- new BN(input === "base" ? poolInfo.mintAmountA : poolInfo.mintAmountB).mul(
118
- new BN(10).pow(new BN(poolInfo[input === "base" ? "mintA" : "mintB"].decimals)),
119
- ),
120
- );
119
+ this.logDebug("amountRaw:", amountRaw.toString(), "lpAmount:", lpAmount.toString());
120
+
121
+ const liquidity = divCeil(inputAmount.mul(lpAmount), input === "base" ? baseReserve : quoteReserve);
122
+
123
+ this.logDebug("liquidity:", liquidity.toString());
121
124
 
122
125
  const _slippage = new Percent(new BN(1)).add(slippage);
123
126
  const slippageAdjustedAmount = _slippage.mul(amountRaw).quotient;