diff --git a/assets/bc-logos/Archethic.svg b/assets/bc-logos/Archethic.svg
new file mode 100644
index 000000000..04180bb22
--- /dev/null
+++ b/assets/bc-logos/Archethic.svg
@@ -0,0 +1,13 @@
+
diff --git a/assets/bc-logos/BNB.svg b/assets/bc-logos/BNB.svg
new file mode 100644
index 000000000..d39bfa1da
--- /dev/null
+++ b/assets/bc-logos/BNB.svg
@@ -0,0 +1,14 @@
+
+
\ No newline at end of file
diff --git a/assets/bc-logos/EURe.svg b/assets/bc-logos/EURe.svg
new file mode 100644
index 000000000..5f51e5b0f
--- /dev/null
+++ b/assets/bc-logos/EURe.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/bc-logos/Ethereum.svg b/assets/bc-logos/Ethereum.svg
new file mode 100644
index 000000000..171c0b605
--- /dev/null
+++ b/assets/bc-logos/Ethereum.svg
@@ -0,0 +1,19 @@
+
+
\ No newline at end of file
diff --git a/assets/bc-logos/Matic.svg b/assets/bc-logos/Matic.svg
new file mode 100644
index 000000000..9cd801399
--- /dev/null
+++ b/assets/bc-logos/Matic.svg
@@ -0,0 +1,21 @@
+
+
\ No newline at end of file
diff --git a/lib/application/market_price.dart b/lib/application/market_price.dart
index 37129e2a6..95213aaf4 100644
--- a/lib/application/market_price.dart
+++ b/lib/application/market_price.dart
@@ -1,4 +1,3 @@
-import 'package:aewallet/application/oracle/provider.dart';
import 'package:aewallet/application/settings/settings.dart';
import 'package:aewallet/domain/models/core/result.dart';
import 'package:aewallet/domain/models/market_price.dart';
@@ -8,6 +7,8 @@ import 'package:aewallet/infrastructure/repositories/market/archethic_oracle_uco
import 'package:aewallet/infrastructure/repositories/market/coingecko_uco_market.dart';
import 'package:aewallet/infrastructure/repositories/market/local_uco_market.dart';
import 'package:aewallet/model/available_currency.dart';
+import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart'
+ as aedappfm;
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
@@ -43,7 +44,7 @@ Future _selectedCurrencyMarketPrice(Ref ref) async {
if (currency.name == 'usd') {
final archethicOracleUCO =
- ref.watch(ArchethicOracleUCOProviders.archethicOracleUCO);
+ ref.watch(aedappfm.ArchethicOracleUCOProviders.archethicOracleUCO);
return MarketPrice(
amount: archethicOracleUCO.usd,
lastLoading: archethicOracleUCO.timestamp,
@@ -52,7 +53,7 @@ Future _selectedCurrencyMarketPrice(Ref ref) async {
} else {
if (currency.name == 'eur') {
final archethicOracleUCO =
- ref.watch(ArchethicOracleUCOProviders.archethicOracleUCO);
+ ref.watch(aedappfm.ArchethicOracleUCOProviders.archethicOracleUCO);
return MarketPrice(
amount: archethicOracleUCO.eur,
lastLoading: archethicOracleUCO.timestamp,
diff --git a/lib/application/market_price.g.dart b/lib/application/market_price.g.dart
index ff361fc16..5eca77a65 100644
--- a/lib/application/market_price.g.dart
+++ b/lib/application/market_price.g.dart
@@ -191,7 +191,7 @@ class _CurrencyMarketPriceProviderElement
}
String _$selectedCurrencyMarketPriceHash() =>
- r'6b813030eaf80361c53bed7ad5e9fe9b4447ce88';
+ r'916fbf25a847d2d714b9c5bfe2bf5a6eeb277e08';
/// See also [_selectedCurrencyMarketPrice].
@ProviderFor(_selectedCurrencyMarketPrice)
diff --git a/lib/application/nft/nft.dart b/lib/application/nft/nft.dart
index 23259bb53..2755a9ec7 100644
--- a/lib/application/nft/nft.dart
+++ b/lib/application/nft/nft.dart
@@ -1,20 +1,14 @@
-import 'dart:convert';
-import 'dart:typed_data';
-
+import 'package:aewallet/infrastructure/repositories/nft/nft.repository.dart';
import 'package:aewallet/model/blockchain/keychain_secured_infos.dart';
import 'package:aewallet/model/blockchain/token_information.dart';
import 'package:aewallet/model/data/account_token.dart';
import 'package:aewallet/model/keychain_service_keypair.dart';
-import 'package:aewallet/service/app_service.dart';
-import 'package:aewallet/util/get_it_instance.dart';
-import 'package:archethic_lib_dart/archethic_lib_dart.dart';
-import 'package:logging/logging.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'nft.g.dart';
@riverpod
-NFTRepository _nftRepository(_NftRepositoryRef ref) => NFTRepository();
+NFTRepositoryImpl _nftRepository(_NftRepositoryRef ref) => NFTRepositoryImpl();
@riverpod
Future _getNFTInfo(
@@ -51,223 +45,6 @@ Future<(List, List)> _getNFTList(
.getNFTList(address, nameAccount, keychainSecuredInfos);
}
-class NFTRepository {
- static final _logger = Logger('NFTRepository');
-
- Future isAccountOwner(
- String accountAddress,
- String tokenAddress,
- String tokenId,
- ) async {
- final accountLastAddressMap =
- await sl.get().getLastTransaction([accountAddress]);
- var accounLastAddress = '';
- if (accountLastAddressMap[accountAddress] == null ||
- accountLastAddressMap[accountAddress]!.address == null ||
- accountLastAddressMap[accountAddress]!.address!.address == null) {
- accounLastAddress = accountAddress;
- } else {
- accounLastAddress =
- accountLastAddressMap[accountAddress]!.address!.address!;
- }
-
- final accountLastInputsMap =
- await sl.get().getTransactionInputs(
- [accounLastAddress],
- request: 'amount, from, tokenAddress, spent, timestamp, type, tokenId',
- );
-
- if (accountLastInputsMap[accounLastAddress] == null) {
- return false;
- }
-
- final _tokenId = int.tryParse(tokenId);
-
- final accountLastInputs = accountLastInputsMap[accounLastAddress];
- for (final input in accountLastInputs!) {
- if (_tokenId == null) {
- if (input.tokenAddress == tokenAddress) {
- return true;
- }
- } else {
- if (input.tokenAddress == tokenAddress && input.tokenId == _tokenId) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- Future getNFTInfo(
- String address,
- KeychainServiceKeyPair keychainServiceKeyPair,
- ) async {
- final tokenMap = await sl.get().getToken(
- [address],
- );
-
- if (tokenMap.isEmpty ||
- tokenMap[address] == null ||
- tokenMap[address]!.type != 'non-fungible') {
- return null;
- }
-
- final token = tokenMap[address]!;
-
- final tokenProperties = {...token.properties};
-
- if (token.ownerships != null && token.ownerships!.isNotEmpty) {
- tokenProperties.addAll(
- _tokenPropertiesDecryptedSecret(
- keypair: keychainServiceKeyPair,
- ownerships: token.ownerships!,
- ),
- );
- }
- final tokenInformation = TokenInformation(
- address: address,
- name: token.name,
- id: token.id,
- type: token.type,
- decimals: token.decimals,
- supply: fromBigInt(token.supply).toDouble(),
- symbol: token.symbol,
- tokenProperties: tokenProperties,
- tokenCollection: token.collection,
- );
- return tokenInformation;
- }
-
- Future<(List, List)> getNFTList(
- String address,
- String nameAccount,
- KeychainSecuredInfos keychainSecuredInfos,
- ) async {
- final balanceMap = await sl.get().fetchBalance([address]);
- final balance = balanceMap[address];
- final nftList = [];
- final nftCollectionList = [];
-
- final tokenAddressList = [];
- if (balance == null) {
- return (nftList, nftCollectionList);
- }
-
- for (final tokenBalance in balance.token) {
- if (tokenBalance.address != null) {
- tokenAddressList.add(tokenBalance.address!);
- }
- }
-
- final tokenMap = await sl.get().getToken(
- tokenAddressList.toSet().toList(),
- );
-
- // TODO(reddwarf03): temporaly section -> need https://github.com/archethic-foundation/archethic-node/issues/714
-
- final secretMap = await sl.get().getTransaction(
- tokenAddressList.toSet().toList(),
- request:
- 'data { ownerships { authorizedPublicKeys { encryptedSecretKey, publicKey } secret } }',
- );
-
- for (final tokenBalance in balance.token) {
- final token = tokenMap[tokenBalance.address];
-
- if (token == null || token.type != 'non-fungible') {
- continue;
- }
-
- final newProperties = {...token.properties};
-
- if (secretMap[tokenBalance.address] != null &&
- secretMap[tokenBalance.address]!.data != null &&
- secretMap[tokenBalance.address]!.data!.ownerships.isNotEmpty) {
- newProperties.addAll(
- _tokenPropertiesDecryptedSecret(
- keypair: keychainSecuredInfos.services[nameAccount]!.keyPair!,
- ownerships: secretMap[tokenBalance.address]!.data!.ownerships,
- ),
- );
- }
-
- final collectionWithTokenId =