@raydium-io/raydium-sdk-v2 0.0.36-alpha → 0.0.37-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 (49) hide show
  1. package/lib/index.d.ts +1 -1
  2. package/lib/index.js +1 -1
  3. package/lib/index.js.map +1 -1
  4. package/lib/index.mjs +1 -1
  5. package/lib/index.mjs.map +1 -1
  6. package/lib/raydium/account/account.d.ts +1 -1
  7. package/lib/raydium/clmm/clmm.d.ts +1 -1
  8. package/lib/raydium/clmm/clmm.js +1 -1
  9. package/lib/raydium/clmm/clmm.js.map +1 -1
  10. package/lib/raydium/clmm/clmm.mjs +1 -1
  11. package/lib/raydium/clmm/clmm.mjs.map +1 -1
  12. package/lib/raydium/clmm/index.d.ts +1 -1
  13. package/lib/raydium/clmm/index.js +1 -1
  14. package/lib/raydium/clmm/index.js.map +1 -1
  15. package/lib/raydium/clmm/index.mjs +1 -1
  16. package/lib/raydium/clmm/index.mjs.map +1 -1
  17. package/lib/raydium/cpmm/cpmm.d.ts +1 -1
  18. package/lib/raydium/farm/farm.d.ts +1 -1
  19. package/lib/raydium/ido/ido.d.ts +1 -1
  20. package/lib/raydium/ido/index.d.ts +1 -1
  21. package/lib/raydium/index.d.ts +1 -1
  22. package/lib/raydium/index.js +1 -1
  23. package/lib/raydium/index.js.map +1 -1
  24. package/lib/raydium/index.mjs +1 -1
  25. package/lib/raydium/index.mjs.map +1 -1
  26. package/lib/raydium/liquidity/liquidity.d.ts +1 -1
  27. package/lib/raydium/marketV2/createMarket.d.ts +1 -1
  28. package/lib/raydium/marketV2/index.d.ts +1 -1
  29. package/lib/raydium/moduleBase.d.ts +1 -1
  30. package/lib/raydium/raydium.d.ts +1 -1
  31. package/lib/raydium/raydium.js +1 -1
  32. package/lib/raydium/raydium.js.map +1 -1
  33. package/lib/raydium/raydium.mjs +1 -1
  34. package/lib/raydium/raydium.mjs.map +1 -1
  35. package/lib/raydium/token/token.d.ts +1 -1
  36. package/lib/raydium/tradeV2/index.js +1 -1
  37. package/lib/raydium/tradeV2/index.js.map +1 -1
  38. package/lib/raydium/tradeV2/index.mjs +1 -1
  39. package/lib/raydium/tradeV2/index.mjs.map +1 -1
  40. package/lib/raydium/tradeV2/instrument.js +1 -1
  41. package/lib/raydium/tradeV2/instrument.js.map +1 -1
  42. package/lib/raydium/tradeV2/instrument.mjs +1 -1
  43. package/lib/raydium/tradeV2/instrument.mjs.map +1 -1
  44. package/lib/raydium/tradeV2/trade.d.ts +1 -1
  45. package/lib/raydium/utils1216/index.d.ts +1 -1
  46. package/lib/raydium/utils1216/utils1216.d.ts +1 -1
  47. package/lib/{raydium-5d4faf36.d.ts → raydium-3aa078dd.d.ts} +6 -1
  48. package/package.json +1 -1
  49. package/src/raydium/clmm/clmm.ts +19 -1
@@ -1,5 +1,5 @@
1
1
  import '@solana/web3.js';
2
- export { i as default } from '../../raydium-5d4faf36.js';
2
+ export { i as default } from '../../raydium-3aa078dd.js';
3
3
  import './type.js';
4
4
  import '../../type-541fc296.js';
5
5
  import '../../api/api.js';
@@ -1,4 +1,4 @@
1
- export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-5d4faf36.js';
1
+ export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-3aa078dd.js';
2
2
  import '@solana/web3.js';
3
3
  import '../../api/api.js';
4
4
  import 'axios';
@@ -1,7 +1,7 @@
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-5d4faf36.js';
4
+ export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-3aa078dd.js';
5
5
  import '../../marshmallow/buffer-layout.js';
6
6
  import '../../api/api.js';
7
7
  import 'axios';
@@ -11,7 +11,7 @@ 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
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';
14
- import { ClmmPositionLayout, PositionInfoLayout } from './raydium/clmm/layout.js';
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';
17
17
  import { PoolAccountInfoV4, ReturnTypeGetAddLiquidityDefaultPool } from './raydium/tradeV2/type.js';
@@ -221,6 +221,11 @@ declare class Clmm extends ModuleBase {
221
221
  getOwnerPositionInfo({ programId, }: {
222
222
  programId: string | PublicKey;
223
223
  }): Promise<ReturnType<typeof PositionInfoLayout.decode>[]>;
224
+ getRpcClmmPoolInfo({ poolId, }: {
225
+ poolId: string | PublicKey;
226
+ }): Promise<ReturnType<typeof PoolInfoLayout.decode> & {
227
+ currentPrice: number;
228
+ }>;
224
229
  }
225
230
 
226
231
  declare class CpmmModule extends ModuleBase {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raydium-io/raydium-sdk-v2",
3
- "version": "0.0.36-alpha",
3
+ "version": "0.0.37-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",
@@ -32,7 +32,7 @@ import { ClmmInstrument } from "./instrument";
32
32
  import { MakeTransaction } from "../type";
33
33
  import { MathUtil } from "./utils/math";
34
34
  import { getPdaOperationAccount, getPdaPersonalPositionAddress } from "./utils/pda";
35
- import { ClmmPositionLayout, OperationLayout, PositionInfoLayout } from "./layout";
35
+ import { ClmmPositionLayout, OperationLayout, PositionInfoLayout, PoolInfoLayout } from "./layout";
36
36
  import BN from "bn.js";
37
37
 
38
38
  export class Clmm extends ModuleBase {
@@ -1308,6 +1308,24 @@ export class Clmm extends ModuleBase {
1308
1308
  return allPosition;
1309
1309
  }
1310
1310
 
1311
+ public async getRpcClmmPoolInfo({
1312
+ poolId,
1313
+ }: {
1314
+ poolId: string | PublicKey;
1315
+ }): Promise<ReturnType<typeof PoolInfoLayout.decode> & { currentPrice: number }> {
1316
+ const account = await this.scope.connection.getAccountInfo(new PublicKey(poolId));
1317
+ const rpc = PoolInfoLayout.decode(account!.data);
1318
+ const currentPrice = SqrtPriceMath.sqrtPriceX64ToPrice(
1319
+ rpc.sqrtPriceX64,
1320
+ rpc.mintDecimalsA,
1321
+ rpc.mintDecimalsB,
1322
+ ).toNumber();
1323
+ return {
1324
+ ...rpc,
1325
+ currentPrice,
1326
+ };
1327
+ }
1328
+
1311
1329
  /*
1312
1330
  public async computeAmountIn({
1313
1331
  poolInfo,