-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
chore: bump add docs for
getEASAttestations
(#126)
- v0.36.4
- v0.36.3
- v0.36.2
- v0.36.1
- v0.36.0
- v0.35.8
- v0.35.7
- v0.35.6
- v0.35.5
- v0.35.4
- v0.35.3
- v0.35.2
- v0.35.1
- v0.35.0
- v0.34.1
- v0.34.1-alpha
- v0.34.0
- v0.33.6
- v0.33.5
- v0.33.4
- v0.33.3
- v0.33.2
- v0.33.1
- v0.33.0
- v0.32.0
- v0.31.6
- v0.31.5
- v0.31.4
- v0.31.3
- v0.31.2
- v0.31.1
- v0.31.0
- v0.30.0
- v0.29.5
- v0.29.4
- v0.29.3
- v0.29.2
- v0.29.1
- v0.29.0
- v0.28.7
- v0.28.6
- v0.28.5
- v0.28.4
- v0.28.3
- v0.28.2
- v0.28.1
- v0.28.0
- v0.27.1
- v0.27.0
- v0.26.16
- v0.26.15
- v0.26.14
- v0.26.13
- v0.26.12
- v0.26.11
- v0.26.10
- v0.26.9
- v0.26.8
- v0.26.7
- v0.26.6
- v0.26.5
- v0.26.4
- v0.26.3
- v0.26.2
- v0.26.1
- v0.26.0
- v0.25.7
- v0.25.6
- v0.25.5
- v0.25.4
- v0.25.3
- v0.25.2
- v0.25.1
- v0.25.0
- v0.24.5
- v0.24.4
- v0.24.3
- v0.24.2
- v0.24.1
- v0.24.0
- v0.23.4
- v0.23.3
- v0.23.2
- v0.23.1
- v0.23.0
- v0.22.5
- v0.22.4
- v0.22.3
- v0.22.2
- v0.22.1
- v0.22.0
- v0.21.9
- v0.21.8
- v0.21.7
- v0.21.6
- v0.21.5
- v0.21.4
- v0.21.3
- v0.21.2
- v0.21.1
- v0.21.0
- v0.20.16
- v0.20.15
- v0.20.14
- v0.20.13
- v0.20.12
- v0.20.11
- v0.20.10
- v0.20.9
- v0.20.8
- v0.20.7
- v0.20.6
- v0.20.5
- v0.20.4
- v0.20.2
- v0.20.1
- v0.20.0
- v0.19.7
- v0.19.6
- v0.19.5
- v0.19.4
- v0.19.3
- v0.19.2
- v0.19.1
- v0.19.0
- v0.18.6
- v0.18.5
- v0.18.4
- v0.18.3
- v0.18.2
- v0.18.1
- v0.18.0
- v0.17.11
- v0.17.10
- v0.17.9
- v0.17.8
- v0.17.7
- v0.17.6
- v0.17.5
- v0.17.4
- v0.17.3
- v0.17.2
- v0.17.1
- v0.17.0
- v0.16.10
- v0.16.9
- v0.16.8
- v0.16.7
- v0.16.6
- v0.16.5
- v0.16.4
- v0.16.3
- v0.16.2
- v0.16.1
- v0.16.0
- v0.15.0
- v0.14.2
- v0.14.1
- v0.14.0
- v0.13.4
- v0.13.3
- v0.13.2
- v0.13.1
- v0.13.0
- v0.12.1
- v0.12.0
- v0.11.3
- v0.11.2
- v0.11.1
- v0.11.0
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.12
- v0.9.11
- v0.9.10
- v0.9.9
- v0.9.8
- v0.9.7
- v0.9.6
- v0.9.5
- v0.9.4
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
1 parent
452eedd
commit 311b027
Showing
5 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@coinbase/onchainkit': minor | ||
--- | ||
|
||
- **feat**: added initial version of `getEASAttestations`, which helps getting the user attestations from the Ethereum Attetation Service (EAS). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# getEASAttestations | ||
|
||
The `getEASAttestations` function fetches attestations for a specified address and blockchain in Ethereum Attestation Service (EAS). It allows optional filtering based on schema IDs, revocation status, expiration time, and the number of attestations to return. | ||
|
||
## Usage | ||
|
||
```ts | ||
import { getEASAttestations } from '@coinbase/onchainkit'; | ||
import { base } from 'viem/chains'; | ||
|
||
const attestations = await getEASAttestations({ | ||
'0x1234567890abcdef1234567890abcdef12345678', | ||
base, | ||
{ | ||
// Optional schemas to filter the attestations. | ||
schemas: ['0x1801901fabd0e6189356b4fb52bb0ab855276d84f7ec140839fbd1f6801ca065'], | ||
}, | ||
}); | ||
|
||
console.log(attestations); | ||
``` | ||
|
||
## Returns | ||
|
||
```ts | ||
// Array of EAS Attestation objects | ||
type GetEASAttestationsResponse = EASAttestation[]; | ||
|
||
type EASAttestation = { | ||
attester: EASAttesterAddress; // the attester who created the attestation. | ||
decodedDataJson: string; // The attestation data decoded to JSON. | ||
expirationTime: number; // The Unix timestamp when the attestation expires (0 for no expiration). | ||
id: string; // The unique identifier of the attestation. | ||
recipient: Address; // The Ethereum address of the recipient of the attestation. | ||
revocationTime: number; // The Unix timestamp when the attestation was revoked, if applicable. | ||
revoked: boolean; // A boolean indicating whether the attestation is revocable or not. | ||
schemaId: EASSchemaUid; // The schema identifier associated with the attestation. | ||
time: number; // The Unix timestamp when the attestation was created. | ||
}; | ||
|
||
type EASAttesterAddress = Address; | ||
|
||
type EASSchemaUid = Address; | ||
|
||
type Address = `0x${string}`; | ||
``` | ||
|
||
## Parameters | ||
|
||
```ts | ||
// Address - Ethereum address for which attestations are being queried | ||
address: Address; | ||
|
||
// Chain - The blockchain of interest | ||
chain: Chain; | ||
|
||
// Optional filtering options for the attestations query | ||
type GetEASAttestationsOptions = { | ||
schemas?: EASSchemaUid[]; // Schema IDs to filter attestations | ||
revoked?: boolean; // Filter for revoked attestations (default: false) | ||
expirationTime?: number; // Unix timestamp to filter based on expiration time (default: current time) | ||
limit?: number; // Maximum number of attestations to return (default: 10) | ||
}; | ||
|
||
type EASSchemaUid = Address; | ||
|
||
type Address = `0x${string}`; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters