@haven-fi/solauto-sdk 1.0.557 → 1.0.559

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":"transactionUtils.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AAoBxE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAsCzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAOlD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AA4LjD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,EACtB,sBAAsB,EAAE,MAAM,EAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAoH7B;AA2LD,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,GACrB,OAAO,CAAC,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CA0BnD;AAED,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,aAAa,oBAsDtB;AAED,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,aAAa,EACrB,2BAA2B,CAAC,EAAE,MAAM,EACpC,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAsI5C;AAED,wBAAsB,gCAAgC,CACpD,eAAe,EAAE,oBAAoB,EACrC,YAAY,EAAE,SAAS,EACvB,eAAe,EAAE,SAAS,GACzB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAsC5C;AAED,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,kBAAkB,EAAE,EACzB,KA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,6 +468,7 @@ function getErrorInfo(umi, txs, error, simulationSuccessful) {
468
468
  errName = errCode === undefined ? err[1] : undefined;
469
469
  }
470
470
  else if (error instanceof transactions_1.BundleSimulationError) {
471
+ console.log(error.details);
471
472
  errTxIdx = error.details.transactionIdx;
472
473
  errIxIdx = error.details.instructionIdx - computeIxs;
473
474
  errCode = error.details.errorCode;
@@ -1 +1 @@
1
- {"version":3,"file":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAKV,MAAM,iBAAiB,CAAC;AAMzB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,EAEH,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAYlC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAMlE,wBAAgB,mBAAmB,IAAI,SAAS,CAG/C;AAgND,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB;;;;IAkB7D;AAED,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EAAE,EACtB,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,CA+F/B"}
1
+ {"version":3,"file":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAKV,MAAM,iBAAiB,CAAC;AAMzB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,EAEH,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAYlC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAMlE,wBAAgB,mBAAmB,IAAI,SAAS,CAG/C;AA+MD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB;;;;IAkB7D;AAED,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EAAE,EACtB,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,CA+F/B"}
@@ -59,15 +59,15 @@ async function simulateJitoBundle(umi, txs) {
59
59
  },
60
60
  ]);
61
61
  if (res.value && res.value.summary.failed) {
62
- const resValue = res.result.value;
63
- const transactionResults = resValue.transactionResults;
62
+ const transactionResults = res.value
63
+ .transactionResults;
64
64
  transactionResults.forEach((x) => {
65
65
  x.logs?.forEach((y) => {
66
66
  (0, generalUtils_1.consoleLog)(y);
67
67
  });
68
68
  });
69
69
  const failedTxIdx = transactionResults.length;
70
- const txFailure = resValue.summary.failed.error.TransactionFailure;
70
+ const txFailure = res.value.summary.failed.error.TransactionFailure;
71
71
  if (txFailure) {
72
72
  const info = parseJitoErrorMessage(txFailure[1]);
73
73
  if (info) {
@@ -78,7 +78,7 @@ async function simulateJitoBundle(umi, txs) {
78
78
  });
79
79
  }
80
80
  }
81
- throw new Error(txFailure ? txFailure[1] : resValue.summary.failed.toString());
81
+ throw new Error(txFailure ? txFailure[1] : res.value.summary.failed.toString());
82
82
  }
83
83
  else if (res.error && res.error.message) {
84
84
  throw new Error(res.error.message);
@@ -205,13 +205,7 @@ async function sendJitoBundledTransactions(umi, connection, userSigner, otherSig
205
205
  builtTxs = await umiToVersionedTransactions(umi, latestBlockhash, userSigner, otherSigners, txs, true, feeEstimates, simulationResults
206
206
  ? simulationResults.map((x) => x.unitsConsumed * 1.15)
207
207
  : undefined);
208
- // consoleLog(
209
- // builtTxs.map((x) =>
210
- // x.message.compiledInstructions.map((y) =>
211
- // x.message.staticAccountKeys[y.programIdIndex].toString()
212
- // )
213
- // )
214
- // );
208
+ (0, generalUtils_1.consoleLog)(builtTxs.map((x) => x.message.compiledInstructions.map((y) => x.message.staticAccountKeys[y.programIdIndex].toString())));
215
209
  const serializedTxs = builtTxs.map((x) => x.serialize());
216
210
  if (serializedTxs.find((x) => x.length > 1232)) {
217
211
  throw new Error("A transaction is too large");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.557",
3
+ "version": "1.0.559",
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",
@@ -868,6 +868,7 @@ export function getErrorInfo(
868
868
  : undefined;
869
869
  errName = errCode === undefined ? (err[1] as string) : undefined;
870
870
  } else if (error instanceof BundleSimulationError) {
871
+ console.log(error.details);
871
872
  errTxIdx = error.details.transactionIdx;
872
873
  errIxIdx = error.details.instructionIdx - computeIxs;
873
874
  errCode = error.details.errorCode;
@@ -94,9 +94,8 @@ async function simulateJitoBundle(umi: Umi, txs: VersionedTransaction[]) {
94
94
  ]);
95
95
 
96
96
  if (res.value && res.value.summary.failed) {
97
- const resValue = res.result.value;
98
- const transactionResults =
99
- resValue.transactionResults as SimulatedTransactionResponse[];
97
+ const transactionResults = res.value
98
+ .transactionResults as SimulatedTransactionResponse[];
100
99
  transactionResults.forEach((x) => {
101
100
  x.logs?.forEach((y) => {
102
101
  consoleLog(y);
@@ -104,7 +103,7 @@ async function simulateJitoBundle(umi: Umi, txs: VersionedTransaction[]) {
104
103
  });
105
104
 
106
105
  const failedTxIdx = transactionResults.length;
107
- const txFailure = resValue.summary.failed.error.TransactionFailure;
106
+ const txFailure = res.value.summary.failed.error.TransactionFailure;
108
107
 
109
108
  if (txFailure) {
110
109
  const info = parseJitoErrorMessage(txFailure[1] as string);
@@ -122,7 +121,7 @@ async function simulateJitoBundle(umi: Umi, txs: VersionedTransaction[]) {
122
121
  }
123
122
 
124
123
  throw new Error(
125
- txFailure ? txFailure[1] : resValue.summary.failed.toString()
124
+ txFailure ? txFailure[1] : res.value.summary.failed.toString()
126
125
  );
127
126
  } else if (res.error && res.error.message) {
128
127
  throw new Error(res.error.message);
@@ -350,13 +349,13 @@ export async function sendJitoBundledTransactions(
350
349
  ? simulationResults.map((x) => x.unitsConsumed! * 1.15)
351
350
  : undefined
352
351
  );
353
- // consoleLog(
354
- // builtTxs.map((x) =>
355
- // x.message.compiledInstructions.map((y) =>
356
- // x.message.staticAccountKeys[y.programIdIndex].toString()
357
- // )
358
- // )
359
- // );
352
+ consoleLog(
353
+ builtTxs.map((x) =>
354
+ x.message.compiledInstructions.map((y) =>
355
+ x.message.staticAccountKeys[y.programIdIndex].toString()
356
+ )
357
+ )
358
+ );
360
359
 
361
360
  const serializedTxs = builtTxs.map((x) => x.serialize());
362
361
  if (serializedTxs.find((x) => x.length > 1232)) {