Trait SparkSigner

Source
pub trait SparkSigner:
    SparkSignerShamir
    + SparkSignerEcdsa
    + SparkSignerEcies
    + SparkSignerFrost
    + SparkSignerSecp256k1
    + SparkSignerFrostSigning {
    type WrappedSigner: Sized;

    // Required methods
    fn from_mnemonic<'life0, 'async_trait>(
        mnemonic: &'life0 str,
        network: SparkNetwork,
    ) -> Pin<Box<dyn Future<Output = Result<Self::WrappedSigner, SparkSdkError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn from_master_seed<'life0, 'async_trait>(
        master_seed: &'life0 [u8],
        network: SparkNetwork,
    ) -> Pin<Box<dyn Future<Output = Result<Self::WrappedSigner, SparkSdkError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn derive_signing_key_from_leaf(
        &self,
        leaf_id: Uuid,
    ) -> Result<Vec<u8>, SparkSdkError>;
}

Required Associated Types§

Source

type WrappedSigner: Sized

The constructed signer type, wrapped in an Arc<parking_lot::RwLock<>>

Required Methods§

Source

fn from_mnemonic<'life0, 'async_trait>( mnemonic: &'life0 str, network: SparkNetwork, ) -> Pin<Box<dyn Future<Output = Result<Self::WrappedSigner, SparkSdkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates a new signer instance from a mnemonic (BIP-39).

§Arguments
  • mnemonic - The mnemonic to derive keys from
§Returns

A new instance of Self

Source

fn from_master_seed<'life0, 'async_trait>( master_seed: &'life0 [u8], network: SparkNetwork, ) -> Pin<Box<dyn Future<Output = Result<Self::WrappedSigner, SparkSdkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates a new signer instance from a seed.

§Arguments
  • seed - The seed bytes to derive keys from
§Returns

A new instance of Self

Source

fn derive_signing_key_from_leaf( &self, leaf_id: Uuid, ) -> Result<Vec<u8>, SparkSdkError>

Derives a signing key from a leaf ID.

§Arguments
  • leaf_id - The leaf ID to derive the signing key from
§Returns

The signing key as a 32-byte array of Vec<u8>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§