Copyright | © 2018-2020 IOHK |
---|---|
License | Apache-2.0 |
Safe Haskell | None |
Language | Haskell2010 |
This module contains the core primitive of a Wallet. This is roughly a Haskell translation of the Formal Specification for a Cardano Wallet
It doesn't contain any particular business-logic code, but defines a few primitive operations on Wallet core types as well.
Synopsis
-
data
Block
=
Block
{
- header :: ! BlockHeader
- transactions :: ![ Tx ]
- delegations :: ![ DelegationCertificate ]
-
data
BlockHeader
=
BlockHeader
{
- slotNo :: SlotNo
- blockHeight :: Quantity "block" Word32
- headerHash :: !( Hash "BlockHeader")
- parentHeaderHash :: !( Maybe ( Hash "BlockHeader"))
- isGenesisBlockHeader :: BlockHeader -> Bool
-
data
ChainPoint
- = ChainPointAtGenesis
- | ChainPoint ! SlotNo !( Hash "BlockHeader")
- compareSlot :: ChainPoint -> ChainPoint -> Ordering
- chainPointFromBlockHeader :: BlockHeader -> ChainPoint
- type Slot = WithOrigin SlotNo
- data WithOrigin t
- toSlot :: ChainPoint -> Slot
-
data
CertificatePublicationTime
=
CertificatePublicationTime
{
- slotNo :: SlotNo
- slotInternalIndex :: Word64
- data DelegationCertificate
- dlgCertAccount :: DelegationCertificate -> RewardAccount
- dlgCertPoolId :: DelegationCertificate -> Maybe PoolId
- data PoolLifeCycleStatus
-
data
PoolRegistrationCertificate
=
PoolRegistrationCertificate
{
- poolId :: ! PoolId
- poolOwners :: ![ PoolOwner ]
- poolMargin :: Percentage
- poolCost :: Coin
- poolPledge :: Coin
- poolMetadata :: Maybe ( StakePoolMetadataUrl , StakePoolMetadataHash )
-
data
PoolRetirementCertificate
=
PoolRetirementCertificate
{
- poolId :: ! PoolId
- retirementEpoch :: ! EpochNo
- data PoolCertificate
- getPoolCertificatePoolId :: PoolCertificate -> PoolId
- setPoolCertificatePoolId :: PoolId -> PoolCertificate -> PoolCertificate
- getPoolRegistrationCertificate :: PoolLifeCycleStatus -> Maybe PoolRegistrationCertificate
- getPoolRetirementCertificate :: PoolLifeCycleStatus -> Maybe PoolRetirementCertificate
- data NonWalletCertificate
- data Certificate
- data NetworkParameters = NetworkParameters { }
-
data
GenesisParameters
=
GenesisParameters
{
- getGenesisBlockHash :: Hash "Genesis"
- getGenesisBlockDate :: StartTime
- data SlottingParameters = SlottingParameters { }
-
data
ProtocolParameters
=
ProtocolParameters
{
- decentralizationLevel :: DecentralizationLevel
- txParameters :: TxParameters
- desiredNumberOfStakePools :: Word16
- minimumUTxO :: MinimumUTxO
- stakeKeyDeposit :: Coin
- eras :: EraInfo EpochNo
- maximumCollateralInputCount :: Word16
- minimumCollateralPercentage :: Natural
- executionUnitPrices :: Maybe ExecutionUnitPrices
- currentNodeProtocolParameters :: Maybe ProtocolParameters
- data TxParameters = TxParameters { }
- newtype TokenBundleMaxSize = TokenBundleMaxSize { }
- data EraInfo info = EraInfo { }
- emptyEraInfo :: EraInfo info
- newtype ActiveSlotCoefficient = ActiveSlotCoefficient { }
- data DecentralizationLevel
- $sel:getDecentralizationLevel:DecentralizationLevel :: DecentralizationLevel -> Percentage
- getFederationPercentage :: DecentralizationLevel -> Percentage
- fromDecentralizationLevel :: Percentage -> DecentralizationLevel
- fromFederationPercentage :: Percentage -> DecentralizationLevel
- newtype EpochLength = EpochLength { }
- newtype EpochNo = EpochNo { }
- unsafeEpochNo :: HasCallStack => Word32 -> EpochNo
- isValidEpochNo :: EpochNo -> Bool
- newtype FeePolicy = LinearFee ( LinearFunction Double )
- data LinearFunction a = LinearFunction { }
-
data
SlotId
=
SlotId
{
- epochNumber :: ! EpochNo
- slotNumber :: ! SlotInEpoch
- newtype SlotNo = SlotNo { }
- newtype SlotLength = SlotLength { }
- newtype SlotInEpoch = SlotInEpoch { }
- newtype StartTime = StartTime UTCTime
- stabilityWindowByron :: SlottingParameters -> Quantity "block" Word64
- stabilityWindowShelley :: SlottingParameters -> Quantity "block" Word64
- data ExecutionUnits = ExecutionUnits { }
- data ExecutionUnitPrices = ExecutionUnitPrices { }
-
data
WalletMetadata
=
WalletMetadata
{
- name :: ! WalletName
- creationTime :: ! UTCTime
- passphraseInfo :: !( Maybe WalletPassphraseInfo )
- delegation :: ! WalletDelegation
- newtype WalletId = WalletId { }
- newtype WalletName = WalletName { }
- walletNameMinLength :: Int
- walletNameMaxLength :: Int
-
data
WalletDelegation
=
WalletDelegation
{
- active :: ! WalletDelegationStatus
- next :: ![ WalletDelegationNext ]
-
data
WalletDelegationStatus
- = NotDelegating
- | Delegating ! PoolId
-
data
WalletDelegationNext
=
WalletDelegationNext
{
- changesAt :: ! EpochNo
- status :: ! WalletDelegationStatus
-
class
IsDelegatingTo
a
where
- isDelegatingTo :: ( PoolId -> Bool ) -> a -> Bool
- data StakePoolsSummary = StakePoolsSummary { }
- newtype PoolId = PoolId { }
- newtype PoolOwner = PoolOwner { }
- poolIdBytesLength :: [ Int ]
- decodePoolIdBech32 :: Text -> Either TextDecodingError PoolId
- encodePoolIdBech32 :: PoolId -> Text
-
data
StakePoolMetadata
=
StakePoolMetadata
{
- ticker :: StakePoolTicker
- name :: Text
- description :: Maybe Text
- homepage :: Text
- newtype StakePoolMetadataHash = StakePoolMetadataHash ByteString
- newtype StakePoolMetadataUrl = StakePoolMetadataUrl Text
- newtype StakePoolTicker = StakePoolTicker { }
- data StakeKeyCertificate
- data PoolMetadataGCStatus
-
data
SortOrder
- = Ascending
- | Descending
-
data
Range
a =
Range
{
- inclusiveLowerBound :: Maybe a
- inclusiveUpperBound :: Maybe a
- data RangeBound a
- wholeRange :: Range a
- isAfterRange :: Ord a => a -> Range a -> Bool
- isBeforeRange :: Ord a => a -> Range a -> Bool
- isSubrangeOf :: Ord a => Range a -> Range a -> Bool
- isWithinRange :: Ord a => a -> Range a -> Bool
- mapRangeLowerBound :: (a -> a) -> Range a -> Range a
- mapRangeUpperBound :: (a -> a) -> Range a -> Range a
- rangeIsFinite :: Range a -> Bool
- rangeIsSingleton :: Eq a => Range a -> Bool
- rangeIsValid :: Ord a => Range a -> Bool
- rangeHasLowerBound :: Range a -> Bool
- rangeHasUpperBound :: Range a -> Bool
- rangeLowerBound :: Range a -> RangeBound a
- rangeUpperBound :: Range a -> RangeBound a
- newtype Signature (what :: Type ) = Signature { }
- data Settings = Settings { }
- data SmashServer
- $sel:unSmashServer:SmashServer :: SmashServer -> URI
- data PoolMetadataSource
- defaultSettings :: Settings
- unsafeToPMS :: URI -> PoolMetadataSource
- newtype TokenMetadataServer = TokenMetadataServer { }
- data InternalState = InternalState { }
- defaultInternalState :: InternalState
Block
A block on the chain, as the wallet sees it.
Block | |
|
Instances
Eq Block Source # | |
Ord Block Source # | |
Defined in Cardano.Wallet.Primitive.Types |
|
Show Block Source # | |
Generic Block Source # | |
NFData Block Source # | |
Defined in Cardano.Wallet.Primitive.Types |
|
Buildable Block Source # | |
type Rep Block Source # | |
Defined in Cardano.Wallet.Primitive.Types
type
Rep
Block
=
D1
('
MetaData
"Block" "Cardano.Wallet.Primitive.Types" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" '
False
) (
C1
('
MetaCons
"Block" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"header") '
NoSourceUnpackedness
'
SourceStrict
'
DecidedStrict
) (
Rec0
BlockHeader
)
:*:
(
S1
('
MetaSel
('
Just
"transactions") '
NoSourceUnpackedness
'
SourceStrict
'
DecidedStrict
) (
Rec0
[
Tx
])
:*:
S1
('
MetaSel
('
Just
"delegations") '
NoSourceUnpackedness
'
SourceStrict
'
DecidedStrict
) (
Rec0
[
DelegationCertificate
]))))
|
data BlockHeader Source #
BlockHeader | |
|
Instances
isGenesisBlockHeader :: BlockHeader -> Bool Source #
Check whether a block with a given
BlockHeader
is the genesis block.
data ChainPoint Source #
A point on the blockchain
is either the genesis block, or a block with a hash that was
created at a particular
SlotNo
.
TODO:
-
This type is essentially a copy of the
ChainPoint
type. We want to import it from there when overhauling our types. -
That said, using
WithOrigin
would not be bad. -
BlockHeader
is also a good type for rerencing points on the chain, but it's less compatible with the types in ouroboros-network.
ChainPointAtGenesis | |
ChainPoint ! SlotNo !( Hash "BlockHeader") |
Instances
compareSlot :: ChainPoint -> ChainPoint -> Ordering Source #
Compare the slot numbers of two
ChainPoint
s,
but where the
ChainPointAtGenesis
comes before all other slot numbers.
chainPointFromBlockHeader :: BlockHeader -> ChainPoint Source #
Convert a
BlockHeader
into a
ChainPoint
.
type Slot = WithOrigin SlotNo Source #
A point in (slot) time, which is either genesis (
Origin
)
or has a slot number (
At
).
In contrast to
ChainPoint
, the type
Slot
does not refer
to a point on an actual chain with valid block hashes,
but merely to a timeslot which can hold a single block.
This implies:
data WithOrigin t Source #
Instances
toSlot :: ChainPoint -> Slot Source #
Retrieve the slot of a
ChainPoint
.
Delegation and stake pools
data CertificatePublicationTime Source #
Represents an abstract notion of a certificate publication time.
Certificates published at later times take precedence over certificates published at earlier times.
CertificatePublicationTime | |
|
Instances
data DelegationCertificate Source #
Represent a delegation certificate.
Instances
data PoolLifeCycleStatus Source #
Indicates the current life cycle status of a pool.
PoolNotRegistered |
Indicates that a pool is not registered. |
PoolRegistered PoolRegistrationCertificate |
Indicates that a pool is registered BUT NOT marked for retirement. Records the latest registration certificate. |
PoolRegisteredAndRetired PoolRegistrationCertificate PoolRetirementCertificate |
Indicates that a pool is registered AND ALSO marked for retirement. Records the latest registration and retirement certificates. |
Instances
Eq PoolLifeCycleStatus Source # | |
Defined in Cardano.Wallet.Primitive.Types (==) :: PoolLifeCycleStatus -> PoolLifeCycleStatus -> Bool Source # (/=) :: PoolLifeCycleStatus -> PoolLifeCycleStatus -> Bool Source # |
|
Ord PoolLifeCycleStatus Source # | |
Defined in Cardano.Wallet.Primitive.Types compare :: PoolLifeCycleStatus -> PoolLifeCycleStatus -> Ordering Source # (<) :: PoolLifeCycleStatus -> PoolLifeCycleStatus -> Bool Source # (<=) :: PoolLifeCycleStatus -> PoolLifeCycleStatus -> Bool Source # (>) :: PoolLifeCycleStatus -> PoolLifeCycleStatus -> Bool Source # (>=) :: PoolLifeCycleStatus -> PoolLifeCycleStatus -> Bool Source # max :: PoolLifeCycleStatus -> PoolLifeCycleStatus -> PoolLifeCycleStatus Source # min :: PoolLifeCycleStatus -> PoolLifeCycleStatus -> PoolLifeCycleStatus Source # |
|
Show PoolLifeCycleStatus Source # | |
Defined in Cardano.Wallet.Primitive.Types |
data PoolRegistrationCertificate Source #
Pool ownership data from the stake pool registration certificate.
PoolRegistrationCertificate | |
|
Instances
data PoolRetirementCertificate Source #
PoolRetirementCertificate | |
|
Instances
data PoolCertificate Source #
Sum-type of pool registration- and retirement- certificates. Mirrors the
PoolCert
type in cardano-ledger-specs.
Instances
data NonWalletCertificate Source #
Instances
data Certificate Source #
CertificateOfDelegation DelegationCertificate | |
CertificateOfPool PoolCertificate | |
CertificateOther NonWalletCertificate |
Instances
Network Parameters
data NetworkParameters Source #
Records the complete set of parameters currently in use by the network that are relevant to the wallet.
Instances
data GenesisParameters Source #
Parameters defined by the genesis block .
At present, these values cannot be changed through the update system.
They can only be changed through a soft or hard fork.
GenesisParameters | |
|
Instances
data SlottingParameters Source #
SlottingParameters | |
|
Instances
data ProtocolParameters Source #
Protocol parameters that can be changed through the update system.
ProtocolParameters | |
|
Instances
data TxParameters Source #
Parameters that relate to the construction of transactions .
TxParameters | |
|
Instances
newtype TokenBundleMaxSize Source #
The maximum size of a serialized
TokenBundle
(
_maxValSize
in the Alonzo
ledger)
Instances
Represents
info
about the starting epoch/time of all possible eras.
Field values can be either: - Just pastEpochBoundary - the network forked to this era in the past. - Just futureEpochBoundary - the hard-fork to this era is confirmed, but it hasn't yet occured. - Nothing - the hard-fork to this era is not yet confirmed.
Note: this type is not a practical way to tell what the current era is.
It is expected that there is an order,
byron, shelley, allegra, mary
, by
which the
Maybe
fields are filled in.
It might be cumbersome to work with this type.
But
we don't need to. A
product of
Maybe
is both what we can query from the node, and
what we need to provide in the wallet API.
Instances
emptyEraInfo :: EraInfo info Source #
newtype ActiveSlotCoefficient Source #
Instances
data DecentralizationLevel Source #
Indicates the current level of decentralization in the network.
According to the Design Specification for Delegation and Incentives in Cardano, the decentralization parameter d is a value in the range '[0, 1]', where:
- d = '1' indicates that the network is completely federalized .
- d = '0' indicates that the network is completely decentralized .
However, in Cardano Wallet, we represent the decentralization level as a percentage, where:
- ' 0 %' indicates that the network is completely federalized .
- '100 %' indicates that the network is completely decentralized .
Instances
fromFederationPercentage :: Percentage -> DecentralizationLevel Source #
Percentage of federated nodes. Equal to the "decentralization parameter" d from the ledger specification.
newtype EpochLength Source #
Number of slots in a single epoch
Instances
Instances
unsafeEpochNo :: HasCallStack => Word32 -> EpochNo Source #
Convert the specified value into an
EpochNo
, or fail if the value is
too large.
isValidEpochNo :: EpochNo -> Bool Source #
A linear equation of a free variable
x
. Represents the
x -> a + b*x
function where
x
can be either a transaction size in bytes or
a number of inputs + outputs.
Instances
Eq FeePolicy Source # | |
Show FeePolicy Source # | |
Generic FeePolicy Source # | |
NFData FeePolicy Source # | |
Defined in Cardano.Wallet.Primitive.Types |
|
PersistFieldSql FeePolicy Source # | |
PersistField FeePolicy Source # | |
Defined in Cardano.Wallet.DB.Sqlite.Types |
|
ToText FeePolicy Source # | |
FromText FeePolicy Source # | |
Defined in Cardano.Wallet.Primitive.Types |
|
SymbolToField "protocolParametersFeePolicy" ProtocolParameters FeePolicy Source # | |
type Rep FeePolicy Source # | |
Defined in Cardano.Wallet.Primitive.Types
type
Rep
FeePolicy
=
D1
('
MetaData
"FeePolicy" "Cardano.Wallet.Primitive.Types" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" '
True
) (
C1
('
MetaCons
"LinearFee" '
PrefixI
'
False
) (
S1
('
MetaSel
('
Nothing
::
Maybe
Symbol
) '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
(
LinearFunction
Double
))))
|
data LinearFunction a Source #
Instances
A slot identifier is the combination of an epoch and slot.
SlotId | |
|
Instances
Eq SlotId Source # | |
Ord SlotId Source # | |
Read SlotId Source # | |
Show SlotId Source # | |
Generic SlotId Source # | |
NFData SlotId Source # | |
Defined in Cardano.Wallet.Primitive.Types |
|
Buildable SlotId Source # | |
type Rep SlotId Source # | |
Defined in Cardano.Wallet.Primitive.Types
type
Rep
SlotId
=
D1
('
MetaData
"SlotId" "Cardano.Wallet.Primitive.Types" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" '
False
) (
C1
('
MetaCons
"SlotId" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"epochNumber") '
NoSourceUnpackedness
'
SourceStrict
'
DecidedStrict
) (
Rec0
EpochNo
)
:*:
S1
('
MetaSel
('
Just
"slotNumber") '
NoSourceUnpackedness
'
SourceStrict
'
DecidedStrict
) (
Rec0
SlotInEpoch
)))
|
The 0-based index for the Ourboros time slot.
Instances
newtype SlotLength Source #
Duration of a single slot.
Instances
newtype SlotInEpoch Source #
Instances
Blockchain start time
Instances
Eq StartTime Source # | |
Ord StartTime Source # | |
Defined in Cardano.Wallet.Primitive.Types |
|
Show StartTime Source # | |
Generic StartTime Source # | |
NFData StartTime Source # | |
Defined in Cardano.Wallet.Primitive.Types |
|
ToJSON ( ApiT StartTime ) Source # | |
FromJSON ( ApiT StartTime ) Source # | |
type Rep StartTime Source # | |
Defined in Cardano.Wallet.Primitive.Types
type
Rep
StartTime
=
D1
('
MetaData
"StartTime" "Cardano.Wallet.Primitive.Types" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" '
True
) (
C1
('
MetaCons
"StartTime" '
PrefixI
'
False
) (
S1
('
MetaSel
('
Nothing
::
Maybe
Symbol
) '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
UTCTime
)))
|
stabilityWindowByron :: SlottingParameters -> Quantity "block" Word64 Source #
In Byron, this stability window is equal to 2k slots, where _k_ is the
$sel:getSecurityParameter:SlottingParameters
stabilityWindowShelley :: SlottingParameters -> Quantity "block" Word64 Source #
In Shelley, this stability window is equal to _3k/f_ slots where _k_ is the
$sel:getSecurityParameter:SlottingParameters
and _f_ is the
ActiveSlotCoefficient
.
data ExecutionUnits Source #
ExecutionUnits | |
|
Instances
data ExecutionUnitPrices Source #
Instances
Wallet Metadata
data WalletMetadata Source #
Additional information about a wallet that can't simply be derived from
the blockchain like
Wallet s
is.
Whereas
Wallet s
in
Primitive
can be updated using
applyBlock
,
WalletMetadata
can not*.
-
) Except for possibly
$sel:status:WalletDelegationNext
and$sel:delegation:WalletMetadata
...
WalletMetadata | |
|
Instances
Instances
newtype WalletName Source #
Length-restricted name of a wallet
Instances
walletNameMinLength :: Int Source #
Calling 'fromText @WalletName' on shorter string will fail.
walletNameMaxLength :: Int Source #
Calling 'fromText @WalletName' on a longer string will fail.
data WalletDelegation Source #
WalletDelegation | |
|
Instances
data WalletDelegationStatus Source #
Instances
data WalletDelegationNext Source #
Instances
class IsDelegatingTo a where Source #
Instances
IsDelegatingTo WalletDelegation Source # | |
Defined in Cardano.Wallet.Primitive.Types isDelegatingTo :: ( PoolId -> Bool ) -> WalletDelegation -> Bool Source # |
|
IsDelegatingTo WalletDelegationNext Source # | |
Defined in Cardano.Wallet.Primitive.Types isDelegatingTo :: ( PoolId -> Bool ) -> WalletDelegationNext -> Bool Source # |
|
IsDelegatingTo WalletDelegationStatus Source # | |
Defined in Cardano.Wallet.Primitive.Types isDelegatingTo :: ( PoolId -> Bool ) -> WalletDelegationStatus -> Bool Source # |
Stake Pools
data StakePoolsSummary Source #
Instances
Eq StakePoolsSummary Source # | |
Defined in Cardano.Wallet.Primitive.Types (==) :: StakePoolsSummary -> StakePoolsSummary -> Bool Source # (/=) :: StakePoolsSummary -> StakePoolsSummary -> Bool Source # |
|
Show StakePoolsSummary Source # | |
Defined in Cardano.Wallet.Primitive.Types |
|
Buildable StakePoolsSummary Source # | |
Defined in Cardano.Wallet.Primitive.Types build :: StakePoolsSummary -> Builder Source # |
Identifies a stake pool.
For Jörmungandr a
PoolId
is the blake2b-256 hash of the stake pool
registration certificate.
Instances
A stake pool owner, which is a public key encoded in bech32 with prefix ed25519_pk.
Instances
poolIdBytesLength :: [ Int ] Source #
decodePoolIdBech32 :: Text -> Either TextDecodingError PoolId Source #
Decode a Bech32 encoded
PoolId
.
data StakePoolMetadata Source #
Information about a stake pool.
The metadata information is not used directly by cardano-wallet, but rather passed straight through to API consumers.
StakePoolMetadata | |
|
Instances
newtype StakePoolMetadataHash Source #
A newtype to wrap metadata hash.
NOTE: not using the
Hash
type as this newtype is primarily for database
interop which doesn't quite like DataKinds.
Instances
newtype StakePoolMetadataUrl Source #
A newtype to wrap metadata Url, mostly needed for database lookups and signature clarity.
Instances
newtype StakePoolTicker Source #
Very short name for a stake pool.
Instances
data StakeKeyCertificate Source #
Instances
data PoolMetadataGCStatus Source #
Instances
Querying
Represents a sort order, applicable to the results returned by a query.
Ascending |
Sort in ascending order. |
Descending |
Sort in descending order. |
Instances
Bounded SortOrder Source # | |
Enum SortOrder Source # | |
Defined in Cardano.Wallet.Primitive.Types succ :: SortOrder -> SortOrder Source # pred :: SortOrder -> SortOrder Source # toEnum :: Int -> SortOrder Source # fromEnum :: SortOrder -> Int Source # enumFrom :: SortOrder -> [ SortOrder ] Source # enumFromThen :: SortOrder -> SortOrder -> [ SortOrder ] Source # enumFromTo :: SortOrder -> SortOrder -> [ SortOrder ] Source # enumFromThenTo :: SortOrder -> SortOrder -> SortOrder -> [ SortOrder ] Source # |
|
Eq SortOrder Source # | |
Show SortOrder Source # | |
Generic SortOrder Source # | |
ToText SortOrder Source # | |
FromText SortOrder Source # | |
Defined in Cardano.Wallet.Primitive.Types |
|
type Rep SortOrder Source # | |
Defined in Cardano.Wallet.Primitive.Types |
Ranges
Represents a range of values.
A range is defined by two optional bounds:
- an inclusive lower bound
- an inclusive upper bound
There are four cases:
Value | Range Represented | Membership Function |
---|---|---|
|
[ x, y ]
|
\p -> p >= x && p <= y
|
|
[ x, ∞ )
|
\p -> p >= x
|
|
(−∞, y ]
|
\p -> p <= y
|
|
(−∞, ∞ )
|
\p -> True
|
Range | |
|
data RangeBound a Source #
Represents a range boundary.
Instances
Eq a => Eq ( RangeBound a) Source # | |
Defined in Cardano.Wallet.Primitive.Types (==) :: RangeBound a -> RangeBound a -> Bool Source # (/=) :: RangeBound a -> RangeBound a -> Bool Source # |
|
Ord a => Ord ( RangeBound a) Source # | |
Defined in Cardano.Wallet.Primitive.Types compare :: RangeBound a -> RangeBound a -> Ordering Source # (<) :: RangeBound a -> RangeBound a -> Bool Source # (<=) :: RangeBound a -> RangeBound a -> Bool Source # (>) :: RangeBound a -> RangeBound a -> Bool Source # (>=) :: RangeBound a -> RangeBound a -> Bool Source # max :: RangeBound a -> RangeBound a -> RangeBound a Source # min :: RangeBound a -> RangeBound a -> RangeBound a Source # |
wholeRange :: Range a Source #
The range that includes everything.
isAfterRange :: Ord a => a -> Range a -> Bool Source #
Returns
True
if (and only if) the given range has an upper bound and the
specified value is greater than the upper bound.
isBeforeRange :: Ord a => a -> Range a -> Bool Source #
Returns
True
if (and only if) the given range has a lower bound and the
specified value is smaller than the lower bound.
isSubrangeOf :: Ord a => Range a -> Range a -> Bool Source #
Returns
True
if (and only if) the first given range is a subrange of the
second given range.
isWithinRange :: Ord a => a -> Range a -> Bool Source #
Returns
True
if (and only if) the given value is not smaller than the
lower bound (if present) of the given range and is not greater than the
upper bound (if present) of the given range.
mapRangeLowerBound :: (a -> a) -> Range a -> Range a Source #
Apply a function to the lower bound of a range.
mapRangeUpperBound :: (a -> a) -> Range a -> Range a Source #
Apply a function to the upper bound of a range.
rangeIsFinite :: Range a -> Bool Source #
Returns
True
if (and only if) the given range has both a lower and upper
bound.
rangeIsSingleton :: Eq a => Range a -> Bool Source #
Returns
True
if (and only if) the range covers exactly one value.
rangeIsValid :: Ord a => Range a -> Bool Source #
Returns
True
if (and only if) the lower bound of a range is not greater
than its upper bound.
rangeHasLowerBound :: Range a -> Bool Source #
Returns
True
if (and only if) the given range has a lower bound.
rangeHasUpperBound :: Range a -> Bool Source #
Returns
True
if (and only if) the given range has an upper bound.
rangeLowerBound :: Range a -> RangeBound a Source #
Get the lower bound of a
Range
.
rangeUpperBound :: Range a -> RangeBound a Source #
Get the upper bound of a
Range
.
Polymorphic
newtype Signature (what :: Type ) Source #
A newtype to wrap raw bytestring representing signed data, captured with a phantom type.
Instances
Eq ( Signature what) Source # | |
Show ( Signature what) Source # | |
Generic ( Signature what) Source # | |
ByteArrayAccess ( Signature what) Source # | |
type Rep ( Signature what) Source # | |
Defined in Cardano.Wallet.Primitive.Types
type
Rep
(
Signature
what) =
D1
('
MetaData
"Signature" "Cardano.Wallet.Primitive.Types" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" '
True
) (
C1
('
MetaCons
"Signature" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"getSignature") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
ByteString
)))
|
Settings
Wallet application settings. These are stored at runtime and potentially mutable.
Instances
Eq Settings Source # | |
Show Settings Source # | |
Generic Settings Source # | |
ToJSON ( ApiT Settings ) Source # | |
FromJSON ( ApiT Settings ) Source # | |
type Rep Settings Source # | |
Defined in Cardano.Wallet.Primitive.Types
type
Rep
Settings
=
D1
('
MetaData
"Settings" "Cardano.Wallet.Primitive.Types" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" '
False
) (
C1
('
MetaCons
"Settings" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"poolMetadataSource") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
PoolMetadataSource
)))
|
data SmashServer Source #
A SMASH server is either an absolute http or https url.
Don't export SmashServer constructor, use
fromText
instance instead.
Instances
data PoolMetadataSource Source #
Source of Stake Pool Metadata aggregation.
Instances
unsafeToPMS :: URI -> PoolMetadataSource Source #
newtype TokenMetadataServer Source #
Instances
InternalState
data InternalState Source #
Various internal states of the pool DB that need to survive wallet restarts. These aren't exposed settings.
Instances
Eq InternalState Source # | |
Defined in Cardano.Wallet.Primitive.Types (==) :: InternalState -> InternalState -> Bool Source # (/=) :: InternalState -> InternalState -> Bool Source # |
|
Show InternalState Source # | |
Defined in Cardano.Wallet.Primitive.Types |
|
Generic InternalState Source # | |
Defined in Cardano.Wallet.Primitive.Types from :: InternalState -> Rep InternalState x Source # to :: Rep InternalState x -> InternalState Source # |
|
type Rep InternalState Source # | |
Defined in Cardano.Wallet.Primitive.Types
type
Rep
InternalState
=
D1
('
MetaData
"InternalState" "Cardano.Wallet.Primitive.Types" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" '
False
) (
C1
('
MetaCons
"InternalState" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"lastMetadataGC") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
(
Maybe
POSIXTime
))))
|