@raydium-io/raydium-sdk-v2 0.0.21-alpha → 0.0.23-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-9f713012.d.ts → raydium-97f3539d.d.ts} +1 -1
  36. package/package.json +1 -1
  37. package/src/raydium/cpmm/cpmm.ts +10 -4
@@ -1,6 +1,6 @@
1
1
  import '@solana/web3.js';
2
2
  import '../../type-2bed92a9.js';
3
- export { j as default } from '../../raydium-9f713012.js';
3
+ export { j as default } from '../../raydium-97f3539d.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-9f713012.js';
2
+ export { i as default } from '../../raydium-97f3539d.js';
3
3
  import './type.js';
4
4
  import '../../type-2bed92a9.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-9f713012.js';
1
+ export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-97f3539d.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-9f713012.js';
4
+ export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-97f3539d.js';
5
5
  import '../../marshmallow/buffer-layout.js';
6
6
  import '../../api/api.js';
7
7
  import 'axios';
@@ -228,7 +228,7 @@ declare class CpmmModule extends ModuleBase {
228
228
  baseReserve: BN__default;
229
229
  quoteReserve: BN__default;
230
230
  }>;
231
- createPool<T extends TxVersion>({ programId, poolFeeAccount, mintA, mintB, mintAAmount, mintBAmount, startTime, ownerInfo, associatedOnly, checkCreateATAOwner, txVersion, computeBudgetConfig, }: CreateCpmmPoolParam<T>): Promise<MakeTxData<T, {
231
+ createPool<T extends TxVersion>({ programId, poolFeeAccount, startTime, ownerInfo, associatedOnly, checkCreateATAOwner, txVersion, computeBudgetConfig, ...params }: CreateCpmmPoolParam<T>): Promise<MakeTxData<T, {
232
232
  address: CreateCpmmPoolAddress;
233
233
  }>>;
234
234
  addLiquidity<T extends TxVersion>(params: AddCpmmLiquidityParams<T>): Promise<MakeTxData<T>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raydium-io/raydium-sdk-v2",
3
- "version": "0.0.21-alpha",
3
+ "version": "0.0.23-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",
@@ -73,18 +73,24 @@ export default class CpmmModule extends ModuleBase {
73
73
  public async createPool<T extends TxVersion>({
74
74
  programId,
75
75
  poolFeeAccount,
76
- mintA,
77
- mintB,
78
- mintAAmount,
79
- mintBAmount,
80
76
  startTime,
81
77
  ownerInfo,
82
78
  associatedOnly = false,
83
79
  checkCreateATAOwner = false,
84
80
  txVersion,
85
81
  computeBudgetConfig,
82
+ ...params
86
83
  }: CreateCpmmPoolParam<T>): Promise<MakeTxData<T, { address: CreateCpmmPoolAddress }>> {
87
84
  const payer = ownerInfo.feePayer || this.scope.owner?.publicKey;
85
+ const isFront = new BN(new PublicKey(params.mintA.address).toBuffer()).lte(
86
+ new BN(new PublicKey(params.mintB.address).toBuffer()),
87
+ );
88
+
89
+ const [mintA, mintB] = isFront ? [params.mintA, params.mintB] : [params.mintB, params.mintA];
90
+ const [mintAAmount, mintBAmount] = isFront
91
+ ? [params.mintAAmount, params.mintBAmount]
92
+ : [params.mintBAmount, params.mintAAmount];
93
+
88
94
  const mintAUseSOLBalance = ownerInfo.useSOLBalance && mintA.address === NATIVE_MINT.toBase58();
89
95
  const mintBUseSOLBalance = ownerInfo.useSOLBalance && mintB.address === NATIVE_MINT.toBase58();
90
96
  const [mintAPubkey, mintBPubkey] = [new PublicKey(mintA.address), new PublicKey(mintB.address)];