cardano-ledger-api-1.11.0.0: Public API for the cardano ledger codebase
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Api.Tx.Address

Synopsis

Address

data Addr Source #

An address for UTxO.

Contents of Addr data type are intentionally left as lazy, otherwise operating on compact form of an address will result in redundant work.

Instances

Instances details
FromJSON Addr 
Instance details

Defined in Cardano.Ledger.Address

FromJSONKey Addr 
Instance details

Defined in Cardano.Ledger.Address

ToJSON Addr 
Instance details

Defined in Cardano.Ledger.Address

ToJSONKey Addr 
Instance details

Defined in Cardano.Ledger.Address

Generic Addr 
Instance details

Defined in Cardano.Ledger.Address

Associated Types

type Rep AddrTypeType #

Methods

fromAddrRep Addr x #

toRep Addr x → Addr #

Show Addr 
Instance details

Defined in Cardano.Ledger.Address

Methods

showsPrecIntAddrShowS #

showAddrString #

showList ∷ [Addr] → ShowS #

DecCBOR Addr 
Instance details

Defined in Cardano.Ledger.Address

EncCBOR Addr 
Instance details

Defined in Cardano.Ledger.Address

Methods

encCBORAddrEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy AddrSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [Addr] → Size Source #

NFData Addr 
Instance details

Defined in Cardano.Ledger.Address

Methods

rnfAddr → () #

Eq Addr 
Instance details

Defined in Cardano.Ledger.Address

Methods

(==)AddrAddrBool #

(/=)AddrAddrBool #

Ord Addr 
Instance details

Defined in Cardano.Ledger.Address

Methods

compareAddrAddrOrdering #

(<)AddrAddrBool #

(<=)AddrAddrBool #

(>)AddrAddrBool #

(>=)AddrAddrBool #

maxAddrAddrAddr #

minAddrAddrAddr #

NoThunks Addr 
Instance details

Defined in Cardano.Ledger.Address

type Rep Addr 
Instance details

Defined in Cardano.Ledger.Address

type Rep Addr = D1 ('MetaData "Addr" "Cardano.Ledger.Address" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "Addr" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Network) :*: (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PaymentCredential) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StakeReference))) :+: C1 ('MetaCons "AddrBootstrap" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BootstrapAddress)))

getNetworkAddrNetwork Source #

Lookup a Network Id for an Address

newtype BootstrapAddress Source #

Instances

Instances details
Generic BootstrapAddress 
Instance details

Defined in Cardano.Ledger.Address

Associated Types

type Rep BootstrapAddressTypeType #

Show BootstrapAddress 
Instance details

Defined in Cardano.Ledger.Address

NFData BootstrapAddress 
Instance details

Defined in Cardano.Ledger.Address

Methods

rnfBootstrapAddress → () #

Eq BootstrapAddress 
Instance details

Defined in Cardano.Ledger.Address

Ord BootstrapAddress 
Instance details

Defined in Cardano.Ledger.Address

NoThunks BootstrapAddress 
Instance details

Defined in Cardano.Ledger.Address

type Rep BootstrapAddress 
Instance details

Defined in Cardano.Ledger.Address

type Rep BootstrapAddress = D1 ('MetaData "BootstrapAddress" "Cardano.Ledger.Address" "cardano-ledger-core-1.17.0.0-inplace" 'True) (C1 ('MetaCons "BootstrapAddress" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBootstrapAddress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Address)))

serialiseAddrAddrByteString Source #

Serialise an address to the external format.

Strict decoders

Decoders below will only decode addresses that are allowed to be placed on chain today. Historically there were a few bugs in the decoder which allowed a few malformed addressed to be placed on chain. If you need backwards compatibility, reach out for decodeAddrLenient.

decodeAddrMonadFail m ⇒ ByteString → m Addr Source #

Strict decoder for an address from a ByteString. This will not let you decode some of the buggy addresses that have been placed on chain. This decoder is intended for addresses that are to be placed on chian today.

decodeAddrEitherByteStringEither String Addr Source #

Same as decodeAddr, but produces an Either result

Lenient decoders

These lenient decoders do not fail for addresses with known bugs

data DecAddr Source #

Decoded Address.

Constructors

DecAddr Addr

Address was decoded with no problems

DecAddrBadPtr Addr

Address was decoded, but it contains an invalid Ptr, which means that address will be decoded with Ptr that has all values clamped to zero.

DecAddrUnconsumed

Address was decoded, but not all of input was consumed

Fields

Instances

Instances details
Show DecAddr Source # 
Instance details

Defined in Cardano.Ledger.Api.Tx.Address

Methods

showsPrecIntDecAddrShowS #

showDecAddrString #

showList ∷ [DecAddr] → ShowS #

Eq DecAddr Source # 
Instance details

Defined in Cardano.Ledger.Api.Tx.Address

Methods

(==)DecAddrDecAddrBool #

(/=)DecAddrDecAddrBool #

decodeAddrLenientMonadFail m ⇒ ByteString → m Addr Source #

This is a lenient decoder that will disregard known bugs in the address deserialization. This function is intended for clients that need to deal with historical data that has already been placed on chain. If you also require information on what exactly is bad in the address, or you would like to guard only against a specific bug, you should use decodeAddrLenientEither instead.

Since: 1.8.0

decodeAddrLenientEitherByteStringEither String DecAddr Source #

Decode an address and fail only for addresses that could have never been placed on chain, while decoding addresses with information about potential problems in them. Similar to decodeAddrLenient, this function is not intended for addresses that will be placed into a new transaction.

Since: 1.8.0

Reward Account

data RewardAccount Source #

An account based address for rewards

Constructors

RewardAccount 

Instances

Instances details
FromJSON RewardAccount 
Instance details

Defined in Cardano.Ledger.Address

FromJSONKey RewardAccount 
Instance details

Defined in Cardano.Ledger.Address

ToJSON RewardAccount 
Instance details

Defined in Cardano.Ledger.Address

ToJSONKey RewardAccount 
Instance details

Defined in Cardano.Ledger.Address

Generic RewardAccount 
Instance details

Defined in Cardano.Ledger.Address

Associated Types

type Rep RewardAccountTypeType #

Show RewardAccount 
Instance details

Defined in Cardano.Ledger.Address

DecCBOR RewardAccount 
Instance details

Defined in Cardano.Ledger.Address

EncCBOR RewardAccount 
Instance details

Defined in Cardano.Ledger.Address

Default RewardAccount 
Instance details

Defined in Cardano.Ledger.Address

NFData RewardAccount 
Instance details

Defined in Cardano.Ledger.Address

Methods

rnfRewardAccount → () #

Eq RewardAccount 
Instance details

Defined in Cardano.Ledger.Address

Ord RewardAccount 
Instance details

Defined in Cardano.Ledger.Address

NoThunks RewardAccount 
Instance details

Defined in Cardano.Ledger.Address

type Rep RewardAccount 
Instance details

Defined in Cardano.Ledger.Address

type Rep RewardAccount = D1 ('MetaData "RewardAccount" "Cardano.Ledger.Address" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "RewardAccount" 'PrefixI 'True) (S1 ('MetaSel ('Just "raNetwork") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Network) :*: S1 ('MetaSel ('Just "raCredential") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Credential 'Staking))))

serialiseRewardAccountRewardAccountByteString Source #

Serialise a reward account to the external format.

deserialiseRewardAccountByteStringMaybe RewardAccount Source #

Deserialise a reward account from the external format. This will fail if the input data is not in the right format (or if there is trailing data).