decodeAddr method

  1. @override
List<int> decodeAddr(
  1. String addr, {
  2. int? ss58Format,
})
override

Overrides the base class method to decode a Substrate address.

This method decodes a Substrate address from the given input string. It expects a map of optional keyword arguments, with the 'ss58_format' key specifying the expected SS58 format for the address. It validates the arguments, decodes the address, and returns the decoded address as a List<int>.

Parameters:

  • addr: The address to be decoded.
  • kwargs: Optional keyword arguments (e.g., 'ss58_format') for customization.

Returns: A List<int> containing the decoded address bytes.

Throws:

  • FormatException if the provided address is not in the expected SS58 format.

Implementation

@override
List<int> decodeAddr(String addr, {int? ss58Format}) {
  final pubkeyBytes = _SubstrateAddrUtils.decodeAddr(addr, ss58Format).$1;
  AddrKeyValidator.validateAndGetEd25519Key(pubkeyBytes);
  return pubkeyBytes;
}