2023-07-19 20:58:26 +00:00
|
|
|
import 'package:stackwallet/dto/ordinals/feed_response.dart'; // Assuming this import is necessary
|
|
|
|
import 'package:stackwallet/services/ordinals_api.dart'; // Assuming this import is necessary
|
2023-07-19 18:03:17 +00:00
|
|
|
|
2023-07-18 16:15:05 +00:00
|
|
|
mixin OrdinalsInterface {
|
2023-07-19 20:58:26 +00:00
|
|
|
final OrdinalsAPI ordinalsAPI = OrdinalsAPI(baseUrl: 'http://ord-litecoin.stackwallet.com');
|
|
|
|
|
|
|
|
Future<FeedResponse> fetchLatestInscriptions() async {
|
2023-07-19 18:03:17 +00:00
|
|
|
try {
|
|
|
|
final feedResponse = await ordinalsAPI.getLatestInscriptions();
|
|
|
|
// Process the feedResponse data as needed
|
|
|
|
print('Latest Inscriptions:');
|
|
|
|
for (var inscription in feedResponse.inscriptions) {
|
|
|
|
print('Title: ${inscription.title}, Href: ${inscription.href}');
|
|
|
|
}
|
|
|
|
return feedResponse;
|
|
|
|
} catch (e) {
|
|
|
|
// Handle errors
|
|
|
|
throw Exception('Error in OrdinalsInterface: $e');
|
|
|
|
}
|
|
|
|
}
|
2023-07-19 20:58:26 +00:00
|
|
|
}
|