Skip to content

Commit

Permalink
fix: invalid pair hash detection
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 committed Nov 2, 2024
1 parent cf67887 commit 37f5d19
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export default [
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-enum-comparison": "off",
"@typescript-eslint/prefer-promise-reject-errors": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "off",
},
},
Expand Down
3 changes: 1 addition & 2 deletions src/utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
SubmarinePairTypeTaproot,
} from "./boltzClient";
import { ECPair } from "./ecpair";
import { formatError } from "./errors";
import { ChainSwap, ReverseSwap, SomeSwap, SubmarineSwap } from "./swapCreator";

export const isIos = () =>
Expand Down Expand Up @@ -95,7 +94,7 @@ export const fetcher = async <T = unknown>(
const apiUrl = getApiUrl() + url;
const response = await fetch(apiUrl, opts);
if (!response.ok) {
return Promise.reject(new Error(formatError(response)));
return Promise.reject(response);
}
return (await response.json()) as T;
};
Expand Down
4 changes: 1 addition & 3 deletions src/utils/http.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { formatError } from "./errors";

export const checkResponse = <T = unknown>(response: Response): Promise<T> => {
if (!response.ok) {
return Promise.reject(new Error(formatError(response)));
return Promise.reject(response);
}
return response.json();
};

0 comments on commit 37f5d19

Please sign in to comment.