Documentation ¶
Index ¶
Constants ¶
View Source
const (
FaucetHandler = "faucet"
)
Variables ¶
This section is empty.
Functions ¶
func AttachFaucetAPI ¶
func AttachFaucetAPI(signingKey *ethereum.SignKeys, amount uint64, api *apirest.API, pathPrefix string) error
AttachFaucetAPI attaches the faucet API to the given http apirest router. The path prefix is used to define the base path in which the endpoint method will be registered. For example, if the pathPrefix is "/faucet", the resulting endpoint is /faucet/{network}/{to}. The networks map defines the amount of tokens to send for each network. Networks not defined are considered invalid.
Types ¶
type FaucetAPI ¶
type FaucetAPI struct {
// contains filtered or unexported fields
}
FaucetAPI is a httprouter/apirest handler for the faucet. It generates a signed package that can be used to request tokens from the faucet.
type FaucetPackage ¶
type FaucetPackage struct { // FaucetPackagePayload is the Vocdoni faucet package payload FaucetPayload []byte `json:"faucetPayload"` // Signature is the signature for the vocdoni faucet payload Signature []byte `json:"signature"` }
FaucetPackage represents the data of a faucet package
type FaucetResponse ¶
type FaucetResponse struct { // Amount transferred Amount string `json:"amount,omitempty"` // FaucetPackage represents the faucet package FaucetPackage []byte `json:"faucetPackage,omitempty"` }
FaucetResponse represents the message on the response of a faucet request
Click to show internal directories.
Click to hide internal directories.