Help us shape the future of Go! Take the 2026 Go Developer Survey

common

package
v1.16.16 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchOwners

func MatchOwners(
	owners *secp256k1fx.OutputOwners,
	addrs set.Set[ids.ShortID],
	minIssuanceTime uint64,
) ([]uint32, bool)

MatchOwners attempts to match a list of addresses up to the provided threshold.

Types

type ChainUTXOs

type ChainUTXOs interface {
	AddUTXO(ctx context.Context, destinationChainID ids.ID, utxo *lux.UTXO) error
	RemoveUTXO(ctx context.Context, sourceChainID, utxoID ids.ID) error

	UTXOs(ctx context.Context, sourceChainID ids.ID) ([]*lux.UTXO, error)
	GetUTXO(ctx context.Context, sourceChainID, utxoID ids.ID) (*lux.UTXO, error)
}

func NewChainUTXOs

func NewChainUTXOs(chainID ids.ID, utxos UTXOs) ChainUTXOs

type ConfirmationHandler

type ConfirmationHandler func(ConfirmationReceipt)

ConfirmationHandler is called when a transaction is confirmed

type ConfirmationReceipt

type ConfirmationReceipt struct {
	ChainAlias           string
	TxID                 ids.ID
	IssuanceDuration     time.Duration
	ConfirmationDuration time.Duration
	TotalDuration        time.Duration
}

ConfirmationReceipt contains information about a confirmed transaction

type Option

type Option func(*Options)

func UnionOptions

func UnionOptions(first, second []Option) []Option

func WithAssumeDecided

func WithAssumeDecided() Option

func WithBaseFee

func WithBaseFee(baseFee *big.Int) Option

func WithChangeOwner

func WithChangeOwner(changeOwner *secp256k1fx.OutputOwners) Option

func WithConfirmationHandler

func WithConfirmationHandler(f ConfirmationHandler) Option

func WithContext

func WithContext(ctx context.Context) Option

func WithCustomAddresses

func WithCustomAddresses(addrs set.Set[ids.ShortID]) Option

func WithCustomEthAddresses

func WithCustomEthAddresses(addrs set.Set[ethcommon.Address]) Option

func WithMemo

func WithMemo(memo []byte) Option

func WithMinIssuanceTime

func WithMinIssuanceTime(minIssuanceTime uint64) Option

func WithPollFrequency

func WithPollFrequency(pollFrequency time.Duration) Option

func WithPostIssuanceFunc

func WithPostIssuanceFunc(f PostIssuanceFunc) Option

func WithStakeableLocked

func WithStakeableLocked() Option

type Options

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

func NewOptions

func NewOptions(ops []Option) *Options

func (*Options) Addresses

func (o *Options) Addresses(defaultAddresses set.Set[ids.ShortID]) set.Set[ids.ShortID]

func (*Options) AllowStakeableLocked

func (o *Options) AllowStakeableLocked() bool

func (*Options) AssumeDecided

func (o *Options) AssumeDecided() bool

func (*Options) BaseFee

func (o *Options) BaseFee(defaultBaseFee *big.Int) *big.Int

func (*Options) ChangeOwner

func (o *Options) ChangeOwner(defaultOwner *secp256k1fx.OutputOwners) *secp256k1fx.OutputOwners

func (*Options) ConfirmationHandler

func (o *Options) ConfirmationHandler() ConfirmationHandler

func (*Options) Context

func (o *Options) Context() context.Context

func (*Options) EthAddresses

func (o *Options) EthAddresses(defaultAddresses set.Set[ethcommon.Address]) set.Set[ethcommon.Address]

func (*Options) Memo

func (o *Options) Memo() []byte

func (*Options) MinIssuanceTime

func (o *Options) MinIssuanceTime() uint64

func (*Options) PollFrequency

func (o *Options) PollFrequency() time.Duration

func (*Options) PostIssuanceFunc

func (o *Options) PostIssuanceFunc() PostIssuanceFunc

type PostIssuanceFunc

type PostIssuanceFunc func(ids.ID)

Signature of the function that will be called after a transaction has been issued with the ID of the issued transaction.

type UTXOs

type UTXOs interface {
	AddUTXO(ctx context.Context, sourceChainID, destinationChainID ids.ID, utxo *lux.UTXO) error
	RemoveUTXO(ctx context.Context, sourceChainID, destinationChainID, utxoID ids.ID) error

	UTXOs(ctx context.Context, sourceChainID, destinationChainID ids.ID) ([]*lux.UTXO, error)
	GetUTXO(ctx context.Context, sourceChainID, destinationChainID, utxoID ids.ID) (*lux.UTXO, error)
}

func NewUTXOs

func NewUTXOs() UTXOs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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