This version is still in development, but I would like to talk about this and possibly get feedback.
Interactive mode
Added interactive mode to the package. Now when you install the package globally, it becomes available from the command line:
$ npm i -g btsdex
$ btsdex
> |
In fact, this is a conventional REPL-console with pre-defined variables:
BitShares
, the main class of the package;login
, the equivalent ofBitShares.login
generateKeys
, a function for generating keysaccounts
, the equivalent ofBitShares.accounts
assets
, the equivalent ofBitShares.assets
db
, the equivalent ofBitShares.db
history
, analogue ofBitShares.hostory
network
, the equivalent ofBitShares.network
fees
, the equivalent ofBitShares.fees
For example:
$ btsdex
> fees
Fees {
transfer: 0.1042,
limit_order_create: 0.00578,
limit_order_cancel: 0.00057,
call_order_update: 0.00578,
...}
>
When you start btsdex
, it tries to connect to the main network. If you want to connect to the testnet:
$ btsdex --testnet
Browserify
Added generation of files for inclusion in the browser through the tag <script>
. The files are available in the releases on the GitHub.
To include in your HTML page:
<script src = "btsdex.min.js"> </ script>
After enabling, the BitShares
class is available in the browser console.
Tests for mocha
The project already suffered from the lack of tests. It's time to test the minimum before the release.
To date, only one test for the BitShares
class has been written. Over time, I hope everything will be covered in the tests.
disconnect ()
Personally, I did not need to disconnect. But when writing the tests, and solving the issue of the REPL-version of the package, it was understood that the shutdown function is necessary.
It's very simple to use:
BitShares.disconnect ()
If you have a wish for a REPL-mode, or maybe there is not a very useful function, write to GitHub.
On this I have everything. Great weekend to everyone!
Congratulations @scientistnik! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
Award for the total payout received
Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word
STOP
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit