getChainIdFromMessage static method

String getChainIdFromMessage(
  1. String message
)

Implementation

static String getChainIdFromMessage(String message) {
  try {
    const pattern = 'Chain ID: ';
    final regexp = RegExp('$pattern(?<temp1>\\d+)');
    final matches = regexp.allMatches(message);
    for (final Match m in matches) {
      return m[0]!.toString().replaceAll(pattern, '');
    }
  } catch (_) {}
  return '';
}