accounts

package
v1.0.0-alpha.23 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const BlockIssuanceCreditsBytesLength = serializer.Int64ByteSize + iotago.SlotIndexLength

Variables

This section is empty.

Functions

func WithBlockIssuerKeys

func WithBlockIssuerKeys(blockIssuerKeys ...iotago.BlockIssuerKey) options.Option[AccountData]

func WithCredits

func WithCredits(credits *BlockIssuanceCredits) options.Option[AccountData]

func WithDelegationStake

func WithDelegationStake(delegationStake iotago.BaseToken) options.Option[AccountData]

func WithExpirySlot

func WithExpirySlot(expirySlot iotago.SlotIndex) options.Option[AccountData]

func WithFixedCost

func WithFixedCost(fixedCost iotago.Mana) options.Option[AccountData]

func WithLatestSupportedProtocolVersion

func WithLatestSupportedProtocolVersion(versionAndHash model.VersionAndHash) options.Option[AccountData]

func WithOutputID

func WithOutputID(outputID iotago.OutputID) options.Option[AccountData]

func WithStakeEndEpoch

func WithStakeEndEpoch(stakeEndEpoch iotago.EpochIndex) options.Option[AccountData]

func WithValidatorStake

func WithValidatorStake(validatorStake iotago.BaseToken) options.Option[AccountData]

Types

type AccountData

type AccountData struct {
	ID              iotago.AccountID
	Credits         *BlockIssuanceCredits
	ExpirySlot      iotago.SlotIndex
	OutputID        iotago.OutputID
	BlockIssuerKeys iotago.BlockIssuerKeys

	ValidatorStake                        iotago.BaseToken
	DelegationStake                       iotago.BaseToken
	FixedCost                             iotago.Mana
	StakeEndEpoch                         iotago.EpochIndex
	LatestSupportedProtocolVersionAndHash model.VersionAndHash
}

func AccountDataFromBytes

func AccountDataFromBytes(b []byte) (*AccountData, int, error)

func AccountDataFromReader

func AccountDataFromReader(reader io.ReadSeeker) (*AccountData, error)

func NewAccountData

func NewAccountData(id iotago.AccountID, opts ...options.Option[AccountData]) *AccountData

func (*AccountData) AddBlockIssuerKeys

func (a *AccountData) AddBlockIssuerKeys(blockIssuerKeys ...iotago.BlockIssuerKey)

func (*AccountData) Bytes

func (a *AccountData) Bytes() ([]byte, error)

func (*AccountData) Clone

func (a *AccountData) Clone() *AccountData

func (*AccountData) RemoveBlockIssuerKey

func (a *AccountData) RemoveBlockIssuerKey(blockIssuerKeys ...iotago.BlockIssuerKey)

func (*AccountData) String

func (a *AccountData) String() string

type AccountsData

type AccountsData []*AccountData

type BlockIssuanceCredits

type BlockIssuanceCredits struct {
	Value      iotago.BlockIssuanceCredits
	UpdateSlot iotago.SlotIndex
}

BlockIssuanceCredits is a weight annotated with the slot it was last updated in.

func BlockIssuanceCreditsFromBytes

func BlockIssuanceCreditsFromBytes(bytes []byte) (*BlockIssuanceCredits, int, error)

func NewBlockIssuanceCredits

func NewBlockIssuanceCredits(value iotago.BlockIssuanceCredits, updateTime iotago.SlotIndex) (newCredits *BlockIssuanceCredits)

NewBlockIssuanceCredits creates a new Credits instance.

func (*BlockIssuanceCredits) Bytes

func (c *BlockIssuanceCredits) Bytes() ([]byte, error)

Bytes returns a serialized version of the Credits.

func (*BlockIssuanceCredits) String

func (c *BlockIssuanceCredits) String() string

func (*BlockIssuanceCredits) Update

func (c *BlockIssuanceCredits) Update(change iotago.BlockIssuanceCredits, updateSlot ...iotago.SlotIndex)

Update updates the Credits increasing Value and updateTime.

type Mana

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

Mana is the stored and potential mana value of an account collected on the UTXO layer - used by the Scheduler.

func NewMana

func NewMana(value iotago.Mana, excessBaseTokens iotago.BaseToken, updateTime iotago.SlotIndex) *Mana

func (*Mana) ExcessBaseTokens

func (m *Mana) ExcessBaseTokens() iotago.BaseToken

func (*Mana) String

func (m *Mana) String() string

func (*Mana) UpdateTime

func (m *Mana) UpdateTime() iotago.SlotIndex

func (*Mana) Value

func (m *Mana) Value() iotago.Mana

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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