From 7c7e39bc4e1695951f94dadfcf3aff9614a95523 Mon Sep 17 00:00:00 2001 From: Tiago Siebler Date: Thu, 18 Jan 2024 12:27:43 +0000 Subject: [PATCH] chore(): fix publish workflow --- .github/workflows/npmpublish.yml | 1 - docs/classes/OrderBook.html | 40 +++++++++++++-------------- docs/classes/OrderBooksStore.html | 12 ++++---- docs/functions/OrderBookLevel.html | 4 +-- docs/index.html | 4 +-- docs/interfaces/OrderBookOptions.html | 6 ++-- docs/modules.html | 4 +-- docs/types/OrderBookLevelState.html | 2 +- package-lock.json | 4 +-- package.json | 2 +- 10 files changed, 39 insertions(+), 40 deletions(-) diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index c49a346..254ecfc 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -10,7 +10,6 @@ on: jobs: publish-npm: - needs: build runs-on: ubuntu-latest steps: - name: Package Version Updated diff --git a/docs/classes/OrderBook.html b/docs/classes/OrderBook.html index 90f0d85..00cc024 100644 --- a/docs/classes/OrderBook.html +++ b/docs/classes/OrderBook.html @@ -1,5 +1,5 @@ -OrderBook | orderbooks - v1.1.8

Class OrderBook<ExtraStateType>

Storage helper to store/track/manipulate the current state of an symbol's orderbook

-

Type Parameters

  • ExtraStateType = unknown

Constructors

constructor +OrderBook | orderbooks - v1.1.9

Class OrderBook<ExtraStateType>

Storage helper to store/track/manipulate the current state of an symbol's orderbook

+

Type Parameters

  • ExtraStateType = unknown

Constructors

Properties

lastUpdateTimestamp: number
maxDepth: number
shouldCheckTimestamps: boolean
symbol: string

Methods

  • throw error if current timestamp is older than last updated timestamp

    -

    Parameters

    • timestamp: number

    Returns undefined | false

  • Private

    find index of level in book, using "price" property as primary key

    +

Constructors

Properties

lastUpdateTimestamp: number
maxDepth: number
shouldCheckTimestamps: boolean
symbol: string

Methods

  • throw error if current timestamp is older than last updated timestamp

    +

    Parameters

    • timestamp: number

    Returns undefined | false

  • Private

    find index of level in book, using "price" property as primary key

    Parameters

    Returns number

    index of level in book, if found, else -1

    -
  • get lowest sell order

    +
  • get lowest sell order

    Parameters

    • Optional offset: number = 0

      offset from array centre (should be positive)

    Returns null | number

    lowest seller price

    -
  • get highest buy order price

    +
  • get highest buy order price

    Parameters

    • Optional offset: number = 0

      offset from array centre (should be positive)

    Returns null | number

    highest buyer price

    -
  • get current bid/ask spread in basis points

    +
  • get current bid/ask spread in basis points

    Parameters

    • Optional n: number = 0

      offset from centre of book

    Returns null | number

    spread between best bid & ask in basis points

    -
  • get current bid/ask spread percentage

    +
  • get current bid/ask spread percentage

    Parameters

    • Optional n: number = 0

      offset from centre of book

    Returns null | number

    percentage spread between best bid & ask

    -
  • Process orderbook delta change, either deleting, updating or inserting level data into the existing book. Price is used on each level to find existing index in tracked book state.

    +
  • Process orderbook delta change, either deleting, updating or inserting level data into the existing book. Price is used on each level to find existing index in tracked book state.

    Parameters

    • Optional deleteDelta: OrderBookLevelState<unknown>[] = []

      levels to delete

    • Optional upsertDelta: OrderBookLevelState<unknown>[] = []

      levels to update (will automatically insert if level does not exist)

    • Optional insertDelta: OrderBookLevelState<unknown>[] = []

      levels to insert

      -
    • timestamp: number = ...

    Returns this

  • Process orderbook snapshot, replacing existing book in memory

    +
  • timestamp: number = ...

Returns this

  • Process orderbook snapshot, replacing existing book in memory

    Parameters

    • data: OrderBookLevelState<ExtraStateType>[]

      current orderbook snapshot represented as array, where each child element is a level in the orderbook

      -
    • timestamp: number = ...

    Returns this

  • Private

    replace item at index, mutating existing book store

    -

    Parameters

    Returns this

  • Sort orderbook in memory, lowest price last, highest price first

    -

    Returns this

  • Track last updated timestamp

    -

    Parameters

    • timestamp: number = ...

    Returns this

  • Trim edges of orderbook to total target

    +
  • timestamp: number = ...

Returns this

Generated using TypeDoc

\ No newline at end of file +

Returns this

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/OrderBooksStore.html b/docs/classes/OrderBooksStore.html index 6d8a6ea..6aec71a 100644 --- a/docs/classes/OrderBooksStore.html +++ b/docs/classes/OrderBooksStore.html @@ -1,6 +1,6 @@ -OrderBooksStore | orderbooks - v1.1.8

Class OrderBooksStore<ExtraStateType>

Store for multi-symbol orderbooks, grouped into one book (OrderBook) per symbol

+OrderBooksStore | orderbooks - v1.1.9

Class OrderBooksStore<ExtraStateType>

Store for multi-symbol orderbooks, grouped into one book (OrderBook) per symbol

ExtraStateType is optional extra state you may want to store with each orderbook level, completely optional. Inject a union type if desired.

-

Type Parameters

  • ExtraStateType = unknown

Constructors

Type Parameters

  • ExtraStateType = unknown

Constructors

Properties

Methods

Constructors

Properties

books: Record<string, OrderBook<ExtraStateType>> = {}
maxDepth: number
shouldCheckTimestamp: boolean
traceLog: boolean

Methods

  • Get the current orderbook store for a symbol. Automatically initialised (empty), if none exists yet.

    +

Constructors

Properties

books: Record<string, OrderBook<ExtraStateType>> = {}
maxDepth: number
shouldCheckTimestamp: boolean
traceLog: boolean

Methods

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/OrderBookLevel.html b/docs/functions/OrderBookLevel.html index 4cb3e6f..f972c6f 100644 --- a/docs/functions/OrderBookLevel.html +++ b/docs/functions/OrderBookLevel.html @@ -1,3 +1,3 @@ -OrderBookLevel | orderbooks - v1.1.8

Function OrderBookLevel

Returns OrderBookLevelState<T>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 73bfc1a..5ac829f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,4 @@ -orderbooks - v1.1.8

orderbooks - v1.1.8

OrderBooks Store npm version npm size npm downloads

CodeFactor

+orderbooks - v1.1.9

orderbooks - v1.1.9

OrderBooks Store npm version npm size npm downloads

CodeFactor

A minimal set of utilities for handling orderbook snapshots and delta updates, with bybit examples.

Issues & Discussion

  • Issues? Check the issues tab.
  • @@ -76,4 +76,4 @@
    const btcOrderBook = OrderBooks.getBook('BTCUSD');

    // console.log current orderbook state
    btcOrderBook.print();

    // clear current orderbook to free memory
    btcOrderBook.reset();

    Star History

    Star History Chart

    -

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/OrderBookOptions.html b/docs/interfaces/OrderBookOptions.html index 06abc46..44c825b 100644 --- a/docs/interfaces/OrderBookOptions.html +++ b/docs/interfaces/OrderBookOptions.html @@ -1,5 +1,5 @@ -OrderBookOptions | orderbooks - v1.1.8

Interface OrderBookOptions

interface OrderBookOptions {
    checkTimestamps?: boolean;
    maxDepth?: number;
    traceLog?: boolean;
}

Properties

checkTimestamps? +OrderBookOptions | orderbooks - v1.1.9

Interface OrderBookOptions

interface OrderBookOptions {
    checkTimestamps?: boolean;
    maxDepth?: number;
    traceLog?: boolean;
}

Properties

checkTimestamps?: boolean
maxDepth?: number
traceLog?: boolean

Whether to console.log when a snapshot or delta is processed

-

Generated using TypeDoc

\ No newline at end of file +

Properties

checkTimestamps?: boolean
maxDepth?: number
traceLog?: boolean

Whether to console.log when a snapshot or delta is processed

+

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html index 330e579..d290b8f 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1,6 +1,6 @@ -orderbooks - v1.1.8

orderbooks - v1.1.8

Index

Classes

OrderBook +orderbooks - v1.1.9

orderbooks - v1.1.9

Index

Classes

Interfaces

Type Aliases

Functions

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/OrderBookLevelState.html b/docs/types/OrderBookLevelState.html index 2799340..b07e35a 100644 --- a/docs/types/OrderBookLevelState.html +++ b/docs/types/OrderBookLevelState.html @@ -1 +1 @@ -OrderBookLevelState | orderbooks - v1.1.8

Type alias OrderBookLevelState<T>

OrderBookLevelState<T>: [Symbol, Price, Side, Quantity, (T[] | any)?]

Type Parameters

  • T = unknown

Generated using TypeDoc

\ No newline at end of file +OrderBookLevelState | orderbooks - v1.1.9

Type alias OrderBookLevelState<T>

OrderBookLevelState<T>: [Symbol, Price, Side, Quantity, (T[] | any)?]

Type Parameters

  • T = unknown

Generated using TypeDoc

\ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 1f8e647..c2ec7a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "orderbooks", - "version": "1.1.8", + "version": "1.1.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "orderbooks", - "version": "1.1.8", + "version": "1.1.9", "license": "MIT", "devDependencies": { "@babel/core": "^7.14.5", diff --git a/package.json b/package.json index 9d6cda7..22ed8ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orderbooks", - "version": "1.1.8", + "version": "1.1.9", "description": "In-memory state stores and handlers for caching multiple exchange:symbol orderbook states", "main": "lib/index.js", "types": "lib/index.d.ts",