getBaseEtherscanEndpoint method
- String fullUrl
inherited
Implementation
String getBaseEtherscanEndpoint(String fullUrl) {
Uri uri = Uri.parse(fullUrl);
// Extract the scheme, host, and path
String baseUrl = '${uri.scheme}://${uri.host}${uri.path}';
// Get the query parameters
Map<String, String> queryParams = uri.queryParameters;
// Check if 'module' and 'action' parameters exist
if (queryParams.containsKey('module') &&
queryParams.containsKey('action')) {
String module = queryParams['module']!;
String action = queryParams['action']!;
// Construct the base endpoint
return '$baseUrl&module=$module&action=$action';
} else {
// If 'module' or 'action' is missing, return the original URL
return fullUrl;
}
}