From f843b170dadf91c2d85acca9f31afa593211499d Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Wed, 8 May 2019 16:31:55 +0300 Subject: [PATCH 01/25] CLIENT-1819: add getRestrictions method --- data-service/api/API.ts | 3 ++- data-service/api/matcher/getPairRestrictions.ts | 13 +++++++++++++ src/modules/app/services/waves/matcher/Matcher.js | 9 +++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 data-service/api/matcher/getPairRestrictions.ts diff --git a/data-service/api/API.ts b/data-service/api/API.ts index 380efa0a76..c756403b82 100644 --- a/data-service/api/API.ts +++ b/data-service/api/API.ts @@ -16,6 +16,7 @@ import { } from './matcher/getOrders'; import * as addressModule from './address'; import { getLastPrice } from './matcher/getLastPrice'; +import { getPairRestrictions } from './matcher/getPairRestrictions'; import { getAddressByAlias, getAliasesByAddress } from './aliases/aliases'; import * as pairsModule from './pairs/pairs'; import * as dataModule from './data'; @@ -26,7 +27,7 @@ export const aliases = { getAliasesByAddress, getAddressByAlias }; export const node = { height }; export const matcher = { - getOrderBook, getOrdersByPair, addSignature, clearSignature, getOrders, signatureTimeout, factory, getLastPrice + getOrderBook, getOrdersByPair, addSignature, clearSignature, getOrders, signatureTimeout, factory, getLastPrice, getPairRestrictions }; export const assets = { ...assetsApi }; diff --git a/data-service/api/matcher/getPairRestrictions.ts b/data-service/api/matcher/getPairRestrictions.ts new file mode 100644 index 0000000000..dbae6a0c62 --- /dev/null +++ b/data-service/api/matcher/getPairRestrictions.ts @@ -0,0 +1,13 @@ +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` + }).then(info => { + return info; + }).catch(error => console.log(error)); +} diff --git a/src/modules/app/services/waves/matcher/Matcher.js b/src/modules/app/services/waves/matcher/Matcher.js index 7782cd1197..a801487350 100644 --- a/src/modules/app/services/waves/matcher/Matcher.js +++ b/src/modules/app/services/waves/matcher/Matcher.js @@ -45,6 +45,15 @@ return ds.api.matcher.getLastPrice(pair); } + /** + * @param {AssetPair} pair + * @return {Promise} + */ + @decorators.cachable(0.5) + getPairRestrictions(pair) { + return ds.api.matcher.getPairRestrictions(pair); + } + /** * @param {string} address * @return {Promise>} From bd06c57681d898e8b2db73cc8a11169fa3e85bfb Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 24 May 2019 19:05:35 +0300 Subject: [PATCH 02/25] CLIENT-1819: add pairRestrictions --- .../dex/directives/createOrder/CreateOrder.js | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index c5672d048d..9d6fec9f7f 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -126,6 +126,10 @@ * @type {boolean} */ this._silenceNow = false; + /** + * @type {Object} + */ + this.pairRestrictions = {}; /** * * @type {boolean} @@ -170,8 +174,12 @@ */ const spreadPoll = createPoll(this, this._getData, this._setData, 1000); - this.receive(balanceWatcher.change, this._updateBalances, this); + this.receive(balanceWatcher.change, () => { + this._updateBalances(); + this._getPairRestrictions(); + }, this); this._updateBalances(); + this._getPairRestrictions(); const lastTradePromise = new Promise((resolve) => { balanceWatcher.ready.then(() => { @@ -231,6 +239,7 @@ } })); currentFee(); + this._getPairRestrictions(); }); this.observe(['priceBalance', 'total', 'maxPriceBalance'], this._setIfCanBuyOrder); @@ -831,6 +840,20 @@ this.order.$setDirty(); } + _getPairRestrictions() { + if (!this.loaded) { + return false; + } + + ds.api.matcher.getPairRestrictions({ + amountAsset: this.amountBalance.asset, + priceAsset: this.priceBalance.asset + }).then(info => { + this.pairRestrictions = info; + }); + + } + static _animateNotification($element) { return utils.animate($element, { t: 100 }, { duration: 1200, From 291da9a14506f30310940abcb36d747b8ab3088f Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 27 May 2019 15:45:06 +0300 Subject: [PATCH 03/25] CLIENT-1819: save --- .../dex/directives/createOrder/CreateOrder.js | 46 +++++++++++++++++-- .../directives/createOrder/createOrder.html | 24 +++++++--- 2 files changed, 60 insertions(+), 10 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index 9d6fec9f7f..c4bc437c6d 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -126,6 +126,14 @@ * @type {boolean} */ this._silenceNow = false; + /** + * @type {boolean} + */ + this.isValidStepSize = false; + /** + * @type {boolean} + */ + this.isValidTickSize = false; /** * @type {Object} */ @@ -213,6 +221,9 @@ } }); + this.isValidStepSize = this._validateStepSize(); + this.isValidTickSize = this._validateTickSize(); + this.observe(['amountBalance', 'type', 'fee', 'priceBalance'], this._updateMaxAmountOrPriceBalance); this.observe('_assetIdPair', () => { @@ -244,14 +255,24 @@ this.observe(['priceBalance', 'total', 'maxPriceBalance'], this._setIfCanBuyOrder); - this.observe('amount', () => ( - !this._silenceNow && this._updateField({ amount: this.amount }) - )); + this.observe('amount', () => { + if (!this._silenceNow) { + this.isValidStepSize = this._validateStepSize(); + this._updateField({ amount: this.amount }); + } + }); this.observe('price', () => ( !this._silenceNow && this._updateField({ price: this.price }) )); + this.observe('price', () => { + if (!this._silenceNow) { + this.isValidTickSize = this._validateTickSize(); + this._updateField({ price: this.price }); + } + }); + this.observe('total', () => ( !this._silenceNow && this._updateField({ total: this.total }) )); @@ -849,9 +870,26 @@ amountAsset: this.amountBalance.asset, priceAsset: this.priceBalance.asset }).then(info => { - this.pairRestrictions = info; + if (info) { + this.pairRestrictions = info; + } }); + } + + _validateStepSize() { + if (!this.amount) { + return false; + } + const step = new BigNumber(this.pairRestrictions.stepSize); + return this.amount.getTokens().modulo(step).isZero(); + } + _validateTickSize() { + if (!this.price) { + return false; + } + const step = new BigNumber(this.pairRestrictions.tickSize); + return this.price.getTokens().modulo(step).isZero(); } static _animateNotification($element) { diff --git a/src/modules/dex/directives/createOrder/createOrder.html b/src/modules/dex/directives/createOrder/createOrder.html index c19070aa7a..f633f1c527 100644 --- a/src/modules/dex/directives/createOrder/createOrder.html +++ b/src/modules/dex/directives/createOrder/createOrder.html @@ -88,8 +88,9 @@ ng-blur="$ctrl.setChangedInput('amount')" w-validate w-validator-asset="{{$ctrl.amountBalance.asset}}" - w-validator-lte="{{$ctrl.maxAmountBalance}}" - w-validator-gt="0" + w-validator-lte="{{$ctrl.maxAmountBalance ? $ctrl.maxAmountBalance : $ctrl.pairRestrictions.maxAmount}}" + w-validator-gte="{{$ctrl.pairRestrictions.minAmount}}" + w-validator-custom="{{$ctrl.isValidStepSize}}" name="amount" ng-model="$ctrl.amount" autocomplete="off" @@ -102,7 +103,7 @@ - + @@ -113,6 +114,9 @@ + + + @@ -146,7 +150,9 @@ ng-blur="$ctrl.setChangedInput('price')" w-validate w-validator-asset="{{$ctrl.priceBalance.asset}}" - w-validator-gt="0" + w-validator-lte="{{$ctrl.pairRestrictions.maxPrice}}" + w-validator-gte="{{$ctrl.pairRestrictions.minPrice}}" + w-validator-custom="{{$ctrl.isValidTickSize}}" name="price" ng-model="$ctrl.price" autocomplete="off" @@ -159,12 +165,18 @@ - - + + + + + + + + From 4591cc4c9088a8b6b912a85930cff6a8d9ff00a4 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 31 May 2019 18:50:19 +0300 Subject: [PATCH 04/25] CLIENT-1819: save --- .../dex/directives/createOrder/CreateOrder.js | 146 +++++++++++++++--- .../directives/createOrder/createOrder.html | 31 ++-- .../directives/createOrder/createOrder.less | 6 + 3 files changed, 153 insertions(+), 30 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index 673f0772cf..065ccff72e 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -20,7 +20,7 @@ const controller = function (Base, waves, user, utils, createPoll, $scope, $element, notification, dexDataService, ease, $state, modalManager, balanceWatcher) { - const { without, keys, last } = require('ramda'); + const { without, keys, last, equals } = require('ramda'); const { Money } = require('@waves/data-entities'); const ds = require('data-service'); const analytics = require('@waves/event-sender'); @@ -46,6 +46,10 @@ return this.amountBalance && this.priceBalance; } + get loadedPairRestrictions() { + return !equals(this.pairRestrictions, Object.create(null)); + } + /** * Max amount (with fee) * @type {Money} @@ -101,6 +105,10 @@ * @type {number} */ ERROR_DISPLAY_INTERVAL = 3; + /** + * @type {number} + */ + ERROR_CLICKABLE_DISPLAY_INTERVAL = 6; /** * @type {{amount: string, price: string}} * @private @@ -152,6 +160,14 @@ * @type {Object} */ pairRestrictions = {}; + /** + * @type {Money} + */ + _price = null; + /** + * @type {Money} + */ + _amount = null; constructor() { @@ -192,10 +208,9 @@ this.receive(balanceWatcher.change, () => { this._updateBalances(); - this._getPairRestrictions(); }, this); - this._updateBalances(); - this._getPairRestrictions(); + this._updateBalances() + .then(() => this._setPairRestrictions()); const lastTradePromise = new Promise((resolve) => { balanceWatcher.ready.then(() => { @@ -233,6 +248,7 @@ this.isValidTickSize = this._validateTickSize(); this.observe(['amountBalance', 'type', 'fee', 'priceBalance'], this._updateMaxAmountOrPriceBalance); + this.observe(['maxAmountBalance', 'amountBalance', 'priceBalance'], this._setPairRestrictions); this.observe('_assetIdPair', () => { this.amount = null; @@ -258,27 +274,28 @@ } })); currentFee(); - this._getPairRestrictions(); }); this.observe(['priceBalance', 'total', 'maxPriceBalance'], this._setIfCanBuyOrder); this.observe('amount', () => { + this.isValidStepSize = this._validateStepSize(); if (!this._silenceNow) { - this.isValidStepSize = this._validateStepSize(); this._updateField({ amount: this.amount }); } + if (this.amount) { + this._amount = this.amount; + } }); - this.observe('price', () => ( - !this._silenceNow && this._updateField({ price: this.price }) - )); - this.observe('price', () => { + this.isValidTickSize = this._validateTickSize(); if (!this._silenceNow) { - this.isValidTickSize = this._validateTickSize(); this._updateField({ price: this.price }); } + if (this.price) { + this._price = this.price; + } }); this.observe('total', () => ( @@ -309,9 +326,12 @@ /** * @param {number} factor + * @return {Promise} */ setAmountByBalance(factor) { - const amount = this.maxAmount.cloneWithTokens(this.maxAmount.getTokens().times(factor)); + const amount = this.maxAmount.cloneWithTokens( + this.roundAmount(this.maxAmount.getTokens().times(factor)) + ); this._updateField({ amount }); return Promise.resolve(); } @@ -382,6 +402,16 @@ this._updateField({ amount, total, price }); } + setPrice(value) { + const price = this.priceBalance.cloneWithTokens(value); + this._updateField({ price }); + } + + setAmount(value) { + const amount = this.amountBalance.cloneWithTokens(value); + this._updateField({ amount }); + } + setBidPrice() { const price = this.priceBalance.cloneWithTokens(String(this.bid.price)); this._updateField({ price }); @@ -908,35 +938,111 @@ this.order.$setDirty(); } - _getPairRestrictions() { + _setPairRestrictions() { if (!this.loaded) { return false; } + this.pairRestrictions = {}; + ds.api.matcher.getPairRestrictions({ amountAsset: this.amountBalance.asset, priceAsset: this.priceBalance.asset }).then(info => { if (info) { - this.pairRestrictions = info; + this.pairRestrictions = Object.keys(info).reduce((pairRestriction, key) => { + if (typeof info[key] === 'string' || typeof info[key] === 'number') { + pairRestriction[key] = new BigNumber(info[key]); + } else { + pairRestriction[key] = info[key]; + } + return pairRestriction; + }, Object.create(null)); + } else { + const tickSize = new BigNumber(Math.pow(10, -this.priceBalance.asset.precision)); + const stepSize = new BigNumber(Math.pow(10, -this.amountBalance.asset.precision)); + const maxPrice = new BigNumber(Infinity); + const maxAmount = this.maxAmountBalance ? + this.maxAmountBalance.getTokens() : + new BigNumber(Infinity); + this.pairRestrictions = { + maxPrice, + maxAmount, + tickSize, + stepSize, + minPrice: tickSize, + minAmount: stepSize + }; } }); } + /** + * @return {boolean} + */ _validateStepSize() { if (!this.amount) { return false; } - const step = new BigNumber(this.pairRestrictions.stepSize); - return this.amount.getTokens().modulo(step).isZero(); + + return this.amount.getTokens().modulo(this.pairRestrictions.stepSize).isZero(); } + /** + * @return {boolean} + */ _validateTickSize() { - if (!this.price) { - return false; + const { tickSize, minPrice, maxPrice } = this.pairRestrictions; + if (!this.price || this.price.getTokens().lte(minPrice) || this.price.getTokens().gte(maxPrice)) { + return true; } - const step = new BigNumber(this.pairRestrictions.tickSize); - return this.price.getTokens().modulo(step).isZero(); + + return this.price.getTokens().modulo(tickSize).isZero(); + } + + /** + * @return {string} + */ + roundPrice() { + if (!this.loadedPairRestrictions) { + return ''; + } + const price = this._price.getTokens(); + const { tickSize, minPrice, maxPrice } = this.pairRestrictions; + const roundedPrice = price.decimalPlaces(-tickSize.e, BigNumber.ROUND_HALF_EVEN); + + if (roundedPrice.lt(minPrice)) { + return minPrice; + } + + if (roundedPrice.gt(maxPrice)) { + return maxPrice; + } + + return roundedPrice; + } + + /** + * @param {Money} value + * @return {string} + */ + roundAmount(value) { + if (!this.loadedPairRestrictions) { + return ''; + } + const amount = value ? value : this._amount.getTokens(); + const { stepSize, minAmount, maxAmount } = this.pairRestrictions; + const roundedAmount = amount.decimalPlaces(-stepSize.e, BigNumber.ROUND_HALF_EVEN); + + if (roundedAmount.lt(minAmount)) { + return minAmount; + } + + if (roundedAmount.gt(maxAmount)) { + return maxAmount; + } + + return roundedAmount; } static _animateNotification($element) { diff --git a/src/modules/dex/directives/createOrder/createOrder.html b/src/modules/dex/directives/createOrder/createOrder.html index 34d988bff2..dbb7d9b151 100644 --- a/src/modules/dex/directives/createOrder/createOrder.html +++ b/src/modules/dex/directives/createOrder/createOrder.html @@ -89,14 +89,14 @@
- + + + {{$ctrl.roundPrice()}} + - + @@ -118,8 +120,11 @@ - + + + {{$ctrl.roundPrice()}} +
@@ -142,7 +147,7 @@
- - + - + - + + + {{$ctrl.roundAmount()}} + diff --git a/src/modules/dex/directives/createOrder/createOrder.less b/src/modules/dex/directives/createOrder/createOrder.less index eefd1aba52..1d68a9847d 100644 --- a/src/modules/dex/directives/createOrder/createOrder.less +++ b/src/modules/dex/directives/createOrder/createOrder.less @@ -431,6 +431,12 @@ w-create-order { } } } + + .clickable-value { + text-decoration: underline; + font-weight: bold; + cursor: pointer; + } } } From 4d6c6ed1fa47d0cfd960a22b309e99b9b858700b Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 3 Jun 2019 11:12:58 +0300 Subject: [PATCH 05/25] CLIENT-1819: add max/min clickable hint --- .../dex/directives/createOrder/CreateOrder.js | 5 +-- .../directives/createOrder/createOrder.html | 35 +++++++++++++------ 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index 065ccff72e..ef9ac41a5c 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -1004,9 +1004,10 @@ * @return {string} */ roundPrice() { - if (!this.loadedPairRestrictions) { + if (!this.loadedPairRestrictions || !this._price) { return ''; } + const price = this._price.getTokens(); const { tickSize, minPrice, maxPrice } = this.pairRestrictions; const roundedPrice = price.decimalPlaces(-tickSize.e, BigNumber.ROUND_HALF_EVEN); @@ -1027,7 +1028,7 @@ * @return {string} */ roundAmount(value) { - if (!this.loadedPairRestrictions) { + if (!this.loadedPairRestrictions || !this._amount) { return ''; } const amount = value ? value : this._amount.getTokens(); diff --git a/src/modules/dex/directives/createOrder/createOrder.html b/src/modules/dex/directives/createOrder/createOrder.html index dbb7d9b151..3e1057734a 100644 --- a/src/modules/dex/directives/createOrder/createOrder.html +++ b/src/modules/dex/directives/createOrder/createOrder.html @@ -105,23 +105,29 @@
{{$ctrl.priceDisplayName}}
- - + + {{$ctrl.roundPrice()}} - + + + {{$ctrl.pairRestrictions.maxPrice}} + - - + + + + {{$ctrl.pairRestrictions.minPrice}} + - + {{$ctrl.roundPrice()}} @@ -168,19 +174,26 @@ - - + + + + {{$ctrl.pairRestrictions.minAmount}} + - + - + + + + {{$ctrl.pairRestrictions.maxAmount}} + + From c2cabcb4bdd30cd673454acb7ee2785045e98289 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 3 Jun 2019 12:45:28 +0300 Subject: [PATCH 06/25] CLIENT-1819: save --- .../dex/directives/createOrder/CreateOrder.js | 57 +++++++++---------- .../directives/createOrder/createOrder.html | 18 +++--- 2 files changed, 36 insertions(+), 39 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index ef9ac41a5c..b694fb9b07 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -160,15 +160,6 @@ * @type {Object} */ pairRestrictions = {}; - /** - * @type {Money} - */ - _price = null; - /** - * @type {Money} - */ - _amount = null; - constructor() { super(); @@ -283,9 +274,6 @@ if (!this._silenceNow) { this._updateField({ amount: this.amount }); } - if (this.amount) { - this._amount = this.amount; - } }); this.observe('price', () => { @@ -293,9 +281,6 @@ if (!this._silenceNow) { this._updateField({ price: this.price }); } - if (this.price) { - this._price = this.price; - } }); this.observe('total', () => ( @@ -321,7 +306,9 @@ return false; } - return this.maxAmount.cloneWithTokens(this.maxAmount.getTokens().times(factor)).eq(amount); + return this.maxAmount.cloneWithTokens( + this.roundAmount(this.maxAmount.getTokens().times(factor)) + ).eq(amount); } /** @@ -330,7 +317,7 @@ */ setAmountByBalance(factor) { const amount = this.maxAmount.cloneWithTokens( - this.roundAmount(this.maxAmount.getTokens().times(factor)) + this.getClosestValidAmount(this.maxAmount.getTokens().times(factor)) ); this._updateField({ amount }); return Promise.resolve(); @@ -1000,15 +987,12 @@ return this.price.getTokens().modulo(tickSize).isZero(); } - /** - * @return {string} - */ roundPrice() { - if (!this.loadedPairRestrictions || !this._price) { - return ''; + if (!this.loadedPairRestrictions) { + return; } - const price = this._price.getTokens(); + const price = this.priceBalance.cloneWithTokens(this.order.price.$viewValue).getTokens(); const { tickSize, minPrice, maxPrice } = this.pairRestrictions; const roundedPrice = price.decimalPlaces(-tickSize.e, BigNumber.ROUND_HALF_EVEN); @@ -1024,16 +1008,29 @@ } /** - * @param {Money} value - * @return {string} + * @param {BigNumber} value + * @return {BigNumber} */ roundAmount(value) { - if (!this.loadedPairRestrictions || !this._amount) { - return ''; + const { stepSize } = this.pairRestrictions; + const roundedAmount = value.decimalPlaces(-stepSize.e, BigNumber.ROUND_HALF_EVEN); + + return roundedAmount; + } + + /** + * @param {BigNumber} value + */ + getClosestValidAmount(value) { + if (!this.loadedPairRestrictions) { + return; } - const amount = value ? value : this._amount.getTokens(); - const { stepSize, minAmount, maxAmount } = this.pairRestrictions; - const roundedAmount = amount.decimalPlaces(-stepSize.e, BigNumber.ROUND_HALF_EVEN); + + const amount = value ? + value : + this.amountBalance.cloneWithTokens(this.order.amount.$viewValue).getTokens(); + const { minAmount, maxAmount } = this.pairRestrictions; + const roundedAmount = this.roundAmount(amount); if (roundedAmount.lt(minAmount)) { return minAmount; diff --git a/src/modules/dex/directives/createOrder/createOrder.html b/src/modules/dex/directives/createOrder/createOrder.html index 3e1057734a..bc80d4cb24 100644 --- a/src/modules/dex/directives/createOrder/createOrder.html +++ b/src/modules/dex/directives/createOrder/createOrder.html @@ -108,19 +108,19 @@ - {{$ctrl.roundPrice()}} + {{$ctrl.roundPrice().toFormat()}} - {{$ctrl.pairRestrictions.maxPrice}} + {{$ctrl.pairRestrictions.maxPrice.toFormat()}} - {{$ctrl.pairRestrictions.minPrice}} + {{$ctrl.pairRestrictions.minPrice.toFormat()}} @@ -129,7 +129,7 @@ - {{$ctrl.roundPrice()}} + {{$ctrl.roundPrice().toFormat()}}
@@ -177,7 +177,7 @@ - {{$ctrl.pairRestrictions.minAmount}} + {{$ctrl.pairRestrictions.minAmount.toFormat()}} @@ -191,14 +191,14 @@ - {{$ctrl.pairRestrictions.maxAmount}} + {{$ctrl.pairRestrictions.maxAmount.toFormat()}} - - - {{$ctrl.roundAmount()}} + + + {{$ctrl.getClosestValidAmount().toFormat()}} From 4e53ffad12a730828649e8a92d616dfecbdfaf8f Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Tue, 4 Jun 2019 16:39:12 +0300 Subject: [PATCH 07/25] CLIENT-1819: save --- data-service/api/matcher/getPairRestrictions.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/data-service/api/matcher/getPairRestrictions.ts b/data-service/api/matcher/getPairRestrictions.ts index dbae6a0c62..4048c6bc2c 100644 --- a/data-service/api/matcher/getPairRestrictions.ts +++ b/data-service/api/matcher/getPairRestrictions.ts @@ -7,7 +7,5 @@ import { get } from '../../config'; export function getPairRestrictions(pair: AssetPair) { return request({ url: `${get('matcher')}/orderbook/${pair.amountAsset.id}/${pair.priceAsset.id}/info` - }).then(info => { - return info; - }).catch(error => console.log(error)); + }).catch(e => console.log(e.message)); } From 37e1b385893c513996d067f179066d28805d4c1f Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Wed, 5 Jun 2019 17:14:00 +0300 Subject: [PATCH 08/25] CLIENT-1819: refactor --- .../api/matcher/getPairRestrictions.ts | 2 +- .../dex/directives/createOrder/CreateOrder.js | 169 ++++++++++-------- .../directives/createOrder/createOrder.html | 8 +- 3 files changed, 96 insertions(+), 83 deletions(-) diff --git a/data-service/api/matcher/getPairRestrictions.ts b/data-service/api/matcher/getPairRestrictions.ts index 4048c6bc2c..41d0deb803 100644 --- a/data-service/api/matcher/getPairRestrictions.ts +++ b/data-service/api/matcher/getPairRestrictions.ts @@ -7,5 +7,5 @@ import { get } from '../../config'; export function getPairRestrictions(pair: AssetPair) { return request({ url: `${get('matcher')}/orderbook/${pair.amountAsset.id}/${pair.priceAsset.id}/info` - }).catch(e => console.log(e.message)); + }); } diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index a386d7dae3..b4553e848d 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -20,7 +20,7 @@ const controller = function (Base, waves, user, utils, createPoll, $scope, $element, notification, dexDataService, ease, $state, modalManager, balanceWatcher) { - const { without, keys, last, equals } = require('ramda'); + const { without, keys, last } = require('ramda'); const { Money } = require('@waves/data-entities'); const ds = require('data-service'); const analytics = require('@waves/event-sender'); @@ -46,8 +46,11 @@ return this.amountBalance && this.priceBalance; } + /** + * @return {number} + */ get loadedPairRestrictions() { - return !equals(this.pairRestrictions, Object.create(null)); + return Object.keys(this.pairRestrictions).length; } /** @@ -201,11 +204,8 @@ */ const spreadPoll = createPoll(this, this._getData, this._setData, 1000); - this.receive(balanceWatcher.change, () => { - this._updateBalances(); - }, this); - this._updateBalances() - .then(() => this._setPairRestrictions()); + this.receive(balanceWatcher.change, this._updateBalances, this); + this._updateBalances().then(() => this._setPairRestrictions()); const lastTradePromise = new Promise((resolve) => { balanceWatcher.ready.then(() => { @@ -315,7 +315,7 @@ } return this.maxAmount.cloneWithTokens( - this.roundAmount(this.maxAmount.getTokens().times(factor)) + this.getRoundAmountByStepSize(this.maxAmount.getTokens().times(factor)) ).eq(amount); } @@ -397,11 +397,17 @@ this._updateField({ amount, total, price }); } + /** + * @param value + */ setPrice(value) { const price = this.priceBalance.cloneWithTokens(value); this._updateField({ price }); } + /** + * @param value + */ setAmount(value) { const amount = this.amountBalance.cloneWithTokens(value); this._updateField({ amount }); @@ -492,6 +498,66 @@ }); } + /** + * @return {BigNumber|*} + */ + getRoundPriceByTickSize() { + if (!this.loadedPairRestrictions) { + return; + } + + const price = this.priceBalance.cloneWithTokens(this.order.price.$viewValue).getTokens(); + const { tickSize, minPrice, maxPrice } = this.pairRestrictions; + const roundedPrice = price.decimalPlaces(tickSize.decimalPlaces(), BigNumber.ROUND_HALF_EVEN); + + if (roundedPrice.lt(minPrice)) { + return minPrice; + } + + if (roundedPrice.gt(maxPrice)) { + return maxPrice; + } + + return roundedPrice; + } + + /** + * @param {BigNumber} value + * @return {BigNumber} + */ + getRoundAmountByStepSize(value) { + const { stepSize } = this.pairRestrictions; + const roundedAmount = value.decimalPlaces(stepSize.decimalPlaces(), BigNumber.ROUND_HALF_EVEN); + + return roundedAmount; + } + + /** + * @param {BigNumber} value + * @return {BigNumber|*} + */ + getClosestValidAmount(value) { + if (!this.loadedPairRestrictions) { + return; + } + + const amount = value ? + value : + this.amountBalance.cloneWithTokens(this.order.amount.$viewValue).getTokens(); + const { minAmount, maxAmount } = this.pairRestrictions; + const roundedAmount = this.getRoundAmountByStepSize(amount); + + if (roundedAmount.lt(minAmount)) { + return minAmount; + } + + if (roundedAmount.gt(maxAmount)) { + return maxAmount; + } + + return roundedAmount; + } + /** * @param data * @return {*|Promise} @@ -933,9 +999,12 @@ this.order.$setDirty(); } + /** + * @private + */ _setPairRestrictions() { if (!this.loaded) { - return false; + return; } this.pairRestrictions = {}; @@ -943,17 +1012,18 @@ ds.api.matcher.getPairRestrictions({ amountAsset: this.amountBalance.asset, priceAsset: this.priceBalance.asset - }).then(info => { - if (info) { - this.pairRestrictions = Object.keys(info).reduce((pairRestriction, key) => { - if (typeof info[key] === 'string' || typeof info[key] === 'number') { - pairRestriction[key] = new BigNumber(info[key]); - } else { - pairRestriction[key] = info[key]; - } - return pairRestriction; - }, Object.create(null)); - } else { + }) + .then(info => { + this.pairRestrictions = { + maxPrice: new BigNumber(info.maxPrice), + maxAmount: new BigNumber(info.maxAmount), + tickSize: new BigNumber(info.tickSize), + stepSize: new BigNumber(info.stepSize), + minPrice: new BigNumber(info.minPrice), + minAmount: new BigNumber(info.minAmount) + }; + }) + .catch(() => { const tickSize = new BigNumber(Math.pow(10, -this.priceBalance.asset.precision)); const stepSize = new BigNumber(Math.pow(10, -this.amountBalance.asset.precision)); const maxPrice = new BigNumber(Infinity); @@ -968,8 +1038,7 @@ minPrice: tickSize, minAmount: stepSize }; - } - }); + }); } /** @@ -995,62 +1064,6 @@ return this.price.getTokens().modulo(tickSize).isZero(); } - roundPrice() { - if (!this.loadedPairRestrictions) { - return; - } - - const price = this.priceBalance.cloneWithTokens(this.order.price.$viewValue).getTokens(); - const { tickSize, minPrice, maxPrice } = this.pairRestrictions; - const roundedPrice = price.decimalPlaces(-tickSize.e, BigNumber.ROUND_HALF_EVEN); - - if (roundedPrice.lt(minPrice)) { - return minPrice; - } - - if (roundedPrice.gt(maxPrice)) { - return maxPrice; - } - - return roundedPrice; - } - - /** - * @param {BigNumber} value - * @return {BigNumber} - */ - roundAmount(value) { - const { stepSize } = this.pairRestrictions; - const roundedAmount = value.decimalPlaces(-stepSize.e, BigNumber.ROUND_HALF_EVEN); - - return roundedAmount; - } - - /** - * @param {BigNumber} value - */ - getClosestValidAmount(value) { - if (!this.loadedPairRestrictions) { - return; - } - - const amount = value ? - value : - this.amountBalance.cloneWithTokens(this.order.amount.$viewValue).getTokens(); - const { minAmount, maxAmount } = this.pairRestrictions; - const roundedAmount = this.roundAmount(amount); - - if (roundedAmount.lt(minAmount)) { - return minAmount; - } - - if (roundedAmount.gt(maxAmount)) { - return maxAmount; - } - - return roundedAmount; - } - static _animateNotification($element) { return utils.animate($element, { t: 100 }, { duration: 1200, diff --git a/src/modules/dex/directives/createOrder/createOrder.html b/src/modules/dex/directives/createOrder/createOrder.html index bc80d4cb24..33991ce78e 100644 --- a/src/modules/dex/directives/createOrder/createOrder.html +++ b/src/modules/dex/directives/createOrder/createOrder.html @@ -107,8 +107,8 @@ - - {{$ctrl.roundPrice().toFormat()}} + + {{$ctrl.getRoundPriceByTickSize().toFormat()}} @@ -128,8 +128,8 @@ - - {{$ctrl.roundPrice().toFormat()}} + + {{$ctrl.getRoundPriceByTickSize().toFormat()}} From 2de972cddd99a56da2a66401963b2705cde43b6f Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Wed, 5 Jun 2019 18:41:34 +0300 Subject: [PATCH 09/25] CLIENT-1819: fixes --- .../dex/directives/createOrder/CreateOrder.js | 64 ++++++++++++------- .../directives/createOrder/createOrder.html | 12 ++-- 2 files changed, 48 insertions(+), 28 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index b4553e848d..c7b9190598 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -526,6 +526,10 @@ * @return {BigNumber} */ getRoundAmountByStepSize(value) { + if (!this.loadedPairRestrictions) { + return value; + } + const { stepSize } = this.pairRestrictions; const roundedAmount = value.decimalPlaces(stepSize.decimalPlaces(), BigNumber.ROUND_HALF_EVEN); @@ -548,11 +552,11 @@ const roundedAmount = this.getRoundAmountByStepSize(amount); if (roundedAmount.lt(minAmount)) { - return minAmount; + return minAmount.decimalPlaces(roundedAmount.decimalPlaces()); } if (roundedAmount.gt(maxAmount)) { - return maxAmount; + return maxAmount.decimalPlaces(roundedAmount.decimalPlaces()); } return roundedAmount; @@ -1008,45 +1012,59 @@ } this.pairRestrictions = {}; + const defaultPairRestriction = this._getDefaultPairRestriction(); ds.api.matcher.getPairRestrictions({ amountAsset: this.amountBalance.asset, priceAsset: this.priceBalance.asset }) .then(info => { + const maxAmount = info.maxAmount ? + new BigNumber(info.maxAmount) : + defaultPairRestriction.maxAmount; this.pairRestrictions = { - maxPrice: new BigNumber(info.maxPrice), - maxAmount: new BigNumber(info.maxAmount), - tickSize: new BigNumber(info.tickSize), - stepSize: new BigNumber(info.stepSize), - minPrice: new BigNumber(info.minPrice), - minAmount: new BigNumber(info.minAmount) + maxPrice: info.maxPrice ? new BigNumber(info.maxPrice) : defaultPairRestriction.maxPrice, + maxAmount: this.maxAmountBalance ? + this.maxAmountBalance.getTokens() : + maxAmount, + tickSize: info.tickSize ? new BigNumber(info.tickSize) : defaultPairRestriction.tickSize, + stepSize: info.stepSize ? new BigNumber(info.stepSize) : defaultPairRestriction.stepSize, + minPrice: info.minPrice ? new BigNumber(info.minPrice) : defaultPairRestriction.minPrice, + minAmount: info.minAmount ? new BigNumber(info.minAmount) : defaultPairRestriction.minAmount }; }) .catch(() => { - const tickSize = new BigNumber(Math.pow(10, -this.priceBalance.asset.precision)); - const stepSize = new BigNumber(Math.pow(10, -this.amountBalance.asset.precision)); - const maxPrice = new BigNumber(Infinity); - const maxAmount = this.maxAmountBalance ? - this.maxAmountBalance.getTokens() : - new BigNumber(Infinity); - this.pairRestrictions = { - maxPrice, - maxAmount, - tickSize, - stepSize, - minPrice: tickSize, - minAmount: stepSize - }; + this.pairRestrictions = defaultPairRestriction; }); } + /** + * @return {{minAmount, minPrice, stepSize, maxPrice, maxAmount, tickSize}} + * @private + */ + _getDefaultPairRestriction() { + const tickSize = new BigNumber(Math.pow(10, -this.priceBalance.asset.precision)); + const stepSize = new BigNumber(Math.pow(10, -this.amountBalance.asset.precision)); + const maxPrice = new BigNumber(Infinity); + const maxAmount = this.maxAmountBalance ? + this.maxAmountBalance.getTokens() : + new BigNumber(Infinity); + return ({ + maxPrice, + maxAmount, + tickSize, + stepSize, + minPrice: tickSize, + minAmount: stepSize + }); + } + /** * @return {boolean} */ _validateStepSize() { if (!this.amount) { - return false; + return true; } return this.amount.getTokens().modulo(this.pairRestrictions.stepSize).isZero(); diff --git a/src/modules/dex/directives/createOrder/createOrder.html b/src/modules/dex/directives/createOrder/createOrder.html index 33991ce78e..8f627f72c9 100644 --- a/src/modules/dex/directives/createOrder/createOrder.html +++ b/src/modules/dex/directives/createOrder/createOrder.html @@ -171,9 +171,6 @@ - - - @@ -181,8 +178,10 @@ - + + + {{$ctrl.getClosestValidAmount().toFormat()}} + + + +
From be0225ca6b69184a3331f9db1cd1614bf02e7888 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Thu, 6 Jun 2019 17:44:05 +0300 Subject: [PATCH 10/25] CLIENT-1819: some fixes --- src/modules/dex/directives/createOrder/CreateOrder.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index c7b9190598..8b3a1875ac 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -342,7 +342,9 @@ expand(type) { this.type = type; if (!this.price || this.price.getTokens().eq('0')) { - this.price = this._getCurrentPrice(); + this._setPairRestrictions().then(() => { + this.price = this._getCurrentPrice(); + }); } // todo: refactor after getting rid of Layout-DEX coupling. @@ -545,6 +547,7 @@ return; } + const { stepSize } = this.pairRestrictions; const amount = value ? value : this.amountBalance.cloneWithTokens(this.order.amount.$viewValue).getTokens(); @@ -552,11 +555,11 @@ const roundedAmount = this.getRoundAmountByStepSize(amount); if (roundedAmount.lt(minAmount)) { - return minAmount.decimalPlaces(roundedAmount.decimalPlaces()); + return minAmount.decimalPlaces(stepSize.decimalPlaces()); } if (roundedAmount.gt(maxAmount)) { - return maxAmount.decimalPlaces(roundedAmount.decimalPlaces()); + return maxAmount.decimalPlaces(stepSize.decimalPlaces()); } return roundedAmount; From 1f733c36f1498af79e096424f01c3ccd008aef46 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 17 Jun 2019 12:01:52 +0300 Subject: [PATCH 11/25] CLIENT-1819: fix price and amount choosen from order book --- .../dex/directives/createOrder/CreateOrder.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index 8b3a1875ac..f3a02081a9 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -175,12 +175,14 @@ this.receive(dexDataService.chooseOrderBook, ({ type, price, amount }) => { this.expand(type); + const roundedPrice = this.getRoundPriceByTickSize(price).toString(); + const roundedAmount = this.getClosestValidAmount(new BigNumber(amount)).toString(); switch (type) { case 'buy': - this._onClickBuyOrder(price, amount); + this._onClickBuyOrder(roundedPrice, roundedAmount); break; case 'sell': - this._onClickSellOrder(price, amount); + this._onClickSellOrder(roundedPrice, roundedAmount); break; default: throw new Error('Wrong order type!'); @@ -501,14 +503,17 @@ } /** + * @param {string} * @return {BigNumber|*} */ - getRoundPriceByTickSize() { + getRoundPriceByTickSize(value) { if (!this.loadedPairRestrictions) { return; } - const price = this.priceBalance.cloneWithTokens(this.order.price.$viewValue).getTokens(); + const price = value ? + new BigNumber(value) : + this.priceBalance.cloneWithTokens(this.order.price.$viewValue).getTokens(); const { tickSize, minPrice, maxPrice } = this.pairRestrictions; const roundedPrice = price.decimalPlaces(tickSize.decimalPlaces(), BigNumber.ROUND_HALF_EVEN); From 5d57f42fd37a93883574b8cade090f3cded05617 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Tue, 18 Jun 2019 17:53:18 +0300 Subject: [PATCH 12/25] CLIENT-1819: tickSize fixes --- .../dex/directives/createOrder/CreateOrder.js | 110 ++++++++++++------ .../directives/createOrder/createOrder.html | 30 +++-- 2 files changed, 95 insertions(+), 45 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index f3a02081a9..c93a5bf116 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -171,12 +171,13 @@ constructor() { super(); - this.observe(['type', 'amount', 'price', 'amountBalance', 'fee'], this._currentMaxAmount); + this.observe(['type', 'amount', 'price', 'amountBalance', 'fee', 'pairRestrictions'], + this._currentMaxAmount); this.receive(dexDataService.chooseOrderBook, ({ type, price, amount }) => { this.expand(type); - const roundedPrice = this.getRoundPriceByTickSize(price).toString(); - const roundedAmount = this.getClosestValidAmount(new BigNumber(amount)).toString(); + const roundedPrice = this.getRoundPriceTokensByTickSize(new BigNumber(price)).toString(); + const roundedAmount = this.getClosestValidAmountTokens(new BigNumber(amount)).toString(); switch (type) { case 'buy': this._onClickBuyOrder(roundedPrice, roundedAmount); @@ -317,7 +318,7 @@ } return this.maxAmount.cloneWithTokens( - this.getRoundAmountByStepSize(this.maxAmount.getTokens().times(factor)) + this.getRoundAmountTokensByStepSize(this.maxAmount.getTokens().times(factor)) ).eq(amount); } @@ -327,7 +328,7 @@ */ setAmountByBalance(factor) { const amount = this.maxAmount.cloneWithTokens( - this.getClosestValidAmount(this.maxAmount.getTokens().times(factor)) + this.getClosestValidAmountTokens(this.maxAmount.getTokens().times(factor)) ); this._updateField({ amount }); return Promise.resolve(); @@ -388,7 +389,7 @@ } setMaxAmount() { - const amount = this.maxAmount; + const amount = this.getClosestValidAmount(this.maxAmount.getTokens()); this._updateField({ amount }); } @@ -503,71 +504,113 @@ } /** - * @param {string} - * @return {BigNumber|*} + * @param {BigNumber} price + * @return {Money|*} */ - getRoundPriceByTickSize(value) { + getRoundPriceByTickSize(price) { if (!this.loadedPairRestrictions) { return; } - const price = value ? - new BigNumber(value) : - this.priceBalance.cloneWithTokens(this.order.price.$viewValue).getTokens(); const { tickSize, minPrice, maxPrice } = this.pairRestrictions; const roundedPrice = price.decimalPlaces(tickSize.decimalPlaces(), BigNumber.ROUND_HALF_EVEN); if (roundedPrice.lt(minPrice)) { - return minPrice; + return this.priceBalance.cloneWithTokens(minPrice); } if (roundedPrice.gt(maxPrice)) { - return maxPrice; + return this.priceBalance.cloneWithTokens(maxPrice); } - return roundedPrice; + return this.priceBalance.cloneWithTokens(roundedPrice); } /** * @param {BigNumber} value * @return {BigNumber} */ + getRoundPriceTokensByTickSize(value) { + const price = value ? + value : + this.priceBalance.cloneWithTokens(this.order.price.$viewValue).getTokens(); + const roundedPrice = this.getRoundPriceByTickSize(price); + if (!roundedPrice) { + return; + } + return roundedPrice.getTokens(); + } + + /** + * @param {BigNumber} value + * @return {Money} + */ getRoundAmountByStepSize(value) { if (!this.loadedPairRestrictions) { - return value; + return; } const { stepSize } = this.pairRestrictions; - const roundedAmount = value.decimalPlaces(stepSize.decimalPlaces(), BigNumber.ROUND_HALF_EVEN); - - return roundedAmount; + const roundedAmount = value.decimalPlaces(stepSize.decimalPlaces()); + return this.amountBalance.cloneWithTokens(roundedAmount); } /** + * * @param {BigNumber} value - * @return {BigNumber|*} + * @return {BigNumber} */ - getClosestValidAmount(value) { + getRoundAmountTokensByStepSize(value) { + const roundedAmount = this.getRoundAmountByStepSize(value); + if (!roundedAmount) { + return; + } + return roundedAmount.getTokens(); + } + + /** + * @param {BigNumber} amount + * @return {Money|*} + */ + getClosestValidAmount(amount) { if (!this.loadedPairRestrictions) { return; } const { stepSize } = this.pairRestrictions; - const amount = value ? - value : - this.amountBalance.cloneWithTokens(this.order.amount.$viewValue).getTokens(); const { minAmount, maxAmount } = this.pairRestrictions; - const roundedAmount = this.getRoundAmountByStepSize(amount); + const roundedAmount = this.getRoundAmountTokensByStepSize(amount); if (roundedAmount.lt(minAmount)) { - return minAmount.decimalPlaces(stepSize.decimalPlaces()); + return this.amountBalance.cloneWithTokens( + minAmount.decimalPlaces(stepSize.decimalPlaces()) + ); } if (roundedAmount.gt(maxAmount)) { - return maxAmount.decimalPlaces(stepSize.decimalPlaces()); + return this.amountBalance.cloneWithTokens( + maxAmount.decimalPlaces(stepSize.decimalPlaces()) + ); + } + + return this.amountBalance.cloneWithTokens(roundedAmount); + } + + /** + * @param {BigNumber} value + * @return {BigNumber|*} + */ + getClosestValidAmountTokens(value) { + const amount = value ? + value : + this.amountBalance.cloneWithTokens(this.order.amount.$viewValue.replace(/\s/g, '')).getTokens(); + const validAmount = this.getClosestValidAmount(amount); + + if (!validAmount) { + return; } - return roundedAmount; + return validAmount.getTokens(); } /** @@ -883,9 +926,10 @@ } const price = this._validPrice(); const amount = this._validAmount(); - this._setDirtyField('total', this.priceBalance.cloneWithTokens( - price.times(amount) - )); + const total = price.times(amount).isZero() ? + this.priceBalance.cloneWithTokens(price.times(amount)) : + this.getRoundPriceByTickSize(price.times(amount)); + this._setDirtyField('total', total); this._silenceNow = true; } @@ -898,7 +942,7 @@ } const total = this._validTotal(); const amount = this._validAmount(); - this._setDirtyField('price', this.priceBalance.cloneWithTokens( + this._setDirtyField('price', this.getRoundPriceByTickSize( total.div(amount) )); this._silenceNow = true; @@ -914,7 +958,7 @@ const total = this._validTotal(); const price = this._validPrice(); - this._setDirtyField('amount', this.amountBalance.cloneWithTokens( + this._setDirtyField('amount', this.getClosestValidAmount( total.div(price) )); this._silenceNow = true; diff --git a/src/modules/dex/directives/createOrder/createOrder.html b/src/modules/dex/directives/createOrder/createOrder.html index 8f627f72c9..be72df47b6 100644 --- a/src/modules/dex/directives/createOrder/createOrder.html +++ b/src/modules/dex/directives/createOrder/createOrder.html @@ -107,8 +107,9 @@
- - {{$ctrl.getRoundPriceByTickSize().toFormat()}} + + {{$ctrl.getRoundPriceTokensByTickSize().toFormat()}} @@ -128,8 +129,9 @@ - - {{$ctrl.getRoundPriceByTickSize().toFormat()}} + + {{$ctrl.getRoundPriceTokensByTickSize().toFormat()}} @@ -173,14 +175,16 @@ - - {{$ctrl.pairRestrictions.minAmount.toFormat()}} + + {{$ctrl.pairRestrictions.minAmount.toFormat()}} - - {{$ctrl.getClosestValidAmount().toFormat()}} + + {{$ctrl.getClosestValidAmountTokens().toFormat()}} @@ -189,15 +193,17 @@ params="{name: $ctrl.amountBalance.asset.displayName}"> - - {{$ctrl.pairRestrictions.maxAmount.toFormat()}} + + {{$ctrl.pairRestrictions.maxAmount.toFormat()}} - - {{$ctrl.getClosestValidAmount().toFormat()}} + + {{$ctrl.getClosestValidAmountTokens().toFormat()}} From 34da8977be27f729071dbea49126f9ca620c37db Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Wed, 19 Jun 2019 17:14:06 +0300 Subject: [PATCH 13/25] CLIENT-1819: add round max amount --- .../dex/directives/createOrder/CreateOrder.js | 49 +++++++++++++++---- .../directives/createOrder/createOrder.html | 8 +-- 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index c93a5bf116..e7bc783ac9 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -394,11 +394,11 @@ } setMaxPrice() { - const amount = this.maxAmount; - const total = this.priceBalance.cloneWithTokens( - this.price.getTokens().times(amount.getTokens()) + const amount = this.getRoundAmountByStepSize(this.maxAmount.getTokens()); + const price = this.getClosestValidPrice(this.price.getTokens()); + const total = this.getRoundPriceByTickSize( + price.getTokens().times(amount.getTokens()) ); - const price = this.price; this._updateField({ amount, total, price }); } @@ -511,9 +511,22 @@ if (!this.loadedPairRestrictions) { return; } - - const { tickSize, minPrice, maxPrice } = this.pairRestrictions; + const { tickSize } = this.pairRestrictions; const roundedPrice = price.decimalPlaces(tickSize.decimalPlaces(), BigNumber.ROUND_HALF_EVEN); + return this.priceBalance.cloneWithTokens(roundedPrice); + } + + /** + * @param {BigNumber} price + * @return {Money|*} + */ + getClosestValidPrice(price) { + if (!this.loadedPairRestrictions) { + return; + } + + const { minPrice, maxPrice } = this.pairRestrictions; + const roundedPrice = this.getRoundPriceTokensByTickSize(price); if (roundedPrice.lt(minPrice)) { return this.priceBalance.cloneWithTokens(minPrice); @@ -528,7 +541,7 @@ /** * @param {BigNumber} value - * @return {BigNumber} + * @return {BigNumber|*} */ getRoundPriceTokensByTickSize(value) { const price = value ? @@ -541,6 +554,22 @@ return roundedPrice.getTokens(); } + /** + * @param {BigNumber} price + * @return {BigNumber|*} + */ + getClosestValidPriceTokens(value) { + const price = value ? + value : + this.priceBalance.cloneWithTokens(this.order.price.$viewValue).getTokens(); + const validPrice = this.getClosestValidPrice(price); + if (!validPrice) { + return; + } + + return validPrice.getTokens(); + } + /** * @param {BigNumber} value * @return {Money} @@ -926,8 +955,8 @@ } const price = this._validPrice(); const amount = this._validAmount(); - const total = price.times(amount).isZero() ? - this.priceBalance.cloneWithTokens(price.times(amount)) : + const total = amount.isZero() ? + this.priceBalance.cloneWithTokens('0') : this.getRoundPriceByTickSize(price.times(amount)); this._setDirtyField('total', total); this._silenceNow = true; @@ -942,7 +971,7 @@ } const total = this._validTotal(); const amount = this._validAmount(); - this._setDirtyField('price', this.getRoundPriceByTickSize( + this._setDirtyField('price', this.getClosestValidPrice( total.div(amount) )); this._silenceNow = true; diff --git a/src/modules/dex/directives/createOrder/createOrder.html b/src/modules/dex/directives/createOrder/createOrder.html index be72df47b6..84da2157e6 100644 --- a/src/modules/dex/directives/createOrder/createOrder.html +++ b/src/modules/dex/directives/createOrder/createOrder.html @@ -108,8 +108,8 @@ - {{$ctrl.getRoundPriceTokensByTickSize().toFormat()}} + ng-click="$ctrl.setPrice($ctrl.getClosestValidPriceTokens())"> + {{$ctrl.getClosestValidPriceTokens().toFormat()}} @@ -130,8 +130,8 @@ - {{$ctrl.getRoundPriceTokensByTickSize().toFormat()}} + ng-click="$ctrl.setPrice($ctrl.getClosestValidPriceTokens())"> + {{$ctrl.getClosestValidPriceTokens().toFormat()}} From e29de706a49d40f9dab986792b0b866b82c03196 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Wed, 19 Jun 2019 17:57:33 +0300 Subject: [PATCH 14/25] CLIENT-1819: refactor --- .../dex/directives/createOrder/CreateOrder.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index e7bc783ac9..cdfe5d075c 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -327,8 +327,8 @@ * @return {Promise} */ setAmountByBalance(factor) { - const amount = this.maxAmount.cloneWithTokens( - this.getClosestValidAmountTokens(this.maxAmount.getTokens().times(factor)) + const amount = this.getClosestValidAmount( + this.maxAmount.getTokens().times(factor) ); this._updateField({ amount }); return Promise.resolve(); @@ -403,7 +403,7 @@ } /** - * @param value + * @param {BigNumber} value */ setPrice(value) { const price = this.priceBalance.cloneWithTokens(value); @@ -411,7 +411,7 @@ } /** - * @param value + * @param {BigNumber} value */ setAmount(value) { const amount = this.amountBalance.cloneWithTokens(value); @@ -543,10 +543,7 @@ * @param {BigNumber} value * @return {BigNumber|*} */ - getRoundPriceTokensByTickSize(value) { - const price = value ? - value : - this.priceBalance.cloneWithTokens(this.order.price.$viewValue).getTokens(); + getRoundPriceTokensByTickSize(price) { const roundedPrice = this.getRoundPriceByTickSize(price); if (!roundedPrice) { return; From 3bc0297198d48e3698ce83f9a37c5059548efa27 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Thu, 20 Jun 2019 17:01:10 +0300 Subject: [PATCH 15/25] CLIENT-1819: review fix --- src/modules/dex/directives/createOrder/CreateOrder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index cdfe5d075c..52da4e42f4 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -176,8 +176,8 @@ this.receive(dexDataService.chooseOrderBook, ({ type, price, amount }) => { this.expand(type); - const roundedPrice = this.getRoundPriceTokensByTickSize(new BigNumber(price)).toString(); - const roundedAmount = this.getClosestValidAmountTokens(new BigNumber(amount)).toString(); + const roundedPrice = this.getRoundPriceTokensByTickSize(new BigNumber(price)).toFixed(); + const roundedAmount = this.getClosestValidAmountTokens(new BigNumber(amount)).toFixed(); switch (type) { case 'buy': this._onClickBuyOrder(roundedPrice, roundedAmount); From 5968f1aa76e07be744f293f0523259a32d8fe5d3 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Wed, 3 Jul 2019 11:05:09 +0300 Subject: [PATCH 16/25] CLIENT-1819: fix round function --- src/modules/dex/directives/createOrder/CreateOrder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index 52da4e42f4..b9f1fb0f3b 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -512,7 +512,7 @@ return; } const { tickSize } = this.pairRestrictions; - const roundedPrice = price.decimalPlaces(tickSize.decimalPlaces(), BigNumber.ROUND_HALF_EVEN); + const roundedPrice = price.dividedToIntegerBy(tickSize).times(tickSize); return this.priceBalance.cloneWithTokens(roundedPrice); } @@ -577,7 +577,7 @@ } const { stepSize } = this.pairRestrictions; - const roundedAmount = value.decimalPlaces(stepSize.decimalPlaces()); + const roundedAmount = value.div(stepSize).integerValue().times(stepSize); return this.amountBalance.cloneWithTokens(roundedAmount); } From 303cb4bcfa32addcfb7c5fbe91742b26275b6203 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 23 Sep 2019 17:28:01 +0300 Subject: [PATCH 17/25] CLIENT-1819: change logic --- .../dex/directives/createOrder/CreateOrder.js | 245 ++++++++---------- .../directives/createOrder/createOrder.html | 38 +-- 2 files changed, 125 insertions(+), 158 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index 36293b581f..e7b25ea7c6 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -49,10 +49,10 @@ } /** - * @return {number} + * @return {boolean} */ get loadedPairRestrictions() { - return Object.keys(this.pairRestrictions).length; + return Object.keys(this.pairRestrictions).length > 0; } /** @@ -172,13 +172,13 @@ /** * @type {boolean} */ - isValidStepSize = false; + isValidAmountPrecision = false; /** * @type {boolean} */ - isValidTickSize = false; + isValidPricePrecision = false; /** - * @type {Object} + * @type {TPairRestrictions | {}} */ pairRestrictions = {}; @@ -190,8 +190,8 @@ this.receive(dexDataService.chooseOrderBook, ({ type, price, amount }) => { this.expand(type); - const roundedPrice = this.getRoundPriceTokensByTickSize(new BigNumber(price)).toFixed(); - const roundedAmount = this.getClosestValidAmountTokens(new BigNumber(amount)).toFixed(); + const roundedPrice = this._getRoundPriceByPrecision(new BigNumber(price)).getTokens().toString(); + const roundedAmount = this._getClosestValidAmount(new BigNumber(amount)).getTokens().toString(); switch (type) { case 'buy': this._onClickBuyOrder(roundedPrice, roundedAmount); @@ -253,8 +253,8 @@ } }); - this.isValidStepSize = this._validateStepSize(); - this.isValidTickSize = this._validateTickSize(); + this.isValidAmountPrecision = this._validateAmountPrecision(); + this.isValidPricePrecision = this._validatePricePrecision(); this.observe(['amountBalance', 'type', 'fee', 'priceBalance'], this._updateMaxAmountOrPriceBalance); this.observe(['maxAmountBalance', 'amountBalance', 'priceBalance'], this._setPairRestrictions); @@ -291,19 +291,29 @@ this.observe(['priceBalance', 'total', 'maxPriceBalance'], this._setIfCanBuyOrder); this.observe('amount', () => { - this.isValidStepSize = this._validateStepSize(); + this.isValidAmountPrecision = this._validateAmountPrecision(); if (!this._silenceNow) { this._updateField({ amount: this.amount }); } }); this.observe('price', () => { - this.isValidTickSize = this._validateTickSize(); - if (!this._silenceNow) { + this.isValidPricePrecision = this._validatePricePrecision(); + if (this._silenceNow) { this._updateField({ price: this.price }); } }); + $scope.$watch('$ctrl.order.price.$viewValue', () => { + this.isValidPricePrecision = this._validatePricePrecision(); + utils.safeApply(); + }); + + $scope.$watch('$ctrl.order.amount.$viewValue', () => { + this.isValidAmountPrecision = this._validateAmountPrecision(); + utils.safeApply(); + }); + this.observe('total', () => ( !this._silenceNow && this._updateField({ total: this.total }) )); @@ -348,7 +358,7 @@ } return this.maxAmount.cloneWithTokens( - this.getRoundAmountTokensByStepSize(this.maxAmount.getTokens().mul(factor)) + this._getRoundAmountByPrecision(this.maxAmount.getTokens().mul(factor)).getTokens() ).eq(amount); } @@ -357,7 +367,7 @@ * @return {Promise} */ setAmountByBalance(factor) { - const amount = this.getClosestValidAmount( + const amount = this._getClosestValidAmount( this.maxAmount.getTokens().mul(factor) ); this._updateField({ amount }); @@ -419,14 +429,14 @@ } setMaxAmount() { - const amount = this.getClosestValidAmount(this.maxAmount.getTokens()); + const amount = this._getClosestValidAmount(this.maxAmount.getTokens()); this._updateField({ amount }); } setMaxPrice() { - const amount = this.getRoundAmountByStepSize(this.maxAmount.getTokens()); - const price = this.getClosestValidPrice(this.price.getTokens()); - const total = this.getRoundPriceByTickSize( + const amount = this._getRoundAmountByPrecision(this.maxAmount.getTokens()); + const price = this._getClosestValidPrice(this.price.getTokens()); + const total = this.priceBalance.cloneWithTokens( price.getTokens().mul(amount.getTokens()) ); this._updateField({ amount, total, price }); @@ -535,28 +545,30 @@ /** * @param {BigNumber} price - * @return {Money|*} + * @return {Money} + * @private */ - getRoundPriceByTickSize(price) { + _getRoundPriceByPrecision(price) { if (!this.loadedPairRestrictions) { - return; + return this.priceBalance.cloneWithTokens(price); } - const { tickSize } = this.pairRestrictions; - const roundedPrice = price.dividedToIntegerBy(tickSize).mul(tickSize); + const { pricePrecision } = this.pairRestrictions; + const roundedPrice = price.roundTo(pricePrecision); return this.priceBalance.cloneWithTokens(roundedPrice); } /** * @param {BigNumber} price - * @return {Money|*} + * @return {Money} + * @private */ - getClosestValidPrice(price) { + _getClosestValidPrice(price) { if (!this.loadedPairRestrictions) { - return; + return this.priceBalance.cloneWithTokens(price); } const { minPrice, maxPrice } = this.pairRestrictions; - const roundedPrice = this.getRoundPriceTokensByTickSize(price); + const roundedPrice = this._getRoundPriceByPrecision(price).getTokens(); if (roundedPrice.lt(minPrice)) { return this.priceBalance.cloneWithTokens(minPrice); @@ -569,106 +581,50 @@ return this.priceBalance.cloneWithTokens(roundedPrice); } - /** - * @param {BigNumber} value - * @return {BigNumber|*} - */ - getRoundPriceTokensByTickSize(price) { - const roundedPrice = this.getRoundPriceByTickSize(price); - if (!roundedPrice) { - return; - } - return roundedPrice.getTokens(); - } - - /** - * @param {BigNumber} price - * @return {BigNumber|*} - */ - getClosestValidPriceTokens(value) { - const price = value ? - value : - this.priceBalance.cloneWithTokens(this.order.price.$viewValue).getTokens(); - const validPrice = this.getClosestValidPrice(price); - if (!validPrice) { - return; - } - - return validPrice.getTokens(); - } - /** * @param {BigNumber} value * @return {Money} + * @private */ - getRoundAmountByStepSize(value) { + _getRoundAmountByPrecision(value) { if (!this.loadedPairRestrictions) { - return; + return this.amountBalance.cloneWithTokens(value); } - const { stepSize } = this.pairRestrictions; - const roundedAmount = value.div(stepSize).integerValue().mul(stepSize); - return this.amountBalance.cloneWithTokens(roundedAmount); - } + const { amountPrecision } = this.pairRestrictions; - /** - * - * @param {BigNumber} value - * @return {BigNumber} - */ - getRoundAmountTokensByStepSize(value) { - const roundedAmount = this.getRoundAmountByStepSize(value); - if (!roundedAmount) { - return; - } - return roundedAmount.getTokens(); + const roundedAmount = value.roundTo(amountPrecision, 1); + return this.amountBalance.cloneWithTokens(roundedAmount); } /** * @param {BigNumber} amount - * @return {Money|*} + * @return {Money} + * @private */ - getClosestValidAmount(amount) { + _getClosestValidAmount(amount) { if (!this.loadedPairRestrictions) { - return; + return this.amountBalance.cloneWithTokens(amount); } - const { stepSize } = this.pairRestrictions; - const { minAmount, maxAmount } = this.pairRestrictions; - const roundedAmount = this.getRoundAmountTokensByStepSize(amount); + const { amountPrecision, minAmount, maxAmount } = this.pairRestrictions; + const roundedAmount = this._getRoundAmountByPrecision(amount).getTokens(); if (roundedAmount.lt(minAmount)) { return this.amountBalance.cloneWithTokens( - minAmount.decimalPlaces(stepSize.decimalPlaces()) + minAmount.roundTo(amountPrecision) ); } if (roundedAmount.gt(maxAmount)) { return this.amountBalance.cloneWithTokens( - maxAmount.decimalPlaces(stepSize.decimalPlaces()) + maxAmount.roundTo(amountPrecision) ); } return this.amountBalance.cloneWithTokens(roundedAmount); } - /** - * @param {BigNumber} value - * @return {BigNumber|*} - */ - getClosestValidAmountTokens(value) { - const amount = value ? - value : - this.amountBalance.cloneWithTokens(this.order.amount.$viewValue.replace(/\s/g, '')).getTokens(); - const validAmount = this.getClosestValidAmount(amount); - - if (!validAmount) { - return; - } - - return validAmount.getTokens(); - } - /** * @param data * @return {*|Promise} @@ -986,7 +942,7 @@ const amount = this._validAmount(); const total = amount.isZero() ? this.priceBalance.cloneWithTokens('0') : - this.getRoundPriceByTickSize(price.mul(amount)); + this.priceBalance.cloneWithTokens(price.mul(amount)); this._setDirtyField('total', total); this._silenceNow = true; } @@ -1000,7 +956,7 @@ } const total = this._validTotal(); const amount = this._validAmount(); - this._setDirtyField('price', this.getClosestValidPrice( + this._setDirtyField('price', this._getClosestValidPrice( total.div(amount) )); this._silenceNow = true; @@ -1016,7 +972,7 @@ const total = this._validTotal(); const price = this._validPrice(); - this._setDirtyField('amount', this.getClosestValidAmount( + this._setDirtyField('amount', this._getClosestValidAmount( total.div(price) )); this._silenceNow = true; @@ -1199,33 +1155,49 @@ } /** + * @return {Promise|Promise} * @private */ _setPairRestrictions() { if (!this.loaded) { - return; + return Promise.resolve(); } this.pairRestrictions = {}; const defaultPairRestriction = this._getDefaultPairRestriction(); - ds.api.matcher.getPairRestrictions({ - amountAsset: this.amountBalance.asset, - priceAsset: this.priceBalance.asset - }) - .then(info => { - const maxAmount = info.maxAmount ? - new BigNumber(info.maxAmount) : - defaultPairRestriction.maxAmount; + return ds.api.matcher + .getPairRestrictions({ + amountAsset: this.amountBalance.asset, + priceAsset: this.priceBalance.asset + }) + .then(data => { + const { maxAmount, maxPrice, stepPrice, stepAmount, minPrice, minAmount } = data.restrictions; + const restMaxAmount = maxAmount ? new BigNumber(maxAmount) : defaultPairRestriction.maxAmount; + const pricePrecision = stepPrice ? + Math.min( + new BigNumber(stepPrice).getDecimalsCount(), defaultPairRestriction.pricePrecision + ) : + defaultPairRestriction.pricePrecision; + const amountPrecision = stepAmount ? + Math.min( + new BigNumber(stepAmount).getDecimalsCount(), defaultPairRestriction.amountPrecision + ) : + defaultPairRestriction.amountPrecision; + this.pairRestrictions = { - maxPrice: info.maxPrice ? new BigNumber(info.maxPrice) : defaultPairRestriction.maxPrice, + maxPrice: maxPrice ? new BigNumber(maxPrice) : defaultPairRestriction.maxPrice, maxAmount: this.maxAmountBalance ? - this.maxAmountBalance.getTokens() : - maxAmount, - tickSize: info.tickSize ? new BigNumber(info.tickSize) : defaultPairRestriction.tickSize, - stepSize: info.stepSize ? new BigNumber(info.stepSize) : defaultPairRestriction.stepSize, - minPrice: info.minPrice ? new BigNumber(info.minPrice) : defaultPairRestriction.minPrice, - minAmount: info.minAmount ? new BigNumber(info.minAmount) : defaultPairRestriction.minAmount + BigNumber.min(this.maxAmountBalance.getTokens(), restMaxAmount) : + restMaxAmount, + minPrice: minPrice ? + BigNumber.max(new BigNumber(minPrice), defaultPairRestriction.minPrice) : + defaultPairRestriction.minPrice, + minAmount: minAmount ? + BigNumber.max(new BigNumber(minAmount), defaultPairRestriction.minAmount) : + defaultPairRestriction.minAmount, + pricePrecision, + amountPrecision }; }) .catch(() => { @@ -1234,12 +1206,12 @@ } /** - * @return {{minAmount, minPrice, stepSize, maxPrice, maxAmount, tickSize}} + * @return {TPairRestrictions} * @private */ _getDefaultPairRestriction() { - const tickSize = new BigNumber(Math.pow(10, -this.priceBalance.asset.precision)); - const stepSize = new BigNumber(Math.pow(10, -this.amountBalance.asset.precision)); + const pricePrecision = this.priceBalance.asset.precision; + const amountPrecision = this.amountBalance.asset.precision; const maxPrice = new BigNumber(Infinity); const maxAmount = this.maxAmountBalance ? this.maxAmountBalance.getTokens() : @@ -1247,34 +1219,37 @@ return ({ maxPrice, maxAmount, - tickSize, - stepSize, - minPrice: tickSize, - minAmount: stepSize + pricePrecision, + amountPrecision, + minPrice: (new BigNumber(10)).pow(-pricePrecision), + minAmount: (new BigNumber(10)).pow(-amountPrecision) }); } /** * @return {boolean} */ - _validateStepSize() { - if (!this.amount) { + _validateAmountPrecision() { + if (!this.loadedPairRestrictions) { return true; } - return this.amount.getTokens().modulo(this.pairRestrictions.stepSize).isZero(); + const { amountPrecision } = this.pairRestrictions; + + return (new BigNumber(this.order.amount.$viewValue)).getDecimalsCount() <= amountPrecision; } /** * @return {boolean} */ - _validateTickSize() { - const { tickSize, minPrice, maxPrice } = this.pairRestrictions; - if (!this.price || this.price.getTokens().lte(minPrice) || this.price.getTokens().gte(maxPrice)) { + _validatePricePrecision() { + if (!this.loadedPairRestrictions) { return true; } - return this.price.getTokens().modulo(tickSize).isZero(); + const { pricePrecision } = this.pairRestrictions; + + return (new BigNumber(this.order.price.$viewValue)).getDecimalsCount() <= pricePrecision; } static _animateNotification($element) { @@ -1326,3 +1301,13 @@ controller }); })(); + +/** + * @typedef {object} TPairRestrictions + * @property {BigNumber} maxPrice + * @property {BigNumber} maxAmount + * @property {BigNumber} minPrice + * @property {BigNumber} minAmount + * @property {number} pricePrecision + * @property {number} amountPrecision + */ diff --git a/src/modules/dex/directives/createOrder/createOrder.html b/src/modules/dex/directives/createOrder/createOrder.html index e9fcf98390..ccb3c30dcf 100644 --- a/src/modules/dex/directives/createOrder/createOrder.html +++ b/src/modules/dex/directives/createOrder/createOrder.html @@ -93,10 +93,10 @@ type="text" ng-blur="$ctrl.setChangedInput('price')" w-validate - w-validator-custom="{{$ctrl.isValidTickSize}}" w-validator-asset="{{$ctrl.priceBalance.asset}}" w-validator-lte="{{$ctrl.pairRestrictions.maxPrice}}" w-validator-gte="{{$ctrl.pairRestrictions.minPrice}}" + w-validator-custom="{{$ctrl.isValidPricePrecision}}" name="price" ng-model="$ctrl.price" autocomplete="off" @@ -105,13 +105,6 @@
{{$ctrl.priceDisplayName}}
- - - - {{$ctrl.getClosestValidPriceTokens().toFormat()}} - - @@ -127,11 +120,9 @@ - - - - {{$ctrl.getClosestValidPriceTokens().toFormat()}} + + @@ -163,7 +154,7 @@ w-validator-asset="{{$ctrl.amountBalance.asset}}" w-validator-lte="{{$ctrl.maxAmountBalance ? $ctrl.maxAmountBalance : $ctrl.pairRestrictions.maxAmount}}" w-validator-gte="{{$ctrl.pairRestrictions.minAmount}}" - w-validator-custom="{{$ctrl.isValidStepSize}}" + w-validator-custom="{{$ctrl.isValidAmountPrecision}}" name="amount" ng-model="$ctrl.amount" autocomplete="off" @@ -180,13 +171,6 @@ {{$ctrl.pairRestrictions.minAmount.toFormat()}} - - - - {{$ctrl.getClosestValidAmountTokens().toFormat()}} - - - - - - {{$ctrl.getClosestValidAmountTokens().toFormat()}} - - + + + +
From c3d8bcbd6fa742903f981126224335042843e9af Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 23 Sep 2019 17:33:04 +0300 Subject: [PATCH 18/25] CLIENT-1819: change logic --- src/modules/dex/directives/createOrder/CreateOrder.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index e7b25ea7c6..2d8f3ffbdb 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -940,9 +940,7 @@ } const price = this._validPrice(); const amount = this._validAmount(); - const total = amount.isZero() ? - this.priceBalance.cloneWithTokens('0') : - this.priceBalance.cloneWithTokens(price.mul(amount)); + const total = this.priceBalance.cloneWithTokens(price.mul(amount)); this._setDirtyField('total', total); this._silenceNow = true; } From 267fcafcefc6c6f0c644b1bce0f97fd5e4fd9214 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 23 Sep 2019 18:25:53 +0300 Subject: [PATCH 19/25] CLIENT-1819: update locales --- locale/de/app.dex.json | 10 ++++++++++ locale/de/app.utils.json | 16 +++++++++++----- locale/en/app.dex.json | 10 ++++++++++ locale/en/app.utils.json | 16 +++++++++++----- locale/es/app.dex.json | 10 ++++++++++ locale/es/app.utils.json | 16 +++++++++++----- locale/et_EE/app.dex.json | 10 ++++++++++ locale/et_EE/app.utils.json | 16 +++++++++++----- locale/fr/app.dex.json | 10 ++++++++++ locale/fr/app.utils.json | 16 +++++++++++----- locale/hi_IN/app.dex.json | 10 ++++++++++ locale/hi_IN/app.utils.json | 16 +++++++++++----- locale/id/app.dex.json | 10 ++++++++++ locale/id/app.utils.json | 16 +++++++++++----- locale/it/app.dex.json | 10 ++++++++++ locale/it/app.utils.json | 16 +++++++++++----- locale/ja/app.dex.json | 10 ++++++++++ locale/ja/app.utils.json | 16 +++++++++++----- locale/ko/app.dex.json | 10 ++++++++++ locale/ko/app.utils.json | 16 +++++++++++----- locale/nl_NL/app.dex.json | 10 ++++++++++ locale/nl_NL/app.ledger.json | 2 +- locale/nl_NL/app.utils.json | 16 +++++++++++----- locale/pl/app.dex.json | 10 ++++++++++ locale/pl/app.utils.json | 16 +++++++++++----- locale/pt_BR/app.dex.json | 10 ++++++++++ locale/pt_BR/app.utils.json | 16 +++++++++++----- locale/pt_PT/app.dex.json | 10 ++++++++++ locale/pt_PT/app.utils.json | 16 +++++++++++----- locale/ru/app.dex.json | 10 ++++++++++ locale/ru/app.utils.json | 16 +++++++++++----- locale/tr/app.dex.json | 10 ++++++++++ locale/tr/app.utils.json | 16 +++++++++++----- locale/zh_CN/app.dex.json | 10 ++++++++++ locale/zh_CN/app.ledger.json | 2 +- locale/zh_CN/app.utils.json | 16 +++++++++++----- .../dex/directives/createOrder/createOrder.html | 8 ++++---- 37 files changed, 363 insertions(+), 91 deletions(-) diff --git a/locale/de/app.dex.json b/locale/de/app.dex.json index 9e7079a5b6..bc9791d96a 100644 --- a/locale/de/app.dex.json +++ b/locale/de/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[Das Diagramm konnte nicht heruntergeladen werden.] {div}[Wenn Sie dieses Diagramm in Ihrer Anwendung verwenden möchten, senden Sie eine Anfrage an [tradingview.com](https://tradingview.com)]" }, + "charts": "charts", "createOrder": { "1day": "1 Tag", "1hour": "1 Stunde", @@ -32,8 +33,12 @@ "buy": "Kaufen", "createOrderNotPermitted": "Bestellungen sind vorübergehend nicht verfügbar", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "Nicht genug {{name}}", "precision": "Das Maximum der {{precision}} Dezimalstellen wurde überschritten", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "Dieses Feld wird benötigt" }, "expiration": "Ablauf", @@ -63,6 +68,8 @@ "priceField": "Limitpreis", "sell": "Verkaufen", "spread": "Abstand", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "Gesamt" }, "demo": { @@ -144,6 +151,7 @@ "header": "Etwas ist schief gelaufen" } }, + "orders": "orders", "portfolio": { "title": "Portfolio" }, @@ -229,10 +237,12 @@ "all": "Alle", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "Mein Guthaben", "myTradeHistory": "Meine Handelsgeschichte", "openOrders": "Meine offenen Bestellungen", "OrderHistory": "Meine Bestellhistorie", + "trade": "Trade", "tradeHistory": "Handelsgeschichte", "waves": "Waves" } diff --git a/locale/de/app.utils.json b/locale/de/app.utils.json index 72d3fcbe0f..57591a43e7 100644 --- a/locale/de/app.utils.json +++ b/locale/de/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "Bitte hinterlegen sie ETH nicht von Smart Contracts! Hinterlegen sie keine ERC20 Tokens! Nur Ethereum ist erlaubt." }, "wavesGatewayVST": { - "helpDescrText": "Sobald die Transaktion bestätigt ist, verarbeitet das Gateway die Übertragung der Vostok Token zu einem Token in ihrem Waves Account.", - "helpDescrTitle": "Geben Sie diese Adresse in Ihren Vostok-Kunden oder Ihr Wallet ein.", + "helpDescrText": "Sobald die Transaktion bestätigt ist, verarbeitet das Gateway die Übertragung der VST Token zu einem Token in ihrem Waves Account.", + "helpDescrTitle": "Geben Sie diese Adresse in Ihren VST-Kunden oder Ihr Wallet ein.", "warningMinAmountTitle": "Der Mindesteinzahlungsbetrag beträgt {{minAmount, BigNumber}} {{assetTicker}}, der Höchsteinzahlungsbetrag beträgt {{maxAmount}} {{assetTicker}}" } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "Importieren sie Accounts von Waves Lite Client" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "Teilen sie einen Link zu einer Rechnung", "verified": "Geprüft", "vostok": { - "serverError": "Der Vostok Service ist vorübergehend nicht verfügbar. Versuchen sie es später noch einmal." + "serverError": "Der VST Service ist vorübergehend nicht verfügbar. Versuchen sie es später noch einmal." }, "wtry": { "info": "Bei Problemen mit der Zahlungsabwicklung wenden sie sich bitte an das Support-Team von Digilira - [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "Fehler beim Abrufen der Anbieterinformationen. Bitte überprüfen Sie die Adresse und versuchen Sie es erneut", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "Keine verdächtigen Token anzeigen", + "edit": "Edit", "forDisableClear": "Um es vollständig zu deaktivieren, löschen Sie das Feld.", "matcherAddress": "Matcher Adresse", "nodeAddress": "Knotenadresse", @@ -946,7 +952,7 @@ "1_3_0": "{span.line}[1. Verbesserte App-Navigation und Startseitenoberfläche.]", "1_3_18": "{span.line}[1. Added login to wallet using a private key.]\n{span.line}[2. The 24 hours price change of a token is now bound to token/WAVES pair.]", "1_3_19": "{span.line}[1. Bancor gateway has been launched.]\n{span.line}[2. User menu interface has been improved.]", - "1_3_2": "{span.line}[1. Das Vostok-Gateway wurde gestartet.] \n {span.line}[2. Verbesserte Benutzeroberfläche und zusätzliche kleinere Fehler wurden behoben.]", + "1_3_2": "{span.line}[1. Das VST-Gateway wurde gestartet.] \n {span.line}[2. Verbesserte Benutzeroberfläche und zusätzliche kleinere Fehler wurden behoben.]", "1_3_20": "{span.line}[1. Improved system for storing and restoring accounts from local storage (Need to update the [desktop application](https://wavesplatform.com/technology/wallet)).]\n{span.line}[2. Fixed rounding of prices in the orderbook.]", "1_3_5": "{span.line}[1. A tab with [wsoc.io](https://wsoc.io) contest tokens has been added.]\n{span.line}[2. French language support added.]\n{span.line}[3. Additional minor bugs have been fixed.]", "1_3_7": "{span.line}[1. Integration with [tokenrating.wavesexplorer.com](https://tokenrating.wavesexplorer.com) Now you can rate tokens directly in the app.]\n{span.line}[2. Additional minor bugs have been fixed.]", diff --git a/locale/en/app.dex.json b/locale/en/app.dex.json index 2488ac2ab3..60826cd1aa 100644 --- a/locale/en/app.dex.json +++ b/locale/en/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[The chart could not be downloaded.]{div}[If you want to use this chart in your application, please send a request to [tradingview.com](https://tradingview.com)]" }, + "charts": "charts", "createOrder": { "1day": "1 day", "1hour": "1 hour", @@ -32,8 +33,12 @@ "buy": "Buy", "createOrderNotPermitted": "Orders is temporarily unavailable", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "Not enough {{name}}", "precision": "Exceeded maximum of {{precision}} decimal places", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "This field is required" }, "expiration": "Expiration", @@ -63,6 +68,8 @@ "priceField": "Limit price", "sell": "Sell", "spread": "spread", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "Total" }, "demo": { @@ -144,6 +151,7 @@ "header": "Something went wrong" } }, + "orders": "orders", "portfolio": { "title": "Portfolio" }, @@ -229,10 +237,12 @@ "all": "All", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "My Balance", "myTradeHistory": "My Trade History", "openOrders": "My Open Orders", "OrderHistory": "My Order History", + "trade": "Trade", "tradeHistory": "Trade History", "waves": "Waves" } diff --git a/locale/en/app.utils.json b/locale/en/app.utils.json index fcc433b9e0..75e3940d0b 100644 --- a/locale/en/app.utils.json +++ b/locale/en/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "Please do not deposit ETH from smart contracts! Do not deposit ERC20 tokens! Only Ethereum is allowed." }, "wavesGatewayVST": { - "helpDescrText": "Once the transaction is confirmed, the gateway will process the transfer of Vostok to a token in your Waves account.", - "helpDescrTitle": "Enter this address into your Vostok client or wallet", + "helpDescrText": "Once the transaction is confirmed, the gateway will process the transfer of VST to a token in your Waves account.", + "helpDescrTitle": "Enter this address into your VST client or wallet", "warningMinAmountTitle": "The minimum amount of deposit is {{minAmount, BigNumber}} {{assetTicker}}, the maximum amount of deposit is {{maxAmount}} {{assetTicker}}" } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "Import accounts from Waves Lite Client" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "Share a Link to an Invoice", "verified": "Verified", "vostok": { - "serverError": "Service Vostok temporarily unavailable. Try again later." + "serverError": "Service VST temporarily unavailable. Try again later." }, "wtry": { "info": "In case of problems with payment processing, please contact the Digilira support team — [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "Failed to get provider information. Please check the address and try again", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "Don't show suspicious tokens", + "edit": "Edit", "forDisableClear": "For completely disable it, clear the field.", "matcherAddress": "Matcher address", "nodeAddress": "Node address", @@ -946,7 +952,7 @@ "1_3_0": "{span.line}[1. Improved app navigation and start page interface.]", "1_3_18": "{span.line}[1. Added login to wallet using a private key.]\n{span.line}[2. The 24 hours price change of a token is now bound to token/WAVES pair.]", "1_3_19": "{span.line}[1. Bancor gateway has been launched.]\n{span.line}[2. User menu interface has been improved.]", - "1_3_2": "{span.line}[1. Vostok gateway has been launched.]\n{span.line}[2. Improved UI and additional minor bugs have been fixed.]", + "1_3_2": "{span.line}[1. VST gateway has been launched.]\n{span.line}[2. Improved UI and additional minor bugs have been fixed.]", "1_3_20": "{span.line}[1. Improved system for storing and restoring accounts from local storage (Need to update the [desktop application](https://wavesplatform.com/technology/wallet)).]\n{span.line}[2. Fixed rounding of prices in the orderbook.]", "1_3_5": "{span.line}[1. A tab with [wsoc.io](https://wsoc.io) contest tokens has been added.]\n{span.line}[2. French language support added.]\n{span.line}[3. Additional minor bugs have been fixed.]", "1_3_7": "{span.line}[1. Integration with [tokenrating.wavesexplorer.com](https://tokenrating.wavesexplorer.com) Now you can rate tokens directly in the app.]\n{span.line}[2. Additional minor bugs have been fixed.]", diff --git a/locale/es/app.dex.json b/locale/es/app.dex.json index 6c2dea7777..537de9081c 100644 --- a/locale/es/app.dex.json +++ b/locale/es/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[No se puede descargar el gráfico.]{div}[Si quieres usar este gráfico en tu aplicación, por favor envía una petición a [tradingview.com](https://tradingview.com)]" }, + "charts": "charts", "createOrder": { "1day": "1 día", "1hour": "1 hora", @@ -32,8 +33,12 @@ "buy": "Comprar", "createOrderNotPermitted": "Los pedidos no estàn disponible temporalmente", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "No hay suficiente {{name}}", "precision": "Excedido el máximo de {{precision}} lugares decimales", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "Se requiere este campo" }, "expiration": "Terminación", @@ -63,6 +68,8 @@ "priceField": "Precio límite", "sell": "Vender", "spread": "diferencial", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "Total" }, "demo": { @@ -144,6 +151,7 @@ "header": "Algo ha salido mal" } }, + "orders": "orders", "portfolio": { "title": "Portafolio" }, @@ -229,10 +237,12 @@ "all": "Todo", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "Mi balance", "myTradeHistory": "Mi historial", "openOrders": "Mis órdenes abiertas", "OrderHistory": "Mi historial de ordenes", + "trade": "Trade", "tradeHistory": "Historial", "waves": "Waves" } diff --git a/locale/es/app.utils.json b/locale/es/app.utils.json index 905a7fa04a..ff5758a185 100644 --- a/locale/es/app.utils.json +++ b/locale/es/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "!Por favor no deposites ETH desde Smart-Contract! No deposites tokens ERC20, solo se acepta Ethereum." }, "wavesGatewayVST": { - "helpDescrText": "Una vez que se confirma la transacción, la puerta de enlace procesará la transferencia de Vostok en forma de token a su cuenta Waves.", - "helpDescrTitle": "Ingrese esta dirección en su cartera o cliente Vostok", + "helpDescrText": "Una vez que se confirma la transacción, la puerta de enlace procesará la transferencia de VST en forma de token a su cuenta Waves.", + "helpDescrTitle": "Ingrese esta dirección en su cartera o cliente VST", "warningMinAmountTitle": "La cantidad mínima de depósito es {{minAmount, BigNumber}} {{assetTicker}}, la cantidad máxima de depósito es {{maxAmount}} {{assetTicker}}" } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "Importar cuentas desde Waves Lite Client" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "Comparte un Link a la factura", "verified": "Verificado", "vostok": { - "serverError": "Servicio Vostok temporalmente no disponible. Inténtalo de nuevo más tarde." + "serverError": "Servicio VST temporalmente no disponible. Inténtalo de nuevo más tarde." }, "wtry": { "info": "Si tuvieras problemas con el proceso de pago, por favor, contacta con el equipo de soporte de Digilira - [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "No se ha podido obtener la información del proveedor. Compruebe la dirección e inténtelo de nuevo", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "No mostrar tokens sospechosos", + "edit": "Edit", "forDisableClear": "Para desactivarlo por completo, borre el campo.", "matcherAddress": "Dirección del Matcher", "nodeAddress": "Dirección del Nodo", @@ -946,7 +952,7 @@ "1_3_0": "\"span.line\" [1. Se ha mejorado la navegación de la aplicación y la interfaz de la página de inicio.]", "1_3_18": "{span.line} [1. Inicio de sesión agregado a la billetera con clave privada.] \n {span.line} [2. El cambio de precio de 24 horas de un token ahora está vinculado al par de tokens / WAVES.]", "1_3_19": "{span.line}[1. Se ha puesto en marcha la puerta de enlace Bancor.]\n{span.line}[2. Se ha corregido la interfaz de usuario y algunos errores menores.]", - "1_3_2": "\"span.line\" [1. Se ha puesto en marcha la puerta de enlace Vostok.]\n\"span.line\" [2. Se ha corregido la interfaz de usuario y algunos errores menores.]", + "1_3_2": "\"span.line\" [1. Se ha puesto en marcha la puerta de enlace VST.]\n\"span.line\" [2. Se ha corregido la interfaz de usuario y algunos errores menores.]", "1_3_20": "{span.line} [1. Sistema mejorado para almacenar y restaurar cuentas desde el almacenamiento local (es necesario actualizar la [aplicación de escritorio] (https://wavesplatform.com/technology/wallet)).] \n {span.line} [2. Se corrigió el redondeo de precios en el libro de pedidos.]", "1_3_5": "\"span.line\" [1. Se ha añadido una pestaña con tokens de concurso [wsoc.io](https://wsoc.io).\n\"span.line\" [2. Se ha añadido compatibilidad con el idioma francés.]\n\"span.line\" [3. Se han corregido errores menores adicionales.]", "1_3_7": "\"span.line\" [1. Integración con [tokenrating.wavesexplorer.com](https://tokenrating.wavesexplorer.com) Ahora puede calificar tokens directamente en la aplicación.]\n\"span.line\" [2. Se han corregido errores menores.]", diff --git a/locale/et_EE/app.dex.json b/locale/et_EE/app.dex.json index c72e1c421f..a964fce5f5 100644 --- a/locale/et_EE/app.dex.json +++ b/locale/et_EE/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div} [Diagrammi ei õnnestunud alla laadida.] {div} [Kui soovite seda skeemi oma rakenduses kasutada, saatke palun oma päring [tradingview.com'le](https://tradingview.com)]" }, + "charts": "charts", "createOrder": { "1day": "1 päev", "1hour": "1 tund", @@ -32,8 +33,12 @@ "buy": "Osta", "createOrderNotPermitted": "Orderid ei ole ajutiselt saadaval", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "Pole piisavalt {{name}}", "precision": "Ületati maksimaalselt kasutatava {{precision}} kümnendkoha", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "Selle välja täitmine on kohustuslik" }, "expiration": "Aegumine", @@ -63,6 +68,8 @@ "priceField": "Piirhind", "sell": "Müü", "spread": "hinnavahe", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "Kokku" }, "demo": { @@ -144,6 +151,7 @@ "header": "Midagi läks valesti" } }, + "orders": "orders", "portfolio": { "title": "Portfell" }, @@ -229,10 +237,12 @@ "all": "Kõik", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "Minu Saldod", "myTradeHistory": "Minu Kauplemisajalugu", "openOrders": "Minu Avatud Orderid", "OrderHistory": "My Order History", + "trade": "Trade", "tradeHistory": "Kauplemisajalugu", "waves": "Waves" } diff --git a/locale/et_EE/app.utils.json b/locale/et_EE/app.utils.json index 7a72be88b6..a2caf9da1b 100644 --- a/locale/et_EE/app.utils.json +++ b/locale/et_EE/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "Palun ärge tehke sissemakset ETH smart-kontrakrtidelt! Ärge tehkse sissemakseid ERC20 tokenites! Ainult Ethereum on lubatud." }, "wavesGatewayVST": { - "helpDescrText": "Once the transaction is confirmed, the gateway will process the transfer of Vostok to a token in your Waves account.", - "helpDescrTitle": "Enter this address into your Vostok client or wallet", + "helpDescrText": "Once the transaction is confirmed, the gateway will process the transfer of VST to a token in your Waves account.", + "helpDescrTitle": "Enter this address into your VST client or wallet", "warningMinAmountTitle": "The minimum amount of deposit is {{minAmount, BigNumber}} {{assetTicker}}, the maximum amount of deposit is {{maxAmount}} {{assetTicker}}" } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "Importige kontosid Waves Lite kliendist" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "Jaga link arvele", "verified": "Verifitseeritud", "vostok": { - "serverError": "Service Vostok temporarily unavailable. Try again later." + "serverError": "Service VST temporarily unavailable. Try again later." }, "wtry": { "info": "Makse töötlemisega seotud probleemide korral palun võtke ühendust Digilira tugimeeskonnaga — [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "Teenusepakkuja teabe hankimine ebaõnnestus. Palun kontrollige aadressi ja proovige uuesti", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "Don't show suspicious tokens", + "edit": "Edit", "forDisableClear": "For completely disable it, clear the field.", "matcherAddress": "Matcher'i aadress", "nodeAddress": "Sõlme aadress", @@ -946,7 +952,7 @@ "1_3_0": "{span.line}[1. Improved app navigation and start page interface.]", "1_3_18": "{span.line}[1. Added login to wallet using a private key.]\n{span.line}[2. The 24 hours price change of a token is now bound to token/WAVES pair.]", "1_3_19": "{span.line}[1. Bancor gateway has been launched.]\n{span.line}[2. User menu interface has been improved.]", - "1_3_2": "{span.line}[1. Vostok gateway has been launched.]\n{span.line}[2. Improved UI and additional minor bugs have been fixed.]", + "1_3_2": "{span.line}[1. VST gateway has been launched.]\n{span.line}[2. Improved UI and additional minor bugs have been fixed.]", "1_3_20": "{span.line}[1. Improved system for storing and restoring accounts from local storage (Need to update the [desktop application](https://wavesplatform.com/technology/wallet)).]\n{span.line}[2. Fixed rounding of prices in the orderbook.]", "1_3_5": "{span.line}[1. A tab with [wsoc.io](https://wsoc.io) contest tokens has been added.]\n{span.line}[2. French language support added.]\n{span.line}[3. Additional minor bugs have been fixed.]", "1_3_7": "{span.line}[1. Integration with [tokenrating.wavesexplorer.com](https://tokenrating.wavesexplorer.com) Now you can rate tokens directly in the app.]\n{span.line}[2. Additional minor bugs have been fixed.]", diff --git a/locale/fr/app.dex.json b/locale/fr/app.dex.json index fa1646ae67..2f3e92e474 100644 --- a/locale/fr/app.dex.json +++ b/locale/fr/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[Le graphique n'a pas pu être téléchargé.]{div}[Si vous désirez utiliser ce graphique dans votre application, veuillez envoyer une requête à [tradingview.com](https://tradingview.com)]" }, + "charts": "charts", "createOrder": { "1day": "1 jour", "1hour": "1 heure", @@ -32,8 +33,12 @@ "buy": "Acheter", "createOrderNotPermitted": "Les ordres sont temporairement indisponibles", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "Insuffisant {{name}}", "precision": "Dépassement du maximum de {{precision}} décimales", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "Ce champ est requis" }, "expiration": "Expiration", @@ -63,6 +68,8 @@ "priceField": "Prix limite", "sell": "Vendre", "spread": "Écart", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "Total" }, "demo": { @@ -144,6 +151,7 @@ "header": "Une erreur est survenue" } }, + "orders": "orders", "portfolio": { "title": "Portfolio" }, @@ -229,10 +237,12 @@ "all": "Tout", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "Mon solde", "myTradeHistory": "Historique de mes échanges", "openOrders": "Mes ordres ouverts", "OrderHistory": "Mon historique d'ordres", + "trade": "Trade", "tradeHistory": "Historique d'échanges", "waves": "Waves" } diff --git a/locale/fr/app.utils.json b/locale/fr/app.utils.json index a29983c62e..37962b040c 100644 --- a/locale/fr/app.utils.json +++ b/locale/fr/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "Ne déposez pas d'ETH à partir de smart-contracts ! Ne déposez pas de tokens ERC20 ! Seul Ethereum est autorisé." }, "wavesGatewayVST": { - "helpDescrText": "Une fois la transaction confirmée, le portail traitera le transfert de Vostok vers un jeton dans votre compte Waves.", - "helpDescrTitle": "Entrez cette adresse dans votre client ou portefeuille Vostok", + "helpDescrText": "Une fois la transaction confirmée, le portail traitera le transfert de VST vers un jeton dans votre compte Waves.", + "helpDescrTitle": "Entrez cette adresse dans votre client ou portefeuille VST", "warningMinAmountTitle": "Le montant minimum du dépôt est de {{minAmount, BigNumber}} {{assetTicker}}, le montant maximum du dépôt est de {{maxAmount}} {{assetTicker}}" } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "Importer des comptes depuis le Client Waves Lite" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "Partager un lien vers une facture", "verified": "Vérifié", "vostok": { - "serverError": "Service Vostok temporairement indisponible. Veuillez réessayez plus tard." + "serverError": "Service VST temporairement indisponible. Veuillez réessayez plus tard." }, "wtry": { "info": "En cas de problèmes avec le traitement des paiements, veuillez contacter l'équipe de support Digilira - [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "Échec de l'obtention d'informations sur le fournisseur. Veuillez vérifier l'adresse et réessayer", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "Ne pas afficher les jetons suspects", + "edit": "Edit", "forDisableClear": "Pour le désactiver complètement, effacez le champ.", "matcherAddress": "Adresse du coupleur", "nodeAddress": "Adresse du node", @@ -946,7 +952,7 @@ "1_3_0": "{span.line}[1. Amélioration de la navigation dans l'application et de l'interface de la page de démarrage.]", "1_3_18": "{span.line}[1. Ajout de la connexion au portefeuille à l'aide d'une clé privée.] \n{span.line}[2. Le changement de prix d'un jeton sur 24 heures est désormais lié à la paire jeton/WAVES.]", "1_3_19": "{span.line}[1. Le portail Bancor a été lancé.] \n{span.line}[2. Interface utilisateur améliorée.]", - "1_3_2": "{span.line}[1. Le portail Vostok a été lancé.] \n{span.line}[2. Interface utilisateur améliorée et correction de bugs mineurs supplémentaires.]", + "1_3_2": "{span.line} [1. Le portail VST a été lancé.] \n{span.line} [2. Interface utilisateur améliorée et correction de bugs mineurs supplémentaires.]", "1_3_20": "{span.line}[1. Improved system for storing and restoring accounts from local storage (Need to update the [desktop application](https://wavesplatform.com/technology/wallet)).]\n{span.line}[2. Fixed rounding of prices in the orderbook.]", "1_3_5": "{span.line}[1. Un onglet avec les jetons du concours [wsoc.io] (https://wsoc.io) a été ajouté.] \n {span.line}[2. Prise en charge de la langue française ajoutée.] \n {span.line}[3. Des bugs mineurs supplémentaires ont été corrigés.]", "1_3_7": "{span.line}[1. Intégration avec [tokenrating.wavesexplorer.com] (https://tokenrating.wavesexplorer.com) Vous pouvez maintenant noter les jetons directement dans l'application.] \n {span.line}[2. Des bugs mineurs supplémentaires ont été corrigés.]", diff --git a/locale/hi_IN/app.dex.json b/locale/hi_IN/app.dex.json index 68e1e76f0f..0755b5a2f5 100644 --- a/locale/hi_IN/app.dex.json +++ b/locale/hi_IN/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[यह चार्ट डाउनलोड नहीं किया जा सका।]{div}[यदि आप इस चार्ट को अपेन ऐप्लिकेशन में उपयोग करना चाहतें हैं तो कृपया [tradingview.com](https://tradingview.com) को अनुरोध भेजें]" }, + "charts": "charts", "createOrder": { "1day": "1 दिन", "1hour": "1 घंटे", @@ -32,8 +33,12 @@ "buy": "खरीदें", "createOrderNotPermitted": "ओर्डर अस्थायी रूप से अनुपलब्ध हैं", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "पर्याप्त {{name}} नहीं", "precision": "अधिकतम {{precision}} दशमलव स्थानों से अधिक है", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "यह क्षेत्र जरूरी है" }, "expiration": "अवसान", @@ -63,6 +68,8 @@ "priceField": "मूल्य सीमित करें", "sell": "बेचना", "spread": "स्प्रेड", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "कुल योग" }, "demo": { @@ -144,6 +151,7 @@ "header": "कुछ गलत हुआ" } }, + "orders": "orders", "portfolio": { "title": "पोर्टफोलियो" }, @@ -229,10 +237,12 @@ "all": "सभी", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "मेरा बैलेंस", "myTradeHistory": "मेरा ट्रेड इतिहास", "openOrders": "मेरे खुले ऑर्डर", "OrderHistory": "My Order History", + "trade": "Trade", "tradeHistory": "ट्रेड इतिहास", "waves": "Waves" } diff --git a/locale/hi_IN/app.utils.json b/locale/hi_IN/app.utils.json index 59108afc8f..f5cd57c295 100644 --- a/locale/hi_IN/app.utils.json +++ b/locale/hi_IN/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "कृपया स्मार्ट-कॉन्ट्रैक्ट से ETH जमा ना करें! ERC20 टोकन जमा ना करें! केवल Ethereum अनुमत है।" }, "wavesGatewayVST": { - "helpDescrText": "Once the transaction is confirmed, the gateway will process the transfer of Vostok to a token in your Waves account.", - "helpDescrTitle": "Enter this address into your Vostok client or wallet", + "helpDescrText": "Once the transaction is confirmed, the gateway will process the transfer of VST to a token in your Waves account.", + "helpDescrTitle": "Enter this address into your VST client or wallet", "warningMinAmountTitle": "The minimum amount of deposit is {{minAmount, BigNumber}} {{assetTicker}}, the maximum amount of deposit is {{maxAmount}} {{assetTicker}}" } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "वेव्स लाइट क्लाइंट से खाते आयात करें" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "किसी इनवॉइस का लिंक साझा करें", "verified": "सत्यापित", "vostok": { - "serverError": "Service Vostok temporarily unavailable. Try again later." + "serverError": "Service VST temporarily unavailable. Try again later." }, "wtry": { "info": "भुगतान प्रोसेसिंग की समस्याओं की स्थिति में, कृपया Digilira सपोर्टिंग टीम से संपर्क करें — [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "प्रदाता की जानकारी प्राप्त करने में विफल। कृपया पते की जांच करें और पुनः प्रयास करें", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "Don't show suspicious tokens", + "edit": "Edit", "forDisableClear": "For completely disable it, clear the field.", "matcherAddress": "मैचर पता", "nodeAddress": "नोड पता", @@ -946,7 +952,7 @@ "1_3_0": "{span.line}[1. Improved app navigation and start page interface.]", "1_3_18": "{span.line}[1. Added login to wallet using a private key.]\n{span.line}[2. The 24 hours price change of a token is now bound to token/WAVES pair.]", "1_3_19": "{span.line}[1. Bancor gateway has been launched.]\n{span.line}[2. User menu interface has been improved.]", - "1_3_2": "{span.line}[1. Vostok gateway has been launched.]\n{span.line}[2. Improved UI and additional minor bugs have been fixed.]", + "1_3_2": "{span.line}[1. VST gateway has been launched.]\n{span.line}[2. Improved UI and additional minor bugs have been fixed.]", "1_3_20": "{span.line}[1. Improved system for storing and restoring accounts from local storage (Need to update the [desktop application](https://wavesplatform.com/technology/wallet)).]\n{span.line}[2. Fixed rounding of prices in the orderbook.]", "1_3_5": "{span.line}[1. A tab with [wsoc.io](https://wsoc.io) contest tokens has been added.]\n{span.line}[2. French language support added.]\n{span.line}[3. Additional minor bugs have been fixed.]", "1_3_7": "{span.line}[1. Integration with [tokenrating.wavesexplorer.com](https://tokenrating.wavesexplorer.com) Now you can rate tokens directly in the app.]\n{span.line}[2. Additional minor bugs have been fixed.]", diff --git a/locale/id/app.dex.json b/locale/id/app.dex.json index e758b9fbb7..428f0928fe 100644 --- a/locale/id/app.dex.json +++ b/locale/id/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[Bagan tidak dapat diunduh.] {div}[Jika Anda ingin menggunakan bagan ini di aplikasi Anda, silakan kirim permintaan ke [tradingview.com](https://tradingview.com)]" }, + "charts": "charts", "createOrder": { "1day": "1 hari", "1hour": "1 jam", @@ -32,8 +33,12 @@ "buy": "Beli", "createOrderNotPermitted": "Pesanan sementara tidak tersedia", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "Tidak cukup {{name}}", "precision": "Melebihi {{precision}} angka desimal", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "Bagian ini diperlukan" }, "expiration": "Kedaluwarsa", @@ -63,6 +68,8 @@ "priceField": "Batasi harga", "sell": "Jual", "spread": "Sebaran", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "Total" }, "demo": { @@ -144,6 +151,7 @@ "header": "Ada yang salah" } }, + "orders": "orders", "portfolio": { "title": "Portofolio" }, @@ -229,10 +237,12 @@ "all": "Semua", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "Saldo saya", "myTradeHistory": "Sejarah Dagang Anda", "openOrders": "Pesanan Terbuka Anda", "OrderHistory": "Riwayat Pesanan Saya", + "trade": "Trade", "tradeHistory": "Sejarah Perdagangan", "waves": "Waves" } diff --git a/locale/id/app.utils.json b/locale/id/app.utils.json index 8e93860abb..3579d850f7 100644 --- a/locale/id/app.utils.json +++ b/locale/id/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "Tolong jangan depositkan ETH dari kontrak pintar! Jangan setor token ERC20! Hanya Ethereum yang diizinkan." }, "wavesGatewayVST": { - "helpDescrText": "Setelah transaksi dikonfirmasi, gateway akan memproses transfer Vostok ke token di akun Waves Anda.", - "helpDescrTitle": "Masukkan alamat ini ke klien atau dompet Vostok Anda", + "helpDescrText": "Setelah transaksi dikonfirmasi, gateway akan memproses transfer VST ke token di akun Waves Anda.", + "helpDescrTitle": "Masukkan alamat ini ke klien atau dompet VST Anda", "warningMinAmountTitle": "Jumlah minimum deposit adalah {{minAmount, BigNumber}} {{assetTicker}}, jumlah deposit maksimum adalah {{maxAmount}} {{assetTicker}}" } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "Impor akun dari Klien Lite Waves" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "Bagikan Tautan ke Faktur", "verified": "Terverifikasi", "vostok": { - "serverError": "Layanan Vostok sementara tidak tersedia. Coba lagi nanti." + "serverError": "Layanan VST sementara tidak tersedia. Coba lagi nanti." }, "wtry": { "info": "Jika ada masalah dengan proses pembayaran, silakan hubungi tim dukungan Digilira — [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "Gagal mendapatkan informasi penyedia. Silakan periksa alamatnya dan coba lagi", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "Jangan tampilkan token yang mencurigakan", + "edit": "Edit", "forDisableClear": "Untuk sepenuhnya menonaktifkannya, kosongkan bidang.", "matcherAddress": "Alamat pencocok", "nodeAddress": "Alamat node", @@ -946,7 +952,7 @@ "1_3_0": "{span.line} [1. Navigasi aplikasi yang ditingkatkan dan antarmuka halaman mulai.]", "1_3_18": "{span.line} [1. Menambahkan login ke dompet menggunakan kunci pribadi.] \n{span.line} [2. Perubahan harga 24 jam dari token sekarang terikat ke pasangan token/WAVES.]", "1_3_19": "{span.line} [1. Gerbang Bancor telah diluncurkan.] \n {span.line} [2. Antarmuka menu pengguna telah ditingkatkan.]", - "1_3_2": "{span.line} [1. Gateway Vostok telah diluncurkan.] \n{span.line} [2. UI yang diperbaiki dan bug minor tambahan telah diperbaiki.]", + "1_3_2": "{span.line} [1. Gateway VST telah diluncurkan.] \n{span.line} [2. UI yang diperbaiki dan bug minor tambahan telah diperbaiki.]", "1_3_20": "{span.line}[1. Improved system for storing and restoring accounts from local storage (Need to update the [desktop application](https://wavesplatform.com/technology/wallet)).]\n{span.line}[2. Fixed rounding of prices in the orderbook.]", "1_3_5": "{span.line} [1. Tab dengan token kontes [wsoc.io] (https://wsoc.io) telah ditambahkan.] \n {span.line} [2. Dukungan bahasa Perancis ditambahkan.] \n {span.line} [3. Bug minor tambahan telah diperbaiki.]", "1_3_7": "{span.line}[1. Integrasi dengan [tokenrating.wavesexplorer.com] (https://tokenrating.wavesexplorer.com) Sekarang Anda dapat menilai token langsung di app.] \n {span.line}[2. Bug minor tambahan telah diperbaiki.]", diff --git a/locale/it/app.dex.json b/locale/it/app.dex.json index 5ed040c159..f4f0a726ed 100644 --- a/locale/it/app.dex.json +++ b/locale/it/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[Non è stato possibile scaricare il listino.]{div}[Se vuoi usare questo listino nella tua applicazione, invia una richiesta a [tradingview.com](https://tradingview.com)]" }, + "charts": "charts", "createOrder": { "1day": "1 giorno", "1hour": "1 ora", @@ -32,8 +33,12 @@ "buy": "Compra", "createOrderNotPermitted": "Ordini temporaneamente non disponibile", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "{{name}} insufficienti", "precision": "Superamento del massimo di {{precision}} posizioni decimali", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "Questo campo è obbligatorio" }, "expiration": "Scadenza", @@ -63,6 +68,8 @@ "priceField": "Prezzo Limite", "sell": "Vendi", "spread": "spread", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "Totale" }, "demo": { @@ -144,6 +151,7 @@ "header": "Qualcosa non ha funzionato" } }, + "orders": "orders", "portfolio": { "title": "Portafoglio" }, @@ -229,10 +237,12 @@ "all": "Tutto", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "Il mio bilancio", "myTradeHistory": "Il mio storico ordini", "openOrders": "I miei ordini pendenti", "OrderHistory": "Storico Ordini", + "trade": "Trade", "tradeHistory": "Storico Ordini", "waves": "Waves" } diff --git a/locale/it/app.utils.json b/locale/it/app.utils.json index 6e5aac1627..55d36ff258 100644 --- a/locale/it/app.utils.json +++ b/locale/it/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "Per favore, non inviare ETH da smart contracts! Non inviare token ERC20! Accettiamo esclusivamente Ethereum." }, "wavesGatewayVST": { - "helpDescrText": "Una volta che la transazione sarà confermata, il gateway processerà il trasferimento di Vostok in favore di un token nel tuo account Waves.", - "helpDescrTitle": "Inserisci questo indirizzo nel tuo client Vostok o nel tuo wallet", + "helpDescrText": "Una volta che la transazione sarà confermata, il gateway processerà il trasferimento di VST in favore di un token nel tuo account Waves.", + "helpDescrTitle": "Inserisci questo indirizzo nel tuo client VST o nel tuo wallet", "warningMinAmountTitle": "L'importo minimo di deposito è di {{minAmount, BigNumber}} {{assetTicker}}, l'importo massimo di deposito è di {{maxAmount}} {{assetTicker}}" } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "Importa account dal Client Waves Lite" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "Condividi il link ad una fattura", "verified": "Verificato", "vostok": { - "serverError": "Servizio Vostok temporaneamente non disponibile. Riprova più tardi." + "serverError": "Servizio VST temporaneamente non disponibile. Riprova più tardi." }, "wtry": { "info": "In caso di problema con la procedura di pagamento, per favore contattare il team di supporto di Digilira — [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "Informazioni del provider non acquisite. Controllare il link e riprovare più tardi", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "Nascondi token sospetti", + "edit": "Edit", "forDisableClear": "Per disabilitarlo completamente, lascia vuoto il campo.", "matcherAddress": "Indirizzo Matcher", "nodeAddress": "Indirizzo Nodo", @@ -946,7 +952,7 @@ "1_3_0": "{span.line}[1. Miglioramento dell'interfaccia do navigazione della pagina iniziale.]", "1_3_18": "{span.line} [1. Aggiunto login al wallet utilizzando una chiave privata.]\n{span.line} [2. La modifica del prezzo di 24 ore di un token è ora associata alla coppia token/WAVES.]", "1_3_19": "{span.line} [1. Lancio del gateway Bancor.] \n{span.line} [2.Miglioramento dell'interfaccia del menu utente.]", - "1_3_2": "{span.line} [1. Lancio del gateway Vostok.] \n{span.line} [2. Miglioramento dell'interfaccia utente e risoluzione di altri bug minori.]", + "1_3_2": "{span.line} [1. Lancio del gateway VST.] \n{span.line} [2. Miglioramento dell'interfaccia utente e risoluzione di altri bug minori.]", "1_3_20": "{span.line}[1. Improved system for storing and restoring accounts from local storage (Need to update the [desktop application](https://wavesplatform.com/technology/wallet)).]\n{span.line}[2. Fixed rounding of prices in the orderbook.]", "1_3_5": "{span.line}[1. Aggiunto il tab al concorso [wsoc.io](https://wsoc.io) tokens.]\n{span.line}[2. Aggiunto il supporto alla lingua Francese.]\n{span.line}[3. Risoluzione di bug minori.]", "1_3_7": "{span.line} [1. Integrazione con [tokenrating.wavesexplorer.com] (https://tokenrating.wavesexplorer.com) Ora puoi valutare i token direttamente nell'app.] \n {span.line} [2. Sono stati corretti altri bug minori.]", diff --git a/locale/ja/app.dex.json b/locale/ja/app.dex.json index 39e54d90f0..48f198a714 100644 --- a/locale/ja/app.dex.json +++ b/locale/ja/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[チャートをダウンロードできません。]{div}[アプリケーション内でチャートの利用を希望する場合 [tradingview.com](https://tradingview.com)にリクエストを送信して下さい。]" }, + "charts": "charts", "createOrder": { "1day": "1日", "1hour": "1時間", @@ -32,8 +33,12 @@ "buy": "購入", "createOrderNotPermitted": "現在、注文することができません", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "{{name}} が足りません", "precision": "小数点数の最大は {{precision}} 桁です", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "この項目は必須です" }, "expiration": "有効期限", @@ -63,6 +68,8 @@ "priceField": "指値", "sell": "売却", "spread": "スプレッド", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "合計" }, "demo": { @@ -144,6 +151,7 @@ "header": "何かがおかしいようです" } }, + "orders": "orders", "portfolio": { "title": "ポートフォリオ" }, @@ -229,10 +237,12 @@ "all": "すべて", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "自分の残高", "myTradeHistory": "自分のトレード履歴", "openOrders": "自分の未約定注文", "OrderHistory": "自分のトレード履歴", + "trade": "Trade", "tradeHistory": "トレード履歴", "waves": "Waves" } diff --git a/locale/ja/app.utils.json b/locale/ja/app.utils.json index 5e2bd24943..fd797a8c6c 100644 --- a/locale/ja/app.utils.json +++ b/locale/ja/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "ETHをスマートコントラクトからデポジットしないでください。また、ERC20トークンもデポジットしないでください。" }, "wavesGatewayVST": { - "helpDescrText": "トランザクションが承認されると、ゲートウェイはVostokの送信を進め、あなたのWavesアカウントにトークンが反映されます。", - "helpDescrTitle": "このアドレスをVostokクライアント、またはウォレットに入力してください", + "helpDescrText": "トランザクションが承認されると、ゲートウェイはVSTの送信を進め、あなたのWavesアカウントにトークンが反映されます。", + "helpDescrTitle": "このアドレスをVSTクライアント、またはウォレットに入力してください", "warningMinAmountTitle": "最小デポジット額は{{minAmount, BigNumber}} {{assetTicker}}、最大デポジット額は{{maxAmount}} {{assetTicker}}です" } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "Wavesのライトクライアントからアカウントをインポート" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "請求書リンクを共有", "verified": "承認済", "vostok": { - "serverError": "現在、一時的に、Vostokのサービスがご利用いただけません。再度お試しください。" + "serverError": "現在、一時的に、VSTのサービスがご利用いただけません。再度お試しください。" }, "wtry": { "info": "送金処理に問題が生じた場合、Digiliraのサポートチームに連絡してください。— [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "プロバイダー情報の取得に失敗しました。アドレスを確認して再度お試しください。", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "不審なトークンを表示しない", + "edit": "Edit", "forDisableClear": "完全に無効にするには、このフィールドをクリアします。", "matcherAddress": "Matcher アドレス", "nodeAddress": "ノードアドレス", @@ -946,7 +952,7 @@ "1_3_0": "{span.line} [1. アプリのナビゲーションとスタートページのインターフェースが改善されました。]", "1_3_18": "{span.line}[1. 秘密鍵によるログインが可能になりました。]{span.line}[2. 24時間以内のトークン価格の変化がトークン/WAVESペアに対応しました。]", "1_3_19": "{span.line}[1. Bancor gateway has been launched.]\n{span.line}[2. User menu interface has been improved.]", - "1_3_2": "{span.line} [1. Vostokのゲートウェイが追加されました。 \n{span.line} [2. UIの改善と、いくつかのマイナーなバグを修正しました。]", + "1_3_2": "{span.line} [1. VSTのゲートウェイが追加されました。 \n{span.line} [2. UIの改善と、いくつかのマイナーなバグを修正しました。]", "1_3_20": "{span.line}[1. Improved system for storing and restoring accounts from local storage (Need to update the [desktop application](https://wavesplatform.com/technology/wallet)).]\n{span.line}[2. Fixed rounding of prices in the orderbook.]", "1_3_5": "{span.line}[1. [wsoc.io](https://wsoc.io) コンテスト用のトークンタブが追加されました。]{span.line}[2. フランス語に対応しました。]{span.line}[3. 一部のマイナーバグを修正しました。]", "1_3_7": "{span.line}[1.[tokenrating.wavesexplorer.com](https://tokenrating.wavesexplorer.com) に対応。アプリから直接トークンのレーティングが可能に。]{span.line}[2. 追加のマイナーバグを修正しました。]", diff --git a/locale/ko/app.dex.json b/locale/ko/app.dex.json index fe60b752c7..64c0006ee0 100644 --- a/locale/ko/app.dex.json +++ b/locale/ko/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[차트를 불러올 수 없습니다.]{div}[귀하의 어플리케이션에서 해당 차트를 불러오고 싶다면 [tradingview.com](https://tradingview.com)에 요청하세요.]" }, + "charts": "charts", "createOrder": { "1day": "1일", "1hour": "1시간", @@ -32,8 +33,12 @@ "buy": "매수", "createOrderNotPermitted": "일시적으로 거래 주문을 이용할 수 없습니다.", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "{{name}}가 부족합니다", "precision": "최대 소수점 자리 값 {{precision}} 초과", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "필수 입력 항목입니다" }, "expiration": "주문 만기", @@ -63,6 +68,8 @@ "priceField": "지정가", "sell": "매도", "spread": "스프레드", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "총금액" }, "demo": { @@ -144,6 +151,7 @@ "header": "문제가 발생했습니다" } }, + "orders": "orders", "portfolio": { "title": "포트폴리오" }, @@ -229,10 +237,12 @@ "all": "모두", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "나의 잔액", "myTradeHistory": "나의 주문내역", "openOrders": "나의 대기 주문", "OrderHistory": "나의 주문내역", + "trade": "Trade", "tradeHistory": "거래내역", "waves": "Waves" } diff --git a/locale/ko/app.utils.json b/locale/ko/app.utils.json index fcc5edf504..5292c0eae5 100644 --- a/locale/ko/app.utils.json +++ b/locale/ko/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "Smart Contracts에서 ETH를 입금하지 마세요! ERC20 토큰을 입금하지 마세요! Ethereum 입금만 가능합니다." }, "wavesGatewayVST": { - "helpDescrText": "트랜잭션이 승인되면 게이트웨이가 귀하의 Waves 계정에서 Vostok를 토큰으로 전송하는 작업을 처리할 것입니다.", - "helpDescrTitle": "이 주소를 Vostok 클라이언트 또는 지갑에 입력하세요", + "helpDescrText": "트랜잭션이 승인되면 게이트웨이가 귀하의 Waves 계정에서 VST를 토큰으로 전송하는 작업을 처리할 것입니다.", + "helpDescrTitle": "이 주소를 VST 클라이언트 또는 지갑에 입력하세요", "warningMinAmountTitle": "최소 입금액은 {{minAmount, BigNumber}} {{assetTicker}} 이며 최대 입금액은 {{maxAmount}} {{assetTicker}} 입니다." } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "Waves Lite 클라이언트에서 계정 불러오기" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "인보이스 링크 복사", "verified": "인증 완료", "vostok": { - "serverError": "Vostok 서비스를 일시적으로 사용할 수 없습니다. 나중에 다시 시도하세요." + "serverError": "VST 서비스를 일시적으로 사용할 수 없습니다. 나중에 다시 시도하세요." }, "wtry": { "info": "지불 처리와 관련된 문제가 있을 경우 Digilira 지원팀에 문의하세요 — [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "제공자의 정보를 가져오는데 실패했습니다. 주소를 확인하고 다시 시도하세요.", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "검증되지 않은 토큰을 표시하지 않습니다", + "edit": "Edit", "forDisableClear": "완전히 비활성화하려면 항목을 지우세요", "matcherAddress": "Matcher 주소", "nodeAddress": "Node 주소", @@ -946,7 +952,7 @@ "1_3_0": "{span.line}[1. 앱 네비게이션 및 시작 페이지 인터페이스 개선.]", "1_3_18": "{span.line}[1. Added login to wallet using a private key.]\n{span.line}[2. The 24 hours price change of a token is now bound to token/WAVES pair.]", "1_3_19": "{span.line}[1. Bancor gateway has been launched.]\n{span.line}[2. User menu interface has been improved.]", - "1_3_2": "{span.line}[1. Vostok 게이트웨이 런칭 완료.]\n{span.line}[2. UI 개선 및 기타 버그 픽스.]", + "1_3_2": "{span.line}[1. VST 게이트웨이 런칭 완료.]\n{span.line}[2. UI 개선 및 기타 버그 픽스.]", "1_3_20": "{span.line}[1. Improved system for storing and restoring accounts from local storage (Need to update the [desktop application](https://wavesplatform.com/technology/wallet)).]\n{span.line}[2. Fixed rounding of prices in the orderbook.]", "1_3_5": "{span.line}[1. [wsoc.io](https://wsoc.io) 컨테스트 토큰 탭 추가 완료.]\n{span.line}[2. 프랑스어 지원 추가.]\n{span.line}[3. 기타 버그 픽스.]", "1_3_7": "{span.line}[1. Integration with [tokenrating.wavesexplorer.com](https://tokenrating.wavesexplorer.com)과의 통합. 앱에서 토큰을 평가할 수 있습니다.]\n{span.line}[2. 기타 버그 픽스.]", diff --git a/locale/nl_NL/app.dex.json b/locale/nl_NL/app.dex.json index 28d2314981..d1b56f5728 100644 --- a/locale/nl_NL/app.dex.json +++ b/locale/nl_NL/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[De grafiek kan niet worden gedownload.] {div}[Als u deze grafiek in uw toepassing wilt gebruiken, stuur dan een verzoek naar [tradingview.com](https://tradingview.com)]" }, + "charts": "charts", "createOrder": { "1day": "1 dag", "1hour": "1 uur", @@ -32,8 +33,12 @@ "buy": "Kopen", "createOrderNotPermitted": "Orders zijn tijdelijk niet beschikbaar.", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "Niet genoeg {{name}}", "precision": "Maximum aantal decimalen van {{precision}} overschreden", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "Verplicht veld" }, "expiration": "Vervalt", @@ -63,6 +68,8 @@ "priceField": "Limiet prijs", "sell": "verkoop", "spread": "spreiding", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "Totaal" }, "demo": { @@ -144,6 +151,7 @@ "header": "Er is iets misgegaan" } }, + "orders": "orders", "portfolio": { "title": "Portfolio" }, @@ -229,10 +237,12 @@ "all": "Alles", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "Mijn balans", "myTradeHistory": "Mijn handelsgeschiedenis", "openOrders": "Mijn openstaande orders", "OrderHistory": "Mijn handelsgeschiedenis", + "trade": "Trade", "tradeHistory": "Handelsgeschiedenis", "waves": "Waves" } diff --git a/locale/nl_NL/app.ledger.json b/locale/nl_NL/app.ledger.json index ef733ed4b1..377fba94b7 100644 --- a/locale/nl_NL/app.ledger.json +++ b/locale/nl_NL/app.ledger.json @@ -12,7 +12,7 @@ "back": "Ga terug", "choose": "Kies uw account", "help": { - "id": "{div} [Stel handmatig een ID in of selecteer een account uit de lijst.] \n{div} [Bewaar de ID, deze is nodig voor het importeren.]" + "id": "{div}[Stel handmatig een ID in of selecteer een account uit de lijst.] \n{div}[Bewaar de ID, deze is nodig voor het importeren.]" }, "id": "Account ID", "importAccount": "Importeer een Ledger account", diff --git a/locale/nl_NL/app.utils.json b/locale/nl_NL/app.utils.json index cdf6358126..c264dedac5 100644 --- a/locale/nl_NL/app.utils.json +++ b/locale/nl_NL/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "Verstuur geen ETH vanuit smart contracts naar dit adres. Stort geen ERC20 tokens! Alleen Ethereum is toegestaan." }, "wavesGatewayVST": { - "helpDescrText": "Zodra de transactie bevestigd is zal de gateway de transactie behandelen en dit omzetten naar een Vostok token in uw Waves account.", - "helpDescrTitle": "Dit adres invoeren in uw Vostok-client of wallet", + "helpDescrText": "Zodra de transactie bevestigd is zal de gateway de transactie behandelen en dit omzetten naar een VST token in uw Waves account.", + "helpDescrTitle": "Dit adres invoeren in uw VST-client of wallet", "warningMinAmountTitle": "Het minimale stortingsbedrag is {{minAmount, BigNumber}} {{assetTicker}}, het maximale stortingsbedrag is {{maxAmount}} {{assetTicker}}" } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "Accounts importeren van Waves Lite Client" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "Deel een link naar een factuur", "verified": "Geverifieerd", "vostok": { - "serverError": "Service Vostok tijdelijk niet beschikbaar. Probeer het later opnieuw." + "serverError": "Service VST tijdelijk niet beschikbaar. Probeer het later opnieuw." }, "wtry": { "info": "Neem in geval van problemen met de betalingsverwerking contact op met het Digilira-ondersteuningsteam - [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "Niet gelukt provider informatie op te vragen. Controleer het adres en probeer het opnieuw.", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "Toon geen verdachte tokens", + "edit": "Edit", "forDisableClear": "Om het volledig uit te schakelen, maak het veld leeg.", "matcherAddress": "Matcher adres", "nodeAddress": "Node adres", @@ -946,7 +952,7 @@ "1_3_0": "{span.line}[1. Spam tokens and transactions have been hidden in client.]\n{span.line}[2. Improved UI and additional minor bugs have been fixed.]", "1_3_18": "{span.line}[1. Added login to wallet using a private key.]\n{span.line}[2. The 24 hours price change of a token is now bound to token/WAVES pair.]", "1_3_19": "{span.line}[1. Bancor gateway has been launched.]\n{span.line}[2. User menu interface has been improved.]", - "1_3_2": "{span.line}[1. Vostok gateway has been launched.]\n{span.line}[2. Improved UI and additional minor bugs have been fixed.]", + "1_3_2": "{span.line}[1. VST gateway has been launched.]\n{span.line}[2. Improved UI and additional minor bugs have been fixed.]", "1_3_20": "{span.line}[1. Improved system for storing and restoring accounts from local storage (Need to update the [desktop application](https://wavesplatform.com/technology/wallet)).]\n{span.line}[2. Fixed rounding of prices in the orderbook.]", "1_3_5": "{span.line}[1. A tab with [wsoc.io](https://wsoc.io) contest tokens has been added.]\n{span.line}[2. French language support added.]\n{span.line}[3. Additional minor bugs have been fixed.]", "1_3_7": "{span.line}[1. Integration with [tokenrating.wavesexplorer.com](https://tokenrating.wavesexplorer.com) Now you can rate tokens directly in the app.]\n{span.line}[2. Additional minor bugs have been fixed.]", diff --git a/locale/pl/app.dex.json b/locale/pl/app.dex.json index 86fdc9c472..7ade2bdc19 100644 --- a/locale/pl/app.dex.json +++ b/locale/pl/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[Wykres nie mógł zostać załadowany]{div}[Jeśli chcesz używać tego wykresu w twojej aplikacji wyślij proszę prośbę do [tradingview.com](https://tradingview.com)]" }, + "charts": "charts", "createOrder": { "1day": "1 dzień", "1hour": "1 godz", @@ -32,8 +33,12 @@ "buy": "Kupno", "createOrderNotPermitted": "Chwilowo niedostępna informacja o ofertach", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "Nie wystarczająco {{name}}", "precision": "Przekroczono maksymalną liczbę{{precision}} miejsc dziesiętnych", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "To pole jest wymagane" }, "expiration": "Wygaśnięcie", @@ -63,6 +68,8 @@ "priceField": "Limit ceny", "sell": "Sprzedaż", "spread": "spread", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "Ogółem" }, "demo": { @@ -144,6 +151,7 @@ "header": "Coś poszło nie tak" } }, + "orders": "orders", "portfolio": { "title": "Portfolio" }, @@ -229,10 +237,12 @@ "all": "Wszystko", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "Stan konta", "myTradeHistory": "Moja historia transakcji", "openOrders": "Moje aktywne zlecenia", "OrderHistory": "Moja historia transakcji", + "trade": "Trade", "tradeHistory": "Historia transakcji", "waves": "Waves" } diff --git a/locale/pl/app.utils.json b/locale/pl/app.utils.json index a3218902f4..ce63240eb3 100644 --- a/locale/pl/app.utils.json +++ b/locale/pl/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "Proszę nie deponować ETH z inteligentnych kontraktów (smart contracts)! Proszę nie deponować tokenów ERC20! Tylko Ethereum dozwolone." }, "wavesGatewayVST": { - "helpDescrText": "Jeżeli transakcja zostanie potwierdzona, system wymieni Vostok na tokeny w Twoim koncie Waves.", - "helpDescrTitle": "Wprowadź ten adres w swoim kliencie albo portfelu Vostok", + "helpDescrText": "Jeżeli transakcja zostanie potwierdzona, system wymieni VST na tokeny w Twoim koncie Waves.", + "helpDescrTitle": "Wprowadź ten adres w swoim kliencie albo portfelu VST", "warningMinAmountTitle": "Minimalna kwota depozytu to {{minAmount, BigNumber}} {{assetTicker}}, maksymalna kwota depozytu to {{maxAmount}} {{assetTicker}}" } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "Import konta z Waves Lite Client" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "Udostępnij link do faktury", "verified": "Zweryfikowany", "vostok": { - "serverError": "Usługa Vostok jest tymczasowo niedostępna. Spróbuj ponownie później." + "serverError": "Usługa VST jest tymczasowo niedostępna. Spróbuj ponownie później." }, "wtry": { "info": "Na wypadek problemów z procesem płatności, proszę kontaktować się z Digilira support team — [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "Nie udało się pobrać informacji o dostawcy. Sprawdź adres i spróbuj ponownie", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "Nie pokazuj podejrzanych tokenów", + "edit": "Edit", "forDisableClear": "Aby całkowicie go wyłączyć, wyczyść pole.", "matcherAddress": "Adres Matchera", "nodeAddress": "Adres Node", @@ -946,7 +952,7 @@ "1_3_0": "{span.line}[1. Ulepszona nawigacja aplikacji i interfejs strony startowej.]", "1_3_18": "{span.line} [1. Dodano login do portfela za pomocą klucza prywatnego.] \n {span.line} [2. 24-godzinna zmiana ceny tokena jest teraz powiązana z parą token / WAVES.]", "1_3_19": "{span.line} [1. Uruchomiono bramę Bancor.] \n {span.line} [2. Interfejs menu użytkownika został ulepszony.]", - "1_3_2": "{span.line} [1. Uruchomiono bramę (gateway) Vostok.] \n {span.line} [2. Poprawiony interfejs użytkownika i dodatkowo zostały naprawione drobne błędy.]", + "1_3_2": "{span.line} [1. Uruchomiono bramę (gateway) VST.] \n {span.line} [2. Poprawiony interfejs użytkownika i dodatkowo zostały naprawione drobne błędy.]", "1_3_20": "{span.line} [1. Ulepszony system przechowywania i przywracania kont z lokalnego magazynu (potrzeba aktualizacji [aplikacji komputerowej] (https://wavesplatform.com/technology/wallet)).] \n {span.line} [2. Naprawiono zaokrąglanie cen w księdze zamówień.]", "1_3_5": "{span.line} [1. Dodano zakładkę z tokenami konkursowymi [wsoc.io] (https://wsoc.io).] \n {span.line} [2. Dodano obsługę języka francuskiego.] \n {span.line} [3. Dodatkowe drobne błędy zostały naprawione.]", "1_3_7": "{span.line} [1. Integracja z [tokenrating.wavesexplorer.com] (https://tokenrating.wavesexplorer.com) Teraz możesz oceniać tokeny bezpośrednio w aplikacji.] \n {span.line} [2. Dodatkowe drobne błędy zostały naprawione.]", diff --git a/locale/pt_BR/app.dex.json b/locale/pt_BR/app.dex.json index cf59c2aa34..810635b2ad 100644 --- a/locale/pt_BR/app.dex.json +++ b/locale/pt_BR/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[O gráfico não pôde ser baixado.]{div}[Se você quiser usar este gráfico em seu aplicativo, envie uma solicitação para [tradingview.com](https://tradingview.com)]" }, + "charts": "charts", "createOrder": { "1day": "1 dia", "1hour": "1 hora", @@ -32,8 +33,12 @@ "buy": "Comprar", "createOrderNotPermitted": "As ordens estão temporariamente indisponíveis", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "Insuficiente {{name}}", "precision": "Máximo excedido de {{precision}} casas decimais", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "Este campo é obrigatório" }, "expiration": "Prazo", @@ -63,6 +68,8 @@ "priceField": "Preço limite", "sell": "Vender", "spread": "spread", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "Total" }, "demo": { @@ -144,6 +151,7 @@ "header": "Algo deu errado" } }, + "orders": "orders", "portfolio": { "title": "Portfólio" }, @@ -229,10 +237,12 @@ "all": "Tudo", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "Meu Saldo", "myTradeHistory": "Meu histórico de Negociações", "openOrders": "Minhas Ordens Abertas", "OrderHistory": "My Order History", + "trade": "Trade", "tradeHistory": "Histórico de Negociações", "waves": "Waves" } diff --git a/locale/pt_BR/app.utils.json b/locale/pt_BR/app.utils.json index b65605dd8c..43fbf6d10f 100644 --- a/locale/pt_BR/app.utils.json +++ b/locale/pt_BR/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "Por favor, não deposite ETH através de smart contracts! Não deposite tokens ERC20! Apenas Ethereum é permitido." }, "wavesGatewayVST": { - "helpDescrText": "Once the transaction is confirmed, the gateway will process the transfer of Vostok to a token in your Waves account.", - "helpDescrTitle": "Enter this address into your Vostok client or wallet", + "helpDescrText": "Once the transaction is confirmed, the gateway will process the transfer of VST to a token in your Waves account.", + "helpDescrTitle": "Enter this address into your VST client or wallet", "warningMinAmountTitle": "The minimum amount of deposit is {{minAmount, BigNumber}} {{assetTicker}}, the maximum amount of deposit is {{maxAmount}} {{assetTicker}}" } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "Importar contas da Waves Lite Client" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "Compartilhar o link desta fatura", "verified": "Verificado", "vostok": { - "serverError": "Service Vostok temporarily unavailable. Try again later." + "serverError": "Service VST temporarily unavailable. Try again later." }, "wtry": { "info": "Em caso de problemas com o processamento de pagamentos, entre em contato com a equipe de suporte da Digilira — [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "Falha ao obter informações do provedor. Por favor, verifique o endereço e tente novamente", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "Don't show suspicious tokens", + "edit": "Edit", "forDisableClear": "For completely disable it, clear the field.", "matcherAddress": "Endereço do Matcher", "nodeAddress": "Endereço do node", @@ -946,7 +952,7 @@ "1_3_0": "{span.line}[1. Improved app navigation and start page interface.]", "1_3_18": "{span.line}[1. Added login to wallet using a private key.]\n{span.line}[2. The 24 hours price change of a token is now bound to token/WAVES pair.]", "1_3_19": "{span.line}[1. Bancor gateway has been launched.]\n{span.line}[2. User menu interface has been improved.]", - "1_3_2": "{span.line}[1. Vostok gateway has been launched.]\n{span.line}[2. Improved UI and additional minor bugs have been fixed.]", + "1_3_2": "{span.line}[1. VST gateway has been launched.]\n{span.line}[2. Improved UI and additional minor bugs have been fixed.]", "1_3_20": "{span.line}[1. Improved system for storing and restoring accounts from local storage (Need to update the [desktop application](https://wavesplatform.com/technology/wallet)).]\n{span.line}[2. Fixed rounding of prices in the orderbook.]", "1_3_5": "{span.line}[1. A tab with [wsoc.io](https://wsoc.io) contest tokens has been added.]\n{span.line}[2. French language support added.]\n{span.line}[3. Additional minor bugs have been fixed.]", "1_3_7": "{span.line}[1. Integration with [tokenrating.wavesexplorer.com](https://tokenrating.wavesexplorer.com) Now you can rate tokens directly in the app.]\n{span.line}[2. Additional minor bugs have been fixed.]", diff --git a/locale/pt_PT/app.dex.json b/locale/pt_PT/app.dex.json index 2488ac2ab3..60826cd1aa 100644 --- a/locale/pt_PT/app.dex.json +++ b/locale/pt_PT/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[The chart could not be downloaded.]{div}[If you want to use this chart in your application, please send a request to [tradingview.com](https://tradingview.com)]" }, + "charts": "charts", "createOrder": { "1day": "1 day", "1hour": "1 hour", @@ -32,8 +33,12 @@ "buy": "Buy", "createOrderNotPermitted": "Orders is temporarily unavailable", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "Not enough {{name}}", "precision": "Exceeded maximum of {{precision}} decimal places", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "This field is required" }, "expiration": "Expiration", @@ -63,6 +68,8 @@ "priceField": "Limit price", "sell": "Sell", "spread": "spread", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "Total" }, "demo": { @@ -144,6 +151,7 @@ "header": "Something went wrong" } }, + "orders": "orders", "portfolio": { "title": "Portfolio" }, @@ -229,10 +237,12 @@ "all": "All", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "My Balance", "myTradeHistory": "My Trade History", "openOrders": "My Open Orders", "OrderHistory": "My Order History", + "trade": "Trade", "tradeHistory": "Trade History", "waves": "Waves" } diff --git a/locale/pt_PT/app.utils.json b/locale/pt_PT/app.utils.json index 437ad5fbfd..51d28d761b 100644 --- a/locale/pt_PT/app.utils.json +++ b/locale/pt_PT/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "Please do not deposit ETH from smart contracts! Do not deposit ERC20 tokens! Only Ethereum is allowed." }, "wavesGatewayVST": { - "helpDescrText": "Once the transaction is confirmed, the gateway will process the transfer of Vostok to a token in your Waves account.", - "helpDescrTitle": "Enter this address into your Vostok client or wallet", + "helpDescrText": "Once the transaction is confirmed, the gateway will process the transfer of VST to a token in your Waves account.", + "helpDescrTitle": "Enter this address into your VST client or wallet", "warningMinAmountTitle": "The minimum amount of deposit is {{minAmount, BigNumber}} {{assetTicker}}, the maximum amount of deposit is {{maxAmount}} {{assetTicker}}" } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "Import accounts from Waves Lite Client" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "Share a Link to an Invoice", "verified": "Verified", "vostok": { - "serverError": "Service Vostok temporarily unavailable. Try again later." + "serverError": "Service VST temporarily unavailable. Try again later." }, "wtry": { "info": "In case of problems with payment processing, please contact the Digilira support team — [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "Failed to get provider information. Please check the address and try again", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "Don't show suspicious tokens", + "edit": "Edit", "forDisableClear": "For completely disable it, clear the field.", "matcherAddress": "Matcher address", "nodeAddress": "Node address", @@ -946,7 +952,7 @@ "1_3_0": "{span.line}[1. Improved app navigation and start page interface.]", "1_3_18": "{span.line}[1. Added login to wallet using a private key.]\n{span.line}[2. The 24 hours price change of a token is now bound to token/WAVES pair.]", "1_3_19": "{span.line}[1. Bancor gateway has been launched.]\n{span.line}[2. User menu interface has been improved.]", - "1_3_2": "{span.line}[1. Vostok gateway has been launched.]\n{span.line}[2. Improved UI and additional minor bugs have been fixed.]", + "1_3_2": "{span.line}[1. VST gateway has been launched.]\n{span.line}[2. Improved UI and additional minor bugs have been fixed.]", "1_3_20": "{span.line}[1. Improved system for storing and restoring accounts from local storage (Need to update the [desktop application](https://wavesplatform.com/technology/wallet)).]\n{span.line}[2. Fixed rounding of prices in the orderbook.]", "1_3_5": "{span.line}[1. A tab with [wsoc.io](https://wsoc.io) contest tokens has been added.]\n{span.line}[2. French language support added.]\n{span.line}[3. Additional minor bugs have been fixed.]", "1_3_7": "{span.line}[1. Integration with [tokenrating.wavesexplorer.com](https://tokenrating.wavesexplorer.com) Now you can rate tokens directly in the app.]\n{span.line}[2. Additional minor bugs have been fixed.]", diff --git a/locale/ru/app.dex.json b/locale/ru/app.dex.json index b1f8416599..de75e50684 100644 --- a/locale/ru/app.dex.json +++ b/locale/ru/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[Невозможно загрузить график.]{div}[Если вы хотите использовать график в своем приложении, отправьте заявку [tradingview.com](https://tradingview.com)]" }, + "charts": "графики", "createOrder": { "1day": "1 день", "1hour": "1 час", @@ -32,8 +33,12 @@ "buy": "Купить", "createOrderNotPermitted": "Ордера временно недоступны.", "errors": { + "amountMax": "Макс. сумма - ", + "amountMin": "Мин. сумма - ", "balance": "Недостаточно {{name}}", "precision": "Десятичных знаков больше, чем {{precision}}", + "priceMax": "Макс. цена - ", + "priceMin": "Мин. цена - ", "required": "Это поле необходимо заполнить" }, "expiration": "Действителен", @@ -63,6 +68,8 @@ "priceField": "Цена", "sell": "Продать", "spread": "разница", + "stopPriceField": "Стоп-цена", + "stopPriceHelp": "Это автоматически действующий ордер на покупку или продажу по заранее установленной цене", "total": "Сумма" }, "demo": { @@ -144,6 +151,7 @@ "header": "Что-то пошло не так..." } }, + "orders": "ордера", "portfolio": { "title": "Портфолио" }, @@ -229,10 +237,12 @@ "all": "Все", "btc": "Btc", "eth": "ETH", + "history": "история", "myBalance": "Мой баланс", "myTradeHistory": "Моя история сделок", "openOrders": "Мои открытые ордера", "OrderHistory": "Моя история ордеров", + "trade": "Сделки", "tradeHistory": "История сделок", "waves": "Waves" } diff --git a/locale/ru/app.utils.json b/locale/ru/app.utils.json index b8e3d2f259..a674723772 100644 --- a/locale/ru/app.utils.json +++ b/locale/ru/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "Не отправляйте ETH со смарт-контрактов! Не отправляйте ERC20-токены! Только Ethereum." }, "wavesGatewayVST": { - "helpDescrText": "Как только транзакция будет подтверждена, шлюз отправит Vostok-токен на ваш аккаунт Waves.", - "helpDescrTitle": "Введите этот адрес в ваш Vostok клиент или кошелёк.", + "helpDescrText": "Как только транзакция будет подтверждена, шлюз отправит VST-токен на ваш аккаунт Waves.", + "helpDescrTitle": "Введите этот адрес в ваш VST клиент или кошелёк.", "warningMinAmountTitle": "Минимальная сумма депозита {{minAmount, BigNumber}} {{assetTicker}}, максимальная сумма депозита {{maxAmount}} {{assetTicker}}" } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "Импорт аккаунтов из Waves Lite Client" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "Ссылка на выставленный счет", "verified": "Проверенный", "vostok": { - "serverError": "Сервис Vostok временно недоступен. Попробуйте, пожалуйста, позже." + "serverError": "Сервис VST временно недоступен. Попробуйте, пожалуйста, позже." }, "wtry": { "info": "Если у вас возникнут проблемы с процессингом, пожалуйста, обратитесь в службу поддержки Digilira — [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "Невозможно получить информацию о провайдере. Проверьте корректность адреса и попробуйте ещё раз", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "Не показывать подозрительные токены", + "edit": "Изменить", "forDisableClear": "Если хотите его полностью отключить, очистите поле.", "matcherAddress": "Адрес матчера", "nodeAddress": "Адрес ноды", @@ -946,7 +952,7 @@ "1_3_0": "{span.line}[1. Улучшена навигация приложения и интерфейс стартовых страниц.]", "1_3_18": "{span.line}[1. Добавлен импорт из приватного ключа.]\n{span.line}[2. Изменение цены токена теперь считается по паре с WAVES.]", "1_3_19": "{span.line}[1. Запущен шлюз Bancor]\n{span.line}[2. Улучшен интерфейс меню пользователя.]", - "1_3_2": "{span.line}[1. Запущен шлюз Vostok.]\n{span.line}[2. Улучшен UI и исправлено несколько багов.]", + "1_3_2": "{span.line}[1. Запущен шлюз VST.]\n{span.line}[2. Улучшен UI и исправлено несколько багов.]", "1_3_20": "{span.line}[1. Улучшена система хранения и восстановления аккаунтов из локального хранилища (Необходимо обновить [desktop-приложение](https://wavesplatform.com/technology/wallet))]\n{span.line}[2. Исправлено округление цен в ордербуке]", "1_3_5": "{span.line}[1. Добавлена вкладка с токенами конкурса [wsoc.io](https://wsoc.io)]\n{span.line}[2. Добавлена поддержка франзуского языка]\n{span.line}[3. Исправлены мелкие ошибки]", "1_3_7": "{span.line}[1. Интеграция с [tokenrating.wavesexplorer.com](https://tokenrating.wavesexplorer.com) Теперь вы можете голосовать за токены прямо в приложении]\n{span.line}[2. Исправлены мелкие ошибки]", diff --git a/locale/tr/app.dex.json b/locale/tr/app.dex.json index b3c12224c8..3706e128ea 100644 --- a/locale/tr/app.dex.json +++ b/locale/tr/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[grafikler indirilememektedir.]{div}[Eğer uygulamanızda grafikleri kullanmak istiyorsanız [tradingview.com] a mesaj atın(https://tradingview.com)]" }, + "charts": "charts", "createOrder": { "1day": "1 gün", "1hour": "1 saat", @@ -32,8 +33,12 @@ "buy": "Al", "createOrderNotPermitted": "Emirler geçici olarak devre dışı", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "Yetersiz {{name}} bakiyesi", "precision": "Maksimum ondalık sayısını {{precision}} aştınız", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "Bu alanın doldurulması zorunludur" }, "expiration": "Geçerlilik tarihi", @@ -63,6 +68,8 @@ "priceField": "Limit fiyat", "sell": "Sat", "spread": "Makas", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "Toplam" }, "demo": { @@ -144,6 +151,7 @@ "header": "Bir şeyler ters gitti" } }, + "orders": "orders", "portfolio": { "title": "Portföy" }, @@ -229,10 +237,12 @@ "all": "Hepsi", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "Bakiyem", "myTradeHistory": "Takas geçmişim", "openOrders": "Açık emirlerim", "OrderHistory": "Takas geçmişim", + "trade": "Trade", "tradeHistory": "Takas geçmişi", "waves": "Waves" } diff --git a/locale/tr/app.utils.json b/locale/tr/app.utils.json index b980124853..52b8268872 100644 --- a/locale/tr/app.utils.json +++ b/locale/tr/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "ETH akıllı kontratlarından yatırma işlemi yapmayınız. ERC20 tokenleri yatırmayınız! Sadece Ethereum transferleri kabul edilir." }, "wavesGatewayVST": { - "helpDescrText": "İşlem onaylandıktan sonra Vostoklar Waves adresinize geçit tarafından gönderilir.", - "helpDescrTitle": "Bu adresi Vostok cüzdanına ya da uygulamasına giriniz.", + "helpDescrText": "İşlem onaylandıktan sonra VSTlar Waves adresinize geçit tarafından gönderilir.", + "helpDescrTitle": "Bu adresi VST cüzdanına ya da uygulamasına giriniz.", "warningMinAmountTitle": "Minimum yatırma tutarı {{minAmount, BigNumber}} {{assetTicker}}'dir. Maksimum yatırma tutarı ise {{maxAmount}} {{assetTicker}}'dir." } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "Hesapları Waves Lite Client'ten aktar" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "Custom matcher address", + "matcher": "Matcher", + "matcherTerms": "I agree to the Super DEX Mather Terms of Use.", + "terms": "Terms", + "title": "Choose matcher", + "wavesTerms": "I am over 18 years old, and I agree to the Waves Terms of Use and Waves Privacy Policy." }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "Faturanın bir kopyasını paylaş", "verified": "Doğrulandı", "vostok": { - "serverError": "Vostok geçici olarak hizmet dışıdır. Daha sonra tekrar deneyiniz." + "serverError": "VST geçici olarak hizmet dışıdır. Daha sonra tekrar deneyiniz." }, "wtry": { "info": "Ödemeler konusunda herhangi bir problem yaşarsanız — [destek@digilira.com](mailto:destek@digilira.com) 'a e-posta gönderebilirsiniz." @@ -670,6 +675,7 @@ "dataProviderInvalid": "Sağlayıcı bilgisine ulaşılamadı. Lütfen adresi kontrol edin ve tekrar deneyin.", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "Şüheli tokenleri gösterme", + "edit": "Edit", "forDisableClear": "Tamamen devre dışı bırakmak için alanı temizleyin.", "matcherAddress": "Eşleştirici adresi", "nodeAddress": "Tam düğüm adresi", @@ -946,7 +952,7 @@ "1_3_0": "{span.line}[1. Açılış sayfası güncellendi ve sayfalar arası dolaşım geliştirildi.]", "1_3_18": "{span.line}[1. Özel anahtar ile giriş eklendi]\n{span.line}[2. Bir token'in 24 saatlik değişimi token/WAVES olarak ayarlandı.]", "1_3_19": "{span.line}[1. Bancor gateway has been launched.]\n{span.line}[2. User menu interface has been improved.]", - "1_3_2": "{span.line}[1. Vostok geçidi faaliyete alındı.]\n{span.line}[2. Görsel tasarım geliştirildi ve ufak hatalar giderildi.]", + "1_3_2": "{span.line}[1. VST geçidi faaliyete alındı.]\n{span.line}[2. Görsel tasarım geliştirildi ve ufak hatalar giderildi.]", "1_3_20": "{span.line}[1. Improved system for storing and restoring accounts from local storage (Need to update the [desktop application](https://wavesplatform.com/technology/wallet)).]\n{span.line}[2. Fixed rounding of prices in the orderbook.]", "1_3_5": "{span.line}[1. [wsoc.io](https://wsoc.io) Yarışma kripto paraları eklendi.]\n{span.line}[2. Fransızca desteği eklendi.]\n{span.line}[3. Ufak hatalar giderildi.]", "1_3_7": "{span.line}[1. [tokenrating.wavesexplorer.com] entegrasyonu (https://tokenrating.wavesexplorer.com) Artık uygulamadan kripto paralar için derecelendirme puanı verebilirsiniz.]\n{span.line}[2. Ufak hatalar giderildi.]", diff --git a/locale/zh_CN/app.dex.json b/locale/zh_CN/app.dex.json index 90160bff70..33b7df88f4 100644 --- a/locale/zh_CN/app.dex.json +++ b/locale/zh_CN/app.dex.json @@ -19,6 +19,7 @@ "candleChart": { "error": "{div}[无法下载该图表。]{div}[如果您要在您的应用程序中使用此图表,请向[tradingview.com](https://tradingview.com)]发送请求" }, + "charts": "charts", "createOrder": { "1day": "1天", "1hour": "1小时", @@ -32,8 +33,12 @@ "buy": "买", "createOrderNotPermitted": "订单暂时无法使用", "errors": { + "amountMax": "Max Amount - ", + "amountMin": "Min Amount - ", "balance": "您的{{name}}余额不足以", "precision": "超过最大的{{precision}}位小数", + "priceMax": "Max Price - ", + "priceMin": "Min Price - ", "required": "这是必填栏" }, "expiration": "满期", @@ -63,6 +68,8 @@ "priceField": "限价", "sell": "卖", "spread": "买卖差价", + "stopPriceField": "Stop price", + "stopPriceHelp": "This is an automatic buy or sell order at a predetermined price", "total": "总额" }, "demo": { @@ -144,6 +151,7 @@ "header": "出了些问题" } }, + "orders": "orders", "portfolio": { "title": "投资组合" }, @@ -229,10 +237,12 @@ "all": "所有", "btc": "Btc", "eth": "ETH", + "history": "history", "myBalance": "我的金额", "myTradeHistory": "我的贸易历史", "openOrders": "我的开放订单", "OrderHistory": "我的订单历史", + "trade": "Trade", "tradeHistory": "交易历史记录", "waves": "Waves" } diff --git a/locale/zh_CN/app.ledger.json b/locale/zh_CN/app.ledger.json index f79762f4ac..a814dccffc 100644 --- a/locale/zh_CN/app.ledger.json +++ b/locale/zh_CN/app.ledger.json @@ -12,7 +12,7 @@ "back": "返回", "choose": "选择您的帐户", "help": { - "id": "{div} [手动设置ID或从列表中选择一个帐户。] \n {div} [请保存ID,导入时需要。]" + "id": "{div}[手动设置ID或从列表中选择一个帐户。] \n {div}[请保存ID,导入时需要。]" }, "id": "帐户ID", "importAccount": "导入 Ledger 帐户", diff --git a/locale/zh_CN/app.utils.json b/locale/zh_CN/app.utils.json index 2e23cf52e0..1b50d31432 100644 --- a/locale/zh_CN/app.utils.json +++ b/locale/zh_CN/app.utils.json @@ -293,8 +293,8 @@ "warningTitle": "请不要从智能合约中交存ETH!别交存ERC20代币!您只能交存以太坊Ethereum。" }, "wavesGatewayVST": { - "helpDescrText": "确认交易后,网关将处理将Vostok转移到Waves帐户中的代币。", - "helpDescrTitle": "在您的Vostok客户端或钱包中输入此地址", + "helpDescrText": "确认交易后,网关将处理将VST转移到Waves帐户中的代币。", + "helpDescrTitle": "在您的VST客户端或钱包中输入此地址", "warningMinAmountTitle": "最低存款金额为{{minAmount, BigNumber}} {{assetTicker}},最高存款金额为{{maxAmount}} {{assetTicker}}" } }, @@ -353,7 +353,12 @@ "wavesLiteClientDescription": "从Waves Lite客户端导入帐户" }, "matcherChoice": { - "title": "Choose matcher" + "customMatcher": "自定义匹配器地址", + "matcher": "匹配", + "matcherTerms": "我同意Super DEX Mather使用条款。", + "terms": "条款", + "title": "选择匹配器", + "wavesTerms": "我已超过18岁,我同意Waves使用条款和Waves隐私政策。" }, "open-main": { "dex": { @@ -470,7 +475,7 @@ "shareInvoiceLink": "分享单据链接", "verified": "验证", "vostok": { - "serverError": "Vostok服务暂时无法使用。稍后再试。" + "serverError": "VST服务暂时无法使用。稍后再试。" }, "wtry": { "info": "如果付款处理出了问题,请联系Digilira支持团队 — [support@digilira.com](mailto:support@digilira.com)" @@ -670,6 +675,7 @@ "dataProviderInvalid": "无法获得提供商信息。请检查地址并再试一次", "dataProviderName": "{{dataProviderName}}", "dontShowSpamCheckboxDescr": "不要显示可疑代币", + "edit": "编辑", "forDisableClear": "要完全禁用它,请清除该字段。", "matcherAddress": "交易匹配节点地址", "nodeAddress": "节点地址", @@ -946,7 +952,7 @@ "1_3_0": "{span.line}[1。改进了应用程序导航和起始页面界面。]", "1_3_18": "{span.line} [1。使用私钥添加了对钱包的登录。] \n {span.line} [2。令牌的24小时价格变化现在绑定到代币/ WAVES对。]", "1_3_19": "{span.line} [1。 Bancor网关已经推出。] \n {span.line} [2。用户菜单界面已得到改进。]", - "1_3_2": "{span.line} [1。 Vostok网关已经推出。] \n {span.line} [2。改进的用户界面和其他小错误已得到修复。]", + "1_3_2": "{span.line} [1。 VST网关已经推出。] \n {span.line} [2。改进的用户界面和其他小错误已得到修复。]", "1_3_20": "{span.line} [1。改进了从本地存储中存储和恢复帐户的系统(需要更新[桌面应用程序](https://wavesplatform.com/technology/wallet))。 \n {span.line} [2。修正了订单中价格的四舍五入。]", "1_3_5": "{span.line} [1。已添加包含[wsoc.io](https://wsoc.io)竞赛代币的标签。 \n {span.line} [2。增加了法语支持。] \n {span.line} [3。其他小错误已得到修复。]", "1_3_7": "{span.line} [1。与[tokenrating.wavesexplorer.com]集成(https://tokenrating.wavesexplorer.com)现在您可以直接在应用程序中对令牌进行评分。 \n {span.line} [2。其他小错误已得到修复。]", diff --git a/src/modules/dex/directives/createOrder/createOrder.html b/src/modules/dex/directives/createOrder/createOrder.html index ccb3c30dcf..1e834a1c19 100644 --- a/src/modules/dex/directives/createOrder/createOrder.html +++ b/src/modules/dex/directives/createOrder/createOrder.html @@ -106,13 +106,13 @@
- + {{$ctrl.pairRestrictions.maxPrice.toFormat()}} - + {{$ctrl.pairRestrictions.minPrice.toFormat()}} @@ -165,7 +165,7 @@ - + {{$ctrl.pairRestrictions.minAmount.toFormat()}} @@ -176,7 +176,7 @@ w-i18n="directives.createOrder.errors.balance" params="{name: $ctrl.amountBalance.asset.displayName}"> - + {{$ctrl.pairRestrictions.maxAmount.toFormat()}} From 462f65932f8df45b5156632b1a11c7a77861cd4e Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 7 Oct 2019 11:56:11 +0300 Subject: [PATCH 20/25] CLIENT-1819: fixes setting restrictions --- src/modules/dex/directives/createOrder/CreateOrder.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index 2d8f3ffbdb..a2fe6b2c75 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -45,7 +45,7 @@ } get loaded() { - return this.amountBalance && this.priceBalance && this.fee; + return !!(this.amountBalance && this.priceBalance && this.fee); } /** @@ -257,7 +257,7 @@ this.isValidPricePrecision = this._validatePricePrecision(); this.observe(['amountBalance', 'type', 'fee', 'priceBalance'], this._updateMaxAmountOrPriceBalance); - this.observe(['maxAmountBalance', 'amountBalance', 'priceBalance'], this._setPairRestrictions); + this.observe(['maxAmountBalance', 'amountBalance', 'priceBalance', 'fee'], this._setPairRestrictions); this.observe('_assetIdPair', () => { this.amount = null; @@ -1163,7 +1163,6 @@ this.pairRestrictions = {}; const defaultPairRestriction = this._getDefaultPairRestriction(); - return ds.api.matcher .getPairRestrictions({ amountAsset: this.amountBalance.asset, From 58da0a8e82341adadd1e7de1809a546b00a95f87 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Fri, 25 Oct 2019 17:56:49 +0300 Subject: [PATCH 21/25] DEXW-1823: add step round in orderbook --- data-service/api/API.ts | 3 +- .../api/matcher/getPairRestrictions.ts | 9 +++ .../app/services/waves/matcher/Matcher.js | 9 +++ .../dex/directives/orderBook/OrderBook.js | 72 ++++++++++++++++--- .../dex/directives/orderBook/OrderList.js | 5 +- .../dex/directives/orderBook/OrderListItem.js | 32 +++++++-- 6 files changed, 112 insertions(+), 18 deletions(-) create mode 100644 data-service/api/matcher/getPairRestrictions.ts diff --git a/data-service/api/API.ts b/data-service/api/API.ts index 2dff63ca89..e69182492b 100644 --- a/data-service/api/API.ts +++ b/data-service/api/API.ts @@ -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'; @@ -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; diff --git a/data-service/api/matcher/getPairRestrictions.ts b/data-service/api/matcher/getPairRestrictions.ts new file mode 100644 index 0000000000..04e57c9b87 --- /dev/null +++ b/data-service/api/matcher/getPairRestrictions.ts @@ -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` + }); +} diff --git a/src/modules/app/services/waves/matcher/Matcher.js b/src/modules/app/services/waves/matcher/Matcher.js index 6a156c4aa8..d92446c092 100644 --- a/src/modules/app/services/waves/matcher/Matcher.js +++ b/src/modules/app/services/waves/matcher/Matcher.js @@ -113,6 +113,15 @@ return ds.api.matcher.getLastPrice(pair); } + /** + * @param {AssetPair} pair + * @return {Promise} + */ + @decorators.cachable(0.5) + getPairRestrictions(pair) { + return ds.api.matcher.getPairRestrictions(pair); + } + /** * @param {string} address * @return {Promise>} diff --git a/src/modules/dex/directives/orderBook/OrderBook.js b/src/modules/dex/directives/orderBook/OrderBook.js index 435dd0fcc5..c20ebe3c84 100644 --- a/src/modules/dex/directives/orderBook/OrderBook.js +++ b/src/modules/dex/directives/orderBook/OrderBook.js @@ -106,6 +106,10 @@ * @public */ this.isScrolled = false; + /** + * @type {TPairRestrictions | null} + */ + this.pairRestrictions = null; this.receive(dexDataService.showSpread, () => { this._dom.$box.stop().animate({ scrollTop: this._getSpreadScrollPosition() }, 300); @@ -192,6 +196,11 @@ this.priceAsset = priceAsset; this.amountAsset = amountAsset; this.pair = new AssetPair(amountAsset, priceAsset); + return this.pair; + }) + .then(ds.api.matcher.getPairRestrictions) + .then((data) => { + this.pairRestrictions = data; }); } @@ -225,7 +234,7 @@ ]) .then(([orderbook, orders, lastPrice]) => { this.loadingError = false; - return this._remapOrderBook(orderbook, orders, lastPrice); + return this._remapOrderBook(orderbook, orders, lastPrice, this.pairRestrictions.restrictions); }) .catch(() => { this.loadingError = true; @@ -280,8 +289,8 @@ }, Object.create(null)); const lastTrade = lastPrice; - const bids = OrderBook._sumAllOrders(dataBids, 'sell'); - const asks = OrderBook._sumAllOrders(dataAsks, 'buy').reverse(); + const bids = OrderBook._sumAllOrders(dataBids, 'sell', this.pairRestrictions.restrictions); + const asks = OrderBook._sumAllOrders(dataAsks, 'buy', this.pairRestrictions.restrictions).reverse(); const maxAmount = OrderBook._getMaxAmount(bids, asks, crop); @@ -333,8 +342,17 @@ }; const length = OrderList.ROWS_COUNT; - this._asks.render(toLength(data.asks, length), data.crop, data.priceHash, data.maxAmount, pair); - this._bids.render(data.bids, data.crop, data.priceHash, data.maxAmount, pair); + const stepPrecision = this.pairRestrictions && this.pairRestrictions.restrictions ? + { + amount: (new BigNumber(this.pairRestrictions.restrictions.stepAmount)).getDecimalsCount(), + price: (new BigNumber(this.pairRestrictions.restrictions.stepPrice)).getDecimalsCount() + } : + null; + + this._asks.render( + toLength(data.asks, length), data.crop, data.priceHash, data.maxAmount, pair, stepPrecision + ); + this._bids.render(data.bids, data.crop, data.priceHash, data.maxAmount, pair, stepPrecision); if (this._showSpread) { this._showSpread = false; @@ -356,20 +374,27 @@ /** * @param {Array} list * @param {'buy'|'sell'} type + * @param {TRestrictions | null} restrictions * @return Array * @private */ - static _sumAllOrders(list, type) { + static _sumAllOrders(list, type, restrictions) { let total = new BigNumber(0); let amountTotal = new BigNumber(0); return list.map((item) => { total = total.add(item.total); amountTotal = amountTotal.add(item.amount); + const amount = this._roundToStep( + item.amount, restrictions && restrictions.stepAmount ? restrictions.stepAmount : undefined + ); + const price = this._roundToStep( + item.price, restrictions && restrictions.stepPrice ? restrictions.stepPrice : undefined + ); return { type, - amount: new BigNumber(item.amount), - price: new BigNumber(item.price), + amount, + price, total, totalAmount: amountTotal }; @@ -407,6 +432,20 @@ return list.filter((o) => o.price.gte(crop.min) && o.price.lte(crop.max)); } + /** + * @param {string | number} value + * @param {string | number} step? + * @private + */ + static _roundToStep(value, step) { + if (!step) { + return new BigNumber(value); + } + return new BigNumber(value).roundTo( + (new BigNumber(step).getDecimalsCount()) + ); + } + } return new OrderBook(); @@ -463,3 +502,20 @@ * @property {{price: Money, lastSide: string}} lastTrade * @property {BigNumber} spread */ + +/** + * @typedef {object} TPairRestrictions + * @property {TRestrictions | null} restrictions + * @property {tickSize: string} matchingRules + */ + +/** + * @typedef {object} TRestrictions + * @property {string} maxAmount + * @property {string} maxPrice + * @property {string} stepPrice + * @property {string} stepAmount + * @property {string} minPrice + * @property {string} minAmount + */ + diff --git a/src/modules/dex/directives/orderBook/OrderList.js b/src/modules/dex/directives/orderBook/OrderList.js index d234cbb5b8..ff0469913c 100644 --- a/src/modules/dex/directives/orderBook/OrderList.js +++ b/src/modules/dex/directives/orderBook/OrderList.js @@ -54,14 +54,15 @@ * @param {OrderBook.ICrop} crop * @param {Record} priceHash * @param {BigNumber} maxAmount + * @param {TStepPrecision | null} stepPrecision * @param {AssetPair} pair */ - render(data, crop, priceHash, maxAmount, pair) { + render(data, crop, priceHash, maxAmount, pair, stepPrecision) { const widthList = []; this._rows.forEach((row, index) => { const item = data[index]; - row.render(item, crop, priceHash, pair); + row.render(item, crop, priceHash, pair, stepPrecision); widthList[index] = item && item.amount.div(maxAmount).mul(100).toFixed(2); }); diff --git a/src/modules/dex/directives/orderBook/OrderListItem.js b/src/modules/dex/directives/orderBook/OrderListItem.js index 0b627833be..f031ce603b 100644 --- a/src/modules/dex/directives/orderBook/OrderListItem.js +++ b/src/modules/dex/directives/orderBook/OrderListItem.js @@ -82,16 +82,17 @@ * @param {OrderBook.IOrder} data * @param {OrderBook.ICrop} crop * @param {Record} priceHash + * @param {TStepPrecision | null} stepPrecision * @param {AssetPair} pair */ - render(data, crop, priceHash, pair) { + render(data, crop, priceHash, pair, stepPrecision) { if (OrderListItem._isEqual(this._data, data)) { return null; } this._pair = pair; this._data = data; - this._draw(crop, priceHash, pair); + this._draw(crop, priceHash, pair, stepPrecision); } /** @@ -105,14 +106,25 @@ * @param {OrderBook.ICrop} [crop] * @param {Record} [priceHash] * @param {AssetPair} [pair] + * @param {TStepPrecision | null} [stepPrecision] * @private */ - _draw(crop, priceHash, pair) { + _draw(crop, priceHash, pair, stepPrecision) { if (this._data) { - this._amountNode.innerHTML = - utils.getNiceNumberTemplate(this._data.amount, pair.amountAsset.precision, true); - this._priceNode.innerHTML = - utils.getNiceNumberTemplate(this._data.price, pair.priceAsset.precision, 100000); + const amountPrecision = stepPrecision && stepPrecision.amount ? + Math.min(pair.amountAsset.precision, stepPrecision.amount) : + pair.amountAsset.precision; + + const pricePrecision = stepPrecision && stepPrecision.price ? + Math.min(pair.priceAsset.precision, stepPrecision.price) : + pair.priceAsset.precision; + + this._amountNode.innerHTML = utils.getNiceNumberTemplate( + this._data.amount, amountPrecision, true + ); + this._priceNode.innerHTML = utils.getNiceNumberTemplate( + this._data.price, pricePrecision, 100000 + ); this._totalNode.innerHTML = utils.getNiceNumberTemplate(this._data.total, pair.priceAsset.precision, true); @@ -255,3 +267,9 @@ /** * @name OrderListItem */ + +/** + * @typedef {object} TStepPrecision + * @property {number} price + * @property {number} amount + */ From 7238d37b7b43a947a3047f4e992eefed8390b1e0 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 28 Oct 2019 10:52:58 +0300 Subject: [PATCH 22/25] DEXW-1823: save stepPrice round --- .../dex/directives/orderBook/OrderBook.js | 46 +++++++++++-------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/src/modules/dex/directives/orderBook/OrderBook.js b/src/modules/dex/directives/orderBook/OrderBook.js index c20ebe3c84..76b6e135ea 100644 --- a/src/modules/dex/directives/orderBook/OrderBook.js +++ b/src/modules/dex/directives/orderBook/OrderBook.js @@ -200,7 +200,21 @@ }) .then(ds.api.matcher.getPairRestrictions) .then((data) => { - this.pairRestrictions = data; + if (data.restrictions && data.matchingRules) { + const stepPrice = +data.matchingRules.tickSize > +data.restrictions.stepPrice ? + data.matchingRules.tickSize : + data.restrictions.stepPrice; + this.pairRestrictions = { + ...data.restrictions, + stepPrice + }; + } else if (data.matchingRules) { + this.pairRestrictions = { + stepPrice: data.matchingRules.tickSize + }; + } else { + this.pairRestrictions = null; + } }); } @@ -234,7 +248,7 @@ ]) .then(([orderbook, orders, lastPrice]) => { this.loadingError = false; - return this._remapOrderBook(orderbook, orders, lastPrice, this.pairRestrictions.restrictions); + return this._remapOrderBook(orderbook, orders, lastPrice); }) .catch(() => { this.loadingError = true; @@ -289,8 +303,8 @@ }, Object.create(null)); const lastTrade = lastPrice; - const bids = OrderBook._sumAllOrders(dataBids, 'sell', this.pairRestrictions.restrictions); - const asks = OrderBook._sumAllOrders(dataAsks, 'buy', this.pairRestrictions.restrictions).reverse(); + const bids = OrderBook._sumAllOrders(dataBids, 'sell', this.pairRestrictions); + const asks = OrderBook._sumAllOrders(dataAsks, 'buy', this.pairRestrictions).reverse(); const maxAmount = OrderBook._getMaxAmount(bids, asks, crop); @@ -342,10 +356,10 @@ }; const length = OrderList.ROWS_COUNT; - const stepPrecision = this.pairRestrictions && this.pairRestrictions.restrictions ? + const stepPrecision = this.pairRestrictions ? { - amount: (new BigNumber(this.pairRestrictions.restrictions.stepAmount)).getDecimalsCount(), - price: (new BigNumber(this.pairRestrictions.restrictions.stepPrice)).getDecimalsCount() + amount: (new BigNumber(this.pairRestrictions.stepAmount)).getDecimalsCount(), + price: (new BigNumber(this.pairRestrictions.stepPrice)).getDecimalsCount() } : null; @@ -374,7 +388,7 @@ /** * @param {Array} list * @param {'buy'|'sell'} type - * @param {TRestrictions | null} restrictions + * @param {TPairRestrictions | null} restrictions * @return Array * @private */ @@ -505,17 +519,11 @@ /** * @typedef {object} TPairRestrictions - * @property {TRestrictions | null} restrictions - * @property {tickSize: string} matchingRules - */ - -/** - * @typedef {object} TRestrictions - * @property {string} maxAmount - * @property {string} maxPrice + * @property {string} maxAmount? + * @property {string} maxPrice? * @property {string} stepPrice - * @property {string} stepAmount - * @property {string} minPrice - * @property {string} minAmount + * @property {string} stepAmount? + * @property {string} minPrice? + * @property {string} minAmount? */ From 20b4b5a44c4a8901ee380e084f1121cb1ecf8eea Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 28 Oct 2019 11:40:46 +0300 Subject: [PATCH 23/25] DEXW-1823: add matcherSettings in service --- .../app/services/waves/matcher/Matcher.js | 29 ++++++++- src/modules/dex/controllers/DexCtrl.js | 8 ++- .../dex/directives/orderBook/OrderBook.js | 64 +++++++++---------- 3 files changed, 65 insertions(+), 36 deletions(-) diff --git a/src/modules/app/services/waves/matcher/Matcher.js b/src/modules/app/services/waves/matcher/Matcher.js index d92446c092..df95b00b3e 100644 --- a/src/modules/app/services/waves/matcher/Matcher.js +++ b/src/modules/app/services/waves/matcher/Matcher.js @@ -28,6 +28,11 @@ */ currentMatcherAddress = ''; + /** + * @type {TPairRestrictions | null} + */ + pairRestrictions = null; + constructor() { this._orderBookCacheHash = Object.create(null); @@ -115,11 +120,15 @@ /** * @param {AssetPair} pair - * @return {Promise} + * @return {Promise} */ @decorators.cachable(0.5) getPairRestrictions(pair) { - return ds.api.matcher.getPairRestrictions(pair); + return ds.api.matcher.getPairRestrictions(pair) + .then((restrictions) => { + this.pairRestrictions = restrictions; + return restrictions; + }); } /** @@ -465,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 + */ diff --git a/src/modules/dex/controllers/DexCtrl.js b/src/modules/dex/controllers/DexCtrl.js index 82ad6288cf..e2f56207a9 100644 --- a/src/modules/dex/controllers/DexCtrl.js +++ b/src/modules/dex/controllers/DexCtrl.js @@ -14,6 +14,7 @@ * @param {Waves} waves * @param {utils} utils * @param {ModalManager} modalManager + * @param {Matcher} matcher * @return {DexCtrl} */ const controller = function ( @@ -26,7 +27,8 @@ createPoll, waves, utils, - modalManager) { + modalManager, + matcher) { const analytics = require('@waves/event-sender'); @@ -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); } @@ -278,7 +281,8 @@ 'createPoll', 'waves', 'utils', - 'modalManager' + 'modalManager', + 'matcher' ]; angular.module('app.dex') diff --git a/src/modules/dex/directives/orderBook/OrderBook.js b/src/modules/dex/directives/orderBook/OrderBook.js index 76b6e135ea..9fb8ef387d 100644 --- a/src/modules/dex/directives/orderBook/OrderBook.js +++ b/src/modules/dex/directives/orderBook/OrderBook.js @@ -13,6 +13,7 @@ * @param {app.i18n} i18n * @param {typeof OrderList} OrderList * @param {Transactions} transactions + * @param {Matcher} matcher * @return {OrderBook} */ const controller = function (Base, @@ -24,7 +25,8 @@ $scope, i18n, OrderList, - transactions) { + transactions, + matcher) { const SECTIONS = { ASKS: '.table__asks', @@ -107,7 +109,7 @@ */ this.isScrolled = false; /** - * @type {TPairRestrictions | null} + * @type {TRestrictions | null} */ this.pairRestrictions = null; @@ -124,6 +126,8 @@ this._onChangeVisibleElements(); this._updateAssetData(); + + this.receive(utils.observe(matcher, 'pairRestrictions'), this._onChangeMatcherPairRestrictions, this); } $postLink() { @@ -197,24 +201,6 @@ this.amountAsset = amountAsset; this.pair = new AssetPair(amountAsset, priceAsset); return this.pair; - }) - .then(ds.api.matcher.getPairRestrictions) - .then((data) => { - if (data.restrictions && data.matchingRules) { - const stepPrice = +data.matchingRules.tickSize > +data.restrictions.stepPrice ? - data.matchingRules.tickSize : - data.restrictions.stepPrice; - this.pairRestrictions = { - ...data.restrictions, - stepPrice - }; - } else if (data.matchingRules) { - this.pairRestrictions = { - stepPrice: data.matchingRules.tickSize - }; - } else { - this.pairRestrictions = null; - } }); } @@ -385,10 +371,33 @@ return info.offsetTop - box.offsetTop - box.clientHeight / 2 + info.clientHeight / 2; } + /** + * @private + */ + _onChangeMatcherPairRestrictions() { + const restrictions = matcher.pairRestrictions && matcher.pairRestrictions.restrictions; + const matchingRules = matcher.pairRestrictions && matcher.pairRestrictions.matchingRules; + if (restrictions && matchingRules) { + const stepPrice = +matchingRules.tickSize > +restrictions.stepPrice ? + matchingRules.tickSize : + restrictions.stepPrice; + this.pairRestrictions = { + ...restrictions, + stepPrice + }; + } else if (matchingRules) { + this.pairRestrictions = { + stepPrice: matchingRules.tickSize + }; + } else { + this.pairRestrictions = null; + } + } + /** * @param {Array} list * @param {'buy'|'sell'} type - * @param {TPairRestrictions | null} restrictions + * @param {TRestrictions | null} restrictions * @return Array * @private */ @@ -475,7 +484,8 @@ '$scope', 'i18n', 'OrderList', - 'transactions' + 'transactions', + 'matcher' ]; angular.module('app.dex').component('wDexOrderBook', { @@ -517,13 +527,3 @@ * @property {BigNumber} spread */ -/** - * @typedef {object} TPairRestrictions - * @property {string} maxAmount? - * @property {string} maxPrice? - * @property {string} stepPrice - * @property {string} stepAmount? - * @property {string} minPrice? - * @property {string} minAmount? - */ - From c2c59d8099e0d3bf786b0294dbc8fe2bc7a9820a Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 28 Oct 2019 12:22:37 +0300 Subject: [PATCH 24/25] DEXW-1823: refactor --- src/modules/dex/directives/orderBook/OrderBook.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/dex/directives/orderBook/OrderBook.js b/src/modules/dex/directives/orderBook/OrderBook.js index 9fb8ef387d..65000c6e4b 100644 --- a/src/modules/dex/directives/orderBook/OrderBook.js +++ b/src/modules/dex/directives/orderBook/OrderBook.js @@ -378,7 +378,7 @@ const restrictions = matcher.pairRestrictions && matcher.pairRestrictions.restrictions; const matchingRules = matcher.pairRestrictions && matcher.pairRestrictions.matchingRules; if (restrictions && matchingRules) { - const stepPrice = +matchingRules.tickSize > +restrictions.stepPrice ? + const stepPrice = (new BigNumber(matchingRules.tickSize)).gt(restrictions.stepPrice) ? matchingRules.tickSize : restrictions.stepPrice; this.pairRestrictions = { From 58ce0031f1ffe22bd4194b097a0ccd4f5ac7d8a3 Mon Sep 17 00:00:00 2001 From: okanishcheva Date: Mon, 28 Oct 2019 16:31:51 +0300 Subject: [PATCH 25/25] CLIENT-1819: merge dexw-1823, refactoring --- .../dex/directives/createOrder/CreateOrder.js | 118 ++++++++++-------- 1 file changed, 66 insertions(+), 52 deletions(-) diff --git a/src/modules/dex/directives/createOrder/CreateOrder.js b/src/modules/dex/directives/createOrder/CreateOrder.js index c45bdd4e54..974810b010 100644 --- a/src/modules/dex/directives/createOrder/CreateOrder.js +++ b/src/modules/dex/directives/createOrder/CreateOrder.js @@ -16,10 +16,11 @@ * @param {ModalManager} modalManager * @param {BalanceWatcher} balanceWatcher * @param {Transactions} transactions + * @param {Matcher} matcher * @return {CreateOrder} */ const controller = function (Base, waves, user, utils, createPoll, $scope, $element, notification, - dexDataService, ease, $state, modalManager, balanceWatcher, transactions) { + dexDataService, ease, $state, modalManager, balanceWatcher, transactions, matcher) { const { without, keys, last } = require('ramda'); const { Money } = require('@waves/data-entities'); @@ -221,15 +222,13 @@ */ const spreadPoll = createPoll(this, this._getData, this._setData, 1000); - this.receive(balanceWatcher.change, this._updateBalances, this); - this._updateBalances().then(() => this._setPairRestrictions()); - const onChangeBalanceWatcher = () => { this._updateBalances(); if (this.matcherSettings.mode === 'dynamic') { this._updateFeeList(); } }; + this.receive(balanceWatcher.change, onChangeBalanceWatcher, this); this._updateBalances(); @@ -257,7 +256,6 @@ this.isValidPricePrecision = this._validatePricePrecision(); this.observe(['amountBalance', 'type', 'fee', 'priceBalance'], this._updateMaxAmountOrPriceBalance); - this.observe(['maxAmountBalance', 'amountBalance', 'priceBalance', 'fee'], this._setPairRestrictions); this.observe('_assetIdPair', () => { this.amount = null; @@ -344,6 +342,9 @@ } $scope.$apply(); }); + + this.receive(utils.observe(matcher, 'pairRestrictions'), this._onChangeMatcherPairRestrictions, this); + this.observe(['maxAmountBalance'], this._onChangeMatcherPairRestrictions); } /** @@ -385,9 +386,7 @@ expand(type) { this.type = type; if (!this.price || this.price.getTokens().eq('0')) { - this._setPairRestrictions().then(() => { - this.price = this._getCurrentPrice(); - }); + this.price = this._getCurrentPrice(); } // todo: refactor after getting rid of Layout-DEX coupling. @@ -1155,53 +1154,67 @@ } /** - * @return {Promise|Promise} + * @return {void} * @private */ - _setPairRestrictions() { - if (!this.loaded) { - return Promise.resolve(); - } - + _onChangeMatcherPairRestrictions() { this.pairRestrictions = {}; const defaultPairRestriction = this._getDefaultPairRestriction(); - return ds.api.matcher - .getPairRestrictions({ - amountAsset: this.amountBalance.asset, - priceAsset: this.priceBalance.asset - }) - .then(data => { - const { maxAmount, maxPrice, stepPrice, stepAmount, minPrice, minAmount } = data.restrictions; - const restMaxAmount = maxAmount ? new BigNumber(maxAmount) : defaultPairRestriction.maxAmount; - const pricePrecision = stepPrice ? - Math.min( - new BigNumber(stepPrice).getDecimalsCount(), defaultPairRestriction.pricePrecision - ) : - defaultPairRestriction.pricePrecision; - const amountPrecision = stepAmount ? - Math.min( - new BigNumber(stepAmount).getDecimalsCount(), defaultPairRestriction.amountPrecision - ) : - defaultPairRestriction.amountPrecision; - - this.pairRestrictions = { - maxPrice: maxPrice ? new BigNumber(maxPrice) : defaultPairRestriction.maxPrice, - maxAmount: this.maxAmountBalance ? - BigNumber.min(this.maxAmountBalance.getTokens(), restMaxAmount) : - restMaxAmount, - minPrice: minPrice ? - BigNumber.max(new BigNumber(minPrice), defaultPairRestriction.minPrice) : - defaultPairRestriction.minPrice, - minAmount: minAmount ? - BigNumber.max(new BigNumber(minAmount), defaultPairRestriction.minAmount) : - defaultPairRestriction.minAmount, - pricePrecision, - amountPrecision - }; - }) - .catch(() => { - this.pairRestrictions = defaultPairRestriction; - }); + const matcherSettings = matcher.pairRestrictions; + + if (!matcherSettings) { + this.pairRestrictions = defaultPairRestriction; + return; + } + + const restrictions = matcherSettings.restrictions; + const matchingRules = matcherSettings.matchingRules; + + if (!restrictions && !matchingRules) { + this.pairRestrictions = defaultPairRestriction; + return; + } + + if (!restrictions && matchingRules && matchingRules.tickSize) { + this.pairRestrictions = { + ...defaultPairRestriction, + pricePrecision: new BigNumber(matchingRules.tickSize).getDecimalsCount() + }; + return; + } + + const { maxAmount, maxPrice, stepPrice, stepAmount, minPrice, minAmount } = restrictions; + const restMaxAmount = maxAmount ? new BigNumber(maxAmount) : defaultPairRestriction.maxAmount; + + const priceSizes = [defaultPairRestriction.pricePrecision]; + if (stepPrice) { + priceSizes.push(new BigNumber(stepPrice).getDecimalsCount()); + } + if (matchingRules && matchingRules.tickSize) { + priceSizes.push(new BigNumber(matchingRules.tickSize).getDecimalsCount()); + } + const pricePrecision = Math.min(...priceSizes); + + const amountPrecision = stepAmount ? + Math.min( + new BigNumber(stepAmount).getDecimalsCount(), defaultPairRestriction.amountPrecision + ) : + defaultPairRestriction.amountPrecision; + + this.pairRestrictions = { + maxPrice: maxPrice ? new BigNumber(maxPrice) : defaultPairRestriction.maxPrice, + maxAmount: this.maxAmountBalance ? + BigNumber.min(this.maxAmountBalance.getTokens(), restMaxAmount) : + restMaxAmount, + minPrice: minPrice ? + BigNumber.max(new BigNumber(minPrice), defaultPairRestriction.minPrice) : + defaultPairRestriction.minPrice, + minAmount: minAmount ? + BigNumber.max(new BigNumber(minAmount), defaultPairRestriction.minAmount) : + defaultPairRestriction.minAmount, + pricePrecision, + amountPrecision + }; } /** @@ -1290,7 +1303,8 @@ '$state', 'modalManager', 'balanceWatcher', - 'transactions' + 'transactions', + 'matcher' ]; angular.module('app.dex').component('wCreateOrder', {