mempool/README.md
Miguel Medeiros c80f82a0b1
v2.3.0 (#12)
* FIX: getBlocks optional params

* v2.3.0 - new minor version for mempool-js
- Add support for Bisq API
- Add support for Liquid API
- Change the main object to export network objects.
- Change README.md instructions.

Co-authored-by: softsimon <softsimon@users.noreply.github.com>
2021-04-14 17:27:28 -03:00

100 lines
2.9 KiB
Markdown

# Mempool JS API
[![npm version](https://img.shields.io/npm/v/@mempool/mempool-js.svg?style=flat-square)](https://www.npmjs.org/package/mempool-js)
[![NPM](https://img.shields.io/david/mempool/mempool-js.svg?style=flat-square)](https://david-dm.org/mempool/mempool-js#info=dependencies)
[![Known Vulnerabilities](https://snyk.io/test/github/mempool/mempool-js/badge.svg?style=flat-square)](https://snyk.io/test/github/mempool/mempool-js)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
NPM package module for Mempool APIs.
[https://mempool.tools/mempool-js](https://mempool.tools/mempool-js)
---
## **Installation**
### **ES Modules**
Install the npm module.
```bash
# npm
$ npm install @mempool/mempool-js --save
# yarn
$ yarn add @mempool/mempool-js
```
Or if you're not into package management, just [download a ZIP](https://github.com/mempool/mempool-js/archive/refs/heads/main.zip) file.
Import the module.
```js
import mempoolJS from '@mempool/mempool-js';
// default mempool.space endpoints
const { bitcoin, bisq, liquid } = mempoolJS();
// (alternative) your custom endpoints
const { bitcoin, bisq, liquid } = mempoolJS({
homespace: 'mempool.space',
});
```
### **CommonJS**
Include the line below in the `head` tag of your html file.
```html
<script type="text/javascript" src="https://mempool.space/mempool.js"></script>
```
Call `mempoolJS` function to access the API methods.
```js
// default mempool.space endpoints
const { bitcoin, bisq, liquid } = mempoolJS();
// (alternative) your custom endpoints
const { bitcoin, bisq, liquid } = mempoolJS({
homespace: 'mempool.space',
});
```
---
## **Features**
- [Bitcoin](./README-bitcoin.md)
- [Addresses](./README-bitcoin.md#get-address)
- [Blocks](./README-bitcoin.md#get-blocks)
- [Fees](./README-bitcoin.md#get-fees)
- [Mempool](./README-bitcoin.md#get-mempool)
- [Transactions](./README-bitcoin.md#get-transactions)
- [Websocket Client](./README-bitcoin.md#Websocket-Client)
- [Websocket Server](./README-bitcoin.md#Websocket-Server)
- [Bisq](./README-bisq.md#get-address)
- [Addresses](./README-bisq.md#get-address)
- [Blocks](./README-bisq.md#get-blocks)
- [Statistics](./README-bisq.md#get-statistics)
- [Transactions](./README-bisq.md#get-transactions)
- [Liquid](./README-liquid.md#get-address)
- [Addresses](./README-liquid.md#get-address)
- [Assets](./README-liquid.md#get-address)
- [Blocks](./README-liquid.md#get-address)
- [Fees](./README-liquid.md#get-address)
- [Mempool](./README-liquid.md#get-address)
- [Transactions](./README-liquid.md#get-address)
- [Websocket Client](./README-liquid.md#Websocket-Client)
- [Websocket Server](./README-liquid.md#Websocket-Server)
---
## **Contributing**
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
---
## **License** [MIT](https://choosealicense.com/licenses/mit/)