GithubHelp home page GithubHelp logo

dxfeed / dxlink Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 2.0 1.29 MB

Market Data API

Home Page: https://demo.dxfeed.com/dxlink-ws/

License: Mozilla Public License 2.0

HTML 0.43% TypeScript 98.81% CSS 0.15% JavaScript 0.61%
api client dxfeed financial-data historical-data library market-api market-data market-data-feeds real-time

dxlink's Introduction

dxlink's People

Contributors

fyzu avatar levithomason avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dxlink's Issues

dxfeed websockets API Not Respecting FEED_SETUP Message

Hello,

I am debugging my dxfeed client, and keep running into this stubborn issue. I am unable to reproduce exactly; running the same code multiple times results in either a successful FEED_SETUP or an unsuccessful one depending on the day/hour.

I am trying to send the following FEED_SETUP message:

{'type': 'FEED_SETUP', 'channel': 1, 'acceptAggregationPeriod': 0.0, 'acceptDataFormat': 'FULL', 'acceptEventFields': {'Quote': ['eventType', 'eventSymbol', 'eventTime', 'sequence', 'timeNanoPart', 'bidTime', 'bidExchangeCode', 'bidPrice', 'bidSize', 'askTime', 'askExchangeCode', 'askPrice', 'askSize']}}

However, I keep getting back

{"type":"FEED_CONFIG","channel":1,"dataFormat":"COMPACT","aggregationPeriod":0.0}

, where acceptDataFormat is not respected. My parser is based only on the FULL dataset; COMPACT won't work for me. Why does the API not respect my FEED_SETUP message?

Minor mistakes

@Fyzu

  • typo in DXLinkFeedEventListner -> DXLinkFeedEventListener.
  • client.connect is asnyc function for no reason

minor ref fix

Description

- $ref: "#/components/schemas/FeedEvent"

      payload:
        allOf:
          - $ref: "#/components/schemas/Message"
          - type: object
            properties:
              type:
                const: FEED_DATA
              events:
                description: Batch of events.
                oneOf:
                  - description: |
                      List of events in full mode.
                      Empty fields are omitted from the json.
                    type: array
                    items:
                      - $ref: "#/components/schemas/FeedEvent"

items doesn't accept a list per spec, the dash - should be omitted.

Unable to start DXLinkWebSocketClient - WebSocket is not defined

Getting error when creating a client -

const client = new DXLinkWebSocketClient()
    client.connect('wss://openapi-ws.dxfeed.com/realtime')
    client.setAuthToken('xyz')

    const feed = new DXLinkFeed(client, FeedContract.AUTO)
    feed.configure({
        acceptAggregationPeriod: 10,
        acceptDataFormat: FeedDataFormat.COMPACT,
        acceptEventFields: {
            Quote: ['eventSymbol', 'askPrice', 'bidPrice'],
            Candle: ['eventSymbol', 'open', 'close', 'high', 'low', 'volume'],
        },
    })

Error -
this.socket = new WebSocket(this.url)
^
ReferenceError: WebSocket is not defined
at WebSocketConnector.start (file:///Users/xyz/tt/node_modules/@dxfeed/dxlink-websocket-client/src/connector.ts:23:23)

this.socket = new WebSocket(this.url)

I added this import in connector class which fixed the issue locally for me -
import WebSocket from 'ws';

Unable to run demo

Hello,
I trying to run demo, but faced problem.
What I did is:

  1. Cloned the repo into dxLink folder.
  2. As mentioned at https://github.com/dxFeed/dxLink/blob/main/dxlink-javascript/dxlink-api/README.md, I’ve ran command “npm install @dxfeed/dxlink-api“ at folder dxLink/dxlink-javascript/dxlink-api and received output message: added 5 packages, and audited 11 packages in 807ms
  3. At same folder I’ve ran comman “npm i -S @vitejs/plugin-react“ and received output message: “{{added 79 packages, and audited 90 packages in 16s }}
    {{7 packages are looking for funding }}
    run npm fund for details“

4.I’ve entered to folder dxLink/dxlink-javascript/dxlink-api/demo and ran command “vite“ and got an error message:

Failed to scan for dependencies from entries:
/win/workspaces/nbs/nbs1/repo/dxLink/dxlink-javascript/dxlink-api/demo/index.html   
✘ [ERROR] Failed to resolve entry for package "@dxfeed/dxlink-core". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-scan]
../../../../../../../../../home/user/.nvm/versions/node/v22.3.0/lib/node_modules/vite/node_modules/esbuild/lib/main.js:1225:21:
  1225 │         let result = await callback({
       ╵                      ^

How can I fix the error, please?

API not sending JSON data

Most of the time I am receiving JSON data through the API. However, same code, no changes, and sometimes I get a list of data instead.

JSON:
image

LIST:
image

According to the documentation, the API should always be sending JSON data.

Can't install deps in dxlink-javascript

Trying to setup locally to make some fixes but I get this on npm i in dxlink-javascript:

npm ERR! code E403
npm ERR! 403 403 Forbidden - GET https://dxfeed.jfrog.io/artifactory/api/npm/npm-local/@dxfeed/ui-kit/-/@dxfeed/ui-kit-2.7.0.tgz
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.

npm ERR! A complete log of this run can be found in: ~/.npm/_logs/2024-03-23T20_13_31_780Z-debug-0.log

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.