luckyman-client
v1.1.6
Published
```cli npm install luckyman-client ``` Or upgrade ```cli npm install --upgrade luckyman-client ``` # Usage ## Create instance of LuckyManClient ```typescript import { LuckyManClient, SnipeEvent } from "luckyman-client/dist"
Readme
Installation
npm install luckyman-clientOr upgrade
npm install --upgrade luckyman-clientUsage
Create instance of LuckyManClient
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.")
);Http Methods
Add Tokens to snipe.
Add several tokens to the list in server to detect the point when it can be tradable.
const response = await luckyManClient.addTokens(["0x..", "0x.."]);Remove Tokens from snipe token list
const response = await luckyManClient.removeTokens(["0x..", "0x.."]);Fetch all tokens which is being detected the tradable point
const response = await luckyManClient.fetchAllTokens();Fetch details of tokens
const response = await luckyManClient.fetchTokensWithInfo(["0x..", "0x..]);Fetch details of pairs
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.." }
])WebSocket Subscription Methods
Receive notification when the token which is added into the list is tradable.
luckyManClient.listenToToken(
(data: {
tokenAddress: string,
simulateResult: {
router: string,
buyFee: number,
sellFee: number,
txLimit: number
}[]
}) => {
console.log(data)
});Unsubscription
luckyManClient.unsubscribe(SnipeEvent.simulateSubscribe)