Documentation
¶
Index ¶
- Constants
- type Faucet
- type Handler
- type HandlerFunc
- type Middleware
- type Option
- func WithConfig(c *config.Config) Option
- func WithHTTPMiddlewares(middlewares []func(http.Handler) http.Handler) Option
- func WithLogger(l *slog.Logger) Option
- func WithMiddlewares(middlewares []Middleware) Option
- func WithPrepareTxMessageFn(prepareTxMsgFn PrepareTxMessageFn) Option
- func WithRPCHandlers(handlers []Handler) Option
- type PrepareCfg
- type PrepareTxMessageFn
Constants ¶
const DefaultDripMethod = "drip" // the default JSON-RPC method for a faucet drip
const JSONMimeType = "application/json"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Faucet ¶
type Faucet struct {
// contains filtered or unexported fields
}
Faucet is a standard Gno faucet
type Handler ¶
type Handler struct { HandlerFunc HandlerFunc Pattern string }
Handler defines a faucet pattern handler
type HandlerFunc ¶ added in v0.5.1
type HandlerFunc func(ctx context.Context, req *spec.BaseJSONRequest) *spec.BaseJSONResponse
HandlerFunc is the custom faucet request handler
type Middleware ¶
type Middleware func(next HandlerFunc) HandlerFunc
Middleware is the faucet middleware func
type Option ¶
type Option func(f *Faucet)
func WithConfig ¶
WithConfig specifies the config for the faucet
func WithHTTPMiddlewares ¶ added in v0.5.2
WithHTTPMiddlewares specifies the http request middlewares for the faucet. Middlewares are applied for each endpoint
func WithLogger ¶
WithLogger specifies the logger for the faucet
func WithMiddlewares ¶
func WithMiddlewares(middlewares []Middleware) Option
WithMiddlewares specifies the rpc request middlewares for the faucet. Middlewares are applied for each endpoint
func WithPrepareTxMessageFn ¶
func WithPrepareTxMessageFn(prepareTxMsgFn PrepareTxMessageFn) Option
WithPrepareTxMessageFn specifies the faucet transaction message constructor
func WithRPCHandlers ¶ added in v0.5.2
WithRPCHandlers specifies the HTTP handlers for the faucet
type PrepareCfg ¶
type PrepareCfg struct { SendAmount std.Coins // the amount to be sent FromAddress crypto.Address // the faucet address ToAddress crypto.Address // the beneficiary address }
PrepareCfg specifies the tx prepare configuration
type PrepareTxMessageFn ¶
type PrepareTxMessageFn func(PrepareCfg) std.Msg
PrepareTxMessageFn is the callback method that constructs the faucet fund transaction message