ledger

package
v0.93.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 22 Imported by: 13

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
	UtxoFailureOutputTooBigUtxo            = 12
	UtxoFailureInsufficientCollateral      = 13
	UtxoFailureScriptsNotPaidUtxo          = 14
	UtxoFailureExUnitsTooBigUtxo           = 15
	UtxoFailureCollateralContainsNonAda    = 16
	UtxoFailureWrongNetworkInTxBody        = 17
	UtxoFailureOutsideForecast             = 18
	UtxoFailureTooManyCollateralInputs     = 19
	UtxoFailureNoCollateralInputs          = 20
)
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 (
	LOVELACE_TOKEN              = "lovelace"
	BLOCK_BODY_HASH_ZERO_TX_HEX = "29571d16f081709b3c48651860077bebf9340abb3fc7133443c54f1f5a5edcf1"
)
View Source
const (
	SIGMA_SIZE      = 64
	PUBLIC_KEY_SIZE = 32
	Sum0KesSig_SIZE = 64
)
View Source
const (
	VRF_SUITE = 0x04 // ECVRF-ED25519-SHA512-Elligator2
)

Variables

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

Allegra functions

View Source
var (
	NewAlonzoBlockFromCbor             = alonzo.NewAlonzoBlockFromCbor
	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
)

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 (
	NewMaryBlockFromCbor             = mary.NewMaryBlockFromCbor
	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,
}

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,
}

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(data []byte) (uint, error)

func DetermineTransactionType added in v0.55.0

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

func ExtractBlockData added in v0.84.0

func ExtractBlockData(
	bodyHex string,
) ([]UTXOOutput, []RegisCert, []DeRegisCert, error)

func GetBlockOutput added in v0.84.0

func GetBlockOutput(
	txBodies []BabbageTransactionBody,
) ([]UTXOOutput, []RegisCert, []DeRegisCert, error)

func GetListRegisCertPoolId added in v0.84.0

func GetListRegisCertPoolId(regisCerts []RegisCert) []string

func GetListUnregisCertPoolId added in v0.84.0

func GetListUnregisCertPoolId(deRegisCerts []DeRegisCert) []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 BlockHexCbor) (error, bool, string, uint64, uint64)

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

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

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

type AllegraProtocolParameters added in v0.79.0

type AllegraProtocolParameters = allegra.AllegraProtocolParameters

type AllegraTransaction

type AllegraTransaction = allegra.AllegraTransaction

type AllegraTransactionBody

type AllegraTransactionBody = allegra.AllegraTransactionBody

type AlonzoBlock

type AlonzoBlock = alonzo.AlonzoBlock

Alonzo types

type AlonzoBlockHeader

type AlonzoBlockHeader = alonzo.AlonzoBlockHeader

type AlonzoProtocolParameterUpdate added in v0.80.0

type AlonzoProtocolParameterUpdate = alonzo.AlonzoProtocolParameterUpdate

type AlonzoProtocolParameters added in v0.80.0

type AlonzoProtocolParameters = alonzo.AlonzoProtocolParameters

type AlonzoTransaction

type AlonzoTransaction = alonzo.AlonzoTransaction

type AlonzoTransactionBody

type AlonzoTransactionBody = alonzo.AlonzoTransactionBody

type AlonzoTransactionOutput

type AlonzoTransactionOutput = alonzo.AlonzoTransactionOutput

type AlonzoTransactionWitnessSet

type AlonzoTransactionWitnessSet = alonzo.AlonzoTransactionWitnessSet

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

func NewAssetFingerprint added in v0.44.0

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

type BabbageBlock

type BabbageBlock = babbage.BabbageBlock

Babbage types

type BabbageBlockHeader

type BabbageBlockHeader = babbage.BabbageBlockHeader

type BabbageProtocolParameterUpdate added in v0.77.0

type BabbageProtocolParameterUpdate = babbage.BabbageProtocolParameterUpdate

type BabbageProtocolParameters added in v0.77.0

type BabbageProtocolParameters = babbage.BabbageProtocolParameters

type BabbageTransaction

type BabbageTransaction = babbage.BabbageTransaction

type BabbageTransactionBody

type BabbageTransactionBody = babbage.BabbageTransactionBody

func GetTxBodies added in v0.84.0

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

type BabbageTransactionOutput

type BabbageTransactionOutput = babbage.BabbageTransactionOutput

type BabbageTransactionWitnessSet

type BabbageTransactionWitnessSet = babbage.BabbageTransactionWitnessSet

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

func NewBlake2b256 added in v0.44.0

func NewBlake2b256(data []byte) Blake2b256

type Block

type Block interface {
	BlockHeader
	Transactions() []Transaction
	Utxorpc() *utxorpc.Block
}

func NewBlockFromCbor

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

type BlockHeader

type BlockHeader interface {
	Hash() string
	BlockNumber() uint64
	SlotNumber() uint64
	IssuerVkey() IssuerVkey
	BlockBodySize() uint64
	Era() Era
	Cbor() []byte
}

func NewBlockHeaderFromCbor

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

XXX: should this take the block header type instead?

type BlockHexCbor added in v0.84.0

type BlockHexCbor struct {
	Flag          int
	HeaderCbor    string
	Eta0          string
	Spk           int
	BlockBodyCbor string
	// contains filtered or unexported fields
}

type ByronEpochBounaryBlockHeader added in v0.93.0

type ByronEpochBounaryBlockHeader = byron.ByronEpochBoundaryBlockHeader

type ByronEpochBoundaryBlock

type ByronEpochBoundaryBlock = byron.ByronEpochBoundaryBlock

Byron types

type ByronMainBlock

type ByronMainBlock = byron.ByronMainBlock

type ByronMainBlockHeader

type ByronMainBlockHeader = byron.ByronMainBlockHeader

type ByronTransaction

type ByronTransaction = byron.ByronTransaction

type ByronTransactionInput added in v0.77.0

type ByronTransactionInput = byron.ByronTransactionInput

type ByronTransactionOutput added in v0.77.0

type ByronTransactionOutput = byron.ByronTransactionOutput

type Certificate added in v0.84.0

type Certificate = common.Certificate

Certificates

type CertificateWrapper added in v0.84.0

type CertificateWrapper = common.CertificateWrapper

type CollateralContainsNonADA

type CollateralContainsNonADA struct {
	UtxoFailureErrorBase
	// TODO: determine content/structure of this value
	Value cbor.Value
}

func (*CollateralContainsNonADA) Error

func (e *CollateralContainsNonADA) Error() string

type ConwayBlock added in v0.60.0

type ConwayBlock = conway.ConwayBlock

Conway types

type ConwayBlockHeader added in v0.60.0

type ConwayBlockHeader = conway.ConwayBlockHeader

type ConwayProtocolParameterUpdate added in v0.91.0

type ConwayProtocolParameterUpdate = conway.ConwayProtocolParameterUpdate

type ConwayProtocolParameters added in v0.91.0

type ConwayProtocolParameters = conway.ConwayProtocolParameters

type ConwayTransaction added in v0.60.0

type ConwayTransaction = conway.ConwayTransaction

type ConwayTransactionBody added in v0.60.0

type ConwayTransactionBody = conway.ConwayTransactionBody

type ConwayTransactionWitnessSet added in v0.91.0

type ConwayTransactionWitnessSet = conway.ConwayTransactionWitnessSet

type DeRegisCert added in v0.84.0

type DeRegisCert struct {
	Flag          int
	DeRegisPoolId string
	DeRegisEpoch  string
	TxIndex       int
	// contains filtered or unexported fields
}

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 interface{}
	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 MaryBlock

type MaryBlock = mary.MaryBlock

Mary types

type MaryBlockHeader

type MaryBlockHeader = mary.MaryBlockHeader

type MaryProtocolParameterUpdate added in v0.80.0

type MaryProtocolParameterUpdate = mary.MaryProtocolParameterUpdate

type MaryProtocolParameters added in v0.80.0

type MaryProtocolParameters = mary.MaryProtocolParameters

type MaryTransaction

type MaryTransaction = mary.MaryTransaction

type MaryTransactionBody

type MaryTransactionBody = mary.MaryTransactionBody

type MaryTransactionOutput

type MaryTransactionOutput = mary.MaryTransactionOutput

type MaryTransactionOutputValue added in v0.42.0

type MaryTransactionOutputValue = mary.MaryTransactionOutputValue

type MaryTransactionWitnessSet added in v0.80.0

type MaryTransactionWitnessSet = mary.MaryTransactionWitnessSet

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

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

func NewPoolIdFromBech32 added in v0.77.0

func NewPoolIdFromBech32(poolId string) (PoolId, error)

type PoolRegistrationCertificate added in v0.84.0

type PoolRegistrationCertificate = common.PoolRegistrationCertificate

type PoolRelay added in v0.84.0

type PoolRelay = common.PoolRelay

Pools

type PoolRetirementCertificate added in v0.84.0

type PoolRetirementCertificate = common.PoolRetirementCertificate

type ProposalProcedure added in v0.85.0

type ProposalProcedure = common.ProposalProcedure

type RegisCert added in v0.84.0

type RegisCert struct {
	Flag         int
	RegisPoolId  string
	RegisPoolVrf string
	TxIndex      int
	// contains filtered or unexported fields
}

type ScriptsNotPaidUtxo

type ScriptsNotPaidUtxo struct {
	UtxoFailureErrorBase
	// TODO: determine content/structure of this value
	Value cbor.Value
}

func (*ScriptsNotPaidUtxo) Error

func (e *ScriptsNotPaidUtxo) Error() string

type ShelleyBlock

type ShelleyBlock = shelley.ShelleyBlock

Shelley types

type ShelleyBlockHeader

type ShelleyBlockHeader = shelley.ShelleyBlockHeader

type ShelleyProtocolParameterUpdate added in v0.79.0

type ShelleyProtocolParameterUpdate = shelley.ShelleyProtocolParameterUpdate

type ShelleyProtocolParameters added in v0.79.0

type ShelleyProtocolParameters = shelley.ShelleyProtocolParameters

type ShelleyTransaction

type ShelleyTransaction = shelley.ShelleyTransaction

type ShelleyTransactionBody

type ShelleyTransactionBody = shelley.ShelleyTransactionBody

type ShelleyTransactionInput

type ShelleyTransactionInput = shelley.ShelleyTransactionInput

type ShelleyTransactionOutput

type ShelleyTransactionOutput = shelley.ShelleyTransactionOutput

type ShelleyTransactionWitnessSet

type ShelleyTransactionWitnessSet = shelley.ShelleyTransactionWitnessSet

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

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                  interface{}
	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

Compatablity aliases

func NewTransactionFromCbor

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

type TransactionBody

type TransactionBody = common.TransactionBody

func NewTransactionBodyFromCbor

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

type TransactionInput added in v0.43.0

type TransactionInput = common.TransactionInput

type TransactionOutput added in v0.43.0

type TransactionOutput = common.TransactionOutput

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
}

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

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

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