pub struct Account {
pub key_pair: Option<KeyPair>,
pub address_or_scripthash: AddressOrScriptHash,
pub label: Option<String>,
pub verification_script: Option<VerificationScript>,
pub is_default: bool,
pub is_locked: bool,
pub encrypted_private_key: Option<String>,
pub signing_threshold: Option<u32>,
pub nr_of_participants: Option<u32>,
pub wallet: Option<Weak<Wallet>>,
}
Fields§
§key_pair: Option<KeyPair>
§address_or_scripthash: AddressOrScriptHash
§label: Option<String>
§verification_script: Option<VerificationScript>
§is_default: bool
§is_locked: bool
§encrypted_private_key: Option<String>
§signing_threshold: Option<u32>
§nr_of_participants: Option<u32>
§wallet: Option<Weak<Wallet>>
Implementations§
Source§impl Account
impl Account
pub fn get_address(&self) -> String
pub fn get_script_hash(&self) -> H160
pub fn get_verification_script(&self) -> Option<VerificationScript>
pub fn get_public_key(&self) -> Option<Secp256r1PublicKey>
Source§impl Account
impl Account
pub fn to_nep6_account(&self) -> Result<NEP6Account, ProviderError>
pub async fn get_nep17_balances<P>(
&self,
provider: &RpcClient<P>,
) -> Result<HashMap<H160, u64>, ProviderError>where
P: JsonRpcProvider,
Trait Implementations§
Source§impl AccountTrait for Account
impl AccountTrait for Account
type Error = ProviderError
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
Source§impl<'de> Deserialize<'de> for Account
impl<'de> Deserialize<'de> for Account
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PrehashSigner<Secp256r1Signature> for Account
impl PrehashSigner<Secp256r1Signature> for Account
Source§fn sign_prehash(&self, _prehash: &[u8]) -> Result<Secp256r1Signature, Error>
fn sign_prehash(&self, _prehash: &[u8]) -> Result<Secp256r1Signature, Error>
Attempt to sign the given message digest, returning a digital signature
on success, or an error if something went wrong. Read more
Auto Trait Implementations§
impl Freeze for Account
impl RefUnwindSafe for Account
impl Send for Account
impl Sync for Account
impl Unpin for Account
impl UnwindSafe for Account
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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