binance_client 5.3.0 → 5.4.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
  SHA256:
3
- metadata.gz: 2195d7329ae93172557f7e71ac420c55161aca2120a7293f4fc7c9158dcad7f1
4
- data.tar.gz: bcbfc894402374fffc73c8938285dccc3168d7afb8dc0d92c08486c9866aed94
3
+ metadata.gz: 036c0e5f781eee981ff28fe37b0c1695a34191c7b82200e74b22860ec6c8aaa0
4
+ data.tar.gz: 1f74e555a2e1d369c334e596e59ec1c43d60c653cb5e899ada7e9a60c2f85b67
5
5
  SHA512:
6
- metadata.gz: daef5aec2386eae6531bc72fa52610ca5de40074cae5ed1e69fa9f17f16921477696b767ea7a61fff50ec97e947293401e543616c7f58cf7b8fa5d0e2354c49a
7
- data.tar.gz: 4b6b8e314fda53a36151cd85fca2cd0d435d7c7ecca087dae49c9c47648a962f14fc4cd90d8346556a0dced4e17b91bdea6efb605128a33319dc28c8adb21d33
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- binance_client (5.3.0)
4
+ binance_client (5.4.0)
5
5
  activesupport
6
6
  api_client_base (~> 1.11)
7
7
  typhoeus
@@ -104,4 +104,4 @@ DEPENDENCIES
104
104
  webmock
105
105
 
106
106
  BUNDLED WITH
107
- 2.2.29
107
+ 2.3.21
@@ -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 = ["AJ Villalobos"]
7
- spec.email = ["hi@ajvillalobos.com"]
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"
@@ -25,6 +25,7 @@ module BinanceClient
25
25
  api_action :withdraw
26
26
  api_action :ping
27
27
  api_action :all_orders, args: [:symbol, :start_time]
28
+ api_action :sub_accounts
28
29
 
29
30
  attribute :host
30
31
  attribute :api_key
@@ -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
@@ -1,3 +1,3 @@
1
1
  module BinanceClient
2
- VERSION = "5.3.0"
2
+ VERSION = "5.4.0"
3
3
  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.3.0
4
+ version: 5.4.0
5
5
  platform: ruby
6
6
  authors:
7
- - AJ Villalobos
7
+ - Bloom Devs
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-09 00:00:00.000000000 Z
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
- - hi@ajvillalobos.com
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