Tilkal / multichain-api

MultiChain JSON-RPC Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MultiChain API

MIT License NPM Version Build Status Code Coverage

MultiChain API is an unofficial MultiChain 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

npm install --save multichain-api

Examples

TypeScript example:

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:

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

License

MIT

About

MultiChain JSON-RPC Client

License:MIT License


Languages

Language:TypeScript 100.0%