BTSDEX v.4.x

in utopian-io •  2 months ago

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. 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:

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:

let account = wait for BitShares.login(<login>, <password>);

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

Another way to get a class object is to use the loginFromFile method:

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:

let account = wait BitShares.login(<account>, <password>)
async account.assetIssue(<toName>, <assetSymbol>, <amount>, <memo>))

memo is not a required parameter.

To burn tokens:

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.

If you like what I am doing, put an star in btsdex!!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @scientistnik! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

Award for the number of upvotes 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

Do not miss the last post from @steemitboard:

SteemitBoard - Witness Update
SteemFest³ - SteemitBoard support the Travel Reimbursement Fund.

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