launcher

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GasPriceDecider

type GasPriceDecider interface {
	GasPriceInWei() decimal.Decimal
}

func NewGasStationGasPriceDecider

func NewGasStationGasPriceDecider(fallbackGasPrice decimal.Decimal) GasPriceDecider

func NewStaticGasPriceDecider

func NewStaticGasPriceDecider(gasPrice decimal.Decimal) GasPriceDecider

type GasStationPriceDeciderWithFallback

type GasStationPriceDeciderWithFallback struct {
	FallbackGasPriceInWei decimal.Decimal
}

func (GasStationPriceDeciderWithFallback) GasPriceInWei

type GasStationRespBody

type GasStationRespBody struct {
	Fast    decimal.Decimal `json:"fast"`
	Average decimal.Decimal `json:"average"`
}

type ISignService

type ISignService interface {
	Sign(launchLog *LaunchLog) string
	AfterSign() //what you want to do when signature has been used
}

func NewDefaultSignService

func NewDefaultSignService(privateKeyStr string, getNonce func(string) (int, error)) ISignService

type LaunchLog

type LaunchLog struct {
	ID       int64          `db:"id" auto:"true" primaryKey:"true" autoIncrement:"true"`
	ItemType string         `db:"item_type"`
	ItemID   int64          `db:"item_id"`
	Status   string         `db:"status"`
	Hash     sql.NullString `db:"transaction_hash"`

	BlockNumber sql.NullInt64 `db:"block_number"`

	From     string              `db:"t_from"`
	To       string              `db:"t_to"`
	Value    decimal.Decimal     `db:"value"`
	GasLimit int64               `db:"gas_limit"`
	GasUsed  sql.NullInt64       `db:"gas_used"`
	GasPrice decimal.NullDecimal `db:"gas_price"`
	Nonce    sql.NullInt64       `db:"nonce"`
	Data     string              `db:"data"`

	ExecutedAt time.Time `db:"executed_at"`
	CreatedAt  time.Time `db:"created_at"`
	UpdatedAt  time.Time `db:"updated_at"`
}

type Launcher

type Launcher struct {
	Ctx             context.Context `json:"ctx"`
	GasPriceDecider GasPriceDecider
	SignService     ISignService
	BlockChain      sdk.BlockChain
}

func NewLauncher

func NewLauncher(ctx context.Context, sign ISignService, hydro sdk.Hydro, gasPriceDecider GasPriceDecider) *Launcher

type StaticGasPriceDecider

type StaticGasPriceDecider struct {
	PriceInWei decimal.Decimal
}

func (StaticGasPriceDecider) GasPriceInWei

func (s StaticGasPriceDecider) GasPriceInWei() decimal.Decimal

Jump to

Keyboard shortcuts

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