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.
"Simple Outputs"
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.
Example
An example indexer query for such simple outputs could be:
https://api.testnet.shimmer.network/api/indexer/v1/outputs/basic?address=rms1qrnspqhq6jhkujxak8aw9vult5uaa38hj8fv9klsvnvchdsf2q06wmr2c7j&hasStorageDepositReturn=false&hasExpiration=false&hasTimelock=false
Let's break it down into the components:
/api/indexer/v1/outputs/basic
: we are asking the indexer for outputs of typeBasicOutput
. 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 theAddress Unlock Condition
matches the given addressrms1qrnspqhq6jhkujxak8aw9vult5uaa38hj8fv9klsvnvchdsf2q06wmr2c7j
hasStorageDepositReturn=false
: by adding thehasStorageDepositReturn
query parameter we are explicitely asking the indexer to look at theStorage Deposit Return Unlock Condition
of the outputs. By passingfalse
we tell the indexer to only return outputs that have no such condition.hasExpiration=false
: by adding thehasExpiration
query parameter, we can tell the indexer to look forExpiration Unlock Condition
and by passingfalse
we can ask it to only return outputs that have no expiration condition.hasTimelock=false
: by adding thehasTimelock
query parameter, we are asking the indexer to look forTimelock Unlock Condition
and by passingfalse
we tell it to only return outputs that have no timelock condition.