21 Commits

Author SHA1 Message Date
tomFlowee 291dedfa30 This adds several features.
* message sending now allows arrays.
The underlying engine allows more than the JS allowed, this has been
fixed.
Specifically we now allow something like:
  message.body[45] = ["first", "second"];

* A new helper method is exposed to JavaScript: parseAddress()
This method allows one to parse Bitcoin addresses and return the
script-hash used elsewhere.
Notice that the second argument is an optional prefix, allowing for
parsing of testnet addresses.
2021-02-26 19:37:16 +01:00
tomFlowee f4fb05cd6b Also cancel any promises open on shutdown. 2021-02-20 11:04:15 +01:00
tomFlowee 525ef09b64 Warp callbacks in unique_ptrs
The NodeJS APis break expected contracts with regards to the
Napi::ThreadSafeFunction and that makes them not work as a normal
object.
Using new / delete on them works much better and allows the user
to re-assign a callback to a new value.
2021-02-17 21:02:06 +01:00
tomFlowee 0b3487c2ea Add onChainChanged() callback for new blocks 2021-02-15 12:15:07 +01:00
tomFlowee 665b18cf0b Add 'stop()' to shut down the engine 2021-02-15 10:46:56 +01:00
tomFlowee baf11f749e Split ContextData into two classes.
This separates the JavaScript napi stuff better from the rest.
2021-02-14 19:44:28 +01:00
tomFlowee 7ce891937a Be more silent by default 2021-02-12 21:38:06 +01:00
tomFlowee 1691cb19b1 Make testnet4 work much easier.
This adds calls;
    Flowee.testConnectHub()
    Flowee.testConnectIndexer()

And if you want to connect to both:
    Flowee.testConnect()
2020-12-16 22:11:55 +01:00
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 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 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 18037f09f1 Add Flowee.sendTransaction() JavaScript call. 2019-12-27 22:25:49 +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 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 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 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