bitshares 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f764f9e5559cb963c49a566f4467d52af3885c91
4
- data.tar.gz: 396b6b1131c8cbb7bcc05c12cc4d76602b472423
3
+ metadata.gz: cdd9cb06ba7de14c146c796a45ffb114b3580adc
4
+ data.tar.gz: cdfb67d63b34bd0ed3c3add85326791e392014a8
5
5
  SHA512:
6
- metadata.gz: 84208a411b47edd4c940f20db8ed53e3c0f184180579c1d84cb5308ed752599a6622557ec13e5a55dfaabfe109b80159e3dbf6ca0b714505b22a4bd109680a17
7
- data.tar.gz: b4d3420d3ca5d92200f0f3d67b9f0bdbd54d54a38eb8dcd2a7dabc5e3644f1903389f55806e28ddadf77422d177cfd8ea491ef9025ffd6da5d7fa0d0aa165417
6
+ metadata.gz: 11a3914c2343c2d21a39e45a57e9fdac9c7e92e46b30cf4655f988cfc0a4250e59d6644d5089a912b9e261acd83cf9737e7dcbe73f5a1f376f87fbee2b4f018b
7
+ data.tar.gz: 511570f0749d431b33360a75c3d4b9d27ada36d1f58ed70cecdff03e113cc0f468996be21a5791f534b2dfac4ccf2690f5c28d47f17efff0c55c3e81e2f9c1c3
data/README.md CHANGED
@@ -27,7 +27,7 @@ Or install it yourself as:
27
27
 
28
28
  ## Authentication
29
29
 
30
- RPC server login credentials (registered account name and password) must be stored in the following environment variables:-
30
+ RPC server login credentials (registered account name and password) must be stored in the following environment variables or set in the configuation (see below):-
31
31
 
32
32
  `$BITSHARES_ACCOUNT`
33
33
 
@@ -35,10 +35,19 @@ RPC server login credentials (registered account name and password) must be stor
35
35
 
36
36
  ## Configuration
37
37
 
38
+ Config settings may be set via a hash or Yaml file.
39
+
40
+ **Via a hash**
41
+
42
+ RPC server login credentials may be set as follows:
43
+ ```Ruby
44
+ Bitshares.configure(:rpc_username => 'whatever')
45
+ Bitshares.configure(:rpc_password => 'whatever')
46
+ ```
47
+
38
48
  The Gem allows multiple wallet names and passwords to be stored so that actions requiring these data may be automated.
39
49
  To use this functionality - i.e. with the Wallet class (see below) wallet names and passwords must be configured in either of the following ways:
40
50
 
41
- **Via a hash**
42
51
  ```Ruby
43
52
  Bitshares.configure(:wallet => {'wallet1' => 'password1'})
44
53
  Bitshares.configure(:wallet => {'wallet2' => 'password2'})
@@ -177,7 +186,7 @@ cny_bts_trader.order_list # lists orders for the account and market - optional l
177
186
  cny_bts_trader.submit_bid(quantity, price) # buy <quantity> of Market base (BTS here) at <price> (quote/base)
178
187
  cny_bts_trader.submit_ask(quantity, price) # sell <quantity> of Market base (BTS here) at <price> (quote/base)
179
188
  # both return respective order id
180
-
189
+
181
190
  cny_bts_trader.cancel_orders(*order_ids) # cancels one or more orders for the account and market
182
191
  # returns array of memo's e.g. 'cancel ASK-90189b6e'
183
192
  ```
data/lib/bitshares.rb CHANGED
@@ -18,7 +18,8 @@ CHAIN = Bitshares::Blockchain
18
18
  # stackoverflow.com/questions/6233124/where-to-place-access-config-file-in-gem
19
19
  module Bitshares
20
20
 
21
- @config = {:wallet => {nil => nil}} # name/password key/value pairs
21
+ @config = {rpc_username: nil, rpc_password: nil,
22
+ :wallet => {nil => nil}} # name/password key/value pairs
22
23
 
23
24
  @valid_keys = @config.keys
24
25
 
@@ -6,8 +6,8 @@ module Bitshares
6
6
 
7
7
  def self.init
8
8
  bitshares_running?
9
- user = ENV['BITSHARES_ACCOUNT']
10
- password = ENV['BITSHARES_PASSWORD']
9
+ user = ENV['BITSHARES_ACCOUNT'] || Bitshares.config[:rpc_username]
10
+ password = ENV['BITSHARES_PASSWORD'] || Bitshares.config[:rpc_password]
11
11
  @uri = URI("http://localhost:#{rpc_http_port}/rpc")
12
12
  @req = Net::HTTP::Post.new(@uri)
13
13
  @req.content_type = 'application/json'
@@ -1,3 +1,3 @@
1
1
  module Bitshares
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitshares
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruce Steedman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-17 00:00:00.000000000 Z
11
+ date: 2015-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler