ant-pool-api 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +70 -0
- data/lib/ant.rb +1 -1
- data/lib/ant/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9749a1cbd3429ef71ebfb98b577d18a3b6ab9c82
|
4
|
+
data.tar.gz: 8856981345eae9821ca165f57680ad3058c05b37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 736ec82941124af400208cc25c8d4c21fd4f48e7421eee9072314a5e1c72cdb8e2b2dcf70e7fcf104e8703a36e8bd3fff9289ed6838dff17ab178dfe7e6833a5
|
7
|
+
data.tar.gz: 79cdcb0622f438c32117a1364d0d8f6bc5bbeb70d3947816d9f342eee776c90890de633c8f508700e018b02f81ce4d9f89cf43c088796a663a38eee8845ccc6f
|
data/README.md
CHANGED
@@ -0,0 +1,70 @@
|
|
1
|
+
antpool
|
2
|
+
=======
|
3
|
+
|
4
|
+
ANT-POOL API integration. Ruby gem.
|
5
|
+
|
6
|
+
Installation
|
7
|
+
------------
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```
|
12
|
+
gem 'ant-pool-api', :require => 'ant'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
```
|
18
|
+
$ bundle
|
19
|
+
```
|
20
|
+
|
21
|
+
Usage
|
22
|
+
-----
|
23
|
+
|
24
|
+
##How to use?
|
25
|
+
|
26
|
+
###1. Create your ruby project
|
27
|
+
|
28
|
+
###2. Add "require 'ant'"
|
29
|
+
|
30
|
+
###3. Create class
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
api = Ant::API.new(username, api_key, api_secret)
|
34
|
+
```
|
35
|
+
|
36
|
+
```
|
37
|
+
username - your username on ant-pool
|
38
|
+
api_key - your API key
|
39
|
+
api_secret - your API secret code
|
40
|
+
```
|
41
|
+
|
42
|
+
####c) Full API documentation: https://119.9.76.150/apiGuild.htm
|
43
|
+
|
44
|
+
###4. Examples
|
45
|
+
|
46
|
+
####Connect and get balance:
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
# -*- encoding : utf-8 -*-
|
50
|
+
require 'rubygems'
|
51
|
+
require 'ant'
|
52
|
+
|
53
|
+
api = Ant::API.new(username, api_key, api_secret)
|
54
|
+
puts api.account
|
55
|
+
|
56
|
+
```
|
57
|
+
|
58
|
+
```json
|
59
|
+
{"code":0, "message":"ok", "data":{"earn24Hours":"0.00000000", "earnTotal":"0.00000000", "paidOut":"0.00000000", "balance":"0.00000000"}}
|
60
|
+
```
|
61
|
+
|
62
|
+
####Get Hashrate:
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
puts api.hashrate
|
66
|
+
```
|
67
|
+
|
68
|
+
```json
|
69
|
+
{"code":0, "message":"ok", "data":{"last5m":"0", "last15m":"0", "last1h":"0", "last1d":"0", "prev5m":"0", "prev15m":"0", "prev1h":"0", "prev1d":"0", "accepted":"0", "stale":"0", "dupelicate":"0", "other":"0"}}
|
70
|
+
```
|
data/lib/ant.rb
CHANGED
@@ -20,7 +20,7 @@ module Ant
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def api_call(method, param = {}, priv = false, is_json = true)
|
23
|
-
url = "https://
|
23
|
+
url = "https://www.antpool.com/api/#{ method }"
|
24
24
|
if priv
|
25
25
|
self.nonce
|
26
26
|
param.merge!(:key => self.api_key, :signature => self.signature.to_s.upcase, :nonce => self.nonce_v)
|
data/lib/ant/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ant-pool-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
|
- charls
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-08-
|
12
|
+
date: 2014-08-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|