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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8c98d28c76660b4cba23b7f79fb4ba8936d98c6
4
- data.tar.gz: 3f7521227309cf8e5d5bd4224a73e08b26be5c05
3
+ metadata.gz: 6d6e50b5d0bf07480589a5c0ace82601a66d604f
4
+ data.tar.gz: 36026e98e7ff68ec78b02fa5bc72d314de90c626
5
5
  SHA512:
6
- metadata.gz: 6f1cdfb069a098f5dadcfcb1f437edab13d56d737724ff044cff6aed07d72b9497313cc291c9ed74c56f4377ee000b2391cc5930b1e1f2da621276535ed4cc80
7
- data.tar.gz: 5a55b702a31ea62031b7f0341375ed79e4bee0ce99c3a7403d337f7094500159fe4acc9d0466555f234006d0ee682c9acf4fc47d2cbe33c2baf143c027834c68
6
+ metadata.gz: df673216a9422fa2f8ea644af39b95bcea54e79188e61d5ac7db882a38068ec16f7bc1e31ee2289b945c008667a2fb3892fb1cba833b409e07ad516be7421640
7
+ data.tar.gz: 89e3c77063db92f9f9507b60a96944718989cba9aea22357c618b077a6f2bafece7f39902bf09c8accf9e59b579ce3a5deef511a7e6fd2adb6ac93d8455560cf
data/README.md CHANGED
@@ -1,31 +1,34 @@
1
- # okcoin.cn Rest Api Ruby Wrapper
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
- 2. 名字等细节尽量与okcoin.cn保持一致,目前所有的api都完全和官方文档一致
5
+ 1. 保持跟踪最新的api
8
6
 
9
- ## Installation
10
7
 
11
- Add this line to your application's Gemfile:
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
- And then execute:
19
+ 然后执行命令:
18
20
 
19
21
  $ bundle
20
22
 
21
- Or install it yourself as:
23
+ 当然,你也可以手工安装:
22
24
 
23
25
  $ gem install okcoin
24
26
 
25
- ## Usage
27
+ ## 使用
26
28
 
27
29
  ```ruby
28
- client = Okcoin::Client.new 'https://www.okcoin.cn/api/', api_key: 'YOUR_OKCOIN_APIKEY', secret_key: 'YOUR_OKCOIN_SECRET'
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,secret_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
@@ -1,5 +1,3 @@
1
- require './base'
2
-
3
1
  module Okcoin
4
2
  class Client < Base
5
3
  # 行情 API
@@ -1,3 +1,3 @@
1
1
  module Okcoin
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/okcoin.rb CHANGED
@@ -1,4 +1,12 @@
1
1
  require "okcoin/version"
2
+ require "net/http"
3
+ require "uri"
4
+ require "json"
5
+ require "logger"
6
+ require "digest/md5"
7
+ require "okcoin/http_utils"
8
+ require "okcoin/api_define_tool"
9
+ require 'okcoin/base'
2
10
  require "okcoin/client"
3
11
 
4
12
  def logger
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: okcoin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wu Minzhe