Copyright | (c) Rune K. Svendsen 2016 |
---|---|
License | PublicDomain |
Maintainer | runesvend@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Utility functions for Data.Bitcoin.PaymentChannel.
- getFundingAddress :: ChannelParameters -> Address
- getRedeemScript :: ChannelParameters -> Script
- setSenderChangeAddress :: PaymentChannel a => a -> Address -> a
- serialize :: Serialize a => a -> ByteString
- deserEither :: forall a. (Typeable a, Serialize a) => ByteString -> Either String a
- data BitcoinLockTime
- parseBitcoinLocktime :: Word32 -> BitcoinLockTime
- toWord32 :: BitcoinLockTime -> Word32
- fromDate :: UTCTime -> BitcoinLockTime
- parseJSONInt :: Scientific -> Parser Integer
- pGetSig :: Payment -> Signature
- fpGetSig :: FullPayment -> Signature
- unsafeUpdateRecvState :: ReceiverPaymentChannelI a -> Payment -> ReceiverPaymentChannelI a
Documentation
getFundingAddress :: ChannelParameters -> Address Source #
Derive a Bitcoin address, for funding a payment channel, from
ChannelParameters
.
The transaction which pays to this address is the channel funding transaction,
and information about this transaction is contained in
FundingTxInfo
.
setSenderChangeAddress :: PaymentChannel a => a -> Address -> a Source #
Set new value sender change address
serialize :: Serialize a => a -> ByteString Source #
deserEither :: forall a. (Typeable a, Serialize a) => ByteString -> Either String a Source #
data BitcoinLockTime Source #
Data type representing a Bitcoin LockTime, which specifies a point in time.
Derive a BitcoinLockTime
from a UTCTime
using fromDate
.
parseBitcoinLocktime :: Word32 -> BitcoinLockTime Source #
Convert from Bitcoin format (Word32
)
toWord32 :: BitcoinLockTime -> Word32 Source #
Convert to Bitcoin format (uint32 UNIX timestamp)
fromDate :: UTCTime -> BitcoinLockTime Source #
Convert a UTCTime
to a BitcoinLockTime
parseJSONInt :: Scientific -> Parser Integer Source #
fpGetSig :: FullPayment -> Signature Source #
unsafeUpdateRecvState :: ReceiverPaymentChannelI a -> Payment -> ReceiverPaymentChannelI a Source #
Update internal state without signature verification. Useful for database-type services where a logic layer has already verified the signature, and it just needs to be stored.