Copyright | (c) Rune K. Svendsen 2016 |
---|---|
License | PublicDomain |
Maintainer | runesvend@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Utility functions for PaymentChannel.
- getFundingAddress :: ChanParams -> Address
- getRedeemScript :: ChanParams -> Script
- serialize :: Serialize a => a -> ByteString
- deserEither :: forall a. (Typeable a, Serialize a) => ByteString -> Either String a
- class BtcLockTime a where
- parseLockTime :: BtcLockTime a => Word32 -> Either LockTimeParseError a
- toWord32 :: BtcLockTime a => a -> Word32
- fromDate :: UTCTime -> Maybe LockTimeDate
- parseJSONWord :: forall i. (Typeable i, Integral i, Bounded i) => Scientific -> Parser i
Documentation
getFundingAddress :: ChanParams -> Address Source #
Derive a Bitcoin address, for funding a payment channel, from
ChanParams
.
The transaction which pays to this address is the channel funding transaction,
and information about this transaction is contained in
FundingTxInfo
.
getRedeemScript :: ChanParams -> Script Source #
Generate OP_CHECKLOCKTIMEVERIFY redeemScript, which can be redeemed in two ways: 1) by providing a signature from both server and client 2) after the date specified by lockTime: by providing only a client signature
serialize :: Serialize a => a -> ByteString Source #
deserEither :: forall a. (Typeable a, Serialize a) => ByteString -> Either String a Source #
class BtcLockTime a where Source #
Data type representing a Bitcoin LockTime, which specifies a point in time.
BtcLockTime LockTimeBlockHeight Source # | |
BtcLockTime LockTimeDate Source # | |
parseLockTime :: BtcLockTime a => Word32 -> Either LockTimeParseError a Source #
toWord32 :: BtcLockTime a => a -> Word32 Source #
parseJSONWord :: forall i. (Typeable i, Integral i, Bounded i) => Scientific -> Parser i Source #