Documentation ¶
Index ¶
- Constants
- type EthereumTransaction
- type TransactionWithConfirmations
- type TransactionWithMetadata
- func (txh *TransactionWithMetadata) Addresses() []accounts.AddressAndAmount
- func (txh *TransactionWithMetadata) Amount() coin.Amount
- func (txh *TransactionWithMetadata) Fee() *coin.Amount
- func (txh *TransactionWithMetadata) Gas() uint64
- func (txh *TransactionWithMetadata) ID() string
- func (txh *TransactionWithMetadata) MarshalJSON() ([]byte, error)
- func (txh *TransactionWithMetadata) Timestamp() *time.Time
- func (txh *TransactionWithMetadata) Type() accounts.TxType
- func (txh *TransactionWithMetadata) UnmarshalJSON(input []byte) error
Constants ¶
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 ¶
func (txh *TransactionWithConfirmations) Addresses() []accounts.AddressAndAmount
Addresses implements accounts.Transaction.
func (*TransactionWithConfirmations) Amount ¶
func (txh *TransactionWithConfirmations) Amount() coin.Amount
Amount implements accounts.Transaction.
func (*TransactionWithConfirmations) NumConfirmations ¶
func (txh *TransactionWithConfirmations) NumConfirmations() int
NumConfirmations implements accounts.Transaction.
func (*TransactionWithConfirmations) Status ¶
func (txh *TransactionWithConfirmations) Status() accounts.TxStatus
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 ¶
func (txh *TransactionWithMetadata) Addresses() []accounts.AddressAndAmount
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 ¶
func (txh *TransactionWithMetadata) Type() accounts.TxType
Type implements accounts.Transaction.
func (*TransactionWithMetadata) UnmarshalJSON ¶
func (txh *TransactionWithMetadata) UnmarshalJSON(input []byte) error
UnmarshalJSON implements json.Unmarshaler. Used for DB serialization.