Class: Beaconcha::Validator

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Validator.



3
4
5
6
# File 'lib/beaconcha/validator.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

#attestationeffectiveness(id:) ⇒ Object



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

def attestationeffectiveness(id:)
  Beaconcha::Client.get(path: "/validator/#{id}/attestationeffectiveness")
end

#attestationefficiency(id:) ⇒ Object



29
30
31
# File 'lib/beaconcha/validator.rb', line 29

def attestationefficiency(id:)
  Beaconcha::Client.get(path: "/validator/#{id}/attestationefficiency")
end

#attestations(id:) ⇒ Object



33
34
35
# File 'lib/beaconcha/validator.rb', line 33

def attestations(id:)
  Beaconcha::Client.get(path: "/validator/#{id}/attestations")
end

#balancehistory(id:, latest_epoch: nil, limit: nil, offset: nil) ⇒ Object



37
38
39
40
41
# File 'lib/beaconcha/validator.rb', line 37

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

#deposits(id:) ⇒ Object



43
44
45
# File 'lib/beaconcha/validator.rb', line 43

def deposits(id:)
  Beaconcha::Client.get(path: "/validator/#{id}/deposits")
end

#eth1(address:, limit: nil, offset: nil) ⇒ Object



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

def eth1(address:, limit: nil, offset: nil)
  Beaconcha::Client.get(path: "/validator/eth1/#{address}",
                        query: { limit: limit, offset: offset })
end

#execution_performance(id:) ⇒ Object



47
48
49
# File 'lib/beaconcha/validator.rb', line 47

def execution_performance(id:)
  Beaconcha::Client.get(path: "/validator/#{id}/execution/performance")
end

#incomedetailhistory(id:) ⇒ Object



51
52
53
# File 'lib/beaconcha/validator.rb', line 51

def incomedetailhistory(id:)
  Beaconcha::Client.get(path: "/validator/#{id}/incomedetailhistory")
end

#leaderboardObject



13
14
15
# File 'lib/beaconcha/validator.rb', line 13

def leaderboard
  Beaconcha::Client.get(path: "/validator/leaderboard")
end

#performance(id:) ⇒ Object



55
56
57
# File 'lib/beaconcha/validator.rb', line 55

def performance(id:)
  Beaconcha::Client.get(path: "/validator/#{id}/performance")
end

#proposals(id:, epoch: nil) ⇒ Object



59
60
61
# File 'lib/beaconcha/validator.rb', line 59

def proposals(id:, epoch: nil)
  Beaconcha::Client.get(path: "/validator/#{id}/proposals", query: { epoch: epoch })
end

#queueObject



63
64
65
# File 'lib/beaconcha/validator.rb', line 63

def queue
  Beaconcha::Client.get(path: "/validators/queue")
end

#retrieve(id:) ⇒ Object



21
22
23
# File 'lib/beaconcha/validator.rb', line 21

def retrieve(id:)
  Beaconcha::Client.get(path: "/validator/#{id}")
end

#stats(id:) ⇒ Object



17
18
19
# File 'lib/beaconcha/validator.rb', line 17

def stats(id:)
  Beaconcha::Client.get(path: "/validator/stats/#{id}")
end