Copyright | (c) Rune K. Svendsen, 2016 |
---|---|
License | PublicDomain |
Maintainer | runesvend@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Types used with the interface provided by Data.Bitcoin.PaymentChannel.
- data SenderPaymentChannel = CSenderPaymentChannel {
- spcState :: PaymentChannelState
- spcSignFunc :: Hash256 -> Signature
- data ReceiverPaymentChannel = CReceiverPaymentChannel {
- rpcState :: PaymentChannelState
- rpcVerifyFunc :: Hash256 -> PubKey -> Signature -> Bool
- rpcSignFunc :: Hash256 -> Signature
- data Payment
- data FundingTxInfo = CFundingTxInfo {}
- data ChannelParameters = CChannelParameters {}
- data PayChanError
- data BitcoinAmount
- toWord64 :: BitcoinAmount -> Word64
- class PaymentChannel a where
- valueToMe :: a -> BitcoinAmount
- getChannelState :: a -> PaymentChannelState
- getChannelID :: a -> TxHash
- channelIsExhausted :: a -> Bool
- data BitcoinLockTime
- fromDate :: UTCTime -> BitcoinLockTime
Documentation
data SenderPaymentChannel Source
State object for the value sender
CSenderPaymentChannel | |
|
data ReceiverPaymentChannel Source
State object for the value receiver
CReceiverPaymentChannel | |
|
data FundingTxInfo Source
Holds information about the Bitcoin transaction used to fund the channel
CFundingTxInfo | |
|
data ChannelParameters Source
Defines the sender, receiver, and expiration date for the channel
CChannelParameters | |
|
data BitcoinAmount Source
Represents a bitcoin amount as number of satoshis.
1 satoshi = 1e-8 bitcoins.
Integer operations will never over- or underflow with this type.
Convert to a Word64 using toWord64
, which caps the final amount.
toWord64 :: BitcoinAmount -> Word64 Source
Convert to Word64
, with zero as floor, UINT64_MAX as ceiling
class PaymentChannel a where Source
Get various information about an open payment channel.
valueToMe :: a -> BitcoinAmount Source
Get value sent to receiver/left for sender
getChannelState :: a -> PaymentChannelState Source
Retrieve internal channel state
getChannelID :: a -> TxHash Source
Get channel ID
channelIsExhausted :: a -> Bool Source
data BitcoinLockTime Source
Data type representing a Bitcoin LockTime, which specifies a point in time.
Derive a BitcoinLockTime
from a UTCTime
using fromDate
.
fromDate :: UTCTime -> BitcoinLockTime Source
Convert a UTCTime
to a BitcoinLockTime