encodeKey method
Overrides the address encoding method for Avax X-Chain addresses.
pubKey
: The public key to encode into an Avax X-Chain address.
kwargs
: A map of optional encoding parameters.
This method constructs an Avax X-Chain address by combining the address prefix with the result of encoding the public key using the AtomAddrEncoder with the Human-Readable Part (HRP) from the Avax X-Chain configuration.
Returns the encoded Avax X-Chain address as a String.
Implementation
@override
String encodeKey(List<int> pubKey, [Map<String, dynamic> kwargs = const {}]) {
final String prefix = CoinsConf.avaxXChain.params.addrPrefix!;
return prefix +
AtomAddrEncoder().encodeKey(
pubKey,
{"hrp": CoinsConf.avaxXChain.params.addrHrp!},
);
}