2.0.0 • Published 5 years ago

pecunia-node-sdk v2.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

Pecunia Platform API Node.js SDK

Usage

The package is available in the npm registry:

npm install pecunia-node-sdk --save

ES5 module system usage:

const Sdk = require('pecunia-node-sdk').Sdk;
const sdk = new Sdk();
const apiKey = '...secret...'
const PecClient = sdk.getPecClient(apiKey)

PecClient.nodes.list().then(data => {
	console.log(data)
}) //get all my nodes
PecClient.nodes.getnode('replace-with-node-id', {platform: '99HOST'}).then(data => {
	console.log(data)
}) //get all my nodes
PecClient.nodes.create({ blockchain: 'HUZU', nodeId: 'huzu', txhash: 'tx-id-here', plan: 1, platform: 'pecunia' }).then(data => {
	console.log(data)
}) //create a node
PecClient.nodes.getusernodes({platform: 'pecunia'}).then(data => {
	console.log(data)
}) //get all user hosted nodes on a specific platfrom
PecClient.nodes.delete('replace-with-node-id', {platform: 'pecunia'}).then(data => {
	console.log(data)
}) //delete a node