encodeCredential method
Implementation
String encodeCredential(AdaStakeCredential credential,
[Map<String, dynamic> kwargs = const {}]) {
/// Determine the network tag, defaulting to mainnet if not specified.
final netTag = kwargs["net_tag"] ?? ADANetwork.mainnet;
/// Check if the provided network tag is a valid enum value.
if (netTag is! ADANetwork) {
throw const AddressConverterException(
'Address type is not an enumerative of ADANetwork');
}
final pointer = kwargs["pointer"];
if (pointer is! Pointer) {
throw const AddressConverterException(
'The provided value for "Pointer" is not of type Pointer.');
}
return AdaShelleyAddrUtils.encode(
credential: credential,
pointer: pointer,
netTag: netTag,
hrp: AdaShelleyAddrConst.networkTagToAddrHrp[netTag]!,
type: ADAAddressType.pointer);
}