added fix for active indexed tokens + improved data structure for wallet description

This commit is contained in:
Stephan D
2025-12-22 18:30:15 +01:00
parent 2d6586430f
commit dfad7fb335
18 changed files with 307 additions and 26 deletions

View File

@@ -13,6 +13,8 @@ class WalletDTO {
final WalletAssetDTO asset;
final String depositAddress;
final String status;
final String name;
final String? description;
final Map<String, String>? metadata;
final String? createdAt;
final String? updatedAt;
@@ -24,6 +26,8 @@ class WalletDTO {
required this.asset,
required this.depositAddress,
required this.status,
required this.name,
this.description,
this.metadata,
this.createdAt,
this.updatedAt,

View File

@@ -24,8 +24,10 @@ extension WalletDTOMapper on WalletDTO {
balance: balance?.toDomain(),
availableMoney: balance?.available?.toDomain(),
describable: newDescribable(
name: metadata?['name'] ?? 'Crypto Wallet',
description: metadata?['description'],
name: name.isNotEmpty ? name : (metadata?['name'] ?? 'Crypto Wallet'),
description: (description != null && description!.isNotEmpty)
? description
: metadata?['description'],
),
);
}

View File

@@ -26,11 +26,11 @@ class QuotationService {
return PaymentQuoteResponse.fromJson(response).quote.toDomain();
}
static Future<PaymentQuotes> getMultipleQuotation(String organizationRef, QuotePaymentsRequest request) async {
static Future<PaymentQuotes> getMultiQuotation(String organizationRef, QuotePaymentsRequest request) async {
_logger.fine('Quoting payments for organization $organizationRef');
final response = await AuthorizationService.getPOSTResponse(
_objectType,
'/quote-multiple/$organizationRef',
'/multiquote/$organizationRef',
request.toJson(),
);
return PaymentQuotesResponse.fromJson(response).quote.toDomain();

View File

@@ -1,8 +1,6 @@
import 'package:pshared/models/wallet/wallet.dart' as domain;
import 'package:pshared/models/currency.dart';
import 'package:pshared/models/describable.dart';
import 'package:pweb/models/wallet.dart';
@@ -26,10 +24,7 @@ extension WalletUiMapper on domain.WalletModel {
network: asset.chain,
tokenSymbol: asset.tokenSymbol,
contractAddress: asset.contractAddress,
describable: newDescribable(
name: metadata?['name'] ?? 'Crypto Wallet',
description: metadata?['description'],
),
describable: describable,
);
}
}