fuly 0.0.5 → 0.0.10
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 +5 -0
- data/lib/bitfinex/api/wallet.rb +34 -1
- data/lib/bitfinex/client.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b43c1ec760e981a67837a2686b0a2cc1dbfe89dfe9afbbab043b3bce71b011b3
|
|
4
|
+
data.tar.gz: 5267452710937aa867cf17b06811a0dc98641c9d1c4ad26c1ed8cf6a14a77169
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 22fc294cb5064f3f2508cccbb4caac5c35326fbb5bd1cad4bfe0f29f45c23fdf38fe2ade73461f3c3001799df13405b8dd3df6f32c8bc20d8edf618e569a9ac3
|
|
7
|
+
data.tar.gz: d7be5eb4bce216ae314e1d6f9ba43b108860fbde4d364e7e5e663700cdd66f7613a23a8fe09e96dbd9641ff2aa6b55da92ab9a4ca894b08eaacba0c5e7bf1da8
|
data/lib/bitfinex/api/funding.rb
CHANGED
|
@@ -74,5 +74,10 @@ module Bitfinex
|
|
|
74
74
|
res = request("auth/r/funding/credits/#{currency}").body
|
|
75
75
|
return JSON.parse(res)
|
|
76
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
|
|
77
82
|
end
|
|
78
83
|
end
|
data/lib/bitfinex/api/wallet.rb
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
module Bitfinex
|
|
2
2
|
module Wallet
|
|
3
|
+
# Ratelimit: 90 req/min
|
|
4
|
+
# https://docs.bitfinex.com/reference#rest-auth-info-user
|
|
5
|
+
def user_info
|
|
6
|
+
res = request("auth/r/info/user").body
|
|
7
|
+
return JSON.parse(res)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# Ratelimit: 90 req/min
|
|
11
|
+
# https://docs.bitfinex.com/reference#key-permissions
|
|
12
|
+
def permissions
|
|
13
|
+
res = request("auth/r/permissions").body
|
|
14
|
+
return JSON.parse(res)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# https://docs.bitfinex.com/reference#rest-auth-withdraw
|
|
18
|
+
def withdraw(wallet, method, amount, address)
|
|
19
|
+
res = request("auth/w/withdraw", {
|
|
20
|
+
wallet: wallet,#'exchange',
|
|
21
|
+
method: method,#'tetheruse',
|
|
22
|
+
amount: amount,#'10',
|
|
23
|
+
address: address#'0x2bf788d017C4DF927787DF2EB1310266d9db6893',
|
|
24
|
+
}).body
|
|
25
|
+
return JSON.parse(res)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Ratelimit: 45 req/min
|
|
29
|
+
# https://docs.bitfinex.com/reference#rest-auth-movements
|
|
30
|
+
def movements
|
|
31
|
+
res = request("auth/r/movements/hist").body
|
|
32
|
+
return JSON.parse(res)
|
|
33
|
+
end
|
|
34
|
+
|
|
3
35
|
# Ratelimit: 45 req/min
|
|
4
36
|
# https://docs.bitfinex.com/reference#rest-auth-wallets
|
|
5
37
|
def wallets
|
|
@@ -11,7 +43,8 @@ module Bitfinex
|
|
|
11
43
|
# https://docs.bitfinex.com/reference#rest-auth-ledgers
|
|
12
44
|
def ledgers(currency)
|
|
13
45
|
res = request("auth/r/ledgers/#{currency}/hist", {
|
|
14
|
-
limit:
|
|
46
|
+
limit: 2500,
|
|
47
|
+
# category: 28,
|
|
15
48
|
}).body
|
|
16
49
|
return JSON.parse(res)
|
|
17
50
|
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.10
|
|
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-03-11 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: {}
|