Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for cashu #1139

Merged
merged 2 commits into from
Apr 15, 2024
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
10 changes: 6 additions & 4 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions mutiny-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ payjoin = { version = "0.13.0", features = ["send", "base64"] }
bincode = "1.3.3"
hex-conservative = "0.1.1"
async-lock = "3.2.0"
bitcoin-waila = { git = "https://github.com/mutinywallet/bitcoin-waila", rev = "1d6c416fc0abaa2efa78e3dcf28450975d8f7bfe" }
bitcoin-waila = "0.5.0"

fedimint-client = "0.3.0"
fedimint-core = "0.3.0"
Expand All @@ -58,7 +58,7 @@ fedimint-ln-client = "0.3.0"
fedimint-bip39 = "0.3.0"
fedimint-ln-common = "0.3.0"
fedimint-tbs = "0.3.0"
moksha-core = { git = "https://github.com/ngutech21/moksha", rev = "18d99977965662d46ccec29fecdb0ce493745917" }
moksha-core = "0.2.1"

base64 = "0.13.0"
pbkdf2 = "0.11"
Expand Down
15 changes: 6 additions & 9 deletions mutiny-core/src/cashu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,27 @@ impl CashuHttpClient {
url: &Url,
melt_quote_request: PostMeltQuoteBolt11Request,
) -> Result<PostMeltQuoteBolt11Response, MutinyError> {
self.mint_post(
&url.join("/v1/melt/quote/bolt11")?,
json!(melt_quote_request),
)
.await
let url = format!("{url}/v1/melt/quote/bolt11");
self.mint_post(url, json!(melt_quote_request)).await
}

pub async fn post_melt_bolt11(
&self,
url: &Url,
melt_request: PostMeltBolt11Request,
) -> Result<PostMeltBolt11Response, MutinyError> {
self.mint_post(&url.join("/v1/melt/bolt11")?, json!(melt_request))
.await
let url = format!("{url}/v1/melt/bolt11");
self.mint_post(url, json!(melt_request)).await
}

async fn mint_post<T: serde::de::DeserializeOwned>(
&self,
url: &Url,
url: String,
body: Value,
) -> Result<T, MutinyError> {
let res = self
.client
.post(url.clone())
.post(url)
.header("Content-Type", "application/json")
.body(body.to_string())
.send()
Expand Down
4 changes: 2 additions & 2 deletions mutiny-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ once_cell = "1.18.0"
hex-conservative = "0.1.1"
payjoin = { version = "0.13.0", features = ["send", "base64"] }
fedimint-core = "0.3.0"
moksha-core = { git = "https://github.com/ngutech21/moksha", rev = "18d99977965662d46ccec29fecdb0ce493745917" }
moksha-core = "0.2.1"

bitcoin-waila = { git = "https://github.com/mutinywallet/bitcoin-waila", rev = "1d6c416fc0abaa2efa78e3dcf28450975d8f7bfe" }
bitcoin-waila = "0.5.0"

# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
Expand Down
Loading