Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gootools/glasseater
Tools that eat glass so you don't have to
https://github.com/gootools/glasseater
rpc-client solana
Last synced: 9 days ago
JSON representation
Tools that eat glass so you don't have to
- Host: GitHub
- URL: https://github.com/gootools/glasseater
- Owner: gootools
- Created: 2022-01-03T16:31:30.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-19T22:27:17.000Z (about 3 years ago)
- Last Synced: 2025-01-31T20:55:53.949Z (20 days ago)
- Topics: rpc-client, solana
- Language: TypeScript
- Homepage:
- Size: 270 KB
- Stars: 39
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome - gootools/glasseater - Tools that eat glass so you don't have to (TypeScript)
README
# GlassEater
Tools that [eat glass](https://www.theblockcrypto.com/post/123515/solana-labs-ceo-part-of-our-culture-is-to-eat-glass) so you don't have to.

Docs coming soon...
## Features
- generates the most precise and optimal getProgramAccounts queries possible
- automatically batches queries
- autocompletes and type checks everything it possibly can
- enables advanced local filtering
- accepts custom borsh deserializers and fetch functions
- zero dependencies (for the time being)### Installation
`(npm|pnpm|yarn) add glasseater @solana/web3.js`
### Usage
```typescript
import { AccountsQuery } from "glasseater";const proposalsQuery = new AccountsQuery(SCHEMA, Proposal);
proposalsQuery
.for(programId)
.select(["config"])
.where({
accountType,
realm: new PublicKey(realmId),
});const proposals = await proposalsQuery.fetch();
```### Wishlist
- tests
- anchor IDL support
- joins
- simpler interface
- caching and deduplication*_\* like [swr](https://swr.vercel.app), but this and batching might be better handled with a [service worker](https://github.com/gootools/solana-sidekick)_