v1domain

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	AccountInfo
	Index                  uint32
	BirthdayBlock          uint32
	NextExternalIndex      uint
	NextInternalIndex      uint
	DerivationPathByScript map[string]string
}

type AccountInfo

type AccountInfo struct {
	Namespace      string
	Label          string
	Xpub           string
	DerivationPath string
}

type AddressInfo

type AddressInfo struct {
	Account        string
	Address        string
	BlindingKey    []byte
	DerivationPath string
	Script         string
}

type OceanRepoManager

type OceanRepoManager interface {
	WalletRepository() WalletRepository
	UtxoRepository() UtxoRepository
	TransactionRepository() TransactionRepository
}

func NewOceanRepoManager

func NewOceanRepoManager(oceanDbDir string) (OceanRepoManager, error)

type Transaction

type Transaction struct {
	TxID        string
	TxHex       string
	BlockHash   string
	BlockHeight uint64
	Accounts    map[string]struct{}
}

Transaction is the data structure representing an Elements tx with extra info like whether it is conifirmed/unconfirmed and the name of the accounts owning one or more of its inputs.

func (*Transaction) AddAccount

func (t *Transaction) AddAccount(accountName string)

AddAccount adds the given account to the map of those involved in the tx.

func (*Transaction) Confirm

func (t *Transaction) Confirm(blockHash string, blockHeight uint64)

Confirm marks the tx as confirmed.

func (*Transaction) IsConfirmed

func (t *Transaction) IsConfirmed() bool

IsConfirmed returns whther the tx is included in the blockchain.

type TransactionRepository

type TransactionRepository interface {
	AddTransactions(txs []*Transaction) error
}

func NewTransactionRepositoryImpl

func NewTransactionRepositoryImpl(store *badgerhold.Store) TransactionRepository

type Utxo

type Utxo struct {
	UtxoKey
	Value               uint64
	Asset               string
	ValueCommitment     []byte
	AssetCommitment     []byte
	ValueBlinder        []byte
	AssetBlinder        []byte
	Script              []byte
	Nonce               []byte
	RangeProof          []byte
	SurjectionProof     []byte
	AccountName         string
	LockTimestamp       int64
	LockExpiryTimestamp int64
	SpentStatus         UtxoStatus
	ConfirmedStatus     UtxoStatus
}

func (*Utxo) Key

func (u *Utxo) Key() UtxoKey

type UtxoKey

type UtxoKey struct {
	TxID string
	VOut uint32
}

func (UtxoKey) Hash

func (k UtxoKey) Hash() string

type UtxoRepository

type UtxoRepository interface {
	AddUtxos(utxos []*Utxo) error
}

func NewUtxoRepositoryImpl

func NewUtxoRepositoryImpl(store *badgerhold.Store) UtxoRepository

type UtxoStatus

type UtxoStatus struct {
	Txid        string
	BlockHeight uint64
	BlockTime   int64
	BlockHash   string
}

type Wallet

type Wallet struct {
	EncryptedMnemonic   []byte
	PasswordHash        []byte
	BirthdayBlockHeight uint32
	RootPath            string
	NetworkName         string
	Accounts            map[string]*Account
	AccountsByLabel     map[string]string
	NextAccountIndex    uint32
}

type WalletRepository

type WalletRepository interface {
	InsertWallet(wallet *Wallet) error
	GetWallet() (*Wallet, error)
}

func NewWalletRepositoryImpl

func NewWalletRepositoryImpl(store *badgerhold.Store) WalletRepository

Jump to

Keyboard shortcuts

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