Skip to main content
Research Preview — This API is under development.

Within

Check if a geometry is within a specified radius of a target geometry.

Request Body

number
required
Target chain ID (e.g., 84532 for Base Sepolia, 8453 for Base).
Input
required
The geometry to check (typically a point).
Input
required
The target geometry to measure distance from.
number
required
Maximum distance in meters.
string
required
EAS schema UID to issue the attestation against.
string
Ethereum address to receive the attestation. Defaults to zero address if not provided.

Example Request

Example Response

Notes

  • Uses PostGIS ST_DWithin function
  • Radius is always in meters (no unit conversion)
  • Returns true if the distance between geometries is less than or equal to the radius
  • The operation field includes the radius in centimeters: within:RADIUS_CM (e.g., within:50000 for a 500m radius). Resolver contracts should use prefix matching, not exact string comparison

SDK Method

See astral.compute.within()