Node.JS
Overview
The Circular Enterprise APIs provide a powerful and efficient way to certify data on the blockchain, ensuring immutability, transparency, and security. These APIs facilitate account management, network configuration, data signing, and transaction monitoring, making it easier for enterprises to integrate blockchain-based certification into their workflows.
This library is designed for developers who need to verify, sign, and submit data certificates using the Circular blockchain while maintaining seamless integration with Node.js applications.
Installation
You can install the Circular Enterprise APIs via npm:
npm install circular-enterprise-apis
Usage
The API supports both CommonJS and ES Modules, allowing for easy integration into different JavaScript environments.
Example (CommonJS)
const { CEP_Account } = require('circular-enterprise-apis');
const Address = 'your-wallet-address';
const PrivateKey = 'your-private-key';
const blockchain = '0x8a20baa40c45dc5055aeb26197c203e576ef389d9acb171bd62da11dc5ad72b2';
let account = new CEP_Account();
async function run() {
account.open(Address);
await account.updateAccount();
const submitResult = await account.submitCertificate("Enterprise API Test", PrivateKey);
if (submitResult.Result === 200) {
console.log("Certificate submitted:", submitResult);
} else {
console.log("Submission failed:", submitResult.message);
}
account.close();
}
run();
Example (ES Modules)
import { CEP_Account } from 'circular-enterprise-apis';
const Address = 'your-wallet-address';
const PrivateKey = 'your-private-key';
let account = new CEP_Account();
async function run() {
account.open(Address);
await account.updateAccount();
const submitResult = await account.submitCertificate("Enterprise API Test", PrivateKey);
if (submitResult.Result === 200) {
console.log("Certificate submitted:", submitResult);
} else {
console.log("Submission failed:", submitResult.message);
}
account.close();
}
run();
Useful Links
You can find more on the official GitHub repository or on the official NPM repository.
Last updated