Skip to content

Commit

Permalink
Merge pull request #74 from hypercerts-org/develop
Browse files Browse the repository at this point in the history
Develop into main
  • Loading branch information
bitbeckers authored Jun 4, 2024
2 parents deb96bb + 4d0f914 commit 08c18b9
Show file tree
Hide file tree
Showing 77 changed files with 2,382 additions and 1,301 deletions.
13 changes: 13 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# The port the server will run on
PORT=4001

# The chain ID of the
CHAIN_ID=11155111
ALCHEMY_API_KEY=mock_alchemy_api_key
SUPABASE_DB_URL=http://localhost:54321
SUPABASE_SERVICE_API_KEY=test
BATCH_SIZE=10000
DELAY=5000
SENTRY_DSN="test"
SENTRY_ENVIRONMENT=testing
SENTRY_AUTH_TOKEN="test"
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"start": "node -r dotenv/config dist/server.js",
"lint": "next lint",
"test": "vitest",
"test:coverage": "vitest --coverage",
"reset:supabase:local": "npx supabase db reset",
"update:sentry:sourcemaps": "npx @sentry/wizard@latest -i sourcemaps",
"update:supabase:types": "npx supabase gen types typescript --local > src/types/database-generated.types.ts"
Expand All @@ -18,6 +19,7 @@
"license": "ISC",
"type": "module",
"devDependencies": {
"@anatine/zod-mock": "^3.13.4",
"@eslint/js": "^8.57.0",
"@faker-js/faker": "^8.4.1",
"@rollup/plugin-alias": "^5.1.0",
Expand All @@ -44,11 +46,13 @@
"rollup-plugin-polyfill-node": "^0.13.0",
"sinon": "^17.0.1",
"supertest": "^6.3.4",
"ts-mockito": "^2.6.1",
"tsx": "^4.7.1",
"typescript": "^5.3.3",
"typescript-eslint": "^7.0.2",
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.3.1"
"vitest": "^1.3.1",
"vitest-mock-extended": "^1.3.1"
},
"dependencies": {
"@hypercerts-org/sdk": "^1.4.3",
Expand All @@ -65,7 +69,7 @@
"lodash": "^4.17.21",
"luxon": "^3.4.4",
"type-fest": "^4.10.3",
"viem": "^2.9.19",
"viem": "^2.13.5",
"zod": "^3.23.6"
},
"packageManager": "[email protected]"
Expand Down
94 changes: 88 additions & 6 deletions pnpm-lock.yaml

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

11 changes: 6 additions & 5 deletions src/clients/evmClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,25 @@ const selectedNetwork = () => {
}
};

const alchemyUrl = (apiKey: string) => {
const alchemyUrl = () => {
switch (chainId) {
case 10:
return `https://opt-mainnet.g.alchemy.com/v2/${apiKey}`;
return `https://opt-mainnet.g.alchemy.com/v2/${alchemyApiKey}`;
case 84532:
return `https://base-sepolia.g.alchemy.com/v2/${apiKey}`;
return `https://base-sepolia.g.alchemy.com/v2/${alchemyApiKey}`;
case 11155111:
return `https://eth-sepolia.g.alchemy.com/v2/${apiKey}`;
return `https://eth-sepolia.g.alchemy.com/v2/${alchemyApiKey}`;
default:
throw new Error(`Unsupported chain ID: ${chainId}`);
}
};

/* Returns a PublicClient instance for the configured network. */
// @ts-ignose viem client type to complex to type
export const client = createPublicClient({
cacheTime: 10_000,
chain: selectedNetwork(),
transport: http(alchemyUrl(alchemyApiKey)),
transport: http(alchemyUrl()),
batch: {
multicall: {
wait: 32,
Expand Down
Loading

0 comments on commit 08c18b9

Please sign in to comment.