class IOSTSdk::Http::GetChainInfo

Public Instance Methods

invoke(base_url:) click to toggle source
# File lib/iost_sdk/http/get_chain_info.rb, line 8
def invoke(base_url:)
  resp = HTTParty.get("#{base_url}/getChainInfo")
  raise HttpRequestError.new(status_code: resp.code, body: resp.body) unless
    resp.code == 200

  IOSTSdk::Models::ChainInfo.new.populate(model_data: JSON.parse(resp.body))
end