You need to run a local Bottos node to use this library.
Bottos JavaScript APIYou need to run a local Bottos node to use this library.
The SDK supports below features:
- wallet creation
- smart contract calling
- smart contract deplyment
- Transaction, stake
- connection management to chain (to do)
Installation
Node.js
If you use npm
npm install bottos-sdk-js --save
or yarn
yarn add bottos-sdk-js
Usage
In node:
var BottosWalletSDK = require('bottos-sdk-js');
In browers:
<script src="path/to/bottos-sdk-js.min.js"></script> <!-- or a CDN --> <script src="unpkg.com/bottos-sdk-js"></script>
file
You can find the bottos-sdk-js.min.js file on release page
Then:
const sdk = new BottosWalletSDK({ baseUrl: "http://localhost:8689/v1" }); const Wallet = sdk.Wallet
There you go, now you can use it:
const Keypairs = Wallet.createKeys() console.log('Keypairs', Keypairs)
Send a transaction:
const params = { from: 'testaccount1', to: 'testaccount2', value: 100, } let privateKey = 'b4e0391643ff9be326a6ddfa543df0e0c2e37b7e11ed2f45590c62a5d5f09d9f' Wallet.sendTransaction(params, privateKey) .then(res => { console.log('sendTransaction res:', res) })
You can find more examples in the example
directory.
HomePage
https://github.com/bottos-project/bottos-sdk-js#readme
Repository
git://github.com/bottos-project/bottos-sdk-js.git