mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-24 19:46:16 +00:00
Update thorchain_exchange.provider.dart
This commit is contained in:
parent
23fa325c43
commit
466b8877fb
1 changed files with 2 additions and 7 deletions
|
@ -8,13 +8,12 @@ import 'package:cake_wallet/exchange/trade.dart';
|
||||||
import 'package:cake_wallet/exchange/trade_request.dart';
|
import 'package:cake_wallet/exchange/trade_request.dart';
|
||||||
import 'package:cake_wallet/exchange/trade_state.dart';
|
import 'package:cake_wallet/exchange/trade_state.dart';
|
||||||
import 'package:cake_wallet/exchange/utils/currency_pairs_utils.dart';
|
import 'package:cake_wallet/exchange/utils/currency_pairs_utils.dart';
|
||||||
import 'package:cake_wallet/store/dashboard/trades_store.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:cw_core/amount_converter.dart';
|
import 'package:cw_core/amount_converter.dart';
|
||||||
import 'package:cw_core/crypto_currency.dart';
|
import 'package:cw_core/crypto_currency.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:collection/collection.dart';
|
|
||||||
|
|
||||||
class ThorChainExchangeProvider extends ExchangeProvider {
|
class ThorChainExchangeProvider extends ExchangeProvider {
|
||||||
ThorChainExchangeProvider({required this.tradesStore})
|
ThorChainExchangeProvider({required this.tradesStore})
|
||||||
|
@ -26,7 +25,6 @@ class ThorChainExchangeProvider extends ExchangeProvider {
|
||||||
CryptoCurrency.btc,
|
CryptoCurrency.btc,
|
||||||
CryptoCurrency.eth,
|
CryptoCurrency.eth,
|
||||||
CryptoCurrency.ltc,
|
CryptoCurrency.ltc,
|
||||||
CryptoCurrency.bch
|
|
||||||
].contains(element))
|
].contains(element))
|
||||||
.toList())
|
.toList())
|
||||||
];
|
];
|
||||||
|
@ -34,7 +32,7 @@ class ThorChainExchangeProvider extends ExchangeProvider {
|
||||||
static const _baseURL = 'https://thornode.ninerealms.com';
|
static const _baseURL = 'https://thornode.ninerealms.com';
|
||||||
static const _quotePath = '/thorchain/quote/swap';
|
static const _quotePath = '/thorchain/quote/swap';
|
||||||
static const _affiliateName = 'cakewallet';
|
static const _affiliateName = 'cakewallet';
|
||||||
static const _affiliateBps = '0';
|
static const _affiliateBps = '10';
|
||||||
|
|
||||||
final Box<Trade> tradesStore;
|
final Box<Trade> tradesStore;
|
||||||
|
|
||||||
|
@ -80,8 +78,6 @@ class ThorChainExchangeProvider extends ExchangeProvider {
|
||||||
'from_asset': _normalizeCurrency(from),
|
'from_asset': _normalizeCurrency(from),
|
||||||
'to_asset': _normalizeCurrency(to),
|
'to_asset': _normalizeCurrency(to),
|
||||||
'amount': AmountConverter.amountToSmallestUnit(cryptoCurrency: from, amount: 1).toString(),
|
'amount': AmountConverter.amountToSmallestUnit(cryptoCurrency: from, amount: 1).toString(),
|
||||||
'affiliate': _affiliateName,
|
|
||||||
'affiliate_bps': _affiliateBps,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
final responseJSON = await _getSwapQuote(params);
|
final responseJSON = await _getSwapQuote(params);
|
||||||
|
@ -109,7 +105,6 @@ class ThorChainExchangeProvider extends ExchangeProvider {
|
||||||
|
|
||||||
final responseJSON = await _getSwapQuote(params);
|
final responseJSON = await _getSwapQuote(params);
|
||||||
|
|
||||||
print('createTrade _ responseJSON________: $responseJSON');
|
|
||||||
final inputAddress = responseJSON['inbound_address'] as String?;
|
final inputAddress = responseJSON['inbound_address'] as String?;
|
||||||
final memo = responseJSON['memo'] as String?;
|
final memo = responseJSON['memo'] as String?;
|
||||||
final tradeId = await getNextTradeCounter();
|
final tradeId = await getNextTradeCounter();
|
||||||
|
|
Loading…
Reference in a new issue