WhaleAPI SDK
    Preparing search index...

    Class TradeContext

    Trade context

    Index

    Constructors

    Methods

    • Set order changed callback, after receiving the order changed event, it will call back to this function.

      Parameters

      Returns void

    • Subscribe

      const {
      Config,
      TradeContext,
      Decimal,
      OrderSide,
      TimeInForceType,
      OrderType,
      TopicType,
      } = require("longport");

      let config = Config.fromEnv();
      let ctx = await TradeContext.new(config)
      ctx.setOnQuote((_, event) => console.log(event.toString()));
      await ctx.subscribe([TopicType.Private]);

      Parameters

      Returns Promise<void>

    • Unsubscribe

      Parameters

      Returns Promise<void>