okcoin 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -11
- data/lib/okcoin/base.rb +1 -9
- data/lib/okcoin/client.rb +0 -2
- data/lib/okcoin/version.rb +1 -1
- data/lib/okcoin.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d6e50b5d0bf07480589a5c0ace82601a66d604f
|
4
|
+
data.tar.gz: 36026e98e7ff68ec78b02fa5bc72d314de90c626
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df673216a9422fa2f8ea644af39b95bcea54e79188e61d5ac7db882a38068ec16f7bc1e31ee2289b945c008667a2fb3892fb1cba833b409e07ad516be7421640
|
7
|
+
data.tar.gz: 89e3c77063db92f9f9507b60a96944718989cba9aea22357c618b077a6f2bafece7f39902bf09c8accf9e59b579ce3a5deef511a7e6fd2adb6ac93d8455560cf
|
data/README.md
CHANGED
@@ -1,31 +1,34 @@
|
|
1
|
-
#
|
1
|
+
# 币行中国站接口 Ruby 实现
|
2
2
|
|
3
|
-
okcoin.cn的Rest Api很简单易懂,但是官方并有提供ruby实现,并且其他ruby
|
4
|
-
|
5
|
-
1. 保持跟踪最新的api
|
3
|
+
okcoin.cn的Rest Api很简单易懂,但是官方并有提供ruby实现,并且其他ruby实现都没有更新或者是国际站的实现,所以决定自己写一个,目前实现了全部Rest API。
|
6
4
|
|
7
|
-
|
5
|
+
1. 保持跟踪最新的api
|
8
6
|
|
9
|
-
## Installation
|
10
7
|
|
11
|
-
|
8
|
+
2. 名字等细节尽量与okcoin.cn保持一致,目前所有的api都完全和官方文档一致
|
9
|
+
|
10
|
+
|
11
|
+
## 安装
|
12
|
+
|
13
|
+
把下面这行加到你的 Gemfile里面:
|
12
14
|
|
13
15
|
```ruby
|
14
16
|
gem 'okcoin'
|
15
17
|
```
|
16
18
|
|
17
|
-
|
19
|
+
然后执行命令:
|
18
20
|
|
19
21
|
$ bundle
|
20
22
|
|
21
|
-
|
23
|
+
当然,你也可以手工安装:
|
22
24
|
|
23
25
|
$ gem install okcoin
|
24
26
|
|
25
|
-
##
|
27
|
+
## 使用
|
26
28
|
|
27
29
|
```ruby
|
28
|
-
|
30
|
+
# url可选,默认就是https://www.okcoin.cn/api/,后面两个必选
|
31
|
+
client = Okcoin::Client.new url: 'https://www.okcoin.cn/api/', api_key: 'YOUR_OKCOIN_APIKEY', secret_key: 'YOUR_OKCOIN_SECRET'
|
29
32
|
client.ticker(symbol: "btc_cny")
|
30
33
|
client.trades(symbol: 'btc_cny', since: nil)
|
31
34
|
```
|
@@ -36,6 +39,8 @@ client.trades(symbol: 'btc_cny', since: nil)
|
|
36
39
|
|
37
40
|
## Contributing
|
38
41
|
|
42
|
+
如果有问题给我发邮件:wuminzhe@126.com,也是我的支付宝账号😆
|
43
|
+
|
39
44
|
Bug reports and pull requests are welcome on GitHub at https://github.com/wuminzhe/okcoin. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
40
45
|
|
41
46
|
|
data/lib/okcoin/base.rb
CHANGED
@@ -1,18 +1,10 @@
|
|
1
|
-
require "net/http"
|
2
|
-
require "uri"
|
3
|
-
require "json"
|
4
|
-
require "logger"
|
5
|
-
require "digest/md5"
|
6
|
-
require "./http_utils"
|
7
|
-
require "./api_define_tool"
|
8
|
-
|
9
1
|
module Okcoin
|
10
2
|
|
11
3
|
class Base
|
12
4
|
include HttpUtils
|
13
5
|
extend ApiDefineTool
|
14
6
|
|
15
|
-
def initialize(url,api_key
|
7
|
+
def initialize(url: 'https://www.okcoin.cn/api/', api_key:, secret_key:)
|
16
8
|
@url = url
|
17
9
|
@api_key = api_key
|
18
10
|
@secret_key = secret_key
|
data/lib/okcoin/client.rb
CHANGED
data/lib/okcoin/version.rb
CHANGED
data/lib/okcoin.rb
CHANGED