Indexer.getReceivedAttestationUIDs
getReceivedAttestationUIDs(address recipient, bytes32 schemaUid, uint256 start, uint256 length, bool reverseOrder) external view returns (bytes32[] memory) 페이지네이션 역방향 조회입니다. schemaUid로 recipient에게 발급된 attestation UID를 최대 length개 반환합니다. reverseOrder = true를 지정하면 가장 최근 항목부터 조회합니다. 반환된 각 UID를 EAS.getAttestation(uid)에 전달하여 실제 구조체를 가져오고 폐기/만료 여부를 확인합니다.
파라미터
| 이름 | 타입 | 필수 | 설명 |
|---|---|---|---|
recipient | address | ✓ | 수신자(subject) 주소입니다. |
schemaUid | bytes32 | ✓ | 필터링할 스키마 UID입니다. |
start | uint256 | ✓ | indexer 목록의 0 기반 오프셋입니다. 첫 페이지를 가져올 때는 0을 전달합니다. |
length | uint256 | ✓ | 반환할 최대 UID 개수입니다. Indexer가 매우 큰 요청을 내부적으로 제한하므로 실용상 호출당 50~100개가 적절합니다. |
reverseOrder | bool | ✓ | true로 설정하면 가장 최근 attestation부터 가장 오래된 순으로 순회합니다. 대부분의 UI 사용 사례에서 권장되는 방향입니다. |
반환값
타입:
bytes32[] Attestation UID 배열입니다. 일치하는 attestation이 없으면 빈 배열이 반환됩니다.
예제
viem — 가장 최근 5개 attestation
const INDEXER = "0x1000000000000000000000000000000000000008";
const uids = await publicClient.readContract({
address: INDEXER,
abi: indexerAbi,
functionName: "getReceivedAttestationUIDs",
args: [recipient, schemaUid, 0n, 5n, true],
});
// Then look up each one to validate
const attestations = await Promise.all(
uids.map((uid) =>
publicClient.readContract({
address: EAS,
abi: easAbi,
functionName: "getAttestation",
args: [uid],
})
)
);
const valid = attestations.find(
(a) => a.revocationTime === 0n && (a.expirationTime === 0n || a.expirationTime > now)
);