Before bliss

This commit is contained in:
2026-05-16 05:59:55 +00:00
parent a0d9775015
commit b4d82b8b1f
4 changed files with 65 additions and 24 deletions

View File

@@ -83,20 +83,33 @@ export class AppService extends EventEmitter<AppEventMap> {
// Import the default P2PKH template
const { templateIdentifier } = await engine.importTemplate(p2pkhTemplate);
engine
.subscribeToLockingBytecodesForTemplate(templateIdentifier)
.catch((err) =>
console.error(
`Error subscribing to locking bytecodes for template ${templateIdentifier}: ${err}`,
),
);
engine
.updateUnspentOutputsForTemplate(templateIdentifier)
.catch((err) =>
console.error(
`Error updating unspent outputs for template ${templateIdentifier}: ${err}`,
),
);
// engine
// .subscribeToLockingBytecodesForTemplate(templateIdentifier)
// .catch((err) =>
// console.error(
// `Error subscribing to locking bytecodes for template ${templateIdentifier}: ${err}`,
// ),
// );
// engine
// .updateUnspentOutputsForTemplate(templateIdentifier)
// .catch((err) =>
// console.error(
// `Error updating unspent outputs for template ${templateIdentifier}: ${err}`,
// ),
// );
// Update all the unspents for every template, and subscribe to the locking bytecodes for changes
// TODO: Remove the above lines that do the same thing. Minimising changes for BLISS.
const updateTemplates = async () => {
const templates = await engine.listImportedTemplates();
templates.forEach(async (template) => {
// engine.updateUnspentOutputsForTemplate(generateTemplateIdentifier(template));
engine.subscribeToLockingBytecodesForTemplate(generateTemplateIdentifier(template));
});
};
updateTemplates();
// Set default locking parameters for P2PKH
// To my knowledge, this doesnt generate any lockscript, so discovery of funds will not work automatically.