ftx_exchange_api 0.0.1 → 0.0.2
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 -1
- data/README.md +82 -2
- data/lib/ftx_exchange_api/public_api.rb +1 -1
- data/lib/ftx_exchange_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 66bd451b62c8206a8910fd8b8a13de11aa21f1d9def06711e271e879dc5d2a9c
|
|
4
|
+
data.tar.gz: 4c339ee8b7358f2b39a5c2eae3d7dd706680bdf51de35fee4d2712b301517bd0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba11caef7c7e5637a55dcede4cb37593efce18e96711e0190e457fe2a7788c8d12a7f4f25db67729d616251b1bb5204f600e4602361bc71a12f4aa85f508a632
|
|
7
|
+
data.tar.gz: 93961919cb301762ffaa097ecbd6e54cd069623ee0ba5f1583d1a6b04601285f3555d683c868e31883d354fe0f6f916c3c76941f08b356c0b2c7f009b0612676
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# FtxExchangeApi
|
|
2
2
|
|
|
3
3
|
[](http://rubygems.org/gems/ftx_exchange_api)
|
|
4
4
|
[](https://github.com/khiav223577/ftx_exchange_api/actions)
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
## Supports
|
|
10
10
|
- Ruby 2.2 ~ 2.7
|
|
11
|
-
- Rails 3.2, 4.2, 5.0, 5.1, 5.2, 6.0
|
|
12
11
|
|
|
13
12
|
## Installation
|
|
14
13
|
|
|
@@ -24,8 +23,89 @@ Or install it yourself as:
|
|
|
24
23
|
|
|
25
24
|
$ gem install ftx_exchange_api
|
|
26
25
|
|
|
26
|
+
## Configuration
|
|
27
|
+
|
|
28
|
+
### Set timeout time
|
|
29
|
+
|
|
30
|
+
```rb
|
|
31
|
+
# default config
|
|
32
|
+
FtxExchangeApi.default_config.timeout = 3 # seconds
|
|
33
|
+
|
|
34
|
+
# custom config
|
|
35
|
+
FtxExchangeApi::PublicApi.new(config: { timeout: 12 })
|
|
36
|
+
FtxExchangeApi::PrivateApi.new(access_key, secret_key, config: { timeout: 12 })
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Logging
|
|
40
|
+
|
|
41
|
+
```rb
|
|
42
|
+
require 'logger'
|
|
43
|
+
|
|
44
|
+
# default config
|
|
45
|
+
FtxExchangeApi.default_config.logger = Logger.new(STDOUT) # print log to stdand output
|
|
46
|
+
FtxExchangeApi.default_config.logger = Logger.new('log/api.log')
|
|
47
|
+
|
|
48
|
+
# custom config
|
|
49
|
+
FtxExchangeApi::PublicApi.new(config: { logger: Logger.new(STDOUT) })
|
|
50
|
+
FtxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.new(STDOUT) })
|
|
51
|
+
```
|
|
52
|
+
|
|
27
53
|
## Usage
|
|
28
54
|
|
|
55
|
+
### Public Api Examples
|
|
56
|
+
|
|
57
|
+
```rb
|
|
58
|
+
@api = FtxExchangeApi::PublicApi.new
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### [GET /markets](https://docs.ftx.com/?ruby#get-markets)
|
|
62
|
+
|
|
63
|
+
> Get markets
|
|
64
|
+
|
|
65
|
+
<details>
|
|
66
|
+
<summary>Show code</summary>
|
|
67
|
+
|
|
68
|
+
```rb
|
|
69
|
+
@api.markets
|
|
70
|
+
```
|
|
71
|
+
</details>
|
|
72
|
+
|
|
73
|
+
#### [GET /markets/{market_name}](https://docs.ftx.com/?ruby#get-markets)
|
|
74
|
+
|
|
75
|
+
> Get single market
|
|
76
|
+
|
|
77
|
+
<details>
|
|
78
|
+
<summary>Show code</summary>
|
|
79
|
+
|
|
80
|
+
```rb
|
|
81
|
+
@api.markets(market_name)
|
|
82
|
+
```
|
|
83
|
+
</details>
|
|
84
|
+
|
|
85
|
+
#### [GET /markets/{market_name}/orderbook?depth={depth}](https://docs.ftx.com/?ruby#get-markets)
|
|
86
|
+
|
|
87
|
+
> Get orderbook
|
|
88
|
+
|
|
89
|
+
<details>
|
|
90
|
+
<summary>Show code</summary>
|
|
91
|
+
|
|
92
|
+
```rb
|
|
93
|
+
# use default parameters
|
|
94
|
+
@api.orderbook(market_name)
|
|
95
|
+
|
|
96
|
+
# provide all possible parameters
|
|
97
|
+
@api.orderbook(market_name, depth: 3)
|
|
98
|
+
```
|
|
99
|
+
</details>
|
|
100
|
+
|
|
101
|
+
### Private Api Examples
|
|
102
|
+
|
|
103
|
+
```rb
|
|
104
|
+
access_key = 'YOUR_ACCESS_KEY'
|
|
105
|
+
secret_key = 'YOUR_SECRET_KEY'
|
|
106
|
+
|
|
107
|
+
@api = FtxExchangeApi::PrivateApi.new(access_key, secret_key)
|
|
108
|
+
```
|
|
29
109
|
|
|
30
110
|
## Development
|
|
31
111
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ftx_exchange_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- khiav reoy
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-09-
|
|
11
|
+
date: 2021-09-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|