cardano-addresses
Copyright2020 Input Output (Hong Kong) Ltd. 2021-2022 Input Output Global Inc. (IOG) 2023-2025 Intersect
LicenseApache-2.0
Safe HaskellNone
LanguageHaskell2010

Cardano.Address

Description

 
Synopsis

Address

data Address #

An Address type representing Cardano addresses. Internals are irrevelant to the user.

Since: 1.0.0

Instances

Instances details
NFData Address # 
Instance details

Defined in Cardano.Address

Methods

rnf :: Address -> () #

Generic Address # 
Instance details

Defined in Cardano.Address

Associated Types

type Rep Address 
Instance details

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

Methods

from :: Address -> Rep Address x #

to :: Rep Address x -> Address #

Show Address # 
Instance details

Defined in Cardano.Address

Eq Address # 
Instance details

Defined in Cardano.Address

Methods

(==) :: Address -> Address -> Bool #

(/=) :: Address -> Address -> Bool #

Ord Address # 
Instance details

Defined in Cardano.Address

type Rep Address # 
Instance details

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

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

delegationAddress #

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

pointerAddress #

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

Instances details
ToJSON ChainPointer # 
Instance details

Defined in Cardano.Address

NFData ChainPointer # 
Instance details

Defined in Cardano.Address

Methods

rnf :: ChainPointer -> () #

Generic ChainPointer # 
Instance details

Defined in Cardano.Address

Associated Types

type Rep ChainPointer 
Instance details

Defined in Cardano.Address

type Rep ChainPointer = D1 ('MetaData "ChainPointer" "Cardano.Address" "cardano-addresses-4.0.2-inplace" 'False) (C1 ('MetaCons "ChainPointer" 'PrefixI 'True) (S1 ('MetaSel ('Just "slotNum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: (S1 ('MetaSel ('Just "transactionIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: S1 ('MetaSel ('Just "outputIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural))))
Show ChainPointer # 
Instance details

Defined in Cardano.Address

Eq ChainPointer # 
Instance details

Defined in Cardano.Address

Ord ChainPointer # 
Instance details

Defined in Cardano.Address

type Rep ChainPointer # 
Instance details

Defined in Cardano.Address

type Rep ChainPointer = D1 ('MetaData "ChainPointer" "Cardano.Address" "cardano-addresses-4.0.2-inplace" 'False) (C1 ('MetaCons "ChainPointer" 'PrefixI 'True) (S1 ('MetaSel ('Just "slotNum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: (S1 ('MetaSel ('Just "transactionIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: S1 ('MetaSel ('Just "outputIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural))))

unsafeMkAddress :: ByteString -> Address #

Unsafe constructor for easily lifting bytes inside an Address.

Use at your own risks.

Conversion From / To Text

base58 :: Address -> Text #

Encode an Address to a base58 Text.

Since: 1.0.0

fromBase58 :: Text -> Maybe Address #

Decode a base58-encoded Text into an Address

Since: 1.0.0

bech32 :: Address -> Text #

Encode a Shelley Address to bech32 Text, using addr or addr_test as a human readable prefix (depending on the network tag in the address).

Since: 1.0.0

bech32With :: HumanReadablePart -> Address -> Text #

Encode an Address to bech32 Text, using the specified human readable prefix.

Since: 2.0.0

fromBech32 :: Text -> Maybe Address #

Decode a bech32-encoded Text into an Address

Since: 1.0.0

newtype NetworkTag #

Magic constant associated with a given network. This is mainly used in two places:

  1. In Address payloads, to discriminate addresses between networks.
  2. At the network-level, when doing handshake with nodes.

Constructors

NetworkTag 

Fields

Instances

Instances details
ToJSON NetworkTag # 
Instance details

Defined in Cardano.Address

NFData NetworkTag # 
Instance details

Defined in Cardano.Address

Methods

rnf :: NetworkTag -> () #

Generic NetworkTag # 
Instance details

Defined in Cardano.Address

Associated Types

type Rep NetworkTag 
Instance details

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

Defined in Cardano.Address

Eq NetworkTag # 
Instance details

Defined in Cardano.Address

type Rep NetworkTag # 
Instance details

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