|
@@ -16,6 +16,7 @@ use cdk::cdk_lightning;
|
|
|
use cdk::cdk_lightning::MintLightning;
|
|
|
use cdk::mint::{MintBuilder, MintMeltLimits};
|
|
|
use cdk::nuts::nut17::SupportedMethods;
|
|
|
+use cdk::nuts::nut19::{CachedEndpoint, Method as NUT19Method, Path as NUT19Path};
|
|
|
use cdk::nuts::{ContactInfo, CurrencyUnit, MintVersion, PaymentMethod};
|
|
|
use cdk::types::LnKey;
|
|
|
use cdk_mintd::cli::CLIArgs;
|
|
@@ -285,6 +286,19 @@ async fn main() -> anyhow::Result<()> {
|
|
|
.with_quote_ttl(10000, 10000)
|
|
|
.with_seed(mnemonic.to_seed_normalized("").to_vec());
|
|
|
|
|
|
+ let cache_ttl = settings
|
|
|
+ .info
|
|
|
+ .seconds_to_cache_requests_for
|
|
|
+ .unwrap_or(DEFAULT_CACHE_TTL_SECS);
|
|
|
+
|
|
|
+ let cached_endpoints = vec![
|
|
|
+ CachedEndpoint::new(NUT19Method::Post, NUT19Path::MintBolt11),
|
|
|
+ CachedEndpoint::new(NUT19Method::Post, NUT19Path::MeltBolt11),
|
|
|
+ CachedEndpoint::new(NUT19Method::Post, NUT19Path::Swap),
|
|
|
+ ];
|
|
|
+
|
|
|
+ mint_builder = mint_builder.add_cache(Some(cache_ttl), cached_endpoints);
|
|
|
+
|
|
|
let mint = mint_builder.build().await?;
|
|
|
|
|
|
let mint = Arc::new(mint);
|
|
@@ -306,10 +320,6 @@ async fn main() -> anyhow::Result<()> {
|
|
|
.info
|
|
|
.seconds_quote_is_valid_for
|
|
|
.unwrap_or(DEFAULT_QUOTE_TTL_SECS);
|
|
|
- let cache_ttl = settings
|
|
|
- .info
|
|
|
- .seconds_to_cache_requests_for
|
|
|
- .unwrap_or(DEFAULT_CACHE_TTL_SECS);
|
|
|
let cache_tti = settings
|
|
|
.info
|
|
|
.seconds_to_extend_cache_by
|