gql

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationLink struct {
	State       graphql.String `graphql:"state"`
	UserAddress graphql.String `graphql:"user_address"`
}

func (*ApplicationLink) IsValid

func (a *ApplicationLink) IsValid() bool
type ApplicationLinks []*ApplicationLink

func (ApplicationLinks) AreAllInvalid added in v0.2.0

func (a ApplicationLinks) AreAllInvalid() bool

func (ApplicationLinks) IsAnyValid added in v0.2.0

func (a ApplicationLinks) IsAnyValid() bool

type Client

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

Client represents a GraphQL client

func NewClient

func NewClient(chainEndpoint string, desmosEndpoint string) (*Client, error)

NewClient returns a new Client instance

func (*Client) CheckIsValidator

func (c *Client) CheckIsValidator(appLink *ApplicationLink) (bool, error)

CheckIsValidator checks whether the user having the given username is a validator or not based on the data present on the specific GraphQL endpoint.

func (c *Client) GetDiscordLinks(username string) (ApplicationLinks, error)

GetDiscordLinks returns the (possibly multiple) ApplicationLink representing the connection between the Desmos Profile and Discord. It returns an error if the link was not found, or it's not in the correct state.

Jump to

Keyboard shortcuts

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