Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data STOSubscriber = STOSubscriber {
- wCredential :: Credential
- wSTOIssuer :: PaymentPubKeyHash
- wSTOTokenName :: TokenName
- wSTOAmount :: Integer
- type STOSubscriberSchema = Endpoint "sto" STOSubscriber
- data UnlockError
- = WithdrawEndpointError ContractError
- | WithdrawTxError ContractError
- | WithdrawPkError ContractError
- | GetCredentialStateMachineError SMContractError
- | GetCredentialTransitionError (InvalidTransition IDState IDAction)
- | UnlockExchangeTokenAccError TokenAccountError
- | UnlockMkTxError MkTxError
- 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 ()
- type MirrorSchema = Endpoint "issue" CredentialOwnerReference .\/ Endpoint "revoke" CredentialOwnerReference
- data CredentialOwnerReference = CredentialOwnerReference {
- coTokenName :: TokenName
- coOwner :: Wallet
- data MirrorError
- = StateNotFound TokenName PaymentPubKeyHash
- | SetupError ContractError
- | MirrorEndpointError ContractError
- | CreateTokenTxError ContractError
- | StateMachineError SMContractError
- mirror :: (HasEndpoint "revoke" CredentialOwnerReference s, HasEndpoint "issue" CredentialOwnerReference s) => Contract w s MirrorError ()
- data Credential = Credential {
- credAuthority :: CredentialAuthority
- credName :: TokenName
- data UserCredential = UserCredential {
- ucAddress :: PaymentPubKeyHash
- ucCredential :: Credential
- ucToken :: Value
- newtype CredentialAuthority = CredentialAuthority {
- unCredentialAuthority :: PaymentPubKeyHash
- data Role
- type PrismSchema = ((MirrorSchema .\/ STOSubscriberSchema) .\/ UnlockExchangeSchema) .\/ Endpoint "role" Role
- data PrismError
- = UnlockSTOErr UnlockError
- | MirrorErr MirrorError
- | EPError ContractError
- | UnlockExchangeErr UnlockError
- contract :: Contract () PrismSchema PrismError ()
Unlock (STO)
data STOSubscriber Source #
STOSubscriber | |
|
Instances
type STOSubscriberSchema = Endpoint "sto" STOSubscriber Source #
data UnlockError Source #
WithdrawEndpointError ContractError | |
WithdrawTxError ContractError | |
WithdrawPkError ContractError | |
GetCredentialStateMachineError SMContractError | |
GetCredentialTransitionError (InvalidTransition IDState IDAction) | |
UnlockExchangeTokenAccError TokenAccountError | |
UnlockMkTxError MkTxError |
Instances
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
Unlock (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.
Mirror app
type MirrorSchema = Endpoint "issue" CredentialOwnerReference .\/ Endpoint "revoke" CredentialOwnerReference Source #
data CredentialOwnerReference Source #
Reference to a credential tied to a specific owner (public key address). From this, and the public key of the Mirror instance, we can compute the address of the state machine script that locks the token for the owner.
CredentialOwnerReference | |
|
Instances
data MirrorError Source #
StateNotFound TokenName PaymentPubKeyHash | |
SetupError ContractError | |
MirrorEndpointError ContractError | |
CreateTokenTxError ContractError | |
StateMachineError SMContractError |
Instances
mirror :: (HasEndpoint "revoke" CredentialOwnerReference s, HasEndpoint "issue" CredentialOwnerReference s) => Contract w s MirrorError () Source #
Credential manager app
data Credential Source #
Named credential issued by a credential authority
Credential | |
|
Instances
data UserCredential Source #
A Credential
issued to a user (public key address)
UserCredential | |
|
Instances
newtype CredentialAuthority Source #
Entity that is authorised to mint credential tokens
CredentialAuthority | |
|
Instances
all-in-one
The roles that we pass to contract
.
Mirror | The |
UnlockSTO | The |
UnlockExchange | The |
Instances
Eq Role Source # | |
Show Role Source # | |
Generic Role Source # | |
FromJSON Role Source # | |
Defined in Plutus.Contracts.Prism parseJSON :: Value -> Parser Role parseJSONList :: Value -> Parser [Role] | |
ToJSON Role Source # | |
Defined in Plutus.Contracts.Prism | |
type Rep Role Source # | |
Defined in Plutus.Contracts.Prism type Rep Role = D1 ('MetaData "Role" "Plutus.Contracts.Prism" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'False) (C1 ('MetaCons "Mirror" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "UnlockSTO" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UnlockExchange" 'PrefixI 'False) (U1 :: Type -> Type))) |
type PrismSchema = ((MirrorSchema .\/ STOSubscriberSchema) .\/ UnlockExchangeSchema) .\/ Endpoint "role" Role Source #
data PrismError Source #
UnlockSTOErr UnlockError | |
MirrorErr MirrorError | |
EPError ContractError | |
UnlockExchangeErr UnlockError |
Instances
contract :: Contract () PrismSchema PrismError () Source #
A wrapper around the four prism contracts. This is just a workaround
for the emulator, where we can only ever run a single Contract
. In
the PAB we could simply start all four contracts (credentialManager,
mirror, subscribeSTO, subscribeExchange) separately.