Socket
Socket
Sign inDemoInstall

@fugle/realtime

Package Overview
Dependencies
4
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @fugle/realtime

Fugle Realtime API client library for Node.js


Version published
Weekly downloads
4
increased by300%
Maintainers
4
Install size
764 kB
Created
Weekly downloads
 

Changelog

Source

0.4.0 (2022-12-08)

Features

  • add support for historical api (#4) (ae28de7)

Readme

Source

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

Keywords

FAQs

Last updated on 08 Dec 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc