stack_wallet/lib/dto/ordinals/feed_response.dart
sneurlax afbf818ab5 refactor InscriptionLink factory, casting
TODO replace casting throughout ordinals DTOs with refactored validation
2023-07-19 11:04:19 -05:00

16 lines
554 B
Dart

import 'package:stackwallet/dto/ordinals/inscription_link.dart';
class FeedResponse {
final List<InscriptionLink> inscriptions;
FeedResponse({required this.inscriptions});
factory FeedResponse.fromJson(Map<String, dynamic> json) {
final List<dynamic> inscriptionsJson = json['_links']['inscriptions'] as List<dynamic>;
final List<InscriptionLink> inscriptions = inscriptionsJson
.map((json) => InscriptionLink.fromJson(json as Map<String, dynamic>))
.toList();
return FeedResponse(inscriptions: inscriptions);
}
}