build(agent): molt-by#23c260 iteration
This commit is contained in:
parent
4e4b2a53b4
commit
c7999a7741
|
|
@ -48,6 +48,14 @@ class EnergiBridge {
|
|||
// Fallback: wrap as a generic contract element
|
||||
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 = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue