From bb8ec93db140bf46460568aabe28bc5ae3dcda1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CSebastian?= <64795732+slegarraga@users.noreply.github.com> Date: Thu, 11 Jun 2026 11:38:33 -0400 Subject: [PATCH] Fix build typings and default API URL --- package.json | 3 ++- src/index.ts | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ff5aa96..5220518 100644 --- a/package.json +++ b/package.json @@ -40,8 +40,9 @@ "zod": ">=3.0.0" }, "devDependencies": { + "@types/node": "^20.11.0", "ai": "^3.4.0", "typescript": "^5.3.0", "zod": "^3.22.0" } -} \ No newline at end of file +} diff --git a/src/index.ts b/src/index.ts index cc104d9..3df7704 100644 --- a/src/index.ts +++ b/src/index.ts @@ -38,9 +38,9 @@ interface HashlockConfig { } function getConfig(config?: HashlockConfig) { - const apiUrl = (config?.apiUrl || process.env.HASHLOCK_API_URL || "").replace(/\/+$/, ""); + const apiUrl = (config?.apiUrl || process.env.HASHLOCK_API_URL || "https://api.hashlock.markets").replace(/\/+$/, ""); const apiKey = config?.apiKey || process.env.HASHLOCK_API_KEY || ""; - if (!apiUrl || !apiKey) throw new Error("Missing HASHLOCK_API_URL or HASHLOCK_API_KEY"); + if (!apiKey) throw new Error("Missing HASHLOCK_API_KEY"); return { apiUrl, apiKey }; } @@ -130,4 +130,3 @@ export function hashlockTools(config?: HashlockConfig) { export { hashlockPost, getConfig }; export type { HashlockConfig }; -