allchain
v1.0.9
Published
A package that helps a developer to use any blockchain network in their project and create decentralised application.
Downloads
4
Readme
Develop, Deploy, and Innovate - seamlessly.
A package that helps a developer to use any blockchain network in their project and create decentralised application.
A JavaScript API to connect with the JSON-RPC of Ethereum and Solana network.
Installation
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 0.10 or higher is required.
If this is a brand new project, make sure to create a package.json
first with
the npm init
command.
Installation is done using the
npm install
command:
$ npm install allchain
Once the package is installed, you can import the library using require approach:
const allchain = require('allchain')
console.log(new allchain.Eth());
You will notice this output on the terminal if everything works well.
You are connected to Ethereum Chain.
Eth {}
You have connected to the Ethereum chain. To connect to solana type this on the terminal.
const allchain = require('allchain')
console.log(new allchain.Sol());
Output
You are connected to Solana Chain.
Sol {}
Documentation
This package allows to make dapps on multiple chains using allchain.
Following are the features of allchain.
- createAccount
- currentProvider
- getGasPrice
- sendTransaction
- getBlock
- getBlockNumber
- getBalance
- createWallet
- addAccount
Usage/Examples
The following code demonstrates the working of allchain's feature.
- To create an account on either of the chain use the following functions.
allchain = require('allchain');
function eth_createAccount()
{
return allchain.Eth.createAccount();
}
function sol_createAccount()
{
return allchain.Sol.createAccount();
}
- To get the wallet balance of your account using account address.
allchain = require('allchain');
function eth_balance(account_address)
{
return allchain.Eth.getBalance(account_address);
}
function sol_balance(account_address)
{
return allchain.Sol.getBalance(account_address);
}
The above functions return the balance of the provided address.
Support
For support, email mail us at [email protected] and [email protected].