oanda_api_v20 1.2.0 → 1.3.0
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 +10 -4
- data/lib/oanda_api_v20/accounts.rb +2 -2
- data/lib/oanda_api_v20/version.rb +1 -1
- data/spec/oanda_api_v20/api_spec.rb +8 -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: db69dca6a7b2e6a90014655db03bb55e458091a5
|
4
|
+
data.tar.gz: f5944a97ae751f3034b22334ac985b55b7e4ce3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e84bc7248328b97b98b969891ab161fb7ae6ff1f81240e8ae842174f951b74817b2162d76b9b9092a8dcf266951993a9a3551bd8574bd93493943d48f6c99eb3
|
7
|
+
data.tar.gz: dffcb489f40265cbe32114447074b9cef1d15c72e268138239dd7dd42c8ee8cafc6ffb38c7deddd8edc2a60618cd4a0cefdf0c675a819d7005da9265c8529b75
|
data/README.md
CHANGED
@@ -63,6 +63,12 @@ client.account('account_id').instruments('EUR_USD,EUR_CAD').show
|
|
63
63
|
client.account('account_id').changes.show
|
64
64
|
```
|
65
65
|
|
66
|
+
```ruby
|
67
|
+
options = { 'sinceTransactionID' => '6358' }
|
68
|
+
|
69
|
+
client.account('account_id').changes.show
|
70
|
+
```
|
71
|
+
|
66
72
|
```ruby
|
67
73
|
options = { alias: 'My New Account #2' }
|
68
74
|
|
@@ -81,7 +87,7 @@ client.instrument('EUR_USD').candles(options).show
|
|
81
87
|
|
82
88
|
### Orders
|
83
89
|
|
84
|
-
See the [Oanda Documentation](http://developer.oanda.com/rest-live-v20/
|
90
|
+
See the [Oanda Documentation](http://developer.oanda.com/rest-live-v20/order-ep/) for all available options on orders.
|
85
91
|
|
86
92
|
```ruby
|
87
93
|
client.account('account_id').orders.show
|
@@ -142,7 +148,7 @@ client.account('account_id').order(id).cancel
|
|
142
148
|
|
143
149
|
### Trades
|
144
150
|
|
145
|
-
See the [Oanda Documentation](http://developer.oanda.com/rest-live-v20/
|
151
|
+
See the [Oanda Documentation](http://developer.oanda.com/rest-live-v20/trade-ep/) for all available options on trades.
|
146
152
|
|
147
153
|
```ruby
|
148
154
|
options = { 'instrument' => 'USD_CAD' }
|
@@ -207,7 +213,7 @@ client.account('account_id').trade(id).close
|
|
207
213
|
|
208
214
|
### Positions
|
209
215
|
|
210
|
-
See the [Oanda Documentation](http://developer.oanda.com/rest-live-v20/
|
216
|
+
See the [Oanda Documentation](http://developer.oanda.com/rest-live-v20/position-ep/) for all available options on positions.
|
211
217
|
|
212
218
|
```ruby
|
213
219
|
client.account('account_id').positions.show
|
@@ -229,7 +235,7 @@ client.account('account_id').position('EUR_CAD', options).close
|
|
229
235
|
|
230
236
|
### Transactions
|
231
237
|
|
232
|
-
See the [Oanda Documentation](http://developer.oanda.com/rest-live-v20/
|
238
|
+
See the [Oanda Documentation](http://developer.oanda.com/rest-live-v20/transaction-ep/) for all available options on transactions.
|
233
239
|
|
234
240
|
```ruby
|
235
241
|
client.account('account_id').transactions.show
|
@@ -24,8 +24,8 @@ module OandaApiV20
|
|
24
24
|
end
|
25
25
|
|
26
26
|
# GET /v3/accounts/:account_id/changes
|
27
|
-
def changes
|
28
|
-
options = { 'sinceTransactionID' => last_transaction_id }
|
27
|
+
def changes(options = {})
|
28
|
+
options = { 'sinceTransactionID' => last_transaction_id } unless options['sinceTransactionID']
|
29
29
|
Client.send(http_verb, "#{base_uri}/accounts/#{account_id}/changes", headers: headers, query: options)
|
30
30
|
end
|
31
31
|
|
@@ -91,6 +91,14 @@ describe OandaApiV20::Api do
|
|
91
91
|
expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/changes').with(query: { 'sinceTransactionID' => '1' })).to have_been_made.once
|
92
92
|
end
|
93
93
|
|
94
|
+
it 'retrieving all changes since a transaction id' do
|
95
|
+
options = {
|
96
|
+
'sinceTransactionID' => '1'
|
97
|
+
}
|
98
|
+
api.changes(options)
|
99
|
+
expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/changes').with(query: options)).to have_been_made.once
|
100
|
+
end
|
101
|
+
|
94
102
|
it 'updating a configuration' do
|
95
103
|
api.http_verb = :patch
|
96
104
|
options = { 'alias' => 'Timmy!' }
|
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.3.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:
|
11
|
+
date: 2017-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|