Safe Haskell | None |
---|---|
Language | Haskell2010 |
Two sample that unlock some funds by presenting the credentials.
* subscribeSTO
uses the credential to participate in an STO
* unlockExchange
uses the credential to take ownership of funds that
were locked by an exchange.
Synopsis
- data STOSubscriber = STOSubscriber {
- wCredential :: Credential
- wSTOIssuer :: PaymentPubKeyHash
- wSTOTokenName :: TokenName
- wSTOAmount :: Integer
- type STOSubscriberSchema = Endpoint "sto" STOSubscriber
- subscribeSTO :: forall w s. HasEndpoint "sto" STOSubscriber s => Contract w s UnlockError ()
- type UnlockExchangeSchema = Endpoint "unlock from exchange" Credential
- unlockExchange :: forall w s. HasEndpoint "unlock from exchange" Credential s => Contract w s UnlockError ()
- data UnlockError
- = WithdrawEndpointError ContractError
- | WithdrawTxError ContractError
- | WithdrawPkError ContractError
- | GetCredentialStateMachineError SMContractError
- | GetCredentialTransitionError (InvalidTransition IDState IDAction)
- | UnlockExchangeTokenAccError TokenAccountError
- | UnlockMkTxError MkTxError
STO
data STOSubscriber Source #
STOSubscriber | |
|
Instances
type STOSubscriberSchema = Endpoint "sto" STOSubscriber Source #
subscribeSTO :: forall w s. HasEndpoint "sto" STOSubscriber s => Contract w s UnlockError () Source #
Obtain a token from the credential manager app, then participate in the STO
Exchange
type UnlockExchangeSchema = Endpoint "unlock from exchange" Credential Source #
unlockExchange :: forall w s. HasEndpoint "unlock from exchange" Credential s => Contract w s UnlockError () Source #
Obtain a token from the credential manager app, then use it to unlock funds that were locked by an exchange.
Errors etc.
data UnlockError Source #
WithdrawEndpointError ContractError | |
WithdrawTxError ContractError | |
WithdrawPkError ContractError | |
GetCredentialStateMachineError SMContractError | |
GetCredentialTransitionError (InvalidTransition IDState IDAction) | |
UnlockExchangeTokenAccError TokenAccountError | |
UnlockMkTxError MkTxError |