@cryptorubic/web3 0.8.17-alpha.solana.17 → 0.8.17-alpha.solana.18

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cryptorubic/web3",
3
- "version": "0.8.17-alpha.solana.17",
3
+ "version": "0.8.17-alpha.solana.18",
4
4
  "dependencies": {
5
5
  "@ethersproject/bignumber": "^5.8.0",
6
6
  "@mysten/sui": "^1.24.0",
@@ -96,10 +96,18 @@ class SolanaGasService {
96
96
  };
97
97
  const recentFees = await this.connection.getRecentPrioritizationFees();
98
98
  const lastTenTxFees = recentFees.slice(recentFees.length - 10);
99
- const lastBlocksSlots = await this.connection.getBlocks(lastTenTxFees[0].slot);
99
+ const lastBlocksSlots = await this.connection.getBlocks(lastTenTxFees[0].slot).catch((err) => {
100
+ this.logger?.customLog('SolanaGasService_calculateCUPriceSolWeb3_getBlocks ERROR', err);
101
+ return [];
102
+ });
100
103
  const lastBlocksSigs = await Promise.all(lastBlocksSlots.map((slot) => this.connection.getBlockSignatures(slot, 'confirmed')));
101
104
  const flattenSigs = lastBlocksSigs.flatMap((b) => b.signatures);
102
- const lastTxs = await this.connection.getTransactions(flattenSigs, { commitment: 'confirmed', maxSupportedTransactionVersion: 0 });
105
+ const lastTxs = await this.connection
106
+ .getTransactions(flattenSigs, { commitment: 'confirmed', maxSupportedTransactionVersion: 0 })
107
+ .catch((err) => {
108
+ this.logger?.customLog('SolanaGasService_calculateCUPriceSolWeb3_getTransactions ERROR', err);
109
+ return [];
110
+ });
103
111
  const serializedTxs = lastTxs
104
112
  .filter(Boolean)
105
113
  .map((tx) => web3_js_1.VersionedTransaction.deserialize(Buffer.from(tx.transaction.message.serialize())));