Vana SDK - v2.2.2
    Preparing search index...

    Function retrieveAndValidateGrant

    • Retrieves and validates a grant file from IPFS.

      Parameters

      • grantUrl: string

        The IPFS URL of the grant file to retrieve. Obtain from on-chain permission records or grant events.

      • OptionalrelayerUrl: string

        Optional URL of the relayer service. If not provided, uses default IPFS gateways.

      Returns Promise<GrantFile>

      Promise resolving to the validated grant file

      Fetches a grant file from IPFS and performs basic validation to ensure the retrieved data is a valid grant structure. Use this when you need to verify or process existing grants.

      When grant retrieval fails. Check network connectivity or IPFS gateway availability.

      When grant file is malformed. Verify the grant URL points to a valid grant file.

      const grant = await retrieveAndValidateGrant(
      'ipfs://QmXxx...'
      );

      console.log('Grant for:', grant.grantee);
      console.log('Operation:', grant.operation);