cardano-wallet-core-2022.7.1: The Wallet Backend for a Cardano node.
Copyright © 2018-2020 IOHK
License Apache-2.0
Safe Haskell None
Language Haskell2010

Cardano.Wallet

Description

Provides wallet layer functions that are used by API layer. Uses both Cardano.Wallet.DB and Cardano.Wallet.Network to realize its role as being intermediary between the three.

Functions of the wallet layer are often parameterized with variables following the convention below:

  • s : A s tate used to keep track of known addresses. Typically, possible values for this parameter are described in AddressDiscovery sub-modules. For instance SeqState or Rnd State .
  • k : A k ey derivation scheme intrinsically connected to the underlying discovery state s . This describes how the hierarchical structure of a wallet is defined as well as the relationship between secret keys and public addresses.
Synopsis

Development

Naming Conventions

Components inside a particular context ctx can be called via dedicated lenses (see Cardano.Wallet#Capabilities). These components are extracted from the context in a where clause according to the following naming convention:

  • db = ctx ^. dbLayer @s \ k@ for the DBLayer .
  • tr = ctx ^. logger for the Logger.
  • nw = ctx ^. networkLayer for the NetworkLayer .
  • tl = ctx ^. transactionLayer \ k@ for the TransactionLayer .
  • re = ctx ^. workerRegistry for the WorkerRegistry .

TroubleShooting

• Overlapping instances for HasType (DBLayer IO s k) ctx
    arising from a use of ‘myFunction’
  Matching instances:

Occurs when a particular function is missing a top-level constraint (because it uses another function that demands such constraint). Here, myFunction needs its surrounding context ctx to have a DBLayer but the constraint is missing from its host function.

Fix : Add " HasDBLayer s k " as a class-constraint to the surrounding function.

• Overlapping instances for HasType (DBLayer IO s t0 k0) ctx
    arising from a use of ‘myFunction’
  Matching givens (or their superclasses):

Occurs when a function is called in a context where type-level parameters can be inferred. Here, myFunction is called but it is unclear whether the parameter t0 and k0 of its context are the same as the ones from the function at the call-site.

Fix : Add type-applications at the call-site " myFunction @ctx @s \ k@"

WalletLayer

data WalletLayer m s (k :: Depth -> Type -> Type ) Source #

Capabilities

Each function in the wallet layer is defined in function of a non-specialized context ctx . That context may require some extra capabilities via class-constraints in the function signature. Capabilities are expressed in the form of a " HasXXX " class-constraints sometimes with extra type parameters.

For example:

listWallets
    :: forall ctx s k.
        ( HasDBLayer s k ctx
        )
    => ctx
    -> IO [WalletId]

Requires that the given context has an access to a database layer DBLayer parameterized over the wallet state, a network target and a key derivation scheme. Components are pulled from the context generically (i.e. the concrete ctx must derive Generic ) using their associated type. The concrete ctx is therefore expected to be a product-type of all the necessary components.

One can build an interface using only a subset of the wallet layer capabilities and functions, for instance, something to fiddle with wallets and their metadata does not require any networking layer.

dbLayer :: forall m s k ctx. HasDBLayer m s k ctx => Lens' ctx ( DBLayer m s k) Source #

logger :: forall m msg ctx. HasLogger m msg ctx => Lens' ctx ( Tracer m msg) Source #

type HasNetworkLayer m = HasType ( NetworkLayer m Block ) Source #

This module is only interested in one block-, and tx-type. This constraint hides that choice, for some ease of use.

Interface

Wallet

createIcarusWallet :: forall ctx s k n. ( HasGenesisData ctx, HasDBLayer IO s k ctx, PaymentAddress n k, k ~ IcarusKey , s ~ SeqState n k, Typeable n) => ctx -> WalletId -> WalletName -> (k ' RootK XPrv , Passphrase "encryption") -> ExceptT ErrWalletAlreadyExists IO WalletId Source #

Initialise and store a new legacy Icarus wallet. These wallets are intrinsically sequential, but, in the incentivized testnet, we only have access to the a snapshot of the MainNet.

To work-around this, we scan the genesis block with an arbitrary big gap and resort to a default gap afterwards.

attachPrivateKeyFromPwdHash :: forall ctx s k. HasDBLayer IO s k ctx => ctx -> WalletId -> (k ' RootK XPrv , PassphraseHash ) -> ExceptT ErrNoSuchWallet IO () Source #

The hash here is the output of Scrypt function with the following parameters: - logN = 14 - r = 8 - p = 1 - bytesNumber = 64

readWallet :: forall ctx s k. HasDBLayer IO s k ctx => ctx -> WalletId -> ExceptT ErrNoSuchWallet IO ( Wallet s, WalletMetadata , Set Tx ) Source #

Retrieve the wallet state for the wallet with the given ID.

deleteWallet :: forall ctx s k. HasDBLayer IO s k ctx => ctx -> WalletId -> ExceptT ErrNoSuchWallet IO () Source #

Remove an existing wallet. Note that there's no particular work to be done regarding the restoration worker as it will simply terminate on the next tick when noticing that the corresponding wallet is gone.

restoreWallet :: forall ctx s k. ( HasNetworkLayer IO ctx, HasDBLayer IO s k ctx, HasLogger IO WalletWorkerLog ctx, IsOurs s Address , IsOurs s RewardAccount , AddressBookIso s, MaybeLight s) => ctx -> WalletId -> ExceptT ErrNoSuchWallet IO () Source #

Restore a wallet from its current tip.

After the wallet has been restored, this action will continue to fetch newly created blocks and apply them, or roll back to a previous point whenever the chain switches.

updateWallet :: forall ctx s k. HasDBLayer IO s k ctx => ctx -> WalletId -> ( WalletMetadata -> WalletMetadata ) -> ExceptT ErrNoSuchWallet IO () Source #

Update a wallet's metadata with the given update function.

updateWalletPassphraseWithOldPassphrase :: forall ctx s k. ( HasDBLayer IO s k ctx, WalletKey k) => ctx -> WalletId -> ( Passphrase "user", Passphrase "user") -> ExceptT ErrUpdatePassphrase IO () Source #

Change a wallet's passphrase to the given passphrase.

fetchRewardBalance :: forall ctx s k. HasDBLayer IO s k ctx => ctx -> WalletId -> IO Coin Source #

Fetch the cached reward balance of a given wallet from the database.

rollbackBlocks :: forall ctx s k. HasDBLayer IO s k ctx => ctx -> WalletId -> Slot -> ExceptT ErrNoSuchWallet IO ChainPoint Source #

Rewind the UTxO snapshots, transaction history and other information to a the earliest point in the past that is before or is the point of rollback.

checkWalletIntegrity :: forall ctx s k. HasDBLayer IO s k ctx => ctx -> WalletId -> GenesisParameters -> ExceptT ErrCheckWalletIntegrity IO () Source #

Check whether a wallet is in good shape when restarting a worker.

readNextWithdrawal :: forall ctx k. ( HasTransactionLayer k ctx, HasNetworkLayer IO ctx) => ctx -> AnyCardanoEra -> Coin -> IO Coin Source #

Read the current withdrawal capacity of a wallet. Note that, this simply returns 0 if:

a) There's no reward account for this type of wallet. b) The current reward value is too small to be considered (adding it would cost more than its value).

queryRewardBalance :: forall ctx. HasNetworkLayer IO ctx => ctx -> RewardAccount -> ExceptT ErrFetchRewards IO Coin Source #

Query the node for the reward balance of a given wallet.

Rather than force all callers of readWallet to wait for fetching the account balance (via the NetworkLayer ), we expose this function for it.

data ErrReadRewardAccount Source #

Instances

Instances details
Eq ErrReadRewardAccount Source #
Instance details

Defined in Cardano.Wallet

Show ErrReadRewardAccount Source #
Instance details

Defined in Cardano.Wallet

Generic ErrReadRewardAccount Source #
Instance details

Defined in Cardano.Wallet

IsServerError ErrReadRewardAccount Source #
Instance details

Defined in Cardano.Wallet.Api.Server

type Rep ErrReadRewardAccount Source #
Instance details

Defined in Cardano.Wallet

type Rep ErrReadRewardAccount = D1 (' MetaData "ErrReadRewardAccount" "Cardano.Wallet" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" ' False ) ( C1 (' MetaCons "ErrReadRewardAccountNotAShelleyWallet" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "ErrReadRewardAccountNoSuchWallet" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ErrNoSuchWallet )))

data ErrReadPolicyPublicKey Source #

Instances

Instances details
Eq ErrReadPolicyPublicKey Source #
Instance details

Defined in Cardano.Wallet

Show ErrReadPolicyPublicKey Source #
Instance details

Defined in Cardano.Wallet

Generic ErrReadPolicyPublicKey Source #
Instance details

Defined in Cardano.Wallet

IsServerError ErrReadPolicyPublicKey Source #
Instance details

Defined in Cardano.Wallet.Api.Server

type Rep ErrReadPolicyPublicKey Source #
Instance details

Defined in Cardano.Wallet

type Rep ErrReadPolicyPublicKey = D1 (' MetaData "ErrReadPolicyPublicKey" "Cardano.Wallet" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" ' False ) ( C1 (' MetaCons "ErrReadPolicyPublicKeyNotAShelleyWallet" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: ( C1 (' MetaCons "ErrReadPolicyPublicKeyNoSuchWallet" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ErrNoSuchWallet )) :+: C1 (' MetaCons "ErrReadPolicyPublicKeyAbsent" ' PrefixI ' False ) ( U1 :: Type -> Type )))

data ErrWritePolicyPublicKey Source #

Instances

Instances details
Eq ErrWritePolicyPublicKey Source #
Instance details

Defined in Cardano.Wallet

Show ErrWritePolicyPublicKey Source #
Instance details

Defined in Cardano.Wallet

Generic ErrWritePolicyPublicKey Source #
Instance details

Defined in Cardano.Wallet

IsServerError ErrWritePolicyPublicKey Source #
Instance details

Defined in Cardano.Wallet.Api.Server

type Rep ErrWritePolicyPublicKey Source #
Instance details

Defined in Cardano.Wallet

Shared Wallet

Address

listAddresses Source #

Arguments

:: forall ctx s k. ( HasDBLayer IO s k ctx, CompareDiscovery s, KnownAddresses s)
=> ctx
-> WalletId
-> (s -> Address -> Maybe Address )

A function to normalize address, so that delegated addresses non-delegation addresses found in the transaction history are shown with their delegation settings. Use Just for wallet without delegation settings.

-> ExceptT ErrNoSuchWallet IO [( Address , AddressState , NonEmpty DerivationIndex )]

List all addresses of a wallet with their metadata. Addresses are ordered from the most-recently-discovered to the oldest known.

data ErrCreateRandomAddress Source #

Instances

Instances details
Eq ErrCreateRandomAddress Source #
Instance details

Defined in Cardano.Wallet

Show ErrCreateRandomAddress Source #
Instance details

Defined in Cardano.Wallet

Generic ErrCreateRandomAddress Source #
Instance details

Defined in Cardano.Wallet

IsServerError ErrCreateRandomAddress Source #
Instance details

Defined in Cardano.Wallet.Api.Server

type Rep ErrCreateRandomAddress Source #
Instance details

Defined in Cardano.Wallet

data ErrImportRandomAddress Source #

Instances

Instances details
Eq ErrImportRandomAddress Source #
Instance details

Defined in Cardano.Wallet

Show ErrImportRandomAddress Source #
Instance details

Defined in Cardano.Wallet

Generic ErrImportRandomAddress Source #
Instance details

Defined in Cardano.Wallet

IsServerError ErrImportRandomAddress Source #
Instance details

Defined in Cardano.Wallet.Api.Server

type Rep ErrImportRandomAddress Source #
Instance details

Defined in Cardano.Wallet

Payment

getTxExpiry Source #

Arguments

:: TimeInterpreter ( ExceptT PastHorizonException IO )

Context for time to slot calculation.

-> Maybe NominalDiffTime

Time to live (TTL) in seconds from now.

-> IO SlotNo

Calculate the transaction expiry slot, given a TimeInterpreter , and an optional TTL in seconds.

If no TTL is provided, a default of 2 hours is used (note: there is no particular reason why we chose that duration).

data SelectAssetsParams s result Source #

Parameters for the selectAssets function.

Instances

Instances details
Generic ( SelectAssetsParams s result) Source #
Instance details

Defined in Cardano.Wallet

Associated Types

type Rep ( SelectAssetsParams s result) :: Type -> Type Source #

type Rep ( SelectAssetsParams s result) Source #
Instance details

Defined in Cardano.Wallet

selectAssets :: forall ctx m s k result. ( BoundedAddressLength k, HasTransactionLayer k ctx, HasLogger m WalletWorkerLog ctx, MonadRandom m) => ctx -> AnyCardanoEra -> ProtocolParameters -> SelectAssetsParams s result -> (s -> Selection -> result) -> ExceptT ErrSelectAssets m result Source #

Selects assets from a wallet.

This function has the following responsibilities:

  • selecting inputs from the UTxO set to pay for user-specified outputs;
  • selecting inputs from the UTxO set to pay for collateral;
  • producing change outputs to return excess value to the wallet;
  • balancing a selection to pay for the transaction fee.

When selecting inputs to pay for user-specified outputs, inputs are selected randomly.

By default, the seed used for random selection is derived automatically, from the given MonadRandom context.

However, if a concrete value is specified for the optional $sel:randomSeed:SelectAssetsParams parameter, then that value will be used instead as the seed for random selection.

readWalletUTxOIndex :: forall ctx s k. HasDBLayer IO s k ctx => ctx -> WalletId -> ExceptT ErrNoSuchWallet IO ( UTxOIndex WalletUTxO , Wallet s, Set Tx ) Source #

Read a wallet checkpoint and index its UTxO, for selectAssets and selectAssetsNoOutputs .

assignChangeAddresses :: forall s. GenChange s => ArgGenChange s -> Selection -> s -> ( SelectionOf TxOut , s) Source #

Augments the given outputs with new outputs. These new outputs correspond to change outputs to which new addresses have been assigned. This updates the wallet state as it needs to keep track of new pending change addresses.

buildAndSignTransaction Source #

Arguments

:: forall ctx s k. ( HasTransactionLayer k ctx, HasDBLayer IO s k ctx, HasNetworkLayer IO ctx, IsOwned s k)
=> ctx
-> WalletId
-> AnyCardanoEra
-> ((k ' RootK XPrv , Passphrase "encryption") -> ( XPrv , Passphrase "encryption"))

Reward account derived from the root key (or somewhere else).

-> Passphrase "user"
-> TransactionCtx
-> SelectionOf TxOut
-> ExceptT ErrSignPayment IO ( Tx , TxMeta , UTCTime , SealedTx )

Produce witnesses and construct a transaction from a given selection.

Requires the encryption passphrase in order to decrypt the root private key. Note that this doesn't broadcast the transaction to the network. In order to do so, use submitTx .

signTransaction Source #

Arguments

:: forall k. ( WalletKey k, HardDerivation k, Bounded ( Index ( AddressIndexDerivationType k) ' AddressK ))
=> TransactionLayer k SealedTx

The way to interact with the wallet backend

-> AnyCardanoEra

Preferred latest era

-> ( Address -> Maybe (k ' AddressK XPrv , Passphrase "encryption"))

The wallets address-key lookup function

-> (k ' RootK XPrv , Passphrase "encryption")

The root key of the wallet

-> UTxO

The total UTxO set of the wallet (i.e. if pending transactions all applied).

-> SealedTx

The transaction to sign

-> SealedTx

The original transaction, with additional signatures added where necessary

data ErrSelectAssets Source #

Instances

Instances details
Eq ErrSelectAssets Source #
Instance details

Defined in Cardano.Wallet

Show ErrSelectAssets Source #
Instance details

Defined in Cardano.Wallet

Generic ErrSelectAssets Source #
Instance details

Defined in Cardano.Wallet

IsServerError ErrSelectAssets Source #
Instance details

Defined in Cardano.Wallet.Api.Server

type Rep ErrSelectAssets Source #
Instance details

Defined in Cardano.Wallet

newtype ErrUpdateSealedTx Source #

Constructors

ErrExistingKeyWitnesses Int

The SealedTx couldn't not be updated because the *n* existing key-witnesses would have been rendered invalid.

data ErrCannotJoin Source #

Migration

data ErrCreateMigrationPlan Source #

Instances

Instances details
Eq ErrCreateMigrationPlan Source #
Instance details

Defined in Cardano.Wallet

Show ErrCreateMigrationPlan Source #
Instance details

Defined in Cardano.Wallet

Generic ErrCreateMigrationPlan Source #
Instance details

Defined in Cardano.Wallet

IsServerError ErrCreateMigrationPlan Source #
Instance details

Defined in Cardano.Wallet.Api.Server

type Rep ErrCreateMigrationPlan Source #
Instance details

Defined in Cardano.Wallet

type Rep ErrCreateMigrationPlan = D1 (' MetaData "ErrCreateMigrationPlan" "Cardano.Wallet" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" ' False ) ( C1 (' MetaCons "ErrCreateMigrationPlanEmpty" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "ErrCreateMigrationPlanNoSuchWallet" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ErrNoSuchWallet )))

Delegation

data PoolRetirementEpochInfo Source #

Constructors

PoolRetirementEpochInfo

Fields

quitStakePool :: forall ctx s k. HasDBLayer IO s k ctx => ctx -> WalletId -> Withdrawal -> ExceptT ErrStakePoolDelegation IO DelegationAction Source #

Helper function to factor necessary logic for quitting a stake pool.

Fee Estimation

data FeeEstimation Source #

Result of a fee estimation process given a wallet and payment order.

Constructors

FeeEstimation

Fields

estimateFee :: forall m. Monad m => ExceptT ErrSelectAssets m Coin -> ExceptT ErrSelectAssets m FeeEstimation Source #

Estimate the transaction fee for a given coin selection algorithm by repeatedly running it (100 times) and collecting the results. In the returned FeeEstimation , the minimum fee is that which 90% of the sampled fees are greater than. The maximum fee is the highest fee observed in the samples.

calcMinimumDeposit :: forall ctx s k. ( HasDBLayer IO s k ctx, HasNetworkLayer IO ctx) => ctx -> WalletId -> ExceptT ErrSelectAssets IO Coin Source #

Calculate the minimum deposit necessary if a given wallet wanted to delegate to a pool. Said differently, this return either 0, or the value of the key deposit protocol parameters if the wallet has no registered stake key.

calcMinimumCoinValues :: forall ctx k f. ( HasTransactionLayer k ctx, HasNetworkLayer IO ctx, Applicative f) => ctx -> AnyCardanoEra -> f TxOut -> IO (f Coin ) Source #

Calculate the minimum coin values required for a bunch of specified outputs.

Transaction

forgetTx :: forall ctx s k. HasDBLayer IO s k ctx => ctx -> WalletId -> Hash "Tx" -> ExceptT ErrRemoveTx IO () Source #

Remove a pending or expired transaction from the transaction history. This happens at the request of the user. If the transaction is already on chain, or is missing from the transaction history, an error will be returned.

If a Pending transaction is removed, but later appears in a block, it will be added back to the transaction history.

listAssets :: forall s k ctx. ( HasDBLayer IO s k ctx, IsOurs s Address ) => ctx -> WalletId -> ExceptT ErrNoSuchWallet IO ( Set AssetId ) Source #

Extract assets associated with a given wallet from its transaction history.

getTransaction :: forall ctx s k. HasDBLayer IO s k ctx => ctx -> WalletId -> Hash "Tx" -> ExceptT ErrGetTransaction IO TransactionInfo Source #

Get transaction and metadata from history for a given wallet.

submitExternalTx :: forall ctx k. ( HasNetworkLayer IO ctx, HasTransactionLayer k ctx, HasLogger IO TxSubmitLog ctx) => ctx -> SealedTx -> ExceptT ErrPostTx IO Tx Source #

Broadcast an externally-signed transaction to the network.

NOTE: external transactions will not be added to the LocalTxSubmission pool, so the user must retry submission themselves.

submitTx :: forall ctx s k. ( HasNetworkLayer IO ctx, HasDBLayer IO s k ctx, HasLogger IO WalletWorkerLog ctx) => ctx -> WalletId -> ( Tx , TxMeta , SealedTx ) -> ExceptT ErrSubmitTx IO () Source #

Broadcast a (signed) transaction to the network.

data PartialTx era Source #

A PartialTx is an an unbalanced SealedTx along with the necessary information to balance it.

The $sel:inputs:PartialTx and $sel:redeemers:PartialTx must match the binary transaction contained in the sealedTx .

data LocalTxSubmissionConfig Source #

Constructors

LocalTxSubmissionConfig

Fields

defaultLocalTxSubmissionConfig :: LocalTxSubmissionConfig Source #

The current default is to resubmit any pending transaction about once every 10 blocks.

The default rate limit for checking the pending list is 1000ms.

runLocalTxSubmissionPool :: forall ctx s k m. ( MonadUnliftIO m, MonadMonotonicTime m, HasLogger IO WalletWorkerLog ctx, HasNetworkLayer m ctx, HasDBLayer m s k ctx) => LocalTxSubmissionConfig -> ctx -> WalletId -> m () Source #

Continuous process which monitors the chain tip and retries submission of pending transactions as the chain lengthens.

Regardless of the frequency of chain updates, this function won't re-query the database faster than the configured $sel:rateLimit:LocalTxSubmissionConfig .

This only exits if the network layer watchNodeTip function exits.

data ErrMkTransaction Source #

Instances

Instances details
Eq ErrMkTransaction Source #
Instance details

Defined in Cardano.Wallet.Transaction

Show ErrMkTransaction Source #
Instance details

Defined in Cardano.Wallet.Transaction

Generic ErrMkTransaction Source #
Instance details

Defined in Cardano.Wallet.Transaction

IsServerError ErrMkTransaction Source #
Instance details

Defined in Cardano.Wallet.Api.Server

type Rep ErrMkTransaction Source #
Instance details

Defined in Cardano.Wallet.Transaction

Root Key

withRootKey :: forall ctx s k e a. HasDBLayer IO s k ctx => ctx -> WalletId -> Passphrase "user" -> ( ErrWithRootKey -> e) -> (k ' RootK XPrv -> PassphraseScheme -> ExceptT e IO a) -> ExceptT e IO a Source #

Execute an action which requires holding a root XPrv.

withRootKey takes a callback function with two arguments:

  • The encrypted root private key itself
  • The underlying passphrase scheme (legacy or new)

Caller are then expected to use preparePassphrase with the given scheme in order to "prepare" the passphrase to be used by other function. This does nothing for the new encryption, but for the legacy encryption with Scrypt, passphrases needed to first be CBOR serialized and blake2b_256 hashed.

@@ withRootKey ctx s k ctx wid pwd OnError $ xprv scheme -> changePassphrase (preparePassphrase scheme pwd) newPwd xprv @@@

readAccountPublicKey :: forall ctx s k. ( HasDBLayer IO s k ctx, GetAccount s k) => ctx -> WalletId -> ExceptT ErrReadAccountPublicKey IO (k ' AccountK XPub ) Source #

Retrieve current public account key of a wallet.

signMetadataWith :: forall ctx s k n. ( HasDBLayer IO s k ctx, HardDerivation k, AddressIndexDerivationType k ~ ' Soft , WalletKey k, s ~ SeqState n k) => ctx -> WalletId -> Passphrase "user" -> ( Role , DerivationIndex ) -> TxMetadata -> ExceptT ErrSignMetadataWith IO ( Signature TxMetadata ) Source #

Sign an arbitrary transaction metadata object with a private key belonging to the wallet's account.

This is experimental, and will likely be replaced by a more robust to arbitrary message signing using COSE, or a subset of it.

data ErrWrongPassphrase Source #

Indicate a failure when checking for a given Passphrase match

Instances

Instances details
Eq ErrWrongPassphrase Source #
Instance details

Defined in Cardano.Wallet.Primitive.Passphrase.Types

Show ErrWrongPassphrase Source #
Instance details

Defined in Cardano.Wallet.Primitive.Passphrase.Types

Generic ErrWrongPassphrase Source #
Instance details

Defined in Cardano.Wallet.Primitive.Passphrase.Types

NFData ErrWrongPassphrase Source #
Instance details

Defined in Cardano.Wallet.Primitive.Passphrase.Types

type Rep ErrWrongPassphrase Source #
Instance details

Defined in Cardano.Wallet.Primitive.Passphrase.Types

type Rep ErrWrongPassphrase = D1 (' MetaData "ErrWrongPassphrase" "Cardano.Wallet.Primitive.Passphrase.Types" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" ' False ) ( C1 (' MetaCons "ErrWrongPassphrase" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "ErrPassphraseSchemeUnsupported" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 PassphraseScheme )))

Utilities

throttle :: ( MonadUnliftIO m, MonadMonotonicTime m) => DiffTime -> ( Time -> a -> m ()) -> m (a -> m ()) Source #

Return a function to run an action at most once every _interval_.

posAndNegFromCardanoValue :: Value -> ( TokenBundle , TokenBundle ) Source #

Convert a Value into a positive and negative component. Useful to convert the potentially negative balance of a partial tx into TokenBundles.

Logging