-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Adaptive default token (#4)
This branch introduces adaptive default token queried from the network, and thus specific to each network. Until now, default token was hardcoded, which was removed in this branch. It also prepares a model for the default bech32 prefix, which has analogous purpose and was initially intended to implement together. However, due to work organization purposes, the Adaptive Bech32 Address Prefix feature will be introduced separately. List of changes: - deleted hardcoded "defaultFeeTokenAliasModel" from app_config.dart in order to replace it with queried values - created query_kira_token_aliases_req.dart to enable using query parameters introduced in interx v0.4.43 - pagination and querying by denomination name - updated query_kira_token_aliases_resp.dart with new parameters "defaultDenom" and "bech32Prefix", added in interx v0.4.43 - created token_default_denom_model.dart which is a business model representing default token alias. It also contains default bech32 prefix, which will be used later in the analogous feature Adaptive Bech32 Address Prefix. - created "getTokenDefaultDenomModel()" method in query_kira_token_aliases_service.dart, which is called with every network change and conditions its status - if TokenDefaultDenomModel is missing, network is unhealthy - added "tokenDefaultDenomModel" field to classes extending ANetworkOnlineModel to enable passing the new parameters to the network - replaced every usage of hardcoded default token with the queried values, accessed via NetworkModuleBloc with the variable "tokenDefaultDenomModel" - unrelated with the branch's specific domain: modified token_avatar.dart to handle both .svg and .png logo images
- Loading branch information
Showing
33 changed files
with
357 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
lib/infra/dto/api_kira/query_kira_tokens_aliases/request/query_kira_tokens_aliases_req.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:equatable/equatable.dart'; | ||
|
||
class QueryKiraTokensAliasesReq extends Equatable { | ||
final List<String>? tokens; | ||
final int? limit; | ||
final int? offset; | ||
|
||
const QueryKiraTokensAliasesReq({ | ||
this.tokens, | ||
this.limit, | ||
this.offset, | ||
}); | ||
|
||
Map<String, dynamic> get queryParameters => <String, dynamic>{ | ||
'tokens': tokens?.join(','), | ||
'limit': limit, | ||
'offset': offset, | ||
}; | ||
|
||
@override | ||
List<Object?> get props => <Object?>[tokens, limit, offset]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.