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

Cardano.Ledger.Api.Tx.Address

Synopsis

Address

data Addr c 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
Crypto c ⇒ FromJSON (Addr c) 
Instance details

Defined in Cardano.Ledger.Address

Crypto c ⇒ FromJSONKey (Addr c) 
Instance details

Defined in Cardano.Ledger.Address

ToJSON (Addr c) 
Instance details

Defined in Cardano.Ledger.Address

ToJSONKey (Addr c) 
Instance details

Defined in Cardano.Ledger.Address

Generic (Addr c) 
Instance details

Defined in Cardano.Ledger.Address

Associated Types

type Rep (Addr c) ∷ TypeType Source #

Methods

fromAddr c → Rep (Addr c) x Source #

toRep (Addr c) x → Addr c Source #

Show (Addr c) 
Instance details

Defined in Cardano.Ledger.Address

Methods

showsPrecIntAddr c → ShowS Source #

showAddr c → String Source #

showList ∷ [Addr c] → ShowS Source #

Crypto c ⇒ DecCBOR (Addr c) 
Instance details

Defined in Cardano.Ledger.Address

Methods

decCBORDecoder s (Addr c) Source #

dropCBORProxy (Addr c) → Decoder s () Source #

labelProxy (Addr c) → Text Source #

Crypto c ⇒ EncCBOR (Addr c) 
Instance details

Defined in Cardano.Ledger.Address

Methods

encCBORAddr c → Encoding Source #

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

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

NFData (Addr c) 
Instance details

Defined in Cardano.Ledger.Address

Methods

rnfAddr c → () Source #

Eq (Addr c) 
Instance details

Defined in Cardano.Ledger.Address

Methods

(==)Addr c → Addr c → Bool Source #

(/=)Addr c → Addr c → Bool Source #

Ord (Addr c) 
Instance details

Defined in Cardano.Ledger.Address

Methods

compareAddr c → Addr c → Ordering Source #

(<)Addr c → Addr c → Bool Source #

(<=)Addr c → Addr c → Bool Source #

(>)Addr c → Addr c → Bool Source #

(>=)Addr c → Addr c → Bool Source #

maxAddr c → Addr c → Addr c Source #

minAddr c → Addr c → Addr c Source #

NoThunks (Addr c) 
Instance details

Defined in Cardano.Ledger.Address

type Rep (Addr c) 
Instance details

Defined in Cardano.Ledger.Address

getNetworkAddr c → Network Source #

Lookup a Network Id for an Address

newtype BootstrapAddress c Source #

Instances

Instances details
Generic (BootstrapAddress c) 
Instance details

Defined in Cardano.Ledger.Address

Associated Types

type Rep (BootstrapAddress c) ∷ TypeType Source #

Show (BootstrapAddress c) 
Instance details

Defined in Cardano.Ledger.Address

NFData (BootstrapAddress c) 
Instance details

Defined in Cardano.Ledger.Address

Methods

rnfBootstrapAddress c → () Source #

Eq (BootstrapAddress c) 
Instance details

Defined in Cardano.Ledger.Address

Ord (BootstrapAddress c) 
Instance details

Defined in Cardano.Ledger.Address

NoThunks (BootstrapAddress c) 
Instance details

Defined in Cardano.Ledger.Address

type Rep (BootstrapAddress c) 
Instance details

Defined in Cardano.Ledger.Address

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

serialiseAddrAddr c → ByteString 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.

decodeAddr ∷ (Crypto c, MonadFail m) ⇒ ByteString → m (Addr c) 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.

decodeAddrEitherCrypto c ⇒ ByteStringEither String (Addr c) Source #

Same as decodeAddr, but produces an Either result

decodeAddrShort ∷ (Crypto c, MonadFail m) ⇒ ShortByteString → m (Addr c) Source #

Same as decodeAddr, but works on ShortByteString

decodeAddrShortEitherCrypto c ⇒ ShortByteStringEither String (Addr c) Source #

Same as decodeAddrShort, but produces an Either result

Lenient decoders

These lenient decoders do not fail for addresses with known bugs

data DecAddr c Source #

Decoded Address.

Constructors

DecAddr (Addr c)

Address was decoded with no problems

DecAddrBadPtr (Addr c)

Address was decoded, but it contains an invalid Ptr

DecAddrUnconsumed

Address was decoded, but not all of input was consumed

Fields

Instances

Instances details
Show (DecAddr c) Source # 
Instance details

Defined in Cardano.Ledger.Api.Tx.Address

Methods

showsPrecIntDecAddr c → ShowS Source #

showDecAddr c → String Source #

showList ∷ [DecAddr c] → ShowS Source #

Eq (DecAddr c) Source # 
Instance details

Defined in Cardano.Ledger.Api.Tx.Address

Methods

(==)DecAddr c → DecAddr c → Bool Source #

(/=)DecAddr c → DecAddr c → Bool Source #

decodeAddrLenient ∷ (Crypto c, MonadFail m) ⇒ ByteString → m (Addr c) 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

decodeAddrLenientEitherCrypto c ⇒ ByteStringEither String (DecAddr c) 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 c Source #

An account based address for rewards

Constructors

RewardAccount 

Bundled Patterns

pattern RewardAcntNetworkCredential 'Staking c → RewardAccount c 

Instances

Instances details
Crypto c ⇒ FromJSON (RewardAcnt c) 
Instance details

Defined in Cardano.Ledger.Address

Crypto c ⇒ FromJSONKey (RewardAccount c) 
Instance details

Defined in Cardano.Ledger.Address

Crypto c ⇒ ToJSON (RewardAcnt c) 
Instance details

Defined in Cardano.Ledger.Address

Crypto c ⇒ ToJSONKey (RewardAccount c) 
Instance details

Defined in Cardano.Ledger.Address

Generic (RewardAccount c) 
Instance details

Defined in Cardano.Ledger.Address

Associated Types

type Rep (RewardAccount c) ∷ TypeType Source #

Show (RewardAccount c) 
Instance details

Defined in Cardano.Ledger.Address

Crypto c ⇒ DecCBOR (RewardAcnt c) 
Instance details

Defined in Cardano.Ledger.Address

Crypto c ⇒ EncCBOR (RewardAcnt c) 
Instance details

Defined in Cardano.Ledger.Address

Methods

encCBORRewardAcnt c → Encoding Source #

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

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

Crypto c ⇒ Default (RewardAcnt c) 
Instance details

Defined in Cardano.Ledger.Address

Methods

defRewardAcnt c Source #

NFData (RewardAccount c) 
Instance details

Defined in Cardano.Ledger.Address

Methods

rnfRewardAccount c → () Source #

Eq (RewardAccount c) 
Instance details

Defined in Cardano.Ledger.Address

Ord (RewardAccount c) 
Instance details

Defined in Cardano.Ledger.Address

NoThunks (RewardAcnt c) 
Instance details

Defined in Cardano.Ledger.Address

type Rep (RewardAccount c) 
Instance details

Defined in Cardano.Ledger.Address

type Rep (RewardAccount c) = D1 ('MetaData "RewardAccount" "Cardano.Ledger.Address" "cardano-ledger-core-1.12.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 c))))

serialiseRewardAccountRewardAcnt c → ByteString Source #

Serialise a reward account to the external format.

deserialiseRewardAccountCrypto c ⇒ ByteStringMaybe (RewardAcnt c) 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).

Deprecations