class Object

Public Instance Methods

connection() click to toggle source
# File lib/peatio/goldcoin/client.rb, line 67
def connection
  @connection ||= Faraday.new(@json_rpc_endpoint) do |f|
    f.adapter :net_http_persistent, pool_size: 5
  end.tap do |connection|
    unless @json_rpc_endpoint.user.blank?
      connection.basic_auth(@json_rpc_endpoint.user,
                            @json_rpc_endpoint.password)
    end
  end
end
post(method, params) click to toggle source
# File lib/peatio/goldcoin/client.rb, line 62
def post(method, params)
  connection.post("/", {jsonrpc: "1.0", method: method, params: params}.to_json,
                  "Accept" => "application/json", "Content-Type" => "application/json")
end