mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-27 23:55:49 +00:00
Update dependencies (#1007)
* Update dependencies: @types/lodash@4.14.133, mocha-junit-reporter@1.22.0, tslint@5.17.0, nyc Fix type errors
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
FormattedOrderbookOrder
|
||||
} from './parse/orderbook-order'
|
||||
import {validate} from '../common'
|
||||
import {Amount, Issue} from '../common/types/objects'
|
||||
import {Issue} from '../common/types/objects'
|
||||
import {BookOffer} from '../common/types/commands'
|
||||
import {RippleAPI} from '..'
|
||||
import BigNumber from 'bignumber.js'
|
||||
@@ -15,7 +15,7 @@ export type FormattedOrderbook = {
|
||||
asks: FormattedOrderbookOrder[]
|
||||
}
|
||||
|
||||
function isSameIssue(a: Amount, b: Amount) {
|
||||
function isSameIssue(a: Issue, b: Issue) {
|
||||
return a.currency === b.currency && a.counterparty === b.counterparty
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ function flipOrder(order: FormattedOrderbookOrder) {
|
||||
return _.merge({}, order, {specification: newSpecification})
|
||||
}
|
||||
|
||||
function alignOrder(base: Amount, order: FormattedOrderbookOrder) {
|
||||
function alignOrder(base: Issue, order: FormattedOrderbookOrder): FormattedOrderbookOrder {
|
||||
const quantity = order.specification.quantity
|
||||
return isSameIssue(quantity, base) ? order : flipOrder(order)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user