Query the Indexer for Outputs
Outputs support a wide range of unlock conditions. Some of them are time-based or require to issue a transaction to claim final ownership of the outputs. Some usecases might want to skip these kind of outputs to avoid the required complexity of comparing time or issuing claiming transactions. The indexer allows you to filter out these outputs by using simple query filters.
We can define "Simple Outputs" to be the ones that can be unlocked by a single address, have no timelock or expiration and have no storage deposit return conditions. These ouputs are 100% owned by the given address and can be spent without any constraints.
An example indexer query for such simple outputs could be:
Let's break it down into the components:
/api/indexer/v1/outputs/basic: we are asking the indexer for outputs of type
BasicOutput. These are normal outputs that carry value in form of the base token and optionally a set of native tokens. You can check TIP-18 for more information about the outputs that are supported by the network.
address=rms1qrnspqhq6jhkujxak8aw9vult5uaa38hj8fv9klsvnvchdsf2q06wmr2c7j: we are asking the indexer to only return the outputs, where the
Address Unlock Conditionmatches the given address
hasStorageDepositReturn=false: by adding the
hasStorageDepositReturnquery parameter we are explicitely asking the indexer to look at the
Storage Deposit Return Unlock Conditionof the outputs. By passing
falsewe tell the indexer to only return outputs that have no such condition.
hasExpiration=false: by adding the
hasExpirationquery parameter, we can tell the indexer to look for
Expiration Unlock Conditionand by passing
falsewe can ask it to only return outputs that have no expiration condition.
hasTimelock=false: by adding the
hasTimelockquery parameter, we are asking the indexer to look for
Timelock Unlock Conditionand by passing
falsewe tell it to only return outputs that have no timelock condition.