fuly 0.0.4 → 0.0.9
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/lib/bitfinex/api/funding.rb +11 -1
- data/lib/bitfinex/api/wallet.rb +9 -1
- data/lib/bitfinex/client.rb +2 -2
- metadata +5 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3d531168d90e0a52ffa9b7bc870b999dc60f4990f7a496c88f64bfe9316e7fed
|
|
4
|
+
data.tar.gz: 2f8a2c89230ee48b6bc47bc80340ea135379f0a31605fd315cd8b34dd18e3f29
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6e5e3484dbd42ecb9bda2d9497f83e73736ad94bf28273bea67701463b862f74d43005611229c960955c126b6b0cb5cec372f9aee90ec0c4ebbedff886b0631b
|
|
7
|
+
data.tar.gz: 425a65502de581b0dfc7882bcccda747b7267c1f07b7cd80bcabf66b7d0e450cf6b7f8004cf4c93da250946b3e4ed854d7cdf6cf465c2ec2db2c7d5f920d9fb7
|
data/lib/bitfinex/api/funding.rb
CHANGED
|
@@ -65,9 +65,19 @@ module Bitfinex
|
|
|
65
65
|
# 所有正在借款列表
|
|
66
66
|
# Ratelimit: 45 req/min
|
|
67
67
|
# https://docs.bitfinex.com/reference#rest-auth-funding-credits
|
|
68
|
-
def
|
|
68
|
+
def funding_credit_all
|
|
69
69
|
res = request("auth/r/funding/credits").body
|
|
70
70
|
return JSON.parse(res)
|
|
71
71
|
end
|
|
72
|
+
|
|
73
|
+
def funding_credit(currency = "fUSD")
|
|
74
|
+
res = request("auth/r/funding/credits/#{currency}").body
|
|
75
|
+
return JSON.parse(res)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def funding_loans(currency = "fUSD")
|
|
79
|
+
res = request("auth/r/funding/loans/#{currency}").body
|
|
80
|
+
return JSON.parse(res)
|
|
81
|
+
end
|
|
72
82
|
end
|
|
73
83
|
end
|
data/lib/bitfinex/api/wallet.rb
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
module Bitfinex
|
|
2
2
|
module Wallet
|
|
3
|
+
# Ratelimit: 45 req/min
|
|
4
|
+
# https://docs.bitfinex.com/reference#rest-auth-movements
|
|
5
|
+
def movements
|
|
6
|
+
res = request("auth/r/movements/hist").body
|
|
7
|
+
return JSON.parse(res)
|
|
8
|
+
end
|
|
9
|
+
|
|
3
10
|
# Ratelimit: 45 req/min
|
|
4
11
|
# https://docs.bitfinex.com/reference#rest-auth-wallets
|
|
5
12
|
def wallets
|
|
@@ -11,7 +18,8 @@ module Bitfinex
|
|
|
11
18
|
# https://docs.bitfinex.com/reference#rest-auth-ledgers
|
|
12
19
|
def ledgers(currency)
|
|
13
20
|
res = request("auth/r/ledgers/#{currency}/hist", {
|
|
14
|
-
limit:
|
|
21
|
+
limit: 2500,
|
|
22
|
+
# category: 28,
|
|
15
23
|
}).body
|
|
16
24
|
return JSON.parse(res)
|
|
17
25
|
end
|
data/lib/bitfinex/client.rb
CHANGED
|
@@ -16,7 +16,7 @@ module Bitfinex
|
|
|
16
16
|
|
|
17
17
|
def request(url, options = {})
|
|
18
18
|
body = options || {}
|
|
19
|
-
nonce = (Time.now.to_f * 1000).
|
|
19
|
+
nonce = ((Time.now.to_f * 1000).floor * 1000).to_s
|
|
20
20
|
payload = "/api/v2/#{url}#{nonce}#{body.to_json}"
|
|
21
21
|
sign = OpenSSL::HMAC.hexdigest("sha384", @api_secret, payload)
|
|
22
22
|
|
|
@@ -44,7 +44,7 @@ module Bitfinex
|
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def v1_request(url, options = {})
|
|
47
|
-
nonce = (Time.now.to_f * 1000).floor.to_s
|
|
47
|
+
nonce = ((Time.now.to_f * 1000).floor * 1000).to_s
|
|
48
48
|
url = "/v1/#{url}"
|
|
49
49
|
payload = build_payload(url, options, nonce)
|
|
50
50
|
headers = {
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fuly
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rex Chen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-01-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: httparty
|
|
@@ -26,7 +26,7 @@ dependencies:
|
|
|
26
26
|
version: 0.17.0
|
|
27
27
|
description: Official Fuly API ruby wrapper
|
|
28
28
|
email:
|
|
29
|
-
- rex@
|
|
29
|
+
- rex@fuly.ai
|
|
30
30
|
executables: []
|
|
31
31
|
extensions: []
|
|
32
32
|
extra_rdoc_files: []
|
|
@@ -35,7 +35,7 @@ files:
|
|
|
35
35
|
- lib/bitfinex/api/wallet.rb
|
|
36
36
|
- lib/bitfinex/client.rb
|
|
37
37
|
- lib/fuly.rb
|
|
38
|
-
homepage: https://fuly.
|
|
38
|
+
homepage: https://fuly.ai/
|
|
39
39
|
licenses:
|
|
40
40
|
- MIT
|
|
41
41
|
metadata: {}
|
|
@@ -54,8 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
55
|
version: '0'
|
|
56
56
|
requirements: []
|
|
57
|
-
|
|
58
|
-
rubygems_version: 2.7.7
|
|
57
|
+
rubygems_version: 3.0.3
|
|
59
58
|
signing_key:
|
|
60
59
|
specification_version: 4
|
|
61
60
|
summary: Fuly API Wrapper
|