README.md in nanook-1.0.0 vs README.md in nanook-1.0.1

- old
+ new

@@ -60,11 +60,11 @@ Nanook.new.wallet(wallet_id).accounts ``` ### Sending a payment -You can send a payment from an account in a wallet: +To send a payment from an account in a wallet: ```ruby account = Nanook.new.wallet(wallet_id).account(account_id) account.pay(to: recipient_account_id, amount: 0.2, id: unique_id) ``` @@ -78,12 +78,16 @@ The `id` can be any string and needs to be unique per payment. It serves an important purpose; it allows you to make this call multiple times with the same `id` and be reassured that you will only ever send that nano payment once. From the [Nano RPC](https://github.com/nanocurrency/raiblocks/wiki/RPC-protocol#account-create): > You can (and should) specify a unique id for each spend to provide idempotency. That means that if you [make the payment call] two times with the same id, the second request won't send any additional Nano. -The unit of the `amount` is NANO (which is currently technically 1Mnano &mdash; see [What are Nano's Units](https://nano.org/en/faq#what-are-nano-units-)). +The unit of the `amount` is NANO (which is currently technically Mnano &mdash; see [What are Nano's Units](https://nano.org/en/faq#what-are-nano-units-)). You can pass an amount of raw instead by adding the `unit: :raw` argument: +```ruby +account.pay(to: recipient_account_id, amount: 999, unit: :raw, id: unique_id) +``` + Note, there may be a delay in receiving a response due to Proof of Work being done. From the [Nano RPC](https://github.com/nanocurrency/raiblocks/wiki/RPC-protocol#account-create): > Proof of Work is precomputed for one transaction in the background. If it has been a while since your last transaction it will send instantly, the next one will need to wait for Proof of Work to be generated. ### Receiving a payment @@ -114,10 +118,12 @@ wallet.receive(block_id, into: account_id) ``` ## All commands +Below is a quick reference list of commands. See the [full Nanook documentation](https://lukes.github.io/nanook/1.0.0/) for a searchable detailed description of every class and method, what the arguments mean, and example responses (Tip: expand the "**Nanook** < Object" item in the sidebar). + ### 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: @@ -129,15 +135,10 @@ #### Working with a single wallet: ```ruby wallet = Nanook.new.wallet(wallet_id) -wallet.export -wallet.locked? -wallet.unlock(password) -wallet.change_password(password) - wallet.balance wallet.balance(account_break_down: true) 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) @@ -146,10 +147,15 @@ wallet.account.create wallet.accounts wallet.contains?(account_id) +wallet.export +wallet.locked? +wallet.unlock(password) +wallet.change_password(password) + wallet.destroy ``` ### Accounts #### Create account: @@ -161,10 +167,19 @@ #### Working with a single account: ```ruby account = Nanook.new.wallet(wallet_id).account(account_id) +account.balance +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.exists? account.info account.info(detailed: true) account.ledger account.ledger(limit: 10) @@ -173,29 +188,25 @@ account.public_key account.delegators account.representative account.weight -account.balance -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.balance +account.balance(unit: :raw) +account.pending +account.pending(limit: 1) + account.exists? account.info account.info(detailed: true) account.ledger account.ledger(limit: 10) @@ -203,19 +214,16 @@ 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 +See the [full documentation for Nanook::Block](https://lukes.github.io/nanook/1.0.0/classes/Nanook/Block.html) for a detailed description of each method and example responses. + ```ruby block = Nanook.new.block(block_id) block.info # Verified blocks in the ledger block.info(allow_unchecked: true) # Verified blocks AND unchecked synchronizing blocks @@ -226,11 +234,11 @@ block.history(limit: 10) block.republish block.republish(sources: 2) block.republish(destinations: 2) block.pending? -block.process +block.publish block.successors block.successors(limit: 10) block.generate_work block.cancel_work @@ -299,9 +307,13 @@ Bug reports and pull requests are welcome. Pull requests with passing tests are even better. To run the test suite: bundle exec rspec spec + +To update rdoc documentation: + + bundle exec rake rerdoc ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).