luckyman-client

1.1.6 • Public • Published

Installation

npm install luckyman-client

Or upgrade

npm install --upgrade luckyman-client

Usage

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)

Readme

Keywords

none

Package Sidebar

Install

npm i luckyman-client

Weekly Downloads

4

Version

1.1.6

License

ISC

Unpacked Size

42.6 kB

Total Files

10

Last publish

Collaborators

  • storm0611