create account

BTSDEX v.4.x by scientistnik

View this thread on: hive.blogpeakd.comecency.com
· @scientistnik ·
$0.69
BTSDEX v.4.x
![BTSDEX.png](https://cdn.steemitimages.com/DQmYf7vDJyxqn2Mic3iWh2XdWSqRf3xwCPsN2dZo7YW8373/BTSDEX.png)

Since my last post, many new versions have been added. Before I start the version of `v0.5.X` I would like to tell you about the changes in the version `v0.4.X`.

Before I start, it is worth noting that third-party developers have joined the development. Someone reported on the found bugs, someone suggested pull-requests. Special thanks would like to express [@technologiespro](https://github.com/technologiespro). Thanks to him the version 0.4.X was enriched with even more functionality.

## Autoreconnect

Autoreconnect was added to increase the resilience when the connection to the server was broken for a long time. This can be, for example, if you have an Internet connection disconnected.

Auto-reconnect is enabled by default and will try to restore the connection for an infinitely long time. If you do not need this behavior, you should specify this when initializing the `BitShares` class:
```JS
const BitShares = require ("btsdex");

BitShares.init ("wss: //bitshares.openledger.info/ws", false, false);
```

## login and loginFromFile

To access your account, many use the login and password or via the `*.bin`-file. This simplifies the interaction: there is no need to remember three different private keys, it is enough to store only one.

I decided to add this to the package `btsdex`. If you know only the login and password from your account, just write:
```JS
let account = wait for BitShares.login(<login>, <password>);
```

Now in `account` the same object of class `BitShares`, in which the keys `active` and` memo` are put.

Another way to get a class object is to use the `loginFromFile` method:
```JS
const buffer = fs.readFileSync(<bit-file>);
let account = wait for BitShares.loginFromFile(buffer, <password>, <accountName>);
```

## assetIssue and assetReserve

The `BitShares` class is enriched with two operations:` asset_issue` for issue, and `asset_reserve` for burning tokens.

To issue tokens:
```JS
let account = wait BitShares.login(<account>, <password>)
async account.assetIssue(<toName>, <assetSymbol>, <amount>, <memo>))
```
`memo` is not a required parameter.

To burn tokens:
```JS
let account = wait BitShares.login(<account>, <password>)
async account.assetReserve(<assetSymbol>, <amount>)
```

# Plans for version 0.5.x

- It has come to realize that there is very little functionality for adding more than one oeration to a single transaction. How to organize it right is yet to be decided. But I think it will be decided in the next version.

- Also, the documentation would like to be made available for editing the community through a pullrequest. Create a separate repository - a bad solution. But the capabilities of the Github page may well come up.

- Build packages to connect directly to the browser without compiling.

- Some of the functionality of `btsdex` was very useful mainly in the repositories `bitsharesjs-ws` and `bitsharesjs`. One such proposal has already [been approved](https://github.com/bitshares/bitsharesjs-ws/pull/23).

If you like what I am doing, put an star in [btsdex](https://github.com/scientistnik/btsdex)!!
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 5 others
properties (23)
authorscientistnik
permlinkbtsdex-v-4-x
categoryutopian-io
json_metadata{"tags":["utopian-io","bitshares","blockchain"],"image":["https://cdn.steemitimages.com/DQmYf7vDJyxqn2Mic3iWh2XdWSqRf3xwCPsN2dZo7YW8373/BTSDEX.png"],"links":["https://github.com/technologiespro","https://github.com/bitshares/bitsharesjs-ws/pull/23","https://github.com/scientistnik/btsdex"],"app":"steemit/0.1","format":"markdown"}
created2018-09-09 13:04:09
last_update2018-09-09 13:04:09
depth0
children1
last_payout2018-09-16 13:04:09
cashout_time1969-12-31 23:59:59
total_payout_value0.556 HBD
curator_payout_value0.129 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,197
author_reputation748,919,157,653
root_title"BTSDEX v.4.x"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id70,786,673
net_rshares644,070,876,257
author_curate_reward""
vote details (69)
@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/voted.png)](http://steemitboard.com/@scientistnik) Award for the number of upvotes 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>



**Do not miss the last post from @steemitboard:**
<table><tr><td><a href="https://steemit.com/steemitboard/@steemitboard/steemitboard-witness-update-2018-09-07"><img src="https://steemitimages.com/64x128/http://i.cubeupload.com/7CiQEO.png"></a></td><td><a href="https://steemit.com/steemitboard/@steemitboard/steemitboard-witness-update-2018-09-07">SteemitBoard - Witness Update</a></td></tr><tr><td><a href="https://steemit.com/steemfest/@steemitboard/steemfest-steemitboard-support-the-travel-reimbursement-fund"><img src="https://steemitimages.com/64x128/https://cdn.steemitimages.com/DQmawPYDAwfrQM8YU6ejD1f87g64cvsmEFn8RQKHJMs4zxg/image.png"></a></td><td><a href="https://steemit.com/steemfest/@steemitboard/steemfest-steemitboard-support-the-travel-reimbursement-fund">SteemFest³ - SteemitBoard support the Travel Reimbursement Fund.</a></td></tr></table>

> 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-20180909t231142000z
categoryutopian-io
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2018-09-09 23:11:42
last_update2018-09-09 23:11:42
depth1
children0
last_payout2018-09-16 23:11:42
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_length1,554
author_reputation38,975,615,169,260
root_title"BTSDEX v.4.x"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id70,828,736
net_rshares0