verifactu-sdk API / InMemoryHashStore
Class: InMemoryHashStore
Defined in: src/store/HashStore.ts:79
Default in-memory HashStore implementation.
Intended for tests, demos and short-lived CLI invocations. Production deployments should provide their own persistent store.
Example
const client = new VerifactuClient({
// ...
hashStore: new InMemoryHashStore(),
});Implements
Constructors
Constructor
new InMemoryHashStore():
InMemoryHashStore
Returns
InMemoryHashStore
Methods
getLast()
getLast(
taxpayerNif):HashStoreEntry|null
Defined in: src/store/HashStore.ts:83
Return the last appended entry for the given taxpayer.
Parameters
taxpayerNif
string
NIF of the taxpayer whose chain is being read.
Returns
HashStoreEntry | null
The last entry, or null if the taxpayer has no previous record (i.e. the next submission must be marked PrimerRegistro='S').
Implementation of
append()
append(
taxpayerNif,entry):void
Defined in: src/store/HashStore.ts:88
Persist a freshly computed hash as the new tail of the chain.
Parameters
taxpayerNif
string
NIF of the taxpayer the chain belongs to.
entry
The newly created record's identifier and hash.
Returns
void