Struct terra_rust_api::PublicKey[][src]

pub struct PublicKey {
    pub raw_pub_key: Option<Vec<u8>>,
    pub raw_address: Option<Vec<u8>>,
}
Expand description

The public key we used to generate the cosmos/tendermind/terrad addresses

Fields

raw_pub_key: Option<Vec<u8>>

This is optional as we can generate non-pub keys without

raw_address: Option<Vec<u8>>

The raw bytes used to generate non-pub keys

Implementations

impl PublicKey[src]

pub fn from_bitcoin_public_key(bpub: &PublicKey) -> PublicKey[src]

Generate a Cosmos/Tendermint/Terrad Public Key

pub fn from_public_key(bpub: &[u8]) -> PublicKey[src]

Generate from secp256k1 Cosmos/Terrad Public Key

pub fn from_account(acc_address: &str) -> Result<PublicKey>[src]

Generate a Cosmos/Tendermint/Terrad Account

pub fn from_tendermint_key(tendermint_public_key: &str) -> Result<PublicKey>[src]

build a public key from a tendermint public key

pub fn from_operator_address(valoper_address: &str) -> Result<PublicKey>[src]

Generate a Operator address for this public key (used by the validator)

pub fn from_raw_address(raw_address: &str) -> Result<PublicKey>[src]

Generate Public key from raw address

pub fn pubkey_from_public_key(public_key: &[u8]) -> Vec<u8>[src]

Gets a bech32-words pubkey from a compressed bytes Secp256K1 public key.

@param publicKey raw public key

pub fn pubkey_from_ed25519_public_key(public_key: &[u8]) -> Vec<u8>[src]

Gets a bech32-words pubkey from a compressed bytes Ed25519 public key.

@param publicKey raw public key

pub fn public_key_from_pubkey(pub_key: &[u8]) -> Result<Vec<u8>>[src]

Translate from a BECH32 prefixed key to a standard public key

pub fn address_from_public_key(public_key: &[u8]) -> Vec<u8>[src]

Gets a raw address from a compressed bytes public key.

@param publicKey raw public key

pub fn address_from_public_ed25519_key(public_key: &[u8]) -> Result<Vec<u8>>[src]

Gets a raw address from a ed25519 public key.

@param publicKey raw public key

pub fn account(&self) -> Result<String>[src]

The main account used in most things

pub fn operator_address(&self) -> Result<String>[src]

The operator address used for validators

pub fn application_public_key(&self) -> Result<String>[src]

application public key - Application keys are associated with a public key terrapub- and an address terra-

pub fn operator_address_public_key(&self) -> Result<String>[src]

The operator address used for validators public key.

pub fn tendermint(&self) -> Result<String>[src]

This is a unique key used to sign block hashes. It is associated with a public key terravalconspub.

pub fn tendermint_pubkey(&self) -> Result<String>[src]

This is a unique key used to sign block hashes. It is associated with a public key terravalconspub.

Trait Implementations

impl Debug for PublicKey[src]

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

Formats the value using the given formatter. Read more

impl<'de> Deserialize<'de> for PublicKey[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl Serialize for PublicKey[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

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

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

fn in_current_span(self) -> Instrumented<Self>[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]

pub fn erased_serialize(
    &self,
    serializer: &mut dyn Serializer
) -> Result<Ok, Error>
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

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

pub fn vzip(self) -> V

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]