MinimaWorkTemplateProvider
@totemsdk/txpow / MinimaWorkTemplateProvider
Interface: MinimaWorkTemplateProvider
Provider abstraction for the current Minima block-candidate template.
The TxPoW package remains transport/node-client agnostic: callers inject a provider that fetches the current template from a Minima node, Axia, or a test fixture.
MinimaWorkRelay is the preferred long-term relay boundary. The legacy
broadcastBlockCandidate callback is retained as a compatibility/fallback
path only — new consumers should use relay via MinimaWorkRelay and not
build around the lossy candidate: unknown shape.
Methods
broadcastBlockCandidate()?
optionalbroadcastBlockCandidate(candidate):Promise<void>
Parameters
candidate
Returns
Promise<void>
Deprecated
Prefer MinimaWorkRelay.submitBlock (complete envelope).
Retained for compatibility; only invoked for genuine Minima blocks
(Super-0 … Super-31) when no relay is configured.
getCurrentTemplate()
getCurrentTemplate():
Promise<MinimaWorkTemplate>
Fetch the current block-candidate template.
Returns
Promise<MinimaWorkTemplate>
getLatestTemplate()?
optionalgetLatestTemplate():Promise<MinimaWorkTemplate>
Optional: fetch the latest template for freshness checks. Falls back to getCurrentTemplate.
Returns
Promise<MinimaWorkTemplate>
validateTemplate()?
optionalvalidateTemplate(template):Promise<boolean>
Optional: validate a template before mining against it.
Parameters
template
Returns
Promise<boolean>