Skip to content

Types issues and general node/typescript compatibility #695

Description

@Rulikkk
  1. It looks like the .ws namespace in the client is present in runtime/javascript, however, it is completely missing in d.ts files. So, generally, websocket APIs are unusable from typescript, without dirty hacks.
  2. package.json lacks type: "module" or any other definition
  3. Also, it looks like many types exist in .d.ts files, and are essentially not usable in typescript source code (see sample below)
// assume following import
import { OrderSide } from "binance-api-node";

// then use it
const orderSide = OrderSide.BUY;

In this sample, when TS is compiled to JS, the OrderSide won't exist in JS context and import will fail, because initially OrderSide comes from .d.ts file, which does not get to compiled JS output.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions