# npm-komodorpc-library

> An API for KOMODO RPC

Latest version **1.0.7** (published 2019-08-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install npm-komodorpc-library
pnpm add npm-komodorpc-library
yarn add npm-komodorpc-library
bun add npm-komodorpc-library
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2019-08-04 |
| First published | 2019-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 199.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Hafsa Fatima |
| Maintainers | hafsafatima |
| Keywords | npm, npm-komodorpc, npm-komodo, komodo |

## Links

- npm: https://www.npmjs.com/package/npm-komodorpc-library
- Repository: https://github.com/Hafsa-Fatima/Komodo-RPC-Node-Library
- Homepage: https://github.com/Hafsa-Fatima/Komodo-RPC-Node-Library#readme
- Issues: https://github.com/Hafsa-Fatima/Komodo-RPC-Node-Library/issues
- npm.io page: https://npm.io/package/npm-komodorpc-library

## Dependencies (3)

- [request](https://npm.io/package/request.md) ^2.88.0
- [webpack](https://npm.io/package/webpack.md) ^4.35.0
- [turbo-cli](https://npm.io/package/turbo-cli.md) ^0.32.60

## Recent versions

- 1.0.7 (latest) — 2019-08-04
- 1.0.6 — 2019-08-04
- 1.0.5 — 2019-08-04
- 1.0.4 — 2019-08-04
- 1.0.3 — 2019-08-04
- 1.0.2 — 2019-08-04
- 1.0.1 — 2019-08-04

## README

![Komodo_Logo](komodologo.png?raw=true)
# Node JS Library
#### RPC API-Library for Komodo-based asset chains, for Node JS Developers

## Description:
- Komodo RPC library helps you integrate your Node JS Apps with Komodo asset-chains without having to setup/implement required RPC functions. Install this NPM Module and call Komodo API RPCs as easily as calling a local function. Komodo RPC library acts as a wrapper between your Node JS app and the Komodo-daemon running on a server.

### Installation:
Install 'npm-komodorpc-library' npm Module:
  - > ` npm install npm-komodorpc-library `


## Usage:
- Create object for Connect class using `rpc_user`, `rpc_password`, `rpc_ipaddress`, `rpc_port` parameters from YOUR_SMARTCHAIN_name.conf file
- Use the above object to call any method
- Response is a pending Promise return
- Use Async/Await or Promise to capture the response

##### Example
- Using Async function and await keyword :
```javascript
const komodo = require('npm-komodorpc-library');

const conn = new komodo.Connect(rpc_user='user568251219',
rpc_password='pass766db41922bac0bbe3c1909a41e3dfe0291e2c1b6c76f7172c3e9bdf46f64d16f9',
rpc_ipaddress='http://127.0.0.1',
rpc_port='12450');

async function mainfunc(){
    let walletinfo = await conn.getwalletinfo() // await works in a async function
    console.log(walletinfo)
}

mainfunc()
```
- Using promise :
```javascript
const komodo = require('npm-komodorpc-library');

const conn = new komodo.Connect(rpc_user='user568251219',
rpc_password='pass766db41922bac0bbe3c1909a41e3dfe0291e2c1b6c76f7172c3e9bdf46f64d16f9',
rpc_ipaddress='http://127.0.0.1',
rpc_port='12450');

let walletinfo = conn.getwalletinfo()
walletinfo.then((res)=>console.log(res)) //Promise.prototype.then

```

- Create an object of **Komodo Connect** class with following parameters to populate RPC options and authentication parameters.

|    Argument    |                                          Description                                 |
|:--------------:|:------------------------------------------------------------------------------------:|
|  rpc_username  |                              Username for RPC authentication                         |
|  rpc_password  |                              Password for RPC authentication                         |
| node_ipaddress |  IP address of the node where the Komodo-daemon is running; **Default: '127.0.0.1'** |
|    rpc_port    |                 Port number where the Komodo-daemon is listening for RPCs            |


### Documentation:
-   Wiki: [Komodo RPC API Library](https://github.com/Hafsa-Fatima/Komodo-RPC-Node-Library/)
-  [Komodo API Guide](https://developers.komodoplatform.com/basic-docs/smart-chains/smart-chain-api/)
### NPM package listing:
-  [NPM-komodo-library](https://www.npmjs.com/package/npm-komodorpc-library)

---
_Source: https://npm.io/package/npm-komodorpc-library · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
