delegate

package
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DaoProvider

type DaoProvider interface {
	GetByID(id uuid.UUID) (*dao.Dao, error)
}

type Delegate

type Delegate struct {
	Address               string
	ENSName               string
	DelegatorCount        int32
	PercentOfDelegators   float64
	VotingPower           float64
	PercentOfVotingPower  float64
	About                 string
	Statement             string
	VotesCount            int32
	CreatedProposalsCount int32
}

type EnsResolver

type EnsResolver interface {
	GetByNames(names []string) ([]ensresolver.EnsName, error)
	GetByAddresses(addresses []string) ([]ensresolver.EnsName, error)
	AddRequests(list []string)
}

type GetDelegateProfileRequest

type GetDelegateProfileRequest struct {
	DaoID   uuid.UUID
	Address string
}

type GetDelegateProfileResponse

type GetDelegateProfileResponse struct {
	Address              string
	VotingPower          float64
	IncomingPower        float64
	OutgoingPower        float64
	PercentOfVotingPower float64
	PercentOfDelegators  float64
	Delegates            []ProfileDelegateItem
	Expiration           *time.Time
}

type GetDelegatesRequest

type GetDelegatesRequest struct {
	DaoID         uuid.UUID
	QueryAccounts []string
	Sort          *string
	Limit         int
	Offset        int
}

type GetDelegatesResponse

type GetDelegatesResponse struct {
	Delegates []Delegate
	Total     int32
}

type ProfileDelegateItem

type ProfileDelegateItem struct {
	Address        string
	ENSName        string
	Weight         float64
	DelegatedPower float64
}

type Server

type Server struct {
	storagepb.UnimplementedDelegateServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(sp *Service) *Server

func (*Server) GetDelegates

type Service

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

func NewService

func NewService(dc delegatepb.DelegateClient, daoProvider DaoProvider, ensResolver EnsResolver) *Service

func (*Service) GetDelegateProfile

func (s *Service) GetDelegateProfile(ctx context.Context, request GetDelegateProfileRequest) (GetDelegateProfileResponse, error)

func (*Service) GetDelegates

func (s *Service) GetDelegates(ctx context.Context, request GetDelegatesRequest) (*GetDelegatesResponse, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL