Skip to content

Commit

Permalink
fix: merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kemuru committed Dec 6, 2024
2 parents d76ab8c + 04f2d8d commit 9fe795e
Show file tree
Hide file tree
Showing 107 changed files with 1,087 additions and 779 deletions.
7 changes: 5 additions & 2 deletions kleros-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kleros/kleros-sdk",
"version": "2.1.8",
"version": "2.1.10",
"description": "SDK for Kleros version 2",
"repository": "[email protected]:kleros/kleros-v2.git",
"homepage": "https://github.com/kleros/kleros-v2/tree/master/kleros-sdk#readme",
Expand Down Expand Up @@ -39,13 +39,16 @@
"rimraf": "^6.0.1",
"ts-node": "^10.9.2",
"typescript": "^5.6.3",
"viem": "^2.21.48",
"vitest": "^1.6.0"
},
"dependencies": {
"@reality.eth/reality-eth-lib": "^3.2.44",
"@urql/core": "^5.0.8",
"mustache": "^4.2.0",
"viem": "^2.21.48",
"zod": "^3.23.8"
},
"peerDependencies": {
"viem": "^2.21.48"
}
}
4 changes: 2 additions & 2 deletions web-devtools/src/assets/svgs/socialmedia/discord.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions web-devtools/src/assets/svgs/socialmedia/etherscan.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions web-devtools/src/assets/svgs/socialmedia/ghost-blog.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions web-devtools/src/assets/svgs/socialmedia/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions web-devtools/src/assets/svgs/socialmedia/linkedin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions web-devtools/src/assets/svgs/socialmedia/reddit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions web-devtools/src/assets/svgs/socialmedia/slack.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions web-devtools/src/assets/svgs/socialmedia/snapshot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions web-devtools/src/assets/svgs/socialmedia/youtube.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions web-devtools/src/utils/parseWagmiError.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { type SimulateContractErrorType } from "@wagmi/core";

type ExtendedWagmiError = SimulateContractErrorType & { shortMessage?: string; metaMessages?: string[] };

/**
* @param error
* @description Tries to extract the human readable error message, otherwise reverts to error.message
* @returns Human readable error if possible
*/
export const parseWagmiError = (error: SimulateContractErrorType) => {
const extError = error as ExtendedWagmiError;

const metaMessage = extError?.metaMessages?.[0];
const shortMessage = extError?.shortMessage;

return metaMessage ?? shortMessage ?? error.message;
};
6 changes: 4 additions & 2 deletions web-devtools/src/utils/wrapWithToast.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { toast, ToastPosition, Theme } from "react-toastify";
import { type PublicClient, type TransactionReceipt } from "viem";

import { parseWagmiError } from "./parseWagmiError";

export const OPTIONS = {
position: "top-center" as ToastPosition,
autoClose: 5000,
Expand Down Expand Up @@ -35,11 +37,11 @@ export async function wrapWithToast(
})
)
.catch((error) => {
toast.error(error.shortMessage ?? error.message, OPTIONS);
toast.error(parseWagmiError(error), OPTIONS);
return { status: false };
});
}

export async function catchShortMessage(promise: Promise<any>) {
return await promise.catch((error) => toast.error(error.shortMessage ?? error.message, OPTIONS));
return await promise.catch((error) => toast.error(parseWagmiError(error), OPTIONS));
}
Loading

0 comments on commit 9fe795e

Please sign in to comment.