Refactored types

This commit is contained in:
2026-07-25 04:08:48 +02:00
parent cde2abf5f1
commit 6b6085ef25
8 changed files with 158 additions and 160 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
use std::collections::HashMap;
use pulse_wire::terminal::WatchListItem;
use pulse_wire::terminal::MarketItem;
use serde_json::Value;
fn number(value: &Value, field: &str) -> Result<f64, String> {
@@ -15,7 +15,7 @@ fn number(value: &Value, field: &str) -> Result<f64, String> {
pub async fn fetch_watch_list(
client: &hypersdk::hypercore::HttpClient,
symbols: &[String],
) -> Result<Vec<WatchListItem>, String> {
) -> Result<Vec<MarketItem>, String> {
let response = client
.meta_and_asset_ctxs(None)
.await
@@ -63,7 +63,7 @@ pub async fn fetch_watch_list(
by_symbol.insert(
symbol,
WatchListItem {
MarketItem {
symbol: symbol.to_owned(),
price,
trend: ((price / previous_day_price) - 1.0) * 100.0,