Class: ScriptEndpoint
Allows fetching script history and UTXOs.
Constructors
constructor
• new ScriptEndpoint(proxyInterface
, scriptType
, scriptPayload
): ScriptEndpoint
Parameters
Name | Type |
---|---|
proxyInterface | FailoverProxy |
scriptType | string |
scriptPayload | string |
Returns
Defined in
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
Name | Type | Description |
---|---|---|
page? | number | Page index of the tx history. |
pageSize? | number | Number of txs per page. |
Returns
Promise
<TxHistoryPage
>
Defined in
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
[]>