Ceramic Anchor listener
Getting started
Installation
$ npm install @ceramicnetwork/anchor-listener
Usage
import {
createBlockProofsListener,
createBlocksProofsLoader,
createAncestorBlocksProofsLoader,
} from '@ceramicnetwork/anchor-listener'
import { take, timeout } from 'rxjs'
const subsription = createBlockProofsListener({ chainId: 'eip155:1', confirmations: 20, provider: ... }).subscribe({
next(event) {
}
})
subscription.unsubscribe()
createBlocksProofsLoader({ chainId: 'eip155:1', fromBlock: 100, toBlock: 120, provider: ... }).subscribe({
next(event) {
}
})
createAncestorBlocksProofsLoader({ chainId: 'eip155:1', initialBlock: 'latest', targetAncestorHash: '...', provider: ... }).pipe(
take(50),
timeout(300_000),
).subscribe({
next(event) {
}
})
Development
Run tests:
npm test
Run linter:
npm run lint
Contributing
We are happy to accept small and large contributions. Make sure to check out the
Ceramic specifications
for details of how the protocol works.
License
MIT or Apache-2.0