Documentation ¶
Overview ¶
Package cosmosfaucet is a faucet to request tokens for sdk accounts.
Code generated for package cosmosfaucet by go-bindata DO NOT EDIT. (@generated) sources: starport/pkg/cosmosfaucet/openapi/index.html starport/pkg/cosmosfaucet/openapi/openapi.yml.tmpl
Index ¶
- Constants
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type Faucet
- type Option
Constants ¶
const ( // DefaultAccountName is the default account to transfer tokens from. DefaultAccountName = "faucet" // DefaultDenom is the default denomination to distribute. DefaultDenom = "uatom" // DefaultAmount specifies the default amount to transfer to an account // on each request. DefaultAmount = 10000000 // DefaultMaxAmount specifies the maximum amount that can be tranffered to an // account in all times. DefaultMaxAmount = 100000000 )
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type Faucet ¶
type Faucet struct {
// contains filtered or unexported fields
}
func New ¶
New creates a new faucet with ccr (to access and use blockchain's CLI) and given options.
func (Faucet) ServeHTTP ¶
func (f Faucet) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements http.Handler to expose the functionality of Faucet.Transfer() via HTTP. request/response payloads are compatible with the previous implementation at allinbits/cosmos-faucet.
type Option ¶
type Option func(*Faucet)
Option configures the faucetOptions.
func Account ¶
Account provides the account information to transfer tokens from. when mnemonic isn't provided, account assumed to be exists in the keyring.
func Coin ¶
Coin adds a new coin to coins list to distribute by the faucet. the first coin added to the list considered as the default coin during transfer requests.
amount is the amount of the coin can be distributed per request. maxAmount is the maximum amount of the coin that can be sent to a single account. denom is denomination of the coin to be distributed by the faucet.