Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f843b17
CLIENT-1819: add getRestrictions method
May 8, 2019
bd06c57
CLIENT-1819: add pairRestrictions
May 24, 2019
291da9a
CLIENT-1819: save
May 27, 2019
68c0473
CLIENT-1819: merge client-998
May 30, 2019
4591cc4
CLIENT-1819: save
May 31, 2019
4d6c6ed
CLIENT-1819: add max/min clickable hint
Jun 3, 2019
c2cabcb
CLIENT-1819: save
Jun 3, 2019
33aaab6
Merge branch 'dev' of github.com:wavesplatform/WavesGUI into client-1…
Jun 3, 2019
4e53ffa
CLIENT-1819: save
Jun 4, 2019
37e1b38
CLIENT-1819: refactor
Jun 5, 2019
2de972c
CLIENT-1819: fixes
Jun 5, 2019
010097a
Merge branch 'dev' into client-1819-add-tickSize-support-in-matcher
Jun 6, 2019
be0225c
CLIENT-1819: some fixes
Jun 6, 2019
8f61888
Merge branch 'dev' into client-1819-add-tickSize-support-in-matcher
Jun 17, 2019
1f733c3
CLIENT-1819: fix price and amount choosen from order book
Jun 17, 2019
5d57f42
CLIENT-1819: tickSize fixes
Jun 18, 2019
6f4cf2f
Merge branch 'dev' into client-1819-add-tickSize-support-in-matcher
Jun 18, 2019
4fc98cf
Merge branch 'dev' into client-1819-add-tickSize-support-in-matcher
Jun 19, 2019
34da897
CLIENT-1819: add round max amount
Jun 19, 2019
e29de70
CLIENT-1819: refactor
Jun 19, 2019
3bc0297
CLIENT-1819: review fix
Jun 20, 2019
e12d269
Merge remote-tracking branch 'origin/dev' into client-1819-add-tickSi…
Jun 25, 2019
5968f1a
CLIENT-1819: fix round function
Jul 3, 2019
c02c9ff
CLIENT-1819: merge dev
Sep 23, 2019
303cb4b
CLIENT-1819: change logic
Sep 23, 2019
c3d8bcb
CLIENT-1819: change logic
Sep 23, 2019
267fcaf
CLIENT-1819: update locales
Sep 23, 2019
34af40d
Merge branch 'master' into client-1819-add-tickSize-support-in-matcher
Oct 7, 2019
462f659
CLIENT-1819: fixes setting restrictions
Oct 7, 2019
58da0a8
DEXW-1823: add step round in orderbook
Oct 25, 2019
7238d37
DEXW-1823: save stepPrice round
Oct 28, 2019
20b4b5a
DEXW-1823: add matcherSettings in service
Oct 28, 2019
f0862ce
Merge branch 'dev' into dexw-1823-round-to-step-in-orderbook
Oct 28, 2019
c2c59d8
DEXW-1823: refactor
Oct 28, 2019
c1806ac
Merge branch 'dexw-1823-round-to-step-in-orderbook' into client-1819-…
Oct 28, 2019
58ce003
CLIENT-1819: merge dexw-1823, refactoring
Oct 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion data-service/api/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import * as matchersApi from './matchers/matchers'
import * as addressModule from './address';
import { getLastPrice } from './matcher/getLastPrice';
import { getPairRestrictions } from './matcher/getPairRestrictions';
import { getAddressByAlias, getAliasesByAddress, getAliasesByIdList } from './aliases/aliases';
import { getFeeRates, getSettings } from './matcher/getSettings';
import * as pairsModule from './pairs/pairs';
Expand All @@ -30,7 +31,7 @@ export const node = { height };

export const matcher = {
getOrderBook, getOrdersByPair, addSignature, clearSignature, getOrders, signatureTimeout, factory, getLastPrice,
getFeeRates, getSettings
getFeeRates, getSettings, getPairRestrictions
};

export const matchers = matchersApi;
Expand Down
9 changes: 9 additions & 0 deletions data-service/api/matcher/getPairRestrictions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { AssetPair } from '@waves/data-entities';
import { request } from '../../utils/request';
import { get } from '../../config';

export function getPairRestrictions(pair: AssetPair) {
return request({
url: `${get('matcher')}/orderbook/${pair.amountAsset.id}/${pair.priceAsset.id}/info`
});
}
2 changes: 1 addition & 1 deletion locale/it/app.dex.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,4 @@
"waves": "Waves"
}
}
}
}
2 changes: 1 addition & 1 deletion locale/it/app.utils.json
Original file line number Diff line number Diff line change
Expand Up @@ -985,4 +985,4 @@
"help": "Byte restanti: {{bytes}}"
}
}
}
}
2 changes: 1 addition & 1 deletion locale/zh_CN/app.dex.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,4 @@
"waves": "Waves"
}
}
}
}
34 changes: 34 additions & 0 deletions src/modules/app/services/waves/matcher/Matcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
*/
currentMatcherAddress = '';

/**
* @type {TPairRestrictions | null}
*/
pairRestrictions = null;

constructor() {
this._orderBookCacheHash = Object.create(null);

Expand Down Expand Up @@ -113,6 +118,19 @@
return ds.api.matcher.getLastPrice(pair);
}

/**
* @param {AssetPair} pair
* @return {Promise<TPairRestrictions>}
*/
@decorators.cachable(0.5)
getPairRestrictions(pair) {
return ds.api.matcher.getPairRestrictions(pair)
.then((restrictions) => {
this.pairRestrictions = restrictions;
return restrictions;
});
}

/**
* @param {string} address
* @return {Promise<IScriptInfo<Money>>}
Expand Down Expand Up @@ -456,3 +474,19 @@
* @typedef {object} Matcher#IFeeMap
* @property {number}
*/

/**
* @typedef {object} TPairRestrictions
* @param {TRestrictions} restrictions
* @param {{tickSize: string}} matchingRules
*/

/**
* @typedef {object} TRestrictions
* @property {string} maxAmount
* @property {string} maxPrice
* @property {string} stepPrice
* @property {string} stepAmount
* @property {string} minPrice
* @property {string} minAmount
*/
8 changes: 6 additions & 2 deletions src/modules/dex/controllers/DexCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* @param {Waves} waves
* @param {utils} utils
* @param {ModalManager} modalManager
* @param {Matcher} matcher
* @return {DexCtrl}
*/
const controller = function (
Expand All @@ -26,7 +27,8 @@
createPoll,
waves,
utils,
modalManager) {
modalManager,
matcher) {

const analytics = require('@waves/event-sender');

Expand Down Expand Up @@ -122,6 +124,7 @@
return this._showModalAndRedirect(userAssetIdPair.amount, userAssetIdPair.price);
}
const pair = await this._getPair();
matcher.getPairRestrictions(pair);
$location.search('assetId2', pair.amountAsset.id);
$location.search('assetId1', pair.priceAsset.id);
}
Expand Down Expand Up @@ -278,7 +281,8 @@
'createPoll',
'waves',
'utils',
'modalManager'
'modalManager',
'matcher'
];

angular.module('app.dex')
Expand Down
Loading