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

common

package
v1.36.35 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: BSD-3-Clause Imports: 12 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 WithCustomEVMAddresses added in v1.27.11

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

WithCustomEVMAddresses sets the option's filter to a custom set of 20-byte EVM-runtime account addresses. The value IS "EVM-runtime account address" — that's the data model.

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) EVMAddresses added in v1.27.11

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

EVMAddresses returns the configured set of 20-byte EVM-runtime account addresses (the format consumed by Lux C-Chain, regulated EVM L1, and every EVM-compatible chain). Naming reflects the data model that consumes the value (EVM account), not the hash primitive that derives it.

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