Provides a common interface for wallet operations:
newtype KeyWallet = KeyWallet
{ address :: NetworkId -> Aff Address
, selectCollateral ::
Coin
-> Int
-> UtxoMap
-> Aff (Maybe (Array TransactionUnspentOutput))
, signTx :: Transaction -> Aff TransactionWitnessSet
, signData :: NetworkId -> RawBytes -> Aff DataSignature
, paymentKey :: Aff PrivatePaymentKey
, stakeKey :: Aff (Maybe PrivateStakeKey)
, drepKey :: Aff PrivateDrepKey
}
This interface is used in cardano-transaction-lib
to encapsulate private keys.
It can be used to provide signing services remotely (note the Aff
) without revealing the private keys.
To create a KeyWallet
from private key(s), use this function:
Cardano.Wallet.Key.privateKeysToKeyWallet
:: PrivatePaymentKey
-> Maybe PrivateStakeKey
-> PrivateDrepKey
-> KeyWallet
CTL's test suite uses KeyWallet
to run every contract.