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).Input
required
The geometry to check (typically a point). See Input types for accepted formats.
Input
required
The target geometry to measure distance from.
number
required
Maximum distance in meters.
string
EAS schema UID. The server uses a default schema if not provided.
string
Ethereum address to receive the attestation. Defaults to the zero address.
Example request
Response
Returns a BooleanComputeResponse.boolean
required
true if the geometry is within the radius of the target.string
required
Encodes the radius in centimeters:
"within:RADIUS_CM" (e.g., "within:50000" for a 500m radius).number
required
Unix timestamp of computation.
string[]
required
Array containing
[geometryRef, targetRef].AttestationData
required
Signed EAS attestation. See AttestationData.
DelegatedAttestationData
required
Signature for delegated onchain submission. See DelegatedAttestationData.
Example response
Notes
- Uses PostGIS
ST_DWithinfunction - Radius is always in meters in the request (no unit conversion needed)
- The
operationfield encodes the radius in centimeters:within:50000means 500 meters. Resolver contracts should use prefix matching, not exact string comparison - Returns
trueif the distance between geometries is less than or equal to the radius
SDK Method
See
astral.compute.within()