Skip to content

Commit

Permalink
rename orderbook row
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-rogobete committed Jun 3, 2024
1 parent 8c8238e commit a85e34a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class _SliverPinnedHeader extends StatelessWidget {
),
child: Text(
text,
style: Theme.of(context).textTheme.headline6!.copyWith(
style: Theme.of(context).textTheme.headlineMedium!.copyWith(
color: Colors.white,
),
),
Expand Down
14 changes: 7 additions & 7 deletions lib/src/responses/order_book_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@ import '../price.dart';
class OrderBookResponse extends Response {
Asset base;
Asset counter;
List<Row> asks;
List<Row> bids;
List<OrderBookRow> asks;
List<OrderBookRow> bids;

OrderBookResponse(this.base, this.counter, this.asks, this.bids);

factory OrderBookResponse.fromJson(Map<String, dynamic> json) => OrderBookResponse(
Asset.fromJson(json['base']),
Asset.fromJson(json['counter']),
(json['asks'] as List).map((e) => Row.fromJson(e)).toList(),
(json['bids'] as List).map((e) => Row.fromJson(e)).toList())
(json['asks'] as List).map((e) => OrderBookRow.fromJson(e)).toList(),
(json['bids'] as List).map((e) => OrderBookRow.fromJson(e)).toList())
..rateLimitLimit = convertInt(json['rateLimitLimit'])
..rateLimitRemaining = convertInt(json['rateLimitRemaining'])
..rateLimitReset = convertInt(json['rateLimitReset']);
}

/// Represents a row in the order book response received from the horizon server.
class Row {
class OrderBookRow {
String amount;
String price;
Price priceR;

Row(this.amount, this.price, this.priceR);
OrderBookRow(this.amount, this.price, this.priceR);

factory Row.fromJson(Map<String, dynamic> json) => Row(json['amount'], json['price'],
factory OrderBookRow.fromJson(Map<String, dynamic> json) => OrderBookRow(json['amount'], json['price'],
Price.fromJson(json['price_r']));
}

0 comments on commit a85e34a

Please sign in to comment.