Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions packages/webui/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import tseslint from "typescript-eslint";

export default tseslint.config(
{
ignores: [
"dist/",
"node_modules/",
"wasm/",
"webpack.config.js",
"playwright.config.ts",
"scripts/",
"tests/",
],
},
tseslint.configs.recommended,
{
files: ["src/**/*.{ts,tsx}"],
languageOptions: {
parserOptions: {
project: ["./tsconfig.json"],
tsconfigRootDir: import.meta.dirname,
},
},
},
);
1 change: 1 addition & 0 deletions packages/webui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@bitgo/wasm-web-ui",
"version": "0.1.0",
"description": "Web frontend for BitGoWASM libraries",
"type": "module",
"repository": {
"type": "git",
"url": "git+https://github.com/BitGo/BitGoWASM.git"
Expand Down
8 changes: 6 additions & 2 deletions packages/webui/scripts/extract-samples.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
* Usage: node scripts/extract-samples.js
*/

const fs = require("fs");
const path = require("path");
import fs from "fs";
import path from "path";
import { fileURLToPath } from "url";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const FIXTURES_DIR = path.resolve(__dirname, "../src/fixtures/fixed-script");
const OUTPUT_FILE = path.resolve(__dirname, "../src/wasm-utxo/parser/samples.ts");
Expand Down
2 changes: 1 addition & 1 deletion packages/webui/src/lib/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let currentPath: string | null = null;
*/
export function parseHash(hash: string = location.hash): ParsedHash {
// Remove leading # if present
let hashContent = hash.startsWith("#") ? hash.slice(1) : hash;
const hashContent = hash.startsWith("#") ? hash.slice(1) : hash;

// Default to root path
if (!hashContent || hashContent === "/") {
Expand Down
2 changes: 1 addition & 1 deletion packages/webui/src/wasm-solana/transaction/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ class SolanaTransactionParser extends BaseComponent {
}

private share(): void {
copyToClipboard(location.href, this.$(".btn")!);
void copyToClipboard(location.href, this.$(".btn")!);
}

private clear(): void {
Expand Down
6 changes: 3 additions & 3 deletions packages/webui/src/wasm-utxo/addresses/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ class AddressConverter extends BaseComponent {
{
class: "copy-btn",
style: "margin-left: 0.5rem",
onclick: (e: Event) => copyToClipboard(hexString, e.target as HTMLElement),
onclick: (e: Event) => void copyToClipboard(hexString, e.target as HTMLElement),
},
"Copy",
),
Expand Down Expand Up @@ -569,7 +569,7 @@ class AddressConverter extends BaseComponent {
"button",
{
class: "copy-btn",
onclick: (e: Event) => copyToClipboard(outcome.address, e.target as HTMLElement),
onclick: (e: Event) => void copyToClipboard(outcome.address, e.target as HTMLElement),
},
"Copy",
),
Expand All @@ -595,7 +595,7 @@ class AddressConverter extends BaseComponent {
}

private share(): void {
copyToClipboard(location.href, this.$(".btn")!);
void copyToClipboard(location.href, this.$(".btn")!);
}

private clear(): void {
Expand Down
7 changes: 4 additions & 3 deletions packages/webui/src/wasm-utxo/parser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ function renderTreeNode(
class: "copy-btn",
onclick: (e: Event) => {
e.stopPropagation();
copyToClipboard(getFullValue(node.value), e.target as HTMLElement);
void copyToClipboard(getFullValue(node.value), e.target as HTMLElement);
},
},
"Copy",
Expand Down Expand Up @@ -1437,7 +1437,8 @@ class PsbtTxParser extends BaseComponent {
this.applyPsbtEdit();
} catch (e) {
if (errorEl) {
errorEl.replaceChildren(h("div", { class: "error-message" }, `${e}`));
const message = e instanceof Error ? e.message : String(e);
errorEl.replaceChildren(h("div", { class: "error-message" }, message));
}
}
}
Expand Down Expand Up @@ -1502,7 +1503,7 @@ class PsbtTxParser extends BaseComponent {
}

private share(): void {
copyToClipboard(location.href, this.$(".btn")!);
void copyToClipboard(location.href, this.$(".btn")!);
}

private clear(): void {
Expand Down
325 changes: 150 additions & 175 deletions packages/webui/src/wasm-utxo/parser/samples.ts

Large diffs are not rendered by default.

Loading
Loading