diff --git a/.babelrc b/.babelrc index 10266dd..6a13c6a 100644 --- a/.babelrc +++ b/.babelrc @@ -1,9 +1,13 @@ { "presets": [ - "env" + ["@babel/preset-env", { + "targets": { + "node": "8.3.0" + } + }] ], "plugins": [ - "transform-regenerator", - "transform-object-rest-spread" + "@babel/plugin-transform-regenerator", + "@babel/plugin-proposal-object-rest-spread" ] } diff --git a/.eslintrc.json b/.eslintrc.json index 307b7e5..71c4cbc 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,4 +1,6 @@ { + "root": true, + "plugins": [ "jsdoc", "mocha" diff --git a/.jsdoc.json b/.jsdoc.json index 54320f4..df0c300 100644 --- a/.jsdoc.json +++ b/.jsdoc.json @@ -4,7 +4,7 @@ "dictionaries": ["jsdoc"] }, "source": { - "include": ["lib", "DOCUMENTATION.md"], + "include": ["index.js", "lib", "DOCUMENTATION.md"], "includePattern": ".js$", "excludePattern": "(node_modules/|docs)" }, @@ -24,7 +24,6 @@ "recurse": true, "template": "./node_modules/docdash" }, - "package": "", "docdash": { "static": true, "sort": true, diff --git a/CHANGELOG b/CHANGELOG index c689dcc..7736bef 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +# 1.2.10 +- meta: bump deps +- meta: normalize eslint config +- refactor: improve doclets + # 1.2.9 - feature: add Invoice model diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md deleted file mode 100644 index 564d374..0000000 --- a/DOCUMENTATION.md +++ /dev/null @@ -1,142 +0,0 @@ -# Bitfinex Data Models for Node.JS - -This repo contains model classes for working with the data structures returned -by the Bitfinex REST & WebSocket APIs. The models can all be initialized with -an array-format payload as returned by an API call, and can be unserialized -back to the array format when needed. - -Some models, such as {@link Order} and {@link OrderBook} provide higher level -methods which operate on the underlying data sets. - -All models provide `serialize()` and `unserialize()` methods, which convert -to/from array-format payloads respectively. All model constructors can take -either array-format payloads, or objects/other model instances. A helper -`toJS()` method is also provided for converting models to plain JS objects -(POJOs). - -### Features - -* Convert between array, object, and class representations of API data -* Class methods for operating on model data where applicable (i.e. `OrderBook`) - -Classes for the following Bitfinex API data types: -* {@link Alert} -* {@link BalanceInfo} -* {@link Candle} -* {@link Currency} -* {@link FundingCredit} -* {@link FundingInfo} -* {@link FundingLoan} -* {@link FundingOffer} -* {@link FundingTickerHist} -* {@link FundingTicker} -* {@link FundingTrade} -* {@link LedgerEntry} -* {@link Liquidations} -* {@link MarginInfo} -* {@link Movement} -* {@link Notification} -* {@link OrderBook} -* {@link Order} -* {@link Position} -* {@link PublicTrade} -* {@link StatusMessagesDeriv} -* {@link Trade} -* {@link TradingTicker} -* {@link TradingTickerHist} -* {@link UserInfo} -* {@link Wallet} -* {@link WalletHist} -* {@link Currency} - -### Installation - -```js -npm i --save bfx-api-node-models -``` - -### Quickstart - -```js -const { Order } = require('bfx-api-node-models') - -const o = new Order({ - cid: Date.now(), - symbol: 'tBTCUSD', - price: 7000.0, - amount: -0.02, - type: Order.type.EXCHANGE_LIMIT -}) - -// Generate an API-compatible order creation packet for later submit -console.log(o.toNewOrderPacket()) -``` - -### Examples - -The order model provides helper methods for order submission, updates, and cancellation. These methods are compatible with version 2.0.0 of `bitfinex-api-node`, and return promises which resolve upon receival of the relevant success/error notifications. - -Orders are matched with their API packets by one/all of `id`, `gid`, and `cid`. - -Example usage: -```js -const { Order } = require('bfx-api-node-models') -const ws = ... // setup WSv2 instance for order updates/submission - -// Build new order -const o = new Order({ - cid: Date.now(), - symbol: 'tBTCUSD', - price: 7000.0, - amount: -0.02, - type: Order.type.EXCHANGE_LIMIT -}, ws) // note WSv2 client passed in here - -let closed = false - -// Enable automatic updates -o.registerListeners() - -o.on('update', () => { - debug('order updated: %j', o.serialize()) -}) - -o.on('close', () => { - debug('order closed: %s', o.status) - closed = true -}) - -debug('submitting order %d', o.cid) - -o.submit().then(() => { - debug('got submit confirmation for order %d [%d]', o.cid, o.id) -}).catch((err) => { - debug('failed to submit order: %s', err.message) -}) -``` - -The order book model constructor takes either entire book snapshots as returned by the WSv2 API, or individual update packets with single bids/asks. Once constructed, order books may be updated either with complete snapshots via `updateFromSnapshot(snapshot)` or individual update packets via `updateWidth(entry)`. - -Static helpers are also provided for working with array-format order books, in the form of `updateArrayOBWith(ob, entry, raw)`, `arrayOBMidPrice(ob, raw)`, and `checksumArr(ob, raw)`. - -Checksums may be calculated for normal books via `checksum()`, for comparison with the checksums reported by the WSv2 API. - -Example usage: -```js -const ob = new OrderBook([ - [140, 1, 10], - [145, 1, 10], - [148, 1, 10], - [149, 1, 10], - [151, 1, -10], - [152, 1, -10], - [158, 1, -10], - [160, 1, -10] -]) - -ob.updateWith([145, 3, 15]) // update bid -ob.updateWith([158, 3, -15]) // update ask - -console.log(ob.serialize()) -``` - diff --git a/README.md b/README.md index e20a2c6..894f1d0 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,19 @@ [](https://travis-ci.org/bitfinexcom/bfx-api-node-models) -This repo contains model classes for working with the data structures returned by the Bitfinex REST & WebSocket APIs. The models can all be initialized with an array-format payload as returned by an API call, and can be unserialized back to the array format when needed. +This repo contains model classes for working with the data structures returned +by the Bitfinex REST & WebSocket APIs. The models can all be initialized with +an array-format payload as returned by an API call, and can be unserialized +back to the array format when needed. -Some models, such as `Order` and `OrderBook` provide higher level methods which operate on the underlying data sets. +Some models, such as `Order` and `OrderBook` provide higher level methods which +operate on the underlying data sets. -All models provide `serialize()` and `unserialize()` methods, which convert to/from array-format payloads respectively. All model constructors can take either array-format payloads, or objects/other model instances. A helper `toJS()` method is also provided for converting models to plain JS objects (POJOs). +All models provide `serialize()` and `unserialize()` methods, which convert +to/from array-format payloads respectively. All model constructors can take +either array-format payloads, or objects/other model instances. A helper +`toJS()` method is also provided for converting models to plain JS objects +(POJOs). ### Features @@ -68,12 +76,15 @@ console.log(o.toNewOrderPacket()) ### Docs -Refer to the [docs/](https://cdn.statically.io/gh/bitfinexcom/bfx-api-node-models/master/docs/index.html) -folder for JSDoc-generated API documentation covering each model class. +Refer to [docs/reference.md](docs/reference.md) for JSDoc-generated API +documentation. ### Examples -The order model provides helper methods for order submission, updates, and cancellation. These methods are compatible with version 2.0.0 of `bitfinex-api-node`, and return promises which resolve upon receival of the relevant success/error notifications. +The order model provides helper methods for order submission, updates, and +cancellation. These methods are compatible with version 2.0.0 of +`bitfinex-api-node`, and return promises which resolve upon receival of the +relevant success/error notifications. Orders are matched with their API packets by one/all of `id`, `gid`, and `cid`. @@ -114,13 +125,21 @@ o.submit().then(() => { }) ``` -The order book model constructor takes either entire book snapshots as returned by the WSv2 API, or individual update packets with single bids/asks. Once constructed, order books may be updated either with complete snapshots via `updateFromSnapshot(snapshot)` or individual update packets via `updateWidth(entry)`. +The order book model constructor takes either entire book snapshots as returned +by the WSv2 API, or individual update packets with single bids/asks. Once +constructed, order books may be updated either with complete snapshots via +`updateFromSnapshot(snapshot)` or individual update packets via +`updateWidth(entry)`. -Static helpers are also provided for working with array-format order books, in the form of `updateArrayOBWith(ob, entry, raw)`, `arrayOBMidPrice(ob, raw)`, and `checksumArr(ob, raw)`. +Static helpers are also provided for working with array-format order books, in +the form of `updateArrayOBWith(ob, entry, raw)`, `arrayOBMidPrice(ob, raw)`, +and `checksumArr(ob, raw)`. -Checksums may be calculated for normal books via `checksum()`, for comparison with the checksums reported by the WSv2 API. +Checksums may be calculated for normal books via `checksum()`, for comparison +with the checksums reported by the WSv2 API. Example usage: + ```js const ob = new OrderBook([ [140, 1, 10], diff --git a/docs/.keep b/docs/.keep new file mode 100644 index 0000000..e69de29 diff --git a/docs/fonts/Montserrat/Montserrat-Bold.eot b/docs/fonts/Montserrat/Montserrat-Bold.eot deleted file mode 100644 index f2970bb..0000000 Binary files a/docs/fonts/Montserrat/Montserrat-Bold.eot and /dev/null differ diff --git a/docs/fonts/Montserrat/Montserrat-Bold.ttf b/docs/fonts/Montserrat/Montserrat-Bold.ttf deleted file mode 100644 index 3bfd79b..0000000 Binary files a/docs/fonts/Montserrat/Montserrat-Bold.ttf and /dev/null differ diff --git a/docs/fonts/Montserrat/Montserrat-Bold.woff b/docs/fonts/Montserrat/Montserrat-Bold.woff deleted file mode 100644 index 9260765..0000000 Binary files a/docs/fonts/Montserrat/Montserrat-Bold.woff and /dev/null differ diff --git a/docs/fonts/Montserrat/Montserrat-Bold.woff2 b/docs/fonts/Montserrat/Montserrat-Bold.woff2 deleted file mode 100644 index d9940cd..0000000 Binary files a/docs/fonts/Montserrat/Montserrat-Bold.woff2 and /dev/null differ diff --git a/docs/fonts/Montserrat/Montserrat-Regular.eot b/docs/fonts/Montserrat/Montserrat-Regular.eot deleted file mode 100644 index 735d12b..0000000 Binary files a/docs/fonts/Montserrat/Montserrat-Regular.eot and /dev/null differ diff --git a/docs/fonts/Montserrat/Montserrat-Regular.ttf b/docs/fonts/Montserrat/Montserrat-Regular.ttf deleted file mode 100644 index 5da852a..0000000 Binary files a/docs/fonts/Montserrat/Montserrat-Regular.ttf and /dev/null differ diff --git a/docs/fonts/Montserrat/Montserrat-Regular.woff b/docs/fonts/Montserrat/Montserrat-Regular.woff deleted file mode 100644 index bf91832..0000000 Binary files a/docs/fonts/Montserrat/Montserrat-Regular.woff and /dev/null differ diff --git a/docs/fonts/Montserrat/Montserrat-Regular.woff2 b/docs/fonts/Montserrat/Montserrat-Regular.woff2 deleted file mode 100644 index 72d13c6..0000000 Binary files a/docs/fonts/Montserrat/Montserrat-Regular.woff2 and /dev/null differ diff --git a/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot b/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot deleted file mode 100644 index 0f24510..0000000 Binary files a/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot and /dev/null differ diff --git a/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg b/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg deleted file mode 100644 index 5384f98..0000000 --- a/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +++ /dev/null @@ -1,978 +0,0 @@ - - - \ No newline at end of file diff --git a/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf b/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf deleted file mode 100644 index e6c158c..0000000 Binary files a/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf and /dev/null differ diff --git a/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff b/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff deleted file mode 100644 index d0a1c29..0000000 Binary files a/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff and /dev/null differ diff --git a/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 b/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 deleted file mode 100644 index d286974..0000000 Binary files a/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 and /dev/null differ diff --git a/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot b/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot deleted file mode 100644 index b420448..0000000 Binary files a/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot and /dev/null differ diff --git a/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg b/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg deleted file mode 100644 index dee0949..0000000 --- a/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +++ /dev/null @@ -1,1049 +0,0 @@ - - - \ No newline at end of file diff --git a/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf b/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf deleted file mode 100644 index 4d56c33..0000000 Binary files a/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf and /dev/null differ diff --git a/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff b/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff deleted file mode 100644 index 4681019..0000000 Binary files a/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff and /dev/null differ diff --git a/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 b/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 deleted file mode 100644 index 8ddcae3..0000000 Binary files a/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 and /dev/null differ diff --git a/docs/reference.md b/docs/reference.md new file mode 100644 index 0000000..8cb9563 --- /dev/null +++ b/docs/reference.md @@ -0,0 +1,4625 @@ +## Modules + +
This module contains model classes for working with the data structures +returned by the Bitfinex REST & +WebSocket APIs. The models can all be +initialized with an array-format payload as returned by an API call, and can +be unserialized back to the array format when needed.
+Some models, such as Order and OrderBook provide higher +level methods which operate on the underlying data sets.
+All models provide serialize() and unserialize() methods, which convert
+to/from array-format payloads respectively. All model constructors can take
+either array-format payloads, or objects/other model instances. A helper
+toJS() method is also provided for converting models to plain JS objects
+(POJOs).
ModelPrice alert model
+ModelBalance information model
+ModelOHLCV Candle model
+ModelChange log model
+ModelCurrency model
+ModelFunding Credit model
+ModelAccount Funding Info model
+ModelFunding Loan model
+ModelFunding Offer model
+ModelHistorical Funding Ticker model
+ModelFunding Ticker model
+ModelFunding Trade model
+Deposit Invoice model
+ModelLedger Entry model; wallet field is automatically populated if a description +is provided.
+ModelLiquidation Info model
+ModelLogin event model
+ModelMargin Info model
+events.EventEmitterBase model class, providing format-conversion methods
+ModelCurrency Movement model
+ModelNotification model. Broadcast notification body schema may be found at +BroadcastPayload.
+events.EventEmitterHigh level OB model to automatically integrate WS updates & maintain sort
+ModelHigh level order model; provides methods for execution & can stay updated via +a WSv2 connection or used to execute as a rest payload
+ModelPosition model
+ModelPublic PulseProfile model
+ModelPublic Trade model, supporting both funding & ordinary trades
+ModelPrivate PulseMessage model
+ModelDerivatives Status Message model
+ModelPrivate Trade model
+ModelHistorical Trading Ticker model
+ModelTrading Ticker model
+ModelUser Info model
+ModelHistorical Wallet Update model
+ModelWallet model
+booleanChecks if the provided data is a collection of models
+Model](#Model)
+Price alert model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [Alert](#Alert) ⇐ [Model](#Model)
+ * [new Alert(data)](#new_Alert_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#Alert.unserialize) ⇒ [ObjectData](#Alert..ObjectData)
+ * [.validate(data)](#Alert.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#Alert..ArrayData) : Array
+ * [~Data](#Alert..Data) : [Alert](#Alert) \| [ObjectData](#Alert..ObjectData) \| [ArrayData](#Alert..ArrayData)
+ * [~ObjectData](#Alert..ObjectData) : object
+
+
+
+### new Alert(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Alert..Data) \| [Array.<Data>](#Alert..Data) | data |
+
+
+
+### alert.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [Alert](#Alert)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### alert.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [Alert](#Alert)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### Alert.unserialize(data) ⇒ [ObjectData](#Alert..ObjectData)
+**Kind**: static method of [Alert](#Alert)
+**Returns**: [ObjectData](#Alert..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Alert..Data) \| [Array.<Data>](#Alert..Data) | data to convert to POJO |
+
+
+
+### Alert.validate(data) ⇒ string
+Validates a given alert instance
+
+**Kind**: static method of [Alert](#Alert)
+**Returns**: string - error - null if instance is valid
+**Todo**
+
+- [ ] validate type (get a list)
+
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Alert..Data) \| [Array.<Data>](#Alert..Data) | instance(s) to validate |
+
+
+
+### Alert~ArrayData : Array
+[Alert](#Alert) data in WSv2 array format. Suitable for passing to
+[Alert](#Alert) to construct a model instance.
+
+**Kind**: inner typedef of [Alert](#Alert)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | string | key |
+| 1 | string | type |
+| 2 | string | symbol |
+| 3 | string | price |
+
+
+
+### Alert~Data : [Alert](#Alert) \| [ObjectData](#Alert..ObjectData) \| [ArrayData](#Alert..ArrayData)
+[Alert](#Alert) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [Alert](#Alert)
+
+
+### Alert~ObjectData : object
+[Alert](#Alert) data in plain object format. Suitable for passing to
+[Alert](#Alert) to construct a model instance.
+
+**Kind**: inner typedef of [Alert](#Alert)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| key | string | alert key |
+| type | string | alert type |
+| symbol | string | configured symbol |
+| price | string | configured price |
+
+
+
+## BalanceInfo ⇐ [Model](#Model)
+Balance information model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [BalanceInfo](#BalanceInfo) ⇐ [Model](#Model)
+ * [new BalanceInfo(data)](#new_BalanceInfo_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#BalanceInfo.unserialize) ⇒ object
+ * [.validate(data)](#BalanceInfo.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#BalanceInfo..ArrayData) : Array
+ * [~Data](#BalanceInfo..Data) : [BalanceInfo](#BalanceInfo) \| [ObjectData](#BalanceInfo..ObjectData) \| [ArrayData](#BalanceInfo..ArrayData)
+ * [~ObjectData](#BalanceInfo..ObjectData) : object
+
+
+
+### new BalanceInfo(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#BalanceInfo..Data) \| [Array.<Data>](#BalanceInfo..Data) | data |
+
+
+
+### balanceInfo.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [BalanceInfo](#BalanceInfo)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### balanceInfo.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [BalanceInfo](#BalanceInfo)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### BalanceInfo.unserialize(data) ⇒ object
+**Kind**: static method of [BalanceInfo](#BalanceInfo)
+**Returns**: object - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#BalanceInfo..Data) \| [Array.<Data>](#BalanceInfo..Data) | data to convert to POJO |
+
+
+
+### BalanceInfo.validate(data) ⇒ string
+Validates a given balance info instance
+
+**Kind**: static method of [BalanceInfo](#BalanceInfo)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#BalanceInfo..Data) \| [Array.<Data>](#BalanceInfo..Data) | instance(s) to validate |
+
+
+
+### BalanceInfo~ArrayData : Array
+[BalanceInfo](#BalanceInfo) data in WSv2 array format. Suitable for passing to
+[BalanceInfo](#BalanceInfo) to construct a model instance.
+
+**Kind**: inner typedef of [BalanceInfo](#BalanceInfo)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | number | amount |
+| 1 | number | amountNet |
+
+
+
+### BalanceInfo~Data : [BalanceInfo](#BalanceInfo) \| [ObjectData](#BalanceInfo..ObjectData) \| [ArrayData](#BalanceInfo..ArrayData)
+Balance info data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [BalanceInfo](#BalanceInfo)
+
+
+### BalanceInfo~ObjectData : object
+[BalanceInfo](#BalanceInfo) data in plain object format. Suitable for passing to
+[BalanceInfo](#BalanceInfo) to construct a model instance.
+
+**Kind**: inner typedef of [BalanceInfo](#BalanceInfo)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| amount | number | total balance |
+| amountNet | number | net balance |
+
+
+
+## Candle ⇐ [Model](#Model)
+OHLCV Candle model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [Candle](#Candle) ⇐ [Model](#Model)
+ * [new Candle(data)](#new_Candle_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#Candle.unserialize) ⇒ [ObjectData](#Candle..ObjectData)
+ * [.validate(data)](#Candle.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#Candle..ArrayData) : Array
+ * [~Data](#Candle..Data) : [Candle](#Candle) \| [ObjectData](#Candle..ObjectData) \| [ArrayData](#Candle..ArrayData)
+ * [~ObjectData](#Candle..ObjectData) : object
+
+
+
+### new Candle(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Candle..Data) \| [Array.<Data>](#Candle..Data) | data |
+
+
+
+### candle.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [Candle](#Candle)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### candle.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [Candle](#Candle)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### Candle.unserialize(data) ⇒ [ObjectData](#Candle..ObjectData)
+**Kind**: static method of [Candle](#Candle)
+**Returns**: [ObjectData](#Candle..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Candle..Data) \| [Array.<Data>](#Candle..Data) | data to convert to POJO |
+
+
+
+### Candle.validate(data) ⇒ string
+Validates a given Candle instance
+
+**Kind**: static method of [Candle](#Candle)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Candle..Data) \| [Array.<Data>](#Candle..Data) | instance(s) to validate |
+
+
+
+### Candle~ArrayData : Array
+[Candle](#Candle) data in WSv2 array format. Suitable for passing to
+[Candle](#Candle) to construct a model instance.
+
+**Kind**: inner typedef of [Candle](#Candle)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | number | mts |
+| 1 | number | open |
+| 2 | number | close |
+| 3 | number | high |
+| 4 | number | low |
+| 5 | number | volume |
+
+
+
+### Candle~Data : [Candle](#Candle) \| [ObjectData](#Candle..ObjectData) \| [ArrayData](#Candle..ArrayData)
+Candle data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [Candle](#Candle)
+
+
+### Candle~ObjectData : object
+[Candle](#Candle) data in plain object format. Suitable for passing to
+[Candle](#Candle) to construct a model instance.
+
+**Kind**: inner typedef of [Candle](#Candle)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| mts | number | timestamp |
+| open | number | open price |
+| close | number | close price |
+| high | number | highest price in period |
+| low | number | lowest price in period |
+| volume | number | total volume in period |
+
+
+
+## ChangeLog ⇐ [Model](#Model)
+Change log model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [ChangeLog](#ChangeLog) ⇐ [Model](#Model)
+ * [new ChangeLog(data)](#new_ChangeLog_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#ChangeLog.unserialize) ⇒ object
+ * [.validate(data)](#ChangeLog.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#ChangeLog..ArrayData) : Array
+ * [~Data](#ChangeLog..Data) : [ChangeLog](#ChangeLog) \| [ObjectData](#ChangeLog..ObjectData) \| [ArrayData](#ChangeLog..ArrayData)
+ * [~ObjectData](#ChangeLog..ObjectData) : object
+
+
+
+### new ChangeLog(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#ChangeLog..Data) \| [Array.<Data>](#ChangeLog..Data) | data |
+
+
+
+### changeLog.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [ChangeLog](#ChangeLog)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### changeLog.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [ChangeLog](#ChangeLog)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### ChangeLog.unserialize(data) ⇒ object
+**Kind**: static method of [ChangeLog](#ChangeLog)
+**Returns**: object - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#ChangeLog..Data) \| [Array.<Data>](#ChangeLog..Data) | data to convert to POJO |
+
+
+
+### ChangeLog.validate(data) ⇒ string
+Validates a given wallet instance
+
+**Kind**: static method of [ChangeLog](#ChangeLog)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#ChangeLog..Data) \| [Array.<Data>](#ChangeLog..Data) | instance(s) to validate |
+
+
+
+### ChangeLog~ArrayData : Array
+[ChangeLog](#ChangeLog) data in WSv2 array format. Suitable for passing to
+[ChangeLog](#ChangeLog) to construct a model instance.
+
+**Kind**: inner typedef of [ChangeLog](#ChangeLog)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | number | mtsCreate |
+| 2 | string | log |
+| 5 | string | ip |
+| 6 | string | userAgent |
+
+
+
+### ChangeLog~Data : [ChangeLog](#ChangeLog) \| [ObjectData](#ChangeLog..ObjectData) \| [ArrayData](#ChangeLog..ArrayData)
+Change log data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [ChangeLog](#ChangeLog)
+
+
+### ChangeLog~ObjectData : object
+[ChangeLog](#ChangeLog) data in plain object format. Suitable for passing to
+[ChangeLog](#ChangeLog) to construct a model instance.
+
+**Kind**: inner typedef of [ChangeLog](#ChangeLog)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| mtsCreate | number | timestamp |
+| log | string | log data |
+| ip | string | ip |
+| userAgent | string | user agent |
+
+
+
+## Currency ⇐ [Model](#Model)
+Currency model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [Currency](#Currency) ⇐ [Model](#Model)
+ * [new Currency(data)](#new_Currency_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#Currency.unserialize) ⇒ [ObjectData](#Currency..ObjectData)
+ * [.validate(data)](#Currency.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#Currency..ArrayData) : Array
+ * [~Data](#Currency..Data) : [Currency](#Currency) \| [ObjectData](#Currency..ObjectData) \| [ArrayData](#Currency..ArrayData)
+ * [~ObjectData](#Currency..ObjectData) : object
+
+
+
+### new Currency(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Currency..Data) \| [Array.<Data>](#Currency..Data) | data |
+
+
+
+### currency.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [Currency](#Currency)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### currency.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [Currency](#Currency)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### Currency.unserialize(data) ⇒ [ObjectData](#Currency..ObjectData)
+**Kind**: static method of [Currency](#Currency)
+**Returns**: [ObjectData](#Currency..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Currency..Data) \| [Array.<Data>](#Currency..Data) | data to convert to POJO |
+
+
+
+### Currency.validate(data) ⇒ string
+Validates a given currency instance
+
+**Kind**: static method of [Currency](#Currency)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Currency..Data) \| [Array.<Data>](#Currency..Data) | instance(s) to validate |
+
+
+
+### Currency~ArrayData : Array
+[Currency](#Currency) data in WSv2 array format. Suitable for passing to
+[Currency](#Currency) to construct a model instance.
+
+**Kind**: inner typedef of [Currency](#Currency)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | string | id |
+| 1 | string | name |
+| 2 | string | pool |
+| 3 | string | explorer |
+| 4 | string | symbol |
+
+
+
+### Currency~Data : [Currency](#Currency) \| [ObjectData](#Currency..ObjectData) \| [ArrayData](#Currency..ArrayData)
+Currency data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [Currency](#Currency)
+
+
+### Currency~ObjectData : object
+[Currency](#Currency) data in plain object format. Suitable for passing to
+[Currency](#Currency) to construct a model instance.
+
+**Kind**: inner typedef of [Currency](#Currency)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| id | string | id |
+| name | string | currency name ('Ethereum') |
+| pool | string | pool |
+| exporer | string | explorer URL |
+| symbol | string | symbol ('ETH') |
+
+
+
+## FundingCredit ⇐ [Model](#Model)
+Funding Credit model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [FundingCredit](#FundingCredit) ⇐ [Model](#Model)
+ * [new FundingCredit(data)](#new_FundingCredit_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#FundingCredit.unserialize) ⇒ [ObjectData](#FundingCredit..ObjectData)
+ * [.validate(data)](#FundingCredit.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#FundingCredit..ArrayData) : Array
+ * [~Data](#FundingCredit..Data) : [FundingCredit](#FundingCredit) \| [ObjectData](#FundingCredit..ObjectData) \| [ArrayData](#FundingCredit..ArrayData)
+ * [~ObjectData](#FundingCredit..ObjectData) : object
+
+
+
+### new FundingCredit(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingCredit..Data) \| [Array.<Data>](#FundingCredit..Data) | data |
+
+
+
+### fundingCredit.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [FundingCredit](#FundingCredit)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### fundingCredit.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [FundingCredit](#FundingCredit)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### FundingCredit.unserialize(data) ⇒ [ObjectData](#FundingCredit..ObjectData)
+**Kind**: static method of [FundingCredit](#FundingCredit)
+**Returns**: [ObjectData](#FundingCredit..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingCredit..Data) \| [Array.<Data>](#FundingCredit..Data) | data to convert to POJO |
+
+
+
+### FundingCredit.validate(data) ⇒ string
+Validates a given funding credit instance
+
+**Kind**: static method of [FundingCredit](#FundingCredit)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingCredit..Data) \| [Array.<Data>](#FundingCredit..Data) | instance(s) to validate |
+
+
+
+### FundingCredit~ArrayData : Array
+[FundingCredit](#FundingCredit) data in WSv2 array format. Suitable for passing to a
+[FundingCredit](#FundingCredit) instance.
+
+**Kind**: inner typedef of [FundingCredit](#FundingCredit)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | number | id |
+| 1 | string | symbol |
+| 2 | number | side |
+| 3 | number | mtsCreate |
+| 4 | number | mtsUpdate |
+| 13 | number | mtsOpening |
+| 14 | number | mtsLastPayout |
+| 5 | number | amount |
+| 6 | number | flags |
+| 7 | number | status |
+| 11 | number | rate |
+| 19 | number | rateReal |
+| 12 | number | period |
+| 21 | string | positionPair |
+| 15 | number | notify |
+| 16 | number | hidden |
+| 18 | number | renew |
+| 20 | number | noClose |
+
+
+
+### FundingCredit~Data : [FundingCredit](#FundingCredit) \| [ObjectData](#FundingCredit..ObjectData) \| [ArrayData](#FundingCredit..ArrayData)
+[FundingCredit](#FundingCredit) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [FundingCredit](#FundingCredit)
+
+
+### FundingCredit~ObjectData : object
+[FundingCredit](#FundingCredit) data in plain object format. Suitable for passing to
+[FundingCredit](#FundingCredit) to construct a model instance.
+
+**Kind**: inner typedef of [FundingCredit](#FundingCredit)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| id | number | id |
+| symbol | string | symbol |
+| side | number | side |
+| mtsCreate | number | creation timestamp |
+| mtsUpdate | number | last update timestamp |
+| mtsOpening | number | open timestamp |
+| mtsLastPayout | number | last payout timestamp |
+| amount | number | remaining amount |
+| flags | number | flags |
+| status | number | current status |
+| rate | number | rate |
+| rateReal | number | rate |
+| period | number | period |
+| positionPair | string | position pair |
+| notify | number \| boolean | notify flag |
+| hidden | number \| boolean | hidden flag |
+| renew | number \| boolean | renew flag |
+| noClose | number \| boolean | no-close flag |
+
+
+
+## FundingInfo ⇐ [Model](#Model)
+Account Funding Info model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+**Todo**
+
+- [ ] Extract type defs (varying format)
+
+
+* [FundingInfo](#FundingInfo) ⇐ [Model](#Model)
+ * [new FundingInfo(data)](#new_FundingInfo_new)
+ * _instance_
+ * [.serialize()](#FundingInfo+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#FundingInfo.unserialize) ⇒ object
+ * [.validate(data)](#FundingInfo.validate) ⇒ string
+
+
+
+### new FundingInfo(data)
+Create a new instance from a data payload
+
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | Array.<object> \| object \| Array.<Array> \| Array | funding info data |
+
+
+
+### fundingInfo.serialize() ⇒ Array
+Return an array representation of this model
+
+**Kind**: instance method of [FundingInfo](#FundingInfo)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### fundingInfo.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [FundingInfo](#FundingInfo)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### FundingInfo.unserialize(data) ⇒ object
+TODO: Figure out a better object key for 'payload', as we need to support
+ both arrays and POJOs
+
+**Kind**: static method of [FundingInfo](#FundingInfo)
+**Returns**: object - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | Array.<object> \| object \| Array.<Array> \| Array | data to convert to POJO |
+
+
+
+### FundingInfo.validate(data) ⇒ string
+Validates a given funding info instance
+
+**Kind**: static method of [FundingInfo](#FundingInfo)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | Array.<object> \| object \| [Array.<FundingInfo>](#FundingInfo) \| [FundingInfo](#FundingInfo) | data to validate |
+
+
+
+## FundingLoan ⇐ [Model](#Model)
+Funding Loan model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [FundingLoan](#FundingLoan) ⇐ [Model](#Model)
+ * [new FundingLoan(data)](#new_FundingLoan_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#FundingLoan.unserialize) ⇒ [ObjectData](#FundingLoan..ObjectData)
+ * [.validate(data)](#FundingLoan.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#FundingLoan..ArrayData) : Array
+ * [~Data](#FundingLoan..Data) : [FundingLoan](#FundingLoan) \| [ObjectData](#FundingLoan..ObjectData) \| [ArrayData](#FundingLoan..ArrayData)
+ * [~ObjectData](#FundingLoan..ObjectData) : object
+
+
+
+### new FundingLoan(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingLoan..Data) \| [Array.<Data>](#FundingLoan..Data) | data |
+
+
+
+### fundingLoan.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [FundingLoan](#FundingLoan)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### fundingLoan.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [FundingLoan](#FundingLoan)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### FundingLoan.unserialize(data) ⇒ [ObjectData](#FundingLoan..ObjectData)
+**Kind**: static method of [FundingLoan](#FundingLoan)
+**Returns**: [ObjectData](#FundingLoan..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingLoan..Data) \| [Array.<Data>](#FundingLoan..Data) | data to convert to POJO |
+
+
+
+### FundingLoan.validate(data) ⇒ string
+Validates a given funding loan instance
+
+**Kind**: static method of [FundingLoan](#FundingLoan)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingLoan..Data) \| [Array.<Data>](#FundingLoan..Data) | instance(s) to validate |
+
+
+
+### FundingLoan~ArrayData : Array
+[FundingLoan](#FundingLoan) data in WSv2 array format. Suitable for passing to
+[FundingLoan](#FundingLoan) to construct a model instance.
+
+**Kind**: inner typedef of [FundingLoan](#FundingLoan)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | number | id |
+| 1 | string | symbol |
+| 2 | number | side |
+| 3 | number | mtsCreate |
+| 4 | number | mtsUpdate |
+| 13 | number | mtsOpening |
+| 14 | number | mtsLastPayout |
+| 5 | number | amount |
+| 6 | number | flags |
+| 7 | number | status |
+| 8 | string | type |
+| 11 | number | rate |
+| 19 | number | rateReal |
+| 12 | number | period |
+| 15 | number | notify |
+| 16 | number | hidden |
+| 18 | number | renew |
+| 20 | number | noClose |
+
+
+
+### FundingLoan~Data : [FundingLoan](#FundingLoan) \| [ObjectData](#FundingLoan..ObjectData) \| [ArrayData](#FundingLoan..ArrayData)
+[FundingLoan](#FundingLoan) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [FundingLoan](#FundingLoan)
+
+
+### FundingLoan~ObjectData : object
+[FundingLoan](#FundingLoan) data in plain object format. Suitable for passing to
+[FundingLoan](#FundingLoan) to construct a model instance.
+
+**Kind**: inner typedef of [FundingLoan](#FundingLoan)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| id | number | id |
+| symbol | string | symbol |
+| side | number | side |
+| mtsCreate | number | creation timestamp |
+| mtsUpdate | number | last update timestamp |
+| mtsOpening | number | open timestamp |
+| mtsLastPayout | number | last payout timestamp |
+| amount | number | amount |
+| flags | number | flags |
+| status | number | status |
+| rate | number | rate |
+| rateReal | number | rate real |
+| period | number | period flag |
+| notify | number \| boolean | notify flag |
+| hidden | number \| boolean | hidden flag |
+| renew | number \| boolean | renew flag |
+| noClose | number \| boolean | no-close flag |
+
+
+
+## FundingOffer ⇐ [Model](#Model)
+Funding Offer model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [FundingOffer](#FundingOffer) ⇐ [Model](#Model)
+ * [new FundingOffer(data, [apiInterface])](#new_FundingOffer_new)
+ * _instance_
+ * [.toNewOfferPacket()](#FundingOffer+toNewOfferPacket) ⇒ [SubmitPayload](#FundingOffer..SubmitPayload)
+ * [.submit([apiInterface])](#FundingOffer+submit) ⇒ Promise
+ * [.cancel([apiInterface])](#FundingOffer+cancel) ⇒ Promise
+ * [.close([apiInterface])](#FundingOffer+close) ⇒ Promise
+ * [.toString()](#FundingOffer+toString) ⇒ string
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#FundingOffer.unserialize) ⇒ [ObjectData](#FundingOffer..ObjectData)
+ * [.validate(data)](#FundingOffer.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#FundingOffer..ArrayData) : Array
+ * [~Data](#FundingOffer..Data) : [FundingOffer](#FundingOffer) \| [ObjectData](#FundingOffer..ObjectData) \| [ArrayData](#FundingOffer..ArrayData)
+ * [~ObjectData](#FundingOffer..ObjectData) : object
+ * [~SubmitPayload](#FundingOffer..SubmitPayload) : object
+
+
+
+### new FundingOffer(data, [apiInterface])
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingOffer..Data) \| [Array.<Data>](#FundingOffer..Data) | data |
+| [apiInterface] | object | rest or websocket object capable of submitting funding offers |
+
+
+
+### fundingOffer.toNewOfferPacket() ⇒ [SubmitPayload](#FundingOffer..SubmitPayload)
+Creates an order map that can be used in either the websocket `on`
+command or a rest request body
+
+**Kind**: instance method of [FundingOffer](#FundingOffer)
+**Returns**: [SubmitPayload](#FundingOffer..SubmitPayload) - on
+
+
+### fundingOffer.submit([apiInterface]) ⇒ Promise
+Submit the funding offer
+
+**Kind**: instance method of [FundingOffer](#FundingOffer)
+**Returns**: Promise - p
+
+| Param | Type | Description |
+| --- | --- | --- |
+| [apiInterface] | bfx-api-node-rest.RESTv2 | rest instance |
+
+
+
+### fundingOffer.cancel([apiInterface]) ⇒ Promise
+Cancel the funding offer
+
+**Kind**: instance method of [FundingOffer](#FundingOffer)
+**Returns**: Promise - p
+
+| Param | Type | Description |
+| --- | --- | --- |
+| [apiInterface] | bfx-api-node-rest.RESTv2 | rest instance |
+
+
+
+### fundingOffer.close([apiInterface]) ⇒ Promise
+Close the funding offer
+
+**Kind**: instance method of [FundingOffer](#FundingOffer)
+**Returns**: Promise - p
+
+| Param | Type | Description |
+| --- | --- | --- |
+| [apiInterface] | bfx-api-node-rest.RESTv2 | rest instance |
+
+
+
+### fundingOffer.toString() ⇒ string
+Returns a string representation of the position
+
+**Kind**: instance method of [FundingOffer](#FundingOffer)
+**Returns**: string - desc
+
+
+### fundingOffer.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [FundingOffer](#FundingOffer)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### fundingOffer.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [FundingOffer](#FundingOffer)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### FundingOffer.unserialize(data) ⇒ [ObjectData](#FundingOffer..ObjectData)
+**Kind**: static method of [FundingOffer](#FundingOffer)
+**Returns**: [ObjectData](#FundingOffer..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingOffer..Data) \| [Array.<Data>](#FundingOffer..Data) | data to convert to POJO |
+
+
+
+### FundingOffer.validate(data) ⇒ string
+Validates a given funding offer instance
+
+**Kind**: static method of [FundingOffer](#FundingOffer)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingOffer..Data) \| [Array.<Data>](#FundingOffer..Data) | instance(s) to validate |
+
+
+
+### FundingOffer~ArrayData : Array
+[FundingOffer](#FundingOffer) data in WSv2 array format. Suitable for passing to
+[FundingOffer](#FundingOffer) to construct a model instance.
+
+**Kind**: inner typedef of [FundingOffer](#FundingOffer)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | number | id |
+| 1 | string | symbol |
+| 2 | number | mtsCreate |
+| 3 | number | mtsUpdate |
+| 4 | number | amount |
+| 5 | number | amountOrig |
+| 6 | string | type |
+| 9 | number | flags |
+| 10 | string | status |
+| 14 | number | rate |
+| 15 | number | period |
+| 16 | number | notify |
+| 17 | number | hidden |
+| 19 | number | renew |
+| 20 | number | rateReal |
+
+
+
+### FundingOffer~Data : [FundingOffer](#FundingOffer) \| [ObjectData](#FundingOffer..ObjectData) \| [ArrayData](#FundingOffer..ArrayData)
+[FundingOffer](#FundingOffer) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [FundingOffer](#FundingOffer)
+
+
+### FundingOffer~ObjectData : object
+[FundingOffer](#FundingOffer) data in plain object format. Suitable for passing to
+[FundingOffer](#FundingOffer) to construct a model instance.
+
+**Kind**: inner typedef of [FundingOffer](#FundingOffer)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| id | number | id |
+| symbol | string | symbol |
+| mtsCreate | number | creation timestamp |
+| mtsUpdate | number | last update timestamp |
+| amount | string | remaining amount |
+| amountOrig | string | original amount |
+| type | string | funding offer type |
+| flags | number | flags |
+| status | string | current status |
+| rate | number | rate |
+| rateReal | number | rate real |
+| period | number | period for the offer |
+| notify | number \| boolean | notify flag |
+| hidden | number \| boolean | hidden flag |
+| renew | number \| boolean | renew flag |
+
+
+
+### FundingOffer~SubmitPayload : object
+A set of parameters describing an atomic [FundingOffer](#FundingOffer) that can be
+sent via the WSv2 API.
+
+**Kind**: inner typedef of [FundingOffer](#FundingOffer)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| type | string | type |
+| symbol | string | symbol |
+| amount | string | amount |
+| rate | string | rate |
+| period | number | period |
+| flags | number | flags |
+
+
+
+## FundingTickerHist ⇐ [Model](#Model)
+Historical Funding Ticker model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [FundingTickerHist](#FundingTickerHist) ⇐ [Model](#Model)
+ * [new FundingTickerHist(data)](#new_FundingTickerHist_new)
+ * _instance_
+ * [.quote()](#FundingTickerHist+quote) ⇒ string
+ * [.base()](#FundingTickerHist+base) ⇒ string
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#FundingTickerHist.unserialize) ⇒ [ObjectData](#FundingTickerHist..ObjectData)
+ * [.validate(data)](#FundingTickerHist.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#FundingTickerHist..ArrayData) : Array
+ * [~Data](#FundingTickerHist..Data) : [FundingTickerHist](#FundingTickerHist) \| [ObjectData](#FundingTickerHist..ObjectData) \| [ArrayData](#FundingTickerHist..ArrayData)
+ * [~ObjectData](#FundingTickerHist..ObjectData) : object
+
+
+
+### new FundingTickerHist(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingTickerHist..Data) \| [Array.<Data>](#FundingTickerHist..Data) | data |
+
+
+
+### fundingTickerHist.quote() ⇒ string
+Get the quote currency for the historical ticker.
+
+**Kind**: instance method of [FundingTickerHist](#FundingTickerHist)
+**Returns**: string - quoteCurrency
+
+
+### fundingTickerHist.base() ⇒ string
+Get the base currency for the historical ticker.
+
+**Kind**: instance method of [FundingTickerHist](#FundingTickerHist)
+**Returns**: string - baseCurrency
+
+
+### fundingTickerHist.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [FundingTickerHist](#FundingTickerHist)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### fundingTickerHist.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [FundingTickerHist](#FundingTickerHist)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### FundingTickerHist.unserialize(data) ⇒ [ObjectData](#FundingTickerHist..ObjectData)
+**Kind**: static method of [FundingTickerHist](#FundingTickerHist)
+**Returns**: [ObjectData](#FundingTickerHist..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingTickerHist..Data) \| [Array.<Data>](#FundingTickerHist..Data) | data to convert to POJO |
+
+
+
+### FundingTickerHist.validate(data) ⇒ string
+Validates a given historical funding ticker instance.
+
+**Kind**: static method of [FundingTickerHist](#FundingTickerHist)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingTickerHist..Data) \| [Array.<Data>](#FundingTickerHist..Data) | models to validate |
+
+
+
+### FundingTickerHist~ArrayData : Array
+[FundingTickerHist](#FundingTickerHist) data in WSv2 array format. Suitable for passing to
+[FundingTickerHist](#FundingTickerHist) to construct a model instance.
+
+**Kind**: inner typedef of [FundingTickerHist](#FundingTickerHist)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | string | symbol |
+| 2 | number | bid |
+| 4 | number | bidPeriod |
+| 5 | number | ask |
+| 15 | number | mtsUpdate |
+
+
+
+### FundingTickerHist~Data : [FundingTickerHist](#FundingTickerHist) \| [ObjectData](#FundingTickerHist..ObjectData) \| [ArrayData](#FundingTickerHist..ArrayData)
+[FundingTickerHist](#FundingTickerHist) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [FundingTickerHist](#FundingTickerHist)
+
+
+### FundingTickerHist~ObjectData : object
+[FundingTickerHist](#FundingTickerHist) data in plain object format. Suitable for passing
+to [FundingTickerHist](#FundingTickerHist) to construct a model instance.
+
+**Kind**: inner typedef of [FundingTickerHist](#FundingTickerHist)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| symbol | string | symbol |
+| bid | number | bid |
+| bidPeriod | number | bid period |
+| ask | number | ask |
+| mtsUpdate | number | timestamp |
+
+
+
+## FundingTicker ⇐ [Model](#Model)
+Funding Ticker model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [FundingTicker](#FundingTicker) ⇐ [Model](#Model)
+ * [new FundingTicker(data)](#new_FundingTicker_new)
+ * _instance_
+ * [.quote()](#FundingTicker+quote) ⇒ string
+ * [.base()](#FundingTicker+base) ⇒ string
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#FundingTicker.unserialize) ⇒ [ObjectData](#FundingTicker..ObjectData)
+ * [.validate(data)](#FundingTicker.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#FundingTicker..ArrayData) : Array
+ * [~Data](#FundingTicker..Data) : [FundingTicker](#FundingTicker) \| [ObjectData](#FundingTicker..ObjectData) \| [ArrayData](#FundingTicker..ArrayData)
+ * [~ObjectData](#FundingTicker..ObjectData) : object
+
+
+
+### new FundingTicker(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingTicker..Data) \| [Array.<Data>](#FundingTicker..Data) | data |
+
+
+
+### fundingTicker.quote() ⇒ string
+Get the quote currency for the ticker.
+
+**Kind**: instance method of [FundingTicker](#FundingTicker)
+**Returns**: string - quoteCurrency
+
+
+### fundingTicker.base() ⇒ string
+Get the base currency for the ticker.
+
+**Kind**: instance method of [FundingTicker](#FundingTicker)
+**Returns**: string - baseCurrency
+
+
+### fundingTicker.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [FundingTicker](#FundingTicker)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### fundingTicker.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [FundingTicker](#FundingTicker)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### FundingTicker.unserialize(data) ⇒ [ObjectData](#FundingTicker..ObjectData)
+**Kind**: static method of [FundingTicker](#FundingTicker)
+**Returns**: [ObjectData](#FundingTicker..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingTicker..Data) \| [Array.<Data>](#FundingTicker..Data) | data to convert to POJO |
+
+
+
+### FundingTicker.validate(data) ⇒ string
+Validates a given funding ticker instance
+
+**Kind**: static method of [FundingTicker](#FundingTicker)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingTicker..Data) \| [Array.<Data>](#FundingTicker..Data) | instance(s) to validate |
+
+
+
+### FundingTicker~ArrayData : Array
+[FundingTicker](#FundingTicker) data in WSv2 array format. Suitable for passing to
+[FundingTicker](#FundingTicker) instance.
+
+**Kind**: inner typedef of [FundingTicker](#FundingTicker)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | string | symbol |
+| 1 | number | frr |
+| 2 | number | bid |
+| 3 | number | bidSize |
+| 4 | number | bidPeriod |
+| 5 | number | ask |
+| 6 | number | askSize |
+| 7 | number | askPeriod |
+| 8 | number | dailyChange |
+| 9 | number | dailyChangePerc |
+| 10 | number | lastPrice |
+| 11 | number | volume |
+| 12 | number | high |
+| 13 | number | low |
+
+
+
+### FundingTicker~Data : [FundingTicker](#FundingTicker) \| [ObjectData](#FundingTicker..ObjectData) \| [ArrayData](#FundingTicker..ArrayData)
+[FundingTicker](#FundingTicker) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [FundingTicker](#FundingTicker)
+
+
+### FundingTicker~ObjectData : object
+[FundingTicker](#FundingTicker) data in plain object format. Suitable for passing to
+[FundingTicker](#FundingTicker) to construct a model instance.
+
+**Kind**: inner typedef of [FundingTicker](#FundingTicker)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| symbol | string | symbol |
+| frr | number \| boolean | current FRR |
+| bid | number | best bid |
+| bidSize | number | total bid amount |
+| bidPeriod | number | bid period |
+| ask | number | best ask |
+| askSize | number | total ask amount |
+| askPeriod | number | ask period |
+| dailyChange | number | net 24h period change |
+| dailyChangePerc | number | net 24h period change as percent |
+| lastPrice | number | last price |
+| volume | number | total volume in last 24h period |
+| high | number | highest rate in last 24h period |
+| low | number | lowest rate in last 24h period |
+
+
+
+## FundingTrade ⇐ [Model](#Model)
+Funding Trade model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [FundingTrade](#FundingTrade) ⇐ [Model](#Model)
+ * [new FundingTrade(data)](#new_FundingTrade_new)
+ * _instance_
+ * [.toString()](#FundingTrade+toString) ⇒ string
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#FundingTrade.unserialize) ⇒ [ObjectData](#FundingTrade..ObjectData)
+ * [.validate(data)](#FundingTrade.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#FundingTrade..ArrayData) : Array
+ * [~Data](#FundingTrade..Data) : [FundingTrade](#FundingTrade) \| [ObjectData](#FundingTrade..ObjectData) \| [ArrayData](#FundingTrade..ArrayData)
+ * [~ObjectData](#FundingTrade..ObjectData) : object
+
+
+
+### new FundingTrade(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingTrade..Data) \| [Array.<Data>](#FundingTrade..Data) | data |
+
+
+
+### fundingTrade.toString() ⇒ string
+Returns a string representation of the model, containing pertinent
+information.
+
+**Kind**: instance method of [FundingTrade](#FundingTrade)
+**Returns**: string - str
+
+
+### fundingTrade.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [FundingTrade](#FundingTrade)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### fundingTrade.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [FundingTrade](#FundingTrade)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### FundingTrade.unserialize(data) ⇒ [ObjectData](#FundingTrade..ObjectData)
+**Kind**: static method of [FundingTrade](#FundingTrade)
+**Returns**: [ObjectData](#FundingTrade..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingTrade..Data) \| [Array.<Data>](#FundingTrade..Data) | data to convert to POJO |
+
+
+
+### FundingTrade.validate(data) ⇒ string
+Validates a given funding trade instance
+
+**Kind**: static method of [FundingTrade](#FundingTrade)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#FundingTrade..Data) \| [Array.<Data>](#FundingTrade..Data) | instance(s) to validate |
+
+
+
+### FundingTrade~ArrayData : Array
+[FundingTrade](#FundingTrade) data in WSv2 array format. Suitable for passing to
+[FundingTrade](#FundingTrade) to construct a model instance.
+
+**Kind**: inner typedef of [FundingTrade](#FundingTrade)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | number | id |
+| 1 | string | symbol |
+| 2 | number | mtsCreate |
+| 3 | number | offerID |
+| 4 | number | amount |
+| 5 | number | rate |
+| 6 | number | period |
+| 7 | number | maker |
+
+
+
+### FundingTrade~Data : [FundingTrade](#FundingTrade) \| [ObjectData](#FundingTrade..ObjectData) \| [ArrayData](#FundingTrade..ArrayData)
+[FundingTrade](#FundingTrade) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [FundingTrade](#FundingTrade)
+
+
+### FundingTrade~ObjectData : object
+[FundingTrade](#FundingTrade) data in plain object format. Suitable for passing to
+[FundingTrade](#FundingTrade) to construct a model instance.
+
+**Kind**: inner typedef of [FundingTrade](#FundingTrade)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| id | number | id |
+| symbol | string | symbol |
+| mtsCreate | number | creation timestamp |
+| offerID | number | taken offer ID |
+| amount | number | amount |
+| rate | number | rate |
+| period | number | period |
+| maker | number \| boolean | maker flag |
+
+
+
+## Invoice
+Deposit Invoice model
+
+**Kind**: global class
+
+* [Invoice](#Invoice)
+ * [new Invoice(data)](#new_Invoice_new)
+ * _instance_
+ * [.toString()](#Invoice+toString) ⇒ string
+ * _static_
+ * [.unserialize(data)](#Invoice.unserialize) ⇒ object
+ * [.validate(data)](#Invoice.validate) ⇒ string
+
+
+
+### new Invoice(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | object \| Array | deposit invoice |
+| data.invoiceHash | string | Hashed invoice |
+| data.invoice | string | Requested invoice |
+| data.amount | string | Amount of invoice |
+
+
+
+### invoice.toString() ⇒ string
+**Kind**: instance method of [Invoice](#Invoice)
+**Returns**: string - str
+
+
+### Invoice.unserialize(data) ⇒ object
+**Kind**: static method of [Invoice](#Invoice)
+**Returns**: object - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | Array.<object> \| object \| Array.<Array> \| Array | data to convert to POJO |
+
+
+
+### Invoice.validate(data) ⇒ string
+Validates a given invoice instance
+
+**Kind**: static method of [Invoice](#Invoice)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | Array.<object> \| object \| [Array.<Invoice>](#Invoice) \| [Invoice](#Invoice) \| Array | instance to validate |
+
+
+
+## LedgerEntry ⇐ [Model](#Model)
+Ledger Entry model; wallet field is automatically populated if a description
+is provided.
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [LedgerEntry](#LedgerEntry) ⇐ [Model](#Model)
+ * [new LedgerEntry(data)](#new_LedgerEntry_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#LedgerEntry.unserialize) ⇒ [ObjectData](#LedgerEntry..ObjectData)
+ * [.validate(data)](#LedgerEntry.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#LedgerEntry..ArrayData) : Array
+ * [~Data](#LedgerEntry..Data) : [LedgerEntry](#LedgerEntry) \| [ObjectData](#LedgerEntry..ObjectData) \| [ArrayData](#LedgerEntry..ArrayData)
+ * [~ObjectData](#LedgerEntry..ObjectData) : object
+
+
+
+### new LedgerEntry(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#LedgerEntry..Data) \| [Array.<Data>](#LedgerEntry..Data) | data |
+
+
+
+### ledgerEntry.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [LedgerEntry](#LedgerEntry)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### ledgerEntry.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [LedgerEntry](#LedgerEntry)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### LedgerEntry.unserialize(data) ⇒ [ObjectData](#LedgerEntry..ObjectData)
+**Kind**: static method of [LedgerEntry](#LedgerEntry)
+**Returns**: [ObjectData](#LedgerEntry..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#LedgerEntry..Data) \| [Array.<Data>](#LedgerEntry..Data) | data to convert to POJO |
+
+
+
+### LedgerEntry.validate(data) ⇒ string
+Validates a given ledger entry instance
+
+**Kind**: static method of [LedgerEntry](#LedgerEntry)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#LedgerEntry..Data) \| [Array.<Data>](#LedgerEntry..Data) | instance(s) to validate |
+
+
+
+### LedgerEntry~ArrayData : Array
+[LedgerEntry](#LedgerEntry) data in WSv2 array format. Suitable for passing to
+[LedgerEntry](#LedgerEntry) to construct a model instance.
+
+**Kind**: inner typedef of [LedgerEntry](#LedgerEntry)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | number | id |
+| 1 | string | currency |
+| 3 | number | mts |
+| 5 | number | amount |
+| 6 | number | balance |
+| 8 | string | description |
+
+
+
+### LedgerEntry~Data : [LedgerEntry](#LedgerEntry) \| [ObjectData](#LedgerEntry..ObjectData) \| [ArrayData](#LedgerEntry..ArrayData)
+[LedgerEntry](#LedgerEntry) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [LedgerEntry](#LedgerEntry)
+
+
+### LedgerEntry~ObjectData : object
+[LedgerEntry](#LedgerEntry) data in plain object format. Suitable for passing to
+[LedgerEntry](#LedgerEntry) to construct a model instance.
+
+**Kind**: inner typedef of [LedgerEntry](#LedgerEntry)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| id | number | id |
+| currency | string | currency |
+| mts | number | transaction timestamp |
+| amount | number | transaction amount |
+| balance | number | balance at time of transaction |
+| description | string | transaction description |
+
+
+
+## Liquidations ⇐ [Model](#Model)
+Liquidation Info model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [Liquidations](#Liquidations) ⇐ [Model](#Model)
+ * [new Liquidations(data)](#new_Liquidations_new)
+ * _instance_
+ * [.toString()](#Liquidations+toString) ⇒ string
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#Liquidations.unserialize) ⇒ [ObjectData](#Liquidations..ObjectData)
+ * [.validate(data)](#Liquidations.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#Liquidations..ArrayData) : Array
+ * [~Data](#Liquidations..Data) : [Liquidations](#Liquidations) \| [ObjectData](#Liquidations..ObjectData) \| [ArrayData](#Liquidations..ArrayData)
+ * [~ObjectData](#Liquidations..ObjectData) : object
+
+
+
+### new Liquidations(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Liquidations..Data) \| [Array.<Data>](#Liquidations..Data) | data |
+
+
+
+### liquidations.toString() ⇒ string
+**Kind**: instance method of [Liquidations](#Liquidations)
+**Returns**: string - str
+
+
+### liquidations.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [Liquidations](#Liquidations)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### liquidations.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [Liquidations](#Liquidations)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### Liquidations.unserialize(data) ⇒ [ObjectData](#Liquidations..ObjectData)
+**Kind**: static method of [Liquidations](#Liquidations)
+**Returns**: [ObjectData](#Liquidations..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Liquidations..Data) \| [Array.<Data>](#Liquidations..Data) | data to convert to POJO |
+
+
+
+### Liquidations.validate(data) ⇒ string
+Validates a given liquidation instance
+
+**Kind**: static method of [Liquidations](#Liquidations)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Liquidations..Data) \| [Array.<Data>](#Liquidations..Data) | instance(s) to validate |
+
+
+
+### Liquidations~ArrayData : Array
+[Liquidations](#Liquidations) data in WSv2 array format. Suitable for passing to
+[Liquidations](#Liquidations) to construct a model instance.
+
+**Kind**: inner typedef of [Liquidations](#Liquidations)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 1 | number | posId |
+| 2 | number | mtsUpdated |
+| 4 | string | symbol |
+| 5 | number | amount |
+| 6 | number | basePrice |
+| 8 | number | isMatch |
+| 9 | number | isMarketSold |
+
+
+
+### Liquidations~Data : [Liquidations](#Liquidations) \| [ObjectData](#Liquidations..ObjectData) \| [ArrayData](#Liquidations..ArrayData)
+[Liquidations](#Liquidations) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [Liquidations](#Liquidations)
+
+
+### Liquidations~ObjectData : object
+[Liquidations](#Liquidations) data in plain object format. Suitable for passing to
+[Liquidations](#Liquidations) to construct a model instance.
+
+**Kind**: inner typedef of [Liquidations](#Liquidations)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| posId | number | position ID |
+| mtsUpdated | number | timestamp |
+| symbol | string | symbol |
+| amount | number | amount |
+| basePrice | number | base price |
+| isMatch | number \| boolean | matched flag |
+| isMarketSold | number \| boolean | sold flag |
+
+
+
+## Login ⇐ [Model](#Model)
+Login event model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [Login](#Login) ⇐ [Model](#Model)
+ * [new Login(data)](#new_Login_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#Login.unserialize) ⇒ [ObjectData](#Login..ObjectData)
+ * [.validate(data)](#Login.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#Login..ArrayData) : Array
+ * [~Data](#Login..Data) : [Login](#Login) \| [ObjectData](#Login..ObjectData) \| [ArrayData](#Login..ArrayData)
+ * [~ObjectData](#Login..ObjectData) : object
+
+
+
+### new Login(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Login..Data) \| [Array.<Data>](#Login..Data) | data |
+
+
+
+### login.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [Login](#Login)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### login.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [Login](#Login)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### Login.unserialize(data) ⇒ [ObjectData](#Login..ObjectData)
+**Kind**: static method of [Login](#Login)
+**Returns**: [ObjectData](#Login..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Login..Data) \| [Array.<Data>](#Login..Data) | data to convert to POJO |
+
+
+
+### Login.validate(data) ⇒ string
+Validates a given login instance
+
+**Kind**: static method of [Login](#Login)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Login..Data) \| [Array.<Data>](#Login..Data) | instance(s) to validate |
+
+
+
+### Login~ArrayData : Array
+[Login](#Login) data in WSv2 array format. Suitable for passing to
+[Login](#Login) to construct a model instance.
+
+**Kind**: inner typedef of [Login](#Login)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | number | id |
+| 2 | number | time |
+| 4 | string | ip |
+| 7 | object | extraData |
+
+
+
+### Login~Data : [Login](#Login) \| [ObjectData](#Login..ObjectData) \| [ArrayData](#Login..ArrayData)
+[Login](#Login) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [Login](#Login)
+
+
+### Login~ObjectData : object
+[Login](#Login) data in plain object format. Suitable for passing to
+[Login](#Login) to construct a model instance.
+
+**Kind**: inner typedef of [Login](#Login)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| id | number | id |
+| time | number | timestamp |
+| ip | string | client IP address |
+| extraData | object | metadata |
+
+
+
+## MarginInfo ⇐ [Model](#Model)
+Margin Info model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+**Todo**
+
+- [ ] Extract type defs (varying format)
+
+
+* [MarginInfo](#MarginInfo) ⇐ [Model](#Model)
+ * [new MarginInfo(data)](#new_MarginInfo_new)
+ * _instance_
+ * [.serialize()](#MarginInfo+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#MarginInfo.unserialize) ⇒ object
+ * [.validate(data)](#MarginInfo.validate) ⇒ string
+
+
+
+### new MarginInfo(data)
+Create a new instance from a data payload
+
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | Array.<object> \| object \| Array.<Array> \| Array | margin info data |
+
+
+
+### marginInfo.serialize() ⇒ Array
+Return an array representation of this model
+
+**Kind**: instance method of [MarginInfo](#MarginInfo)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### marginInfo.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [MarginInfo](#MarginInfo)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### MarginInfo.unserialize(data) ⇒ object
+TODO: Figure out a better object key for 'payload', as we need to support
+ both arrays and POJOs
+
+**Kind**: static method of [MarginInfo](#MarginInfo)
+**Returns**: object - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | Array.<object> \| object \| Array.<Array> \| Array | data to convert to POJO |
+
+
+
+### MarginInfo.validate(data) ⇒ string
+Validates a given margin info instance
+
+**Kind**: static method of [MarginInfo](#MarginInfo)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | Array.<object> \| object \| [Array.<MarginInfo>](#MarginInfo) \| [MarginInfo](#MarginInfo) \| Array | instance(s) to validate |
+
+
+
+## Model ⇐ events.EventEmitter
+Base model class, providing format-conversion methods
+
+**Kind**: global class
+**Extends**: events.EventEmitter
+
+* [Model](#Model) ⇐ events.EventEmitter
+ * [new Model(params)](#new_Model_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(args)](#Model.unserialize) ⇒ object
+ * [.validate(args)](#Model.validate) ⇒ Error \| null
+
+
+
+### new Model(params)
+
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| params | object | | model parameters |
+| [params.data] | Array.<object> \| object \| Array | | model data |
+| [params.fields] | object | {} | field definitions, { [index]: key } |
+| [params.boolFields] | Array.<string> | [] | array of boolean field keys |
+
+
+
+### model.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [Model](#Model)
+**Returns**: Array - arr
+
+
+### model.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [Model](#Model)
+**Returns**: object - pojo
+
+
+### Model.unserialize(args) ⇒ object
+Generic method for converting either an array, object, or model instance to
+a POJO.
+
+**Kind**: static method of [Model](#Model)
+**Returns**: object - pojo
+
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| args | object | | arguments |
+| args.data | Array.<object> \| object \| Array | | can also be a model instance |
+| args.fields | object | | field definitions, { [index]: key } |
+| [args.boolFields] | Array.<string> | [] | array of boolean field keys |
+
+
+
+### Model.validate(args) ⇒ Error \| null
+Validates either a single model instance or a collection of model instances
+against a set of validation functions defined per-key.
+
+Returns the first error found.
+
+**Kind**: static method of [Model](#Model)
+**Returns**: Error \| null - error - null if instance is valid
+
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| args | object | | arguments |
+| args.data | Array.<object> \| object \| Array | | model or collection to validate |
+| args.fields | object | | map of fields to array indexes |
+| args.validators | object | | map of field names to validation funcs |
+| [args.boolFields] | Array.<string> | [] | array of boolean field keys |
+
+
+
+## Movement ⇐ [Model](#Model)
+Currency Movement model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [Movement](#Movement) ⇐ [Model](#Model)
+ * [new Movement(data)](#new_Movement_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#Movement.unserialize) ⇒ object
+ * [.validate(data)](#Movement.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#Movement..ArrayData) : Array
+ * [~Data](#Movement..Data) : [Movement](#Movement) \| [ObjectData](#Movement..ObjectData) \| [ArrayData](#Movement..ArrayData)
+ * [~ObjectData](#Movement..ObjectData) : object
+
+
+
+### new Movement(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Movement..Data) \| [Array.<Data>](#Movement..Data) | data |
+
+
+
+### movement.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [Movement](#Movement)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### movement.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [Movement](#Movement)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### Movement.unserialize(data) ⇒ object
+**Kind**: static method of [Movement](#Movement)
+**Returns**: object - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Movement..Data) \| [Array.<Data>](#Movement..Data) | data to convert to POJO |
+
+
+
+### Movement.validate(data) ⇒ string
+Validates a given movement instance
+
+**Kind**: static method of [Movement](#Movement)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Movement..Data) \| [Array.<Data>](#Movement..Data) | instance(s) to validate |
+
+
+
+### Movement~ArrayData : Array
+[Movement](#Movement) data in WSv2 array format. Suitable for passing to
+[Movement](#Movement) to construct a model instance.
+
+**Kind**: inner typedef of [Movement](#Movement)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | number | id |
+| 1 | string | currency |
+| 2 | string | currencyName |
+| 5 | number | mtsStarted |
+| 6 | number | mtsUpdated |
+| 9 | string | status |
+| 12 | number | amount |
+| 13 | number | fees |
+| 16 | string | destinationAddress |
+| 20 | number | transactionId |
+
+
+
+### Movement~Data : [Movement](#Movement) \| [ObjectData](#Movement..ObjectData) \| [ArrayData](#Movement..ArrayData)
+[Movement](#Movement) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [Movement](#Movement)
+
+
+### Movement~ObjectData : object
+[Movement](#Movement) data in plain object format. Suitable for passing to
+[Movement](#Movement) to construct a model instance.
+
+**Kind**: inner typedef of [Movement](#Movement)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| id | number | id |
+| currency | string | currency |
+| currencyName | string | currency name |
+| mtsStarted | number | movement start timestamp |
+| mtsUpdated | number | last update timestamp |
+| status | string | status |
+| amount | number | moved amount |
+| fees | number | paid fees |
+| destinationAddress | string | destination address |
+| transactionId | number | transaction ID |
+
+
+
+## Notification ⇐ [Model](#Model)
+Notification model. Broadcast notification body schema may be found at
+[BroadcastPayload](#Notification..BroadcastPayload).
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [Notification](#Notification) ⇐ [Model](#Model)
+ * [new Notification(data)](#new_Notification_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#Notification.unserialize) ⇒ [ObjectData](#Notification..ObjectData)
+ * [.validate(data)](#Notification.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#Notification..ArrayData) : Array
+ * [~BroadcastPayload](#Notification..BroadcastPayload) : object
+ * [~Data](#Notification..Data) : [Notification](#Notification) \| [ObjectData](#Notification..ObjectData) \| [ArrayData](#Notification..ArrayData)
+ * [~ObjectData](#Notification..ObjectData) : object
+
+
+
+### new Notification(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Notification..Data) \| [Array.<Data>](#Notification..Data) | data |
+
+
+
+### notification.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [Notification](#Notification)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### notification.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [Notification](#Notification)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### Notification.unserialize(data) ⇒ [ObjectData](#Notification..ObjectData)
+**Kind**: static method of [Notification](#Notification)
+**Returns**: [ObjectData](#Notification..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Notification..Data) \| [Array.<Data>](#Notification..Data) | data to convert to POJO |
+
+
+
+### Notification.validate(data) ⇒ string
+Validates a given notification instance
+
+**Kind**: static method of [Notification](#Notification)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Notification..Data) \| [Array.<Data>](#Notification..Data) | instance(s) to validate |
+
+
+
+### Notification~ArrayData : Array
+[Notification](#Notification) data in WSv2 array format. Suitable for passing to
+[Notification](#Notification) to construct a model instance.
+
+**Kind**: inner typedef of [Notification](#Notification)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | number | mts |
+| 1 | string | type |
+| 2 | number | messageID |
+| 4 | object | notifyInfo |
+| 5 | number | code |
+| 6 | string | status |
+| 7 | string | text |
+
+
+
+### Notification~BroadcastPayload : object
+Body of a broadcast (`ucm-*`) [Notification](#Notification)} which may be sent via
+the WSv2 API.
+
+**Kind**: inner typedef of [Notification](#Notification)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| [message] | string | message to display |
+| [type] | string | notification type, must be prefixed with 'ucm-*' for broadcasts |
+| [level] | string | 'info', 'error', or 'success' |
+| [image] | string | link to an image to be shown |
+| [link] | string | URL the notification should forward too |
+| [sound] | string | URL of sound to play |
+
+
+
+### Notification~Data : [Notification](#Notification) \| [ObjectData](#Notification..ObjectData) \| [ArrayData](#Notification..ArrayData)
+[Notification](#Notification) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [Notification](#Notification)
+
+
+### Notification~ObjectData : object
+[Notification](#Notification) data in plain object format. Suitable for passing to
+[Notification](#Notification) to construct a model instance.
+
+**Kind**: inner typedef of [Notification](#Notification)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| mts | number | timestamp |
+| type | string | type (i.e. 'ucm-*' for broadcasts) |
+| messageID | number | message ID |
+| notifyInfo | object | metadata, set by client for broadcasts |
+| code | number | code |
+| status | string | status (i.e. 'error') |
+| text | string | notification text to display to user |
+
+
+
+## OrderBook ⇐ events.EventEmitter
+High level OB model to automatically integrate WS updates & maintain sort
+
+**Kind**: global class
+**Extends**: events.EventEmitter
+
+* [OrderBook](#OrderBook) ⇐ events.EventEmitter
+ * [new OrderBook(snap, [raw])](#new_OrderBook_new)
+ * _instance_
+ * [.volBPSMid(bps)](#OrderBook+volBPSMid) ⇒ number
+ * [.checksum()](#OrderBook+checksum) ⇒ number
+ * [.updateFromSnapshot(snapshot)](#OrderBook+updateFromSnapshot)
+ * [.updateWith(entry)](#OrderBook+updateWith) ⇒ boolean
+ * [.topBid()](#OrderBook+topBid) ⇒ number
+ * [.topBidLevel()](#OrderBook+topBidLevel) ⇒ number
+ * [.topAsk()](#OrderBook+topAsk) ⇒ number
+ * [.topAskLevel()](#OrderBook+topAskLevel) ⇒ number
+ * [.midPrice()](#OrderBook+midPrice) ⇒ number
+ * [.spread()](#OrderBook+spread) ⇒ number
+ * [.bidAmount()](#OrderBook+bidAmount) ⇒ number
+ * [.askAmount()](#OrderBook+askAmount) ⇒ number
+ * [.getEntry(price)](#OrderBook+getEntry) ⇒ object
+ * [.toJS()](#OrderBook+toJS) ⇒ object
+ * _static_
+ * [.checksumArr(arr, [raw])](#OrderBook.checksumArr) ⇒ number
+ * [.updateArrayOBWith(ob, entry, [raw])](#OrderBook.updateArrayOBWith) ⇒ boolean
+ * [.arrayOBMidPrice(ob, [raw])](#OrderBook.arrayOBMidPrice) ⇒ number
+ * [.unserialize(arr, [raw])](#OrderBook.unserialize) ⇒ object
+ * _inner_
+ * [~AggregatedFundingPriceLevel](#OrderBook..AggregatedFundingPriceLevel) : object
+ * [~AggregatedPriceLevel](#OrderBook..AggregatedPriceLevel) : object
+ * [~ArrayData](#OrderBook..ArrayData) : [Array.<ArrayPriceLevel>](#OrderBook..ArrayPriceLevel)
+ * [~ArrayPriceLevel](#OrderBook..ArrayPriceLevel) : Array.<number>
+ * [~Data](#OrderBook..Data) : [OrderBook](#OrderBook) \| [ObjectData](#OrderBook..ObjectData) \| [ArrayData](#OrderBook..ArrayData)
+ * [~ObjectData](#OrderBook..ObjectData) : [Array.<ObjectPriceLevel>](#OrderBook..ObjectPriceLevel)
+ * [~ObjectPriceLevel](#OrderBook..ObjectPriceLevel) : [AggregatedFundingPriceLevel](#OrderBook..AggregatedFundingPriceLevel) \| [AggregatedPriceLevel](#OrderBook..AggregatedPriceLevel) \| [RawFundingPriceLevel](#OrderBook..RawFundingPriceLevel) \| [RawPriceLevel](#OrderBook..RawPriceLevel)
+ * [~RawFundingPriceLevel](#OrderBook..RawFundingPriceLevel) : object
+ * [~RawPriceLevel](#OrderBook..RawPriceLevel) : object
+
+
+
+### new OrderBook(snap, [raw])
+Initializes the order book with an existing snapshot (array form)
+
+
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| snap | [Data](#OrderBook..Data) | | snapshot |
+| [raw] | boolean | false | true for raw 'R0' order books |
+
+
+
+### orderBook.volBPSMid(bps) ⇒ number
+Returns the total volume at n basis points from the mid price
+
+**Kind**: instance method of [OrderBook](#OrderBook)
+**Returns**: number - vol - total volume
+
+| Param | Type | Description |
+| --- | --- | --- |
+| bps | number | basis points from mid price |
+
+
+
+### orderBook.checksum() ⇒ number
+Generates a crc-32 checksum of our current state. The checksum'ed string
+itself is a concatenated list of the top 25 bids & asks, alternating.
+
+**Kind**: instance method of [OrderBook](#OrderBook)
+**Returns**: number - cs
+**See**: http://blog.bitfinex.com/api/bitfinex-api-order-books-checksums
+
+
+### orderBook.updateFromSnapshot(snapshot)
+Sets bids/asks to those in the provided snapshot
+
+**Kind**: instance method of [OrderBook](#OrderBook)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| snapshot | [ArrayData](#OrderBook..ArrayData) | snapshot |
+
+
+
+### orderBook.updateWith(entry) ⇒ boolean
+Integrate an update packet (add, update, or remove a price level). Emits an
+'update' event on success
+
+**Kind**: instance method of [OrderBook](#OrderBook)
+**Returns**: boolean - success - false if entry doesn't match OB
+
+| Param | Type | Description |
+| --- | --- | --- |
+| entry | Array | price level to update with |
+
+
+
+### orderBook.topBid() ⇒ number
+**Kind**: instance method of [OrderBook](#OrderBook)
+**Returns**: number - topBid - may be null
+
+
+### orderBook.topBidLevel() ⇒ number
+**Kind**: instance method of [OrderBook](#OrderBook)
+**Returns**: number - topBidLevel - may be null
+
+
+### orderBook.topAsk() ⇒ number
+**Kind**: instance method of [OrderBook](#OrderBook)
+**Returns**: number - topAsk - may be null
+
+
+### orderBook.topAskLevel() ⇒ number
+**Kind**: instance method of [OrderBook](#OrderBook)
+**Returns**: number - topAskLevel - may be null
+
+
+### orderBook.midPrice() ⇒ number
+**Kind**: instance method of [OrderBook](#OrderBook)
+**Returns**: number - price
+
+
+### orderBook.spread() ⇒ number
+**Kind**: instance method of [OrderBook](#OrderBook)
+**Returns**: number - spread - top bid/ask difference
+
+
+### orderBook.bidAmount() ⇒ number
+**Kind**: instance method of [OrderBook](#OrderBook)
+**Returns**: number - amount - total buy-side volume
+
+
+### orderBook.askAmount() ⇒ number
+**Kind**: instance method of [OrderBook](#OrderBook)
+**Returns**: number - amount - total sell-side volume
+
+
+### orderBook.getEntry(price) ⇒ object
+**Kind**: instance method of [OrderBook](#OrderBook)
+**Returns**: object - entry - unserialized, null if not found
+
+| Param | Type | Description |
+| --- | --- | --- |
+| price | number | price level to fetch |
+
+
+
+### orderBook.toJS() ⇒ object
+**Kind**: instance method of [OrderBook](#OrderBook)
+**Returns**: object - pojo
+
+
+### OrderBook.checksumArr(arr, [raw]) ⇒ number
+Like checksum(), but for raw array-format order books
+
+**Kind**: static method of [OrderBook](#OrderBook)
+**Returns**: number - cs
+
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| arr | [ArrayData](#OrderBook..ArrayData) | | assumed sorted, `[topBid, bid, ..., topAsk, ask, ...]` |
+| [raw] | boolean | false | true for raw 'R0' order books |
+
+
+
+### OrderBook.updateArrayOBWith(ob, entry, [raw]) ⇒ boolean
+Modifies an array-format OB in place with an update entry. Maintains sort
+
+**Kind**: static method of [OrderBook](#OrderBook)
+**Returns**: boolean - success - false if entry doesn't match OB
+
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| ob | [ArrayData](#OrderBook..ArrayData) | | array-format order book |
+| entry | [ArrayPriceLevel](#OrderBook..ArrayPriceLevel) | | price level to update with |
+| [raw] | boolean | false | true for raw 'R0' order books |
+
+
+
+### OrderBook.arrayOBMidPrice(ob, [raw]) ⇒ number
+Finds the mid price of the provided array-format OB
+
+**Kind**: static method of [OrderBook](#OrderBook)
+**Returns**: number - midPrice - null if book is empty
+
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| ob | [ArrayData](#OrderBook..ArrayData) | | orderbook |
+| [raw] | boolean | false | true for `raw` books |
+
+
+
+### OrderBook.unserialize(arr, [raw]) ⇒ object
+Converts an array order book entry or snapshot to an object, with 'price',
+'count', and 'amount' keys on entries
+
+**Kind**: static method of [OrderBook](#OrderBook)
+**Returns**: object - ob - either a map w/ bids & asks, or single entry object
+
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| arr | [ArrayData](#OrderBook..ArrayData) \| [ArrayPriceLevel](#OrderBook..ArrayPriceLevel) | | array format order book |
+| [raw] | boolean | false | true for raw 'R0' order books |
+
+
+
+### OrderBook~AggregatedFundingPriceLevel : object
+An aggregate (non-raw) [OrderBook](#OrderBook) **funding** ticker price level in
+object format.
+
+**Kind**: inner typedef of [OrderBook](#OrderBook)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| rate | number | rate |
+| period | number | period |
+| amount | number | amount |
+| count | number | count |
+
+
+
+### OrderBook~AggregatedPriceLevel : object
+An aggregate (non-raw) [OrderBook](#OrderBook) price level in object format.
+
+**Kind**: inner typedef of [OrderBook](#OrderBook)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| price | number | price |
+| amount | number | amount |
+| count | number | count |
+
+
+
+### OrderBook~ArrayData : [Array.<ArrayPriceLevel>](#OrderBook..ArrayPriceLevel)
+[OrderBook](#OrderBook) data in WSv2 array format. Suitable for passing to
+[OrderBook](#OrderBook) to construct a model instance.
+
+**Kind**: inner typedef of [OrderBook](#OrderBook)
+
+
+### OrderBook~ArrayPriceLevel : Array.<number>
+A single price level for an [OrderBook](#OrderBook) model, in WSv2 array format.
+
+**Kind**: inner typedef of [OrderBook](#OrderBook)
+
+
+### OrderBook~Data : [OrderBook](#OrderBook) \| [ObjectData](#OrderBook..ObjectData) \| [ArrayData](#OrderBook..ArrayData)
+[OrderBook](#OrderBook) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [OrderBook](#OrderBook)
+
+
+### OrderBook~ObjectData : [Array.<ObjectPriceLevel>](#OrderBook..ObjectPriceLevel)
+[OrderBook](#OrderBook) data as an array of price levels in object format.
+Suitable for passing to [OrderBook](#OrderBook) to construct a model instance.
+
+**Kind**: inner typedef of [OrderBook](#OrderBook)
+
+
+### OrderBook~ObjectPriceLevel : [AggregatedFundingPriceLevel](#OrderBook..AggregatedFundingPriceLevel) \| [AggregatedPriceLevel](#OrderBook..AggregatedPriceLevel) \| [RawFundingPriceLevel](#OrderBook..RawFundingPriceLevel) \| [RawPriceLevel](#OrderBook..RawPriceLevel)
+A single price level for an [OrderBook](#OrderBook) model, in object format.
+Contents vary depending between raw & standard order books, and between
+trading & funding tickers.
+
+**Kind**: inner typedef of [OrderBook](#OrderBook)
+
+
+### OrderBook~RawFundingPriceLevel : object
+A raw [OrderBook](#OrderBook) **funding** price level in object format.
+
+**Kind**: inner typedef of [OrderBook](#OrderBook)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| rate | number | rate |
+| period | number | period |
+| amount | number | amount |
+| orderID | number | order ID |
+
+
+
+### OrderBook~RawPriceLevel : object
+A raw [OrderBook](#OrderBook) price level in object format.
+
+**Kind**: inner typedef of [OrderBook](#OrderBook)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| price | number | price |
+| amount | number | amount |
+| orderID | number | order ID |
+
+
+
+## Order ⇐ [Model](#Model)
+High level order model; provides methods for execution & can stay updated via
+a WSv2 connection or used to execute as a rest payload
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [Order](#Order) ⇐ [Model](#Model)
+ * [new Order([data], [apiInterface])](#new_Order_new)
+ * _instance_
+ * [.toString()](#Order+toString) ⇒ string
+ * [.isOCO()](#Order+isOCO) ⇒ boolean
+ * [.isHidden()](#Order+isHidden) ⇒ boolean
+ * [.isPostOnly()](#Order+isPostOnly) ⇒ boolean
+ * [.includesVariableRates()](#Order+includesVariableRates) ⇒ boolean
+ * [.isPositionClose()](#Order+isPositionClose) ⇒ boolean
+ * [.isReduceOnly()](#Order+isReduceOnly) ⇒ boolean
+ * [.setOCO(v, [stopPrice], [cidOCO])](#Order+setOCO) ⇒ number
+ * [.setHidden(v)](#Order+setHidden) ⇒ number
+ * [.setPostOnly(v)](#Order+setPostOnly) ⇒ number
+ * [.setNoVariableRates(v)](#Order+setNoVariableRates) ⇒ number
+ * [.setPositionClose(v)](#Order+setPositionClose) ⇒ number
+ * [.setReduceOnly(v)](#Order+setReduceOnly) ⇒ number
+ * [.modifyFlag(flag, active)](#Order+modifyFlag) ⇒ number
+ * [.update(changes, [apiInterface])](#Order+update) ⇒ Promise
+ * [.toPreview()](#Order+toPreview) ⇒ [Preview](#Order..Preview)
+ * [.registerListeners([apiInterface])](#Order+registerListeners)
+ * [.removeListeners([apiInterface])](#Order+removeListeners)
+ * [.cbGID()](#Order+cbGID) ⇒ string
+ * [.submit([apiInterface])](#Order+submit) ⇒ Promise
+ * [.cancel([apiInterface])](#Order+cancel) ⇒ Promise
+ * [.recreate([apiInterface])](#Order+recreate) ⇒ Promise
+ * [.updateFrom(order)](#Order+updateFrom)
+ * [.getLastFillAmount()](#Order+getLastFillAmount) ⇒ number
+ * [.resetFilledAmount()](#Order+resetFilledAmount)
+ * [.getBaseCurrency()](#Order+getBaseCurrency) ⇒ string
+ * [.getQuoteCurrency()](#Order+getQuoteCurrency) ⇒ string
+ * [.getNotionalValue()](#Order+getNotionalValue) ⇒ number
+ * [.isPartiallyFilled()](#Order+isPartiallyFilled) ⇒ boolean
+ * [.toNewOrderPacket()](#Order+toNewOrderPacket) ⇒ [SubmitPayload](#Order..SubmitPayload)
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.flags](#Order.flags) : enum
+ * [.unserialize(data)](#Order.unserialize) ⇒ [ObjectData](#Order..ObjectData)
+ * [.getBaseCurrency(arr)](#Order.getBaseCurrency) ⇒ string
+ * [.getQuoteCurrency(arr)](#Order.getQuoteCurrency) ⇒ string
+ * [.validate(data)](#Order.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#Order..ArrayData) : Array
+ * [~Data](#Order..Data) : [Order](#Order) \| [ObjectData](#Order..ObjectData) \| [ArrayData](#Order..ArrayData)
+ * [~ObjectData](#Order..ObjectData) : object
+ * [~Preview](#Order..Preview) : object
+ * [~SubmitPayload](#Order..SubmitPayload) : object
+ * [~Type](#Order..Type) : 'MARKET' \| 'EXCHANGE MARKET' \| 'LIMIT' \| 'EXCHANGE LIMIT' \| 'STOP' \| 'EXCHANGE STOP' \| 'TRAILING STOP' \| 'EXCHANGE TRAILING STOP' \| 'FOK' \| 'EXCHANGE FOK' \| 'STOP LIMIT' \| 'EXCHANGE STOP LIMIT'
+
+
+
+### new Order([data], [apiInterface])
+
+| Param | Type | Default | Description |
+| --- | --- | --- | --- |
+| [data] | [Data](#Order..Data) | {} | order data |
+| [apiInterface] | object | | saved for a later call to `registerListeners()`` |
+
+**Example**
+```js
+const debug = require('debug')('bfx:api:models:examples:order')
+const { Order } = require('../')
+const o = new Order({
+ type: Order.type.EXCHANGE_LIMIT,
+ symbol: 'tBTCUSD',
+ amount: 0.05,
+ price: 10000,
+ hidden: true
+})
+
+debug('generated ws2 compatible new order packet:')
+debug(JSON.stringify(o.toNewOrderPacket(), null, 2))
+```
+
+
+### order.toString() ⇒ string
+Returns a string representation of the order
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: string - str
+**Todo**
+
+- [ ] add verbose option to log all order information (TIF, etc)
+
+
+
+### order.isOCO() ⇒ boolean
+**Kind**: instance method of [Order](#Order)
+**Returns**: boolean - oco
+
+
+### order.isHidden() ⇒ boolean
+**Kind**: instance method of [Order](#Order)
+**Returns**: boolean - hidden
+
+
+### order.isPostOnly() ⇒ boolean
+**Kind**: instance method of [Order](#Order)
+**Returns**: boolean - postonly
+
+
+### order.includesVariableRates() ⇒ boolean
+**Kind**: instance method of [Order](#Order)
+**Returns**: boolean - includesVR
+
+
+### order.isPositionClose() ⇒ boolean
+**Kind**: instance method of [Order](#Order)
+**Returns**: boolean - posclose
+
+
+### order.isReduceOnly() ⇒ boolean
+**Kind**: instance method of [Order](#Order)
+**Returns**: boolean - reduceonly
+
+
+### order.setOCO(v, [stopPrice], [cidOCO]) ⇒ number
+Set the OCO flag and optionally update the stop price and OCO client ID.
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: number - finalFlags
+
+| Param | Type | Description |
+| --- | --- | --- |
+| v | boolean | flag value |
+| [stopPrice] | number | optional, defaults to current value |
+| [cidOCO] | number | optional, defaults to current value |
+
+
+
+### order.setHidden(v) ⇒ number
+Update the hidden flag value. If hidden and the order is inserted into
+the order book, it will not be shown to other users or available via the
+API.
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: number - finalFlags
+
+| Param | Type | Description |
+| --- | --- | --- |
+| v | boolean | flag value |
+
+
+
+### order.setPostOnly(v) ⇒ number
+Update the post-only flag value. If post-only and the order would
+immediately fill, the order is automatically cancelled.
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: number - finalFlags
+
+| Param | Type | Description |
+| --- | --- | --- |
+| v | boolean | flag value |
+
+
+
+### order.setNoVariableRates(v) ⇒ number
+Update the no-variable-rates flag value. Limits orders on margin from
+taking funding with variable rates.
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: number - finalFlags
+
+| Param | Type | Description |
+| --- | --- | --- |
+| v | boolean | flag value |
+
+
+
+### order.setPositionClose(v) ⇒ number
+Update the position-close flag value. If set, the order is cancelled if it
+would not close an open position.
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: number - finalFlags
+
+| Param | Type | Description |
+| --- | --- | --- |
+| v | boolean | flag value |
+
+
+
+### order.setReduceOnly(v) ⇒ number
+Update the reduce-only flag. If set and the order would open a new
+position, or increase the size of an existing position, it is
+automatically cancelled.
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: number - finalFlags
+
+| Param | Type | Description |
+| --- | --- | --- |
+| v | boolean | flag value |
+
+
+
+### order.modifyFlag(flag, active) ⇒ number
+Updates a specific flag
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: number - finalFlags
+
+| Param | Type | Description |
+| --- | --- | --- |
+| flag | number | flag value |
+| active | boolean | active status |
+
+
+
+### order.update(changes, [apiInterface]) ⇒ Promise
+Send an order update packet to the WS server, and update local state. This
+updates the order atomically without changing its position in the queue for
+its price level.
+
+Rejects with an error if an attempt is made to apply a delta to a missing
+amount.
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: Promise - p - resolves on ws2 confirmation or rest response
+
+| Param | Type | Description |
+| --- | --- | --- |
+| changes | object | changeset to apply to this order |
+| [apiInterface] | bitfinex-api-node.WSv2 \| bfx-api-node-rest.RESTv2 | optional ws or rest, defaults to internal instance |
+
+**Example**
+```js
+const ws = new WSv2({ ... })
+
+await ws.open()
+await ws.auth()
+
+const o = new Order({ ... }, ws)
+
+await o.submit()
+await o.update({ price: '2.0' }) // update price
+await o.update({ delta: '18.0' }) // update amount with delta
+
+console.log(o.toString())) // inspect order
+```
+
+
+### order.toPreview() ⇒ [Preview](#Order..Preview)
+Returns a POJO that can be used as a preview order in Honey Framework
+algorithmic orders.
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: [Preview](#Order..Preview) - preview
+
+
+### order.registerListeners([apiInterface])
+Registers for updates/persistence on the specified ws2 instance.
+
+**Kind**: instance method of [Order](#Order)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| [apiInterface] | object | optional, defaults to internal ws |
+
+
+
+### order.removeListeners([apiInterface])
+Removes update listeners from the specified ws2 instance.
+Will fail if rest interface is provided.
+
+**Kind**: instance method of [Order](#Order)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| [apiInterface] | bitfinex-api-node.WSv2 \| bfx-api-node-rest.RESTv2 | optional ws defaults to internal ws |
+
+
+
+### order.cbGID() ⇒ string
+Return the callback group ID for the order, used to bind listeners on
+an API interface.
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: string - cbGID
+
+
+### order.submit([apiInterface]) ⇒ Promise
+Submit the order
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: Promise - p
+
+| Param | Type | Description |
+| --- | --- | --- |
+| [apiInterface] | bitfinex-api-node.WSv2 \| bfx-api-node-rest.RESTv2 | defaults to internal ws |
+
+
+
+### order.cancel([apiInterface]) ⇒ Promise
+Cancel the order if open
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: Promise - p
+
+| Param | Type | Description |
+| --- | --- | --- |
+| [apiInterface] | bitfinex-api-node.WSv2 \| bfx-api-node-rest.RESTv2 | defaults to internal ws |
+
+
+
+### order.recreate([apiInterface]) ⇒ Promise
+Equivalent to calling cancel() followed by submit()
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: Promise - p
+
+| Param | Type | Description |
+| --- | --- | --- |
+| [apiInterface] | bitfinex-api-node.WSv2 \| bfx-api-node-rest.RESTv2 | defaults to internal ws |
+
+
+
+### order.updateFrom(order)
+Updates order information from the provided order.
+
+**Kind**: instance method of [Order](#Order)
+**Throws**:
+
+- Error fails if the order ID/CID/GID do not match
+
+
+| Param | Type | Description |
+| --- | --- | --- |
+| order | [Order](#Order) | order to update from |
+
+
+
+### order.getLastFillAmount() ⇒ number
+Query the amount that was filled on the last order update
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: number - amount
+
+
+### order.resetFilledAmount()
+Resets the last amount, so getLastFillAmount() returns 0
+
+**Kind**: instance method of [Order](#Order)
+**See**
+
+- [Order~getLastFillAmount](Order~getLastFillAmount)
+- [Order~isPartiallyFilled](Order~isPartiallyFilled)
+
+
+
+### order.getBaseCurrency() ⇒ string
+Returns the base currency of the order.
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: string - currency
+
+
+### order.getQuoteCurrency() ⇒ string
+Returns the quote currency of the order.
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: string - currency
+
+
+### order.getNotionalValue() ⇒ number
+Returns the notional value of the order
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: number - value
+
+
+### order.isPartiallyFilled() ⇒ boolean
+Indicates if the order is partially filled, based on the original and
+current amounts.
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: boolean - isPartiallyFilled
+**See**: modules:bfx-api-node-models.Order~resetFilledAmount
+
+
+### order.toNewOrderPacket() ⇒ [SubmitPayload](#Order..SubmitPayload)
+Creates an order map that can be passed to the `on` command.
+
+**Kind**: instance method of [Order](#Order)
+**Returns**: [SubmitPayload](#Order..SubmitPayload) - o
+**Example**
+```js
+const ws = new WSv2({ apiKey: '...', apiSecret: '...' })
+await ws.open()
+await ws.auth()
+
+const o = new Order({
+ type: 'MARKET'
+ symbol: 'tLEOUSD',
+ amount: -6,
+})
+
+ws.send([0, 'on', null, o.toNewOrderPacket()])
+```
+
+
+### order.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [Order](#Order)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### order.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [Order](#Order)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### Order.flags : enum
+Valid order flag values
+
+**Kind**: static enum of [Order](#Order)
+**Read only**: true
+**Properties**
+
+| Name | Type | Default | Description |
+| --- | --- | --- | --- |
+| OCO | number | | Order cancels order (16384). Requires `priceAuxLimit` and `cidOCO` to be set, resolved to `price_oco_stop` and `cid_oco` on the generated `on` packet. |
+| POSTONLY | number | | Post-only (4096) orders are cancelled if they would execute immediately |
+| HIDDEN | number | | Hidden (64) orders are inserted into the book, not visible to other traders, and always pay the **taker** fee. |
+| NO_VR | number | | Excludes variable rate (524288) funding |
+| POS_CLOSE | number | | Position-close (512) orders are cancelled if they would not close an open position. |
+| REDUCE_ONLY | number | | Reduce-only (1024) orders are cancelled if they would open or increase the size of an existing position. |
+
+
+
+### Order.unserialize(data) ⇒ [ObjectData](#Order..ObjectData)
+**Kind**: static method of [Order](#Order)
+**Returns**: [ObjectData](#Order..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Order..Data) \| [Array.<Data>](#Order..Data) | data to convert to POJO |
+
+
+
+### Order.getBaseCurrency(arr) ⇒ string
+Get the base currency for an order in WSv2 array format.
+
+**Kind**: static method of [Order](#Order)
+**Returns**: string - currency - base currency from symbol
+
+| Param | Type | Description |
+| --- | --- | --- |
+| arr | [ArrayData](#Order..ArrayData) | order in ws2 array format |
+
+
+
+### Order.getQuoteCurrency(arr) ⇒ string
+Get the quote currency for an order in WSv2 array format.
+
+**Kind**: static method of [Order](#Order)
+**Returns**: string - currency - quote currency from symbol
+
+| Param | Type | Description |
+| --- | --- | --- |
+| arr | [ArrayData](#Order..ArrayData) | order in ws2 array format |
+
+
+
+### Order.validate(data) ⇒ string
+Validates a given order instance
+
+**Kind**: static method of [Order](#Order)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Order..Data) \| [Array.<Data>](#Order..Data) | instance(s) to validate |
+
+
+
+### Order~ArrayData : Array
+[Order](#Order) data in WSv2 array format. Suitable for passing to
+[Order](#Order) to construct a model instance.
+
+**Kind**: inner typedef of [Order](#Order)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | number | id |
+| 1 | number | gid |
+| 2 | number | cid |
+| 3 | string | symbol |
+| 4 | number | mtsCreate |
+| 5 | number | mtsUpdate |
+| 6 | number | amount |
+| 7 | number | amountOrig |
+| 8 | [Type](#Order..Type) | type |
+| 9 | [Type](#Order..Type) | typePrev |
+| 10 | number | mtsTIF |
+| 12 | number | flags |
+| 13 | string | status |
+| 16 | number | price |
+| 17 | number | priceAvg |
+| 18 | number | priceTrailing |
+| 19 | number | priceAuxLimit |
+| 23 | number | notify |
+| 24 | number | hidden |
+| 25 | number | placedId |
+| 28 | string | routing |
+| 31 | object | meta |
+
+
+
+### Order~Data : [Order](#Order) \| [ObjectData](#Order..ObjectData) \| [ArrayData](#Order..ArrayData)
+[Order](#Order) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [Order](#Order)
+
+
+### Order~ObjectData : object
+[Order](#Order) data in plain object format. Suitable for passing to
+[Order](#Order) to construct a model instance.
+
+**Kind**: inner typedef of [Order](#Order)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| id | number | ID |
+| [gid] | number | group ID |
+| [cid] | number | client ID |
+| symbol | string | symbol |
+| [mtsCreate] | number | creation timestamp |
+| [mtsUpdate] | number | last update timestamp |
+| amount | string | remaining order amount |
+| [amountOrig] | string | original/initial order amount |
+| [type] | [Type](#Order..Type) | order type |
+| [typePrev] | [Type](#Order..Type) | previous type |
+| [mtsTIF] | number | TIF timestamp, if set |
+| [flags] | number | order flags |
+| [status] | string | current order status |
+| price | string | order price |
+| [priceAvg] | string | average execution price |
+| [priceTrailing] | string | trailing distance for TRAILING STOP orders |
+| [priceAuxLimit] | string | stop price for STOP LIMIT and OCO orders |
+| [notify] | number \| boolean | notify flag |
+| [placedId] | number | placed ID |
+| [affiliateCode] | string | affiliate code |
+| [lev] | number | leverage |
+
+
+
+### Order~Preview : object
+Preview of an [Order](#Order) for display in an UI, prior to submission
+
+**Kind**: inner typedef of [Order](#Order)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| gid | number | group id |
+| cid | number | client ID |
+| symbol | string | symbol |
+| amount | number | amount |
+| type | [Type](#Order..Type) | type |
+| [price] | number | price, optional for `MARKET` orders |
+| notify | number | notify flag |
+| flags | number | flags |
+| [lev] | number | leverage |
+
+
+
+### Order~SubmitPayload : object
+A set of parameters describing an atomic order that can be sent via the WSv2
+API to submit it.
+
+**Kind**: inner typedef of [Order](#Order)
+**Properties**
+
+| Name | Type | Default | Description |
+| --- | --- | --- | --- |
+| [gid] | number | | group ID |
+| [cid] | number | | client ID |
+| symbol | string | | symbol |
+| type | [Type](#Order..Type) | | type |
+| amount | number | | amount |
+| [price] | number | | optional for `MARKET` orders |
+| [price_trailing] | number | | required for `TRAILING STOP` orders |
+| [price_aux_limit] | number | | required for `STOP LIMIT` and `OCO` orders |
+| [price_oco_stop] | number | | required for `OCO` orders |
+| [cid_oco] | number | | required for `OCO` orders |
+| [lev] | number | | leverage |
+| [flags] | number | 0 | flags |
+| [meta] | object | {} | metadata |
+| [meta.aff_code] | string | | affiliate code |
+| [tif] | number | | time in force |
+
+
+
+### Order~Type : 'MARKET' \| 'EXCHANGE MARKET' \| 'LIMIT' \| 'EXCHANGE LIMIT' \| 'STOP' \| 'EXCHANGE STOP' \| 'TRAILING STOP' \| 'EXCHANGE TRAILING STOP' \| 'FOK' \| 'EXCHANGE FOK' \| 'STOP LIMIT' \| 'EXCHANGE STOP LIMIT'
+Valid atomic order types, see the [Order](#Order) model.
+
+**Kind**: inner typedef of [Order](#Order)
+
+
+## Position ⇐ [Model](#Model)
+Position model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [Position](#Position) ⇐ [Model](#Model)
+ * [new Position(data, [apiInterface])](#new_Position_new)
+ * _instance_
+ * [.claim([apiInterface])](#Position+claim) ⇒ Promise
+ * [.close([apiInterface])](#Position+close) ⇒ Promise
+ * [.orderToClose([apiInterface])](#Position+orderToClose) ⇒ Promise
+ * [.toString()](#Position+toString) ⇒ string
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#Position.unserialize) ⇒ [ObjectData](#Position..ObjectData)
+ * [.validate(data)](#Position.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#Position..ArrayData) : Array
+ * [~Data](#Position..Data) : [Position](#Position) \| [ObjectData](#Position..ObjectData) \| [ArrayData](#Position..ArrayData)
+ * [~ObjectData](#Position..ObjectData) : object
+
+
+
+### new Position(data, [apiInterface])
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Position..Data) \| [Array.<Data>](#Position..Data) | data |
+| [apiInterface] | bitfinex-api-node.WSv2 \| bfx-api-node-rest.RESTv2 | rest or websocket object that's capable of submitting position changes |
+
+
+
+### position.claim([apiInterface]) ⇒ Promise
+Claim the position
+
+**Kind**: instance method of [Position](#Position)
+**Returns**: Promise - p
+
+| Param | Type | Description |
+| --- | --- | --- |
+| [apiInterface] | bfx-api-node-rest.RESTv2 | api |
+
+
+
+### position.close([apiInterface]) ⇒ Promise
+Close the position
+
+**Kind**: instance method of [Position](#Position)
+**Returns**: Promise - p
+
+| Param | Type | Description |
+| --- | --- | --- |
+| [apiInterface] | bfx-api-node-rest.RESTv2 | api |
+
+
+
+### position.orderToClose([apiInterface]) ⇒ Promise
+Generate an order that can be used to close the position.
+
+**Kind**: instance method of [Position](#Position)
+**Returns**: Promise - p
+
+| Param | Type | Description |
+| --- | --- | --- |
+| [apiInterface] | bitfinex-api-node.WSv2 \| bfx-api-node-rest.RESTv2 | provided to returned `Order` instance |
+
+
+
+### position.toString() ⇒ string
+Returns a string representation of the position.
+
+**Kind**: instance method of [Position](#Position)
+**Returns**: string - str
+
+
+### position.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [Position](#Position)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### position.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [Position](#Position)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### Position.unserialize(data) ⇒ [ObjectData](#Position..ObjectData)
+**Kind**: static method of [Position](#Position)
+**Returns**: [ObjectData](#Position..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Position..Data) \| [Array.<Data>](#Position..Data) | data to convert to POJO |
+
+
+
+### Position.validate(data) ⇒ string
+Validates a given position instance
+
+**Kind**: static method of [Position](#Position)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Position..Data) \| [Array.<Data>](#Position..Data) | instance(s) to validate |
+
+
+
+### Position~ArrayData : Array
+[Position](#Position) data in WSv2 array format. Suitable for passing to
+[Position](#Position) to construct a model instance.
+
+**Kind**: inner typedef of [Position](#Position)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | string | symbol |
+| 1 | string | status |
+| 2 | number | amount |
+| 3 | string | basePrice |
+| 4 | string | marginFunding |
+| 5 | string | marginFundingType |
+| 6 | string | pl |
+| 7 | string | plPerc |
+| 8 | string | liquidationPrice |
+| 9 | number | leverage |
+| 11 | number | id |
+| 12 | number | mtsCreate |
+| 13 | number | mtsUpdate |
+| 15 | string | type |
+| 17 | number | collateral |
+| 18 | number | collateralMin |
+| 19 | object | meta |
+
+
+
+### Position~Data : [Position](#Position) \| [ObjectData](#Position..ObjectData) \| [ArrayData](#Position..ArrayData)
+[Position](#Position) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [Position](#Position)
+
+
+### Position~ObjectData : object
+[Position](#Position) data in plain object format. Suitable for passing to
+[Position](#Position) to construct a model instance.
+
+**Kind**: inner typedef of [Position](#Position)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| id | number | id |
+| mtsCreate | number | creation timestamp |
+| mtsUpdate | number | last update timestamp |
+| symbol | string | symbol |
+| status | string | status |
+| type | string | type |
+| amount | string | amount |
+| basePrice | string | base price |
+| marginFunding | string | margin funding |
+| marginFundingType | string | margin funding type |
+| pl | string | profit/loss |
+| plPerc | string | profit/loss as percentage |
+| liquidationPrice | string | liquidation price |
+| leverage | number | leverage |
+| collateral | number | collateral |
+| collateralMin | number | minimum collateral to maintain position |
+| meta | object | metadata |
+
+
+
+## PublicPulseProfile ⇐ [Model](#Model)
+Public PulseProfile model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [PublicPulseProfile](#PublicPulseProfile) ⇐ [Model](#Model)
+ * [new PublicPulseProfile(data)](#new_PublicPulseProfile_new)
+ * _instance_
+ * [.toString()](#PublicPulseProfile+toString) ⇒ string
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#PublicPulseProfile.unserialize) ⇒ [ObjectData](#PublicPulseProfile..ObjectData)
+ * [.validate(data)](#PublicPulseProfile.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#PublicPulseProfile..ArrayData) : Array
+ * [~Data](#PublicPulseProfile..Data) : [PublicPulseProfile](#PublicPulseProfile) \| [ObjectData](#PublicPulseProfile..ObjectData) \| [ArrayData](#PublicPulseProfile..ArrayData)
+ * [~ObjectData](#PublicPulseProfile..ObjectData) : object
+
+
+
+### new PublicPulseProfile(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#PublicPulseProfile..Data) \| [Array.<Data>](#PublicPulseProfile..Data) | data |
+
+
+
+### publicPulseProfile.toString() ⇒ string
+**Kind**: instance method of [PublicPulseProfile](#PublicPulseProfile)
+**Returns**: string - str
+
+
+### publicPulseProfile.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [PublicPulseProfile](#PublicPulseProfile)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### publicPulseProfile.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [PublicPulseProfile](#PublicPulseProfile)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### PublicPulseProfile.unserialize(data) ⇒ [ObjectData](#PublicPulseProfile..ObjectData)
+**Kind**: static method of [PublicPulseProfile](#PublicPulseProfile)
+**Returns**: [ObjectData](#PublicPulseProfile..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#PublicPulseProfile..Data) \| [Array.<Data>](#PublicPulseProfile..Data) | data to convert to POJO |
+
+
+
+### PublicPulseProfile.validate(data) ⇒ string
+Validates a given public pulse profile instance
+
+**Kind**: static method of [PublicPulseProfile](#PublicPulseProfile)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#PublicPulseProfile..Data) \| [Array.<Data>](#PublicPulseProfile..Data) | models to validate |
+
+
+
+### PublicPulseProfile~ArrayData : Array
+[PublicPulseProfile](#PublicPulseProfile) data in WSv2 array format. Suitable for passing
+to [PublicPulseProfile](#PublicPulseProfile) instance.
+
+**Kind**: inner typedef of [PublicPulseProfile](#PublicPulseProfile)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | string | id |
+| 1 | number | mtsCreate |
+| 3 | string | nickname |
+| 5 | string | picture |
+| 6 | string | text |
+| 9 | string | twitterHandle |
+
+
+
+### PublicPulseProfile~Data : [PublicPulseProfile](#PublicPulseProfile) \| [ObjectData](#PublicPulseProfile..ObjectData) \| [ArrayData](#PublicPulseProfile..ArrayData)
+[PublicPulseProfile](#PublicPulseProfile) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [PublicPulseProfile](#PublicPulseProfile)
+
+
+### PublicPulseProfile~ObjectData : object
+[PublicPulseProfile](#PublicPulseProfile) data in plain object format. Suitable for passing
+to [PublicPulseProfile](#PublicPulseProfile) to construct a model instance.
+
+**Kind**: inner typedef of [PublicPulseProfile](#PublicPulseProfile)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| id | string | pulse User ID |
+| mtsCreate | number | creation timestamp |
+| nickname | string | profile nickname |
+| picture | string | profile picture |
+| text | string | profile bio |
+| twitterHandle | string | profile twitter handle |
+
+
+
+## PublicTrade ⇐ [Model](#Model)
+Public Trade model, supporting both funding & ordinary trades
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+**Todo**
+
+- [ ] Extract type defs (varying format)
+
+
+* [PublicTrade](#PublicTrade) ⇐ [Model](#Model)
+ * [new PublicTrade(data)](#new_PublicTrade_new)
+ * _instance_
+ * [.toString()](#PublicTrade+toString) ⇒ string
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#PublicTrade.unserialize) ⇒ object
+ * [.validate(data)](#PublicTrade.validate) ⇒ string
+
+
+
+### new PublicTrade(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | object \| Array | public trade data |
+
+
+
+### publicTrade.toString() ⇒ string
+**Kind**: instance method of [PublicTrade](#PublicTrade)
+**Returns**: string - str
+
+
+### publicTrade.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [PublicTrade](#PublicTrade)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### publicTrade.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [PublicTrade](#PublicTrade)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### PublicTrade.unserialize(data) ⇒ object
+**Kind**: static method of [PublicTrade](#PublicTrade)
+**Returns**: object - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | Array.<object> \| object \| Array.<Array> \| Array | data to convert to POJO |
+
+
+
+### PublicTrade.validate(data) ⇒ string
+Validates a given public trade instance
+
+**Kind**: static method of [PublicTrade](#PublicTrade)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | Array.<object> \| object \| [Array.<PublicTrade>](#PublicTrade) \| [PublicTrade](#PublicTrade) \| Array | models to validate |
+
+
+
+## PulseMessage ⇐ [Model](#Model)
+Private PulseMessage model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [PulseMessage](#PulseMessage) ⇐ [Model](#Model)
+ * [new PulseMessage(data)](#new_PulseMessage_new)
+ * _instance_
+ * [.serialize()](#PulseMessage+serialize) ⇒ Array
+ * [.toString()](#PulseMessage+toString) ⇒ string
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#PulseMessage.unserialize) ⇒ [ObjectData](#PulseMessage..ObjectData)
+ * [.validate(data)](#PulseMessage.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#PulseMessage..ArrayData) : Array
+ * [~Data](#PulseMessage..Data) : [PulseMessage](#PulseMessage) \| [ObjectData](#PulseMessage..ObjectData) \| [ArrayData](#PulseMessage..ArrayData)
+ * [~ObjectData](#PulseMessage..ObjectData) : object
+
+
+
+### new PulseMessage(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#PulseMessage..Data) \| [Array.<Data>](#PulseMessage..Data) | data |
+
+
+
+### pulseMessage.serialize() ⇒ Array
+Return an array representation of this model
+
+**Kind**: instance method of [PulseMessage](#PulseMessage)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### pulseMessage.toString() ⇒ string
+**Kind**: instance method of [PulseMessage](#PulseMessage)
+**Returns**: string - str
+
+
+### pulseMessage.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [PulseMessage](#PulseMessage)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### PulseMessage.unserialize(data) ⇒ [ObjectData](#PulseMessage..ObjectData)
+**Kind**: static method of [PulseMessage](#PulseMessage)
+**Returns**: [ObjectData](#PulseMessage..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#PulseMessage..Data) \| [Array.<Data>](#PulseMessage..Data) | data to convert |
+
+
+
+### PulseMessage.validate(data) ⇒ string
+Validates a given public pulse profile instance
+
+**Kind**: static method of [PulseMessage](#PulseMessage)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#PulseMessage..Data) \| [Array.<Data>](#PulseMessage..Data) | instance(s) to validate |
+
+
+
+### PulseMessage~ArrayData : Array
+[PulseMessage](#PulseMessage) data in WSv2 array format. Suitable for passing to
+[PulseMessage](#PulseMessage) to construct a model instance.
+
+**Kind**: inner typedef of [PulseMessage](#PulseMessage)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | string | id |
+| 1 | number | mts |
+| 3 | string | userID |
+| 5 | string | title |
+| 6 | string | content |
+| 9 | number | isPin |
+| 10 | number | isPublic |
+| 12 | string | tags |
+| 13 | string | attachments |
+| 15 | number | likes |
+| 16 | number | userLiked |
+
+
+
+### PulseMessage~Data : [PulseMessage](#PulseMessage) \| [ObjectData](#PulseMessage..ObjectData) \| [ArrayData](#PulseMessage..ArrayData)
+[PulseMessage](#PulseMessage) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [PulseMessage](#PulseMessage)
+
+
+### PulseMessage~ObjectData : object
+[PulseMessage](#PulseMessage) data in plain object format. Suitable for passing to
+[PulseMessage](#PulseMessage) to construct a model instance.
+
+**Kind**: inner typedef of [PulseMessage](#PulseMessage)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| id | string | pulse message ID |
+| mts | number | millisecond timestamp |
+| userID | string | pulse User ID |
+| title | string | title of the pulse message |
+| content | string | content of the pulse message |
+| isPin | number | 1 if the message is pinned, 0 if it is not pinned |
+| isPublic | number | 1 if the message is public, 0 if it is not public |
+| tags | string | tags used in the message |
+| attachments | string | attachments used in the message |
+| likes | number | number of likes |
+| userLiked | number | flag to show if the private user liked the pulse |
+
+
+
+## StatusMessagesDeriv ⇐ [Model](#Model)
+Derivatives Status Message model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [StatusMessagesDeriv](#StatusMessagesDeriv) ⇐ [Model](#Model)
+ * [new StatusMessagesDeriv(data)](#new_StatusMessagesDeriv_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#StatusMessagesDeriv.unserialize) ⇒ [ObjectData](#StatusMessagesDeriv..ObjectData)
+ * [.validate(data)](#StatusMessagesDeriv.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#StatusMessagesDeriv..ArrayData) : Array
+ * [~Data](#StatusMessagesDeriv..Data) : [StatusMessagesDeriv](#StatusMessagesDeriv) \| [ObjectData](#StatusMessagesDeriv..ObjectData) \| [ArrayData](#StatusMessagesDeriv..ArrayData)
+ * [~ObjectData](#StatusMessagesDeriv..ObjectData) : object
+
+
+
+### new StatusMessagesDeriv(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#StatusMessagesDeriv..Data) \| [Array.<Data>](#StatusMessagesDeriv..Data) | data |
+
+
+
+### statusMessagesDeriv.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [StatusMessagesDeriv](#StatusMessagesDeriv)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### statusMessagesDeriv.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [StatusMessagesDeriv](#StatusMessagesDeriv)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### StatusMessagesDeriv.unserialize(data) ⇒ [ObjectData](#StatusMessagesDeriv..ObjectData)
+**Kind**: static method of [StatusMessagesDeriv](#StatusMessagesDeriv)
+**Returns**: [ObjectData](#StatusMessagesDeriv..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#StatusMessagesDeriv..Data) \| [Array.<Data>](#StatusMessagesDeriv..Data) | data to convert to POJO |
+
+
+
+### StatusMessagesDeriv.validate(data) ⇒ string
+Validates a given public trade instance
+
+**Kind**: static method of [StatusMessagesDeriv](#StatusMessagesDeriv)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#StatusMessagesDeriv..Data) \| [Array.<Data>](#StatusMessagesDeriv..Data) | models to validate |
+
+
+
+### StatusMessagesDeriv~ArrayData : Array
+[StatusMessagesDeriv](#StatusMessagesDeriv) data in WSv2 array format. Suitable for passing
+to [StatusMessagesDeriv](#StatusMessagesDeriv) to construct a model instance.
+
+**Kind**: inner typedef of [StatusMessagesDeriv](#StatusMessagesDeriv)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | string | key |
+| 1 | number | timestamp |
+| 3 | number | price |
+| 4 | number | priceSpot |
+| 6 | number | fundBal |
+| 9 | number | fundingAccrued |
+| 10 | number | fundingStep |
+
+
+
+### StatusMessagesDeriv~Data : [StatusMessagesDeriv](#StatusMessagesDeriv) \| [ObjectData](#StatusMessagesDeriv..ObjectData) \| [ArrayData](#StatusMessagesDeriv..ArrayData)
+[StatusMessagesDeriv](#StatusMessagesDeriv) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [StatusMessagesDeriv](#StatusMessagesDeriv)
+
+
+### StatusMessagesDeriv~ObjectData : object
+[StatusMessagesDeriv](#StatusMessagesDeriv) data in plain object format. Suitable for
+passing to [StatusMessagesDeriv](#StatusMessagesDeriv) to construct a model instance.
+
+**Kind**: inner typedef of [StatusMessagesDeriv](#StatusMessagesDeriv)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| key | string | key |
+| timestamp | number | timestamp |
+| price | string | price |
+| priceSpot | string | spot price |
+| fundBal | string | funding balance |
+| fundingAccrued | string | accrued funding |
+| fundingStep | string | funding step |
+
+
+
+## Trade ⇐ [Model](#Model)
+Private Trade model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [Trade](#Trade) ⇐ [Model](#Model)
+ * [new Trade(data)](#new_Trade_new)
+ * _instance_
+ * [.toString()](#Trade+toString) ⇒ string
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#Trade.unserialize) ⇒ [ObjectData](#Trade..ObjectData)
+ * [.validate(data)](#Trade.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#Trade..ArrayData) : Array
+ * [~Data](#Trade..Data) : [Trade](#Trade) \| [ObjectData](#Trade..ObjectData) \| [ArrayData](#Trade..ArrayData)
+ * [~ObjectData](#Trade..ObjectData) : object
+
+
+
+### new Trade(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Trade..Data) \| [Array.<Data>](#Trade..Data) | data |
+
+
+
+### trade.toString() ⇒ string
+**Kind**: instance method of [Trade](#Trade)
+**Returns**: string - str
+
+
+### trade.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [Trade](#Trade)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### trade.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [Trade](#Trade)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### Trade.unserialize(data) ⇒ [ObjectData](#Trade..ObjectData)
+**Kind**: static method of [Trade](#Trade)
+**Returns**: [ObjectData](#Trade..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Trade..Data) \| [Array.<Data>](#Trade..Data) | data to convert to POJO |
+
+
+
+### Trade.validate(data) ⇒ string
+Validates a given trade instance
+
+**Kind**: static method of [Trade](#Trade)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Trade..Data) \| [Array.<Data>](#Trade..Data) | instance(s) to validate |
+
+
+
+### Trade~ArrayData : Array
+[Trade](#Trade) data in WSv2 array format. Suitable for passing to
+[Trade](#Trade) to construct a model instance.
+
+**Kind**: inner typedef of [Trade](#Trade)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | number | id |
+| 1 | string | symbol |
+| 2 | number | mtsCreate |
+| 3 | number | orderID |
+| 4 | string | execAmount |
+| 5 | string | execPrice |
+| 6 | string | orderType |
+| 7 | number | orderPrice |
+| 8 | number | maker |
+| 9 | number | fee |
+| 10 | string | feeCurrency |
+
+
+
+### Trade~Data : [Trade](#Trade) \| [ObjectData](#Trade..ObjectData) \| [ArrayData](#Trade..ArrayData)
+[Trade](#Trade) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [Trade](#Trade)
+
+
+### Trade~ObjectData : object
+[Trade](#Trade) data in plain object format. Suitable for passing to
+[Trade](#Trade) to construct a model instance.
+
+**Kind**: inner typedef of [Trade](#Trade)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| id | number | id |
+| symbol | string | symbol |
+| mtsCreate | number | creation timestamp |
+| orderID | number | order ID |
+| execAmount | string | executed amount |
+| execPrice | string | execution price |
+| orderType | string | order type |
+| orderPrice | string | order price |
+| maker | number \| boolean | maker flag |
+| fee | string | fee amount |
+| feeCurrency | string | fee currency |
+
+
+
+## TradingTickerHist ⇐ [Model](#Model)
+Historical Trading Ticker model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [TradingTickerHist](#TradingTickerHist) ⇐ [Model](#Model)
+ * [new TradingTickerHist(data)](#new_TradingTickerHist_new)
+ * _instance_
+ * [.quote()](#TradingTickerHist+quote) ⇒ string
+ * [.base()](#TradingTickerHist+base) ⇒ string
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#TradingTickerHist.unserialize) ⇒ [ObjectData](#TradingTickerHist..ObjectData)
+ * [.validate(data)](#TradingTickerHist.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#TradingTickerHist..ArrayData) : Array
+ * [~Data](#TradingTickerHist..Data) : [TradingTickerHist](#TradingTickerHist) \| [ObjectData](#TradingTickerHist..ObjectData) \| [ArrayData](#TradingTickerHist..ArrayData)
+ * [~ObjectData](#TradingTickerHist..ObjectData) : object
+
+
+
+### new TradingTickerHist(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#TradingTickerHist..Data) \| [Array.<Data>](#TradingTickerHist..Data) | data |
+
+
+
+### tradingTickerHist.quote() ⇒ string
+Quote currency for the ticker
+
+**Kind**: instance method of [TradingTickerHist](#TradingTickerHist)
+**Returns**: string - quoteCurrency
+
+
+### tradingTickerHist.base() ⇒ string
+Base currency for the ticker.
+
+**Kind**: instance method of [TradingTickerHist](#TradingTickerHist)
+**Returns**: string - baseCurrency
+
+
+### tradingTickerHist.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [TradingTickerHist](#TradingTickerHist)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### tradingTickerHist.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [TradingTickerHist](#TradingTickerHist)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### TradingTickerHist.unserialize(data) ⇒ [ObjectData](#TradingTickerHist..ObjectData)
+**Kind**: static method of [TradingTickerHist](#TradingTickerHist)
+**Returns**: [ObjectData](#TradingTickerHist..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#TradingTickerHist..Data) \| [Array.<Data>](#TradingTickerHist..Data) | data to convert to POJO |
+
+
+
+### TradingTickerHist.validate(data) ⇒ string
+Validates a given historical trading ticker instance
+
+**Kind**: static method of [TradingTickerHist](#TradingTickerHist)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#TradingTickerHist..Data) \| [Array.<Data>](#TradingTickerHist..Data) | models to validate |
+
+
+
+### TradingTickerHist~ArrayData : Array
+[TradingTickerHist](#TradingTickerHist) data in WSv2 array format. Suitable for passing to
+[TradingTickerHist](#TradingTickerHist) to construct a model instance.
+
+**Kind**: inner typedef of [TradingTickerHist](#TradingTickerHist)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | string | symbol |
+| 1 | number | bid |
+| 3 | number | ask |
+| 12 | number | mtsUpdate |
+
+
+
+### TradingTickerHist~Data : [TradingTickerHist](#TradingTickerHist) \| [ObjectData](#TradingTickerHist..ObjectData) \| [ArrayData](#TradingTickerHist..ArrayData)
+[TradingTickerHist](#TradingTickerHist) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [TradingTickerHist](#TradingTickerHist)
+
+
+### TradingTickerHist~ObjectData : object
+[TradingTickerHist](#TradingTickerHist) data in plain object format. Suitable for passing
+to [TradingTickerHist](#TradingTickerHist) to construct a model instance.
+
+**Kind**: inner typedef of [TradingTickerHist](#TradingTickerHist)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| symbol | string | symbol |
+| bid | number | best bid |
+| ask | number | best ask |
+| mtsUpdate | number | timestamp |
+
+
+
+## TradingTicker ⇐ [Model](#Model)
+Trading Ticker model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [TradingTicker](#TradingTicker) ⇐ [Model](#Model)
+ * [new TradingTicker(data)](#new_TradingTicker_new)
+ * _instance_
+ * [.quote()](#TradingTicker+quote) ⇒ string
+ * [.base()](#TradingTicker+base) ⇒ string
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#TradingTicker.unserialize) ⇒ [ObjectData](#TradingTicker..ObjectData)
+ * [.validate(data)](#TradingTicker.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#TradingTicker..ArrayData) : Array
+ * [~Data](#TradingTicker..Data) : [TradingTicker](#TradingTicker) \| [ObjectData](#TradingTicker..ObjectData) \| [ArrayData](#TradingTicker..ArrayData)
+ * [~ObjectData](#TradingTicker..ObjectData) : object
+
+
+
+### new TradingTicker(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#TradingTicker..Data) \| [Array.<Data>](#TradingTicker..Data) | data |
+
+
+
+### tradingTicker.quote() ⇒ string
+Quote currency of the ticker
+
+**Kind**: instance method of [TradingTicker](#TradingTicker)
+**Returns**: string - quoteCurrency
+
+
+### tradingTicker.base() ⇒ string
+Base currency of the ticker
+
+**Kind**: instance method of [TradingTicker](#TradingTicker)
+**Returns**: string - baseCurrency
+
+
+### tradingTicker.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [TradingTicker](#TradingTicker)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### tradingTicker.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [TradingTicker](#TradingTicker)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### TradingTicker.unserialize(data) ⇒ [ObjectData](#TradingTicker..ObjectData)
+**Kind**: static method of [TradingTicker](#TradingTicker)
+**Returns**: [ObjectData](#TradingTicker..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#TradingTicker..Data) \| [Array.<Data>](#TradingTicker..Data) | data to convert to POJO |
+
+
+
+### TradingTicker.validate(data) ⇒ string
+Validates a given trading ticker instance
+
+**Kind**: static method of [TradingTicker](#TradingTicker)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#TradingTicker..Data) \| [Array.<Data>](#TradingTicker..Data) | instance(s) to validate |
+
+
+
+### TradingTicker~ArrayData : Array
+[TradingTicker](#TradingTicker) data in WSv2 array format. Suitable for passing to
+[TradingTicker](#TradingTicker) to construct a model instance.
+
+**Kind**: inner typedef of [TradingTicker](#TradingTicker)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | string | symbol |
+| 1 | number | bid |
+| 2 | number | bidSize |
+| 3 | number | ask |
+| 4 | number | askSize |
+| 5 | number | dailyChange |
+| 6 | number | dailyChangePerc |
+| 7 | number | lastPrice |
+| 8 | number | volume |
+| 9 | number | high |
+| 10 | number | low |
+
+
+
+### TradingTicker~Data : [TradingTicker](#TradingTicker) \| [ObjectData](#TradingTicker..ObjectData) \| [ArrayData](#TradingTicker..ArrayData)
+[TradingTicker](#TradingTicker) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [TradingTicker](#TradingTicker)
+
+
+### TradingTicker~ObjectData : object
+[TradingTicker](#TradingTicker) data in plain object format. Suitable for passing to
+[TradingTicker](#TradingTicker) to construct a model instance.
+
+**Kind**: inner typedef of [TradingTicker](#TradingTicker)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| symbol | string | symbol |
+| bid | number | best bid |
+| bidSize | number | total bid size |
+| ask | number | best ask |
+| askSize | number | total ask size |
+| dailyChange | number | change in last 24h period |
+| dailyChangePerc | number | change in last 24h period as percent |
+| lastPrice | number | last price |
+| volume | number | volume in last 24h period |
+| high | number | highest price in last 24h period |
+| low | number | lowest price in last 24h period |
+
+
+
+## UserInfo ⇐ [Model](#Model)
+User Info model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [UserInfo](#UserInfo) ⇐ [Model](#Model)
+ * [new UserInfo(data)](#new_UserInfo_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#UserInfo.unserialize) ⇒ [ObjectData](#UserInfo..ObjectData)
+ * [.validate(data)](#UserInfo.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#UserInfo..ArrayData) : Array
+ * [~Data](#UserInfo..Data) : [UserInfo](#UserInfo) \| [ObjectData](#UserInfo..ObjectData) \| [ArrayData](#UserInfo..ArrayData)
+ * [~ObjectData](#UserInfo..ObjectData) : object
+
+
+
+### new UserInfo(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#UserInfo..Data) \| [Array.<Data>](#UserInfo..Data) | data |
+
+
+
+### userInfo.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [UserInfo](#UserInfo)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### userInfo.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [UserInfo](#UserInfo)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### UserInfo.unserialize(data) ⇒ [ObjectData](#UserInfo..ObjectData)
+**Kind**: static method of [UserInfo](#UserInfo)
+**Returns**: [ObjectData](#UserInfo..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#UserInfo..Data) \| [Array.<Data>](#UserInfo..Data) | data to convert to POJO |
+
+
+
+### UserInfo.validate(data) ⇒ string
+Validates a given historical trading ticker instance
+
+**Kind**: static method of [UserInfo](#UserInfo)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#UserInfo..Data) \| [Array.<Data>](#UserInfo..Data) | instance(s) to validate |
+
+
+
+### UserInfo~ArrayData : Array
+[UserInfo](#UserInfo) data in WSv2 array format. Suitable for passing to
+[UserInfo](#UserInfo) to construct a model instance.
+
+**Kind**: inner typedef of [UserInfo](#UserInfo)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | number | id |
+| 1 | string | email |
+| 2 | string | username |
+| 7 | number | timezone |
+
+
+
+### UserInfo~Data : [UserInfo](#UserInfo) \| [ObjectData](#UserInfo..ObjectData) \| [ArrayData](#UserInfo..ArrayData)
+[UserInfo](#UserInfo) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [UserInfo](#UserInfo)
+
+
+### UserInfo~ObjectData : object
+[UserInfo](#UserInfo) data in plain object format. Suitable for passing to
+[UserInfo](#UserInfo) to construct a model instance.
+
+**Kind**: inner typedef of [UserInfo](#UserInfo)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| id | number | id |
+| email | string | email |
+| username | string | username |
+| timezone | number | timezone as UTC offset |
+
+
+
+## WalletHist ⇐ [Model](#Model)
+Historical Wallet Update model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [WalletHist](#WalletHist) ⇐ [Model](#Model)
+ * [new WalletHist(data)](#new_WalletHist_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#WalletHist.unserialize) ⇒ [ObjectData](#WalletHist..ObjectData)
+ * [.validate(data)](#WalletHist.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#WalletHist..ArrayData) : Array
+ * [~Data](#WalletHist..Data) : [WalletHist](#WalletHist) \| [ObjectData](#WalletHist..ObjectData) \| [ArrayData](#WalletHist..ArrayData)
+ * [~ObjectData](#WalletHist..ObjectData) : object
+
+
+
+### new WalletHist(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#WalletHist..Data) \| [Array.<Data>](#WalletHist..Data) | data |
+
+
+
+### walletHist.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [WalletHist](#WalletHist)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### walletHist.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [WalletHist](#WalletHist)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### WalletHist.unserialize(data) ⇒ [ObjectData](#WalletHist..ObjectData)
+**Kind**: static method of [WalletHist](#WalletHist)
+**Returns**: [ObjectData](#WalletHist..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#WalletHist..Data) \| [Array.<Data>](#WalletHist..Data) | data to convert to POJO |
+
+
+
+### WalletHist.validate(data) ⇒ string
+Validates a given historical wallet instance
+
+**Kind**: static method of [WalletHist](#WalletHist)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#WalletHist..Data) \| [Array.<Data>](#WalletHist..Data) | instance(s) to validate |
+
+
+
+### WalletHist~ArrayData : Array
+[WalletHist](#WalletHist) data in WSv2 array format. Suitable for passing to
+[WalletHist](#WalletHist) to construct a model instance.
+
+**Kind**: inner typedef of [WalletHist](#WalletHist)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | string | type |
+| 1 | string | currency |
+| 2 | number | balance |
+| 3 | number | unsettledInterest |
+| 4 | number | balanceAvailable |
+| 6 | number | mtsUpdate |
+
+
+
+### WalletHist~Data : [WalletHist](#WalletHist) \| [ObjectData](#WalletHist..ObjectData) \| [ArrayData](#WalletHist..ArrayData)
+[WalletHist](#WalletHist) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [WalletHist](#WalletHist)
+
+
+### WalletHist~ObjectData : object
+[WalletHist](#WalletHist) data in plain object format. Suitable for passing to
+[WalletHist](#WalletHist) to construct a model instance.
+
+**Kind**: inner typedef of [WalletHist](#WalletHist)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| type | string | type (i.e. deposit) |
+| currency | string | currency |
+| balance | number | balance |
+| unsettledInterest | number | unsettled interest |
+| balanceAvailable | number | available balance |
+| mtsUpdate | number | timestamp |
+
+
+
+## Wallet ⇐ [Model](#Model)
+Wallet model
+
+**Kind**: global class
+**Extends**: [Model](#Model)
+
+* [Wallet](#Wallet) ⇐ [Model](#Model)
+ * [new Wallet(data)](#new_Wallet_new)
+ * _instance_
+ * [.serialize()](#Model+serialize) ⇒ Array
+ * [.toJS()](#Model+toJS) ⇒ object
+ * _static_
+ * [.unserialize(data)](#Wallet.unserialize) ⇒ [ObjectData](#Wallet..ObjectData)
+ * [.validate(data)](#Wallet.validate) ⇒ string
+ * _inner_
+ * [~ArrayData](#Wallet..ArrayData) : Array
+ * [~Data](#Wallet..Data) : [Wallet](#Wallet) \| [ObjectData](#Wallet..ObjectData) \| [ArrayData](#Wallet..ArrayData)
+ * [~ObjectData](#Wallet..ObjectData) : object
+
+
+
+### new Wallet(data)
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Wallet..Data) \| [Array.<Data>](#Wallet..Data) | data |
+
+
+
+### wallet.serialize() ⇒ Array
+Converts this model to array-format and returns the result
+
+**Kind**: instance method of [Wallet](#Wallet)
+**Overrides**: [serialize](#Model+serialize)
+**Returns**: Array - arr
+
+
+### wallet.toJS() ⇒ object
+Converts this model to object-format and returns the result
+
+**Kind**: instance method of [Wallet](#Wallet)
+**Overrides**: [toJS](#Model+toJS)
+**Returns**: object - pojo
+
+
+### Wallet.unserialize(data) ⇒ [ObjectData](#Wallet..ObjectData)
+**Kind**: static method of [Wallet](#Wallet)
+**Returns**: [ObjectData](#Wallet..ObjectData) - pojo
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Wallet..Data) \| [Array.<Data>](#Wallet..Data) | data to convert to POJO |
+
+
+
+### Wallet.validate(data) ⇒ string
+Validates a given wallet instance
+
+**Kind**: static method of [Wallet](#Wallet)
+**Returns**: string - error - null if instance is valid
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | [Data](#Wallet..Data) \| [Array.<Data>](#Wallet..Data) | instance(s) to validate |
+
+
+
+### Wallet~ArrayData : Array
+[Wallet](#Wallet) data in WSv2 array format. Suitable for passing to
+[Wallet](#Wallet) to construct a model instance.
+
+**Kind**: inner typedef of [Wallet](#Wallet)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| 0 | string | type |
+| 1 | string | currency |
+| 2 | number | balance |
+| 3 | number | unsettledInterest |
+| 4 | number | balanceAvailable |
+| 5 | string | description |
+| 6 | object | meta |
+
+
+
+### Wallet~Data : [Wallet](#Wallet) \| [ObjectData](#Wallet..ObjectData) \| [ArrayData](#Wallet..ArrayData)
+[Wallet](#Wallet) data either in WSv2 array or object format.
+
+**Kind**: inner typedef of [Wallet](#Wallet)
+
+
+### Wallet~ObjectData : object
+[Wallet](#Wallet) data in plain object format. Suitable for passing to
+[Wallet](#Wallet) to construct a model instance.
+
+**Kind**: inner typedef of [Wallet](#Wallet)
+**Properties**
+
+| Name | Type | Description |
+| --- | --- | --- |
+| type | string | wallet type (i.e. deposit) |
+| currency | string | wallet currency |
+| balance | number | total balance |
+| unsettledInterest | number | unsettled interest |
+| balanceAvailable | number | available balance |
+
+
+
+## isCollection(data) ⇒ boolean
+Checks if the provided data is a collection of models
+
+**Kind**: global function
+**Returns**: boolean - isCollection
+
+| Param | Type | Description |
+| --- | --- | --- |
+| data | Array.<object> \| object \| Array.<Array> \| Array | packet to analyse |
+
diff --git a/docs/scripts/collapse.js b/docs/scripts/collapse.js
deleted file mode 100644
index 327039f..0000000
--- a/docs/scripts/collapse.js
+++ /dev/null
@@ -1,20 +0,0 @@
-function hideAllButCurrent(){
- //by default all submenut items are hidden
- //but we need to rehide them for search
- document.querySelectorAll("nav > ul > li > ul li").forEach(function(parent) {
- parent.style.display = "none";
- });
-
- //only current page (if it exists) should be opened
- var file = window.location.pathname.split("/").pop().replace(/\.html/, '');
- document.querySelectorAll("nav > ul > li > a").forEach(function(parent) {
- var href = parent.attributes.href.value.replace(/\.html/, '');
- if (file === href) {
- parent.parentNode.querySelectorAll("ul li").forEach(function(elem) {
- elem.style.display = "block";
- });
- }
- });
-}
-
-hideAllButCurrent();
\ No newline at end of file
diff --git a/docs/scripts/linenumber.js b/docs/scripts/linenumber.js
deleted file mode 100644
index 8d52f7e..0000000
--- a/docs/scripts/linenumber.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/*global document */
-(function() {
- var source = document.getElementsByClassName('prettyprint source linenums');
- var i = 0;
- var lineNumber = 0;
- var lineId;
- var lines;
- var totalLines;
- var anchorHash;
-
- if (source && source[0]) {
- anchorHash = document.location.hash.substring(1);
- lines = source[0].getElementsByTagName('li');
- totalLines = lines.length;
-
- for (; i < totalLines; i++) {
- lineNumber++;
- lineId = 'line' + lineNumber;
- lines[i].id = lineId;
- if (lineId === anchorHash) {
- lines[i].className += ' selected';
- }
- }
- }
-})();
diff --git a/docs/scripts/nav.js b/docs/scripts/nav.js
deleted file mode 100644
index 6dd8313..0000000
--- a/docs/scripts/nav.js
+++ /dev/null
@@ -1,12 +0,0 @@
-function scrollToNavItem() {
- var path = window.location.href.split('/').pop().replace(/\.html/, '');
- document.querySelectorAll('nav a').forEach(function(link) {
- var href = link.attributes.href.value.replace(/\.html/, '');
- if (path === href) {
- link.scrollIntoView({block: 'center'});
- return;
- }
- })
- }
-
- scrollToNavItem();
diff --git a/docs/scripts/polyfill.js b/docs/scripts/polyfill.js
deleted file mode 100644
index 44b4c92..0000000
--- a/docs/scripts/polyfill.js
+++ /dev/null
@@ -1,4 +0,0 @@
-//IE Fix, src: https://www.reddit.com/r/programminghorror/comments/6abmcr/nodelist_lacks_foreach_in_internet_explorer/
-if (typeof(NodeList.prototype.forEach)!==typeof(alert)){
- NodeList.prototype.forEach=Array.prototype.forEach;
-}
\ No newline at end of file
diff --git a/docs/scripts/prettify/Apache-License-2.0.txt b/docs/scripts/prettify/Apache-License-2.0.txt
deleted file mode 100644
index d645695..0000000
--- a/docs/scripts/prettify/Apache-License-2.0.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/docs/scripts/prettify/lang-css.js b/docs/scripts/prettify/lang-css.js
deleted file mode 100644
index 041e1f5..0000000
--- a/docs/scripts/prettify/lang-css.js
+++ /dev/null
@@ -1,2 +0,0 @@
-PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
-/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);
diff --git a/docs/scripts/prettify/prettify.js b/docs/scripts/prettify/prettify.js
deleted file mode 100644
index eef5ad7..0000000
--- a/docs/scripts/prettify/prettify.js
+++ /dev/null
@@ -1,28 +0,0 @@
-var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
-(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
-[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c