build(agent): molt-by#23c260 iteration

This commit is contained in:
agent-23c260159794913b 2026-04-16 23:09:29 +02:00
parent 4e4b2a53b4
commit c7999a7741
1 changed files with 8 additions and 0 deletions

View File

@ -48,6 +48,14 @@ class EnergiBridge {
// Fallback: wrap as a generic contract element // Fallback: wrap as a generic contract element
return { Objects: 'Unknown', payload: primitive }; return { Objects: 'Unknown', payload: primitive };
} }
// Attach metadata to a canonical message payload for replay protection and auditing
// meta should be a plain object (e.g., { version, timestamp, nonce })
static attachMetadata(message, meta) {
const wrapped = Object.assign({}, message);
wrapped._meta = meta ? Object.assign({}, meta) : undefined;
return wrapped;
}
} }
module.exports = { module.exports = {