models

package
v0.0.0-...-78afc55 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UTXOStateUnspent = "unspent"
	UTXOStateSpent   = "spent"
)
View Source
const (
	MainnetSnapshotsCheckpoint = "service-mainnet-snapshots-checkpoint"
)

Variables

This section is empty.

Functions

func CreateOrUpdateUTXOs

func CreateOrUpdateUTXOs(ctx context.Context, tx *mixin.Transaction, timestamp uint64) error

func CreateSnapshot

func CreateSnapshot(ctx context.Context, hash string, topology, timestamp int64, transactionHash string) error

func GetAmountByViewKey

func GetAmountByViewKey(ctx context.Context, view string)

func ReadProperty

func ReadProperty(ctx context.Context, key string) (string, error)

func WriteProperty

func WriteProperty(ctx context.Context, key, value string) error

Types

type Property

type Property struct {
	Key       string
	Value     string
	UpdatedAt time.Time
}

type Snapshot

type Snapshot struct {
	Hash            string    `json:"hash"`
	Topology        int64     `json:"topology"`
	Timestamp       time.Time `json:"timestamp"`
	TransactionHash string    `json:"transaction_hash"`
}

func QuerySnapshotByHash

func QuerySnapshotByHash(ctx context.Context, hash string) (*Snapshot, error)

func QuerySnapshotByTransactionHash

func QuerySnapshotByTransactionHash(ctx context.Context, transactionHash string) (*Snapshot, error)

type UTXO

type UTXO struct {
	UTXOId          string
	TransactionHash string
	AssetId         string
	Amount          string
	OutputIndex     int
	OutputScript    string
	OutputType      uint8
	State           string
	Keys            []string
	Mask            string
	Extra           string
	SpentBy         string
	CreatedAt       time.Time
}

Jump to

Keyboard shortcuts

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