Skip to content

Commit

Permalink
moved to solarity
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvolear committed Aug 14, 2023
1 parent 9b87442 commit 4e77cb0
Show file tree
Hide file tree
Showing 14 changed files with 394 additions and 385 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 DLSL
Copyright (c) 2023 Solarity

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
[![npm](https://img.shields.io/npm/v/@dlsl/graph-modules.svg)](https://www.npmjs.com/package/@dlsl/graph-modules)
[![npm](https://img.shields.io/npm/v/@solarity/graph-lib.svg)](https://www.npmjs.com/package/@solarity/graph-lib)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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.
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`
- 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 @dlsl/graph-modules
$ npm install @solarity/graph-lib
```

The latest stable version is always in the `master` branch.

### Usage

```typescript
import { pushUnique } from '@dlsl/graph-modules'
import { pushUnique } from '@solarity/graph-lib'

export function handleDelegated(event: Delegated): void {
. . .
Expand All @@ -36,8 +36,8 @@ export function handleDelegated(event: Delegated): void {
}
```

You will find the helper modules in the `/modules` directory.
You will find the helper modules in the `/modules` directory.

## License

The development modules are released under the MIT License.
The library is released under the MIT License.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
737 changes: 371 additions & 366 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{
"name": "dlsl",
"name": "@solarity/graph-lib",
"version": "1.0.0-rc.3",
"license": "MIT",
"author": "Distributed Lab",
"readme": "README.md",
"description": "Useful modules for developing subgraphs for The Graph protocol",
"keywords": [
"distributedlab",
"solarity",
"ethereum",
"subgraph",
"thegraph"
],


"scripts": {
"install": "npx husky install",
"test": "graph test",
Expand All @@ -20,10 +23,10 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/dl-solidity-library/graph-modules.git"
"url": "git+https://github.com/dl-solarity/graph-lib.git"
},
"bugs": {
"url": "https://github.com/dl-solidity-library/graph-modules/issues"
"url": "https://github.com/dl-solarity/graph-lib/issues"
},
"dependencies": {
"@graphprotocol/graph-cli": "0.48.0",
Expand Down
7 changes: 4 additions & 3 deletions publish/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "@dlsl/graph-modules",
"name": "@solarity/graph-lib",
"version": "1.0.0-rc.3",
"license": "MIT",
"author": "Distributed Lab",
"readme": "README.md",
"description": "Useful modules for developing subgraphs for The Graph protocol",
"keywords": [
"distributedlab",
"solarity",
"ethereum",
"subgraph",
"thegraph"
Expand All @@ -19,10 +20,10 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/dl-solidity-library/graph-modules.git"
"url": "git+https://github.com/dl-solarity/graph-lib.git"
},
"bugs": {
"url": "https://github.com/dl-solidity-library/graph-modules/issues"
"url": "https://github.com/dl-solarity/graph-lib/issues"
},
"types": "index.ts"
}
2 changes: 1 addition & 1 deletion tests/arrays/array-helper.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, assert, test } from "matchstick-as";
import { Address, Bytes } from "@graphprotocol/graph-ts";
import { pushUnique, remove, upcastCopy } from "../../modules";
import { pushUnique, remove, upcastCopy } from "../../lib";

describe("array-helper", () => {
describe("pushUnique", () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/arrays/hash-table.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, beforeEach, describe, log, test } from "matchstick-as";
import { HashTable } from "../../modules";
import { assert, beforeEach, describe, test } from "matchstick-as";
import { HashTable } from "../../lib";
import { Address, BigInt, ByteArray, Bytes } from "@graphprotocol/graph-ts";

let hashTable: HashTable<Bytes, BigInt>;
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/history-searcher.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, assert, beforeAll, test } from "matchstick-as";
import { BigInt } from "@graphprotocol/graph-ts";
import { findPrevHistory } from "../../modules/";
import { findPrevHistory } from "../../lib";
import { MockEntity } from "../mocks/MockEntity";

describe("history-searcher", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/type-utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, describe, test } from "matchstick-as";
import { isAddress, isBytes, isBytesArray } from "../../modules/utils/type-utils";
import { isAddress, isBytes, isBytesArray } from "../../lib/utils/type-utils";
import { Address, BigInt, ByteArray, Bytes } from "@graphprotocol/graph-ts";

describe("type-utisl", () => {
Expand Down

0 comments on commit 4e77cb0

Please sign in to comment.