@eth-optimism/atst
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published


Optimism

@eth-optimism/atst

The official SDK and cli for Optimism's attestation Station

atst

atst is a typescript / javascript sdk and cli around AttestationStation

Visit Docs for general documentation on AttestationStation.

Getting started

Install

npm install @eth-optimism/atst wagmi @wagmi/core ethers@5.7.0

atst typescript/javascript sdk

The typescript sdk provides a clean wagmi based interface for reading and writing to AttestationStation.

See sdk docs for usage instructions.

atst cli

The cli provides a convenient cli for interacting with the AttestationStation contract

preview

See cli docs for usage instructions.

React API

For react hooks we recomend using the wagmi cli with the etherscan plugin and react plugin to automatically generate react hooks around AttestationStation.

Use createKey and createValue to convert your raw keys and values into bytes that can be used in AttestationStation contract calls

Use parseString, parseBool, parseAddress and parseNumber to convert values returned by AttestationStation to their correct data type.

For convenience we also export the hooks here:

  • useAttestationStationAttestation - Reads attestations with useContractRead
  • useAttestationStationVersion - Reads attestation version
  • useAttestationStationAttest - Wraps useContractWrite with AttestationStation abi calling attest
  • usePrepareAttestationStationAttest - Wraps usePrepare with AttestationStation abi calling attest
  • useAttestationStationAttestationCreatedEvent - Wraps useContractEvents for Created events

Also some more hooks exported by the cli but these are likely the only ones you need.

Contributing

Please see our contributing.md. No contribution is too small.

Having your contribution denied feels bad. Please consider opening an issue before adding any new features or apis.

Getting help

If you have any problems, these resources could help you:

Package Sidebar

Install

npm i @eth-optimism/atst

Weekly Downloads

45

Version

0.2.0

License

MIT

Unpacked Size

633 kB

Total Files

67

Last publish

Collaborators

  • optibot
  • kelvinfichter