Commit Graph

27 Commits

Author SHA1 Message Date
TomZ d0df3452cb Make connecting to one server work better
This ensures that we also resolve the promise when only one
of the server-types (hub/indexer) is connected to.
2020-07-27 19:26:05 +02:00
TomZ 4e042ce150 fix misuses of hashToString 2020-07-27 11:43:55 +02:00
TomZ 7edbcc6ba3 Enrich addressmonitor callback object
Allow for the possibility that more than one watched address matches
the transaction we notify about and therefore make an array.
Additionally, include the block-height property when mined.
2020-07-27 10:53:06 +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 e3e3eb90d0 Make sendMessage call return the msg to JS 2020-07-17 23:21:06 +02:00
TomZ 04e4a9cac2 Make an actual C++ message to be sent
This takes the JavaScript 'message' object and converts it into
a message that the NetworkManager uses.
2020-07-17 23:21:05 +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
TomZ 5e82bef884 Actually include the imported data in the git repo. 2020-05-20 12:11:23 +02:00
TomZ 6590d39b3b List the indexer status 2020-05-20 12:06:21 +02:00
TomZ d7dc95dac4 Add support for the AddressMonitor service 2019-12-30 18:49:53 +01:00
TomZ 9a4e015d96 Fix typo
Make the connectHub/connectIndexer methods work again.
2019-12-27 22:25:49 +01:00
TomZ 18037f09f1 Add Flowee.sendTransaction() JavaScript call. 2019-12-27 22:25:49 +01:00
TomZ 4acb75ffe5 Fix property-name. It had a trailing space. 2019-12-23 15:02:13 +01:00
TomZ 23f61912f3 Last minute API review; IncludeTxId -> IncludeTxid 2019-12-23 15:01:52 +01:00
TomZ 95e3390509 Fixlet due to api review. 2019-12-19 01:26:20 +01:00
TomZ a7bca1a5b0 Port Search to use the Flowee wrappers of callbacks
Those are safer.
2019-12-09 15:10:27 +01:00
TomZ 7539772be0 Re-do the connect() family of methods.
Working around lots of NodeJS stupidities.
2019-12-09 15:10:27 +01:00
TomZ 51e1adf740 Make connect return a Promise
this allows us to only do stuff when the connections have been made.
2019-12-01 23:03:56 +01:00
TomZ 122672211c Make most of search work. 2019-11-30 20:07:39 +01:00
TomZ 8a1f6cbdf9 Make search object actually find stuff 2019-11-29 20:12:16 +01:00
TomZ 7a29d404ae Work on a search option for FloweeJS 2019-11-28 23:58:56 +01:00
TomZ 05699c6bc8 cleanup example.js 2019-11-13 17:52:17 +01:00
TomZ f2b95d5151 Change build system, make work for npm registry
In Flowee the main repo I removed the Qt dependency for the stuff
we use and in this repo I stopped linking to the externally built
flowee libraries.

This introduces an import.sh which copies the flowee sources we use
in this plugin to sure there being minimumal external dependencies.
2019-11-13 14:56:21 +01:00
TomZ 99d16e38a7 Fixlet of comment 2019-11-12 12:41:41 +01:00
TomZ 1d2fbaee23 Actually hook up the javascript to the Flowee code
This discovers the joys of NodeJS' threadsafe-functions
and makes the callbacks work so we can see that we actually
connected to the hub & indexer
2019-11-09 22:31:54 +01:00
TomZ bd795729c2 Port to the C++ api 2019-11-09 19:10:11 +01:00
TomZ 03ede89c36 Refactor; move code around 2019-11-09 18:18:56 +01:00