Skip to main content

MemoryOmniaVtxoStore

@totemsdk/omnia-vtxo


@totemsdk/omnia-vtxo / MemoryOmniaVtxoStore

Class: MemoryOmniaVtxoStore

Implements

Constructors

Constructor

new MemoryOmniaVtxoStore(): MemoryOmniaVtxoStore

Returns

MemoryOmniaVtxoStore

Methods

getPool()

getPool(poolId): Promise<OmniaVtxoPool | undefined>

Parameters

poolId

string

Returns

Promise<OmniaVtxoPool | undefined>

Implementation of

OmniaVtxoStore.getPool


getVtxo()

getVtxo(vtxoId): Promise<OmniaVtxo | undefined>

Parameters

vtxoId

string

Returns

Promise<OmniaVtxo | undefined>

Implementation of

OmniaVtxoStore.getVtxo


listVtxos()

listVtxos(poolId?): Promise<OmniaVtxo[]>

Parameters

poolId?

string

Returns

Promise<OmniaVtxo[]>

Implementation of

OmniaVtxoStore.listVtxos


markVtxoSpent()

markVtxoSpent(vtxoId, now?): Promise<void>

Marks a VTXO as spent. Accepts an optional now timestamp for deterministic testing. When now is omitted the store falls back to Date.now() — this is intentional and explicitly documented: the store is a persistence layer, not a pure function, so wall-clock time is an acceptable default for production use. Pass now in tests.

Parameters

vtxoId

string

now?

number

Returns

Promise<void>

Implementation of

OmniaVtxoStore.markVtxoSpent


savePool()

savePool(pool): Promise<void>

Parameters

pool

OmniaVtxoPool

Returns

Promise<void>

Implementation of

OmniaVtxoStore.savePool


saveVtxo()

saveVtxo(vtxo): Promise<void>

Parameters

vtxo

OmniaVtxo

Returns

Promise<void>

Implementation of

OmniaVtxoStore.saveVtxo