cardano-ledger-core-1.19.0.0: Core components of Cardano ledgers from the Shelley release on.
Safe HaskellNone
LanguageHaskell2010

Cardano.Ledger.Address

Synopsis

Documentation

serialiseAddrAddrByteString Source #

Serialise an address to the external format.

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 Source # 
Instance details

Defined in Cardano.Ledger.Address

FromJSONKey Addr Source # 
Instance details

Defined in Cardano.Ledger.Address

ToJSON Addr Source # 
Instance details

Defined in Cardano.Ledger.Address

ToJSONKey Addr Source # 
Instance details

Defined in Cardano.Ledger.Address

DecCBOR Addr Source # 
Instance details

Defined in Cardano.Ledger.Address

EncCBOR Addr Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

encCBORAddrEncoding Source #

NFData Addr Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

rnfAddr → () #

Generic Addr Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

fromAddrRep Addr x #

toRep Addr x → Addr #

Show Addr Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

showsPrecIntAddrShowS #

showAddrString #

showList ∷ [Addr] → ShowS #

Eq Addr Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

(==)AddrAddrBool #

(/=)AddrAddrBool #

Ord Addr Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

compareAddrAddrOrdering #

(<)AddrAddrBool #

(<=)AddrAddrBool #

(>)AddrAddrBool #

(>=)AddrAddrBool #

maxAddrAddrAddr #

minAddrAddrAddr #

NoThunks Addr Source # 
Instance details

Defined in Cardano.Ledger.Address

type Rep Addr Source # 
Instance details

Defined in Cardano.Ledger.Address

newtype BootstrapAddress Source #

Instances

Instances details
NFData BootstrapAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

rnfBootstrapAddress → () #

Generic BootstrapAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

Associated Types

type Rep BootstrapAddress 
Instance details

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)))
Show BootstrapAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

Eq BootstrapAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

Ord BootstrapAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

NoThunks BootstrapAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

type Rep BootstrapAddress Source # 
Instance details

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)))

bootstrapAddressAttrsSizeBootstrapAddressInt Source #

The size of the extra attributes in a bootstrap (ie Byron) address. Used to help enforce that people do not post huge ones on the chain.

isBootstrapRedeemerBootstrapAddressBool Source #

Return True if a given address is a redeemer address from the Byron Era

getNetworkAddrNetwork Source #

Lookup a Network Id for an Address

data AccountAddress Source #

An account based address for rewards

Constructors

AccountAddress 

Instances

Instances details
FromJSON AccountAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

FromJSONKey AccountAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

ToJSON AccountAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

ToJSONKey AccountAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

DecCBOR AccountAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

EncCBOR AccountAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

Default AccountAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

NFData AccountAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

rnfAccountAddress → () #

Generic AccountAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

Associated Types

type Rep AccountAddress 
Instance details

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)))
Show AccountAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

Eq AccountAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

Ord AccountAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

NoThunks AccountAddress Source # 
Instance details

Defined in Cardano.Ledger.Address

type Rep AccountAddress Source # 
Instance details

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)))

newtype AccountId Source #

Constructors

AccountId 

Instances

Instances details
FromJSON AccountId Source # 
Instance details

Defined in Cardano.Ledger.Address

ToJSON AccountId Source # 
Instance details

Defined in Cardano.Ledger.Address

DecCBOR AccountId Source # 
Instance details

Defined in Cardano.Ledger.Address

EncCBOR AccountId Source # 
Instance details

Defined in Cardano.Ledger.Address

NFData AccountId Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

rnfAccountId → () #

Generic AccountId Source # 
Instance details

Defined in Cardano.Ledger.Address

Associated Types

type Rep AccountId 
Instance details

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))))

Methods

fromAccountIdRep AccountId x #

toRep AccountId x → AccountId #

Show AccountId Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

showsPrecIntAccountIdShowS #

showAccountIdString #

showList ∷ [AccountId] → ShowS #

Eq AccountId Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

(==)AccountIdAccountIdBool #

(/=)AccountIdAccountIdBool #

Ord AccountId Source # 
Instance details

Defined in Cardano.Ledger.Address

NoThunks AccountId Source # 
Instance details

Defined in Cardano.Ledger.Address

type Rep AccountId Source # 
Instance details

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))))

serialiseAccountAddressAccountAddressByteString Source #

Serialise an account address to the external format.

deserialiseAccountAddressByteStringMaybe 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).

decodeAccountAddress ∷ (AddressBuffer b, MonadFail m) ⇒ b → m AccountAddress Source #

pattern RewardAccountNetworkCredential 'StakingAccountAddress Source #

Deprecated: In favor of AccountAddress

Deprecated pattern synonym for backward compatibility

raNetworkAccountAddressNetwork Source #

Deprecated: In favor of aaNetworkId

decodeRewardAccount ∷ (AddressBuffer b, MonadFail m) ⇒ b → m AccountAddress Source #

Deprecated: In favor of decodeAccountAddress

putCredential ∷ ∀ (kr ∷ KeyRole). Credential kr → Put Source #

newtype Word7 Source #

Constructors

Word7 Word8 

Instances

Instances details
Show Word7 Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

showsPrecIntWord7ShowS #

showWord7String #

showList ∷ [Word7] → ShowS #

Eq Word7 Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

(==)Word7Word7Bool #

(/=)Word7Word7Bool #

Compact Address

fromBoostrapCompactAddressCompactAddressCompactAddr Source #

Convert Byron's comapct address into CompactAddr. This is just an efficient type cast.

data CompactAddr Source #

Instances

Instances details
DecCBOR CompactAddr Source # 
Instance details

Defined in Cardano.Ledger.Address

EncCBOR CompactAddr Source # 
Instance details

Defined in Cardano.Ledger.Address

NFData CompactAddr Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

rnfCompactAddr → () #

Generic CompactAddr Source # 
Instance details

Defined in Cardano.Ledger.Address

Associated Types

type Rep CompactAddr 
Instance details

Defined in Cardano.Ledger.Address

type Rep CompactAddr = D1 ('MetaData "CompactAddr" "Cardano.Ledger.Address" "cardano-ledger-core-1.19.0.0-inplace" 'True) (C1 ('MetaCons "UnsafeCompactAddr" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortByteString)))
Show CompactAddr Source # 
Instance details

Defined in Cardano.Ledger.Address

Eq CompactAddr Source # 
Instance details

Defined in Cardano.Ledger.Address

Ord CompactAddr Source # 
Instance details

Defined in Cardano.Ledger.Address

MemPack CompactAddr Source # 
Instance details

Defined in Cardano.Ledger.Address

NoThunks CompactAddr Source # 
Instance details

Defined in Cardano.Ledger.Address

type Rep CompactAddr Source # 
Instance details

Defined in Cardano.Ledger.Address

type Rep CompactAddr = D1 ('MetaData "CompactAddr" "Cardano.Ledger.Address" "cardano-ledger-core-1.19.0.0-inplace" 'True) (C1 ('MetaCons "UnsafeCompactAddr" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortByteString)))

unCompactAddrCompactAddrShortByteString Source #

Unwrap the compact address and get to the address' binary representation.

isPayCredScriptCompactAddrCompactAddrBool Source #

Efficiently check whether compacted adddress is an address with a credential that is a payment script.

isBootstrapCompactAddrCompactAddrBool Source #

Efficiently check whether compated adddress is a Byron address.

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

decodeAddrStateT ∷ ∀ (m ∷ TypeType) b. (MonadFail m, AddressBuffer b) ⇒ b → StateT Int m Addr Source #

Just like decodeAddrStateLenientT, but enforces the address to be well-formed.

decodeAddrStateLenientT Source #

Arguments

∷ ∀ (m ∷ TypeType) b. (MonadFail m, AddressBuffer b) 
Bool

Enable lenient decoding for Ptrs, i.e. indicate whether junk can follow a Ptr. This is necessary for backwards compatibility only. Setting this argument to True is only needed for backwards compatibility.

Bool

Indicate whether decoder should not enforce the full input to be consumed or not, i.e. allow garbage at the end or not. Setting this argument to True is only needed for backwards compatibility.

→ b 
StateT Int m Addr 

This is the most general decoder for a Cardano address. This function is not meant to be used directly, but it is exported for convenice. decodeAddr and other should be used instead.

While decoding an Addr the header (the first byte in the buffer) is expected to be in a certain format. Here are the meaning of all the bits:

@@@

┏━━━━━━━━━━━━━━━━┳━┯━┯━┯━┯━┯━┯━┯━┓ ┃ Byron Address ┃1┊0┊0┊0┊0┊0┊1┊0┃ ┣━━━━━━━━━━━━━━━━╋━┿━┿━┿━┿━┿━┿━┿━┫ ┃Shelley Address ┃0┊x┊x┊x┊0┊0┊0┊x┃ ┗━━━━━━━━━━━━━━━━╋━┿━┿━┿━┿━┿━┿━┿━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃0┊0┊0┊0┊0┊0┊0┊0┃ Testnet PaymentKey StakingKey ┃ ┃0┊0┊0┊0┊0┊0┊0┊1┃ Mainnet PaymentKey StakingKey ┃ ┃0┊0┊0┊1┊0┊0┊0┊0┃ Testnet PaymentScript StakingKey ┃ ┃0┊0┊0┊1┊0┊0┊0┊1┃ Mainnet PaymentScript StakingKey ┃ ┃0┊0┊1┊0┊0┊0┊0┊0┃ Testnet PaymentKey StakingScript ┃ ┃0┊0┊1┊0┊0┊0┊0┊1┃ Mainnet PaymentKey StakingScript ┃ ┃0┊0┊1┊1┊0┊0┊0┊0┃ Testnet PaymentScript StakingScript ┃ ┃0┊0┊1┊1┊0┊0┊0┊1┃ Mainnet PaymentScript StakingScript ┃ ┃0┊1┊0┊0┊0┊0┊0┊0┃ Testnet PaymentKey StakingPtr ┃ ┃0┊1┊0┊0┊0┊0┊0┊1┃ Mainnet PaymentKey StakingPtr ┃ ┃0┊1┊0┊1┊0┊0┊0┊0┃ Testnet PaymentScript StakingPtr ┃ ┃0┊1┊0┊1┊0┊0┊0┊1┃ Mainnet PaymentScript StakingPtr ┃ ┃0┊1┊1┊0┊0┊0┊0┊0┃ Testnet PaymentKey StakingNull ┃ ┃0┊1┊1┊0┊0┊0┊0┊1┃ Mainnet PaymentKey StakingNull ┃ ┃0┊1┊1┊1┊0┊0┊0┊0┃ Testnet PaymentScript StakingNull ┃ ┃0┊1┊1┊1┊0┊0┊0┊1┃ Mainnet PaymentScript StakingNull ┃ ┗━┷━┷━┷━┷━┷━┷━┷━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ `Is Mainnet Address `Payment Credential is a Script `Staking Credential is a Script / No Staking Credential `Not a Base Address @@@

fromCborAddrDecoder s Addr Source #

Decoder for an Addr. Works in all eras

fromCborBothAddrDecoder s (Addr, CompactAddr) Source #

This is the decoder for an address that returns both the actual Addr and the bytes, that it was encoded as.

fromCborCompactAddrDecoder s CompactAddr Source #

Returns the actual bytes that represent an addres, while ensuring that they can be decoded in any era as an Addr when need be.

fromCborRigorousBothAddr Source #

Arguments

Bool

Should there be a hard failure for garbage pointers (False) or should they be normalized instead (True)

Decoder s (Addr, CompactAddr) 

Starting with Babbage we no longer allow addresses with garbage in them.

fromCborBackwardsBothAddrDecoder s (Addr, CompactAddr) Source #

Prior to Babbage era we did not check if a binary blob representing an address was fully consumed, so unfortunately we must preserve this behavior. However, we do not need to preserve the unconsumed bytes in memory, therefore we can drop the garbage after we successfully decoded the malformed address. We also need to allow bogus pointer address to be deserializeable prior to Babbage era.

newtype Withdrawals Source #

This is called wdrl in the spec.

Instances

Instances details
DecCBOR Withdrawals Source # 
Instance details

Defined in Cardano.Ledger.Address

EncCBOR Withdrawals Source # 
Instance details

Defined in Cardano.Ledger.Address

NFData Withdrawals Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

rnfWithdrawals → () #

Monoid Withdrawals Source # 
Instance details

Defined in Cardano.Ledger.Address

Semigroup Withdrawals Source # 
Instance details

Defined in Cardano.Ledger.Address

Generic Withdrawals Source # 
Instance details

Defined in Cardano.Ledger.Address

Associated Types

type Rep Withdrawals 
Instance details

Defined in Cardano.Ledger.Address

type Rep Withdrawals = D1 ('MetaData "Withdrawals" "Cardano.Ledger.Address" "cardano-ledger-core-1.19.0.0-inplace" 'True) (C1 ('MetaCons "Withdrawals" 'PrefixI 'True) (S1 ('MetaSel ('Just "unWithdrawals") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map AccountAddress Coin))))
Show Withdrawals Source # 
Instance details

Defined in Cardano.Ledger.Address

Eq Withdrawals Source # 
Instance details

Defined in Cardano.Ledger.Address

NoThunks Withdrawals Source # 
Instance details

Defined in Cardano.Ledger.Address

type Rep Withdrawals Source # 
Instance details

Defined in Cardano.Ledger.Address

type Rep Withdrawals = D1 ('MetaData "Withdrawals" "Cardano.Ledger.Address" "cardano-ledger-core-1.19.0.0-inplace" 'True) (C1 ('MetaCons "Withdrawals" 'PrefixI 'True) (S1 ('MetaSel ('Just "unWithdrawals") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map AccountAddress Coin))))

newtype DirectDeposits Source #

Direct deposits to account addresses.

Instances

Instances details
DecCBOR DirectDeposits Source # 
Instance details

Defined in Cardano.Ledger.Address

EncCBOR DirectDeposits Source # 
Instance details

Defined in Cardano.Ledger.Address

NFData DirectDeposits Source # 
Instance details

Defined in Cardano.Ledger.Address

Methods

rnfDirectDeposits → () #

Monoid DirectDeposits Source # 
Instance details

Defined in Cardano.Ledger.Address

Semigroup DirectDeposits Source # 
Instance details

Defined in Cardano.Ledger.Address

Generic DirectDeposits Source # 
Instance details

Defined in Cardano.Ledger.Address

Associated Types

type Rep DirectDeposits 
Instance details

Defined in Cardano.Ledger.Address

type Rep DirectDeposits = D1 ('MetaData "DirectDeposits" "Cardano.Ledger.Address" "cardano-ledger-core-1.19.0.0-inplace" 'True) (C1 ('MetaCons "DirectDeposits" 'PrefixI 'True) (S1 ('MetaSel ('Just "unDirectDeposits") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map AccountAddress Coin))))
Show DirectDeposits Source # 
Instance details

Defined in Cardano.Ledger.Address

Eq DirectDeposits Source # 
Instance details

Defined in Cardano.Ledger.Address

NoThunks DirectDeposits Source # 
Instance details

Defined in Cardano.Ledger.Address

type Rep DirectDeposits Source # 
Instance details

Defined in Cardano.Ledger.Address

type Rep DirectDeposits = D1 ('MetaData "DirectDeposits" "Cardano.Ledger.Address" "cardano-ledger-core-1.19.0.0-inplace" 'True) (C1 ('MetaCons "DirectDeposits" 'PrefixI 'True) (S1 ('MetaSel ('Just "unDirectDeposits") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map AccountAddress Coin))))