adamant-api / index / transformTransactionQuery
Function: transformTransactionQuery()
function transformTransactionQuery<T>(obj?, endpoint?): Record<string, unknown>;Defined in: src/api/utils.ts:240
Serializes a transaction query into the flat shape the node expects.
On transactions, top-level filter conditions are combined with and: each is emitted with an and: prefix. This differs from the raw node API, whose default for /api/transactions is or. To opt into or semantics, wrap fields in or: { ... }; the explicit and: { ... } wrapper is also supported. The wrapper objects do not create parentheses: mixed operators remain flat and are emitted in JavaScript object-key order.
On states, chats, and chatrooms, filter conditions are emitted under their plain names. Those endpoints combine plain names with and. Nodes older than v0.11.0 ignore and: / or: prefixes (Adamant-im/adamant#277), while ADAMANT Node v0.11.0+ normalizes and: and strictly rejects or: and unknown query fields (Adamant-im/adamant#294). An explicit and wrapper is flattened to plain names, which work across every node version. An or wrapper or pre-prefixed and: / or: filter key throws the same badParameter message the client methods return, so unsupported prefixes are never sent.
Control and pagination parameters supported by the selected endpoint are passed through unchanged. Known controls unsupported by that endpoint are stripped instead of being serialized as filters.
Type Parameters
| Type Parameter |
|---|
T extends object |
Parameters
| Parameter | Type | Default value |
|---|---|---|
obj? | TransactionQuery<T> | undefined |
endpoint? | TransactionQueryEndpoint | 'transactions' |
Returns
Record<string, unknown>
See
https://docs.adamant.im/api/transactions-query-language.html#combine-filters-and-options