Class: CardanoWallet::Shelley::StakePools

Inherits:
Base
  • Object
show all
Defined in:
lib/cardano_wallet/shelley.rb

Overview

API for StakePools

Examples:

@cw = CardanoWallet.new
@cw.shelley.stake_pools # API for Shelley StakePools

See Also:

Instance Attribute Summary

Attributes inherited from Base

#opt

Instance Method Summary collapse

Methods inherited from Base

#byron, #initialize, #misc, #shared, #shelley, #utils

Constructor Details

This class inherits a constructor from CardanoWallet::Base

Instance Method Details

#delegation_fees(wid) ⇒ Object

Estimate delegation fees



524
525
526
# File 'lib/cardano_wallet/shelley.rb', line 524

def delegation_fees(wid)
  self.class.get("/wallets/#{wid}/delegation-fees")
end

#join(sp_id, wid, passphrase) ⇒ Object

Join stake pool



508
509
510
511
512
# File 'lib/cardano_wallet/shelley.rb', line 508

def join(sp_id, wid, passphrase)
  self.class.put("/stake-pools/#{sp_id}/wallets/#{wid}",
                 body: { passphrase: passphrase }.to_json,
                 headers: { 'Content-Type' => 'application/json' })
end

#list(stake = {}) ⇒ Object

List all stake pools



495
496
497
498
# File 'lib/cardano_wallet/shelley.rb', line 495

def list(stake = {})
  query = stake.empty? ? '' : Utils.to_query(stake)
  self.class.get("/stake-pools#{query}")
end

#list_stake_keys(wid) ⇒ Object

List all stake keys



502
503
504
# File 'lib/cardano_wallet/shelley.rb', line 502

def list_stake_keys(wid)
  self.class.get("/wallets/#{wid}/stake-keys")
end

#quit(wid, passphrase) ⇒ Object

Quit stape pool



516
517
518
519
520
# File 'lib/cardano_wallet/shelley.rb', line 516

def quit(wid, passphrase)
  self.class.delete("#{@api}/stake-pools/*/wallets/#{wid}",
                    body: { passphrase: passphrase }.to_json,
                    headers: { 'Content-Type' => 'application/json' })
end

#trigger_maintenance_actions(action = {}) ⇒ Object

Stake pools maintenance actions

Examples:

maintenance_action({ "maintenance_action": "gc_stake_pools" })

See Also:



480
481
482
483
484
485
# File 'lib/cardano_wallet/shelley.rb', line 480

def trigger_maintenance_actions(action = {})
  Utils.verify_param_is_hash!(action)
  self.class.post('/stake-pools/maintenance-actions',
                  body: action.to_json,
                  headers: { 'Content-Type' => 'application/json' })
end

#view_maintenance_actionsObject

Metdata GC Status



489
490
491
# File 'lib/cardano_wallet/shelley.rb', line 489

def view_maintenance_actions
  self.class.get('/stake-pools/maintenance-actions')
end