fetchSelector method

Future<ExternalContractFunction?> fetchSelector(
  1. String selector, {
  2. bool openChain = true,
  3. bool fourByte = true,
})

Implementation

Future<ExternalContractFunction?> fetchSelector(
  String selector, {
  bool openChain = true,
  bool fourByte = true,
}) async {
  assert(openChain || fourByte, "At least one source must be enabled");

  if (fourByte) {
    final fourByteFunction = await fetchSelector4Byte(selector);
    if (fourByteFunction != null) return fourByteFunction;
  }

  if (openChain) {
    final openChainFunction = await fetchSelectorOpenChain(selector);
    if (openChainFunction != null) return openChainFunction;
  }

  return null;
}