@gala-chain/chaincode ∙ API
API > fetchAllowances
Function: fetchAllowances()
fetchAllowances(
ctx
,data
):Promise
\<TokenAllowance
[]>
Parameters
▪ ctx: GalaChainContext
▪ data: FetchAllowancesParams
Returns
Promise
Description
Query allowances from on-chain World State using the provided parameters. The results will be sorted by creation date ascending (oldest first)
If grantedBy
is provided, but the remaining parameters that constitute
ChainKeys 0 through 7 on the TokenAllowance
class definition are not all
provided, this function will lookup a larger result set than is returned.
The results set pulled from World State will be filtered
by the grantedBy
identity after lookup.
The @ChainKeys
that make up the World State index key are ordered,
and cannot be skipped when making partial composite key queries.
Be advised that broad queries can lead
to performance issues for large result sets.
Non-paginated version, use fetchAllowancesWithPagination()
if use case
expects large result sets.