|
@@ -8,6 +8,7 @@ use super::amount::{Amount, SplitTarget};
|
|
|
use super::proof::{Proofs, SpendingConditions};
|
|
use super::proof::{Proofs, SpendingConditions};
|
|
|
use crate::error::FfiError;
|
|
use crate::error::FfiError;
|
|
|
use crate::token::Token;
|
|
use crate::token::Token;
|
|
|
|
|
+use crate::{CurrencyUnit, MintUrl};
|
|
|
|
|
|
|
|
/// FFI-compatible SendMemo
|
|
/// FFI-compatible SendMemo
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize, uniffi::Record)]
|
|
#[derive(Debug, Clone, Serialize, Deserialize, uniffi::Record)]
|
|
@@ -683,3 +684,32 @@ impl From<cdk::wallet::MeltConfirmOptions> for MeltConfirmOptions {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+/// FFI-compatible WalletKey
|
|
|
|
|
+#[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize, uniffi::Record)]
|
|
|
|
|
+pub struct WalletKey {
|
|
|
|
|
+ /// Mint Url
|
|
|
|
|
+ pub mint_url: MintUrl,
|
|
|
|
|
+ /// Currency Unit
|
|
|
|
|
+ pub unit: CurrencyUnit,
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+impl TryFrom<WalletKey> for cdk::WalletKey {
|
|
|
|
|
+ type Error = FfiError;
|
|
|
|
|
+
|
|
|
|
|
+ fn try_from(value: WalletKey) -> Result<Self, Self::Error> {
|
|
|
|
|
+ Ok(Self {
|
|
|
|
|
+ mint_url: value.mint_url.try_into()?,
|
|
|
|
|
+ unit: value.unit.into(),
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+impl From<cdk::WalletKey> for WalletKey {
|
|
|
|
|
+ fn from(value: cdk::WalletKey) -> Self {
|
|
|
|
|
+ Self {
|
|
|
|
|
+ mint_url: value.mint_url.into(),
|
|
|
|
|
+ unit: value.unit.into(),
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|