quadrigacx 0.0.4 → 0.1.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/Gemfile.lock +1 -1
- data/README.md +1 -5
- data/lib/quadrigacx/client/private.rb +11 -0
- data/lib/quadrigacx/version.rb +1 -1
- data/spec/client_spec.rb +9 -0
- data/spec/fixtures/vcr_cassettes/withdraw.yml +49 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7466cb111935394690ea7070e276d56ca2c5e28b
|
4
|
+
data.tar.gz: e9fe03190ac303a491ec9dce6282b18f444e4397
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e9443a91170fef6cd62e65a857c67327012a4829d17e95cb71c751c28c1b7fe060ba801bcd9307ff586c5ed919caa0dce3e641c89464891cdf12904b666c542
|
7
|
+
data.tar.gz: 483529f455a9a96d1d3879dbf3bd5ec1d6bda40119508c010db88377cf61d38fd046a58d2f5568c10d3bf7230afd62a226999da824a83ce9d06cf73724f53515
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -24,8 +24,19 @@ module QuadrigaCX
|
|
24
24
|
request(:post, '/buy', params)
|
25
25
|
end
|
26
26
|
|
27
|
+
# Cancels an order
|
28
|
+
#
|
29
|
+
# id – a 64 characters long hexadecimal string taken from the list of orders
|
27
30
|
def cancel params={}
|
28
31
|
request(:post, '/cancel_order', params)
|
29
32
|
end
|
33
|
+
|
34
|
+
# Withdraw bitcoins
|
35
|
+
#
|
36
|
+
# amount – The amount to withdraw
|
37
|
+
# address – The bitcoin address we will send the amount to
|
38
|
+
def withdraw params={}
|
39
|
+
request(:post, '/bitcoin_withdrawal', params)
|
40
|
+
end
|
30
41
|
end
|
31
42
|
end
|
data/lib/quadrigacx/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -69,5 +69,14 @@ describe QuadrigaCX::Client do
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
72
|
+
|
73
|
+
describe '#withdraw' do
|
74
|
+
it 'withdraws bitcoins' do
|
75
|
+
VCR.use_cassette('withdraw') do
|
76
|
+
response = client.withdraw(amount: '0.01', address: '1FAs1ywa3pqS6S5mvypXjCtHAzwCkymNUX')
|
77
|
+
expect(response).to eq('"ok"')
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
72
81
|
end
|
73
82
|
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.quadrigacx.com/v2/bitcoin_withdrawal
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"amount":"0.01","address":"1FAs1ywa3pqS6S5mvypXjCtHAzwCkymNUX","key":"kOnVDjfPPh","nonce":"1421689984304","signature":"c87d5b1122f81e09a7ccaa519dba4e1eb4496043d8c558e116219a88d84bf6d7"}'
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
Content-Length:
|
17
|
+
- '186'
|
18
|
+
User-Agent:
|
19
|
+
- Ruby
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- cloudflare-nginx
|
27
|
+
Date:
|
28
|
+
- Mon, 19 Jan 2015 17:53:02 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Content-Length:
|
32
|
+
- '4'
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Set-Cookie:
|
36
|
+
- __cfduid=d080ab90a09d676df8d538374e58fbcfc1421689982; expires=Tue, 19-Jan-16
|
37
|
+
17:53:02 GMT; path=/; domain=.quadrigacx.com; HttpOnly
|
38
|
+
- ci_session=DTQGMgVhU2kOIQB%2FXzpWZ1o%2BAT5beQYgVDEMe1V3V2lfbFBvUA4IbgE9VnoBa1QnAG4LNAJvU2lTJQY3Wj9dPFUzBTEGNFQ2AW0DZVE2DTMNYgZrBW1TYQ5vADVfYlZkWmoBN1s4BmNUbQxtVWFXNF9iUDBQZAgwAW9WegFrVCcAbgs2Am1TaVMlBmpaKl1XVTQFZQYzVHEBOAMhUSMNIA1uBnsFblNiDmkANl8iVmdaOQE8W3UGZVRnDCZVNVc0Xy1QM1BgCDEBe1ZjASNUbgBlCzcCZ1NxU3IGcFo%2FXXpVCgVgBjBUZgEzAyZRcg05DSYGMgVgU2kOeABeX3VWNFp3ASZbYAYgVG4MOVU3VzpfIVBtUDAIdAEtVgcBMVQ3ACALbgIrUzpTcwZ6WnhdM1U8BTsGZlQ3AW8DY1FmDToNbAYxBWxTYQ5hAH9fOlZvWjQBJlsuBiBUMQx6VVtXZF9iUHVQMAglAWJWKwFqVGQAbgslAn9TaFN6;
|
39
|
+
expires=Mon, 19-Jan-2015 19:53:02 GMT; Max-Age=7200; path=/
|
40
|
+
X-Frame-Options:
|
41
|
+
- SAMEORIGIN
|
42
|
+
Cf-Ray:
|
43
|
+
- 1ab4e3b6223c052e-YYZ
|
44
|
+
body:
|
45
|
+
encoding: UTF-8
|
46
|
+
string: '"ok"'
|
47
|
+
http_version:
|
48
|
+
recorded_at: Mon, 19 Jan 2015 17:53:05 GMT
|
49
|
+
recorded_with: VCR 2.9.3
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quadrigacx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maros Hluska
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- spec/fixtures/vcr_cassettes/limit_buy.yml
|
136
136
|
- spec/fixtures/vcr_cassettes/market_buy.yml
|
137
137
|
- spec/fixtures/vcr_cassettes/order_book.yml
|
138
|
+
- spec/fixtures/vcr_cassettes/withdraw.yml
|
138
139
|
- spec/spec_helper.rb
|
139
140
|
homepage: http://mhluska.com/
|
140
141
|
licenses:
|
@@ -167,4 +168,5 @@ test_files:
|
|
167
168
|
- spec/fixtures/vcr_cassettes/limit_buy.yml
|
168
169
|
- spec/fixtures/vcr_cassettes/market_buy.yml
|
169
170
|
- spec/fixtures/vcr_cassettes/order_book.yml
|
171
|
+
- spec/fixtures/vcr_cassettes/withdraw.yml
|
170
172
|
- spec/spec_helper.rb
|