builders

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: GPL-3.0 Imports: 16 Imported by: 5

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 ErrGuardianDoesNotMatch = errors.New("configured guardian does not match signing guardian")

ErrGuardianDoesNotMatch signals a mismatch between the configured guardian in tx and the signing guardian address

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 ErrMissingGuardianOption = errors.New("guardian flag is missing in the option field")

ErrMissingGuardianOption signals that the guardian flag is missing in the transaction option field

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

func TransactionToUnsignedTx added in v1.3.3

func TransactionToUnsignedTx(tx *transaction.FrontendTransaction) *transaction.FrontendTransaction

TransactionToUnsignedTx returns a shallow clone of the transaction, that has the signature fields set to nil

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)
	VerifyByteSlice(msg []byte, publicKey crypto.PublicKey, sig []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