Skip to main content

Class: ScriptEndpointInNode

Allows fetching script history and UTXOs.

Constructors

constructor

new ScriptEndpointInNode(proxyInterface, scriptType, scriptPayload): ScriptEndpointInNode

Parameters

NameType
proxyInterfaceFailoverProxy
scriptTypestring
scriptPayloadstring

Returns

ScriptEndpointInNode

Defined in

src/ChronikClientNode.ts:193

Methods

history

history(page?, pageSize?): Promise<TxHistoryPage_InNode>

Fetches the tx history of this script, in anti-chronological order. This means it's ordered by first-seen first, i.e. TxHistoryPage_InNode.txs[0] will be the most recent tx. If the tx hasn't been seen by the indexer before, it's ordered by the block timestamp.

Parameters

NameTypeDefault valueDescription
pagenumber0Page index of the tx history.
pageSizenumber25Number of txs per page.

Returns

Promise<TxHistoryPage_InNode>

Defined in

src/ChronikClientNode.ts:211


utxos

utxos(): Promise<ScriptUtxos_InNode>

Fetches the current UTXO set for this script. It is grouped by output script, in case a script type can match multiple different output scripts (e.g. Taproot on Lotus).

Returns

Promise<ScriptUtxos_InNode>

Defined in

src/ChronikClientNode.ts:231