@raydium-io/raydium-sdk-v2 0.0.42-alpha → 0.0.43-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raydium-io/raydium-sdk-v2",
3
- "version": "0.0.42-alpha",
3
+ "version": "0.0.43-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
@@ -244,11 +244,6 @@ export class Api {
244
244
  ];
245
245
  const [baseMint, quoteMint] = mint2 && mint1 > mint2 ? [mint2, mint1] : [mint1, mint2];
246
246
 
247
- console.log(
248
- 123123555,
249
- `?mint1=${baseMint}&mint2=${quoteMint}&poolType=${type}&poolSortField=${sort}&sortType=${order}&pageSize=100&page=${page}`,
250
- );
251
-
252
247
  const res = await this.api.get(
253
248
  (this.urlConfigs.POOL_SEARCH_MINT || API_URLS.POOL_SEARCH_MINT) +
254
249
  `?mint1=${baseMint}&mint2=${quoteMint}&poolType=${type}&poolSortField=${sort}&sortType=${order}&pageSize=100&page=${page}`,
@@ -7,7 +7,7 @@ import { MakeMultiTxData, TxBuildData, TxV0BuildData } from "@/common/txTool/txT
7
7
  import { generatePubKey } from "../account/util";
8
8
  import { BN_ZERO } from "@/common/bignumber";
9
9
  import { makeCreateMarketInstruction } from "./instrument";
10
- import { ComputeBudgetConfig } from "@/raydium/type";
10
+ import { ComputeBudgetConfig, MakeMultiTransaction } from "@/raydium/type";
11
11
 
12
12
  interface ExtInfo {
13
13
  address: {
@@ -105,29 +105,30 @@ export default class MarketV2 extends ModuleBase {
105
105
  },
106
106
  });
107
107
  const txBuilder = this.createTxBuilder();
108
- txBuilder.addCustomComputeBudget(computeBudgetConfig);
108
+ // txBuilder.addCustomComputeBudget(computeBudgetConfig);
109
109
  txBuilder.addInstruction({
110
110
  instructions: allTxArr[0].transaction.instructions,
111
111
  signers: allTxArr[0].signer,
112
112
  });
113
113
 
114
- const extraTxBuildData: any[] = [];
114
+ // const extraTxBuildData: any[] = [];
115
115
 
116
116
  for await (const txData of allTxArr.slice(1, allTxArr.length)) {
117
- const extraTxBuilder = this.createTxBuilder();
118
- extraTxBuilder.addCustomComputeBudget(computeBudgetConfig);
119
- extraTxBuilder.addInstruction({
117
+ // const extraTxBuilder = this.createTxBuilder();
118
+ // extraTxBuilder.addCustomComputeBudget(computeBudgetConfig);
119
+ txBuilder.addInstruction({
120
120
  instructions: txData.transaction.instructions,
121
121
  signers: txData.signer,
122
122
  instructionTypes: txData.instructionTypes,
123
123
  });
124
- const build = await extraTxBuilder.versionBuild({ txVersion });
125
- extraTxBuildData.push(build);
124
+
125
+ // const build = await extraTxBuilder.versionBuild({ txVersion });
126
+ // extraTxBuildData.push(build);
126
127
  }
127
128
 
128
- return txBuilder.versionMultiBuild<T, ExtInfo>({
129
- extraPreBuildData: extraTxBuildData,
130
- extInfo: {
129
+ if (txVersion === TxVersion.V0)
130
+ return txBuilder.sizeCheckBuildV0({
131
+ computeBudgetConfig,
131
132
  address: {
132
133
  marketId: market.publicKey,
133
134
  requestQueue: requestQueue.publicKey,
@@ -139,8 +140,21 @@ export default class MarketV2 extends ModuleBase {
139
140
  baseMint: new PublicKey(baseInfo.mint),
140
141
  quoteMin: new PublicKey(quoteInfo.mint),
141
142
  },
143
+ }) as Promise<MakeMultiTxData<T, ExtInfo>>;
144
+
145
+ return txBuilder.sizeCheckBuild({
146
+ computeBudgetConfig,
147
+ address: {
148
+ marketId: market.publicKey,
149
+ requestQueue: requestQueue.publicKey,
150
+ eventQueue: eventQueue.publicKey,
151
+ bids: bids.publicKey,
152
+ asks: asks.publicKey,
153
+ baseVault: baseVault.publicKey,
154
+ quoteVault: quoteVault.publicKey,
155
+ baseMint: new PublicKey(baseInfo.mint),
156
+ quoteMin: new PublicKey(quoteInfo.mint),
142
157
  },
143
- txVersion,
144
158
  }) as Promise<MakeMultiTxData<T, ExtInfo>>;
145
159
  }
146
160
  }