README.md in nanook-0.7.0 vs README.md in nanook-1.0.0
- old
+ new
@@ -1,19 +1,19 @@
# Nanook
-This is a Ruby library for managing a [nano currency](https://nano.org/) node, including making and receiving payments, using the [nano RPC protocol](https://github.com/nanocurrency/raiblocks/wiki/RPC-protocol). Nano is a fee-less, fast, environmentally-friendly cryptocurrency. It's awesome. See [https://nano.org/](https://nano.org/).
+This is a Ruby library for managing a [nano currency](https://nano.org/) node, including making and receiving payments, using the [nano RPC protocol](https://github.com/nanocurrency/raiblocks/wiki/RPC-protocol). Nano is a fee-less, fast, environmentally-friendly cryptocurrency. It's awesome. See [https://nano.org](https://nano.org/).
[](https://badge.fury.io/rb/nanook)
[](https://circleci.com/gh/lukes/nanook/tree/master)
## Installation
Add this line to your application's Gemfile:
```ruby
-gem 'nanook'
+gem 'nanook', "~> 1.0"
```
And then execute:
$ bundle
@@ -24,20 +24,20 @@
# Getting Started
## Initializing
-Nanook will by default connect to `http://localhost:7076`. If you're using Nanook from the nano node itself this will generally work fine.
+Nanook will by default connect to `http://localhost:7076`.
```ruby
nanook = Nanook.new
```
To connect to another host instead:
```ruby
-nanook = Nanook.new("http://example.com:7076")
+nanook = Nanook.new("http://ip6-localhost:7076")
```
## Basics
### Working with wallets and accounts
@@ -98,11 +98,11 @@
wallet = Nanook.new.wallet(wallet_id)
wallet.receive(into: account_id)
```
-The `receive` method when called as above will receive the latest pending payment for an account in a wallet. It will either return a RPC response containing the block if a payment was received, or `false` if there were no pending payments to receive.
+The `receive` method when called as above will receive the latest pending payment for an account in a wallet. It will either return a block hash if a payment was received, or `false` if there were no pending payments to receive.
You can also receive a specific pending block if you know it (you may have discovered it through calling `account.pending` for example):
```ruby
account = Nanook.new.wallet(wallet_id).account(account_id)
@@ -116,10 +116,12 @@
## All commands
### Wallets
+See the [full documentation for Nanook::Wallet](https://lukes.github.io/nanook/1.0.0/classes/Nanook/Wallet.html) for a detailed description of each method and example responses.
+
#### Create wallet:
```ruby
Nanook.new.wallet.create
```
@@ -134,11 +136,13 @@
wallet.unlock(password)
wallet.change_password(password)
wallet.balance
wallet.balance(account_break_down: true)
-wallet.pay(from: your_account_id, to: recipient_account_id, amount: 0.2, id: unique_id)
+wallet.balance(unit: :raw)
+wallet.pay(from: your_account_id, to: recipient_account_id, amount: 2, id: unique_id)
+wallet.pay(from: your_account_id, to: recipient_account_id, amount: 2, unit: :raw, id: unique_id)
wallet.receive(into: account_id)
wallet.receive(pending_block_id, into: account_id)
wallet.account.create
wallet.accounts
@@ -159,45 +163,52 @@
```ruby
account = Nanook.new.wallet(wallet_id).account(account_id)
account.exists?
account.info
+account.info(detailed: true)
account.ledger
account.ledger(limit: 10)
account.history
account.history(limit: 1)
account.public_key
account.delegators
account.representative
account.weight
account.balance
-account.pay(to: recipient_account_id, amount: 0.2, id: unique_id)
+account.balance(unit: :raw)
+account.pay(to: recipient_account_id, amount: 2, id: unique_id)
+account.pay(to: recipient_account_id, amount: 2, unit: :raw, id: unique_id)
account.pending
account.pending(limit: 1)
account.receive
account.receive(pending_block_id)
account.destroy
```
#### Working with any account (not necessarily in your wallet):
+See the [full documentation for Nanook::Account](https://lukes.github.io/nanook/1.0.0/classes/Nanook/Account.html) for a detailed description of each method and example responses.
+
```ruby
account = Nanook.new.account(account_id)
account.exists?
account.info
+account.info(detailed: true)
account.ledger
account.ledger(limit: 10)
account.history
account.history(limit: 1)
account.public_key
account.delegators
account.representative
account.weight
account.balance
+account.balance(unit: :raw)
account.pending
account.pending(limit: 1)
```
### Blocks