binance_client 1.2.0 → 2.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/CHANGELOG.md +25 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +4 -1
- data/README.md +10 -7
- data/lib/binance_client/client.rb +13 -1
- data/lib/binance_client/factories.rb +13 -0
- data/lib/binance_client/models/deposit.rb +31 -0
- data/lib/binance_client/models/deposit_address.rb +28 -0
- data/lib/binance_client/models/market.rb +53 -0
- data/lib/binance_client/models/market_filter.rb +25 -0
- data/lib/binance_client/models/rate_limit.rb +24 -0
- data/lib/binance_client/requests/account_request.rb +10 -0
- data/lib/binance_client/requests/authenticated_base_request.rb +9 -4
- data/lib/binance_client/requests/exchange_info_request.rb +10 -0
- data/lib/binance_client/requests/sub_account_deposit_address_request.rb +25 -0
- data/lib/binance_client/requests/sub_account_deposit_history_request.rb +36 -0
- data/lib/binance_client/responses/account_response.rb +29 -0
- data/lib/binance_client/responses/base_response.rb +6 -4
- data/lib/binance_client/responses/exchange_info_response.rb +30 -0
- data/lib/binance_client/responses/sub_account_deposit_address_response.rb +14 -0
- data/lib/binance_client/responses/sub_account_deposit_history_response.rb +11 -0
- data/lib/binance_client/version.rb +1 -1
- data/lib/binance_client.rb +18 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92d03cdb49a0580cae0efce1cbcaf3f908994f2959473801eccfcabb46cd8c1d
|
4
|
+
data.tar.gz: 8eadce8b6bdb99dad54e1e58724c65595f79a843006e13cc0c4618ee5d62bf88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f31e20576e0c83a044f2f59a3e4a5a8bddb0dfce7eab0a73494ef101dbfce4cefee7c3404b004bd3b1d1438f1accd155d151d819d4028405d9c36c2c10a4ab11
|
7
|
+
data.tar.gz: 7f24cd955d6a8e2ca3ab560b0f45900c514f12001e49e5cfcbfd206b49b24ad7a105111dbc1f673b8831f4091d01486fe6a97922ca0ce12c9dd8116cf6635c7d
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,31 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [2.1.0]
|
8
|
+
### Added
|
9
|
+
- `exchange_info` endpoint
|
10
|
+
- `sub_account_deposit_history` endpoint
|
11
|
+
|
12
|
+
## [2.0.0]
|
13
|
+
### Changed
|
14
|
+
- Remove `used_weight` from responses
|
15
|
+
|
16
|
+
### Added
|
17
|
+
- `recv_window` configuration to set `recvWindow`
|
18
|
+
- `#account` call to get the `/api/v3/account` info
|
19
|
+
|
20
|
+
### Added
|
21
|
+
- `used_weights` to responses
|
22
|
+
|
23
|
+
## [1.4.0] - 2021-12-09
|
24
|
+
### Added
|
25
|
+
- Add factories for use in app development
|
26
|
+
- Add `#sub_account_deposit_address`
|
27
|
+
|
28
|
+
## [1.3.0] - 2021-11-29
|
29
|
+
### Added
|
30
|
+
- Add proxy support
|
31
|
+
|
7
32
|
## [1.2.0] - 2021-11-26
|
8
33
|
### Added
|
9
34
|
- Allow easy access to the `used_weight` header in a response by calling `#used_weight(interval)`
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
binance_client (1.
|
4
|
+
binance_client (2.1.0)
|
5
5
|
activesupport
|
6
6
|
api_client_base (~> 1.11)
|
7
7
|
typhoeus
|
@@ -37,6 +37,8 @@ GEM
|
|
37
37
|
diff-lcs (1.4.4)
|
38
38
|
ethon (0.15.0)
|
39
39
|
ffi (>= 1.15.0)
|
40
|
+
factory_bot (6.2.0)
|
41
|
+
activesupport (>= 5.0.0)
|
40
42
|
ffi (1.15.4)
|
41
43
|
gem_config (0.3.2)
|
42
44
|
hashdiff (1.0.1)
|
@@ -91,6 +93,7 @@ PLATFORMS
|
|
91
93
|
|
92
94
|
DEPENDENCIES
|
93
95
|
binance_client!
|
96
|
+
factory_bot
|
94
97
|
pry-byebug
|
95
98
|
rake (~> 12.0)
|
96
99
|
rspec (~> 3.0)
|
data/README.md
CHANGED
@@ -39,6 +39,8 @@ client.book_ticker(symbol: "BTCETH")
|
|
39
39
|
client.order_book_depth(symbol: "BTCUSDT", limit: 100)
|
40
40
|
```
|
41
41
|
|
42
|
+
See `spec/acceptance` for all calls.
|
43
|
+
|
42
44
|
## Responses
|
43
45
|
The default representation of response data is a JSON hash
|
44
46
|
|
@@ -46,19 +48,16 @@ The default representation of response data is a JSON hash
|
|
46
48
|
You can set a hook to do application-specific things per request. This is useful when monitoring the rate limits:
|
47
49
|
|
48
50
|
```ruby
|
49
|
-
BinanceClient.
|
51
|
+
BinanceClient.configuration.after_response = DoSomethingAfterBinanceResponse
|
50
52
|
```
|
51
53
|
|
52
54
|
What you assign can be a proc -- it just needs to respond to `call` and accept the `BinanceClient` response object:
|
53
55
|
|
54
56
|
```ruby
|
55
|
-
class
|
57
|
+
class DoSomethingAfterBinanceResponse
|
56
58
|
|
57
|
-
def self.call(response)
|
58
|
-
|
59
|
-
if one_minute_weight > 1200
|
60
|
-
Rails.logger.info "Looks like we've hit the request limit!"
|
61
|
-
end
|
59
|
+
def self.call(request, response)
|
60
|
+
response.used_weights # Ruby hash of the headers of all the possible used weights
|
62
61
|
end
|
63
62
|
|
64
63
|
end
|
@@ -67,6 +66,10 @@ end
|
|
67
66
|
## Development
|
68
67
|
Edit the `config.yml.sample` with your own credentials for testing
|
69
68
|
|
69
|
+
## Factories
|
70
|
+
|
71
|
+
To make testing easier in your app, `require "binance_client/factories"` to get access to factories of the models.
|
72
|
+
|
70
73
|
## Contributing
|
71
74
|
|
72
75
|
Bug reports and pull requests are welcome on GitHub at https://github.com/bloom-solutions/binance_client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/bloom-solutions/binance_client/blob/master/CODE_OF_CONDUCT.md).
|
@@ -2,21 +2,33 @@ module BinanceClient
|
|
2
2
|
class Client
|
3
3
|
include APIClientBase::Client.module(default_opts: :default_opts)
|
4
4
|
|
5
|
+
api_action :account
|
5
6
|
api_action :system_status
|
6
7
|
api_action :account_snapshot
|
7
8
|
api_action :get_all
|
9
|
+
api_action :exchange_info
|
8
10
|
api_action :book_ticker
|
9
11
|
api_action :order_book_depth
|
10
12
|
api_action :sub_account_assets, args: [:email]
|
13
|
+
api_action :sub_account_deposit_address, args: [:email, :coin]
|
14
|
+
api_action :sub_account_deposit_history
|
11
15
|
|
12
16
|
attribute :host
|
13
17
|
attribute :api_key
|
14
18
|
attribute :api_secret
|
19
|
+
attribute :proxy
|
20
|
+
attribute :recv_window
|
15
21
|
|
16
22
|
private
|
17
23
|
|
18
24
|
def default_opts
|
19
|
-
{
|
25
|
+
{
|
26
|
+
host: host,
|
27
|
+
api_key: api_key,
|
28
|
+
api_secret: api_secret,
|
29
|
+
proxy: proxy,
|
30
|
+
recv_window: recv_window,
|
31
|
+
}
|
20
32
|
end
|
21
33
|
end
|
22
34
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
|
3
|
+
factory :binance_client_asset_balance, class: "BinanceClient::AssetBalance" do
|
4
|
+
sequence(:asset) { |n| "ASSET#{n}" }
|
5
|
+
free { rand(10_000) }
|
6
|
+
locked { rand(1_000) }
|
7
|
+
|
8
|
+
initialize_with do
|
9
|
+
new(asset: asset, free: free, locked: locked)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module BinanceClient
|
2
|
+
class Deposit
|
3
|
+
|
4
|
+
METHODS = %i[
|
5
|
+
sub_account_id
|
6
|
+
address
|
7
|
+
address_tag
|
8
|
+
amount
|
9
|
+
coin
|
10
|
+
insert_time
|
11
|
+
network
|
12
|
+
status
|
13
|
+
tx_id
|
14
|
+
source_address
|
15
|
+
confirm_times
|
16
|
+
].freeze
|
17
|
+
|
18
|
+
attr_reader :raw_hash
|
19
|
+
|
20
|
+
def initialize(raw_hash:)
|
21
|
+
@raw_hash = raw_hash
|
22
|
+
end
|
23
|
+
|
24
|
+
METHODS.each do |method_name|
|
25
|
+
define_method method_name do
|
26
|
+
raw_hash[method_name.to_s.camelcase(:lower)]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module BinanceClient
|
2
|
+
class DepositAddress
|
3
|
+
|
4
|
+
def self.new_from_raw(raw_hash)
|
5
|
+
args = raw_hash.each_with_object({}) do |(k, v), h|
|
6
|
+
h[k.underscore] = v
|
7
|
+
end
|
8
|
+
|
9
|
+
self.new(**args)
|
10
|
+
end
|
11
|
+
|
12
|
+
ATTRS = [
|
13
|
+
:address,
|
14
|
+
:coin,
|
15
|
+
:tag,
|
16
|
+
:url,
|
17
|
+
]
|
18
|
+
|
19
|
+
attr_accessor(*ATTRS)
|
20
|
+
|
21
|
+
def initialize(**kwargs)
|
22
|
+
kwargs.each do |attr, value|
|
23
|
+
self.send("#{attr}=", value)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module BinanceClient
|
2
|
+
class Market < BaseModel
|
3
|
+
|
4
|
+
METHODS = %i[
|
5
|
+
symbol
|
6
|
+
status
|
7
|
+
base_asset
|
8
|
+
base_asset_precision
|
9
|
+
quote_asset
|
10
|
+
quote_precision
|
11
|
+
quote_asset_precision
|
12
|
+
base_commission_precision
|
13
|
+
quote_commission_precision
|
14
|
+
order_types
|
15
|
+
iceberg_allowed
|
16
|
+
oco_allowed
|
17
|
+
quote_order_qty_market_allowed
|
18
|
+
is_spot_trading_allowed
|
19
|
+
is_margin_trading_allowed
|
20
|
+
].freeze
|
21
|
+
|
22
|
+
BOOL_MAP = {
|
23
|
+
iceberg_allowed: :iceberg_allowed?,
|
24
|
+
oco_allowed: :oco_allowed?,
|
25
|
+
quote_order_qty_market_allowed: :quote_order_qty_market_allowed?,
|
26
|
+
is_spot_trading_allowed: :spot_trading_allowed?,
|
27
|
+
is_margin_trading_allowed: :margin_trading_allowed?,
|
28
|
+
}.freeze
|
29
|
+
|
30
|
+
attr_reader :raw_hash
|
31
|
+
|
32
|
+
def initialize(raw_hash:)
|
33
|
+
@raw_hash = raw_hash
|
34
|
+
end
|
35
|
+
|
36
|
+
METHODS.each do |method_name|
|
37
|
+
define_method method_name do
|
38
|
+
raw_hash[method_name.to_s.camelcase(:lower)]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
BOOL_MAP.each do |original_method_name, alias_method_name|
|
43
|
+
alias_method alias_method_name, original_method_name
|
44
|
+
end
|
45
|
+
|
46
|
+
def filters
|
47
|
+
@filters ||= raw_hash["filters"].map do |filter_hash|
|
48
|
+
MarketFilter.new(raw_hash: filter_hash)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module BinanceClient
|
2
|
+
class MarketFilter
|
3
|
+
|
4
|
+
attr_reader :raw_hash
|
5
|
+
|
6
|
+
def initialize(raw_hash:)
|
7
|
+
@raw_hash = raw_hash
|
8
|
+
end
|
9
|
+
|
10
|
+
def method_missing(method_name, *args)
|
11
|
+
key = method_name.to_s.camelcase(:lower)
|
12
|
+
super if raw_hash[key].nil?
|
13
|
+
|
14
|
+
self.class.define_method method_name do
|
15
|
+
value = raw_hash[method_name.to_s.camelcase(:lower)]
|
16
|
+
|
17
|
+
value = value.to_d if value =~ /^[\d\.]+$/
|
18
|
+
|
19
|
+
value
|
20
|
+
end
|
21
|
+
send(method_name)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module BinanceClient
|
2
|
+
class RateLimit
|
3
|
+
|
4
|
+
METHODS = %i[
|
5
|
+
rate_limit_type
|
6
|
+
interval
|
7
|
+
interval_num
|
8
|
+
limit
|
9
|
+
].freeze
|
10
|
+
|
11
|
+
attr_reader :raw_hash
|
12
|
+
|
13
|
+
def initialize(raw_hash:)
|
14
|
+
@raw_hash = raw_hash
|
15
|
+
end
|
16
|
+
|
17
|
+
METHODS.each do |method_name|
|
18
|
+
define_method method_name do
|
19
|
+
raw_hash[method_name.to_s.camelcase(:lower)]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -2,11 +2,13 @@ module BinanceClient
|
|
2
2
|
class AuthenticatedBaseRequest < BaseRequest
|
3
3
|
include APIClientBase::Request.module
|
4
4
|
|
5
|
+
attribute :recv_window, Integer
|
6
|
+
|
5
7
|
def signature
|
6
8
|
OpenSSL::HMAC.hexdigest(
|
7
9
|
OpenSSL::Digest.new("sha256"),
|
8
10
|
api_secret,
|
9
|
-
|
11
|
+
params_without_signature_with_timestamp_and_recv_window.to_query,
|
10
12
|
)
|
11
13
|
end
|
12
14
|
|
@@ -19,11 +21,14 @@ module BinanceClient
|
|
19
21
|
end
|
20
22
|
|
21
23
|
def params
|
22
|
-
|
24
|
+
params_without_signature_with_timestamp_and_recv_window.
|
25
|
+
merge(signature_hash).to_query
|
23
26
|
end
|
24
27
|
|
25
|
-
def
|
26
|
-
|
28
|
+
def params_without_signature_with_timestamp_and_recv_window
|
29
|
+
attrs_to_merge = { timestamp: timestamp }
|
30
|
+
attrs_to_merge[:recvWindow] = recv_window if recv_window.present?
|
31
|
+
params_without_signature.merge(attrs_to_merge)
|
27
32
|
end
|
28
33
|
|
29
34
|
def params_without_signature
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module BinanceClient
|
2
|
+
class SubAccountDepositAddressRequest < AuthenticatedBaseRequest
|
3
|
+
|
4
|
+
attribute :email, String
|
5
|
+
attribute :coin, String
|
6
|
+
attribute :network, String
|
7
|
+
|
8
|
+
private
|
9
|
+
|
10
|
+
def path
|
11
|
+
"/sapi/v1/capital/deposit/subAddress"
|
12
|
+
end
|
13
|
+
|
14
|
+
def params_without_signature
|
15
|
+
{
|
16
|
+
email: email,
|
17
|
+
coin: coin,
|
18
|
+
network: network,
|
19
|
+
}.reject do |key, value|
|
20
|
+
value.nil?
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module BinanceClient
|
2
|
+
class SubAccountDepositHistoryRequest < AuthenticatedBaseRequest
|
3
|
+
attribute :sub_account_id, String
|
4
|
+
attribute :start_time, DateTime
|
5
|
+
attribute :end_time, DateTime
|
6
|
+
attribute :coin, String
|
7
|
+
attribute :status, Integer
|
8
|
+
attribute :limit, Integer
|
9
|
+
attribute :offset, Integer
|
10
|
+
|
11
|
+
PARAMS = [
|
12
|
+
:sub_account_id,
|
13
|
+
:start_time,
|
14
|
+
:end_time,
|
15
|
+
:coin,
|
16
|
+
:status,
|
17
|
+
:limit,
|
18
|
+
:offset,
|
19
|
+
].freeze
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def path
|
24
|
+
"/sapi/v1/broker/subAccount/depositHist"
|
25
|
+
end
|
26
|
+
|
27
|
+
def params_without_signature
|
28
|
+
PARAMS.each_with_object({}) do |param, hash|
|
29
|
+
key = param.to_s.camelcase(:lower)
|
30
|
+
value = send(param)
|
31
|
+
value = value.to_i * 1_000 if value.is_a?(DateTime)
|
32
|
+
hash[key] = value
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module BinanceClient
|
2
|
+
class AccountResponse < BaseResponse
|
3
|
+
|
4
|
+
[
|
5
|
+
:maker_commission,
|
6
|
+
:taker_commission,
|
7
|
+
:buyer_commission,
|
8
|
+
:seller_commission,
|
9
|
+
:can_trade,
|
10
|
+
:can_withdraw,
|
11
|
+
:can_deposit,
|
12
|
+
:update_time,
|
13
|
+
:account_type,
|
14
|
+
:permissions,
|
15
|
+
].each do |method_name|
|
16
|
+
define_method method_name do
|
17
|
+
key = method_name.to_s.camelcase(:lower)
|
18
|
+
body[key]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def balances
|
23
|
+
body["balances"].map do |balance_hash|
|
24
|
+
AssetBalance.new(**balance_hash.symbolize_keys)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -4,10 +4,12 @@ module BinanceClient
|
|
4
4
|
|
5
5
|
attribute :body, Object, lazy: true, default: :default_body
|
6
6
|
|
7
|
-
def
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
def used_weights
|
8
|
+
@used_weights ||= headers.each_with_object({}) do |(key, value), hash|
|
9
|
+
next if not key.include?("USED")
|
10
|
+
next if not key.include?("WEIGHT")
|
11
|
+
hash[key] = value
|
12
|
+
end
|
11
13
|
end
|
12
14
|
|
13
15
|
def message
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module BinanceClient
|
2
|
+
class ExchangeInfoResponse < BaseResponse
|
3
|
+
|
4
|
+
def timezone
|
5
|
+
body["timezone"]
|
6
|
+
end
|
7
|
+
|
8
|
+
def timezone
|
9
|
+
body["timezone"]
|
10
|
+
end
|
11
|
+
|
12
|
+
def server_time
|
13
|
+
body["serverTime"]
|
14
|
+
end
|
15
|
+
|
16
|
+
def markets
|
17
|
+
@markets ||= body["symbols"].map do |market_hash|
|
18
|
+
Market.new(raw_hash: market_hash)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
alias_method :symbols, :markets
|
22
|
+
|
23
|
+
def rate_limits
|
24
|
+
@rate_limits ||= body["rateLimits"].map do |rate_limit_hash|
|
25
|
+
RateLimit.new(raw_hash: rate_limit_hash)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
data/lib/binance_client.rb
CHANGED
@@ -2,6 +2,9 @@ require "binance_client/version"
|
|
2
2
|
require "api_client_base"
|
3
3
|
require "active_support/core_ext/hash/indifferent_access"
|
4
4
|
require "active_support/core_ext/object/to_query"
|
5
|
+
require "active_support/core_ext/string/inflections"
|
6
|
+
require "active_support/core_ext/date_time"
|
7
|
+
require "active_support/core_ext/integer"
|
5
8
|
require "json"
|
6
9
|
require "openssl"
|
7
10
|
|
@@ -11,22 +14,35 @@ require "binance_client/models/base_model"
|
|
11
14
|
require "binance_client/models/order_book_entry"
|
12
15
|
require "binance_client/models/order_book"
|
13
16
|
require "binance_client/models/asset_balance"
|
17
|
+
require "binance_client/models/deposit_address"
|
18
|
+
require "binance_client/models/market"
|
19
|
+
require "binance_client/models/market_filter"
|
20
|
+
require "binance_client/models/rate_limit"
|
21
|
+
require "binance_client/models/deposit"
|
14
22
|
|
15
23
|
require "binance_client/requests/base_request"
|
16
24
|
require "binance_client/requests/authenticated_base_request"
|
17
25
|
require "binance_client/responses/base_response"
|
18
26
|
require "binance_client/requests/system_status_request"
|
19
27
|
require "binance_client/requests/account_snapshot_request"
|
28
|
+
require "binance_client/requests/exchange_info_request"
|
20
29
|
require "binance_client/requests/get_all_request"
|
21
30
|
require "binance_client/requests/book_ticker_request"
|
22
31
|
require "binance_client/requests/order_book_depth_request"
|
23
32
|
require "binance_client/requests/sub_account_assets_request"
|
33
|
+
require "binance_client/requests/sub_account_deposit_address_request"
|
34
|
+
require "binance_client/requests/sub_account_deposit_history_request"
|
35
|
+
require "binance_client/requests/account_request"
|
24
36
|
require "binance_client/responses/system_status_response"
|
25
37
|
require "binance_client/responses/account_snapshot_response"
|
26
38
|
require "binance_client/responses/get_all_response"
|
39
|
+
require "binance_client/responses/exchange_info_response"
|
27
40
|
require "binance_client/responses/book_ticker_response"
|
28
41
|
require "binance_client/responses/order_book_depth_response"
|
29
42
|
require "binance_client/responses/sub_account_assets_response"
|
43
|
+
require "binance_client/responses/sub_account_deposit_address_response"
|
44
|
+
require "binance_client/responses/sub_account_deposit_history_response"
|
45
|
+
require "binance_client/responses/account_response"
|
30
46
|
|
31
47
|
module BinanceClient
|
32
48
|
class Error < StandardError; end
|
@@ -39,5 +55,7 @@ module BinanceClient
|
|
39
55
|
has :host, classes: String, default: DEFAULT_HOST
|
40
56
|
has :api_key, classes: String
|
41
57
|
has :api_secret, classes: String
|
58
|
+
has :recv_window, classes: [NilClass, Integer]
|
59
|
+
has :proxy
|
42
60
|
end
|
43
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: binance_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AJ Villalobos
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: api_client_base
|
@@ -116,24 +116,38 @@ files:
|
|
116
116
|
- binance_client.gemspec
|
117
117
|
- lib/binance_client.rb
|
118
118
|
- lib/binance_client/client.rb
|
119
|
+
- lib/binance_client/factories.rb
|
119
120
|
- lib/binance_client/models/asset_balance.rb
|
120
121
|
- lib/binance_client/models/base_model.rb
|
122
|
+
- lib/binance_client/models/deposit.rb
|
123
|
+
- lib/binance_client/models/deposit_address.rb
|
124
|
+
- lib/binance_client/models/market.rb
|
125
|
+
- lib/binance_client/models/market_filter.rb
|
121
126
|
- lib/binance_client/models/order_book.rb
|
122
127
|
- lib/binance_client/models/order_book_entry.rb
|
128
|
+
- lib/binance_client/models/rate_limit.rb
|
129
|
+
- lib/binance_client/requests/account_request.rb
|
123
130
|
- lib/binance_client/requests/account_snapshot_request.rb
|
124
131
|
- lib/binance_client/requests/authenticated_base_request.rb
|
125
132
|
- lib/binance_client/requests/base_request.rb
|
126
133
|
- lib/binance_client/requests/book_ticker_request.rb
|
134
|
+
- lib/binance_client/requests/exchange_info_request.rb
|
127
135
|
- lib/binance_client/requests/get_all_request.rb
|
128
136
|
- lib/binance_client/requests/order_book_depth_request.rb
|
129
137
|
- lib/binance_client/requests/sub_account_assets_request.rb
|
138
|
+
- lib/binance_client/requests/sub_account_deposit_address_request.rb
|
139
|
+
- lib/binance_client/requests/sub_account_deposit_history_request.rb
|
130
140
|
- lib/binance_client/requests/system_status_request.rb
|
141
|
+
- lib/binance_client/responses/account_response.rb
|
131
142
|
- lib/binance_client/responses/account_snapshot_response.rb
|
132
143
|
- lib/binance_client/responses/base_response.rb
|
133
144
|
- lib/binance_client/responses/book_ticker_response.rb
|
145
|
+
- lib/binance_client/responses/exchange_info_response.rb
|
134
146
|
- lib/binance_client/responses/get_all_response.rb
|
135
147
|
- lib/binance_client/responses/order_book_depth_response.rb
|
136
148
|
- lib/binance_client/responses/sub_account_assets_response.rb
|
149
|
+
- lib/binance_client/responses/sub_account_deposit_address_response.rb
|
150
|
+
- lib/binance_client/responses/sub_account_deposit_history_response.rb
|
137
151
|
- lib/binance_client/responses/system_status_response.rb
|
138
152
|
- lib/binance_client/version.rb
|
139
153
|
homepage: https://github.com/bloom-solutions/binance_client-ruby
|