wasabi-solana-ts 1.2.7 → 1.2.9
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.
|
@@ -12,6 +12,7 @@ type ErrorObject = {
|
|
|
12
12
|
expected: boolean;
|
|
13
13
|
program: string;
|
|
14
14
|
};
|
|
15
|
+
export declare const NOT_ENOUGH_SOL_ERROR = "Insufficient SOL for transaction fees. Please add more SOL and try again.";
|
|
15
16
|
export declare const parseSendTransactionError: (error: SendTransactionError, transaction: VersionedTransaction) => ErrorObject | undefined;
|
|
16
17
|
export declare const parseError: (instructionNumber: number, errorCode: number, transaction: VersionedTransaction) => ErrorObject | undefined;
|
|
17
18
|
export declare const parseSimulationError: (error: SimulationError, transaction: VersionedTransaction) => ErrorObject | undefined;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getFailingSwapProgram = exports.matchError = exports.parseErrorLogs = exports.parseSimulationError = exports.parseError = exports.parseSendTransactionError = exports.SimulationError = void 0;
|
|
26
|
+
exports.getFailingSwapProgram = exports.matchError = exports.parseErrorLogs = exports.parseSimulationError = exports.parseError = exports.parseSendTransactionError = exports.NOT_ENOUGH_SOL_ERROR = exports.SimulationError = void 0;
|
|
27
27
|
const jupiter_1 = require("./jupiter");
|
|
28
28
|
const titan_1 = require("./titan");
|
|
29
29
|
const web3_js_1 = require("@solana/web3.js");
|
|
@@ -42,6 +42,7 @@ class SimulationError extends Error {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
exports.SimulationError = SimulationError;
|
|
45
|
+
exports.NOT_ENOUGH_SOL_ERROR = "Insufficient SOL for transaction fees. Please add more SOL and try again.";
|
|
45
46
|
const wasabiProgramId = 'spicyTHtbmarmUxwFSHYpA8G4uP2nRNq38RReMpoZ9c';
|
|
46
47
|
const wasabiExpectedErrors = [
|
|
47
48
|
6004, // MinTokensNotMet
|
|
@@ -184,7 +185,7 @@ const parseErrorLogs = (logs) => {
|
|
|
184
185
|
else if (failingProgramId.localeCompare(wasabiProgramId) === 0) {
|
|
185
186
|
return findWasabiError(errorCode);
|
|
186
187
|
}
|
|
187
|
-
else if (failingProgramId.localeCompare(web3_js_1.SystemProgram.programId.toBase58())) {
|
|
188
|
+
else if (failingProgramId.localeCompare(web3_js_1.SystemProgram.programId.toBase58()) === 0) {
|
|
188
189
|
return parseSystemError(errorCode, web3_js_1.SystemProgram.programId.toBase58());
|
|
189
190
|
}
|
|
190
191
|
}
|
|
@@ -254,14 +255,14 @@ const matchError = (error) => {
|
|
|
254
255
|
'.*InsufficientFundsForFee.*': {
|
|
255
256
|
code: 0,
|
|
256
257
|
name: 'InsufficientFundsForFee',
|
|
257
|
-
msg:
|
|
258
|
+
msg: exports.NOT_ENOUGH_SOL_ERROR,
|
|
258
259
|
expected: true,
|
|
259
260
|
program: 'ComputeBudget'
|
|
260
261
|
},
|
|
261
262
|
'.*InsufficientFundsForRent.*': {
|
|
262
263
|
code: 0,
|
|
263
264
|
name: 'InsufficientFundsForRent',
|
|
264
|
-
msg:
|
|
265
|
+
msg: exports.NOT_ENOUGH_SOL_ERROR,
|
|
265
266
|
expected: true,
|
|
266
267
|
program: 'System'
|
|
267
268
|
},
|