@lelantos-org/sdk / wallet / NoteSink
Interface: NoteSink โ
Defined in: @lelantos-org/sdk/dist/wallet/sync.d.ts:34
Where a sync writes what it finds.
Deliberately not a NoteStore: a store hands back a fresh NotesFile on every load(), so a sync that owned one would be mutating a second copy of state the wallet already holds in NoteCache โ and whichever of the two saved last would erase the other's writes. The sink is the live file, so exactly one NotesFile exists per wallet. NoteCache implements it.
Properties โ
file โ
readonly file: NotesFile;Defined in: @lelantos-org/sdk/dist/wallet/sync.d.ts:36
The live notes file. Read for the resume cursor; never replaced.
Methods โ
addHits() โ
addHits(hits): object;Defined in: @lelantos-org/sdk/dist/wallet/sync.d.ts:38
Append hits to the live file in memory. Idempotent by cm.
Parameters โ
| Parameter | Type |
|---|---|
hits | ScanHit[] |
Returns โ
object
added โ
added: StoredNote[];skipped โ
skipped: number;checkpoint() โ
checkpoint(cursor): Promise<void>;Defined in: @lelantos-org/sdk/dist/wallet/sync.d.ts:43
Persist the current notes together with cursor.
Parameters โ
| Parameter | Type |
|---|---|
cursor | number |
Returns โ
Promise<void>