worker

package
v1.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Approve      = "approve"
	Check        = "check"
	GiveTo       = "giveTo"
	MintTo       = "mintTo"
	NextTime     = "nextTime"
	Register     = "register"
	Transfer     = "transfer"
	TransferFrom = "transferFrom"
)
View Source
const AccountCreateID = "ACCOUNT_CREATE"
View Source
const DispatchID = "DISPATCH"

Variables

View Source
var (
	ErrInsufficientGas          = errors.New("eth-custodial: insufficient gas")
	ErrGasPriceTooLow           = errors.New("eth-custodial: gas price too low")
	ErrNonceTooLow              = errors.New("eth-custodial: nonce too low")
	ErrReplacementTxUnderpriced = errors.New("eth-custodial: replacement tx underpriced")
	ErrNetwork                  = errors.New("eth-custodial: network related error")
)
View Source
var ErrInvalidNumberString = errors.New("invalid number string")

Functions

func StringToBigInt

func StringToBigInt(numberString string) (*big.Int, error)

Types

type AccountCreateArgs

type AccountCreateArgs struct {
	TrackingID string      `json:"trackingId"`
	KeyPair    keypair.Key `json:"keypair"`
}

func (AccountCreateArgs) Kind

func (AccountCreateArgs) Kind() string

type AccountCreateWorker

type AccountCreateWorker struct {
	river.WorkerDefaults[AccountCreateArgs]
	// contains filtered or unexported fields
}

func (*AccountCreateWorker) Work

type DispatchArgs

type DispatchArgs struct {
	TrackingID string `json:"trackingId"`
	OTXID      uint64 `json:"otxId"`
	RawTx      string `json:"rawTx"`
}

func (DispatchArgs) Kind

func (DispatchArgs) Kind() string

type DispatchError

type DispatchError struct {
	Err         error
	OriginalErr error
}

func (*DispatchError) Error

func (e *DispatchError) Error() string

func (*DispatchError) Unwrap

func (e *DispatchError) Unwrap() error

type DisptachWorker

type DisptachWorker struct {
	river.WorkerDefaults[DispatchArgs]
	// contains filtered or unexported fields
}

func (*DisptachWorker) Work

type TokenTransferArgs

type TokenTransferArgs struct {
	TrackingID   string `json:"trackingId"`
	From         string `json:"from"`
	To           string `json:"to"`
	TokenAddress string `json:"tokenAddress"`
	Amount       string `json:"amount"`
}

func (TokenTransferArgs) Kind

func (TokenTransferArgs) Kind() string

type TokenTransferWorker

type TokenTransferWorker struct {
	river.WorkerDefaults[TokenTransferArgs]
	// contains filtered or unexported fields
}

func (*TokenTransferWorker) Work

type WorkerContainer

type WorkerContainer struct {
	GasOracle     gas.GasOracle
	Store         store.Store
	Logg          *slog.Logger
	ChainProvider *ethutils.Provider
	QueueClient   *river.Client[pgx.Tx]
}

func New

func New(o WorkerOpts) (*WorkerContainer, error)

func (*WorkerContainer) Start

func (w *WorkerContainer) Start(ctx context.Context) error

func (*WorkerContainer) Stop

func (w *WorkerContainer) Stop(ctx context.Context) error

type WorkerOpts

type WorkerOpts struct {
	MaxWorkers int
	ChainID    int64
	GasOracle  gas.GasOracle
	Store      store.Store
	Logg       *slog.Logger
}

Jump to

Keyboard shortcuts

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