plutus-use-cases-1.2.0.0: Collection of smart contracts to develop the plutus/wallet interface
Safe HaskellNone
LanguageHaskell2010

Plutus.Contracts.Prism.Unlock

Description

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

STO

data STOSubscriber Source #

Constructors

STOSubscriber 

Fields

Instances

Instances details
Eq STOSubscriber Source # 
Instance details

Defined in Plutus.Contracts.Prism.Unlock

Show STOSubscriber Source # 
Instance details

Defined in Plutus.Contracts.Prism.Unlock

Generic STOSubscriber Source # 
Instance details

Defined in Plutus.Contracts.Prism.Unlock

Associated Types

type Rep STOSubscriber :: Type -> Type Source #

FromJSON STOSubscriber Source # 
Instance details

Defined in Plutus.Contracts.Prism.Unlock

Methods

parseJSON :: Value -> Parser STOSubscriber

parseJSONList :: Value -> Parser [STOSubscriber]

ToJSON STOSubscriber Source # 
Instance details

Defined in Plutus.Contracts.Prism.Unlock

Methods

toJSON :: STOSubscriber -> Value

toEncoding :: STOSubscriber -> Encoding

toJSONList :: [STOSubscriber] -> Value

toEncodingList :: [STOSubscriber] -> Encoding

type Rep STOSubscriber Source # 
Instance details

Defined in Plutus.Contracts.Prism.Unlock

type Rep STOSubscriber = D1 ('MetaData "STOSubscriber" "Plutus.Contracts.Prism.Unlock" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'False) (C1 ('MetaCons "STOSubscriber" 'PrefixI 'True) ((S1 ('MetaSel ('Just "wCredential") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Credential) :*: S1 ('MetaSel ('Just "wSTOIssuer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PaymentPubKeyHash)) :*: (S1 ('MetaSel ('Just "wSTOTokenName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TokenName) :*: S1 ('MetaSel ('Just "wSTOAmount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer))))

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 #

Instances

Instances details
Eq UnlockError Source # 
Instance details

Defined in Plutus.Contracts.Prism.Unlock

Show UnlockError Source # 
Instance details

Defined in Plutus.Contracts.Prism.Unlock

Generic UnlockError Source # 
Instance details

Defined in Plutus.Contracts.Prism.Unlock

Associated Types

type Rep UnlockError :: Type -> Type Source #

FromJSON UnlockError Source # 
Instance details

Defined in Plutus.Contracts.Prism.Unlock

Methods

parseJSON :: Value -> Parser UnlockError

parseJSONList :: Value -> Parser [UnlockError]

ToJSON UnlockError Source # 
Instance details

Defined in Plutus.Contracts.Prism.Unlock

Methods

toJSON :: UnlockError -> Value

toEncoding :: UnlockError -> Encoding

toJSONList :: [UnlockError] -> Value

toEncodingList :: [UnlockError] -> Encoding

AsContractError UnlockError Source # 
Instance details

Defined in Plutus.Contracts.Prism.Unlock

Methods

_ContractError :: Prism' UnlockError ContractError

_WalletContractError :: Prism' UnlockError WalletAPIError

_ChainIndexContractError :: Prism' UnlockError (Text, ChainIndexResponse)

_ConstraintResolutionContractError :: Prism' UnlockError MkTxError

_ToCardanoConvertContractError :: Prism' UnlockError ToCardanoError

_ResumableContractError :: Prism' UnlockError MatchingError

_CCheckpointContractError :: Prism' UnlockError CheckpointError

_EndpointDecodeContractError :: Prism' UnlockError (EndpointDescription, EndpointValue Value, Text)

_OtherContractError :: Prism' UnlockError Text

type Rep UnlockError Source # 
Instance details

Defined in Plutus.Contracts.Prism.Unlock

type Rep UnlockError = D1 ('MetaData "UnlockError" "Plutus.Contracts.Prism.Unlock" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'False) ((C1 ('MetaCons "WithdrawEndpointError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ContractError)) :+: (C1 ('MetaCons "WithdrawTxError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ContractError)) :+: C1 ('MetaCons "WithdrawPkError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ContractError)))) :+: ((C1 ('MetaCons "GetCredentialStateMachineError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SMContractError)) :+: C1 ('MetaCons "GetCredentialTransitionError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (InvalidTransition IDState IDAction)))) :+: (C1 ('MetaCons "UnlockExchangeTokenAccError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TokenAccountError)) :+: C1 ('MetaCons "UnlockMkTxError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MkTxError)))))