@haven-fi/solauto-sdk 1.0.406 → 1.0.408

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.
@@ -1 +1 @@
1
- {"version":3,"file":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAIV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,EAEJ,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAMlE,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,SAAS,CAAC,CAa9D;AAiND,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,kBAAkB,EAAE,EACzB,MAAM,CAAC,EAAE,kBAAkB,EAC3B,kBAAkB,GAAE,kBAA2C,EAC/D,cAAc,CAAC,EAAE,MAAM,IAAI,GAC1B,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CA6E/B"}
1
+ {"version":3,"file":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAIV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,EAEJ,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAMlE,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,SAAS,CAAC,CAa9D;AAqND,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,kBAAkB,EAAE,EACzB,MAAM,CAAC,EAAE,kBAAkB,EAC3B,kBAAkB,GAAE,kBAA2C,EAC/D,cAAc,CAAC,EAAE,MAAM,IAAI,GAC1B,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAwF/B"}
@@ -153,7 +153,9 @@ async function pollBundleStatus(bundleId, interval = 1000, timeout = 40000) {
153
153
  async function sendJitoBundle(umi, transactions) {
154
154
  let resp;
155
155
  try {
156
- resp = await axios_1.default.post(umi.rpc.getEndpoint(), {
156
+ resp = await axios_1.default.post(
157
+ // umi.rpc.getEndpoint(),
158
+ `${solautoConstants_1.JITO_BLOCK_ENGINE}/api/v1/bundles`, {
157
159
  jsonrpc: "2.0",
158
160
  id: 1,
159
161
  method: "sendBundle",
@@ -183,14 +185,14 @@ async function sendJitoBundledTransactions(umi, connection, signer, txs, txType,
183
185
  (0, generalUtils_1.consoleLog)("Transaction sizes: ", txs.map((x) => x.getTransactionSize(umi)));
184
186
  txs[0] = txs[0].prepend(await getTipInstruction(signer, 150000));
185
187
  const feeEstimates = priorityFeeSetting !== types_1.PriorityFeeSetting.None
186
- ? await Promise.all(txs.map(async (x) => (await (0, solanaUtils_1.getComputeUnitPriceEstimate)(umi, x, priorityFeeSetting, true)) ??
187
- 1000000))
188
+ ? await Promise.all(txs.map(async (x) => (await (0, solanaUtils_1.getComputeUnitPriceEstimate)(umi, x, priorityFeeSetting, true)) ?? 1000000))
188
189
  : undefined;
189
190
  const latestBlockhash = (await umi.rpc.getLatestBlockhash({ commitment: "confirmed" })).blockhash;
190
191
  let builtTxs;
191
192
  let simulationResults;
192
193
  if (txType !== "skip-simulation") {
193
- builtTxs = await umiToVersionedTransactions(umi, latestBlockhash, signer, txs, false, feeEstimates);
194
+ builtTxs = await umiToVersionedTransactions(umi, latestBlockhash, signer, txs, true, // REVERT ME
195
+ feeEstimates);
194
196
  (0, generalUtils_1.consoleLog)(builtTxs.map((x) => x.message.compiledInstructions.map((y) => x.message.staticAccountKeys[y.programIdIndex].toString())));
195
197
  simulationResults = await simulateJitoBundle(umi, builtTxs);
196
198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.406",
3
+ "version": "1.0.408",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "Typescript SDK for the Solauto program on the Solana blockchain",
@@ -228,12 +228,16 @@ async function sendJitoBundle(
228
228
  ): Promise<string[]> {
229
229
  let resp: any;
230
230
  try {
231
- resp = await axios.post<{ result: string }>(umi.rpc.getEndpoint(), {
232
- jsonrpc: "2.0",
233
- id: 1,
234
- method: "sendBundle",
235
- params: [transactions],
236
- });
231
+ resp = await axios.post<{ result: string }>(
232
+ // umi.rpc.getEndpoint(),
233
+ `${JITO_BLOCK_ENGINE}/api/v1/bundles`,
234
+ {
235
+ jsonrpc: "2.0",
236
+ id: 1,
237
+ method: "sendBundle",
238
+ params: [transactions],
239
+ }
240
+ );
237
241
  } catch (e: any) {
238
242
  if (e.response.data.error) {
239
243
  console.error("Jito send bundle error:", e.response.data.error);
@@ -258,7 +262,14 @@ export async function sendJitoBundledTransactions(
258
262
  onAwaitingSign?: () => void
259
263
  ): Promise<string[] | undefined> {
260
264
  if (txs.length === 1) {
261
- const resp = await sendSingleOptimizedTransaction(umi, connection, txs[0], txType, priorityFeeSetting, onAwaitingSign);
265
+ const resp = await sendSingleOptimizedTransaction(
266
+ umi,
267
+ connection,
268
+ txs[0],
269
+ txType,
270
+ priorityFeeSetting,
271
+ onAwaitingSign
272
+ );
262
273
  return resp ? [bs58.encode(resp)] : undefined;
263
274
  }
264
275
 
@@ -275,8 +286,12 @@ export async function sendJitoBundledTransactions(
275
286
  ? await Promise.all(
276
287
  txs.map(
277
288
  async (x) =>
278
- (await getComputeUnitPriceEstimate(umi, x, priorityFeeSetting, true)) ??
279
- 1000000
289
+ (await getComputeUnitPriceEstimate(
290
+ umi,
291
+ x,
292
+ priorityFeeSetting,
293
+ true
294
+ )) ?? 1000000
280
295
  )
281
296
  )
282
297
  : undefined;
@@ -293,7 +308,7 @@ export async function sendJitoBundledTransactions(
293
308
  latestBlockhash,
294
309
  signer,
295
310
  txs,
296
- false,
311
+ true, // REVERT ME
297
312
  feeEstimates
298
313
  );
299
314
  consoleLog(