#waves #blockchain #private-key #transaction #account #tech #testnet

wavesplatform

Library to work with Waves blockchain (https://waves.tech/)

8 releases

0.3.2 Aug 29, 2023
0.3.1 Oct 19, 2022
0.2.4 Sep 19, 2022
0.2.3 Jul 21, 2022
0.2.1 Sep 10, 2020

#9 in #waves

48 downloads per month
Used in waves-wallet-generator

MIT license

67KB
1.5K SLoC

waves-lib-rust

crates.io docs.rs

Library to work with Waves blockchain

Usage

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>>());
}

lib.rs:

wavesplatform

Library to work with Waves blockchain (https://waves.tech/).

Supports offline transaction signing and creating addresses and keys.

Usage

 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>>()
     );
 }

Dependencies

~13–27MB
~409K SLoC