binance-ruby 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/binance/api/version.rb +1 -1
- metadata +3 -16
- data/.circleci/config.yml +0 -51
- data/.env.example +0 -5
- data/.gitignore +0 -16
- data/.rspec +0 -2
- data/.travis.yml +0 -5
- data/Gemfile +0 -6
- data/LICENSE +0 -21
- data/LICENSE.txt +0 -21
- data/README.md +0 -106
- data/Rakefile +0 -6
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/binance-ruby.gemspec +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36b0291fb360c359bab2ce9d5c63218856380ccf
|
4
|
+
data.tar.gz: 605916d5cb2547285bb018bbda6a7318bc88b9e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6853df2c7650a80b3e1cf25e7b1d923faa9a35fcdd5fa83607378dd831d3c96dfdb5930727314d10b488c2ec24d6a86be11e5f2c5d1a4bf5dea598cf51941e14
|
7
|
+
data.tar.gz: 7f32b6d3e866652c3b8d0855959c0a4747f6d45bcb0eef50b7c9da306e00a3e16b86732ca4cccb3cecc8ddf595f326122df7bb45670579c95e88fd3e7d99f5c2
|
data/lib/binance/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: binance-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Peterson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -157,19 +157,6 @@ executables: []
|
|
157
157
|
extensions: []
|
158
158
|
extra_rdoc_files: []
|
159
159
|
files:
|
160
|
-
- ".circleci/config.yml"
|
161
|
-
- ".env.example"
|
162
|
-
- ".gitignore"
|
163
|
-
- ".rspec"
|
164
|
-
- ".travis.yml"
|
165
|
-
- Gemfile
|
166
|
-
- LICENSE
|
167
|
-
- LICENSE.txt
|
168
|
-
- README.md
|
169
|
-
- Rakefile
|
170
|
-
- bin/console
|
171
|
-
- bin/setup
|
172
|
-
- binance-ruby.gemspec
|
173
160
|
- lib/binance/api.rb
|
174
161
|
- lib/binance/api/account.rb
|
175
162
|
- lib/binance/api/configuration.rb
|
@@ -202,5 +189,5 @@ rubyforge_project:
|
|
202
189
|
rubygems_version: 2.5.2
|
203
190
|
signing_key:
|
204
191
|
specification_version: 4
|
205
|
-
summary: binance-ruby-0.1.
|
192
|
+
summary: binance-ruby-0.1.3
|
206
193
|
test_files: []
|
data/.circleci/config.yml
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
# Ruby CircleCI 2.0 configuration file
|
2
|
-
#
|
3
|
-
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
-
#
|
5
|
-
version: 2
|
6
|
-
jobs:
|
7
|
-
build:
|
8
|
-
docker:
|
9
|
-
# specify the version you desire here
|
10
|
-
- image: circleci/ruby:2.4.1-node-browsers
|
11
|
-
|
12
|
-
# Specify service dependencies here if necessary
|
13
|
-
# CircleCI maintains a library of pre-built images
|
14
|
-
# documented at https://circleci.com/docs/2.0/circleci-images/
|
15
|
-
# - image: circleci/postgres:9.4
|
16
|
-
|
17
|
-
working_directory: ~/binance-ruby
|
18
|
-
|
19
|
-
steps:
|
20
|
-
- checkout
|
21
|
-
|
22
|
-
# Download and cache dependencies
|
23
|
-
- restore_cache:
|
24
|
-
keys:
|
25
|
-
- v1-dependencies-{{ checksum "binance-ruby.gemspec" }}
|
26
|
-
# fallback to using the latest cache if no exact match is found
|
27
|
-
- v1-dependencies-
|
28
|
-
|
29
|
-
- run:
|
30
|
-
name: install dependencies
|
31
|
-
command: |
|
32
|
-
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
33
|
-
|
34
|
-
- save_cache:
|
35
|
-
paths:
|
36
|
-
- ./vendor/bundle
|
37
|
-
key: v1-dependencies-{{ checksum "binance-ruby.gemspec" }}
|
38
|
-
|
39
|
-
# run tests!
|
40
|
-
- run:
|
41
|
-
name: run tests
|
42
|
-
command: |
|
43
|
-
mkdir /tmp/test-results
|
44
|
-
bundle exec rspec --format progress
|
45
|
-
|
46
|
-
# collect reports
|
47
|
-
- store_test_results:
|
48
|
-
path: /tmp/test-results
|
49
|
-
- store_artifacts:
|
50
|
-
path: /tmp/test-results
|
51
|
-
destination: test-results
|
data/.env.example
DELETED
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2018 Jake Peterson
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2017 Jake Peterson
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,106 +0,0 @@
|
|
1
|
-
# Binance::Api [![Gem Version](https://badge.fury.io/rb/binance-ruby.svg)](https://badge.fury.io/rb/binance-ruby) [![Circle CI](https://circleci.com/gh/Jakenberg/binance-ruby.svg?style=shield)](https://circleci.com/gh/Jakenberg/binance-ruby) [![codecov](https://codecov.io/gh/Jakenberg/binance-ruby/branch/master/graph/badge.svg)](https://codecov.io/gh/Jakenberg/binance-ruby)
|
2
|
-
|
3
|
-
## Installation
|
4
|
-
|
5
|
-
Add this line to your application's Gemfile:
|
6
|
-
|
7
|
-
```ruby
|
8
|
-
gem 'binance-ruby'
|
9
|
-
```
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
Or install it yourself as:
|
16
|
-
|
17
|
-
$ gem install binance-ruby
|
18
|
-
|
19
|
-
## Setup
|
20
|
-
|
21
|
-
### Environment Variables
|
22
|
-
|
23
|
-
At minimum, you must configure the following environment variables:
|
24
|
-
|
25
|
-
```bash
|
26
|
-
BINANCE_API_KEY
|
27
|
-
BINANCE_SECRET_KEY
|
28
|
-
```
|
29
|
-
|
30
|
-
Additionally, Binance allows granular API key access based on the action being taken. For example, it is possible to use one API key for _only_ trade actions, while using another for withdrawal actions. You can configure this using any of the following keys:
|
31
|
-
|
32
|
-
```bash
|
33
|
-
BINANCE_READ_INFO_API_KEY
|
34
|
-
BINANCE_TRADING_API_KEY
|
35
|
-
BINANCE_WITHDRAWALS_API_KEY
|
36
|
-
```
|
37
|
-
|
38
|
-
If any one of these keys are not defined, `binance-ruby` will fallback to `BINANCE_API_KEY`.
|
39
|
-
|
40
|
-
## Usage
|
41
|
-
|
42
|
-
I highly recommend reading the [official Binance documentation](https://github.com/binance-exchange/binance-official-api-docs) before using this gem. Anything missed here is surely well explained there.
|
43
|
-
|
44
|
-
### Binance::Api
|
45
|
-
|
46
|
-
- [`candlesticks!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#klinecandlestick-data): Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.
|
47
|
-
- [`compressed_aggregate_trades!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#compressedaggregate-trades-list): Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will have the quantity aggregated.
|
48
|
-
- [`depth!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#order-book): Get your order book.
|
49
|
-
- [`exchange_info!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#exchange-information): Current exchange trading rules and symbol information.
|
50
|
-
- [`historical_trades!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#old-trade-lookup-market_data): Get older trades.
|
51
|
-
- [`ping!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#test-connectivity): Test connectivity to the Rest API.
|
52
|
-
- [`ticker!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#24hr-ticker-price-change-statistics): Price change statistics. **Careful** when accessing this with no symbol.
|
53
|
-
- [`time!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#check-server-time): Test connectivity to the Rest API and get the current server time.
|
54
|
-
- [`trades!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#recent-trades-list): Get recent trades (up to last 500).
|
55
|
-
|
56
|
-
### Binance::Api::Account
|
57
|
-
|
58
|
-
- [`info!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#account-information-user_data): Get current account information.
|
59
|
-
- [`trades!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#account-trade-list-user_data): Get trades for a specific account and symbol.
|
60
|
-
|
61
|
-
### Binance::Api::DataStream
|
62
|
-
|
63
|
-
- [`start!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#start-user-data-stream-user_stream): Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent.
|
64
|
-
- [`keepalive!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#keepalive-user-data-stream-user_stream): Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 30 minutes.
|
65
|
-
- [`stop!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#close-user-data-stream-user_stream): Close out a user data stream.
|
66
|
-
|
67
|
-
### Binance::Api::Order
|
68
|
-
|
69
|
-
- [`all!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#all-orders-user_data): Get all account orders; active, canceled, or filled.
|
70
|
-
- [`all_open!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#current-open-orders-user_data): Get all open orders on a symbol. **Careful** when accessing this with no symbol.
|
71
|
-
- [`cancel!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#cancel-order-trade): Cancel an active order.
|
72
|
-
- [`create!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#new-order--trade): Send in a new order. Use `test: true` for test orders.
|
73
|
-
- [`status!`](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#query-order-user_data): Check an order's status.
|
74
|
-
|
75
|
-
For more information, please refer to the [official Rest API documentation](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md) written by the Binance team.
|
76
|
-
|
77
|
-
## Author
|
78
|
-
|
79
|
-
[Jake Peterson](https://jakenberg.io)
|
80
|
-
|
81
|
-
I drink beer 😉
|
82
|
-
|
83
|
-
**BTC**: `1EZTj5rEaKE9dEBjR1wiismwma4XpXtLBz`
|
84
|
-
|
85
|
-
**ETH**: `0xf61195dcb1e89f139114e599cf1dd37dd8b7b96a`
|
86
|
-
|
87
|
-
**LTC**: `LL3Nf7CmLoFeLENSKN6WhgPNVuxjzgh2eV`
|
88
|
-
|
89
|
-
**BCH**: [Bcash. LOL](https://www.youtube.com/watch?v=oCOjCEth6xI)
|
90
|
-
|
91
|
-
## Development
|
92
|
-
|
93
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
94
|
-
|
95
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
96
|
-
|
97
|
-
## Contributing
|
98
|
-
|
99
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/jakenberg/binance-ruby.
|
100
|
-
|
101
|
-
### TODO
|
102
|
-
- Convert milliseconds to ruby DateTime.
|
103
|
-
|
104
|
-
## License
|
105
|
-
|
106
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "binance/ruby"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/binance-ruby.gemspec
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require "binance/api/version"
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "binance-ruby"
|
8
|
-
spec.version = Binance::Api::VERSION
|
9
|
-
spec.authors = ["Jake Peterson"]
|
10
|
-
spec.email = ["hello@jakenberg.io"]
|
11
|
-
|
12
|
-
spec.summary = "binance-ruby-#{Binance::Api::VERSION}"
|
13
|
-
spec.description = %q{Ruby wrapper for the Binance API.}
|
14
|
-
spec.homepage = "https://github.com/jakenberg/binance-ruby"
|
15
|
-
spec.license = "MIT"
|
16
|
-
|
17
|
-
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
-
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
-
if spec.respond_to?(:metadata)
|
20
|
-
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
21
|
-
else
|
22
|
-
raise "RubyGems 2.0 or newer is required to protect against " \
|
23
|
-
"public gem pushes."
|
24
|
-
end
|
25
|
-
|
26
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
27
|
-
f.match(%r{^(test|spec|features)/})
|
28
|
-
end
|
29
|
-
spec.bindir = "exe"
|
30
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
-
spec.require_paths = ["lib"]
|
32
|
-
|
33
|
-
spec.add_development_dependency "bundler", "~> 1.15"
|
34
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
35
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
36
|
-
spec.add_development_dependency "webmock", '~> 3.0'
|
37
|
-
spec.add_development_dependency 'pry', '~> 0.11.0'
|
38
|
-
spec.add_development_dependency 'dotenv-rails', '~> 2.2.0'
|
39
|
-
spec.add_development_dependency 'codecov', '~> 0.1'
|
40
|
-
|
41
|
-
spec.add_dependency 'awrence', '~> 1.0'
|
42
|
-
spec.add_dependency 'httparty', '~> 0.15'
|
43
|
-
spec.add_dependency 'activesupport-core-ext', '~> 4.0.0'
|
44
|
-
end
|