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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 855ee74786a3de1374e5c2bb853f8078d0a8b1bb47d75172086a0f5e70f45f48
4
- data.tar.gz: ef9dbf8d6ececa26a46c6c2ccd7bb355a45eeafd24eefb857fb62e5970591f53
3
+ metadata.gz: 66bd451b62c8206a8910fd8b8a13de11aa21f1d9def06711e271e879dc5d2a9c
4
+ data.tar.gz: 4c339ee8b7358f2b39a5c2eae3d7dd706680bdf51de35fee4d2712b301517bd0
5
5
  SHA512:
6
- metadata.gz: 5436d4efcbd409b7c3ba27ed57c527db7b31b7dbf849170000926a5fbd2f0d8a37ef4c5f1dac431ceb2146921fb970b64e4f7ee3f7b71d2ea89572b5cbc2eb99
7
- data.tar.gz: 39a5a1002dea3206044e6d70d780dc0cdff9047fe6d3fa94497fdddccd2c59def956ac3f50f88d41a815bc95fd41e60989bb20c74b84139875bd3412a9f98469
6
+ metadata.gz: ba11caef7c7e5637a55dcede4cb37593efce18e96711e0190e457fe2a7788c8d12a7f4f25db67729d616251b1bb5204f600e4602361bc71a12f4aa85f508a632
7
+ data.tar.gz: 93961919cb301762ffaa097ecbd6e54cd069623ee0ba5f1583d1a6b04601285f3555d683c868e31883d354fe0f6f916c3c76941f08b356c0b2c7f009b0612676
data/CHANGELOG.md CHANGED
@@ -1 +1,4 @@
1
- ## Change Log
1
+ ## Change Log
2
+
3
+ ### v0.0.1 2021/09/15
4
+ - [#1](https://github.com/khiav223577/ftx_exchange_api/pull/1) Implement markets and orderbook API (@khiav223577)
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # ftx_exchange_api
1
+ # FtxExchangeApi
2
2
 
3
3
  [![Gem Version](https://img.shields.io/gem/v/ftx_exchange_api.svg?style=flat)](http://rubygems.org/gems/ftx_exchange_api)
4
4
  [![Build Status](https://github.com/khiav223577/ftx_exchange_api/workflows/Ruby/badge.svg)](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
 
@@ -21,7 +21,7 @@ module FtxExchangeApi
21
21
  protected
22
22
 
23
23
  def send_request(method, path, query)
24
- super(method, path, {}, query)
24
+ super(method, path, {}, query.reject{|_k, v| v == nil })
25
25
  end
26
26
  end
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module FtxExchangeApi
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
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.1
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-15 00:00:00.000000000 Z
11
+ date: 2021-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler