datafeed-server
tradingview datafeed server
Last updated 8 months ago by zlq4863947 .
AGPL-3.0-or-later · Repository · Original npm · Tarball · package.json
$ cnpm install datafeed-server 
SYNC missed versions from official npm registry.

datafeed-server

tradingview data server

安装

npm install datafeed-server

启动

import { DatafeedApp, IDatafeeder } from 'datafeed-server';

(async function bootstrap() {
  const datafeeder: IDatafeeder = {
    getServerTime: () => {
      return 'get test time';
    },
    resolveSymbol: () => {
      return Promise.resolve(undefined);
    },
    getHistory: () => {
      return Promise.resolve(undefined);
    },
    searchSymbols: () => {
      return Promise.resolve(undefined);
    },
  };
  const app = new DatafeedApp({
    port: 3000,
    datafeeder,
  });
  await app.start();
})();

rest-api 请求

  import { RequestParams, Requester } from 'datafeed-server';

  const getHuobiHistory = async () => {
    const apiUrl = 'https://api.huobipro.com';


    const requestParams: RequestParams = {
      symbol: 'btcusdt',
      period: '1day',
      size: 200
    };

    const requester = new Requester();
    const res = await requester.send(apiUrl, '/market/history/kline', requestParams);
    console.log(res);
  };

Current Tags

  • 0.1.9                                ...           latest (8 months ago)

11 Versions

  • 0.1.9                                ...           8 months ago
  • 0.1.8                                ...           a year ago
  • 0.1.7                                ...           a year ago
  • 0.1.6                                ...           a year ago
  • 0.1.5                                ...           a year ago
  • 0.1.3                                ...           a year ago
  • 0.1.2                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
  • 0.0.10                                ...           a year ago
  • 0.0.9                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 1
Dependencies (7)
Dev Dependencies (14)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |