| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Ledger.Api.Tx.Address
Synopsis
- data Addr
- getNetwork ∷ Addr → Network
- newtype BootstrapAddress = BootstrapAddress {}
- serialiseAddr ∷ Addr → ByteString
- decodeAddr ∷ MonadFail m ⇒ ByteString → m Addr
- decodeAddrEither ∷ ByteString → Either String Addr
- decodeAddrShort ∷ MonadFail m ⇒ ShortByteString → m Addr
- decodeAddrShortEither ∷ ShortByteString → Either String Addr
- data DecAddr
- decodeAddrLenient ∷ MonadFail m ⇒ ByteString → m Addr
- decodeAddrLenientEither ∷ ByteString → Either String DecAddr
- data AccountAddress = AccountAddress {}
- newtype AccountId = AccountId {}
- serialiseAccountAddress ∷ AccountAddress → ByteString
- deserialiseAccountAddress ∷ ByteString → Maybe AccountAddress
- pattern RewardAccount ∷ Network → Credential 'Staking → AccountAddress
- serialiseRewardAccount ∷ AccountAddress → ByteString
- deserialiseRewardAccount ∷ ByteString → Maybe AccountAddress
Address
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.
Constructors
| Addr Network (Credential 'Payment) StakeReference | |
| AddrBootstrap BootstrapAddress |
Instances
getNetwork ∷ Addr → Network Source #
Lookup a Network Id for an Address
newtype BootstrapAddress Source #
Constructors
| BootstrapAddress | |
Fields | |
Instances
| NFData BootstrapAddress | |||||
Defined in Cardano.Ledger.Address Methods rnf ∷ BootstrapAddress → () # | |||||
| Generic BootstrapAddress | |||||
Defined in Cardano.Ledger.Address Associated Types
Methods from ∷ BootstrapAddress → Rep BootstrapAddress x # to ∷ Rep BootstrapAddress x → BootstrapAddress # | |||||
| Show BootstrapAddress | |||||
Defined in Cardano.Ledger.Address Methods showsPrec ∷ Int → BootstrapAddress → ShowS # show ∷ BootstrapAddress → String # showList ∷ [BootstrapAddress] → ShowS # | |||||
| Eq BootstrapAddress | |||||
Defined in Cardano.Ledger.Address Methods | |||||
| Ord BootstrapAddress | |||||
Defined in Cardano.Ledger.Address Methods compare ∷ BootstrapAddress → BootstrapAddress → Ordering # (<) ∷ BootstrapAddress → BootstrapAddress → Bool # (<=) ∷ BootstrapAddress → BootstrapAddress → Bool # (>) ∷ BootstrapAddress → BootstrapAddress → Bool # (>=) ∷ BootstrapAddress → BootstrapAddress → Bool # max ∷ BootstrapAddress → BootstrapAddress → BootstrapAddress # min ∷ BootstrapAddress → BootstrapAddress → BootstrapAddress # | |||||
| NoThunks BootstrapAddress | |||||
Defined in Cardano.Ledger.Address | |||||
| type Rep BootstrapAddress | |||||
Defined in Cardano.Ledger.Address type Rep BootstrapAddress = D1 ('MetaData "BootstrapAddress" "Cardano.Ledger.Address" "cardano-ledger-core-1.19.0.0-inplace" 'True) (C1 ('MetaCons "BootstrapAddress" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBootstrapAddress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Address))) | |||||
serialiseAddr ∷ Addr → 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 ∷ MonadFail 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.
decodeAddrEither ∷ ByteString → Either String Addr Source #
Same as decodeAddr, but produces an Either result
decodeAddrShort ∷ MonadFail m ⇒ ShortByteString → m Addr Source #
Same as decodeAddr, but works on ShortByteString
decodeAddrShortEither ∷ ShortByteString → Either String Addr Source #
Same as decodeAddrShort, but produces an Either result
Lenient decoders
These lenient decoders do not fail for addresses with known bugs
Decoded Address.
Constructors
| DecAddr Addr | Address was decoded with no problems |
| DecAddrBadPtr Addr | Address was decoded, but it contains an invalid |
| DecAddrUnconsumed | Address was decoded, but not all of input was consumed |
Fields
| |
Instances
decodeAddrLenient ∷ MonadFail 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
decodeAddrLenientEither ∷ ByteString → Either 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
Account Address
data AccountAddress Source #
An account based address for rewards
Constructors
| AccountAddress | |
Fields | |
Instances
| FromJSON AccountAddress | |||||
Defined in Cardano.Ledger.Address Methods parseJSON ∷ Value → Parser AccountAddress Source # | |||||
| FromJSONKey AccountAddress | |||||
Defined in Cardano.Ledger.Address | |||||
| ToJSON AccountAddress | |||||
Defined in Cardano.Ledger.Address Methods toJSON ∷ AccountAddress → Value Source # toEncoding ∷ AccountAddress → Encoding Source # toJSONList ∷ [AccountAddress] → Value Source # | |||||
| ToJSONKey AccountAddress | |||||
Defined in Cardano.Ledger.Address | |||||
| DecCBOR AccountAddress | |||||
Defined in Cardano.Ledger.Address | |||||
| EncCBOR AccountAddress | |||||
Defined in Cardano.Ledger.Address Methods | |||||
| Default AccountAddress | |||||
Defined in Cardano.Ledger.Address Methods | |||||
| NFData AccountAddress | |||||
Defined in Cardano.Ledger.Address Methods rnf ∷ AccountAddress → () # | |||||
| Generic AccountAddress | |||||
Defined in Cardano.Ledger.Address Associated Types
| |||||
| Show AccountAddress | |||||
Defined in Cardano.Ledger.Address Methods showsPrec ∷ Int → AccountAddress → ShowS # show ∷ AccountAddress → String # showList ∷ [AccountAddress] → ShowS # | |||||
| Eq AccountAddress | |||||
Defined in Cardano.Ledger.Address Methods (==) ∷ AccountAddress → AccountAddress → Bool # (/=) ∷ AccountAddress → AccountAddress → Bool # | |||||
| Ord AccountAddress | |||||
Defined in Cardano.Ledger.Address Methods compare ∷ AccountAddress → AccountAddress → Ordering # (<) ∷ AccountAddress → AccountAddress → Bool # (<=) ∷ AccountAddress → AccountAddress → Bool # (>) ∷ AccountAddress → AccountAddress → Bool # (>=) ∷ AccountAddress → AccountAddress → Bool # | |||||
| NoThunks AccountAddress | |||||
Defined in Cardano.Ledger.Address | |||||
| type Rep AccountAddress | |||||
Defined in Cardano.Ledger.Address type Rep AccountAddress = D1 ('MetaData "AccountAddress" "Cardano.Ledger.Address" "cardano-ledger-core-1.19.0.0-inplace" 'False) (C1 ('MetaCons "AccountAddress" 'PrefixI 'True) (S1 ('MetaSel ('Just "aaNetworkId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Network) :*: S1 ('MetaSel ('Just "aaAccountId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AccountId))) | |||||
Constructors
| AccountId | |
Fields | |
Instances
| FromJSON AccountId | |||||
| ToJSON AccountId | |||||
| DecCBOR AccountId | |||||
| EncCBOR AccountId | |||||
| NFData AccountId | |||||
Defined in Cardano.Ledger.Address | |||||
| Generic AccountId | |||||
Defined in Cardano.Ledger.Address Associated Types
| |||||
| Show AccountId | |||||
| Eq AccountId | |||||
| Ord AccountId | |||||
Defined in Cardano.Ledger.Address | |||||
| NoThunks AccountId | |||||
| type Rep AccountId | |||||
Defined in Cardano.Ledger.Address type Rep AccountId = D1 ('MetaData "AccountId" "Cardano.Ledger.Address" "cardano-ledger-core-1.19.0.0-inplace" 'True) (C1 ('MetaCons "AccountId" 'PrefixI 'True) (S1 ('MetaSel ('Just "unAccountId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Credential 'Staking)))) | |||||
serialiseAccountAddress ∷ AccountAddress → ByteString Source #
Serialise an account address to the external format.
deserialiseAccountAddress ∷ ByteString → Maybe AccountAddress Source #
Deserialise an account address from the external format. This will fail if the input data is not in the right format (or if there is trailing data).
Deprecated - Reward Account (use Account Address instead)
pattern RewardAccount ∷ Network → Credential 'Staking → AccountAddress Source #
Deprecated pattern synonym for backward compatibility