module RBPCP.Api where
import RBPCP.Types
import RBPCP.Internal.Types
import Servant.API
type VER = "v2"
type FundInfo = VER :> "funding" :> Capture "client_pubkey" (Client PubKey) :> Capture "exp_time" BLT :> "info"
:> Get '[JSON] FundingInfo
type BeginOpen = VER :> "funding" :> Capture "client_pubkey" (Client PubKey) :> Capture "server_pubkey" (Server PubKey)
:> Capture "exp_time" BLT :> "begin_open"
:> Header "Host" String :> Get '[JSON] ChannelLocation
type ChanOpen = VER :> "channels" :> Capture "client_pubkey" (Client PubKey) :> Capture "exp_time" BLT
:> Capture "funding_txid" TxHash :> Capture "funding_vout" Vout
:> ReqBody '[JSON] Payment :> Verb 'POST 201 '[JSON] PaymentResult
type ChanPay = VER :> "channels" :> Capture "client_pubkey" (Client PubKey) :> Capture "exp_time" BLT
:> Capture "funding_txid" TxHash :> Capture "funding_vout" Vout
:> ReqBody '[JSON] Payment :> Put '[JSON] PaymentResult
type ChanClose = VER :> "channels" :> Capture "client_pubkey" (Client PubKey) :> Capture "exp_time" BLT
:> Capture "funding_txid" TxHash :> Capture "funding_vout" Vout :> "close"
:> ReqBody '[JSON] Payment :> Put '[JSON] PaymentResult
type RBPCP =
FundInfo
:<|> BeginOpen
:<|> ChanOpen
:<|> ChanPay
:<|> ChanClose
type BLT = Word32