gemblockchain/
lib.rs

1//! gemblockchain
2//!
3//! Library to work with Gem blockchain.
4//!
5//! Supports offline transaction signing and creating addresses and keys.
6//!
7//!# Usage
8//!```rust
9//! use std::time::{SystemTime, UNIX_EPOCH};
10//! use gemblockchain::account::{PrivateKeyAccount, TESTNET};
11//! use gemblockchain::base58::*;
12//! use gemblockchain::seed::*;
13//! use gemblockchain::transaction::*;
14//!
15//! fn main() {
16//!     let phrase = generate_phrase();
17//!     let account = PrivateKeyAccount::from_seed(&phrase);
18//!     println!(
19//!         "My TESTNET address: {}",
20//!         account.public_key().to_address(TESTNET).to_string()
21//!     );
22//!
23//!     let ts = SystemTime::now()
24//!         .duration_since(UNIX_EPOCH)
25//!         .unwrap()
26//!         .as_secs()
27//!         * 1000;
28//!     let tx = Transaction::new_alias(&account.public_key(), "rhino", TESTNET, 100000, ts);
29//!     println!("ID is {}", tx.id().to_string());
30//!     let ptx = account.sign_transaction(tx);
31//!     println!(
32//!         "Proofs are {:?}",
33//!         ptx.proofs
34//!             .iter()
35//!             .map(|p| p.to_base58())
36//!             .collect::<Vec<String>>()
37//!     );
38//! }
39//! ```
40mod bytebuffer;
41
42/// Address module
43pub mod account;
44/// Module for interacting with the REST API of a Waves node
45pub mod node;
46/// Seed phrase module
47pub mod seed;
48/// Transaction module
49pub mod transaction;
50/// Util module
51pub mod util;
52
53pub use base58;