tangleledger

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0, BSD-2-Clause Imports: 6 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() *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) EventTransactionConfirmed

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

EventTransactionConfirmed returns an event that triggers when a transaction is confirmed

func (*TangleLedger) GetConfirmedTransaction

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

GetConfirmedTransaction fetches a transaction by ID, and executes the given callback if found

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) GetTxInclusionState

func (t *TangleLedger) GetTxInclusionState(txid ledgerstate.TransactionID) (ledgerstate.InclusionState, error)

GetTxInclusionState returns the inclusion state of the given transaction

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