mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 03:49:22 +00:00
add content endpoint
This commit is contained in:
parent
6d772b0acd
commit
d623480a75
2 changed files with 8 additions and 2 deletions
|
@ -4,7 +4,7 @@ class ContentResponse {
|
|||
ContentResponse({required this.fileLink});
|
||||
|
||||
factory ContentResponse.fromJson(Map<String, dynamic> json) {
|
||||
return ContentResponse(fileLink: FileLink.fromJson(json['_links']['file']));
|
||||
return ContentResponse(fileLink: FileLink.fromJson(json['_links']['file'] as Map<String, dynamic>));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,6 @@ class FileLink {
|
|||
FileLink({required this.href});
|
||||
|
||||
factory FileLink.fromJson(Map<String, dynamic> json) {
|
||||
return FileLink(href: json['href']);
|
||||
return FileLink(href: json['href'] as String);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import 'package:stackwallet/dto/ordinals/transaction_response.dart';
|
|||
import 'package:stackwallet/dto/ordinals/output_response.dart';
|
||||
import 'package:stackwallet/dto/ordinals/address_response.dart';
|
||||
import 'package:stackwallet/dto/ordinals/block_response.dart';
|
||||
import 'package:stackwallet/dto/ordinals/content_response.dart';
|
||||
|
||||
class OrdinalsAPI {
|
||||
final String baseUrl;
|
||||
|
@ -66,4 +67,9 @@ class OrdinalsAPI {
|
|||
final response = await _getResponse('/block/$blockNumber');
|
||||
return BlockResponse.fromJson(response);
|
||||
}
|
||||
|
||||
Future<ContentResponse> getInscriptionContent(String inscriptionId) async {
|
||||
final response = await _getResponse('/content/$inscriptionId');
|
||||
return ContentResponse.fromJson(response);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue