mirror of
https://github.com/fdundjer/solana-sniper-bot.git
synced 2025-11-18 18:51:10 +10:00
feat: real time filtering
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
import { Filter, FilterResult } from './pool-filters';
|
||||
import { MintLayout } from '@solana/spl-token';
|
||||
import { Connection } from '@solana/web3.js';
|
||||
import { LiquidityStateV4 } from '@raydium-io/raydium-sdk';
|
||||
import { LiquidityPoolKeysV4 } from '@raydium-io/raydium-sdk';
|
||||
import { logger } from '../helpers';
|
||||
|
||||
export class RenouncedFilter implements Filter {
|
||||
constructor(private readonly connection: Connection) {}
|
||||
|
||||
async execute(poolState: LiquidityStateV4): Promise<FilterResult> {
|
||||
async execute(poolKeys: LiquidityPoolKeysV4): Promise<FilterResult> {
|
||||
try {
|
||||
const accountInfo = await this.connection.getAccountInfo(poolState.baseMint, this.connection.commitment);
|
||||
const accountInfo = await this.connection.getAccountInfo(poolKeys.baseMint, this.connection.commitment);
|
||||
if (!accountInfo?.data) {
|
||||
return { ok: false, message: 'Renounced -> Failed to fetch account data' };
|
||||
}
|
||||
@ -18,7 +18,7 @@ export class RenouncedFilter implements Filter {
|
||||
const renounced = deserialize.mintAuthorityOption === 0;
|
||||
return { ok: renounced, message: renounced ? undefined : 'Renounced -> Creator can mint more tokens' };
|
||||
} catch (e) {
|
||||
logger.error({ mint: poolState.baseMint }, `Failed to check if mint is renounced`);
|
||||
logger.error({ mint: poolKeys.baseMint }, `Failed to check if mint is renounced`);
|
||||
}
|
||||
|
||||
return { ok: false, message: 'Renounced -> Failed to check if mint is renounced' };
|
||||
|
||||
Reference in New Issue
Block a user