mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 17:57:40 +00:00
remove ord-litecoin imports
This commit is contained in:
parent
20fdcf4817
commit
af30826e9e
12 changed files with 0 additions and 516 deletions
|
@ -1,52 +0,0 @@
|
|||
import 'package:stackwallet/dto/ordinals/inscription_link.dart';
|
||||
import 'package:stackwallet/dto/ordinals/ordinals_response.dart';
|
||||
|
||||
class AddressResponse extends OrdinalsResponse<AddressResponse> {
|
||||
final AddressLinks links;
|
||||
final String address;
|
||||
final List<InscriptionLink> inscriptions;
|
||||
|
||||
AddressResponse({
|
||||
required this.links,
|
||||
required this.address,
|
||||
required this.inscriptions,
|
||||
});
|
||||
|
||||
factory AddressResponse.fromJson(OrdinalsResponse json) {
|
||||
final data = json.data as Map<String, dynamic>;
|
||||
final inscriptionsJson = data['inscriptions'] as List;
|
||||
final inscriptions = inscriptionsJson
|
||||
.map((inscriptionJson) => InscriptionLink.fromJson(inscriptionJson as Map<String, dynamic>))
|
||||
.toList();
|
||||
|
||||
return AddressResponse(
|
||||
links: AddressLinks.fromJson(data['_links'] as Map<String, dynamic>),
|
||||
address: data['address'] as String,
|
||||
inscriptions: inscriptions,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AddressLinks {
|
||||
final AddressLink? self;
|
||||
|
||||
AddressLinks({
|
||||
this.self,
|
||||
});
|
||||
|
||||
factory AddressLinks.fromJson(Map<String, dynamic> json) {
|
||||
return AddressLinks(
|
||||
self: json['self'] != null ? AddressLink.fromJson(json['self'] as Map<String, dynamic>) : null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AddressLink {
|
||||
final String href;
|
||||
|
||||
AddressLink({required this.href});
|
||||
|
||||
factory AddressLink.fromJson(Map<String, dynamic> json) {
|
||||
return AddressLink(href: json['href'] as String);
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
import 'package:stackwallet/dto/ordinals/ordinals_response.dart';
|
||||
|
||||
class BlockResponse extends OrdinalsResponse<BlockResponse> {
|
||||
final BlockLinks links;
|
||||
final String hash;
|
||||
final String previousBlockhash;
|
||||
final int size;
|
||||
final String target;
|
||||
final String timestamp;
|
||||
final int weight;
|
||||
|
||||
BlockResponse({
|
||||
required this.links,
|
||||
required this.hash,
|
||||
required this.previousBlockhash,
|
||||
required this.size,
|
||||
required this.target,
|
||||
required this.timestamp,
|
||||
required this.weight,
|
||||
});
|
||||
|
||||
factory BlockResponse.fromJson(OrdinalsResponse json) {
|
||||
final data = json.data as Map<String, dynamic>;
|
||||
return BlockResponse(
|
||||
links: BlockLinks.fromJson(data['_links'] as Map<String, dynamic>),
|
||||
hash: data['hash'] as String,
|
||||
previousBlockhash: data['previous_blockhash'] as String,
|
||||
size: data['size'] as int,
|
||||
target: data['target'] as String,
|
||||
timestamp: data['timestamp'] as String,
|
||||
weight: data['weight'] as int,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BlockLinks {
|
||||
final BlockLink? prev;
|
||||
final BlockLink? self;
|
||||
|
||||
BlockLinks({
|
||||
this.prev,
|
||||
this.self,
|
||||
});
|
||||
|
||||
factory BlockLinks.fromJson(Map<String, dynamic> json) {
|
||||
return BlockLinks(
|
||||
prev: json['prev'] != null ? BlockLink.fromJson(json['prev'] as Map<String, dynamic>) : null,
|
||||
self: json['self'] != null ? BlockLink.fromJson(json['self'] as Map<String, dynamic>) : null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BlockLink {
|
||||
final String href;
|
||||
|
||||
BlockLink({required this.href});
|
||||
|
||||
factory BlockLink.fromJson(Map<String, dynamic> json) {
|
||||
return BlockLink(href: json['href'] as String);
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
import 'package:stackwallet/dto/ordinals/ordinals_response.dart';
|
||||
|
||||
class ContentResponse extends OrdinalsResponse<ContentResponse> {
|
||||
final FileLink fileLink;
|
||||
|
||||
ContentResponse({required this.fileLink});
|
||||
|
||||
factory ContentResponse.fromJson(OrdinalsResponse json) {
|
||||
final data = json.data as Map<String, dynamic>;
|
||||
return ContentResponse(fileLink: FileLink.fromJson(data['_links']['file'] as Map<String, dynamic>)); // TODO don't cast as Map<String, dynamic>
|
||||
}
|
||||
}
|
||||
|
||||
class FileLink {
|
||||
final String href;
|
||||
|
||||
FileLink({required this.href});
|
||||
|
||||
factory FileLink.fromJson(Map<String, dynamic> json) {
|
||||
return FileLink(href: json['href'] as String);
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
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;
|
||||
|
||||
FeedResponse({required this.inscriptions});
|
||||
|
||||
factory FeedResponse.fromJson(OrdinalsResponse json) {
|
||||
final List<dynamic> inscriptionsJson = json.data['_links']['inscriptions'] as List<dynamic>;
|
||||
final List<InscriptionLink> inscriptions = inscriptionsJson
|
||||
.map((json) => InscriptionLink.fromJson(json as Map<String, dynamic>))
|
||||
.toList();
|
||||
|
||||
return FeedResponse(inscriptions: inscriptions);
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
class InscriptionLink {
|
||||
final String href;
|
||||
final String title;
|
||||
|
||||
InscriptionLink({required this.href, required this.title});
|
||||
|
||||
factory InscriptionLink.fromJson(Map<String, dynamic> json) {
|
||||
return InscriptionLink(
|
||||
href: json['href'] as String ?? '',
|
||||
title: json['title'] as String ?? '',
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
import 'package:stackwallet/dto/ordinals/ordinals_response.dart';
|
||||
|
||||
class InscriptionResponse extends OrdinalsResponse<InscriptionResponse> {
|
||||
late final Links links;
|
||||
late final String address;
|
||||
late final int contentLength;
|
||||
late final String contentType;
|
||||
late final int genesisFee;
|
||||
late final int genesisHeight;
|
||||
late final String genesisTransaction;
|
||||
late final String location;
|
||||
late final int number;
|
||||
late final int offset;
|
||||
late final String output;
|
||||
late final String? sat; // Make sure to update the type to allow null
|
||||
late final String timestamp;
|
||||
|
||||
InscriptionResponse({
|
||||
required this.links,
|
||||
required this.address,
|
||||
required this.contentLength,
|
||||
required this.contentType,
|
||||
required this.genesisFee,
|
||||
required this.genesisHeight,
|
||||
required this.genesisTransaction,
|
||||
required this.location,
|
||||
required this.number,
|
||||
required this.offset,
|
||||
required this.output,
|
||||
required this.sat,
|
||||
required this.timestamp,
|
||||
});
|
||||
|
||||
factory InscriptionResponse.fromJson(OrdinalsResponse json) {
|
||||
final data = json.data as Map<String, dynamic>;
|
||||
return InscriptionResponse(
|
||||
links: Links.fromJson(data['_links'] as Map<String, dynamic>),
|
||||
address: data['address'] as String,
|
||||
contentLength: data['content_length'] as int,
|
||||
contentType: data['content_type'] as String,
|
||||
genesisFee: data['genesis_fee'] as int,
|
||||
genesisHeight: data['genesis_height'] as int,
|
||||
genesisTransaction: data['genesis_transaction'] as String,
|
||||
location: data['location'] as String,
|
||||
number: data['number'] as int,
|
||||
offset: data['offset'] as int,
|
||||
output: data['output'] as String,
|
||||
sat: data['sat'] as String?,
|
||||
timestamp: data['timestamp'] as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Links {
|
||||
late final Link content;
|
||||
late final Link genesisTransaction;
|
||||
late final Link next;
|
||||
late final Link output;
|
||||
late final Link prev;
|
||||
late final Link preview;
|
||||
late final Link? sat; // Make sure to update the type to allow null
|
||||
late final Link self;
|
||||
|
||||
Links({
|
||||
required this.content,
|
||||
required this.genesisTransaction,
|
||||
required this.next,
|
||||
required this.output,
|
||||
required this.prev,
|
||||
required this.preview,
|
||||
this.sat,
|
||||
required this.self,
|
||||
});
|
||||
|
||||
factory Links.fromJson(Map<String, dynamic> json) {
|
||||
return Links(
|
||||
content: Link.fromJson(json['content'] as Map<String, dynamic>),
|
||||
genesisTransaction: Link.fromJson(json['genesis_transaction'] as Map<String, dynamic>),
|
||||
next: Link.fromJson(json['next'] as Map<String, dynamic>),
|
||||
output: Link.fromJson(json['output'] as Map<String, dynamic>),
|
||||
prev: Link.fromJson(json['prev'] as Map<String, dynamic>),
|
||||
preview: Link.fromJson(json['preview'] as Map<String, dynamic>),
|
||||
sat: json['sat'] != null ? Link.fromJson(json['sat'] as Map<String, dynamic>) : null,
|
||||
self: Link.fromJson(json['self'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Link {
|
||||
late final String href;
|
||||
|
||||
Link({required this.href});
|
||||
|
||||
factory Link.fromJson(Map<String, dynamic> json) {
|
||||
return Link(href: json['href'] as String);
|
||||
}
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
class OrdinalsResponse<T> {
|
||||
final T? data;
|
||||
final String? error;
|
||||
|
||||
OrdinalsResponse({this.data, this.error});
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
import 'package:stackwallet/dto/ordinals/transaction_response.dart';
|
||||
import 'package:stackwallet/dto/ordinals/ordinals_response.dart';
|
||||
|
||||
class OutputResponse extends OrdinalsResponse<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(OrdinalsResponse json) {
|
||||
final data = json.data as Map<String, dynamic>;
|
||||
|
||||
return OutputResponse(
|
||||
links: OutputLinks.fromJson(data['_links'] as Map<String, dynamic>),
|
||||
address: data['address'] as String,
|
||||
scriptPubkey: data['script_pubkey'] as String,
|
||||
transaction: data['transaction'] as String,
|
||||
value: data['value'] as int,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class OutputLinks {
|
||||
final OutputLink? self;
|
||||
final TransactionLink? transaction;
|
||||
|
||||
OutputLinks({
|
||||
this.self,
|
||||
this.transaction,
|
||||
});
|
||||
|
||||
factory OutputLinks.fromJson(Map<String, dynamic> json) {
|
||||
return OutputLinks(
|
||||
self: json['self'] != null ? OutputLink.fromJson(json['self'] as Map<String, dynamic>) : null,
|
||||
transaction: json['transaction'] != null ? TransactionLink.fromJson(json['transaction'] as Map<String, dynamic>) : null,
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
import 'package:stackwallet/dto/ordinals/ordinals_response.dart';
|
||||
|
||||
class PreviewResponse extends OrdinalsResponse<PreviewResponse> {
|
||||
final ImageLink imageLink;
|
||||
|
||||
PreviewResponse({required this.imageLink});
|
||||
|
||||
factory PreviewResponse.fromJson(OrdinalsResponse json) {
|
||||
final data = json.data as Map<String, dynamic>;
|
||||
return PreviewResponse(imageLink: ImageLink.fromJson(data['_links']['image'] as Map<String, dynamic>));
|
||||
}
|
||||
}
|
||||
|
||||
class ImageLink {
|
||||
final String href;
|
||||
|
||||
ImageLink({required this.href});
|
||||
|
||||
factory ImageLink.fromJson(Map<String, dynamic> json) {
|
||||
return ImageLink(href: json['href'] as String);
|
||||
}
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
import 'package:stackwallet/dto/ordinals/ordinals_response.dart';
|
||||
|
||||
class SatResponse extends OrdinalsResponse<SatResponse> {
|
||||
final SatLinks links;
|
||||
final int block;
|
||||
final int cycle;
|
||||
final String decimal;
|
||||
final String degree;
|
||||
final int epoch;
|
||||
final String name;
|
||||
final int offset;
|
||||
final String percentile;
|
||||
final int period;
|
||||
final String rarity;
|
||||
final String timestamp;
|
||||
|
||||
SatResponse({
|
||||
required this.links,
|
||||
required this.block,
|
||||
required this.cycle,
|
||||
required this.decimal,
|
||||
required this.degree,
|
||||
required this.epoch,
|
||||
required this.name,
|
||||
required this.offset,
|
||||
required this.percentile,
|
||||
required this.period,
|
||||
required this.rarity,
|
||||
required this.timestamp,
|
||||
});
|
||||
|
||||
factory SatResponse.fromJson(OrdinalsResponse json) {
|
||||
final data = json.data as Map<String, dynamic>;
|
||||
return SatResponse(
|
||||
links: SatLinks.fromJson(data['_links'] as Map<String, dynamic>),
|
||||
block: data['block'] as int,
|
||||
cycle: data['cycle'] as int,
|
||||
decimal: data['decimal'] as String,
|
||||
degree: data['degree'] as String,
|
||||
epoch: data['epoch'] as int,
|
||||
name: data['name'] as String,
|
||||
offset: data['offset'] as int,
|
||||
percentile: data['percentile'] as String,
|
||||
period: data['period'] as int,
|
||||
rarity: data['rarity'] as String,
|
||||
timestamp: data['timestamp'] as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SatLinks {
|
||||
final SatLink? block;
|
||||
final SatLink? inscription;
|
||||
final SatLink? next;
|
||||
final SatLink? prev;
|
||||
final SatLink? self;
|
||||
|
||||
SatLinks({
|
||||
this.block,
|
||||
this.inscription,
|
||||
this.next,
|
||||
this.prev,
|
||||
this.self,
|
||||
});
|
||||
|
||||
factory SatLinks.fromJson(Map<String, dynamic> json) {
|
||||
return SatLinks(
|
||||
block: json['block'] != null ? SatLink.fromJson(json['block'] as Map<String, dynamic>) : null,
|
||||
inscription: json['inscription'] != null ? SatLink.fromJson(json['inscription'] as Map<String, dynamic>) : null,
|
||||
next: json['next'] != null ? SatLink.fromJson(json['next'] as Map<String, dynamic>) : null,
|
||||
prev: json['prev'] != null ? SatLink.fromJson(json['prev'] as Map<String, dynamic>) : null,
|
||||
self: json['self'] != null ? SatLink.fromJson(json['self'] as Map<String, dynamic>) : null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SatLink {
|
||||
final String href;
|
||||
|
||||
SatLink({required this.href});
|
||||
|
||||
factory SatLink.fromJson(Map<String, dynamic> json) {
|
||||
return SatLink(href: json['href'] as String);
|
||||
}
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
import 'package:stackwallet/dto/ordinals/inscription_link.dart';
|
||||
import 'package:stackwallet/dto/ordinals/ordinals_response.dart';
|
||||
|
||||
class TransactionResponse extends OrdinalsResponse<TransactionResponse> {
|
||||
final TransactionLinks links;
|
||||
final List<OutputLink> inputs;
|
||||
final InscriptionLink inscription;
|
||||
final List<OutputLink> outputs;
|
||||
final TransactionLink self;
|
||||
final String transaction;
|
||||
|
||||
TransactionResponse({
|
||||
required this.links,
|
||||
required this.inputs,
|
||||
required this.inscription,
|
||||
required this.outputs,
|
||||
required this.self,
|
||||
required this.transaction,
|
||||
});
|
||||
|
||||
factory TransactionResponse.fromJson(OrdinalsResponse json) {
|
||||
final data = json.data as Map<String, dynamic>;
|
||||
final inputsJson = data['_links']['inputs'] as List;
|
||||
final inputs = inputsJson
|
||||
.map((inputJson) => OutputLink.fromJson(inputJson as Map<String, dynamic>))
|
||||
.toList();
|
||||
|
||||
final outputsJson = data['_links']['outputs'] as List;
|
||||
final outputs = outputsJson
|
||||
.map((outputJson) => OutputLink.fromJson(outputJson as Map<String, dynamic>))
|
||||
.toList();
|
||||
|
||||
return TransactionResponse(
|
||||
links: TransactionLinks.fromJson(data['_links'] as Map<String, dynamic>),
|
||||
inputs: inputs,
|
||||
inscription: InscriptionLink.fromJson(data['_links']['inscription'] as Map<String, dynamic>),
|
||||
outputs: outputs,
|
||||
self: TransactionLink.fromJson(data['_links']['self'] as Map<String, dynamic>),
|
||||
transaction: data['transaction'] as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class TransactionLinks {
|
||||
final TransactionLink? block;
|
||||
final InscriptionLink? inscription;
|
||||
final TransactionLink? self;
|
||||
|
||||
TransactionLinks({
|
||||
this.block,
|
||||
this.inscription,
|
||||
this.self,
|
||||
});
|
||||
|
||||
factory TransactionLinks.fromJson(Map<String, dynamic> json) {
|
||||
return TransactionLinks(
|
||||
block: json['block'] != null ? TransactionLink.fromJson(json['block'] as Map<String, dynamic>) : null,
|
||||
inscription: json['inscription'] != null ? InscriptionLink.fromJson(json['inscription'] as Map<String, dynamic>) : null,
|
||||
self: json['self'] != null ? TransactionLink.fromJson(json['self'] as Map<String, dynamic>) : null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class TransactionLink {
|
||||
final String href;
|
||||
|
||||
TransactionLink({required this.href});
|
||||
|
||||
factory TransactionLink.fromJson(Map<String, dynamic> json) {
|
||||
return TransactionLink(href: json['href'] as String);
|
||||
}
|
||||
}
|
||||
|
||||
class OutputLink {
|
||||
final String href;
|
||||
|
||||
OutputLink({required this.href});
|
||||
|
||||
factory OutputLink.fromJson(Map<String, dynamic> json) {
|
||||
return OutputLink(href: json['href'] as String);
|
||||
}
|
||||
}
|
|
@ -5,18 +5,6 @@ import 'package:stackwallet/db/isar/main_db.dart';
|
|||
import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
|
||||
// ord-litecoin-specific imports
|
||||
// import 'package:stackwallet/dto/ordinals/feed_response.dart';
|
||||
// import 'package:stackwallet/dto/ordinals/inscription_response.dart';
|
||||
// import 'package:stackwallet/dto/ordinals/sat_response.dart';
|
||||
// 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';
|
||||
// import 'package:stackwallet/dto/ordinals/preview_response.dart';
|
||||
// import 'package:stackwallet/services/ordinals_api.dart';
|
||||
|
||||
import 'package:stackwallet/services/litescribe_api.dart';
|
||||
import 'package:stackwallet/dto/ordinals/inscription_data.dart';
|
||||
|
||||
|
|
Loading…
Reference in a new issue