shelley

package
v0.94.2 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	EraIdShelley   = 1
	EraNameShelley = "Shelley"

	BlockTypeShelley = 2

	BlockHeaderTypeShelley = 1

	TxTypeShelley = 1
)
View Source
const (
	NonceType0 = 0
	NonceType1 = 1
)

Variables

View Source
var (
	EraShelley = common.Era{
		Id:   EraIdShelley,
		Name: EraNameShelley,
	}
)

Functions

This section is empty.

Types

type Nonce

type Nonce struct {
	cbor.StructAsArray
	Type  uint
	Value [32]byte
}

func (*Nonce) UnmarshalCBOR

func (n *Nonce) UnmarshalCBOR(data []byte) error

type ShelleyBlock

type ShelleyBlock struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor
	Header                 *ShelleyBlockHeader
	TransactionBodies      []ShelleyTransactionBody
	TransactionWitnessSets []ShelleyTransactionWitnessSet
	TransactionMetadataSet map[uint]*cbor.LazyValue
}

func NewShelleyBlockFromCbor

func NewShelleyBlockFromCbor(data []byte) (*ShelleyBlock, error)

func (*ShelleyBlock) BlockBodySize

func (b *ShelleyBlock) BlockBodySize() uint64

func (*ShelleyBlock) BlockNumber

func (b *ShelleyBlock) BlockNumber() uint64

func (*ShelleyBlock) Era

func (b *ShelleyBlock) Era() common.Era

func (*ShelleyBlock) Hash

func (b *ShelleyBlock) Hash() string

func (*ShelleyBlock) IssuerVkey

func (b *ShelleyBlock) IssuerVkey() common.IssuerVkey

func (*ShelleyBlock) SlotNumber

func (b *ShelleyBlock) SlotNumber() uint64

func (*ShelleyBlock) Transactions

func (b *ShelleyBlock) Transactions() []common.Transaction

func (ShelleyBlock) Type added in v0.94.0

func (ShelleyBlock) Type() int

func (*ShelleyBlock) UnmarshalCBOR

func (b *ShelleyBlock) UnmarshalCBOR(cborData []byte) error

func (*ShelleyBlock) Utxorpc

func (b *ShelleyBlock) Utxorpc() *utxorpc.Block

type ShelleyBlockHeader

type ShelleyBlockHeader struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor

	Body struct {
		cbor.StructAsArray
		BlockNumber          uint64
		Slot                 uint64
		PrevHash             common.Blake2b256
		IssuerVkey           common.IssuerVkey
		VrfKey               []byte
		NonceVrf             interface{}
		LeaderVrf            interface{}
		BlockBodySize        uint64
		BlockBodyHash        common.Blake2b256
		OpCertHotVkey        []byte
		OpCertSequenceNumber uint32
		OpCertKesPeriod      uint32
		OpCertSignature      []byte
		ProtoMajorVersion    uint64
		ProtoMinorVersion    uint64
	}
	Signature interface{}
	// contains filtered or unexported fields
}

func NewShelleyBlockHeaderFromCbor

func NewShelleyBlockHeaderFromCbor(data []byte) (*ShelleyBlockHeader, error)

func (*ShelleyBlockHeader) BlockBodySize

func (h *ShelleyBlockHeader) BlockBodySize() uint64

func (*ShelleyBlockHeader) BlockNumber

func (h *ShelleyBlockHeader) BlockNumber() uint64

func (*ShelleyBlockHeader) Era

func (h *ShelleyBlockHeader) Era() common.Era

func (*ShelleyBlockHeader) Hash

func (h *ShelleyBlockHeader) Hash() string

func (*ShelleyBlockHeader) IssuerVkey

func (h *ShelleyBlockHeader) IssuerVkey() common.IssuerVkey

func (*ShelleyBlockHeader) SlotNumber

func (h *ShelleyBlockHeader) SlotNumber() uint64

func (*ShelleyBlockHeader) UnmarshalCBOR

func (h *ShelleyBlockHeader) UnmarshalCBOR(cborData []byte) error

type ShelleyProtocolParameterUpdate

type ShelleyProtocolParameterUpdate struct {
	MinFeeA            uint      `cbor:"0,keyasint"`
	MinFeeB            uint      `cbor:"1,keyasint"`
	MaxBlockBodySize   uint      `cbor:"2,keyasint"`
	MaxTxSize          uint      `cbor:"3,keyasint"`
	MaxBlockHeaderSize uint      `cbor:"4,keyasint"`
	KeyDeposit         uint      `cbor:"5,keyasint"`
	PoolDeposit        uint      `cbor:"6,keyasint"`
	MaxEpoch           uint      `cbor:"7,keyasint"`
	NOpt               uint      `cbor:"8,keyasint"`
	A0                 *cbor.Rat `cbor:"9,keyasint"`
	Rho                *cbor.Rat `cbor:"10,keyasint"`
	Tau                *cbor.Rat `cbor:"11,keyasint"`
	Decentralization   *cbor.Rat `cbor:"12,keyasint"`
	Nonce              *Nonce    `cbor:"13,keyasint"`
	ProtocolVersion    struct {
		cbor.StructAsArray
		Major uint
		Minor uint
	} `cbor:"14,keyasint"`
	MinUtxoValue uint `cbor:"15,keyasint"`
}

type ShelleyProtocolParameters

type ShelleyProtocolParameters struct {
	cbor.StructAsArray
	MinFeeA            uint
	MinFeeB            uint
	MaxBlockBodySize   uint
	MaxTxSize          uint
	MaxBlockHeaderSize uint
	KeyDeposit         uint
	PoolDeposit        uint
	MaxEpoch           uint
	NOpt               uint
	A0                 *cbor.Rat
	Rho                *cbor.Rat
	Tau                *cbor.Rat
	Decentralization   *cbor.Rat
	Nonce              *cbor.Rat
	ProtocolMajor      uint
	ProtocolMinor      uint
	MinUtxoValue       uint
}

type ShelleyTransaction

type ShelleyTransaction struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor
	Body       ShelleyTransactionBody
	WitnessSet ShelleyTransactionWitnessSet
	TxMetadata *cbor.LazyValue
}

func NewShelleyTransactionFromCbor

func NewShelleyTransactionFromCbor(data []byte) (*ShelleyTransaction, error)

func (ShelleyTransaction) AssetMint

func (ShelleyTransaction) AuxDataHash

func (t ShelleyTransaction) AuxDataHash() *common.Blake2b256

func (*ShelleyTransaction) Cbor

func (t *ShelleyTransaction) Cbor() []byte

func (ShelleyTransaction) Certificates

func (t ShelleyTransaction) Certificates() []common.Certificate

func (ShelleyTransaction) Collateral

func (t ShelleyTransaction) Collateral() []common.TransactionInput

func (ShelleyTransaction) CollateralReturn

func (t ShelleyTransaction) CollateralReturn() common.TransactionOutput

func (ShelleyTransaction) Consumed

func (ShelleyTransaction) CurrentTreasuryValue

func (t ShelleyTransaction) CurrentTreasuryValue() int64

func (ShelleyTransaction) Donation

func (t ShelleyTransaction) Donation() uint64

func (ShelleyTransaction) Fee

func (t ShelleyTransaction) Fee() uint64

func (ShelleyTransaction) Hash

func (t ShelleyTransaction) Hash() string

func (ShelleyTransaction) Inputs

func (ShelleyTransaction) IsValid

func (t ShelleyTransaction) IsValid() bool

func (ShelleyTransaction) Metadata

func (t ShelleyTransaction) Metadata() *cbor.LazyValue

func (ShelleyTransaction) Outputs

func (ShelleyTransaction) Produced

func (t ShelleyTransaction) Produced() []common.Utxo

func (ShelleyTransaction) ProposalProcedures

func (t ShelleyTransaction) ProposalProcedures() []common.ProposalProcedure

func (*ShelleyTransaction) ProtocolParametersUpdate

func (t *ShelleyTransaction) ProtocolParametersUpdate() map[common.Blake2b224]any

func (ShelleyTransaction) ReferenceInputs

func (t ShelleyTransaction) ReferenceInputs() []common.TransactionInput

func (ShelleyTransaction) RequiredSigners

func (t ShelleyTransaction) RequiredSigners() []common.Blake2b224

func (ShelleyTransaction) ScriptDataHash

func (t ShelleyTransaction) ScriptDataHash() *common.Blake2b256

func (ShelleyTransaction) TTL

func (t ShelleyTransaction) TTL() uint64

func (ShelleyTransaction) TotalCollateral

func (t ShelleyTransaction) TotalCollateral() uint64

func (ShelleyTransaction) Type added in v0.94.0

func (ShelleyTransaction) Type() int

func (ShelleyTransaction) Utxorpc

func (t ShelleyTransaction) Utxorpc() *utxorpc.Tx

func (ShelleyTransaction) ValidityIntervalStart

func (t ShelleyTransaction) ValidityIntervalStart() uint64

func (ShelleyTransaction) VotingProcedures

func (t ShelleyTransaction) VotingProcedures() common.VotingProcedures

func (ShelleyTransaction) Withdrawals

func (t ShelleyTransaction) Withdrawals() map[*common.Address]uint64

type ShelleyTransactionBody

type ShelleyTransactionBody struct {
	cbor.DecodeStoreCbor

	TxInputs       []ShelleyTransactionInput   `cbor:"0,keyasint,omitempty"`
	TxOutputs      []ShelleyTransactionOutput  `cbor:"1,keyasint,omitempty"`
	TxFee          uint64                      `cbor:"2,keyasint,omitempty"`
	Ttl            uint64                      `cbor:"3,keyasint,omitempty"`
	TxCertificates []common.CertificateWrapper `cbor:"4,keyasint,omitempty"`
	TxWithdrawals  map[*common.Address]uint64  `cbor:"5,keyasint,omitempty"`
	Update         struct {
		cbor.StructAsArray
		ProtocolParamUpdates map[common.Blake2b224]ShelleyProtocolParameterUpdate
		Epoch                uint64
	} `cbor:"6,keyasint,omitempty"`
	TxAuxDataHash *common.Blake2b256 `cbor:"7,keyasint,omitempty"`
	// contains filtered or unexported fields
}

func NewShelleyTransactionBodyFromCbor

func NewShelleyTransactionBodyFromCbor(
	data []byte,
) (*ShelleyTransactionBody, error)

func (*ShelleyTransactionBody) AssetMint

func (*ShelleyTransactionBody) AuxDataHash

func (b *ShelleyTransactionBody) AuxDataHash() *common.Blake2b256

func (*ShelleyTransactionBody) Certificates

func (b *ShelleyTransactionBody) Certificates() []common.Certificate

func (*ShelleyTransactionBody) Collateral

func (*ShelleyTransactionBody) CollateralReturn

func (b *ShelleyTransactionBody) CollateralReturn() common.TransactionOutput

func (*ShelleyTransactionBody) CurrentTreasuryValue

func (b *ShelleyTransactionBody) CurrentTreasuryValue() int64

func (*ShelleyTransactionBody) Donation

func (b *ShelleyTransactionBody) Donation() uint64

func (*ShelleyTransactionBody) Fee

func (b *ShelleyTransactionBody) Fee() uint64

func (*ShelleyTransactionBody) Hash

func (b *ShelleyTransactionBody) Hash() string

func (*ShelleyTransactionBody) Inputs

func (*ShelleyTransactionBody) Outputs

func (*ShelleyTransactionBody) ProposalProcedures

func (b *ShelleyTransactionBody) ProposalProcedures() []common.ProposalProcedure

func (*ShelleyTransactionBody) ProtocolParametersUpdate

func (b *ShelleyTransactionBody) ProtocolParametersUpdate() map[common.Blake2b224]any

func (*ShelleyTransactionBody) ReferenceInputs

func (b *ShelleyTransactionBody) ReferenceInputs() []common.TransactionInput

func (*ShelleyTransactionBody) RequiredSigners

func (b *ShelleyTransactionBody) RequiredSigners() []common.Blake2b224

func (*ShelleyTransactionBody) ScriptDataHash

func (b *ShelleyTransactionBody) ScriptDataHash() *common.Blake2b256

func (*ShelleyTransactionBody) TTL

func (b *ShelleyTransactionBody) TTL() uint64

func (*ShelleyTransactionBody) TotalCollateral

func (b *ShelleyTransactionBody) TotalCollateral() uint64

func (*ShelleyTransactionBody) UnmarshalCBOR

func (b *ShelleyTransactionBody) UnmarshalCBOR(cborData []byte) error

func (*ShelleyTransactionBody) Utxorpc

func (b *ShelleyTransactionBody) Utxorpc() *utxorpc.Tx

func (*ShelleyTransactionBody) ValidityIntervalStart

func (b *ShelleyTransactionBody) ValidityIntervalStart() uint64

func (*ShelleyTransactionBody) VotingProcedures

func (b *ShelleyTransactionBody) VotingProcedures() common.VotingProcedures

func (*ShelleyTransactionBody) Withdrawals

func (b *ShelleyTransactionBody) Withdrawals() map[*common.Address]uint64

type ShelleyTransactionInput

type ShelleyTransactionInput struct {
	cbor.StructAsArray
	TxId        common.Blake2b256
	OutputIndex uint32
}

func NewShelleyTransactionInput

func NewShelleyTransactionInput(hash string, idx int) ShelleyTransactionInput

func (ShelleyTransactionInput) Id

func (ShelleyTransactionInput) Index

func (i ShelleyTransactionInput) Index() uint32

func (ShelleyTransactionInput) MarshalJSON

func (i ShelleyTransactionInput) MarshalJSON() ([]byte, error)

func (ShelleyTransactionInput) String

func (i ShelleyTransactionInput) String() string

func (ShelleyTransactionInput) Utxorpc

type ShelleyTransactionOutput

type ShelleyTransactionOutput struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor
	OutputAddress common.Address `json:"address"`
	OutputAmount  uint64         `json:"amount"`
}

func NewShelleyTransactionOutputFromCbor

func NewShelleyTransactionOutputFromCbor(
	data []byte,
) (*ShelleyTransactionOutput, error)

func (ShelleyTransactionOutput) Address

func (ShelleyTransactionOutput) Amount

func (o ShelleyTransactionOutput) Amount() uint64

func (ShelleyTransactionOutput) Assets

func (ShelleyTransactionOutput) Datum

func (ShelleyTransactionOutput) DatumHash

func (ShelleyTransactionOutput) Utxorpc

type ShelleyTransactionWitnessSet

type ShelleyTransactionWitnessSet struct {
	cbor.DecodeStoreCbor
	VkeyWitnesses      []interface{} `cbor:"0,keyasint,omitempty"`
	MultisigScripts    []interface{} `cbor:"1,keyasint,omitempty"`
	BootstrapWitnesses []interface{} `cbor:"2,keyasint,omitempty"`
}

func (*ShelleyTransactionWitnessSet) UnmarshalCBOR

func (t *ShelleyTransactionWitnessSet) UnmarshalCBOR(cborData []byte) error

Jump to

Keyboard shortcuts

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