Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
7bae6581
Unverified
Commit
7bae6581
authored
Mar 02, 2023
by
Ori Pomerantz
Committed by
GitHub
Mar 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update sdk.md
parent
fb24c9ac
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
22 deletions
+18
-22
sdk.md
packages/atst/docs/sdk.md
+18
-22
No files found.
packages/atst/docs/sdk.md
View file @
7bae6581
...
@@ -43,7 +43,8 @@ yarn add @eth-optimism/atst @wagmi/core ethers@5.7.0
...
@@ -43,7 +43,8 @@ yarn add @eth-optimism/atst @wagmi/core ethers@5.7.0
## Basic usage
## Basic usage
All functions are fully tested. The tests are a great example to see usage examples.
All functions are fully tested. The tests (the files that end with
`.spec.ts`
under
`.../src/lib`
) are a great example to see usage examples.
### Setup
### Setup
...
@@ -55,7 +56,7 @@ import { connect, createClient } from '@wagmi/core'
...
@@ -55,7 +56,7 @@ import { connect, createClient } from '@wagmi/core'
import
{
providers
,
Wallet
}
from
'
ethers
'
import
{
providers
,
Wallet
}
from
'
ethers
'
const
provider
=
new
providers
.
JsonRpcProvider
({
const
provider
=
new
providers
.
JsonRpcProvider
({
url
:
parsedOptions
.
rpcUrl
,
url
:
"
https://mainnet.optimism.io
"
,
headers
:
{
headers
:
{
'
User-Agent
'
:
'
@eth-optimism/atst
'
,
'
User-Agent
'
:
'
@eth-optimism/atst
'
,
},
},
...
@@ -181,6 +182,21 @@ The abi of the attestation station contract
...
@@ -181,6 +182,21 @@ The abi of the attestation station contract
import
{
abi
}
from
'
@eth-optimism/atst
'
import
{
abi
}
from
'
@eth-optimism/atst
'
```
```
#### `createKey`
`createKey`
hashes keys longer than 31 bytes, because the atst key size is limited to 32 bytes.
```
typescript
const
key
=
await
createKey
(
'
i.am.a.key.much.longer.than.32.bytes.long
'
)
```
createKey will keep the key as is if it is shorter than 32 bytes and otherwise run it through keccak256.
#### `getEvents`
#### `getEvents`
...
@@ -248,26 +264,6 @@ const bigNumberAttestation = stringifyAttestationBytes(
...
@@ -248,26 +264,6 @@ const bigNumberAttestation = stringifyAttestationBytes(
**Note:**
`writeAttestation`
already does this for you so this is only needed if using a library other than the attestation station.
**Note:**
`writeAttestation`
already does this for you so this is only needed if using a library other than the attestation station.
<!--
#### createKey
`createKey`
hashes keys longer than 31 bytes, because the atst key size is limited to 32 bytes.
```
typescript
const
key
=
await
createKey
(
about
,
key
,
'
i.am.a.key.much.longer.than.32.bytes.long
'
)
await
writeAttestation
(
preparedTx
)
```
createKey will keep the key as is if it is shorter than 32 bytes and otherwise run it through kekkak256
-->
## Tutorial
## Tutorial
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment