GithubHelp home page GithubHelp logo

tastytrade-api-js's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tastytrade-api-js's Issues

Service return types Promise<any>

Any possibility to get types added to all of the service functions? Right now they are all Promise<any> so it requires the user of this sdk to implement all of their own types and models which does not seem ideal.

User-Agent setup in browser environment

We set the User-Agent header explicitly in the http-client here. This is ok for node.js and other server side environments, however setting the User-Agent header in browser environment triggers below warnings:

image

I am unsure of the significance of User-Agent for the backend; but maybe, we can just remove the UA from the http client?

Target Modern Runtimes for JS SDK

The current JS SDK is distributed to NPM with ES5 target. This is very antiquated method as argued here and here.

Almost all the applications which use TastyTrade SDK will likely also use DXLink Websocket Client which is also authored as modern javascript module on NPM - See reference tsconfig.json

Can we target modern runtimes for JS SDK for Tasty Trade APIs?

If the is willing to support this feature, I can even attempt to submit a PR to that effect.

Azure App Service Deployable

  1. Production build for front end after fixing/ignorng build/ES Lint errors
  2. Define "start" for the root folder to reference the "start" task in the front end folder

Deprecate MarketDataStreamer in favor of @dxfeed/dxlink-websocket-client?

This SDK offers a MarketDataStreamer which acts as a wrapper and abstraction over dxlink feed apis. However, DXLink team provides their own version of this here.

This raises questions on duplication of efforts, purpose of this SDK over the one provided by DXLink, the difference between the two SDKs and the future vision of Tasty on the SDK. Maybe, we should consider deprecating this version in favor of the one provided by DXLink?

Unable to subscribe to equity option quotes

The api quote token only has equities market data available to it. Subscribing to other instruments types via dxLink (equity options, future options, futures) doesn't return any data.

We are aware of the issue and are working with DxFeed to resolve it. Any developments will be posted here.

Different events using API and the tasty app

I want to subscribe to market data on options symbols and get the latest events, even when markets are closed. I'm looking for a snapshot of data rather than a real-time stream.

The tasty platform always shows the latest Greeks, quotes, etc, for the option symbols.

Looking at wss://tasty-demo-ws.dxfeed.com/delayed events in the browser, I see the usual FEED_DATA even when the options market is closed.

{"type":"FEED_DATA","channel":1,"data":["Greeks",["Greeks",".PLTR231117C15",0.859042135169914,0.679454583347139,0.0982083687887286,-0.0261660721057656,0.00609448239509639,0.01518018285523352,"Greeks",".WBA231117P27.5",0.74595897321041,-0.851562819473887,0.0539648651528887,-0.01993263273054975,-0.0167382063515774,0.01331688462849462]]}	1698104164.7325706

The API client behaves differently:

this.streamer.addSubscription( '.PLTR231117C15', {subscriptionTypes: [MarketDataSubscriptionType.Trade], channelId: 1})
would not produce any data

this.streamer.addSubscription( 'AAPL', {subscriptionTypes: [MarketDataSubscriptionType.Quote], channelId: 1})
shows data arriving

I couldn't find anything obvious in the API client implementation that may prevent receiving data outside of the window for opened markets.

Browser Support for JS SDK

I am attempting to use the SDK client in browser environment. However, this results in below errors:

image

Can we please author this SDK in a manner that is compatible with both node.js and browser?

If the is willing to support this feature, I can even attempt to submit a PR to that effect.

TypeError: TastytradeClient is not a constructor

Hi,

I'm following the quick start in the README:

import TastytradeClient from "@tastytrade/api"
const tastytradeClient = new TastytradeClient(baseUrl, accountStreamerUrl)
const loginResponse = await tastytradeClient.sessionService.login(usernameOrEmail, pasword)

I'm getting this error message:

const tastytradeClient = new TastytradeClient(baseUrl, accountStreamerUrl)
                         ^

TypeError: TastytradeClient is not a constructor

The baseUrl I'm using is the sandbox page.

I'm on "@tastytrade/api": "^3.1.0",
I'm on node v21.5
I'm also trying to incorporate it with express and use it in a route.

Let me know what other information you need

Streaming Account Connect Returning Not Implemented

Hi there,

I'm trying to stream account data.
I'm working in the Sandbox environment at the moment.
I'm implementing a Typescript, Node, Express server. I'm not using the Tasty Trade JS Library, am using regular webhooks.

I send in this:

Added to JSON and sending: {
  action: 'connect',
  value: '5W.....',
  'request-id': 4,
  source: 'tastytrade-api-js-sdk',
  'auth-token': 'hS-tazdJq3a5Bus-...'
}

I'm getting this error:

HandleOneMessage JSON: {
  status: 'error',
  action: 'connect',
  'web-socket-session-id': 'c69d0c31',
  message: 'not-implemented',
  'request-id': 4
}

I have tried the Tasty Trade API JS website example as well and I also get this:

{
    "status": "error",
    "action": "connect",
    "web-socket-session-id": "6964b9ef",
    "message": "not-implemented",
    "request-id": 2
}

Is the Account Streaming not available right now? I know Tasty Trade is going through some API changes.

Streamer token and url not working from /api-quote-tokens

I found out that getting the wss URL and the token for DXlink is not working with the information obtained from endpoint /api-quote-tokens. In the Tasty Trade Postman collection I found there is another endpoint which allows to obtain dxlink token as well as a different wss URL and those are working. Endpoint is /quote-streamer-tokens

Can someone look into this? Change is needed here:

const apiQuoteToken = (await this.httpClient.getData('/api-quote-tokens', {}, {}))

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.