decodeAddres static method
AdaGenericAddrDecoderResult
decodeAddres(
- String address, {
- ADAAddressType? addrType,
- ADANetwork? network,
Decode an ADA address string.
address
: The address to decode.
addrType
: The expected address type. If provided, the decoded address type
must match this.
network
: The network type.
Returns a AdaGenericAddrDecoderResult
object containing the decoded address.
Implementation
static AdaGenericAddrDecoderResult decodeAddres(String address,
{ADAAddressType? addrType, ADANetwork? network}) {
final decodeAddr =
AdaGenericAddrDecoder().decode(address, {"net_tag": network});
if (addrType != null) {
if (decodeAddr.type.header != addrType.header) {
throw ADAPluginException("Incorrect address type. ",
details: {"Excepted": addrType.name, "type": decodeAddr.type});
}
}
return decodeAddr;
}