bullion_vault 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -0
- data/Gemfile.lock +45 -0
- data/MIT-LICENSE +21 -0
- data/README.mkd +51 -0
- data/Rakefile +8 -0
- data/bullion_vault.gemspec +27 -0
- data/lib/bullion_vault.rb +23 -0
- data/lib/bullion_vault/api.rb +21 -0
- data/lib/bullion_vault/authentication.rb +9 -0
- data/lib/bullion_vault/client.rb +11 -0
- data/lib/bullion_vault/client/login.rb +26 -0
- data/lib/bullion_vault/client/view_balance.rb +11 -0
- data/lib/bullion_vault/client/view_market.rb +11 -0
- data/lib/bullion_vault/configuration.rb +66 -0
- data/lib/bullion_vault/connection.rb +33 -0
- data/lib/bullion_vault/error.rb +29 -0
- data/lib/bullion_vault/request.rb +34 -0
- data/lib/bullion_vault/version.rb +3 -0
- data/lib/faraday/cookie_auth.rb +14 -0
- data/lib/faraday/raise_http_4xx.rb +48 -0
- data/lib/faraday/raise_http_5xx.rb +29 -0
- data/lib/faraday/raise_invalid_cookie.rb +34 -0
- data/spec/bullion_vault/api_spec.rb +67 -0
- data/spec/bullion_vault/client/login_spec.rb +51 -0
- data/spec/bullion_vault/client/view_balance_spec.rb +17 -0
- data/spec/bullion_vault/client/view_market_spec.rb +16 -0
- data/spec/bullion_vault/client_spec.rb +13 -0
- data/spec/bullion_vault_spec.rb +65 -0
- data/spec/faraday/cookie_auth_spec.rb +14 -0
- data/spec/faraday/response_spec.rb +40 -0
- data/spec/fixtures/view_balance.xml +41 -0
- data/spec/fixtures/view_balance.yaml +32 -0
- data/spec/fixtures/view_market.xml +261 -0
- data/spec/fixtures/view_market.yaml +164 -0
- data/spec/spec_helper.rb +37 -0
- metadata +148 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
envelope:
|
3
|
+
message:
|
4
|
+
clientBalance:
|
5
|
+
clientPositions:
|
6
|
+
clientPosition:
|
7
|
+
- securityId: USD
|
8
|
+
available: "101"
|
9
|
+
total: "101"
|
10
|
+
classNarrative: CURRENCY
|
11
|
+
totalValuation: "101"
|
12
|
+
valuationCurrency: USD
|
13
|
+
- securityId: GBP
|
14
|
+
available: "1"
|
15
|
+
total: "1"
|
16
|
+
classNarrative: CURRENCY
|
17
|
+
totalValuation: "1.61"
|
18
|
+
valuationCurrency: USD
|
19
|
+
- securityId: EUR
|
20
|
+
available: "1"
|
21
|
+
total: "1"
|
22
|
+
classNarrative: CURRENCY
|
23
|
+
totalValuation: "1.43"
|
24
|
+
valuationCurrency: USD
|
25
|
+
- securityId: AUXZU
|
26
|
+
available: "0.001"
|
27
|
+
total: "0.001"
|
28
|
+
classNarrative: GOLD
|
29
|
+
totalValuation: "45.95"
|
30
|
+
valuationCurrency: USD
|
31
|
+
type: CLIENT_BALANCE_A
|
32
|
+
version: "0.2"
|
@@ -0,0 +1,261 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<envelope>
|
3
|
+
<message type="MARKET_DEPTH_A" version="0.1">
|
4
|
+
<market>
|
5
|
+
<pitches>
|
6
|
+
<pitch
|
7
|
+
securityClassNarrative="GOLD"
|
8
|
+
securityId="AUXLN"
|
9
|
+
considerationCurrency="EUR"
|
10
|
+
>
|
11
|
+
<buyPrices>
|
12
|
+
<price
|
13
|
+
actionIndicator="B"
|
14
|
+
quantity="0.206"
|
15
|
+
limit="32132"
|
16
|
+
/>
|
17
|
+
</buyPrices>
|
18
|
+
|
19
|
+
<sellPrices>
|
20
|
+
<price
|
21
|
+
actionIndicator="S"
|
22
|
+
quantity="0.019"
|
23
|
+
limit="32193"
|
24
|
+
/>
|
25
|
+
</sellPrices>
|
26
|
+
</pitch>
|
27
|
+
<pitch
|
28
|
+
securityClassNarrative="GOLD"
|
29
|
+
securityId="AUXLN"
|
30
|
+
considerationCurrency="GBP"
|
31
|
+
>
|
32
|
+
<buyPrices>
|
33
|
+
<price
|
34
|
+
actionIndicator="B"
|
35
|
+
quantity="0.598"
|
36
|
+
limit="28077"
|
37
|
+
/>
|
38
|
+
</buyPrices>
|
39
|
+
|
40
|
+
<sellPrices>
|
41
|
+
<price
|
42
|
+
actionIndicator="S"
|
43
|
+
quantity="0.11"
|
44
|
+
limit="28107"
|
45
|
+
/>
|
46
|
+
</sellPrices>
|
47
|
+
</pitch>
|
48
|
+
<pitch
|
49
|
+
securityClassNarrative="GOLD"
|
50
|
+
securityId="AUXLN"
|
51
|
+
considerationCurrency="USD"
|
52
|
+
>
|
53
|
+
<buyPrices>
|
54
|
+
<price
|
55
|
+
actionIndicator="B"
|
56
|
+
quantity="0.01"
|
57
|
+
limit="45551"
|
58
|
+
/>
|
59
|
+
</buyPrices>
|
60
|
+
|
61
|
+
<sellPrices>
|
62
|
+
<price
|
63
|
+
actionIndicator="S"
|
64
|
+
quantity="0.018"
|
65
|
+
limit="45642"
|
66
|
+
/>
|
67
|
+
</sellPrices>
|
68
|
+
</pitch>
|
69
|
+
<pitch
|
70
|
+
securityClassNarrative="GOLD"
|
71
|
+
securityId="AUXNY"
|
72
|
+
considerationCurrency="EUR"
|
73
|
+
>
|
74
|
+
<buyPrices>
|
75
|
+
<price
|
76
|
+
actionIndicator="B"
|
77
|
+
quantity="0.019"
|
78
|
+
limit="32121"
|
79
|
+
/>
|
80
|
+
</buyPrices>
|
81
|
+
|
82
|
+
<sellPrices>
|
83
|
+
<price
|
84
|
+
actionIndicator="S"
|
85
|
+
quantity="0.019"
|
86
|
+
limit="32186"
|
87
|
+
/>
|
88
|
+
</sellPrices>
|
89
|
+
</pitch>
|
90
|
+
<pitch
|
91
|
+
securityClassNarrative="GOLD"
|
92
|
+
securityId="AUXNY"
|
93
|
+
considerationCurrency="GBP"
|
94
|
+
>
|
95
|
+
<buyPrices>
|
96
|
+
<price
|
97
|
+
actionIndicator="B"
|
98
|
+
quantity="0.015"
|
99
|
+
limit="28053"
|
100
|
+
/>
|
101
|
+
</buyPrices>
|
102
|
+
|
103
|
+
<sellPrices>
|
104
|
+
<price
|
105
|
+
actionIndicator="S"
|
106
|
+
quantity="0.015"
|
107
|
+
limit="28110"
|
108
|
+
/>
|
109
|
+
</sellPrices>
|
110
|
+
</pitch>
|
111
|
+
<pitch
|
112
|
+
securityClassNarrative="GOLD"
|
113
|
+
securityId="AUXNY"
|
114
|
+
considerationCurrency="USD"
|
115
|
+
>
|
116
|
+
<buyPrices>
|
117
|
+
<price
|
118
|
+
actionIndicator="B"
|
119
|
+
quantity="0.016"
|
120
|
+
limit="45541"
|
121
|
+
/>
|
122
|
+
</buyPrices>
|
123
|
+
|
124
|
+
<sellPrices>
|
125
|
+
<price
|
126
|
+
actionIndicator="S"
|
127
|
+
quantity="0.016"
|
128
|
+
limit="45633"
|
129
|
+
/>
|
130
|
+
</sellPrices>
|
131
|
+
</pitch>
|
132
|
+
<pitch
|
133
|
+
securityClassNarrative="GOLD"
|
134
|
+
securityId="AUXZU"
|
135
|
+
considerationCurrency="EUR"
|
136
|
+
>
|
137
|
+
<buyPrices>
|
138
|
+
<price
|
139
|
+
actionIndicator="B"
|
140
|
+
quantity="0.35"
|
141
|
+
limit="32170"
|
142
|
+
/>
|
143
|
+
</buyPrices>
|
144
|
+
|
145
|
+
<sellPrices>
|
146
|
+
<price
|
147
|
+
actionIndicator="S"
|
148
|
+
quantity="0.988"
|
149
|
+
limit="32207"
|
150
|
+
/>
|
151
|
+
</sellPrices>
|
152
|
+
</pitch>
|
153
|
+
<pitch
|
154
|
+
securityClassNarrative="GOLD"
|
155
|
+
securityId="AUXZU"
|
156
|
+
considerationCurrency="GBP"
|
157
|
+
>
|
158
|
+
<buyPrices>
|
159
|
+
<price
|
160
|
+
actionIndicator="B"
|
161
|
+
quantity="0.1"
|
162
|
+
limit="28100"
|
163
|
+
/>
|
164
|
+
</buyPrices>
|
165
|
+
|
166
|
+
<sellPrices>
|
167
|
+
<price
|
168
|
+
actionIndicator="S"
|
169
|
+
quantity="0.019"
|
170
|
+
limit="28127"
|
171
|
+
/>
|
172
|
+
</sellPrices>
|
173
|
+
</pitch>
|
174
|
+
<pitch
|
175
|
+
securityClassNarrative="GOLD"
|
176
|
+
securityId="AUXZU"
|
177
|
+
considerationCurrency="USD"
|
178
|
+
>
|
179
|
+
<buyPrices>
|
180
|
+
<price
|
181
|
+
actionIndicator="B"
|
182
|
+
quantity="0.198"
|
183
|
+
limit="45620"
|
184
|
+
/>
|
185
|
+
</buyPrices>
|
186
|
+
|
187
|
+
<sellPrices>
|
188
|
+
<price
|
189
|
+
actionIndicator="S"
|
190
|
+
quantity="0.017"
|
191
|
+
limit="45662"
|
192
|
+
/>
|
193
|
+
</sellPrices>
|
194
|
+
</pitch>
|
195
|
+
<pitch
|
196
|
+
securityClassNarrative="SILVER"
|
197
|
+
securityId="AGXLN"
|
198
|
+
considerationCurrency="EUR"
|
199
|
+
>
|
200
|
+
<buyPrices>
|
201
|
+
<price
|
202
|
+
actionIndicator="B"
|
203
|
+
quantity="0.968"
|
204
|
+
limit="804"
|
205
|
+
/>
|
206
|
+
</buyPrices>
|
207
|
+
|
208
|
+
<sellPrices>
|
209
|
+
<price
|
210
|
+
actionIndicator="S"
|
211
|
+
quantity="1.339"
|
212
|
+
limit="807"
|
213
|
+
/>
|
214
|
+
</sellPrices>
|
215
|
+
</pitch>
|
216
|
+
<pitch
|
217
|
+
securityClassNarrative="SILVER"
|
218
|
+
securityId="AGXLN"
|
219
|
+
considerationCurrency="GBP"
|
220
|
+
>
|
221
|
+
<buyPrices>
|
222
|
+
<price
|
223
|
+
actionIndicator="B"
|
224
|
+
quantity="1.367"
|
225
|
+
limit="700"
|
226
|
+
/>
|
227
|
+
</buyPrices>
|
228
|
+
|
229
|
+
<sellPrices>
|
230
|
+
<price
|
231
|
+
actionIndicator="S"
|
232
|
+
quantity="185.62"
|
233
|
+
limit="702"
|
234
|
+
/>
|
235
|
+
</sellPrices>
|
236
|
+
</pitch>
|
237
|
+
<pitch
|
238
|
+
securityClassNarrative="SILVER"
|
239
|
+
securityId="AGXLN"
|
240
|
+
considerationCurrency="USD"
|
241
|
+
>
|
242
|
+
<buyPrices>
|
243
|
+
<price
|
244
|
+
actionIndicator="B"
|
245
|
+
quantity="0.833"
|
246
|
+
limit="1139"
|
247
|
+
/>
|
248
|
+
</buyPrices>
|
249
|
+
|
250
|
+
<sellPrices>
|
251
|
+
<price
|
252
|
+
actionIndicator="S"
|
253
|
+
quantity="2.141"
|
254
|
+
limit="1142"
|
255
|
+
/>
|
256
|
+
</sellPrices>
|
257
|
+
</pitch>
|
258
|
+
</pitches>
|
259
|
+
</market>
|
260
|
+
</message>
|
261
|
+
</envelope>
|
@@ -0,0 +1,164 @@
|
|
1
|
+
---
|
2
|
+
envelope:
|
3
|
+
message:
|
4
|
+
type: MARKET_DEPTH_A
|
5
|
+
version: '0.1'
|
6
|
+
market:
|
7
|
+
pitches:
|
8
|
+
pitch:
|
9
|
+
- securityClassNarrative: GOLD
|
10
|
+
securityId: AUXLN
|
11
|
+
considerationCurrency: EUR
|
12
|
+
buyPrices:
|
13
|
+
price:
|
14
|
+
actionIndicator: B
|
15
|
+
quantity: '0.206'
|
16
|
+
limit: '32132'
|
17
|
+
sellPrices:
|
18
|
+
price:
|
19
|
+
actionIndicator: S
|
20
|
+
quantity: '0.019'
|
21
|
+
limit: '32193'
|
22
|
+
- securityClassNarrative: GOLD
|
23
|
+
securityId: AUXLN
|
24
|
+
considerationCurrency: GBP
|
25
|
+
buyPrices:
|
26
|
+
price:
|
27
|
+
actionIndicator: B
|
28
|
+
quantity: '0.598'
|
29
|
+
limit: '28077'
|
30
|
+
sellPrices:
|
31
|
+
price:
|
32
|
+
actionIndicator: S
|
33
|
+
quantity: '0.11'
|
34
|
+
limit: '28107'
|
35
|
+
- securityClassNarrative: GOLD
|
36
|
+
securityId: AUXLN
|
37
|
+
considerationCurrency: USD
|
38
|
+
buyPrices:
|
39
|
+
price:
|
40
|
+
actionIndicator: B
|
41
|
+
quantity: '0.01'
|
42
|
+
limit: '45551'
|
43
|
+
sellPrices:
|
44
|
+
price:
|
45
|
+
actionIndicator: S
|
46
|
+
quantity: '0.018'
|
47
|
+
limit: '45642'
|
48
|
+
- securityClassNarrative: GOLD
|
49
|
+
securityId: AUXNY
|
50
|
+
considerationCurrency: EUR
|
51
|
+
buyPrices:
|
52
|
+
price:
|
53
|
+
actionIndicator: B
|
54
|
+
quantity: '0.019'
|
55
|
+
limit: '32121'
|
56
|
+
sellPrices:
|
57
|
+
price:
|
58
|
+
actionIndicator: S
|
59
|
+
quantity: '0.019'
|
60
|
+
limit: '32186'
|
61
|
+
- securityClassNarrative: GOLD
|
62
|
+
securityId: AUXNY
|
63
|
+
considerationCurrency: GBP
|
64
|
+
buyPrices:
|
65
|
+
price:
|
66
|
+
actionIndicator: B
|
67
|
+
quantity: '0.015'
|
68
|
+
limit: '28053'
|
69
|
+
sellPrices:
|
70
|
+
price:
|
71
|
+
actionIndicator: S
|
72
|
+
quantity: '0.015'
|
73
|
+
limit: '28110'
|
74
|
+
- securityClassNarrative: GOLD
|
75
|
+
securityId: AUXNY
|
76
|
+
considerationCurrency: USD
|
77
|
+
buyPrices:
|
78
|
+
price:
|
79
|
+
actionIndicator: B
|
80
|
+
quantity: '0.016'
|
81
|
+
limit: '45541'
|
82
|
+
sellPrices:
|
83
|
+
price:
|
84
|
+
actionIndicator: S
|
85
|
+
quantity: '0.016'
|
86
|
+
limit: '45633'
|
87
|
+
- securityClassNarrative: GOLD
|
88
|
+
securityId: AUXZU
|
89
|
+
considerationCurrency: EUR
|
90
|
+
buyPrices:
|
91
|
+
price:
|
92
|
+
actionIndicator: B
|
93
|
+
quantity: '0.35'
|
94
|
+
limit: '32170'
|
95
|
+
sellPrices:
|
96
|
+
price:
|
97
|
+
actionIndicator: S
|
98
|
+
quantity: '0.988'
|
99
|
+
limit: '32207'
|
100
|
+
- securityClassNarrative: GOLD
|
101
|
+
securityId: AUXZU
|
102
|
+
considerationCurrency: GBP
|
103
|
+
buyPrices:
|
104
|
+
price:
|
105
|
+
actionIndicator: B
|
106
|
+
quantity: '0.1'
|
107
|
+
limit: '28100'
|
108
|
+
sellPrices:
|
109
|
+
price:
|
110
|
+
actionIndicator: S
|
111
|
+
quantity: '0.019'
|
112
|
+
limit: '28127'
|
113
|
+
- securityClassNarrative: GOLD
|
114
|
+
securityId: AUXZU
|
115
|
+
considerationCurrency: USD
|
116
|
+
buyPrices:
|
117
|
+
price:
|
118
|
+
actionIndicator: B
|
119
|
+
quantity: '0.198'
|
120
|
+
limit: '45620'
|
121
|
+
sellPrices:
|
122
|
+
price:
|
123
|
+
actionIndicator: S
|
124
|
+
quantity: '0.017'
|
125
|
+
limit: '45662'
|
126
|
+
- securityClassNarrative: SILVER
|
127
|
+
securityId: AGXLN
|
128
|
+
considerationCurrency: EUR
|
129
|
+
buyPrices:
|
130
|
+
price:
|
131
|
+
actionIndicator: B
|
132
|
+
quantity: '0.968'
|
133
|
+
limit: '804'
|
134
|
+
sellPrices:
|
135
|
+
price:
|
136
|
+
actionIndicator: S
|
137
|
+
quantity: '1.339'
|
138
|
+
limit: '807'
|
139
|
+
- securityClassNarrative: SILVER
|
140
|
+
securityId: AGXLN
|
141
|
+
considerationCurrency: GBP
|
142
|
+
buyPrices:
|
143
|
+
price:
|
144
|
+
actionIndicator: B
|
145
|
+
quantity: '1.367'
|
146
|
+
limit: '700'
|
147
|
+
sellPrices:
|
148
|
+
price:
|
149
|
+
actionIndicator: S
|
150
|
+
quantity: '185.62'
|
151
|
+
limit: '702'
|
152
|
+
- securityClassNarrative: SILVER
|
153
|
+
securityId: AGXLN
|
154
|
+
considerationCurrency: USD
|
155
|
+
buyPrices:
|
156
|
+
price:
|
157
|
+
actionIndicator: B
|
158
|
+
quantity: '0.833'
|
159
|
+
limit: '1139'
|
160
|
+
sellPrices:
|
161
|
+
price:
|
162
|
+
actionIndicator: S
|
163
|
+
quantity: '2.141'
|
164
|
+
limit: '1142'
|