mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-30 19:15:20 +01:00
bindings: add MintKeySet
This commit is contained in:
@@ -118,6 +118,11 @@ interface KeySet {
|
||||
Keys keys();
|
||||
};
|
||||
|
||||
interface MintKeySet {
|
||||
[Name=generate]
|
||||
constructor(string secret, string derivation_path, u8 max_order);
|
||||
};
|
||||
|
||||
interface KeySetResponse {
|
||||
constructor(sequence<string> keyset_ids);
|
||||
sequence<string> keyset_ids();
|
||||
|
||||
@@ -14,7 +14,7 @@ mod ffi {
|
||||
pub use crate::nuts::nut01::keys::Keys;
|
||||
pub use crate::nuts::nut01::public_key::PublicKey;
|
||||
pub use crate::nuts::nut01::secret_key::SecretKey;
|
||||
pub use crate::nuts::nut02::key_set::{KeySet, KeySetResponse};
|
||||
pub use crate::nuts::nut02::{KeySet, KeySetResponse, MintKeySet};
|
||||
pub use crate::nuts::nut03::RequestMintResponse;
|
||||
pub use crate::nuts::nut04::{MintRequest, PostMintResponse};
|
||||
pub use crate::nuts::nut05::{
|
||||
|
||||
22
bindings/cashu-ffi/src/nuts/nut02/mint_keyset.rs
Normal file
22
bindings/cashu-ffi/src/nuts/nut02/mint_keyset.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use std::ops::Deref;
|
||||
|
||||
use cashu::nuts::nut02::mint::KeySet as KeySetSdk;
|
||||
|
||||
pub struct MintKeySet {
|
||||
inner: KeySetSdk,
|
||||
}
|
||||
|
||||
impl Deref for MintKeySet {
|
||||
type Target = KeySetSdk;
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.inner
|
||||
}
|
||||
}
|
||||
|
||||
impl MintKeySet {
|
||||
pub fn generate(secret: String, derivation_path: String, max_order: u8) -> Self {
|
||||
Self {
|
||||
inner: KeySetSdk::generate(secret, derivation_path, max_order),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +1,5 @@
|
||||
pub mod key_set;
|
||||
pub mod mint_keyset;
|
||||
|
||||
pub use key_set::{KeySet, KeySetResponse};
|
||||
pub use mint_keyset::MintKeySet;
|
||||
|
||||
@@ -121,6 +121,12 @@ interface KeySet {
|
||||
Keys keys();
|
||||
};
|
||||
|
||||
|
||||
interface MintKeySet {
|
||||
[Name=generate]
|
||||
constructor(string secret, string derivation_path, u8 max_order);
|
||||
};
|
||||
|
||||
interface KeySetResponse {
|
||||
constructor(sequence<string> keyset_ids);
|
||||
sequence<string> keyset_ids();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
mod client;
|
||||
mod error;
|
||||
mod mint;
|
||||
mod types;
|
||||
mod wallet;
|
||||
|
||||
@@ -8,13 +9,14 @@ mod ffi {
|
||||
Amount, BlindedMessage, BlindedMessages, BlindedSignature, Bolt11Invoice, CashuError,
|
||||
CheckFeesRequest, CheckFeesResponse, CheckSpendableRequest, CheckSpendableResponse,
|
||||
InvoiceStatus, KeyPair, KeySet, KeySetResponse, Keys, MeltRequest, MeltResponse, MintInfo,
|
||||
MintProof, MintProofs, MintRequest, MintVersion, Nut05MeltRequest, Nut05MeltResponse,
|
||||
PostMintResponse, Proof, PublicKey, RequestMintResponse, SecretKey, SplitRequest,
|
||||
SplitResponse, Token,
|
||||
MintKeySet, MintProof, MintProofs, MintRequest, MintVersion, Nut05MeltRequest,
|
||||
Nut05MeltResponse, PostMintResponse, Proof, PublicKey, RequestMintResponse, SecretKey,
|
||||
SplitRequest, SplitResponse, Token,
|
||||
};
|
||||
|
||||
pub use crate::client::Client;
|
||||
pub use crate::error::CashuSdkError;
|
||||
pub use crate::mint::Mint;
|
||||
pub use crate::types::{Melted, ProofsStatus, SendProofs};
|
||||
pub use crate::wallet::Wallet;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user