@arcblock/forge-message

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

Usage no npm install needed!

<script type="module">
  import arcblockForgeMessage from 'https://cdn.skypack.dev/@arcblock/forge-message';
</script>

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 @arcblock/forge-message
// OR
yarn add @arcblock/forge-message

Usage

const { createMessage, formatMessage } = require('@arcblock/forge-message');

const message = createMessage('Transaction', {
  from: '',
  nonce: 0,
  signature: 'abc',
  itx: {
    type: 'PokeTx',
    value: {
      date: '2019-04-25',
      address: 'zzzzzzzzzzzzzzzzzzzzz',
    },
  },
});

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

Documentation

For full documentation, checkout https://forge-js.netlify.com

Contributors

Name Website
wangshijun https://ocap.arcblock.io