babbage

package
v0.105.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EraIdBabbage   = 5
	EraNameBabbage = "Babbage"

	BlockTypeBabbage = 6

	BlockHeaderTypeBabbage = 5

	TxTypeBabbage = 5
)
View Source
const (
	DatumOptionTypeHash = 0
	DatumOptionTypeData = 1
)

Variables

View Source
var (
	EraBabbage = common.Era{
		Id:   EraIdBabbage,
		Name: EraNameBabbage,
	}
)

Functions

This section is empty.

Types

type BabbageBlock

type BabbageBlock struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor
	BlockHeader            *BabbageBlockHeader
	TransactionBodies      []BabbageTransactionBody
	TransactionWitnessSets []BabbageTransactionWitnessSet
	TransactionMetadataSet map[uint]*cbor.LazyValue
	InvalidTransactions    []uint
}

func NewBabbageBlockFromCbor

func NewBabbageBlockFromCbor(data []byte) (*BabbageBlock, error)

func (*BabbageBlock) BlockBodySize

func (b *BabbageBlock) BlockBodySize() uint64

func (*BabbageBlock) BlockNumber

func (b *BabbageBlock) BlockNumber() uint64

func (*BabbageBlock) Era

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

func (*BabbageBlock) Hash

func (b *BabbageBlock) Hash() string

func (*BabbageBlock) Header

func (b *BabbageBlock) Header() common.BlockHeader

func (*BabbageBlock) IssuerVkey

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

func (*BabbageBlock) PrevHash added in v0.105.0

func (b *BabbageBlock) PrevHash() string

func (*BabbageBlock) SlotNumber

func (b *BabbageBlock) SlotNumber() uint64

func (*BabbageBlock) Transactions

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

func (BabbageBlock) Type added in v0.94.0

func (BabbageBlock) Type() int

func (*BabbageBlock) UnmarshalCBOR

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

func (*BabbageBlock) Utxorpc

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

type BabbageBlockHeader

type BabbageBlockHeader struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor

	Body struct {
		cbor.StructAsArray
		BlockNumber   uint64
		Slot          uint64
		PrevHash      common.Blake2b256
		IssuerVkey    common.IssuerVkey
		VrfKey        []byte
		VrfResult     interface{}
		BlockBodySize uint64
		BlockBodyHash common.Blake2b256
		OpCert        struct {
			cbor.StructAsArray
			HotVkey        []byte
			SequenceNumber uint32
			KesPeriod      uint32
			Signature      []byte
		}
		ProtoVersion struct {
			cbor.StructAsArray
			Major uint64
			Minor uint64
		}
	}
	Signature interface{}
	// contains filtered or unexported fields
}

func NewBabbageBlockHeaderFromCbor

func NewBabbageBlockHeaderFromCbor(data []byte) (*BabbageBlockHeader, error)

func (*BabbageBlockHeader) BlockBodySize

func (h *BabbageBlockHeader) BlockBodySize() uint64

func (*BabbageBlockHeader) BlockNumber

func (h *BabbageBlockHeader) BlockNumber() uint64

func (*BabbageBlockHeader) Era

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

func (*BabbageBlockHeader) Hash

func (h *BabbageBlockHeader) Hash() string

func (*BabbageBlockHeader) IssuerVkey

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

func (*BabbageBlockHeader) PrevHash added in v0.105.0

func (h *BabbageBlockHeader) PrevHash() string

func (*BabbageBlockHeader) SlotNumber

func (h *BabbageBlockHeader) SlotNumber() uint64

func (*BabbageBlockHeader) UnmarshalCBOR

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

type BabbageProtocolParameterUpdate

type BabbageProtocolParameterUpdate struct {
	cbor.DecodeStoreCbor
	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"`
	ProtocolVersion      *common.ProtocolParametersProtocolVersion `cbor:"14,keyasint"`
	MinPoolCost          *uint64                                   `cbor:"16,keyasint"`
	AdaPerUtxoByte       *uint64                                   `cbor:"17,keyasint"`
	CostModels           map[uint][]int64                          `cbor:"18,keyasint"`
	ExecutionCosts       *common.ExUnitPrice                       `cbor:"19,keyasint"`
	MaxTxExUnits         *common.ExUnit                            `cbor:"20,keyasint"`
	MaxBlockExUnits      *common.ExUnit                            `cbor:"21,keyasint"`
	MaxValueSize         *uint                                     `cbor:"22,keyasint"`
	CollateralPercentage *uint                                     `cbor:"23,keyasint"`
	MaxCollateralInputs  *uint                                     `cbor:"24,keyasint"`
}

func (BabbageProtocolParameterUpdate) IsProtocolParameterUpdate added in v0.95.0

func (BabbageProtocolParameterUpdate) IsProtocolParameterUpdate()

func (*BabbageProtocolParameterUpdate) UnmarshalCBOR added in v0.95.0

func (u *BabbageProtocolParameterUpdate) UnmarshalCBOR(data []byte) error

type BabbageProtocolParameters

type BabbageProtocolParameters 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
	ProtocolMajor        uint
	ProtocolMinor        uint
	MinPoolCost          uint64
	AdaPerUtxoByte       uint64
	CostModels           map[uint][]int64
	ExecutionCosts       common.ExUnitPrice
	MaxTxExUnits         common.ExUnit
	MaxBlockExUnits      common.ExUnit
	MaxValueSize         uint
	CollateralPercentage uint
	MaxCollateralInputs  uint
}

BabbageProtocolParameters represents the current Babbage protocol parameters as seen in local-state-query

func UpgradePParams added in v0.103.0

func UpgradePParams(
	prevPParams alonzo.AlonzoProtocolParameters,
) BabbageProtocolParameters

func (*BabbageProtocolParameters) Update added in v0.99.0

func (p *BabbageProtocolParameters) Update(
	paramUpdate *BabbageProtocolParameterUpdate,
)

func (*BabbageProtocolParameters) Utxorpc added in v0.102.0

type BabbageTransaction

type BabbageTransaction struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor
	Body       BabbageTransactionBody
	WitnessSet BabbageTransactionWitnessSet
	IsTxValid  bool
	TxMetadata *cbor.LazyValue
}

func NewBabbageTransactionFromCbor

func NewBabbageTransactionFromCbor(data []byte) (*BabbageTransaction, error)

func (BabbageTransaction) AssetMint

func (BabbageTransaction) AuxDataHash

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

func (*BabbageTransaction) Cbor

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

func (BabbageTransaction) Certificates

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

func (BabbageTransaction) Collateral

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

func (BabbageTransaction) CollateralReturn

func (t BabbageTransaction) CollateralReturn() common.TransactionOutput

func (BabbageTransaction) Consumed

func (BabbageTransaction) CurrentTreasuryValue

func (t BabbageTransaction) CurrentTreasuryValue() int64

func (BabbageTransaction) Donation

func (t BabbageTransaction) Donation() uint64

func (BabbageTransaction) Fee

func (t BabbageTransaction) Fee() uint64

func (BabbageTransaction) Hash

func (t BabbageTransaction) Hash() string

func (BabbageTransaction) Inputs

func (BabbageTransaction) IsValid

func (t BabbageTransaction) IsValid() bool

func (BabbageTransaction) Metadata

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

func (BabbageTransaction) Outputs

func (BabbageTransaction) Produced

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

func (BabbageTransaction) ProposalProcedures

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

func (BabbageTransaction) ProtocolParameterUpdates added in v0.95.0

func (t BabbageTransaction) ProtocolParameterUpdates() (uint64, map[common.Blake2b224]common.ProtocolParameterUpdate)

func (BabbageTransaction) ReferenceInputs

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

func (BabbageTransaction) RequiredSigners

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

func (BabbageTransaction) ScriptDataHash

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

func (BabbageTransaction) TTL

func (t BabbageTransaction) TTL() uint64

func (BabbageTransaction) TotalCollateral

func (t BabbageTransaction) TotalCollateral() uint64

func (BabbageTransaction) Type added in v0.94.0

func (BabbageTransaction) Type() int

func (*BabbageTransaction) Utxorpc

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

func (BabbageTransaction) ValidityIntervalStart

func (t BabbageTransaction) ValidityIntervalStart() uint64

func (BabbageTransaction) VotingProcedures

func (t BabbageTransaction) VotingProcedures() common.VotingProcedures

func (BabbageTransaction) Withdrawals

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

type BabbageTransactionBody

type BabbageTransactionBody struct {
	alonzo.AlonzoTransactionBody
	TxOutputs []BabbageTransactionOutput `cbor:"1,keyasint,omitempty"`
	Update    struct {
		cbor.StructAsArray
		ProtocolParamUpdates map[common.Blake2b224]BabbageProtocolParameterUpdate
		Epoch                uint64
	} `cbor:"6,keyasint,omitempty"`
	TxCollateralReturn *BabbageTransactionOutput         `cbor:"16,keyasint,omitempty"`
	TxTotalCollateral  uint64                            `cbor:"17,keyasint,omitempty"`
	TxReferenceInputs  []shelley.ShelleyTransactionInput `cbor:"18,keyasint,omitempty"`
}

func NewBabbageTransactionBodyFromCbor

func NewBabbageTransactionBodyFromCbor(
	data []byte,
) (*BabbageTransactionBody, error)

func (*BabbageTransactionBody) CollateralReturn

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

func (*BabbageTransactionBody) Outputs

func (*BabbageTransactionBody) ProtocolParameterUpdates added in v0.95.0

func (b *BabbageTransactionBody) ProtocolParameterUpdates() (uint64, map[common.Blake2b224]common.ProtocolParameterUpdate)

func (*BabbageTransactionBody) ReferenceInputs

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

func (*BabbageTransactionBody) TotalCollateral

func (b *BabbageTransactionBody) TotalCollateral() uint64

func (*BabbageTransactionBody) UnmarshalCBOR

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

func (*BabbageTransactionBody) Utxorpc

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

type BabbageTransactionOutput

type BabbageTransactionOutput struct {
	cbor.DecodeStoreCbor
	OutputAddress common.Address                       `cbor:"0,keyasint,omitempty"`
	OutputAmount  mary.MaryTransactionOutputValue      `cbor:"1,keyasint,omitempty"`
	DatumOption   *BabbageTransactionOutputDatumOption `cbor:"2,keyasint,omitempty"`
	ScriptRef     *cbor.Tag                            `cbor:"3,keyasint,omitempty"`
	// contains filtered or unexported fields
}

func NewBabbageTransactionOutputFromCbor

func NewBabbageTransactionOutputFromCbor(
	data []byte,
) (*BabbageTransactionOutput, error)

func (BabbageTransactionOutput) Address

func (BabbageTransactionOutput) Amount

func (o BabbageTransactionOutput) Amount() uint64

func (BabbageTransactionOutput) Assets

func (BabbageTransactionOutput) Datum

func (BabbageTransactionOutput) DatumHash

func (*BabbageTransactionOutput) MarshalCBOR

func (o *BabbageTransactionOutput) MarshalCBOR() ([]byte, error)

func (BabbageTransactionOutput) MarshalJSON

func (o BabbageTransactionOutput) MarshalJSON() ([]byte, error)

func (*BabbageTransactionOutput) UnmarshalCBOR

func (o *BabbageTransactionOutput) UnmarshalCBOR(cborData []byte) error

func (BabbageTransactionOutput) Utxorpc

type BabbageTransactionOutputDatumOption

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

func (*BabbageTransactionOutputDatumOption) MarshalCBOR

func (d *BabbageTransactionOutputDatumOption) MarshalCBOR() ([]byte, error)

func (*BabbageTransactionOutputDatumOption) UnmarshalCBOR

func (d *BabbageTransactionOutputDatumOption) UnmarshalCBOR(data []byte) error

type BabbageTransactionWitnessSet

type BabbageTransactionWitnessSet struct {
	alonzo.AlonzoTransactionWitnessSet
	PlutusV2Scripts []cbor.RawMessage `cbor:"6,keyasint,omitempty"`
}

func (*BabbageTransactionWitnessSet) UnmarshalCBOR

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

Jump to

Keyboard shortcuts

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