added fix for active indexed tokens + improved data structure for wallet description
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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'],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user