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 {}]) {
AddrKeyValidator.validateAddressArgs<List<int>>(kwargs, "net_ver");
AddrKeyValidator.validateAddressArgs<List<int>>(kwargs, "pub_vkey");
final List<int> netVerBytes = kwargs["net_ver"];
final List<int> pubVKey = kwargs["pub_vkey"];
return _XmrAddrUtils.encodeKey(pubKey, pubVKey, netVerBytes);
}