Documentation ¶
Index ¶
- Constants
- Variables
- func ApiKeyInterceptor(apiKey string) clientv2.RequestInterceptor
- type GetVotingPowerParams
- type ListMessageOption
- type ListMessageOptions
- type ListProposalOption
- func ListProposalCreatedAfter(t time.Time) ListProposalOption
- func ListProposalWithIDFilter(proposalID ...string) ListProposalOption
- func ListProposalWithInterceptors(interceptors []clientv2.RequestInterceptor) ListProposalOption
- func ListProposalWithOrderBy(orderBy string, orderDirection client.OrderDirection) ListProposalOption
- func ListProposalWithPagination(limit, offset int) ListProposalOption
- func ListProposalWithSpacesFilter(spaceID ...string) ListProposalOption
- type ListProposalOptions
- type ListProposalOrderBy
- type ListProposalPagination
- type ListSpaceOption
- type ListSpaceOptions
- type ListVotesOption
- func ListVotesCreatedAfter(t time.Time) ListVotesOption
- func ListVotesWithInterceptors(interceptors []clientv2.RequestInterceptor) ListVotesOption
- func ListVotesWithOrderBy(orderBy string, orderDirection client.OrderDirection) ListVotesOption
- func ListVotesWithPagination(limit, offset int) ListVotesOption
- func ListVotesWithProposalIDsFilter(proposalID ...string) ListVotesOption
- type ListVotesOptions
- type Option
- type Options
- type RankingOption
- type RankingOptions
- type RankingPagination
- type Relayer
- type SDK
- func (s *SDK) GetProposalByID(ctx context.Context, id string, opts ...clientv2.RequestInterceptor) (*client.ProposalFragment, error)
- func (s *SDK) GetRanking(ctx context.Context, opts ...RankingOption) ([]string, error)
- func (s *SDK) GetSpaceByID(ctx context.Context, id string, opts ...clientv2.RequestInterceptor) (*client.SpaceFragment, error)
- func (s *SDK) GetVotingPower(ctx context.Context, params GetVotingPowerParams) (*client.VotingPowerFragment, error)
- func (s *SDK) ListMessage(ctx context.Context, opts ...ListMessageOption) ([]*client.MessageFragment, error)
- func (s *SDK) ListNetworks(ctx context.Context, opts ...clientv2.RequestInterceptor) ([]string, error)
- func (s *SDK) ListProposal(ctx context.Context, opts ...ListProposalOption) ([]*client.ProposalFragment, error)
- func (s *SDK) ListSpace(ctx context.Context, opts ...ListSpaceOption) ([]*client.SpaceFragment, error)
- func (s *SDK) ListVotes(ctx context.Context, opts ...ListVotesOption) ([]*client.VoteFragment, error)
- func (s *SDK) Validate(_ context.Context, params ValidationParams) (ValidationResponse, error)
- func (s *SDK) Vote(_ context.Context, params VoteParams) (VoteResult, error)
- func (s *SDK) VoteByID(ctx context.Context, id string) (*client.VoteFragment, error)
- type StrategyFragment
- type ValidationParams
- type ValidationResponse
- type VoteParams
- type VoteResult
Constants ¶
View Source
const ( ProductionHub = "https://hub.snapshot.org/graphql" ProductionScoreURL = "https://score.snapshot.org/" ProductionSeqURL = "https://seq.snapshot.org/" )
Variables ¶
View Source
var ErrProposalNotFound = errors.New("proposal not found")
View Source
var ErrSpaceNotFound = errors.New("space not found")
View Source
var ErrTooManyRequests = errors.New("too many requests")
Functions ¶
func ApiKeyInterceptor ¶
func ApiKeyInterceptor(apiKey string) clientv2.RequestInterceptor
Types ¶
type GetVotingPowerParams ¶
type ListMessageOption ¶ added in v0.4.1
type ListMessageOption func(options *ListMessageOptions)
func ListMessageWithInterceptors ¶ added in v0.4.1
func ListMessageWithInterceptors(interceptors []clientv2.RequestInterceptor) ListMessageOption
func ListMessageWithMCIFilter ¶ added in v0.4.1
func ListMessageWithMCIFilter(mci int) ListMessageOption
func ListMessageWithPagination ¶ added in v0.4.1
func ListMessageWithPagination(limit, offset int) ListMessageOption
type ListMessageOptions ¶ added in v0.4.1
type ListProposalOption ¶
type ListProposalOption func(*ListProposalOptions)
func ListProposalCreatedAfter ¶
func ListProposalCreatedAfter(t time.Time) ListProposalOption
func ListProposalWithIDFilter ¶
func ListProposalWithIDFilter(proposalID ...string) ListProposalOption
func ListProposalWithInterceptors ¶
func ListProposalWithInterceptors(interceptors []clientv2.RequestInterceptor) ListProposalOption
func ListProposalWithOrderBy ¶
func ListProposalWithOrderBy(orderBy string, orderDirection client.OrderDirection) ListProposalOption
func ListProposalWithPagination ¶
func ListProposalWithPagination(limit, offset int) ListProposalOption
func ListProposalWithSpacesFilter ¶
func ListProposalWithSpacesFilter(spaceID ...string) ListProposalOption
type ListProposalOptions ¶
type ListProposalOrderBy ¶
type ListProposalOrderBy struct { OrderBy string OrderDirection client.OrderDirection }
type ListProposalPagination ¶
type ListSpaceOption ¶
type ListSpaceOption func(options *ListSpaceOptions)
func ListSpaceWithIDFilter ¶
func ListSpaceWithIDFilter(spaceID ...string) ListSpaceOption
func ListSpaceWithInterceptors ¶
func ListSpaceWithInterceptors(interceptors []clientv2.RequestInterceptor) ListSpaceOption
func ListSpaceWithPagination ¶
func ListSpaceWithPagination(limit, offset int) ListSpaceOption
type ListSpaceOptions ¶
type ListVotesOption ¶
type ListVotesOption func(options *ListVotesOptions)
func ListVotesCreatedAfter ¶
func ListVotesCreatedAfter(t time.Time) ListVotesOption
func ListVotesWithInterceptors ¶
func ListVotesWithInterceptors(interceptors []clientv2.RequestInterceptor) ListVotesOption
func ListVotesWithOrderBy ¶
func ListVotesWithOrderBy(orderBy string, orderDirection client.OrderDirection) ListVotesOption
func ListVotesWithPagination ¶
func ListVotesWithPagination(limit, offset int) ListVotesOption
func ListVotesWithProposalIDsFilter ¶
func ListVotesWithProposalIDsFilter(proposalID ...string) ListVotesOption
type ListVotesOptions ¶
type Option ¶
type Option func(opts *Options)
func WithApiKey ¶
func WithBaseURL ¶
func WithHTTPClient ¶
func WithInterceptors ¶
func WithInterceptors(interceptors []clientv2.RequestInterceptor) Option
func WithOptions ¶
type RankingOption ¶
type RankingOption func(options *RankingOptions)
func RankingWithCategory ¶
func RankingWithCategory(category string) RankingOption
func RankingWithInterceptors ¶
func RankingWithInterceptors(interceptors []clientv2.RequestInterceptor) RankingOption
func RankingWithNetwork ¶
func RankingWithNetwork(network string) RankingOption
func RankingWithPagination ¶
func RankingWithPagination(limit, offset int) RankingOption
type RankingOptions ¶
type RankingPagination ¶
type SDK ¶
type SDK struct {
// contains filtered or unexported fields
}
func (*SDK) GetProposalByID ¶
func (s *SDK) GetProposalByID(ctx context.Context, id string, opts ...clientv2.RequestInterceptor) (*client.ProposalFragment, error)
func (*SDK) GetRanking ¶
func (*SDK) GetSpaceByID ¶
func (s *SDK) GetSpaceByID(ctx context.Context, id string, opts ...clientv2.RequestInterceptor) (*client.SpaceFragment, error)
func (*SDK) GetVotingPower ¶
func (s *SDK) GetVotingPower(ctx context.Context, params GetVotingPowerParams) (*client.VotingPowerFragment, error)
func (*SDK) ListMessage ¶ added in v0.4.1
func (s *SDK) ListMessage(ctx context.Context, opts ...ListMessageOption) ([]*client.MessageFragment, error)
func (*SDK) ListNetworks ¶
func (*SDK) ListProposal ¶
func (s *SDK) ListProposal(ctx context.Context, opts ...ListProposalOption) ([]*client.ProposalFragment, error)
func (*SDK) ListSpace ¶
func (s *SDK) ListSpace(ctx context.Context, opts ...ListSpaceOption) ([]*client.SpaceFragment, error)
func (*SDK) ListVotes ¶
func (s *SDK) ListVotes(ctx context.Context, opts ...ListVotesOption) ([]*client.VoteFragment, error)
func (*SDK) Validate ¶
func (s *SDK) Validate(_ context.Context, params ValidationParams) (ValidationResponse, error)
func (*SDK) Vote ¶
func (s *SDK) Vote(_ context.Context, params VoteParams) (VoteResult, error)
type StrategyFragment ¶
type ValidationParams ¶
type ValidationResponse ¶
type ValidationResponse struct {
Result bool `json:"result"`
}
type VoteParams ¶
type VoteResult ¶
Click to show internal directories.
Click to hide internal directories.