Skip to content

Commit

Permalink
update README and metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasDP committed Jan 14, 2019
1 parent 9f7c765 commit badeedd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 21 deletions.
8 changes: 7 additions & 1 deletion cardano-wallet/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
[package]
name = "cardano-wallet"
version = "0.1.1"
version = "0.2.1"
authors = ["Nicolas Di Prima <[email protected]>"]
description = "Cardano Wallet, from rust to JS via Wasm"
homepage = "https://github.com/input-output-hk/js-cardano-wasm#README.md"
repository = "https://github.com/input-output-hk/js-cardano-wasm"
readme = "README.md"
keywords = ["wasm", "cardano", "wallet", "crypto", "ada"]
license = "MIT OR Apache-2.0"

[lib]
crate-type = ["cdylib", "rlib"]
Expand Down
44 changes: 24 additions & 20 deletions cardano-wallet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,35 @@ npm i --save cardano-wallet

# How to use

You can seek documentation
[here](https://github.com/rustwasm/create-wasm-app#create-wasm-app)
regarding how to use this package in your project.

Now remember, with great power comes great responsibility. You can now
write a cardano wallet, redeem your certificates, create and sign
transactions.

```js
import * as Cardano from "hello-wasm-pack";
import * as Cardano from "cardano-wallet";

Cardano
.then(Cardano => {
const MNEMONICS = "crowd captain hungry tray powder motor coast oppose month shed parent mystery torch resemble index";
const PASSWORD = "Cardano Rust for the winners!";
const MNEMONICS = "crowd captain hungry tray powder motor coast oppose month shed parent mystery torch resemble index";
const PASSWORD = "Cardano Rust for the winners!";

// to connect the wallet to mainnet
let settings = Cardano.BlockchainSettings.mainnet();
// to connect the wallet to mainnet
let settings = Cardano.BlockchainSettings.mainnet();

// recover the entropy
let entropy = Cardano.Entropy.from_english_mnemonics(MNEMONICS);
// recover the wallet
let wallet = Cardano.Bip44RootPrivateKey.recover(entropy, PASSWORD);
// recover the entropy
let entropy = Cardano.Entropy.from_english_mnemonics(MNEMONICS);
// recover the wallet
let wallet = Cardano.Bip44RootPrivateKey.recover(entropy, PASSWORD);

// create a wallet account
let account = wallet.bip44_account(Wallet.AccountIndex.new(0 | 0x80000000));
let account_public = account.public();
// create a wallet account
let account = wallet.bip44_account(Cardano.AccountIndex.new(0 | 0x80000000));
let account_public = account.public();

// create an address
let key_pub = account_public.address_key(false, Wallet.AddressKeyIndex.new(0));
let address = key_pub.bootstrap_era_address(settings);
// create an address
let key_pub = account_public.address_key(false, Cardano.AddressKeyIndex.new(0));
let address = key_pub.bootstrap_era_address(settings);

console.log("Address m/bip44/ada/'0/0/0", address.to_base58());
})
.catch(console.error);
console.log("Address m/bip44/ada/'0/0/0", address.to_base58());
```

0 comments on commit badeedd

Please sign in to comment.