mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 03:49:22 +00:00
change now token contract "fix"
This commit is contained in:
parent
bc90723c86
commit
051eb6c924
2 changed files with 11 additions and 1 deletions
|
@ -149,6 +149,8 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
|||
currency.ticker,
|
||||
caseSensitive: false,
|
||||
)
|
||||
.and()
|
||||
.tokenContractEqualTo(currency.tokenContract)
|
||||
.findAll();
|
||||
|
||||
final items = [Tuple2(currency.exchangeName, currency)];
|
||||
|
@ -631,6 +633,7 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
|||
.getAggregateCurrency(
|
||||
widget.contract == null ? coin!.ticker : widget.contract!.symbol,
|
||||
ExchangeRateType.estimated,
|
||||
widget.contract == null ? null : widget.contract!.address,
|
||||
)
|
||||
.then((value) {
|
||||
if (value != null) {
|
||||
|
|
|
@ -61,10 +61,12 @@ class ExchangeDataLoadingService {
|
|||
final sendCurrency = await getAggregateCurrency(
|
||||
"BTC",
|
||||
state.exchangeRateType,
|
||||
null,
|
||||
);
|
||||
final receiveCurrency = await getAggregateCurrency(
|
||||
"XMR",
|
||||
state.exchangeRateType,
|
||||
null,
|
||||
);
|
||||
state.setCurrencies(sendCurrency, receiveCurrency);
|
||||
}
|
||||
|
@ -72,7 +74,10 @@ class ExchangeDataLoadingService {
|
|||
}
|
||||
|
||||
Future<AggregateCurrency?> getAggregateCurrency(
|
||||
String ticker, ExchangeRateType rateType) async {
|
||||
String ticker,
|
||||
ExchangeRateType rateType,
|
||||
String? contract,
|
||||
) async {
|
||||
final currencies = await ExchangeDataLoadingService.instance.isar.currencies
|
||||
.filter()
|
||||
.group((q) => rateType == ExchangeRateType.fixed
|
||||
|
@ -89,6 +94,8 @@ class ExchangeDataLoadingService {
|
|||
ticker,
|
||||
caseSensitive: false,
|
||||
)
|
||||
.and()
|
||||
.tokenContractEqualTo(contract)
|
||||
.findAll();
|
||||
|
||||
final items = currencies
|
||||
|
|
Loading…
Reference in a new issue