Crates.io | wavesplatform |
lib.rs | wavesplatform |
version | 0.3.2 |
source | src |
created_at | 2020-09-09 15:19:32.417907 |
updated_at | 2023-08-29 05:54:44.644588 |
description | Library to work with Waves blockchain (https://waves.tech/) |
homepage | https://github.com/waves-rust/waves-lib-rust |
repository | https://github.com/waves-rust/waves-lib-rust |
max_upload_size | |
id | 286715 |
size | 129,867 |
Library to work with Waves blockchain
use std::time::{SystemTime, UNIX_EPOCH};
use wavesplatform::account::{PrivateKeyAccount, TESTNET};
use wavesplatform::base58::*;
use wavesplatform::seed::*;
use wavesplatform::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>>());
}