@cryptorubic/web3 0.8.17-alpha.solana.22 → 0.8.17-alpha.solana.23
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
|
@@ -44,6 +44,7 @@ class SolanaAdapter extends abstract_adapter_1.AbstractAdapter {
|
|
|
44
44
|
async multicallByAddress(_address, _abi, _method, _methodArgs = [], _allowErrors = true) {
|
|
45
45
|
throw new Error('Method multicall is not supported');
|
|
46
46
|
}
|
|
47
|
+
// 6024 - Insufficient balance
|
|
47
48
|
async simulateTransaction(config, timeout = 15_000) {
|
|
48
49
|
try {
|
|
49
50
|
const bufferData = config.data.startsWith('0x') ? Buffer.from(config.data.slice(2), 'hex') : Buffer.from(config.data, 'base64');
|
|
@@ -58,9 +59,13 @@ class SolanaAdapter extends abstract_adapter_1.AbstractAdapter {
|
|
|
58
59
|
}
|
|
59
60
|
});
|
|
60
61
|
const resp = await (0, timeout_1.withTimeout)(simulation, timeout, 'Solana Simulation Timeout!');
|
|
62
|
+
if (resp.value.err) {
|
|
63
|
+
throw new Error('Transaction simulation failed.');
|
|
64
|
+
}
|
|
61
65
|
return new bignumber_js_1.default(resp.value.unitsConsumed || exports.DEFAULT_CU_LIMIT).toFixed(0);
|
|
62
66
|
}
|
|
63
67
|
catch (err) {
|
|
68
|
+
this.logger?.customError('Error while simulating transaction', err);
|
|
64
69
|
throw err;
|
|
65
70
|
}
|
|
66
71
|
}
|
|
@@ -90,7 +90,7 @@ class SolanaGasService {
|
|
|
90
90
|
.reduce((acc, fee) => acc.plus(fee), new bignumber_js_1.default(0))
|
|
91
91
|
.div(filteredPriorityFees.length)
|
|
92
92
|
.dp(0, bignumber_js_1.default.ROUND_CEIL);
|
|
93
|
-
this.logger?.customLog('SOLANA_WEB3 PRIORITY_FEE SUCCESS', { priorityFeeEstimate: avgProrityFee.toNumber()
|
|
93
|
+
this.logger?.customLog('SOLANA_WEB3 PRIORITY_FEE SUCCESS', { priorityFeeEstimate: avgProrityFee.toNumber() });
|
|
94
94
|
return avgProrityFee;
|
|
95
95
|
}
|
|
96
96
|
}
|