Documentation ¶
Index ¶
- type AddressFilter
- type DateFilter
- type EpochFilter
- type PeriodEndTimeFilter
- func (PeriodEndTimeFilter) Eq(value time.Time) *filter.Term
- func (PeriodEndTimeFilter) Gt(value time.Time) *filter.Term
- func (PeriodEndTimeFilter) Gte(value time.Time) *filter.Term
- func (PeriodEndTimeFilter) Lt(value time.Time) *filter.Term
- func (PeriodEndTimeFilter) Lte(value time.Time) *filter.Term
- type RewardIterator
- type RewardIteratorImpl
- type RewardsServiceClient
- func (s *RewardsServiceClient) Close() error
- func (s *RewardsServiceClient) Connection() *grpc.ClientConndeprecated
- func (s *RewardsServiceClient) ListRewards(ctx context.Context, req *stakingpb.ListRewardsRequest, opts ...gax.CallOption) RewardIterator
- func (s *RewardsServiceClient) ListStakes(ctx context.Context, req *stakingpb.ListStakesRequest, opts ...gax.CallOption) StakeIterator
- type StakeIterator
- type StakeIteratorImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressFilter ¶
type AddressFilter struct{}
AddressFilter is a custom type to define filter operation on the address field.
func WithAddress ¶
func WithAddress() AddressFilter
WithAddress instructs the backend API to return rewards aggregations that have `address` set in a manner which matches the desired filter. Needs a companion equals operator to be functional (ex: WithAddress().Eq("my_address").
type DateFilter ¶
type DateFilter struct{}
DateFilter is a custom type to define filter operation on the date.
func WithDate ¶
func WithDate() DateFilter
WithDate instructs the backend API to return rewards aggregations that have `date` set in a manner which matches the desired filter. Needs a companion comparison operator (ex: >, <, =, etc) to be functional.
func (DateFilter) Eq ¶
func (DateFilter) Eq(value string) *filter.Term
Eq method is a custom method to define the equals operation on the date.
func (DateFilter) Gt ¶
func (DateFilter) Gt(value string) *filter.Term
Gt method is a custom method to define the greater than operation on the date.
func (DateFilter) Gte ¶
func (DateFilter) Gte(value string) *filter.Term
Gte method is a custom method to define the greater than or equals operation on the date.
func (DateFilter) Lt ¶
func (DateFilter) Lt(value string) *filter.Term
Lt method is a custom method to define the less than operation on the date.
type EpochFilter ¶
type EpochFilter struct{}
EpochFilter is a custom type to define filter operation on the epoch field.
func WithEpoch ¶
func WithEpoch() EpochFilter
WithEpoch instructs the backend API to return rewards aggregations that have `epoch` set in a manner which matches the desired filter. Needs a companion comparison operator (ex: >, <, =, etc) to be functional.
func (EpochFilter) Eq ¶
func (EpochFilter) Eq(value int) *filter.Term
Eq method is a custom method to define the equals operation on the epoch field.
func (EpochFilter) Gt ¶
func (EpochFilter) Gt(value int) *filter.Term
Gt method is a custom method to define the greater than operation on the epoch field.
func (EpochFilter) Gte ¶
func (EpochFilter) Gte(value int) *filter.Term
Gte method is a custom method to define the greater than or equals operation on the epoch field.
func (EpochFilter) Lt ¶
func (EpochFilter) Lt(value int) *filter.Term
Lt method is a custom method to define the less than operation on the epoch field.
type PeriodEndTimeFilter ¶
type PeriodEndTimeFilter struct{}
PeriodEndTimeFilter is a custom type to define filter operation on the period_end_time field.
func WithPeriodEndTime ¶
func WithPeriodEndTime() PeriodEndTimeFilter
Instructs the backend API to return rewards aggregations that have `period_end_time` set in a manner which matches the desired filter. Needs a companion comparison operator (ex: >, <, =, etc) to be functional.
func (PeriodEndTimeFilter) Eq ¶
func (PeriodEndTimeFilter) Eq(value time.Time) *filter.Term
Eq method is a custom method to define the equals operation on the period_end_time field.
func (PeriodEndTimeFilter) Gt ¶
func (PeriodEndTimeFilter) Gt(value time.Time) *filter.Term
Gt method is a custom method to define the greater than operation on the period_end_time field.
func (PeriodEndTimeFilter) Gte ¶
func (PeriodEndTimeFilter) Gte(value time.Time) *filter.Term
Gte method is a custom method to define the greater than or equals operation on the period_end_time field.
type RewardIterator ¶
type RewardIterator interface { // PageInfo supports pagination. See the google.golang.org/api/iterator package for details. PageInfo() *iterator.PageInfo // Next returns the next result. Its second return value is iterator.Done if there are no more // results. Once Next returns Done, all subsequent calls will return Done. Next() (*stakingpb.Reward, error) // Response is the raw response for the current page. // Calling Next() or InternalFetch() updates this value. Response() *stakingpb.ListRewardsResponse }
RewardIterator is an interface for iterating through the response to ListRewards.
type RewardIteratorImpl ¶
type RewardIteratorImpl struct {
// contains filtered or unexported fields
}
RewardIteratorImpl is an implementation of RewardIterator that unwraps correctly.
func (*RewardIteratorImpl) Next ¶
func (n *RewardIteratorImpl) Next() (*stakingpb.Reward, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*RewardIteratorImpl) PageInfo ¶
func (n *RewardIteratorImpl) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (*RewardIteratorImpl) Response ¶
func (n *RewardIteratorImpl) Response() *stakingpb.ListRewardsResponse
Response is the raw response for the current page. Calling Next() or InternalFetch() updates this value.
type RewardsServiceClient ¶
type RewardsServiceClient struct {
// contains filtered or unexported fields
}
RewardsServiceClient is the client to use to access StakingService APIs.
func NewRewardsServiceClient ¶
func NewRewardsServiceClient( ctx context.Context, stakingOpts ...clients.StakingClientOption, ) (*RewardsServiceClient, error)
NewRewardsServiceClient returns a RewardsServiceClient based on the given inputs.
func (*RewardsServiceClient) Close ¶
func (s *RewardsServiceClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RewardsServiceClient) Connection
deprecated
func (s *RewardsServiceClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RewardsServiceClient) ListRewards ¶
func (s *RewardsServiceClient) ListRewards( ctx context.Context, req *stakingpb.ListRewardsRequest, opts ...gax.CallOption, ) RewardIterator
ListRewards helps list onchain rewards of an address for a specific protocol, with optional filters for time range, aggregation period, and more.
func (*RewardsServiceClient) ListStakes ¶
func (s *RewardsServiceClient) ListStakes( ctx context.Context, req *stakingpb.ListStakesRequest, opts ...gax.CallOption, ) StakeIterator
ListStakes list staking activities for a given protocol.
type StakeIterator ¶
type StakeIterator interface { // PageInfo supports pagination. See the google.golang.org/api/iterator package for details. PageInfo() *iterator.PageInfo // Next returns the next result. Its second return value is iterator.Done if there are no more // results. Once Next returns Done, all subsequent calls will return Done. Next() (*stakingpb.Stake, error) // Response is the raw response for the current page. // Calling Next() or InternalFetch() updates this value. Response() *stakingpb.ListStakesResponse }
StakeIterator is an interface for iterating through the response to ListStakes.
type StakeIteratorImpl ¶
type StakeIteratorImpl struct {
// contains filtered or unexported fields
}
StakeIteratorImpl is an implementation of StakeIterator that unwraps correctly.
func (*StakeIteratorImpl) Next ¶
func (n *StakeIteratorImpl) Next() (*stakingpb.Stake, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*StakeIteratorImpl) PageInfo ¶
func (n *StakeIteratorImpl) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (*StakeIteratorImpl) Response ¶
func (n *StakeIteratorImpl) Response() *stakingpb.ListStakesResponse
Response is the raw response for the current page. Calling Next() or InternalFetch() updates this value.