[−][src]Struct ethers_core::types::PrivateKey
A private key on Secp256k1
Implementations
impl PrivateKey
[src]
pub fn new<R: Rng>(rng: &mut R) -> Self
[src]
pub fn sign<S>(&self, message: S) -> Signature where
S: AsRef<[u8]>,
[src]
S: AsRef<[u8]>,
Sign arbitrary string data.
The data is UTF-8 encoded and enveloped the same way as with
hash_message
. The returned signed data's signature is in 'Electrum'
notation, that is the recovery value v
is either 27
or 28
(as
opposed to the standard notation where v
is either 0
or 1
). This
is important to consider when using this signature with other crates.
pub fn sign_transaction(
&self,
tx: TransactionRequest,
chain_id: Option<u64>
) -> Result<Transaction, TxError>
[src]
&self,
tx: TransactionRequest,
chain_id: Option<u64>
) -> Result<Transaction, TxError>
RLP encodes and then signs the stransaction.
If no chain_id is provided, then EIP-155 is not used.
This will return an error if called if any of the nonce
, gas_price
or gas
fields are not populated.
Panics
If tx.to
is an ENS name. The caller MUST take care of name resolution before
calling this function.
Methods from Deref<Target = SecretKey>
Trait Implementations
impl Clone for PrivateKey
[src]
fn clone(&self) -> PrivateKey
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PrivateKey
[src]
impl Deref for PrivateKey
[src]
type Target = SecretKey
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl<'de> Deserialize<'de> for PrivateKey
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Eq for PrivateKey
[src]
impl<'_> From<&'_ PrivateKey> for PublicKey
[src]
fn from(src: &PrivateKey) -> PublicKey
[src]
Gets the public address of a private key.
impl<'_> From<&'_ PrivateKey> for Address
[src]
fn from(src: &PrivateKey) -> Address
[src]
impl From<PrivateKey> for Address
[src]
fn from(src: PrivateKey) -> Address
[src]
impl FromStr for PrivateKey
[src]
type Err = SecpError
The associated error which can be returned from parsing.
fn from_str(src: &str) -> Result<PrivateKey, Self::Err>
[src]
impl PartialEq<PrivateKey> for PrivateKey
[src]
fn eq(&self, other: &PrivateKey) -> bool
[src]
fn ne(&self, other: &PrivateKey) -> bool
[src]
impl Serialize for PrivateKey
[src]
impl StructuralEq for PrivateKey
[src]
impl StructuralPartialEq for PrivateKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for PrivateKey
impl Send for PrivateKey
impl Sync for PrivateKey
impl Unpin for PrivateKey
impl UnwindSafe for PrivateKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,