Documentation ¶
Index ¶
- Constants
- func IsContract(c *ethclient.Client, ctx context.Context, a ethCommon.Address) (bool, error)
- func IsUserStaker(wallet string) (bool, error)
- func IsValidWallet(a string) bool
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func VerifyTurnstile(secret, key string) (bool, error)
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type FaucetReq
- type MutationResolver
- type QueryResolver
- type Resolver
- type ResolverRoot
Constants ¶
const SiteVerifyUrl = "https://challenges.cloudflare.com/turnstile/v0/siteverify"
SiteVerifyUrl to use to check Turnstile with
const StakerCutoff = 10_000
StakerCutoff to require before allowing to use the faucet
const TimeToLive = 10 * time.Second
!!! WARNING !!! The code below was going to be deleted when updating resolvers. It has been copied here so you have one last chance to move it out of harms way if you want. There are two reasons this happens:
- When renaming or deleting a resolver the old code will be put in here. You can safely delete it when you're done.
- You have helper methods in this file. Move them out to keep these resolver files clean.
const UrlModeratorsGraph = "https://moderators.fluidity.money/"
UrlModeratorsGraph to ask whether a user is currently staking and their point threshold
Variables ¶
This section is empty.
Functions ¶
func IsContract ¶
IsContract test by checking the contract size with Geth to see if it's greater than 0.
func IsUserStaker ¶
func IsValidWallet ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func VerifyTurnstile ¶
VerifyTurnstile by making a request to Cloudflare, returning an error if it happens, and false if we can't verify them upstream.
Types ¶
type ComplexityRoot ¶
type Config ¶
type Config struct { Schema *ast.Schema Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type DirectiveRoot struct { }
type MutationResolver ¶
type Resolver ¶
type Resolver struct { DB *gorm.DB // db used to look up any fields that are missing from a request. F features.F // features to have enabled when requested C config.C // config for connecting to the right endpoints TurnstileSecret string // Turnstile secret to use for verification }
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
Mutation returns MutationResolver implementation.
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
Query returns QueryResolver implementation.
type ResolverRoot ¶
type ResolverRoot interface { Mutation() MutationResolver Query() QueryResolver }