decodeAddr method

  1. @override
List<int> decodeAddr(
  1. String addr, [
  2. Map<String, dynamic> kwargs = const {}
])
override

Decodes a Monero (XMR) integrated address to extract the public key and view key components.

Given an XMR address and optional decoding parameters specified in kwargs, this method decodes the address to extract the public key and view key components.

Ensure that the "net_ver" and "payment_id" parameters are provided as List

Parameters:

  • addr: The XMR address to be decoded.
  • kwargs: A map of optional decoding parameters, including "net_ver" (network version bytes) and "payment_id" (payment ID bytes).

Returns: A List

Implementation

@override
List<int> decodeAddr(String addr, [Map<String, dynamic> kwargs = const {}]) {
  final List<int> netVerBytes =
      AddrKeyValidator.validateAddressArgs<List<int>>(kwargs, "net_ver");
  final List<int> paymentId =
      AddrKeyValidator.validateAddressArgs<List<int>>(kwargs, "payment_id");
  final decodeAddr = XmrAddrDecoder()
      .decode(addr, netVerBytes: netVerBytes, paymentId: paymentId);
  return decodeAddr.keyBytes;
}