diff --git a/watcher/package.json b/watcher/package.json index 167d5321..cdc6e64e 100644 --- a/watcher/package.json +++ b/watcher/package.json @@ -37,8 +37,8 @@ "@solana/spl-token": "^0.4.6", "@solana/web3.js": "^1.73.0", "@types/bn.js": "^5.1.0", - "@wormhole-foundation/example-liquidity-layer-definitions": "file:./sdk/wormhole-foundation-example-liquidity-layer-definitions-0.0.1.tgz", - "@wormhole-foundation/example-liquidity-layer-evm": "file:./sdk/wormhole-foundation-example-liquidity-layer-evm-0.0.1.tgz", + "@wormhole-foundation/example-liquidity-layer-definitions": "file:sdk/wormhole-foundation-example-liquidity-layer-definitions-0.0.1.tgz", + "@wormhole-foundation/example-liquidity-layer-evm": "file:sdk/wormhole-foundation-example-liquidity-layer-evm-0.0.1.tgz", "@wormhole-foundation/example-liquidity-layer-solana": "file:sdk/wormhole-foundation-example-liquidity-layer-solana-0.0.1.tgz", "@wormhole-foundation/wormhole-monitor-common": "^0.0.1", "algosdk": "^2.4.0", diff --git a/watcher/src/watchers/FTSolanaWatcher.ts b/watcher/src/watchers/FTSolanaWatcher.ts index 8977a772..27984843 100644 --- a/watcher/src/watchers/FTSolanaWatcher.ts +++ b/watcher/src/watchers/FTSolanaWatcher.ts @@ -160,7 +160,7 @@ export class FTSolanaWatcher extends SolanaWatcher { // Check if the last signature of this batch is the same as the current signature // If it is, it means we are not progressing and should break the loop - // Index is 0 because `getSignaturesForAddress` returns the signatures in descending orderfetching info for blocks + // Index is 0 because `getSignaturesForAddress` returns the signatures in descending order if (batchSignatures[0].signature === currSignature) { this.logger.warn('No new signatures fetched, breaking the loop.'); break; @@ -939,6 +939,7 @@ export class FTSolanaWatcher extends SolanaWatcher { return auction; } + async getDbLatestAuctionHistoryIndex(): Promise { if (!this.pg) { this.logger.debug('No database connection, returning 0'); @@ -950,7 +951,7 @@ export class FTSolanaWatcher extends SolanaWatcher { this.logger.info(`Latest auction history index: ${maxIndex}`); return maxIndex; } catch (error) { - this.logger.error('Failed to fetch the largest index from auction_history_mapping:', error); + this.logger.error(`Failed to fetch the largest index from auction_history_mapping: ${error}`); throw new Error('Database query failed'); } } @@ -970,7 +971,7 @@ export class FTSolanaWatcher extends SolanaWatcher { .first(); return result; } catch (error) { - this.logger.error(`Error fetching auction history mapping for ${auction}:`, error); + this.logger.error(`Error fetching auction history mapping for ${auction}: ${error}`); throw error; } } @@ -989,7 +990,7 @@ export class FTSolanaWatcher extends SolanaWatcher { .merge(); this.logger.info(`Saved ${mappings.length} auction history mappings.`); } catch (error) { - this.logger.error('Error saving auction history mappings:', error); + this.logger.error(`Error saving auction history mappings: ${error}`); throw error; } } @@ -999,12 +1000,11 @@ export class FTSolanaWatcher extends SolanaWatcher { this.logger.debug('No database connection, skipping saveFastTransfer'); return; } - this.logger.debug(`Saving fast transfer ${fastTransfer.fast_vaa_hash}`); try { await this.pg('fast_transfers').insert(fastTransfer).onConflict('fast_vaa_id').merge(); this.logger.info(`Saved fast transfer ${fastTransfer.fast_vaa_hash}.`); } catch (error) { - this.logger.error(`Error saving fast transfer ${fastTransfer.fast_vaa_hash}:`, error); + this.logger.error(`Error saving fast transfer ${fastTransfer.fast_vaa_hash}: ${error}`); throw error; } } @@ -1034,7 +1034,7 @@ export class FTSolanaWatcher extends SolanaWatcher { await this.pg('fast_transfer_auctions').where(id).update(update); this.logger.info(`Updated auction for fast vaa hash: ${id.fast_vaa_hash}.`); } catch (error) { - this.logger.error(`Error updating auction ${id.fast_vaa_hash}:`, error); + this.logger.error(`Error updating auction ${id.fast_vaa_hash}: ${error}`); throw error; } } @@ -1053,8 +1053,7 @@ export class FTSolanaWatcher extends SolanaWatcher { return result?.fast_vaa_hash || ''; } catch (error) { this.logger.error( - `Error fetching Fast VAA hash for auction pubkey ${auctionPubkey.toBase58()}:`, - error + `Error fetching Fast VAA hash for auction pubkey ${auctionPubkey.toBase58()}: ${error}` ); throw error; } @@ -1094,12 +1093,11 @@ export class FTSolanaWatcher extends SolanaWatcher { this.logger.debug('No database connection, skipping saveAuctionLogs'); return; } - this.logger.debug(`Attempting to save auction logs for ${auctionLogs.fast_vaa_hash}`); try { await this.pg('auction_logs').insert(auctionLogs); this.logger.info(`Saved auction logs for ${auctionLogs.fast_vaa_hash}.`); } catch (error) { - this.logger.error(`Error saving auction logs for ${auctionLogs.fast_vaa_hash}:`, error); + this.logger.error(`Error saving auction logs for ${auctionLogs.fast_vaa_hash}: ${error}`); throw error; } }