encodeKey method

  1. @override
String encodeKey(
  1. List<int> pubKey, {
  2. List<int>? netVersion,
})
override

Overrides the base class method to encode a public key as a P2SH (Pay-to-Script-Hash) address.

Implementation

@override
String encodeKey(List<int> pubKey, {List<int>? netVersion}) {
  netVersion = AddrKeyValidator.getAddrArg<List<int>>(
    netVersion,
    "netVersion",
  );

  /// Encode the address bytes as a Base58-encoded P2SH address.
  return Base58Encoder.checkEncode([
    ...netVersion,
    ...validateAndHashKey(pubKey),
  ]);
}