class Bloopi::API::Ether
Attributes
balance[R]
coin_symbol[R]
transaction_hash[R]
wallet[R]
Public Class Methods
balance(args, options = {})
click to toggle source
{:wallet_address=>“”}
# File lib/bloopi/api/ether.rb, line 16 def self.balance(args, options = {}) wallet_address = args[:wallet_address] response = Bloopi.make_request("/eth/#{wallet_address}", {}, "get", {:use_ssl => true}.merge!(options)) raise ServerError.new(response.status, response.body) if response.status >= 500 raise OAuthTokenRequestError.new(response.status, response.body) if response.status >= 400 response end
exchange(args, options = {})
click to toggle source
# File lib/bloopi/api/ether.rb, line 50 def self.exchange(args, options = {}) response = Bloopi.make_request("/eth/exchange/omg", {}.merge!(args), "post", {:use_ssl => true, format: :json}.merge!(options)) raise ServerError.new(response.status, response.body) if response.status >= 500 raise OAuthTokenRequestError.new(response.status, response.body) if response.status >= 400 response end
new(attributes)
click to toggle source
# File lib/bloopi/api/ether.rb, line 9 def initialize(attributes) @coin_symbol = attributes["coin_symbol"] @balance = attributes["balance"] @wallet_address = attributes["wallet_address"] end
new_wallet(args, options = {})
click to toggle source
# File lib/bloopi/api/ether.rb, line 25 def self.new_wallet(args, options = {}) response = Bloopi.make_request("/eth/new", {}.merge!(args), "post", {:use_ssl => true, format: :json}.merge!(options)) raise ServerError.new(response.status, response.body) if response.status >= 500 raise OAuthTokenRequestError.new(response.status, response.body) if response.status >= 400 response end
transfer(args, options = {})
click to toggle source
{:to_address=>“”, :from_address=>“”, :password=>“”, :quantity=>0.001}
# File lib/bloopi/api/ether.rb, line 37 def self.transfer(args, options = {}) response = Bloopi.make_request("/eth/send", {}.merge!(args), "post", {:use_ssl => true, format: :json}.merge!(options)) raise ServerError.new(response.status, response.body) if response.status >= 500 raise OAuthTokenRequestError.new(response.status, response.body) if response.status >= 400 response end