Skip to content

Commit d04b01a

Browse files
committed
cleanup
1 parent 95e33a6 commit d04b01a

File tree

3 files changed

+2
-50
lines changed

3 files changed

+2
-50
lines changed

packages/explorer/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
"@radix-ui/react-popover": "^1.1.1",
5555
"@radix-ui/react-select": "^2.1.1",
5656
"@radix-ui/react-separator": "^1.1.0",
57-
"@radix-ui/react-slider": "^1.3.5",
5857
"@radix-ui/react-slot": "^1.1.0",
5958
"@radix-ui/react-tooltip": "^1.1.6",
6059
"@radix-ui/themes": "^3.0.5",

packages/explorer/src/app/(explorer)/[chainName]/worlds/[worldAddress]/interact/content/encodeFunctionArgs.ts

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,9 @@ export function encodeFunctionArgs(args: unknown[], inputs: AbiFunction): unknow
88
if (input.type.includes("[]")) return JSON.parse(arg as string);
99
if (input.type === "tuple") return JSON.parse(arg as string);
1010
if (input.type === "bool") return arg === "true";
11-
1211
if (input.type.startsWith("uint") || input.type.startsWith("int")) {
13-
const argStr = String(arg).trim();
14-
15-
// Handle values ending with "n" (BigInt notation)
16-
if (argStr.endsWith("n")) {
17-
const numericPart = argStr.slice(0, -1);
18-
return BigInt(numericPart);
19-
}
20-
21-
// Handle regular numeric strings
22-
if (argStr === "") return 0n;
23-
24-
// Remove any non-numeric characters except minus sign and decimal point
25-
const cleanArg = argStr.replace(/[^\d.-]/g, "");
26-
if (cleanArg === "" || cleanArg === "-" || cleanArg === ".") return 0n;
27-
28-
// Handle decimal numbers by truncating to integer
29-
if (cleanArg.includes(".")) {
30-
const [integerPart] = cleanArg.split(".");
31-
return BigInt(integerPart || "0");
32-
}
33-
34-
return BigInt(cleanArg);
12+
if (typeof arg === "string" && arg.endsWith("n")) return arg.slice(0, -1);
13+
return arg;
3514
}
3615

3716
return arg;

packages/explorer/src/components/ui/Slider.tsx

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)