cardano-wallet-core-2022.7.1: The Wallet Backend for a Cardano node.
Copyright © 2022 IOHK
License Apache-2.0
Safe Haskell None
Language Haskell2010

Cardano.Wallet.DB.WalletState

Description

Pure data type which represents the entire wallet state, including all checkpoints.

FIXME during ADP-1043: Actually include everything, e.g. TxHistory, Pending transactions, …

Synopsis

Wallet state

data WalletState s Source #

Wallet state. Currently includes:

  • Prologue of the address discovery state
  • Checkpoints of UTxO and of discoveries of the address discovery state.

FIXME during ADP-1043: Include also TxHistory, pending transactions, …, everything.

fromGenesis :: AddressBookIso s => Wallet s -> Maybe ( WalletState s) Source #

Create a wallet from the genesis block.

getLatest :: AddressBookIso s => WalletState s -> Wallet s Source #

Get the wallet checkpoint with the largest slot number

findNearestPoint :: WalletState s -> Slot -> Maybe Slot Source #

Find the nearest Checkpoint that is either at the given point or before.

WalletCheckpoint (internal use mostly)

data WalletCheckpoint s Source #

Data stored in a single checkpoint. Only includes the UTxO and the Discoveries , but not the Prologue .

getBlockHeight :: WalletCheckpoint s -> Word32 Source #

Helper function: Get the block height of a wallet checkpoint.

getSlot :: WalletCheckpoint s -> Slot Source #

Helper function: Get the Slot of a wallet checkpoint.

Delta types

Multiple wallets

data DeltaMap key da Source #

Delta type for Map .

Constructors

Insert key ( Base da)
Delete key
Adjust key da

Instances

Instances details
( Show key, Show da, Show ( Base da)) => Show ( DeltaMap key da)
Instance details

Defined in Data.DeltaMap

( Show key, Show da, Show ( Base da)) => Buildable ( DeltaMap key da)
Instance details

Defined in Data.DeltaMap

( Ord key, Delta da) => Delta ( DeltaMap key da)
Instance details

Defined in Data.DeltaMap

Associated Types

type Base ( DeltaMap key da) Source #

type Base ( DeltaMap key da)
Instance details

Defined in Data.DeltaMap

type Base ( DeltaMap key da) = Map key ( Base da)

adjustNoSuchWallet :: WalletId -> ( ErrNoSuchWallet -> e) -> (w -> Either e (dw, b)) -> Map WalletId w -> ( Maybe ( DeltaMap WalletId dw), Either e b) Source #

Adjust a specific wallet if it exists or return ErrNoSuchWallet .