Skip to content

adamant-api / index / transformTransactionQuery

Function: transformTransactionQuery()

ts
function transformTransactionQuery<T>(obj?, endpoint?): Record<string, unknown>;

Defined in: src/api/utils.ts:132

Serializes a transaction query into the flat shape the node expects.

Top-level filter conditions are combined with and by default: each is emitted with an and: prefix. This differs from the raw node API, whose default 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.

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

ParameterTypeDefault 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

Released under the GPL-3.0 License.