mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-24 08:05:02 +01:00
fix: mint info
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)?)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user