Documentation
¶
Index ¶
- Variables
- type Client
- func (s *Client) Close() error
- func (s *Client) Connection() *grpc.ClientConndeprecated
- func (s *Client) ListRewards(ctx context.Context, req *api.ListRewardsRequest, opts ...gax.CallOption) RewardIterator
- func (s *Client) ListStakes(ctx context.Context, req *api.ListStakesRequest, opts ...gax.CallOption) StakeIterator
- type RewardIterator
- type RewardIteratorImpl
- type StakeIterator
- type StakeIteratorImpl
Constants ¶
This section is empty.
Variables ¶
var ( Ethereum = api.ProtocolResourceName{Protocol: "ethereum"}.String() Solana = api.ProtocolResourceName{Protocol: "solana"}.String() Cosmos = api.ProtocolResourceName{Protocol: "cosmos"}.String() )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the client to use to access StakingService APIs.
func NewRewardsServiceClient ¶
func NewRewardsServiceClient( ctx context.Context, stakingOpts ...options.StakingClientOption, ) (*Client, error)
NewRewardsServiceClient returns a RewardsServiceClient based on the given inputs.
func (*Client) Close ¶
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection
deprecated
func (s *Client) 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 (*Client) ListRewards ¶
func (s *Client) ListRewards( ctx context.Context, req *api.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 (*Client) ListStakes ¶
func (s *Client) ListStakes( ctx context.Context, req *api.ListStakesRequest, opts ...gax.CallOption, ) StakeIterator
ListStakes list staking activities for a given protocol.
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() (*api.Reward, error) // Response is the raw response for the current page. // Calling Next() or InternalFetch() updates this value. Response() *api.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() (*api.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() *api.ListRewardsResponse
Response is the raw response for the current page. Calling Next() or InternalFetch() updates this value.
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() (*api.Stake, error) // Response is the raw response for the current page. // Calling Next() or InternalFetch() updates this value. Response() *api.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() (*api.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() *api.ListStakesResponse
Response is the raw response for the current page. Calling Next() or InternalFetch() updates this value.