{hasRoute ? (
<>
Route found for shortcut. Click to run
{!!executionDetails?.approvals?.length && (
-
+
)}
-
+
>
diff --git a/playground/tsconfig.json b/playground/tsconfig.json
index 7801fdd..0f7b6c8 100644
--- a/playground/tsconfig.json
+++ b/playground/tsconfig.json
@@ -3,13 +3,14 @@
"compilerOptions": {
"paths": {
"@ensofinance/use-defi": [
- "../use-defi/src/index.ts"
+ "./use-defi/src/index.ts"
]
}
},
"include": [
"src",
- "../use-defi/src"
+ "../use-defi/src",
+ "vite.config.ts"
],
"references": [
{
diff --git a/tsconfig.json b/tsconfig.json
index 585d2d0..79513d9 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -21,6 +21,7 @@
"noUnusedLocals": true,
"emitDeclarationOnly": true,
"allowJs": true,
+ "composite": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"outDir": "./dist",
@@ -28,6 +29,7 @@
"vitest/globals"
],
},
+ "include": [],
"files": [],
"references": [
{
diff --git a/use-defi/.eslintrc.cjs b/use-defi/.eslintrc.cjs
index dff88cc..1cedd82 100644
--- a/use-defi/.eslintrc.cjs
+++ b/use-defi/.eslintrc.cjs
@@ -23,4 +23,10 @@ module.exports = {
'@typescript-eslint/no-explicit-any': ['warn'],
'@typescript-eslint/no-unsafe-assignment': 'off',
},
+ overrides: [
+ {
+ files: ['src/**/*.ts', 'test/**/*.ts'],
+ excludedFiles: ['.eslintrc.cjs', 'package.json'],
+ },
+ ],
};
diff --git a/use-defi/package.json b/use-defi/package.json
index 19054f8..6171d84 100644
--- a/use-defi/package.json
+++ b/use-defi/package.json
@@ -1,6 +1,6 @@
{
"name": "@ensofinance/use-defi",
- "version": "0.2.3",
+ "version": "0.2.4",
"description": "React hooks library to use with enso shortcuts infrastructure",
"main": "index.js",
"module": "index.esm.js",
diff --git a/use-defi/src/utils/fetch.ts b/use-defi/src/utils/fetch.ts
index 717ea74..7fbfb0d 100644
--- a/use-defi/src/utils/fetch.ts
+++ b/use-defi/src/utils/fetch.ts
@@ -1,11 +1,9 @@
-import { URLSearchParams } from 'url';
-
import { ENSO_API } from '../constants';
import { parseApiErrorOrReturn } from './parseApiError';
export const apiFetchGet = async (apiPath: string, qsParams: Record): Promise => {
- const response = await fetch(`${ENSO_API}/${apiPath}?${new URLSearchParams(qsParams).toString()}`);
+ const response = await fetch(`${ENSO_API}/${apiPath}?${new window.URLSearchParams(qsParams).toString()}`);
const data = await response.json();
return parseApiErrorOrReturn(data as T);
@@ -24,7 +22,7 @@ export const apiFetchPost = async (
headers.set('Authorization', `Bearer ${apiKey}`);
}
- const response = await fetch(`${ENSO_API}/${apiPath}?${new URLSearchParams(qsParams).toString()}`, {
+ const response = await fetch(`${ENSO_API}/${apiPath}?${new window.URLSearchParams(qsParams).toString()}`, {
method: 'POST',
headers,
body: body ? JSON.stringify(body) : undefined,
diff --git a/use-defi/tsconfig.json b/use-defi/tsconfig.json
index 56a6e12..4a5a177 100644
--- a/use-defi/tsconfig.json
+++ b/use-defi/tsconfig.json
@@ -1,7 +1,16 @@
{
"extends": "../tsconfig.json",
- "compilerOptions": {},
+ "compilerOptions": {
+ "paths": {
+ "@ensofinance/use-defi": [
+ "./use-defi/src/index.ts"
+ ]
+ }
+ },
"include": [
- "**/*.ts"
+ "src/**/*.ts",
+ "src/**/*.tsx",
+ "test/**/*.ts",
+ "vitest.config.ts"
]
}
\ No newline at end of file