oanda_api_v20 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +7 -1
- data/lib/oanda_api_v20/orders.rb +2 -2
- data/lib/oanda_api_v20/version.rb +1 -1
- data/spec/oanda_api_v20/api_spec.rb +6 -0
- 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: b8108f8ae8240196afbf5ce81fb7cc96f9eeece1
|
4
|
+
data.tar.gz: 97384a79da9a3a293529034eb5f2a483c5c9b96e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: def31bfcd6716e880495a6396133334fd649c9fa64f42c1b957b4a165bb7b3b3ea74e13be95b3293ababb1f754ad935bd09ab24360ee9a58008e646bd61279f7
|
7
|
+
data.tar.gz: 6ee7cb2047dd8e05eae5da2da3efd859a6dfad1fd1c4f989342b73a9a67e6bd43d8b6145991e1c73ab0c82e6d61a7e94a2ae7679d049af52e0a4a6855c496c1a
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -70,7 +70,7 @@ client.account('account_id').changes.show
|
|
70
70
|
```ruby
|
71
71
|
options = { 'sinceTransactionID' => '6358' }
|
72
72
|
|
73
|
-
client.account('account_id').changes.show
|
73
|
+
client.account('account_id').changes(options).show
|
74
74
|
```
|
75
75
|
|
76
76
|
```ruby
|
@@ -97,6 +97,12 @@ See the [Oanda Documentation](http://developer.oanda.com/rest-live-v20/order-ep/
|
|
97
97
|
client.account('account_id').orders.show
|
98
98
|
```
|
99
99
|
|
100
|
+
```ruby
|
101
|
+
options = { 'instrument' => 'USD_CAD' }
|
102
|
+
|
103
|
+
client.account('account_id').orders(options).show
|
104
|
+
```
|
105
|
+
|
100
106
|
```ruby
|
101
107
|
id = client.account('account_id').orders.show['orders'][0]['id']
|
102
108
|
|
data/lib/oanda_api_v20/orders.rb
CHANGED
@@ -18,8 +18,8 @@ module OandaApiV20
|
|
18
18
|
end
|
19
19
|
|
20
20
|
# GET /v3/accounts/:account_id/orders
|
21
|
-
def orders
|
22
|
-
Client.send(http_verb, "#{base_uri}/accounts/#{account_id}/orders", headers: headers)
|
21
|
+
def orders(options = {})
|
22
|
+
Client.send(http_verb, "#{base_uri}/accounts/#{account_id}/orders", headers: headers, query: options)
|
23
23
|
end
|
24
24
|
|
25
25
|
# GET /v3/accounts/:account_id/pendingOrders
|
@@ -174,6 +174,12 @@ describe OandaApiV20::Api do
|
|
174
174
|
expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/orders')).to have_been_made.once
|
175
175
|
end
|
176
176
|
|
177
|
+
it 'retrieving all orders' do
|
178
|
+
options = { 'instrument' => 'USD_CAD' }
|
179
|
+
api.orders(options)
|
180
|
+
expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/orders').with(query: options)).to have_been_made.once
|
181
|
+
end
|
182
|
+
|
177
183
|
it 'retrieving all pending orders' do
|
178
184
|
api.pending_orders
|
179
185
|
expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/pendingOrders')).to have_been_made.once
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oanda_api_v20
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kobus Joubert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|