![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
blockchainiz
Advanced tools
Blockchainiz is a platform to access the blockchain. It is dedicated to banks and insurance companies. This package is a node library to interact more easily with the Blockchainiz API.
Simply use NPM with the following command:
npm install blockchainiz --save
This will download the package and add an entry in your project's package.json
file.
In your project's source code, you need to start by importing the blockchainiz package and specify the options you want to use:
const blockchainiz = require('blockchainiz')({
publicKey: 'your public key',
privateKey: 'your private key',
useSandbox: true,
});
There are 3 options that you can set. You NEED to specify them in order for the package to work:
Option | Type | Description |
---|---|---|
publicKey | string | Your Blockchainiz public key |
privateKey | string | Your Blockchainiz private key |
useSandbox | bool | True to use the sandbox version of the API |
blockchainiz.setKeys(publicKey, privateKey);
Parameter | Type | Description |
---|---|---|
publicKey | string | The public key |
privateKey | string | The private key |
blockchainiz.useSandbox(shouldUseSandbox);
Parameter | Type | Description |
---|---|---|
shouldUseSandbox | bool | True to use the sandbox. False to use the production version |
blockchainiz.getInfoNodeBitcoin(function (err, data) {
// data contains the informations
});
'data' key | Type | Description |
---|---|---|
version | number | The version number of the Bitcoin node used by the API |
protocolVersion | number | The Bitcoin protocol version number of the node used by the API |
blockNumber | number | Number of the last blocked mined on the Bitcoin blockchain |
difficulty | number | Current difficulty on the Bitcoin network |
blockchainiz.getInfoNodeEthereum(function (err, data) {
// data contains the informations
});
'data' key | Type | Description |
---|---|---|
networkProtocolVersion | string | Version of the network protocol of the node used by the API |
ethereumProtocolVersion | string | Version of the Ethereum protocol of the node used by the API |
solcVersion | string | Version of the solidity compiler used by the API |
gasPrice | string | Current gas price in wei |
blockNumber | number | Number of the most recent block on the Ethereum blockchain |
As of today, only the Bitcoin blockchain can be used to host notaries.
blockchainiz.postNotary(format, data, function (err, data) {
// data contains the response of Blockchainiz
});
Parameter | Type | Description |
---|---|---|
format | string | Format in which the data is encoded (allowed values: 'hex', 'base64', 'ascii') |
data | string | The data to notarize |
'data' key | Type | Description |
---|---|---|
txid | string | ID of the transaction |
blockchainiz.getNotary(format, txid, function (err, data) {
// data contains the response of Blockchainiz
});
Parameter | Type | Description |
---|---|---|
format | string | Format in which to return the result (allowed values: 'hex', 'base64', 'ascii') |
txid | string | ID of the transaction on the blockchain |
'data' key | Type | Description |
---|---|---|
data | string | Data notarized in the blockchain |
status | string | Current status of the transaction. Can be 'mined' or 'not mined' |
confirmations | number | Number of confirmations for that bloc |
blockindex | number | Position of the transaction inside the bloc |
blocktime | number | Timestamp in seconds of when the bloc was mined |
blockindex
andblocktime
won't be included if the notary has not been mined in a bloc yet
blockchainiz.getNotaries(format, function (err, data) {
// data contains all the notaries
});
Parameter | Type | Description |
---|---|---|
format | string | Format in which to return the result (allowed values: 'hex', 'base64', 'ascii') |
The data
parameter of the callback contains an array of objects. Each object represents a notary and follows the same format as in the method getNotary
.
blockchainiz.postContractEthereumSolidity(sourceCode, parameters, contractName, callbackUrl, function (err, data) {
// data contains the response of Blockchainiz
});
Parameter | Type | Description |
---|---|---|
sourceCode | string | The source code of the smart contract to upload |
parameters | array | Array of parameters to pass to the constructor |
contractName | string | Name of the smart contract to upload in the sources |
callbackUrl | string | A URL that will be called back when the contract is mined on Ethereum |
'data' key | Type | Description |
---|---|---|
abi | object | The ABI if the contract returned by the solidity compiler |
id | number | The Blockchainiz ID of the new contract |
blockchainiz.getContract(id, function (err, data) {
// data contains the response of Blockchainiz
});
Parameter | Type | Description |
---|---|---|
id | number | Id number of the smart conttract in the Blockchainiz API |
'data' key | Type | Description |
---|---|---|
abi | object | The ABI definition of the contract |
amount | number | Account of ether in the contract wallet |
status | string | Status of the contract can be mined or not mined |
address | string | Address of the contract |
amount
andaddress
won't be included if the contract has not been mined yet
blockchainiz.postContractEthereumSolidityFunction(parameters, id, functionName, function (err, data) {
// data contains the response of Blockchainiz
});
Parameter | Type | Description |
---|---|---|
parameters | array | Array of parameters to pass to the function |
id | number | ID number of the contract on Blockchainiz |
functionName | string | Name of the function to call |
'data' key | Type | Description |
---|---|---|
result (optional) | array | The result value of the smart contract function |
txid (optional) | string | The ID number of the transaction |
result
will only be present if the function is constant and returns something.txid
will only be present if the function is not constant and so trigger an Ethereum transaction
In order to receiver a socket.io event, you must first subscribe to it. More informations on the full documentation of the API: https://www.sandbox.blockchainiz.io/#socket-io
blockchainiz.listenerNewBlockEthereum();
blockchainiz.listenerContract(contractId, eventName);
Parameter | Type | Description |
---|---|---|
contractId | number | Blockchainiz ID number of the contract to listen to |
eventName | string | Name of the Ethereum event to listen to |
blockchainiz.onErrorText(function (event, error) {
// event contains the name of the event who triggered the error
// error contains the error message
});
blockchainiz.onListenerContract(function (id, event, data) {
// id is the blockchainiz id number of the smart contract
// event is the name of the Ethereum event received
// data is the data sent by the Ethereum event
});
blockchainiz.onNewBlockEthereum(function (hash) {
// hash of the new block
});
The documentation of the API itself is available here: https://www.sandbox.blockchainiz.io/
You can sign up for a pair of keys on our website: https://www.blockchainiz.io/
FAQs
A node library to interact more easily with the Blockchainiz API
We found that blockchainiz demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.