Commit 1ee5b9d9 authored by Ori Pomerantz's avatar Ori Pomerantz Committed by GitHub

Update sdk.md

parent c5b48fea
...@@ -13,7 +13,7 @@ Typescript sdk for interacting with the ATST based on [@wagmi/core](https://wagm ...@@ -13,7 +13,7 @@ Typescript sdk for interacting with the ATST based on [@wagmi/core](https://wagm
## Installation ## Installation
Install atst and it's peer dependencies. Install atst and its peer dependencies.
npm npm
...@@ -100,6 +100,7 @@ await writeAttestation(preparedTx) ...@@ -100,6 +100,7 @@ await writeAttestation(preparedTx)
### High level API ### High level API
These functions are the easiest way to interact with the AttestationStation contract. 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).
#### `prepareWriteAttestation` #### `prepareWriteAttestation`
...@@ -111,16 +112,18 @@ const preparedTx = await prepareWriteAttestation(about, key, 'hello world') ...@@ -111,16 +112,18 @@ const preparedTx = await prepareWriteAttestation(about, key, 'hello world')
console.log(preparedTx.gasFee) console.log(preparedTx.gasFee)
``` ```
**Return Value:** A prepared transaction, ready for [`writeAttestation`](#writeattestation).
#### `readAttestation` #### `readAttestation`
[Reads](https://wagmi.sh/core/actions/readContract) and parses an attestation based on its data type. [Reads](https://wagmi.sh/core/actions/readContract) and parses an attestation based on its data type.
```typescript ```typescript
const attestation = await readAttestation( const attestation = await readAttestation(
creator, // Address: The creator of the attestation creator, // Address: The creator of the attestation
about, // Address: The about topic of the attestation about, // Address: The about topic of the attestation
key, // string: The key of the attestation key, // string: The key of the attestation
dataType, // Optional, the data type of the attestation, 'string' | 'bytes' | 'number' | 'bool' | 'address' dataType, // Optional, the data type of the attestation, 'string' | 'bytes' | 'number' | 'bool' | 'address'
contractAddress // Optional address: the contract address of the attestation station contractAddress // Optional address: the contract address of the attestation station
) )
``` ```
......
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