tangleledger

package
v0.8.11 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: Apache-2.0, BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TangleLedger

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

TangleLedger imlpements txstream.TangleLedger with the GoShimmer tangle as backend.

func New

func New(tangleInstance *tangle.Tangle) *TangleLedger

New returns an implementation for txstream.Ledger.

func (*TangleLedger) Detach

func (t *TangleLedger) Detach()

Detach detaches the event handlers.

func (*TangleLedger) EventTransactionBooked

func (t *TangleLedger) EventTransactionBooked() *events.Event

EventTransactionBooked returns an event that triggers when a transaction is booked.

func (*TangleLedger) GetHighGoFTransaction added in v0.8.0

func (t *TangleLedger) GetHighGoFTransaction(txid ledgerstate.TransactionID, f func(ret *ledgerstate.Transaction)) (found bool)

GetHighGoFTransaction fetches a transaction by ID, and executes the given callback if its GoF is high.

func (*TangleLedger) GetOutput

func (t *TangleLedger) GetOutput(outID ledgerstate.OutputID, f func(ledgerstate.Output)) bool

GetOutput finds an output by ID (either spent or unspent).

func (*TangleLedger) GetOutputMetadata

func (t *TangleLedger) GetOutputMetadata(outID ledgerstate.OutputID, f func(*ledgerstate.OutputMetadata)) bool

GetOutputMetadata finds an output by ID and returns its metadata.

func (*TangleLedger) GetUnspentOutputs

func (t *TangleLedger) GetUnspentOutputs(addr ledgerstate.Address, f func(output ledgerstate.Output))

GetUnspentOutputs returns the available UTXOs for an address.

func (*TangleLedger) PostTransaction

func (t *TangleLedger) PostTransaction(tx *ledgerstate.Transaction) error

PostTransaction posts a transaction to the ledger.

Jump to

Keyboard shortcuts

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