TronWallet / trontrade-api

TronTrade API Client

Home Page:https://trontrade.github.io/trontrade-api/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TronTrade SDK

this client is still in alpha state and not yet available on npm

Install package

npm install @trontrade/client

or

yarn add @trontrade/client

The documentation will be available in the folder /docs

Examples

Create client

const client = new ExchangeClient();

Receive new orders from a specific symbol

const anteSymbolId = 1;
const symbolApi = await client.symbol(anteSymbolId);

symbolApi.orders().watch().subscribe(order => {
  // Handle order
  console.log("New Order!", order);
});

Get price for symbol

const anteSymbolId = 1;
const symbolApi = await client.symbol(anteSymbolId);

const ticker = await symbolApi.ticker().current();

console.log(`Current ANTE Price: ${ticker.price}`);

Get price for symbol periodically

symbolApi.ticker().watch().subscribe(ticker => {
  console.log(`Current ANTE Price: ${ticker.price}`);
});

Build

yarn install
yarn build

Generate documentation

yarn docs

About

TronTrade API Client

https://trontrade.github.io/trontrade-api/


Languages

Language:TypeScript 92.5%Language:JavaScript 7.5%