Complete typed read-only access to ADAMANT Node APIs #67
dev-adamant-im
started this conversation in
Developers & API
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
adamant-apinow provides a complete typed surface for the read-heavy ADAMANT Node APIs used by explorers, monitoring services, wallets, bots, and other integrations. Consumers no longer need genericapi.get()calls or local response casts for the main account, block, delegate, peer, pool, and network-status queries introduced or expanded in ADAMANT Node v0.10.2.What is now covered
Top accounts
The SDK exposes
getTopAccounts()with typed pagination and delegate filtering:The response includes the Node's deterministic balance ordering and pagination metadata.
limit: 0requests count-only metadata without returning account rows.Blocks, delegates, peers, and pooled transactions
Public option types now cover the Node-supported filters and pagination controls for:
This makes the SDK usable as the typed boundary for read-only services rather than only as a signing and broadcast helper.
Network and delegate state
The generated contracts now expose:
consensusCodeName;consensusSchedule;milestoneSchedule;forgedvalues as base-10 integer strings;producedblocksproperty instead of the previous generatedproducedlockstypo.For example, a service can retrieve the public chain projection without locally redefining the response:
Endpoint-aware query semantics
The Node transaction query language is flat rather than a nested Boolean expression tree. It serializes conditions into one SQL expression in query-string order, with normal SQL precedence and no parentheses added for
and: {}oror: {}objects.The SDK therefore:
andby default;and/orconditions make wire order semantically significant;includeDirectTransfers,returnAsset, anduserIdto compatible endpoints;/api/transactions, where the Node actually applies them.This is intentionally stricter than forwarding every shared option to every endpoint. A typed call should represent behavior the selected Node route actually implements.
Schema provenance
src/api/generated.tsis reproducibly generated from:Adamant-im/adamant-schema@f35b8ddb5597a8f1a80a3a670bedb003af65ef90The repository verifies the generated file with
npm run api-types:check, while package-consumer tests compile the exported declarations and exercise the built ESM and CommonJS entry points.The
producedlockstoproducedblockscorrection is a compile-time compatibility change. Consumers that construct delegate or status fixtures manually may also need to add the newly required fields. Runtime response handling remains pass-through: older Node responses are not transformed or rejected by the SDK.Live state alongside snapshot reads
The same Node v0.10.2 alignment adds opt-in WebSocket handlers for compact
newBlockevents and confirmed or unconfirmedbalances/changeevents. Subscriptions are restored after reconnecting, and balance values are absolute replacements rather than deltas.These events complement the typed REST reads but do not replace them:
Compatibility boundaries
References
JavaScript SDK
Node, schema, and protocol documentation
Beta Was this translation helpful? Give feedback.
All reactions