Skip to content

A library for getting Mirror.xyz posts directly from their storage on Arweave.

Notifications You must be signed in to change notification settings

justinkgibbons89/mirror-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mirror-client

Mirror.xyz posts are stored on Arweave and can be queried directly from there.

get posts by contributor

posts on arweave have a Contributor tag which corresponds to a wallet address, so we can easily get all the posts from a given address:

const sartoshiAddress = "0xeD98464BDA3cE53a95B50f897556bEDE4316361c"
const limit = 5
const posts = await getMirrorPostsByContributor(sartoshiAddress, limit);
console.log(posts.map((post: any) => { return post.content.title }));

get a specific post by digest

get the latest version of a given post using its Original-Content-Digest tag:

const originalContentDigest = "GjssNdA6XK7VYynkvwDem3KYwPACSU9nDWpR5rei3hw"
const limit = 1
const posts = await getMirrorPostsByDigest(originalContentDigest, limit);
console.log(posts.map((post: any) => { return post.content.title }));

You could also query by Content-Digest if you were determined to get a specific version of a post, but this library doesn't currently expose a function for that.

configuration

by default this library uses arweave.net as the node and arweave.net/graphql as the graphql endpoint for arweave requests. performance/data availability may be improved by using private infrastructure.

About

A library for getting Mirror.xyz posts directly from their storage on Arweave.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published