bitex-bitstamp 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +2 -0
  3. data/.ruby-gemset +1 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile +27 -0
  6. data/Gemfile.lock +126 -0
  7. data/LICENSE.txt +20 -0
  8. data/README.md +96 -0
  9. data/Rakefile +55 -0
  10. data/VERSION +1 -0
  11. data/bitstamp.gemspec +93 -0
  12. data/lib/bitstamp.rb +107 -0
  13. data/lib/bitstamp/collection.rb +30 -0
  14. data/lib/bitstamp/helper.rb +19 -0
  15. data/lib/bitstamp/model.rb +29 -0
  16. data/lib/bitstamp/net.rb +43 -0
  17. data/lib/bitstamp/orders.rb +71 -0
  18. data/lib/bitstamp/ticker.rb +16 -0
  19. data/lib/bitstamp/transactions.rb +43 -0
  20. data/spec/bitstamp_spec.rb +87 -0
  21. data/spec/collection_spec.rb +12 -0
  22. data/spec/fixtures/vcr_cassettes/bitstamp/balance.yml +63 -0
  23. data/spec/fixtures/vcr_cassettes/bitstamp/order_book.yml +1910 -0
  24. data/spec/fixtures/vcr_cassettes/bitstamp/orders/all.yml +62 -0
  25. data/spec/fixtures/vcr_cassettes/bitstamp/orders/buy.yml +62 -0
  26. data/spec/fixtures/vcr_cassettes/bitstamp/orders/sell/failure.yml +60 -0
  27. data/spec/fixtures/vcr_cassettes/bitstamp/ticker.yml +63 -0
  28. data/spec/fixtures/vcr_cassettes/bitstamp/transactions.yml +244 -0
  29. data/spec/fixtures/vcr_cassettes/bitstamp/unconfirmed_user_deposits.yml +72 -0
  30. data/spec/fixtures/vcr_cassettes/bitstamp/user_transactions/all.yml +223 -0
  31. data/spec/fixtures/vcr_cassettes/bitstamp/withdraw_bitcoins/failure.yml +145 -0
  32. data/spec/orders_spec.rb +40 -0
  33. data/spec/spec_helper.rb +31 -0
  34. data/spec/support/bitstamp_setup.rb +19 -0
  35. data/spec/support/vcr.rb +15 -0
  36. data/spec/transactions_spec.rb +32 -0
  37. metadata +178 -0
@@ -0,0 +1,72 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.bitstamp.net/api/unconfirmed_btc/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: key=BITSTAMP_KEY&nonce=13950737097883&signature=EA9ACED64B8F902D9AD63CB7C4D4DF87385A8F4925DCB0445C6A8B75099BE23B
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: !binary |-
14
+ T0s=
15
+ headers:
16
+ !binary "RGF0ZQ==":
17
+ - !binary |-
18
+ TW9uLCAxNyBNYXIgMjAxNCAxNjoyODozMCBHTVQ=
19
+ !binary "U2VydmVy":
20
+ - !binary |-
21
+ QXBhY2hl
22
+ !binary "Q29udGVudC1MYW5ndWFnZQ==":
23
+ - !binary |-
24
+ ZW4=
25
+ !binary "RXhwaXJlcw==":
26
+ - !binary |-
27
+ TW9uLCAxNyBNYXIgMjAxNCAxNjoyODozMCBHTVQ=
28
+ !binary "VmFyeQ==":
29
+ - !binary |-
30
+ QWNjZXB0LUxhbmd1YWdl
31
+ !binary "Q2FjaGUtQ29udHJvbA==":
32
+ - !binary |-
33
+ bWF4LWFnZT0w
34
+ !binary "TGFzdC1Nb2RpZmllZA==":
35
+ - !binary |-
36
+ TW9uLCAxNyBNYXIgMjAxNCAxNjoyODozMCBHTVQ=
37
+ !binary "Q29ubmVjdGlvbg==":
38
+ - !binary |-
39
+ Y2xvc2U=
40
+ !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
41
+ - !binary |-
42
+ Y2h1bmtlZA==
43
+ !binary "Q29udGVudC1UeXBl":
44
+ - !binary |-
45
+ YXBwbGljYXRpb24vanNvbg==
46
+ !binary "U2V0LUNvb2tpZQ==":
47
+ - !binary |-
48
+ aW5jYXBfc2VzXzQ3Xzk5MDI1PWx0SGxLa3RxMnl1KzZBbTJTZnVtQUswaUox
49
+ TUFBQUFBZ0dGV1FRYWFENC90TCt1MlNEdGdvUT09OyBwYXRoPS87IERvbWFp
50
+ bj0uYml0c3RhbXAubmV0
51
+ - !binary |-
52
+ bmxiaV85OTAyNT1nSlJSTHZodVpXOE9KdllsK2RsNnZRQUFBQUNNV1hLZGdR
53
+ RjNSbHhYT2ppcmVZRTg7IHBhdGg9LzsgRG9tYWluPS5iaXRzdGFtcC5uZXQ=
54
+ - !binary |-
55
+ dmlzaWRfaW5jYXBfOTkwMjU9Wkt5c1dqYUJRMkczdU5zamplTGdkcTBpSjFN
56
+ QUFBQUFRVUlQQUFBQUFBQ0xHK2JlYUlRRVRVL2w0VEdTQXRWVzsgZXhwaXJl
57
+ cz1XZWQsIDE2IE1hciAyMDE2IDE0OjE3OjAzIEdNVDsgcGF0aD0vOyBEb21h
58
+ aW49LmJpdHN0YW1wLm5ldA==
59
+ !binary "WC1JaW5mbw==":
60
+ - !binary |-
61
+ NS05NTM1NjgyNC05NTM1Njg5NyBOTk5ZIENUKDQ0IDM3IDApIFJUKDEzOTUw
62
+ NzM3MDk0MDAgMjMwKSBxKDAgMCAxIDApIHIoMSAyKSBVNg==
63
+ !binary "WC1DZG4=":
64
+ - !binary |-
65
+ SW5jYXBzdWxh
66
+ body:
67
+ encoding: ASCII-8BIT
68
+ string: !binary |-
69
+ W10=
70
+ http_version:
71
+ recorded_at: Mon, 17 Mar 2014 16:28:30 GMT
72
+ recorded_with: VCR 2.6.0
@@ -0,0 +1,223 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.bitstamp.net/api/v2/user_transactions/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: key=BITSTAMP_KEY&nonce=1380238185&signature=7CBA96CEB133CF1E40EB223B8EE85696D75FFFB2AF8DFF9052F9F6651F829C2A&timedelta=3600
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: !binary |-
14
+ T0s=
15
+ headers:
16
+ !binary "U2VydmVy":
17
+ - !binary |-
18
+ Y2xvdWRmbGFyZS1uZ2lueA==
19
+ !binary "RGF0ZQ==":
20
+ - !binary |-
21
+ VGh1LCAyNiBTZXAgMjAxMyAyMzoyOTo0NiBHTVQ=
22
+ !binary "Q29udGVudC1UeXBl":
23
+ - !binary |-
24
+ YXBwbGljYXRpb24vanNvbg==
25
+ !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
26
+ - !binary |-
27
+ Y2h1bmtlZA==
28
+ !binary "Q29ubmVjdGlvbg==":
29
+ - !binary |-
30
+ a2VlcC1hbGl2ZQ==
31
+ !binary "U2V0LUNvb2tpZQ==":
32
+ - !binary |-
33
+ X19jZmR1aWQ9ZDg0ODRmMzI3NTJiOTlmMGMzNzI0YWE1YjNkYjczNjA2MTM4
34
+ MDIzODE4NTY4MzsgZXhwaXJlcz1Nb24sIDIzLURlYy0yMDE5IDIzOjUwOjAw
35
+ IEdNVDsgcGF0aD0vOyBkb21haW49LmJpdHN0YW1wLm5ldA==
36
+ !binary "Q29udGVudC1MYW5ndWFnZQ==":
37
+ - !binary |-
38
+ ZW4=
39
+ !binary "RXhwaXJlcw==":
40
+ - !binary |-
41
+ VGh1LCAyNiBTZXAgMjAxMyAyMzoyOTo0NiBHTVQ=
42
+ !binary "VmFyeQ==":
43
+ - !binary |-
44
+ QWNjZXB0LUxhbmd1YWdl
45
+ !binary "Q2FjaGUtQ29udHJvbA==":
46
+ - !binary |-
47
+ bWF4LWFnZT0w
48
+ !binary "TGFzdC1Nb2RpZmllZA==":
49
+ - !binary |-
50
+ VGh1LCAyNiBTZXAgMjAxMyAyMzoyOTo0NiBHTVQ=
51
+ !binary "Q2YtUmF5":
52
+ - !binary |-
53
+ YjQzYmNmNDg0NjQwMzIw
54
+ body:
55
+ encoding: ASCII-8BIT
56
+ string: !binary |-
57
+ W3sidXNkIjogIjAuMDAiLCAiYnRjIjogIi0zLjAwNzgxMTI0IiwgImJ0Y191
58
+ c2QiOiAiMC4wMCIsICJvcmRlcl9pZCI6IG51bGwsICJmZWUiOiAiMC4wMCIs
59
+ ICJ0eXBlIjogMSw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MDAwMDAiLCAiYnRjX3Vz
208
+ ZCI6ICIwLjAwIiwgIm9yZGVyX2lkIjogbnVsbCwgImZlZSI6ICIxNS4wMCIs
209
+ ICJ0eXBlIjogMCwgImlkIjogMTMzOTA4NCwgImRhdGV0aW1lIjogIjIwMTMt
210
+ MDktMDkgMTA6NDQ6MzQifSwgeyJ1c2QiOiAiMC4wMCIsICJidGMiOiAiLTku
211
+ NTUyNTM0MTEiLCAiYnRjX3VzZCI6ICIwLjAwIiwgIm9yZGVyX2lkIjogbnVs
212
+ bCwgImZlZSI6ICIwLjAwIiwgInR5cGUiOiAxLCAiaWQiOiAxMjIwOTIwLCAi
213
+ ZGF0ZXRpbWUiOiAiMjAxMy0wOC0xOSAyMjowNTowMyJ9LCB7InVzZCI6ICIt
214
+ OTgwLjA5IiwgImJ0YyI6ICI5LjU1MjUzNDExIiwgImJ0Y191c2QiOiAiMTAy
215
+ LjYwIiwgIm9yZGVyX2lkIjogbnVsbCwgImZlZSI6ICI0LjkxIiwgInR5cGUi
216
+ OiAyLCAiaWQiOiAxMjIwODk2LCAiZGF0ZXRpbWUiOiAiMjAxMy0wOC0xOSAy
217
+ MjowMDowOCJ9LCB7InVzZCI6ICIxMDAwLjAwIiwgImJ0YyI6ICIwLjAwMDAw
218
+ MDAwIiwgImJ0Y191c2QiOiAiMC4wMCIsICJvcmRlcl9pZCI6IG51bGwsICJm
219
+ ZWUiOiAiMTUuMDAiLCAidHlwZSI6IDAsICJpZCI6IDEyMTgzODUsICJkYXRl
220
+ dGltZSI6ICIyMDEzLTA4LTE5IDEzOjA0OjM5In1d
221
+ http_version:
222
+ recorded_at: Thu, 26 Sep 2013 23:29:46 GMT
223
+ recorded_with: VCR 2.6.0
@@ -0,0 +1,145 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.bitstamp.net/api/bitcoin_withdrawal/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: address=17Vr8d1yWrA226QNYZLDwaG4vDMUEaT9t5&amount=100&key=BITSTAMP_KEY&nonce=13950683899510&signature=0644D03D0D4FF3DEA6C2A4DF55C371930A2BC9BCE5D56DD9C151AE2014E2F0EF
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: !binary |-
14
+ T0s=
15
+ headers:
16
+ !binary "RGF0ZQ==":
17
+ - !binary |-
18
+ TW9uLCAxNyBNYXIgMjAxNCAxNDo1OTo1MCBHTVQ=
19
+ !binary "U2VydmVy":
20
+ - !binary |-
21
+ QXBhY2hl
22
+ !binary "Q29udGVudC1MYW5ndWFnZQ==":
23
+ - !binary |-
24
+ ZW4=
25
+ !binary "RXhwaXJlcw==":
26
+ - !binary |-
27
+ TW9uLCAxNyBNYXIgMjAxNCAxNDo1OTo1MSBHTVQ=
28
+ !binary "VmFyeQ==":
29
+ - !binary |-
30
+ QWNjZXB0LUxhbmd1YWdl
31
+ !binary "Q2FjaGUtQ29udHJvbA==":
32
+ - !binary |-
33
+ bWF4LWFnZT0w
34
+ !binary "TGFzdC1Nb2RpZmllZA==":
35
+ - !binary |-
36
+ TW9uLCAxNyBNYXIgMjAxNCAxNDo1OTo1MSBHTVQ=
37
+ !binary "Q29ubmVjdGlvbg==":
38
+ - !binary |-
39
+ Y2xvc2U=
40
+ !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
41
+ - !binary |-
42
+ Y2h1bmtlZA==
43
+ !binary "Q29udGVudC1UeXBl":
44
+ - !binary |-
45
+ YXBwbGljYXRpb24vanNvbg==
46
+ !binary "U2V0LUNvb2tpZQ==":
47
+ - !binary |-
48
+ aW5jYXBfc2VzXzQ3Xzk5MDI1PThwUm5iQUdWZTFPNkpPaTFTZnVtQU9ZTkox
49
+ TUFBQUFBQXFtSkQ1YWpxZkJXQjB4dDBzZlBKZz09OyBwYXRoPS87IERvbWFp
50
+ bj0uYml0c3RhbXAubmV0
51
+ - !binary |-
52
+ bmxiaV85OTAyNT1zSDhvYitnYmtoOFJ5cFByK2RsNnZRQUFBQUFhQXUxMWNL
53
+ T0xodkw1bDFaYnpUZmE7IHBhdGg9LzsgRG9tYWluPS5iaXRzdGFtcC5uZXQ=
54
+ - !binary |-
55
+ dmlzaWRfaW5jYXBfOTkwMjU9L0VpSGtHSnZUQnVzTTBCMnJZMlE4T1lOSjFN
56
+ QUFBQUFRVUlQQUFBQUFBRE1EeEg1VE8ydGVENmlrcmR6b3RqYTsgZXhwaXJl
57
+ cz1XZWQsIDE2IE1hciAyMDE2IDE0OjE3OjAzIEdNVDsgcGF0aD0vOyBEb21h
58
+ aW49LmJpdHN0YW1wLm5ldA==
59
+ !binary "WC1JaW5mbw==":
60
+ - !binary |-
61
+ NS05Mzg1NjE0MC05Mzg1NjIxMiBOTk5ZIENUKDM1IDM1IDApIFJUKDEzOTUw
62
+ NjgzODk5MDkgMjY2KSBxKDAgMCAxIC0xKSByKDEgMikgVTY=
63
+ !binary "WC1DZG4=":
64
+ - !binary |-
65
+ SW5jYXBzdWxh
66
+ body:
67
+ encoding: ASCII-8BIT
68
+ string: !binary |-
69
+ eyJlcnJvciI6IHsiYW1vdW50IjogWyJZb3UgaGF2ZSBvbmx5IDAgQlRDIGF2
70
+ YWlsYWJsZS4gQ2hlY2sgeW91ciBhY2NvdW50IGJhbGFuY2UgZm9yIGRldGFp
71
+ bHMuIl19fQ==
72
+ http_version:
73
+ recorded_at: Mon, 17 Mar 2014 14:59:50 GMT
74
+ - request:
75
+ method: post
76
+ uri: https://www.bitstamp.net/api/bitcoin_withdrawal/
77
+ body:
78
+ encoding: US-ASCII
79
+ string: address=17Vr8d1yWrA226QNYZLDwaG4vDMUEaT9t5&amount=100&key=BITSTAMP_KEY&nonce=13950683908946&signature=3F64B8F96F1CE4CCC76271862FED88A2DEC018D5B54CBC46FDF6521D5C2D4D14
80
+ headers: {}
81
+ response:
82
+ status:
83
+ code: 200
84
+ message: !binary |-
85
+ T0s=
86
+ headers:
87
+ !binary "RGF0ZQ==":
88
+ - !binary |-
89
+ TW9uLCAxNyBNYXIgMjAxNCAxNDo1OTo1MSBHTVQ=
90
+ !binary "U2VydmVy":
91
+ - !binary |-
92
+ QXBhY2hl
93
+ !binary "Q29udGVudC1MYW5ndWFnZQ==":
94
+ - !binary |-
95
+ ZW4=
96
+ !binary "RXhwaXJlcw==":
97
+ - !binary |-
98
+ TW9uLCAxNyBNYXIgMjAxNCAxNDo1OTo1MSBHTVQ=
99
+ !binary "VmFyeQ==":
100
+ - !binary |-
101
+ QWNjZXB0LUxhbmd1YWdl
102
+ !binary "Q2FjaGUtQ29udHJvbA==":
103
+ - !binary |-
104
+ bWF4LWFnZT0w
105
+ !binary "TGFzdC1Nb2RpZmllZA==":
106
+ - !binary |-
107
+ TW9uLCAxNyBNYXIgMjAxNCAxNDo1OTo1MSBHTVQ=
108
+ !binary "Q29ubmVjdGlvbg==":
109
+ - !binary |-
110
+ Y2xvc2U=
111
+ !binary "VHJhbnNmZXItRW5jb2Rpbmc=":
112
+ - !binary |-
113
+ Y2h1bmtlZA==
114
+ !binary "Q29udGVudC1UeXBl":
115
+ - !binary |-
116
+ YXBwbGljYXRpb24vanNvbg==
117
+ !binary "U2V0LUNvb2tpZQ==":
118
+ - !binary |-
119
+ aW5jYXBfc2VzXzQ3Xzk5MDI1PSswY3pOVjJIU2kycEplaTFTZnVtQU9ZTkox
120
+ TUFBQUFBcTZzbkV2Si8rMTRvNkNXU2FwQmdXUT09OyBwYXRoPS87IERvbWFp
121
+ bj0uYml0c3RhbXAubmV0
122
+ - !binary |-
123
+ bmxiaV85OTAyNT1YY2ZXWmJhaHBuWit1WlFjK2RsNnZRQUFBQUJJRE1LNk1k
124
+ Q2RZNURHc3lNNVE2akE7IHBhdGg9LzsgRG9tYWluPS5iaXRzdGFtcC5uZXQ=
125
+ - !binary |-
126
+ dmlzaWRfaW5jYXBfOTkwMjU9T2N1S085a09RaCsvYlVOVUlVSWF5dVlOSjFN
127
+ QUFBQUFRVUlQQUFBQUFBQVM5TE9rSFp2dHQ1UW1HSXVyQjNzbDsgZXhwaXJl
128
+ cz1XZWQsIDE2IE1hciAyMDE2IDE0OjE3OjAwIEdNVDsgcGF0aD0vOyBEb21h
129
+ aW49LmJpdHN0YW1wLm5ldA==
130
+ !binary "WC1JaW5mbw==":
131
+ - !binary |-
132
+ Ni0xNTU2MjAxOTktMTU1NjIwMjc2IE5OTlkgQ1QoMzQgMzYgMCkgUlQoMTM5
133
+ NTA2ODM5MDQwNiAxODkpIHEoMCAwIDEgLTEpIHIoMSAyKSBVNg==
134
+ !binary "WC1DZG4=":
135
+ - !binary |-
136
+ SW5jYXBzdWxh
137
+ body:
138
+ encoding: ASCII-8BIT
139
+ string: !binary |-
140
+ eyJlcnJvciI6IHsiYW1vdW50IjogWyJZb3UgaGF2ZSBvbmx5IDAgQlRDIGF2
141
+ YWlsYWJsZS4gQ2hlY2sgeW91ciBhY2NvdW50IGJhbGFuY2UgZm9yIGRldGFp
142
+ bHMuIl19fQ==
143
+ http_version:
144
+ recorded_at: Mon, 17 Mar 2014 14:59:51 GMT
145
+ recorded_with: VCR 2.6.0
@@ -0,0 +1,40 @@
1
+ require 'spec_helper'
2
+
3
+ describe Bitstamp::Orders do
4
+ before { setup_bitstamp }
5
+
6
+ describe :all, vcr: {cassette_name: 'bitstamp/orders/all'} do
7
+ subject { Bitstamp.orders.all }
8
+ it { should be_kind_of Array }
9
+ describe "first order" do
10
+ subject { Bitstamp.orders.all.first }
11
+ its(:price) { should == "1.01" }
12
+ its(:amount) { should == "1.00000000" }
13
+ its(:type) { should == 0 }
14
+ its(:datetime) { should == "2013-09-26 23:15:04" }
15
+ end
16
+ end
17
+
18
+ describe :sell do
19
+ context "no permission found", vcr: {cassette_name: 'bitstamp/orders/sell/failure'} do
20
+ subject { Bitstamp.orders.sell(:amount => 1, :price => 1000) }
21
+ it { should be_kind_of Bitstamp::Order }
22
+ its(:error) { should == "No permission found" }
23
+ end
24
+ # context "bitcoins available", vcr: {cassette_name: 'bitstamp/orders/sell/success'} do
25
+ # subject { Bitstamp.orders.sell(:amount => 1, :price => 1000) }
26
+ # xit { should be_kind_of Bitstamp::Order }
27
+ # its(:error) { should be_nil }
28
+ # end
29
+ end
30
+
31
+ describe :buy, vcr: {cassette_name: 'bitstamp/orders/buy'} do
32
+ subject { Bitstamp.orders.buy(:amount => 1, :price => 1.01) }
33
+ it { should be_kind_of Bitstamp::Order }
34
+ its(:price) { should == "1.01" }
35
+ its(:amount) { should == "1" }
36
+ its(:type) { should == 0 }
37
+ its(:datetime) { should == "2013-09-26 23:26:56.849475" }
38
+ its(:error) { should be_nil }
39
+ end
40
+ end