BTSDEX v0.5.0

in #utopian-io6 years ago

BTSDEX.png
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 of BitShares.login
  • generateKeys, a function for generating keys
  • accounts, the equivalent of BitShares.accounts
  • assets, the equivalent of BitShares.assets
  • db, the equivalent of BitShares.db
  • history, analogue of BitShares.hostory
  • network, the equivalent of BitShares.network
  • fees, the equivalent of BitShares.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.
Screenshot from 2018-09-16 15-57-38.png

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!

Sort:  

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

Support SteemitBoard's project! Vote for its witness and get one more award!

Coin Marketplace

STEEM 0.28
TRX 0.11
JST 0.034
BTC 66272.75
ETH 3183.00
USDT 1.00
SBD 4.09