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
- setSenderChangeAddress :: PaymentChannel a => a -> Address -> a
- serialize :: Binary a => a -> ByteString
- serialize' :: Serialize a => a -> ByteString
- data BitcoinLockTime
- parseBitcoinLocktime :: Word32 -> BitcoinLockTime
- toWord32 :: BitcoinLockTime -> Word32
- fromDate :: UTCTime -> BitcoinLockTime
- deserEither :: forall m a. (Typeable a, Binary a) => ByteString -> Either String a
- parseJSONInt :: Scientific -> Parser Integer
- unsafeUpdateRecvState :: ReceiverPaymentChannel -> Payment -> ReceiverPaymentChannel
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 :: Binary a => a -> ByteString Source #
serialize' :: Serialize a => a -> ByteString 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
)
fromDate :: UTCTime -> BitcoinLockTime Source #
Convert a UTCTime
to a BitcoinLockTime
deserEither :: forall m a. (Typeable a, Binary a) => ByteString -> Either String a Source #
parseJSONInt :: Scientific -> Parser Integer Source #
unsafeUpdateRecvState :: ReceiverPaymentChannel -> Payment -> ReceiverPaymentChannel 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.