getMethodsFromRecap static method

List<String> getMethodsFromRecap(
  1. String recap
)

Implementation

static List<String> getMethodsFromRecap(String recap) {
  final decodedRecap = decodeRecap(recap);
  if (!isValidRecap(decodedRecap)) return [];

  try {
    // methods are only available for eip155 as per the current implementation
    final resource = decodedRecap['att']?['eip155'] as Map<String, dynamic>?;
    if (resource == null) return [];

    return resource.keys.map((k) => k.split('/').last).toList();
  } catch (e) {
    return [];
  }
}