Commit Graph

9 Commits

Author SHA1 Message Date
TomZ 4962804d3f Move common code to its own method 2020-07-28 12:35:27 +02:00
TomZ ff70c7e4da Remove obsolete doc 2020-07-27 21:04:46 +02:00
TomZ da773ae97e Add UTXO accessor methods 2020-07-27 20:05:53 +02:00
TomZ be5663ba7e Start new service, add getLiveTransaction method 2020-07-27 12:41:23 +02:00
TomZ a529506cd0 Add getBlockHeader getter 2020-07-27 12:00:42 +02:00
TomZ 35c2b9d17a Add getRawTransaction method 2020-07-27 11:44:26 +02:00
TomZ c579d1da47 small fixes 2020-07-27 11:42:25 +02:00
TomZ d695d85ddb Make much complete the sending of messages
This converts more JS values to the proper NetworkManager values
and vice versa for the return message.

Return messages now have the following structure;

{
  serviceId: 1,
  messageId: 1,
  '67': 'main',
  '68': 644459,
  header: {},
  body: [
    { key: '67', value: 'main' },
    { key: '68', value: 644459 },
  ]
}

The keys in CMF are all intergers, and the 67 and 68 here are examples.
The body is now an array of properties.

For convenience each item is also set on the main return message.
Be aware, though, that for properties that are repeated only the last
one will be present on the return-message.

This commit also implements several blockchain service methods and
adds an example.

Last point is that for byte-arrays (like hashes) we produce a property
like this:
{
  key: '70',
  value: [Uint8Array],
  string: '000000000000000001613440a154e4c35c6467f65dafd70605d5578ec00b0192'
}

Again, as convenience, we add the string version of hashes. This is also
present on the return-message as '70str' next to the '70' bytearray.
2020-07-18 14:42:50 +02:00
TomZ 30108aba48 Combine with native JavaScript lib
This starts a native JS lib, taking inspiration for the basics
from the Flowee-JS-pure repo.
Additionally this exposes sending of CMF messages from JS over
the connection already set up in C++.
2020-07-17 23:20:23 +02:00