pub struct PrivateKey {
pub account: u32,
pub index: u32,
pub coin_type: u32,
/* private fields */
}
Expand description
The Private key structure that is used to generate signatures and public keys WARNING: No Security Audit has been performed
Fields§
§account: u32
§index: u32
§coin_type: u32
Implementations§
Source§impl PrivateKey
impl PrivateKey
Sourcepub fn new<C: Signing + Context>(
secp: &Secp256k1<C>,
) -> Result<PrivateKey, TerraRustAPIError>
pub fn new<C: Signing + Context>( secp: &Secp256k1<C>, ) -> Result<PrivateKey, TerraRustAPIError>
Generate a new private key
Sourcepub fn new_seed<C: Signing + Context>(
secp: &Secp256k1<C>,
seed_phrase: &str,
) -> Result<PrivateKey, TerraRustAPIError>
pub fn new_seed<C: Signing + Context>( secp: &Secp256k1<C>, seed_phrase: &str, ) -> Result<PrivateKey, TerraRustAPIError>
generate a new private key with a seed phrase
Sourcepub fn from_words<C: Signing + Context>(
secp: &Secp256k1<C>,
words: &str,
account: u32,
index: u32,
) -> Result<PrivateKey, TerraRustAPIError>
pub fn from_words<C: Signing + Context>( secp: &Secp256k1<C>, words: &str, account: u32, index: u32, ) -> Result<PrivateKey, TerraRustAPIError>
for private key recovery. This is also used by wallet routines to re-hydrate the structure
Sourcepub fn from_words_seed<C: Signing + Context>(
secp: &Secp256k1<C>,
words: &str,
seed_pass: &str,
) -> Result<PrivateKey, TerraRustAPIError>
pub fn from_words_seed<C: Signing + Context>( secp: &Secp256k1<C>, words: &str, seed_pass: &str, ) -> Result<PrivateKey, TerraRustAPIError>
for private key recovery with seed phrase
Sourcepub fn public_key<C: Signing + Context>(&self, secp: &Secp256k1<C>) -> PublicKey
pub fn public_key<C: Signing + Context>(&self, secp: &Secp256k1<C>) -> PublicKey
generate the public key for this private key
Sourcepub fn sign<C: Signing + Context>(
&self,
secp: &Secp256k1<C>,
blob: &str,
) -> Result<StdSignature, TerraRustAPIError>
pub fn sign<C: Signing + Context>( &self, secp: &Secp256k1<C>, blob: &str, ) -> Result<StdSignature, TerraRustAPIError>
signs a blob of data and returns a StdSignature
Trait Implementations§
Source§impl Clone for PrivateKey
impl Clone for PrivateKey
Source§fn clone(&self) -> PrivateKey
fn clone(&self) -> PrivateKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for PrivateKey
impl RefUnwindSafe for PrivateKey
impl Send for PrivateKey
impl Sync for PrivateKey
impl Unpin for PrivateKey
impl UnwindSafe for PrivateKey
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