Skip to content

fetchAttestation()

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / fetchAttestation

fetchAttestation(uid, options?): Promise<RangeSASAttestation | null>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:11184

Fetch attestation from Range API

Retrieves a full attestation record by UID from Range’s attestation API. Supports both the REST API and on-chain queries.

⚠️ PARTIAL IMPLEMENTATION: Basic HTTP fetch implemented. Full implementation requires:

  • On-chain attestation queries via SAS program
  • Websocket subscription for attestation updates
  • Caching layer for performance

string

Attestation UID to fetch

Fetch options

string

Range API endpoint

string

API key for authenticated requests

number

Request timeout in milliseconds

boolean

Whether to query on-chain instead of API

Promise<RangeSASAttestation | null>

The attestation if found, null otherwise

const attestation = await fetchAttestation('sas_abc123', {
apiEndpoint: 'https://api.range.org/v1',
apiKey: 'your-api-key',
})
if (attestation) {
console.log('Found attestation:', attestation.schema)
}