relayer

package
v0.0.0-...-a287f25 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RelayerOK            = 0
	InternalServerError  = 1
	InvalidRequestError  = 2
	InsufficentGasError  = 3
	EstimateGasError     = 4
	SendTransactionError = 5
)
View Source
const GasLimitRelax = 120
View Source
const PackedGasFeeLimitShift uint64 = 10 ^ 11

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainError

type ChainError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type Error

type Error struct {
	Code       int         `json:"code"`
	Message    string      `json:"message"`
	ChainError *ChainError `json:"chainError,omitempty"`
}

func NewEstimateGasError

func NewEstimateGasError(rpcError error) *Error

func NewInsufficentGasError

func NewInsufficentGasError(need uint64) *Error

func NewInternalServerError

func NewInternalServerError() *Error

func NewInvalidRequestError

func NewInvalidRequestError(msg string) *Error

func NewSendTransactionError

func NewSendTransactionError(rpcError error) *Error

func (*Error) Error

func (r *Error) Error() string

type Relayer

type Relayer struct {
	// contains filtered or unexported fields
}

func NewRelayer

func NewRelayer(rpc string, chainId *big.Int, key string, contract string, gasPrice uint64, feePercent uint32) (*Relayer, error)

func (*Relayer) Address

func (r *Relayer) Address() string

func (*Relayer) CallFunction

func (r *Relayer) CallFunction(ctx context.Context, from, to, method, callData string, nonce uint32, expiration uint32, gasLimit uint64, signature string) (tx string, err error)

Jump to

Keyboard shortcuts

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