1.0.8 • Published 2 years ago

dexguru-sdk v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

logo

dexguru-sdk is a light wrapper around dex.guru REST API.

Installation

NPM

npm install dexguru-sdk

Yarn

yarn install dexguru-sdk

Getting Started

Get an API key from developers.dex.guru

import DexGuru, { ChainsListModel } from "dexguru-sdk";

const YOUR_API_KEY = 'abc123';

const sdk = new DexGuru(YOUR_API_KEY, "https://api.dev.dex.guru");
const chains: ChainsListModel = await sdk.getAllChains();

SDK providers all responses with Typescript models

export interface ChainModel {
    chain_id: number;
    name: string;
    description: string;
}

export interface ChainsListModel {
  total: number;
  data: ChainModel[];
}

Usage Examples

See a wallet:

import DexGuru, { ChainsListModel } from 'dexguru-sdk';

const YOUR_API_KEY = 'abc123';
const wallet = 'bot_wallet_address';

const sdk = new DexGuru(YOUR_API_KEY, "https://api.dev.dex.guru");

const response = await sdk.getWalletInfo(ChainChoices._1, wallet)
console.log(response)

Note that a valid wallet id need to be provided.

The response:

{
    "wallet_address": "bot_wallet_address",
    "volume_1m_usd": 5000.123456,
    "txns_1m": 999999,
    "category": "bot",
    "timestamp": 1621635936
}

Check trades on that same wallet:

import DexGuru, { ChainChoices, SwapsBurnsMintsListModel } from 'dexguru-sdk';

const trades: SwapsBurnsMintsListModel = sdk.getWalletTransactions(ChainChoices._1, "bot_wallet_address");
console.log(trades);
1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago