Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InputsSpec ¶
type InputsSpec struct { }
InputsSpec are representing a client specification for inputs part of the transaction.
type OutputSpec ¶
type OutputSpec interface {
// contains filtered or unexported methods
}
OutputSpec is a specification for a single output of the transaction.
type OutputsSpec ¶
type OutputsSpec struct {
Outputs []OutputSpec
}
OutputsSpec are representing a client specification for outputs part of the transaction.
func NewOutputsSpecs ¶
func NewOutputsSpecs(outputs ...OutputSpec) OutputsSpec
NewOutputsSpecs constructs a new OutputsSpec instance with provided outputs specifications.
func (*OutputsSpec) Add ¶
func (s *OutputsSpec) Add(output OutputSpec)
Add a new output specification to the list of outputs.
func (*OutputsSpec) Evaluate ¶
func (s *OutputsSpec) Evaluate(ctx *evaluationContext) ([]*sdk.TransactionOutput, transaction.OutputsAnnotations, error)
Evaluate the outputs specifications and return the transaction outputs and their annotations.
type PaymailAddressService ¶
type PaymailAddressService interface { HasPaymailAddress(ctx context.Context, userID string, address string) (bool, error) GetDefaultPaymailAddress(ctx context.Context, userID string) (string, error) }
PaymailAddressService is a component that provides methods for working with paymail address.
type Service ¶
type Service interface { CreateBEEF(ctx context.Context, spec *TransactionSpec) (*Transaction, error) CreateRawTx(ctx context.Context, spec *TransactionSpec) (*Transaction, error) }
Service is a service for creating transaction outlines.
func NewService ¶
func NewService(paymailService paymail.ServiceClient, paymailAddressService PaymailAddressService, utxoSelector UTXOSelector, logger zerolog.Logger) Service
NewService creates a new transaction outlines service.
type Transaction ¶
type Transaction struct { Hex bsv.TxHex Annotations transaction.Annotations }
Transaction represents a transaction outline.
type TransactionSpec ¶
type TransactionSpec struct { Outputs OutputsSpec UserID string Inputs InputsSpec }
TransactionSpec represents client provided specification for a transaction outline.
type UTXO ¶
type UTXO struct { TxID string Vout uint32 bsvmodel.CustomInstructions }
UTXO represents an unspent transaction output.
type UTXOSelector ¶
type UTXOSelector interface {
Select(ctx context.Context, tx *sdk.Transaction, userID string) ([]*UTXO, error)
}
UTXOSelector is a component that provides methods for selecting UTXOs of given user to fund a transaction.