Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | 1x 11x | import { ParsedTransactionWithMeta, TransactionResponse, VersionedTransactionResponse } from '@solana/web3.js';
export type SolanaTransaction =
| ParsedTransactionWithMeta
| VersionedTransactionResponse
| (TransactionResponse & VersionedTransactionResponse);
export interface ParseConfig {
/**
* if true, will try to parse unknown DEXes
* @default false
*/
tryUnknowDEX?: boolean;
/**
* if set, will only parse transactions from these programIds
* @default undefined
*/
programIds?: string[];
}
export interface DexInfo {
programId?: string;
amm?: string;
route?: string;
}
export interface TokenInfo {
mint: string;
amount: number;
decimals: number;
authority?: string;
destination?: string;
source?: string;
}
export interface TokenAmount {
amount: bigint;
uiAmount: number;
decimals: number;
}
export interface TransferInfo {
type: 'TRANSFER_IN' | 'TRANSFER_OUT';
token: TokenInfo;
from: string;
to: string;
timestamp: number;
signature: string;
}
export interface TransferData {
type: 'transfer' | 'transferChecked' | string;
info: {
authority: string;
destination: string;
mint: string;
source: string;
tokenAmount: {
amount: string;
decimals: number;
uiAmount: number;
};
};
idx: string;
}
export type TradeType = 'BUY' | 'SELL';
export interface TradeInfo {
user: string; // Signer Address (Who Buy or Sell)
type: TradeType;
inputToken: TokenInfo;
outputToken: TokenInfo;
fee?: TokenInfo;
programId?: string; // DEX program ID
amm?: string; // AMM type (e.g., 'RaydiumV4', 'Meteora')
route?: string; // Router or Bot (e.g., 'Jupiter','OKX','BananaGun')
slot: number;
timestamp: number;
signature: string;
idx: string; // instruction indexes
}
export interface PumpfunTradeEvent {
mint: string;
solAmount: number;
tokenAmount: number;
isBuy: boolean;
user: string;
timestamp: bigint;
virtualSolReserves: number;
virtualTokenReserves: number;
}
export interface PumpfunCreateEvent {
name: string;
symbol: string;
uri: string;
mint: string;
bondingCurve: string;
user: string;
}
export interface PumpfunCompleteEvent {
user: string;
mint: string;
bondingCurve: string;
timestamp: bigint;
}
export interface PumpfunEvent {
type: 'TRADE' | 'CREATE' | 'COMPLETE';
data: PumpfunTradeEvent | PumpfunCreateEvent | PumpfunCompleteEvent;
slot: number;
timestamp: number;
signature: string;
idx: string; // instruction indexes
}
export type PoolEventType = 'CREATE' | 'ADD' | 'REMOVE';
export interface PoolEventBase {
user: string;
type: PoolEventType;
programId?: string; // DEX program ID
amm?: string; // AMM type (e.g., 'Raydiumv4', 'Jupiter')
slot: number;
timestamp: number;
signature: string;
idx: string; // instruction indexes
}
export interface PoolEvent extends PoolEventBase {
/**
* AMM pool address (market)
*/
poolId: string;
/**
* LP mint address
*/
poolLpMint?: string;
/**
* Token A mint address (TOKEN)
*/
token0Mint?: string;
/**
* Token A amount (TOKEN)
*/
token0Amount?: number;
/**
* Token B mint address (SOL/USDC/USDT)
*/
token1Mint?: string;
/**
* Token B amount (SOL/USDC/USDT)
*/
token1Amount?: number;
/**
* Lp amount
*/
lpAmount?: number;
}
export const convertToUiAmount = (amount: bigint, decimals?: number) => {
return Number(amount) / Math.pow(10, decimals || 9);
};
|