The Circular Layer 1 Blockchain Protocol Interface Library is a JavaScript library designed to integrate seamlessly with Circular's blockchain platforms. This open-source library, maintained by Circular Global Ledgers, Inc., provides a comprehensive suite of tools for interacting with blockchain networks, managing wallets, assets, smart contracts, and more.
- Blockchain Interaction: Directly interact with Circular's blockchain networks.
- Smart Contracts: Deploy, test, and interact with smart contracts.
- Wallet Management: Create, retrieve, and manage blockchain wallets and balances.
- Asset Management: Handle asset transactions, including creation, transfer, and retrieval of asset details.
- Domains Management: Resolve domain names to wallet addresses.
- Transaction Management: Send, search, and validate transactions.
- Analytics: Retrieve analytical data about the blockchain.
To use the Circular Library in your project, include it directly in your HTML or JavaScript file:
Install dependency:
npm install circular-library
// test.mjs or test.ts
import Circular, { NAG_URL_DEFAULT } from "circular-library"
const NAG_KEY = process.env.NAG_KEY || '';
const NAG_URL = process.env.NAG_URL || NAG_URL_DEFAULT;
const circular = Circular(NAG_KEY, NAG_URL)
async function run() {
const {Result, Node, Response} = await circular.GetBlockchains()
console.log(Result, Node, Response);
}
run()
<script type="module" src="path_to_circular_library.js"></script>
<script type="module">
import CircularLibrary, { NAG_URL_DEFAULT } from "circular-library"
const Circular = CircularLibrary(
'your_nag_key',
NAG_URL_DEFAULT
)
// Set your Network Access Gateway key, not necessary if given in the "constructor"
Circular.SetNAGKey('your_nag_key');
</script>
// Register a new wallet on the blockchain
Circular.RegisterWallet('blockchain_id', 'public_key').then(response => {
console.log(response);
});
Circular.GetWalletBalance('blockchain_id', 'wallet_address', 'asset_name').then(balance => {
console.log(balance);
});
// Send a transaction
Circular.SendTransaction('transaction_id', 'from_address', 'to_address', 'timestamp', 'type', 'payload', 'nonce', 'signature', 'blockchain_id');
// Test a smart contract
Circular.TestContract('blockchain_id', 'developer_wallet_address', 'smart_contract_project').then(testResults => {
console.log(testResults);
});
Contributions to the Circular Library are welcome. Please ensure to follow the contribution guidelines and code of conduct.
This project is open source and available under the LICENSE for both private and commercial use.
1.1.0
Originator: Gianluca De Novi, PhD
Contributors: Sebastian Lagemann, [Add contributors here]
Contact For support or collaboration, please contact [email protected].
This README file outlines the main features and usage of the library, providing a comprehensive guide for developers interested in utilizing the Circular blockchain interfaces. Adjust the paths and names as per your actual project setup.