Skip to content

Commit 5ddd7d8

Browse files
run biome unsafe lint fix
1 parent 631870f commit 5ddd7d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+119
-121
lines changed

src/server/listeners/update-tx-listener.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ export const updateTxListener = async (): Promise<void> => {
1212
logger({
1313
service: "server",
1414
level: "info",
15-
message: `Listening for updated transactions`,
15+
message: "Listening for updated transactions",
1616
});
1717

1818
const connection = await knex.client.acquireConnection();
19-
connection.query(`LISTEN updated_transaction_data`);
19+
connection.query("LISTEN updated_transaction_data");
2020

2121
connection.on(
2222
"notification",
@@ -28,7 +28,7 @@ export const updateTxListener = async (): Promise<void> => {
2828
(sub) => sub.requestId === parsedPayload.id,
2929
);
3030

31-
if (index == -1) {
31+
if (index === -1) {
3232
return;
3333
}
3434

@@ -55,7 +55,7 @@ export const updateTxListener = async (): Promise<void> => {
5555
logger({
5656
service: "server",
5757
level: "info",
58-
message: `[updateTxListener] Connection database ended`,
58+
message: "[updateTxListener] Connection database ended",
5959
});
6060

6161
knex.client.releaseConnection(connection);
@@ -64,15 +64,15 @@ export const updateTxListener = async (): Promise<void> => {
6464
logger({
6565
service: "server",
6666
level: "info",
67-
message: `[updateTxListener] Released database connection on end`,
67+
message: "[updateTxListener] Released database connection on end",
6868
});
6969
});
7070

7171
connection.on("error", async (err: any) => {
7272
logger({
7373
service: "server",
7474
level: "error",
75-
message: `[updateTxListener] Database connection error`,
75+
message: "[updateTxListener] Database connection error",
7676
error: err,
7777
});
7878

@@ -82,7 +82,7 @@ export const updateTxListener = async (): Promise<void> => {
8282
logger({
8383
service: "worker",
8484
level: "info",
85-
message: `[updateTxListener] Released database connection on error`,
85+
message: "[updateTxListener] Released database connection on error",
8686
});
8787
});
8888
};

src/server/middleware/auth.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export async function withAuth(server: FastifyInstance) {
123123
}
124124
// Allow this request to proceed.
125125
return;
126-
} else if (error) {
126+
}if (error) {
127127
message = error;
128128
}
129129
} catch (err: any) {
@@ -172,11 +172,10 @@ export const onRequest = async ({
172172
const authWallet = await getAuthWallet();
173173
if (publicKey === (await authWallet.getAddress())) {
174174
return await handleAccessToken(jwt, req, getUser);
175-
} else if (publicKey === THIRDWEB_DASHBOARD_ISSUER) {
175+
}if (publicKey === THIRDWEB_DASHBOARD_ISSUER) {
176176
return await handleDashboardAuth(jwt);
177-
} else {
178-
return await handleKeypairAuth({ jwt, req, publicKey });
179177
}
178+
return await handleKeypairAuth({ jwt, req, publicKey });
180179
}
181180

182181
// Get the public key hash from the `kid` header.
@@ -383,7 +382,7 @@ const handleAccessToken = async (
383382

384383
try {
385384
token = await getAccessToken({ jwt });
386-
} catch (e) {
385+
} catch (_e) {
387386
// Missing or invalid signature. This will occur if the JWT not intended for this auth pattern.
388387
return { isAuthed: false };
389388
}

src/server/middleware/error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const isZodError = (err: unknown): boolean => {
5353

5454
export function withErrorHandler(server: FastifyInstance) {
5555
server.setErrorHandler(
56-
(error: string | Error | CustomError | ZodError, request, reply) => {
56+
(error: string | Error | CustomError | ZodError, _request, reply) => {
5757
if (typeof error === "string") {
5858
return reply.status(StatusCodes.INTERNAL_SERVER_ERROR).send({
5959
error: {

src/server/routes/auth/access-tokens/get-all.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export async function getAllAccessTokens(fastify: FastifyInstance) {
3434
[StatusCodes.OK]: responseBodySchema,
3535
},
3636
},
37-
handler: async (req, res) => {
37+
handler: async (_req, res) => {
3838
const accessTokens = await getAccessTokens();
3939
res.status(StatusCodes.OK).send({
4040
result: accessTokens.map((token) => ({

src/server/routes/auth/keypair/list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function listPublicKeys(fastify: FastifyInstance) {
2828
[StatusCodes.OK]: responseBodySchema,
2929
},
3030
},
31-
handler: async (req, res) => {
31+
handler: async (_req, res) => {
3232
const keypairs = await listKeypairs();
3333

3434
res.status(StatusCodes.OK).send({

src/server/routes/auth/permissions/get-all.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export async function getAllPermissions(fastify: FastifyInstance) {
3131
[StatusCodes.OK]: responseBodySchema,
3232
},
3333
},
34-
handler: async (req, res) => {
34+
handler: async (_req, res) => {
3535
const permissions = await prisma.permissions.findMany();
3636
res.status(StatusCodes.OK).send({
3737
result: permissions,

src/server/routes/backend-wallet/get-balance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export async function getBalance(fastify: FastifyInstance) {
5151
const chainId = await getChainIdFromChain(chain);
5252
const sdk = await getSdk({ chainId });
5353

54-
let balanceData = await sdk.getBalance(walletAddress);
54+
const balanceData = await sdk.getBalance(walletAddress);
5555

5656
reply.status(StatusCodes.OK).send({
5757
result: {

src/server/routes/backend-wallet/simulate-transaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export async function simulateTransaction(fastify: FastifyInstance) {
8686

8787
const chainId = await getChainIdFromChain(chain);
8888

89-
let queuedTransaction: QueuedTransaction = {
89+
const queuedTransaction: QueuedTransaction = {
9090
status: "queued",
9191
queueId: randomUUID(),
9292
queuedAt: new Date(),

src/server/routes/chain/get-all.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export async function getAllChainData(fastify: FastifyInstance) {
6363
[StatusCodes.OK]: responseSchema,
6464
},
6565
},
66-
handler: async (request, reply) => {
66+
handler: async (_request, reply) => {
6767
const allChains = (await fetchChains()) ?? [];
6868
const config = await getConfig();
6969

src/server/routes/configuration/auth/get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function getAuthConfiguration(fastify: FastifyInstance) {
2626
[StatusCodes.OK]: responseBodySchema,
2727
},
2828
},
29-
handler: async (req, res) => {
29+
handler: async (_req, res) => {
3030
const config = await getConfig();
3131
res.status(StatusCodes.OK).send({
3232
result: {

src/server/routes/configuration/backend-wallet-balance/get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export async function getBackendWalletBalanceConfiguration(
3030
[StatusCodes.OK]: responseBodySchema,
3131
},
3232
},
33-
handler: async (req, res) => {
33+
handler: async (_req, res) => {
3434
const config = await getConfig();
3535
res.status(StatusCodes.OK).send({
3636
result: {

src/server/routes/configuration/cache/get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function getCacheConfiguration(fastify: FastifyInstance) {
2626
[StatusCodes.OK]: responseBodySchema,
2727
},
2828
},
29-
handler: async (req, res) => {
29+
handler: async (_req, res) => {
3030
const config = await getConfig();
3131
res.status(StatusCodes.OK).send({
3232
result: {

src/server/routes/configuration/chains/get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function getChainsConfiguration(fastify: FastifyInstance) {
2525
[StatusCodes.OK]: responseBodySchema,
2626
},
2727
},
28-
handler: async (req, res) => {
28+
handler: async (_req, res) => {
2929
const config = await getConfig();
3030
const result: Static<typeof chainResponseSchema>[] = config.chainOverrides
3131
? JSON.parse(config.chainOverrides)

src/server/routes/configuration/contract-subscriptions/get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export async function getContractSubscriptionsConfiguration(
2929
[StatusCodes.OK]: responseSchema,
3030
},
3131
},
32-
handler: async (req, res) => {
32+
handler: async (_req, res) => {
3333
const config = await getConfig();
3434
res.status(StatusCodes.OK).send({
3535
result: {

src/server/routes/configuration/cors/get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function getCorsConfiguration(fastify: FastifyInstance) {
2525
[StatusCodes.OK]: responseBodySchema,
2626
},
2727
},
28-
handler: async (req, res) => {
28+
handler: async (_req, res) => {
2929
const config = await getConfig(false);
3030

3131
// Omit required domains.

src/server/routes/configuration/ip/get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export async function getIpAllowlist(fastify: FastifyInstance) {
2424
[StatusCodes.OK]: responseBodySchema,
2525
},
2626
},
27-
handler: async (req, res) => {
27+
handler: async (_req, res) => {
2828
const config = await getConfig(false);
2929

3030
res.status(StatusCodes.OK).send({

src/server/routes/configuration/transactions/get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export async function getTransactionConfiguration(fastify: FastifyInstance) {
3535
[StatusCodes.OK]: responseBodySchema,
3636
},
3737
},
38-
handler: async (req, res) => {
38+
handler: async (_req, res) => {
3939
const config = await getConfig();
4040
res.status(StatusCodes.OK).send({
4141
result: {

src/server/routes/contract/events/get-all-events.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export async function getAllEvents(fastify: FastifyInstance) {
8787
contractAddress,
8888
});
8989

90-
let returnData = await contract.events.getAllEvents({
90+
const returnData = await contract.events.getAllEvents({
9191
fromBlock,
9292
toBlock,
9393
order,

src/server/routes/contract/extensions/account-factory/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FastifyInstance } from "fastify";
1+
import type { FastifyInstance } from "fastify";
22
import { getAllAccounts } from "./read/get-all-accounts";
33
import { getAssociatedAccounts } from "./read/get-associated-accounts";
44
import { isAccountDeployed } from "./read/is-account-deployed";

src/server/routes/contract/extensions/account/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FastifyInstance } from "fastify";
1+
import type { FastifyInstance } from "fastify";
22
import { getAllAdmins } from "./read/get-all-admins";
33
import { getAllSessions } from "./read/get-all-sessions";
44
import { grantAdmin } from "./write/grant-admin";

src/server/routes/contract/metadata/abi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export async function getABI(fastify: FastifyInstance) {
8484
contractAddress,
8585
});
8686

87-
let returnData = contract.abi;
87+
const returnData = contract.abi;
8888

8989
reply.status(StatusCodes.OK).send({
9090
result: returnData,

src/server/routes/contract/metadata/events.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export async function extractEvents(fastify: FastifyInstance) {
8484
contractAddress,
8585
});
8686

87-
let returnData = await contract.publishedMetadata.extractEvents();
87+
const returnData = await contract.publishedMetadata.extractEvents();
8888

8989
reply.status(StatusCodes.OK).send({
9090
result: returnData,

src/server/routes/contract/metadata/extensions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export async function getContractExtensions(fastify: FastifyInstance) {
6464
contractAddress,
6565
});
6666

67-
let returnData = getAllDetectedExtensionNames(contract.abi);
67+
const returnData = getAllDetectedExtensionNames(contract.abi);
6868

6969
reply.status(StatusCodes.OK).send({
7070
result: returnData,

src/server/routes/contract/metadata/functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export async function extractFunctions(fastify: FastifyInstance) {
8181
contractAddress,
8282
});
8383

84-
let returnData = await contract.publishedMetadata.extractFunctions();
84+
const returnData = await contract.publishedMetadata.extractFunctions();
8585

8686
reply.status(StatusCodes.OK).send({
8787
result: returnData,

src/server/routes/contract/roles/read/get-all.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function getAllRoles(fastify: FastifyInstance) {
6262
contractAddress,
6363
});
6464

65-
let returnData = (await contract.roles.getAll()) as Static<
65+
const returnData = (await contract.roles.getAll()) as Static<
6666
typeof responseSchema
6767
>["result"];
6868

src/server/routes/contract/roles/read/get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export async function getRoles(fastify: FastifyInstance) {
5656
contractAddress,
5757
});
5858

59-
let returnData = await contract.roles.get(role);
59+
const returnData = await contract.roles.get(role);
6060

6161
reply.status(StatusCodes.OK).send({
6262
result: returnData,

src/server/routes/contract/subscriptions/add-contract-subscription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export async function addContractSubscription(fastify: FastifyInstance) {
132132
const provider = sdk.getProvider();
133133
const currentBlockNumber = await provider.getBlockNumber();
134134
await upsertChainIndexer({ chainId, currentBlockNumber });
135-
} catch (error) {
135+
} catch (_error) {
136136
// this is fine, must be already locked, so don't need to update current block as this will be recent
137137
}
138138
}

src/server/routes/contract/subscriptions/get-contract-subscriptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export async function getContractSubscriptions(fastify: FastifyInstance) {
4040
[StatusCodes.OK]: responseSchema,
4141
},
4242
},
43-
handler: async (request, reply) => {
43+
handler: async (_request, reply) => {
4444
const contractSubscriptions = await getAllContractSubscriptions();
4545

4646
reply.status(StatusCodes.OK).send({

src/server/routes/deploy/contract-types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Static, Type } from "@sinclair/typebox";
1+
import { type Static, Type } from "@sinclair/typebox";
22
import { PREBUILT_CONTRACTS_MAP } from "@thirdweb-dev/sdk";
3-
import { FastifyInstance } from "fastify";
3+
import type { FastifyInstance } from "fastify";
44
import { StatusCodes } from "http-status-codes";
55
import { standardResponseSchema } from "../../schemas/shared-api-schemas";
66

@@ -25,7 +25,7 @@ export async function contractTypes(fastify: FastifyInstance) {
2525
[StatusCodes.OK]: responseBodySchema,
2626
},
2727
},
28-
handler: async (request, reply) => {
28+
handler: async (_request, reply) => {
2929
reply.status(StatusCodes.OK).send({
3030
result: Object.keys(PREBUILT_CONTRACTS_MAP),
3131
});

src/server/routes/deploy/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FastifyInstance } from "fastify";
1+
import type { FastifyInstance } from "fastify";
22
import { deployPrebuiltEdition } from "./prebuilts/edition";
33
import { deployPrebuiltEditionDrop } from "./prebuilts/edition-drop";
44
import { deployPrebuiltMarketplaceV3 } from "./prebuilts/marketplace-v3";

src/server/routes/deploy/prebuilt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const requestBodySchema = Type.Object({
2929
requestBodySchema.examples = [
3030
{
3131
contractMetadata: {
32-
name: `My Contract`,
32+
name: "My Contract",
3333
description: "Contract deployed from thirdweb Engine",
3434
primary_sale_recipient: "0x1946267d81Fb8aDeeEa28e6B98bcD446c8248473",
3535
seller_fee_basis_points: 500,

src/server/routes/relayer/get-all.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export async function getAllRelayers(fastify: FastifyInstance) {
3232
[StatusCodes.OK]: responseBodySchema,
3333
},
3434
},
35-
handler: async (req, res) => {
35+
handler: async (_req, res) => {
3636
const relayers = await prisma.relayers.findMany();
3737

3838
return res.status(StatusCodes.OK).send({

src/server/routes/relayer/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export async function relayTransaction(fastify: FastifyInstance) {
157157
},
158158
});
159159
return;
160-
} else if (req.body.type === "permit") {
160+
}if (req.body.type === "permit") {
161161
// EIP-2612
162162
const { request, signature } = req.body;
163163
const { v, r, s } = utils.splitSignature(signature);

src/server/routes/system/queue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function queueStatus(fastify: FastifyInstance) {
4242
[StatusCodes.OK]: responseBodySchema,
4343
},
4444
},
45-
handler: async (req, res) => {
45+
handler: async (_req, res) => {
4646
// Get # queued and sent transactions.
4747
const queued = await SendTransactionQueue.length();
4848
const pending = await MineTransactionQueue.length();

src/server/routes/transaction/blockchain/get-user-op-receipt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export async function getUserOpReceipt(fastify: FastifyInstance) {
104104
reply.status(StatusCodes.OK).send({
105105
result: json.result,
106106
});
107-
} catch (e) {
107+
} catch (_e) {
108108
throw createCustomError(
109109
"Unable to get receipt.",
110110
StatusCodes.INTERNAL_SERVER_ERROR,

src/server/routes/transaction/cancel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export async function cancelTransaction(fastify: FastifyInstance) {
8080
);
8181
}
8282

83-
let message = "Transaction successfully cancelled.";
83+
const message = "Transaction successfully cancelled.";
8484
let cancelledTransaction: CancelledTransaction | null = null;
8585
if (!transaction.isUserOp) {
8686
if (transaction.status === "queued") {

0 commit comments

Comments
 (0)