dexguru-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

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);

Readme

Keywords

none

Package Sidebar

Install

npm i dexguru-sdk

Weekly Downloads

120

Version

1.0.8

License

MIT

Unpacked Size

67 kB

Total Files

17

Last publish

Collaborators

  • dexguru