create account

BTSDEX v0.5.0 by scientistnik

View this thread on: hive.blogpeakd.comecency.com
· @scientistnik ·
$8.00
BTSDEX v0.5.0
![BTSDEX.png](https://cdn.steemitimages.com/DQmUoXuik5TKhpRZqLLXBwsTs8ZadaitQAm8k97jqsA364B/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:
```js
$ 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:
```js
$ btsdex --testnet
```

## Browserify

Added generation of files for inclusion in the browser through the tag `<script>`. The files are available in the [releases](https://github.com/scientistnik/btsdex/releases) on the GitHub.

To include in your HTML page:
```html
<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](https://cdn.steemitimages.com/DQmPJozZMbrSkqgBM5Abegxd8cAe6Z9RkDboB3kd1uwioLH/Screenshot%20from%202018-09-16%2015-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:
```js
BitShares.disconnect ()
```

<hr>

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!
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 35 others
properties (23)
authorscientistnik
permlinkbtsdex-v0-5-0
categoryutopian-io
json_metadata{"tags":["utopian-io","bitshares","blockchain"],"image":["https://cdn.steemitimages.com/DQmUoXuik5TKhpRZqLLXBwsTs8ZadaitQAm8k97jqsA364B/BTSDEX.png","https://cdn.steemitimages.com/DQmPJozZMbrSkqgBM5Abegxd8cAe6Z9RkDboB3kd1uwioLH/Screenshot%20from%202018-09-16%2015-57-38.png"],"links":["https://github.com/scientistnik/btsdex/releases"],"app":"steemit/0.1","format":"markdown"}
created2018-09-16 13:13:33
last_update2018-09-16 13:13:33
depth0
children1
last_payout2018-09-23 13:13:33
cashout_time1969-12-31 23:59:59
total_payout_value6.116 HBD
curator_payout_value1.881 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,409
author_reputation748,919,157,653
root_title"BTSDEX v0.5.0"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,447,155
net_rshares6,615,502,692,134
author_curate_reward""
vote details (99)
@steemitboard ·
Congratulations @scientistnik! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

[![](https://steemitimages.com/70x80/http://steemitboard.com/notifications/payout.png)](http://steemitboard.com/@scientistnik) Award for the total payout received

<sub>_Click on the badge to view your Board of Honor._</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



> Support [SteemitBoard's project](https://steemit.com/@steemitboard)! **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-scientistnik-20180925t013017000z
categoryutopian-io
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2018-09-25 01:30:18
last_update2018-09-25 01:30:18
depth1
children0
last_payout2018-10-02 01:30:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length687
author_reputation38,975,615,169,260
root_title"BTSDEX v0.5.0"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id72,180,179
net_rshares0