Documentation ¶
Index ¶
Constants ¶
View Source
const ( BzzDeposit = 100.0 BzzGasLimit = 100000 BzzGasPrice = 65536 BzzTokenAddress = "0x6aab14fe9cccd64a502d23842d916eb5321c26e7" EthAccount = "0x62cab2b3b55f341f10348720ca18063cdb779ad5" EthDeposit = 1.0 EthGasLimit = 21000 EthGasPrice = 21000 )
Variables ¶
View Source
var ( ErrForbidden = errors.New("forbidden") ErrNotFound = errors.New("not found") ErrMethodNotAllowed = errors.New("method not allowed") ErrTooManyRequests = errors.New("too many requests") ErrInternalServerError = errors.New("internal server error") )
Errors that are returned by the API.
View Source
var ErrNotSet = errors.New("swap client not set")
ErrNotSet represents error when Swap client is not set
Functions ¶
Types ¶
type BadRequestError ¶
type BadRequestError struct {
// contains filtered or unexported fields
}
BadRequestError holds list of errors from http response that represent invalid data submitted by the user.
func NewBadRequestError ¶
func NewBadRequestError(errors ...string) (err *BadRequestError)
NewBadRequestError constructs a new BadRequestError with provided errors.
func (*BadRequestError) Error ¶
func (e *BadRequestError) Error() (s string)
func (*BadRequestError) Errors ¶
func (e *BadRequestError) Errors() (errs []string)
Errors returns a list of error messages.
type Client ¶
type Client interface { SendETH(ctx context.Context, to string, amount float64) (tx string, err error) SendBZZ(ctx context.Context, to string, amount float64) (tx string, err error) }
Client defines Client interface
type GethClient ¶
type GethClient struct {
// contains filtered or unexported fields
}
GethClient manages communication with the Geth node
func NewGethClient ¶
func NewGethClient(baseURL *url.URL, o *GethClientOptions) (c *GethClient)
NewClient constructs a new Client.
type GethClientOptions ¶
type GethClientOptions struct { BzzDeposit float64 BzzTokenAddress string EthAccount string EthDeposit float64 HTTPClient *http.Client }
GethClientOptions holds optional parameters for the GethClient
Click to show internal directories.
Click to hide internal directories.