-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
594d10d
commit 522d824
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,37 @@ | ||
# boa-sdk-ts | ||
SDK to interface with the BOSAGORA blockchain | ||
boa-sdk-ts is a TypeScript/JavaScript library for communicating with the Stoa API server. | ||
It also has utility functions such as hashing and pre-image validation. | ||
|
||
## Install | ||
```bash | ||
$ npm install --save boa-sdk-ts | ||
``` | ||
|
||
## Import the your library | ||
```import * as BoaSdk from "boa-sdk-ts";``` | ||
|
||
## Usage | ||
```TypeScript | ||
// Create BOA Client | ||
let boa_client = new BoaSdk.BOAClient("http://localhost:3836"); | ||
|
||
// Query | ||
boa_client.getValidator("GA3DMXTREDC4AIUTHRFIXCKWKF7BDIXRWM2KLV74OPK2OKDM2VJ235GN", 10) | ||
.then((validators: Array<BoaSdk.Validator>) => | ||
{ | ||
// On Success | ||
}) | ||
.catch(err => | ||
{ | ||
// On Error | ||
}); | ||
``` | ||
|
||
## Testing | ||
```bash | ||
$ git clone https://github.com/bpfkorea/boa-sdk-ts.git | ||
$ npm install | ||
$ npm run build | ||
$ npm test | ||
``` |