fix: mint info

This commit is contained in:
thesimplekid
2023-05-06 12:13:07 -04:00
parent 92e91b7d9b
commit 8b9959073f
3 changed files with 8 additions and 6 deletions

View File

@@ -12,11 +12,11 @@ use lightning_invoice::Invoice;
#[tokio::main]
async fn main() {
let url = "https://legend.lnbits.com/cashu/api/v1/MWMnRmbewX92AHjcL55mRo/";
let url = "https:dev-cashu.thesimplekid.com";
let client = Client::new(url).unwrap();
// NUT-09
// test_get_mint_info(&mint).await;
test_get_mint_info(&client).await;
let keys = test_get_mint_keys(&client).await;
let wallet = CashuWallet::new(client.to_owned(), keys);
@@ -139,8 +139,8 @@ async fn test_melt(wallet: &CashuWallet, invoice: Invoice, proofs: Proofs) {
println!("{:?}", res);
}
async fn _test_get_mint_info(mint: &Client) {
let _mint_info = mint.get_info().await.unwrap();
async fn test_get_mint_info(mint: &Client) {
let mint_info = mint.get_info().await.unwrap();
// println!("{:?}", mint_info);
}

View File

@@ -167,6 +167,8 @@ impl Client {
/// Get Mint Info [NUT-09]
pub async fn get_info(&self) -> Result<MintInfo, Error> {
let url = self.mint_url.join("info")?;
Ok(minreq::get(url).send()?.json::<MintInfo>()?)
let res = minreq::get(url).send()?.json::<Value>()?;
Ok(serde_json::from_value(res)?)
}
}

View File

@@ -301,7 +301,7 @@ pub struct MintInfo {
/// long description
pub description_long: String,
/// contact methods to reach the mint operator
pub contact: HashMap<String, String>,
pub contact: Vec<Vec<String>>,
/// shows which NUTs the mint supports
pub nuts: Vec<String>,
/// message of the day that the wallet must display to the user