Skip to content

Commit

Permalink
Fix etherscan tsconfig file
Browse files Browse the repository at this point in the history
  • Loading branch information
0xaguspunk committed Jan 15, 2025
1 parent fecf4d9 commit 83c3500
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 37 deletions.
14 changes: 7 additions & 7 deletions typescript/packages/plugins/etherscan/src/etherscan.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ export class EtherscanService {
return etherscanRequest(
buildUrl(network, "account", "txlist", {
address,
startblock: startBlock,
endblock: endBlock,
page,
offset,
sort,
startblock: startBlock ?? "",
endblock: endBlock ?? "",
page: page ?? "",
offset: offset ?? "",
sort: sort ?? "",
}),
this.apiKey,
);
Expand Down Expand Up @@ -243,8 +243,8 @@ export class EtherscanService {
const { address, fromBlock, toBlock, topic0, topic1, topic2, topic3, network } = parameters;
const params: Record<string, string | number> = {
address,
fromBlock: typeof fromBlock === "number" ? `0x${fromBlock.toString(16)}` : fromBlock,
toBlock: typeof toBlock === "number" ? `0x${toBlock.toString(16)}` : toBlock,
fromBlock: typeof fromBlock === "number" ? `0x${fromBlock.toString(16)}` : (fromBlock ?? ""),
toBlock: typeof toBlock === "number" ? `0x${toBlock.toString(16)}` : (toBlock ?? ""),
};

if (topic0) params.topic0 = topic0;
Expand Down
20 changes: 3 additions & 17 deletions typescript/packages/plugins/etherscan/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"skipLibCheck": true,
"outDir": "./dist",
"rootDir": "./src"
},
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "../../../tsconfig.base.json",
"include": ["src/**/*"],
"references": [
{
"path": "../../core"
}
]
"exclude": ["node_modules", "dist"]
}
15 changes: 2 additions & 13 deletions typescript/packages/plugins/etherscan/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
import { defineConfig } from "tsup";
import { treeShakableConfig } from "../../../tsup.config.base";

export default defineConfig({
entry: [
"src/index.ts",
"src/etherscan.plugin.ts",
"src/etherscan.service.ts",
"src/parameters.ts",
"src/request.ts",
],
format: ["esm", "cjs"],
dts: true,
splitting: true,
sourcemap: true,
clean: true,
target: "es2022",
...treeShakableConfig,
});
11 changes: 11 additions & 0 deletions typescript/packages/plugins/etherscan/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"tasks": {
"build": {
"inputs": ["src/**", "tsup.config.ts", "!./**/*.test.{ts,tsx}", "tsconfig.json"],
"dependsOn": ["^build"],
"outputs": ["dist/**"]
}
}
}

0 comments on commit 83c3500

Please sign in to comment.