multichain-api
Version:
MultiChain JSON-RPC Client
71 lines (50 loc) • 1.86 kB
Markdown
# MultiChain API
[](https://opensource.org/licenses/MIT)
[](https://www.npmjs.com/package/multichain-api)
[](https://travis-ci.org/Tilkal/multichain-api)
[](https://codecov.io/gh/Tilkal/multichain-api)
**MultiChain API** is an unofficial [MultiChain](http://www.multichain.com/) client for *Node.js* written in *TypeScript*.
> 💡 The `alpha` status only denotes that the unit tests are incomplete, but the client should be fully functional.
## Features
* `Promise`-based functional API
* Optimized for serverless architecture
## Installation
```shell
npm install --save multichain-api
```
## Examples
*TypeScript* example:
```typescript
import { GetBlock } from 'multichain-api/Commands/GetBlock'
import { RpcClient } from 'multichain-api/RpcClient'
const client = RpcClient({
protocol: 'http',
host: '127.0.0.1',
port: 8570,
username: 'multichainrpc'
password: '...'
})
client(GetBlock(42))
.then(response => console.log(response))
.catch(error => console.log(error))
```
*JavaScript* example:
```javascript
const { GetBlock } = require('multichain-api/Commands/GetBlock')
const { RpcClient } = require('multichain-api/RpcClient')
const client = RpcClient({
protocol: 'http',
host: '127.0.0.1',
port: 8570,
username: 'multichainrpc'
password: '...'
})
client(GetBlock(42))
.then(response => console.log(response))
.catch(error => console.log(error))
```
## Resources
* [Wiki](https://github.com/Tilkal/multichain-api/wiki)
* [API Documentation](https://tilkal.github.io/multichain-api/)
## License
[MIT](LICENSE)