Documentation
¶
Index ¶
Constants ¶
View Source
const ( TransactionStatusFailed = TransactionStatus(-1) TransactionStatusPending = TransactionStatus(0) TransactionStatusConfirmed = TransactionStatus(1) )
View Source
const ( // TxDirectionAny includes both incoming and outgoing transactions. TxDirectionAny TxDirection = 0 // TxDirectionIncoming includes only incoming transactions where the wallet receives funds. TxDirectionIncoming = 1 // TxDirectionOutgoing includes only outgoing transactions where the wallet sends funds. TxDirectionOutgoing = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressInfo ¶
type AddressInfo struct {
Address string `json:"address"`
PublicKey string `json:"public_key"`
Label string `json:"label"`
Path string `json:"path"`
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
}
AddressInfo represents the information about a wallet address.
type TransactionInfo ¶
type TransactionInfo struct {
No int64
TxID string
Sender string
Receiver string
Direction TxDirection
Amount amount.Amount
Fee amount.Amount
Memo string
Status TransactionStatus
BlockHeight block.Height
PayloadType payload.Type
Data []byte
Comment string
CreatedAt time.Time
UpdatedAt time.Time
}
func MakeTransactionInfos ¶
func MakeTransactionInfos(trx *tx.Tx, status TransactionStatus, blockHeight block.Height) ([]*TransactionInfo, error)
MakeTransactionInfos builds one or more TransactionInfo entries from the given transaction.
It may return multiple entries (one per recipient) to support batch transfer transactions. Note that the caller is responsible for setting the transaction direction.
type TransactionStatus ¶
type TransactionStatus int
func (TransactionStatus) String ¶
func (ts TransactionStatus) String() string
type TxDirection ¶
type TxDirection int
TxDirection indicates whether to include incoming or outgoing transactions.
func (TxDirection) String ¶
func (dir TxDirection) String() string
Click to show internal directories.
Click to hide internal directories.