friendbot

package
v0.78.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidCreateAmount occurs when the amount for a friendbot create account request is out of bounds. The bounds
	// are defined in the friendbot service (see https://github.com/kinecosystem/friendbot/blob/master/src/routes.ts#L51).
	ErrInvalidCreateAmount = errors.New("friendbot create account request quark amount must be in the range [0, 1000000000]")

	// ErrInvalidFundAmount occurs when the amount for a friendbot fund account request is out of bounds. The bounds
	// defined in the friendbot service (https://github.com/kinecosystem/friendbot/blob/master/src/routes.ts#L51) allow
	// fund requests for 0 quarks, but the blockchain transaction will fail. Therefore, a min amount of 1 is required.
	ErrInvalidFundAmount = errors.New("friendbot fund account request quark amount must be in the range [1, 1000000000]")
)

Functions

func CreateAccount

func CreateAccount(address string, quarkAmount uint) (hash string, err error)

CreateAccount creates a new account on the test Kin network with the requested starting balance.

friendbot accepts an amount in kin, but parses it as a float and throws an internal error if the amount has more than 5 decimal places, so quarks are used here to avoid input errors.

func FundAccount

func FundAccount(address string, quarkAmount uint) (hash string, err error)

FundAccount funds an existing account on the test Kin network with the requested amount.

Types

This section is empty.

Jump to

Keyboard shortcuts

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