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§
Source§impl PublicKey
impl PublicKey
Sourcepub fn from_bitcoin_public_key(bpub: &PublicKey) -> PublicKey
pub fn from_bitcoin_public_key(bpub: &PublicKey) -> PublicKey
Generate a Cosmos/Tendermint/Terrad Public Key
Sourcepub fn from_public_key(bpub: &[u8]) -> PublicKey
pub fn from_public_key(bpub: &[u8]) -> PublicKey
Generate from secp256k1 Cosmos/Terrad Public Key
Sourcepub fn from_account(acc_address: &str) -> Result<PublicKey, TerraRustAPIError>
pub fn from_account(acc_address: &str) -> Result<PublicKey, TerraRustAPIError>
Generate a Cosmos/Tendermint/Terrad Account
Sourcepub fn from_tendermint_key(
tendermint_public_key: &str,
) -> Result<PublicKey, TerraRustAPIError>
pub fn from_tendermint_key( tendermint_public_key: &str, ) -> Result<PublicKey, TerraRustAPIError>
build a public key from a tendermint public key
Sourcepub fn from_tendermint_address(
tendermint_hex_address: &str,
) -> Result<PublicKey, TerraRustAPIError>
pub fn from_tendermint_address( tendermint_hex_address: &str, ) -> Result<PublicKey, TerraRustAPIError>
build a terravalcons address from a tendermint hex key the tendermint_hex_address should be a hex code of 40 length
Sourcepub fn from_operator_address(
valoper_address: &str,
) -> Result<PublicKey, TerraRustAPIError>
pub fn from_operator_address( valoper_address: &str, ) -> Result<PublicKey, TerraRustAPIError>
Generate a Operator address for this public key (used by the validator)
Sourcepub fn from_raw_address(
raw_address: &str,
) -> Result<PublicKey, TerraRustAPIError>
pub fn from_raw_address( raw_address: &str, ) -> Result<PublicKey, TerraRustAPIError>
Generate Public key from raw address
Sourcepub fn pubkey_from_public_key(public_key: &[u8]) -> Vec<u8> ⓘ
pub fn pubkey_from_public_key(public_key: &[u8]) -> Vec<u8> ⓘ
Gets a bech32-words pubkey from a compressed bytes Secp256K1 public key.
@param publicKey raw public key
Sourcepub fn pubkey_from_ed25519_public_key(public_key: &[u8]) -> Vec<u8> ⓘ
pub fn pubkey_from_ed25519_public_key(public_key: &[u8]) -> Vec<u8> ⓘ
Gets a bech32-words pubkey from a compressed bytes Ed25519 public key.
@param publicKey raw public key
Sourcepub fn public_key_from_pubkey(
pub_key: &[u8],
) -> Result<Vec<u8>, TerraRustAPIError>
pub fn public_key_from_pubkey( pub_key: &[u8], ) -> Result<Vec<u8>, TerraRustAPIError>
Translate from a BECH32 prefixed key to a standard public key
Sourcepub fn address_from_public_key(public_key: &[u8]) -> Vec<u8> ⓘ
pub fn address_from_public_key(public_key: &[u8]) -> Vec<u8> ⓘ
Gets a raw address from a compressed bytes public key.
@param publicKey raw public key
Sourcepub fn address_from_public_ed25519_key(
public_key: &[u8],
) -> Result<Vec<u8>, TerraRustAPIError>
pub fn address_from_public_ed25519_key( public_key: &[u8], ) -> Result<Vec<u8>, TerraRustAPIError>
Gets a raw address from a ed25519 public key.
@param publicKey raw public key
Sourcepub fn account(&self) -> Result<String, TerraRustAPIError>
pub fn account(&self) -> Result<String, TerraRustAPIError>
The main account used in most things
Sourcepub fn operator_address(&self) -> Result<String, TerraRustAPIError>
pub fn operator_address(&self) -> Result<String, TerraRustAPIError>
The operator address used for validators
Sourcepub fn application_public_key(&self) -> Result<String, TerraRustAPIError>
pub fn application_public_key(&self) -> Result<String, TerraRustAPIError>
application public key - Application keys are associated with a public key terrapub- and an address terra-
Sourcepub fn operator_address_public_key(&self) -> Result<String, TerraRustAPIError>
pub fn operator_address_public_key(&self) -> Result<String, TerraRustAPIError>
The operator address used for validators public key.
Sourcepub fn tendermint(&self) -> Result<String, TerraRustAPIError>
pub fn tendermint(&self) -> Result<String, TerraRustAPIError>
This is a unique key used to sign block hashes. It is associated with a public key terravalconspub.
Sourcepub fn tendermint_pubkey(&self) -> Result<String, TerraRustAPIError>
pub fn tendermint_pubkey(&self) -> Result<String, TerraRustAPIError>
This is a unique key used to sign block hashes. It is associated with a public key terravalconspub.