Giter Site home page Giter Site logo

dg-sdk-node's Introduction

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

dg-sdk-node's People

Contributors

fmontserrat avatar otmjka avatar kovalenp avatar evahteev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.