Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@ FORCE_ISOCODE=

# Breez SDK API Key (for Lightning Network features)
# Get your API key at: https://sdk-doc-liquid.breez.technology/guide/getting_started.html#api-key
BREEZ_API_KEY=
#
# One issued Breez key currently covers both the Liquid and Spark SDKs,
# so `BREEZ_API_KEY` is read by both backends by default. To split them
# later (e.g. if Breez issues separate keys), set `BREEZ_SPARK_API_KEY`
# explicitly — it takes precedence over `BREEZ_API_KEY` for the Spark
# backend. See `coincube-gui/src/app/breez_spark/config.rs`.
BREEZ_API_KEY=
BREEZ_SPARK_API_KEY=
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add a trailing newline to satisfy dotenv lint.

The file currently ends immediately after BREEZ_SPARK_API_KEY=, which matches the reported EndingBlankLine warning.

🔧 Proposed fix
 BREEZ_API_KEY=
 BREEZ_SPARK_API_KEY=
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
BREEZ_SPARK_API_KEY=
BREEZ_API_KEY=
BREEZ_SPARK_API_KEY=
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 21-21: [EndingBlankLine] No blank line at the end of the file

(EndingBlankLine)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.env.example at line 21, The .env.example currently ends immediately after
the BREEZ_SPARK_API_KEY= line and triggers the EndingBlankLine lint; add a
single trailing newline at the end of the file so the file ends with a blank
line (ensure the final character after the BREEZ_SPARK_API_KEY= line is a
newline).

9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 23 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
[workspace]
resolver = "2"
members = ["fuzz", "coincube-core", "coincubed", "coincube-gui", "coincube-ui"]
default-members = ["coincube-core", "coincubed", "coincube-gui", "coincube-ui"]
members = [
"fuzz",
"coincube-core",
"coincubed",
"coincube-gui",
"coincube-ui",
"coincube-spark-protocol",
]
# coincube-spark-bridge is deliberately NOT a member of this workspace.
# It links breez-sdk-spark 0.13.1, whose `tokio_with_wasm ^0.8.7` and
# `rusqlite ^0.32.1 (links = "sqlite3")` dep requirements are unresolvable
# together with breez-sdk-liquid 0.12.2. Making the bridge a standalone
# workspace (with its own Cargo.lock) gives it an isolated dep graph and
# lets it coexist with the Liquid-linked gui at runtime via stdin/stdout
# IPC. See coincube-spark-bridge/Cargo.toml for its own [workspace] block.
exclude = ["coincube-spark-bridge"]
default-members = [
"coincube-core",
"coincubed",
"coincube-gui",
"coincube-ui",
"coincube-spark-protocol",
]

# Patch to resolve dependency conflicts with Breez SDK
[patch.crates-io]
Expand Down
12 changes: 11 additions & 1 deletion coincube-gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async-trait = "0.1"
async-hwi = "0.0.29"
breez-sdk-liquid = { git = "https://github.com/breez/breez-sdk-liquid", tag = "0.12.2" }
coincube-core = { path = "../coincube-core" }
coincube-spark-protocol = { path = "../coincube-spark-protocol" }
coincubed = { path = "../coincubed", default-features = false, features = [
"nonblocking_shutdown",
] }
Expand All @@ -47,7 +48,16 @@ iced_runtime = "0.14.0"
# Used to verify RFC-compliance of an email
email_address = "0.2.7"

tokio = { version = "1", features = ["signal"] }
tokio = { version = "1", features = [
"signal",
"process",
"io-util",
"sync",
"time",
"macros",
"rt",
"rt-multi-thread",
] }
async-fd-lock = "0.2.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub fn asset_kind_for_id(asset_id: &str, network: Network) -> Option<AssetKind>
/// decimal places.
///
/// ```
/// use coincube_gui::app::breez::assets::format_asset_amount;
/// use coincube_gui::app::breez_liquid::assets::format_asset_amount;
/// assert_eq!(format_asset_amount(100_000_000, 8), "1.00000000");
/// assert_eq!(format_asset_amount(50_000_000, 8), "0.50000000");
/// ```
Expand Down Expand Up @@ -157,7 +157,7 @@ pub fn format_usdt_display(amount: u64) -> String {
/// `scale`. Returns `None` for malformed or empty inputs. Zero values return `Some(0)`.
///
/// ```
/// use coincube_gui::app::breez::assets::parse_asset_to_minor_units;
/// use coincube_gui::app::breez_liquid::assets::parse_asset_to_minor_units;
/// assert_eq!(parse_asset_to_minor_units("1.50", 8), Some(150_000_000));
/// assert_eq!(parse_asset_to_minor_units("1e2", 8), None); // scientific notation rejected
/// assert_eq!(parse_asset_to_minor_units("0.0", 8), Some(0)); // zero yields Some(0)
Expand Down
43 changes: 43 additions & 0 deletions coincube-gui/src/app/breez_spark/assets.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//! Placeholder Spark asset registry.
//!
//! Phase 2 scope: Bitcoin + Lightning only. Spark SDK 0.13.1 also ships
//! Spark-native tokens (BTKN) and a Stable Balance feature (USDB under
//! the hood), but those are invisible to the user in our Phase 6 plan —
//! Stable Balance surfaces as a Settings toggle, not a user-visible asset,
//! and BTKN has no shipping use case for us yet.
//!
//! This module exists so future phases have a stable place to extend the
//! asset list. The `list_assets()` accessor returns an owned `Vec` so
//! callers don't have to care whether the list is static or derived from
//! backend state (it'll need to pull from the bridge once per-cube asset
//! discovery is wired).

/// A Spark-side asset that the UI can display in a picker / balance row.
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub enum SparkAsset {
/// Native Spark Bitcoin balance.
Bitcoin,
/// Lightning payments (BOLT11 / BOLT12 / LNURL). Rendered as a
/// separate asset even though it's routed over Bitcoin under the
/// hood, matching how the UI already treats Liquid's Lightning
/// method.
Lightning,
}

impl SparkAsset {
/// Short label for display in pickers (not localized).
pub fn label(self) -> &'static str {
match self {
Self::Bitcoin => "BTC",
Self::Lightning => "Lightning",
}
}
}

/// Return the full asset list the Spark panels should render today.
///
/// Phase 6 will add a Stable Balance toggle in Settings (not an asset
/// entry) and later phases may add more Spark-native assets here.
pub fn list_assets() -> Vec<SparkAsset> {
vec![SparkAsset::Bitcoin, SparkAsset::Lightning]
}
Loading
Loading