@haven-fi/solauto-sdk 1.0.248 → 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;
|
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.
|
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.
|
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`;
|
@@ -258,9 +258,9 @@ class TransactionsManager {
|
|
258
258
|
? count + 1
|
259
259
|
: count;
|
260
260
|
}, 0);
|
261
|
-
isolatedLutTx = newAccountsUsage
|
261
|
+
isolatedLutTx = Boolean(newAccountsUsage);
|
262
262
|
}
|
263
|
-
if (updateLookupTable &&
|
263
|
+
if (updateLookupTable && updateLookupTable?.new) {
|
264
264
|
await this.updateLut(updateLookupTable.tx);
|
265
265
|
}
|
266
266
|
this.lookupTables.defaultLuts = client.defaultLookupTables();
|
package/package.json
CHANGED
@@ -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
|
-
|
63
|
+
getMarginfiErrorFromCode,
|
66
64
|
MARGINFI_PROGRAM_ID,
|
67
65
|
} from "../marginfi-sdk";
|
68
|
-
import { ReferralStateManager
|
66
|
+
import { ReferralStateManager } from "../clients";
|
69
67
|
import {
|
70
68
|
createJupiterProgram,
|
71
|
-
|
69
|
+
getJupiterErrorFromCode,
|
72
70
|
JUPITER_PROGRAM_ID,
|
73
71
|
} from "../jupiter-sdk";
|
74
|
-
import {
|
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 =
|
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 =
|
838
|
+
programError = getJupiterErrorFromCode(errCode, createJupiterProgram());
|
841
839
|
}
|
842
840
|
|
843
841
|
if (errName && errCode === undefined) {
|
@@ -381,9 +381,9 @@ export class TransactionsManager {
|
|
381
381
|
? count + 1
|
382
382
|
: count;
|
383
383
|
}, 0);
|
384
|
-
isolatedLutTx = newAccountsUsage
|
384
|
+
isolatedLutTx = Boolean(newAccountsUsage);
|
385
385
|
}
|
386
|
-
if (updateLookupTable &&
|
386
|
+
if (updateLookupTable && updateLookupTable?.new) {
|
387
387
|
await this.updateLut(updateLookupTable.tx);
|
388
388
|
}
|
389
389
|
this.lookupTables.defaultLuts = client.defaultLookupTables();
|