Class: Eost::Eosscan
- Inherits:
-
Object
- Object
- Eost::Eosscan
- Defined in:
- lib/eost/eosscan.rb
Overview
classe para acesso dados blockchain EOS
Instance Attribute Summary collapse
-
#url ⇒ String
readonly
Endereco da API blockchain EOS.
Instance Method Summary collapse
-
#adapter ⇒ <Symbol>
Adapter for the connection - default :net_http.
-
#chain_get_account(**args) ⇒ Hash
Dados numa carteira EOS.
-
#conn ⇒ <Faraday::Connection>
manage the default properties and the middleware stack for fulfilling an HTTP request.
-
#history_get_actions(**args) ⇒ Hash
Dados das transacoes ligadas a uma carteira EOS.
-
#initialize(www: 'https://eos.greymass.com') ⇒ Eosscan
constructor
Acesso dados blockchain EOS.
Constructor Details
#initialize(www: 'https://eos.greymass.com') ⇒ Eosscan
Returns acesso dados blockchain EOS.
15 16 17 18 |
# File 'lib/eost/eosscan.rb', line 15 def initialize(www: 'https://eos.greymass.com') @url = www # load_specs end |
Instance Attribute Details
#url ⇒ String (readonly)
Returns endereco da API blockchain EOS.
10 11 12 |
# File 'lib/eost/eosscan.rb', line 10 def url @url end |
Instance Method Details
#adapter ⇒ <Symbol>
Returns adapter for the connection - default :net_http.
21 22 23 |
# File 'lib/eost/eosscan.rb', line 21 def adapter @adapter ||= Faraday.default_adapter end |
#chain_get_account(**args) ⇒ Hash
Returns dados numa carteira EOS.
98 99 100 |
# File 'lib/eost/eosscan.rb', line 98 def chain_get_account(**args) JSON.parse(conn.post('/v1/chain/get_account', args.to_json, content_type: 'application/json').body) end |
#conn ⇒ <Faraday::Connection>
manage the default properties and the middleware stack for fulfilling an HTTP request
28 29 30 31 32 33 34 |
# File 'lib/eost/eosscan.rb', line 28 def conn @conn ||= Faraday.new(url: url) do |c| c.request(:url_encoded) c.adapter(adapter) end end |
#history_get_actions(**args) ⇒ Hash
Returns dados das transacoes ligadas a uma carteira EOS.
154 155 156 |
# File 'lib/eost/eosscan.rb', line 154 def history_get_actions(**args) JSON.parse(conn.post('/v1/history/get_actions', args.to_json, content_type: 'application/json').body) end |