ethereum

package
v0.0.0-...-f5bbbf4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PendingBlockNumber  = BlockNumber(-2)
	LatestBlockNumber   = BlockNumber(-1)
	EarliestBlockNumber = BlockNumber(0)
)
View Source
const (
	EIP712DomainLabel = "EIP712Domain"
)

Variables

This section is empty.

Functions

func GetEIP191EncodedData

func GetEIP191EncodedData(msg []byte) []byte

func GetEIP712EncodedData

func GetEIP712EncodedData(typedData *core.TypedData) ([]byte, error)

Types

type BlockNumber

type BlockNumber int64

func (BlockNumber) Int64

func (n BlockNumber) Int64() int64

func (BlockNumber) MarshalText

func (n BlockNumber) MarshalText() ([]byte, error)

func (*BlockNumber) UnmarshalJSON

func (n *BlockNumber) UnmarshalJSON(data []byte) error

UnmarshalJSON parses the given JSON fragment into a BlockNumber. It supports: - "latest", "earliest" or "pending" as string arguments - the block number Returned errors: - an invalid block number error when the given argument isn't a known strings - an out of range error when the given block number is either too little or too large

type CallMsg

type CallMsg struct {
	From       *ethcommon.Address // the sender of the 'transaction'
	To         *ethcommon.Address // the destination contract (nil for contract creation)
	Gas        *uint64            // if 0, the call executes with near-infinite gas
	GasPrice   *big.Int           // wei <-> gas exchange ratio
	Value      *big.Int           // amount of wei sent along with the call
	Data       *[]byte            // input data, usually an ABI-encoded contract method invocation
	GasFeeCap  *big.Int
	GasTipCap  *big.Int
	AccessList types.AccessList
}

CallMsg contains parameters for contract calls.

func (*CallMsg) MarshalJSON

func (msg *CallMsg) MarshalJSON() ([]byte, error)

func (*CallMsg) UnmarshalJSON

func (msg *CallMsg) UnmarshalJSON(b []byte) error

func (*CallMsg) WithData

func (msg *CallMsg) WithData(d []byte) *CallMsg

func (*CallMsg) WithFrom

func (msg *CallMsg) WithFrom(addr ethcommon.Address) *CallMsg

func (*CallMsg) WithGas

func (msg *CallMsg) WithGas(gas uint64) *CallMsg

func (*CallMsg) WithGasPrice

func (msg *CallMsg) WithGasPrice(p *big.Int) *CallMsg

func (*CallMsg) WithTo

func (msg *CallMsg) WithTo(addr ethcommon.Address) *CallMsg

func (*CallMsg) WithValue

func (msg *CallMsg) WithValue(v *big.Int) *CallMsg

type Caller

type Caller interface {
	Eth() EthCaller
	EEA() EEACaller
	Priv() PrivCaller
}

func NewCaller

func NewCaller(client jsonrpc.Client) Caller

NewCaller creates a caller from a jsonrpc.Client

type EEACaller

type EEACaller interface {
	SendRawTransaction(context.Context, []byte) (ethcommon.Hash, error)
}

EEACaller is a JSON-RPC client to an Ethereum client using eea namespace

type EthCaller

type EthCaller interface {
	ChainID(context.Context) (*big.Int, error)
	GasPrice(context.Context) (*big.Int, error)
	BaseFeePerGas(context.Context, BlockNumber) (*big.Int, error)
	GetTransactionCount(context.Context, ethcommon.Address, BlockNumber) (uint64, error)
	EstimateGas(context.Context, *CallMsg) (uint64, error)
	SendRawTransaction(context.Context, []byte) (ethcommon.Hash, error)
	SendRawPrivateTransaction(context.Context, []byte, *PrivateArgs) (ethcommon.Hash, error)
}

EthCaller is a JSON-RPC client to an Ethereum client using eth namespace

type PrivCaller

type PrivCaller interface {
	DistributeRawTransaction(context.Context, []byte) ([]byte, error)
	GetTransactionCount(ctx context.Context, addr ethcommon.Address, privacyGroupID string) (uint64, error)
	GetEeaTransactionCount(ctx context.Context, addr ethcommon.Address, privateFrom string, privateFor []string) (uint64, error)
}

type PrivacyFlag

type PrivacyFlag uint64
const (
	StandardPrivatePrivacyFlag PrivacyFlag = iota                              // 0
	PartyProtectionPrivacyFlag PrivacyFlag = 1 << PrivacyFlag(iota-1)          // 1
	StateValidationPrivacyFlag             = iota | PartyProtectionPrivacyFlag // 3 which includes PrivacyFlagPartyProtection
)

type PrivateArgs

type PrivateArgs struct {
	PrivateFrom    *string      `json:"privateFrom,omitempty"`
	PrivateFor     *[]string    `json:"privateFor,omitempty"`
	PrivateType    *PrivateType `json:"restriction,omitempty"`
	PrivacyFlag    *PrivacyFlag `json:"privacyFlag,omitempty"`
	PrivacyGroupID *string      `json:"privacyGroupId,omitempty"`
}

TODO: Delete usage of unnecessary pointers: https://app.zenhub.com/workspaces/orchestrate-5ea70772b186e10067f57842/issues/consensys/quorum-key-manager/96 PrivateArgs arguments for private transactions

func (*PrivateArgs) WithPrivacyFlag

func (args *PrivateArgs) WithPrivacyFlag(flag PrivacyFlag) *PrivateArgs

func (*PrivateArgs) WithPrivacyGroupID

func (args *PrivateArgs) WithPrivacyGroupID(id string) *PrivateArgs

func (*PrivateArgs) WithPrivateFor

func (args *PrivateArgs) WithPrivateFor(pubKeys []string) *PrivateArgs

func (*PrivateArgs) WithPrivateFrom

func (args *PrivateArgs) WithPrivateFrom(pubKey string) *PrivateArgs

func (*PrivateArgs) WithPrivateType

func (args *PrivateArgs) WithPrivateType(pubKey string) *PrivateArgs

type PrivateType

type PrivateType string
const (
	PrivateTypeRestricted   PrivateType = "restricted"
	PrivateTypeUnrestricted PrivateType = "unrestricted"
)

type SendEEATxMsg

type SendEEATxMsg struct {
	From     ethcommon.Address
	To       *ethcommon.Address
	Nonce    *uint64
	Data     *[]byte
	Gas      *uint64
	GasPrice *big.Int

	PrivateArgs
}

TODO: Delete usage of unnecessary pointers: https://app.zenhub.com/workspaces/orchestrate-5ea70772b186e10067f57842/issues/consensys/quorum-key-manager/96

func (*SendEEATxMsg) MarshalJSON

func (msg *SendEEATxMsg) MarshalJSON() ([]byte, error)

func (*SendEEATxMsg) TxData

func (msg *SendEEATxMsg) TxData() *types.Transaction

func (*SendEEATxMsg) UnmarshalJSON

func (msg *SendEEATxMsg) UnmarshalJSON(b []byte) error

type SendTxMsg

type SendTxMsg struct {
	From       ethcommon.Address
	To         *ethcommon.Address
	Gas        *uint64
	GasPrice   *big.Int
	Value      *big.Int
	Nonce      *uint64
	Data       *[]byte
	GasFeeCap  *big.Int
	GasTipCap  *big.Int
	AccessList types.AccessList

	PrivateArgs
}

TODO: Delete usage of unnecessary pointers: https://app.zenhub.com/workspaces/orchestrate-5ea70772b186e10067f57842/issues/consensys/quorum-key-manager/96

func (*SendTxMsg) IsLegacy

func (msg *SendTxMsg) IsLegacy() bool

func (*SendTxMsg) IsPrivate

func (msg *SendTxMsg) IsPrivate() bool

func (*SendTxMsg) MarshalJSON

func (msg *SendTxMsg) MarshalJSON() ([]byte, error)

func (*SendTxMsg) TxData

func (msg *SendTxMsg) TxData(txType int, chainID *big.Int) *types.Transaction

func (*SendTxMsg) TxDataQuorum

func (msg *SendTxMsg) TxDataQuorum() *quorumtypes.Transaction

TODO: Delete this function and use only go-quorum types when

func (*SendTxMsg) UnmarshalJSON

func (msg *SendTxMsg) UnmarshalJSON(b []byte) error

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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