Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface SpotSpin

Hierarchy

  • SpotSpin

Index

Methods

  • Subscribes to the balance changes stream of a particular account by it's ID

    example
    const unsubscribe = spin.listenAccountBalances(request, {
    onNotifyOk: (data) => console.log(data),
    onStateOk: (data) => console.log(data),
    onSubOk: (data) => console.log(data),
    onUnsubOk: (data) => console.log(data),
    onSubError: (error) => console.error(error),
    onUnsubError: (error) => console.error(error),
    onNotifyError: (error) => console.error(error),
    onStateError: (error) => console.error(error),
    });

    unsubscribe();

    Parameters

    Returns Subscription

  • Subscribes to the all orders stream of a particular account by it's ID

    example
    const unsubscribe = spin.listenAccountOrders(request, {
    onNotifyOk: (data) => console.log(data),
    onStateOk: (data) => console.log(data),
    onSubOk: (data) => console.log(data),
    onUnsubOk: (data) => console.log(data),
    onSubError: (error) => console.error(error),
    onUnsubError: (error) => console.error(error),
    onNotifyError: (error) => console.error(error),
    onStateError: (error) => console.error(error),
    });

    unsubscribe();

    Parameters

    Returns Subscription

  • Subscribes to the trades stream of a particular account by it's ID

    example
    const unsubscribe = spin.listenAccountTrades(request, {
    onNotifyOk: (data) => console.log(data),
    onSubOk: (data) => console.log(data),
    onUnsubOk: (data) => console.log(data),
    onSubError: (error) => console.error(error),
    onUnsubError: (error) => console.error(error),
    onNotifyError: (error) => console.error(error),
    });

    unsubscribe();

    Parameters

    Returns Subscription

  • Subscribe to the orderbook L1 data. Notifications are sent every time when best bid or best ask were changed. That changes couldn't be generated more often than block is validated and added in near blockchain, but there can be be multiple changes within one block. Messages order is guaranteed

    example
    const unsubscribe = spin.listenBookL1(request, {
    onNotifyOk: (data) => console.log(data),
    onSubOk: (data) => console.log(data),
    onUnsubOk: (data) => console.log(data),
    onSubError: (error) => console.error(error),
    onUnsubError: (error) => console.error(error),
    onNotifyError: (error) => console.error(error),
    });

    unsubscribe();

    Parameters

    Returns Subscription

  • Subscribe to the orderbook L2 data. L2 data consists a snapshot of the bids/asks prices and quantities with a specific depth. Right now notifications are sent every 100 millisecond, but don't forget that each block in blockchain is generated approximately 1 second, so the average time of this type of notification approximately 1 second too. If there is no changes in orderbook notifications won't be sent.

    example
    const unsubscribe = spin.listenBookL2(request, {
    onNotifyOk: (data) => console.log(data),
    onSubOk: (data) => console.log(data),
    onUnsubOk: (data) => console.log(data),
    onSubError: (error) => console.error(error),
    onUnsubError: (error) => console.error(error),
    onNotifyError: (error) => console.error(error),
    });

    unsubscribe();

    Parameters

    Returns Subscription

  • Subscribe to the orderbook L3 data. In response you receive an initial snapshot of the orderbook. There is a last_change_id field that is used to validate integrity of the orderbook events sequence. Each next notification will have a sequentially increasing number by 1 in the id field. Each notification means absolutely quantity for a given price level. If quantity is 0, it means there are no orders for a given price level.

    example
    const unsubscribe = spin.listenBookL3(request, {
    onNotifyOk: (data) => console.log(data),
    onStateOk: (data) => console.log(data),
    onSubOk: (data) => console.log(data),
    onUnsubOk: (data) => console.log(data),
    onSubError: (error) => console.error(error),
    onUnsubError: (error) => console.error(error),
    onNotifyError: (error) => console.error(error),
    onStateError: (error) => console.error(error),
    });

    unsubscribe();

    Parameters

    Returns Subscription

  • Subscribes to the all orders stream of a particular market by it's id

    example
    const unsubscribe = spin.listenOrders(request, {
    onNotifyOk: (data) => console.log(data),
    onSubOk: (data) => console.log(data),
    onUnsubOk: (data) => console.log(data),
    onSubError: (error) => console.error(error),
    onUnsubError: (error) => console.error(error),
    onNotifyError: (error) => console.error(error),
    });

    unsubscribe();

    Parameters

    Returns Subscription

  • Subscribes to the trades stream of a particular market by it's id

    example
    const unsubscribe = spin.listenTrades(request, {
    onNotifyOk: (data) => console.log(data),
    onSubOk: (data) => console.log(data),
    onUnsubOk: (data) => console.log(data),
    onSubError: (error) => console.error(error),
    onUnsubError: (error) => console.error(error),
    onNotifyError: (error) => console.error(error),
    });

    unsubscribe();

    Parameters

    Returns Subscription

  • Health check method for gateway API

    example
    const unsubscribe = spin.ping(undefined, {
    onOk: (data) => console.log(data),
    onError: (error) => console.error(error),
    });

    unsubscribe();

    Parameters

    Returns Subscription

Generated using TypeDoc