launcher

package
v0.0.38 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GasPriceDecider added in v0.0.38

type GasPriceDecider interface {
	GasPriceInWei() decimal.Decimal
}

func NewGasStationGasPriceDecider added in v0.0.38

func NewGasStationGasPriceDecider(fallbackGasPrice decimal.Decimal) GasPriceDecider

func NewStaticGasPriceDecider added in v0.0.38

func NewStaticGasPriceDecider(gasPrice decimal.Decimal) GasPriceDecider

type GasStationPriceDeciderWithFallback added in v0.0.38

type GasStationPriceDeciderWithFallback struct {
	FallbackGasPriceInWei decimal.Decimal
}

func (GasStationPriceDeciderWithFallback) GasPriceInWei added in v0.0.38

type GasStationRespBody added in v0.0.38

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 added in v0.0.38

type StaticGasPriceDecider struct {
	PriceInWei decimal.Decimal
}

func (StaticGasPriceDecider) GasPriceInWei added in v0.0.38

func (s StaticGasPriceDecider) GasPriceInWei() decimal.Decimal

Jump to

Keyboard shortcuts

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