encodeKey method
Encodes a Monero (XMR) public key and view key as an XMR address.
Given a public key, view key, and optional encoding parameters specified in kwargs
,
this method encodes the public keys as an XMR address and returns the result as a string.
Ensure that the "net_ver" and "pub_vkey" parameters are provided as List
Parameters:
- pubKey: The public key to be encoded.
- kwargs: A map of optional encoding parameters, including "net_ver" (network version bytes) and "pub_vkey" (public view key).
Returns: A string representing the encoded XMR address.
Implementation
@override
String encodeKey(List<int> pubKey, [Map<String, dynamic> kwargs = const {}]) {
final List<int> netVerBytes =
AddrKeyValidator.validateAddressArgs<List<int>>(kwargs, "net_ver");
final List<int> pubVKey =
AddrKeyValidator.validateAddressArgs<List<int>>(kwargs, "pub_vkey");
return encode(
pubSpendKey: pubKey, pubViewKey: pubVKey, netVarBytes: netVerBytes);
}