Skip to content

Commit

Permalink
Merge branch 'main' into rm-hf
Browse files Browse the repository at this point in the history
  • Loading branch information
bigint authored Feb 20, 2025
2 parents 7cc6f4f + 784a7dd commit 2a63df5
Show file tree
Hide file tree
Showing 279 changed files with 2,415 additions and 23,020 deletions.
2 changes: 0 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"mikestead.dotenv",
"biomejs.biome",
"GitHub.github-vscode-theme",
"NomicFoundation.hardhat-solidity",
"eamodio.gitlens",
"wix.vscode-import-cost",
"mquandalle.graphql",
"PKief.material-icon-theme",
"Prisma.prisma",
Expand Down
7 changes: 1 addition & 6 deletions apps/api/.env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
NEXT_PUBLIC_LENS_NETWORK="testnet"
DATABASE_URL=""
LENS_DATABASE_PASSWORD=""
SECRET="secret"
EVER_ACCESS_KEY=""
EVER_ACCESS_SECRET=""
PRIVATE_KEY="1d65a3183f35ecef73ce8f7d47920d58abdf3766debc2ff0b4c653b7633707fd" # Testnet private key without funds
AWS_ACCESS_KEY_ID=""
AWS_SECRET_ACCESS_KEY=""
SLACK_WEBHOOK_URL=""
OPENAI_API_KEY=""
6 changes: 0 additions & 6 deletions apps/api/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
declare namespace NodeJS {
interface ProcessEnv {
AWS_ACCESS_KEY_ID: string;
AWS_SECRET_ACCESS_KEY: string;
DATABASE_URL: string;
EVER_ACCESS_KEY: string;
EVER_ACCESS_SECRET: string;
LENS_DATABASE_PASSWORD: string;
PRIVATE_KEY: string;
SECRET: string;
SLACK_WEBHOOK_URL: string;
OPENAI_API_KEY: string;
}
}
14 changes: 5 additions & 9 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@
"typecheck": "tsc --pretty"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.749.0",
"@aws-sdk/client-sts": "^3.749.0",
"@hey/data": "workspace:*",
"@hey/db": "workspace:*",
"@hey/helpers": "workspace:*",
"@hey/indexer": "workspace:*",
"@json2csv/plainjs": "^7.0.6",
"@lens-protocol/metadata": "^1.2.0",
"apollo-utilities": "^1.3.4",
"axios": "^1.7.8",
Expand All @@ -26,17 +23,16 @@
"express-file-routing": "^3.0.3",
"express-rate-limit": "^7.5.0",
"express-session": "^1.18.1",
"fast-xml-parser": "^4.5.1",
"graphql": "^16.10.0",
"jose": "^5.10.0",
"linkedom": "^0.18.9",
"openai": "^4.85.1",
"openai": "^4.85.2",
"rate-limit-redis": "^4.2.0",
"request-ip": "^3.3.0",
"tsx": "^4.19.2",
"tsx": "^4.19.3",
"ua-parser-js": "2.0.2",
"urlcat": "^3.1.0",
"uuid": "^11.0.5",
"viem": "^2.23.2",
"uuid": "^11.1.0",
"viem": "^2.23.3",
"zod": "^3.24.2"
},
"devDependencies": {
Expand Down
3 changes: 0 additions & 3 deletions apps/api/src/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,3 @@ export const CACHE_AGE_1_DAY = "public, s-maxage=86400, max-age=86400";
// Cache indefinitely
export const CACHE_AGE_INDEFINITE =
"public, s-maxage=31536000, max-age=31536000, immutable";

// Tests
export const SITEMAP_BATCH_SIZE = 50000;
16 changes: 0 additions & 16 deletions apps/api/src/helpers/ens/resolverAbi.ts

This file was deleted.

29 changes: 0 additions & 29 deletions apps/api/src/helpers/lens/getRates.ts

This file was deleted.

6 changes: 4 additions & 2 deletions apps/api/src/helpers/middlewares/validateLensAccount.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { LENS_API_URL } from "@hey/data/constants";
import { Errors } from "@hey/data/errors";
import type { NextFunction, Request, Response } from "express";
import { createRemoteJWKSet, jwtVerify } from "jose";
import catchedError from "../catchedError";

const jwksUri = "https://api.testnet.lens.dev/.well-known/jwks.json";
const JWKS = createRemoteJWKSet(new URL(jwksUri));
const jwksUri = `${LENS_API_URL.replace("/graphql", "")}/.well-known/jwks.json`;
// Cache the JWKS for 12 hours
const JWKS = createRemoteJWKSet(new URL(jwksUri), { cacheMaxAge: 60 * 60 * 12 });

/**
* Middleware to validate Lens account
Expand Down
40 changes: 0 additions & 40 deletions apps/api/src/helpers/sitemap/buildSitemap.ts

This file was deleted.

40 changes: 0 additions & 40 deletions apps/api/src/helpers/slack.ts

This file was deleted.

This file was deleted.

8 changes: 2 additions & 6 deletions apps/api/src/routes/account/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,17 @@ export const get = [
.json({ result: JSON.parse(cachedData), success: true });
}

const [accountPermission, accountStatus] = await prisma.$transaction([
const [accountPermission] = await prisma.$transaction([
prisma.accountPermission.findFirst({
where: {
permissionId: PermissionId.Suspended,
accountAddress: address as string
}
}),
prisma.accountStatus.findUnique({
where: { accountAddress: address as string }
})
]);

const response: AccountDetails = {
isSuspended: accountPermission?.permissionId === PermissionId.Suspended,
status: accountStatus || null
isSuspended: accountPermission?.permissionId === PermissionId.Suspended
};

await setRedis(cacheKey, response);
Expand Down
30 changes: 0 additions & 30 deletions apps/api/src/routes/account/status/clear.ts

This file was deleted.

Loading

0 comments on commit 2a63df5

Please sign in to comment.