Trait AccountTrait

Source
pub trait AccountTrait:
    Sized
    + PartialEq
    + Send
    + Sync
    + Debug
    + Clone {
    type Error: Sync + Send + Debug + Sized;

Show 35 methods // Required methods fn key_pair(&self) -> &Option<KeyPair>; fn address_or_scripthash(&self) -> &AddressOrScriptHash; fn label(&self) -> &Option<String>; fn verification_script(&self) -> &Option<VerificationScript>; fn is_locked(&self) -> bool; fn encrypted_private_key(&self) -> &Option<String>; fn signing_threshold(&self) -> &Option<u32>; fn nr_of_participants(&self) -> &Option<u32>; fn set_key_pair(&mut self, key_pair: Option<KeyPair>); fn set_address_or_scripthash( &mut self, address_or_scripthash: AddressOrScriptHash, ); fn set_label(&mut self, label: Option<String>); fn set_verification_script( &mut self, verification_script: Option<VerificationScript>, ); fn set_locked(&mut self, is_locked: bool); fn set_encrypted_private_key( &mut self, encrypted_private_key: Option<String>, ); fn set_signing_threshold(&mut self, signing_threshold: Option<u32>); fn set_nr_of_participants(&mut self, nr_of_participants: Option<u32>); fn new( address: AddressOrScriptHash, label: Option<String>, verification_script: Option<VerificationScript>, signing_threshold: Option<u32>, nr_of_participants: Option<u32>, ) -> Self; fn from_key_pair( key_pair: KeyPair, signing_threshold: Option<u32>, nr_of_participants: Option<u32>, ) -> Result<Self, Self::Error>; fn from_key_pair_opt( key_pair: Option<KeyPair>, address: AddressOrScriptHash, label: Option<String>, verification_script: Option<VerificationScript>, is_locked: bool, is_default: bool, encrypted_private_key: Option<String>, signing_threshold: Option<u32>, nr_of_participants: Option<u32>, ) -> Self; fn from_wif(wif: &str) -> Result<Self, Self::Error>; fn decrypt_private_key(&mut self, password: &str) -> Result<(), Self::Error>; fn encrypt_private_key(&mut self, password: &str) -> Result<(), Self::Error>; fn get_script_hash(&self) -> ScriptHash; fn get_signing_threshold(&self) -> Result<u32, Self::Error>; fn get_nr_of_participants(&self) -> Result<u32, Self::Error>; fn from_verification_script( script: &VerificationScript, ) -> Result<Self, Self::Error>; fn from_public_key( public_key: &Secp256r1PublicKey, ) -> Result<Self, Self::Error>; fn set_wallet(&mut self, wallet: Option<Weak<Wallet>>); fn get_wallet(&self) -> Option<Arc<Wallet>>; fn multi_sig_from_public_keys( public_keys: &mut [Secp256r1PublicKey], signing_threshold: u32, ) -> Result<Self, Self::Error>; fn multi_sig_from_addr( address: String, signing_threshold: u8, nr_of_participants: u8, ) -> Result<Self, Self::Error>; fn from_address(address: &str) -> Result<Self, Self::Error>; fn from_script_hash(script_hash: &H160) -> Result<Self, Self::Error>; fn create() -> Result<Self, Self::Error>; fn is_multi_sig(&self) -> bool;
}

Required Associated Types§

Required Methods§

Source

fn key_pair(&self) -> &Option<KeyPair>

Source

fn address_or_scripthash(&self) -> &AddressOrScriptHash

Source

fn label(&self) -> &Option<String>

Source

fn verification_script(&self) -> &Option<VerificationScript>

Source

fn is_locked(&self) -> bool

Source

fn encrypted_private_key(&self) -> &Option<String>

Source

fn signing_threshold(&self) -> &Option<u32>

Source

fn nr_of_participants(&self) -> &Option<u32>

Source

fn set_key_pair(&mut self, key_pair: Option<KeyPair>)

Source

fn set_address_or_scripthash( &mut self, address_or_scripthash: AddressOrScriptHash, )

Source

fn set_label(&mut self, label: Option<String>)

Source

fn set_verification_script( &mut self, verification_script: Option<VerificationScript>, )

Source

fn set_locked(&mut self, is_locked: bool)

Source

fn set_encrypted_private_key(&mut self, encrypted_private_key: Option<String>)

Source

fn set_signing_threshold(&mut self, signing_threshold: Option<u32>)

Source

fn set_nr_of_participants(&mut self, nr_of_participants: Option<u32>)

Source

fn new( address: AddressOrScriptHash, label: Option<String>, verification_script: Option<VerificationScript>, signing_threshold: Option<u32>, nr_of_participants: Option<u32>, ) -> Self

Source

fn from_key_pair( key_pair: KeyPair, signing_threshold: Option<u32>, nr_of_participants: Option<u32>, ) -> Result<Self, Self::Error>

Source

fn from_key_pair_opt( key_pair: Option<KeyPair>, address: AddressOrScriptHash, label: Option<String>, verification_script: Option<VerificationScript>, is_locked: bool, is_default: bool, encrypted_private_key: Option<String>, signing_threshold: Option<u32>, nr_of_participants: Option<u32>, ) -> Self

Source

fn from_wif(wif: &str) -> Result<Self, Self::Error>

Source

fn decrypt_private_key(&mut self, password: &str) -> Result<(), Self::Error>

Source

fn encrypt_private_key(&mut self, password: &str) -> Result<(), Self::Error>

Source

fn get_script_hash(&self) -> ScriptHash

Source

fn get_signing_threshold(&self) -> Result<u32, Self::Error>

Source

fn get_nr_of_participants(&self) -> Result<u32, Self::Error>

Source

fn from_verification_script( script: &VerificationScript, ) -> Result<Self, Self::Error>

Source

fn from_public_key(public_key: &Secp256r1PublicKey) -> Result<Self, Self::Error>

Source

fn set_wallet(&mut self, wallet: Option<Weak<Wallet>>)

Source

fn get_wallet(&self) -> Option<Arc<Wallet>>

Source

fn multi_sig_from_public_keys( public_keys: &mut [Secp256r1PublicKey], signing_threshold: u32, ) -> Result<Self, Self::Error>

Source

fn multi_sig_from_addr( address: String, signing_threshold: u8, nr_of_participants: u8, ) -> Result<Self, Self::Error>

Source

fn from_address(address: &str) -> Result<Self, Self::Error>

Source

fn from_script_hash(script_hash: &H160) -> Result<Self, Self::Error>

Source

fn create() -> Result<Self, Self::Error>

Source

fn is_multi_sig(&self) -> bool

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§