Enum iota_sdk::client::secret::SecretManager

source ·
#[non_exhaustive]
pub enum SecretManager { Stronghold(StrongholdSecretManager), LedgerNano(LedgerSecretManager), Mnemonic(MnemonicSecretManager), PrivateKey(Box<PrivateKeySecretManager>), Placeholder, }
Available on crate feature client only.
Expand description

Supported secret managers

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Stronghold(StrongholdSecretManager)

Available on crate feature stronghold only.

Secret manager that uses iota_stronghold as the backing storage.

§

LedgerNano(LedgerSecretManager)

Available on crate feature ledger_nano only.

Secret manager that uses a Ledger Nano hardware wallet or Speculos simulator.

§

Mnemonic(MnemonicSecretManager)

Secret manager that uses a mnemonic in plain memory. It’s not recommended for production use. Use LedgerNano or Stronghold instead.

§

PrivateKey(Box<PrivateKeySecretManager>)

Available on crate feature private_key_secret_manager only.

Secret manager that uses a single private key.

§

Placeholder

Secret manager that’s just a placeholder, so it can be provided to an online wallet, but can’t be used for signing.

Implementations§

source§

impl SecretManager

source

pub async fn generate_ed25519_addresses( &self, __arg1: GetAddressesOptions ) -> Result<Vec<Bech32Address>>

Get a vector of public bech32 addresses

source

pub async fn generate_evm_addresses( &self, __arg1: GetAddressesOptions ) -> Result<Vec<String>>

Get a vector of EVM address strings

source§

impl SecretManager

source

pub fn try_from_mnemonic(mnemonic: impl Into<Mnemonic>) -> Result<Self>

Tries to create a SecretManager from a mnemonic string.

source

pub fn try_from_hex_seed(seed: impl Into<Zeroizing<String>>) -> Result<Self>

Tries to create a SecretManager from a seed hex string.

Trait Implementations§

source§

impl Debug for SecretManager

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for SecretManager

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&SecretManager> for SecretManagerDto

source§

fn from(value: &SecretManager) -> Self

Converts to this type from the input type.
source§

impl From<LedgerSecretManager> for SecretManager

source§

fn from(secret_manager: LedgerSecretManager) -> Self

Converts to this type from the input type.
source§

impl From<MnemonicSecretManager> for SecretManager

source§

fn from(secret_manager: MnemonicSecretManager) -> Self

Converts to this type from the input type.
source§

impl From<PrivateKeySecretManager> for SecretManager

source§

fn from(secret_manager: PrivateKeySecretManager) -> Self

Converts to this type from the input type.
source§

impl From<StrongholdAdapter> for SecretManager

source§

fn from(secret_manager: StrongholdSecretManager) -> Self

Converts to this type from the input type.
source§

impl FromStr for SecretManager

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self>

Parses a string s to return a value of this type. Read more
source§

impl SecretManage for SecretManager

§

type Error = Error

source§

fn generate_ed25519_addresses<'life0, 'async_trait>( &'life0 self, coin_type: u32, account_index: u32, address_indexes: Range<u32>, options: impl 'async_trait + Into<Option<GenerateAddressOptions>> + Send ) -> Pin<Box<dyn Future<Output = Result<Vec<Ed25519Address>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Generates addresses. Read more
source§

fn generate_evm_addresses<'life0, 'async_trait>( &'life0 self, coin_type: u32, account_index: u32, address_indexes: Range<u32>, options: impl 'async_trait + Into<Option<GenerateAddressOptions>> + Send ) -> Pin<Box<dyn Future<Output = Result<Vec<EvmAddress>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn sign_ed25519<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 [u8], chain: Bip44 ) -> Pin<Box<dyn Future<Output = Result<Ed25519Signature>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Signs msg using the given Bip44 using Ed25519.
source§

fn sign_secp256k1_ecdsa<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 [u8], chain: Bip44 ) -> Pin<Box<dyn Future<Output = Result<(PublicKey, RecoverableSignature), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Signs msg using the given Bip44 using Secp256k1.
source§

fn sign_transaction_essence<'life0, 'life1, 'async_trait>( &'life0 self, prepared_transaction_data: &'life1 PreparedTransactionData, time: Option<u32> ) -> Pin<Box<dyn Future<Output = Result<Unlocks, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Signs a transaction essence.
source§

fn sign_transaction<'life0, 'async_trait>( &'life0 self, prepared_transaction_data: PreparedTransactionData ) -> Pin<Box<dyn Future<Output = Result<TransactionPayload, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn signature_unlock<'life0, 'life1, 'async_trait>( &'life0 self, essence_hash: &'life1 [u8; 32], chain: Bip44 ) -> Pin<Box<dyn Future<Output = Result<Unlock, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Signs essence_hash using the given chain, returning an Unlock.
source§

impl SecretManagerConfig for SecretManager

§

type Config = SecretManagerDto

source§

fn to_config(&self) -> Option<Self::Config>

source§

fn from_config(config: &Self::Config) -> Result<Self, Self::Error>

source§

impl TryFrom<SecretManagerDto> for SecretManager

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: SecretManagerDto) -> Result<Self>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> ConvertTo<T> for T
where T: Send,

source§

impl<S> DowncastSecretManager for S
where S: 'static + SecretManage + Send + Sync,

source§

fn downcast<T>(&self) -> Option<&T>
where T: 'static + SecretManage,

Available on crate feature client only.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> Any for T
where T: Any,