diff --git a/README.md b/README.md index 04bb78c0..7a684f86 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Augmint](http://www.augmint.cc/android-chrome-192x192.png) +![Augmint](https://www.augmint.org/android-chrome-192x192.png) # Augmint - Stable Digital Tokens - Javascript Library (WIP) diff --git a/generateDocs.sh b/generateDocs.sh new file mode 100755 index 00000000..664569ef --- /dev/null +++ b/generateDocs.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +cat >./dist/sourcefile-map.json <(orders: T[], + tokens: Tokens, + rate: Tokens, + toTokens: (order: T) => Tokens): IMarketMatch { + const ret: IMarketMatch = { + filledTokens: Tokens.of(0), + filledEthers: Wei.of(0) + }; + + for (const order of orders) { + const remaining = tokens.sub(ret.filledTokens); + if (remaining.isZero()) { + break; + } + + const fillTokens: Tokens = Tokens.min(toTokens(order), remaining); + const fillEthers: Wei = fillTokens.toWeiAt(rate, order.price); + + ret.filledTokens = ret.filledTokens.add(fillTokens); + ret.filledEthers = ret.filledEthers.add(fillEthers); + ret.limitPrice = order.price; + } + if (ret.limitPrice) { + ret.averagePrice = rate.divToRatio(ret.filledTokens.toRate(ret.filledEthers)); + } + + return ret; + } + constructor(public buyOrders: IBuyOrder[], public sellOrders: ISellOrder[]) { buyOrders.sort(OrderBook.compareBuyOrders); sellOrders.sort(OrderBook.compareSellOrders); @@ -47,13 +83,16 @@ export class OrderBook { if (!this.hasMatchingOrders()) { return { buyIds, sellIds, gasEstimate: 0 }; } + const lowestSellPrice: Ratio = this.sellOrders[0].price; const highestBuyPrice: Ratio = this.buyOrders[0].price; const clone = o => Object.assign({}, o); - const buys: IBuyOrder[] = this.buyOrders.filter(o => o.price.gte(lowestSellPrice)).map(clone); + const buys: IBuyOrder[] = this.buyOrders + .filter(o => o.price.gte(lowestSellPrice)).map(clone); - const sells: ISellOrder[] = this.sellOrders.filter(o => o.price.lte(highestBuyPrice)).map(clone); + const sells: ISellOrder[] = this.sellOrders + .filter(o => o.price.lte(highestBuyPrice)).map(clone); let buyIdx: number = 0; let sellIdx: number = 0; @@ -98,6 +137,28 @@ export class OrderBook { return { buyIds, sellIds, gasEstimate }; } + + /** + * calculate price for n amount of token to buy + * @return {object} simple buy data { tokens, ethers, limitPrice, averagePrice } + * @param tokenAmount - amount of token to buy + * @param ethFiatRate - current rate + */ + public estimateMarketBuy(tokenAmount: Tokens, ethFiatRate: Tokens): IMarketMatch { + return OrderBook.estimateMarketOrder(this.sellOrders, tokenAmount, ethFiatRate, + order => order.amount); + } + + /** + * calculate price for n amount of token to sell + * @return {object} simple buy data { tokens, ethers, limitPrice, averagePrice } + * @param tokenAmount - amount of token to sell + * @param ethFiatRate - current rate + */ + public estimateMarketSell(tokenAmount: Tokens, ethFiatRate: Tokens): IMarketMatch { + return OrderBook.estimateMarketOrder(this.buyOrders, tokenAmount, ethFiatRate, + order => order.amount.toTokensAt(ethFiatRate, order.price)); + } } export interface IMatchingOrders { diff --git a/src/units.ts b/src/units.ts index c2521763..0b7c4bd8 100644 --- a/src/units.ts +++ b/src/units.ts @@ -40,6 +40,11 @@ abstract class FixedPoint { return this.create(ceilDiv(this.amount.mul(Ratio.DIV_BN), ratio.amount)); } + public divToRatio(other: this): Ratio { + this.check(other); + return new Ratio(this.amount.mul(Ratio.DIV_BN).divRound(other.amount)); + } + // // comparison // @@ -125,6 +130,9 @@ export class Wei extends FixedPoint { return new Tokens(this.amount.mul(rate.amount).divRound(price.amount.mul(E12))); } + public toNumber(): number { + return this.amount.toNumber() / Wei.DIV_BN.toNumber() + } } export class Tokens extends FixedPoint { @@ -158,7 +166,6 @@ export class Tokens extends FixedPoint { this.check(ethers, Wei); return new Tokens(this.amount.mul(Wei.DIV_BN).divRound(ethers.amount)); } - } @@ -178,6 +185,5 @@ export class Ratio extends FixedPoint { public toNumber(): number { return this.amount.toNumber() / Ratio.DIV; } - } diff --git a/test/Exchange.simpleBuy.test.js b/test/Exchange.simpleBuy.test.js new file mode 100644 index 00000000..3069bea1 --- /dev/null +++ b/test/Exchange.simpleBuy.test.js @@ -0,0 +1,65 @@ +const { assert } = require("chai"); + +const { normalizeBN } = require("./testHelpers/normalize.js"); +const { Augmint, utils, Wei, Tokens, Ratio } = require("../dist/index.js"); +const loadEnv = require("./testHelpers/loadEnv.js"); +const OrderBook = Augmint.Exchange.OrderBook; + +const config = loadEnv(); + +if (config.LOG) { + utils.logger.level = config.LOG; +} + +const RATE = Tokens.of(400.00); + +describe("calculate market orders", () => { + it("should return matching info", () => { + const buyOrders = [ + { amount: Wei.of(0.0070), price: Ratio.of(1.2) }, + { amount: Wei.of(0.0094), price: Ratio.of(1) }, + { amount: Wei.of(0.0064), price: Ratio.of(0.7) } + ]; + + const sellOrders = [ + { amount: Tokens.of(1), price: Ratio.of(1.02) }, + { amount: Tokens.of(10), price: Ratio.of(1.03) } + ]; + + const orderBook = new OrderBook(buyOrders, sellOrders); + + const sellResult = { + filledTokens: Tokens.of(6), + filledEthers: Wei.of(0.016165), + limitPrice: Ratio.of(1), + averagePrice: Ratio.of(1.077673) + }; + + const sellMatches = orderBook.estimateMarketSell(Tokens.of(6), RATE); + + assert.deepEqual(normalizeBN(sellResult), normalizeBN(sellMatches)); + + const buyResult = { + filledTokens: Tokens.of(2), + filledEthers: Wei.of(0.005125), + limitPrice: Ratio.of(1.03), + averagePrice: Ratio.of(1.02501) + }; + + const buyMatches = orderBook.estimateMarketBuy(Tokens.of(2), RATE); + + assert.deepEqual(normalizeBN(buyMatches), normalizeBN(buyResult)); + }); + + it("should work on empty order book", () => { + const orderBook = new OrderBook([], []); + const exp = { + filledTokens: Tokens.of(0), + filledEthers: Wei.of(0) + }; + const buyMatches = orderBook.estimateMarketBuy(Tokens.of(100), RATE); + const sellMatches = orderBook.estimateMarketSell(Tokens.of(100), RATE) + assert.deepEqual(normalizeBN(buyMatches), normalizeBN(exp)); + assert.deepEqual(normalizeBN(sellMatches), normalizeBN(exp)); + }); +}); diff --git a/test/LoanManager.test.js b/test/LoanManager.test.js index a144ff2d..d9edc13b 100644 --- a/test/LoanManager.test.js +++ b/test/LoanManager.test.js @@ -2,11 +2,7 @@ const chai = require("chai"); const { assert, expect } = chai; chai.use(require("chai-exclude")); -const BN = require("bn.js"); -BN.prototype.inspect = function() { - return this.toString(); -}; - +const { normalizeBN } = require("./testHelpers/normalize.js"); const { takeSnapshot, revertSnapshot } = require("./testHelpers/ganache.js"); const { Augmint, utils, Wei, Tokens, Ratio } = require("../dist/index.js"); const { AugmintJsError } = Augmint.Errors; @@ -17,20 +13,6 @@ if (config.LOG) { utils.logger.level = config.LOG; } -// deeply normalize all BN properties so they can be compared with deepEquals -// NOTE: object graph must not have cycles -function normalizeBN(obj) { - Object.keys(obj).map((key, index) => { - const o = obj[key]; - if (o instanceof BN) { - obj[key] = new BN(o.toString()); - } else if (o instanceof Object) { - obj[key] = normalizeBN(o); - } - }); - return obj; -} - function mockProd( id, minDisbursedAmount, diff --git a/test/testHelpers/normalize.js b/test/testHelpers/normalize.js new file mode 100644 index 00000000..c19de8d3 --- /dev/null +++ b/test/testHelpers/normalize.js @@ -0,0 +1,21 @@ +const BN = require("bn.js"); + +BN.prototype.inspect = function() { + return this.toString(); +}; + +module.exports = { normalizeBN }; + +// deeply normalize all BN properties so they can be compared with deepEquals +// NOTE: object graph must not have cycles +function normalizeBN(obj) { + Object.keys(obj).map((key, index) => { + const o = obj[key]; + if (o instanceof BN) { + obj[key] = new BN(o.toString()); + } else if (o instanceof Object) { + obj[key] = normalizeBN(o); + } + }); + return obj; +} diff --git a/yarn.lock b/yarn.lock index d1d5fbac..b89ce797 100644 --- a/yarn.lock +++ b/yarn.lock @@ -64,6 +64,54 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== +"@types/events@*": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" + integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== + +"@types/fs-extra@^5.0.3": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.1.0.tgz#2a325ef97901504a3828718c390d34b8426a10a1" + integrity sha512-AInn5+UBFIK9FK5xc9yP5e3TQSPNNgjHByqYcj9g5elVBnDQcQL7PlO1CIRy2gWlbwK7UPYqi7vRvFA44dCmYQ== + dependencies: + "@types/node" "*" + +"@types/glob@*": + version "7.1.1" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" + integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w== + dependencies: + "@types/events" "*" + "@types/minimatch" "*" + "@types/node" "*" + +"@types/handlebars@^4.0.38": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@types/handlebars/-/handlebars-4.1.0.tgz#3fcce9bf88f85fe73dc932240ab3fb682c624850" + integrity sha512-gq9YweFKNNB1uFK71eRqsd4niVkXrxHugqWFQkeLRJvGjnxsLr16bYtcsG4tOFwmYi0Bax+wCkbf1reUfdl4kA== + dependencies: + handlebars "*" + +"@types/highlight.js@^9.12.3": + version "9.12.3" + resolved "https://registry.yarnpkg.com/@types/highlight.js/-/highlight.js-9.12.3.tgz#b672cfaac25cbbc634a0fd92c515f66faa18dbca" + integrity sha512-pGF/zvYOACZ/gLGWdQH8zSwteQS1epp68yRcVLJMgUck/MjEn/FBYmPub9pXT8C1e4a8YZfHo1CKyV8q1vKUnQ== + +"@types/lodash@^4.14.110": + version "4.14.132" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.132.tgz#8ce45ca8745ff2e004fac0de0ab46f61e390ffa0" + integrity sha512-RNUU1rrh85NgUJcjOOr96YXr+RHwInGbaQCZmlitqOaCKXffj8bh+Zxwuq5rjDy5OgzFldDVoqk4pyLEDiwxIw== + +"@types/marked@^0.4.0": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.4.2.tgz#64a89e53ea37f61cc0f3ee1732c555c2dbf6452f" + integrity sha512-cDB930/7MbzaGF6U3IwSQp6XBru8xWajF5PV2YZZeV8DyiliTuld11afVztGI9+yJZ29il5E+NpGA6ooV/Cjkg== + +"@types/minimatch@*", "@types/minimatch@3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" + integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== + "@types/mkdirp@^0.5.2": version "0.5.2" resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f" @@ -98,6 +146,14 @@ dependencies: "@types/node" "*" +"@types/shelljs@^0.8.0": + version "0.8.5" + resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.8.5.tgz#1e507b2f6d1f893269bd3e851ec24419ef9beeea" + integrity sha512-bZgjwIWu9gHCjirKJoOlLzGi5N0QgZ5t7EXEuoqyWCHTuSddURXo3FOBYDyRPNOWzZ6NbkLvZnVkn483Y/tvcQ== + dependencies: + "@types/glob" "*" + "@types/node" "*" + abstract-leveldown@~0.12.0, abstract-leveldown@~0.12.1: version "0.12.4" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-0.12.4.tgz#29e18e632e60e4e221d5810247852a63d7b2e410" @@ -725,7 +781,7 @@ command-line-args@^4.0.7: find-replace "^1.0.3" typical "^2.6.1" -commander@^2.12.1, commander@^2.8.1: +commander@^2.12.1, commander@^2.8.1, commander@~2.20.0: version "2.20.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== @@ -1664,9 +1720,9 @@ fs.realpath@^1.0.0: integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= fstream@^1.0.2, fstream@^1.0.8: - version "1.0.11" - resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" - integrity sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE= + version "1.0.12" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.12.tgz#4e8ba8ee2d48be4f7d0de505455548eae5932045" + integrity sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg== dependencies: graceful-fs "^4.1.2" inherits "~2.0.0" @@ -1749,7 +1805,7 @@ glob@7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: +glob@^7.0.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: version "7.1.4" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== @@ -1809,6 +1865,17 @@ growl@1.10.5: resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== +handlebars@*, handlebars@^4.0.6: + version "4.1.2" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" + integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== + dependencies: + neo-async "^2.6.0" + optimist "^0.6.1" + source-map "^0.6.1" + optionalDependencies: + uglify-js "^3.1.4" + har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -1911,6 +1978,11 @@ he@1.2.0: resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== +highlight.js@^9.13.1: + version "9.15.6" + resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.15.6.tgz#72d4d8d779ec066af9a17cb14360c3def0aa57c4" + integrity sha512-zozTAWM1D6sozHo8kqhfYgsac+B+q0PmsjXeyDrYIHHcBN0zTVT66+s2GW1GZv7DbyaROdLXKdabwS/WqPyIdQ== + hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -2051,6 +2123,11 @@ inquirer@^6.2.2: strip-ansi "^5.1.0" through "^2.3.6" +interpret@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" + integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== + invert-kv@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" @@ -2517,7 +2594,7 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" -lodash@^4.17.11: +lodash@^4.17.10, lodash@^4.17.11: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== @@ -2582,6 +2659,11 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" +marked@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-0.4.0.tgz#9ad2c2a7a1791f10a852e0112f77b571dce10c66" + integrity sha512-tMsdNBgOsrUophCAFQl0XPe6Zqk/uy9gnue+jIIKhykO51hxyu6uNx7zBPy0+y/WKYVZZMspV9YeXLNdKk+iYw== + md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -2691,7 +2773,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -minimatch@3.0.4, minimatch@^3.0.4: +minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -2708,6 +2790,11 @@ minimist@^1.2.0: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + mixin-deep@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" @@ -2830,6 +2917,11 @@ negotiator@0.6.2: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== +neo-async@^2.6.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" + integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== + nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -2977,6 +3069,14 @@ onetime@^2.0.0: dependencies: mimic-fn "^1.0.0" +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" @@ -3366,6 +3466,13 @@ readable-stream@~1.0.26, readable-stream@~1.0.26-4: isarray "0.0.1" string_decoder "~0.10.x" +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= + dependencies: + resolve "^1.1.6" + regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -3447,6 +3554,13 @@ resolve@1.10.1, resolve@^1.3.2, resolve@^1.8.1: dependencies: path-parse "^1.0.6" +resolve@^1.1.6: + version "1.11.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.0.tgz#4014870ba296176b86343d50b60f3b50609ce232" + integrity sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw== + dependencies: + path-parse "^1.0.6" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -3515,10 +3629,10 @@ rollup-pluginutils@2.6.0, rollup-pluginutils@^2.3.1: estree-walker "^0.6.0" micromatch "^3.1.10" -rollup@1.12.3: - version "1.12.3" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.12.3.tgz#068b1957d5bebf6c0a758cfe42609b512add35a9" - integrity sha512-ueWhPijWN+GaPgD3l77hXih/gcDXmYph6sWeQegwBYtaqAE834e8u+MC2wT6FKIUsz1DBOyOXAQXUZB+rjWDoQ== +rollup@1.12.4: + version "1.12.4" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.12.4.tgz#f2cb825300cea6601f12a4c3d2f3918807b27403" + integrity sha512-sHg0F05oTMJzM592MWU8irsPx8LIFMKSCnEkcp6vp/gnj+oJ9GJEBW9hl8jUqy2L6Q2uUxFzPgvoExLbfuSODA== dependencies: "@types/estree" "0.0.39" "@types/node" "^12.0.2" @@ -3716,6 +3830,15 @@ shebang-regex@^1.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= +shelljs@^0.8.2: + version "0.8.3" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.3.tgz#a7f3319520ebf09ee81275b2368adb286659b097" + integrity sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A== + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -3808,6 +3931,11 @@ source-map@^0.5.6: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= +source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" @@ -4240,6 +4368,44 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= +typedoc-default-themes@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.5.0.tgz#6dc2433e78ed8bea8e887a3acde2f31785bd6227" + integrity sha1-bcJDPnjti+qOiHo6zeLzF4W9Yic= + +typedoc-plugin-sourcefile-url@1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/typedoc-plugin-sourcefile-url/-/typedoc-plugin-sourcefile-url-1.0.4.tgz#a4054b834414eb62434dbe809eb689682b486002" + integrity sha512-vydiILnDDyOcmeLrOiigYchOuy/1SJm8dG2nznTizNPxv17HUVdLVLLscki1wleQQPc+Yd+PzNCjreXiAdL4ug== + +typedoc@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.14.2.tgz#769f457f4f9e4bdb8b5f3b177c86b6a31d8c3dc3" + integrity sha512-aEbgJXV8/KqaVhcedT7xG6d2r+mOvB5ep3eIz1KuB5sc4fDYXcepEEMdU7XSqLFO5hVPu0nllHi1QxX2h/QlpQ== + dependencies: + "@types/fs-extra" "^5.0.3" + "@types/handlebars" "^4.0.38" + "@types/highlight.js" "^9.12.3" + "@types/lodash" "^4.14.110" + "@types/marked" "^0.4.0" + "@types/minimatch" "3.0.3" + "@types/shelljs" "^0.8.0" + fs-extra "^7.0.0" + handlebars "^4.0.6" + highlight.js "^9.13.1" + lodash "^4.17.10" + marked "^0.4.0" + minimatch "^3.0.0" + progress "^2.0.0" + shelljs "^0.8.2" + typedoc-default-themes "^0.5.0" + typescript "3.2.x" + +typescript@3.2.x: + version "3.2.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.4.tgz#c585cb952912263d915b462726ce244ba510ef3d" + integrity sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg== + typescript@3.4.3: version "3.4.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.3.tgz#0eb320e4ace9b10eadf5bc6103286b0f8b7c224f" @@ -4250,6 +4416,14 @@ typical@^2.6.0, typical@^2.6.1: resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.1.tgz#5c080e5d661cbbe38259d2e70a3c7253e873881d" integrity sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0= +uglify-js@^3.1.4: + version "3.5.15" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.15.tgz#fe2b5378fd0b09e116864041437bff889105ce24" + integrity sha512-fe7aYFotptIddkwcm6YuA0HmknBZ52ZzOsUxZEdhhkSsz7RfjHDX2QDxwKTiv4JQ5t5NhfmpgAK+J7LiDhKSqg== + dependencies: + commander "~2.20.0" + source-map "~0.6.1" + ulog@2.0.0-beta.6: version "2.0.0-beta.6" resolved "https://registry.yarnpkg.com/ulog/-/ulog-2.0.0-beta.6.tgz#e8410635ba1f6eddc164ddf221cdc4355d10c95e" @@ -4647,6 +4821,11 @@ wide-align@1.1.3: dependencies: string-width "^1.0.2 || 2" +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"