record

package
v1.0.0-beta.40 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressesRepo

type AddressesRepo interface {
	FindByStringAddresses(ctx context.Context, addresses iter.Seq[string]) ([]*database.Address, error)
}

AddressesRepo is an interface for addresses repository.

type Broadcaster

type Broadcaster interface {
	Broadcast(ctx context.Context, tx *trx.Transaction) (*chainmodels.TXInfo, error)
}

Broadcaster is an interface for broadcasting transactions.

type OperationsRepo

type OperationsRepo interface {
	SaveAll(ctx context.Context, opRows iter.Seq[*database.Operation]) error
}

OperationsRepo is an interface for operations repository.

type OutputsRepo

type OutputsRepo interface {
	FindByOutpoints(ctx context.Context, outpoints iter.Seq[bsv.Outpoint]) ([]*database.TrackedOutput, error)
}

OutputsRepo is an interface for outputs repository.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service for recording transactions

func NewService

func NewService(
	logger zerolog.Logger,
	addressesRepo AddressesRepo,
	outputsRepo OutputsRepo,
	operationsRepo OperationsRepo,
	broadcaster Broadcaster,
) *Service

NewService creates a new service for transactions

func (*Service) RecordPaymailTransaction

func (s *Service) RecordPaymailTransaction(ctx context.Context, tx *trx.Transaction, senderPaymail, receiverPaymail string) error

RecordPaymailTransaction will validate, broadcast and save paymail transaction

func (*Service) RecordTransactionOutline

func (s *Service) RecordTransactionOutline(ctx context.Context, userID string, outline *outlines.Transaction) error

RecordTransactionOutline will validate, broadcast and save a transaction outline

Jump to

Keyboard shortcuts

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