blupee 0.1.1 → 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/lib/blupee.rb +2 -0
- data/lib/blupee/api/ether.rb +1 -6
- data/lib/blupee/api/omise_go.rb +36 -0
- data/lib/blupee/api/token.rb +36 -0
- data/lib/blupee/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6554c0e03b6aedb2704e7069bc52ced45decbcb
|
4
|
+
data.tar.gz: fbc05ebe2ca32e07296214f887b7a0a5c5bab543
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8eda395acd13786af39813fc6139d975d712203c0723930d75b838206f4a1fa559d705f9fdec513ce19f0f719fe413a50940864673c4a5818b17e53f09d843b4
|
7
|
+
data.tar.gz: 4bbeba25293dce539ca045e29e4c72cee7505d81f4fbe4cf82b23e98734fd3a97ef9c0f30eb5e7a77eaa5a6b8de5c6928c467e18e893d1b497d3fe375896bcad
|
data/lib/blupee.rb
CHANGED
@@ -6,6 +6,8 @@ require_relative "blupee/http_service"
|
|
6
6
|
require_relative "blupee/http_service/request"
|
7
7
|
require_relative "blupee/http_service/response"
|
8
8
|
require_relative "blupee/api/ether"
|
9
|
+
require_relative "blupee/api/omise_go"
|
10
|
+
require_relative "blupee/api/token"
|
9
11
|
|
10
12
|
module Blupee
|
11
13
|
|
data/lib/blupee/api/ether.rb
CHANGED
@@ -32,7 +32,7 @@ module Blupee
|
|
32
32
|
end
|
33
33
|
|
34
34
|
# {:to_address=>"", :from_address=>"", :password=>"", :quantity=>0.001}
|
35
|
-
def self.
|
35
|
+
def self.transfer(args, options = {})
|
36
36
|
response = Blupee.make_request("/eth/send",
|
37
37
|
{}.merge!(args),
|
38
38
|
"post",
|
@@ -44,11 +44,6 @@ module Blupee
|
|
44
44
|
response
|
45
45
|
end
|
46
46
|
|
47
|
-
|
48
|
-
def self.all
|
49
|
-
eth_wallet = JSON.parse(response.body)
|
50
|
-
eth_wallet.map { |attributes| new(attributes) }
|
51
|
-
end
|
52
47
|
end
|
53
48
|
end
|
54
49
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
module Blupee
|
5
|
+
module API
|
6
|
+
class OmiseGo
|
7
|
+
attr_reader :coin_symbol, :balance, :wallet, :transaction_hash
|
8
|
+
|
9
|
+
def initialize(attributes)
|
10
|
+
@coin_symbol = attributes["coin_symbol"]
|
11
|
+
@balance = attributes["balance"]
|
12
|
+
@wallet_address = attributes["wallet_address"]
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.balance(id, options = {})
|
16
|
+
response = Blupee.make_request("/omg/#{id}", {}, "get", {:use_ssl => true}.merge!(options))
|
17
|
+
raise ServerError.new(response.status, response.body) if response.status >= 500
|
18
|
+
raise OAuthTokenRequestError.new(response.status, response.body) if response.status >= 400
|
19
|
+
response
|
20
|
+
end
|
21
|
+
|
22
|
+
# {:to_address=>"", :from_address=>"", :password=>"", :quantity=>0.001}
|
23
|
+
def self.transfer(args, options = {})
|
24
|
+
response = Blupee.make_request("/omg/send",
|
25
|
+
{}.merge!(args),
|
26
|
+
"post",
|
27
|
+
{:use_ssl => true,
|
28
|
+
format: :json}.merge!(options))
|
29
|
+
|
30
|
+
raise ServerError.new(response.status, response.body) if response.status >= 500
|
31
|
+
raise OAuthTokenRequestError.new(response.status, response.body) if response.status >= 400
|
32
|
+
response
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
module Blupee
|
5
|
+
module API
|
6
|
+
class Token
|
7
|
+
attr_reader :coin_symbol, :balance, :wallet, :transaction_hash
|
8
|
+
|
9
|
+
def initialize(attributes)
|
10
|
+
@coin_symbol = attributes["coin_symbol"]
|
11
|
+
@balance = attributes["balance"]
|
12
|
+
@wallet_address = attributes["wallet_address"]
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.balance(contract_id, wallet_address, options = {})
|
16
|
+
response = Blupee.make_request("/token/#{contract_id}/#{wallet_address}", {}, "get", {:use_ssl => true}.merge!(options))
|
17
|
+
raise ServerError.new(response.status, response.body) if response.status >= 500
|
18
|
+
raise OAuthTokenRequestError.new(response.status, response.body) if response.status >= 400
|
19
|
+
response
|
20
|
+
end
|
21
|
+
|
22
|
+
# {:to_address=>"", :from_address=>"", :password=>"", :quantity=>0.001, :contract_address=>""}
|
23
|
+
def self.transfer(args, options = {})
|
24
|
+
response = Blupee.make_request("/token/send",
|
25
|
+
{}.merge!(args),
|
26
|
+
"post",
|
27
|
+
{:use_ssl => true,
|
28
|
+
format: :json}.merge!(options))
|
29
|
+
|
30
|
+
raise ServerError.new(response.status, response.body) if response.status >= 500
|
31
|
+
raise OAuthTokenRequestError.new(response.status, response.body) if response.status >= 400
|
32
|
+
response
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/lib/blupee/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blupee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blupee Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -167,6 +167,8 @@ extra_rdoc_files: []
|
|
167
167
|
files:
|
168
168
|
- lib/blupee.rb
|
169
169
|
- lib/blupee/api/ether.rb
|
170
|
+
- lib/blupee/api/omise_go.rb
|
171
|
+
- lib/blupee/api/token.rb
|
170
172
|
- lib/blupee/auth.rb
|
171
173
|
- lib/blupee/configuration.rb
|
172
174
|
- lib/blupee/errors.rb
|