mirror of
https://github.com/aljazceru/cdk.git
synced 2026-02-05 21:26:13 +01:00
feat: make mint/wallet fns public
This commit is contained in:
@@ -302,7 +302,10 @@ impl Mint {
|
||||
}
|
||||
|
||||
/// Blind Sign
|
||||
async fn blind_sign(&self, blinded_message: &BlindedMessage) -> Result<BlindSignature, Error> {
|
||||
pub async fn blind_sign(
|
||||
&self,
|
||||
blinded_message: &BlindedMessage,
|
||||
) -> Result<BlindSignature, Error> {
|
||||
let BlindedMessage {
|
||||
amount,
|
||||
blinded_secret,
|
||||
@@ -456,7 +459,7 @@ impl Mint {
|
||||
}
|
||||
|
||||
/// Verify [`Proof`] meets conditions and is signed
|
||||
async fn verify_proof(&self, proof: &Proof) -> Result<(), Error> {
|
||||
pub async fn verify_proof(&self, proof: &Proof) -> Result<(), Error> {
|
||||
// Check if secret is a nut10 secret with conditions
|
||||
if let Ok(secret) =
|
||||
<&crate::secret::Secret as TryInto<crate::nuts::nut10::Secret>>::try_into(&proof.secret)
|
||||
@@ -744,7 +747,7 @@ impl Mint {
|
||||
}
|
||||
|
||||
/// Ensure Keyset is loaded in mint
|
||||
async fn ensure_keyset_loaded(&self, id: &Id) -> Result<(), Error> {
|
||||
pub async fn ensure_keyset_loaded(&self, id: &Id) -> Result<(), Error> {
|
||||
let keysets = self.keysets.read().await;
|
||||
if keysets.contains_key(id) {
|
||||
return Ok(());
|
||||
@@ -763,7 +766,7 @@ impl Mint {
|
||||
}
|
||||
|
||||
/// Generate [`MintKeySet`] from [`MintKeySetInfo`]
|
||||
fn generate_keyset(&self, keyset_info: MintKeySetInfo) -> MintKeySet {
|
||||
pub fn generate_keyset(&self, keyset_info: MintKeySetInfo) -> MintKeySet {
|
||||
MintKeySet::generate_from_xpriv(&self.secp_ctx, self.xpriv, keyset_info)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ impl Wallet {
|
||||
}
|
||||
|
||||
#[instrument(skip(self), fields(mint_url = %mint_url))]
|
||||
async fn active_mint_keyset(
|
||||
pub async fn active_mint_keyset(
|
||||
&self,
|
||||
mint_url: &UncheckedUrl,
|
||||
unit: &CurrencyUnit,
|
||||
@@ -366,7 +366,7 @@ impl Wallet {
|
||||
}
|
||||
|
||||
#[instrument(skip(self), fields(mint_url = %mint_url))]
|
||||
async fn active_keys(
|
||||
pub async fn active_keys(
|
||||
&self,
|
||||
mint_url: &UncheckedUrl,
|
||||
unit: &CurrencyUnit,
|
||||
@@ -779,7 +779,7 @@ impl Wallet {
|
||||
|
||||
/// Create Swap Payload
|
||||
#[instrument(skip(self, proofs), fields(mint_url = %mint_url))]
|
||||
async fn create_swap(
|
||||
pub async fn create_swap(
|
||||
&self,
|
||||
mint_url: &UncheckedUrl,
|
||||
unit: &CurrencyUnit,
|
||||
|
||||
Reference in New Issue
Block a user