encode static method
String
encode({
- required AdaStakeCredential credential,
- AdaStakeCredential? stakeCredential,
- Pointer? pointer,
- required ADANetwork netTag,
- required String hrp,
- required ADAAddressType type,
Implementation
static String encode(
{required AdaStakeCredential credential,
AdaStakeCredential? stakeCredential,
Pointer? pointer,
required ADANetwork netTag,
required String hrp,
required ADAAddressType type}) {
/// Encode the address prefix using the header type and network tag.
final prefixByte = AdaShelleyAddrUtils.encodePrefix(
type, netTag.value, credential.type,
stakeType: stakeCredential?.type);
return Bech32Encoder.encode(
hrp,
List<int>.from([
...prefixByte,
...credential.hash,
...stakeCredential?.hash ?? <int>[],
...pointer?.toBytes() ?? <int>[]
]));
}