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 }; -