Skip to content

Commit 9df9b74

Browse files
author
Layko Andrey
committed
10 - Fix asset exchange rate
Changed exchange rates API URL to Binance API
1 parent ac2ac69 commit 9df9b74

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

frontend/src/actions/deploy-contract.js

-9
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,6 @@ export const convertCurrencies = conversionValues => async dispatch => {
9696
const fromAmount = conversionValues.fromAmount ? conversionValues.fromAmount : '0';
9797
let fromCurrency = conversionValues.fromCurrency ? conversionValues.fromCurrency.toUpperCase() : 'TUSD';
9898
let toCurrency = conversionValues.toCurrency ? conversionValues.toCurrency.toUpperCase() : 'ETH';
99-
100-
if (toCurrency === 'USD') {
101-
toCurrency = 'TUSD'
102-
}
103-
104-
if (fromCurrency === 'USD') {
105-
fromCurrency = 'TUSD'
106-
}
107-
10899
const apiRequestUrl = `https://api.binance.com/api/v3/avgPrice?symbol=${fromCurrency}${toCurrency}`;
109100

110101
try {

frontend/src/components/WithdrawFundsForm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class WithdrawFundsForm extends Component {
2727
className="ui compact selection dropdown"
2828
name="withdrawalCurrency"
2929
options={[
30-
{key: 'dollars', text: '$', value: 'USD'},
30+
{key: 'dollars', text: '$', value: 'TUSD'},
3131
{key: 'pounds', text: '£', value: 'GBP'},
3232
{key: 'eruo', text: '€', value: 'EUR'},
3333
{key: 'reminibi', text: '¥', value: 'CNY'},

frontend/src/scenes/EthereumScaffoldForm.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class EthereumScaffoldForm extends Component {
7676
const conversionAmount = await actions.convertCurrencies({
7777
fromAmount: fiatAmount || fiatAmount === 0 ? fiatAmount : formValues.fiatAmount,
7878
fromCurrency: newCurrency || formValues.currency,
79-
toCurrency: 'eth'
79+
toCurrency: 'ETH'
8080
});
8181
change('conversionAmount', conversionAmount);
8282
};
@@ -196,7 +196,7 @@ class EthereumScaffoldForm extends Component {
196196
className="ui compact selection dropdown"
197197
name="currency"
198198
options={[
199-
{ key: 'dollars', text: '$', value: 'USD' },
199+
{ key: 'dollars', text: '$', value: 'TUSD' },
200200
{ key: 'pounds', text: '£', value: 'GBP' },
201201
{ key: 'eruo', text: '€', value: 'EUR' },
202202
{ key: 'reminibi', text: '¥', value: 'CNY' },

0 commit comments

Comments
 (0)