Add FiatAPI methods to Liquid SDK (#331)

* Add FiatAPI methods to Liquid SDK

* Add mirrored structs of fiat crate on Dart bindings

* Re-generate bindings

* Fix sdk-common imports

* Avoid using hardcoded Breez Server URL, re-use sdk-common constant

* Update Cargo.lock

---------

Co-authored-by: Erdem Yerebasmaz <erdem@yerebasmaz.com>
This commit is contained in:
ok300
2024-06-26 13:55:44 +00:00
committed by GitHub
parent 079be185c6
commit ef5cd28fa5
20 changed files with 3701 additions and 390 deletions

View File

@@ -106,6 +106,10 @@ pub(crate) enum Command {
/// LNURL-auth endpoint
lnurl: String,
},
/// List fiat currencies
ListFiat {},
/// Fetch available fiat rates
FetchFiatRates {},
}
#[derive(Helper, Completer, Hinter, Validator)]
@@ -376,6 +380,14 @@ pub(crate) async fn handle_command(
command_result!(res)
}
Command::FetchFiatRates {} => {
let res = sdk.fetch_fiat_rates().await?;
command_result!(res)
}
Command::ListFiat {} => {
let res = sdk.list_fiat_currencies().await?;
command_result!(res)
}
})
}