Skip to main content

Class: ScriptEndpoint

Allows fetching script history and UTXOs.

Constructors

constructor

new ScriptEndpoint(proxyInterface, scriptType, scriptPayload): ScriptEndpoint

Parameters

NameType
proxyInterfaceFailoverProxy
scriptTypestring
scriptPayloadstring

Returns

ScriptEndpoint

Defined in

src/ChronikClient.ts:173

Methods

history

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

Fetches the tx history of this script, in anti-chronological order. This means it's ordered by first-seen first. If the tx hasn't been seen by the indexer before, it's ordered by the block timestamp.

Parameters

NameTypeDescription
page?numberPage index of the tx history.
pageSize?numberNumber of txs per page.

Returns

Promise<TxHistoryPage>

Defined in

src/ChronikClient.ts:190


utxos

utxos(): Promise<ScriptUtxos[]>

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[]>

Defined in

src/ChronikClient.ts:217