Skip to content

Commit 83c3500

Browse files
committed
Fix etherscan tsconfig file
1 parent fecf4d9 commit 83c3500

File tree

4 files changed

+23
-37
lines changed

4 files changed

+23
-37
lines changed

typescript/packages/plugins/etherscan/src/etherscan.service.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ export class EtherscanService {
7272
return etherscanRequest(
7373
buildUrl(network, "account", "txlist", {
7474
address,
75-
startblock: startBlock,
76-
endblock: endBlock,
77-
page,
78-
offset,
79-
sort,
75+
startblock: startBlock ?? "",
76+
endblock: endBlock ?? "",
77+
page: page ?? "",
78+
offset: offset ?? "",
79+
sort: sort ?? "",
8080
}),
8181
this.apiKey,
8282
);
@@ -243,8 +243,8 @@ export class EtherscanService {
243243
const { address, fromBlock, toBlock, topic0, topic1, topic2, topic3, network } = parameters;
244244
const params: Record<string, string | number> = {
245245
address,
246-
fromBlock: typeof fromBlock === "number" ? `0x${fromBlock.toString(16)}` : fromBlock,
247-
toBlock: typeof toBlock === "number" ? `0x${toBlock.toString(16)}` : toBlock,
246+
fromBlock: typeof fromBlock === "number" ? `0x${fromBlock.toString(16)}` : (fromBlock ?? ""),
247+
toBlock: typeof toBlock === "number" ? `0x${toBlock.toString(16)}` : (toBlock ?? ""),
248248
};
249249

250250
if (topic0) params.topic0 = topic0;
Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
{
2-
"extends": "../../../tsconfig.json",
3-
"compilerOptions": {
4-
"target": "ES2020",
5-
"module": "ESNext",
6-
"moduleResolution": "node",
7-
"experimentalDecorators": true,
8-
"emitDecoratorMetadata": true,
9-
"esModuleInterop": true,
10-
"skipLibCheck": true,
11-
"outDir": "./dist",
12-
"rootDir": "./src"
13-
},
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"extends": "../../../tsconfig.base.json",
144
"include": ["src/**/*"],
15-
"references": [
16-
{
17-
"path": "../../core"
18-
}
19-
]
5+
"exclude": ["node_modules", "dist"]
206
}
Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
import { defineConfig } from "tsup";
2+
import { treeShakableConfig } from "../../../tsup.config.base";
23

34
export default defineConfig({
4-
entry: [
5-
"src/index.ts",
6-
"src/etherscan.plugin.ts",
7-
"src/etherscan.service.ts",
8-
"src/parameters.ts",
9-
"src/request.ts",
10-
],
11-
format: ["esm", "cjs"],
12-
dts: true,
13-
splitting: true,
14-
sourcemap: true,
15-
clean: true,
16-
target: "es2022",
5+
...treeShakableConfig,
176
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://turbo.build/schema.json",
3+
"extends": ["//"],
4+
"tasks": {
5+
"build": {
6+
"inputs": ["src/**", "tsup.config.ts", "!./**/*.test.{ts,tsx}", "tsconfig.json"],
7+
"dependsOn": ["^build"],
8+
"outputs": ["dist/**"]
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)