0.5.0 • Published 5 years ago

bottos-sdk-js v0.5.0

Weekly downloads
3
License
GPL-3.0
Repository
github
Last release
5 years ago

Bottos JavaScript API

You need to run a local Bottos node to use this library.

The SDK supports below features:

  1. wallet creation
  2. smart contract calling
  3. smart contract deplyment
  4. Transaction, stake
  5. connection management to chain (to do)

Documentation

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.

0.5.0

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.13

5 years ago

0.2.12

5 years ago

0.2.11

5 years ago

0.2.10

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago