Provides encoding and decoding methods for parsing substrate addresses.
SS58 account examples can be finded in ss58-Registry.
final address = Address.decode('1zugcag7cJVBtVRnFxv5Qftn7xKAnR6YJ9x4x3XLgGgmNnS');
// get registry info of given `prefix`
final polkadotRegistry = Codec.registry.getByPrefix(0);
print('polkadot registry: $polkadotRegistry');
// decoding substrate address
final String originalEncodedAddress = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
final List<int> decodedBytes = Codec.fromNetwork('substrate').decode(originalEncodedAddress);
print('Substrate address bytes: $decodedBytes');
// Encoding the decodedBytes to produce back encodedAddress.
final int substrateAddressPrefix = 42;
final encodedAddress = Codec(substrateAddressPrefix).encode(decodedBytes);
print(encodedAddress);