fromProtocolMagic static method

ADANetwork fromProtocolMagic(
  1. int? protocolMagic
)

Implementation

static ADANetwork fromProtocolMagic(int? protocolMagic) {
  if (protocolMagic == null) return ADANetwork.mainnet;
  return values.firstWhere(
    (element) => element.protocolMagic == protocolMagic,
    orElse: () => throw const AddressConverterException(
        "Invalid protocol magic or network does not supported."),
  );
}