stack_wallet/lib/dto/ordinals/feed_response.dart

17 lines
661 B
Dart
Raw Normal View History

import 'package:stackwallet/dto/ordinals/inscription_link.dart';
import 'package:stackwallet/dto/ordinals/ordinals_response.dart';
class FeedResponse extends OrdinalsResponse<FeedResponse> {
final List<InscriptionLink> inscriptions;
2023-07-19 15:37:42 +00:00
FeedResponse({required this.inscriptions});
factory FeedResponse.fromJson(OrdinalsResponse json) {
final List<dynamic> inscriptionsJson = json.data['_links']['inscriptions'] as List<dynamic>;
2023-07-19 15:37:42 +00:00
final List<InscriptionLink> inscriptions = inscriptionsJson
.map((json) => InscriptionLink.fromJson(json as Map<String, dynamic>))
.toList();
2023-07-19 15:37:42 +00:00
return FeedResponse(inscriptions: inscriptions);
}
}