encodeKey method
Overrides the base class method to encode a public key as a Solana SOL address.
This method takes a public key as a List
Parameters:
- pubKey: The public key to be encoded as a Solana SOL address.
- kwargs: Optional keyword arguments (not used in this implementation).
Returns: A String representing the Solana SOL address encoded from the provided public key
Implementation
@override
String encodeKey(List<int> pubKey, [Map<String, dynamic> kwargs = const {}]) {
/// Validate and process the public key as an Ed25519 key.
final pub = AddrKeyValidator.validateAndGetEd25519Key(pubKey);
/// Encode the processed public key as a Solana SOL address using Base58.
final encodedKey = Base58Encoder.encode(pub.compressed.sublist(1));
/// Return the encoded Solana SOL address as a String.
return encodedKey;
}