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

common

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 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 ConfirmationReceipt added in v1.11.14

type ConfirmationReceipt struct {
	// Identifies the primary chain ("P", "X" or "C")
	ChainAlias string
	// ID of the issued transaction
	TxID ids.ID
	// The time from initiation to confirmation
	TotalDuration time.Duration
	// The time from issuance to confirmation. It does not include the duration
	// of issuance.
	ConfirmationDuration time.Duration
}

ConfirmationReceipt is the information known after issuing and confirming a transaction.

type IssuanceReceipt added in v1.13.3

type IssuanceReceipt struct {
	// Identifies the primary chain ("P", "X" or "C")
	ChainAlias string
	// ID of the issued transaction
	TxID ids.ID
	// The time from initiation to issuance
	Duration time.Duration
}

IssuanceReceipt is the information known after issuing a 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 added in v1.11.14

func WithConfirmationHandler(f func(ConfirmationReceipt)) 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 WithIssuanceHandler added in v1.13.3

func WithIssuanceHandler(f func(IssuanceReceipt)) Option

func WithMemo

func WithMemo(memo []byte) Option

func WithMinIssuanceTime

func WithMinIssuanceTime(minIssuanceTime uint64) Option

func WithPollFrequency

func WithPollFrequency(pollFrequency time.Duration) 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 added in v1.11.14

func (o *Options) ConfirmationHandler() func(ConfirmationReceipt)

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) IssuanceHandler added in v1.13.3

func (o *Options) IssuanceHandler() func(IssuanceReceipt)

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

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