Page through wallet activity with a block cursor
For a wallet-specific ledger, listsinceblock supplies changes and a cursor that can be committed alongside the imported records.
Advance from a committed block
Set CURSOR to the last saved block hash for wallet shop. With the default target depth of one, lastblock identifies the block to pass on the next iteration. Inspect both activity arrays before committing the new cursor.
bitcoin-cli -rpcwallet=shop listsinceblock "$CURSOR" | jq '{lastblock, transactions, removed}'
Merge repeated entries safely
An unconfirmed wallet transaction can appear in successive responses. A reorganisation can add records to removed. Reconcile individual details by transaction and output, and apply reversals before advancing the cursor. A pruned node can have incomplete removed history when the detached block data is unavailable.