ledger

package
v0.142.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0 Imports: 25 Imported by: 31

Documentation

Index

Constants

View Source
const (
	EraIdAllegra           = allegra.EraIdAllegra
	BlockTypeAllegra       = allegra.BlockTypeAllegra
	BlockHeaderTypeAllegra = allegra.BlockHeaderTypeAllegra
	TxTypeAllegra          = allegra.TxTypeAllegra
)

Allegra constants

View Source
const (
	EraIdAlonzo           = alonzo.EraIdAlonzo
	BlockTypeAlonzo       = alonzo.BlockTypeAlonzo
	BlockHeaderTypeAlonzo = alonzo.BlockHeaderTypeAlonzo
	TxTypeAlonzo          = alonzo.TxTypeAlonzo
)

Alonzo constants

View Source
const (
	EraIdBabbage           = babbage.EraIdBabbage
	BlockTypeBabbage       = babbage.BlockTypeBabbage
	BlockHeaderTypeBabbage = babbage.BlockHeaderTypeBabbage
	TxTypeBabbage          = babbage.TxTypeBabbage
)

Babbage constants

View Source
const (
	EraIdByron           = byron.EraIdByron
	BlockTypeByronEbb    = byron.BlockTypeByronEbb
	BlockTypeByronMain   = byron.BlockTypeByronMain
	BlockHeaderTypeByron = byron.BlockHeaderTypeByron
	TxTypeByron          = byron.TxTypeByron
)

Byron constants

View Source
const (
	AddressTypeScriptNone = common.AddressTypeScriptNone
	AddressTypeKeyNone    = common.AddressTypeKeyNone
	AddressTypeKeyKey     = common.AddressTypeKeyKey
)
View Source
const (
	EraIdConway           = conway.EraIdConway
	BlockTypeConway       = conway.BlockTypeConway
	BlockHeaderTypeConway = conway.BlockHeaderTypeConway
	TxTypeConway          = conway.TxTypeConway
)

Conway constants

View Source
const (
	ApplyTxErrorUtxowFailure = 0

	UTXOWFailureUtxoFailure = 2

	UtxoFailureFromAlonzo = 1

	UtxoFailureBadInputsUtxo               = 0
	UtxoFailureOutsideValidityIntervalUtxo = 1
	UtxoFailureMaxTxSizeUtxo               = 2
	UtxoFailureInputSetEmpty               = 3
	UtxoFailureFeeTooSmallUtxo             = 4
	UtxoFailureValueNotConservedUtxo       = 5
	UtxoFailureOutputTooSmallUtxo          = 6
	UtxoFailureUtxosFailure                = 7
	UtxoFailureWrongNetwork                = 8
	UtxoFailureWrongNetworkWithdrawal      = 9
	UtxoFailureOutputBootAddrAttrsTooBig   = 10
	UtxoFailureTriesToForgeAda             = 11
	UtxoFailureInsufficientCollateral      = 12
	UtxoFailureWrongNetworkInTxBody        = 17
	UtxoFailureOutsideForecast             = 18
	UtxoFailureTooManyCollateralInputs     = 19
	UtxoFailureNoCollateralInputs          = 20
)
View Source
const (
	// Alonzo era error constants
	UtxoFailureOutputTooBigUtxoAlonzo         = 12
	UtxoFailureScriptsNotPaidUtxoAlonzo       = 14
	UtxoFailureExUnitsTooBigUtxoAlonzo        = 15
	UtxoFailureCollateralContainsNonAdaAlonzo = 16

	// Babbage era error constants (same as Alonzo for these errors)
	UtxoFailureOutputTooBigUtxoBabbage         = 12
	UtxoFailureScriptsNotPaidUtxoBabbage       = 14
	UtxoFailureExUnitsTooBigUtxoBabbage        = 15
	UtxoFailureCollateralContainsNonAdaBabbage = 16

	// Conway era error constants
	UtxoFailureOutputTooBigUtxoConway         = 11
	UtxoFailureScriptsNotPaidUtxoConway       = 13
	UtxoFailureExUnitsTooBigUtxoConway        = 14
	UtxoFailureCollateralContainsNonAdaConway = 15
)

Era-specific constants for errors that differ between Cardano eras

View Source
const (
	EraIdLeios             = leios.EraIdLeios
	BlockTypeLeiosRanking  = leios.BlockTypeLeiosRanking
	BlockTypeLeiosEndorser = leios.BlockTypeLeiosEndorser
	BlockHeaderTypeLeios   = leios.BlockHeaderTypeLeios
	TxTypeLeios            = leios.TxTypeLeios
)

Leios constants

View Source
const (
	EraIdMary           = mary.EraIdMary
	BlockTypeMary       = mary.BlockTypeMary
	BlockHeaderTypeMary = mary.BlockHeaderTypeMary
	TxTypeMary          = mary.TxTypeMary
)

Mary constants

View Source
const (
	EraIdShelley           = shelley.EraIdShelley
	BlockTypeShelley       = shelley.BlockTypeShelley
	BlockHeaderTypeShelley = shelley.BlockHeaderTypeShelley
	TxTypeShelley          = shelley.TxTypeShelley
)

Shelley constants

View Source
const (
	HeaderBodyLengthShelleyLike = 15
	HeaderBodyLengthBabbageLike = 10
	ProtoMajorShelley           = 2
	ProtoMajorAllegra           = 3
	ProtoMajorMary              = 4
	ProtoMajorAlonzo            = 5
	ProtoMajorBabbage           = 7
	ProtoMajorConway            = 9
)
View Source
const (
	LOVELACE_TOKEN              = "lovelace"
	BLOCK_BODY_HASH_ZERO_TX_HEX = "29571d16f081709b3c48651860077bebf9340abb3fc7133443c54f1f5a5edcf1"
	MAX_LIST_LENGTH_CBOR        = 23
)
View Source
const (
	SIGMA_SIZE      = 64
	PUBLIC_KEY_SIZE = 32
	Sum0KesSig_SIZE = 64

	// CardanoKesDepth is the fixed KES tree depth used in Cardano's consensus protocol
	CardanoKesDepth = 6
	// CardanoKesSignatureSize is the expected KES signature size: 64 + depth*64
	CardanoKesSignatureSize = 448
)
View Source
const (
	VRF_SUITE = 0x04 // ECVRF-ED25519-SHA512-Elligator2
)

Variables

View Source
var (
	NewAllegraBlockFromCbor           = allegra.NewAllegraBlockFromCbor
	NewAllegraBlockHeaderFromCbor     = allegra.NewAllegraBlockHeaderFromCbor
	NewAllegraTransactionFromCbor     = allegra.NewAllegraTransactionFromCbor
	NewAllegraTransactionBodyFromCbor = allegra.NewAllegraTransactionBodyFromCbor
)

Allegra functions

View Source
var (
	NewAlonzoBlockFromCbor             = alonzo.NewAlonzoBlockFromCbor
	NewAlonzoBlockHeaderFromCbor       = alonzo.NewAlonzoBlockHeaderFromCbor
	NewAlonzoTransactionFromCbor       = alonzo.NewAlonzoTransactionFromCbor
	NewAlonzoTransactionBodyFromCbor   = alonzo.NewAlonzoTransactionBodyFromCbor
	NewAlonzoTransactionOutputFromCbor = alonzo.NewAlonzoTransactionOutputFromCbor
)

Alonzo functions

View Source
var (
	NewBabbageBlockFromCbor             = babbage.NewBabbageBlockFromCbor
	NewBabbageBlockHeaderFromCbor       = babbage.NewBabbageBlockHeaderFromCbor
	NewBabbageTransactionFromCbor       = babbage.NewBabbageTransactionFromCbor
	NewBabbageTransactionBodyFromCbor   = babbage.NewBabbageTransactionBodyFromCbor
	NewBabbageTransactionOutputFromCbor = babbage.NewBabbageTransactionOutputFromCbor
)

Babbage functions

View Source
var (
	NewByronEpochBoundaryBlockFromCbor       = byron.NewByronEpochBoundaryBlockFromCbor
	NewByronMainBlockFromCbor                = byron.NewByronMainBlockFromCbor
	NewByronEpochBoundaryBlockHeaderFromCbor = byron.NewByronEpochBoundaryBlockHeaderFromCbor
	NewByronMainBlockHeaderFromCbor          = byron.NewByronMainBlockHeaderFromCbor
	NewByronTransactionInput                 = byron.NewByronTransactionInput
	NewByronTransactionFromCbor              = byron.NewByronTransactionFromCbor
	NewByronTransactionOutputFromCbor        = byron.NewByronTransactionOutputFromCbor
)

Byron functions

View Source
var (
	NewAddress          = common.NewAddress
	NewAddressFromParts = common.NewAddressFromParts
)
View Source
var (
	NewConwayBlockFromCbor           = conway.NewConwayBlockFromCbor
	NewConwayBlockHeaderFromCbor     = conway.NewConwayBlockHeaderFromCbor
	NewConwayTransactionFromCbor     = conway.NewConwayTransactionFromCbor
	NewConwayTransactionBodyFromCbor = conway.NewConwayTransactionBodyFromCbor
)

Conway functions

View Source
var (
	NewLeiosEndorserBlockFromCbor   = leios.NewLeiosEndorserBlockFromCbor
	NewLeiosRankingBlockFromCbor    = leios.NewLeiosRankingBlockFromCbor
	NewLeiosBlockHeaderFromCbor     = leios.NewLeiosBlockHeaderFromCbor
	NewLeiosTransactionFromCbor     = leios.NewLeiosTransactionFromCbor
	NewLeiosTransactionBodyFromCbor = leios.NewLeiosTransactionBodyFromCbor
)

Leios functions

View Source
var (
	NewMaryBlockFromCbor             = mary.NewMaryBlockFromCbor
	NewMaryBlockHeaderFromCbor       = mary.NewMaryBlockHeaderFromCbor
	NewMaryTransactionFromCbor       = mary.NewMaryTransactionFromCbor
	NewMaryTransactionBodyFromCbor   = mary.NewMaryTransactionBodyFromCbor
	NewMaryTransactionOutputFromCbor = mary.NewMaryTransactionOutputFromCbor
)

Mary functions

View Source
var (
	NewShelleyBlockFromCbor             = shelley.NewShelleyBlockFromCbor
	NewShelleyBlockHeaderFromCbor       = shelley.NewShelleyBlockHeaderFromCbor
	NewShelleyTransactionInput          = shelley.NewShelleyTransactionInput
	NewShelleyTransactionFromCbor       = shelley.NewShelleyTransactionFromCbor
	NewShelleyTransactionBodyFromCbor   = shelley.NewShelleyTransactionBodyFromCbor
	NewShelleyTransactionOutputFromCbor = shelley.NewShelleyTransactionOutputFromCbor
)

Shelley functions

View Source
var BlockHeaderToBlockTypeMap = map[uint]uint{
	BlockHeaderTypeShelley: BlockTypeShelley,
	BlockHeaderTypeAllegra: BlockTypeAllegra,
	BlockHeaderTypeMary:    BlockTypeMary,
	BlockHeaderTypeAlonzo:  BlockTypeAlonzo,
	BlockHeaderTypeBabbage: BlockTypeBabbage,
	BlockHeaderTypeConway:  BlockTypeConway,
	BlockHeaderTypeLeios:   BlockTypeLeiosRanking,
}

BlockHeaderToBlockTypeMap is a mapping of NtN chainsync block header types (era ID) to NtC block types

View Source
var BlockToBlockHeaderTypeMap = map[uint]uint{
	BlockTypeShelley:       BlockHeaderTypeShelley,
	BlockTypeAllegra:       BlockHeaderTypeAllegra,
	BlockTypeMary:          BlockHeaderTypeMary,
	BlockTypeAlonzo:        BlockHeaderTypeAlonzo,
	BlockTypeBabbage:       BlockHeaderTypeBabbage,
	BlockTypeConway:        BlockHeaderTypeConway,
	BlockTypeLeiosRanking:  BlockHeaderTypeLeios,
	BlockTypeLeiosEndorser: BlockHeaderTypeLeios,
}

BlockToBlockHeaderTypeMap is a mapping of NtC chainsync block types to NtN block header types (era ID)

View Source
var EraInvalid = common.EraInvalid

Functions

func CalculateBlockBodyHash added in v0.84.0

func CalculateBlockBodyHash(txsRaw [][]string) ([]byte, error)

func DetermineBlockType added in v0.67.0

func DetermineBlockType(headerCbor []byte) (uint, error)

DetermineBlockType determines the block type from the header CBOR

func DetermineTransactionType added in v0.55.0

func DetermineTransactionType(data []byte) (uint, error)

func EncodeCborTxSeq added in v0.95.0

func EncodeCborTxSeq(data []uint) ([]byte, error)

func GetListRegisCertPoolId added in v0.84.0

func GetListRegisCertPoolId(
	regisCerts []common.PoolRegistrationCertificate,
) []string

func GetListUnregisCertPoolId added in v0.84.0

func GetListUnregisCertPoolId(
	deRegisCerts []common.PoolRetirementCertificate,
) []string

func HashPair added in v0.84.0

func MkInputVrf added in v0.84.0

func MkInputVrf(slot int64, eta0 []byte) []byte

func NewEraMismatchErrorFromCbor

func NewEraMismatchErrorFromCbor(cborData []byte) (error, error)

func NewGenericErrorFromCbor

func NewGenericErrorFromCbor(cborData []byte) (error, error)

func NewShelleyTxValidationErrorFromCbor

func NewShelleyTxValidationErrorFromCbor(cborData []byte) (error, error)

func NewTxSubmitErrorFromCbor

func NewTxSubmitErrorFromCbor(cborData []byte) (error, error)

Helper function to try to parse CBOR as various error types

func VerifyBlock added in v0.84.0

func VerifyBlock(
	block Block,
	eta0Hex string,
	slotsPerKesPeriod uint64,
) (bool, string, uint64, uint64, error)

func VerifyBlockBody added in v0.84.0

func VerifyBlockBody(data string, blockBodyHash string) (bool, error)

func VerifyKes added in v0.84.0

func VerifyKes(
	header *BabbageBlockHeader,
	slotsPerKesPeriod uint64,
) (bool, error)

TODO: make this work on anything from Shelley onward (#845)

func VerifyKesComponents added in v0.141.0

func VerifyKesComponents(
	bodyCbor []byte,
	signature []byte,
	hotVkey []byte,
	kesPeriod uint64,
	slot uint64,
	slotsPerKesPeriod uint64,
) (bool, error)

func VerifyVrf added in v0.141.0

func VerifyVrf(
	vrfKey []byte,
	proof []byte,
	expectedOutput []byte,
	msg []byte,
) (bool, error)

func VrfVerifyAndHash added in v0.84.0

func VrfVerifyAndHash(
	publicKey []byte,
	proof []byte,
	msg []byte,
) ([]byte, error)

Types

type AddrKeyHash added in v0.84.0

type AddrKeyHash = common.AddrKeyHash

Address

type Address added in v0.43.0

type Address = common.Address

Address

type AllegraBlock

type AllegraBlock = allegra.AllegraBlock

Allegra types

type AllegraProtocolParameterUpdate added in v0.79.0

type AllegraProtocolParameterUpdate = allegra.AllegraProtocolParameterUpdate

Allegra types

type AllegraProtocolParameters added in v0.79.0

type AllegraProtocolParameters = allegra.AllegraProtocolParameters

Allegra types

type AllegraTransaction

type AllegraTransaction = allegra.AllegraTransaction

Allegra types

type AllegraTransactionBody

type AllegraTransactionBody = allegra.AllegraTransactionBody

Allegra types

type AlonzoBlock

type AlonzoBlock = alonzo.AlonzoBlock

Alonzo types

type AlonzoBlockHeader

type AlonzoBlockHeader = alonzo.AlonzoBlockHeader

Alonzo types

type AlonzoProtocolParameterUpdate added in v0.80.0

type AlonzoProtocolParameterUpdate = alonzo.AlonzoProtocolParameterUpdate

Alonzo types

type AlonzoProtocolParameters added in v0.80.0

type AlonzoProtocolParameters = alonzo.AlonzoProtocolParameters

Alonzo types

type AlonzoTransaction

type AlonzoTransaction = alonzo.AlonzoTransaction

Alonzo types

type AlonzoTransactionBody

type AlonzoTransactionBody = alonzo.AlonzoTransactionBody

Alonzo types

type AlonzoTransactionOutput

type AlonzoTransactionOutput = alonzo.AlonzoTransactionOutput

Alonzo types

type AlonzoTransactionWitnessSet

type AlonzoTransactionWitnessSet = alonzo.AlonzoTransactionWitnessSet

Alonzo types

type ApplyTxError

type ApplyTxError struct {
	cbor.StructAsArray
	Failures []error
}

func (*ApplyTxError) Error

func (e *ApplyTxError) Error() string

func (*ApplyTxError) UnmarshalCBOR

func (e *ApplyTxError) UnmarshalCBOR(data []byte) error

type AssetFingerprint added in v0.44.0

type AssetFingerprint = common.AssetFingerprint

Assets

func NewAssetFingerprint added in v0.44.0

func NewAssetFingerprint(policyId []byte, assetName []byte) AssetFingerprint

type AuxData added in v0.95.0

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

type BabbageBlock

type BabbageBlock = babbage.BabbageBlock

Babbage types

type BabbageBlockHeader

type BabbageBlockHeader = babbage.BabbageBlockHeader

Babbage types

type BabbageProtocolParameterUpdate added in v0.77.0

type BabbageProtocolParameterUpdate = babbage.BabbageProtocolParameterUpdate

Babbage types

type BabbageProtocolParameters added in v0.77.0

type BabbageProtocolParameters = babbage.BabbageProtocolParameters

Babbage types

type BabbageTransaction

type BabbageTransaction = babbage.BabbageTransaction

Babbage types

type BabbageTransactionBody

type BabbageTransactionBody = babbage.BabbageTransactionBody

Babbage types

func GetTxBodies added in v0.84.0

func GetTxBodies(txsRaw [][]string) ([]BabbageTransactionBody, error)

type BabbageTransactionOutput

type BabbageTransactionOutput = babbage.BabbageTransactionOutput

Babbage types

type BabbageTransactionWitnessSet

type BabbageTransactionWitnessSet = babbage.BabbageTransactionWitnessSet

Babbage types

type BadInputsUtxo

type BadInputsUtxo struct {
	UtxoFailureErrorBase
	Inputs []TxIn
}

func (*BadInputsUtxo) Error

func (e *BadInputsUtxo) Error() string

type Blake2b224

type Blake2b224 = common.Blake2b224

Hash types

func NewBlake2b224 added in v0.44.0

func NewBlake2b224(data []byte) Blake2b224

type Blake2b256

type Blake2b256 = common.Blake2b256

Hash types

func NewBlake2b256 added in v0.44.0

func NewBlake2b256(data []byte) Blake2b256

type Block

type Block = common.Block

Compatibility aliases

func NewBlockFromCbor

func NewBlockFromCbor(blockType uint, data []byte) (Block, error)

type BlockHeader

type BlockHeader = common.BlockHeader

Compatibility aliases

func NewBlockHeaderFromCbor

func NewBlockHeaderFromCbor(blockType uint, data []byte) (BlockHeader, error)

type BlockHexCbor added in v0.84.0

type BlockHexCbor struct {
	cbor.StructAsArray
	Flag          int
	HeaderCbor    string
	Eta0          string
	Spk           int
	BlockBodyCbor string
}

type ByronEpochBounaryBlockHeader added in v0.93.0

type ByronEpochBounaryBlockHeader = byron.ByronEpochBoundaryBlockHeader

Byron types

type ByronEpochBoundaryBlock

type ByronEpochBoundaryBlock = byron.ByronEpochBoundaryBlock

Byron types

type ByronMainBlock

type ByronMainBlock = byron.ByronMainBlock

Byron types

type ByronMainBlockHeader

type ByronMainBlockHeader = byron.ByronMainBlockHeader

Byron types

type ByronTransaction

type ByronTransaction = byron.ByronTransaction

Byron types

type ByronTransactionInput added in v0.77.0

type ByronTransactionInput = byron.ByronTransactionInput

Byron types

type ByronTransactionOutput added in v0.77.0

type ByronTransactionOutput = byron.ByronTransactionOutput

Byron types

type Certificate added in v0.84.0

type Certificate = common.Certificate

Certificates

type CertificateWrapper added in v0.84.0

type CertificateWrapper = common.CertificateWrapper

Certificates

type CollateralContainsNonADA

type CollateralContainsNonADA struct {
	UtxoFailureErrorBase
	Provided cbor.Value
}

CollateralContainsNonADA represents the CollateralContainsNonADA error from cardano-ledger. CBOR: [16, provided] (Alonzo/Babbage), [15, provided] (Conway)

func (*CollateralContainsNonADA) Error

func (e *CollateralContainsNonADA) Error() string

func (*CollateralContainsNonADA) MarshalCBOR added in v0.140.0

func (e *CollateralContainsNonADA) MarshalCBOR() ([]byte, error)

func (*CollateralContainsNonADA) UnmarshalCBOR added in v0.140.0

func (e *CollateralContainsNonADA) UnmarshalCBOR(data []byte) error

type ConwayBlock added in v0.60.0

type ConwayBlock = conway.ConwayBlock

Conway types

type ConwayBlockHeader added in v0.60.0

type ConwayBlockHeader = conway.ConwayBlockHeader

Conway types

type ConwayProtocolParameterUpdate added in v0.91.0

type ConwayProtocolParameterUpdate = conway.ConwayProtocolParameterUpdate

Conway types

type ConwayProtocolParameters added in v0.91.0

type ConwayProtocolParameters = conway.ConwayProtocolParameters

Conway types

type ConwayTransaction added in v0.60.0

type ConwayTransaction = conway.ConwayTransaction

Conway types

type ConwayTransactionBody added in v0.60.0

type ConwayTransactionBody = conway.ConwayTransactionBody

Conway types

type ConwayTransactionWitnessSet added in v0.91.0

type ConwayTransactionWitnessSet = conway.ConwayTransactionWitnessSet

Conway types

type Era

type Era = common.Era

func GetEraById

func GetEraById(eraId uint8) Era

type EraMismatch

type EraMismatch struct {
	cbor.StructAsArray
	LedgerEra uint8
	OtherEra  uint8
}

func (*EraMismatch) Error

func (e *EraMismatch) Error() string

type ExUnitsTooBigUtxo

type ExUnitsTooBigUtxo struct {
	UtxoFailureErrorBase
	MaxAllowed int
	Supplied   int
}

func (*ExUnitsTooBigUtxo) Error

func (e *ExUnitsTooBigUtxo) Error() string

type FeeTooSmallUtxo

type FeeTooSmallUtxo struct {
	UtxoFailureErrorBase
	MinimumFee  uint64
	SuppliedFee uint64
}

func (*FeeTooSmallUtxo) Error

func (e *FeeTooSmallUtxo) Error() string

type GenericError

type GenericError struct {
	Value any
	Cbor  []byte
}

func (*GenericError) Error

func (e *GenericError) Error() string

func (*GenericError) UnmarshalCBOR

func (e *GenericError) UnmarshalCBOR(data []byte) error

type InputSetEmptyUtxo

type InputSetEmptyUtxo struct {
	UtxoFailureErrorBase
}

func (*InputSetEmptyUtxo) Error

func (e *InputSetEmptyUtxo) Error() string

type InsufficientCollateral

type InsufficientCollateral struct {
	UtxoFailureErrorBase
	BalanceComputed    uint64
	RequiredCollateral uint64
}

func (*InsufficientCollateral) Error

func (e *InsufficientCollateral) Error() string

type IssuerVkey added in v0.58.0

type IssuerVkey = common.IssuerVkey

Other types

type LeiosBlockHeader added in v0.136.0

type LeiosBlockHeader = leios.LeiosBlockHeader

Leios types

type LeiosEndorderBlock added in v0.136.0

type LeiosEndorderBlock = leios.LeiosEndorserBlock

Leios types

type LeiosProtocolParameterUpdate added in v0.136.0

type LeiosProtocolParameterUpdate = leios.LeiosProtocolParameterUpdate

Leios types

type LeiosProtocolParameters added in v0.136.0

type LeiosProtocolParameters = leios.LeiosProtocolParameters

Leios types

type LeiosRankingBlock added in v0.136.0

type LeiosRankingBlock = leios.LeiosRankingBlock

Leios types

type LeiosTransaction added in v0.136.0

type LeiosTransaction = leios.LeiosTransaction

Leios types

type LeiosTransactionBody added in v0.136.0

type LeiosTransactionBody = leios.LeiosTransactionBody

Leios types

type LeiosTransactionWitnessSet added in v0.136.0

type LeiosTransactionWitnessSet = leios.LeiosTransactionWitnessSet

Leios types

type MaryBlock

type MaryBlock = mary.MaryBlock

Mary types

type MaryBlockHeader

type MaryBlockHeader = mary.MaryBlockHeader

Mary types

type MaryProtocolParameterUpdate added in v0.80.0

type MaryProtocolParameterUpdate = mary.MaryProtocolParameterUpdate

Mary types

type MaryProtocolParameters added in v0.80.0

type MaryProtocolParameters = mary.MaryProtocolParameters

Mary types

type MaryTransaction

type MaryTransaction = mary.MaryTransaction

Mary types

type MaryTransactionBody

type MaryTransactionBody = mary.MaryTransactionBody

Mary types

type MaryTransactionOutput

type MaryTransactionOutput = mary.MaryTransactionOutput

Mary types

type MaryTransactionOutputValue added in v0.42.0

type MaryTransactionOutputValue = mary.MaryTransactionOutputValue

Mary types

type MaxTxSizeUtxo

type MaxTxSizeUtxo struct {
	UtxoFailureErrorBase
	ActualSize int
	MaxSize    int
}

func (*MaxTxSizeUtxo) Error

func (e *MaxTxSizeUtxo) Error() string

type MultiAssetTypeMint added in v0.44.0

type MultiAssetTypeMint = common.MultiAssetTypeMint

Assets

type MultiAssetTypeOutput added in v0.44.0

type MultiAssetTypeOutput = common.MultiAssetTypeOutput

Assets

type NewErrorFromCborFunc

type NewErrorFromCborFunc func([]byte) (error, error)

Helper type to make the code a little cleaner

type NoCollateralInputs

type NoCollateralInputs struct {
	UtxoFailureErrorBase
}

func (*NoCollateralInputs) Error

func (e *NoCollateralInputs) Error() string

type OutputBootAddrAttrsTooBig

type OutputBootAddrAttrsTooBig struct {
	UtxoFailureErrorBase
	Outputs []TxOut
}

func (*OutputBootAddrAttrsTooBig) Error

func (e *OutputBootAddrAttrsTooBig) Error() string

type OutputTooBigUtxo

type OutputTooBigUtxo struct {
	UtxoFailureErrorBase
	Outputs []struct {
		ActualSize int
		MaxSize    int
		Output     TxOut
	}
}

func (*OutputTooBigUtxo) Error

func (e *OutputTooBigUtxo) Error() string

type OutputTooSmallUtxo

type OutputTooSmallUtxo struct {
	UtxoFailureErrorBase
	Outputs []TxOut
}

func (*OutputTooSmallUtxo) Error

func (e *OutputTooSmallUtxo) Error() string

type OutsideForecast

type OutsideForecast struct {
	UtxoFailureErrorBase
	Slot uint32
}

func (*OutsideForecast) Error

func (e *OutsideForecast) Error() string

type OutsideValidityIntervalUtxo

type OutsideValidityIntervalUtxo struct {
	UtxoFailureErrorBase
	ValidityInterval cbor.Value
	Slot             uint32
}

func (*OutsideValidityIntervalUtxo) Error

type PoolId added in v0.77.0

type PoolId = common.PoolId

Pools

func NewPoolIdFromBech32 added in v0.77.0

func NewPoolIdFromBech32(poolId string) (PoolId, error)

type PoolRegistrationCertificate added in v0.84.0

type PoolRegistrationCertificate = common.PoolRegistrationCertificate

Certificates

type PoolRelay added in v0.84.0

type PoolRelay = common.PoolRelay

Pools

type PoolRetirementCertificate added in v0.84.0

type PoolRetirementCertificate = common.PoolRetirementCertificate

Certificates

type ProposalProcedure added in v0.85.0

type ProposalProcedure = common.ProposalProcedure

Governance types

type ScriptsNotPaidUtxo

type ScriptsNotPaidUtxo struct {
	UtxoFailureErrorBase
	Utxos []common.Utxo // Each Utxo contains Id (input) and Output
}

ScriptsNotPaidUtxo represents the ScriptsNotPaidUTxO error from cardano-ledger. Haskell: ScriptsNotPaidUTxO !(UTxO era) where UTxO era = Map TxIn TxOut CBOR: [14, utxo_map]

func (*ScriptsNotPaidUtxo) Error

func (e *ScriptsNotPaidUtxo) Error() string

func (*ScriptsNotPaidUtxo) MarshalCBOR added in v0.139.0

func (e *ScriptsNotPaidUtxo) MarshalCBOR() ([]byte, error)

func (*ScriptsNotPaidUtxo) UnmarshalCBOR added in v0.139.0

func (e *ScriptsNotPaidUtxo) UnmarshalCBOR(data []byte) error

type ShelleyBlock

type ShelleyBlock = shelley.ShelleyBlock

Shelley types

type ShelleyBlockHeader

type ShelleyBlockHeader = shelley.ShelleyBlockHeader

Shelley types

type ShelleyProtocolParameterUpdate added in v0.79.0

type ShelleyProtocolParameterUpdate = shelley.ShelleyProtocolParameterUpdate

Shelley types

type ShelleyProtocolParameters added in v0.79.0

type ShelleyProtocolParameters = shelley.ShelleyProtocolParameters

Shelley types

type ShelleyTransaction

type ShelleyTransaction = shelley.ShelleyTransaction

Shelley types

type ShelleyTransactionBody

type ShelleyTransactionBody = shelley.ShelleyTransactionBody

Shelley types

type ShelleyTransactionInput

type ShelleyTransactionInput = shelley.ShelleyTransactionInput

Shelley types

type ShelleyTransactionOutput

type ShelleyTransactionOutput = shelley.ShelleyTransactionOutput

Shelley types

type ShelleyTransactionWitnessSet

type ShelleyTransactionWitnessSet = shelley.ShelleyTransactionWitnessSet

Shelley types

type ShelleyTxValidationError

type ShelleyTxValidationError struct {
	Era uint8
	Err ApplyTxError
}

func (*ShelleyTxValidationError) Error

func (e *ShelleyTxValidationError) Error() string

func (*ShelleyTxValidationError) UnmarshalCBOR

func (e *ShelleyTxValidationError) UnmarshalCBOR(data []byte) error

type StakeDelegationCertificate added in v0.84.0

type StakeDelegationCertificate = common.StakeDelegationCertificate

Certificates

type Sum0KesSig added in v0.84.0

type Sum0KesSig []byte

func Sum0KesSigFromByte added in v0.84.0

func Sum0KesSigFromByte(sigBytes []byte) Sum0KesSig

func (Sum0KesSig) Verify added in v0.84.0

func (s Sum0KesSig) Verify(
	_ uint64,
	pubKey ed25519.PublicKey,
	msg []byte,
) bool

type SumXKesSig added in v0.84.0

type SumXKesSig struct {
	Depth                  uint64
	Sigma                  any
	LeftHandSidePublicKey  ed25519.PublicKey
	RightHandSidePublicKey ed25519.PublicKey
}

func NewSumKesFromByte added in v0.84.0

func NewSumKesFromByte(depth uint64, fromByte []byte) SumXKesSig

func (SumXKesSig) Verify added in v0.84.0

func (s SumXKesSig) Verify(
	period uint64,
	pubKey ed25519.PublicKey,
	msg []byte,
) bool

type TooManyCollateralInputs

type TooManyCollateralInputs struct {
	UtxoFailureErrorBase
	MaxAllowed int
	Supplied   int
}

func (*TooManyCollateralInputs) Error

func (e *TooManyCollateralInputs) Error() string

type Transaction added in v0.46.0

type Transaction = common.Transaction

Compatibility aliases

func NewTransactionFromCbor

func NewTransactionFromCbor(txType uint, data []byte) (Transaction, error)

type TransactionBody

type TransactionBody = common.TransactionBody

Compatibility aliases

func NewTransactionBodyFromCbor

func NewTransactionBodyFromCbor(
	txType uint,
	data []byte,
) (TransactionBody, error)

type TransactionInput added in v0.43.0

type TransactionInput = common.TransactionInput

Compatibility aliases

type TransactionOutput added in v0.43.0

type TransactionOutput = common.TransactionOutput

Compatibility aliases

func NewTransactionOutputFromCbor added in v0.69.0

func NewTransactionOutputFromCbor(data []byte) (TransactionOutput, error)

NewTransactionOutputFromCbor attempts to parse the provided arbitrary CBOR data as a transaction output from each of the eras, returning the first one that we can successfully decode

type TriesToForgeADA

type TriesToForgeADA struct {
	UtxoFailureErrorBase
}

func (*TriesToForgeADA) Error

func (e *TriesToForgeADA) Error() string

type TxIn

type TxIn struct {
	cbor.StructAsArray
	Utxo cbor.ByteString
	TxIx uint8
}

func (*TxIn) String

func (e *TxIn) String() string

type TxOut

type TxOut struct {
	cbor.Value
}

func (*TxOut) String

func (t *TxOut) String() string

type UTXOOutput added in v0.84.0

type UTXOOutput struct {
	Flag        int
	TxHash      string
	OutputIndex string
	Tokens      []UTXOOutputToken
	DatumHex    string
	// contains filtered or unexported fields
}

func GetBlockOutput added in v0.84.0

type UTXOOutputToken added in v0.84.0

type UTXOOutputToken struct {
	Flag           int
	TokenAssetName string
	TokenValue     string
	// contains filtered or unexported fields
}

func ExtractTokens added in v0.84.0

func ExtractTokens(output TransactionOutput) ([]UTXOOutputToken, error)

type Utxo added in v0.90.0

type Utxo = common.Utxo

Compatibility aliases

type UtxoFailure

type UtxoFailure struct {
	cbor.StructAsArray
	Era uint8
	Err error
}

func (*UtxoFailure) Error

func (e *UtxoFailure) Error() string

func (*UtxoFailure) UnmarshalCBOR

func (e *UtxoFailure) UnmarshalCBOR(data []byte) error

type UtxoFailureErrorBase

type UtxoFailureErrorBase struct {
	cbor.StructAsArray
	Type uint8
}

type UtxosFailure

type UtxosFailure struct {
	UtxoFailureErrorBase
	Err GenericError
}

func (*UtxosFailure) Error

func (e *UtxosFailure) Error() string

type UtxowFailure

type UtxowFailure struct {
	cbor.StructAsArray
	Err error
}

func (*UtxowFailure) Error

func (e *UtxowFailure) Error() string

func (*UtxowFailure) UnmarshalCBOR

func (e *UtxowFailure) UnmarshalCBOR(data []byte) error

type ValueNotConservedUtxo

type ValueNotConservedUtxo struct {
	UtxoFailureErrorBase
	Consumed uint64
	Produced uint64
}

func (*ValueNotConservedUtxo) Error

func (e *ValueNotConservedUtxo) Error() string

type VotingProcedure added in v0.85.0

type VotingProcedure = common.VotingProcedure

Governance types

type VotingProcedures added in v0.85.0

type VotingProcedures = common.VotingProcedures

Governance types

type WrongNetwork

type WrongNetwork struct {
	UtxoFailureErrorBase
	ExpectedNetworkId int
	Addresses         cbor.Value
}

func (*WrongNetwork) Error

func (e *WrongNetwork) Error() string

type WrongNetworkInTxBody

type WrongNetworkInTxBody struct {
	UtxoFailureErrorBase
	ActualNetworkId      int
	TransactionNetworkId int
}

func (*WrongNetworkInTxBody) Error

func (e *WrongNetworkInTxBody) Error() string

type WrongNetworkWithdrawal

type WrongNetworkWithdrawal struct {
	UtxoFailureErrorBase
	ExpectedNetworkId int
	RewardAccounts    cbor.Value
}

func (*WrongNetworkWithdrawal) Error

func (e *WrongNetworkWithdrawal) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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