Skip to content

IndexerProvider

Defined in: ootle-indexer/src/indexer-provider.ts:34

  • Provider

readonly defaultTransactionTimeoutMs: number

Defined in: ootle-indexer/src/indexer-provider.ts:39

fetchSubstates(requests): Promise<GetSubstatesResponse>

Defined in: ootle-indexer/src/indexer-provider.ts:118

Fetches multiple substates by ID in a single request.

string[]

Promise<GetSubstatesResponse>

Provider.fetchSubstates


getClient(): IndexerClient

Defined in: ootle-indexer/src/indexer-provider.ts:58

Exposes the underlying IndexerClient for advanced use (e.g. resolveWantInputs).

IndexerClient


getCurrentEpoch(): Promise<number>

Defined in: ootle-indexer/src/indexer-provider.ts:90

Returns the epoch the network is currently on.

Every transaction carries a mandatory max_epoch, capped at MAX_TRANSACTION_VALIDITY_EPOCHS past this value, so a builder needs the chain tip before it can be constructed: TransactionBuilder.new(network, await provider.getCurrentEpoch() + 10).

Promise<number>

Provider.getCurrentEpoch


getStealthUtxo(resourceAddress, commitment): Promise<IndexerGetSubstateResponse | null>

Defined in: ootle-indexer/src/indexer-provider.ts:103

Fetches a stealth UTXO substate by resource address + 32-byte commitment.

The provider owns the utxo_{resourceHex}_{commitmentHex} id format; callers pass the resource and commitment and never string the id themselves. Returns null when the UTXO does not exist (already spent / never created), instead of throwing.

string

Uint8Array

Promise<IndexerGetSubstateResponse | null>

Provider.getStealthUtxo


getSubstate(substateId, version?): Promise<IndexerGetSubstateResponse>

Defined in: ootle-indexer/src/indexer-provider.ts:95

Fetches a single substate by ID and optional version.

string

number | null

Promise<IndexerGetSubstateResponse>

Provider.getSubstate


getTemplateDefinition(templateAddress): Promise<GetTemplateDefinitionResponse>

Defined in: ootle-indexer/src/indexer-provider.ts:122

Returns the ABI definition for a published template.

string

Promise<GetTemplateDefinitionResponse>

Provider.getTemplateDefinition


getTransactionResult(transactionId): Promise<IndexerGetTransactionResultResponse>

Defined in: ootle-indexer/src/indexer-provider.ts:138

Polls for the result of a previously submitted transaction.

string

Promise<IndexerGetTransactionResultResponse>

Provider.getTransactionResult


listRecentTransactions(params): Promise<ListRecentTransactionsResponse>

Defined in: ootle-indexer/src/indexer-provider.ts:180

Lists recent transactions.

ListRecentTransactionsRequest

Promise<ListRecentTransactionsResponse>

Provider.listRecentTransactions


network(): Network

Defined in: ootle-indexer/src/indexer-provider.ts:86

Returns the network this provider is connected to.

Network

Provider.network


resolveInputs(inputs): Promise<InputDeclaration[]>

Defined in: ootle-indexer/src/indexer-provider.ts:142

Resolves unversioned inputs by fetching their current version from the indexer. Returns the same list with version filled in for any entry that had version: null, and is_write preserved.

InputDeclaration[]

Promise<InputDeclaration[]>

Provider.resolveInputs


stopWatcher(): void

Defined in: ootle-indexer/src/indexer-provider.ts:81

Stops the SSE TransactionWatcher if one is running. Call this when the provider is no longer needed to release the connection.

void


submitTransaction(envelope): Promise<IndexerSubmitTransactionResponse>

Defined in: ootle-indexer/src/indexer-provider.ts:128

Submits a BOR+base64-encoded transaction envelope to the network. Encoding is performed by sealTransaction in transaction.ts.

string

Promise<IndexerSubmitTransactionResponse>

Provider.submitTransaction


watchTransactionSSE(txId, timeoutMs?): PendingTransaction

Defined in: ootle-indexer/src/indexer-provider.ts:69

Returns a PendingTransaction that resolves via SSE when the network finalises the transaction, falling back to REST polling on timeout.

The TransactionWatcher SSE loop is created lazily on the first call and reused for all subsequent calls on this provider instance.

string

number

PendingTransaction


static connect(options): Promise<IndexerProvider>

Defined in: ootle-indexer/src/indexer-provider.ts:51

Creates an IndexerProvider and verifies connectivity by fetching the indexer identity.

IndexerProviderOptions

Promise<IndexerProvider>