-
Notifications
You must be signed in to change notification settings - Fork 92
fix all biome errors #815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix all biome errors #815
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
--ignore-engines true | ||
--ignore-engines true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,7 @@ | |
"superjson": "^2.2.1", | ||
"thirdweb": "^5.71.0", | ||
"uuid": "^9.0.1", | ||
"viem": "^2.21.54", | ||
"winston": "^3.14.1", | ||
"zod": "^3.23.8" | ||
}, | ||
|
@@ -92,10 +93,6 @@ | |
"schema": "./src/prisma/schema.prisma" | ||
}, | ||
"resolutions": { | ||
"@thirdweb-dev/auth/**/axios": ">=1.7.8", | ||
"@thirdweb-dev/auth/**/web3-utils": ">=4.2.1", | ||
"ethers-gcp-kms-signer/**/protobufjs": ">=7.2.5", | ||
"fastify/**/find-my-way": ">=8.2.2", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are needed to pin versions that don't have reported vulnerabilities.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some of these may be removable since I only see the first two deps in this vuln report list. |
||
"@grpc/grpc-js": ">=1.8.22", | ||
"body-parser": ">=1.20.3", | ||
"cookie": ">=0.7.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import * as crypto from "node:crypto"; | ||
|
||
if (typeof globalThis.crypto === "undefined") { | ||
(globalThis as any).crypto = crypto; | ||
// @ts-expect-error | ||
globalThis.crypto = crypto; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { Type, type Static } from "@sinclair/typebox"; | ||
import { Value } from "@sinclair/typebox/value"; | ||
import { TransformDecodeError } from "@sinclair/typebox/value/transform"; | ||
import type { FastifyInstance } from "fastify"; | ||
import { StatusCodes } from "http-status-codes"; | ||
import { env } from "../../../../shared/utils/env"; | ||
|
@@ -47,15 +48,15 @@ const responseBodySchema = Type.Union([ | |
|
||
type RpcResponse = | ||
| { | ||
result: string; | ||
error: undefined; | ||
} | ||
result: string; | ||
error: undefined; | ||
} | ||
| { | ||
result: undefined; | ||
error: { | ||
message: string; | ||
}; | ||
}; | ||
result: undefined; | ||
error: { | ||
message: string; | ||
}; | ||
}; | ||
|
||
export async function sendSignedUserOp(fastify: FastifyInstance) { | ||
fastify.route<{ | ||
|
@@ -68,7 +69,7 @@ export async function sendSignedUserOp(fastify: FastifyInstance) { | |
schema: { | ||
summary: "Send a signed user operation", | ||
description: "Send a signed user operation", | ||
tags: ["Transaction"], | ||
tags: [ "Transaction" ], | ||
operationId: "sendSignedUserOp", | ||
params: walletChainParamSchema, | ||
body: requestBodySchema, | ||
|
@@ -86,10 +87,11 @@ export async function sendSignedUserOp(fastify: FastifyInstance) { | |
if (typeof signedUserOp === "string") { | ||
try { | ||
userOp = Value.Decode(UserOpString, signedUserOp); | ||
} catch (err: any) { | ||
} catch (err: unknown) { | ||
const msg = err instanceof TransformDecodeError ? err.message : err; | ||
return res.status(400).send({ | ||
error: { | ||
message: `Invalid signed user operation. - ${err.message || err}`, | ||
message: `Invalid signed user operation. - ${msg}`, | ||
}, | ||
}); | ||
} | ||
|
@@ -109,12 +111,14 @@ export async function sendSignedUserOp(fastify: FastifyInstance) { | |
id: 1, | ||
jsonrpc: "2.0", | ||
method: "eth_sendUserOperation", | ||
params: [userOp, entryPointAddress], | ||
params: [ userOp, entryPointAddress ], | ||
}), | ||
}); | ||
|
||
const { result: userOpHash, error } = | ||
(await userOpRes.json()) as RpcResponse; | ||
( | ||
await userOpRes.json() | ||
) as RpcResponse; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did biome format this? This seems weird and lower redability. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My biome corrects this back |
||
|
||
if (error) { | ||
return res.status(400).send({ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the implication of this one. cc @d4mr