plutus-contract-1.1.0.0
Safe HaskellNone
LanguageHaskell2010

Wallet.Emulator.Wallet

Synopsis

Documentation

newtype SigningProcess Source #

Constructors

SigningProcess 

Fields

Instances

Instances details
Show SigningProcess Source # 
Instance details

Defined in Wallet.Emulator.Wallet

data Wallet Source #

A wallet identifier

Instances

Instances details
Eq Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Data Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Wallet -> c Wallet Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Wallet Source #

toConstr :: Wallet -> Constr Source #

dataTypeOf :: Wallet -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Wallet) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Wallet) Source #

gmapT :: (forall b. Data b => b -> b) -> Wallet -> Wallet Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Wallet -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Wallet -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Wallet -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Wallet -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Wallet -> m Wallet Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Wallet -> m Wallet Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Wallet -> m Wallet Source #

Ord Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Show Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Generic Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Associated Types

type Rep Wallet :: Type -> Type Source #

ToJSON Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

ToJSONKey Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

FromJSON Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

HasSymTokens Wallet Source # 
Instance details

Defined in Plutus.Contract.Test.ContractModel.Interface

ToHttpApiData Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

FromHttpApiData Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

ToSchema Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Pretty Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Methods

pretty :: Wallet -> Doc ann Source #

prettyList :: [Wallet] -> Doc ann Source #

type Rep Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

type Rep Wallet = D1 ('MetaData "Wallet" "Wallet.Emulator.Wallet" "plutus-contract-1.1.0.0-KZTRXOViW1GCXNPMdYqx30" 'False) (C1 ('MetaCons "Wallet" 'PrefixI 'True) (S1 ('MetaSel ('Just "prettyWalletName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe String)) :*: S1 ('MetaSel ('Just "getWalletId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 WalletId)))

newtype WalletId Source #

Constructors

WalletId 

Fields

Instances

Instances details
Eq WalletId Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Data WalletId Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WalletId -> c WalletId Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c WalletId Source #

toConstr :: WalletId -> Constr Source #

dataTypeOf :: WalletId -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c WalletId) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c WalletId) Source #

gmapT :: (forall b. Data b => b -> b) -> WalletId -> WalletId Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WalletId -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WalletId -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> WalletId -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> WalletId -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> WalletId -> m WalletId Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> WalletId -> m WalletId Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> WalletId -> m WalletId Source #

Ord WalletId Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Show WalletId Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Generic WalletId Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Associated Types

type Rep WalletId :: Type -> Type Source #

ToJSON WalletId Source # 
Instance details

Defined in Wallet.Emulator.Wallet

ToJSONKey WalletId Source # 
Instance details

Defined in Wallet.Emulator.Wallet

FromJSON WalletId Source # 
Instance details

Defined in Wallet.Emulator.Wallet

ToHttpApiData WalletId Source # 
Instance details

Defined in Wallet.Emulator.Wallet

FromHttpApiData WalletId Source # 
Instance details

Defined in Wallet.Emulator.Wallet

ToSchema WalletId Source # 
Instance details

Defined in Wallet.Emulator.Wallet

type Rep WalletId Source # 
Instance details

Defined in Wallet.Emulator.Wallet

type Rep WalletId = D1 ('MetaData "WalletId" "Wallet.Emulator.Wallet" "plutus-contract-1.1.0.0-KZTRXOViW1GCXNPMdYqx30" 'True) (C1 ('MetaCons "WalletId" 'PrefixI 'True) (S1 ('MetaSel ('Just "unWalletId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 WalletId)))

walletToMockWallet :: Wallet -> Maybe MockWallet Source #

The MockWallet whose ID is the given wallet ID (if it exists)

walletToMockWallet' :: Wallet -> MockWallet Source #

The same as walletToMockWallet but fails with an error instead of returning Nothing.

mockWalletPaymentPubKey :: Wallet -> PaymentPubKey Source #

The public key of a mock wallet. (Fails if the wallet is not a mock wallet).

mockWalletPaymentPubKeyHash :: Wallet -> PaymentPubKeyHash Source #

The payment public key hash of a mock wallet. (Fails if the wallet is not a mock wallet).

mockWalletAddress :: Wallet -> CardanoAddress Source #

Get the cardano address of a mock wallet. (Fails if the wallet is not a mock wallet).

data WalletEvent Source #

Instances

Instances details
Eq WalletEvent Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Show WalletEvent Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Generic WalletEvent Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Associated Types

type Rep WalletEvent :: Type -> Type Source #

ToJSON WalletEvent Source # 
Instance details

Defined in Wallet.Emulator.Wallet

FromJSON WalletEvent Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Pretty WalletEvent Source # 
Instance details

Defined in Wallet.Emulator.Wallet

type Rep WalletEvent Source # 
Instance details

Defined in Wallet.Emulator.Wallet

data WalletState Source #

The state used by the mock wallet environment.

Constructors

WalletState 

Fields

Instances

Instances details
Show WalletState Source # 
Instance details

Defined in Wallet.Emulator.Wallet

ownAddress :: WalletState -> CardanoAddress Source #

Get the user's own payment public-key address.

fromMockWallet :: MockWallet -> WalletState Source #

An empty wallet using the given private key. for that wallet as the sole watched address.

emptyWalletState :: Wallet -> Maybe WalletState Source #

Empty wallet state for an emulator Wallet. Returns Nothing if the wallet is not known in the emulator.

signWallet :: MockWallet -> SigningProcess Source #

Sign the transaction by calling signTxnWithKey (throwing a PrivateKeyNotFound error if called with a key other than the wallet's private key)

signTxnWithKey :: Member (Error WalletAPIError) r => MockWallet -> CardanoTx -> PaymentPubKeyHash -> Eff r CardanoTx Source #

Sign the transaction with the private key of the mock wallet.

signTxWithPrivateKey :: Member (Error WalletAPIError) r => PaymentPrivateKey -> CardanoTx -> PaymentPubKeyHash -> Eff r CardanoTx Source #

Sign the transaction with the private key, if the hash is that of the private key.

signPrivateKeys :: [PaymentPrivateKey] -> SigningProcess Source #

Sign the transaction with the given private keys, ignoring the list of public keys that the SigningProcess is passed.

data Entity Source #

An Entity is a thing that can hold Value. Used in the balances function to compute who holds for a given chain state and set of wallets.

Instances

Instances details
Eq Entity Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Ord Entity Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Show Entity Source # 
Instance details

Defined in Wallet.Emulator.Wallet

walletPaymentPubKeyHashes :: WalletSet -> Map PaymentPubKeyHash Wallet Source #

Pick out all the public keys from the set of wallets and map them back to their corresponding wallets.

balances :: ChainState -> WalletSet -> Map Entity Value Source #

For a set of wallets, convert them into a map of value: entity, where entity is one of Entity.

Orphan instances

Data WalletId Source # 
Instance details

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WalletId -> c WalletId Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c WalletId Source #

toConstr :: WalletId -> Constr Source #

dataTypeOf :: WalletId -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c WalletId) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c WalletId) Source #

gmapT :: (forall b. Data b => b -> b) -> WalletId -> WalletId Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WalletId -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WalletId -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> WalletId -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> WalletId -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> WalletId -> m WalletId Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> WalletId -> m WalletId Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> WalletId -> m WalletId Source #

ToSchema WalletId Source # 
Instance details