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

    Function createValidatedGrant

    • Creates and validates a grant file from permission parameters.

      Parameters

      • params: GrantPermissionParams

        The permission parameters to create and validate the grant from. Obtain from user input or application configuration.

      Returns GrantFile

      The validated grant file object ready for storage

      Combines grant creation with immediate validation to ensure only valid grants are created. Validates schema compliance, grantee address, and operation parameters before returning the grant file.

      When grant parameters are invalid. Check error message for specific validation failures.

      const grant = createValidatedGrant({
      grantee: '0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb',
      operation: 'llm_inference',
      parameters: { model: 'gpt-4', maxTokens: 1000 },
      expiresAt: Date.now() + 86400000 // 24 hours
      });