# mattercloudjs

> MatterCloud Javascript SDK - https://www.mattercloud.net

Latest version **1.1.2** (published 2020-06-01) · Open BSV license · 0 weekly downloads

## Install

```sh
npm install mattercloudjs
pnpm add mattercloudjs
yarn add mattercloudjs
bun add mattercloudjs
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2020-06-01 |
| First published | 2019-11-29 |
| Weekly downloads | 0 |
| License | Open BSV |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 59.1 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 14 |
| Author | MatterCloud - Matter Web Services Inc. |
| Maintainers | mattercloud |
| Keywords | bitcoin, bsv, bitcoin-sv, metanet, blockchain, mattercloud, satoshi, satoshi-vision |

## Links

- npm: https://www.npmjs.com/package/mattercloudjs
- Repository: https://github.com/MatterCloud/mattercloudjs
- Homepage: https://github.com/MatterCloud/mattercloudjs#readme
- Issues: https://github.com/MatterCloud/mattercloudjs/issues
- npm.io page: https://npm.io/package/mattercloudjs

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.18.0
- [eventsource](https://npm.io/package/eventsource.md) ^1.0.7

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.1.2 (latest) — 2020-06-01
- 1.1.1 — 2020-04-17
- 1.0.13 — 2020-03-11
- 1.0.12 — 2020-03-08
- 1.0.11 — 2020-03-08
- 1.0.10 — 2020-03-06
- 1.0.8 — 2020-03-05
- 1.0.7 — 2020-03-03
- 1.0.6 — 2019-11-30
- 1.0.5 — 2019-11-30
- 1.0.4 — 2019-11-30
- 1.0.2 — 2019-11-29
- 1.0.1 — 2019-11-29

## README

# MatterCloud Javascript Library
> Bitcoin SV and Metanet API for Developers
> [MatterCloud.net](https://www.MatterCloud.net)

*Replaces [BitIndex SDK](https://github.com/bitindex/bitindex-sdk)*

![header](header.png)

[VIEW COMPLETE DEVELOPER DOCUMENTATION](https://developers.mattercloud.net)

---

## Quick Start

_Small < 24KB library size_
**Installation**
```sh
npm install mattercloudjs --save
```

**Include**

[Generate an API key](https://www.mattercloud.net/#get-api-key)

```javascript
// NodeJS
var options = {
    api_key: "your api key",
}
var mattercloud = require('mattercloudjs').instance(options);

// Or set API key later
mattercloud.setApiKey("your api key");
```

##  Preview

Easily query balances, utxos, and transactions on the Bitcoin SV Blockchain.

#### Get balance

```javascript
var result = await mattercloud.getBalance('12XXBHkRNrBEb7GCvAP4G8oUs5SoDREkVX');
```

GET https://api.mattercloud.net/api/v3/main/address/12XXBHkRNrBEb7GCvAP4G8oUs5SoDREkVX/balance

Response:
```
{
  "address": "12XXBHkRNrBEb7GCvAP4G8oUs5SoDREkVX",
  "confirmed": 30055,
  "unconfirmed": 0
}
```
#### Get utxos

```javascript
var result = await mattercloud.getUtxos('12XXBHkRNrBEb7GCvAP4G8oUs5SoDREkVX');
```

GET https://api.mattercloud.net/api/v3/main/address/12XXBHkRNrBEb7GCvAP4G8oUs5SoDREkVX/utxo

Response:
```
[
  {
    "address": "12XXBHkRNrBEb7GCvAP4G8oUs5SoDREkVX",
    "txid": "5e3014372338f079f005eedc85359e4d96b8440e7dbeb8c35c4182e0c19a1a12",
    "vout": 0,
    "amount": 0.00015399,
    "satoshis": 15399,
    "value": 15399,
    "height": 576168,
    "confirmations": 34730,
    "scriptPubKey": "76a91410bdcba3041b5e5517a58f2e405293c14a7c70c188ac",
    "script": "76a91410bdcba3041b5e5517a58f2e405293c14a7c70c188ac",
    "outputIndex": 0
  }
]
```

[VIEW COMPLETE DEVELOPER DOCUMENTATION](https://developers.mattercloud.net)

## Detailed Installation and Usage

**Installation**
```sh
npm install mattercloudjs --save
```

**Include**
```javascript
// Node
var options = {
    api_key: "your api key",
}
var mattercloud = require('mattercloudjs').instance(options);

```

```html
<!-- Browser -->
<script src="dist/mattercloud.js"></script>
<script language="javascript">
    // mattercloud.setApiKey('my key');
    var result = await mattercloud.getUtxos('12XXBHkRNrBEb7GCvAP4G8oUs5SoDREkVX');
    console.log('result', result);
</script>
```
See browser usage examples: https://github.com/MatterCloud/mattercloudjs/blob/master/dist/basic.html

### Promises vs. Callback

Both `await` and callback styles are supported for all methods.

Example:

```javascript

// Await style with promises
var result = await mattercloud.getUtxos('12XXBHkRNrBEb7GCvAP4G8oUs5SoDREkVX');

// Callback style
mattercloud.getUtxos('12XXBHkRNrBEb7GCvAP4G8oUs5SoDREkVX', function(result) {
    // ...
});

```

## Detailed Documentation

[VIEW COMPLETE DEVELOPER DOCUMENTATION](https://developers.mattercloud.net)


## Build and Test

```
npm install
npm run build
npm run test
```

-----------


 ## Any questions or ideas?

 We would love to hear from you!

 https://www.mattercloud.net

 https://twitter.com/MatterCloud

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