Taiyi.js the JavaScript API for Taiyi network
Here is full documentation: https://github.com/hongzhongx/taiyi-js/tree/master/doc/README.md
<script src="./taiyi.min.js"></script>
<script>
taiyi.api.getAccounts(['taisifu', 'dasifu'], function(err, response){
console.log(err, response);
});
</script>
https://cdn.jsdelivr.net/npm/@taiyinet/taiyi/dist/taiyi.min.js
<script src="https://cdn.jsdelivr.net/npm/@taiyinet/taiyi/dist/taiyi.min.js"></script>
Please have a look at the webpack usage example.
$ npm install @taiyinet/taiyi-js --save
https://api.taiyi.com By Default
var taiyi = require('@taiyinet/taiyi-js');
var wif = taiyi.auth.toWif(username, password, 'posting');
taiyi.broadcast.vote(wif, voter, author, permlink, weight, function(err, result) {
console.log(err, result);
});
taiyi.api.getAccounts(['taisifu', 'zuowangdao'], function(err, result) {
console.log(err, result);
});
taiyi-js requires some configuration to work on the public taiyi testnet.
You need to set two Taiyi API options, address_prefix
and chain_id
.
taiyi.api.setOptions({
address_prefix: 'TAI',
chain_id: '18dcf0a285365fc58b71f18b3d3fec954aa0c141c44e4e5cb4cf777b9eab274e',
useTestNet: true,
});
The Chain ID could change. If it does, it may not be reflected here, but will be documented on any testnet launch announcements.
Patches are welcome! Contributors are listed in the package.json file. Please run the tests before opening a pull request and make sure that you are passing all of them. If you would like to contribute, but don't know what to work on, check the issues list.
When you find issues, please report them!
MIT