| Copyright | 2020 Input Output (Hong Kong) Ltd. 2021-2022 Input Output Global Inc. (IOG) 2023-2025 Intersect |
|---|---|
| License | Apache-2.0 |
| Safe Haskell | None |
| Language | Haskell2010 |
Cardano.Address
Contents
Description
Synopsis
- data Address
- class HasNetworkDiscriminant key => PaymentAddress (key :: Depth -> Type -> Type) where
- paymentAddress :: NetworkDiscriminant key -> key 'PaymentK XPub -> Address
- class HasNetworkDiscriminant key => StakeAddress (key :: Depth -> Type -> Type) where
- stakeAddress :: NetworkDiscriminant key -> key 'DelegationK XPub -> Address
- class PaymentAddress key => DelegationAddress (key :: Depth -> Type -> Type) where
- delegationAddress :: NetworkDiscriminant key -> key 'PaymentK XPub -> key 'DelegationK XPub -> Address
- class PaymentAddress key => PointerAddress (key :: Depth -> Type -> Type) where
- pointerAddress :: NetworkDiscriminant key -> key 'PaymentK XPub -> ChainPointer -> Address
- data ChainPointer = ChainPointer {}
- unsafeMkAddress :: ByteString -> Address
- base58 :: Address -> Text
- fromBase58 :: Text -> Maybe Address
- bech32 :: Address -> Text
- bech32With :: HumanReadablePart -> Address -> Text
- fromBech32 :: Text -> Maybe Address
- newtype NetworkTag = NetworkTag {}
Address
An Address type representing Cardano addresses. Internals are
irrevelant to the user.
Since: 1.0.0
Instances
| NFData Address # | |||||
Defined in Cardano.Address | |||||
| Generic Address # | |||||
Defined in Cardano.Address Associated Types
| |||||
| Show Address # | |||||
| Eq Address # | |||||
| Ord Address # | |||||
| type Rep Address # | |||||
Defined in Cardano.Address type Rep Address = D1 ('MetaData "Address" "Cardano.Address" "cardano-addresses-4.0.2-inplace" 'True) (C1 ('MetaCons "Address" 'PrefixI 'True) (S1 ('MetaSel ('Just "unAddress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) | |||||
class HasNetworkDiscriminant key => PaymentAddress (key :: Depth -> Type -> Type) where #
Encoding of addresses for certain key types and backend targets.
Since: 1.0.0
Methods
paymentAddress :: NetworkDiscriminant key -> key 'PaymentK XPub -> Address #
Convert a public key to a payment Address valid for the given
network discrimination.
Since: 1.0.0
Instances
| PaymentAddress Byron # | |
Defined in Cardano.Address.Style.Byron Methods paymentAddress :: NetworkDiscriminant Byron -> Byron 'PaymentK XPub -> Address # | |
| PaymentAddress Icarus # | |
Defined in Cardano.Address.Style.Icarus Methods paymentAddress :: NetworkDiscriminant Icarus -> Icarus 'PaymentK XPub -> Address # | |
class HasNetworkDiscriminant key => StakeAddress (key :: Depth -> Type -> Type) where #
Encoding of addresses for certain key types and backend targets.
Since: 2.0.0
Methods
stakeAddress :: NetworkDiscriminant key -> key 'DelegationK XPub -> Address #
Convert a delegation key to a stake Address (aka: reward account address)
valid for the given network discrimination.
Since: 2.0.0
class PaymentAddress key => DelegationAddress (key :: Depth -> Type -> Type) where #
Encoding of delegation addresses for certain key types and backend targets.
Since: 2.0.0
Methods
Arguments
| :: NetworkDiscriminant key | |
| -> key 'PaymentK XPub | Payment key |
| -> key 'DelegationK XPub | Delegation key |
| -> Address |
Convert a public key and a delegation key to a delegation Address valid
for the given network discrimination. Funds sent to this address will be
delegated according to the delegation settings attached to the delegation
key.
Since: 2.0.0
class PaymentAddress key => PointerAddress (key :: Depth -> Type -> Type) where #
Encoding of pointer addresses for payment key type, pointer to delegation certificate in the blockchain and backend targets.
Since: 2.0.0
Methods
Arguments
| :: NetworkDiscriminant key | |
| -> key 'PaymentK XPub | Payment key |
| -> ChainPointer | Pointer to locate delegation key in blockchain |
| -> Address |
Convert a payment public key and a pointer to delegation key in the
blockchain to a delegation Address valid for the given network
discrimination. Funds sent to this address will be delegated according to
the delegation settings attached to the delegation key located by
ChainPointer.
Since: 2.0.0
data ChainPointer #
A ChainPointer type representing location of some object
in the blockchain (eg., delegation certificate). This can be achieved
unambiguously by specifying slot number, transaction index and the index
in the object list (eg., certification list).
For delegation certificates, alternatively, the delegation key can be used and
then DelegationAddress can be used.
Since: 2.0.0
Constructors
| ChainPointer | |
Fields
| |
Instances
unsafeMkAddress :: ByteString -> Address #
Unsafe constructor for easily lifting bytes inside an Address.
Use at your own risks.
Conversion From / To Text
bech32With :: HumanReadablePart -> Address -> Text #
newtype NetworkTag #
Magic constant associated with a given network. This is mainly used in two places:
- In
Addresspayloads, to discriminate addresses between networks. - At the network-level, when doing handshake with nodes.
Constructors
| NetworkTag | |
Fields | |
Instances
| ToJSON NetworkTag # | |||||
Defined in Cardano.Address Methods toJSON :: NetworkTag -> Value # toEncoding :: NetworkTag -> Encoding # toJSONList :: [NetworkTag] -> Value # toEncodingList :: [NetworkTag] -> Encoding # omitField :: NetworkTag -> Bool # | |||||
| NFData NetworkTag # | |||||
Defined in Cardano.Address Methods rnf :: NetworkTag -> () # | |||||
| Generic NetworkTag # | |||||
Defined in Cardano.Address Associated Types
| |||||
| Show NetworkTag # | |||||
Defined in Cardano.Address Methods showsPrec :: Int -> NetworkTag -> ShowS # show :: NetworkTag -> String # showList :: [NetworkTag] -> ShowS # | |||||
| Eq NetworkTag # | |||||
Defined in Cardano.Address | |||||
| type Rep NetworkTag # | |||||
Defined in Cardano.Address type Rep NetworkTag = D1 ('MetaData "NetworkTag" "Cardano.Address" "cardano-addresses-4.0.2-inplace" 'True) (C1 ('MetaCons "NetworkTag" 'PrefixI 'True) (S1 ('MetaSel ('Just "unNetworkTag") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32))) | |||||