Trait coins_bip32::enc::XKeyEncoder[][src]

pub trait XKeyEncoder {
    fn write_xpub<W, K>(writer: &mut W, key: &K) -> Result<usize, Bip32Error>
    where
        W: Write,
        K: AsRef<XPub>
;
fn write_xpriv<W, K>(writer: &mut W, key: &K) -> Result<usize, Bip32Error>
    where
        W: Write,
        K: AsRef<XPriv>
;
fn read_xpriv<R>(reader: &mut R) -> Result<XPriv, Bip32Error>
    where
        R: Read
;
fn read_xpub<R>(reader: &mut R) -> Result<XPub, Bip32Error>
    where
        R: Read
; fn xpriv_to_base58<K>(k: &K) -> Result<String, Bip32Error>
    where
        K: AsRef<XPriv>
, { ... }
fn xpub_to_base58<K>(k: &K) -> Result<String, Bip32Error>
    where
        K: AsRef<XPub>
, { ... }
fn xpriv_from_base58(s: &str) -> Result<XPriv, Bip32Error> { ... }
fn xpub_from_base58(s: &str) -> Result<XPub, Bip32Error> { ... } }

Bip32/49/84 encoder

Required methods

fn write_xpub<W, K>(writer: &mut W, key: &K) -> Result<usize, Bip32Error> where
    W: Write,
    K: AsRef<XPub>, 
[src]

Serialize the xpub to std::io::Write

fn write_xpriv<W, K>(writer: &mut W, key: &K) -> Result<usize, Bip32Error> where
    W: Write,
    K: AsRef<XPriv>, 
[src]

Serialize the xpriv to std::io::Write

fn read_xpriv<R>(reader: &mut R) -> Result<XPriv, Bip32Error> where
    R: Read
[src]

Attempt to instantiate an XPriv from a std::io::Read

use coins_bip32::{Bip32Error, xkeys::XPriv, enc::{XKeyEncoder, MainnetEncoder}};
let xpriv_str = "xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi".to_owned();

let xpriv: XPriv = MainnetEncoder::xpriv_from_base58(&xpriv_str)?;

fn read_xpub<R>(reader: &mut R) -> Result<XPub, Bip32Error> where
    R: Read
[src]

Attempt to instantiate an XPub from a std::io::Read

use coins_bip32::{Bip32Error, xkeys::XPub, enc::{XKeyEncoder, MainnetEncoder}};
let xpub_str = "xpub68NZiKmJWnxxS6aaHmn81bvJeTESw724CRDs6HbuccFQN9Ku14VQrADWgqbhhTHBaohPX4CjNLf9fq9MYo6oDaPPLPxSb7gwQN3ih19Zm4Y".to_owned();

let xpub: XPub = MainnetEncoder::xpub_from_base58(&xpub_str)?;
Loading content...

Provided methods

fn xpriv_to_base58<K>(k: &K) -> Result<String, Bip32Error> where
    K: AsRef<XPriv>, 
[src]

Serialize an XPriv to base58

fn xpub_to_base58<K>(k: &K) -> Result<String, Bip32Error> where
    K: AsRef<XPub>, 
[src]

Serialize an XPub to base58

fn xpriv_from_base58(s: &str) -> Result<XPriv, Bip32Error>[src]

Attempt to read an XPriv from a b58check string.

use coins_bip32::{Bip32Error, xkeys::XPriv, enc::{XKeyEncoder, MainnetEncoder}};
let xpriv_str = "xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi".to_owned();

let xpriv: XPriv = MainnetEncoder::xpriv_from_base58(&xpriv_str)?;

fn xpub_from_base58(s: &str) -> Result<XPub, Bip32Error>[src]

Attempt to read an XPub from a b58check string

use coins_bip32::{Bip32Error, xkeys::XPub, enc::{XKeyEncoder, MainnetEncoder}};
let xpub_str = "xpub68NZiKmJWnxxS6aaHmn81bvJeTESw724CRDs6HbuccFQN9Ku14VQrADWgqbhhTHBaohPX4CjNLf9fq9MYo6oDaPPLPxSb7gwQN3ih19Zm4Y".to_owned();

let xpub: XPub = MainnetEncoder::xpub_from_base58(&xpub_str)?;
Loading content...

Implementors

impl<P: NetworkParams> XKeyEncoder for BitcoinEncoder<P>[src]

fn write_xpub<W, K>(writer: &mut W, key: &K) -> Result<usize, Bip32Error> where
    W: Write,
    K: AsRef<XPub>, 
[src]

Serialize the xpub to std::io::Write

fn write_xpriv<W, K>(writer: &mut W, key: &K) -> Result<usize, Bip32Error> where
    W: Write,
    K: AsRef<XPriv>, 
[src]

Serialize the xpriv to std::io::Write

Loading content...