Skip to content

Commit 5c46bb3

Browse files
Update README.md
1 parent 0cdc064 commit 5c46bb3

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
# Waves
2+
3+
![crates.io](https://img.shields.io/crates/v/wavesplatform.svg)
4+
![docs.rs](https://docs.rs/wavesplatform/badge.svg)
5+
26
A Rust interface to the Waves blockchain
37

48
# Usage
59
```rust
6-
extern crate base58;
7-
extern crate waves;
8-
910
use base58::*;
1011
use std::time::{SystemTime, UNIX_EPOCH};
11-
use waves::account::{PrivateKeyAccount, TESTNET};
12-
use waves::transaction::*;
12+
use wavesplatform::account::{PrivateKeyAccount, TESTNET};
13+
use wavesplatform::seed::*;
14+
use wavesplatform::transaction::*;
1315

1416
fn main() {
15-
let account = PrivateKeyAccount::from_seed("seed");
16-
println!("my address: {}", account.public_key().to_address(TESTNET).to_string());
17+
let phrase = generate_phrase();
18+
let account = PrivateKeyAccount::from_seed(phrase);
19+
println!("My TESTNET address: {}", account.public_key().to_address(TESTNET).to_string());
1720

1821
let ts = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs() * 1000;
1922
let tx = Transaction::new_alias(&account.public_key(), "rhino", TESTNET, 100000, ts);
20-
println!("id is {}", tx.id().to_string());
23+
println!("ID is {}", tx.id().to_string());
2124
let ptx = account.sign_transaction(tx);
22-
println!("proofs are {:?}", ptx.proofs.iter().map(|p| p.to_base58()).collect::<Vec<String>>());
25+
println!("Proofs are {:?}", ptx.proofs.iter().map(|p| p.to_base58()).collect::<Vec<String>>());
2326
}
24-
```
27+
```

0 commit comments

Comments
 (0)