| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cometa.Address.Reward
Description
Staking reward accounts, distinct from payment addresses.
import qualified Cometa.Address.Reward as Reward import qualified Cometa.Credential as Credential import qualified Cometa.NetworkId as Network rewardAccount :: Credential.Credential Credential.Stake -> Reward.RewardAddress rewardAccount = Reward.fromCredential Network.testnet
Synopsis
- data RewardAddress
- fromCredential :: NetworkId -> Credential Stake -> RewardAddress
- networkId :: RewardAddress -> NetworkId
- credential :: RewardAddress -> Credential Stake
- fromBytes :: ByteString -> Either Error RewardAddress
- toBytes :: RewardAddress -> ByteString
- fromText :: Text -> Either Error RewardAddress
- toText :: RewardAddress -> Text
Documentation
data RewardAddress Source #
An immutable reward account. Equality and ordering compare network then
credential (key before script, then hash bytes); Show is diagnostic.
Instances
| Show RewardAddress Source # | |
Defined in Cometa.Address.Reward Methods showsPrec :: Int -> RewardAddress -> ShowS # show :: RewardAddress -> String # showList :: [RewardAddress] -> ShowS # | |
| Eq RewardAddress Source # | |
Defined in Cometa.Address.Reward Methods (==) :: RewardAddress -> RewardAddress -> Bool # (/=) :: RewardAddress -> RewardAddress -> Bool # | |
| Ord RewardAddress Source # | |
Defined in Cometa.Address.Reward Methods compare :: RewardAddress -> RewardAddress -> Ordering # (<) :: RewardAddress -> RewardAddress -> Bool # (<=) :: RewardAddress -> RewardAddress -> Bool # (>) :: RewardAddress -> RewardAddress -> Bool # (>=) :: RewardAddress -> RewardAddress -> Bool # max :: RewardAddress -> RewardAddress -> RewardAddress # min :: RewardAddress -> RewardAddress -> RewardAddress # | |
fromCredential :: NetworkId -> Credential Stake -> RewardAddress Source #
Assemble a reward account from its network and staking authority.
networkId :: RewardAddress -> NetworkId Source #
Four-bit network tag carried by the header.
credential :: RewardAddress -> Credential Stake Source #
Staking authority controlling the rewards.
fromBytes :: ByteString -> Either Error RewardAddress Source #
Import exact reward-account bytes. Non-reward headers return
UnsupportedAddressType; empty input or incorrect exact lengths return
InvalidShelleyAddress. All four-bit network tags are retained.
toBytes :: RewardAddress -> ByteString Source #
Exact 29-byte header and credential encoding.
fromText :: Text -> Either Error RewardAddress Source #
Parse lowercase or all-uppercase Bech32. Mixed case, non-ASCII, empty,
overlong (more than 120 characters), or mismatched network/form prefixes
return InvalidShelleyAddressText. Malformed encoding or checksum returns
InvalidShelleyAddressText; non-reward headers return UnsupportedAddressType;
incorrect exact lengths return InvalidShelleyAddress.
toText :: RewardAddress -> Text Source #
Encode canonical lowercase Bech32, with stake for tag 1 and
stake_test for other tags.