mexbt 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25fa8e7c779ae07ef6f22b81bfa259eebcc5659e
4
- data.tar.gz: 275a2668c6469ade0a0512472ce08dfd767310ac
3
+ metadata.gz: 5c86abf29dc32732c4613edd06fb285bdfa1a273
4
+ data.tar.gz: 58b4606c765d9b080fe6580cc543c49d2df040a0
5
5
  SHA512:
6
- metadata.gz: 106267fe0660c0fc2e953c30d3fa08af104ab8d932b2e0c83574ed55deef11b783b5d0d63389cf631a5f7e89644e950b7aea28e9498f7455efb21126b8b8f39f
7
- data.tar.gz: d65cc9be57cf4706e9091e5bc3a4e7ade89618139dae00e2a5a45598479d7984699ce1fe8a0ac27e42c770c52544eea9273f3f630b864efda5938f2520e81a69
6
+ metadata.gz: 70ae0cd1bd6a6ca62fdfcf904b14f0cd4db1eb767ee00f1ecd52d87322502cd18bdd66a43a31d572335604699d475ce48df3a08ad95cbe25608bbf99b1688a5c
7
+ data.tar.gz: df59b9c1ffc3064c2900abfbb546aeaacc1a2ba2d0b9a0cc2103851b7e017d34295b09f479869f6877b1573468839b51dd06ab0dc9800d03de64dd0531fe6e79
@@ -93,12 +93,8 @@ module Mexbt
93
93
  private
94
94
 
95
95
  def format_amount(amount)
96
- if sandbox
97
- # Horribly hack because sandbox only accepts 6 decimal places thanks to AP
98
- BigDecimal.new(amount, 15).round(6).to_f
99
- else
100
- amount
101
- end
96
+ # Horribly hack because sandbox only accepts 6 decimal places thanks to AP
97
+ BigDecimal.new(amount, 15).round(sandbox ? 6 : 8).to_s
102
98
  end
103
99
  end
104
100
  end
@@ -1,5 +1,4 @@
1
1
  require 'rest_client'
2
- require 'active_support/core_ext/hash/indifferent_access'
3
2
 
4
3
  module Mexbt
5
4
  module Client
@@ -57,4 +56,4 @@ module Mexbt
57
56
  ActiveSupport::HashWithIndifferentAccess.new(JSON.parse(res))
58
57
  end
59
58
  end
60
- end
59
+ end
@@ -1,3 +1,3 @@
1
1
  module Mexbt
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -29,7 +29,7 @@ describe Mexbt::Account do
29
29
 
30
30
  context "with per-instance authentication" do
31
31
 
32
- subject(:account) { Mexbt::Account.new(public_key: "62e78ef68b20bc1db55e56cd7cb675df", private_key: "b4bf685ab83a0a4017cdf471e4d410e1", user_id: "test@mexbt.com", sandbox: true) }
32
+ subject(:account) { Mexbt::Account.new(public_key: "b202ba1efcfd3dd1ceef0e7961d21c05", private_key: "0dca4a65faf9005c5743df92309747b2", user_id: "specs@mexbt.com", sandbox: true) }
33
33
 
34
34
  it "still works" do
35
35
  expect(account.info[:isAccepted]).to be true
@@ -43,9 +43,9 @@ describe Mexbt::Account do
43
43
 
44
44
  before do
45
45
  Mexbt.configure do |c|
46
- c.public_key = "62e78ef68b20bc1db55e56cd7cb675df"
47
- c.private_key = "b4bf685ab83a0a4017cdf471e4d410e1"
48
- c.user_id = "test@mexbt.com"
46
+ c.public_key = "b202ba1efcfd3dd1ceef0e7961d21c05"
47
+ c.private_key = "0dca4a65faf9005c5743df92309747b2"
48
+ c.user_id = "specs@mexbt.com"
49
49
  c.sandbox = true
50
50
  end
51
51
  end
@@ -76,6 +76,12 @@ describe Mexbt::Account do
76
76
  expect(res[:serverOrderId]).to be_a(Fixnum)
77
77
  end
78
78
 
79
+ it "rounds orders with more than 8 decimal places" do
80
+ res = account.create_order(amount: 0.12345678910, currency_pair: "BTCUSD")
81
+ expect(res[:isAccepted]).to be true
82
+ expect(res[:serverOrderId]).to be_a(Fixnum)
83
+ end
84
+
79
85
  it "allows creating limit orders" do
80
86
  res = account.create_order(type: :limit, price: 100, amount: 0.1234, currency_pair: "BTCUSD")
81
87
  expect(res[:isAccepted]).to be true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mexbt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - williamcoates
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-02 00:00:00.000000000 Z
11
+ date: 2015-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport