dexguru-sdk is a light wrapper around dex.guru REST API.
NPM
npm install dexguru-sdk
Yarn
yarn install dexguru-sdk
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();
export interface ChainModel {
chain_id: number;
name: string;
description: string;
}
export interface ChainsListModel {
total: number;
data: ChainModel[];
}
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);