Module

Contract.Test.Cip30Mock

A module for mocking CIP30 wallets.

Re-exports from Ctl.Internal.Wallet.Cip30Mock

#withCip30Mock

withCip30Mock :: forall (a :: Type). KeyWallet -> WalletMock -> Contract a -> Contract a

Construct a CIP-30 wallet mock that exposes KeyWallet functionality behind a CIP-30 interface and uses Ogmios to submit Txs. The wallet is injected directly to window.cardano object, under the name corresponding to provided WalletMock. It works even in NodeJS (we introduce a global window object and delete it afterwards).

Note that this function will refuse to overwrite existing wallet with the mock, so the users should disable their browser extensions before running it in the browser.

Note that this function implements single-address light wallet logic, so it will have to be changed a lot to successfully mimic the behavior of multi-address wallets, like Eternl.

Modules