coinrayjs 2.0.17 → 2.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/coinrayjs.es.js +12289 -13344
- package/dist/coinrayjs.es.js.map +1 -1
- package/dist/coinrayjs.js +32 -49
- package/dist/coinrayjs.js.map +1 -1
- package/dist/types/coinray-cache.d.ts +90 -0
- package/dist/types/coinray-cache.d.ts.map +1 -0
- package/dist/types/coinray.d.ts +197 -0
- package/dist/types/coinray.d.ts.map +1 -0
- package/dist/types/crypto.d.ts +2 -0
- package/dist/types/crypto.d.ts.map +1 -0
- package/dist/types/current-market.d.ts +61 -0
- package/dist/types/current-market.d.ts.map +1 -0
- package/dist/types/errors.d.ts +26 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/event-emitter.d.ts +10 -0
- package/dist/types/event-emitter.d.ts.map +1 -0
- package/dist/types/exchange.d.ts +63 -0
- package/dist/types/exchange.d.ts.map +1 -0
- package/dist/types/i18n/locales.d.ts +22 -0
- package/dist/types/i18n/locales.d.ts.map +1 -0
- package/dist/types/i18n.d.ts +5 -0
- package/dist/types/i18n.d.ts.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lru.d.ts +27 -0
- package/dist/types/lru.d.ts.map +1 -0
- package/dist/types/market.d.ts +82 -0
- package/dist/types/market.d.ts.map +1 -0
- package/dist/types/orders/base.d.ts +30 -0
- package/dist/types/orders/base.d.ts.map +1 -0
- package/dist/types/orders/index.d.ts +7 -0
- package/dist/types/orders/index.d.ts.map +1 -0
- package/dist/types/orders/limit-ladder.d.ts +88 -0
- package/dist/types/orders/limit-ladder.d.ts.map +1 -0
- package/dist/types/orders/limit.d.ts +48 -0
- package/dist/types/orders/limit.d.ts.map +1 -0
- package/dist/types/orders/market.d.ts +38 -0
- package/dist/types/orders/market.d.ts.map +1 -0
- package/dist/types/orders/oco.d.ts +55 -0
- package/dist/types/orders/oco.d.ts.map +1 -0
- package/dist/types/orders/stop-limit.d.ts +43 -0
- package/dist/types/orders/stop-limit.d.ts.map +1 -0
- package/dist/types/orders/validate.d.ts +3 -0
- package/dist/types/orders/validate.d.ts.map +1 -0
- package/dist/types/ticker-subscriptions.d.ts +14 -0
- package/dist/types/ticker-subscriptions.d.ts.map +1 -0
- package/dist/types/types.d.ts +257 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/util.d.ts +49 -0
- package/dist/types/util.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import BigNumber from "bignumber.js";
|
|
2
|
+
import Coinray from "./coinray";
|
|
3
|
+
import Exchange from "./exchange";
|
|
4
|
+
import { FuturesSettings, OrderType, Ticker, TickerSnapshot, TradingSession } from "./types";
|
|
5
|
+
import EventEmitter from "./event-emitter";
|
|
6
|
+
export default class Market extends EventEmitter {
|
|
7
|
+
getExchange: () => Exchange;
|
|
8
|
+
readonly api: Coinray;
|
|
9
|
+
id: number;
|
|
10
|
+
coinraySymbol: string;
|
|
11
|
+
symbol: string;
|
|
12
|
+
symbolAlt: string;
|
|
13
|
+
quoteCurrency: string;
|
|
14
|
+
underlyingQuoteCurrency: string;
|
|
15
|
+
baseLogoUrl: string;
|
|
16
|
+
baseCurrency: string;
|
|
17
|
+
exchangeCode: string;
|
|
18
|
+
volume: BigNumber;
|
|
19
|
+
quoteVolume: BigNumber;
|
|
20
|
+
btcVolume: BigNumber;
|
|
21
|
+
usdVolume: BigNumber;
|
|
22
|
+
websocket: boolean;
|
|
23
|
+
openPrice: BigNumber;
|
|
24
|
+
highPrice: BigNumber;
|
|
25
|
+
lowPrice: BigNumber;
|
|
26
|
+
precisionBase: number;
|
|
27
|
+
precisionQuote: number;
|
|
28
|
+
precisionPrice: number;
|
|
29
|
+
minBase: number;
|
|
30
|
+
maxBase: BigNumber;
|
|
31
|
+
maxBaseMarket: BigNumber;
|
|
32
|
+
minQuote: number;
|
|
33
|
+
maxQuote: BigNumber;
|
|
34
|
+
minTrade?: BigNumber;
|
|
35
|
+
maxTrade?: BigNumber;
|
|
36
|
+
makerFee: number;
|
|
37
|
+
takerFee: number;
|
|
38
|
+
change: number;
|
|
39
|
+
delistedOn: string;
|
|
40
|
+
exchangeUrl: string;
|
|
41
|
+
baseToUsd: BigNumber;
|
|
42
|
+
quoteToUsd: BigNumber;
|
|
43
|
+
status: string;
|
|
44
|
+
note: string;
|
|
45
|
+
private _supportedOrderTypes;
|
|
46
|
+
_lastPrice?: BigNumber;
|
|
47
|
+
_askPrice: BigNumber;
|
|
48
|
+
_bidPrice: BigNumber;
|
|
49
|
+
updatedAt: string;
|
|
50
|
+
futuresSettings?: FuturesSettings;
|
|
51
|
+
symbolTv?: string;
|
|
52
|
+
tradingSessions?: TradingSession[] | null;
|
|
53
|
+
syntheticTrades: boolean;
|
|
54
|
+
marketCap: BigNumber;
|
|
55
|
+
private _groupName?;
|
|
56
|
+
getPriceOverrides: any;
|
|
57
|
+
static Create(d: any, api: Coinray, exchange: Exchange): Market;
|
|
58
|
+
static checkStatic(d: any): void;
|
|
59
|
+
private static checkDynamic;
|
|
60
|
+
constructor(d: any, api: Coinray, exchange: Exchange);
|
|
61
|
+
assignStatic: (d: any) => void;
|
|
62
|
+
private _assignStatic;
|
|
63
|
+
get tradingDisabled(): boolean;
|
|
64
|
+
get tradingEnabled(): boolean;
|
|
65
|
+
get quoteLogoUrl(): string;
|
|
66
|
+
get supportedOrderTypes(): OrderType[];
|
|
67
|
+
get isFutures(): boolean;
|
|
68
|
+
get groupName(): string | undefined;
|
|
69
|
+
get fullDisplayName(): string;
|
|
70
|
+
get displayName(): string;
|
|
71
|
+
get priceOverrides(): any;
|
|
72
|
+
get lastPrice(): any;
|
|
73
|
+
get askPrice(): any;
|
|
74
|
+
get bidPrice(): any;
|
|
75
|
+
overridePrices: (getPriceOverrides: any) => void;
|
|
76
|
+
updateLastPrice: (lastPrice: BigNumber) => void;
|
|
77
|
+
updateBidAsk: (bidPrice: BigNumber, askPrice: BigNumber) => void;
|
|
78
|
+
updateTicker: (ticker: Ticker) => void;
|
|
79
|
+
applySnapshot: (t: TickerSnapshot, live?: boolean) => void;
|
|
80
|
+
clone(): Market;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=market.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"market.d.ts","sourceRoot":"","sources":["../../lib/market.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,cAAc,CAAC;AAarC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAC,eAAe,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAC,MAAM,SAAS,CAAC;AAC3F,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,YAAY;IACvC,WAAW,EAAE,MAAM,QAAQ,CAAA;IAClC,SAAgB,GAAG,EAAE,OAAO,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB,EAAE,MAAM,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,SAAS,CAAC;IAClB,WAAW,EAAE,SAAS,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;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AQ,EAoBnD;IAGD,YAAY,MAAO,GAAG,UAGrB;IAED,OAAO,CAAC,aAAa;IA8CrB,IAAI,eAAe,YAElB;IAED,IAAI,cAAc,YAEjB;IAED,IAAI,YAAY,WAEf;IAED,IAAI,mBAAmB,gBAMtB;IAED,IAAI,SAAS,YAEZ;IAED,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAElC;IAED,IAAI,eAAe,WAElB;IAED,IAAI,WAAW,WAEd;IAED,IAAI,cAAc,QAEjB;IAED,IAAI,SAAS,QAEZ;IAED,IAAI,QAAQ,QAEX;IAED,IAAI,QAAQ,QAEX;IAED,cAAc,sBAAuB,GAAG,UAEvC;IAED,eAAe,cAAe,SAAS,UAItC;IAED,YAAY,aAAc,SAAS,YAAY,SAAS,UAKvD;IAED,YAAY,WAAY,MAAM,UAY7B;IAID,aAAa,MAAO,cAAc,0BAkBjC;IAED,KAAK,IAAI,MAAM,CAiCd;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BalanceLimit, BaseOrderParams, MarketBalance, OrderSide, TimeInForce } from "../types";
|
|
2
|
+
import BigNumber from "bignumber.js";
|
|
3
|
+
export default abstract class BaseOrder {
|
|
4
|
+
id: string;
|
|
5
|
+
coinraySymbol: string;
|
|
6
|
+
precisionBase: number;
|
|
7
|
+
precisionQuote: number;
|
|
8
|
+
precisionPrice: number;
|
|
9
|
+
minBase: BigNumber;
|
|
10
|
+
minQuote: BigNumber;
|
|
11
|
+
makerFee: BigNumber;
|
|
12
|
+
takerFee: BigNumber;
|
|
13
|
+
balances: MarketBalance;
|
|
14
|
+
balanceLimit: BalanceLimit;
|
|
15
|
+
side: OrderSide;
|
|
16
|
+
errors: any;
|
|
17
|
+
isValid: boolean;
|
|
18
|
+
orderExternalId?: string;
|
|
19
|
+
reduceOnly?: boolean;
|
|
20
|
+
postOnly?: boolean;
|
|
21
|
+
timeInForce?: TimeInForce;
|
|
22
|
+
constructor(params: BaseOrderParams);
|
|
23
|
+
abstract constraints(): object;
|
|
24
|
+
abstract getOrders(): Array<BaseOrder>;
|
|
25
|
+
startEdit(orderExternalId: string): void;
|
|
26
|
+
updateLockedOn(_lockedOn: string): void;
|
|
27
|
+
resetError(): void;
|
|
28
|
+
validate(): boolean;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../lib/orders/base.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC;AAC9F,OAAO,SAAS,MAAM,cAAc,CAAC;AAIrC,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,SAAS;IACrC,EAAE,SAAY;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,aAAa,CAAC;IACxB,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,GAAG,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B,YAAY,MAAM,EAAE,eAAe,EAkBlC;IAED,QAAQ,CAAC,WAAW,IAAI,MAAM,CAAA;IAE9B,QAAQ,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,CAAA;IAEtC,SAAS,CAAC,eAAe,EAAE,MAAM,QAEhC;IAED,cAAc,CAAC,SAAS,EAAE,MAAM,QAC/B;IAED,UAAU,SAGT;IAED,QAAQ,IAAI,OAAO,CAUlB;CACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import LimitOrder from "./limit";
|
|
2
|
+
import MarketOrder from "./market";
|
|
3
|
+
import LimitLadderOrder from "./limit-ladder";
|
|
4
|
+
import StopLimitOrder from "./stop-limit";
|
|
5
|
+
import OcoOrder from "./oco";
|
|
6
|
+
export { LimitOrder, LimitLadderOrder, MarketOrder, StopLimitOrder, OcoOrder };
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/orders/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,SAAS,CAAC;AACjC,OAAO,WAAW,MAAM,UAAU,CAAC;AACnC,OAAO,gBAAgB,MAAM,gBAAgB,CAAC;AAC9C,OAAO,cAAc,MAAM,cAAc,CAAC;AAC1C,OAAO,QAAQ,MAAM,OAAO,CAAC;AAE7B,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAC,CAAA"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { BalanceLimit, OrderType } from "../types";
|
|
2
|
+
import BigNumber from "bignumber.js";
|
|
3
|
+
import LimitOrder, { LimitOrderParams } from "./limit";
|
|
4
|
+
import BaseOrder from "./base";
|
|
5
|
+
export declare enum PriceScales {
|
|
6
|
+
LINEAR = "LINEAR",
|
|
7
|
+
EXPONENTIAL = "EXPONENTIAL",
|
|
8
|
+
FIBONACCI = "FIBONACCI",
|
|
9
|
+
CUSTOM = "CUSTOM"
|
|
10
|
+
}
|
|
11
|
+
export declare enum SizeScales {
|
|
12
|
+
EQUAL = "EQUAL",
|
|
13
|
+
LINEAR = "LINEAR",
|
|
14
|
+
LINEAR_REVERSE = "LINEAR_REVERSE",
|
|
15
|
+
EXPONENTIAL = "EXPONENTIAL",
|
|
16
|
+
EXPONENTIAL_REVERSE = "EXPONENTIAL_REVERSE",
|
|
17
|
+
CUSTOM = "CUSTOM"
|
|
18
|
+
}
|
|
19
|
+
interface LimitLadderOrderParams extends LimitOrderParams {
|
|
20
|
+
otherPrice: BigNumber;
|
|
21
|
+
numOrders: number;
|
|
22
|
+
priceScale?: PriceScales;
|
|
23
|
+
sizeScale?: SizeScales;
|
|
24
|
+
priceScales?: Array<number>;
|
|
25
|
+
sizeScales?: Array<number>;
|
|
26
|
+
}
|
|
27
|
+
export default class LimitLadderOrder extends BaseOrder {
|
|
28
|
+
baseAmount: BigNumber;
|
|
29
|
+
quoteAmount: BigNumber;
|
|
30
|
+
price: BigNumber;
|
|
31
|
+
lockedOn: string;
|
|
32
|
+
otherPrice: BigNumber;
|
|
33
|
+
numOrders: number;
|
|
34
|
+
priceScale: PriceScales;
|
|
35
|
+
sizeScale: SizeScales;
|
|
36
|
+
priceScales: Array<number>;
|
|
37
|
+
sizeScales: Array<number>;
|
|
38
|
+
balanceLimit: BalanceLimit;
|
|
39
|
+
orderType: OrderType;
|
|
40
|
+
constraints(): {
|
|
41
|
+
baseAmount: {
|
|
42
|
+
bigNumericality: {
|
|
43
|
+
greaterThanOrEqualTo: number;
|
|
44
|
+
notGreaterThanOrEqualTo: string;
|
|
45
|
+
lessThanOrEqualTo: any;
|
|
46
|
+
notLessThanOrEqualTo: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
quoteAmount: {
|
|
50
|
+
bigNumericality: {
|
|
51
|
+
greaterThanOrEqualTo: number;
|
|
52
|
+
notGreaterThanOrEqualTo: string;
|
|
53
|
+
lessThanOrEqualTo: any;
|
|
54
|
+
notLessThanOrEqualTo: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
price: {
|
|
58
|
+
bigNumericality: {
|
|
59
|
+
greaterThan: number;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
otherPrice: {
|
|
63
|
+
bigNumericality: {
|
|
64
|
+
greaterThan: number;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
numOrders: {
|
|
68
|
+
numericality: {
|
|
69
|
+
greaterThanOrEqualTo: number;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
constructor(params: LimitLadderOrderParams);
|
|
74
|
+
updateNumOrders(numOrders: number): void;
|
|
75
|
+
updatePrice(price: BigNumber, priceOffset?: number): void;
|
|
76
|
+
updateOtherPrice(otherPrice: BigNumber, priceOffset?: number): void;
|
|
77
|
+
updatePriceScales(priceScales: Array<number>): void;
|
|
78
|
+
updatePriceScale(priceScale: PriceScales): void;
|
|
79
|
+
updateSizeScales(sizeScales: Array<number>): void;
|
|
80
|
+
updateSizeScale(sizeScale: SizeScales): void;
|
|
81
|
+
updateLockedOn(lockedOn: string): void;
|
|
82
|
+
recalculate(): void;
|
|
83
|
+
updateQuoteAmount(quoteAmount: BigNumber): void;
|
|
84
|
+
updateBaseAmount(baseAmount: BigNumber): void;
|
|
85
|
+
getOrders(lockedOn?: string): Array<LimitOrder>;
|
|
86
|
+
}
|
|
87
|
+
export {};
|
|
88
|
+
//# sourceMappingURL=limit-ladder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limit-ladder.d.ts","sourceRoot":"","sources":["../../../lib/orders/limit-ladder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAa,SAAS,EAAC,MAAM,UAAU,CAAC;AAC5D,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,UAAU,EAAE,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAGrD,OAAO,SAAS,MAAM,QAAQ,CAAC;AAG/B,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB;AAED,oBAAY,UAAU;IACpB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QAEhC;IAED,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,SAAO,QAO/C;IAED,gBAAgB,CAAC,UAAU,EAAE,SAAS,EAAE,WAAW,SAAO,QAOzD;IAED,iBAAiB,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,QAI3C;IAED,gBAAgB,CAAC,UAAU,EAAE,WAAW,QAIvC;IAED,gBAAgB,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,QAIzC;IAED,eAAe,CAAC,SAAS,EAAE,UAAU,QAIpC;IAED,cAAc,CAAC,QAAQ,EAAE,MAAM,QAE9B;IAED,WAAW,SAOV;IAED,iBAAiB,CAAC,WAAW,EAAE,SAAS,QAYvC;IAED,gBAAgB,CAAC,UAAU,EAAE,SAAS,QAYrC;IAED,SAAS,CAAC,QAAQ,SAAgB,GAAG,KAAK,CAAC,UAAU,CAAC,CA6BrD;CACF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import BaseOrder from "./base";
|
|
2
|
+
import { BalanceLimit, BaseOrderParams, OrderType } from "../types";
|
|
3
|
+
import BigNumber from "bignumber.js";
|
|
4
|
+
export interface LimitOrderParams extends BaseOrderParams {
|
|
5
|
+
baseAmount: BigNumber;
|
|
6
|
+
quoteAmount: BigNumber;
|
|
7
|
+
price: BigNumber;
|
|
8
|
+
lockedOn: string;
|
|
9
|
+
}
|
|
10
|
+
export default class LimitOrder extends BaseOrder {
|
|
11
|
+
baseAmount: BigNumber;
|
|
12
|
+
quoteAmount: BigNumber;
|
|
13
|
+
price: BigNumber;
|
|
14
|
+
lockedOn: string;
|
|
15
|
+
balanceLimit: BalanceLimit;
|
|
16
|
+
orderType: OrderType;
|
|
17
|
+
constraints(): {
|
|
18
|
+
baseAmount: {
|
|
19
|
+
bigNumericality: {
|
|
20
|
+
greaterThanOrEqualTo: number;
|
|
21
|
+
notGreaterThanOrEqualTo: string;
|
|
22
|
+
lessThanOrEqualTo: any;
|
|
23
|
+
notLessThanOrEqualTo: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
quoteAmount: {
|
|
27
|
+
bigNumericality: {
|
|
28
|
+
greaterThanOrEqualTo: number;
|
|
29
|
+
notGreaterThanOrEqualTo: string;
|
|
30
|
+
lessThanOrEqualTo: any;
|
|
31
|
+
notLessThanOrEqualTo: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
price: {
|
|
35
|
+
bigNumericality: {
|
|
36
|
+
greaterThan: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
constructor(params: LimitOrderParams, updateAmounts?: boolean);
|
|
41
|
+
updateBaseAmount(baseAmount: BigNumber): void;
|
|
42
|
+
updateQuoteAmount(quoteAmount: BigNumber): void;
|
|
43
|
+
updateLockedOn(lockedOn: string): void;
|
|
44
|
+
quoteFee(): BigNumber;
|
|
45
|
+
updatePrice(price: BigNumber): void;
|
|
46
|
+
getOrders(): Array<BaseOrder>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=limit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limit.d.ts","sourceRoot":"","sources":["../../../lib/orders/limit.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAC,YAAY,EAAE,eAAe,EAAE,SAAS,EAAC,MAAM,UAAU,CAAC;AAClE,OAAO,SAAS,MAAM,cAAc,CAAC;AAIrC,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,UAAU,EAAE,SAAS,CAAA;IACrB,WAAW,EAAE,SAAS,CAAA;IACtB,KAAK,EAAE,SAAS,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,SAAS;IAC/C,UAAU,EAAE,SAAS,CAAC;IACtB,WAAW,EAAE,SAAS,CAAC;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACT,YAAY,EAAE,YAAY,CAAC;IAEnC,SAAS,YAAmB;IAE5B,WAAW;QAUP,UAAU;YACR,eAAe;gBACb,oBAAoB;gBACpB,uBAAuB;gBACvB,iBAAiB;gBACjB,oBAAoB;;;QAGxB,WAAW;YACT,eAAe;gBACb,oBAAoB;gBACpB,uBAAuB;gBACvB,iBAAiB;gBACjB,oBAAoB;;;QAGxB,KAAK;YACH,eAAe;gBACb,WAAW;;;MAIlB;IAED,YAAY,MAAM,EAAE,gBAAgB,EAAE,aAAa,UAAO,EAczD;IAED,gBAAgB,CAAC,UAAU,EAAE,SAAS,QAIrC;IAED,iBAAiB,CAAC,WAAW,EAAE,SAAS,QAIvC;IAED,cAAc,CAAC,QAAQ,EAAE,MAAM,QAG9B;IAED,QAAQ,cAEP;IAED,WAAW,CAAC,KAAK,EAAE,SAAS,QAQ3B;IAED,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,CAE5B;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import BaseOrder from "./base";
|
|
2
|
+
import { BaseOrderParams, OrderType } from "../types";
|
|
3
|
+
import BigNumber from "bignumber.js";
|
|
4
|
+
interface MarketOrderParams extends BaseOrderParams {
|
|
5
|
+
quoteAmount?: BigNumber;
|
|
6
|
+
baseAmount?: BigNumber;
|
|
7
|
+
}
|
|
8
|
+
export default class MarketOrder extends BaseOrder {
|
|
9
|
+
baseAmount?: BigNumber;
|
|
10
|
+
quoteAmount?: BigNumber;
|
|
11
|
+
price: BigNumber;
|
|
12
|
+
orderType: OrderType;
|
|
13
|
+
constraints: () => {
|
|
14
|
+
baseAmount: {
|
|
15
|
+
bigNumericality: {
|
|
16
|
+
greaterThanOrEqualTo: number;
|
|
17
|
+
notGreaterThanOrEqualTo: string;
|
|
18
|
+
lessThanOrEqualTo: any;
|
|
19
|
+
notLessThanOrEqualTo: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
quoteAmount: {
|
|
23
|
+
bigNumericality: {
|
|
24
|
+
greaterThanOrEqualTo: number;
|
|
25
|
+
notGreaterThanOrEqualTo: string;
|
|
26
|
+
lessThanOrEqualTo: any;
|
|
27
|
+
notLessThanOrEqualTo: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
constructor(params: MarketOrderParams);
|
|
32
|
+
updateBaseAmount(baseAmount: BigNumber): void;
|
|
33
|
+
updateQuoteAmount(quoteAmount: BigNumber): void;
|
|
34
|
+
updatePrice(price: BigNumber): void;
|
|
35
|
+
getOrders(): Array<BaseOrder>;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=market.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"market.d.ts","sourceRoot":"","sources":["../../../lib/orders/market.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAe,eAAe,EAAE,SAAS,EAAC,MAAM,UAAU,CAAC;AAClE,OAAO,SAAS,MAAM,cAAc,CAAC;AAKrC,UAAU,iBAAkB,SAAQ,eAAe;IACjD,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,SAAS;IAChD,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,YAAoB;IAE7B,WAAW;QAUP,UAAU;YACR,eAAe;gBACb,oBAAoB;gBACpB,uBAAuB;gBACvB,iBAAiB;gBACjB,oBAAoB;;;QAGxB,WAAW;YACT,eAAe;gBACb,oBAAoB;gBACpB,uBAAuB;gBACvB,iBAAiB;gBACjB,oBAAoB;;;MAI1B;IAEF,YAAY,MAAM,EAAE,iBAAiB,EAIpC;IAED,gBAAgB,CAAC,UAAU,EAAE,SAAS,QAIrC;IAED,iBAAiB,CAAC,WAAW,EAAE,SAAS,QAIvC;IAED,WAAW,CAAC,KAAK,EAAE,SAAS,QAE3B;IAED,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,CAE5B;CACF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { OrderType } from "../types";
|
|
2
|
+
import BigNumber from "bignumber.js";
|
|
3
|
+
import LimitOrder, { LimitOrderParams } from "./limit";
|
|
4
|
+
interface OcoOrderParams extends LimitOrderParams {
|
|
5
|
+
linkedOrderId: string;
|
|
6
|
+
otherPrice: BigNumber;
|
|
7
|
+
stopPrice: BigNumber;
|
|
8
|
+
}
|
|
9
|
+
export default class OcoOrder extends LimitOrder {
|
|
10
|
+
linkedOrderId: string;
|
|
11
|
+
otherPrice: BigNumber;
|
|
12
|
+
stopPrice: BigNumber;
|
|
13
|
+
orderType: OrderType;
|
|
14
|
+
constraints(): {
|
|
15
|
+
baseAmount: {
|
|
16
|
+
bigNumericality: {
|
|
17
|
+
greaterThanOrEqualTo: number;
|
|
18
|
+
notGreaterThanOrEqualTo: string;
|
|
19
|
+
lessThanOrEqualTo: any;
|
|
20
|
+
notLessThanOrEqualTo: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
quoteAmount: {
|
|
24
|
+
bigNumericality: {
|
|
25
|
+
greaterThanOrEqualTo: number;
|
|
26
|
+
notGreaterThanOrEqualTo: string;
|
|
27
|
+
lessThanOrEqualTo: any;
|
|
28
|
+
notLessThanOrEqualTo: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
price: {
|
|
32
|
+
bigNumericality: {
|
|
33
|
+
greaterThan: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
otherPrice: {
|
|
37
|
+
bigNumericality: {
|
|
38
|
+
greaterThan: number;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
stopPrice: {
|
|
42
|
+
bigNumericality: {
|
|
43
|
+
greaterThan: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
constructor(params: OcoOrderParams);
|
|
48
|
+
updateQuoteAmount(quoteAmount: BigNumber): void;
|
|
49
|
+
updateBaseAmount(baseAmount: BigNumber): void;
|
|
50
|
+
updatePrice(price: BigNumber, priceOffset?: number): void;
|
|
51
|
+
updateOtherPrice(otherPrice: BigNumber, priceOffset?: number): void;
|
|
52
|
+
updateStopPrice(stopPrice: BigNumber, priceOffset?: number): void;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=oco.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oco.d.ts","sourceRoot":"","sources":["../../../lib/orders/oco.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,SAAS,EAAC,MAAM,UAAU,CAAC;AAC9C,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,UAAU,EAAE,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAGrD,UAAU,cAAe,SAAQ,gBAAgB;IAC/C,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,SAAS,CAAC;IACtB,SAAS,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,UAAU;IAC9C,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,SAAS,CAAC;IACtB,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,YAAiB;IAE1B,WAAW;;;;;;;;;;;;;;;;;;;;;;;YAKL,eAAe;gBACb,WAAW;;;;YAIb,eAAe;gBACb,WAAW;;;MAIlB;IAED,YAAY,MAAM,EAAE,cAAc,EAUjC;IAED,iBAAiB,CAAC,WAAW,EAAE,SAAS,QAKvC;IAED,gBAAgB,CAAC,UAAU,EAAE,SAAS,QAKrC;IAED,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,SAAO,QAS/C;IAED,gBAAgB,CAAC,UAAU,EAAE,SAAS,EAAE,WAAW,SAAO,QASzD;IAED,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,SAAO,QASvD;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { OrderType } from "../types";
|
|
2
|
+
import BigNumber from "bignumber.js";
|
|
3
|
+
import LimitOrder, { LimitOrderParams } from "./limit";
|
|
4
|
+
interface StopLimitOrderParams extends LimitOrderParams {
|
|
5
|
+
stopPrice: BigNumber;
|
|
6
|
+
}
|
|
7
|
+
export default class StopLimitOrder extends LimitOrder {
|
|
8
|
+
stopPrice: BigNumber;
|
|
9
|
+
orderType: OrderType;
|
|
10
|
+
constraints(): {
|
|
11
|
+
baseAmount: {
|
|
12
|
+
bigNumericality: {
|
|
13
|
+
greaterThanOrEqualTo: number;
|
|
14
|
+
notGreaterThanOrEqualTo: string;
|
|
15
|
+
lessThanOrEqualTo: any;
|
|
16
|
+
notLessThanOrEqualTo: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
quoteAmount: {
|
|
20
|
+
bigNumericality: {
|
|
21
|
+
greaterThanOrEqualTo: number;
|
|
22
|
+
notGreaterThanOrEqualTo: string;
|
|
23
|
+
lessThanOrEqualTo: any;
|
|
24
|
+
notLessThanOrEqualTo: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
price: {
|
|
28
|
+
bigNumericality: {
|
|
29
|
+
greaterThan: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
stopPrice: {
|
|
33
|
+
bigNumericality: {
|
|
34
|
+
greaterThan: number;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
constructor(params: StopLimitOrderParams);
|
|
39
|
+
updatePrice(price: BigNumber, priceOffset?: number): void;
|
|
40
|
+
updateStopPrice(stopPrice: BigNumber, priceOffset?: number): void;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=stop-limit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stop-limit.d.ts","sourceRoot":"","sources":["../../../lib/orders/stop-limit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,SAAS,EAAC,MAAM,UAAU,CAAC;AAC9C,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,UAAU,EAAE,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAGrD,UAAU,oBAAqB,SAAQ,gBAAgB;IACrD,SAAS,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU;IACpD,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,YAA6B;IAEtC,WAAW;;;;;;;;;;;;;;;;;;;;;;;YAKL,eAAe;gBACb,WAAW;;;MAIlB;IAED,YAAY,MAAM,EAAE,oBAAoB,EAGvC;IAED,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,SAAO,QAO/C;IAED,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,SAAO,QAMvD;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../lib/orders/validate.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,aAAa,CAAC;eAMpB,QAAQ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare class TickerSubscriptions {
|
|
2
|
+
subscriptions: Map<string, Set<string>>;
|
|
3
|
+
pendingAdditions: Map<string, Set<string>>;
|
|
4
|
+
pendingRemovals: Map<string, Set<string>>;
|
|
5
|
+
constructor();
|
|
6
|
+
has(ticker: string): boolean;
|
|
7
|
+
subscribe(listenerId: string, tickers: string[], reset?: boolean): void;
|
|
8
|
+
unsubscribe(listenerId: string, tickers: string[]): void;
|
|
9
|
+
unsubscribeAll(listenerId: string): void;
|
|
10
|
+
exchangeCodes(): Set<string>;
|
|
11
|
+
processPendingChanges(): void;
|
|
12
|
+
}
|
|
13
|
+
export default TickerSubscriptions;
|
|
14
|
+
//# sourceMappingURL=ticker-subscriptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticker-subscriptions.d.ts","sourceRoot":"","sources":["../../lib/ticker-subscriptions.ts"],"names":[],"mappings":"AAAA,cAAM,mBAAmB;IAChB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IACxC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAEjD,cAIC;IAED,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAG3B;IAED,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,GAAE,OAAe,QAkBtE;IAED,WAAW,CAAC,UAAU,EAAE,MAAM,EAAG,OAAO,EAAE,MAAM,EAAE,QAcjD;IAED,cAAc,CAAC,UAAU,EAAE,MAAM,QAgBhC;IAGD,aAAa,IAAI,GAAG,CAAC,MAAM,CAAC,CAM3B;IAED,qBAAqB,SA0BpB;CACF;eAEc,mBAAmB"}
|