github.com/MetalBlockchain/metalgo@v1.11.9/vms/platformvm/txs/staker_tx.go (about)

     1  // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  package txs
     5  
     6  import (
     7  	"time"
     8  
     9  	"github.com/MetalBlockchain/metalgo/ids"
    10  	"github.com/MetalBlockchain/metalgo/utils/crypto/bls"
    11  	"github.com/MetalBlockchain/metalgo/vms/components/avax"
    12  	"github.com/MetalBlockchain/metalgo/vms/platformvm/fx"
    13  )
    14  
    15  // ValidatorTx defines the interface for a validator transaction that supports
    16  // delegation.
    17  type ValidatorTx interface {
    18  	UnsignedTx
    19  	PermissionlessStaker
    20  
    21  	ValidationRewardsOwner() fx.Owner
    22  	DelegationRewardsOwner() fx.Owner
    23  	Shares() uint32
    24  }
    25  
    26  type DelegatorTx interface {
    27  	UnsignedTx
    28  	PermissionlessStaker
    29  
    30  	RewardsOwner() fx.Owner
    31  }
    32  
    33  type StakerTx interface {
    34  	UnsignedTx
    35  	Staker
    36  }
    37  
    38  type PermissionlessStaker interface {
    39  	Staker
    40  
    41  	Outputs() []*avax.TransferableOutput
    42  	Stake() []*avax.TransferableOutput
    43  }
    44  
    45  type Staker interface {
    46  	SubnetID() ids.ID
    47  	NodeID() ids.NodeID
    48  	// PublicKey returns the BLS public key registered by this transaction. If
    49  	// there was no key registered by this transaction, it will return false.
    50  	PublicKey() (*bls.PublicKey, bool, error)
    51  	EndTime() time.Time
    52  	Weight() uint64
    53  	CurrentPriority() Priority
    54  }
    55  
    56  type ScheduledStaker interface {
    57  	Staker
    58  	StartTime() time.Time
    59  	PendingPriority() Priority
    60  }