Releases: Adamant-im/adamant-api-jsclient
Release list
v3.0.0
adamant-api v3.0.0
Major SDK release, coordinated with ADAMANT Node v0.10.0. Updates the HTTP and WebSocket client for the current node API, introduces stable modular package boundaries, improves retry/failover behavior, adds deterministic generated metadata, and replaces the legacy Wiki-first documentation with a source-controlled VitePress + TypeDoc site.
Highlights
ADAMANT Node v0.10.0 support
- Regenerates API DTOs from a pinned
adamant-schemarevision (ms timestamps, loader/status data, numeric counts, nullable unconfirmed-transaction fields). - Adds current transaction/chat query params:
returnUnconfirmed,includeDirectTransfers, delegate lookup by address, multi-type transaction queries. - Combines transaction query filters with logical
andby default; scopes amount filters to transfer transactions. - Adds optional
timestampMstransaction construction andgetEpochTimeMs;timestampMsis not in signed bytes, so hashes, IDs, and signatures are preserved. - Updates health checks for the consolidated node status response; supports inclusive minimum-node-version filtering.
Reliability and WebSocket behavior
- Stops retrying explicit rejected POST responses; returns structured/non-retryable HTTP failures instead of looping.
- Preserves retry and active-node failover for safe requests and network failures without an HTTP response.
- Adds WebSocket subscriptions for multiple addresses, transaction types, and chat asset types.
- Adds transaction/message convenience handlers, connection/reconnection callbacks, explicit connect/disconnect, typed connection errors, listener cleanup, and bounded reconnection handling.
Modular SDK and npm package
- Keeps the package root ADM-focused; prevents loading coin-specific implementations.
- Adds subpath exports for ADM, API DTOs, transactions, metadata, and BTC/ETH/DASH/DOGE helpers, retaining CommonJS and ESM support.
- Adds deterministic wallet metadata synced from a pinned
adamant-walletsrevision. - Removes Lisk/Klayr code and dependencies; standardizes supported external-coin derivation and address validation.
- Requires Node.js 22+, adopts pnpm workspace metadata, modernizes TypeScript/dependencies, adds consumer-level tarball tests.
API fixes retained since v2.4.0
- Fixes delegate voting and health-check behavior.
- Allows string payloads for signal messages; validates amounts only for message types that carry amounts.
- Represents transaction IDs as strings; exports validator utilities.
Documentation, automation, and maintenance
- VitePress documentation site with a TypeDoc-generated API reference and guides.
- GitHub Pages docs workflow, CNAME, refreshed README/CONTRIBUTING.
- Deterministic schema/metadata sync checks, custom Jest runner, package-consumer tests, expanded coverage, module-boundary tests.
- Migrates linting and TypeScript config to the current toolchain; removes obsolete files.
⚠️ Breaking changes and migration notes
- WebSocket subscriptions now default to
allDirections. Previously the client delivered only incoming transactions (hard-codedrecipientId === admAddress); it now emits both incoming and outgoing transactions by default. To restore the old behavior, passdirection: 'incoming'in the WebSocket client options. - Node.js 22+ required.
- Import coin helpers from explicit paths such as
adamant-api/coins/btc; they are no longer exported from the package root. - Lisk/Klayr support removed.
- Transaction query filters now use logical
andby default; amount filters apply only to transfer transactions. - Review deprecated
withoutDirectTransfersusage and migrate toincludeDirectTransfers.
Transaction byte layout, signing, IDs, and signature semantics are unchanged. CommonJS and ESM consumers are both covered by the packaged-tarball test.
Related
- Release PR: #84
- Release task: #83
- ADAMANT Node v0.10.0: https://github.com/Adamant-im/adamant/releases/tag/v0.10.0
Full Changelog: v2.4.0...v3.0.0
v2.4.0
Fixed
- Validation of public keys and delegate names for
api.voteForDelegate()method
Added
- Check if an address is actually a delegate in
api.voteForDelegate() - More validation error messages for
api.voteForDelegate()
v2.2.0
Added
-
Export validator utils:
function isPassphrase(passphrase: unknown): passphrase is string; function isAdmAddress(address: unknown): address is AdamantAddress; function isAdmPublicKey(publicKey: unknown): publicKey is string; function isAdmVoteForPublicKey(publicKey: unknown): publicKey is string; function isAdmVoteForAddress(address: unknown): boolean; function isAdmVoteForDelegateName(delegateName: unknown): delegateName is string; function validateMessage( message: string, messageType: MessageType = MessageType.Chat ): { success: false, error: string } | { success: true }; function isDelegateName(name: unknown): name is string; function admToSats(amount: number): number;
v2.1.0
Added
-
api.initSocket()now accepts an instance ofWebSocketClientas an argument:const socket = new WebSocketClient({ /* ... */ }) api.initSocket(socket) // instead of api.socket = socket
-
Improved the
encodeMessage()anddecodeMessage()functions to accept public keys as Uint8Array or Bufferimport {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>
Fixed
-
TypeScript: Fixed typing for
AdamantApiOptionsby addingLogLevelNameas possible value forlogLevelproperty.For example, you can now use
'log'instead ofLogLevel.Login 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:
amountproperty inChatTransactionData(createChatTransaction()argument) is now truly optional:- amount: number | undefined; + amount?: number;
v2.0.0
Added
-
TypeScript support
The project was fully rewritten in TypeScript, which means it supports typings now.
See examples directory.
-
More API methods
Added more API methods:
// before const block = await api.get('blocks/get', { id }); // after const block = await api.getBlock(id);
and
post()method:await api.post('transactions/process', { transaction });
-
getTransactionId() method
Pass signed transaction with signature to get a transaction id as a string:
import {getTransactionId} from 'adamant-api' const id = getTransactionId(signedTransaction)
See an example for more information.
Fixed
-
Creating multiple instances
Previously, it was not possible to create multiple instances due to the storage of Logger and "Node Manager" data in the modules.
-
Importing module several times
Fixed a bug where importing adamant-api-jsclient caused issues when it was also imported as a dependency.
Changed
-
API Initialization
Now you will create new instances of
adamant-apiusing keywordnew:import { AdamantApi } from 'adamant-api'; const api = new AdamantApi({ nodes: [/* ... */] });
-
Socket Initialization
Replace
api.socket.initSocket()withapi.initSocket().Use
api.socket.on()instead of.initSocket({ onNewMessage() {} }).// before api.socket.initSocket({ admAddress: 'U1234..', onNewMessage(transaction) { // ... }, }); // after api.initSocket({ admAddress: 'U1234..' }); api.socket.on((transaction: AnyTransaction) => { // ... });
or specify
socketoption when initializing API:// socket.ts import { WebSocketClient, TransactionType } from 'adamant-api'; const socket = new WebSocketClient({ admAddress: 'U1234..' }); socket.on([TransactionType.CHAT_MESSAGE, TransactionType.SEND], (transaction) => { // handle chat messages and transfer tokens transactions }); socket.on(TransactionType.VOTE, (transaction) => { // handle vote for delegate transaction }); export { socket };
// api.ts import { AdamantApi } from 'adamant-api'; import { socket } from './socket'; export const api = new AdamantApi({ socket, nodes: [/* ... */], });
Removeed
-
createTransaction()Use
createSendTransaction,createStateTransaction,createChatTransaction,createDelegateTransaction,createVoteTransactionmethods instead.
v1.8.0
- Add
checkNodeTimeoutparameter (see #30)
v1.7.0
- Add api.setStartupCallback() method, see #28
- Add callback as 3rd parameter for the api constructor
v1.6.0
- Update socket.io
- Update other dependencies
- Re-export key for backward compatibility
v1.5.0
- Refactoring
- Add Lisk support
- Axios client
- Style/contributing
v1.4.0
- Add delegateNew()
- Add voteForDelegate()
- Update dependencies
Docs: https://github.com/Adamant-im/adamant-api-jsclient/wiki/API-Specification