Class: Beaconcha::Execution

Inherits:
Object
  • Object
show all
Defined in:
lib/beaconcha/execution.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_key: nil, uri_base: nil) ⇒ Execution

Returns a new instance of Execution.



3
4
5
6
# File 'lib/beaconcha/execution.rb', line 3

def initialize(api_key: nil, uri_base: nil)
  Beaconcha.configuration.api_key = api_key if api_key
  Beaconcha.configuration.uri_base = uri_base if uri_base
end

Instance Method Details

#address(address:, token: nil) ⇒ Object



12
13
14
# File 'lib/beaconcha/execution.rb', line 12

def address(address:, token: nil)
  Beaconcha::Client.get(path: "/execution/address/#{address}", query: { token: token })
end

#block(block_number:) ⇒ Object



16
17
18
# File 'lib/beaconcha/execution.rb', line 16

def block(block_number:)
  Beaconcha::Client.get(path: "/execution/block/#{block_number}")
end

#eth1deposit(txhash:) ⇒ Object



8
9
10
# File 'lib/beaconcha/execution.rb', line 8

def eth1deposit(txhash:)
  Beaconcha::Client.get(path: "/eth1deposit/#{txhash}")
end

#gasnowObject



20
21
22
# File 'lib/beaconcha/execution.rb', line 20

def gasnow
  Beaconcha::Client.get(path: "/execution/gasnow")
end

#produced(id:, limit: nil, offset: nil) ⇒ Object



24
25
26
27
# File 'lib/beaconcha/execution.rb', line 24

def produced(id:, limit: nil, offset: nil)
  Beaconcha::Client.get(path: "/execution/#{id}/produced",
                        query: { limit: limit, offset: offset })
end