Commit 1462423a authored by Ori Pomerantz's avatar Ori Pomerantz Committed by GitHub

Move `getEvents` to the high level API

parent 1ee5b9d9
......@@ -102,6 +102,24 @@ await writeAttestation(preparedTx)
These functions are the easiest way to interact with the AttestationStation contract.
For a more detailed explanation, [see the tutorial](https://github.com/ethereum-optimism/optimism-tutorial/tree/main/ecosystem/attestation-station/using-sdk).
#### `getEvents`
Use `getEvents` to get attestation events using a provider and filters.
```typescript
const events = await getEvents({
creator,
about,
key,
value,
provider: new ethers.providers.JsonRpcProvider('http://localhost:8545'),
fromBlockOrBlockhash,
toBlock,
})
```
Set `key`, `about`, `creator`, or `value` to `null` to not filter that value.
#### `prepareWriteAttestation`
[Prepares](https://wagmi.sh/core/actions/prepareWriteContract) an attestation to be written.
......@@ -196,25 +214,6 @@ createKey will keep the key as is if it is shorter than 32 bytes and otherwise r
#### `getEvents`
Use `getEvents` to get attestation events using a provider and filters.
```typescript
const events = await getEvents({
creator,
about,
key,
value,
provider: new ethers.providers.JsonRpcProvider('http://localhost:8545'),
fromBlockOrBlockhash,
toBlock,
})
```
Set `key`, `about`, `creator`, or `value` to `null` to not filter that value.
#### `parseAddress`
Turn bytes into an address.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment