https://github.com/dl-solarity/graph-lib
Useful modules for subgraphs for The Graph protocol
https://github.com/dl-solarity/graph-lib
solarity subgraph the-graph
Last synced: about 1 year ago
JSON representation
Useful modules for subgraphs for The Graph protocol
- Host: GitHub
- URL: https://github.com/dl-solarity/graph-lib
- Owner: dl-solarity
- License: mit
- Created: 2023-04-26T14:21:29.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-03-07T19:18:07.000Z (over 2 years ago)
- Last Synced: 2025-04-19T21:53:26.011Z (about 1 year ago)
- Topics: solarity, subgraph, the-graph
- Language: TypeScript
- Homepage: https://npmjs.com/package/@solarity/graph-lib
- Size: 398 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/@solarity/graph-lib)
[](https://opensource.org/licenses/MIT)
# Graph Modules by Distributed Lab
This repository contains utility modules for implementing subgraphs for [The Graph protocol](https://thegraph.com/en/). The modules can be imported and used to help develop extended subgraphs logic for numerous tasks.
_The project is in the early stage of development and many new modules will be added soon. Here is what is available right now:_
- array-helper module to ease work with arrays
- hash-table module to bound two arrays (like key-value struct) efficiently
- history-searcher module to search previous history entity with id pattern `idBase + blockNumber`
- type-utils module to easily determine if a given value is an instance of `ByteArray`, `Bytes`, or `Address`
## Overview
### Installation
```console
$ npm install @solarity/graph-lib
```
The latest stable version is always in the `master` branch.
### Usage
```typescript
import { pushUnique } from '@solarity/graph-lib'
export function handleDelegated(event: Delegated): void {
. . .
user.delegateNfts = pushUnique(user.delegateNfts, event.params.nfts);
. . .
}
```
You will find the helper modules in the `/lib` directory.
## License
The library is released under the MIT License.