Waits for the confirmation of a given transaction.
The transaction id to wait for confirmation.
Optional
timeout: numberThe timeout in milliseconds.
Evaluates the transaction by calculating the exunits for each redeemer, applying them, and returning the redeemers. This makes a remote call to the provider in most cases, however may use a virtual machine in some implementations.
The transaction to evaluate.
The additional unspent outputs to consider.
This method fetches the protocol parameters from the Maestro API. It constructs the query URL, sends a GET request with the appropriate headers, and processes the response. The response is parsed into a ProtocolParameters object, which is then returned. If the response is not in the expected format, an error is thrown.
A Promise that resolves to a ProtocolParameters object.
Get the slot config, which describes how to translate between slots and unix timestamps TODO: this is brittle; in theory this should work with the era histories; also, networkName is awkward
Retrieves the unspent outputs for a given address and asset.
The address to retrieve unspent outputs for.
The asset to retrieve unspent outputs for.
Resolves the script deployment by finding a UTxO containing the script reference.
The script or its hash to resolve.
Optional
address: AddressThe address to search for the script deployment. Defaults to a burn address.
This is a default implementation that works but may not be optimal. Subclasses of Provider should implement their own version for better performance.
The method searches for a UTxO at the given address (or a burn address by default) that contains a script reference matching the provided script or script hash.
const scriptUtxo = await provider.resolveScriptRef(myScript);
if (scriptUtxo) {
console.log("Script found in UTxO:", scriptUtxo.input().toCore());
} else {
console.log("Script not found");
}
Abstract class for the Provider. This class provides an interface for interacting with the blockchain.