Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/daoleno/lenskit

lens protocol kit
https://github.com/daoleno/lenskit

Last synced: about 2 months ago
JSON representation

lens protocol kit

Awesome Lists containing this project

README

        

# 🌿 LensKit 🌿

lenskit is a set of libraries for integrating lens protocol into your application.

## Installation

```bash
yarn add @lenskit/react
```

> **Warning**
>
> This package is still in development and not ready for production.

## Hooks

useAuth

```tsx
const { auth, token, error } = useAuth()
```

useIndexedTx

```tsx
const { tx, error } = useIndexedTx(txHash)
```

useProfile

```tsx
const { profile, loading, error } = useProfile({ profileId })
```

useProfiles

```tsx
const { profiles, loading, error } = useProfiles({ ownedBy: [address], limit: 1 })
```

useCreateProfile

```tsx
const { createProfile, profileId, loading, error } = useCreateProfile()
```

useSetProfileMetadata

```tsx
const { setProfileMetadata, tx, loading, error } = useSetProfileMetadata()
```

usePost

```tsx
const { post, publicationId, loading, error } = usePost()
```

useCollect

```tsx
const { collect, tx, loading, error } = useCollect()
```

useComment

```tsx
const { comment, publicationId, loading, error } = useComment()
```

useMirror

```tsx
const { createMirror, publicationId, loading, error } = useMirror()
```

useFollow

```tsx
const { follow, tx, loading, error } = useFollow()
```

useUnfollow

```tsx
const { unfollow, tx, loading, error } = useUnfollow()
```

usePublication

```tsx
const { publication, loading, error } = usePublication({ publicationId })
```

usePublications

```tsx
const { publications, loading, error } = usePublications({
profileId: profileId,
publicationTypes: [PublicationTypes.Post],
})
```

## License

[MIT](https://choosealicense.com/licenses/mit/)