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 +4 -4
- data/README.md +12 -3
- data/lib/bitshares.rb +2 -1
- data/lib/bitshares/client.rb +2 -2
- data/lib/bitshares/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdd9cb06ba7de14c146c796a45ffb114b3580adc
|
4
|
+
data.tar.gz: cdfb67d63b34bd0ed3c3add85326791e392014a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 = {:
|
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
|
|
data/lib/bitshares/client.rb
CHANGED
@@ -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'
|
data/lib/bitshares/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|