@raydium-io/raydium-sdk-v2 0.0.25-alpha → 0.0.26-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 (37) 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/index.d.ts +1 -1
  9. package/lib/raydium/cpmm/cpmm.d.ts +1 -1
  10. package/lib/raydium/cpmm/cpmm.js +1 -1
  11. package/lib/raydium/cpmm/cpmm.js.map +1 -1
  12. package/lib/raydium/cpmm/cpmm.mjs +1 -1
  13. package/lib/raydium/cpmm/cpmm.mjs.map +1 -1
  14. package/lib/raydium/farm/farm.d.ts +1 -1
  15. package/lib/raydium/ido/ido.d.ts +1 -1
  16. package/lib/raydium/ido/index.d.ts +1 -1
  17. package/lib/raydium/index.d.ts +1 -1
  18. package/lib/raydium/index.js +1 -1
  19. package/lib/raydium/index.js.map +1 -1
  20. package/lib/raydium/index.mjs +1 -1
  21. package/lib/raydium/index.mjs.map +1 -1
  22. package/lib/raydium/liquidity/liquidity.d.ts +1 -1
  23. package/lib/raydium/marketV2/createMarket.d.ts +1 -1
  24. package/lib/raydium/marketV2/index.d.ts +1 -1
  25. package/lib/raydium/moduleBase.d.ts +1 -1
  26. package/lib/raydium/raydium.d.ts +1 -1
  27. package/lib/raydium/raydium.js +1 -1
  28. package/lib/raydium/raydium.js.map +1 -1
  29. package/lib/raydium/raydium.mjs +1 -1
  30. package/lib/raydium/raydium.mjs.map +1 -1
  31. package/lib/raydium/token/token.d.ts +1 -1
  32. package/lib/raydium/tradeV2/trade.d.ts +1 -1
  33. package/lib/raydium/utils1216/index.d.ts +1 -1
  34. package/lib/raydium/utils1216/utils1216.d.ts +1 -1
  35. package/lib/{raydium-1fe6ab0b.d.ts → raydium-d75706f4.d.ts} +3 -2
  36. package/package.json +1 -1
  37. package/src/raydium/cpmm/cpmm.ts +14 -2
@@ -1,6 +1,6 @@
1
1
  import '@solana/web3.js';
2
2
  import '../../type-83523f5f.js';
3
- export { j as default } from '../../raydium-1fe6ab0b.js';
3
+ export { j as default } from '../../raydium-d75706f4.js';
4
4
  import 'bn.js';
5
5
  import '@solana/spl-token';
6
6
  import '../../common/txTool/txType.js';
@@ -1,5 +1,5 @@
1
1
  import '@solana/web3.js';
2
- export { i as default } from '../../raydium-1fe6ab0b.js';
2
+ export { i as default } from '../../raydium-d75706f4.js';
3
3
  import './type.js';
4
4
  import '../../type-83523f5f.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-1fe6ab0b.js';
1
+ export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-d75706f4.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-1fe6ab0b.js';
4
+ export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-d75706f4.js';
5
5
  import '../../marshmallow/buffer-layout.js';
6
6
  import '../../api/api.js';
7
7
  import 'axios';
@@ -12,7 +12,7 @@ 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-6fd96950.js';
14
14
  import { ClmmPositionLayout } from './raydium/clmm/layout.js';
15
- import { CreateCpmmPoolParam, CreateCpmmPoolAddress, AddCpmmLiquidityParams, WithdrawCpmmLiquidityParams, CpmmSwapParams, ComputePairAmountParams } from './raydium/cpmm/type.js';
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';
18
18
  import { Structure } from './marshmallow/index.js';
@@ -224,9 +224,10 @@ declare class CpmmModule extends ModuleBase {
224
224
  constructor(params: ModuleBaseProps);
225
225
  load(): Promise<void>;
226
226
  getCpmmPoolKeys(poolId: string): Promise<CpmmKeys>;
227
- getRpcPoolInfo(poolId: string): Promise<ReturnType<typeof CpmmPoolInfoLayout.decode> & {
227
+ getRpcPoolInfo(poolId: string, fetchConfigInfo?: boolean): Promise<ReturnType<typeof CpmmPoolInfoLayout.decode> & {
228
228
  baseReserve: BN__default;
229
229
  quoteReserve: BN__default;
230
+ configInfo?: CpmmConfigInfoInterface;
230
231
  }>;
231
232
  createPool<T extends TxVersion>({ programId, poolFeeAccount, startTime, ownerInfo, associatedOnly, checkCreateATAOwner, txVersion, computeBudgetConfig, ...params }: CreateCpmmPoolParam<T>): Promise<MakeTxData<T, {
232
233
  address: CreateCpmmPoolAddress;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raydium-io/raydium-sdk-v2",
3
- "version": "0.0.25-alpha",
3
+ "version": "0.0.26-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",
@@ -17,6 +17,7 @@ import {
17
17
  WithdrawCpmmLiquidityParams,
18
18
  CpmmSwapParams,
19
19
  ComputePairAmountParams,
20
+ CpmmConfigInfoInterface,
20
21
  } from "./type";
21
22
  import { getCreatePoolKeys, getPdaObservationId } from "./pda";
22
23
  import {
@@ -27,7 +28,7 @@ import {
27
28
  makeSwapCpmmBaseOutInInstruction,
28
29
  } from "./instruction";
29
30
  import BN from "bn.js";
30
- import { CpmmPoolInfoLayout } from "./layout";
31
+ import { CpmmPoolInfoLayout, CpmmConfigInfoLayout } from "./layout";
31
32
  import Decimal from "decimal.js";
32
33
 
33
34
  export default class CpmmModule extends ModuleBase {
@@ -43,10 +44,14 @@ export default class CpmmModule extends ModuleBase {
43
44
  return ((await this.scope.api.fetchPoolKeysById({ idList: [poolId] })) as CpmmKeys[])[0];
44
45
  }
45
46
 
46
- public async getRpcPoolInfo(poolId: string): Promise<
47
+ public async getRpcPoolInfo(
48
+ poolId: string,
49
+ fetchConfigInfo?: boolean,
50
+ ): Promise<
47
51
  ReturnType<typeof CpmmPoolInfoLayout.decode> & {
48
52
  baseReserve: BN;
49
53
  quoteReserve: BN;
54
+ configInfo?: CpmmConfigInfoInterface;
50
55
  }
51
56
  > {
52
57
  const accountData = await this.scope.connection.getAccountInfo(new PublicKey(poolId));
@@ -60,6 +65,12 @@ export default class CpmmModule extends ModuleBase {
60
65
  if (!poolVaultAState) throw new Error(`pool vaultA info not found: ${poolInfo.vaultA.toBase58()}`);
61
66
  if (!poolVaultBState) throw new Error(`pool vaultB info not found: ${poolInfo.vaultB.toBase58()}`);
62
67
 
68
+ let configInfo: CpmmConfigInfoInterface | undefined;
69
+ if (fetchConfigInfo) {
70
+ const configState = await this.scope.connection.getAccountInfo(poolInfo.configId);
71
+ if (configState) configInfo = CpmmConfigInfoLayout.decode(configState.data);
72
+ }
73
+
63
74
  return {
64
75
  ...poolInfo,
65
76
  baseReserve: new BN(AccountLayout.decode(poolVaultAState.data).amount.toString())
@@ -68,6 +79,7 @@ export default class CpmmModule extends ModuleBase {
68
79
  quoteReserve: new BN(AccountLayout.decode(poolVaultBState.data).amount.toString())
69
80
  .sub(poolInfo.protocolFeesMintB)
70
81
  .sub(poolInfo.fundFeesMintB),
82
+ configInfo,
71
83
  };
72
84
  }
73
85