go-tezos: github.com/DefinitelyNotAGoat/go-tezos/delegate Index | Files

package delegate

import "github.com/DefinitelyNotAGoat/go-tezos/delegate"

Index

Package Files

delegate.go interfaces.go mocks.go

type BakingRights Uses

type BakingRights []struct {
    Level         int       `json:"level"`
    Delegate      string    `json:"delegate"`
    Priority      int       `json:"priority"`
    EstimatedTime time.Time `json:"estimated_time"`
}

BakingRights a representation of baking rights on the Tezos network

type Delegate Uses

type Delegate struct {
    Balance              string                 `json:"balance"`
    FrozenBalance        string                 `json:"frozen_balance"`
    FrozenBalanceByCycle []frozenBalanceByCycle `json:"frozen_balance_by_cycle"`
    StakingBalance       string                 `json:"staking_balance"`
    DelegateContracts    []string               `json:"delegated_contracts"`
    DelegatedBalance     string                 `json:"delegated_balance"`
    Deactivated          bool                   `json:"deactivated"`
    GracePeriod          int                    `json:"grace_period"`
}

Delegate is representation of a delegate on the Tezos Network

type DelegateReport Uses

type DelegateReport struct {
    DelegatePhk      string
    Cycle            int
    Delegations      []DelegationReport
    CycleRewards     string
    TotalFeeRewards  string
    SelfBakedRewards string
    TotalRewards     string
}

DelegateReport represents a rewards report for a delegate and all their delegations for a cycle

func (*DelegateReport) GetPayments Uses

func (dr *DelegateReport) GetPayments(minimum int) []Payment

GetPayments will convert a delegate report into payments for batch pay with a minimum requirement in mutez

type DelegateService Uses

type DelegateService struct {
    // contains filtered or unexported fields
}

DelegateService is a struct wrapper for delegate related functions

func NewDelegateService Uses

func NewDelegateService(tzclient tzc.TezosClient, blockService block.TezosBlockService, snapshotService snapshot.TezosSnapshotService, accountService account.TezosAccountService, constants network.Constants) *DelegateService

NewDelegateService returns a new DelegateService

func (*DelegateService) GetAllDelegates Uses

func (d *DelegateService) GetAllDelegates() ([]string, error)

GetAllDelegates a list of all tz1 addresses at the head block

func (*DelegateService) GetAllDelegatesByHash Uses

func (d *DelegateService) GetAllDelegatesByHash(hash string) ([]string, error)

GetAllDelegatesByHash gets a list of all tz1 addresses at a certain hash

func (*DelegateService) GetBakingRights Uses

func (d *DelegateService) GetBakingRights(cycle int) (BakingRights, error)

GetBakingRights gets the baking rights for a specific cycle

func (*DelegateService) GetBakingRightsForDelegate Uses

func (d *DelegateService) GetBakingRightsForDelegate(cycle int, delegatePhk string, priority int) (BakingRights, error)

GetBakingRightsForDelegate gets the baking rights for a delegate at a specific cycle with a certain priority level

func (*DelegateService) GetDelegate Uses

func (d *DelegateService) GetDelegate(delegatePhk string) (Delegate, error)

GetDelegate retrieves information about a delegate at the head block

func (*DelegateService) GetDelegations Uses

func (d *DelegateService) GetDelegations(delegatePhk string) ([]string, error)

GetDelegations retrieves a list of all currently delegated contracts for a delegate.

func (*DelegateService) GetDelegationsAtCycle Uses

func (d *DelegateService) GetDelegationsAtCycle(delegatePhk string, cycle int) ([]string, error)

GetDelegationsAtCycle retrieves a list of all currently delegated contracts for a delegate at a specific cycle.

func (*DelegateService) GetEndorsingRights Uses

func (d *DelegateService) GetEndorsingRights(cycle int) (EndorsingRights, error)

GetEndorsingRights gets the endorsing rights for a specific cycle

func (*DelegateService) GetEndorsingRightsForDelegate Uses

func (d *DelegateService) GetEndorsingRightsForDelegate(cycle int, delegatePhk string) (EndorsingRights, error)

GetEndorsingRightsForDelegate gets the endorsing rights for a specific cycle

func (*DelegateService) GetReport Uses

func (d *DelegateService) GetReport(delegatePhk string, cycle int, fee float64) (*DelegateReport, error)

GetReport gets the total rewards for a delegate earned and calculates the gross rewards earned by each delegation for a single cycle. Also includes the share of each delegation.

func (*DelegateService) GetRewards Uses

func (d *DelegateService) GetRewards(delegatePhk string, cycle int) (string, error)

GetRewards gets the rewards earned by a delegate for a specific cycle.

func (*DelegateService) GetStakingBalance Uses

func (d *DelegateService) GetStakingBalance(delegateAddr string, cycle int) (float64, error)

GetStakingBalance gets the staking balance for a delegate at a specific snapshot for a cycle.

func (*DelegateService) GetStakingBalanceAtCycle Uses

func (d *DelegateService) GetStakingBalanceAtCycle(delegateAddr string, cycle int) (string, error)

GetStakingBalanceAtCycle gets the staking balance of a delegate at a specific cycle

type DelegationReport Uses

type DelegationReport struct {
    DelegationPhk string
    Share         float64
    GrossRewards  string
    Fee           string
    NetRewards    string
}

DelegationReport represents a rewards report for a delegation in DelegateReport

type EndorsingRights Uses

type EndorsingRights []struct {
    Level         int       `json:"level"`
    Delegate      string    `json:"delegate"`
    Slots         []int     `json:"slots"`
    EstimatedTime time.Time `json:"estimated_time"`
}

EndorsingRights is a representation of endorsing rights on the Tezos network

type FrozenBalanceRewards Uses

type FrozenBalanceRewards struct {
    Deposits string `json:"deposits"`
    Fees     string `json:"fees"`
    Rewards  string `json:"rewards"`
}

FrozenBalanceRewards is a FrozenBalanceRewards query returned by the Tezos RPC API.

type Payment Uses

type Payment struct {
    Address string
    Amount  float64
}

Payment is a helper struct for transfers

type TezosDelegateService Uses

type TezosDelegateService interface {
    GetDelegations(delegatePhk string) ([]string, error)
    GetDelegationsAtCycle(delegatePhk string, cycle int) ([]string, error)
    GetReport(delegatePhk string, cycle int, fee float64) (*DelegateReport, error)
    // GetPayments(minimum int) []Payment
    GetRewards(delegatePhk string, cycle int) (string, error)
    GetDelegate(delegatePhk string) (Delegate, error)
    GetStakingBalanceAtCycle(delegateAddr string, cycle int) (string, error)
    GetBakingRights(cycle int) (BakingRights, error)
    GetBakingRightsForDelegate(cycle int, delegatePhk string, priority int) (BakingRights, error)
    GetEndorsingRightsForDelegate(cycle int, delegatePhk string) (EndorsingRights, error)
    GetEndorsingRights(cycle int) (EndorsingRights, error)
    GetAllDelegatesByHash(hash string) ([]string, error)
    GetAllDelegates() ([]string, error)
    GetStakingBalance(delegateAddr string, cycle int) (float64, error)
}

Package delegate imports 9 packages (graph) and is imported by 5 packages. Updated 2019-12-11. Refresh now. Tools for package owners.