Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Bank = Module BankName MessageApi MessageApi QueryApi BankEffs '[Auth]
- bankModule :: Members (ModuleEffs Bank) r => Bank r
- type BankEffs = '[BankKeeper, Error BankError]
- data BankKeeper m a where
- GetBalance :: Address -> CoinId -> BankKeeper m Coin
- Transfer :: Address -> Coin -> Address -> BankKeeper m ()
- Burn :: Address -> Coin -> BankKeeper m ()
- Mint :: Address -> Coin -> BankKeeper m ()
- getBalance :: forall r. MemberWithError BankKeeper r => Address -> CoinId -> Sem r Coin
- transfer :: forall r. MemberWithError BankKeeper r => Address -> Coin -> Address -> Sem r ()
- burn :: forall r. MemberWithError BankKeeper r => Address -> Coin -> Sem r ()
- mint :: forall r. MemberWithError BankKeeper r => Address -> Coin -> Sem r ()
- eval :: Members [Logger, Output Event, Error AppError] r => Members AuthEffs r => forall a. Sem (BankKeeper ': (Error BankError ': r)) a -> Sem r a
- data TransferMsg = TransferMsg {}
- data BurnMsg = BurnMsg {}
- type GetAddressCoinBalance = "balance" :> (QA Address :> (QueryParam' '[Required, Strict] "coin_id" CoinId :> Leaf Coin))
- getAddressCoinBalance :: Member BankKeeper r => QueryArgs Address -> CoinId -> Sem r (QueryResult Coin)
- type QueryApi = GetAddressCoinBalance
- querier :: forall r. Member BankKeeper r => RouteQ QueryApi r
- type MessageApi = (TypedMessage BurnMsg :~> Return ()) :<|> (TypedMessage TransferMsg :~> Return ())
- messageHandlers :: Members BankEffs r => RouteTx MessageApi r
- data TransferEvent = TransferEvent {}
- data BankError = InsufficientFunds Text
- type BankName = "bank"
- transferEventAesonOptions :: Options
- newtype Amount = Amount {}
- data Coin = Coin {
- coinId :: CoinId
- coinAmount :: Amount
- newtype CoinId = CoinId {}
Module
type Bank = Module BankName MessageApi MessageApi QueryApi BankEffs '[Auth] Source #
bankModule :: Members (ModuleEffs Bank) r => Bank r Source #
type BankEffs = '[BankKeeper, Error BankError] Source #
data BankKeeper m a where Source #
GetBalance :: Address -> CoinId -> BankKeeper m Coin | |
Transfer :: Address -> Coin -> Address -> BankKeeper m () | |
Burn :: Address -> Coin -> BankKeeper m () | |
Mint :: Address -> Coin -> BankKeeper m () |
Instances
type DefiningModule (BankKeeper :: k -> Type -> Type) Source # | |
Defined in Tendermint.SDK.Modules.Bank.Keeper |
getBalance :: forall r. MemberWithError BankKeeper r => Address -> CoinId -> Sem r Coin Source #
transfer :: forall r. MemberWithError BankKeeper r => Address -> Coin -> Address -> Sem r () Source #
eval :: Members [Logger, Output Event, Error AppError] r => Members AuthEffs r => forall a. Sem (BankKeeper ': (Error BankError ': r)) a -> Sem r a Source #
data TransferMsg Source #
TransferMsg | |
|
Instances
BurnMsg | |
|
Instances
type GetAddressCoinBalance = "balance" :> (QA Address :> (QueryParam' '[Required, Strict] "coin_id" CoinId :> Leaf Coin)) Source #
Query Api
getAddressCoinBalance :: Member BankKeeper r => QueryArgs Address -> CoinId -> Sem r (QueryResult Coin) Source #
type QueryApi = GetAddressCoinBalance Source #
type MessageApi = (TypedMessage BurnMsg :~> Return ()) :<|> (TypedMessage TransferMsg :~> Return ()) Source #
messageHandlers :: Members BankEffs r => RouteTx MessageApi r Source #
data TransferEvent Source #
Instances
Instances
IsAppError BankError Source # | |
Defined in Tendermint.SDK.Modules.Bank.Types makeAppError :: BankError -> AppError Source # |
transferEventAesonOptions :: Options Source #
Instances
Eq Amount Source # | |
Num Amount Source # | |
Ord Amount Source # | |
Show Amount Source # | |
Generic Amount Source # | |
FromJSON Amount Source # | |
Defined in Tendermint.SDK.Modules.Auth.Types parseJSON :: Value -> Parser Amount parseJSONList :: Value -> Parser [Amount] | |
ToJSON Amount Source # | |
Defined in Tendermint.SDK.Modules.Auth.Types toEncoding :: Amount -> Encoding toJSONList :: [Amount] -> Value toEncodingList :: [Amount] -> Encoding | |
Wrapped Amount Source # | |
Defined in Tendermint.SDK.Modules.Auth.Types type Unwrapped Amount | |
HasCodec Amount Source # | |
Defined in Tendermint.SDK.Modules.Auth.Types | |
type Rep Amount Source # | |
Defined in Tendermint.SDK.Modules.Auth.Types | |
type Unwrapped Amount Source # | |
Defined in Tendermint.SDK.Modules.Auth.Types |
Coin | |
|
Instances
Eq Coin Source # | |
Show Coin Source # | |
Generic Coin Source # | |
Wrapped Coin Source # | |
Defined in Tendermint.SDK.Modules.Auth.Types type Unwrapped Coin | |
HasCodec Coin Source # | |
Defined in Tendermint.SDK.Modules.Auth.Types | |
type Rep Coin Source # | |
Defined in Tendermint.SDK.Modules.Auth.Types type Rep Coin = D1 ('MetaData "Coin" "Tendermint.SDK.Modules.Auth.Types" "hs-abci-sdk-0.1.0.0-6BthCXrKFfHAhK2oYxZQI4" 'False) (C1 ('MetaCons "Coin" 'PrefixI 'True) (S1 ('MetaSel ('Just "coinId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CoinId) :*: S1 ('MetaSel ('Just "coinAmount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Amount))) | |
type Unwrapped Coin Source # | |
Defined in Tendermint.SDK.Modules.Auth.Types |