JSPM

@fugle/realtime

0.4.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q55318F
  • License MIT

Fugle Realtime API client library for Node.js

Package Exports

  • @fugle/realtime
  • @fugle/realtime/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@fugle/realtime) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Fugle Realtime

NPM version Build Status Coverage Status

Fugle Realtime API client library for Node.js

Install

$ npm install --save @fugle/realtime

Usage

The library is an isomorphic JavaScript client that supports HTTP API and WebSocket.

HTTP API

import { HttpClient } from '@fugle/realtime';

const client = new HttpClient({ apiToken: 'demo' });

intraday.meta

client.intraday.meta({ symbolId: '2884' })
  .then(data => console.log(data));

intraday.quote

client.intraday.quote({ symbolId: '2884' })
  .then(data => console.log(data));

intraday.chart

client.intraday.chart({ symbolId: '2884' })
  .then(data => console.log(data));

intraday.dealts

client.intraday.dealts({ symbolId: '2884', limit: 50 })
  .then(data => console.log(data));

intraday.volumes

client.intraday.volumes({ symbolId: '2884' })
  .then(data => console.log(data));

historical.candles

client.historical.candles({ symbolId: '2884', from: '2022-02-07', to: '2022-02-11' })
  .then(data => console.log(data));

WebSocket

import { WebSocketClient } from '@fugle/realtime';

const client = new WebSocketClient({ apiToken: 'demo' });

intraday.meta

client.intraday.meta({ symbolId: '2884' })
  .onmessage = message => console.log(JSON.parse(message.data));

intraday.quote

client.intraday.quote({ symbolId: '2884' })
  .onmessage = message => console.log(JSON.parse(message.data));

intraday.chart

client.intraday.chart({ symbolId: '2884' })
  .onmessage = message => console.log(JSON.parse(message.data));

Reference

Fugle Realtime API

License

MIT