@cryptorubic/web3 0.13.0-alpha.solana-gas.7 → 0.13.0-alpha.solana-gas.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.
package/package.json
CHANGED
|
@@ -42,7 +42,6 @@ class SolanaAdapter extends abstract_adapter_1.AbstractAdapter {
|
|
|
42
42
|
async multicallByAddress(_address, _abi, _method, _methodArgs = [], _allowErrors = true) {
|
|
43
43
|
throw new Error('Method multicall is not supported');
|
|
44
44
|
}
|
|
45
|
-
// 6024 - Insufficient balance
|
|
46
45
|
async simulateTransaction(config, timeout = 15_000) {
|
|
47
46
|
try {
|
|
48
47
|
const bufferData = config.data.startsWith('0x') ? Buffer.from(config.data.slice(2), 'hex') : Buffer.from(config.data, 'base64');
|
|
@@ -66,10 +65,11 @@ class SolanaAdapter extends abstract_adapter_1.AbstractAdapter {
|
|
|
66
65
|
};
|
|
67
66
|
if (err) {
|
|
68
67
|
if (Array.isArray(err['InstructionError'])) {
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
const [failedInstructionIdx, errorData] = err['InstructionError'];
|
|
69
|
+
const failedIxProgrammId = tx.message.staticAccountKeys[failedInstructionIdx];
|
|
70
|
+
this.logger?.customLog('FAILED INSTRUCTION PROGRAM ID', failedIxProgrammId.toBase58());
|
|
71
|
+
const weirdError = errorData?.Custom === 1;
|
|
72
|
+
if (weirdError)
|
|
73
73
|
return defineCuLimit();
|
|
74
74
|
}
|
|
75
75
|
throw new Error('Transaction simulation failed.');
|