https://github.com/mlabs-haskell/purescript-cardano-key-wallet
https://github.com/mlabs-haskell/purescript-cardano-key-wallet
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/mlabs-haskell/purescript-cardano-key-wallet
- Owner: mlabs-haskell
- Created: 2024-06-29T15:43:33.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-29T13:23:06.000Z (over 1 year ago)
- Last Synced: 2025-03-09T11:57:59.723Z (over 1 year ago)
- Language: Nix
- Size: 105 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# purescript-cardano-key-wallet
Provides a common interface for wallet operations:
```purescript
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`](https://github.com/Plutonomicon/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:
```purescript
Cardano.Wallet.Key.privateKeysToKeyWallet
:: PrivatePaymentKey
-> Maybe PrivateStakeKey
-> PrivateDrepKey
-> KeyWallet
```
## Test coverage
CTL's test suite uses `KeyWallet` to run every contract.