Skip to content

v3.1.0

Latest

Choose a tag to compare

@dev-adamant-im dev-adamant-im released this 17 Jul 10:54
ca91922

adamant-api v3.1.0

SDK update coordinated with ADAMANT Node v0.10.2. This version completes the typed read-only Node API surface, adds opt-in live block and balance subscriptions, synchronizes delegate and network-status DTOs with the authoritative schema, and refreshes package tooling.

Highlights

Complete typed read-only Node API

  • Adds getTopAccounts() with typed limit, offset, and isDelegate options. limit: 0 can be used for count-only metadata.
  • Completes option types for blocks, delegates, delegate search and statistics, peers, pooled transactions, and transaction time ranges.
  • Exposes typed consensus codename and activation schedules, block reward milestones, and delegate lifetime forged amounts.
  • Extends the packaged consumer checks so the new methods and response contracts are verified from the built npm artifact.

Endpoint-aware query handling

  • Scopes direct-transfer and other control parameters to endpoints that support them.
  • Removes known unsupported controls before a request is sent instead of allowing them to become ineffective or invalid filters.
  • Preserves deterministic query-string order.
  • Warns when mixed and / or conditions rely on the Node's flat, order-sensitive SQL expression model.
  • Keeps amount filters limited to /api/transactions, where the Node actually applies them.

Client WebSocket state subscriptions

  • Adds opt-in onNewBlock() subscriptions for compact headers of newly applied blocks.
  • Adds onBalanceChange() subscriptions for confirmed balance, unconfirmed balance, or both.
  • Treats balance payloads as current absolute values rather than deltas and documents partial-field delivery.
  • Restores block and balance subscriptions automatically after reconnecting to the same or another healthy node.
  • Routes block and balance handler failures through the existing .catch() path and supports removing the handlers through .off().

These events are best-effort live notifications, not durable streams. Applications should restore state through REST after disconnections when correctness depends on complete history.

Authoritative DTO synchronization

  • Regenerates API types from Adamant-im/adamant-schema@f35b8ddb5597a8f1a80a3a670bedb003af65ef90.
  • Adds consensusCodeName, consensusSchedule, and milestoneSchedule to network status contracts.
  • Adds the delegate lifetime forged value while retaining the distinct delegate-search response shape.
  • Corrects the generated delegate property producedlocks to the runtime property producedblocks.
  • Documents next-forger, delegate, peer, and pooled-transaction snapshot and filtering semantics.

Package and tooling maintenance

  • Sets the package version to 3.1.0 and declares Node.js >=22.12.0.
  • Updates pnpm to 11.13.1 and refreshes runtime and development dependencies without adding direct dependencies.
  • Reduces the resolved lockfile graph from 886 to 876 package entries.
  • Aligns formatting with Prettier 3.9 and keeps local AI-agent and editor directories out of the repository.
  • Publishes through npm Trusted Publishing with GitHub Actions provenance.

Compatibility and migration notes

  • New top-account, network-status, delegate, block, and balance-event capabilities require ADAMANT Node v0.10.2.
  • The package engine floor changes from Node.js >=22 to >=22.12.0. Deployments that also run ADAMANT Node v0.10.2 should use the Node's required Node.js >=22.13.0.
  • TypeScript consumers using the typoed DelegateDto.producedlocks property must migrate to producedblocks.
  • Consumers that manually construct generated delegate or network-status DTOs may need to provide the newly required fields.
  • TypeScript callers that passed endpoint-incompatible query controls must use the option type for the intended endpoint.

Transaction byte layout, hashes, IDs, signatures, encryption, root exports, node selection, retries, and failover behavior are unchanged.

Diff overview

  • 17 files changed
  • 1,471 insertions and 513 deletions
  • Includes the complete v3.0.0..master history for the typed API, generated DTOs, WebSocket subscriptions, tests, documentation, version metadata, and dependency refresh

Validation

Verified on Node.js 22.23.1 and pnpm 11.13.1:

  • npm run compile
  • npm run typecheck
  • npm test — 19 suites and 253 tests passed
  • npm run lint
  • npm run test:package — ESM, CommonJS, live consumers, package subpaths, and TypeScript declarations passed
  • npm run api-types:check
  • npm run metadata:check
  • npm run docs:build
  • git diff --check

Generated API types match the pinned adamant-schema revision, and wallet metadata matches Adamant-im/adamant-wallets@54a820b6dc5e0ec77c3a6fbac91d2f7809a2f5b7.

Related

Full Changelog: v3.0.0...v3.1.0