npm install luckyman-client
Or upgrade
npm install --upgrade luckyman-client
import { LuckyManClient, SnipeEvent } from "luckyman-client/dist"
const luckyManClient = new LuckyManClient(
'http://',
'ws://',
(error) => console.log(error.error),
() => console.log("Socket is Opened."),
() => console.log("Socket is Closed.")
);
Add several tokens to the list in server to detect the point when it can be tradable.
const response = await luckyManClient.addTokens(["0x..", "0x.."]);
const response = await luckyManClient.removeTokens(["0x..", "0x.."]);
const response = await luckyManClient.fetchAllTokens();
const response = await luckyManClient.fetchTokensWithInfo(["0x..", "0x..]);
With pair Addresses
const response = await luckyManClient.fetchPairsWithInfo(["0x..", "0x.."]);
With token addresses
const response = await luckyManClient.fetchPairsWithInfoByTokens([
{ token0: "0x..", token1: "0x.." },
{ token0: "0x..", token1: "0x.." }
])
luckyManClient.listenToToken(
(data: {
tokenAddress: string,
simulateResult: {
router: string,
buyFee: number,
sellFee: number,
txLimit: number
}[]
}) => {
console.log(data)
});
luckyManClient.unsubscribe(SnipeEvent.simulateSubscribe)