types

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 7 Imported by: 0

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

type WalletInfo

type WalletInfo struct {
	Version    int
	Driver     string
	Path       string
	Network    genesis.ChainType
	DefaultFee amount.Amount
	UUID       string
	Encrypted  bool
	Neutered   bool
	CreatedAt  time.Time
}

WalletInfo represents the information about the wallet.

Jump to

Keyboard shortcuts

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