From eb1a9c3c3e670290e28ad86e14ddae4c7cf7455d Mon Sep 17 00:00:00 2001 From: MananTank Date: Tue, 11 Nov 2025 23:20:42 +0000 Subject: [PATCH] Add callout for verifying webhook in dashboard and portal (#8396) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR enhances the `BridgeWebhookModalContent` component by adding a warning alert for payload verification and modifies the documentation for webhook creation and payload parsing to reflect changes in terminology and content structure. ### Detailed summary - Added `UnderlineLink` and `Alert` components to `webhooks.client.tsx`. - Introduced a warning alert regarding payload verification in the webhook modal. - Updated the version selection to only display for specific conditions. - Changed documentation headings and improved clarity on webhook creation and payload parsing. - Revised example payloads and verification instructions in the documentation. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- .../webhooks/components/webhooks.client.tsx | 65 ++++++++++++------- apps/portal/src/app/bridge/webhooks/page.mdx | 52 ++++++++++++--- 2 files changed, 87 insertions(+), 30 deletions(-) diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/webhooks/components/webhooks.client.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/webhooks/components/webhooks.client.tsx index 3f68cdb8aac..d6d7a719de5 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/webhooks/components/webhooks.client.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/payments/webhooks/components/webhooks.client.tsx @@ -2,9 +2,11 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; +import { UnderlineLink } from "@workspace/ui/components/UnderlineLink"; import { formatDistanceToNow } from "date-fns"; import { DotIcon, + InfoIcon, MoreVerticalIcon, PencilIcon, PlusIcon, @@ -25,6 +27,7 @@ import { updateWebhook, } from "@/api/universal-bridge/developer"; import { GenericLoadingPage } from "@/components/blocks/skeletons/GenericLoadingPage"; +import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; import { Button } from "@/components/ui/button"; import { CopyTextButton } from "@/components/ui/CopyTextButton"; import { Checkbox, CheckboxWithLabel } from "@/components/ui/checkbox"; @@ -435,28 +438,30 @@ function BridgeWebhookModalContent( )} /> - ( - - Version - - - Select the data format of the webhook payload (v2 recommended, - v1 for legacy users). - - - - )} - /> + {props.type === "edit" && props.webhook.version === 1 && ( + ( + + Version + + + Select the data format of the webhook payload (v2 recommended, + v1 for legacy users). + + + + )} + /> + )} {props.type === "create" && (
@@ -486,6 +491,22 @@ function BridgeWebhookModalContent(
)} + + + Verify payload before processing + + Make sure to verify receiver, destination chain, token address and + amount to ensure that it represents the expected state of the + transaction before processing it in your backend.{" "} + + Learn more + + + +