@haven-fi/solauto-sdk 1.0.420 → 1.0.421

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,EAGT,gBAAgB,EAEjB,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,wBAAgB,mBAAmB,IAAI,SAAS,CAa/C;AAoND,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB;;;;IAkB3D;AAED,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,CAqG/B"}
1
+ {"version":3,"file":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAGT,gBAAgB,EAEjB,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,wBAAgB,mBAAmB,IAAI,SAAS,CAa/C;AAiND,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB;;;;IAkB3D;AAED,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,CAqG/B"}
@@ -212,7 +212,8 @@ async function sendJitoBundledTransactions(umi, connection, signer, txs, txType,
212
212
  }
213
213
  if (txType !== "only-simulate") {
214
214
  const signers = [...builtTxs].map((tx) => getRequiredSigners(tx.message));
215
- if (Array.from(new Set(signers.flatMap(x => x).filter(x => x.publicKey))).length > 1) {
215
+ if (Array.from(new Set(signers.flatMap((x) => x).filter((x) => x.publicKey)))
216
+ .length > 1) {
216
217
  (0, generalUtils_1.consoleLog)("Signers:", signers);
217
218
  throw new Error("Unexpected error 301. Please retry.");
218
219
  }
@@ -224,13 +225,8 @@ async function sendJitoBundledTransactions(umi, connection, signer, txs, txType,
224
225
  if (serializedTxs.find((x) => x.length > 1232)) {
225
226
  throw new Error("A transaction is too large");
226
227
  }
227
- console.log(serializedTxs.map((x) => bs58_1.default.encode(x)));
228
- // const txSigs = await sendJitoBundle(
229
- // umi,
230
- // serializedTxs.map((x) => base58.encode(x))
231
- // );
232
- // return txSigs.length > 0 ? txSigs : undefined;
233
- return ["test"];
228
+ const txSigs = await sendJitoBundle(umi, serializedTxs.map((x) => bs58_1.default.encode(x)));
229
+ return txSigs.length > 0 ? txSigs : undefined;
234
230
  }
235
231
  return undefined;
236
232
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.420",
3
+ "version": "1.0.421",
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",
@@ -229,15 +229,12 @@ async function sendJitoBundle(
229
229
  ): Promise<string[]> {
230
230
  let resp: any;
231
231
  try {
232
- resp = await axios.post<{ result: string }>(
233
- umi.rpc.getEndpoint(),
234
- {
235
- jsonrpc: "2.0",
236
- id: 1,
237
- method: "sendBundle",
238
- params: [transactions],
239
- }
240
- );
232
+ resp = await axios.post<{ result: string }>(umi.rpc.getEndpoint(), {
233
+ jsonrpc: "2.0",
234
+ id: 1,
235
+ method: "sendBundle",
236
+ params: [transactions],
237
+ });
241
238
  } catch (e: any) {
242
239
  if (e.response.data.error) {
243
240
  console.error("Jito send bundle error:", e.response.data.error);
@@ -346,7 +343,10 @@ export async function sendJitoBundledTransactions(
346
343
 
347
344
  if (txType !== "only-simulate") {
348
345
  const signers = [...builtTxs].map((tx) => getRequiredSigners(tx.message));
349
- if (Array.from(new Set(signers.flatMap(x => x).filter(x => x.publicKey))).length > 1) {
346
+ if (
347
+ Array.from(new Set(signers.flatMap((x) => x).filter((x) => x.publicKey)))
348
+ .length > 1
349
+ ) {
350
350
  consoleLog("Signers:", signers);
351
351
  throw new Error("Unexpected error 301. Please retry.");
352
352
  }
@@ -370,14 +370,11 @@ export async function sendJitoBundledTransactions(
370
370
  throw new Error("A transaction is too large");
371
371
  }
372
372
 
373
- console.log(serializedTxs.map((x) => base58.encode(x)));
374
-
375
- // const txSigs = await sendJitoBundle(
376
- // umi,
377
- // serializedTxs.map((x) => base58.encode(x))
378
- // );
379
- // return txSigs.length > 0 ? txSigs : undefined;
380
- return ["test"];
373
+ const txSigs = await sendJitoBundle(
374
+ umi,
375
+ serializedTxs.map((x) => base58.encode(x))
376
+ );
377
+ return txSigs.length > 0 ? txSigs : undefined;
381
378
  }
382
379
 
383
380
  return undefined;