binance_client 5.2.0 → 5.3.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: 2da825e960057759234b17aae2722429df0a91a6e87343aa63b5177d2f0dea0f
4
- data.tar.gz: ce99de0cdae0c663a384559d780f79933985cbc8cf6f06793dde6091d185b7a0
3
+ metadata.gz: 2195d7329ae93172557f7e71ac420c55161aca2120a7293f4fc7c9158dcad7f1
4
+ data.tar.gz: bcbfc894402374fffc73c8938285dccc3168d7afb8dc0d92c08486c9866aed94
5
5
  SHA512:
6
- metadata.gz: f600ea14ca7dff15ac8b9626f812eccbf0843b9cc09455d04569ae98c25894455c15ba61cc6e1dfab0b7fa50854f520d7c9fa0dad558e3436a5acfe208d56073
7
- data.tar.gz: 2014a2de0f2d412aace73888cd1ad817f4943d64c6f264df15faebae9de970bc6ae0acc045237f52a610026ba46d849f561a344faa7bb033ce2232cb5fcf7862
6
+ metadata.gz: daef5aec2386eae6531bc72fa52610ca5de40074cae5ed1e69fa9f17f16921477696b767ea7a61fff50ec97e947293401e543616c7f58cf7b8fa5d0e2354c49a
7
+ data.tar.gz: 4b6b8e314fda53a36151cd85fca2cd0d435d7c7ecca087dae49c9c47648a962f14fc4cd90d8346556a0dced4e17b91bdea6efb605128a33319dc28c8adb21d33
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.3.0] - 2022-09-09
8
+ ### Added
9
+ - `#sub_account_transfer_history`
10
+
7
11
  ## [5.2.0] - 2022-05-20
8
12
  ### Added
9
13
  - `#all_orders`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- binance_client (5.2.0)
4
+ binance_client (5.3.0)
5
5
  activesupport
6
6
  api_client_base (~> 1.11)
7
7
  typhoeus
@@ -18,6 +18,7 @@ module BinanceClient
18
18
  })
19
19
  api_action :create_sub_account
20
20
  api_action :sub_account_transfer
21
+ api_action :sub_account_transfer_history
21
22
  api_action :sub_account_create_api_keys
22
23
  api_action :create_test_order
23
24
  api_action :create_order
@@ -0,0 +1,44 @@
1
+ module BinanceClient
2
+ class Transfer
3
+
4
+ attr_reader :raw_hash
5
+
6
+ def initialize(raw_hash:)
7
+ @raw_hash = raw_hash
8
+ end
9
+
10
+ def from_id
11
+ @from_id ||= raw_hash["fromId"]
12
+ end
13
+
14
+ def to_id
15
+ @to_id ||= raw_hash["toId"]
16
+ end
17
+
18
+ def asset
19
+ @asset ||= raw_hash["asset"]
20
+ end
21
+
22
+ def qty
23
+ @qty ||= raw_hash["qty"]
24
+ end
25
+
26
+ def time
27
+ @time ||= raw_hash["time"]
28
+ end
29
+
30
+ def txn_id
31
+ @txn_id ||= raw_hash["txnId"]
32
+ end
33
+
34
+ def client_tran_id
35
+ @client_tran_id ||= raw_hash["clientTranId"]
36
+ end
37
+
38
+ def status
39
+ @status ||= raw_hash["status"]
40
+ end
41
+
42
+
43
+ end
44
+ end
@@ -0,0 +1,52 @@
1
+ module BinanceClient
2
+ class SubAccountTransferHistoryRequest < AuthenticatedBaseRequest
3
+
4
+ attribute :from_id, String
5
+ attribute :to_id, String
6
+ attribute :client_tran_id, String
7
+ attribute :show_all_status, Boolean
8
+ attribute :start_time, Integer
9
+ attribute :end_time, Integer
10
+ attribute :page, Integer
11
+ attribute :limit, Integer
12
+
13
+ def start_time=(datetime)
14
+ return if datetime.nil?
15
+ @start_time = datetime.to_i * 1_000
16
+ end
17
+
18
+ def end_time=(datetime)
19
+ return if datetime.nil?
20
+ @end_time = datetime.to_i * 1_000
21
+ end
22
+
23
+ private
24
+
25
+ def path
26
+ "/sapi/v1/broker/transfer"
27
+ end
28
+
29
+ def default_action
30
+ :get
31
+ end
32
+
33
+ def params_without_signature
34
+ %i[
35
+ fromId
36
+ toId
37
+ clientTranId
38
+ showAllStatus
39
+ startTime
40
+ endTime
41
+ page
42
+ limit
43
+ ].each_with_object({}) do |attr, hash|
44
+ val = send(attr.to_s.underscore)
45
+
46
+ next if val.nil?
47
+
48
+ hash[attr] = val
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,11 @@
1
+ module BinanceClient
2
+ class SubAccountTransferHistoryResponse < BaseResponse
3
+
4
+ def transfers
5
+ @transfers ||= body.map do |hash|
6
+ Transfer.new(raw_hash: hash)
7
+ end
8
+ end
9
+
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module BinanceClient
2
- VERSION = "5.2.0"
2
+ VERSION = "5.3.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.2.0
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AJ Villalobos
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-20 00:00:00.000000000 Z
11
+ date: 2022-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: api_client_base
@@ -146,6 +146,7 @@ files:
146
146
  - lib/binance_client/models/order_book_entry.rb
147
147
  - lib/binance_client/models/order_fill.rb
148
148
  - lib/binance_client/models/rate_limit.rb
149
+ - lib/binance_client/models/transfer.rb
149
150
  - lib/binance_client/requests/account_request.rb
150
151
  - lib/binance_client/requests/account_snapshot_request.rb
151
152
  - lib/binance_client/requests/all_orders_request.rb
@@ -166,6 +167,7 @@ files:
166
167
  - lib/binance_client/requests/sub_account_deposit_address_request.rb
167
168
  - lib/binance_client/requests/sub_account_deposit_history_request.rb
168
169
  - lib/binance_client/requests/sub_account_set_spot_bnb_burn_request.rb
170
+ - lib/binance_client/requests/sub_account_transfer_history_request.rb
169
171
  - lib/binance_client/requests/sub_account_transfer_request.rb
170
172
  - lib/binance_client/requests/system_status_request.rb
171
173
  - lib/binance_client/requests/withdraw_request.rb
@@ -188,6 +190,7 @@ files:
188
190
  - lib/binance_client/responses/sub_account_deposit_address_response.rb
189
191
  - lib/binance_client/responses/sub_account_deposit_history_response.rb
190
192
  - lib/binance_client/responses/sub_account_set_spot_bnb_burn_response.rb
193
+ - lib/binance_client/responses/sub_account_transfer_history_response.rb
191
194
  - lib/binance_client/responses/sub_account_transfer_response.rb
192
195
  - lib/binance_client/responses/system_status_response.rb
193
196
  - lib/binance_client/responses/withdraw_response.rb
@@ -199,7 +202,7 @@ metadata:
199
202
  homepage_uri: https://github.com/bloom-solutions/binance_client-ruby
200
203
  source_code_uri: https://github.com/bloom-solutions/binance_client-ruby
201
204
  changelog_uri: https://github.com/bloom-solutions/binance_client-ruby/CHANGELOG.md
202
- post_install_message:
205
+ post_install_message:
203
206
  rdoc_options: []
204
207
  require_paths:
205
208
  - lib
@@ -215,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
218
  version: '0'
216
219
  requirements: []
217
220
  rubygems_version: 3.1.6
218
- signing_key:
221
+ signing_key:
219
222
  specification_version: 4
220
223
  summary: Ruby wrapper for Binance API
221
224
  test_files: []