gemblockchain

Crates.iogemblockchain
lib.rsgemblockchain
version0.3.0
sourcesrc
created_at2020-11-10 15:48:13.958878
updated_at2023-12-05 11:20:15.819847
descriptionLibrary to work with Gem blockchain
homepagehttps://github.com/gemblockchain/gem-lib-rust
repositoryhttps://github.com/gemblockchain/gem-lib-rust
max_upload_size
id310838
size132,388
DEADBLACKCLOVER (deadblackclover)

documentation

README

gem-lib-rust

crates.io docs.rs

Library to work with Gem blockchain

Usage

use std::time::{SystemTime, UNIX_EPOCH};
use gemblockchain::account::{PrivateKeyAccount, TESTNET};
use gemblockchain::base58::*;
use gemblockchain::seed::*;
use gemblockchain::transaction::*;

fn main() {
    let phrase = generate_phrase();
    let account = PrivateKeyAccount::from_seed(&phrase);
    println!("My TESTNET address: {}", account.public_key().to_address(TESTNET).to_string());

    let ts = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs() * 1000;
    let tx = Transaction::new_alias(&account.public_key(), "rhino", TESTNET, 100000, ts);
    println!("ID is {}", tx.id().to_string());
    let ptx = account.sign_transaction(tx);
    println!("Proofs are {:?}", ptx.proofs.iter().map(|p| p.to_base58()).collect::<Vec<String>>());
}
Commit count: 66

cargo fmt