@haven-fi/solauto-sdk 1.0.472 → 1.0.474

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;AAOzD,OAAO,EAIL,eAAe,EAChB,MAAM,iCAAiC,CAAC;AA0BzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAOlD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AA6LjD,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,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,eAAe,oBAqDlG;AAED,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,aAAa,EACrB,2BAA2B,CAAC,EAAE,MAAM,EACpC,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAqI5C;AAED,wBAAsB,gCAAgC,CACpD,eAAe,EAAE,oBAAoB,EACrC,YAAY,EAAE,SAAS,EACvB,eAAe,EAAE,SAAS,GACzB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAsC5C;AAED,wBA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AED,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,kBAAkB,EAAE,EACzB,KAAK,EAAE,KAAK,EACZ,oBAAoB,CAAC,EAAE,OAAO;;;;EAoG/B"}
@@ -487,7 +487,7 @@ function getErrorInfo(umi, txs, error, simulationSuccessful) {
487
487
  (0, generalUtils_1.consoleLog)("Error instruction program:", errIx?.programId.toString());
488
488
  const solautoError = (0, generated_1.getSolautoErrorFromCode)(errCode ?? -1, (0, generated_1.createSolautoProgram)());
489
489
  const marginfiError = (0, marginfi_sdk_1.getMarginfiErrorFromCode)(errCode ?? -1, (0, marginfi_sdk_1.createMarginfiProgram)());
490
- if (errCode &&
490
+ if (errCode !== undefined &&
491
491
  errIx?.programId.toString() ===
492
492
  umi.programs.get("solauto").publicKey.toString()) {
493
493
  programError = solautoError ?? marginfiError;
@@ -497,11 +497,11 @@ function getErrorInfo(umi, txs, error, simulationSuccessful) {
497
497
  canBeIgnored = true;
498
498
  }
499
499
  }
500
- else if (errCode && errIx?.programId === marginfi_sdk_1.MARGINFI_PROGRAM_ID) {
500
+ else if (errCode !== undefined && errIx?.programId === marginfi_sdk_1.MARGINFI_PROGRAM_ID) {
501
501
  programName = "Marginfi";
502
502
  programError = marginfiError;
503
503
  }
504
- else if (errCode && errIx?.programId === jupiter_sdk_1.JUPITER_PROGRAM_ID) {
504
+ else if (errCode !== undefined && errIx?.programId === jupiter_sdk_1.JUPITER_PROGRAM_ID) {
505
505
  programName = "Jupiter";
506
506
  programError = (0, jupiter_sdk_1.getJupiterErrorFromCode)(errCode, (0, jupiter_sdk_1.createJupiterProgram)());
507
507
  }
@@ -517,9 +517,11 @@ function getErrorInfo(umi, txs, error, simulationSuccessful) {
517
517
  catch (e) {
518
518
  (0, generalUtils_1.consoleLog)(e);
519
519
  }
520
- return {
521
- errorName: errorName,
522
- errorInfo: errorInfo,
520
+ const errData = {
521
+ errorName,
522
+ errorInfo,
523
523
  canBeIgnored,
524
524
  };
525
+ (0, generalUtils_1.consoleLog)(errData);
526
+ return errData;
525
527
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.472",
3
+ "version": "1.0.474",
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",
@@ -903,7 +903,7 @@ export function getErrorInfo(
903
903
  );
904
904
 
905
905
  if (
906
- errCode &&
906
+ errCode !== undefined &&
907
907
  errIx?.programId.toString() ===
908
908
  umi.programs.get("solauto").publicKey.toString()
909
909
  ) {
@@ -915,10 +915,10 @@ export function getErrorInfo(
915
915
  ) {
916
916
  canBeIgnored = true;
917
917
  }
918
- } else if (errCode && errIx?.programId === MARGINFI_PROGRAM_ID) {
918
+ } else if (errCode !== undefined && errIx?.programId === MARGINFI_PROGRAM_ID) {
919
919
  programName = "Marginfi";
920
920
  programError = marginfiError;
921
- } else if (errCode && errIx?.programId === JUPITER_PROGRAM_ID) {
921
+ } else if (errCode !== undefined && errIx?.programId === JUPITER_PROGRAM_ID) {
922
922
  programName = "Jupiter";
923
923
  programError = getJupiterErrorFromCode(errCode, createJupiterProgram());
924
924
  }
@@ -934,9 +934,12 @@ export function getErrorInfo(
934
934
  consoleLog(e);
935
935
  }
936
936
 
937
- return {
938
- errorName: errorName,
939
- errorInfo: errorInfo,
937
+ const errData = {
938
+ errorName,
939
+ errorInfo,
940
940
  canBeIgnored,
941
941
  };
942
+ consoleLog(errData);
943
+
944
+ return errData;
942
945
  }