NativeScript ElectrumX-Client
The ElectrumX-Client NativeScript plugin allows your application to communicate with an ElectrumX Server. ElectrumX servers act as middleware allowing remote clients to fetch and send blockchain requests via TCP and TLS sockets to fetch and send blockchain related information.
Requirements
This plugin requires android.permission.INTERNET
to work properly. This must be added to your AndroidManifest.xml
file.
Installation
$ tns plugin add nativescript-electrumx-client
Usage
Simply import the ElectrumxClient
from this plugin and start using in your application. This plugin supports async/await/promises
for a callback structure and utilizes the events to allow for a subscription service for specific events and streams from an ElectrumX Server.
Example usage is listed below:
;
Limitations
This plugin is currently not available for iOS devices (Contributions for iOS support are welcomed and desired!) and socket connections are currently only supported via TCP. TLS support would be great, but would require further enhancements of the SimpleNetworking plugin we're working off of
Acknowledgements
This plugin contains modified code based on the following sources:
node-electrum-client | https://github.com/you21979/node-electrum-client |
---|---|
nativescript-simple-networking | https://github.com/yaqwsx/nativescript-simple-networking |
I'd like to give thanks to the contributors and authors of the works above as their solved headaches made this plugin less of a headache (sort of 😅).