@ocap/message

Utility functions to encode and decode message that can send to forge

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@ocap/message
1.17.207 days ago2 years agoMinified + gzip package size for @ocap/message in KB

Readme

forge-message
styled with prettier docs Gitter
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: 'TransferTx',
    value: {
      to: '2019-04-25',
    },
  },
});

const buffer = message.serializeBinary();
// Then: send the buffer over the wire

Documentation

For full documentation, checkout https://asset-chain.netlify.com

Contributors

| Name | Website | | -------------- | ------------------------------- | | wangshijun | |