import 'package:pshared/data/dto/payment/external_chain.dart';
import 'package:pshared/data/mapper/payment/asset.dart';
import 'package:pshared/models/payment/methods/crypto_address.dart';


extension CryptoAddressPaymentMethodMapper on CryptoAddressPaymentMethod {
  ExternalChainEndpointDTO toDTO() => ExternalChainEndpointDTO(
    address: address,
    asset: asset?.toDTO(),
    memo: memo,
  );
}

extension CryptoAddressPaymentDataDTOMapper on ExternalChainEndpointDTO {
  CryptoAddressPaymentMethod toDomain() => CryptoAddressPaymentMethod(
    address: address,
    asset: asset?.toDomain(),
    memo: memo,
  );
}
