Merge pull request #9 from mempool/feature/add-cnd-link
Add CDN provider to the mempool.js.
This commit is contained in:
commit
70d31f2062
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
|||||||
/node_modules
|
/node_modules
|
||||||
/lib
|
/lib
|
||||||
|
/dist/*
|
||||||
|
!.gitkeep
|
29
README.md
29
README.md
@ -1,9 +1,9 @@
|
|||||||
# Mempool JS API
|
# Mempool JS API
|
||||||
|
|
||||||
[](https://www.npmjs.org/package/mempool-js)
|
[](https://badge.fury.io/js/%40mempool%2Fmempool-js)
|
||||||
[](https://david-dm.org/mempool/mempool-js#info=dependencies)
|
[](https://david-dm.org/mempool/mempool-js#info=dependencies)
|
||||||
[](https://snyk.io/test/github/mempool/mempool-js)
|
[](https://snyk.io/test/github/mempool/mempool-js)
|
||||||
[](https://opensource.org/licenses/MIT)
|
[](https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
NPM package module for Mempool JS API.
|
NPM package module for Mempool JS API.
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ Documentation: [https://mempool.space/api](https://mempool.space/api)
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- [Instalation](#installation)
|
- [Installation](#installation)
|
||||||
- [CommonJS](#commonjs)
|
- [CommonJS](#commonjs)
|
||||||
- [NodeJS](#es-modules)
|
- [NodeJS](#es-modules)
|
||||||
- [Usage](#usage)
|
- [Usage](#usage)
|
||||||
@ -79,6 +79,7 @@ Then import the module.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
import mempoolJS from '@mempool/mempool-js';
|
import mempoolJS from '@mempool/mempool-js';
|
||||||
|
|
||||||
const {
|
const {
|
||||||
addresses,
|
addresses,
|
||||||
blocks,
|
blocks,
|
||||||
@ -104,7 +105,23 @@ const { address } = mempoolJS({
|
|||||||
|
|
||||||
### **CommonJS**
|
### **CommonJS**
|
||||||
|
|
||||||
First, include the script located on the `dist` folder.
|
We provide you our own link to `mempool-js`:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script type="text/javascript" src="https://mempool.space/mempool.js"></script>
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to run your own build, run the script:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# npm
|
||||||
|
$ npm run build
|
||||||
|
|
||||||
|
# yarn
|
||||||
|
$ yarn build
|
||||||
|
```
|
||||||
|
|
||||||
|
And, include the script located on the `dist` folder.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script type="text/javascript" src="./dist/mempool.min.js"></script>
|
<script type="text/javascript" src="./dist/mempool.min.js"></script>
|
||||||
|
0
dist/.gitkeep
vendored
Normal file
0
dist/.gitkeep
vendored
Normal file
2485
dist/mempool.js
vendored
2485
dist/mempool.js
vendored
File diff suppressed because it is too large
Load Diff
1
dist/mempool.min.js
vendored
1
dist/mempool.min.js
vendored
File diff suppressed because one or more lines are too long
@ -2,7 +2,10 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Page Title</title>
|
<title>Page Title</title>
|
||||||
<script src="./../../dist/mempool.js"></script>
|
<script
|
||||||
|
type="text/javascript"
|
||||||
|
src="https://mempool.space/mempool.js"
|
||||||
|
></script>
|
||||||
<script>
|
<script>
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
const { addresses } = mempoolJS();
|
const { addresses } = mempoolJS();
|
||||||
|
@ -2,7 +2,10 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Page Title</title>
|
<title>Page Title</title>
|
||||||
<script src="./../../dist/mempool.js"></script>
|
<script
|
||||||
|
type="text/javascript"
|
||||||
|
src="https://mempool.space/mempool.js"
|
||||||
|
></script>
|
||||||
<script>
|
<script>
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
const { blocks } = mempoolJS();
|
const { blocks } = mempoolJS();
|
||||||
|
@ -2,7 +2,10 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Page Title</title>
|
<title>Page Title</title>
|
||||||
<script src="./../../dist/mempool.js"></script>
|
<script
|
||||||
|
type="text/javascript"
|
||||||
|
src="https://mempool.space/mempool.js"
|
||||||
|
></script>
|
||||||
<script>
|
<script>
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
const { fees } = mempoolJS();
|
const { fees } = mempoolJS();
|
||||||
|
@ -2,7 +2,10 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Page Title</title>
|
<title>Page Title</title>
|
||||||
<script src="./../../dist/mempool.js"></script>
|
<script
|
||||||
|
type="text/javascript"
|
||||||
|
src="https://mempool.space/mempool.js"
|
||||||
|
></script>
|
||||||
<script>
|
<script>
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
const { mempool } = mempoolJS();
|
const { mempool } = mempoolJS();
|
||||||
|
@ -2,7 +2,10 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Page Title</title>
|
<title>Page Title</title>
|
||||||
<script src="./../../dist/mempool.js"></script>
|
<script
|
||||||
|
type="text/javascript"
|
||||||
|
src="https://mempool.space/mempool.js"
|
||||||
|
></script>
|
||||||
<script>
|
<script>
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
const { transactions } = mempoolJS();
|
const { transactions } = mempoolJS();
|
||||||
|
@ -2,7 +2,10 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Page Title</title>
|
<title>Page Title</title>
|
||||||
<script src="./../../dist/mempool.js"></script>
|
<script
|
||||||
|
type="text/javascript"
|
||||||
|
src="https://mempool.space/mempool.js"
|
||||||
|
></script>
|
||||||
<script>
|
<script>
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
const { websocket } = mempoolJS();
|
const { websocket } = mempoolJS();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user