pub trait ReadOnly {
    // Required methods
    fn key_type(&self) -> KeyType;
    fn hrp_address(&self, network_id: u32, chain_id_alias: &str) -> Result<String>;
    fn short_address(&self) -> Result<Id>;
    fn short_address_bytes(&self) -> Result<Vec<u8>>;
    fn eth_address(&self) -> String;
    fn h160_address(&self) -> H160;
}
Expand description

Key interface that “only” allows “read” operations.

Required Methods§

source

fn key_type(&self) -> KeyType

source

fn hrp_address(&self, network_id: u32, chain_id_alias: &str) -> Result<String>

Implements “crypto.PublicKeySECP256K1R.Address()” and “formatting.FormatAddress”. “human readable part” (hrp) must be valid output from “constants.GetHRP(networkID)”. ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/utils/constants

source

fn short_address(&self) -> Result<Id>

source

fn short_address_bytes(&self) -> Result<Vec<u8>>

source

fn eth_address(&self) -> String

source

fn h160_address(&self) -> H160

Implementors§

source§

impl ReadOnly for avalanche_types::key::secp256k1::private_key::Key

source§

impl ReadOnly for avalanche_types::key::secp256k1::public_key::Key