Skip to content

Commit

Permalink
Merge pull request #177 from hypercerts-org/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
bitbeckers authored Jul 9, 2024
2 parents 48b235c + a437fb9 commit 5586a0e
Show file tree
Hide file tree
Showing 25 changed files with 298 additions and 231 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hypercerts-indexer",
"version": "1.0.0",
"description": "",
"description": "Indexing service for the hypercerts ecosystem",
"main": "dist/server.js",
"engines": {
"node": "20.x"
Expand Down Expand Up @@ -36,6 +36,7 @@
"@types/express": "^4.17.21",
"@types/express-serve-static-core": "^4.17.43",
"@types/node": "^20.11.19",
"@types/pg": "^8.11.6",
"@types/sinon": "^17.0.3",
"@types/supertest": "^6.0.2",
"@viem/anvil": "^0.0.10",
Expand All @@ -61,6 +62,7 @@
"wait-on": "^7.2.0"
},
"dependencies": {
"@hypercerts-org/chainsauce": "1.0.23-alpha.3",
"@hypercerts-org/contracts": "2.0.0-alpha.0",
"@hypercerts-org/marketplace-sdk": "^0.3.13",
"@hypercerts-org/sdk": "^1.4.3",
Expand All @@ -70,11 +72,11 @@
"@supabase/supabase-js": "^2.44.2",
"@types/lodash": "^4.17.6",
"axios": "^1.7.2",
"chainsauce": "boudra/chainsauce#main",
"ethers": "^6.13.1",
"express": "^4.19.2",
"lodash": "^4.17.21",
"luxon": "^3.4.4",
"pg": "^8.12.0",
"type-fest": "^4.20.1",
"viem": "^2.16.4",
"zod": "^3.23.8"
Expand Down
134 changes: 84 additions & 50 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/fetching/fetchAllowlistFromUri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { fetchFromHttpsOrIpfs } from "@/utils/fetchFromHttpsOrIpfs.js";
import { parseToOzMerkleTree } from "@/utils/parseToOzMerkleTree.js";

export interface FetchAllowListFromUriInput {
fetchMethod: (args: { uri: string }) => Promise<unknown>;
uri?: string;
}

Expand Down
7 changes: 4 additions & 3 deletions src/indexer/LogParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ export type ParserContext = {
contracts_id: string;
block: Block;
schema?: Tables<"supported_schemas">;
dataFetcher?: (args: { uri: string }) => Promise<unknown>;
};

export interface ParserMethod<T> {
(params: { log: unknown; context: ParserContext }): Promise<T[]>;
(params: { data: unknown; context: ParserContext }): Promise<T[]>;
}

export interface StorageMethod<T> {
Expand All @@ -27,9 +28,9 @@ class LogParser<T> {
this.storage = storage;
}

async parse(log: unknown, context: ParserContext): Promise<void> {
async parse(data: unknown, context: ParserContext): Promise<void> {
try {
const parsed = await this.parser({ log, context });
const parsed = await this.parser({ data, context });
await this.storage({ data: parsed, context });
} catch (error) {
console.error(
Expand Down
Loading

0 comments on commit 5586a0e

Please sign in to comment.