1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//! This crate provides a simple interface for interacting with Litcoin mainnet, and testnet.

use bitcoins::{
    enc::{BitcoinEncoder, NetworkParams},
    nets::Bitcoin,
};

pub struct Ltc;

impl NetworkParams for Ltc {
    const HRP: &'static str = "ltc";
    const PKH_VERSION: u8 = 0x30;
    const SH_VERSION: u8 = 0x30;
}

pub struct LtcTest;

impl NetworkParams for LtcTest {
    const HRP: &'static str = "tltc";
    const PKH_VERSION: u8 = 0x6f;
    const SH_VERSION: u8 = 0x3a;
}

pub type LitecoinMainEncoder = BitcoinEncoder<Ltc>;
pub type LitecoinTestEncoder = BitcoinEncoder<LtcTest>;

pub type LitecoinMainnet = Bitcoin<LitecoinMainEncoder>;
pub type LitecoinTestnet = Bitcoin<LitecoinTestEncoder>;