Skip to content
Snippets Groups Projects
Commit 5b61f26b authored by Mahdi Yari's avatar Mahdi Yari
Browse files

Update README.md

parent 26eec298
No related branches found
No related tags found
1 merge request!17update readme
......@@ -25,11 +25,13 @@
- [Utils](#utils)
- [Tutorials](#tutorials)
- - - - - - - - - - - - - - - - - -
# Install
```
$ npm install @hiveio/hive-js --save
```
- - - - - - - - - - - - - - - - - -
# Browser
```html
<script src="./hive.min.js"></script>
......@@ -40,12 +42,14 @@ hive.api.getAccounts(['mahdiyari', 'hiveio'], function(err, response){
</script>
```
- - - - - - - - - - - - - - - - - -
## CDN
https://cdn.jsdelivr.net/npm/@hiveio/hive-js/dist/hive.min.js<br/>
```html
<script src="https://cdn.jsdelivr.net/npm/@hiveio/hive-js/dist/hive.min.js"></script>
```
- - - - - - - - - - - - - - - - - -
## Config
Default config should work with Hive. However you can change default config.
as
......@@ -56,21 +60,26 @@ hive.config.set('chain_id','beeab0de00000000000000000000000000000000000000000000
hive.config.set('alternative_api_endpoints', ['https://api.hive.blog', 'https://anyx.io']);
```
- - - - - - - - - - - - - - - - - -
### set
```
hive.config.set('address_prefix','STM');
```
- - - - - - - - - - - - - - - - - -
### get
```
hive.config.get('chain_id');
```
- - - - - - - - - - - - - - - - - -
## JSON-RPC
Here is how to activate JSON-RPC transport:
```js
hive.api.setOptions({ url: 'https://api.hive.blog' });
```
- - - - - - - - - - - - - - - - - -
# API
## Subscriptions
......@@ -81,6 +90,7 @@ hive.api.setSubscribeCallback(callback, clearFilter, function(err, result) {
console.log(err, result);
});
```
- - - - - - - - - - - - - - - - - -
### Set Pending Transaction Callback
```
hive.api.setPendingTransactionCallback(cb, function(err, result) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment