2023-07-19 15:45:18 +00:00
|
|
|
import 'package:stackwallet/dto/ordinals/transaction_response.dart';
|
|
|
|
|
2023-07-18 21:36:26 +00:00
|
|
|
class OutputResponse {
|
|
|
|
final OutputLinks links;
|
|
|
|
final String address;
|
|
|
|
final String scriptPubkey;
|
|
|
|
final String transaction;
|
|
|
|
final int value;
|
|
|
|
|
|
|
|
OutputResponse({
|
|
|
|
required this.links,
|
|
|
|
required this.address,
|
|
|
|
required this.scriptPubkey,
|
|
|
|
required this.transaction,
|
|
|
|
required this.value,
|
|
|
|
});
|
|
|
|
|
|
|
|
factory OutputResponse.fromJson(Map<String, dynamic> json) {
|
|
|
|
return OutputResponse(
|
2023-07-19 15:45:18 +00:00
|
|
|
links: OutputLinks.fromJson(json['_links'] as Map<String, dynamic>),
|
|
|
|
address: json['address'] as String,
|
|
|
|
scriptPubkey: json['script_pubkey'] as String,
|
|
|
|
transaction: json['transaction'] as String,
|
|
|
|
value: json['value'] as int,
|
2023-07-18 21:36:26 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class OutputLinks {
|
|
|
|
final OutputLink? self;
|
|
|
|
final TransactionLink? transaction;
|
|
|
|
|
|
|
|
OutputLinks({
|
|
|
|
this.self,
|
|
|
|
this.transaction,
|
|
|
|
});
|
|
|
|
|
|
|
|
factory OutputLinks.fromJson(Map<String, dynamic> json) {
|
|
|
|
return OutputLinks(
|
2023-07-19 15:45:18 +00:00
|
|
|
self: OutputLink.fromJson(json['self'] as Map<String, dynamic>),
|
|
|
|
transaction: TransactionLink.fromJson(json['transaction'] as Map<String, dynamic>),
|
2023-07-18 21:36:26 +00:00
|
|
|
);
|
|
|
|
}
|
2023-07-19 15:48:54 +00:00
|
|
|
}
|