@ex-master/core
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -6,5 +6,4 @@ /// <reference types="node" /> | ||
import { Dashboard } from './dashboard'; | ||
import { AccountBalance, Market, MarketPrecision } from './types'; | ||
import { AccountBalance, Market, MarketPrecision, Order, OrderType } from './types'; | ||
import { PrecisionAlignment } from './util'; | ||
export declare type SpotOrderType = 'bid' | 'ask'; | ||
export interface SpotMarketData { | ||
@@ -28,6 +27,2 @@ market: Market; | ||
} | ||
export interface SpotOrderPaidFee { | ||
key: string; | ||
size: Decimal; | ||
} | ||
export interface SpotOrderOptions { | ||
@@ -39,17 +34,3 @@ cid?: string; | ||
} | ||
export interface SpotOrder { | ||
id: string; | ||
cid?: string; | ||
market: Market; | ||
type: SpotOrderType; | ||
price: Decimal; | ||
size: Decimal; | ||
value: Decimal; | ||
filledSize: Decimal; | ||
filledValue: Decimal; | ||
paidFee: SpotOrderPaidFee | undefined; | ||
active: boolean; | ||
aggressor?: boolean; | ||
createAt: number; | ||
updateAt: number; | ||
export interface SpotOrder extends Order { | ||
} | ||
@@ -78,3 +59,3 @@ export declare type SpotBalanceChangeType = 'order-place' | 'order-match' | 'order-cancel' | 'order-refund' | 'order-fee-deduct' | 'transfer' | 'other'; | ||
abstract getMarkets(): Promise<SpotMarketData[]>; | ||
abstract order(market: Market, type: SpotOrderType, price: Decimal, size: Decimal, options?: SpotOrderOptions): Promise<SpotOrder | undefined>; | ||
abstract order(market: Market, type: OrderType, price: Decimal, size: Decimal, options?: SpotOrderOptions): Promise<SpotOrder | undefined>; | ||
abstract getOrder(order: SpotOrderQuery): Promise<SpotOrder>; | ||
@@ -81,0 +62,0 @@ abstract getOrders(orders: SpotOrderQuery[]): Promise<SpotOrder[]>; |
@@ -54,1 +54,21 @@ import { Decimal } from 'decimal.js'; | ||
export declare type OrderType = 'bid' | 'ask'; | ||
export interface OrderPaidFee { | ||
key: string; | ||
size: Decimal; | ||
} | ||
export interface Order { | ||
id: string; | ||
cid?: string; | ||
market: Market; | ||
type: OrderType; | ||
price: Decimal; | ||
value: Decimal; | ||
size: Decimal; | ||
filledSize: Decimal; | ||
filledValue: Decimal; | ||
paidFee: OrderPaidFee | undefined; | ||
aggressor: boolean; | ||
active: boolean; | ||
createAt: number; | ||
updateAt: number; | ||
} |
{ | ||
"name": "@ex-master/core", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"main": "bld/library/index.js", | ||
@@ -25,3 +25,3 @@ "types": "bld/library/index.d.ts", | ||
}, | ||
"gitHead": "e96de064eda97e0bbd105f97a7ad83d8f057389a" | ||
"gitHead": "8b399fba3380b4da726aeb621821b022ff888a07" | ||
} |
import {EventEmitter} from 'events'; | ||
import Decimal from 'decimal.js'; | ||
import {Observable, Subject, Subscription} from 'rxjs'; | ||
import {Subject, Subscription} from 'rxjs'; | ||
import {Dashboard, defaultDashboard} from './dashboard'; | ||
import {AccountBalance, Market, MarketPrecision} from './types'; | ||
import {AccountBalance, Market, MarketPrecision, Order, OrderType} from './types'; | ||
import {PrecisionAlignment, ensurePrecision} from './util'; | ||
export type SpotOrderType = 'bid' | 'ask'; | ||
export interface SpotMarketData { | ||
@@ -33,6 +31,2 @@ market: Market; | ||
export interface SpotOrderPaidFee { | ||
key: string; | ||
size: Decimal; | ||
} | ||
@@ -46,17 +40,3 @@ export interface SpotOrderOptions { | ||
export interface SpotOrder { | ||
id: string; | ||
cid?: string; | ||
market: Market; | ||
type: SpotOrderType; | ||
price: Decimal; | ||
size: Decimal; | ||
value: Decimal; | ||
filledSize: Decimal; | ||
filledValue: Decimal; | ||
paidFee: SpotOrderPaidFee | undefined; | ||
active: boolean; | ||
aggressor?: boolean; | ||
createAt: number; | ||
updateAt: number; | ||
export interface SpotOrder extends Order { | ||
} | ||
@@ -112,3 +92,3 @@ | ||
market: Market, | ||
type: SpotOrderType, | ||
type: OrderType, | ||
price: Decimal, | ||
@@ -115,0 +95,0 @@ size: Decimal, |
@@ -78,1 +78,23 @@ import {Decimal} from 'decimal.js'; | ||
export type OrderType = 'bid' | 'ask'; | ||
export interface OrderPaidFee { | ||
key: string; | ||
size: Decimal; | ||
} | ||
export interface Order { | ||
id: string; | ||
cid?: string; | ||
market: Market; | ||
type: OrderType; | ||
price: Decimal; | ||
value: Decimal; | ||
size: Decimal; | ||
filledSize: Decimal; | ||
filledValue: Decimal; | ||
paidFee: OrderPaidFee | undefined; | ||
aggressor: boolean; | ||
active: boolean; | ||
createAt: number; | ||
updateAt: number; | ||
} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
775
0
32248