diff --git a/lib/app/shared/widget/custom_listtile_card.dart b/lib/app/shared/widget/custom_listtile_card.dart index 8ac407a6a..f3879f538 100644 --- a/lib/app/shared/widget/custom_listtile_card.dart +++ b/lib/app/shared/widget/custom_listtile_card.dart @@ -45,17 +45,11 @@ class CustomListTileCard extends StatelessWidget { style: Theme.of(context).textTheme.bodyMedium, ), minVerticalPadding: 0, - trailing: Container( - height: 65, - width: 65, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).colorScheme.secondary, - ), - child: Image.asset( - imageAssetPath, - color: Theme.of(context).colorScheme.onSecondary, - ), + trailing: Image.asset( + imageAssetPath, + width: Sizes.icon5x, + height: Sizes.icon5x, + fit: BoxFit.fitHeight, ), ); } diff --git a/lib/dashboard/add_account/create_account/view/create_account_step1_page.dart b/lib/dashboard/add_account/create_account/view/create_account_step1_page.dart index 04824337f..43824a7d0 100644 --- a/lib/dashboard/add_account/create_account/view/create_account_step1_page.dart +++ b/lib/dashboard/add_account/create_account/view/create_account_step1_page.dart @@ -127,6 +127,7 @@ class CreateAccountStep1View extends StatelessWidget { ); }, ), + const SizedBox(height: Sizes.spaceNormal), ], if (BlockchainType.etherlink.isSupported(profileSetting)) ...[ CustomListTileCard( diff --git a/lib/dashboard/add_account/import_account/view/import_account_step1_page.dart b/lib/dashboard/add_account/import_account/view/import_account_step1_page.dart index c5fe6a491..d9f3caa44 100644 --- a/lib/dashboard/add_account/import_account/view/import_account_step1_page.dart +++ b/lib/dashboard/add_account/import_account/view/import_account_step1_page.dart @@ -126,6 +126,7 @@ class ImportAccountStep1View extends StatelessWidget { ); }, ), + const SizedBox(height: Sizes.spaceNormal), ], if (BlockchainType.etherlink.isSupported(profileSetting)) ...[ CustomListTileCard( diff --git a/lib/dashboard/home/tab_bar/tokens/token_page/cubit/tokens_cubit.dart b/lib/dashboard/home/tab_bar/tokens/token_page/cubit/tokens_cubit.dart index 60d776201..f79a987e2 100644 --- a/lib/dashboard/home/tab_bar/tokens/token_page/cubit/tokens_cubit.dart +++ b/lib/dashboard/home/tab_bar/tokens/token_page/cubit/tokens_cubit.dart @@ -2,6 +2,7 @@ import 'package:altme/app/app.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/wallet/wallet.dart'; import 'package:bloc/bloc.dart'; +import 'package:dio/dio.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:json_annotation/json_annotation.dart'; @@ -136,10 +137,21 @@ class TokensCubit extends Cubit { } final baseUrl = ethereumNetwork.apiUrl; - final List tokensBalancesJsonArray = await client.get( - '$baseUrl/v2/addresses/$walletAddress/token-balances', - headers: {'Content-Type': 'application/json'}, - ) as List; + List tokensBalancesJsonArray = []; + + try { + tokensBalancesJsonArray = await client.get( + '$baseUrl/v2/addresses/$walletAddress/token-balances', + headers: {'Content-Type': 'application/json'}, + ) as List; + } catch (e) { + if (e is NetworkException && + e.message == NetworkError.NETWORK_ERROR_NOT_FOUND) { + tokensBalancesJsonArray = []; + } else { + rethrow; + } + } List newData = []; @@ -174,7 +186,6 @@ class TokensCubit extends Cubit { if (offset == 0) { final ethereumBaseToken = await _getBaseTokenBalanceOnEtherlink( walletAddress, - ethereumNetwork, ); @@ -183,12 +194,10 @@ class TokensCubit extends Cubit { } data = newData; - if (data.length == 1) { final emptyTokens = await getSomeEmptyCoins(ethereumNetwork.type); data.addAll(emptyTokens); } - } else { data.addAll(newData); } @@ -527,7 +536,6 @@ class TokensCubit extends Cubit { Future _getBaseTokenBalanceOnEtherlink( String walletAddress, - EthereumNetwork ethereumNetwork, ) async { try { @@ -548,8 +556,21 @@ class TokensCubit extends Cubit { standard: 'ERC20', decimalsToShow: 5, ); - } catch (e, s) { + if (e is NetworkException && + e.message == NetworkError.NETWORK_ERROR_NOT_FOUND) { + return TokenModel( + contractAddress: '', + name: 'Etherlink', + symbol: 'XTZ', + icon: ethereumNetwork.mainTokenIcon, + balance: '0', + decimals: ethereumNetwork.mainTokenDecimal, + standard: 'ERC20', + decimalsToShow: 5, + ); + } + getLogger(toString()).e('error: $e, stack: $s'); return null; } diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index 638adc507..2876d6c2f 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -1058,9 +1058,9 @@ "toStopDisplayingThisPopupDeactivateTheDeveloperModeInTheSettings": "To stop displaying this popup, deactivate the 'developer mode' in the settings.", "warningDialogSubtitle": "The recovery page contains sensitive information. Please, make sure to keep it private.", "accountPrivateKeyAlert": "The recovery page contains sensitive information. Please, make sure to keep it private.", - "etherlinkNetwork": "Ethereum Network", - "etherlinkAccount": "Ethereum account", - "etherlinkAccountDescription": "Create a new Ethereum blockchain address", - "etherlinkAccountCreationCongratulations": "Your new Ethereum account has been successfully created.", + "etherlinkNetwork": "Etherlink Network", + "etherlinkAccount": "Etherlink account", + "etherlinkAccountDescription": "Create a new Etherlink blockchain address", + "etherlinkAccountCreationCongratulations": "Your new Etherlink account has been successfully created.", "etherlinkProofMessage": "" } diff --git a/lib/wallet/cubit/wallet_cubit.dart b/lib/wallet/cubit/wallet_cubit.dart index a17974f01..29a58cd36 100644 --- a/lib/wallet/cubit/wallet_cubit.dart +++ b/lib/wallet/cubit/wallet_cubit.dart @@ -147,8 +147,8 @@ class WalletCubit extends Cubit { BlockchainType.fantom: 0, BlockchainType.polygon: 1, BlockchainType.binance: 2, - BlockchainType.ethereum: 3, - BlockchainType.etherlink: 4, + BlockchainType.etherlink: 3, + BlockchainType.ethereum: 4, }; for (final entry in accounts.entries) { @@ -175,8 +175,8 @@ class WalletCubit extends Cubit { BlockchainType.polygon: 0, BlockchainType.binance: 1, BlockchainType.tezos: 2, - BlockchainType.ethereum: 3, - BlockchainType.etherlink: 4, + BlockchainType.etherlink: 3, + BlockchainType.ethereum: 4, // default account as it is last }; for (final entry in accounts.entries) { diff --git a/packages/oidc4vc/lib/src/oidc4vc.dart b/packages/oidc4vc/lib/src/oidc4vc.dart index 9815c8d39..1f2770897 100644 --- a/packages/oidc4vc/lib/src/oidc4vc.dart +++ b/packages/oidc4vc/lib/src/oidc4vc.dart @@ -1331,6 +1331,7 @@ class OIDC4VC { required Map payload, required Map privateKey, required String kid, + required MediaType mediaType, }) { final d = base64Url.decode(privateKey['d'].toString()); final x = base64Url.decode(privateKey['x'].toString()); @@ -1340,7 +1341,7 @@ class OIDC4VC { final jwt = JWT( payload, header: { - 'typ': 'openid4vci-proof+jwt', + 'typ': mediaType.typ, 'alg': 'EdDSA', 'kid': kid, }, @@ -1617,6 +1618,7 @@ class OIDC4VC { payload: payload, privateKey: tokenParameters.privateKey, kid: tokenParameters.kid ?? tokenParameters.thumbprint, + mediaType: tokenParameters.mediaType, ); return jwt; diff --git a/packages/oidc4vc/test/src/oidc4vc_test.dart b/packages/oidc4vc/test/src/oidc4vc_test.dart index 4b283030f..925d19fce 100644 --- a/packages/oidc4vc/test/src/oidc4vc_test.dart +++ b/packages/oidc4vc/test/src/oidc4vc_test.dart @@ -144,6 +144,7 @@ void main() { payload: payload, privateKey: privateKey, kid: kid, + mediaType: MediaType.proofOfOwnership, ); final value = oidc4vc.verifyTokenEdDSA( diff --git a/pubspec.yaml b/pubspec.yaml index 3ef02d103..1f62ce27f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: altme description: AltMe Flutter App -version: 2.11.2+495 +version: 2.11.6+499 publish_to: "none" # Remove this line if you wish to publish to pub.dev environment: