builders

package
v1.3.6-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: GPL-3.0 Imports: 13 Imported by: 8 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrGasLimitForInnerTransactionV2ShouldBeZero = errors.New("gas limit of the inner transaction should be 0")

ErrGasLimitForInnerTransactionV2ShouldBeZero signals that the gas limit for the inner transaction should be zero

View Source
var ErrInvalidAddress = errors.New("invalid address handler")

ErrInvalidAddress signals that an invalid address was provided

View Source
var ErrInvalidGasLimitNeededForInnerTransaction = errors.New("invalid gas limit needed for inner transaction")

ErrInvalidGasLimitNeededForInnerTransaction signals that an invalid gas limit needed for the inner transaction was provided

View Source
var ErrInvalidValue = errors.New("invalid value")

ErrInvalidValue signals that an invalid value was provided

View Source
var ErrMissingSignature = errors.New("missing signature when computing the transaction's hash")

ErrMissingSignature signals that a transaction's signature is empty when trying to compute it's hash

View Source
var ErrNilAddress = errors.New("nil address handler")

ErrNilAddress signals that a nil address was provided

View Source
var ErrNilCryptoComponentsHolder = errors.New("nil crypto components holder")

ErrNilCryptoComponentsHolder signals that a nil crypto components holder was provided

View Source
var ErrNilInnerTransaction = errors.New("nil inner transaction")

ErrNilInnerTransaction signals that a nil inner transaction was provided

View Source
var ErrNilInnerTransactionSignature = errors.New("nil inner transaction signature")

ErrNilInnerTransactionSignature signals that a nil inner transaction signature was provided

View Source
var ErrNilNetworkConfig = errors.New("nil network config")

ErrNilNetworkConfig signals that a nil network config was provided

View Source
var ErrNilRelayerAccount = errors.New("nil relayer account")

ErrNilRelayerAccount signals that a nil relayer account was provided

View Source
var ErrNilSigner = errors.New("nil signer")

ErrNilSigner signals that a nil transaction signer was provided

View Source
var ErrNilValue = errors.New("nil value")

ErrNilValue signals that a nil value was provided

Functions

func NewRelayedTxV1Builder

func NewRelayedTxV1Builder() *relayedTxV1Builder

NewRelayedTxV1Builder creates a new relayed transaction v1 builder

func NewRelayedTxV2Builder

func NewRelayedTxV2Builder() *relayedTxV2Builder

NewRelayedTxV2Builder creates a new relayed transaction v2 builder

func NewTxBuilder

func NewTxBuilder(signer Signer) (*txBuilder, error)

NewTxBuilder will create a new transaction builder able to build and correctly sign a transaction

func NewTxDataBuilder

func NewTxDataBuilder() *txDataBuilder

NewTxDataBuilder creates a new transaction data builder

func NewVMQueryBuilder

func NewVMQueryBuilder() *vmQueryBuilder

NewVMQueryBuilder creates a new vm query data builder

Types

type Signer

type Signer interface {
	SignMessage(msg []byte, privateKey crypto.PrivateKey) ([]byte, error)
	VerifyMessage(msg []byte, publicKey crypto.PublicKey, sig []byte) error
	SignTransaction(tx *transaction.FrontendTransaction, privateKey crypto.PrivateKey) ([]byte, error)
	SignByteSlice(msg []byte, privateKey crypto.PrivateKey) ([]byte, error)
	IsInterfaceNil() bool
}

Signer defines the method used by a struct used to create valid signatures

type TxDataBuilder

type TxDataBuilder interface {
	Function(function string) TxDataBuilder

	ArgHexString(hexed string) TxDataBuilder
	ArgAddress(address core.AddressHandler) TxDataBuilder
	ArgBigInt(value *big.Int) TxDataBuilder
	ArgInt64(value int64) TxDataBuilder
	ArgBytes(bytes []byte) TxDataBuilder
	ArgBytesList(list [][]byte) TxDataBuilder

	ToDataString() (string, error)
	ToDataBytes() ([]byte, error)

	IsInterfaceNil() bool
}

TxDataBuilder defines the behavior of a transaction data builder

type VMQueryBuilder

type VMQueryBuilder interface {
	Function(function string) VMQueryBuilder
	CallerAddress(address core.AddressHandler) VMQueryBuilder
	Address(address core.AddressHandler) VMQueryBuilder

	ArgHexString(hexed string) VMQueryBuilder
	ArgAddress(address core.AddressHandler) VMQueryBuilder
	ArgBigInt(value *big.Int) VMQueryBuilder
	ArgInt64(value int64) VMQueryBuilder
	ArgBytes(bytes []byte) VMQueryBuilder

	ToVmValueRequest() (*data.VmValueRequest, error)

	IsInterfaceNil() bool
}

VMQueryBuilder defines the behavior of a vm query builder

Jump to

Keyboard shortcuts

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