binance_client 5.3.0 → 5.4.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 +4 -0
- data/Gemfile.lock +2 -2
- data/binance_client.gemspec +2 -2
- data/lib/binance_client/client.rb +1 -0
- data/lib/binance_client/models/account.rb +37 -0
- data/lib/binance_client/requests/sub_accounts_request.rb +21 -0
- data/lib/binance_client/responses/sub_accounts_response.rb +16 -0
- data/lib/binance_client/version.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 036c0e5f781eee981ff28fe37b0c1695a34191c7b82200e74b22860ec6c8aaa0
|
4
|
+
data.tar.gz: 1f74e555a2e1d369c334e596e59ec1c43d60c653cb5e899ada7e9a60c2f85b67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0eef2cba13b537a29b9e13e9d09ebd1688ea75142fd78432e6b40676e5fc9b3e13771f857f649d3e4f43142c5107e4dc9419cb4c9a3d69c84cfab1d1dc470802
|
7
|
+
data.tar.gz: 8716f5b55077d996fac7f5bbd067518b0a59e246be5b983a7b72db4a40c031e44d9233de734f59a4414d0fc490ddabc14f72efc087eebf2a656b63a241a9e959
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ 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
|
+
## [5.4.0] - 2022-10-19
|
8
|
+
### Added
|
9
|
+
- `#sub_accounts` to get the list of an accounts sub accounts
|
10
|
+
|
7
11
|
## [5.3.0] - 2022-09-09
|
8
12
|
### Added
|
9
13
|
- `#sub_account_transfer_history`
|
data/Gemfile.lock
CHANGED
data/binance_client.gemspec
CHANGED
@@ -3,8 +3,8 @@ require_relative 'lib/binance_client/version'
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "binance_client"
|
5
5
|
spec.version = BinanceClient::VERSION
|
6
|
-
spec.authors = ["
|
7
|
-
spec.email = ["
|
6
|
+
spec.authors = ["Bloom Devs"]
|
7
|
+
spec.email = ["dev@bloom.solutions"]
|
8
8
|
|
9
9
|
spec.summary = "Ruby wrapper for Binance API"
|
10
10
|
spec.description = "Ruby wrapper for Binance API"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module BinanceClient
|
2
|
+
class Account
|
3
|
+
|
4
|
+
include Virtus.model
|
5
|
+
|
6
|
+
LOCAL_TO_REMOTE_ATTR_MAP = {
|
7
|
+
sub_account_id: "subaccountId",
|
8
|
+
email: "email",
|
9
|
+
tag: "tag",
|
10
|
+
maker_commission: "makerCommission",
|
11
|
+
taker_commission: "takerCommission",
|
12
|
+
margin_maker_commission: "marginMakerCommission",
|
13
|
+
margin_taker_commission: "marginTakerCommission",
|
14
|
+
create_time: "createTime",
|
15
|
+
}
|
16
|
+
|
17
|
+
attribute :sub_account_id, Integer, lazy: true, default: :default_sub_account_id
|
18
|
+
attribute :email, String, lazy: true, default: :default_email
|
19
|
+
attribute :tag, String, lazy: true, default: :default_tag
|
20
|
+
attribute :maker_commission, BigDecimal, lazy: true, default: :default_maker_commission
|
21
|
+
attribute :taker_commission, BigDecimal, lazy: true, default: :default_taker_commission
|
22
|
+
attribute :margin_maker_commission, BigDecimal, lazy: true, default: :default_margin_maker_commission
|
23
|
+
attribute :margin_taker_commission, BigDecimal, lazy: true, default: :default_margin_taker_commission
|
24
|
+
attribute :create_time, Integer, lazy: true, default: :default_create_time
|
25
|
+
|
26
|
+
attribute :raw_hash, Hash
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
LOCAL_TO_REMOTE_ATTR_MAP.each do |local_attr, remote_attr|
|
31
|
+
define_method :"default_#{local_attr}" do
|
32
|
+
raw_hash[remote_attr]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module BinanceClient
|
2
|
+
class SubAccountsRequest < AuthenticatedBaseRequest
|
3
|
+
|
4
|
+
attribute :sub_account_id, Integer
|
5
|
+
attribute :page, Integer
|
6
|
+
attribute :size, Integer
|
7
|
+
|
8
|
+
private
|
9
|
+
|
10
|
+
def path
|
11
|
+
"/sapi/v1/broker/subAccount"
|
12
|
+
end
|
13
|
+
|
14
|
+
def params_without_signature
|
15
|
+
%i[sub_account_id page size].each_with_object({}) do |attr, hash|
|
16
|
+
hash[attr.to_s.camelcase(:lower)] = send(attr)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module BinanceClient
|
2
|
+
class SubAccountsResponse < BaseResponse
|
3
|
+
|
4
|
+
attribute(:sub_accounts, Array[BinanceClient::Account], {
|
5
|
+
lazy: true,
|
6
|
+
default: :default_sub_accounts,
|
7
|
+
})
|
8
|
+
|
9
|
+
def default_sub_accounts
|
10
|
+
body.map do |sub_account_hash|
|
11
|
+
Account.new(raw_hash: sub_account_hash)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
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: 5.
|
4
|
+
version: 5.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Bloom Devs
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: api_client_base
|
@@ -110,7 +110,7 @@ dependencies:
|
|
110
110
|
version: '0'
|
111
111
|
description: Ruby wrapper for Binance API
|
112
112
|
email:
|
113
|
-
-
|
113
|
+
- dev@bloom.solutions
|
114
114
|
executables: []
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
@@ -132,6 +132,7 @@ files:
|
|
132
132
|
- lib/binance_client/client.rb
|
133
133
|
- lib/binance_client/factories.rb
|
134
134
|
- lib/binance_client/loader.rb
|
135
|
+
- lib/binance_client/models/account.rb
|
135
136
|
- lib/binance_client/models/asset_balance.rb
|
136
137
|
- lib/binance_client/models/base_model.rb
|
137
138
|
- lib/binance_client/models/book_ticker.rb
|
@@ -169,6 +170,7 @@ files:
|
|
169
170
|
- lib/binance_client/requests/sub_account_set_spot_bnb_burn_request.rb
|
170
171
|
- lib/binance_client/requests/sub_account_transfer_history_request.rb
|
171
172
|
- lib/binance_client/requests/sub_account_transfer_request.rb
|
173
|
+
- lib/binance_client/requests/sub_accounts_request.rb
|
172
174
|
- lib/binance_client/requests/system_status_request.rb
|
173
175
|
- lib/binance_client/requests/withdraw_request.rb
|
174
176
|
- lib/binance_client/responses/account_response.rb
|
@@ -192,6 +194,7 @@ files:
|
|
192
194
|
- lib/binance_client/responses/sub_account_set_spot_bnb_burn_response.rb
|
193
195
|
- lib/binance_client/responses/sub_account_transfer_history_response.rb
|
194
196
|
- lib/binance_client/responses/sub_account_transfer_response.rb
|
197
|
+
- lib/binance_client/responses/sub_accounts_response.rb
|
195
198
|
- lib/binance_client/responses/system_status_response.rb
|
196
199
|
- lib/binance_client/responses/withdraw_response.rb
|
197
200
|
- lib/binance_client/version.rb
|