mirror of
https://github.com/aljazceru/cdk.git
synced 2026-02-05 13:16:00 +01:00
refactor: ffi for mint mnemonic
This commit is contained in:
@@ -12,6 +12,7 @@ use cashu_sdk::Mnemonic;
|
||||
|
||||
use crate::error::Result;
|
||||
use crate::types::MintKeySetInfo;
|
||||
use crate::CashuSdkError;
|
||||
|
||||
pub struct Mint {
|
||||
inner: RwLock<MintSdk>,
|
||||
@@ -35,9 +36,13 @@ impl Mint {
|
||||
.map(|ik| ik.as_ref().deref().clone())
|
||||
.collect();
|
||||
|
||||
let menemonic = Mnemonic::from_str(&secret).map_err(|_| CashuSdkError::Generic {
|
||||
err: "Invalid Mnemonic".to_string(),
|
||||
})?;
|
||||
|
||||
Ok(Self {
|
||||
inner: MintSdk::new(
|
||||
Mnemonic::from_str(&secret).unwrap(),
|
||||
menemonic,
|
||||
keysets,
|
||||
spent_secrets,
|
||||
// TODO: quotes
|
||||
|
||||
Reference in New Issue
Block a user