Skip to content

Commit e7e2e5e

Browse files
committed
fix(sdk): stricter console checks
1 parent 6a885e6 commit e7e2e5e

File tree

4 files changed

+17
-22
lines changed

4 files changed

+17
-22
lines changed

packages/thirdweb/biome.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
"noProcessEnv": "warn"
88
},
99
"suspicious": {
10-
"noConsoleLog": "error"
10+
"noConsole": {
11+
"level": "error",
12+
"options": {
13+
"allow": ["error", "warn"]
14+
}
15+
}
1116
}
1217
}
1318
},
@@ -21,6 +26,16 @@
2126
}
2227
}
2328
}
29+
},
30+
{
31+
"include": ["src/cli/bin.ts", "src/cli/commands/**"],
32+
"linter": {
33+
"rules": {
34+
"suspicious": {
35+
"noConsole": "off"
36+
}
37+
}
38+
}
2439
}
2540
],
2641
"files": {

packages/thirdweb/src/wallets/smart/lib/bundler.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
formatUserOperationReceipt,
1818
} from "../types.js";
1919
import {
20-
DEBUG,
2120
ENTRYPOINT_ADDRESS_v0_6,
2221
MANAGED_ACCOUNT_GAS_BUFFER,
2322
getDefaultBundlerUrl,
@@ -267,10 +266,6 @@ async function sendBundlerRequest(args: {
267266
}) {
268267
const { options, operation, params } = args;
269268

270-
if (DEBUG) {
271-
console.debug(`>>> sending ${operation} with payload:`, params);
272-
}
273-
274269
const bundlerUrl = options.bundlerUrl ?? getDefaultBundlerUrl(options.chain);
275270
const fetchWithHeaders = getClientFetch(options.client);
276271
const response = await fetchWithHeaders(bundlerUrl, {
@@ -301,9 +296,5 @@ Code: ${code}`,
301296
);
302297
}
303298

304-
if (DEBUG) {
305-
console.debug(`<<< ${operation} result:`, res);
306-
}
307-
308299
return res.result;
309300
}

packages/thirdweb/src/wallets/smart/lib/constants.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import type { Chain } from "../../../chains/types.js";
22
import { getAddress } from "../../../utils/address.js";
33
import { getThirdwebDomains } from "../../../utils/domains.js";
44

5-
// dev only
6-
export const DEBUG = false;
7-
85
export const DUMMY_SIGNATURE =
96
"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c";
107

packages/thirdweb/src/wallets/smart/lib/paymaster.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ import type {
88
UserOperationV06,
99
UserOperationV07,
1010
} from "../types.js";
11-
import {
12-
DEBUG,
13-
ENTRYPOINT_ADDRESS_v0_6,
14-
getDefaultBundlerUrl,
15-
} from "./constants.js";
11+
import { ENTRYPOINT_ADDRESS_v0_6, getDefaultBundlerUrl } from "./constants.js";
1612
import { hexlifyUserOp } from "./utils.js";
1713

1814
/**
@@ -80,10 +76,6 @@ Code: ${code}`,
8076
);
8177
}
8278

83-
if (DEBUG) {
84-
console.debug("Paymaster result:", res);
85-
}
86-
8779
if (res.result) {
8880
// some paymasters return a string, some return an object with more data
8981
if (typeof res.result === "string") {

0 commit comments

Comments
 (0)