bitreserve 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -1
- data/lib/bitreserve.rb +11 -2
- data/lib/bitreserve/api/endpoints.rb +1 -0
- data/lib/bitreserve/api/transparency.rb +5 -0
- data/lib/bitreserve/client.rb +3 -13
- data/lib/bitreserve/entities/ledger_entry.rb +10 -0
- data/lib/bitreserve/options.rb +21 -0
- data/lib/bitreserve/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/ledger.yml +56 -0
- data/spec/integration/api/transparency_spec.rb +12 -0
- data/spec/unit/api/transparency_spec.rb +12 -0
- data/spec/unit/client_spec.rb +10 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: deb60f433c0506a22143f15daef550ad64da24b3
|
4
|
+
data.tar.gz: 1a55e42af89d027d509a00c2308ca170059b8ec8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6ce73fb17eaab8da3fa1bd2a528c692a7ffe8907bb5fcae0f66641a875faad76db791f942baa26b9820b897c490d245b371b85878e1aa6dacc1679dcf316b7d
|
7
|
+
data.tar.gz: ba0e44f7eb3f23d4db01bef3d9cf0ef29ef6250d14a6aa4a778bc33c5f74da1fe0773bf984fc38f9b0ddc1c3bb92ba28cc1da4a5911ed4f144becc6f935f555f
|
data/README.md
CHANGED
@@ -26,6 +26,7 @@ Or install it yourself as:
|
|
26
26
|
# Contents
|
27
27
|
|
28
28
|
* [Usage](#usage)
|
29
|
+
* [Options](#options)
|
29
30
|
* [Creating an authenticated client](#creating-an-authenticated-client)
|
30
31
|
* [Personal Access Token](#personal-access-token)
|
31
32
|
* [Via argument](#via-argument)
|
@@ -57,6 +58,26 @@ client = Bitreserve::Client.new
|
|
57
58
|
puts client.all_tickers
|
58
59
|
```
|
59
60
|
|
61
|
+
## Sandbox mode
|
62
|
+
|
63
|
+
Bitreserve has a sandbox version for testing purposes:
|
64
|
+
|
65
|
+
* Sandbox site: https://sandbox.bitreserve.org
|
66
|
+
* Sandbox API: https://api-sandbox.bitreserve.org
|
67
|
+
|
68
|
+
You can set `Bitreserve.sandbox = true` to enable sandboxing mode to set the global base URL to point to the sandbox API instead of the production one.
|
69
|
+
|
70
|
+
# Options
|
71
|
+
|
72
|
+
This is a summary of the supported options when instantiating a new client, and their default values:
|
73
|
+
|
74
|
+
```ruby
|
75
|
+
Bitreserve::Client.new(
|
76
|
+
# bearer_token for OAuth authentication
|
77
|
+
token: ENV['BITRESERVE_AUTH_TOKEN']
|
78
|
+
)
|
79
|
+
```
|
80
|
+
|
60
81
|
# Creating an authenticated client
|
61
82
|
|
62
83
|
In order to make most of the API calls, you will need to authenticate your
|
@@ -266,7 +287,7 @@ client.phones
|
|
266
287
|
|
267
288
|
## Transparency
|
268
289
|
|
269
|
-
[*Bitreserve documentation on
|
290
|
+
[*Bitreserve documentation on the reserve status*](https://developer.bitreserve.org/api/v0/#reserve-status)
|
270
291
|
|
271
292
|
**Return a summary of all obligations and assets:**
|
272
293
|
|
@@ -274,6 +295,15 @@ client.phones
|
|
274
295
|
client.statistics
|
275
296
|
```
|
276
297
|
|
298
|
+
[*Bitreserve documentation on the reserve ledger*](https://developer.bitreserve.org/api/v0/#the-reserveledger)
|
299
|
+
|
300
|
+
**Return a detailed record of all obligations and assets flowing into the
|
301
|
+
network:**
|
302
|
+
|
303
|
+
```ruby
|
304
|
+
client.ledger
|
305
|
+
```
|
306
|
+
|
277
307
|
## Pagination
|
278
308
|
|
279
309
|
[*Bitreserve documentation on pagination*](https://developer.bitreserve.org/api/v0/#pagination)
|
data/lib/bitreserve.rb
CHANGED
@@ -5,18 +5,26 @@ require 'virtus'
|
|
5
5
|
Dotenv.load
|
6
6
|
|
7
7
|
require 'bitreserve/version'
|
8
|
+
require 'bitreserve/options'
|
8
9
|
require 'bitreserve/client'
|
9
10
|
|
10
11
|
module Bitreserve
|
11
|
-
API_BASE = 'https://api.bitreserve.org'
|
12
12
|
ROOT_PATH = File.dirname(__FILE__)
|
13
13
|
|
14
|
-
@api_base = API_BASE
|
14
|
+
@api_base = Options::API_BASE
|
15
15
|
@api_version = 0
|
16
16
|
@logger = Logger.new(STDOUT)
|
17
17
|
|
18
18
|
class << self
|
19
19
|
attr_accessor :api_base, :api_version, :logger
|
20
|
+
|
21
|
+
def sandbox=(value)
|
22
|
+
self.api_base = if value
|
23
|
+
Options::SANDBOX_API_BASE
|
24
|
+
else
|
25
|
+
Options::API_BASE
|
26
|
+
end
|
27
|
+
end
|
20
28
|
end
|
21
29
|
end
|
22
30
|
|
@@ -28,6 +36,7 @@ require 'bitreserve/entities/asset'
|
|
28
36
|
require 'bitreserve/entities/auth_token'
|
29
37
|
require 'bitreserve/entities/card'
|
30
38
|
require 'bitreserve/entities/contact'
|
39
|
+
require 'bitreserve/entities/ledger_entry'
|
31
40
|
require 'bitreserve/entities/phone'
|
32
41
|
require 'bitreserve/entities/ticker'
|
33
42
|
require 'bitreserve/entities/transaction'
|
@@ -8,6 +8,7 @@ module Bitreserve
|
|
8
8
|
RESEND_TRANSACTION = CARD_PRIVATE_TRANSACTIONS + '/:id/resend'
|
9
9
|
USER_PRIVATE_TRANSACTIONS = '/me/transactions'
|
10
10
|
PUBLIC_TRANSACTIONS = '/reserve/transactions'
|
11
|
+
LEDGER = '/reserve/ledger'
|
11
12
|
STATS = '/reserve/statistics'
|
12
13
|
TICKER = '/ticker'
|
13
14
|
USER = '/me'
|
@@ -5,6 +5,11 @@ module Bitreserve
|
|
5
5
|
request_data = RequestData.new(Endpoints::STATS, Entities::Asset, authorization_header)
|
6
6
|
Request.perform_with_objects(:get, request_data)
|
7
7
|
end
|
8
|
+
|
9
|
+
def ledger
|
10
|
+
request_data = RequestData.new(Endpoints::LEDGER, Entities::LedgerEntry, authorization_header)
|
11
|
+
Request.perform_with_objects(:get, request_data)
|
12
|
+
end
|
8
13
|
end
|
9
14
|
end
|
10
15
|
end
|
data/lib/bitreserve/client.rb
CHANGED
@@ -5,20 +5,10 @@ module Bitreserve
|
|
5
5
|
class Client
|
6
6
|
include Pagination
|
7
7
|
include API
|
8
|
-
|
8
|
+
include Options
|
9
9
|
|
10
|
-
def initialize(
|
11
|
-
@
|
12
|
-
end
|
13
|
-
|
14
|
-
def bearer_token?
|
15
|
-
!bearer_token.nil?
|
16
|
-
end
|
17
|
-
|
18
|
-
def authorization_header
|
19
|
-
return {} unless bearer_token?
|
20
|
-
|
21
|
-
{ 'Authorization' => "Bearer #{bearer_token}" }
|
10
|
+
def initialize(**options)
|
11
|
+
@options = options
|
22
12
|
end
|
23
13
|
end
|
24
14
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Bitreserve
|
2
|
+
module Options
|
3
|
+
attr_reader :options
|
4
|
+
API_BASE = 'https://api.bitreserve.org'
|
5
|
+
SANDBOX_API_BASE = 'https://api-sandbox.bitreserve.org'
|
6
|
+
|
7
|
+
def bearer_token?
|
8
|
+
!bearer_token.nil?
|
9
|
+
end
|
10
|
+
|
11
|
+
def bearer_token
|
12
|
+
@bearer_token ||= (options[:token] || ENV['BITRESERVE_AUTH_TOKEN'])
|
13
|
+
end
|
14
|
+
|
15
|
+
def authorization_header
|
16
|
+
return {} unless bearer_token?
|
17
|
+
|
18
|
+
{ 'Authorization' => "Bearer #{bearer_token}" }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/bitreserve/version.rb
CHANGED
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.bitreserve.org/v0/reserve/ledger
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Authorization:
|
11
|
+
- Bearer <BITRESERVE_AUTH_TOKEN>
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message: OK
|
16
|
+
headers:
|
17
|
+
Server:
|
18
|
+
- nginx
|
19
|
+
Date:
|
20
|
+
- Wed, 11 Mar 2015 17:02:48 GMT
|
21
|
+
Content-Type:
|
22
|
+
- application/json; charset=utf-8
|
23
|
+
Content-Length:
|
24
|
+
- '8207'
|
25
|
+
Connection:
|
26
|
+
- keep-alive
|
27
|
+
X-Content-Security-Policy:
|
28
|
+
- default-src "none"
|
29
|
+
Content-Security-Policy:
|
30
|
+
- default-src "none"
|
31
|
+
X-Webkit-Csp:
|
32
|
+
- default-src "none"
|
33
|
+
Strict-Transport-Security:
|
34
|
+
- max-age=31536000
|
35
|
+
X-Xss-Protection:
|
36
|
+
- 1; mode=block
|
37
|
+
X-Content-Type-Options:
|
38
|
+
- nosniff
|
39
|
+
X-Frame-Options:
|
40
|
+
- DENY
|
41
|
+
X-Bitreserve-Request-Id:
|
42
|
+
- fe6c7f3b-e8ce-4151-a39a-ac8b92913522
|
43
|
+
X-Ratelimit-Limit:
|
44
|
+
- '300'
|
45
|
+
X-Ratelimit-Remaining:
|
46
|
+
- '299'
|
47
|
+
X-Ratelimit-Reset:
|
48
|
+
- '1426093668'
|
49
|
+
Content-Range:
|
50
|
+
- items 0-49/54765
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
string: '[{"type":"asset","out":{"amount":"0.2","currency":"BTC"},"in":{"amount":"58.48","currency":"USD"},"createdAt":"2015-03-11T17:02:24.638Z"},{"type":"liability","out":{"amount":"0.00","currency":"BTC"},"in":{"amount":"0.2","currency":"BTC"},"TransactionId":"85694bac-6056-4dc8-a6a8-1cba0fd753d7","createdAt":"2015-03-11T17:01:52.509Z"},{"type":"asset","out":{"amount":"0.00","currency":"BTC"},"in":{"amount":"0.2","currency":"BTC"},"createdAt":"2015-03-11T17:01:52.509Z"},{"type":"asset","out":{"amount":"0.05","currency":"BTC"},"in":{"amount":"0.05","currency":"BTC"},"createdAt":"2015-03-11T17:01:14.158Z"},{"type":"asset","out":{"amount":"0.05","currency":"BTC"},"in":{"amount":"0.05","currency":"BTC"},"createdAt":"2015-03-11T17:01:14.093Z"},{"type":"asset","out":{"amount":"0.05","currency":"BTC"},"in":{"amount":"0.05","currency":"BTC"},"createdAt":"2015-03-11T17:00:08.512Z"},{"type":"asset","out":{"amount":"22.4421","currency":"BTC"},"in":{"amount":"0.00","currency":"BTC"},"createdAt":"2015-03-11T17:00:08.449Z"},{"type":"asset","out":{"amount":"0.05","currency":"BTC"},"in":{"amount":"0.05","currency":"BTC"},"createdAt":"2015-03-11T17:00:08.445Z"},{"type":"asset","out":{"amount":"22.0001","currency":"BTC"},"in":{"amount":"0.00","currency":"BTC"},"createdAt":"2015-03-11T17:00:08.441Z"},{"type":"asset","out":{"amount":"22.29","currency":"USD"},"in":{"amount":"0.07565012","currency":"BTC"},"createdAt":"2015-03-11T16:42:38.108Z"},{"type":"liability","out":{"amount":"0.07565012","currency":"BTC"},"in":{"amount":"0.00","currency":"BTC"},"TransactionId":"5ea024f8-5728-48b1-a6d6-b4bc574c2f7e","createdAt":"2015-03-11T16:42:32.052Z"},{"type":"liability","out":{"amount":"22.29","currency":"USD"},"in":{"amount":"0.07565012","currency":"BTC"},"TransactionId":"5ea024f8-5728-48b1-a6d6-b4bc574c2f7e","createdAt":"2015-03-11T16:42:32.051Z"},{"type":"liability","out":{"amount":"15.00","currency":"GBP"},"in":{"amount":"22.29","currency":"USD"},"TransactionId":"5ea024f8-5728-48b1-a6d6-b4bc574c2f7e","createdAt":"2015-03-11T16:42:32.049Z"},{"type":"liability","out":{"amount":"6000.00","currency":"EUR"},"in":{"amount":"6000.00","currency":"EUR"},"TransactionId":"d881428f-f5e1-42cd-bbc6-a503293286e7","createdAt":"2015-03-11T16:36:06.485Z"},{"type":"asset","out":{"amount":"6000.00","currency":"EUR"},"in":{"amount":"6000.00","currency":"EUR"},"createdAt":"2015-03-11T16:36:06.485Z"},{"type":"asset","out":{"amount":"0.67992828","currency":"BTC"},"in":{"amount":"0.00","currency":"BTC"},"createdAt":"2015-03-11T16:29:01.535Z"},{"type":"asset","out":{"amount":"0.082924","currency":"BTC"},"in":{"amount":"0.00","currency":"BTC"},"createdAt":"2015-03-11T16:19:38.928Z"},{"type":"asset","out":{"amount":"147.44","currency":"USD"},"in":{"amount":"0.5002","currency":"BTC"},"createdAt":"2015-03-11T16:08:09.487Z"},{"type":"liability","out":{"amount":"0.5002","currency":"BTC"},"in":{"amount":"0.00","currency":"BTC"},"TransactionId":"76f3c454-364a-4a32-bc59-7ef1b99d0f46","createdAt":"2015-03-11T16:08:04.832Z"},{"type":"liability","out":{"amount":"147.44","currency":"USD"},"in":{"amount":"0.5002","currency":"BTC"},"TransactionId":"76f3c454-364a-4a32-bc59-7ef1b99d0f46","createdAt":"2015-03-11T16:08:04.831Z"},{"type":"asset","out":{"amount":"0.080612","currency":"BTC"},"in":{"amount":"0.00","currency":"BTC"},"createdAt":"2015-03-11T16:07:51.497Z"},{"type":"liability","out":{"amount":"0.00","currency":"BTC"},"in":{"amount":"0.00206286","currency":"BTC"},"TransactionId":"3ab9192a-5dc9-4f12-a14f-c7eca0aaa52c","createdAt":"2015-03-11T16:07:51.483Z"},{"type":"asset","out":{"amount":"0.00","currency":"BTC"},"in":{"amount":"0.00206286","currency":"BTC"},"createdAt":"2015-03-11T16:07:51.483Z"},{"type":"liability","out":{"amount":"0.2","currency":"BTC"},"in":{"amount":"58.48","currency":"USD"},"TransactionId":"85694bac-6056-4dc8-a6a8-1cba0fd753d7","createdAt":"2015-03-11T16:03:43.034Z"},{"type":"asset","out":{"amount":"0.05","currency":"BTC"},"in":{"amount":"14.61","currency":"USD"},"createdAt":"2015-03-11T15:59:32.253Z"},{"type":"liability","out":{"amount":"0.05","currency":"BTC"},"in":{"amount":"14.61","currency":"USD"},"TransactionId":"b4d7de1b-f207-4fdf-b0db-3c01eb39682d","createdAt":"2015-03-11T15:59:28.425Z"},{"type":"asset","out":{"amount":"0.05","currency":"BTC"},"in":{"amount":"14.61","currency":"USD"},"createdAt":"2015-03-11T15:59:01.447Z"},{"type":"liability","out":{"amount":"0.05","currency":"BTC"},"in":{"amount":"14.61","currency":"USD"},"TransactionId":"5dedcec0-4636-4356-9c28-d5979a864193","createdAt":"2015-03-11T15:59:00.967Z"},{"type":"asset","out":{"amount":"0.163719","currency":"BTC"},"in":{"amount":"0.00","currency":"BTC"},"createdAt":"2015-03-11T15:58:48.864Z"},{"type":"asset","out":{"amount":"0.05","currency":"BTC"},"in":{"amount":"14.60","currency":"USD"},"createdAt":"2015-03-11T15:56:29.003Z"},{"type":"liability","out":{"amount":"0.05","currency":"BTC"},"in":{"amount":"14.60","currency":"USD"},"TransactionId":"fe907110-a797-4ff8-8975-77877d809503","createdAt":"2015-03-11T15:56:09.971Z"},{"type":"asset","out":{"amount":"14.75","currency":"USD"},"in":{"amount":"0.05","currency":"BTC"},"createdAt":"2015-03-11T15:54:56.703Z"},{"type":"liability","out":{"amount":"0.05","currency":"BTC"},"in":{"amount":"0.05","currency":"BTC"},"TransactionId":"af24c746-f5d8-4807-aee1-a91640b696f4","createdAt":"2015-03-11T15:54:30.052Z"},{"type":"liability","out":{"amount":"14.75","currency":"USD"},"in":{"amount":"0.05","currency":"BTC"},"TransactionId":"af24c746-f5d8-4807-aee1-a91640b696f4","createdAt":"2015-03-11T15:54:30.051Z"},{"type":"asset","out":{"amount":"14.75","currency":"USD"},"in":{"amount":"0.05","currency":"BTC"},"createdAt":"2015-03-11T15:48:51.126Z"},{"type":"liability","out":{"amount":"0.05","currency":"BTC"},"in":{"amount":"0.05","currency":"BTC"},"TransactionId":"f06d74c5-2597-44af-b10c-8a1d5ce5849d","createdAt":"2015-03-11T15:48:46.435Z"},{"type":"liability","out":{"amount":"14.75","currency":"USD"},"in":{"amount":"0.05","currency":"BTC"},"TransactionId":"f06d74c5-2597-44af-b10c-8a1d5ce5849d","createdAt":"2015-03-11T15:48:46.434Z"},{"type":"asset","out":{"amount":"21.83","currency":"BTC"},"in":{"amount":"6343.60","currency":"USD"},"createdAt":"2015-03-11T15:48:20.314Z"},{"type":"asset","out":{"amount":"0.2389","currency":"BTC"},"in":{"amount":"69.38","currency":"USD"},"createdAt":"2015-03-11T15:48:20.311Z"},{"type":"asset","out":{"amount":"0.37830871","currency":"BTC"},"in":{"amount":"0.00","currency":"BTC"},"createdAt":"2015-03-11T15:48:11.085Z"},{"type":"asset","out":{"amount":"0.06393526","currency":"BTC"},"in":{"amount":"0.00","currency":"BTC"},"createdAt":"2015-03-11T15:48:11.054Z"},{"type":"liability","out":{"amount":"0.00","currency":"BTC"},"in":{"amount":"0.2389","currency":"BTC"},"TransactionId":"dceb1e5d-3cc2-4f7c-a8ef-b0ed7939f163","createdAt":"2015-03-11T15:48:11.050Z"},{"type":"asset","out":{"amount":"0.00","currency":"BTC"},"in":{"amount":"0.2389","currency":"BTC"},"createdAt":"2015-03-11T15:48:11.050Z"},{"type":"asset","out":{"amount":"0.00","currency":"BTC"},"in":{"amount":"50.00","currency":"BTC"},"createdAt":"2015-03-11T15:48:11.047Z"},{"type":"liability","out":{"amount":"0.00","currency":"BTC"},"in":{"amount":"50.00","currency":"BTC"},"TransactionId":"f007ad0e-f482-44df-8efa-a1561cee8d7c","createdAt":"2015-03-11T15:48:11.047Z"},{"type":"liability","out":{"amount":"0.00","currency":"BTC"},"in":{"amount":"21.83","currency":"BTC"},"TransactionId":"1ae86bd0-2c3c-42f9-baf0-92c67b985383","createdAt":"2015-03-11T15:48:11.041Z"},{"type":"asset","out":{"amount":"0.00","currency":"BTC"},"in":{"amount":"21.83","currency":"BTC"},"createdAt":"2015-03-11T15:48:11.041Z"},{"type":"asset","out":{"amount":"14.75","currency":"USD"},"in":{"amount":"0.05","currency":"BTC"},"createdAt":"2015-03-11T15:46:17.917Z"},{"type":"liability","out":{"amount":"0.05","currency":"BTC"},"in":{"amount":"0.05","currency":"BTC"},"TransactionId":"cd6ea33b-c612-446a-b751-001da67e2f93","createdAt":"2015-03-11T15:46:05.540Z"},{"type":"liability","out":{"amount":"14.75","currency":"USD"},"in":{"amount":"0.05","currency":"BTC"},"TransactionId":"cd6ea33b-c612-446a-b751-001da67e2f93","createdAt":"2015-03-11T15:46:05.539Z"}]'
|
54
|
+
http_version:
|
55
|
+
recorded_at: Wed, 11 Mar 2015 17:02:48 GMT
|
56
|
+
recorded_with: VCR 2.9.3
|
@@ -16,6 +16,18 @@ module Bitreserve
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
19
|
+
|
20
|
+
context '#ledger' do
|
21
|
+
it 'gets all the ledger entries' do
|
22
|
+
VCR.use_cassette('ledger') do
|
23
|
+
assets = client.ledger
|
24
|
+
|
25
|
+
expect(assets).to be_a(Array)
|
26
|
+
expect(assets.first).to be_a(Entities::LedgerEntry)
|
27
|
+
expect(assets.first.type).to be_a(String)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
19
31
|
end
|
20
32
|
end
|
21
33
|
end
|
@@ -16,6 +16,18 @@ module Bitreserve
|
|
16
16
|
with(:get, request_data)
|
17
17
|
end
|
18
18
|
end
|
19
|
+
|
20
|
+
context '#ledger' do
|
21
|
+
it 'gets all the bitreserve reserve stats' do
|
22
|
+
request_data = RequestData.new(Endpoints::LEDGER, Entities::LedgerEntry, client.authorization_header)
|
23
|
+
allow(Request).to receive(:perform_with_objects)
|
24
|
+
|
25
|
+
client.ledger
|
26
|
+
|
27
|
+
expect(Request).to have_received(:perform_with_objects).
|
28
|
+
with(:get, request_data)
|
29
|
+
end
|
30
|
+
end
|
19
31
|
end
|
20
32
|
end
|
21
33
|
end
|
data/spec/unit/client_spec.rb
CHANGED
@@ -19,5 +19,15 @@ module Bitreserve
|
|
19
19
|
expect(client.bearer_token).to eq token
|
20
20
|
end
|
21
21
|
end
|
22
|
+
|
23
|
+
it 'uses the production api by default' do
|
24
|
+
Bitreserve.sandbox = false
|
25
|
+
expect(Bitreserve.api_base).to eq Bitreserve::Options::API_BASE
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'uses the sandbox api when asked to' do
|
29
|
+
Bitreserve.sandbox = true
|
30
|
+
expect(Bitreserve.api_base).to eq Bitreserve::Options::SANDBOX_API_BASE
|
31
|
+
end
|
22
32
|
end
|
23
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitreserve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Group Buddies
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -170,16 +170,19 @@ files:
|
|
170
170
|
- lib/bitreserve/entities/card.rb
|
171
171
|
- lib/bitreserve/entities/contact.rb
|
172
172
|
- lib/bitreserve/entities/error.rb
|
173
|
+
- lib/bitreserve/entities/ledger_entry.rb
|
173
174
|
- lib/bitreserve/entities/oauth_error.rb
|
174
175
|
- lib/bitreserve/entities/phone.rb
|
175
176
|
- lib/bitreserve/entities/ticker.rb
|
176
177
|
- lib/bitreserve/entities/transaction.rb
|
177
178
|
- lib/bitreserve/entities/user.rb
|
178
179
|
- lib/bitreserve/helpers.rb
|
180
|
+
- lib/bitreserve/options.rb
|
179
181
|
- lib/bitreserve/pagination.rb
|
180
182
|
- lib/bitreserve/request.rb
|
181
183
|
- lib/bitreserve/request_data.rb
|
182
184
|
- lib/bitreserve/version.rb
|
185
|
+
- spec/fixtures/vcr_cassettes/ledger.yml
|
183
186
|
- spec/fixtures/vcr_cassettes/me.yml
|
184
187
|
- spec/fixtures/vcr_cassettes/me/card.yml
|
185
188
|
- spec/fixtures/vcr_cassettes/me/cards.yml
|
@@ -247,6 +250,7 @@ signing_key:
|
|
247
250
|
specification_version: 4
|
248
251
|
summary: A wrapper for the bitreserve API
|
249
252
|
test_files:
|
253
|
+
- spec/fixtures/vcr_cassettes/ledger.yml
|
250
254
|
- spec/fixtures/vcr_cassettes/me.yml
|
251
255
|
- spec/fixtures/vcr_cassettes/me/card.yml
|
252
256
|
- spec/fixtures/vcr_cassettes/me/cards.yml
|