@haven-fi/solauto-sdk 1.0.249 → 1.0.250

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"transactionUtils.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,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,EAAa,MAAM,YAAY,CAAC;AAO7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAqLjD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,EACtB,sBAAsB,EAAE,MAAM,EAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAkH7B;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,oBA2CzE;AAED,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,aAAa,EACrB,2BAA2B,CAAC,EAAE,MAAM,EACpC,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAsH5C;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,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG;;;;EAuDxE"}
1
+ {"version":3,"file":"transactionUtils.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AAmBxE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAqCzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAOlD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAqLjD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,EACtB,sBAAsB,EAAE,MAAM,EAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAkH7B;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,oBA2CzE;AAED,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,aAAa,EACrB,2BAA2B,CAAC,EAAE,MAAM,EACpC,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAsH5C;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,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG;;;;EAuDxE"}
@@ -454,11 +454,11 @@ function getErrorInfo(umi, tx, error) {
454
454
  }
455
455
  else if (errIx.programId === marginfi_sdk_1.MARGINFI_PROGRAM_ID) {
456
456
  programName = "Marginfi";
457
- programError = (0, marginfi_sdk_1.getMarginfiErrorFromName)(errCode, (0, marginfi_sdk_1.createMarginfiProgram)());
457
+ programError = (0, marginfi_sdk_1.getMarginfiErrorFromCode)(errCode, (0, marginfi_sdk_1.createMarginfiProgram)());
458
458
  }
459
459
  else if (errIx.programId === jupiter_sdk_1.JUPITER_PROGRAM_ID) {
460
460
  programName = "Jupiter";
461
- programError = (0, jupiter_sdk_1.getJupiterErrorFromName)(errCode, (0, jupiter_sdk_1.createJupiterProgram)());
461
+ programError = (0, jupiter_sdk_1.getJupiterErrorFromCode)(errCode, (0, jupiter_sdk_1.createJupiterProgram)());
462
462
  }
463
463
  if (errName && errCode === undefined) {
464
464
  errorName = `${programName ?? "Program"} error`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.249",
3
+ "version": "1.0.250",
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",
@@ -15,7 +15,6 @@ import {
15
15
  import {
16
16
  InvalidRebalanceConditionError,
17
17
  LendingPlatform,
18
- RebalanceDirection,
19
18
  SolautoAction,
20
19
  SolautoRebalanceType,
21
20
  TokenType,
@@ -47,7 +46,6 @@ import {
47
46
  } from "../utils/generalUtils";
48
47
  import { SolautoMarginfiClient } from "../clients/solautoMarginfiClient";
49
48
  import {
50
- fromBaseUnit,
51
49
  getMaxLiqUtilizationRateBps,
52
50
  uint8ArrayToBigInt,
53
51
  } from "../utils/numberUtils";
@@ -62,16 +60,16 @@ import {
62
60
  getLendingAccountDepositInstructionDataSerializer,
63
61
  getLendingAccountRepayInstructionDataSerializer,
64
62
  getLendingAccountWithdrawInstructionDataSerializer,
65
- getMarginfiErrorFromName,
63
+ getMarginfiErrorFromCode,
66
64
  MARGINFI_PROGRAM_ID,
67
65
  } from "../marginfi-sdk";
68
- import { ReferralStateManager, TxHandler } from "../clients";
66
+ import { ReferralStateManager } from "../clients";
69
67
  import {
70
68
  createJupiterProgram,
71
- getJupiterErrorFromName,
69
+ getJupiterErrorFromCode,
72
70
  JUPITER_PROGRAM_ID,
73
71
  } from "../jupiter-sdk";
74
- import { MIN_USD_SUPPORTED_POSITION, PRICES, USD_DECIMALS } from "../constants";
72
+ import { PRICES } from "../constants";
75
73
  import { TransactionItemInputs } from "../types";
76
74
 
77
75
  interface wSolTokenUsage {
@@ -831,13 +829,13 @@ export function getErrorInfo(umi: Umi, tx: TransactionBuilder, error: any) {
831
829
  }
832
830
  } else if (errIx.programId === MARGINFI_PROGRAM_ID) {
833
831
  programName = "Marginfi";
834
- programError = getMarginfiErrorFromName(
832
+ programError = getMarginfiErrorFromCode(
835
833
  errCode,
836
834
  createMarginfiProgram()
837
835
  );
838
836
  } else if (errIx.programId === JUPITER_PROGRAM_ID) {
839
837
  programName = "Jupiter";
840
- programError = getJupiterErrorFromName(errCode, createJupiterProgram());
838
+ programError = getJupiterErrorFromCode(errCode, createJupiterProgram());
841
839
  }
842
840
 
843
841
  if (errName && errCode === undefined) {