types

package
v4.14.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const NumConfirmationsComplete = 12

NumConfirmationsComplete indicates after how many confs the tx is considered complete.

Variables

This section is empty.

Functions

This section is empty.

Types

type EthereumTransaction

type EthereumTransaction interface {
	// Gas returns the gas limit for pending tx, and the gas used for confirmed tx.
	Gas() uint64
}

EthereumTransaction holds information specific to Ethereum.

type TransactionWithConfirmations

type TransactionWithConfirmations struct {
	TransactionWithMetadata
	// contains filtered or unexported fields
}

TransactionWithConfirmations also stores the current tip height so NumConfirmations() can be computed.

func NewTransactionWithConfirmations

func NewTransactionWithConfirmations(
	tx *TransactionWithMetadata,
	tipHeight uint64,
	erc20Token *erc20.Token) *TransactionWithConfirmations

NewTransactionWithConfirmations creates a tx with additional data needed to be able to display it in the frontend.

func (*TransactionWithConfirmations) Addresses

Addresses implements accounts.Transaction.

func (*TransactionWithConfirmations) Amount

Amount implements accounts.Transaction.

func (*TransactionWithConfirmations) NumConfirmations

func (txh *TransactionWithConfirmations) NumConfirmations() int

NumConfirmations implements accounts.Transaction.

func (*TransactionWithConfirmations) Status

Status implements accounts.Transaction.

type TransactionWithMetadata

type TransactionWithMetadata struct {
	Transaction *types.Transaction
	// Height is 0 for pending tx.
	Height uint64
	// Only applies if Height > 0
	GasUsed uint64
	// Only applies if Height > 0.
	// false if contract execution failed, otherwise true.
	Success bool
}

TransactionWithMetadata wraps an outgoing transaction and implements accounts.Transaction.

func (*TransactionWithMetadata) Addresses

Addresses implements accounts.Transaction.

func (*TransactionWithMetadata) Amount

func (txh *TransactionWithMetadata) Amount() coin.Amount

Amount implements accounts.Transaction.

func (*TransactionWithMetadata) Fee

func (txh *TransactionWithMetadata) Fee() *coin.Amount

Fee implements accounts.Transaction.

func (*TransactionWithMetadata) Gas

func (txh *TransactionWithMetadata) Gas() uint64

Gas implements ethtypes.EthereumTransaction.

func (*TransactionWithMetadata) ID

func (txh *TransactionWithMetadata) ID() string

ID implements accounts.Transaction.

func (*TransactionWithMetadata) MarshalJSON

func (txh *TransactionWithMetadata) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. Used for DB serialization.

func (*TransactionWithMetadata) Timestamp

func (txh *TransactionWithMetadata) Timestamp() *time.Time

Timestamp implements accounts.Transaction.

func (*TransactionWithMetadata) Type

Type implements accounts.Transaction.

func (*TransactionWithMetadata) UnmarshalJSON

func (txh *TransactionWithMetadata) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler. Used for DB serialization.

Jump to

Keyboard shortcuts

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