Skip to content

Provider

Defined in: ootle/src/provider.ts:22

A Provider reads chain state and submits transactions. It has no signing capability. The canonical implementation is IndexerProvider, which talks to the indexer REST API.

fetchSubstates(requests): Promise<GetSubstatesResponse>

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

Fetches multiple substates by ID in a single request.

string[]

Promise<GetSubstatesResponse>


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

Defined in: ootle/src/provider.ts:36

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>


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

Defined in: ootle/src/provider.ts:27

Fetches a single substate by ID and optional version.

string

number | null

Promise<IndexerGetSubstateResponse>


getTemplateDefinition(templateAddress): Promise<GetTemplateDefinitionResponse>

Defined in: ootle/src/provider.ts:42

Returns the ABI definition for a published template.

string

Promise<GetTemplateDefinitionResponse>


getTransactionResult(transactionId): Promise<IndexerGetTransactionResultResponse>

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

Polls for the result of a previously submitted transaction.

string

Promise<IndexerGetTransactionResultResponse>


listRecentTransactions(params): Promise<ListRecentTransactionsResponse>

Defined in: ootle/src/provider.ts:60

Lists recent transactions.

ListRecentTransactionsRequest

Promise<ListRecentTransactionsResponse>


network(): Network

Defined in: ootle/src/provider.ts:24

Returns the network this provider is connected to.

Network


resolveInputs(inputs): Promise<SubstateRequirement[]>

Defined in: ootle/src/provider.ts:57

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.

SubstateRequirement[]

Promise<SubstateRequirement[]>


submitTransaction(envelope): Promise<IndexerSubmitTransactionResponse>

Defined in: ootle/src/provider.ts:48

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

string

Promise<IndexerSubmitTransactionResponse>