Utility function to encode and format message that can be sent to or received from forge framework.
Table of Contents
Install
npm i @ocap/message
// OR
yarn add @ocap/message
Usage
const { createMessage, formatMessage } = require('@ocap/message');
const message = createMessage('Transaction', {
from: '',
nonce: 0,
signature: 'abc',
itx: {
type: 'PokeTx',
value: {
date: '2019-04-25',
address: 'zzzzzzzzzzzzzzzzzzzzz',
},
},
});
const buffer = message.serializeBinary();
Documentation
For full documentation, checkout https://ocap-js.netlify.com
Contributors