mattercloudjs
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

MatterCloud Javascript Library

Bitcoin SV and Metanet API for Developers MatterCloud.net

Replaces BitIndex SDK

header

VIEW COMPLETE DEVELOPER DOCUMENTATION


Quick Start

Small < 24KB library size Installation

npm install mattercloudjs --save

Include

Generate an API key

// 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

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

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

Detailed Installation and Usage

Installation

npm install mattercloudjs --save

Include

// Node
var options = {
    api_key: "your api key",
}
var mattercloud = require('mattercloudjs').instance(options);
 
<!-- 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:

 
// Await style with promises
var result = await mattercloud.getUtxos('12XXBHkRNrBEb7GCvAP4G8oUs5SoDREkVX');
 
// Callback style
mattercloud.getUtxos('12XXBHkRNrBEb7GCvAP4G8oUs5SoDREkVX', function(result) {
    // ...
});
 

Detailed Documentation

VIEW COMPLETE DEVELOPER DOCUMENTATION

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.220latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.220
1.1.10
1.0.130
1.0.120
1.0.110
1.0.100
1.0.80
1.0.71
1.0.60
1.0.50
1.0.40
1.0.20
1.0.10

Package Sidebar

Install

npm i mattercloudjs

Weekly Downloads

21

Version

1.1.2

License

Open BSV

Unpacked Size

60.6 kB

Total Files

10

Last publish

Collaborators

  • deanmlittle
  • attilacloud