
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
adamant-api
Advanced tools
ADAMANT JavaScript API is a library intended to interact with ADAMANT blockchain for JavaScript developers. Also ADAMANT Console and ADAMANT node Direct API are available.
Features:
JS API shows decentralization in action—if a network node cannot fulfill your request, the library will redirect it to another node, and so on several times. You will get the result and you do not need to think about processing the request.
Health Check system pings all nodes in the list using /status
endpoint, and connects to a node with actual height. When the library unable to process request with current node, it forces to re-initialize Health Check.
Install library from npm:
npm i adamant-api
Initialize the library:
const { AdamantApi } = require('adamant-api')
const nodes = [
"http://localhost:36666",
"https://endless.adamant.im",
"https://clown.adamant.im",
"http://23.226.231.225:36666",
"http://88.198.156.44:36666",
"https://lake.adamant.im"
];
const api = new AdamantApi({
nodes,
});
Request example:
const response = await api.getBlocks()
console.log(response.data)
See Wiki for documentation and usage.
[2.1.0] - 2023-11-17
api.initSocket()
now accepts an instance of WebSocketClient
as an argument:
const socket = new WebSocketClient({
/* ... */
});
api.initSocket(socket);
// instead of
api.socket = socket;
Improved the encodeMessage()
and decodeMessage()
functions to accept public keys as Uint8Array or Buffer
import {encodeMessage, createKeypairFromPassphrase} from 'adamant-api'
const {publicKey} = createKeypairFromPassphrase('...')
const message = encodeMessage(,, publicKey) // No need to convert public key to string
decodeMessage()
allows passing a key pair instead of a passphrase:
import {decodeMessage, createKeypairFromPassphrase} from 'adamant-api'
const keyPair = createKeypairFromPassphrase('...')
const message = decodeMessage(,, keyPair,) // <- It won't create a key pair from passphrase again
TypeScript: Export transaction handlers TypeScript utils: SingleTransactionHandler
, AnyTransactionHandler
, TransactionHandler<T extends AnyTransaction>
TypeScript: Fixed typing for AdamantApiOptions
by adding LogLevelName
as possible value for logLevel
property.
For example, you can now use 'log'
instead of LogLevel.Log
in TypeScript:
const api = new AdamantApi({/* ... */ logLevel: 'log'});
TypeScript: Added missing declaration modules to npm that led to the error:
Could not find a declaration file for module 'coininfo'.
/// <reference path="../../types/coininfo.d.ts" />
TypeScript: amount
property in ChatTransactionData
(createChatTransaction()
argument) is now truly optional:
- amount: number | undefined;
+ amount?: number;
FAQs
JavaScript API library for the ADAMANT Blockchain
The npm package adamant-api receives a total of 48 weekly downloads. As such, adamant-api popularity was classified as not popular.
We found that adamant-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.