The grant file URL from OnChainPermissionGrant.grantUrl
Optional
_relayerUrl: stringURL of the relayer service (optional, unused)
Promise resolving to the complete grant file with operation details
This is Step 2 of the performant two-step permission API.
Use this method to resolve detailed permission data (operation, parameters, etc.)
for specific grants after first getting the fast on-chain data using
getUserPermissionGrantsOnChain()
. This design eliminates N+1 query problems
by allowing selective lazy-loading of expensive off-chain data.
Performance: Single network request per grant file (typically 100-500ms). Reliability: Tries multiple IPFS gateways as fallbacks if primary URL fails.
// Step 1: Fast on-chain data (no N+1 queries)
const grants = await vana.permissions.getUserPermissionGrantsOnChain();
// Step 2: Lazy-load details for specific grant when needed
const grantFile = await retrieveGrantFile(grants[0].grantUrl);
console.log(`Operation: ${grantFile.operation}`);
console.log(`Grantee: ${grantFile.grantee}`);
console.log(`Parameters:`, grantFile.parameters);
// Only fetch details for grants user actually wants to see
for (const grant of selectedGrants) {
const details = await retrieveGrantFile(grant.grantUrl);
displayGrantDetails(details);
}
Retrieves detailed grant file data from IPFS or HTTP storage.