api

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const TimeoutSafetyFactor int = 2

The fraction of the timeout period to trigger overdue transactions

Variables

This section is empty.

Functions

func IsTransactionDue added in v1.1.0

func IsTransactionDue(rp *rocketpool.RocketPool, startTime time.Time) (bool, time.Duration, error)

True if a transaction is due and needs to bypass the gas threshold

func PrintAndCheckGasInfo added in v1.0.0

func PrintAndCheckGasInfo(gasInfo rocketpool.GasInfo, checkThreshold bool, gasThresholdGwei float64, logger *log.ColorLogger, maxFeeWei *big.Int, gasLimit uint64) bool

Print the gas price and cost of a TX

func PrintAndWaitForTransaction added in v1.0.0

func PrintAndWaitForTransaction(cfg *config.RocketPoolConfig, hash common.Hash, ec rocketpool.ExecutionClient, logger *log.ColorLogger) error

Print a TX's details to the logger and waits for it to validated.

func WriteErrorResponse added in v1.20.0

func WriteErrorResponse(w http.ResponseWriter, err error)

WriteErrorResponse writes a generic error response to w.

func WriteResponse added in v1.20.0

func WriteResponse(w http.ResponseWriter, response interface{}, responseError error)

WriteResponse serialises response as JSON and writes it to w. response must be a pointer to a struct with string fields named Status and Error. On error it writes 400 for BadRequestError and 500 for everything else.

func ZeroIfNil added in v1.9.5

func ZeroIfNil(in **big.Int)

Types

type BadRequestError added in v1.20.0

type BadRequestError struct{ Err error }

BadRequestError signals that the caller supplied invalid input. WriteResponse maps it to HTTP 400 rather than 500.

func (*BadRequestError) Error added in v1.20.0

func (e *BadRequestError) Error() string

func (*BadRequestError) Unwrap added in v1.20.0

func (e *BadRequestError) Unwrap() error

type EIP712Components added in v1.13.6

type EIP712Components struct {
	V uint8    `json:"v"`
	R [32]byte `json:"r"`
	S [32]byte `json:"s"`
}

func ParseEIP712 added in v1.13.6

func ParseEIP712(signature string) (*EIP712Components, error)

type NotFoundError added in v1.20.0

type NotFoundError struct{ Path string }

NotFoundError signals that the requested resource or route does not exist. WriteResponse maps it to HTTP 404.

func (*NotFoundError) Error added in v1.20.0

func (e *NotFoundError) Error() string

Jump to

Keyboard shortcuts

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