Uniswap Sniper Bot  1.0
Functions | Variables
BloXrouteMessageParser Namespace Reference

Utilities to parse incoming BloXroute messages. More...

Functions

bool validateTransaction (const char *message, const char *targetTokenAddress)
 Check if message is of "subscribe" method and regards specified token address. More...
 
std::size_t extractGasPrice (const char *message, char *output)
 Extract gas price hex value from the message. More...
 

Variables

constexpr std::size_t MethodPosition = 37
 Position of the method name in the message string. More...
 
constexpr std::size_t TokenPosition = 179
 Position of the token address in the message string. More...
 
constexpr std::size_t GasPricePosition = 555
 Position of the gas price hex value in the message string. More...
 

Detailed Description

Utilities to parse incoming BloXroute messages.

Function Documentation

◆ validateTransaction()

bool BloXrouteMessageParser::validateTransaction ( const char *  message,
const char *  targetTokenAddress 
)
inline

Check if message is of "subscribe" method and regards specified token address.

Parameters
messageinput message
targetTokenAddresstarget token address to check against
Returns
boolean value if message is valid and should be further processed

◆ extractGasPrice()

std::size_t BloXrouteMessageParser::extractGasPrice ( const char *  message,
char *  output 
)
inline

Extract gas price hex value from the message.

Parameters
messageinput message
outputoutput gas price
Returns
output gas price length

Variable Documentation

◆ MethodPosition

constexpr std::size_t BloXrouteMessageParser::MethodPosition = 37
inlineconstexpr

Position of the method name in the message string.

◆ TokenPosition

constexpr std::size_t BloXrouteMessageParser::TokenPosition = 179
inlineconstexpr

Position of the token address in the message string.

◆ GasPricePosition

constexpr std::size_t BloXrouteMessageParser::GasPricePosition = 555
inlineconstexpr

Position of the gas price hex value in the message string.