Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ VITE_DEFAULT_ASP_URL=https://arkade.computer/
# Get one at https://cloud.reown.com (formerly cloud.walletconnect.com).
# Missing/empty → the Swap screen shows "WalletConnect not configured".
VITE_WALLETCONNECT_PROJECT_ID=

# Default Bitcoin Core `submitpackage` broadcast endpoint for the emergency
# unilateral-exit flow.
AVARK_SUBMITPACKAGE_URL=
AVARK_SUBMITPACKAGE_TOKEN=
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,17 @@ jobs:
env:
VITE_WALLETCONNECT_PROJECT_ID: ${{ vars.VITE_WALLETCONNECT_PROJECT_ID }}
VITE_DEFAULT_ASP_URL: ${{ vars.VITE_DEFAULT_ASP_URL }}
AVARK_SUBMITPACKAGE_URL: ${{ vars.AVARK_SUBMITPACKAGE_URL }}
AVARK_SUBMITPACKAGE_TOKEN: ${{ secrets.AVARK_SUBMITPACKAGE_TOKEN }}
run: |
missing=()
[ -n "$VITE_WALLETCONNECT_PROJECT_ID" ] || missing+=(VITE_WALLETCONNECT_PROJECT_ID)
[ -n "$VITE_DEFAULT_ASP_URL" ] || missing+=(VITE_DEFAULT_ASP_URL)
if [ -z "$AVARK_SUBMITPACKAGE_URL" ]; then
missing+=("AVARK_SUBMITPACKAGE_URL (URL is a Variable, not a Secret — vars.* reads Secrets as empty)")
elif [ -z "$AVARK_SUBMITPACKAGE_TOKEN" ]; then
echo "::notice::AVARK_SUBMITPACKAGE_URL is set without a token — building a tokenless default endpoint."
fi
if [ "${#missing[@]}" -gt 0 ]; then
echo "::error::Release build env vars are empty: ${missing[*]}. Add them in repo Settings → Secrets and variables → Actions → Variables tab (not Secrets — vars.* can't read Secrets)."
exit 1
Expand Down Expand Up @@ -178,6 +185,8 @@ jobs:
env:
VITE_WALLETCONNECT_PROJECT_ID: ${{ vars.VITE_WALLETCONNECT_PROJECT_ID }}
VITE_DEFAULT_ASP_URL: ${{ vars.VITE_DEFAULT_ASP_URL }}
AVARK_SUBMITPACKAGE_URL: ${{ vars.AVARK_SUBMITPACKAGE_URL }}
AVARK_SUBMITPACKAGE_TOKEN: ${{ secrets.AVARK_SUBMITPACKAGE_TOKEN }}
run: |
pnpm tauri android build --apk --target aarch64 -- --features vendored-openssl
V='${{ needs.resolve.outputs.version }}'
Expand All @@ -191,6 +200,8 @@ jobs:
env:
VITE_WALLETCONNECT_PROJECT_ID: ${{ vars.VITE_WALLETCONNECT_PROJECT_ID }}
VITE_DEFAULT_ASP_URL: ${{ vars.VITE_DEFAULT_ASP_URL }}
AVARK_SUBMITPACKAGE_URL: ${{ vars.AVARK_SUBMITPACKAGE_URL }}
AVARK_SUBMITPACKAGE_TOKEN: ${{ secrets.AVARK_SUBMITPACKAGE_TOKEN }}
run: |
pnpm tauri android build --apk --target armv7 -- --features vendored-openssl
V='${{ needs.resolve.outputs.version }}'
Expand Down
3 changes: 1 addition & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
<title>Tauri + React + Typescript</title>
<title>Avark</title>
</head>

<body>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"test:watch": "vitest",
"android-dev-icons": "node scripts/build-android-dev-icons.mjs",
"dev:android": "node scripts/android-dev.mjs",
"dev:ios": "pnpm tauri ios dev --host $(ipconfig getifaddr en0)",
"version:bump": "node scripts/version-bump.mjs",
"prepare": "git config --local core.hooksPath githooks 2>/dev/null || true"
},
Expand Down
6 changes: 0 additions & 6 deletions public/tauri.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/vite.svg

This file was deleted.

49 changes: 25 additions & 24 deletions src-tauri/Cargo.lock

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

9 changes: 5 additions & 4 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ crate-type = ["staticlib", "cdylib", "rlib"]

[build-dependencies]
tauri-build = { version = "2", features = [] }
dotenvy = "0.15"

[dependencies]
tauri = { version = "2", features = [] }
Expand All @@ -31,10 +32,10 @@ thiserror = { version = "2", default-features = false }
tokio = { version = "1", default-features = false, features = ["sync", "fs", "time"] }

# Ark protocol
ark-client = { git = "https://github.com/arkade-os/rust-sdk.git", tag = "v0.9.0", default-features = false, features = ["tls-webpki-roots", "sqlite"] }
ark-core = { git = "https://github.com/arkade-os/rust-sdk.git", tag = "v0.9.0" }
ark-bdk-wallet = { git = "https://github.com/arkade-os/rust-sdk.git", tag = "v0.9.0" }
ark-grpc = { git = "https://github.com/arkade-os/rust-sdk.git", tag = "v0.9.0" }
ark-client = { git = "https://github.com/arkade-os/rust-sdk.git", tag = "v0.9.2", default-features = false, features = ["tls-webpki-roots", "sqlite"] }
ark-core = { git = "https://github.com/arkade-os/rust-sdk.git", tag = "v0.9.2" }
ark-bdk-wallet = { git = "https://github.com/arkade-os/rust-sdk.git", tag = "v0.9.2" }
ark-grpc = { git = "https://github.com/arkade-os/rust-sdk.git", tag = "v0.9.2" }

# Bitcoin / BIP39
bip39 = { version = "2", features = ["rand", "zeroize"] }
Expand Down
29 changes: 29 additions & 0 deletions src-tauri/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
use std::path::Path;

const DOTENV_KEYS: &[&str] = &["AVARK_SUBMITPACKAGE_URL", "AVARK_SUBMITPACKAGE_TOKEN"];

fn forward_dotenv_keys() {
let dotenv = Path::new("../.env");
if dotenv.exists() {
println!("cargo:rerun-if-changed=../.env");
}

let dotenv_values: Vec<(String, String)> = match dotenvy::from_path_iter(dotenv) {
Ok(iter) => iter.filter_map(Result::ok).collect(),
Err(_) => Vec::new(), // no .env — the process env may still provide keys
};

for key in DOTENV_KEYS {
println!("cargo:rerun-if-env-changed={key}");
if std::env::var(key).is_ok_and(|v| !v.is_empty()) {
continue;
}
if let Some((_, value)) = dotenv_values.iter().find(|(k, _)| k == key) {
if !value.is_empty() && !value.contains('\n') {
println!("cargo:rustc-env={key}={value}");
}
}
}
}

fn main() {
forward_dotenv_keys();
tauri_build::build()
}
2 changes: 1 addition & 1 deletion src-tauri/src/commands/lightning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ pub async fn get_ln_invoice(app: tauri::AppHandle, amount_sat: u64) -> Result<St

let amount = bitcoin::Amount::from_sat(amount_sat);
let result = client
.get_ln_invoice(ark_client::SwapAmount::invoice(amount), None)
.get_ln_invoice(ark_client::SwapAmount::invoice(amount), None, None)
.await
.map_err(|e| AppError::Wallet(format!("Failed to create Lightning invoice: {e}")))?;

Expand Down
1 change: 1 addition & 0 deletions src-tauri/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pub mod lightning;
pub mod nostr;
pub mod pin;
pub mod receive;
pub mod recovery;
pub mod send;
pub mod settings;
pub mod share;
Expand Down
Loading
Loading